@redocly/mock-server 0.2.12 → 0.2.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/bin.js +6 -6
  2. package/package.json +3 -4
package/dist/bin.js CHANGED
@@ -190,20 +190,20 @@ ${o.commentBefore}`:s}e.comment=r.after.join(`
190
190
  `)||null}}function DK({tagPrefixes:e},t){let[r,n]=t.parameters;if(!r||!n){let i="Insufficient parameters given for %TAG directive";throw new Lt.YAMLSemanticError(t,i)}if(e.some(i=>i.handle===r)){let i="The %TAG directive must only be given at most once per handle in the same document.";throw new Lt.YAMLSemanticError(t,i)}return{handle:r,prefix:n}}function FK(e,t){let[r]=t.parameters;if(t.name==="YAML:1.0"&&(r="1.0"),!r){let n="Insufficient parameters given for %YAML directive";throw new Lt.YAMLSemanticError(t,n)}if(!tA[r]){let i=`Document will be parsed as YAML ${e.version||e.options.version} rather than YAML ${r}`;e.warnings.push(new Lt.YAMLWarning(t,i))}return r}function BK(e,t,r){let n=[],i=!1;for(let s of t){let{comment:o,name:a}=s;switch(a){case"TAG":try{e.tagPrefixes.push(DK(e,s))}catch(c){e.errors.push(c)}i=!0;break;case"YAML":case"YAML:1.0":if(e.version){let c="The %YAML directive must only be given at most once per document.";e.errors.push(new Lt.YAMLSemanticError(s,c))}try{e.version=FK(e,s)}catch(c){e.errors.push(c)}i=!0;break;default:if(a){let c=`YAML only supports %TAG and %YAML directives, and not %${a}`;e.warnings.push(new Lt.YAMLWarning(s,c))}}o&&n.push(o)}if(r&&!i&&(e.version||r.version||e.options.version)==="1.1"){let s=({handle:o,prefix:a})=>({handle:o,prefix:a});e.tagPrefixes=r.tagPrefixes.map(s),e.version=r.version}e.commentBefore=n.join(`
191
191
  `)||null}function vo(e){if(e instanceof te.Collection)return!0;throw new Error("Expected a YAML collection as document contents")}var dp=class e{constructor(t){this.anchors=new i0(t.anchorPrefix),this.commentBefore=null,this.comment=null,this.contents=null,this.directivesEndMarker=null,this.errors=[],this.options=t,this.schema=null,this.tagPrefixes=[],this.version=null,this.warnings=[]}add(t){return vo(this.contents),this.contents.add(t)}addIn(t,r){vo(this.contents),this.contents.addIn(t,r)}delete(t){return vo(this.contents),this.contents.delete(t)}deleteIn(t){return te.isEmptyPath(t)?this.contents==null?!1:(this.contents=null,!0):(vo(this.contents),this.contents.deleteIn(t))}getDefaults(){return e.defaults[this.version]||e.defaults[this.options.version]||{}}get(t,r){return this.contents instanceof te.Collection?this.contents.get(t,r):void 0}getIn(t,r){return te.isEmptyPath(t)?!r&&this.contents instanceof te.Scalar?this.contents.value:this.contents:this.contents instanceof te.Collection?this.contents.getIn(t,r):void 0}has(t){return this.contents instanceof te.Collection?this.contents.has(t):!1}hasIn(t){return te.isEmptyPath(t)?this.contents!==void 0:this.contents instanceof te.Collection?this.contents.hasIn(t):!1}set(t,r){vo(this.contents),this.contents.set(t,r)}setIn(t,r){te.isEmptyPath(t)?this.contents=r:(vo(this.contents),this.contents.setIn(t,r))}setSchema(t,r){if(!t&&!r&&this.schema)return;typeof t=="number"&&(t=t.toFixed(1)),t==="1.0"||t==="1.1"||t==="1.2"?(this.version?this.version=t:this.options.version=t,delete this.options.schema):t&&typeof t=="string"&&(this.options.schema=t),Array.isArray(r)&&(this.options.customTags=r);let n=Object.assign({},this.getDefaults(),this.options);this.schema=new ZE.Schema(n)}parse(t,r){this.options.keepCstNodes&&(this.cstNode=t),this.options.keepNodeTypes&&(this.type="DOCUMENT");let{directives:n=[],contents:i=[],directivesEndMarker:s,error:o,valueRange:a}=t;if(o&&(o.source||(o.source=this),this.errors.push(o)),BK(this,n,r),s&&(this.directivesEndMarker=!0),this.range=a?[a.start,a.end]:null,this.setSchema(),this.anchors._cstAliases=[],LK(this,i),this.anchors.resolveNodes(),this.options.prettyErrors){for(let c of this.errors)c instanceof Lt.YAMLError&&c.makePretty();for(let c of this.warnings)c instanceof Lt.YAMLError&&c.makePretty()}return this}listNonDefaultTags(){return MK(this.contents).filter(t=>t.indexOf(ZE.Schema.defaultPrefix)!==0)}setTagPrefix(t,r){if(t[0]!=="!"||t[t.length-1]!=="!")throw new Error("Handle must start and end with !");if(r){let n=this.tagPrefixes.find(i=>i.handle===t);n?n.prefix=r:this.tagPrefixes.push({handle:t,prefix:r})}else this.tagPrefixes=this.tagPrefixes.filter(n=>n.handle!==t)}toJSON(t,r){let{keepBlobsInJSON:n,mapAsMap:i,maxAliasCount:s}=this.options,o=n&&(typeof t!="string"||!(this.contents instanceof te.Scalar)),a={doc:this,indentStep:" ",keep:o,mapAsMap:o&&!!i,maxAliasCount:s,stringify:pp},c=Object.keys(this.anchors.map);c.length>0&&(a.anchors=new Map(c.map(u=>[this.anchors.map[u],{alias:[],aliasCount:0,count:1}])));let l=te.toJSON(this.contents,t,a);if(typeof r=="function"&&a.anchors)for(let{count:u,res:p}of a.anchors.values())r(p,u);return l}toString(){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");let t=this.options.indent;if(!Number.isInteger(t)||t<=0){let c=JSON.stringify(t);throw new Error(`"indent" option must be a positive integer, not ${c}`)}this.setSchema();let r=[],n=!1;if(this.version){let c="%YAML 1.2";this.schema.name==="yaml-1.1"&&(this.version==="1.0"?c="%YAML:1.0":this.version==="1.1"&&(c="%YAML 1.1")),r.push(c),n=!0}let i=this.listNonDefaultTags();this.tagPrefixes.forEach(({handle:c,prefix:l})=>{i.some(u=>u.indexOf(l)===0)&&(r.push(`%TAG ${c} ${l}`),n=!0)}),(n||this.directivesEndMarker)&&r.push("---"),this.commentBefore&&((n||!this.directivesEndMarker)&&r.unshift(""),r.unshift(this.commentBefore.replace(/^/gm,"#")));let s={anchors:Object.create(null),doc:this,indent:"",indentStep:" ".repeat(t),stringify:pp},o=!1,a=null;if(this.contents){this.contents instanceof te.Node&&(this.contents.spaceBefore&&(n||this.directivesEndMarker)&&r.push(""),this.contents.commentBefore&&r.push(this.contents.commentBefore.replace(/^/gm,"#")),s.forceBlockIndent=!!this.comment,a=this.contents.comment);let c=a?null:()=>o=!0,l=pp(this.contents,s,()=>a=null,c);r.push(te.addComment(l,"",a))}else this.contents!==void 0&&r.push(pp(this.contents,s));return this.comment&&((!o||a)&&r[r.length-1]!==""&&r.push(""),r.push(this.comment.replace(/^/gm,"#"))),r.join(`
192
192
  `)+`
193
- `}};Lt._defineProperty(dp,"defaults",tA);mp.Document=dp;mp.defaultOptions=NK;mp.scalarOptions=IK});var sA=v(iA=>{"use strict";var s0=OE(),as=rA(),VK=n0(),UK=ts(),zK=Zg();uc();function HK(e,t=!0,r){r===void 0&&typeof t=="string"&&(r=t,t=!0);let n=Object.assign({},as.Document.defaults[as.defaultOptions.version],as.defaultOptions);return new VK.Schema(n).createNode(e,t,r)}var wo=class extends as.Document{constructor(t){super(Object.assign({},as.defaultOptions,t))}};function KK(e,t){let r=[],n;for(let i of s0.parse(e)){let s=new wo(t);s.parse(i,n),r.push(s),n=s}return r}function nA(e,t){let r=s0.parse(e),n=new wo(t).parse(r[0]);if(r.length>1){let i="Source contains multiple documents; please use YAML.parseAllDocuments()";n.errors.unshift(new UK.YAMLSemanticError(r[1],i))}return n}function WK(e,t){let r=nA(e,t);if(r.warnings.forEach(n=>zK.warn(n)),r.errors.length>0)throw r.errors[0];return r.toJSON()}function YK(e,t){let r=new wo(t);return r.contents=e,String(r)}var GK={createNode:HK,defaultOptions:as.defaultOptions,Document:wo,parse:WK,parseAllDocuments:KK,parseCST:s0.parse,parseDocument:nA,scalarOptions:as.scalarOptions,stringify:YK};iA.YAML=GK});var o0=v((kye,oA)=>{oA.exports=sA().YAML});var mc=v((Nye,cA)=>{"use strict";function JK(e){return e.replace(/\~/g,"~0").replace(/\//g,"~1")}function aA(e){return e.replace(/\~1/g,"/").replace(/~0/g,"~")}function XK(e,t,r){if(typeof e>"u")return!1;if(!t||typeof t!="string"||t==="#")return typeof r<"u"?r:e;if(t.indexOf("#")>=0){let i=t.split("#");if(i[0])return!1;t=i[1],t=decodeURIComponent(t.slice(1).split("+").join(" "))}t.startsWith("/")&&(t=t.slice(1));let n=t.split("/");for(let i=0;i<n.length;i++){n[i]=aA(n[i]);let s=typeof r<"u"&&i==n.length-1,o=parseInt(n[i],10);if(!Array.isArray(e)||isNaN(o)||o.toString()!==n[i]?o=Array.isArray(e)&&n[i]==="-"?-2:-1:n[i]=i>0?n[i-1]:"",o!=-1||e&&e.hasOwnProperty(n[i]))if(o>=0)s&&(e[o]=r),e=e[o];else{if(o===-2)return s?(Array.isArray(e)&&e.push(r),r):void 0;s&&(e[n[i]]=r),e=e[n[i]]}else if(typeof r<"u"&&typeof e=="object"&&!Array.isArray(e))e[n[i]]=s?r:n[i+1]==="0"||n[i+1]==="-"?[]:{},e=e[n[i]];else return!1}return e}cA.exports={jptr:XK,jpescape:JK,jpunescape:aA}});var hp=v((Iye,lA)=>{"use strict";function QK(e,t){return t==="$ref"&&!!e&&typeof e[t]=="string"}lA.exports={isRef:QK}});var hc=v((qye,fA)=>{"use strict";function ZK(e){return e}function eW(e){return JSON.parse(JSON.stringify(e))}function tW(e){let t={};for(let r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);return t}function uA(e){let t=Array.isArray(e)?[]:{};for(let r in e)(e.hasOwnProperty(r)||Array.isArray(e))&&(t[r]=typeof e[r]=="object"?uA(e[r]):e[r]);return t}function rW(e){return Object.assign({},e)}function pA(e,t){if(t||(t=new WeakMap),Object(e)!==e||e instanceof Function)return e;if(t.has(e))return t.get(e);try{var r=new e.constructor}catch{r=Object.create(Object.getPrototypeOf(e))}return t.set(e,r),Object.assign(r,...Object.keys(e).map(n=>({[n]:pA(e[n],t)})))}fA.exports={nop:ZK,clone:eW,shallowClone:tW,deepClone:uA,fastClone:rW,circularClone:pA}});var yp=v((jye,mA)=>{"use strict";var nW=mc().jpescape;function iW(){return{path:"#",depth:0,pkey:"",parent:{},payload:{},seen:new WeakMap,identity:!1,identityDetection:!1}}function dA(e,t,r){if(t||(t={depth:0}),t.depth||(t=Object.assign({},iW(),t)),typeof e!="object")return;let n=t.path;for(let i in e){if(t.key=i,t.path=t.path+"/"+encodeURIComponent(nW(i)),t.identityPath=t.seen.get(e[i]),t.identity=typeof t.identityPath<"u",e.hasOwnProperty(i)&&r(e,i,t),typeof e[i]=="object"&&!t.identity){t.identityDetection&&!Array.isArray(e[i])&&e[i]!==null&&t.seen.set(e[i],t.path);let s={};s.parent=e,s.path=t.path,s.depth=t.depth?t.depth+1:1,s.pkey=i,s.payload=t.payload,s.seen=t.seen,s.identity=!1,s.identityDetection=t.identityDetection,dA(e[i],s,r)}t.path=n}}mA.exports={recurse:dA}});var bA=v((Mye,gA)=>{"use strict";var sW=yp().recurse,hA=hc().shallowClone,yc=mc().jptr,oW=hp().isRef,aW=function(e){return e&&e.verbose?{warn:function(){var t=Array.prototype.slice.call(arguments);console.warn.apply(console,t)}}:{warn:function(){}}};function yA(e,t,r){r||(r={}),r.cache||(r.cache={}),r.state||(r.state={}),r.state.identityDetection=!0,r.depth=r.depth?r.depth+1:1;let n=r.depth>1?e:hA(e),i={data:n},s=r.depth>1?t:hA(t);r.master||(r.master=n);let o=aW(r),a=1;for(;a>0;)a=0,sW(i,r.state,function(c,l,u){if(oW(c,l)){let p=c[l];if(a++,r.cache[p]){let d=r.cache[p];if(d.resolved)o.warn("Patching %s for %s",p,d.path),u.parent[u.pkey]=d.data,r.$ref&&typeof u.parent[u.pkey]=="object"&&u.parent[u.pkey]!==null&&(u.parent[u.pkey][r.$ref]=p);else{if(p===d.path)throw new Error(`Tight circle at ${d.path}`);o.warn("Unresolved ref"),u.parent[u.pkey]=yc(d.source,d.path),u.parent[u.pkey]===!1&&(u.parent[u.pkey]=yc(d.source,d.key)),r.$ref&&typeof u.parent[u.pkey]=="object"&&u.parent[u.pkey]!==null&&(u.parent[r.$ref]=p)}}else{let d={};d.path=u.path.split("/$ref")[0],d.key=p,o.warn("Dereffing %s at %s",p,d.path),d.source=s,d.data=yc(d.source,d.key),d.data===!1&&(d.data=yc(r.master,d.key),d.source=r.master),d.data===!1&&o.warn("Missing $ref target",d.key),r.cache[p]=d,d.data=u.parent[u.pkey]=yA(yc(d.source,d.key),d.source,r),r.$ref&&typeof u.parent[u.pkey]=="object"&&u.parent[u.pkey]!==null&&(u.parent[u.pkey][r.$ref]=p),d.resolved=!0}}});return i.data}gA.exports={dereference:yA}});var OA=v((Lye,_A)=>{_A.exports=gc;gc.default=gc;gc.stable=xA;gc.stableStringify=xA;var gp="[...]",vA="[Circular]",ls=[],cs=[];function wA(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function gc(e,t,r,n){typeof n>"u"&&(n=wA()),a0(e,"",0,[],void 0,0,n);var i;try{cs.length===0?i=JSON.stringify(e,t,r):i=JSON.stringify(e,SA(t),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;ls.length!==0;){var s=ls.pop();s.length===4?Object.defineProperty(s[0],s[1],s[3]):s[0][s[1]]=s[2]}}return i}function xo(e,t,r,n){var i=Object.getOwnPropertyDescriptor(n,r);i.get!==void 0?i.configurable?(Object.defineProperty(n,r,{value:e}),ls.push([n,r,t,i])):cs.push([t,r,e]):(n[r]=e,ls.push([n,r,t]))}function a0(e,t,r,n,i,s,o){s+=1;var a;if(typeof e=="object"&&e!==null){for(a=0;a<n.length;a++)if(n[a]===e){xo(vA,e,t,i);return}if(typeof o.depthLimit<"u"&&s>o.depthLimit){xo(gp,e,t,i);return}if(typeof o.edgesLimit<"u"&&r+1>o.edgesLimit){xo(gp,e,t,i);return}if(n.push(e),Array.isArray(e))for(a=0;a<e.length;a++)a0(e[a],a,a,n,e,s,o);else{var c=Object.keys(e);for(a=0;a<c.length;a++){var l=c[a];a0(e[l],l,a,n,e,s,o)}}n.pop()}}function cW(e,t){return e<t?-1:e>t?1:0}function xA(e,t,r,n){typeof n>"u"&&(n=wA());var i=c0(e,"",0,[],void 0,0,n)||e,s;try{cs.length===0?s=JSON.stringify(i,t,r):s=JSON.stringify(i,SA(t),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;ls.length!==0;){var o=ls.pop();o.length===4?Object.defineProperty(o[0],o[1],o[3]):o[0][o[1]]=o[2]}}return s}function c0(e,t,r,n,i,s,o){s+=1;var a;if(typeof e=="object"&&e!==null){for(a=0;a<n.length;a++)if(n[a]===e){xo(vA,e,t,i);return}try{if(typeof e.toJSON=="function")return}catch{return}if(typeof o.depthLimit<"u"&&s>o.depthLimit){xo(gp,e,t,i);return}if(typeof o.edgesLimit<"u"&&r+1>o.edgesLimit){xo(gp,e,t,i);return}if(n.push(e),Array.isArray(e))for(a=0;a<e.length;a++)c0(e[a],a,a,n,e,s,o);else{var c={},l=Object.keys(e).sort(cW);for(a=0;a<l.length;a++){var u=l[a];c0(e[u],u,a,n,e,s,o),c[u]=e[u]}if(typeof i<"u")ls.push([i,t,e]),i[t]=c;else return c}n.pop()}}function SA(e){return e=typeof e<"u"?e:function(t,r){return r},function(t,r){if(cs.length>0)for(var n=0;n<cs.length;n++){var i=cs[n];if(i[1]===t&&i[0]===r){r=i[2],cs.splice(n,1);break}}return e.call(this,t,r)}}});var l0=v((Dye,EA)=>{"use strict";var PA=OA(),lW=process.env.NODE_DISABLE_COLORS?{red:"",yellow:"",green:"",normal:""}:{red:"\x1B[31m",yellow:"\x1B[33;1m",green:"\x1B[32m",normal:"\x1B[0m"};function uW(e,t,r){return r.indexOf(e)===t}function pW(e){return new Set(e).size!==e.length}function fW(e){return new Set(e).size<=1}function dW(e,t){function r(n,i){return PA.stringify(n)===PA.stringify(Object.assign({},n,i))}return r(e,t)&&r(t,e)}function mW(e){let t=[];for(let r of e)t.find(function(i,s,o){return dW(i,r)})||t.push(r);return t}function hW(e){return e.length===mW(e).length}function yW(e){return e.find(function(t,r,n){return e.indexOf(t)<r})}function gW(e){let t=0,r;if(e.length===0)return t;for(let n=0;n<e.length;n++)r=e.charCodeAt(n),t=(t<<5)-t+r,t|=0;return t}String.prototype.toCamelCase=function(){return this.toLowerCase().replace(/[-_ \/\.](.)/g,function(t,r){return r.toUpperCase()})};var bW=["format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","minLength","maxLength","multipleOf","minItems","maxItems","uniqueItems","minProperties","maxProperties","additionalProperties","pattern","enum","default"],vW=["items","minItems","maxItems","uniqueItems"],wW=["get","post","put","delete","patch","head","options","trace"];function $A(e){e=e.replace("[]","Array");let t=e.split("/");return t[0]=t[0].replace(/[^A-Za-z0-9_\-\.]+|\s+/gm,"_"),t.join("/")}function xW(e){return $A(e.split("/").join("_"))}EA.exports={colour:lW,uniqueOnly:uW,hasDuplicates:pW,allSame:fW,distinctArray:hW,firstDupe:yW,hash:gW,parameterTypeProperties:bW,arrayProperties:vW,httpMethods:wW,sanitise:$A,sanitiseAll:xW}});var NA=v((Fye,kA)=>{"use strict";var SW=require("fs"),TA=require("path"),us=require("url"),_W=Cg(),AA=o0(),So=mc().jptr,_o=yp().recurse,li=hc().clone,OW=bA().dereference,vp=hp().isRef,ar=l0();function PW(e){return[...new Set(e)]}function $W(e,t,r,n,i){return new Promise(function(s,o){SW.readFile(e,t,function(a,c){a?r.ignoreIOErrors&&i?(r.verbose&&console.warn("FAILED",n),r.externalRefs[n].failed=!0,s(i)):o(a):s(c)})})}function u0(e,t,r,n,i,s){let o=s.externalRefs[r+n].paths[0],a=us.parse(i),c={},l=1;for(;l;)l=0,_o(e,{identityDetection:!0},function(u,p,d){if(vp(u,p)){if(u[p].startsWith("#")){if(!c[u[p]]&&!u.$fixed){let m=li(So(t,u[p]));if(s.verbose>1&&console.warn((m===!1?ar.colour.red:ar.colour.green)+"Fragment resolution",u[p],ar.colour.normal),m===!1){if(d.parent[d.pkey]={},s.fatal){let f=new Error("Fragment $ref resolution failed "+u[p]);if(s.promise)s.promise.reject(f);else throw f}}else l++,d.parent[d.pkey]=m,c[u[p]]=d.path.replace("/%24ref","")}else if(!u.$fixed){let m=(o+"/"+c[u[p]]).split("/#/").join("/");d.parent[d.pkey]={$ref:m,"x-miro":u[p],$fixed:!0},s.verbose>1&&console.warn("Replacing with",m),l++}}else if(a.protocol){let m=us.resolve(i,u[p]).toString();s.verbose>1&&console.warn(ar.colour.yellow+"Rewriting external url ref",u[p],"as",m,ar.colour.normal),u["x-miro"]=u[p],s.externalRefs[u[p]]&&(s.externalRefs[m]||(s.externalRefs[m]=s.externalRefs[u[p]]),s.externalRefs[m].failed=s.externalRefs[u[p]].failed),u[p]=m}else if(!u["x-miro"]){let m=us.resolve(i,u[p]).toString(),f=!1;s.externalRefs[u[p]]&&(f=s.externalRefs[u[p]].failed),f||(s.verbose>1&&console.warn(ar.colour.yellow+"Rewriting external ref",u[p],"as",m,ar.colour.normal),u["x-miro"]=u[p],u[p]=m)}}});return _o(e,{},function(u,p,d){vp(u,p)&&typeof u.$fixed<"u"&&delete u.$fixed}),s.verbose>1&&console.warn("Finished fragment resolution"),e}function bp(e,t){if(!t.filters||!t.filters.length)return e;for(let r of t.filters)e=r(e,t);return e}function EW(e,t){return e&&e.length>2?e:t&&t.length>2?t:"file:"}function AW(e,t,r,n){var i=us.parse(r.source),s=r.source.split("\\").join("/").split("/");s.pop()||s.pop();let a="",c=t.split("#");c.length>1&&(a="#"+c[1],t=c[0]),s=s.join("/");let l=us.parse(t),u=EW(l.protocol,i.protocol),p;if(u==="file:"?p=TA.resolve(s?s+"/":"",t):p=us.resolve(s?s+"/":"",t),r.cache[p]){r.verbose&&console.warn("CACHED",p,a);let d=li(r.cache[p]),m=r.externalRef=d;if(a&&(m=So(m,a),m===!1&&(m={},r.fatal))){let f=new Error("Cached $ref resolution failed "+p+a);if(r.promise)r.promise.reject(f);else throw f}return m=u0(m,d,t,a,p,r),m=bp(m,r),n(li(m),p,r),Promise.resolve(m)}if(r.verbose&&console.warn("GET",p,a),r.handlers&&r.handlers[u])return r.handlers[u](s,t,a,r).then(function(d){return r.externalRef=d,d=bp(d,r),r.cache[p]=d,n(d,p,r),d}).catch(function(d){throw r.verbose&&console.warn(d),d});if(u&&u.startsWith("http")){let d=Object.assign({},r.fetchOptions,{agent:r.agent});return r.fetch(p,d).then(function(m){if(m.status!==200){if(r.ignoreIOErrors)return r.verbose&&console.warn("FAILED",t),r.externalRefs[t].failed=!0,'{"$ref":"'+t+'"}';throw new Error(`Received status code ${m.status}: ${p}`)}return m.text()}).then(function(m){try{let f=AA.parse(m,{schema:"core",prettyErrors:!0});if(m=r.externalRef=f,r.cache[p]=li(m),a&&(m=So(m,a),m===!1&&(m={},r.fatal))){let h=new Error("Remote $ref resolution failed "+p+a);if(r.promise)r.promise.reject(h);else throw h}m=u0(m,f,t,a,p,r),m=bp(m,r)}catch(f){if(r.verbose&&console.warn(f),r.promise&&r.fatal)r.promise.reject(f);else throw f}return n(m,p,r),m}).catch(function(m){if(r.verbose&&console.warn(m),r.cache[p]={},r.promise&&r.fatal)r.promise.reject(m);else throw m})}else{let d='{"$ref":"'+t+'"}';return $W(p,r.encoding||"utf8",r,t,d).then(function(m){try{let f=AA.parse(m,{schema:"core",prettyErrors:!0});if(m=r.externalRef=f,r.cache[p]=li(m),a&&(m=So(m,a),m===!1&&(m={},r.fatal))){let h=new Error("File $ref resolution failed "+p+a);if(r.promise)r.promise.reject(h);else throw h}m=u0(m,f,t,a,p,r),m=bp(m,r)}catch(f){if(r.verbose&&console.warn(f),r.promise&&r.fatal)r.promise.reject(f);else throw f}return n(m,p,r),m}).catch(function(m){if(r.verbose&&console.warn(m),r.promise&&r.fatal)r.promise.reject(m);else throw m})}}function TW(e){return new Promise(function(t,r){function n(s,o,a){if(s[o]&&vp(s[o],"$ref")){let c=s[o].$ref;if(!c.startsWith("#")){let l="";if(!i[c]){let u=Object.keys(i).find(function(p,d,m){return c.startsWith(p+"/")});u&&(e.verbose&&console.warn("Found potential subschema at",u),l="/"+(c.split("#")[1]||"").replace(u.split("#")[1]||""),l=l.split("/undefined").join(""),c=u)}if(i[c]||(i[c]={resolved:!1,paths:[],extras:{},description:s[o].description}),i[c].resolved){if(!i[c].failed)if(e.rewriteRefs){let u=i[c].resolvedAt;e.verbose>1&&console.warn("Rewriting ref",c,u),s[o]["x-miro"]=c,s[o].$ref=u+l}else s[o]=li(i[c].data)}else i[c].paths.push(a.path),i[c].extras[a.path]=l}}}let i=e.externalRefs;if(e.resolver.depth>0&&e.source===e.resolver.base)return t(i);_o(e.openapi.definitions,{identityDetection:!0,path:"#/definitions"},n),_o(e.openapi.components,{identityDetection:!0,path:"#/components"},n),_o(e.openapi,{identityDetection:!0},n),t(i)})}function RA(e){return new Promise(function(t,r){TW(e).then(function(i){for(let s in i)if(!i[s].resolved){let o=e.resolver.depth;o>0&&o++,e.resolver.actions[o].push(function(){return AW(e.openapi,s,e,function(a,c,l){if(!i[s].resolved){let d={};d.context=i[s],d.$ref=s,d.original=li(a),d.updated=a,d.source=c,l.externals.push(d),i[s].resolved=!0}let u=Object.assign({},l,{source:"",resolver:{actions:l.resolver.actions,depth:l.resolver.actions.length-1,base:l.resolver.base}});l.patch&&i[s].description&&!a.description&&typeof a=="object"&&(a.description=i[s].description),i[s].data=a;let p=PW(i[s].paths);p=p.sort(function(d,m){let f=d.startsWith("#/components/")||d.startsWith("#/definitions/"),h=m.startsWith("#/components/")||m.startsWith("#/definitions/");return f&&!h?-1:h&&!f?1:0});for(let d of p)if(i[s].resolvedAt&&d!==i[s].resolvedAt&&d.indexOf("x-ms-examples/")<0)l.verbose>1&&console.warn("Creating pointer to data at",d),So(l.openapi,d,{$ref:i[s].resolvedAt+i[s].extras[d],"x-miro":s+i[s].extras[d]});else{i[s].resolvedAt?l.verbose>1&&console.warn("Avoiding circular reference"):(i[s].resolvedAt=d,l.verbose>1&&console.warn("Creating initial clone of data at",d));let m=li(a);So(l.openapi,d,m)}l.resolver.actions[u.resolver.depth].length===0&&l.resolver.actions[u.resolver.depth].push(function(){return RA(u)})})})}}).catch(function(i){e.verbose&&console.warn(i),r(i)});let n={options:e};n.actions=e.resolver.actions[e.resolver.depth],t(n)})}var RW=e=>e.reduce((t,r)=>t.then(n=>r().then(Array.prototype.concat.bind(n))),Promise.resolve([]));function p0(e,t,r){e.resolver.actions.push([]),RA(e).then(function(n){RW(n.actions).then(function(){if(e.resolver.depth>=e.resolver.actions.length)return console.warn("Ran off the end of resolver actions"),t(!0);e.resolver.depth++,e.resolver.actions[e.resolver.depth].length?setTimeout(function(){p0(n.options,t,r)},0):(e.verbose>1&&console.warn(ar.colour.yellow+"Finished external resolution!",ar.colour.normal),e.resolveInternal&&(e.verbose>1&&console.warn(ar.colour.yellow+"Starting internal resolution!",ar.colour.normal),e.openapi=OW(e.openapi,e.original,{verbose:e.verbose-1}),e.verbose>1&&console.warn(ar.colour.yellow+"Finished internal resolution!",ar.colour.normal)),_o(e.openapi,{},function(i,s,o){vp(i,s)&&(e.preserveMiro||delete i["x-miro"])}),t(e))}).catch(function(i){e.verbose&&console.warn(i),r(i)})}).catch(function(n){e.verbose&&console.warn(n),r(n)})}function CA(e){if(e.cache||(e.cache={}),e.fetch||(e.fetch=_W),e.source){let t=us.parse(e.source);(!t.protocol||t.protocol.length<=2)&&(e.source=TA.resolve(e.source))}e.externals=[],e.externalRefs={},e.rewriteRefs=!0,e.resolver={},e.resolver.depth=0,e.resolver.base=e.source,e.resolver.actions=[[]]}function CW(e){return CA(e),new Promise(function(t,r){e.resolve?p0(e,t,r):t(e)})}function kW(e,t,r){return r||(r={}),r.openapi=e,r.source=t,r.resolve=!0,CA(r),new Promise(function(n,i){p0(r,n,i)})}kA.exports={optionalResolve:CW,resolve:kW}});var jA=v((Bye,qA)=>{"use strict";function IA(){return{depth:0,seen:new WeakMap,top:!0,combine:!1,allowRefSiblings:!1}}function Gr(e,t,r,n){if(typeof r.depth>"u"&&(r=IA()),e===null||typeof e>"u")return e;if(typeof e.$ref<"u"){let i={$ref:e.$ref};return r.allowRefSiblings&&e.description&&(i.description=e.description),n(i,t,r),i}if(r.combine&&(e.allOf&&Array.isArray(e.allOf)&&e.allOf.length===1&&(e=Object.assign({},e.allOf[0],e),delete e.allOf),e.anyOf&&Array.isArray(e.anyOf)&&e.anyOf.length===1&&(e=Object.assign({},e.anyOf[0],e),delete e.anyOf),e.oneOf&&Array.isArray(e.oneOf)&&e.oneOf.length===1&&(e=Object.assign({},e.oneOf[0],e),delete e.oneOf)),n(e,t,r),r.seen.has(e))return e;if(typeof e=="object"&&e!==null&&r.seen.set(e,!0),r.top=!1,r.depth++,typeof e.items<"u"&&(r.property="items",Gr(e.items,e,r,n)),e.additionalItems&&typeof e.additionalItems=="object"&&(r.property="additionalItems",Gr(e.additionalItems,e,r,n)),e.additionalProperties&&typeof e.additionalProperties=="object"&&(r.property="additionalProperties",Gr(e.additionalProperties,e,r,n)),e.properties)for(let i in e.properties){let s=e.properties[i];r.property="properties/"+i,Gr(s,e,r,n)}if(e.patternProperties)for(let i in e.patternProperties){let s=e.patternProperties[i];r.property="patternProperties/"+i,Gr(s,e,r,n)}if(e.allOf)for(let i in e.allOf){let s=e.allOf[i];r.property="allOf/"+i,Gr(s,e,r,n)}if(e.anyOf)for(let i in e.anyOf){let s=e.anyOf[i];r.property="anyOf/"+i,Gr(s,e,r,n)}if(e.oneOf)for(let i in e.oneOf){let s=e.oneOf[i];r.property="oneOf/"+i,Gr(s,e,r,n)}return e.not&&(r.property="not",Gr(e.not,e,r,n)),r.depth--,e}qA.exports={getDefaultState:IA,walkSchema:Gr}});var LA=v((Vye,MA)=>{"use strict";var NW=require("http"),IW={default:"Default response","1XX":"Informational",103:"Early hints","2XX":"Successful","3XX":"Redirection","4XX":"Client Error","5XX":"Server Error","7XX":"Developer Error"};MA.exports={statusCodes:Object.assign({},IW,NW.STATUS_CODES)}});var DA=v((Uye,qW)=>{qW.exports={name:"swagger2openapi",version:"7.0.8",description:"Convert Swagger 2.0 definitions to OpenApi 3.0 and validate",main:"index.js",bin:{swagger2openapi:"./swagger2openapi.js","oas-validate":"./oas-validate.js",boast:"./boast.js"},funding:"https://github.com/Mermade/oas-kit?sponsor=1",scripts:{test:"mocha"},browserify:{transform:[["babelify",{presets:["es2015"]}]]},repository:{url:"https://github.com/Mermade/oas-kit.git",type:"git"},bugs:{url:"https://github.com/mermade/oas-kit/issues"},author:"Mike Ralphson <mike.ralphson@gmail.com>",license:"BSD-3-Clause",dependencies:{"call-me-maybe":"^1.0.1","node-fetch":"^2.6.1","node-fetch-h2":"^2.3.0","node-readfiles":"^0.2.0","oas-kit-common":"^1.0.8","oas-resolver":"^2.5.6","oas-schema-walker":"^1.1.5","oas-validator":"^5.0.8",reftools:"^1.1.9",yaml:"^1.10.0",yargs:"^17.0.1"},keywords:["swagger","openapi","openapi2","openapi3","converter","conversion","validator","validation","resolver","lint","linter"],gitHead:"b1bba3fc5007e96a991bf2a015cf0534ac36b88b"}});var eT=v((Hye,ZA)=>{"use strict";var jW=require("fs"),MW=require("url"),zye=require("path"),wc=c$(),LW=Cg(),WA=o0(),_n=mc(),bc=_n.jptr,DW=hp().isRef,Jr=hc().clone,FA=hc().circularClone,Sp=yp().recurse,BA=NA(),FW=jA(),Oe=l0(),BW=LA().statusCodes,VW=DA().version,YA="3.0.0",xp,Ot=class extends Error{constructor(t){super(t),this.name="S2OError"}};function Pt(e,t){let r=new Ot(e);if(r.options=t,t.promise)t.promise.reject(r);else throw r}function ht(e,t,r){r.warnOnly?t[r.warnProperty||"x-s2o-warning"]=e:Pt(e,r)}function UW(e,t,r){if(e.nullable&&r.patches++,e.discriminator&&typeof e.discriminator=="string"&&(e.discriminator={propertyName:e.discriminator}),e.items&&Array.isArray(e.items)&&(e.items.length===0?e.items={}:e.items.length===1?e.items=e.items[0]:e.items={anyOf:e.items}),e.type&&Array.isArray(e.type))if(r.patch){if(r.patches++,e.type.length===0)delete e.type;else{e.oneOf||(e.oneOf=[]);for(let n of e.type){let i={};if(n==="null")e.nullable=!0;else{i.type=n;for(let s of Oe.arrayProperties)typeof e.prop<"u"&&(i[s]=e[s],delete e[s])}i.type&&e.oneOf.push(i)}delete e.type,e.oneOf.length===0?delete e.oneOf:e.oneOf.length<2&&(e.type=e.oneOf[0].type,Object.keys(e.oneOf[0]).length>1&&ht("Lost properties from oneOf",e,r),delete e.oneOf)}e.type&&Array.isArray(e.type)&&e.type.length===1&&(e.type=e.type[0])}else Pt("(Patchable) schema type must not be an array",r);e.type&&e.type==="null"&&(delete e.type,e.nullable=!0),e.type==="array"&&!e.items&&(e.items={}),e.type==="file"&&(e.type="string",e.format="binary"),typeof e.required=="boolean"&&(e.required&&e.name&&(typeof t.required>"u"&&(t.required=[]),Array.isArray(t.required)&&t.required.push(e.name)),delete e.required),e.xml&&typeof e.xml.namespace=="string"&&(e.xml.namespace||delete e.xml.namespace),typeof e.allowEmptyValue<"u"&&(r.patches++,delete e.allowEmptyValue)}function zW(e,t){if(e["x-required"]&&Array.isArray(e["x-required"])&&(e.required||(e.required=[]),e.required=e.required.concat(e["x-required"]),delete e["x-required"]),e["x-anyOf"]&&(e.anyOf=e["x-anyOf"],delete e["x-anyOf"]),e["x-oneOf"]&&(e.oneOf=e["x-oneOf"],delete e["x-oneOf"]),e["x-not"]&&(e.not=e["x-not"],delete e["x-not"]),typeof e["x-nullable"]=="boolean"&&(e.nullable=e["x-nullable"],delete e["x-nullable"]),typeof e["x-discriminator"]=="object"&&typeof e["x-discriminator"].propertyName=="string"){e.discriminator=e["x-discriminator"],delete e["x-discriminator"];for(let r in e.discriminator.mapping){let n=e.discriminator.mapping[r];n.startsWith("#/definitions/")&&(e.discriminator.mapping[r]=n.replace("#/definitions/","#/components/schemas/"))}}}function vc(e,t){FW.walkSchema(e,{},{},function(r,n,i){zW(r,n),UW(r,n,t)})}function HW(e){return e.indexOf("#")>=0?e=e.split("#")[1].split("/").pop():e=e.split("/").pop().split(".")[0],encodeURIComponent(Oe.sanitise(e))}function KW(e,t,r){let n=r.payload.options;if(DW(e,t)){if(!e[t].startsWith("#/components/")){if(e[t]==="#/consumes")delete e[t],r.parent[r.pkey]=Jr(n.openapi.consumes);else if(e[t]==="#/produces")delete e[t],r.parent[r.pkey]=Jr(n.openapi.produces);else if(e[t].startsWith("#/definitions/")){let i=e[t].replace("#/definitions/","").split("/"),s=_n.jpunescape(i[0]),o=xp.schemas[decodeURIComponent(s)];o?i[0]=o:ht("Could not resolve reference "+e[t],e,n),e[t]="#/components/schemas/"+i.join("/")}else if(e[t].startsWith("#/parameters/"))e[t]="#/components/parameters/"+Oe.sanitise(e[t].replace("#/parameters/",""));else if(e[t].startsWith("#/responses/"))e[t]="#/components/responses/"+Oe.sanitise(e[t].replace("#/responses/",""));else if(e[t].startsWith("#")){let i=Jr(_n.jptr(n.openapi,e[t]));if(i===!1)ht("direct $ref not found "+e[t],e,n);else if(n.refmap[e[t]])e[t]=n.refmap[e[t]];else{let s=e[t];s=s.replace("/properties/headers/",""),s=s.replace("/properties/responses/",""),s=s.replace("/properties/parameters/",""),s=s.replace("/properties/schemas/","");let o="schemas",a=s.lastIndexOf("/schema");if(o=s.indexOf("/headers/")>a?"headers":s.indexOf("/responses/")>a?"responses":s.indexOf("/example")>a?"examples":s.indexOf("/x-")>a?"extensions":s.indexOf("/parameters/")>a?"parameters":"schemas",o==="schemas"&&vc(i,n),o!=="responses"&&o!=="extensions"){let c=o.substr(0,o.length-1);c==="parameter"&&i.name&&i.name===Oe.sanitise(i.name)&&(c=encodeURIComponent(i.name));let l=1;for(e["x-miro"]&&(c=HW(e["x-miro"]),l="");_n.jptr(n.openapi,"#/components/"+o+"/"+c+l);)l=l===""?2:++l;let u="#/components/"+o+"/"+c+l,p="";o==="examples"&&(i={value:i},p="/value"),_n.jptr(n.openapi,u,i),n.refmap[e[t]]=u+p,e[t]=u+p}}}}if(delete e["x-miro"],Object.keys(e).length>1){let i=e[t],s=r.path.indexOf("/schema")>=0;n.refSiblings==="preserve"||(s&&n.refSiblings==="allOf"?(delete e.$ref,r.parent[r.pkey]={allOf:[{$ref:i},e]}):r.parent[r.pkey]={$ref:i})}}if(t==="x-ms-odata"&&typeof e[t]=="string"&&e[t].startsWith("#/")){let i=e[t].replace("#/definitions/","").replace("#/components/schemas/","").split("/"),s=xp.schemas[decodeURIComponent(i[0])];s?i[0]=s:ht("Could not resolve reference "+e[t],e,n),e[t]="#/components/schemas/"+i.join("/")}}function WW(e,t){for(let r in t.refmap)_n.jptr(e,r,{$ref:t.refmap[r]})}function GA(e){for(let t in e)for(let r in e[t]){let n=Oe.sanitise(r);r!==n&&(e[t][n]=e[t][r],delete e[t][r])}}function YW(e,t){if(e.type==="basic"&&(e.type="http",e.scheme="basic"),e.type==="oauth2"){let r={},n=e.flow;e.flow==="application"&&(n="clientCredentials"),e.flow==="accessCode"&&(n="authorizationCode"),typeof e.authorizationUrl<"u"&&(r.authorizationUrl=e.authorizationUrl.split("?")[0].trim()||"/"),typeof e.tokenUrl=="string"&&(r.tokenUrl=e.tokenUrl.split("?")[0].trim()||"/"),r.scopes=e.scopes||{},e.flows={},e.flows[n]=r,delete e.flow,delete e.authorizationUrl,delete e.tokenUrl,delete e.scopes,typeof e.name<"u"&&(t.patch?(t.patches++,delete e.name):Pt("(Patchable) oauth2 securitySchemes should not have name property",t))}}function VA(e){return e&&!e["x-s2o-delete"]}function JA(e,t){if(e.$ref)e.$ref=e.$ref.replace("#/responses/","#/components/responses/");else{e.type&&!e.schema&&(e.schema={}),e.type&&(e.schema.type=e.type),e.items&&e.items.type!=="array"&&(e.items.collectionFormat!==e.collectionFormat&&ht("Nested collectionFormats are not supported",e,t),delete e.items.collectionFormat),e.type==="array"?(e.collectionFormat==="ssv"?ht("collectionFormat:ssv is no longer supported for headers",e,t):e.collectionFormat==="pipes"?ht("collectionFormat:pipes is no longer supported for headers",e,t):e.collectionFormat==="multi"?e.explode=!0:e.collectionFormat==="tsv"?(ht("collectionFormat:tsv is no longer supported",e,t),e["x-collectionFormat"]="tsv"):e.style="simple",delete e.collectionFormat):e.collectionFormat&&(t.patch?(t.patches++,delete e.collectionFormat):Pt("(Patchable) collectionFormat is only applicable to header.type array",t)),delete e.type;for(let r of Oe.parameterTypeProperties)typeof e[r]<"u"&&(e.schema[r]=e[r],delete e[r]);for(let r of Oe.arrayProperties)typeof e[r]<"u"&&(e.schema[r]=e[r],delete e[r])}}function XA(e,t){if(e.$ref.indexOf("#/parameters/")>=0){let r=e.$ref.split("#/parameters/");e.$ref=r[0]+"#/components/parameters/"+Oe.sanitise(r[1])}e.$ref.indexOf("#/definitions/")>=0&&ht("Definition used as parameter",e,t)}function GW(e,t){let r={};for(let n of Object.keys(e))r[n]=e[n],n==="parameters"&&(r.requestBody={},t.rbname&&(r[t.rbname]=""));return r.requestBody={},r}function wp(e,t,r,n,i,s,o){let a={},c=!0,l;if(t&&t.consumes&&typeof t.consumes=="string")if(o.patch)o.patches++,t.consumes=[t.consumes];else return Pt("(Patchable) operation.consumes must be an array",o);Array.isArray(s.consumes)||delete s.consumes;let u=((t?t.consumes:null)||s.consumes||[]).filter(Oe.uniqueOnly);if(e&&e.$ref&&typeof e.$ref=="string"){XA(e,o);let p=decodeURIComponent(e.$ref.replace("#/components/parameters/","")),d=!1,m=s.components.parameters[p];if((!m||m["x-s2o-delete"])&&e.$ref.startsWith("#/")&&(e["x-s2o-delete"]=!0,d=!0),d){let f=e.$ref,h=bc(s,e.$ref);!h&&f.startsWith("#/")?ht("Could not resolve reference "+f,e,o):h&&(e=h)}}if(e&&(e.name||e.in)){typeof e["x-deprecated"]=="boolean"&&(e.deprecated=e["x-deprecated"],delete e["x-deprecated"]),typeof e["x-example"]<"u"&&(e.example=e["x-example"],delete e["x-example"]),e.in!=="body"&&!e.type&&(o.patch?(o.patches++,e.type="string"):Pt("(Patchable) parameter.type is mandatory for non-body parameters",o)),e.type&&typeof e.type=="object"&&e.type.$ref&&(e.type=bc(s,e.type.$ref)),e.type==="file"&&(e["x-s2o-originalType"]=e.type,l=e.type),e.description&&typeof e.description=="object"&&e.description.$ref&&(e.description=bc(s,e.description.$ref)),e.description===null&&delete e.description;let p=e.collectionFormat;if(e.type==="array"&&!p&&(p="csv"),p&&(e.type!=="array"&&(o.patch?(o.patches++,delete e.collectionFormat):Pt("(Patchable) collectionFormat is only applicable to param.type array",o)),p==="csv"&&(e.in==="query"||e.in==="cookie")&&(e.style="form",e.explode=!1),p==="csv"&&(e.in==="path"||e.in==="header")&&(e.style="simple"),p==="ssv"&&(e.in==="query"?e.style="spaceDelimited":ht("collectionFormat:ssv is no longer supported except for in:query parameters",e,o)),p==="pipes"&&(e.in==="query"?e.style="pipeDelimited":ht("collectionFormat:pipes is no longer supported except for in:query parameters",e,o)),p==="multi"&&(e.explode=!0),p==="tsv"&&(ht("collectionFormat:tsv is no longer supported",e,o),e["x-collectionFormat"]="tsv"),delete e.collectionFormat),e.type&&e.type!=="body"&&e.in!=="formData")if(e.items&&e.schema)ht("parameter has array,items and schema",e,o);else{e.schema&&o.patches++,(!e.schema||typeof e.schema!="object")&&(e.schema={}),e.schema.type=e.type,e.items&&(e.schema.items=e.items,delete e.items,Sp(e.schema.items,null,function(d,m,f){m==="collectionFormat"&&typeof d[m]=="string"&&(p&&d[m]!==p&&ht("Nested collectionFormats are not supported",e,o),delete d[m])}));for(let d of Oe.parameterTypeProperties)typeof e[d]<"u"&&(e.schema[d]=e[d]),delete e[d]}e.schema&&vc(e.schema,o),e["x-ms-skip-url-encoding"]&&e.in==="query"&&(e.allowReserved=!0,delete e["x-ms-skip-url-encoding"])}if(e&&e.in==="formData"){c=!1,a.content={};let p="application/x-www-form-urlencoded";if(u.length&&u.indexOf("multipart/form-data")>=0&&(p="multipart/form-data"),a.content[p]={},e.schema)a.content[p].schema=e.schema,e.schema.$ref&&(a["x-s2o-name"]=decodeURIComponent(e.schema.$ref.replace("#/components/schemas/","")));else{a.content[p].schema={},a.content[p].schema.type="object",a.content[p].schema.properties={},a.content[p].schema.properties[e.name]={};let d=a.content[p].schema,m=a.content[p].schema.properties[e.name];e.description&&(m.description=e.description),e.example&&(m.example=e.example),e.type&&(m.type=e.type);for(let f of Oe.parameterTypeProperties)typeof e[f]<"u"&&(m[f]=e[f]);e.required===!0&&(d.required||(d.required=[]),d.required.push(e.name),a.required=!0),typeof e.default<"u"&&(m.default=e.default),m.properties&&(m.properties=e.properties),e.allOf&&(m.allOf=e.allOf),e.type==="array"&&e.items&&(m.items=e.items,m.items.collectionFormat&&delete m.items.collectionFormat),(l==="file"||e["x-s2o-originalType"]==="file")&&(m.type="string",m.format="binary"),f0(e,m)}}else e&&e.type==="file"&&(e.required&&(a.required=e.required),a.content={},a.content["application/octet-stream"]={},a.content["application/octet-stream"].schema={},a.content["application/octet-stream"].schema.type="string",a.content["application/octet-stream"].schema.format="binary",f0(e,a));if(e&&e.in==="body"){a.content={},e.name&&(a["x-s2o-name"]=(t&&t.operationId?Oe.sanitiseAll(t.operationId):"")+("_"+e.name).toCamelCase()),e.description&&(a.description=e.description),e.required&&(a.required=e.required),t&&o.rbname&&e.name&&(t[o.rbname]=e.name),e.schema&&e.schema.$ref?a["x-s2o-name"]=decodeURIComponent(e.schema.$ref.replace("#/components/schemas/","")):e.schema&&e.schema.type==="array"&&e.schema.items&&e.schema.items.$ref&&(a["x-s2o-name"]=decodeURIComponent(e.schema.items.$ref.replace("#/components/schemas/",""))+"Array"),u.length||u.push("application/json");for(let p of u)a.content[p]={},a.content[p].schema=Jr(e.schema||{}),vc(a.content[p].schema,o);f0(e,a)}if(Object.keys(a).length>0&&(e["x-s2o-delete"]=!0,t))if(t.requestBody&&c){t.requestBody["x-s2o-overloaded"]=!0;let p=t.operationId||i;ht("Operation "+p+" has multiple requestBodies",t,o)}else t.requestBody||(t=r[n]=GW(t,o)),t.requestBody.content&&t.requestBody.content["multipart/form-data"]&&t.requestBody.content["multipart/form-data"].schema&&t.requestBody.content["multipart/form-data"].schema.properties&&a.content["multipart/form-data"]&&a.content["multipart/form-data"].schema&&a.content["multipart/form-data"].schema.properties?(t.requestBody.content["multipart/form-data"].schema.properties=Object.assign(t.requestBody.content["multipart/form-data"].schema.properties,a.content["multipart/form-data"].schema.properties),t.requestBody.content["multipart/form-data"].schema.required=(t.requestBody.content["multipart/form-data"].schema.required||[]).concat(a.content["multipart/form-data"].schema.required||[]),t.requestBody.content["multipart/form-data"].schema.required.length||delete t.requestBody.content["multipart/form-data"].schema.required):t.requestBody.content&&t.requestBody.content["application/x-www-form-urlencoded"]&&t.requestBody.content["application/x-www-form-urlencoded"].schema&&t.requestBody.content["application/x-www-form-urlencoded"].schema.properties&&a.content["application/x-www-form-urlencoded"]&&a.content["application/x-www-form-urlencoded"].schema&&a.content["application/x-www-form-urlencoded"].schema.properties?(t.requestBody.content["application/x-www-form-urlencoded"].schema.properties=Object.assign(t.requestBody.content["application/x-www-form-urlencoded"].schema.properties,a.content["application/x-www-form-urlencoded"].schema.properties),t.requestBody.content["application/x-www-form-urlencoded"].schema.required=(t.requestBody.content["application/x-www-form-urlencoded"].schema.required||[]).concat(a.content["application/x-www-form-urlencoded"].schema.required||[]),t.requestBody.content["application/x-www-form-urlencoded"].schema.required.length||delete t.requestBody.content["application/x-www-form-urlencoded"].schema.required):(t.requestBody=Object.assign(t.requestBody,a),t.requestBody["x-s2o-name"]||(t.requestBody.schema&&t.requestBody.schema.$ref?t.requestBody["x-s2o-name"]=decodeURIComponent(t.requestBody.schema.$ref.replace("#/components/schemas/","")).split("/").join(""):t.operationId&&(t.requestBody["x-s2o-name"]=Oe.sanitiseAll(t.operationId))));if(e&&!e["x-s2o-delete"]){delete e.type;for(let p of Oe.parameterTypeProperties)delete e[p];e.in==="path"&&(typeof e.required>"u"||e.required!==!0)&&(o.patch?(o.patches++,e.required=!0):Pt("(Patchable) path parameters must be required:true ["+e.name+" in "+i+"]",o))}return t}function f0(e,t){for(let r in e)r.startsWith("x-")&&!r.startsWith("x-s2o")&&(t[r]=e[r])}function QA(e,t,r,n,i){if(!e)return!1;if(e.$ref&&typeof e.$ref=="string")e.$ref.indexOf("#/definitions/")>=0?ht("definition used as response: "+e.$ref,e,i):e.$ref.startsWith("#/responses/")&&(e.$ref="#/components/responses/"+Oe.sanitise(decodeURIComponent(e.$ref.replace("#/responses/",""))));else{if((typeof e.description>"u"||e.description===null||e.description===""&&i.patch)&&(i.patch?typeof e=="object"&&!Array.isArray(e)&&(i.patches++,e.description=BW[e]||""):Pt("(Patchable) response.description is mandatory",i)),typeof e.schema<"u"){if(vc(e.schema,i),e.schema.$ref&&typeof e.schema.$ref=="string"&&e.schema.$ref.startsWith("#/responses/")&&(e.schema.$ref="#/components/responses/"+Oe.sanitise(decodeURIComponent(e.schema.$ref.replace("#/responses/","")))),r&&r.produces&&typeof r.produces=="string")if(i.patch)i.patches++,r.produces=[r.produces];else return Pt("(Patchable) operation.produces must be an array",i);n.produces&&!Array.isArray(n.produces)&&delete n.produces;let s=((r?r.produces:null)||n.produces||[]).filter(Oe.uniqueOnly);s.length||s.push("*/*"),e.content={};for(let o of s){if(e.content[o]={},e.content[o].schema=Jr(e.schema),e.examples&&e.examples[o]){let a={};a.value=e.examples[o],e.content[o].examples={},e.content[o].examples.response=a,delete e.examples[o]}e.content[o].schema.type==="file"&&(e.content[o].schema={type:"string",format:"binary"})}delete e.schema}for(let s in e.examples)e.content||(e.content={}),e.content[s]||(e.content[s]={}),e.content[s].examples={},e.content[s].examples.response={},e.content[s].examples.response.value=e.examples[s];if(delete e.examples,e.headers)for(let s in e.headers)s.toLowerCase()==="status code"?i.patch?(i.patches++,delete e.headers[s]):Pt('(Patchable) "Status Code" is not a valid header',i):JA(e.headers[s],i)}}function UA(e,t,r,n,i){for(let s in e){let o=e[s];o&&o["x-trace"]&&typeof o["x-trace"]=="object"&&(o.trace=o["x-trace"],delete o["x-trace"]),o&&o["x-summary"]&&typeof o["x-summary"]=="string"&&(o.summary=o["x-summary"],delete o["x-summary"]),o&&o["x-description"]&&typeof o["x-description"]=="string"&&(o.description=o["x-description"],delete o["x-description"]),o&&o["x-servers"]&&Array.isArray(o["x-servers"])&&(o.servers=o["x-servers"],delete o["x-servers"]);for(let a in o)if(Oe.httpMethods.indexOf(a)>=0||a==="x-amazon-apigateway-any-method"){let c=o[a];if(c&&c.parameters&&Array.isArray(c.parameters)){if(o.parameters)for(let l of o.parameters)typeof l.$ref=="string"&&(XA(l,r),l=bc(i,l.$ref)),!c.parameters.find(function(p,d,m){return p.name===l.name&&p.in===l.in})&&(l.in==="formData"||l.in==="body"||l.type==="file")&&(c=wp(l,c,o,a,s,i,r),r.rbname&&c[r.rbname]===""&&delete c[r.rbname]);for(let l of c.parameters)c=wp(l,c,o,a,a+":"+s,i,r);r.rbname&&c[r.rbname]===""&&delete c[r.rbname],r.debug||c.parameters&&(c.parameters=c.parameters.filter(VA))}if(c&&c.security&&GA(c.security),typeof c=="object"){if(!c.responses){let l={};l.description="Default response",c.responses={default:l}}for(let l in c.responses){let u=c.responses[l];QA(u,l,c,i,r)}}if(c&&c["x-servers"]&&Array.isArray(c["x-servers"]))c.servers=c["x-servers"],delete c["x-servers"];else if(c&&c.schemes&&c.schemes.length){for(let l of c.schemes)if((!i.schemes||i.schemes.indexOf(l)<0)&&(c.servers||(c.servers=[]),Array.isArray(i.servers)))for(let u of i.servers){let p=Jr(u),d=MW.parse(p.url);d.protocol=l,p.url=d.format(),c.servers.push(p)}}if(r.debug&&(c["x-s2o-consumes"]=c.consumes||[],c["x-s2o-produces"]=c.produces||[]),c){if(delete c.consumes,delete c.produces,delete c.schemes,c["x-ms-examples"]){for(let l in c["x-ms-examples"]){let u=c["x-ms-examples"][l],p=Oe.sanitiseAll(l);if(u.parameters)for(let d in u.parameters){let m=u.parameters[d];for(let f of(c.parameters||[]).concat(o.parameters||[]))f.$ref&&(f=_n.jptr(i,f.$ref)),f.name===d&&!f.example&&(f.examples||(f.examples={}),f.examples[l]={value:m})}if(u.responses)for(let d in u.responses){if(u.responses[d].headers)for(let m in u.responses[d].headers){let f=u.responses[d].headers[m];for(let h in c.responses[d].headers)if(h===m){let y=c.responses[d].headers[h];y.example=f}}if(u.responses[d].body&&(i.components.examples[p]={value:Jr(u.responses[d].body)},c.responses[d]&&c.responses[d].content))for(let m in c.responses[d].content){let f=c.responses[d].content[m];f.examples||(f.examples={}),f.examples[l]={$ref:"#/components/examples/"+p}}}}delete c["x-ms-examples"]}if(c.parameters&&c.parameters.length===0&&delete c.parameters,c.requestBody){let l=c.operationId?Oe.sanitiseAll(c.operationId):Oe.sanitiseAll(a+s).toCamelCase(),u=Oe.sanitise(c.requestBody["x-s2o-name"]||l||"");delete c.requestBody["x-s2o-name"];let p=JSON.stringify(c.requestBody),d=Oe.hash(p);if(!n[d]){let f={};f.name=u,f.body=c.requestBody,f.refs=[],n[d]=f}let m="#/"+t+"/"+encodeURIComponent(_n.jpescape(s))+"/"+a+"/requestBody";n[d].refs.push(m)}}}if(o&&o.parameters){for(let a in o.parameters){let c=o.parameters[a];wp(c,null,o,null,s,i,r)}!r.debug&&Array.isArray(o.parameters)&&(o.parameters=o.parameters.filter(VA))}}}function JW(e,t){let r={};xp={schemas:{}},e.security&&GA(e.security);for(let i in e.components.securitySchemes){let s=Oe.sanitise(i);i!==s&&(e.components.securitySchemes[s]&&Pt("Duplicate sanitised securityScheme name "+s,t),e.components.securitySchemes[s]=e.components.securitySchemes[i],delete e.components.securitySchemes[i]),YW(e.components.securitySchemes[s],t)}for(let i in e.components.schemas){let s=Oe.sanitiseAll(i),o="";if(i!==s){for(;e.components.schemas[s+o];)o=o?++o:2;e.components.schemas[s+o]=e.components.schemas[i],delete e.components.schemas[i]}xp.schemas[i]=s+o,vc(e.components.schemas[s+o],t)}t.refmap={},Sp(e,{payload:{options:t}},KW),WW(e,t);for(let i in e.components.parameters){let s=Oe.sanitise(i);i!==s&&(e.components.parameters[s]&&Pt("Duplicate sanitised parameter name "+s,t),e.components.parameters[s]=e.components.parameters[i],delete e.components.parameters[i]);let o=e.components.parameters[s];wp(o,null,null,null,s,e,t)}for(let i in e.components.responses){let s=Oe.sanitise(i);i!==s&&(e.components.responses[s]&&Pt("Duplicate sanitised response name "+s,t),e.components.responses[s]=e.components.responses[i],delete e.components.responses[i]);let o=e.components.responses[s];if(QA(o,s,null,e,t),o.headers)for(let a in o.headers)a.toLowerCase()==="status code"?t.patch?(t.patches++,delete o.headers[a]):Pt('(Patchable) "Status Code" is not a valid header',t):JA(o.headers[a],t)}for(let i in e.components.requestBodies){let s=e.components.requestBodies[i],o=JSON.stringify(s),a=Oe.hash(o),c={};c.name=i,c.body=s,c.refs=[],r[a]=c}if(UA(e.paths,"paths",t,r,e),e["x-ms-paths"]&&UA(e["x-ms-paths"],"x-ms-paths",t,r,e),!t.debug)for(let i in e.components.parameters)e.components.parameters[i]["x-s2o-delete"]&&delete e.components.parameters[i];t.debug&&(e["x-s2o-consumes"]=e.consumes||[],e["x-s2o-produces"]=e.produces||[]),delete e.consumes,delete e.produces,delete e.schemes;let n=[];if(e.components.requestBodies={},!t.resolveInternal){let i=1;for(let s in r){let o=r[s];if(o.refs.length>1){let a="";for(o.name||(o.name="requestBody",a=i++);n.indexOf(o.name+a)>=0;)a=a?++a:2;o.name=o.name+a,n.push(o.name),e.components.requestBodies[o.name]=Jr(o.body);for(let c in o.refs){let l={};l.$ref="#/components/requestBodies/"+o.name,_n.jptr(e,o.refs[c],l)}}}}return e.components.responses&&Object.keys(e.components.responses).length===0&&delete e.components.responses,e.components.parameters&&Object.keys(e.components.parameters).length===0&&delete e.components.parameters,e.components.examples&&Object.keys(e.components.examples).length===0&&delete e.components.examples,e.components.requestBodies&&Object.keys(e.components.requestBodies).length===0&&delete e.components.requestBodies,e.components.securitySchemes&&Object.keys(e.components.securitySchemes).length===0&&delete e.components.securitySchemes,e.components.headers&&Object.keys(e.components.headers).length===0&&delete e.components.headers,e.components.schemas&&Object.keys(e.components.schemas).length===0&&delete e.components.schemas,e.components&&Object.keys(e.components).length===0&&delete e.components,e}function zA(e){return!e||!e.url||typeof e.url!="string"||(e.url=e.url.split("{{").join("{"),e.url=e.url.split("}}").join("}"),e.url.replace(/\{(.+?)\}/g,function(t,r){e.variables||(e.variables={}),e.variables[r]={default:"unknown"}})),e}function HA(e,t,r){if(typeof e.info>"u"||e.info===null)if(t.patch)t.patches++,e.info={version:"",title:""};else return r(new Ot("(Patchable) info object is mandatory"));if(typeof e.info!="object"||Array.isArray(e.info))return r(new Ot("info must be an object"));if(typeof e.info.title>"u"||e.info.title===null)if(t.patch)t.patches++,e.info.title="";else return r(new Ot("(Patchable) info.title cannot be null"));if(typeof e.info.version>"u"||e.info.version===null)if(t.patch)t.patches++,e.info.version="";else return r(new Ot("(Patchable) info.version cannot be null"));if(typeof e.info.version!="string")if(t.patch)t.patches++,e.info.version=e.info.version.toString();else return r(new Ot("(Patchable) info.version must be a string"));if(typeof e.info.logo<"u")if(t.patch)t.patches++,e.info["x-logo"]=e.info.logo,delete e.info.logo;else return r(new Ot("(Patchable) info should not have logo property"));if(typeof e.info.termsOfService<"u"){if(e.info.termsOfService===null)if(t.patch)t.patches++,e.info.termsOfService="";else return r(new Ot("(Patchable) info.termsOfService cannot be null"));try{let n=new URL(e.info.termsOfService)}catch{if(t.patch)t.patches++,delete e.info.termsOfService;else return r(new Ot("(Patchable) info.termsOfService must be a URL"))}}}function KA(e,t,r){if(typeof e.paths>"u")if(t.patch)t.patches++,e.paths={};else return r(new Ot("(Patchable) paths object is mandatory"))}function XW(e,t){let r=new WeakSet;Sp(e,{identityDetection:!0},function(n,i,s){typeof n[i]=="object"&&n[i]!==null&&(r.has(n[i])?t.anchors?n[i]=Jr(n[i]):Pt("YAML anchor or merge key at "+s.path,t):r.add(n[i]))})}function d0(e,t,r){return wc(r,new Promise(function(n,i){if(e||(e={}),t.original=e,t.text||(t.text=WA.stringify(e)),t.externals=[],t.externalRefs={},t.rewriteRefs=!0,t.preserveMiro=!0,t.promise={},t.promise.resolve=n,t.promise.reject=i,t.patches=0,t.cache||(t.cache={}),t.source&&(t.cache[t.source]=t.original),XW(e,t),e.openapi&&typeof e.openapi=="string"&&e.openapi.startsWith("3.")){t.openapi=FA(e),HA(t.openapi,t,i),KA(t.openapi,t,i),BA.optionalResolve(t).then(function(){return t.direct?n(t.openapi):n(t)}).catch(function(o){console.warn(o),i(o)});return}if(!e.swagger||e.swagger!="2.0")return i(new Ot("Unsupported swagger/OpenAPI version: "+(e.openapi?e.openapi:e.swagger)));let s=t.openapi={};if(s.openapi=typeof t.targetVersion=="string"&&t.targetVersion.startsWith("3.")?t.targetVersion:YA,t.origin){s["x-origin"]||(s["x-origin"]=[]);let o={};o.url=t.source||t.origin,o.format="swagger",o.version=e.swagger,o.converter={},o.converter.url="https://github.com/mermade/oas-kit",o.converter.version=VW,s["x-origin"].push(o)}if(s=Object.assign(s,FA(e)),delete s.swagger,Sp(s,{},function(o,a,c){o[a]===null&&!a.startsWith("x-")&&a!=="default"&&c.path.indexOf("/example")<0&&delete o[a]}),e.host)for(let o of Array.isArray(e.schemes)?e.schemes:[""]){let a={},c=(e.basePath||"").replace(/\/$/,"");a.url=(o?o+":":"")+"//"+e.host+c,zA(a),s.servers||(s.servers=[]),s.servers.push(a)}else if(e.basePath){let o={};o.url=e.basePath,zA(o),s.servers||(s.servers=[]),s.servers.push(o)}if(delete s.host,delete s.basePath,s["x-servers"]&&Array.isArray(s["x-servers"])&&(s.servers=s["x-servers"],delete s["x-servers"]),e["x-ms-parameterized-host"]){let o=e["x-ms-parameterized-host"],a={};a.url=o.hostTemplate+(e.basePath?e.basePath:""),a.variables={};let c=a.url.match(/\{\w+\}/g);for(let l in o.parameters){let u=o.parameters[l];u.$ref&&(u=Jr(bc(s,u.$ref))),l.startsWith("x-")||(delete u.required,delete u.type,delete u.in,typeof u.default>"u"&&(u.enum?u.default=u.enum[0]:u.default="none"),u.name||(u.name=c[l].replace("{","").replace("}","")),a.variables[u.name]=u,delete u.name)}s.servers||(s.servers=[]),o.useSchemePrefix===!1?s.servers.push(a):e.schemes.forEach(l=>{s.servers.push(Object.assign({},a,{url:l+"://"+a.url}))}),delete s["x-ms-parameterized-host"]}HA(s,t,i),KA(s,t,i),typeof s.consumes=="string"&&(s.consumes=[s.consumes]),typeof s.produces=="string"&&(s.produces=[s.produces]),s.components={},s["x-callbacks"]&&(s.components.callbacks=s["x-callbacks"],delete s["x-callbacks"]),s.components.examples={},s.components.headers={},s["x-links"]&&(s.components.links=s["x-links"],delete s["x-links"]),s.components.parameters=s.parameters||{},s.components.responses=s.responses||{},s.components.requestBodies={},s.components.securitySchemes=s.securityDefinitions||{},s.components.schemas=s.definitions||{},delete s.definitions,delete s.responses,delete s.parameters,delete s.securityDefinitions,BA.optionalResolve(t).then(function(){JW(t.openapi,t),t.direct?n(t.openapi):n(t)}).catch(function(o){console.warn(o),i(o)})}))}function _p(e,t,r){return wc(r,new Promise(function(n,i){let s=null,o=null;try{s=JSON.parse(e),t.text=JSON.stringify(s,null,2)}catch(a){o=a;try{s=WA.parse(e,{schema:"core",prettyErrors:!0}),t.sourceYaml=!0,t.text=e}catch(c){o=c}}s?d0(s,t).then(a=>n(a)).catch(a=>i(a)):i(new Ot(o?o.message:"Could not parse string"))}))}function QW(e,t,r){return wc(r,new Promise(function(n,i){t.origin=!0,t.source||(t.source=e),t.verbose&&console.warn("GET "+e),t.fetch||(t.fetch=LW);let s=Object.assign({},t.fetchOptions,{agent:t.agent});t.fetch(e,s).then(function(o){if(o.status!==200)throw new Ot(`Received status code ${o.status}: ${e}`);return o.text()}).then(function(o){_p(o,t).then(a=>n(a)).catch(a=>i(a))}).catch(function(o){i(o)})}))}function ZW(e,t,r){return wc(r,new Promise(function(n,i){jW.readFile(e,t.encoding||"utf8",function(s,o){s?i(s):(t.sourceFile=e,_p(o,t).then(a=>n(a)).catch(a=>i(a)))})}))}function eY(e,t,r){return wc(r,new Promise(function(n,i){let s="";e.on("data",function(o){s+=o}).on("end",function(){_p(s,t).then(o=>n(o)).catch(o=>i(o))})}))}ZA.exports={S2OError:Ot,targetVersion:YA,convert:d0,convertObj:d0,convertUrl:QW,convertStr:_p,convertFile:ZW,convertStream:eY}});var dT=v((fT,y0)=>{(function(e){if(typeof fT=="object"&&typeof y0<"u")y0.exports=e();else if(typeof define=="function"&&define.amd)define([],e);else{var t;typeof window<"u"?t=window:typeof global<"u"?t=global:typeof self<"u"?t=self:t=this,t.OpenAPISampler=e()}})(function(){var e,t,r;return function(){function n(i,s,o){function a(u,p){if(!s[u]){if(!i[u]){var d=typeof require=="function"&&require;if(!p&&d)return d(u,!0);if(c)return c(u,!0);var m=new Error("Cannot find module '"+u+"'");throw m.code="MODULE_NOT_FOUND",m}var f=s[u]={exports:{}};i[u][0].call(f.exports,function(h){var y=i[u][1][h];return a(y||h)},f,f.exports,n,i,s,o)}return s[u].exports}for(var c=typeof require=="function"&&require,l=0;l<o.length;l++)a(o[l]);return a}return n}()({1:[function(n,i,s){"use strict";let o=n("./validator"),a=n("./xmlparser/XMLParser"),c=n("./xmlbuilder/json2xml");i.exports={XMLParser:a,XMLValidator:o,XMLBuilder:c}},{"./validator":4,"./xmlbuilder/json2xml":5,"./xmlparser/XMLParser":10}],2:[function(n,i,s){function o(a){return typeof a=="function"?a:Array.isArray(a)?c=>{for(let l of a)if(typeof l=="string"&&c===l||l instanceof RegExp&&l.test(c))return!0}:()=>!1}i.exports=o},{}],3:[function(n,i,s){"use strict";let o=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",a=o+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040",c="["+o+"]["+a+"]*",l=new RegExp("^"+c+"$"),u=function(d,m){let f=[],h=m.exec(d);for(;h;){let y=[];y.startIndex=m.lastIndex-h[0].length;let g=h.length;for(let b=0;b<g;b++)y.push(h[b]);f.push(y),h=m.exec(d)}return f},p=function(d){let m=l.exec(d);return!(m===null||typeof m>"u")};s.isExist=function(d){return typeof d<"u"},s.isEmptyObject=function(d){return Object.keys(d).length===0},s.merge=function(d,m,f){if(m){let h=Object.keys(m),y=h.length;for(let g=0;g<y;g++)f==="strict"?d[h[g]]=[m[h[g]]]:d[h[g]]=m[h[g]]}},s.getValue=function(d){return s.isExist(d)?d:""},s.isName=p,s.getAllMatches=u,s.nameRegexp=c},{}],4:[function(n,i,s){"use strict";let o=n("./util"),a={allowBooleanAttributes:!1,unpairedTags:[]};s.validate=function(_,P){P=Object.assign({},a,P);let E=[],F=!1,$=!1;_[0]==="\uFEFF"&&(_=_.substr(1));for(let O=0;O<_.length;O++)if(_[O]==="<"&&_[O+1]==="?"){if(O+=2,O=l(_,O),O.err)return O}else if(_[O]==="<"){let k=O;if(O++,_[O]==="!"){O=u(_,O);continue}else{let L=!1;_[O]==="/"&&(L=!0,O++);let q="";for(;O<_.length&&_[O]!==">"&&_[O]!==" "&&_[O]!==" "&&_[O]!==`
193
+ `}};Lt._defineProperty(dp,"defaults",tA);mp.Document=dp;mp.defaultOptions=NK;mp.scalarOptions=IK});var sA=v(iA=>{"use strict";var s0=OE(),as=rA(),VK=n0(),UK=ts(),zK=Zg();uc();function HK(e,t=!0,r){r===void 0&&typeof t=="string"&&(r=t,t=!0);let n=Object.assign({},as.Document.defaults[as.defaultOptions.version],as.defaultOptions);return new VK.Schema(n).createNode(e,t,r)}var wo=class extends as.Document{constructor(t){super(Object.assign({},as.defaultOptions,t))}};function KK(e,t){let r=[],n;for(let i of s0.parse(e)){let s=new wo(t);s.parse(i,n),r.push(s),n=s}return r}function nA(e,t){let r=s0.parse(e),n=new wo(t).parse(r[0]);if(r.length>1){let i="Source contains multiple documents; please use YAML.parseAllDocuments()";n.errors.unshift(new UK.YAMLSemanticError(r[1],i))}return n}function WK(e,t){let r=nA(e,t);if(r.warnings.forEach(n=>zK.warn(n)),r.errors.length>0)throw r.errors[0];return r.toJSON()}function YK(e,t){let r=new wo(t);return r.contents=e,String(r)}var GK={createNode:HK,defaultOptions:as.defaultOptions,Document:wo,parse:WK,parseAllDocuments:KK,parseCST:s0.parse,parseDocument:nA,scalarOptions:as.scalarOptions,stringify:YK};iA.YAML=GK});var o0=v((kye,oA)=>{oA.exports=sA().YAML});var mc=v((Nye,cA)=>{"use strict";function JK(e){return e.replace(/\~/g,"~0").replace(/\//g,"~1")}function aA(e){return e.replace(/\~1/g,"/").replace(/~0/g,"~")}function XK(e,t,r){if(typeof e>"u")return!1;if(!t||typeof t!="string"||t==="#")return typeof r<"u"?r:e;if(t.indexOf("#")>=0){let i=t.split("#");if(i[0])return!1;t=i[1],t=decodeURIComponent(t.slice(1).split("+").join(" "))}t.startsWith("/")&&(t=t.slice(1));let n=t.split("/");for(let i=0;i<n.length;i++){n[i]=aA(n[i]);let s=typeof r<"u"&&i==n.length-1,o=parseInt(n[i],10);if(!Array.isArray(e)||isNaN(o)||o.toString()!==n[i]?o=Array.isArray(e)&&n[i]==="-"?-2:-1:n[i]=i>0?n[i-1]:"",o!=-1||e&&e.hasOwnProperty(n[i]))if(o>=0)s&&(e[o]=r),e=e[o];else{if(o===-2)return s?(Array.isArray(e)&&e.push(r),r):void 0;s&&(e[n[i]]=r),e=e[n[i]]}else if(typeof r<"u"&&typeof e=="object"&&!Array.isArray(e))e[n[i]]=s?r:n[i+1]==="0"||n[i+1]==="-"?[]:{},e=e[n[i]];else return!1}return e}cA.exports={jptr:XK,jpescape:JK,jpunescape:aA}});var hp=v((Iye,lA)=>{"use strict";function QK(e,t){return t==="$ref"&&!!e&&typeof e[t]=="string"}lA.exports={isRef:QK}});var hc=v((qye,fA)=>{"use strict";function ZK(e){return e}function eW(e){return JSON.parse(JSON.stringify(e))}function tW(e){let t={};for(let r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);return t}function uA(e){let t=Array.isArray(e)?[]:{};for(let r in e)(e.hasOwnProperty(r)||Array.isArray(e))&&(t[r]=typeof e[r]=="object"?uA(e[r]):e[r]);return t}function rW(e){return Object.assign({},e)}function pA(e,t){if(t||(t=new WeakMap),Object(e)!==e||e instanceof Function)return e;if(t.has(e))return t.get(e);try{var r=new e.constructor}catch{r=Object.create(Object.getPrototypeOf(e))}return t.set(e,r),Object.assign(r,...Object.keys(e).map(n=>({[n]:pA(e[n],t)})))}fA.exports={nop:ZK,clone:eW,shallowClone:tW,deepClone:uA,fastClone:rW,circularClone:pA}});var yp=v((jye,mA)=>{"use strict";var nW=mc().jpescape;function iW(){return{path:"#",depth:0,pkey:"",parent:{},payload:{},seen:new WeakMap,identity:!1,identityDetection:!1}}function dA(e,t,r){if(t||(t={depth:0}),t.depth||(t=Object.assign({},iW(),t)),typeof e!="object")return;let n=t.path;for(let i in e){if(t.key=i,t.path=t.path+"/"+encodeURIComponent(nW(i)),t.identityPath=t.seen.get(e[i]),t.identity=typeof t.identityPath<"u",e.hasOwnProperty(i)&&r(e,i,t),typeof e[i]=="object"&&!t.identity){t.identityDetection&&!Array.isArray(e[i])&&e[i]!==null&&t.seen.set(e[i],t.path);let s={};s.parent=e,s.path=t.path,s.depth=t.depth?t.depth+1:1,s.pkey=i,s.payload=t.payload,s.seen=t.seen,s.identity=!1,s.identityDetection=t.identityDetection,dA(e[i],s,r)}t.path=n}}mA.exports={recurse:dA}});var bA=v((Mye,gA)=>{"use strict";var sW=yp().recurse,hA=hc().shallowClone,yc=mc().jptr,oW=hp().isRef,aW=function(e){return e&&e.verbose?{warn:function(){var t=Array.prototype.slice.call(arguments);console.warn.apply(console,t)}}:{warn:function(){}}};function yA(e,t,r){r||(r={}),r.cache||(r.cache={}),r.state||(r.state={}),r.state.identityDetection=!0,r.depth=r.depth?r.depth+1:1;let n=r.depth>1?e:hA(e),i={data:n},s=r.depth>1?t:hA(t);r.master||(r.master=n);let o=aW(r),a=1;for(;a>0;)a=0,sW(i,r.state,function(c,l,u){if(oW(c,l)){let p=c[l];if(a++,r.cache[p]){let d=r.cache[p];if(d.resolved)o.warn("Patching %s for %s",p,d.path),u.parent[u.pkey]=d.data,r.$ref&&typeof u.parent[u.pkey]=="object"&&u.parent[u.pkey]!==null&&(u.parent[u.pkey][r.$ref]=p);else{if(p===d.path)throw new Error(`Tight circle at ${d.path}`);o.warn("Unresolved ref"),u.parent[u.pkey]=yc(d.source,d.path),u.parent[u.pkey]===!1&&(u.parent[u.pkey]=yc(d.source,d.key)),r.$ref&&typeof u.parent[u.pkey]=="object"&&u.parent[u.pkey]!==null&&(u.parent[r.$ref]=p)}}else{let d={};d.path=u.path.split("/$ref")[0],d.key=p,o.warn("Dereffing %s at %s",p,d.path),d.source=s,d.data=yc(d.source,d.key),d.data===!1&&(d.data=yc(r.master,d.key),d.source=r.master),d.data===!1&&o.warn("Missing $ref target",d.key),r.cache[p]=d,d.data=u.parent[u.pkey]=yA(yc(d.source,d.key),d.source,r),r.$ref&&typeof u.parent[u.pkey]=="object"&&u.parent[u.pkey]!==null&&(u.parent[u.pkey][r.$ref]=p),d.resolved=!0}}});return i.data}gA.exports={dereference:yA}});var OA=v((Lye,_A)=>{_A.exports=gc;gc.default=gc;gc.stable=xA;gc.stableStringify=xA;var gp="[...]",vA="[Circular]",ls=[],cs=[];function wA(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function gc(e,t,r,n){typeof n>"u"&&(n=wA()),a0(e,"",0,[],void 0,0,n);var i;try{cs.length===0?i=JSON.stringify(e,t,r):i=JSON.stringify(e,SA(t),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;ls.length!==0;){var s=ls.pop();s.length===4?Object.defineProperty(s[0],s[1],s[3]):s[0][s[1]]=s[2]}}return i}function xo(e,t,r,n){var i=Object.getOwnPropertyDescriptor(n,r);i.get!==void 0?i.configurable?(Object.defineProperty(n,r,{value:e}),ls.push([n,r,t,i])):cs.push([t,r,e]):(n[r]=e,ls.push([n,r,t]))}function a0(e,t,r,n,i,s,o){s+=1;var a;if(typeof e=="object"&&e!==null){for(a=0;a<n.length;a++)if(n[a]===e){xo(vA,e,t,i);return}if(typeof o.depthLimit<"u"&&s>o.depthLimit){xo(gp,e,t,i);return}if(typeof o.edgesLimit<"u"&&r+1>o.edgesLimit){xo(gp,e,t,i);return}if(n.push(e),Array.isArray(e))for(a=0;a<e.length;a++)a0(e[a],a,a,n,e,s,o);else{var c=Object.keys(e);for(a=0;a<c.length;a++){var l=c[a];a0(e[l],l,a,n,e,s,o)}}n.pop()}}function cW(e,t){return e<t?-1:e>t?1:0}function xA(e,t,r,n){typeof n>"u"&&(n=wA());var i=c0(e,"",0,[],void 0,0,n)||e,s;try{cs.length===0?s=JSON.stringify(i,t,r):s=JSON.stringify(i,SA(t),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;ls.length!==0;){var o=ls.pop();o.length===4?Object.defineProperty(o[0],o[1],o[3]):o[0][o[1]]=o[2]}}return s}function c0(e,t,r,n,i,s,o){s+=1;var a;if(typeof e=="object"&&e!==null){for(a=0;a<n.length;a++)if(n[a]===e){xo(vA,e,t,i);return}try{if(typeof e.toJSON=="function")return}catch{return}if(typeof o.depthLimit<"u"&&s>o.depthLimit){xo(gp,e,t,i);return}if(typeof o.edgesLimit<"u"&&r+1>o.edgesLimit){xo(gp,e,t,i);return}if(n.push(e),Array.isArray(e))for(a=0;a<e.length;a++)c0(e[a],a,a,n,e,s,o);else{var c={},l=Object.keys(e).sort(cW);for(a=0;a<l.length;a++){var u=l[a];c0(e[u],u,a,n,e,s,o),c[u]=e[u]}if(typeof i<"u")ls.push([i,t,e]),i[t]=c;else return c}n.pop()}}function SA(e){return e=typeof e<"u"?e:function(t,r){return r},function(t,r){if(cs.length>0)for(var n=0;n<cs.length;n++){var i=cs[n];if(i[1]===t&&i[0]===r){r=i[2],cs.splice(n,1);break}}return e.call(this,t,r)}}});var l0=v((Dye,EA)=>{"use strict";var PA=OA(),lW=process.env.NODE_DISABLE_COLORS?{red:"",yellow:"",green:"",normal:""}:{red:"\x1B[31m",yellow:"\x1B[33;1m",green:"\x1B[32m",normal:"\x1B[0m"};function uW(e,t,r){return r.indexOf(e)===t}function pW(e){return new Set(e).size!==e.length}function fW(e){return new Set(e).size<=1}function dW(e,t){function r(n,i){return PA.stringify(n)===PA.stringify(Object.assign({},n,i))}return r(e,t)&&r(t,e)}function mW(e){let t=[];for(let r of e)t.find(function(i,s,o){return dW(i,r)})||t.push(r);return t}function hW(e){return e.length===mW(e).length}function yW(e){return e.find(function(t,r,n){return e.indexOf(t)<r})}function gW(e){let t=0,r;if(e.length===0)return t;for(let n=0;n<e.length;n++)r=e.charCodeAt(n),t=(t<<5)-t+r,t|=0;return t}String.prototype.toCamelCase=function(){return this.toLowerCase().replace(/[-_ \/\.](.)/g,function(t,r){return r.toUpperCase()})};var bW=["format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","minLength","maxLength","multipleOf","minItems","maxItems","uniqueItems","minProperties","maxProperties","additionalProperties","pattern","enum","default"],vW=["items","minItems","maxItems","uniqueItems"],wW=["get","post","put","delete","patch","head","options","trace"];function $A(e){e=e.replace("[]","Array");let t=e.split("/");return t[0]=t[0].replace(/[^A-Za-z0-9_\-\.]+|\s+/gm,"_"),t.join("/")}function xW(e){return $A(e.split("/").join("_"))}EA.exports={colour:lW,uniqueOnly:uW,hasDuplicates:pW,allSame:fW,distinctArray:hW,firstDupe:yW,hash:gW,parameterTypeProperties:bW,arrayProperties:vW,httpMethods:wW,sanitise:$A,sanitiseAll:xW}});var NA=v((Fye,kA)=>{"use strict";var SW=require("fs"),TA=require("path"),us=require("url"),_W=Cg(),AA=o0(),So=mc().jptr,_o=yp().recurse,li=hc().clone,OW=bA().dereference,vp=hp().isRef,ar=l0();function PW(e){return[...new Set(e)]}function $W(e,t,r,n,i){return new Promise(function(s,o){SW.readFile(e,t,function(a,c){a?r.ignoreIOErrors&&i?(r.verbose&&console.warn("FAILED",n),r.externalRefs[n].failed=!0,s(i)):o(a):s(c)})})}function u0(e,t,r,n,i,s){let o=s.externalRefs[r+n].paths[0],a=us.parse(i),c={},l=1;for(;l;)l=0,_o(e,{identityDetection:!0},function(u,p,d){if(vp(u,p)){if(u[p].startsWith("#")){if(!c[u[p]]&&!u.$fixed){let m=li(So(t,u[p]));if(s.verbose>1&&console.warn((m===!1?ar.colour.red:ar.colour.green)+"Fragment resolution",u[p],ar.colour.normal),m===!1){if(d.parent[d.pkey]={},s.fatal){let f=new Error("Fragment $ref resolution failed "+u[p]);if(s.promise)s.promise.reject(f);else throw f}}else l++,d.parent[d.pkey]=m,c[u[p]]=d.path.replace("/%24ref","")}else if(!u.$fixed){let m=(o+"/"+c[u[p]]).split("/#/").join("/");d.parent[d.pkey]={$ref:m,"x-miro":u[p],$fixed:!0},s.verbose>1&&console.warn("Replacing with",m),l++}}else if(a.protocol){let m=us.resolve(i,u[p]).toString();s.verbose>1&&console.warn(ar.colour.yellow+"Rewriting external url ref",u[p],"as",m,ar.colour.normal),u["x-miro"]=u[p],s.externalRefs[u[p]]&&(s.externalRefs[m]||(s.externalRefs[m]=s.externalRefs[u[p]]),s.externalRefs[m].failed=s.externalRefs[u[p]].failed),u[p]=m}else if(!u["x-miro"]){let m=us.resolve(i,u[p]).toString(),f=!1;s.externalRefs[u[p]]&&(f=s.externalRefs[u[p]].failed),f||(s.verbose>1&&console.warn(ar.colour.yellow+"Rewriting external ref",u[p],"as",m,ar.colour.normal),u["x-miro"]=u[p],u[p]=m)}}});return _o(e,{},function(u,p,d){vp(u,p)&&typeof u.$fixed<"u"&&delete u.$fixed}),s.verbose>1&&console.warn("Finished fragment resolution"),e}function bp(e,t){if(!t.filters||!t.filters.length)return e;for(let r of t.filters)e=r(e,t);return e}function EW(e,t){return e&&e.length>2?e:t&&t.length>2?t:"file:"}function AW(e,t,r,n){var i=us.parse(r.source),s=r.source.split("\\").join("/").split("/");s.pop()||s.pop();let a="",c=t.split("#");c.length>1&&(a="#"+c[1],t=c[0]),s=s.join("/");let l=us.parse(t),u=EW(l.protocol,i.protocol),p;if(u==="file:"?p=TA.resolve(s?s+"/":"",t):p=us.resolve(s?s+"/":"",t),r.cache[p]){r.verbose&&console.warn("CACHED",p,a);let d=li(r.cache[p]),m=r.externalRef=d;if(a&&(m=So(m,a),m===!1&&(m={},r.fatal))){let f=new Error("Cached $ref resolution failed "+p+a);if(r.promise)r.promise.reject(f);else throw f}return m=u0(m,d,t,a,p,r),m=bp(m,r),n(li(m),p,r),Promise.resolve(m)}if(r.verbose&&console.warn("GET",p,a),r.handlers&&r.handlers[u])return r.handlers[u](s,t,a,r).then(function(d){return r.externalRef=d,d=bp(d,r),r.cache[p]=d,n(d,p,r),d}).catch(function(d){throw r.verbose&&console.warn(d),d});if(u&&u.startsWith("http")){let d=Object.assign({},r.fetchOptions,{agent:r.agent});return r.fetch(p,d).then(function(m){if(m.status!==200){if(r.ignoreIOErrors)return r.verbose&&console.warn("FAILED",t),r.externalRefs[t].failed=!0,'{"$ref":"'+t+'"}';throw new Error(`Received status code ${m.status}: ${p}`)}return m.text()}).then(function(m){try{let f=AA.parse(m,{schema:"core",prettyErrors:!0});if(m=r.externalRef=f,r.cache[p]=li(m),a&&(m=So(m,a),m===!1&&(m={},r.fatal))){let h=new Error("Remote $ref resolution failed "+p+a);if(r.promise)r.promise.reject(h);else throw h}m=u0(m,f,t,a,p,r),m=bp(m,r)}catch(f){if(r.verbose&&console.warn(f),r.promise&&r.fatal)r.promise.reject(f);else throw f}return n(m,p,r),m}).catch(function(m){if(r.verbose&&console.warn(m),r.cache[p]={},r.promise&&r.fatal)r.promise.reject(m);else throw m})}else{let d='{"$ref":"'+t+'"}';return $W(p,r.encoding||"utf8",r,t,d).then(function(m){try{let f=AA.parse(m,{schema:"core",prettyErrors:!0});if(m=r.externalRef=f,r.cache[p]=li(m),a&&(m=So(m,a),m===!1&&(m={},r.fatal))){let h=new Error("File $ref resolution failed "+p+a);if(r.promise)r.promise.reject(h);else throw h}m=u0(m,f,t,a,p,r),m=bp(m,r)}catch(f){if(r.verbose&&console.warn(f),r.promise&&r.fatal)r.promise.reject(f);else throw f}return n(m,p,r),m}).catch(function(m){if(r.verbose&&console.warn(m),r.promise&&r.fatal)r.promise.reject(m);else throw m})}}function TW(e){return new Promise(function(t,r){function n(s,o,a){if(s[o]&&vp(s[o],"$ref")){let c=s[o].$ref;if(!c.startsWith("#")){let l="";if(!i[c]){let u=Object.keys(i).find(function(p,d,m){return c.startsWith(p+"/")});u&&(e.verbose&&console.warn("Found potential subschema at",u),l="/"+(c.split("#")[1]||"").replace(u.split("#")[1]||""),l=l.split("/undefined").join(""),c=u)}if(i[c]||(i[c]={resolved:!1,paths:[],extras:{},description:s[o].description}),i[c].resolved){if(!i[c].failed)if(e.rewriteRefs){let u=i[c].resolvedAt;e.verbose>1&&console.warn("Rewriting ref",c,u),s[o]["x-miro"]=c,s[o].$ref=u+l}else s[o]=li(i[c].data)}else i[c].paths.push(a.path),i[c].extras[a.path]=l}}}let i=e.externalRefs;if(e.resolver.depth>0&&e.source===e.resolver.base)return t(i);_o(e.openapi.definitions,{identityDetection:!0,path:"#/definitions"},n),_o(e.openapi.components,{identityDetection:!0,path:"#/components"},n),_o(e.openapi,{identityDetection:!0},n),t(i)})}function RA(e){return new Promise(function(t,r){TW(e).then(function(i){for(let s in i)if(!i[s].resolved){let o=e.resolver.depth;o>0&&o++,e.resolver.actions[o].push(function(){return AW(e.openapi,s,e,function(a,c,l){if(!i[s].resolved){let d={};d.context=i[s],d.$ref=s,d.original=li(a),d.updated=a,d.source=c,l.externals.push(d),i[s].resolved=!0}let u=Object.assign({},l,{source:"",resolver:{actions:l.resolver.actions,depth:l.resolver.actions.length-1,base:l.resolver.base}});l.patch&&i[s].description&&!a.description&&typeof a=="object"&&(a.description=i[s].description),i[s].data=a;let p=PW(i[s].paths);p=p.sort(function(d,m){let f=d.startsWith("#/components/")||d.startsWith("#/definitions/"),h=m.startsWith("#/components/")||m.startsWith("#/definitions/");return f&&!h?-1:h&&!f?1:0});for(let d of p)if(i[s].resolvedAt&&d!==i[s].resolvedAt&&d.indexOf("x-ms-examples/")<0)l.verbose>1&&console.warn("Creating pointer to data at",d),So(l.openapi,d,{$ref:i[s].resolvedAt+i[s].extras[d],"x-miro":s+i[s].extras[d]});else{i[s].resolvedAt?l.verbose>1&&console.warn("Avoiding circular reference"):(i[s].resolvedAt=d,l.verbose>1&&console.warn("Creating initial clone of data at",d));let m=li(a);So(l.openapi,d,m)}l.resolver.actions[u.resolver.depth].length===0&&l.resolver.actions[u.resolver.depth].push(function(){return RA(u)})})})}}).catch(function(i){e.verbose&&console.warn(i),r(i)});let n={options:e};n.actions=e.resolver.actions[e.resolver.depth],t(n)})}var RW=e=>e.reduce((t,r)=>t.then(n=>r().then(Array.prototype.concat.bind(n))),Promise.resolve([]));function p0(e,t,r){e.resolver.actions.push([]),RA(e).then(function(n){RW(n.actions).then(function(){if(e.resolver.depth>=e.resolver.actions.length)return console.warn("Ran off the end of resolver actions"),t(!0);e.resolver.depth++,e.resolver.actions[e.resolver.depth].length?setTimeout(function(){p0(n.options,t,r)},0):(e.verbose>1&&console.warn(ar.colour.yellow+"Finished external resolution!",ar.colour.normal),e.resolveInternal&&(e.verbose>1&&console.warn(ar.colour.yellow+"Starting internal resolution!",ar.colour.normal),e.openapi=OW(e.openapi,e.original,{verbose:e.verbose-1}),e.verbose>1&&console.warn(ar.colour.yellow+"Finished internal resolution!",ar.colour.normal)),_o(e.openapi,{},function(i,s,o){vp(i,s)&&(e.preserveMiro||delete i["x-miro"])}),t(e))}).catch(function(i){e.verbose&&console.warn(i),r(i)})}).catch(function(n){e.verbose&&console.warn(n),r(n)})}function CA(e){if(e.cache||(e.cache={}),e.fetch||(e.fetch=_W),e.source){let t=us.parse(e.source);(!t.protocol||t.protocol.length<=2)&&(e.source=TA.resolve(e.source))}e.externals=[],e.externalRefs={},e.rewriteRefs=!0,e.resolver={},e.resolver.depth=0,e.resolver.base=e.source,e.resolver.actions=[[]]}function CW(e){return CA(e),new Promise(function(t,r){e.resolve?p0(e,t,r):t(e)})}function kW(e,t,r){return r||(r={}),r.openapi=e,r.source=t,r.resolve=!0,CA(r),new Promise(function(n,i){p0(r,n,i)})}kA.exports={optionalResolve:CW,resolve:kW}});var jA=v((Bye,qA)=>{"use strict";function IA(){return{depth:0,seen:new WeakMap,top:!0,combine:!1,allowRefSiblings:!1}}function Gr(e,t,r,n){if(typeof r.depth>"u"&&(r=IA()),e===null||typeof e>"u")return e;if(typeof e.$ref<"u"){let i={$ref:e.$ref};return r.allowRefSiblings&&e.description&&(i.description=e.description),n(i,t,r),i}if(r.combine&&(e.allOf&&Array.isArray(e.allOf)&&e.allOf.length===1&&(e=Object.assign({},e.allOf[0],e),delete e.allOf),e.anyOf&&Array.isArray(e.anyOf)&&e.anyOf.length===1&&(e=Object.assign({},e.anyOf[0],e),delete e.anyOf),e.oneOf&&Array.isArray(e.oneOf)&&e.oneOf.length===1&&(e=Object.assign({},e.oneOf[0],e),delete e.oneOf)),n(e,t,r),r.seen.has(e))return e;if(typeof e=="object"&&e!==null&&r.seen.set(e,!0),r.top=!1,r.depth++,typeof e.items<"u"&&(r.property="items",Gr(e.items,e,r,n)),e.additionalItems&&typeof e.additionalItems=="object"&&(r.property="additionalItems",Gr(e.additionalItems,e,r,n)),e.additionalProperties&&typeof e.additionalProperties=="object"&&(r.property="additionalProperties",Gr(e.additionalProperties,e,r,n)),e.properties)for(let i in e.properties){let s=e.properties[i];r.property="properties/"+i,Gr(s,e,r,n)}if(e.patternProperties)for(let i in e.patternProperties){let s=e.patternProperties[i];r.property="patternProperties/"+i,Gr(s,e,r,n)}if(e.allOf)for(let i in e.allOf){let s=e.allOf[i];r.property="allOf/"+i,Gr(s,e,r,n)}if(e.anyOf)for(let i in e.anyOf){let s=e.anyOf[i];r.property="anyOf/"+i,Gr(s,e,r,n)}if(e.oneOf)for(let i in e.oneOf){let s=e.oneOf[i];r.property="oneOf/"+i,Gr(s,e,r,n)}return e.not&&(r.property="not",Gr(e.not,e,r,n)),r.depth--,e}qA.exports={getDefaultState:IA,walkSchema:Gr}});var LA=v((Vye,MA)=>{"use strict";var NW=require("http"),IW={default:"Default response","1XX":"Informational",103:"Early hints","2XX":"Successful","3XX":"Redirection","4XX":"Client Error","5XX":"Server Error","7XX":"Developer Error"};MA.exports={statusCodes:Object.assign({},IW,NW.STATUS_CODES)}});var DA=v((Uye,qW)=>{qW.exports={name:"swagger2openapi",version:"7.0.8",description:"Convert Swagger 2.0 definitions to OpenApi 3.0 and validate",main:"index.js",bin:{swagger2openapi:"./swagger2openapi.js","oas-validate":"./oas-validate.js",boast:"./boast.js"},funding:"https://github.com/Mermade/oas-kit?sponsor=1",scripts:{test:"mocha"},browserify:{transform:[["babelify",{presets:["es2015"]}]]},repository:{url:"https://github.com/Mermade/oas-kit.git",type:"git"},bugs:{url:"https://github.com/mermade/oas-kit/issues"},author:"Mike Ralphson <mike.ralphson@gmail.com>",license:"BSD-3-Clause",dependencies:{"call-me-maybe":"^1.0.1","node-fetch":"^2.6.1","node-fetch-h2":"^2.3.0","node-readfiles":"^0.2.0","oas-kit-common":"^1.0.8","oas-resolver":"^2.5.6","oas-schema-walker":"^1.1.5","oas-validator":"^5.0.8",reftools:"^1.1.9",yaml:"^1.10.0",yargs:"^17.0.1"},keywords:["swagger","openapi","openapi2","openapi3","converter","conversion","validator","validation","resolver","lint","linter"],gitHead:"b1bba3fc5007e96a991bf2a015cf0534ac36b88b"}});var eT=v((Hye,ZA)=>{"use strict";var jW=require("fs"),MW=require("url"),zye=require("path"),wc=c$(),LW=Cg(),WA=o0(),_n=mc(),bc=_n.jptr,DW=hp().isRef,Jr=hc().clone,FA=hc().circularClone,Sp=yp().recurse,BA=NA(),FW=jA(),Oe=l0(),BW=LA().statusCodes,VW=DA().version,YA="3.0.0",xp,Ot=class extends Error{constructor(t){super(t),this.name="S2OError"}};function Pt(e,t){let r=new Ot(e);if(r.options=t,t.promise)t.promise.reject(r);else throw r}function ht(e,t,r){r.warnOnly?t[r.warnProperty||"x-s2o-warning"]=e:Pt(e,r)}function UW(e,t,r){if(e.nullable&&r.patches++,e.discriminator&&typeof e.discriminator=="string"&&(e.discriminator={propertyName:e.discriminator}),e.items&&Array.isArray(e.items)&&(e.items.length===0?e.items={}:e.items.length===1?e.items=e.items[0]:e.items={anyOf:e.items}),e.type&&Array.isArray(e.type))if(r.patch){if(r.patches++,e.type.length===0)delete e.type;else{e.oneOf||(e.oneOf=[]);for(let n of e.type){let i={};if(n==="null")e.nullable=!0;else{i.type=n;for(let s of Oe.arrayProperties)typeof e.prop<"u"&&(i[s]=e[s],delete e[s])}i.type&&e.oneOf.push(i)}delete e.type,e.oneOf.length===0?delete e.oneOf:e.oneOf.length<2&&(e.type=e.oneOf[0].type,Object.keys(e.oneOf[0]).length>1&&ht("Lost properties from oneOf",e,r),delete e.oneOf)}e.type&&Array.isArray(e.type)&&e.type.length===1&&(e.type=e.type[0])}else Pt("(Patchable) schema type must not be an array",r);e.type&&e.type==="null"&&(delete e.type,e.nullable=!0),e.type==="array"&&!e.items&&(e.items={}),e.type==="file"&&(e.type="string",e.format="binary"),typeof e.required=="boolean"&&(e.required&&e.name&&(typeof t.required>"u"&&(t.required=[]),Array.isArray(t.required)&&t.required.push(e.name)),delete e.required),e.xml&&typeof e.xml.namespace=="string"&&(e.xml.namespace||delete e.xml.namespace),typeof e.allowEmptyValue<"u"&&(r.patches++,delete e.allowEmptyValue)}function zW(e,t){if(e["x-required"]&&Array.isArray(e["x-required"])&&(e.required||(e.required=[]),e.required=e.required.concat(e["x-required"]),delete e["x-required"]),e["x-anyOf"]&&(e.anyOf=e["x-anyOf"],delete e["x-anyOf"]),e["x-oneOf"]&&(e.oneOf=e["x-oneOf"],delete e["x-oneOf"]),e["x-not"]&&(e.not=e["x-not"],delete e["x-not"]),typeof e["x-nullable"]=="boolean"&&(e.nullable=e["x-nullable"],delete e["x-nullable"]),typeof e["x-discriminator"]=="object"&&typeof e["x-discriminator"].propertyName=="string"){e.discriminator=e["x-discriminator"],delete e["x-discriminator"];for(let r in e.discriminator.mapping){let n=e.discriminator.mapping[r];n.startsWith("#/definitions/")&&(e.discriminator.mapping[r]=n.replace("#/definitions/","#/components/schemas/"))}}}function vc(e,t){FW.walkSchema(e,{},{},function(r,n,i){zW(r,n),UW(r,n,t)})}function HW(e){return e.indexOf("#")>=0?e=e.split("#")[1].split("/").pop():e=e.split("/").pop().split(".")[0],encodeURIComponent(Oe.sanitise(e))}function KW(e,t,r){let n=r.payload.options;if(DW(e,t)){if(!e[t].startsWith("#/components/")){if(e[t]==="#/consumes")delete e[t],r.parent[r.pkey]=Jr(n.openapi.consumes);else if(e[t]==="#/produces")delete e[t],r.parent[r.pkey]=Jr(n.openapi.produces);else if(e[t].startsWith("#/definitions/")){let i=e[t].replace("#/definitions/","").split("/"),s=_n.jpunescape(i[0]),o=xp.schemas[decodeURIComponent(s)];o?i[0]=o:ht("Could not resolve reference "+e[t],e,n),e[t]="#/components/schemas/"+i.join("/")}else if(e[t].startsWith("#/parameters/"))e[t]="#/components/parameters/"+Oe.sanitise(e[t].replace("#/parameters/",""));else if(e[t].startsWith("#/responses/"))e[t]="#/components/responses/"+Oe.sanitise(e[t].replace("#/responses/",""));else if(e[t].startsWith("#")){let i=Jr(_n.jptr(n.openapi,e[t]));if(i===!1)ht("direct $ref not found "+e[t],e,n);else if(n.refmap[e[t]])e[t]=n.refmap[e[t]];else{let s=e[t];s=s.replace("/properties/headers/",""),s=s.replace("/properties/responses/",""),s=s.replace("/properties/parameters/",""),s=s.replace("/properties/schemas/","");let o="schemas",a=s.lastIndexOf("/schema");if(o=s.indexOf("/headers/")>a?"headers":s.indexOf("/responses/")>a?"responses":s.indexOf("/example")>a?"examples":s.indexOf("/x-")>a?"extensions":s.indexOf("/parameters/")>a?"parameters":"schemas",o==="schemas"&&vc(i,n),o!=="responses"&&o!=="extensions"){let c=o.substr(0,o.length-1);c==="parameter"&&i.name&&i.name===Oe.sanitise(i.name)&&(c=encodeURIComponent(i.name));let l=1;for(e["x-miro"]&&(c=HW(e["x-miro"]),l="");_n.jptr(n.openapi,"#/components/"+o+"/"+c+l);)l=l===""?2:++l;let u="#/components/"+o+"/"+c+l,p="";o==="examples"&&(i={value:i},p="/value"),_n.jptr(n.openapi,u,i),n.refmap[e[t]]=u+p,e[t]=u+p}}}}if(delete e["x-miro"],Object.keys(e).length>1){let i=e[t],s=r.path.indexOf("/schema")>=0;n.refSiblings==="preserve"||(s&&n.refSiblings==="allOf"?(delete e.$ref,r.parent[r.pkey]={allOf:[{$ref:i},e]}):r.parent[r.pkey]={$ref:i})}}if(t==="x-ms-odata"&&typeof e[t]=="string"&&e[t].startsWith("#/")){let i=e[t].replace("#/definitions/","").replace("#/components/schemas/","").split("/"),s=xp.schemas[decodeURIComponent(i[0])];s?i[0]=s:ht("Could not resolve reference "+e[t],e,n),e[t]="#/components/schemas/"+i.join("/")}}function WW(e,t){for(let r in t.refmap)_n.jptr(e,r,{$ref:t.refmap[r]})}function GA(e){for(let t in e)for(let r in e[t]){let n=Oe.sanitise(r);r!==n&&(e[t][n]=e[t][r],delete e[t][r])}}function YW(e,t){if(e.type==="basic"&&(e.type="http",e.scheme="basic"),e.type==="oauth2"){let r={},n=e.flow;e.flow==="application"&&(n="clientCredentials"),e.flow==="accessCode"&&(n="authorizationCode"),typeof e.authorizationUrl<"u"&&(r.authorizationUrl=e.authorizationUrl.split("?")[0].trim()||"/"),typeof e.tokenUrl=="string"&&(r.tokenUrl=e.tokenUrl.split("?")[0].trim()||"/"),r.scopes=e.scopes||{},e.flows={},e.flows[n]=r,delete e.flow,delete e.authorizationUrl,delete e.tokenUrl,delete e.scopes,typeof e.name<"u"&&(t.patch?(t.patches++,delete e.name):Pt("(Patchable) oauth2 securitySchemes should not have name property",t))}}function VA(e){return e&&!e["x-s2o-delete"]}function JA(e,t){if(e.$ref)e.$ref=e.$ref.replace("#/responses/","#/components/responses/");else{e.type&&!e.schema&&(e.schema={}),e.type&&(e.schema.type=e.type),e.items&&e.items.type!=="array"&&(e.items.collectionFormat!==e.collectionFormat&&ht("Nested collectionFormats are not supported",e,t),delete e.items.collectionFormat),e.type==="array"?(e.collectionFormat==="ssv"?ht("collectionFormat:ssv is no longer supported for headers",e,t):e.collectionFormat==="pipes"?ht("collectionFormat:pipes is no longer supported for headers",e,t):e.collectionFormat==="multi"?e.explode=!0:e.collectionFormat==="tsv"?(ht("collectionFormat:tsv is no longer supported",e,t),e["x-collectionFormat"]="tsv"):e.style="simple",delete e.collectionFormat):e.collectionFormat&&(t.patch?(t.patches++,delete e.collectionFormat):Pt("(Patchable) collectionFormat is only applicable to header.type array",t)),delete e.type;for(let r of Oe.parameterTypeProperties)typeof e[r]<"u"&&(e.schema[r]=e[r],delete e[r]);for(let r of Oe.arrayProperties)typeof e[r]<"u"&&(e.schema[r]=e[r],delete e[r])}}function XA(e,t){if(e.$ref.indexOf("#/parameters/")>=0){let r=e.$ref.split("#/parameters/");e.$ref=r[0]+"#/components/parameters/"+Oe.sanitise(r[1])}e.$ref.indexOf("#/definitions/")>=0&&ht("Definition used as parameter",e,t)}function GW(e,t){let r={};for(let n of Object.keys(e))r[n]=e[n],n==="parameters"&&(r.requestBody={},t.rbname&&(r[t.rbname]=""));return r.requestBody={},r}function wp(e,t,r,n,i,s,o){let a={},c=!0,l;if(t&&t.consumes&&typeof t.consumes=="string")if(o.patch)o.patches++,t.consumes=[t.consumes];else return Pt("(Patchable) operation.consumes must be an array",o);Array.isArray(s.consumes)||delete s.consumes;let u=((t?t.consumes:null)||s.consumes||[]).filter(Oe.uniqueOnly);if(e&&e.$ref&&typeof e.$ref=="string"){XA(e,o);let p=decodeURIComponent(e.$ref.replace("#/components/parameters/","")),d=!1,m=s.components.parameters[p];if((!m||m["x-s2o-delete"])&&e.$ref.startsWith("#/")&&(e["x-s2o-delete"]=!0,d=!0),d){let f=e.$ref,h=bc(s,e.$ref);!h&&f.startsWith("#/")?ht("Could not resolve reference "+f,e,o):h&&(e=h)}}if(e&&(e.name||e.in)){typeof e["x-deprecated"]=="boolean"&&(e.deprecated=e["x-deprecated"],delete e["x-deprecated"]),typeof e["x-example"]<"u"&&(e.example=e["x-example"],delete e["x-example"]),e.in!=="body"&&!e.type&&(o.patch?(o.patches++,e.type="string"):Pt("(Patchable) parameter.type is mandatory for non-body parameters",o)),e.type&&typeof e.type=="object"&&e.type.$ref&&(e.type=bc(s,e.type.$ref)),e.type==="file"&&(e["x-s2o-originalType"]=e.type,l=e.type),e.description&&typeof e.description=="object"&&e.description.$ref&&(e.description=bc(s,e.description.$ref)),e.description===null&&delete e.description;let p=e.collectionFormat;if(e.type==="array"&&!p&&(p="csv"),p&&(e.type!=="array"&&(o.patch?(o.patches++,delete e.collectionFormat):Pt("(Patchable) collectionFormat is only applicable to param.type array",o)),p==="csv"&&(e.in==="query"||e.in==="cookie")&&(e.style="form",e.explode=!1),p==="csv"&&(e.in==="path"||e.in==="header")&&(e.style="simple"),p==="ssv"&&(e.in==="query"?e.style="spaceDelimited":ht("collectionFormat:ssv is no longer supported except for in:query parameters",e,o)),p==="pipes"&&(e.in==="query"?e.style="pipeDelimited":ht("collectionFormat:pipes is no longer supported except for in:query parameters",e,o)),p==="multi"&&(e.explode=!0),p==="tsv"&&(ht("collectionFormat:tsv is no longer supported",e,o),e["x-collectionFormat"]="tsv"),delete e.collectionFormat),e.type&&e.type!=="body"&&e.in!=="formData")if(e.items&&e.schema)ht("parameter has array,items and schema",e,o);else{e.schema&&o.patches++,(!e.schema||typeof e.schema!="object")&&(e.schema={}),e.schema.type=e.type,e.items&&(e.schema.items=e.items,delete e.items,Sp(e.schema.items,null,function(d,m,f){m==="collectionFormat"&&typeof d[m]=="string"&&(p&&d[m]!==p&&ht("Nested collectionFormats are not supported",e,o),delete d[m])}));for(let d of Oe.parameterTypeProperties)typeof e[d]<"u"&&(e.schema[d]=e[d]),delete e[d]}e.schema&&vc(e.schema,o),e["x-ms-skip-url-encoding"]&&e.in==="query"&&(e.allowReserved=!0,delete e["x-ms-skip-url-encoding"])}if(e&&e.in==="formData"){c=!1,a.content={};let p="application/x-www-form-urlencoded";if(u.length&&u.indexOf("multipart/form-data")>=0&&(p="multipart/form-data"),a.content[p]={},e.schema)a.content[p].schema=e.schema,e.schema.$ref&&(a["x-s2o-name"]=decodeURIComponent(e.schema.$ref.replace("#/components/schemas/","")));else{a.content[p].schema={},a.content[p].schema.type="object",a.content[p].schema.properties={},a.content[p].schema.properties[e.name]={};let d=a.content[p].schema,m=a.content[p].schema.properties[e.name];e.description&&(m.description=e.description),e.example&&(m.example=e.example),e.type&&(m.type=e.type);for(let f of Oe.parameterTypeProperties)typeof e[f]<"u"&&(m[f]=e[f]);e.required===!0&&(d.required||(d.required=[]),d.required.push(e.name),a.required=!0),typeof e.default<"u"&&(m.default=e.default),m.properties&&(m.properties=e.properties),e.allOf&&(m.allOf=e.allOf),e.type==="array"&&e.items&&(m.items=e.items,m.items.collectionFormat&&delete m.items.collectionFormat),(l==="file"||e["x-s2o-originalType"]==="file")&&(m.type="string",m.format="binary"),f0(e,m)}}else e&&e.type==="file"&&(e.required&&(a.required=e.required),a.content={},a.content["application/octet-stream"]={},a.content["application/octet-stream"].schema={},a.content["application/octet-stream"].schema.type="string",a.content["application/octet-stream"].schema.format="binary",f0(e,a));if(e&&e.in==="body"){a.content={},e.name&&(a["x-s2o-name"]=(t&&t.operationId?Oe.sanitiseAll(t.operationId):"")+("_"+e.name).toCamelCase()),e.description&&(a.description=e.description),e.required&&(a.required=e.required),t&&o.rbname&&e.name&&(t[o.rbname]=e.name),e.schema&&e.schema.$ref?a["x-s2o-name"]=decodeURIComponent(e.schema.$ref.replace("#/components/schemas/","")):e.schema&&e.schema.type==="array"&&e.schema.items&&e.schema.items.$ref&&(a["x-s2o-name"]=decodeURIComponent(e.schema.items.$ref.replace("#/components/schemas/",""))+"Array"),u.length||u.push("application/json");for(let p of u)a.content[p]={},a.content[p].schema=Jr(e.schema||{}),vc(a.content[p].schema,o);f0(e,a)}if(Object.keys(a).length>0&&(e["x-s2o-delete"]=!0,t))if(t.requestBody&&c){t.requestBody["x-s2o-overloaded"]=!0;let p=t.operationId||i;ht("Operation "+p+" has multiple requestBodies",t,o)}else t.requestBody||(t=r[n]=GW(t,o)),t.requestBody.content&&t.requestBody.content["multipart/form-data"]&&t.requestBody.content["multipart/form-data"].schema&&t.requestBody.content["multipart/form-data"].schema.properties&&a.content["multipart/form-data"]&&a.content["multipart/form-data"].schema&&a.content["multipart/form-data"].schema.properties?(t.requestBody.content["multipart/form-data"].schema.properties=Object.assign(t.requestBody.content["multipart/form-data"].schema.properties,a.content["multipart/form-data"].schema.properties),t.requestBody.content["multipart/form-data"].schema.required=(t.requestBody.content["multipart/form-data"].schema.required||[]).concat(a.content["multipart/form-data"].schema.required||[]),t.requestBody.content["multipart/form-data"].schema.required.length||delete t.requestBody.content["multipart/form-data"].schema.required):t.requestBody.content&&t.requestBody.content["application/x-www-form-urlencoded"]&&t.requestBody.content["application/x-www-form-urlencoded"].schema&&t.requestBody.content["application/x-www-form-urlencoded"].schema.properties&&a.content["application/x-www-form-urlencoded"]&&a.content["application/x-www-form-urlencoded"].schema&&a.content["application/x-www-form-urlencoded"].schema.properties?(t.requestBody.content["application/x-www-form-urlencoded"].schema.properties=Object.assign(t.requestBody.content["application/x-www-form-urlencoded"].schema.properties,a.content["application/x-www-form-urlencoded"].schema.properties),t.requestBody.content["application/x-www-form-urlencoded"].schema.required=(t.requestBody.content["application/x-www-form-urlencoded"].schema.required||[]).concat(a.content["application/x-www-form-urlencoded"].schema.required||[]),t.requestBody.content["application/x-www-form-urlencoded"].schema.required.length||delete t.requestBody.content["application/x-www-form-urlencoded"].schema.required):(t.requestBody=Object.assign(t.requestBody,a),t.requestBody["x-s2o-name"]||(t.requestBody.schema&&t.requestBody.schema.$ref?t.requestBody["x-s2o-name"]=decodeURIComponent(t.requestBody.schema.$ref.replace("#/components/schemas/","")).split("/").join(""):t.operationId&&(t.requestBody["x-s2o-name"]=Oe.sanitiseAll(t.operationId))));if(e&&!e["x-s2o-delete"]){delete e.type;for(let p of Oe.parameterTypeProperties)delete e[p];e.in==="path"&&(typeof e.required>"u"||e.required!==!0)&&(o.patch?(o.patches++,e.required=!0):Pt("(Patchable) path parameters must be required:true ["+e.name+" in "+i+"]",o))}return t}function f0(e,t){for(let r in e)r.startsWith("x-")&&!r.startsWith("x-s2o")&&(t[r]=e[r])}function QA(e,t,r,n,i){if(!e)return!1;if(e.$ref&&typeof e.$ref=="string")e.$ref.indexOf("#/definitions/")>=0?ht("definition used as response: "+e.$ref,e,i):e.$ref.startsWith("#/responses/")&&(e.$ref="#/components/responses/"+Oe.sanitise(decodeURIComponent(e.$ref.replace("#/responses/",""))));else{if((typeof e.description>"u"||e.description===null||e.description===""&&i.patch)&&(i.patch?typeof e=="object"&&!Array.isArray(e)&&(i.patches++,e.description=BW[e]||""):Pt("(Patchable) response.description is mandatory",i)),typeof e.schema<"u"){if(vc(e.schema,i),e.schema.$ref&&typeof e.schema.$ref=="string"&&e.schema.$ref.startsWith("#/responses/")&&(e.schema.$ref="#/components/responses/"+Oe.sanitise(decodeURIComponent(e.schema.$ref.replace("#/responses/","")))),r&&r.produces&&typeof r.produces=="string")if(i.patch)i.patches++,r.produces=[r.produces];else return Pt("(Patchable) operation.produces must be an array",i);n.produces&&!Array.isArray(n.produces)&&delete n.produces;let s=((r?r.produces:null)||n.produces||[]).filter(Oe.uniqueOnly);s.length||s.push("*/*"),e.content={};for(let o of s){if(e.content[o]={},e.content[o].schema=Jr(e.schema),e.examples&&e.examples[o]){let a={};a.value=e.examples[o],e.content[o].examples={},e.content[o].examples.response=a,delete e.examples[o]}e.content[o].schema.type==="file"&&(e.content[o].schema={type:"string",format:"binary"})}delete e.schema}for(let s in e.examples)e.content||(e.content={}),e.content[s]||(e.content[s]={}),e.content[s].examples={},e.content[s].examples.response={},e.content[s].examples.response.value=e.examples[s];if(delete e.examples,e.headers)for(let s in e.headers)s.toLowerCase()==="status code"?i.patch?(i.patches++,delete e.headers[s]):Pt('(Patchable) "Status Code" is not a valid header',i):JA(e.headers[s],i)}}function UA(e,t,r,n,i){for(let s in e){let o=e[s];o&&o["x-trace"]&&typeof o["x-trace"]=="object"&&(o.trace=o["x-trace"],delete o["x-trace"]),o&&o["x-summary"]&&typeof o["x-summary"]=="string"&&(o.summary=o["x-summary"],delete o["x-summary"]),o&&o["x-description"]&&typeof o["x-description"]=="string"&&(o.description=o["x-description"],delete o["x-description"]),o&&o["x-servers"]&&Array.isArray(o["x-servers"])&&(o.servers=o["x-servers"],delete o["x-servers"]);for(let a in o)if(Oe.httpMethods.indexOf(a)>=0||a==="x-amazon-apigateway-any-method"){let c=o[a];if(c&&c.parameters&&Array.isArray(c.parameters)){if(o.parameters)for(let l of o.parameters)typeof l.$ref=="string"&&(XA(l,r),l=bc(i,l.$ref)),!c.parameters.find(function(p,d,m){return p.name===l.name&&p.in===l.in})&&(l.in==="formData"||l.in==="body"||l.type==="file")&&(c=wp(l,c,o,a,s,i,r),r.rbname&&c[r.rbname]===""&&delete c[r.rbname]);for(let l of c.parameters)c=wp(l,c,o,a,a+":"+s,i,r);r.rbname&&c[r.rbname]===""&&delete c[r.rbname],r.debug||c.parameters&&(c.parameters=c.parameters.filter(VA))}if(c&&c.security&&GA(c.security),typeof c=="object"){if(!c.responses){let l={};l.description="Default response",c.responses={default:l}}for(let l in c.responses){let u=c.responses[l];QA(u,l,c,i,r)}}if(c&&c["x-servers"]&&Array.isArray(c["x-servers"]))c.servers=c["x-servers"],delete c["x-servers"];else if(c&&c.schemes&&c.schemes.length){for(let l of c.schemes)if((!i.schemes||i.schemes.indexOf(l)<0)&&(c.servers||(c.servers=[]),Array.isArray(i.servers)))for(let u of i.servers){let p=Jr(u),d=MW.parse(p.url);d.protocol=l,p.url=d.format(),c.servers.push(p)}}if(r.debug&&(c["x-s2o-consumes"]=c.consumes||[],c["x-s2o-produces"]=c.produces||[]),c){if(delete c.consumes,delete c.produces,delete c.schemes,c["x-ms-examples"]){for(let l in c["x-ms-examples"]){let u=c["x-ms-examples"][l],p=Oe.sanitiseAll(l);if(u.parameters)for(let d in u.parameters){let m=u.parameters[d];for(let f of(c.parameters||[]).concat(o.parameters||[]))f.$ref&&(f=_n.jptr(i,f.$ref)),f.name===d&&!f.example&&(f.examples||(f.examples={}),f.examples[l]={value:m})}if(u.responses)for(let d in u.responses){if(u.responses[d].headers)for(let m in u.responses[d].headers){let f=u.responses[d].headers[m];for(let h in c.responses[d].headers)if(h===m){let y=c.responses[d].headers[h];y.example=f}}if(u.responses[d].body&&(i.components.examples[p]={value:Jr(u.responses[d].body)},c.responses[d]&&c.responses[d].content))for(let m in c.responses[d].content){let f=c.responses[d].content[m];f.examples||(f.examples={}),f.examples[l]={$ref:"#/components/examples/"+p}}}}delete c["x-ms-examples"]}if(c.parameters&&c.parameters.length===0&&delete c.parameters,c.requestBody){let l=c.operationId?Oe.sanitiseAll(c.operationId):Oe.sanitiseAll(a+s).toCamelCase(),u=Oe.sanitise(c.requestBody["x-s2o-name"]||l||"");delete c.requestBody["x-s2o-name"];let p=JSON.stringify(c.requestBody),d=Oe.hash(p);if(!n[d]){let f={};f.name=u,f.body=c.requestBody,f.refs=[],n[d]=f}let m="#/"+t+"/"+encodeURIComponent(_n.jpescape(s))+"/"+a+"/requestBody";n[d].refs.push(m)}}}if(o&&o.parameters){for(let a in o.parameters){let c=o.parameters[a];wp(c,null,o,null,s,i,r)}!r.debug&&Array.isArray(o.parameters)&&(o.parameters=o.parameters.filter(VA))}}}function JW(e,t){let r={};xp={schemas:{}},e.security&&GA(e.security);for(let i in e.components.securitySchemes){let s=Oe.sanitise(i);i!==s&&(e.components.securitySchemes[s]&&Pt("Duplicate sanitised securityScheme name "+s,t),e.components.securitySchemes[s]=e.components.securitySchemes[i],delete e.components.securitySchemes[i]),YW(e.components.securitySchemes[s],t)}for(let i in e.components.schemas){let s=Oe.sanitiseAll(i),o="";if(i!==s){for(;e.components.schemas[s+o];)o=o?++o:2;e.components.schemas[s+o]=e.components.schemas[i],delete e.components.schemas[i]}xp.schemas[i]=s+o,vc(e.components.schemas[s+o],t)}t.refmap={},Sp(e,{payload:{options:t}},KW),WW(e,t);for(let i in e.components.parameters){let s=Oe.sanitise(i);i!==s&&(e.components.parameters[s]&&Pt("Duplicate sanitised parameter name "+s,t),e.components.parameters[s]=e.components.parameters[i],delete e.components.parameters[i]);let o=e.components.parameters[s];wp(o,null,null,null,s,e,t)}for(let i in e.components.responses){let s=Oe.sanitise(i);i!==s&&(e.components.responses[s]&&Pt("Duplicate sanitised response name "+s,t),e.components.responses[s]=e.components.responses[i],delete e.components.responses[i]);let o=e.components.responses[s];if(QA(o,s,null,e,t),o.headers)for(let a in o.headers)a.toLowerCase()==="status code"?t.patch?(t.patches++,delete o.headers[a]):Pt('(Patchable) "Status Code" is not a valid header',t):JA(o.headers[a],t)}for(let i in e.components.requestBodies){let s=e.components.requestBodies[i],o=JSON.stringify(s),a=Oe.hash(o),c={};c.name=i,c.body=s,c.refs=[],r[a]=c}if(UA(e.paths,"paths",t,r,e),e["x-ms-paths"]&&UA(e["x-ms-paths"],"x-ms-paths",t,r,e),!t.debug)for(let i in e.components.parameters)e.components.parameters[i]["x-s2o-delete"]&&delete e.components.parameters[i];t.debug&&(e["x-s2o-consumes"]=e.consumes||[],e["x-s2o-produces"]=e.produces||[]),delete e.consumes,delete e.produces,delete e.schemes;let n=[];if(e.components.requestBodies={},!t.resolveInternal){let i=1;for(let s in r){let o=r[s];if(o.refs.length>1){let a="";for(o.name||(o.name="requestBody",a=i++);n.indexOf(o.name+a)>=0;)a=a?++a:2;o.name=o.name+a,n.push(o.name),e.components.requestBodies[o.name]=Jr(o.body);for(let c in o.refs){let l={};l.$ref="#/components/requestBodies/"+o.name,_n.jptr(e,o.refs[c],l)}}}}return e.components.responses&&Object.keys(e.components.responses).length===0&&delete e.components.responses,e.components.parameters&&Object.keys(e.components.parameters).length===0&&delete e.components.parameters,e.components.examples&&Object.keys(e.components.examples).length===0&&delete e.components.examples,e.components.requestBodies&&Object.keys(e.components.requestBodies).length===0&&delete e.components.requestBodies,e.components.securitySchemes&&Object.keys(e.components.securitySchemes).length===0&&delete e.components.securitySchemes,e.components.headers&&Object.keys(e.components.headers).length===0&&delete e.components.headers,e.components.schemas&&Object.keys(e.components.schemas).length===0&&delete e.components.schemas,e.components&&Object.keys(e.components).length===0&&delete e.components,e}function zA(e){return!e||!e.url||typeof e.url!="string"||(e.url=e.url.split("{{").join("{"),e.url=e.url.split("}}").join("}"),e.url.replace(/\{(.+?)\}/g,function(t,r){e.variables||(e.variables={}),e.variables[r]={default:"unknown"}})),e}function HA(e,t,r){if(typeof e.info>"u"||e.info===null)if(t.patch)t.patches++,e.info={version:"",title:""};else return r(new Ot("(Patchable) info object is mandatory"));if(typeof e.info!="object"||Array.isArray(e.info))return r(new Ot("info must be an object"));if(typeof e.info.title>"u"||e.info.title===null)if(t.patch)t.patches++,e.info.title="";else return r(new Ot("(Patchable) info.title cannot be null"));if(typeof e.info.version>"u"||e.info.version===null)if(t.patch)t.patches++,e.info.version="";else return r(new Ot("(Patchable) info.version cannot be null"));if(typeof e.info.version!="string")if(t.patch)t.patches++,e.info.version=e.info.version.toString();else return r(new Ot("(Patchable) info.version must be a string"));if(typeof e.info.logo<"u")if(t.patch)t.patches++,e.info["x-logo"]=e.info.logo,delete e.info.logo;else return r(new Ot("(Patchable) info should not have logo property"));if(typeof e.info.termsOfService<"u"){if(e.info.termsOfService===null)if(t.patch)t.patches++,e.info.termsOfService="";else return r(new Ot("(Patchable) info.termsOfService cannot be null"));try{let n=new URL(e.info.termsOfService)}catch{if(t.patch)t.patches++,delete e.info.termsOfService;else return r(new Ot("(Patchable) info.termsOfService must be a URL"))}}}function KA(e,t,r){if(typeof e.paths>"u")if(t.patch)t.patches++,e.paths={};else return r(new Ot("(Patchable) paths object is mandatory"))}function XW(e,t){let r=new WeakSet;Sp(e,{identityDetection:!0},function(n,i,s){typeof n[i]=="object"&&n[i]!==null&&(r.has(n[i])?t.anchors?n[i]=Jr(n[i]):Pt("YAML anchor or merge key at "+s.path,t):r.add(n[i]))})}function d0(e,t,r){return wc(r,new Promise(function(n,i){if(e||(e={}),t.original=e,t.text||(t.text=WA.stringify(e)),t.externals=[],t.externalRefs={},t.rewriteRefs=!0,t.preserveMiro=!0,t.promise={},t.promise.resolve=n,t.promise.reject=i,t.patches=0,t.cache||(t.cache={}),t.source&&(t.cache[t.source]=t.original),XW(e,t),e.openapi&&typeof e.openapi=="string"&&e.openapi.startsWith("3.")){t.openapi=FA(e),HA(t.openapi,t,i),KA(t.openapi,t,i),BA.optionalResolve(t).then(function(){return t.direct?n(t.openapi):n(t)}).catch(function(o){console.warn(o),i(o)});return}if(!e.swagger||e.swagger!="2.0")return i(new Ot("Unsupported swagger/OpenAPI version: "+(e.openapi?e.openapi:e.swagger)));let s=t.openapi={};if(s.openapi=typeof t.targetVersion=="string"&&t.targetVersion.startsWith("3.")?t.targetVersion:YA,t.origin){s["x-origin"]||(s["x-origin"]=[]);let o={};o.url=t.source||t.origin,o.format="swagger",o.version=e.swagger,o.converter={},o.converter.url="https://github.com/mermade/oas-kit",o.converter.version=VW,s["x-origin"].push(o)}if(s=Object.assign(s,FA(e)),delete s.swagger,Sp(s,{},function(o,a,c){o[a]===null&&!a.startsWith("x-")&&a!=="default"&&c.path.indexOf("/example")<0&&delete o[a]}),e.host)for(let o of Array.isArray(e.schemes)?e.schemes:[""]){let a={},c=(e.basePath||"").replace(/\/$/,"");a.url=(o?o+":":"")+"//"+e.host+c,zA(a),s.servers||(s.servers=[]),s.servers.push(a)}else if(e.basePath){let o={};o.url=e.basePath,zA(o),s.servers||(s.servers=[]),s.servers.push(o)}if(delete s.host,delete s.basePath,s["x-servers"]&&Array.isArray(s["x-servers"])&&(s.servers=s["x-servers"],delete s["x-servers"]),e["x-ms-parameterized-host"]){let o=e["x-ms-parameterized-host"],a={};a.url=o.hostTemplate+(e.basePath?e.basePath:""),a.variables={};let c=a.url.match(/\{\w+\}/g);for(let l in o.parameters){let u=o.parameters[l];u.$ref&&(u=Jr(bc(s,u.$ref))),l.startsWith("x-")||(delete u.required,delete u.type,delete u.in,typeof u.default>"u"&&(u.enum?u.default=u.enum[0]:u.default="none"),u.name||(u.name=c[l].replace("{","").replace("}","")),a.variables[u.name]=u,delete u.name)}s.servers||(s.servers=[]),o.useSchemePrefix===!1?s.servers.push(a):e.schemes.forEach(l=>{s.servers.push(Object.assign({},a,{url:l+"://"+a.url}))}),delete s["x-ms-parameterized-host"]}HA(s,t,i),KA(s,t,i),typeof s.consumes=="string"&&(s.consumes=[s.consumes]),typeof s.produces=="string"&&(s.produces=[s.produces]),s.components={},s["x-callbacks"]&&(s.components.callbacks=s["x-callbacks"],delete s["x-callbacks"]),s.components.examples={},s.components.headers={},s["x-links"]&&(s.components.links=s["x-links"],delete s["x-links"]),s.components.parameters=s.parameters||{},s.components.responses=s.responses||{},s.components.requestBodies={},s.components.securitySchemes=s.securityDefinitions||{},s.components.schemas=s.definitions||{},delete s.definitions,delete s.responses,delete s.parameters,delete s.securityDefinitions,BA.optionalResolve(t).then(function(){JW(t.openapi,t),t.direct?n(t.openapi):n(t)}).catch(function(o){console.warn(o),i(o)})}))}function _p(e,t,r){return wc(r,new Promise(function(n,i){let s=null,o=null;try{s=JSON.parse(e),t.text=JSON.stringify(s,null,2)}catch(a){o=a;try{s=WA.parse(e,{schema:"core",prettyErrors:!0}),t.sourceYaml=!0,t.text=e}catch(c){o=c}}s?d0(s,t).then(a=>n(a)).catch(a=>i(a)):i(new Ot(o?o.message:"Could not parse string"))}))}function QW(e,t,r){return wc(r,new Promise(function(n,i){t.origin=!0,t.source||(t.source=e),t.verbose&&console.warn("GET "+e),t.fetch||(t.fetch=LW);let s=Object.assign({},t.fetchOptions,{agent:t.agent});t.fetch(e,s).then(function(o){if(o.status!==200)throw new Ot(`Received status code ${o.status}: ${e}`);return o.text()}).then(function(o){_p(o,t).then(a=>n(a)).catch(a=>i(a))}).catch(function(o){i(o)})}))}function ZW(e,t,r){return wc(r,new Promise(function(n,i){jW.readFile(e,t.encoding||"utf8",function(s,o){s?i(s):(t.sourceFile=e,_p(o,t).then(a=>n(a)).catch(a=>i(a)))})}))}function eY(e,t,r){return wc(r,new Promise(function(n,i){let s="";e.on("data",function(o){s+=o}).on("end",function(){_p(s,t).then(o=>n(o)).catch(o=>i(o))})}))}ZA.exports={S2OError:Ot,targetVersion:YA,convert:d0,convertObj:d0,convertUrl:QW,convertStr:_p,convertFile:ZW,convertStream:eY}});var OT=v((_T,b0)=>{(function(e){if(typeof _T=="object"&&typeof b0<"u")b0.exports=e();else if(typeof define=="function"&&define.amd)define([],e);else{var t;typeof window<"u"?t=window:typeof global<"u"?t=global:typeof self<"u"?t=self:t=this,t.OpenAPISampler=e()}})(function(){var e,t,r;return function(){function n(i,s,o){function a(u,p){if(!s[u]){if(!i[u]){var d=typeof require=="function"&&require;if(!p&&d)return d(u,!0);if(c)return c(u,!0);var m=new Error("Cannot find module '"+u+"'");throw m.code="MODULE_NOT_FOUND",m}var f=s[u]={exports:{}};i[u][0].call(f.exports,function(h){var y=i[u][1][h];return a(y||h)},f,f.exports,n,i,s,o)}return s[u].exports}for(var c=typeof require=="function"&&require,l=0;l<o.length;l++)a(o[l]);return a}return n}()({1:[function(n,i,s){"use strict";let o=n("./validator"),a=n("./xmlparser/XMLParser"),c=n("./xmlbuilder/json2xml");i.exports={XMLParser:a,XMLValidator:o,XMLBuilder:c}},{"./validator":4,"./xmlbuilder/json2xml":5,"./xmlparser/XMLParser":10}],2:[function(n,i,s){function o(a){return typeof a=="function"?a:Array.isArray(a)?c=>{for(let l of a)if(typeof l=="string"&&c===l||l instanceof RegExp&&l.test(c))return!0}:()=>!1}i.exports=o},{}],3:[function(n,i,s){"use strict";let o=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",a=o+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040",c="["+o+"]["+a+"]*",l=new RegExp("^"+c+"$"),u=function(d,m){let f=[],h=m.exec(d);for(;h;){let y=[];y.startIndex=m.lastIndex-h[0].length;let g=h.length;for(let b=0;b<g;b++)y.push(h[b]);f.push(y),h=m.exec(d)}return f},p=function(d){let m=l.exec(d);return!(m===null||typeof m>"u")};s.isExist=function(d){return typeof d<"u"},s.isEmptyObject=function(d){return Object.keys(d).length===0},s.merge=function(d,m,f){if(m){let h=Object.keys(m),y=h.length;for(let g=0;g<y;g++)f==="strict"?d[h[g]]=[m[h[g]]]:d[h[g]]=m[h[g]]}},s.getValue=function(d){return s.isExist(d)?d:""},s.isName=p,s.getAllMatches=u,s.nameRegexp=c},{}],4:[function(n,i,s){"use strict";let o=n("./util"),a={allowBooleanAttributes:!1,unpairedTags:[]};s.validate=function(_,P){P=Object.assign({},a,P);let E=[],F=!1,$=!1;_[0]==="\uFEFF"&&(_=_.substr(1));for(let O=0;O<_.length;O++)if(_[O]==="<"&&_[O+1]==="?"){if(O+=2,O=l(_,O),O.err)return O}else if(_[O]==="<"){let k=O;if(O++,_[O]==="!"){O=u(_,O);continue}else{let L=!1;_[O]==="/"&&(L=!0,O++);let q="";for(;O<_.length&&_[O]!==">"&&_[O]!==" "&&_[O]!==" "&&_[O]!==`
194
194
  `&&_[O]!=="\r";O++)q+=_[O];if(q=q.trim(),q[q.length-1]==="/"&&(q=q.substring(0,q.length-1),O--),!x(q)){let N;return q.trim().length===0?N="Invalid space after '<'.":N="Tag '"+q+"' is an invalid name.",b("InvalidTag",N,S(_,O))}let I=m(_,O);if(I===!1)return b("InvalidAttr","Attributes for '"+q+"' have open quote.",S(_,O));let B=I.value;if(O=I.index,B[B.length-1]==="/"){let N=O-B.length;B=B.substring(0,B.length-1);let C=h(B,P);if(C===!0)F=!0;else return b(C.err.code,C.err.msg,S(_,N+C.err.line))}else if(L)if(I.tagClosed){if(B.trim().length>0)return b("InvalidTag","Closing tag '"+q+"' can't have attributes or invalid starting.",S(_,k));if(E.length===0)return b("InvalidTag","Closing tag '"+q+"' has not been opened.",S(_,k));{let N=E.pop();if(q!==N.tagName){let C=S(_,N.tagStartPos);return b("InvalidTag","Expected closing tag '"+N.tagName+"' (opened in line "+C.line+", col "+C.col+") instead of closing tag '"+q+"'.",S(_,k))}E.length==0&&($=!0)}}else return b("InvalidTag","Closing tag '"+q+"' doesn't have proper closing.",S(_,O));else{let N=h(B,P);if(N!==!0)return b(N.err.code,N.err.msg,S(_,O-B.length+N.err.line));if($===!0)return b("InvalidXml","Multiple possible root nodes found.",S(_,O));P.unpairedTags.indexOf(q)!==-1||E.push({tagName:q,tagStartPos:k}),F=!0}for(O++;O<_.length;O++)if(_[O]==="<")if(_[O+1]==="!"){O++,O=u(_,O);continue}else if(_[O+1]==="?"){if(O=l(_,++O),O.err)return O}else break;else if(_[O]==="&"){let N=g(_,O);if(N==-1)return b("InvalidChar","char '&' is not expected.",S(_,O));O=N}else if($===!0&&!c(_[O]))return b("InvalidXml","Extra text at the end",S(_,O));_[O]==="<"&&O--}}else{if(c(_[O]))continue;return b("InvalidChar","char '"+_[O]+"' is not expected.",S(_,O))}if(F){if(E.length==1)return b("InvalidTag","Unclosed tag '"+E[0].tagName+"'.",S(_,E[0].tagStartPos));if(E.length>0)return b("InvalidXml","Invalid '"+JSON.stringify(E.map(O=>O.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1})}else return b("InvalidXml","Start tag expected.",1);return!0};function c(_){return _===" "||_===" "||_===`
195
195
  `||_==="\r"}function l(_,P){let E=P;for(;P<_.length;P++)if(_[P]=="?"||_[P]==" "){let F=_.substr(E,P-E);if(P>5&&F==="xml")return b("InvalidXml","XML declaration allowed only at the start of the document.",S(_,P));if(_[P]=="?"&&_[P+1]==">"){P++;break}else continue}return P}function u(_,P){if(_.length>P+5&&_[P+1]==="-"&&_[P+2]==="-"){for(P+=3;P<_.length;P++)if(_[P]==="-"&&_[P+1]==="-"&&_[P+2]===">"){P+=2;break}}else if(_.length>P+8&&_[P+1]==="D"&&_[P+2]==="O"&&_[P+3]==="C"&&_[P+4]==="T"&&_[P+5]==="Y"&&_[P+6]==="P"&&_[P+7]==="E"){let E=1;for(P+=8;P<_.length;P++)if(_[P]==="<")E++;else if(_[P]===">"&&(E--,E===0))break}else if(_.length>P+9&&_[P+1]==="["&&_[P+2]==="C"&&_[P+3]==="D"&&_[P+4]==="A"&&_[P+5]==="T"&&_[P+6]==="A"&&_[P+7]==="["){for(P+=8;P<_.length;P++)if(_[P]==="]"&&_[P+1]==="]"&&_[P+2]===">"){P+=2;break}}return P}let p='"',d="'";function m(_,P){let E="",F="",$=!1;for(;P<_.length;P++){if(_[P]===p||_[P]===d)F===""?F=_[P]:F!==_[P]||(F="");else if(_[P]===">"&&F===""){$=!0;break}E+=_[P]}return F!==""?!1:{value:E,index:P,tagClosed:$}}let f=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function h(_,P){let E=o.getAllMatches(_,f),F={};for(let $=0;$<E.length;$++){if(E[$][1].length===0)return b("InvalidAttr","Attribute '"+E[$][2]+"' has no space in starting.",T(E[$]));if(E[$][3]!==void 0&&E[$][4]===void 0)return b("InvalidAttr","Attribute '"+E[$][2]+"' is without value.",T(E[$]));if(E[$][3]===void 0&&!P.allowBooleanAttributes)return b("InvalidAttr","boolean attribute '"+E[$][2]+"' is not allowed.",T(E[$]));let O=E[$][2];if(!w(O))return b("InvalidAttr","Attribute '"+O+"' is an invalid name.",T(E[$]));if(!F.hasOwnProperty(O))F[O]=1;else return b("InvalidAttr","Attribute '"+O+"' is repeated.",T(E[$]))}return!0}function y(_,P){let E=/\d/;for(_[P]==="x"&&(P++,E=/[\da-fA-F]/);P<_.length;P++){if(_[P]===";")return P;if(!_[P].match(E))break}return-1}function g(_,P){if(P++,_[P]===";")return-1;if(_[P]==="#")return P++,y(_,P);let E=0;for(;P<_.length;P++,E++)if(!(_[P].match(/\w/)&&E<20)){if(_[P]===";")break;return-1}return P}function b(_,P,E){return{err:{code:_,msg:P,line:E.line||E,col:E.col}}}function w(_){return o.isName(_)}function x(_){return o.isName(_)}function S(_,P){let E=_.substring(0,P).split(/\r?\n/);return{line:E.length,col:E[E.length-1].length+1}}function T(_){return _.startIndex+_[1].length}},{"./util":3}],5:[function(n,i,s){"use strict";let o=n("./orderedJs2Xml"),a=n("../ignoreAttributes"),c={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(f,h){return h},attributeValueProcessor:function(f,h){return h},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:new RegExp("&","g"),val:"&amp;"},{regex:new RegExp(">","g"),val:"&gt;"},{regex:new RegExp("<","g"),val:"&lt;"},{regex:new RegExp("'","g"),val:"&apos;"},{regex:new RegExp('"',"g"),val:"&quot;"}],processEntities:!0,stopNodes:[],oneListGroup:!1};function l(f){this.options=Object.assign({},c,f),this.options.ignoreAttributes===!0||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.ignoreAttributesFn=a(this.options.ignoreAttributes),this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=m),this.processTextOrObjNode=u,this.options.format?(this.indentate=d,this.tagEndChar=`>
196
196
  `,this.newLine=`
197
197
  `):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}l.prototype.build=function(f){return this.options.preserveOrder?o(f,this.options):(Array.isArray(f)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(f={[this.options.arrayNodeName]:f}),this.j2x(f,0,[]).val)},l.prototype.j2x=function(f,h,y){let g="",b="",w=y.join(".");for(let x in f)if(Object.prototype.hasOwnProperty.call(f,x))if(typeof f[x]>"u")this.isAttribute(x)&&(b+="");else if(f[x]===null)this.isAttribute(x)?b+="":x[0]==="?"?b+=this.indentate(h)+"<"+x+"?"+this.tagEndChar:b+=this.indentate(h)+"<"+x+"/"+this.tagEndChar;else if(f[x]instanceof Date)b+=this.buildTextValNode(f[x],x,"",h);else if(typeof f[x]!="object"){let S=this.isAttribute(x);if(S&&!this.ignoreAttributesFn(S,w))g+=this.buildAttrPairStr(S,""+f[x]);else if(!S)if(x===this.options.textNodeName){let T=this.options.tagValueProcessor(x,""+f[x]);b+=this.replaceEntitiesValue(T)}else b+=this.buildTextValNode(f[x],x,"",h)}else if(Array.isArray(f[x])){let S=f[x].length,T="",_="";for(let P=0;P<S;P++){let E=f[x][P];if(!(typeof E>"u"))if(E===null)x[0]==="?"?b+=this.indentate(h)+"<"+x+"?"+this.tagEndChar:b+=this.indentate(h)+"<"+x+"/"+this.tagEndChar;else if(typeof E=="object")if(this.options.oneListGroup){let F=this.j2x(E,h+1,y.concat(x));T+=F.val,this.options.attributesGroupName&&E.hasOwnProperty(this.options.attributesGroupName)&&(_+=F.attrStr)}else T+=this.processTextOrObjNode(E,x,h,y);else if(this.options.oneListGroup){let F=this.options.tagValueProcessor(x,E);F=this.replaceEntitiesValue(F),T+=F}else T+=this.buildTextValNode(E,x,"",h)}this.options.oneListGroup&&(T=this.buildObjectNode(T,x,_,h)),b+=T}else if(this.options.attributesGroupName&&x===this.options.attributesGroupName){let S=Object.keys(f[x]),T=S.length;for(let _=0;_<T;_++)g+=this.buildAttrPairStr(S[_],""+f[x][S[_]])}else b+=this.processTextOrObjNode(f[x],x,h,y);return{attrStr:g,val:b}},l.prototype.buildAttrPairStr=function(f,h){return h=this.options.attributeValueProcessor(f,""+h),h=this.replaceEntitiesValue(h),this.options.suppressBooleanAttributes&&h==="true"?" "+f:" "+f+'="'+h+'"'};function u(f,h,y,g){let b=this.j2x(f,y+1,g.concat(h));return f[this.options.textNodeName]!==void 0&&Object.keys(f).length===1?this.buildTextValNode(f[this.options.textNodeName],h,b.attrStr,y):this.buildObjectNode(b.val,h,b.attrStr,y)}l.prototype.buildObjectNode=function(f,h,y,g){if(f==="")return h[0]==="?"?this.indentate(g)+"<"+h+y+"?"+this.tagEndChar:this.indentate(g)+"<"+h+y+this.closeTag(h)+this.tagEndChar;{let b="</"+h+this.tagEndChar,w="";return h[0]==="?"&&(w="?",b=""),(y||y==="")&&f.indexOf("<")===-1?this.indentate(g)+"<"+h+y+w+">"+f+b:this.options.commentPropName!==!1&&h===this.options.commentPropName&&w.length===0?this.indentate(g)+`<!--${f}-->`+this.newLine:this.indentate(g)+"<"+h+y+w+this.tagEndChar+f+this.indentate(g)+b}},l.prototype.closeTag=function(f){let h="";return this.options.unpairedTags.indexOf(f)!==-1?this.options.suppressUnpairedNode||(h="/"):this.options.suppressEmptyNode?h="/":h=`></${f}`,h};function p(f,h,y,g){return f!==""?this.buildObjectNode(f,h,y,g):h[0]==="?"?this.indentate(g)+"<"+h+y+"?"+this.tagEndChar:this.indentate(g)+"<"+h+y+"/"+this.tagEndChar}l.prototype.buildTextValNode=function(f,h,y,g){if(this.options.cdataPropName!==!1&&h===this.options.cdataPropName)return this.indentate(g)+`<![CDATA[${f}]]>`+this.newLine;if(this.options.commentPropName!==!1&&h===this.options.commentPropName)return this.indentate(g)+`<!--${f}-->`+this.newLine;if(h[0]==="?")return this.indentate(g)+"<"+h+y+"?"+this.tagEndChar;{let b=this.options.tagValueProcessor(h,f);return b=this.replaceEntitiesValue(b),b===""?this.indentate(g)+"<"+h+y+this.closeTag(h)+this.tagEndChar:this.indentate(g)+"<"+h+y+">"+b+"</"+h+this.tagEndChar}},l.prototype.replaceEntitiesValue=function(f){if(f&&f.length>0&&this.options.processEntities)for(let h=0;h<this.options.entities.length;h++){let y=this.options.entities[h];f=f.replace(y.regex,y.val)}return f};function d(f){return this.options.indentBy.repeat(f)}function m(f){return f.startsWith(this.options.attributeNamePrefix)&&f!==this.options.textNodeName?f.substr(this.attrPrefixLen):!1}i.exports=l},{"../ignoreAttributes":2,"./orderedJs2Xml":6}],6:[function(n,i,s){let o=`
198
198
  `;function a(m,f){let h="";return f.format&&f.indentBy.length>0&&(h=o),c(m,f,"",h)}function c(m,f,h,y){let g="",b=!1;for(let w=0;w<m.length;w++){let x=m[w],S=l(x);if(S===void 0)continue;let T="";if(h.length===0?T=S:T=`${h}.${S}`,S===f.textNodeName){let $=x[S];p(T,f)||($=f.tagValueProcessor(S,$),$=d($,f)),b&&(g+=y),g+=$,b=!1;continue}else if(S===f.cdataPropName){b&&(g+=y),g+=`<![CDATA[${x[S][0][f.textNodeName]}]]>`,b=!1;continue}else if(S===f.commentPropName){g+=y+`<!--${x[S][0][f.textNodeName]}-->`,b=!0;continue}else if(S[0]==="?"){let $=u(x[":@"],f),O=S==="?xml"?"":y,k=x[S][0][f.textNodeName];k=k.length!==0?" "+k:"",g+=O+`<${S}${k}${$}?>`,b=!0;continue}let _=y;_!==""&&(_+=f.indentBy);let P=u(x[":@"],f),E=y+`<${S}${P}`,F=c(x[S],f,T,_);f.unpairedTags.indexOf(S)!==-1?f.suppressUnpairedNode?g+=E+">":g+=E+"/>":(!F||F.length===0)&&f.suppressEmptyNode?g+=E+"/>":F&&F.endsWith(">")?g+=E+`>${F}${y}</${S}>`:(g+=E+">",F&&y!==""&&(F.includes("/>")||F.includes("</"))?g+=y+f.indentBy+F+y:g+=F,g+=`</${S}>`),b=!0}return g}function l(m){let f=Object.keys(m);for(let h=0;h<f.length;h++){let y=f[h];if(m.hasOwnProperty(y)&&y!==":@")return y}}function u(m,f){let h="";if(m&&!f.ignoreAttributes)for(let y in m){if(!m.hasOwnProperty(y))continue;let g=f.attributeValueProcessor(y,m[y]);g=d(g,f),g===!0&&f.suppressBooleanAttributes?h+=` ${y.substr(f.attributeNamePrefix.length)}`:h+=` ${y.substr(f.attributeNamePrefix.length)}="${g}"`}return h}function p(m,f){m=m.substr(0,m.length-f.textNodeName.length-1);let h=m.substr(m.lastIndexOf(".")+1);for(let y in f.stopNodes)if(f.stopNodes[y]===m||f.stopNodes[y]==="*."+h)return!0;return!1}function d(m,f){if(m&&m.length>0&&f.processEntities)for(let h=0;h<f.entities.length;h++){let y=f.entities[h];m=m.replace(y.regex,y.val)}return m}i.exports=a},{}],7:[function(n,i,s){let o=n("../util");function a(h,y){let g={};if(h[y+3]==="O"&&h[y+4]==="C"&&h[y+5]==="T"&&h[y+6]==="Y"&&h[y+7]==="P"&&h[y+8]==="E"){y=y+9;let b=1,w=!1,x=!1,S="";for(;y<h.length;y++)if(h[y]==="<"&&!x){if(w&&u(h,y))y+=7,[entityName,val,y]=c(h,y+1),val.indexOf("&")===-1&&(g[f(entityName)]={regx:RegExp(`&${entityName};`,"g"),val});else if(w&&p(h,y))y+=8;else if(w&&d(h,y))y+=8;else if(w&&m(h,y))y+=9;else if(l)x=!0;else throw new Error("Invalid DOCTYPE");b++,S=""}else if(h[y]===">"){if(x?h[y-1]==="-"&&h[y-2]==="-"&&(x=!1,b--):b--,b===0)break}else h[y]==="["?w=!0:S+=h[y];if(b!==0)throw new Error("Unclosed DOCTYPE")}else throw new Error("Invalid Tag instead of DOCTYPE");return{entities:g,i:y}}function c(h,y){let g="";for(;y<h.length&&h[y]!=="'"&&h[y]!=='"';y++)g+=h[y];if(g=g.trim(),g.indexOf(" ")!==-1)throw new Error("External entites are not supported");let b=h[y++],w="";for(;y<h.length&&h[y]!==b;y++)w+=h[y];return[g,w,y]}function l(h,y){return h[y+1]==="!"&&h[y+2]==="-"&&h[y+3]==="-"}function u(h,y){return h[y+1]==="!"&&h[y+2]==="E"&&h[y+3]==="N"&&h[y+4]==="T"&&h[y+5]==="I"&&h[y+6]==="T"&&h[y+7]==="Y"}function p(h,y){return h[y+1]==="!"&&h[y+2]==="E"&&h[y+3]==="L"&&h[y+4]==="E"&&h[y+5]==="M"&&h[y+6]==="E"&&h[y+7]==="N"&&h[y+8]==="T"}function d(h,y){return h[y+1]==="!"&&h[y+2]==="A"&&h[y+3]==="T"&&h[y+4]==="T"&&h[y+5]==="L"&&h[y+6]==="I"&&h[y+7]==="S"&&h[y+8]==="T"}function m(h,y){return h[y+1]==="!"&&h[y+2]==="N"&&h[y+3]==="O"&&h[y+4]==="T"&&h[y+5]==="A"&&h[y+6]==="T"&&h[y+7]==="I"&&h[y+8]==="O"&&h[y+9]==="N"}function f(h){if(o.isName(h))return h;throw new Error(`Invalid entity name ${h}`)}i.exports=a},{"../util":3}],8:[function(n,i,s){let o={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(c,l){return l},attributeValueProcessor:function(c,l){return l},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(c,l,u){return c}},a=function(c){return Object.assign({},o,c)};s.buildOptions=a,s.defaultOptions=o},{}],9:[function(n,i,s){"use strict";let o=n("../util"),a=n("./xmlNode"),c=n("./DocTypeReader"),l=n("strnum"),u=n("../ignoreAttributes");class p{constructor(O){this.options=O,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:"'"},gt:{regex:/&(gt|#62|#x3E);/g,val:">"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"\xA2"},pound:{regex:/&(pound|#163);/g,val:"\xA3"},yen:{regex:/&(yen|#165);/g,val:"\xA5"},euro:{regex:/&(euro|#8364);/g,val:"\u20AC"},copyright:{regex:/&(copy|#169);/g,val:"\xA9"},reg:{regex:/&(reg|#174);/g,val:"\xAE"},inr:{regex:/&(inr|#8377);/g,val:"\u20B9"},num_dec:{regex:/&#([0-9]{1,7});/g,val:(k,L)=>String.fromCharCode(Number.parseInt(L,10))},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:(k,L)=>String.fromCharCode(Number.parseInt(L,16))}},this.addExternalEntities=d,this.parseXml=g,this.parseTextData=m,this.resolveNameSpace=f,this.buildAttributesMap=y,this.isItStopNode=S,this.replaceEntitiesValue=w,this.readStopNodeData=E,this.saveTextToParentTag=x,this.addChild=b,this.ignoreAttributesFn=u(this.options.ignoreAttributes)}}function d($){let O=Object.keys($);for(let k=0;k<O.length;k++){let L=O[k];this.lastEntities[L]={regex:new RegExp("&"+L+";","g"),val:$[L]}}}function m($,O,k,L,q,I,B){if($!==void 0&&(this.options.trimValues&&!L&&($=$.trim()),$.length>0)){B||($=this.replaceEntitiesValue($));let N=this.options.tagValueProcessor(O,$,k,q,I);return N==null?$:typeof N!=typeof $||N!==$?N:this.options.trimValues?F($,this.options.parseTagValue,this.options.numberParseOptions):$.trim()===$?F($,this.options.parseTagValue,this.options.numberParseOptions):$}}function f($){if(this.options.removeNSPrefix){let O=$.split(":"),k=$.charAt(0)==="/"?"/":"";if(O[0]==="xmlns")return"";O.length===2&&($=k+O[1])}return $}let h=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,"gm");function y($,O,k){if(this.options.ignoreAttributes!==!0&&typeof $=="string"){let L=o.getAllMatches($,h),q=L.length,I={};for(let B=0;B<q;B++){let N=this.resolveNameSpace(L[B][1]);if(this.ignoreAttributesFn(N,O))continue;let C=L[B][4],H=this.options.attributeNamePrefix+N;if(N.length)if(this.options.transformAttributeName&&(H=this.options.transformAttributeName(H)),H==="__proto__"&&(H="#__proto__"),C!==void 0){this.options.trimValues&&(C=C.trim()),C=this.replaceEntitiesValue(C);let V=this.options.attributeValueProcessor(N,C,O);V==null?I[H]=C:typeof V!=typeof C||V!==C?I[H]=V:I[H]=F(C,this.options.parseAttributeValue,this.options.numberParseOptions)}else this.options.allowBooleanAttributes&&(I[H]=!0)}if(!Object.keys(I).length)return;if(this.options.attributesGroupName){let B={};return B[this.options.attributesGroupName]=I,B}return I}}let g=function($){$=$.replace(/\r\n?/g,`
199
- `);let O=new a("!xml"),k=O,L="",q="";for(let I=0;I<$.length;I++)if($[I]==="<")if($[I+1]==="/"){let N=_($,">",I,"Closing Tag is not closed."),C=$.substring(I+2,N).trim();if(this.options.removeNSPrefix){let re=C.indexOf(":");re!==-1&&(C=C.substr(re+1))}this.options.transformTagName&&(C=this.options.transformTagName(C)),k&&(L=this.saveTextToParentTag(L,k,q));let H=q.substring(q.lastIndexOf(".")+1);if(C&&this.options.unpairedTags.indexOf(C)!==-1)throw new Error(`Unpaired tag can not be used as closing tag: </${C}>`);let V=0;H&&this.options.unpairedTags.indexOf(H)!==-1?(V=q.lastIndexOf(".",q.lastIndexOf(".")-1),this.tagsNodeStack.pop()):V=q.lastIndexOf("."),q=q.substring(0,V),k=this.tagsNodeStack.pop(),L="",I=N}else if($[I+1]==="?"){let N=P($,I,!1,"?>");if(!N)throw new Error("Pi Tag is not closed.");if(L=this.saveTextToParentTag(L,k,q),!(this.options.ignoreDeclaration&&N.tagName==="?xml"||this.options.ignorePiTags)){let C=new a(N.tagName);C.add(this.options.textNodeName,""),N.tagName!==N.tagExp&&N.attrExpPresent&&(C[":@"]=this.buildAttributesMap(N.tagExp,q,N.tagName)),this.addChild(k,C,q)}I=N.closeIndex+1}else if($.substr(I+1,3)==="!--"){let N=_($,"-->",I+4,"Comment is not closed.");if(this.options.commentPropName){let C=$.substring(I+4,N-2);L=this.saveTextToParentTag(L,k,q),k.add(this.options.commentPropName,[{[this.options.textNodeName]:C}])}I=N}else if($.substr(I+1,2)==="!D"){let N=c($,I);this.docTypeEntities=N.entities,I=N.i}else if($.substr(I+1,2)==="!["){let N=_($,"]]>",I,"CDATA is not closed.")-2,C=$.substring(I+9,N);L=this.saveTextToParentTag(L,k,q);let H=this.parseTextData(C,k.tagname,q,!0,!1,!0,!0);H==null&&(H=""),this.options.cdataPropName?k.add(this.options.cdataPropName,[{[this.options.textNodeName]:C}]):k.add(this.options.textNodeName,H),I=N+2}else{let N=P($,I,this.options.removeNSPrefix),C=N.tagName,H=N.rawTagName,V=N.tagExp,re=N.attrExpPresent,he=N.closeIndex;this.options.transformTagName&&(C=this.options.transformTagName(C)),k&&L&&k.tagname!=="!xml"&&(L=this.saveTextToParentTag(L,k,q,!1));let Ve=k;if(Ve&&this.options.unpairedTags.indexOf(Ve.tagname)!==-1&&(k=this.tagsNodeStack.pop(),q=q.substring(0,q.lastIndexOf("."))),C!==O.tagname&&(q+=q?"."+C:C),this.isItStopNode(this.options.stopNodes,q,C)){let Ce="";if(V.length>0&&V.lastIndexOf("/")===V.length-1)C[C.length-1]==="/"?(C=C.substr(0,C.length-1),q=q.substr(0,q.length-1),V=C):V=V.substr(0,V.length-1),I=N.closeIndex;else if(this.options.unpairedTags.indexOf(C)!==-1)I=N.closeIndex;else{let ye=this.readStopNodeData($,H,he+1);if(!ye)throw new Error(`Unexpected end of ${H}`);I=ye.i,Ce=ye.tagContent}let J=new a(C);C!==V&&re&&(J[":@"]=this.buildAttributesMap(V,q,C)),Ce&&(Ce=this.parseTextData(Ce,C,q,!0,re,!0,!0)),q=q.substr(0,q.lastIndexOf(".")),J.add(this.options.textNodeName,Ce),this.addChild(k,J,q)}else{if(V.length>0&&V.lastIndexOf("/")===V.length-1){C[C.length-1]==="/"?(C=C.substr(0,C.length-1),q=q.substr(0,q.length-1),V=C):V=V.substr(0,V.length-1),this.options.transformTagName&&(C=this.options.transformTagName(C));let Ce=new a(C);C!==V&&re&&(Ce[":@"]=this.buildAttributesMap(V,q,C)),this.addChild(k,Ce,q),q=q.substr(0,q.lastIndexOf("."))}else{let Ce=new a(C);this.tagsNodeStack.push(k),C!==V&&re&&(Ce[":@"]=this.buildAttributesMap(V,q,C)),this.addChild(k,Ce,q),k=Ce}L="",I=he}}else L+=$[I];return O.child};function b($,O,k){let L=this.options.updateTag(O.tagname,k,O[":@"]);L===!1||(typeof L=="string"&&(O.tagname=L),$.addChild(O))}let w=function($){if(this.options.processEntities){for(let O in this.docTypeEntities){let k=this.docTypeEntities[O];$=$.replace(k.regx,k.val)}for(let O in this.lastEntities){let k=this.lastEntities[O];$=$.replace(k.regex,k.val)}if(this.options.htmlEntities)for(let O in this.htmlEntities){let k=this.htmlEntities[O];$=$.replace(k.regex,k.val)}$=$.replace(this.ampEntity.regex,this.ampEntity.val)}return $};function x($,O,k,L){return $&&(L===void 0&&(L=Object.keys(O.child).length===0),$=this.parseTextData($,O.tagname,k,!1,O[":@"]?Object.keys(O[":@"]).length!==0:!1,L),$!==void 0&&$!==""&&O.add(this.options.textNodeName,$),$=""),$}function S($,O,k){let L="*."+k;for(let q in $){let I=$[q];if(L===I||O===I)return!0}return!1}function T($,O,k=">"){let L,q="";for(let I=O;I<$.length;I++){let B=$[I];if(L)B===L&&(L="");else if(B==='"'||B==="'")L=B;else if(B===k[0])if(k[1]){if($[I+1]===k[1])return{data:q,index:I}}else return{data:q,index:I};else B===" "&&(B=" ");q+=B}}function _($,O,k,L){let q=$.indexOf(O,k);if(q===-1)throw new Error(L);return q+O.length-1}function P($,O,k,L=">"){let q=T($,O+1,L);if(!q)return;let I=q.data,B=q.index,N=I.search(/\s/),C=I,H=!0;N!==-1&&(C=I.substring(0,N),I=I.substring(N+1).trimStart());let V=C;if(k){let re=C.indexOf(":");re!==-1&&(C=C.substr(re+1),H=C!==q.data.substr(re+1))}return{tagName:C,tagExp:I,closeIndex:B,attrExpPresent:H,rawTagName:V}}function E($,O,k){let L=k,q=1;for(;k<$.length;k++)if($[k]==="<")if($[k+1]==="/"){let I=_($,">",k,`${O} is not closed`);if($.substring(k+2,I).trim()===O&&(q--,q===0))return{tagContent:$.substring(L,k),i:I};k=I}else if($[k+1]==="?")k=_($,"?>",k+1,"StopNode is not closed.");else if($.substr(k+1,3)==="!--")k=_($,"-->",k+3,"StopNode is not closed.");else if($.substr(k+1,2)==="![")k=_($,"]]>",k,"StopNode is not closed.")-2;else{let I=P($,k,">");I&&((I&&I.tagName)===O&&I.tagExp[I.tagExp.length-1]!=="/"&&q++,k=I.closeIndex)}}function F($,O,k){if(O&&typeof $=="string"){let L=$.trim();return L==="true"?!0:L==="false"?!1:l($,k)}else return o.isExist($)?$:""}i.exports=p},{"../ignoreAttributes":2,"../util":3,"./DocTypeReader":7,"./xmlNode":12,strnum:15}],10:[function(n,i,s){let{buildOptions:o}=n("./OptionsBuilder"),a=n("./OrderedObjParser"),{prettify:c}=n("./node2json"),l=n("../validator");class u{constructor(d){this.externalEntities={},this.options=o(d)}parse(d,m){if(typeof d!="string")if(d.toString)d=d.toString();else throw new Error("XML data is accepted in String or Bytes[] form.");if(m){m===!0&&(m={});let y=l.validate(d,m);if(y!==!0)throw Error(`${y.err.msg}:${y.err.line}:${y.err.col}`)}let f=new a(this.options);f.addExternalEntities(this.externalEntities);let h=f.parseXml(d);return this.options.preserveOrder||h===void 0?h:c(h,this.options)}addEntity(d,m){if(m.indexOf("&")!==-1)throw new Error("Entity value can't have '&'");if(d.indexOf("&")!==-1||d.indexOf(";")!==-1)throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '&#xD;'");if(m==="&")throw new Error("An entity with value '&' is not permitted");this.externalEntities[d]=m}}i.exports=u},{"../validator":4,"./OptionsBuilder":8,"./OrderedObjParser":9,"./node2json":11}],11:[function(n,i,s){"use strict";function o(p,d){return a(p,d)}function a(p,d,m){let f,h={};for(let y=0;y<p.length;y++){let g=p[y],b=c(g),w="";if(m===void 0?w=b:w=m+"."+b,b===d.textNodeName)f===void 0?f=g[b]:f+=""+g[b];else{if(b===void 0)continue;if(g[b]){let x=a(g[b],d,w),S=u(x,d);g[":@"]?l(x,g[":@"],w,d):Object.keys(x).length===1&&x[d.textNodeName]!==void 0&&!d.alwaysCreateTextNode?x=x[d.textNodeName]:Object.keys(x).length===0&&(d.alwaysCreateTextNode?x[d.textNodeName]="":x=""),h[b]!==void 0&&h.hasOwnProperty(b)?(Array.isArray(h[b])||(h[b]=[h[b]]),h[b].push(x)):d.isArray(b,w,S)?h[b]=[x]:h[b]=x}}}return typeof f=="string"?f.length>0&&(h[d.textNodeName]=f):f!==void 0&&(h[d.textNodeName]=f),h}function c(p){let d=Object.keys(p);for(let m=0;m<d.length;m++){let f=d[m];if(f!==":@")return f}}function l(p,d,m,f){if(d){let h=Object.keys(d),y=h.length;for(let g=0;g<y;g++){let b=h[g];f.isArray(b,m+"."+b,!0,!0)?p[b]=[d[b]]:p[b]=d[b]}}}function u(p,d){let{textNodeName:m}=d,f=Object.keys(p).length;return!!(f===0||f===1&&(p[m]||typeof p[m]=="boolean"||p[m]===0))}s.prettify=o},{}],12:[function(n,i,s){"use strict";class o{constructor(c){this.tagname=c,this.child=[],this[":@"]={}}add(c,l){c==="__proto__"&&(c="#__proto__"),this.child.push({[c]:l})}addChild(c){c.tagname==="__proto__"&&(c.tagname="#__proto__"),c[":@"]&&Object.keys(c[":@"]).length>0?this.child.push({[c.tagname]:c.child,":@":c[":@"]}):this.child.push({[c.tagname]:c.child})}}i.exports=o},{}],13:[function(n,i,s){var o=Object.prototype.hasOwnProperty,a=Object.prototype.toString;i.exports=function(l,u,p){if(a.call(u)!=="[object Function]")throw new TypeError("iterator must be a function");var d=l.length;if(d===+d)for(var m=0;m<d;m++)u.call(p,l[m],m,l);else for(var f in l)o.call(l,f)&&u.call(p,l[f],f,l)}},{}],14:[function(n,i,s){"use strict";var o=n("foreach");i.exports=a;function a(c,l,u){if(arguments.length===3)return a.set(c,l,u);if(arguments.length===2)return a.get(c,l);var p=a.bind(a,c);for(var d in a)a.hasOwnProperty(d)&&(p[d]=a[d].bind(p,c));return p}a.get=function(l,u){for(var p=Array.isArray(u)?u:a.parse(u),d=0;d<p.length;++d){var m=p[d];if(!(typeof l=="object"&&m in l))throw new Error("Invalid reference token: "+m);l=l[m]}return l},a.set=function(l,u,p){var d=Array.isArray(u)?u:a.parse(u),m=d[0];if(d.length===0)throw Error("Can not set the root object");for(var f=0;f<d.length-1;++f){var h=d[f];typeof h!="string"&&typeof h!="number"&&(h=String(h)),!(h==="__proto__"||h==="constructor"||h==="prototype")&&(h==="-"&&Array.isArray(l)&&(h=l.length),m=d[f+1],h in l||(m.match(/^(\d+|-)$/)?l[h]=[]:l[h]={}),l=l[h])}return m==="-"&&Array.isArray(l)&&(m=l.length),l[m]=p,this},a.remove=function(c,l){var u=Array.isArray(l)?l:a.parse(l),p=u[u.length-1];if(p===void 0)throw new Error('Invalid JSON pointer for remove: "'+l+'"');var d=a.get(c,u.slice(0,-1));if(Array.isArray(d)){var m=+p;if(p===""&&isNaN(m))throw new Error('Invalid array index: "'+p+'"');Array.prototype.splice.call(d,m,1)}else delete d[p]},a.dict=function(l,u){var p={};return a.walk(l,function(d,m){p[m]=d},u),p},a.walk=function(l,u,p){var d=[];p=p||function(m){var f=Object.prototype.toString.call(m);return f==="[object Object]"||f==="[object Array]"},function m(f){o(f,function(h,y){d.push(String(y)),p(h)?m(h):u(h,a.compile(d)),d.pop()})}(l)},a.has=function(l,u){try{a.get(l,u)}catch{return!1}return!0},a.escape=function(l){return l.toString().replace(/~/g,"~0").replace(/\//g,"~1")},a.unescape=function(l){return l.replace(/~1/g,"/").replace(/~0/g,"~")},a.parse=function(l){if(l==="")return[];if(l.charAt(0)!=="/")throw new Error("Invalid JSON pointer: "+l);return l.substring(1).split(/\//).map(a.unescape)},a.compile=function(l){return l.length===0?"":"/"+l.map(a.escape).join("/")}},{foreach:13}],15:[function(n,i,s){let o=/^[-+]?0x[a-fA-F0-9]+$/,a=/^([\-\+])?(0*)(\.[0-9]+([eE]\-?[0-9]+)?|[0-9]+(\.[0-9]+([eE]\-?[0-9]+)?)?)$/;!Number.parseInt&&window.parseInt&&(Number.parseInt=window.parseInt),!Number.parseFloat&&window.parseFloat&&(Number.parseFloat=window.parseFloat);let c={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};function l(p,d={}){if(d=Object.assign({},c,d),!p||typeof p!="string")return p;let m=p.trim();if(d.skipLike!==void 0&&d.skipLike.test(m))return p;if(d.hex&&o.test(m))return Number.parseInt(m,16);{let f=a.exec(m);if(f){let h=f[1],y=f[2],g=u(f[3]),b=f[4]||f[6];if(!d.leadingZeros&&y.length>0&&h&&m[2]!==".")return p;if(!d.leadingZeros&&y.length>0&&!h&&m[1]!==".")return p;{let w=Number(m),x=""+w;return x.search(/[eE]/)!==-1||b?d.eNotation?w:p:m.indexOf(".")!==-1?x==="0"&&g===""||x===g||h&&x==="-"+g?w:p:y?g===x||h+g===x?w:p:m===x||m===h+x?w:p}}else return p}}function u(p){return p&&p.indexOf(".")!==-1&&(p=p.replace(/0+$/,""),p==="."?p="0":p[0]==="."?p="0"+p:p[p.length-1]==="."&&(p=p.substr(0,p.length-1))),p}i.exports=l},{}],16:[function(n,i,s){"use strict";Object.defineProperty(s,"__esModule",{value:!0}),s.allOfSample=c;var o=n("./traverse"),a=n("./utils");function c(l,u,p,d,m){let f=(0,o.traverse)(l,p,d),h=[];for(let y of u){let{type:g,readOnly:b,writeOnly:w,value:x}=(0,o.traverse)({type:f.type,...y},p,d,m);f.type&&g&&g!==f.type&&(console.warn("allOf: schemas with different types can't be merged"),f.type=g),f.type=f.type||g,f.readOnly=f.readOnly||b,f.writeOnly=f.writeOnly||w,x!=null&&h.push(x)}if(f.type==="object")return f.value=(0,a.mergeDeep)(f.value||{},...h.filter(y=>typeof y=="object")),f;{f.type==="array"&&(p.quiet||console.warn('OpenAPI Sampler: found allOf with "array" type. Result may be incorrect'));let y=h[h.length-1];return f.value=y!=null?y:f.value,f}}},{"./traverse":26,"./utils":27}],17:[function(n,i,s){"use strict";Object.defineProperty(s,"__esModule",{value:!0}),s.inferType=a;let o={multipleOf:"number",maximum:"number",exclusiveMaximum:"number",minimum:"number",exclusiveMinimum:"number",maxLength:"string",minLength:"string",pattern:"string",items:"array",maxItems:"array",minItems:"array",uniqueItems:"array",additionalItems:"array",maxProperties:"object",minProperties:"object",required:"object",additionalProperties:"object",properties:"object",patternProperties:"object",dependencies:"object"};function a(c){if(c.type!==void 0)return Array.isArray(c.type)?c.type.length===0?null:c.type[0]:c.type;let l=Object.keys(o);for(var u=0;u<l.length;u++){let p=l[u],d=o[p];if(c[p]!==void 0)return d}return null}},{}],18:[function(n,i,s){"use strict";Object.defineProperty(s,"__esModule",{value:!0}),s._registerSampler=f,s._samplers=void 0,Object.defineProperty(s,"inferType",{enumerable:!0,get:function(){return l.inferType}}),s.sample=m;var o=n("./traverse"),a=n("./samplers/index"),c=n("fast-xml-parser"),l=n("./infer"),u=s._samplers={};let p={skipReadOnly:!1,maxSampleDepth:15};function d(h,y){var b;if(!h)throw new Error("Unknown format output for building XML.");return(Array.isArray(h)||Object.keys(h).length>1)&&(h={[((b=y==null?void 0:y.xml)==null?void 0:b.name)||"root"]:h}),new c.XMLBuilder({ignoreAttributes:!1,format:!0,attributeNamePrefix:"$",textNodeName:"#text"}).build(h)}function m(h,y,g){let b=Object.assign({},p,y);(0,o.clearCache)();let w=(0,o.traverse)(h,b,g).value;return(b==null?void 0:b.format)==="xml"?d(w,h):w}function f(h,y){u[h]=y}f("array",a.sampleArray),f("boolean",a.sampleBoolean),f("integer",a.sampleNumber),f("number",a.sampleNumber),f("object",a.sampleObject),f("string",a.sampleString)},{"./infer":17,"./samplers/index":21,"./traverse":26,"fast-xml-parser":1}],19:[function(n,i,s){"use strict";Object.defineProperty(s,"__esModule",{value:!0}),s.sampleArray=c;var o=n("../traverse"),a=n("../utils");function c(l){let u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},p=arguments.length>2?arguments[2]:void 0,d=arguments.length>3?arguments[3]:void 0,m=d&&d.depth||1,f=Math.min(l.maxItems!=null?l.maxItems:1/0,l.minItems||1),h=l.prefixItems||l.items||l.contains;Array.isArray(h)&&(f=Math.max(f,h.length));let y=b=>Array.isArray(h)?h[b]||{}:h||{},g=[];if(!h)return g;for(let b=0;b<f;b++){let w=y(b),{value:x}=(0,o.traverse)(w,u,p,{depth:m+1});if((u==null?void 0:u.format)==="xml"){let{value:S,propertyName:T}=(0,a.applyXMLAttributes)({value:x},w,d);T?(g!=null&&g[T]||(g={...g,[T]:[]}),g[T].push(S)):g={...g,...S}}else g.push(x)}if((u==null?void 0:u.format)==="xml"&&m===1){let{value:b,propertyName:w}=(0,a.applyXMLAttributes)({value:null},l,d);w&&(b?g=Array.isArray(g)?{[w]:{...b,...g.map(x=>({"#text":{...x}}))}}:{[w]:{...g,...b}}:g={[w]:g})}return g}},{"../traverse":26,"../utils":27}],20:[function(n,i,s){"use strict";Object.defineProperty(s,"__esModule",{value:!0}),s.sampleBoolean=o;function o(a){return!0}},{}],21:[function(n,i,s){"use strict";Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"sampleArray",{enumerable:!0,get:function(){return o.sampleArray}}),Object.defineProperty(s,"sampleBoolean",{enumerable:!0,get:function(){return a.sampleBoolean}}),Object.defineProperty(s,"sampleNumber",{enumerable:!0,get:function(){return c.sampleNumber}}),Object.defineProperty(s,"sampleObject",{enumerable:!0,get:function(){return l.sampleObject}}),Object.defineProperty(s,"sampleString",{enumerable:!0,get:function(){return u.sampleString}});var o=n("./array"),a=n("./boolean"),c=n("./number"),l=n("./object"),u=n("./string")},{"./array":19,"./boolean":20,"./number":22,"./object":23,"./string":25}],22:[function(n,i,s){"use strict";Object.defineProperty(s,"__esModule",{value:!0}),s.sampleNumber=o;function o(a){let c=0;if(a.type==="number"&&(a.format==="float"||a.format==="double")&&(c=.1),typeof a.exclusiveMinimum=="boolean"||typeof a.exclusiveMaximum=="boolean"){if(a.maximum&&a.minimum)return c=a.exclusiveMinimum?Math.floor(a.minimum)+1:a.minimum,(a.exclusiveMaximum&&c>=a.maximum||!a.exclusiveMaximum&&c>a.maximum)&&(c=(a.maximum+a.minimum)/2),c;if(a.minimum)return a.exclusiveMinimum?Math.floor(a.minimum)+1:a.minimum;if(a.maximum)return a.exclusiveMaximum?a.maximum>0?0:Math.floor(a.maximum)-1:a.maximum>0?0:a.maximum}else{if(a.minimum)return a.minimum;a.exclusiveMinimum?(c=Math.floor(a.exclusiveMinimum)+1,c===a.exclusiveMaximum&&(c=(c+Math.floor(a.exclusiveMaximum)-1)/2)):a.exclusiveMaximum?c=Math.floor(a.exclusiveMaximum)-1:a.maximum&&(c=a.maximum)}return c}},{}],23:[function(n,i,s){"use strict";Object.defineProperty(s,"__esModule",{value:!0}),s.sampleObject=c;var o=n("../traverse"),a=n("../utils");function c(l){let u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},p=arguments.length>2?arguments[2]:void 0,d=arguments.length>3?arguments[3]:void 0,m={},f=d&&d.depth||1;if(l&&typeof l.properties=="object"){let h=Array.isArray(l.required)?l.required:[],y={};for(let g of h)y[g]=!0;Object.keys(l.properties).forEach(g=>{if(u.skipNonRequired&&!y.hasOwnProperty(g))return;let b=(0,o.traverse)(l.properties[g],u,p,{propertyName:g,depth:f+1});if(!(u.skipReadOnly&&b.readOnly)&&!(u.skipWriteOnly&&b.writeOnly))if((u==null?void 0:u.format)==="xml"){let{propertyName:w,value:x}=(0,a.applyXMLAttributes)(b,l.properties[g],{propertyName:g});w?m[w]=x:m={...m,...x}}else m[g]=b.value})}if(l&&typeof l.additionalProperties=="object"){let h=l.additionalProperties["x-additionalPropertiesName"]||"property";m[`${String(h)}1`]=(0,o.traverse)(l.additionalProperties,u,p,{depth:f+1}).value,m[`${String(h)}2`]=(0,o.traverse)(l.additionalProperties,u,p,{depth:f+1}).value}if(l&&typeof l.properties=="object"&&l.maxProperties!==void 0&&Object.keys(m).length>l.maxProperties){let h={},y=0;(Array.isArray(l.required)?l.required:[]).forEach(b=>{m[b]!==void 0&&(h[b]=m[b],y++)}),Object.keys(m).forEach(b=>{y<l.maxProperties&&!h.hasOwnProperty(b)&&(h[b]=m[b],y++)}),m=h}return m}},{"../traverse":26,"../utils":27}],24:[function(n,i,s){"use strict";Object.defineProperty(s,"__esModule",{value:!0}),s.regexSample=l;function o(){return!0}function a(u,p){return u}function c(u,p,d){let m=1;if(u)switch(u){case"?":{m=o()?0:1;break}case"*":{m=a(0,8);break}case"+":{m=a(1,8);break}default:throw new Error("Unknown quantifier symbol provided.")}else p!=null&&d!=null?m=a(parseInt(p),parseInt(d)):p!=null&&d==null&&(m=parseInt(p));return m}function l(u){var S,T;let p=!1;u instanceof RegExp&&(p=u.flags.includes("i"),u=u.toString(),u=(T=(S=u.match(/\/(.+?)\//))==null?void 0:S[1])!=null?T:"");let d,m,f,h=/([.A-Za-z0-9])(?:\{(\d+)(?:\,(\d+)|)\}|(\?|\*|\+))(?![^[]*]|[^{]*})/,y=u.match(h);for(;y!=null;){let _=y[2],P=y[3],E=y[4];f=c(E,_,P),u=u.slice(0,y.index)+y[1].repeat(f)+u.slice(y.index+y[0].length),y=u.match(h)}let g=/(\d-\d|\w-\w|\d|\w|[-!@#$&()`.+,/"])/,b=/\[(\^|)(-|)(.+?)\](?:\{(\d+)(?:\,(\d+)|)\}|(\?|\*|\+)|)/;for(y=u.match(b);y!=null;){let _=y[1]==="^",P=y[2]==="-",E=y[4],F=y[5],$=y[6],O=[],k=y[3],L=k.match(g);for(P&&O.push(45);L!=null;){if(L[0].indexOf("-")===-1)p&&isNaN(Number(L[0]))?(O.push(L[0].toUpperCase().charCodeAt(0)),O.push(L[0].toLowerCase().charCodeAt(0))):O.push(L[0].charCodeAt(0));else{let I=L[0].split("-").map(B=>B.charCodeAt(0));if(d=I[0],m=I[1],d>m)throw new Error("Character range provided is out of order.");for(let B=d;B<=m;B++)if(p&&isNaN(Number(String.fromCharCode(B)))){let N=String.fromCharCode(B);O.push(N.toUpperCase().charCodeAt(0)),O.push(N.toLowerCase().charCodeAt(0))}else O.push(B)}k=k.substring(L[0].length),L=k.match(g)}if(f=c($,E,F),_){let I=-1;for(let B=48;B<=57;B++){if(I=O.indexOf(B),I>-1){O.splice(I,1);continue}O.push(B)}for(let B=65;B<=90;B++){if(I=O.indexOf(B),I>-1){O.splice(I,1);continue}O.push(B)}for(let B=97;B<=122;B++){if(I=O.indexOf(B),I>-1){O.splice(I,1);continue}O.push(B)}}let q=Array.from({length:f},()=>String.fromCharCode(O[a(0,O.length-1)])).join("");u=u.slice(0,y.index)+q+u.slice(y.index+y[0].length),y=u.match(b)}let w=/(.)\{(\d+)\,(\d+)\}/;for(y=u.match(w);y!=null;){if(d=parseInt(y[2]),m=parseInt(y[3]),d>m)throw new Error("Numbers out of order in {} quantifier.");f=a(d,m),u=u.slice(0,y.index)+y[1].repeat(f)+u.slice(y.index+y[0].length),y=u.match(w)}let x=/(.)\{(\d+)\}/;for(y=u.match(x);y!=null;)f=parseInt(y[2]),u=u.slice(0,y.index)+y[1].repeat(f)+u.slice(y.index+y[0].length),y=u.match(x);return u}},{}],25:[function(n,i,s){"use strict";Object.defineProperty(s,"__esModule",{value:!0}),s.sampleString=B;var o=n("../utils"),a=l(n("./string-regex"));function c(N){if(typeof WeakMap!="function")return null;var C=new WeakMap,H=new WeakMap;return(c=function(V){return V?H:C})(N)}function l(N,C){if(!C&&N&&N.__esModule)return N;if(N===null||typeof N!="object"&&typeof N!="function")return{default:N};var H=c(C);if(H&&H.has(N))return H.get(N);var V={__proto__:null},re=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var he in N)if(he!=="default"&&{}.hasOwnProperty.call(N,he)){var Ve=re?Object.getOwnPropertyDescriptor(N,he):null;Ve&&(Ve.get||Ve.set)?Object.defineProperty(V,he,Ve):V[he]=N[he]}return V.default=N,H&&H.set(N,V),V}let u="qwerty!@#$%^123456";function p(){return"user@example.com"}function d(){return"\u043F\u043E\u0448\u0442\u0430@\u0443\u043A\u0440.\u043D\u0435\u0442"}function m(N,C){let H="pa$$word";return N>H.length&&(H+="_",H+=(0,o.ensureMinLength)(u,N-H.length).substring(0,N-H.length)),H}function f(N){let{min:C,max:H,omitTime:V,omitDate:re}=N,he=(0,o.toRFCDateTime)(new Date("2019-08-24T14:15:22.123Z"),V,re,!1);return he.length<C&&console.warn(`Using minLength = ${C} is incorrect with format "date-time"`),H&&he.length>H&&console.warn(`Using maxLength = ${H} is incorrect with format "date-time"`),he}function h(N,C){return f({min:N,max:C,omitTime:!1,omitDate:!1})}function y(N,C){return f({min:N,max:C,omitTime:!0,omitDate:!1})}function g(N,C){return f({min:N,max:C,omitTime:!1,omitDate:!0}).slice(1)}function b(N,C,H,V){let re=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(V&&re)return a.regexSample(V);let he=(0,o.ensureMinLength)("string",N);return C&&he.length>C&&(he=he.substring(0,C)),he}function w(){return"192.168.0.1"}function x(){return"2001:0db8:85a3:0000:0000:8a2e:0370:7334"}function S(){return"example.com"}function T(){return"\u043F\u0440\u0438\u043A\u043B\u0430\u0434.\u0443\u043A\u0440"}function _(){return"http://example.com"}function P(){return"../dictionary"}function E(){return"http://example.com/{endpoint}"}function F(){return"http://example.com/entity/1"}function $(){return"/entity/1"}function O(N,C,H){return(0,o.uuid)(H||"id")}function k(){return"/json/pointer"}function L(){return"1/relative/json/pointer"}function q(){return"/regex/"}let I={email:p,"idn-email":d,password:m,"date-time":h,date:y,time:g,ipv4:w,ipv6:x,hostname:S,"idn-hostname":T,iri:F,"iri-reference":$,uri:_,"uri-reference":P,"uri-template":E,uuid:O,default:b,"json-pointer":k,"relative-json-pointer":L,regex:q};function B(N,C,H,V){let re=N.format||"default",he=I[re]||b,Ve=V&&V.propertyName;return he(N.minLength||0,N.maxLength,Ve,N.pattern,C==null?void 0:C.enablePatterns)}},{"../utils":27,"./string-regex":24}],26:[function(n,i,s){"use strict";Object.defineProperty(s,"__esModule",{value:!0}),s.clearCache=f,s.traverse=g;var o=n("./openapi-sampler"),a=n("./allOf"),c=n("./infer"),l=n("./utils"),u=p(n("json-pointer"));function p(b){return b&&b.__esModule?b:{default:b}}let d={},m=[];function f(){d={},m=[]}function h(b){let w;return b.const!==void 0?w=b.const:b.examples!==void 0&&b.examples.length?w=b.examples[0]:b.enum!==void 0&&b.enum.length?w=b.enum[0]:b.default!==void 0&&(w=b.default),w}function y(b){let w=h(b);if(w!==void 0)return{value:w,readOnly:b.readOnly,writeOnly:b.writeOnly,type:null}}function g(b,w,x,S){if(S){if(m.includes(b))return(0,l.getResultForCircular)((0,c.inferType)(b));m.push(b)}if(S&&S.depth>w.maxSampleDepth)return(0,l.popSchemaStack)(m,S),(0,l.getResultForCircular)((0,c.inferType)(b));if(b.$ref){if(!x)throw new Error("Your schema contains $ref. You must provide full specification in the third parameter.");let E=decodeURIComponent(b.$ref);E.startsWith("#")&&(E=E.substring(1));let F=u.default.get(x,E),$;if(d[E]!==!0){d[E]=!0;let O=g(F,w,x,S);if(w.format==="xml"){let{propertyName:k,value:L}=(0,l.applyXMLAttributes)(O,F,S);$={...O,value:{[k||"root"]:L}}}else $=O;d[E]=!1}else{let O=(0,c.inferType)(F);$=(0,l.getResultForCircular)(O)}return(0,l.popSchemaStack)(m,S),$}if(b.example!==void 0)return(0,l.popSchemaStack)(m,S),{value:b.example,readOnly:b.readOnly,writeOnly:b.writeOnly,type:b.type};if(b.allOf!==void 0)return(0,l.popSchemaStack)(m,S),y(b)||(0,a.allOfSample)({...b,allOf:void 0},b.allOf,w,x,S);if(b.oneOf&&b.oneOf.length){b.anyOf&&(w.quiet||console.warn("oneOf and anyOf are not supported on the same level. Skipping anyOf")),(0,l.popSchemaStack)(m,S);let E=Object.assign({readOnly:b.readOnly,writeOnly:b.writeOnly},b.oneOf[0]);return P(b,E)}if(b.anyOf&&b.anyOf.length){(0,l.popSchemaStack)(m,S);let E=Object.assign({readOnly:b.readOnly,writeOnly:b.writeOnly},b.anyOf[0]);return P(b,E)}if(b.if&&b.then){(0,l.popSchemaStack)(m,S);let{if:E,then:F,...$}=b;return g((0,l.mergeDeep)($,E,F),w,x,S)}let T=h(b),_=null;if(T===void 0){T=null,_=b.type,Array.isArray(_)&&b.type.length>0&&(_=b.type[0]),_||(_=(0,c.inferType)(b));let E=o._samplers[_];E&&(T=E(b,w,x,S))}return(0,l.popSchemaStack)(m,S),{value:T,readOnly:b.readOnly,writeOnly:b.writeOnly,type:_};function P(E,F){let $=y(E);if($!==void 0)return $;let O=g({...E,oneOf:void 0,anyOf:void 0},w,x,S),k=g(F,w,x,S);if(typeof O.value=="object"&&typeof k.value=="object"){let L=(0,l.mergeDeep)(O.value,k.value);return{...k,value:L}}return k}}},{"./allOf":16,"./infer":17,"./openapi-sampler":18,"./utils":27,"json-pointer":14}],27:[function(n,i,s){"use strict";Object.defineProperty(s,"__esModule",{value:!0}),s.applyXMLAttributes=f,s.ensureMinLength=c,s.getResultForCircular=p,s.getXMLAttributes=m,s.mergeDeep=l,s.popSchemaStack=d,s.toRFCDateTime=a,s.uuid=u;function o(g){return g<10?"0"+g:g}function a(g,b,w,x){var S=w?"":g.getUTCFullYear()+"-"+o(g.getUTCMonth()+1)+"-"+o(g.getUTCDate());return b||(S+="T"+o(g.getUTCHours())+":"+o(g.getUTCMinutes())+":"+o(g.getUTCSeconds())+(x?"."+(g.getUTCMilliseconds()/1e3).toFixed(3).slice(2,5):"")+"Z"),S}function c(g,b){return b>g.length?g.repeat(Math.trunc(b/g.length)+1).substring(0,b):g}function l(){let g=S=>S&&typeof S=="object";for(var b=arguments.length,w=new Array(b),x=0;x<b;x++)w[x]=arguments[x];return w.reduce((S,T)=>(Object.keys(T||{}).forEach(_=>{let P=S[_],E=T[_];g(P)&&g(E)?S[_]=l(P,E):S[_]=E}),S),Array.isArray(w[w.length-1])?[]:{})}function u(g){var b=h(g),w=y(b,b,b,b),x="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,S=>{var T=w()*16%16|0;return(S=="x"?T:T&3|8).toString(16)});return x}function p(g){return{value:g==="object"?{}:g==="array"?[]:void 0}}function d(g,b){b&&g.pop()}function m(g){var b,w,x,S,T,_,P;return{name:((b=g==null?void 0:g.xml)==null?void 0:b.name)||"",prefix:((w=g==null?void 0:g.xml)==null?void 0:w.prefix)||"",namespace:((x=g==null?void 0:g.xml)==null?void 0:x.namespace)||null,attribute:(T=(S=g==null?void 0:g.xml)==null?void 0:S.attribute)!=null?T:!1,wrapped:(P=(_=g==null?void 0:g.xml)==null?void 0:_.wrapped)!=null?P:!1}}function f(g){var k,L;let b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{value:x}=g,{propertyName:S}=w,{name:T,prefix:_,namespace:P,attribute:E,wrapped:F}=m(b),$=T||S?`${_?_+":":""}${T||S}`:null,O=typeof x=="object"?Array.isArray(x)?[...x]:{...x}:x;return E&&$&&($=`$${$}`),P&&(typeof O=="object"?O[`$xmlns${_?":"+_:""}`]=P:O={[`$xmlns${_?":"+_:""}`]:P,"#text":O}),b.type==="array"&&(F&&Array.isArray(O)&&(O={[$]:[...O]}),F||($=null),b.example!==void 0&&!F&&($=((L=(k=b.items)==null?void 0:k.xml)==null?void 0:L.name)||$)),(b.oneOf||b.anyOf||b.allOf||b.$ref)&&($=null),{propertyName:$,value:O}}function h(g){var b=0;if(g.length==0)return b;for(var w=0;w<g.length;w++){var x=g.charCodeAt(w);b=(b<<5)-b+x,b=b&b}return b}function y(g,b,w,x){return function(){g|=0,b|=0,w|=0,x|=0;var S=g-(b<<27|b>>>5)|0;return g=b^(w<<17|w>>>15),b=w+x|0,w=x+S|0,x=g+S|0,(x>>>0)/4294967296}}},{}]},{},[18])(18)})});var aR=v(_0=>{"use strict";Object.defineProperty(_0,"__esModule",{value:!0});var BY=Dm(),VY=th(),UY=Sh(),zY=Bh(),oR=Vh(),HY=[BY.default,VY.default,(0,UY.default)(),zY.default,oR.metadataVocabulary,oR.contentVocabulary];_0.default=HY});var cR=v((Tve,KY)=>{KY.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/schema",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/core":!0,"https://json-schema.org/draft/2019-09/vocab/applicator":!0,"https://json-schema.org/draft/2019-09/vocab/validation":!0,"https://json-schema.org/draft/2019-09/vocab/meta-data":!0,"https://json-schema.org/draft/2019-09/vocab/format":!1,"https://json-schema.org/draft/2019-09/vocab/content":!0},$recursiveAnchor:!0,title:"Core and Validation specifications meta-schema",allOf:[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format"},{$ref:"meta/content"}],type:["object","boolean"],properties:{definitions:{$comment:"While no longer an official keyword as it is replaced by $defs, this keyword is retained in the meta-schema to prevent incompatible extensions as it remains in common use.",type:"object",additionalProperties:{$recursiveRef:"#"},default:{}},dependencies:{$comment:'"dependencies" is no longer a keyword, but schema authors should avoid redefining it to facilitate a smooth transition to "dependentSchemas" and "dependentRequired"',type:"object",additionalProperties:{anyOf:[{$recursiveRef:"#"},{$ref:"meta/validation#/$defs/stringArray"}]}}}}});var lR=v((Rve,WY)=>{WY.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/applicator",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/applicator":!0},$recursiveAnchor:!0,title:"Applicator vocabulary meta-schema",type:["object","boolean"],properties:{additionalItems:{$recursiveRef:"#"},unevaluatedItems:{$recursiveRef:"#"},items:{anyOf:[{$recursiveRef:"#"},{$ref:"#/$defs/schemaArray"}]},contains:{$recursiveRef:"#"},additionalProperties:{$recursiveRef:"#"},unevaluatedProperties:{$recursiveRef:"#"},properties:{type:"object",additionalProperties:{$recursiveRef:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$recursiveRef:"#"},propertyNames:{format:"regex"},default:{}},dependentSchemas:{type:"object",additionalProperties:{$recursiveRef:"#"}},propertyNames:{$recursiveRef:"#"},if:{$recursiveRef:"#"},then:{$recursiveRef:"#"},else:{$recursiveRef:"#"},allOf:{$ref:"#/$defs/schemaArray"},anyOf:{$ref:"#/$defs/schemaArray"},oneOf:{$ref:"#/$defs/schemaArray"},not:{$recursiveRef:"#"}},$defs:{schemaArray:{type:"array",minItems:1,items:{$recursiveRef:"#"}}}}});var uR=v((Cve,YY)=>{YY.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/content",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/content":!0},$recursiveAnchor:!0,title:"Content vocabulary meta-schema",type:["object","boolean"],properties:{contentMediaType:{type:"string"},contentEncoding:{type:"string"},contentSchema:{$recursiveRef:"#"}}}});var pR=v((kve,GY)=>{GY.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/core",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/core":!0},$recursiveAnchor:!0,title:"Core vocabulary meta-schema",type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference",$comment:"Non-empty fragments not allowed.",pattern:"^[^#]*#?$"},$schema:{type:"string",format:"uri"},$anchor:{type:"string",pattern:"^[A-Za-z][-A-Za-z0-9.:_]*$"},$ref:{type:"string",format:"uri-reference"},$recursiveRef:{type:"string",format:"uri-reference"},$recursiveAnchor:{type:"boolean",default:!1},$vocabulary:{type:"object",propertyNames:{type:"string",format:"uri"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$recursiveRef:"#"},default:{}}}}});var fR=v((Nve,JY)=>{JY.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/format",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/format":!0},$recursiveAnchor:!0,title:"Format vocabulary meta-schema",type:["object","boolean"],properties:{format:{type:"string"}}}});var dR=v((Ive,XY)=>{XY.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/meta-data",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/meta-data":!0},$recursiveAnchor:!0,title:"Meta-data vocabulary meta-schema",type:["object","boolean"],properties:{title:{type:"string"},description:{type:"string"},default:!0,deprecated:{type:"boolean",default:!1},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0}}}});var mR=v((qve,QY)=>{QY.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/validation",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/validation":!0},$recursiveAnchor:!0,title:"Validation vocabulary meta-schema",type:["object","boolean"],properties:{multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/$defs/nonNegativeInteger"},minLength:{$ref:"#/$defs/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},maxItems:{$ref:"#/$defs/nonNegativeInteger"},minItems:{$ref:"#/$defs/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxContains:{$ref:"#/$defs/nonNegativeInteger"},minContains:{$ref:"#/$defs/nonNegativeInteger",default:1},maxProperties:{$ref:"#/$defs/nonNegativeInteger"},minProperties:{$ref:"#/$defs/nonNegativeIntegerDefault0"},required:{$ref:"#/$defs/stringArray"},dependentRequired:{type:"object",additionalProperties:{$ref:"#/$defs/stringArray"}},const:!0,enum:{type:"array",items:!0},type:{anyOf:[{$ref:"#/$defs/simpleTypes"},{type:"array",items:{$ref:"#/$defs/simpleTypes"},minItems:1,uniqueItems:!0}]}},$defs:{nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{$ref:"#/$defs/nonNegativeInteger",default:0},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}}}});var hR=v(O0=>{"use strict";Object.defineProperty(O0,"__esModule",{value:!0});O0.default=aG;var ZY=cR(),eG=lR(),tG=uR(),rG=pR(),nG=fR(),iG=dR(),sG=mR(),oG=["/properties"];function aG(e){return[ZY,eG,tG,rG,t(this,nG),iG,t(this,sG)].forEach(r=>this.addMetaSchema(r,void 0,!1)),this;function t(r,n){return e?r.$dataMetaSchema(n,oG):n}}});var gR=v((it,yR)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0});it.CodeGen=it.Name=it.nil=it.stringify=it.str=it._=it.KeywordCxt=void 0;var cG=jm(),lG=aR(),uG=Th(),pG=Ih(),fG=Lh(),dG=Kh(),mG=hR(),P0="https://json-schema.org/draft/2019-09/schema",Mp=class extends cG.default{constructor(t={}){super({...t,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),this.addVocabulary(uG.default),lG.default.forEach(t=>this.addVocabulary(t)),this.addVocabulary(pG.default),this.addVocabulary(fG.default),this.opts.discriminator&&this.addKeyword(dG.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:t,meta:r}=this.opts;r&&(mG.default.call(this,t),this.refs["http://json-schema.org/schema"]=P0)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(P0)?P0:void 0)}};yR.exports=it=Mp;Object.defineProperty(it,"__esModule",{value:!0});it.default=Mp;var hG=Bs();Object.defineProperty(it,"KeywordCxt",{enumerable:!0,get:function(){return hG.KeywordCxt}});var Ao=ne();Object.defineProperty(it,"_",{enumerable:!0,get:function(){return Ao._}});Object.defineProperty(it,"str",{enumerable:!0,get:function(){return Ao.str}});Object.defineProperty(it,"stringify",{enumerable:!0,get:function(){return Ao.stringify}});Object.defineProperty(it,"nil",{enumerable:!0,get:function(){return Ao.nil}});Object.defineProperty(it,"Name",{enumerable:!0,get:function(){return Ao.Name}});Object.defineProperty(it,"CodeGen",{enumerable:!0,get:function(){return Ao.CodeGen}})});var _R=v(Xr=>{"use strict";Object.defineProperty(Xr,"__esModule",{value:!0});Xr.formatNames=Xr.fastFormats=Xr.fullFormats=void 0;function To(e,t){return{validate:e,compare:t}}Xr.fullFormats={date:To(wR,A0),time:To(xR,T0),"date-time":To($G,SR),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:TG,"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|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\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:jG,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:RG,int32:{type:"number",validate:NG},int64:{type:"number",validate:IG},float:{type:"number",validate:vR},double:{type:"number",validate:vR},password:!0,binary:!0};Xr.fastFormats={...Xr.fullFormats,date:To(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,A0),time:To(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,T0),"date-time":To(/^\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,SR),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};Xr.formatNames=Object.keys(Xr.fullFormats);function _G(e){return e%4===0&&(e%100!==0||e%400===0)}var OG=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,PG=[0,31,28,31,30,31,30,31,31,30,31,30,31];function wR(e){let t=OG.exec(e);if(!t)return!1;let r=+t[1],n=+t[2],i=+t[3];return n>=1&&n<=12&&i>=1&&i<=(n===2&&_G(r)?29:PG[n])}function A0(e,t){if(e&&t)return e>t?1:e<t?-1:0}var $0=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i;function xR(e,t){let r=$0.exec(e);if(!r)return!1;let n=+r[1],i=+r[2],s=+r[3],o=r[5];return(n<=23&&i<=59&&s<=59||n===23&&i===59&&s===60)&&(!t||o!=="")}function T0(e,t){if(!(e&&t))return;let r=$0.exec(e),n=$0.exec(t);if(r&&n)return e=r[1]+r[2]+r[3]+(r[4]||""),t=n[1]+n[2]+n[3]+(n[4]||""),e>t?1:e<t?-1:0}var E0=/t|\s/i;function $G(e){let t=e.split(E0);return t.length===2&&wR(t[0])&&xR(t[1],!0)}function SR(e,t){if(!(e&&t))return;let[r,n]=e.split(E0),[i,s]=t.split(E0),o=A0(r,i);if(o!==void 0)return o||T0(n,s)}var EG=/\/|:/,AG=/^(?:[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 TG(e){return EG.test(e)&&AG.test(e)}var bR=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function RG(e){return bR.lastIndex=0,bR.test(e)}var CG=-(2**31),kG=2**31-1;function NG(e){return Number.isInteger(e)&&e<=kG&&e>=CG}function IG(e){return Number.isInteger(e)}function vR(){return!0}var qG=/[^\\]\\Z/;function jG(e){if(qG.test(e))return!1;try{return new RegExp(e),!0}catch{return!1}}});var Ec=v(xe=>{"use strict";Object.defineProperty(xe,"__esModule",{value:!0});xe.regexpCode=xe.getEsmExportName=xe.getProperty=xe.safeStringify=xe.stringify=xe.strConcat=xe.addCodeArg=xe.str=xe._=xe.nil=xe._Code=xe.Name=xe.IDENTIFIER=xe._CodeOrName=void 0;var Pc=class{};xe._CodeOrName=Pc;xe.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var fs=class extends Pc{constructor(t){if(super(),!xe.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}}};xe.Name=fs;var wr=class extends Pc{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 fs&&(r[n.str]=(r[n.str]||0)+1),r),{})}};xe._Code=wr;xe.nil=new wr("");function OR(e,...t){let r=[e[0]],n=0;for(;n<t.length;)C0(r,t[n]),r.push(e[++n]);return new wr(r)}xe._=OR;var R0=new wr("+");function PR(e,...t){let r=[$c(e[0])],n=0;for(;n<t.length;)r.push(R0),C0(r,t[n]),r.push(R0,$c(e[++n]));return MG(r),new wr(r)}xe.str=PR;function C0(e,t){t instanceof wr?e.push(...t._items):t instanceof fs?e.push(t):e.push(FG(t))}xe.addCodeArg=C0;function MG(e){let t=1;for(;t<e.length-1;){if(e[t]===R0){let r=LG(e[t-1],e[t+1]);if(r!==void 0){e.splice(t-1,3,r);continue}e[t++]="+"}t++}}function LG(e,t){if(t==='""')return e;if(e==='""')return t;if(typeof e=="string")return t instanceof fs||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 fs))return`"${e}${t.slice(1)}`}function DG(e,t){return t.emptyStr()?e:e.emptyStr()?t:PR`${e}${t}`}xe.strConcat=DG;function FG(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:$c(Array.isArray(e)?e.join(","):e)}function BG(e){return new wr($c(e))}xe.stringify=BG;function $c(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}xe.safeStringify=$c;function VG(e){return typeof e=="string"&&xe.IDENTIFIER.test(e)?new wr(`.${e}`):OR`[${e}]`}xe.getProperty=VG;function UG(e){if(typeof e=="string"&&xe.IDENTIFIER.test(e))return new wr(`${e}`);throw new Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)}xe.getEsmExportName=UG;function zG(e){return new wr(e.toString())}xe.regexpCode=zG});var I0=v(Qt=>{"use strict";Object.defineProperty(Qt,"__esModule",{value:!0});Qt.ValueScope=Qt.ValueScopeName=Qt.Scope=Qt.varKinds=Qt.UsedValueState=void 0;var Xt=Ec(),k0=class extends Error{constructor(t){super(`CodeGen: "code" for ${t} not defined`),this.value=t.value}},Dp;(function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"})(Dp||(Qt.UsedValueState=Dp={}));Qt.varKinds={const:new Xt.Name("const"),let:new Xt.Name("let"),var:new Xt.Name("var")};var Fp=class{constructor({prefixes:t,parent:r}={}){this._names={},this._prefixes=t,this._parent=r}toName(t){return t instanceof Xt.Name?t:this.name(t)}name(t){return new Xt.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}}};Qt.Scope=Fp;var Bp=class extends Xt.Name{constructor(t,r){super(r),this.prefix=t}setValue(t,{property:r,itemIndex:n}){this.value=t,this.scopePath=(0,Xt._)`.${new Xt.Name(r)}[${n}]`}};Qt.ValueScopeName=Bp;var HG=(0,Xt._)`\n`,N0=class extends Fp{constructor(t){super(t),this._values={},this._scope=t.scope,this.opts={...t,_n:t.lines?HG:Xt.nil}}get(){return this._scope}name(t){return new Bp(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,o=(n=r.key)!==null&&n!==void 0?n:r.ref,a=this._values[s];if(a){let u=a.get(o);if(u)return u}else a=this._values[s]=new Map;a.set(o,i);let c=this._scope[s]||(this._scope[s]=[]),l=c.length;return c[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,Xt._)`${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=Xt.nil;for(let o in t){let a=t[o];if(!a)continue;let c=n[o]=n[o]||new Map;a.forEach(l=>{if(c.has(l))return;c.set(l,Dp.Started);let u=r(l);if(u){let p=this.opts.es5?Qt.varKinds.var:Qt.varKinds.const;s=(0,Xt._)`${s}${p} ${l} = ${u};${this.opts._n}`}else if(u=i==null?void 0:i(l))s=(0,Xt._)`${s}${u}${this.opts._n}`;else throw new k0(l);c.set(l,Dp.Completed)})}return s}};Qt.ValueScope=N0});var ae=v(le=>{"use strict";Object.defineProperty(le,"__esModule",{value:!0});le.or=le.and=le.not=le.CodeGen=le.operators=le.varKinds=le.ValueScopeName=le.ValueScope=le.Scope=le.Name=le.regexpCode=le.stringify=le.getProperty=le.nil=le.strConcat=le.str=le._=void 0;var me=Ec(),kr=I0(),fi=Ec();Object.defineProperty(le,"_",{enumerable:!0,get:function(){return fi._}});Object.defineProperty(le,"str",{enumerable:!0,get:function(){return fi.str}});Object.defineProperty(le,"strConcat",{enumerable:!0,get:function(){return fi.strConcat}});Object.defineProperty(le,"nil",{enumerable:!0,get:function(){return fi.nil}});Object.defineProperty(le,"getProperty",{enumerable:!0,get:function(){return fi.getProperty}});Object.defineProperty(le,"stringify",{enumerable:!0,get:function(){return fi.stringify}});Object.defineProperty(le,"regexpCode",{enumerable:!0,get:function(){return fi.regexpCode}});Object.defineProperty(le,"Name",{enumerable:!0,get:function(){return fi.Name}});var Hp=I0();Object.defineProperty(le,"Scope",{enumerable:!0,get:function(){return Hp.Scope}});Object.defineProperty(le,"ValueScope",{enumerable:!0,get:function(){return Hp.ValueScope}});Object.defineProperty(le,"ValueScopeName",{enumerable:!0,get:function(){return Hp.ValueScopeName}});Object.defineProperty(le,"varKinds",{enumerable:!0,get:function(){return Hp.varKinds}});le.operators={GT:new me._Code(">"),GTE:new me._Code(">="),LT:new me._Code("<"),LTE:new me._Code("<="),EQ:new me._Code("==="),NEQ:new me._Code("!=="),NOT:new me._Code("!"),OR:new me._Code("||"),AND:new me._Code("&&"),ADD:new me._Code("+")};var On=class{optimizeNodes(){return this}optimizeNames(t,r){return this}},q0=class extends On{constructor(t,r,n){super(),this.varKind=t,this.name=r,this.rhs=n}render({es5:t,_n:r}){let n=t?kr.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=Co(this.rhs,t,r)),this}get names(){return this.rhs instanceof me._CodeOrName?this.rhs.names:{}}},Vp=class extends On{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 me.Name&&!t[this.lhs.str]&&!this.sideEffects))return this.rhs=Co(this.rhs,t,r),this}get names(){let t=this.lhs instanceof me.Name?{}:{...this.lhs.names};return zp(t,this.rhs)}},j0=class extends Vp{constructor(t,r,n,i){super(t,n,i),this.op=r}render({_n:t}){return`${this.lhs} ${this.op}= ${this.rhs};`+t}},M0=class extends On{constructor(t){super(),this.label=t,this.names={}}render({_n:t}){return`${this.label}:`+t}},L0=class extends On{constructor(t){super(),this.label=t,this.names={}}render({_n:t}){return`break${this.label?` ${this.label}`:""};`+t}},D0=class extends On{constructor(t){super(),this.error=t}render({_n:t}){return`throw ${this.error};`+t}get names(){return this.error.names}},F0=class extends On{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=Co(this.code,t,r),this}get names(){return this.code instanceof me._CodeOrName?this.code.names:{}}},Ac=class extends On{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)||(KG(t,s.names),n.splice(i,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((t,r)=>hs(t,r.names),{})}},Pn=class extends Ac{render(t){return"{"+t._n+super.render(t)+"}"+t._n}},B0=class extends Ac{},Ro=class extends Pn{};Ro.kind="else";var ds=class e extends Pn{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 Ro(n):n}if(r)return t===!1?r instanceof e?r:r.nodes:this.nodes.length?this:new e($R(t),r instanceof e?[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=Co(this.condition,t,r),this}get names(){let t=super.names;return zp(t,this.condition),this.else&&hs(t,this.else.names),t}};ds.kind="if";var ms=class extends Pn{};ms.kind="for";var V0=class extends ms{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=Co(this.iteration,t,r),this}get names(){return hs(super.names,this.iteration.names)}},U0=class extends ms{constructor(t,r,n,i){super(),this.varKind=t,this.name=r,this.from=n,this.to=i}render(t){let r=t.es5?kr.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=zp(super.names,this.from);return zp(t,this.to)}},Up=class extends ms{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=Co(this.iterable,t,r),this}get names(){return hs(super.names,this.iterable.names)}},Tc=class extends Pn{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)}};Tc.kind="func";var Rc=class extends Ac{render(t){return"return "+super.render(t)}};Rc.kind="return";var z0=class extends Pn{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&&hs(t,this.catch.names),this.finally&&hs(t,this.finally.names),t}},Cc=class extends Pn{constructor(t){super(),this.error=t}render(t){return`catch(${this.error})`+super.render(t)}};Cc.kind="catch";var kc=class extends Pn{render(t){return"finally"+super.render(t)}};kc.kind="finally";var H0=class{constructor(t,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
200
- `:""},this._extScope=t,this._scope=new kr.Scope({parent:t}),this._nodes=[new B0]}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 q0(t,s,n)),s}const(t,r,n){return this._def(kr.varKinds.const,t,r,n)}let(t,r,n){return this._def(kr.varKinds.let,t,r,n)}var(t,r,n){return this._def(kr.varKinds.var,t,r,n)}assign(t,r,n){return this._leafNode(new Vp(t,r,n))}add(t,r){return this._leafNode(new j0(t,le.operators.ADD,r))}code(t){return typeof t=="function"?t():t!==me.nil&&this._leafNode(new F0(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,me.addCodeArg)(r,i));return r.push("}"),new me._Code(r)}if(t,r,n){if(this._blockNode(new ds(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 ds(t))}else(){return this._elseNode(new Ro)}endIf(){return this._endBlockNode(ds,Ro)}_for(t,r){return this._blockNode(t),r&&this.code(r).endFor(),this}for(t,r){return this._for(new V0(t),r)}forRange(t,r,n,i,s=this.opts.es5?kr.varKinds.var:kr.varKinds.let){let o=this._scope.toName(t);return this._for(new U0(s,o,r,n),()=>i(o))}forOf(t,r,n,i=kr.varKinds.const){let s=this._scope.toName(t);if(this.opts.es5){let o=r instanceof me.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,me._)`${o}.length`,a=>{this.var(s,(0,me._)`${o}[${a}]`),n(s)})}return this._for(new Up("of",i,s,r),()=>n(s))}forIn(t,r,n,i=this.opts.es5?kr.varKinds.var:kr.varKinds.const){if(this.opts.ownProperties)return this.forOf(t,(0,me._)`Object.keys(${r})`,n);let s=this._scope.toName(t);return this._for(new Up("in",i,s,r),()=>n(s))}endFor(){return this._endBlockNode(ms)}label(t){return this._leafNode(new M0(t))}break(t){return this._leafNode(new L0(t))}return(t){let r=new Rc;if(this._blockNode(r),this.code(t),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(Rc)}try(t,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let i=new z0;if(this._blockNode(i),this.code(t),r){let s=this.name("e");this._currNode=i.catch=new Cc(s),r(s)}return n&&(this._currNode=i.finally=new kc,this.code(n)),this._endBlockNode(Cc,kc)}throw(t){return this._leafNode(new D0(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=me.nil,n,i){return this._blockNode(new Tc(t,r,n)),i&&this.code(i).endFunc(),this}endFunc(){return this._endBlockNode(Tc)}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 ds))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}};le.CodeGen=H0;function hs(e,t){for(let r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function zp(e,t){return t instanceof me._CodeOrName?hs(e,t.names):e}function Co(e,t,r){if(e instanceof me.Name)return n(e);if(!i(e))return e;return new me._Code(e._items.reduce((s,o)=>(o instanceof me.Name&&(o=n(o)),o instanceof me._Code?s.push(...o._items):s.push(o),s),[]));function n(s){let o=r[s.str];return o===void 0||t[s.str]!==1?s:(delete t[s.str],o)}function i(s){return s instanceof me._Code&&s._items.some(o=>o instanceof me.Name&&t[o.str]===1&&r[o.str]!==void 0)}}function KG(e,t){for(let r in t)e[r]=(e[r]||0)-(t[r]||0)}function $R(e){return typeof e=="boolean"||typeof e=="number"||e===null?!e:(0,me._)`!${K0(e)}`}le.not=$R;var WG=ER(le.operators.AND);function YG(...e){return e.reduce(WG)}le.and=YG;var GG=ER(le.operators.OR);function JG(...e){return e.reduce(GG)}le.or=JG;function ER(e){return(t,r)=>t===me.nil?r:r===me.nil?t:(0,me._)`${K0(t)} ${e} ${K0(r)}`}function K0(e){return e instanceof me.Name?e:(0,me._)`(${e})`}});var Se=v(ue=>{"use strict";Object.defineProperty(ue,"__esModule",{value:!0});ue.checkStrictMode=ue.getErrorPath=ue.Type=ue.useFunc=ue.setEvaluated=ue.evaluatedPropsToName=ue.mergeEvaluated=ue.eachItem=ue.unescapeJsonPointer=ue.escapeJsonPointer=ue.escapeFragment=ue.unescapeFragment=ue.schemaRefOrVal=ue.schemaHasRulesButRef=ue.schemaHasRules=ue.checkUnknownRules=ue.alwaysValidSchema=ue.toHash=void 0;var Te=ae(),XG=Ec();function QG(e){let t={};for(let r of e)t[r]=!0;return t}ue.toHash=QG;function ZG(e,t){return typeof t=="boolean"?t:Object.keys(t).length===0?!0:(RR(e,t),!CR(t,e.self.RULES.all))}ue.alwaysValidSchema=ZG;function RR(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]||IR(e,`unknown keyword: "${s}"`)}ue.checkUnknownRules=RR;function CR(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(t[r])return!0;return!1}ue.schemaHasRules=CR;function eJ(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(r!=="$ref"&&t.all[r])return!0;return!1}ue.schemaHasRulesButRef=eJ;function tJ({topSchemaRef:e,schemaPath:t},r,n,i){if(!i){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,Te._)`${r}`}return(0,Te._)`${e}${t}${(0,Te.getProperty)(n)}`}ue.schemaRefOrVal=tJ;function rJ(e){return kR(decodeURIComponent(e))}ue.unescapeFragment=rJ;function nJ(e){return encodeURIComponent(Y0(e))}ue.escapeFragment=nJ;function Y0(e){return typeof e=="number"?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}ue.escapeJsonPointer=Y0;function kR(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}ue.unescapeJsonPointer=kR;function iJ(e,t){if(Array.isArray(e))for(let r of e)t(r);else t(e)}ue.eachItem=iJ;function AR({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:n}){return(i,s,o,a)=>{let c=o===void 0?s:o instanceof Te.Name?(s instanceof Te.Name?e(i,s,o):t(i,s,o),o):s instanceof Te.Name?(t(i,o,s),s):r(s,o);return a===Te.Name&&!(c instanceof Te.Name)?n(i,c):c}}ue.mergeEvaluated={props:AR({mergeNames:(e,t,r)=>e.if((0,Te._)`${r} !== true && ${t} !== undefined`,()=>{e.if((0,Te._)`${t} === true`,()=>e.assign(r,!0),()=>e.assign(r,(0,Te._)`${r} || {}`).code((0,Te._)`Object.assign(${r}, ${t})`))}),mergeToName:(e,t,r)=>e.if((0,Te._)`${r} !== true`,()=>{t===!0?e.assign(r,!0):(e.assign(r,(0,Te._)`${r} || {}`),G0(e,r,t))}),mergeValues:(e,t)=>e===!0?!0:{...e,...t},resultToName:NR}),items:AR({mergeNames:(e,t,r)=>e.if((0,Te._)`${r} !== true && ${t} !== undefined`,()=>e.assign(r,(0,Te._)`${t} === true ? true : ${r} > ${t} ? ${r} : ${t}`)),mergeToName:(e,t,r)=>e.if((0,Te._)`${r} !== true`,()=>e.assign(r,t===!0?!0:(0,Te._)`${r} > ${t} ? ${r} : ${t}`)),mergeValues:(e,t)=>e===!0?!0:Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})};function NR(e,t){if(t===!0)return e.var("props",!0);let r=e.var("props",(0,Te._)`{}`);return t!==void 0&&G0(e,r,t),r}ue.evaluatedPropsToName=NR;function G0(e,t,r){Object.keys(r).forEach(n=>e.assign((0,Te._)`${t}${(0,Te.getProperty)(n)}`,!0))}ue.setEvaluated=G0;var TR={};function sJ(e,t){return e.scopeValue("func",{ref:t,code:TR[t.code]||(TR[t.code]=new XG._Code(t.code))})}ue.useFunc=sJ;var W0;(function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"})(W0||(ue.Type=W0={}));function oJ(e,t,r){if(e instanceof Te.Name){let n=t===W0.Num;return r?n?(0,Te._)`"[" + ${e} + "]"`:(0,Te._)`"['" + ${e} + "']"`:n?(0,Te._)`"/" + ${e}`:(0,Te._)`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,Te.getProperty)(e).toString():"/"+Y0(e)}ue.getErrorPath=oJ;function IR(e,t,r=e.opts.strictSchema){if(r){if(t=`strict mode: ${t}`,r===!0)throw new Error(t);e.self.logger.warn(t)}}ue.checkStrictMode=IR});var $n=v(J0=>{"use strict";Object.defineProperty(J0,"__esModule",{value:!0});var $t=ae(),aJ={data:new $t.Name("data"),valCxt:new $t.Name("valCxt"),instancePath:new $t.Name("instancePath"),parentData:new $t.Name("parentData"),parentDataProperty:new $t.Name("parentDataProperty"),rootData:new $t.Name("rootData"),dynamicAnchors:new $t.Name("dynamicAnchors"),vErrors:new $t.Name("vErrors"),errors:new $t.Name("errors"),this:new $t.Name("this"),self:new $t.Name("self"),scope:new $t.Name("scope"),json:new $t.Name("json"),jsonPos:new $t.Name("jsonPos"),jsonLen:new $t.Name("jsonLen"),jsonPart:new $t.Name("jsonPart")};J0.default=aJ});var Nc=v(Et=>{"use strict";Object.defineProperty(Et,"__esModule",{value:!0});Et.extendErrors=Et.resetErrorsCount=Et.reportExtraError=Et.reportError=Et.keyword$DataError=Et.keywordError=void 0;var ve=ae(),Kp=Se(),Dt=$n();Et.keywordError={message:({keyword:e})=>(0,ve.str)`must pass "${e}" keyword validation`};Et.keyword$DataError={message:({keyword:e,schemaType:t})=>t?(0,ve.str)`"${e}" keyword must be ${t} ($data)`:(0,ve.str)`"${e}" keyword is invalid ($data)`};function cJ(e,t=Et.keywordError,r,n){let{it:i}=e,{gen:s,compositeRule:o,allErrors:a}=i,c=MR(e,t,r);(n!=null?n:o||a)?qR(s,c):jR(i,(0,ve._)`[${c}]`)}Et.reportError=cJ;function lJ(e,t=Et.keywordError,r){let{it:n}=e,{gen:i,compositeRule:s,allErrors:o}=n,a=MR(e,t,r);qR(i,a),s||o||jR(n,Dt.default.vErrors)}Et.reportExtraError=lJ;function uJ(e,t){e.assign(Dt.default.errors,t),e.if((0,ve._)`${Dt.default.vErrors} !== null`,()=>e.if(t,()=>e.assign((0,ve._)`${Dt.default.vErrors}.length`,t),()=>e.assign(Dt.default.vErrors,null)))}Et.resetErrorsCount=uJ;function pJ({gen:e,keyword:t,schemaValue:r,data:n,errsCount:i,it:s}){if(i===void 0)throw new Error("ajv implementation error");let o=e.name("err");e.forRange("i",i,Dt.default.errors,a=>{e.const(o,(0,ve._)`${Dt.default.vErrors}[${a}]`),e.if((0,ve._)`${o}.instancePath === undefined`,()=>e.assign((0,ve._)`${o}.instancePath`,(0,ve.strConcat)(Dt.default.instancePath,s.errorPath))),e.assign((0,ve._)`${o}.schemaPath`,(0,ve.str)`${s.errSchemaPath}/${t}`),s.opts.verbose&&(e.assign((0,ve._)`${o}.schema`,r),e.assign((0,ve._)`${o}.data`,n))})}Et.extendErrors=pJ;function qR(e,t){let r=e.const("err",t);e.if((0,ve._)`${Dt.default.vErrors} === null`,()=>e.assign(Dt.default.vErrors,(0,ve._)`[${r}]`),(0,ve._)`${Dt.default.vErrors}.push(${r})`),e.code((0,ve._)`${Dt.default.errors}++`)}function jR(e,t){let{gen:r,validateName:n,schemaEnv:i}=e;i.$async?r.throw((0,ve._)`new ${e.ValidationError}(${t})`):(r.assign((0,ve._)`${n}.errors`,t),r.return(!1))}var ys={keyword:new ve.Name("keyword"),schemaPath:new ve.Name("schemaPath"),params:new ve.Name("params"),propertyName:new ve.Name("propertyName"),message:new ve.Name("message"),schema:new ve.Name("schema"),parentSchema:new ve.Name("parentSchema")};function MR(e,t,r){let{createErrors:n}=e.it;return n===!1?(0,ve._)`{}`:fJ(e,t,r)}function fJ(e,t,r={}){let{gen:n,it:i}=e,s=[dJ(i,r),mJ(e,r)];return hJ(e,t,s),n.object(...s)}function dJ({errorPath:e},{instancePath:t}){let r=t?(0,ve.str)`${e}${(0,Kp.getErrorPath)(t,Kp.Type.Str)}`:e;return[Dt.default.instancePath,(0,ve.strConcat)(Dt.default.instancePath,r)]}function mJ({keyword:e,it:{errSchemaPath:t}},{schemaPath:r,parentSchema:n}){let i=n?t:(0,ve.str)`${t}/${e}`;return r&&(i=(0,ve.str)`${i}${(0,Kp.getErrorPath)(r,Kp.Type.Str)}`),[ys.schemaPath,i]}function hJ(e,{params:t,message:r},n){let{keyword:i,data:s,schemaValue:o,it:a}=e,{opts:c,propertyName:l,topSchemaRef:u,schemaPath:p}=a;n.push([ys.keyword,i],[ys.params,typeof t=="function"?t(e):t||(0,ve._)`{}`]),c.messages&&n.push([ys.message,typeof r=="function"?r(e):r]),c.verbose&&n.push([ys.schema,o],[ys.parentSchema,(0,ve._)`${u}${p}`],[Dt.default.data,s]),l&&n.push([ys.propertyName,l])}});var DR=v(ko=>{"use strict";Object.defineProperty(ko,"__esModule",{value:!0});ko.boolOrEmptySchema=ko.topBoolOrEmptySchema=void 0;var yJ=Nc(),gJ=ae(),bJ=$n(),vJ={message:"boolean schema is false"};function wJ(e){let{gen:t,schema:r,validateName:n}=e;r===!1?LR(e,!1):typeof r=="object"&&r.$async===!0?t.return(bJ.default.data):(t.assign((0,gJ._)`${n}.errors`,null),t.return(!0))}ko.topBoolOrEmptySchema=wJ;function xJ(e,t){let{gen:r,schema:n}=e;n===!1?(r.var(t,!1),LR(e)):r.var(t,!0)}ko.boolOrEmptySchema=xJ;function LR(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,yJ.reportError)(i,vJ,void 0,t)}});var X0=v(No=>{"use strict";Object.defineProperty(No,"__esModule",{value:!0});No.getRules=No.isJSONType=void 0;var SJ=["string","number","integer","boolean","null","object","array"],_J=new Set(SJ);function OJ(e){return typeof e=="string"&&_J.has(e)}No.isJSONType=OJ;function PJ(){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:{}}}No.getRules=PJ});var Q0=v(di=>{"use strict";Object.defineProperty(di,"__esModule",{value:!0});di.shouldUseRule=di.shouldUseGroup=di.schemaHasRulesForType=void 0;function $J({schema:e,self:t},r){let n=t.RULES.types[r];return n&&n!==!0&&FR(e,n)}di.schemaHasRulesForType=$J;function FR(e,t){return t.rules.some(r=>BR(e,r))}di.shouldUseGroup=FR;function BR(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))}di.shouldUseRule=BR});var Ic=v(At=>{"use strict";Object.defineProperty(At,"__esModule",{value:!0});At.reportTypeError=At.checkDataTypes=At.checkDataType=At.coerceAndCheckDataType=At.getJSONTypes=At.getSchemaTypes=At.DataType=void 0;var EJ=X0(),AJ=Q0(),TJ=Nc(),oe=ae(),VR=Se(),Io;(function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"})(Io||(At.DataType=Io={}));function RJ(e){let t=UR(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}At.getSchemaTypes=RJ;function UR(e){let t=Array.isArray(e)?e:e?[e]:[];if(t.every(EJ.isJSONType))return t;throw new Error("type must be JSONType or JSONType[]: "+t.join(","))}At.getJSONTypes=UR;function CJ(e,t){let{gen:r,data:n,opts:i}=e,s=kJ(t,i.coerceTypes),o=t.length>0&&!(s.length===0&&t.length===1&&(0,AJ.schemaHasRulesForType)(e,t[0]));if(o){let a=eb(t,n,i.strictNumbers,Io.Wrong);r.if(a,()=>{s.length?NJ(e,t,s):tb(e)})}return o}At.coerceAndCheckDataType=CJ;var zR=new Set(["string","number","integer","boolean","null"]);function kJ(e,t){return t?e.filter(r=>zR.has(r)||t==="array"&&r==="array"):[]}function NJ(e,t,r){let{gen:n,data:i,opts:s}=e,o=n.let("dataType",(0,oe._)`typeof ${i}`),a=n.let("coerced",(0,oe._)`undefined`);s.coerceTypes==="array"&&n.if((0,oe._)`${o} == 'object' && Array.isArray(${i}) && ${i}.length == 1`,()=>n.assign(i,(0,oe._)`${i}[0]`).assign(o,(0,oe._)`typeof ${i}`).if(eb(t,i,s.strictNumbers),()=>n.assign(a,i))),n.if((0,oe._)`${a} !== undefined`);for(let l of r)(zR.has(l)||l==="array"&&s.coerceTypes==="array")&&c(l);n.else(),tb(e),n.endIf(),n.if((0,oe._)`${a} !== undefined`,()=>{n.assign(i,a),IJ(e,a)});function c(l){switch(l){case"string":n.elseIf((0,oe._)`${o} == "number" || ${o} == "boolean"`).assign(a,(0,oe._)`"" + ${i}`).elseIf((0,oe._)`${i} === null`).assign(a,(0,oe._)`""`);return;case"number":n.elseIf((0,oe._)`${o} == "boolean" || ${i} === null
199
+ `);let O=new a("!xml"),k=O,L="",q="";for(let I=0;I<$.length;I++)if($[I]==="<")if($[I+1]==="/"){let N=_($,">",I,"Closing Tag is not closed."),C=$.substring(I+2,N).trim();if(this.options.removeNSPrefix){let re=C.indexOf(":");re!==-1&&(C=C.substr(re+1))}this.options.transformTagName&&(C=this.options.transformTagName(C)),k&&(L=this.saveTextToParentTag(L,k,q));let H=q.substring(q.lastIndexOf(".")+1);if(C&&this.options.unpairedTags.indexOf(C)!==-1)throw new Error(`Unpaired tag can not be used as closing tag: </${C}>`);let V=0;H&&this.options.unpairedTags.indexOf(H)!==-1?(V=q.lastIndexOf(".",q.lastIndexOf(".")-1),this.tagsNodeStack.pop()):V=q.lastIndexOf("."),q=q.substring(0,V),k=this.tagsNodeStack.pop(),L="",I=N}else if($[I+1]==="?"){let N=P($,I,!1,"?>");if(!N)throw new Error("Pi Tag is not closed.");if(L=this.saveTextToParentTag(L,k,q),!(this.options.ignoreDeclaration&&N.tagName==="?xml"||this.options.ignorePiTags)){let C=new a(N.tagName);C.add(this.options.textNodeName,""),N.tagName!==N.tagExp&&N.attrExpPresent&&(C[":@"]=this.buildAttributesMap(N.tagExp,q,N.tagName)),this.addChild(k,C,q)}I=N.closeIndex+1}else if($.substr(I+1,3)==="!--"){let N=_($,"-->",I+4,"Comment is not closed.");if(this.options.commentPropName){let C=$.substring(I+4,N-2);L=this.saveTextToParentTag(L,k,q),k.add(this.options.commentPropName,[{[this.options.textNodeName]:C}])}I=N}else if($.substr(I+1,2)==="!D"){let N=c($,I);this.docTypeEntities=N.entities,I=N.i}else if($.substr(I+1,2)==="!["){let N=_($,"]]>",I,"CDATA is not closed.")-2,C=$.substring(I+9,N);L=this.saveTextToParentTag(L,k,q);let H=this.parseTextData(C,k.tagname,q,!0,!1,!0,!0);H==null&&(H=""),this.options.cdataPropName?k.add(this.options.cdataPropName,[{[this.options.textNodeName]:C}]):k.add(this.options.textNodeName,H),I=N+2}else{let N=P($,I,this.options.removeNSPrefix),C=N.tagName,H=N.rawTagName,V=N.tagExp,re=N.attrExpPresent,he=N.closeIndex;this.options.transformTagName&&(C=this.options.transformTagName(C)),k&&L&&k.tagname!=="!xml"&&(L=this.saveTextToParentTag(L,k,q,!1));let Ve=k;if(Ve&&this.options.unpairedTags.indexOf(Ve.tagname)!==-1&&(k=this.tagsNodeStack.pop(),q=q.substring(0,q.lastIndexOf("."))),C!==O.tagname&&(q+=q?"."+C:C),this.isItStopNode(this.options.stopNodes,q,C)){let Ce="";if(V.length>0&&V.lastIndexOf("/")===V.length-1)C[C.length-1]==="/"?(C=C.substr(0,C.length-1),q=q.substr(0,q.length-1),V=C):V=V.substr(0,V.length-1),I=N.closeIndex;else if(this.options.unpairedTags.indexOf(C)!==-1)I=N.closeIndex;else{let ye=this.readStopNodeData($,H,he+1);if(!ye)throw new Error(`Unexpected end of ${H}`);I=ye.i,Ce=ye.tagContent}let J=new a(C);C!==V&&re&&(J[":@"]=this.buildAttributesMap(V,q,C)),Ce&&(Ce=this.parseTextData(Ce,C,q,!0,re,!0,!0)),q=q.substr(0,q.lastIndexOf(".")),J.add(this.options.textNodeName,Ce),this.addChild(k,J,q)}else{if(V.length>0&&V.lastIndexOf("/")===V.length-1){C[C.length-1]==="/"?(C=C.substr(0,C.length-1),q=q.substr(0,q.length-1),V=C):V=V.substr(0,V.length-1),this.options.transformTagName&&(C=this.options.transformTagName(C));let Ce=new a(C);C!==V&&re&&(Ce[":@"]=this.buildAttributesMap(V,q,C)),this.addChild(k,Ce,q),q=q.substr(0,q.lastIndexOf("."))}else{let Ce=new a(C);this.tagsNodeStack.push(k),C!==V&&re&&(Ce[":@"]=this.buildAttributesMap(V,q,C)),this.addChild(k,Ce,q),k=Ce}L="",I=he}}else L+=$[I];return O.child};function b($,O,k){let L=this.options.updateTag(O.tagname,k,O[":@"]);L===!1||(typeof L=="string"&&(O.tagname=L),$.addChild(O))}let w=function($){if(this.options.processEntities){for(let O in this.docTypeEntities){let k=this.docTypeEntities[O];$=$.replace(k.regx,k.val)}for(let O in this.lastEntities){let k=this.lastEntities[O];$=$.replace(k.regex,k.val)}if(this.options.htmlEntities)for(let O in this.htmlEntities){let k=this.htmlEntities[O];$=$.replace(k.regex,k.val)}$=$.replace(this.ampEntity.regex,this.ampEntity.val)}return $};function x($,O,k,L){return $&&(L===void 0&&(L=Object.keys(O.child).length===0),$=this.parseTextData($,O.tagname,k,!1,O[":@"]?Object.keys(O[":@"]).length!==0:!1,L),$!==void 0&&$!==""&&O.add(this.options.textNodeName,$),$=""),$}function S($,O,k){let L="*."+k;for(let q in $){let I=$[q];if(L===I||O===I)return!0}return!1}function T($,O,k=">"){let L,q="";for(let I=O;I<$.length;I++){let B=$[I];if(L)B===L&&(L="");else if(B==='"'||B==="'")L=B;else if(B===k[0])if(k[1]){if($[I+1]===k[1])return{data:q,index:I}}else return{data:q,index:I};else B===" "&&(B=" ");q+=B}}function _($,O,k,L){let q=$.indexOf(O,k);if(q===-1)throw new Error(L);return q+O.length-1}function P($,O,k,L=">"){let q=T($,O+1,L);if(!q)return;let I=q.data,B=q.index,N=I.search(/\s/),C=I,H=!0;N!==-1&&(C=I.substring(0,N),I=I.substring(N+1).trimStart());let V=C;if(k){let re=C.indexOf(":");re!==-1&&(C=C.substr(re+1),H=C!==q.data.substr(re+1))}return{tagName:C,tagExp:I,closeIndex:B,attrExpPresent:H,rawTagName:V}}function E($,O,k){let L=k,q=1;for(;k<$.length;k++)if($[k]==="<")if($[k+1]==="/"){let I=_($,">",k,`${O} is not closed`);if($.substring(k+2,I).trim()===O&&(q--,q===0))return{tagContent:$.substring(L,k),i:I};k=I}else if($[k+1]==="?")k=_($,"?>",k+1,"StopNode is not closed.");else if($.substr(k+1,3)==="!--")k=_($,"-->",k+3,"StopNode is not closed.");else if($.substr(k+1,2)==="![")k=_($,"]]>",k,"StopNode is not closed.")-2;else{let I=P($,k,">");I&&((I&&I.tagName)===O&&I.tagExp[I.tagExp.length-1]!=="/"&&q++,k=I.closeIndex)}}function F($,O,k){if(O&&typeof $=="string"){let L=$.trim();return L==="true"?!0:L==="false"?!1:l($,k)}else return o.isExist($)?$:""}i.exports=p},{"../ignoreAttributes":2,"../util":3,"./DocTypeReader":7,"./xmlNode":12,strnum:15}],10:[function(n,i,s){let{buildOptions:o}=n("./OptionsBuilder"),a=n("./OrderedObjParser"),{prettify:c}=n("./node2json"),l=n("../validator");class u{constructor(d){this.externalEntities={},this.options=o(d)}parse(d,m){if(typeof d!="string")if(d.toString)d=d.toString();else throw new Error("XML data is accepted in String or Bytes[] form.");if(m){m===!0&&(m={});let y=l.validate(d,m);if(y!==!0)throw Error(`${y.err.msg}:${y.err.line}:${y.err.col}`)}let f=new a(this.options);f.addExternalEntities(this.externalEntities);let h=f.parseXml(d);return this.options.preserveOrder||h===void 0?h:c(h,this.options)}addEntity(d,m){if(m.indexOf("&")!==-1)throw new Error("Entity value can't have '&'");if(d.indexOf("&")!==-1||d.indexOf(";")!==-1)throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '&#xD;'");if(m==="&")throw new Error("An entity with value '&' is not permitted");this.externalEntities[d]=m}}i.exports=u},{"../validator":4,"./OptionsBuilder":8,"./OrderedObjParser":9,"./node2json":11}],11:[function(n,i,s){"use strict";function o(p,d){return a(p,d)}function a(p,d,m){let f,h={};for(let y=0;y<p.length;y++){let g=p[y],b=c(g),w="";if(m===void 0?w=b:w=m+"."+b,b===d.textNodeName)f===void 0?f=g[b]:f+=""+g[b];else{if(b===void 0)continue;if(g[b]){let x=a(g[b],d,w),S=u(x,d);g[":@"]?l(x,g[":@"],w,d):Object.keys(x).length===1&&x[d.textNodeName]!==void 0&&!d.alwaysCreateTextNode?x=x[d.textNodeName]:Object.keys(x).length===0&&(d.alwaysCreateTextNode?x[d.textNodeName]="":x=""),h[b]!==void 0&&h.hasOwnProperty(b)?(Array.isArray(h[b])||(h[b]=[h[b]]),h[b].push(x)):d.isArray(b,w,S)?h[b]=[x]:h[b]=x}}}return typeof f=="string"?f.length>0&&(h[d.textNodeName]=f):f!==void 0&&(h[d.textNodeName]=f),h}function c(p){let d=Object.keys(p);for(let m=0;m<d.length;m++){let f=d[m];if(f!==":@")return f}}function l(p,d,m,f){if(d){let h=Object.keys(d),y=h.length;for(let g=0;g<y;g++){let b=h[g];f.isArray(b,m+"."+b,!0,!0)?p[b]=[d[b]]:p[b]=d[b]}}}function u(p,d){let{textNodeName:m}=d,f=Object.keys(p).length;return!!(f===0||f===1&&(p[m]||typeof p[m]=="boolean"||p[m]===0))}s.prettify=o},{}],12:[function(n,i,s){"use strict";class o{constructor(c){this.tagname=c,this.child=[],this[":@"]={}}add(c,l){c==="__proto__"&&(c="#__proto__"),this.child.push({[c]:l})}addChild(c){c.tagname==="__proto__"&&(c.tagname="#__proto__"),c[":@"]&&Object.keys(c[":@"]).length>0?this.child.push({[c.tagname]:c.child,":@":c[":@"]}):this.child.push({[c.tagname]:c.child})}}i.exports=o},{}],13:[function(n,i,s){var o=Object.prototype.hasOwnProperty,a=Object.prototype.toString;i.exports=function(l,u,p){if(a.call(u)!=="[object Function]")throw new TypeError("iterator must be a function");var d=l.length;if(d===+d)for(var m=0;m<d;m++)u.call(p,l[m],m,l);else for(var f in l)o.call(l,f)&&u.call(p,l[f],f,l)}},{}],14:[function(n,i,s){"use strict";var o=n("foreach");i.exports=a;function a(c,l,u){if(arguments.length===3)return a.set(c,l,u);if(arguments.length===2)return a.get(c,l);var p=a.bind(a,c);for(var d in a)a.hasOwnProperty(d)&&(p[d]=a[d].bind(p,c));return p}a.get=function(l,u){for(var p=Array.isArray(u)?u:a.parse(u),d=0;d<p.length;++d){var m=p[d];if(!(typeof l=="object"&&m in l))throw new Error("Invalid reference token: "+m);l=l[m]}return l},a.set=function(l,u,p){var d=Array.isArray(u)?u:a.parse(u),m=d[0];if(d.length===0)throw Error("Can not set the root object");for(var f=0;f<d.length-1;++f){var h=d[f];typeof h!="string"&&typeof h!="number"&&(h=String(h)),!(h==="__proto__"||h==="constructor"||h==="prototype")&&(h==="-"&&Array.isArray(l)&&(h=l.length),m=d[f+1],h in l||(m.match(/^(\d+|-)$/)?l[h]=[]:l[h]={}),l=l[h])}return m==="-"&&Array.isArray(l)&&(m=l.length),l[m]=p,this},a.remove=function(c,l){var u=Array.isArray(l)?l:a.parse(l),p=u[u.length-1];if(p===void 0)throw new Error('Invalid JSON pointer for remove: "'+l+'"');var d=a.get(c,u.slice(0,-1));if(Array.isArray(d)){var m=+p;if(p===""&&isNaN(m))throw new Error('Invalid array index: "'+p+'"');Array.prototype.splice.call(d,m,1)}else delete d[p]},a.dict=function(l,u){var p={};return a.walk(l,function(d,m){p[m]=d},u),p},a.walk=function(l,u,p){var d=[];p=p||function(m){var f=Object.prototype.toString.call(m);return f==="[object Object]"||f==="[object Array]"},function m(f){o(f,function(h,y){d.push(String(y)),p(h)?m(h):u(h,a.compile(d)),d.pop()})}(l)},a.has=function(l,u){try{a.get(l,u)}catch{return!1}return!0},a.escape=function(l){return l.toString().replace(/~/g,"~0").replace(/\//g,"~1")},a.unescape=function(l){return l.replace(/~1/g,"/").replace(/~0/g,"~")},a.parse=function(l){if(l==="")return[];if(l.charAt(0)!=="/")throw new Error("Invalid JSON pointer: "+l);return l.substring(1).split(/\//).map(a.unescape)},a.compile=function(l){return l.length===0?"":"/"+l.map(a.escape).join("/")}},{foreach:13}],15:[function(n,i,s){let o=/^[-+]?0x[a-fA-F0-9]+$/,a=/^([\-\+])?(0*)(\.[0-9]+([eE]\-?[0-9]+)?|[0-9]+(\.[0-9]+([eE]\-?[0-9]+)?)?)$/;!Number.parseInt&&window.parseInt&&(Number.parseInt=window.parseInt),!Number.parseFloat&&window.parseFloat&&(Number.parseFloat=window.parseFloat);let c={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};function l(p,d={}){if(d=Object.assign({},c,d),!p||typeof p!="string")return p;let m=p.trim();if(d.skipLike!==void 0&&d.skipLike.test(m))return p;if(d.hex&&o.test(m))return Number.parseInt(m,16);{let f=a.exec(m);if(f){let h=f[1],y=f[2],g=u(f[3]),b=f[4]||f[6];if(!d.leadingZeros&&y.length>0&&h&&m[2]!==".")return p;if(!d.leadingZeros&&y.length>0&&!h&&m[1]!==".")return p;{let w=Number(m),x=""+w;return x.search(/[eE]/)!==-1||b?d.eNotation?w:p:m.indexOf(".")!==-1?x==="0"&&g===""||x===g||h&&x==="-"+g?w:p:y?g===x||h+g===x?w:p:m===x||m===h+x?w:p}}else return p}}function u(p){return p&&p.indexOf(".")!==-1&&(p=p.replace(/0+$/,""),p==="."?p="0":p[0]==="."?p="0"+p:p[p.length-1]==="."&&(p=p.substr(0,p.length-1))),p}i.exports=l},{}],16:[function(n,i,s){"use strict";Object.defineProperty(s,"__esModule",{value:!0}),s.allOfSample=c;var o=n("./traverse"),a=n("./utils");function c(l,u,p,d,m){let f=(0,o.traverse)(l,p,d),h=[];for(let y of u){let{type:g,readOnly:b,writeOnly:w,value:x}=(0,o.traverse)({type:f.type,...y},p,d,m);f.type&&g&&g!==f.type&&(console.warn("allOf: schemas with different types can't be merged"),f.type=g),f.type=f.type||g,f.readOnly=f.readOnly||b,f.writeOnly=f.writeOnly||w,x!=null&&h.push(x)}if(f.type==="object")return f.value=(0,a.mergeDeep)(f.value||{},...h.filter(y=>typeof y=="object")),f;{f.type==="array"&&(p.quiet||console.warn('OpenAPI Sampler: found allOf with "array" type. Result may be incorrect'));let y=h[h.length-1];return f.value=y!=null?y:f.value,f}}},{"./traverse":26,"./utils":27}],17:[function(n,i,s){"use strict";Object.defineProperty(s,"__esModule",{value:!0}),s.inferType=a;let o={multipleOf:"number",maximum:"number",exclusiveMaximum:"number",minimum:"number",exclusiveMinimum:"number",maxLength:"string",minLength:"string",pattern:"string",items:"array",maxItems:"array",minItems:"array",uniqueItems:"array",additionalItems:"array",maxProperties:"object",minProperties:"object",required:"object",additionalProperties:"object",properties:"object",patternProperties:"object",dependencies:"object"};function a(c){if(c.type!==void 0)return Array.isArray(c.type)?c.type.length===0?null:c.type[0]:c.type;let l=Object.keys(o);for(var u=0;u<l.length;u++){let p=l[u],d=o[p];if(c[p]!==void 0)return d}return null}},{}],18:[function(n,i,s){"use strict";Object.defineProperty(s,"__esModule",{value:!0}),s._registerSampler=f,s._samplers=void 0,Object.defineProperty(s,"inferType",{enumerable:!0,get:function(){return l.inferType}}),s.sample=m;var o=n("./traverse"),a=n("./samplers/index"),c=n("fast-xml-parser"),l=n("./infer"),u=s._samplers={};let p={skipReadOnly:!1,maxSampleDepth:15};function d(h,y){var b;if(!h)throw new Error("Unknown format output for building XML.");return(Array.isArray(h)||Object.keys(h).length>1)&&(h={[((b=y==null?void 0:y.xml)==null?void 0:b.name)||"root"]:h}),new c.XMLBuilder({ignoreAttributes:!1,format:!0,attributeNamePrefix:"$",textNodeName:"#text"}).build(h)}function m(h,y,g){let b=Object.assign({},p,y);(0,o.clearCache)();let w=(0,o.traverse)(h,b,g).value;return(b==null?void 0:b.format)==="xml"?d(w,h):w}function f(h,y){u[h]=y}f("array",a.sampleArray),f("boolean",a.sampleBoolean),f("integer",a.sampleNumber),f("number",a.sampleNumber),f("object",a.sampleObject),f("string",a.sampleString)},{"./infer":17,"./samplers/index":21,"./traverse":26,"fast-xml-parser":1}],19:[function(n,i,s){"use strict";Object.defineProperty(s,"__esModule",{value:!0}),s.sampleArray=c;var o=n("../traverse"),a=n("../utils");function c(l){let u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},p=arguments.length>2?arguments[2]:void 0,d=arguments.length>3?arguments[3]:void 0,m=d&&d.depth||1,f=Math.min(l.maxItems!=null?l.maxItems:1/0,l.minItems||1),h=l.prefixItems||l.items||l.contains;Array.isArray(h)&&(f=Math.max(f,h.length));let y=b=>Array.isArray(h)?h[b]||{}:h||{},g=[];if(!h)return g;for(let b=0;b<f;b++){let w=y(b),{value:x}=(0,o.traverse)(w,u,p,{depth:m+1});if((u==null?void 0:u.format)==="xml"){let{value:S,propertyName:T}=(0,a.applyXMLAttributes)({value:x},w,d);T?(g!=null&&g[T]||(g={...g,[T]:[]}),g[T].push(S)):g={...g,...S}}else g.push(x)}if((u==null?void 0:u.format)==="xml"&&m===1){let{value:b,propertyName:w}=(0,a.applyXMLAttributes)({value:null},l,d);w&&(b?g=Array.isArray(g)?{[w]:{...b,...g.map(x=>({"#text":{...x}}))}}:{[w]:{...g,...b}}:g={[w]:g})}return g}},{"../traverse":26,"../utils":27}],20:[function(n,i,s){"use strict";Object.defineProperty(s,"__esModule",{value:!0}),s.sampleBoolean=o;function o(a){return!0}},{}],21:[function(n,i,s){"use strict";Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"sampleArray",{enumerable:!0,get:function(){return o.sampleArray}}),Object.defineProperty(s,"sampleBoolean",{enumerable:!0,get:function(){return a.sampleBoolean}}),Object.defineProperty(s,"sampleNumber",{enumerable:!0,get:function(){return c.sampleNumber}}),Object.defineProperty(s,"sampleObject",{enumerable:!0,get:function(){return l.sampleObject}}),Object.defineProperty(s,"sampleString",{enumerable:!0,get:function(){return u.sampleString}});var o=n("./array"),a=n("./boolean"),c=n("./number"),l=n("./object"),u=n("./string")},{"./array":19,"./boolean":20,"./number":22,"./object":23,"./string":25}],22:[function(n,i,s){"use strict";Object.defineProperty(s,"__esModule",{value:!0}),s.sampleNumber=o;function o(a){let c=0;if(a.type==="number"&&(a.format==="float"||a.format==="double")&&(c=.1),typeof a.exclusiveMinimum=="boolean"||typeof a.exclusiveMaximum=="boolean"){if(a.maximum&&a.minimum)return c=a.exclusiveMinimum?Math.floor(a.minimum)+1:a.minimum,(a.exclusiveMaximum&&c>=a.maximum||!a.exclusiveMaximum&&c>a.maximum)&&(c=(a.maximum+a.minimum)/2),c;if(a.minimum)return a.exclusiveMinimum?Math.floor(a.minimum)+1:a.minimum;if(a.maximum)return a.exclusiveMaximum?a.maximum>0?0:Math.floor(a.maximum)-1:a.maximum>0?0:a.maximum}else{if(a.minimum)return a.minimum;a.exclusiveMinimum?(c=Math.floor(a.exclusiveMinimum)+1,c===a.exclusiveMaximum&&(c=(c+Math.floor(a.exclusiveMaximum)-1)/2)):a.exclusiveMaximum?c=Math.floor(a.exclusiveMaximum)-1:a.maximum&&(c=a.maximum)}return c}},{}],23:[function(n,i,s){"use strict";Object.defineProperty(s,"__esModule",{value:!0}),s.sampleObject=c;var o=n("../traverse"),a=n("../utils");function c(l){let u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},p=arguments.length>2?arguments[2]:void 0,d=arguments.length>3?arguments[3]:void 0,m={},f=d&&d.depth||1;if(l&&typeof l.properties=="object"){let h=Array.isArray(l.required)?l.required:[],y={};for(let g of h)y[g]=!0;Object.keys(l.properties).forEach(g=>{if(u.skipNonRequired&&!y.hasOwnProperty(g))return;let b=(0,o.traverse)(l.properties[g],u,p,{propertyName:g,depth:f+1});if(!(u.skipReadOnly&&b.readOnly)&&!(u.skipWriteOnly&&b.writeOnly))if((u==null?void 0:u.format)==="xml"){let{propertyName:w,value:x}=(0,a.applyXMLAttributes)(b,l.properties[g],{propertyName:g});w?m[w]=x:m={...m,...x}}else m[g]=b.value})}if(l&&typeof l.additionalProperties=="object"){let h=l.additionalProperties["x-additionalPropertiesName"]||"property";m[`${String(h)}1`]=(0,o.traverse)(l.additionalProperties,u,p,{depth:f+1}).value,m[`${String(h)}2`]=(0,o.traverse)(l.additionalProperties,u,p,{depth:f+1}).value}if(l&&typeof l.properties=="object"&&l.maxProperties!==void 0&&Object.keys(m).length>l.maxProperties){let h={},y=0;(Array.isArray(l.required)?l.required:[]).forEach(b=>{m[b]!==void 0&&(h[b]=m[b],y++)}),Object.keys(m).forEach(b=>{y<l.maxProperties&&!h.hasOwnProperty(b)&&(h[b]=m[b],y++)}),m=h}return m}},{"../traverse":26,"../utils":27}],24:[function(n,i,s){"use strict";Object.defineProperty(s,"__esModule",{value:!0}),s.regexSample=l;function o(){return!0}function a(u,p){return u}function c(u,p,d){let m=1;if(u)switch(u){case"?":{m=o()?0:1;break}case"*":{m=a(0,8);break}case"+":{m=a(1,8);break}default:throw new Error("Unknown quantifier symbol provided.")}else p!=null&&d!=null?m=a(parseInt(p),parseInt(d)):p!=null&&d==null&&(m=parseInt(p));return m}function l(u){var S,T;let p=!1;u instanceof RegExp&&(p=u.flags.includes("i"),u=u.toString(),u=(T=(S=u.match(/\/(.+?)\//))==null?void 0:S[1])!=null?T:"");let d,m,f,h=/([.A-Za-z0-9])(?:\{(\d+)(?:\,(\d+)|)\}|(\?|\*|\+))(?![^[]*]|[^{]*})/,y=u.match(h);for(;y!=null;){let _=y[2],P=y[3],E=y[4];f=c(E,_,P),u=u.slice(0,y.index)+y[1].repeat(f)+u.slice(y.index+y[0].length),y=u.match(h)}let g=/(\d-\d|\w-\w|\d|\w|[-!@#$&()`.+,/"])/,b=/\[(\^|)(-|)(.+?)\](?:\{(\d+)(?:\,(\d+)|)\}|(\?|\*|\+)|)/;for(y=u.match(b);y!=null;){let _=y[1]==="^",P=y[2]==="-",E=y[4],F=y[5],$=y[6],O=[],k=y[3],L=k.match(g);for(P&&O.push(45);L!=null;){if(L[0].indexOf("-")===-1)p&&isNaN(Number(L[0]))?(O.push(L[0].toUpperCase().charCodeAt(0)),O.push(L[0].toLowerCase().charCodeAt(0))):O.push(L[0].charCodeAt(0));else{let I=L[0].split("-").map(B=>B.charCodeAt(0));if(d=I[0],m=I[1],d>m)throw new Error("Character range provided is out of order.");for(let B=d;B<=m;B++)if(p&&isNaN(Number(String.fromCharCode(B)))){let N=String.fromCharCode(B);O.push(N.toUpperCase().charCodeAt(0)),O.push(N.toLowerCase().charCodeAt(0))}else O.push(B)}k=k.substring(L[0].length),L=k.match(g)}if(f=c($,E,F),_){let I=-1;for(let B=48;B<=57;B++){if(I=O.indexOf(B),I>-1){O.splice(I,1);continue}O.push(B)}for(let B=65;B<=90;B++){if(I=O.indexOf(B),I>-1){O.splice(I,1);continue}O.push(B)}for(let B=97;B<=122;B++){if(I=O.indexOf(B),I>-1){O.splice(I,1);continue}O.push(B)}}let q=Array.from({length:f},()=>String.fromCharCode(O[a(0,O.length-1)])).join("");u=u.slice(0,y.index)+q+u.slice(y.index+y[0].length),y=u.match(b)}let w=/(.)\{(\d+)\,(\d+)\}/;for(y=u.match(w);y!=null;){if(d=parseInt(y[2]),m=parseInt(y[3]),d>m)throw new Error("Numbers out of order in {} quantifier.");f=a(d,m),u=u.slice(0,y.index)+y[1].repeat(f)+u.slice(y.index+y[0].length),y=u.match(w)}let x=/(.)\{(\d+)\}/;for(y=u.match(x);y!=null;)f=parseInt(y[2]),u=u.slice(0,y.index)+y[1].repeat(f)+u.slice(y.index+y[0].length),y=u.match(x);return u}},{}],25:[function(n,i,s){"use strict";Object.defineProperty(s,"__esModule",{value:!0}),s.sampleString=B;var o=n("../utils"),a=l(n("./string-regex"));function c(N){if(typeof WeakMap!="function")return null;var C=new WeakMap,H=new WeakMap;return(c=function(V){return V?H:C})(N)}function l(N,C){if(!C&&N&&N.__esModule)return N;if(N===null||typeof N!="object"&&typeof N!="function")return{default:N};var H=c(C);if(H&&H.has(N))return H.get(N);var V={__proto__:null},re=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var he in N)if(he!=="default"&&{}.hasOwnProperty.call(N,he)){var Ve=re?Object.getOwnPropertyDescriptor(N,he):null;Ve&&(Ve.get||Ve.set)?Object.defineProperty(V,he,Ve):V[he]=N[he]}return V.default=N,H&&H.set(N,V),V}let u="qwerty!@#$%^123456";function p(){return"user@example.com"}function d(){return"\u043F\u043E\u0448\u0442\u0430@\u0443\u043A\u0440.\u043D\u0435\u0442"}function m(N,C){let H="pa$$word";return N>H.length&&(H+="_",H+=(0,o.ensureMinLength)(u,N-H.length).substring(0,N-H.length)),H}function f(N){let{min:C,max:H,omitTime:V,omitDate:re}=N,he=(0,o.toRFCDateTime)(new Date("2019-08-24T14:15:22.123Z"),V,re,!1);return he.length<C&&console.warn(`Using minLength = ${C} is incorrect with format "date-time"`),H&&he.length>H&&console.warn(`Using maxLength = ${H} is incorrect with format "date-time"`),he}function h(N,C){return f({min:N,max:C,omitTime:!1,omitDate:!1})}function y(N,C){return f({min:N,max:C,omitTime:!0,omitDate:!1})}function g(N,C){return f({min:N,max:C,omitTime:!1,omitDate:!0}).slice(1)}function b(N,C,H,V){let re=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(V&&re)return a.regexSample(V);let he=(0,o.ensureMinLength)("string",N);return C&&he.length>C&&(he=he.substring(0,C)),he}function w(){return"192.168.0.1"}function x(){return"2001:0db8:85a3:0000:0000:8a2e:0370:7334"}function S(){return"example.com"}function T(){return"\u043F\u0440\u0438\u043A\u043B\u0430\u0434.\u0443\u043A\u0440"}function _(){return"http://example.com"}function P(){return"../dictionary"}function E(){return"http://example.com/{endpoint}"}function F(){return"http://example.com/entity/1"}function $(){return"/entity/1"}function O(N,C,H){return(0,o.uuid)(H||"id")}function k(){return"/json/pointer"}function L(){return"1/relative/json/pointer"}function q(){return"/regex/"}let I={email:p,"idn-email":d,password:m,"date-time":h,date:y,time:g,ipv4:w,ipv6:x,hostname:S,"idn-hostname":T,iri:F,"iri-reference":$,uri:_,"uri-reference":P,"uri-template":E,uuid:O,default:b,"json-pointer":k,"relative-json-pointer":L,regex:q};function B(N,C,H,V){let re=N.format||"default",he=I[re]||b,Ve=V&&V.propertyName;return he(N.minLength||0,N.maxLength,Ve,N.pattern,C==null?void 0:C.enablePatterns)}},{"../utils":27,"./string-regex":24}],26:[function(n,i,s){"use strict";Object.defineProperty(s,"__esModule",{value:!0}),s.clearCache=f,s.traverse=g;var o=n("./openapi-sampler"),a=n("./allOf"),c=n("./infer"),l=n("./utils"),u=p(n("json-pointer"));function p(b){return b&&b.__esModule?b:{default:b}}let d={},m=[];function f(){d={},m=[]}function h(b){let w;return b.const!==void 0?w=b.const:b.examples!==void 0&&b.examples.length?w=b.examples[0]:b.enum!==void 0&&b.enum.length?w=b.enum[0]:b.default!==void 0&&(w=b.default),w}function y(b){let w=h(b);if(w!==void 0)return{value:w,readOnly:b.readOnly,writeOnly:b.writeOnly,type:null}}function g(b,w,x,S){if(S){if(m.includes(b))return(0,l.getResultForCircular)((0,c.inferType)(b));m.push(b)}if(S&&S.depth>w.maxSampleDepth)return(0,l.popSchemaStack)(m,S),(0,l.getResultForCircular)((0,c.inferType)(b));if(b.$ref){if(!x)throw new Error("Your schema contains $ref. You must provide full specification in the third parameter.");let E=decodeURIComponent(b.$ref);E.startsWith("#")&&(E=E.substring(1));let F=u.default.get(x,E),$;if(d[E]!==!0){d[E]=!0;let O=g(F,w,x,S);if(w.format==="xml"){let{propertyName:k,value:L}=(0,l.applyXMLAttributes)(O,F,S);$={...O,value:{[k||"root"]:L}}}else $=O;d[E]=!1}else{let O=(0,c.inferType)(F);$=(0,l.getResultForCircular)(O)}return(0,l.popSchemaStack)(m,S),$}if(b.example!==void 0)return(0,l.popSchemaStack)(m,S),{value:b.example,readOnly:b.readOnly,writeOnly:b.writeOnly,type:b.type};if(b.allOf!==void 0)return(0,l.popSchemaStack)(m,S),y(b)||(0,a.allOfSample)({...b,allOf:void 0},b.allOf,w,x,S);if(b.oneOf&&b.oneOf.length){b.anyOf&&(w.quiet||console.warn("oneOf and anyOf are not supported on the same level. Skipping anyOf")),(0,l.popSchemaStack)(m,S);let E=Object.assign({readOnly:b.readOnly,writeOnly:b.writeOnly},b.oneOf[0]);return P(b,E)}if(b.anyOf&&b.anyOf.length){(0,l.popSchemaStack)(m,S);let E=Object.assign({readOnly:b.readOnly,writeOnly:b.writeOnly},b.anyOf[0]);return P(b,E)}if(b.if&&b.then){(0,l.popSchemaStack)(m,S);let{if:E,then:F,...$}=b;return g((0,l.mergeDeep)($,E,F),w,x,S)}let T=h(b),_=null;if(T===void 0){T=null,_=b.type,Array.isArray(_)&&b.type.length>0&&(_=b.type[0]),_||(_=(0,c.inferType)(b));let E=o._samplers[_];E&&(T=E(b,w,x,S))}return(0,l.popSchemaStack)(m,S),{value:T,readOnly:b.readOnly,writeOnly:b.writeOnly,type:_};function P(E,F){let $=y(E);if($!==void 0)return $;let O=g({...E,oneOf:void 0,anyOf:void 0},w,x,S),k=g(F,w,x,S);if(typeof O.value=="object"&&typeof k.value=="object"){let L=(0,l.mergeDeep)(O.value,k.value);return{...k,value:L}}return k}}},{"./allOf":16,"./infer":17,"./openapi-sampler":18,"./utils":27,"json-pointer":14}],27:[function(n,i,s){"use strict";Object.defineProperty(s,"__esModule",{value:!0}),s.applyXMLAttributes=f,s.ensureMinLength=c,s.getResultForCircular=p,s.getXMLAttributes=m,s.mergeDeep=l,s.popSchemaStack=d,s.toRFCDateTime=a,s.uuid=u;function o(g){return g<10?"0"+g:g}function a(g,b,w,x){var S=w?"":g.getUTCFullYear()+"-"+o(g.getUTCMonth()+1)+"-"+o(g.getUTCDate());return b||(S+="T"+o(g.getUTCHours())+":"+o(g.getUTCMinutes())+":"+o(g.getUTCSeconds())+(x?"."+(g.getUTCMilliseconds()/1e3).toFixed(3).slice(2,5):"")+"Z"),S}function c(g,b){return b>g.length?g.repeat(Math.trunc(b/g.length)+1).substring(0,b):g}function l(){let g=S=>S&&typeof S=="object";for(var b=arguments.length,w=new Array(b),x=0;x<b;x++)w[x]=arguments[x];return w.reduce((S,T)=>(Object.keys(T||{}).forEach(_=>{let P=S[_],E=T[_];g(P)&&g(E)?S[_]=l(P,E):S[_]=E}),S),Array.isArray(w[w.length-1])?[]:{})}function u(g){var b=h(g),w=y(b,b,b,b),x="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,S=>{var T=w()*16%16|0;return(S=="x"?T:T&3|8).toString(16)});return x}function p(g){return{value:g==="object"?{}:g==="array"?[]:void 0}}function d(g,b){b&&g.pop()}function m(g){var b,w,x,S,T,_,P;return{name:((b=g==null?void 0:g.xml)==null?void 0:b.name)||"",prefix:((w=g==null?void 0:g.xml)==null?void 0:w.prefix)||"",namespace:((x=g==null?void 0:g.xml)==null?void 0:x.namespace)||null,attribute:(T=(S=g==null?void 0:g.xml)==null?void 0:S.attribute)!=null?T:!1,wrapped:(P=(_=g==null?void 0:g.xml)==null?void 0:_.wrapped)!=null?P:!1}}function f(g){var k,L;let b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{value:x}=g,{propertyName:S}=w,{name:T,prefix:_,namespace:P,attribute:E,wrapped:F}=m(b),$=T||S?`${_?_+":":""}${T||S}`:null,O=typeof x=="object"?Array.isArray(x)?[...x]:{...x}:x;return E&&$&&($=`$${$}`),P&&(typeof O=="object"?O[`$xmlns${_?":"+_:""}`]=P:O={[`$xmlns${_?":"+_:""}`]:P,"#text":O}),b.type==="array"&&(F&&Array.isArray(O)&&(O={[$]:[...O]}),F||($=null),b.example!==void 0&&!F&&($=((L=(k=b.items)==null?void 0:k.xml)==null?void 0:L.name)||$)),(b.oneOf||b.anyOf||b.allOf||b.$ref)&&($=null),{propertyName:$,value:O}}function h(g){var b=0;if(g.length==0)return b;for(var w=0;w<g.length;w++){var x=g.charCodeAt(w);b=(b<<5)-b+x,b=b&b}return b}function y(g,b,w,x){return function(){g|=0,b|=0,w|=0,x|=0;var S=g-(b<<27|b>>>5)|0;return g=b^(w<<17|w>>>15),b=w+x|0,w=x+S|0,x=g+S|0,(x>>>0)/4294967296}}},{}]},{},[18])(18)})});var sR=v(_0=>{"use strict";Object.defineProperty(_0,"__esModule",{value:!0});var FY=Dm(),BY=th(),VY=Sh(),UY=Bh(),iR=Vh(),zY=[FY.default,BY.default,(0,VY.default)(),UY.default,iR.metadataVocabulary,iR.contentVocabulary];_0.default=zY});var oR=v(($ve,HY)=>{HY.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/schema",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/core":!0,"https://json-schema.org/draft/2019-09/vocab/applicator":!0,"https://json-schema.org/draft/2019-09/vocab/validation":!0,"https://json-schema.org/draft/2019-09/vocab/meta-data":!0,"https://json-schema.org/draft/2019-09/vocab/format":!1,"https://json-schema.org/draft/2019-09/vocab/content":!0},$recursiveAnchor:!0,title:"Core and Validation specifications meta-schema",allOf:[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format"},{$ref:"meta/content"}],type:["object","boolean"],properties:{definitions:{$comment:"While no longer an official keyword as it is replaced by $defs, this keyword is retained in the meta-schema to prevent incompatible extensions as it remains in common use.",type:"object",additionalProperties:{$recursiveRef:"#"},default:{}},dependencies:{$comment:'"dependencies" is no longer a keyword, but schema authors should avoid redefining it to facilitate a smooth transition to "dependentSchemas" and "dependentRequired"',type:"object",additionalProperties:{anyOf:[{$recursiveRef:"#"},{$ref:"meta/validation#/$defs/stringArray"}]}}}}});var aR=v((Eve,KY)=>{KY.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/applicator",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/applicator":!0},$recursiveAnchor:!0,title:"Applicator vocabulary meta-schema",type:["object","boolean"],properties:{additionalItems:{$recursiveRef:"#"},unevaluatedItems:{$recursiveRef:"#"},items:{anyOf:[{$recursiveRef:"#"},{$ref:"#/$defs/schemaArray"}]},contains:{$recursiveRef:"#"},additionalProperties:{$recursiveRef:"#"},unevaluatedProperties:{$recursiveRef:"#"},properties:{type:"object",additionalProperties:{$recursiveRef:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$recursiveRef:"#"},propertyNames:{format:"regex"},default:{}},dependentSchemas:{type:"object",additionalProperties:{$recursiveRef:"#"}},propertyNames:{$recursiveRef:"#"},if:{$recursiveRef:"#"},then:{$recursiveRef:"#"},else:{$recursiveRef:"#"},allOf:{$ref:"#/$defs/schemaArray"},anyOf:{$ref:"#/$defs/schemaArray"},oneOf:{$ref:"#/$defs/schemaArray"},not:{$recursiveRef:"#"}},$defs:{schemaArray:{type:"array",minItems:1,items:{$recursiveRef:"#"}}}}});var cR=v((Ave,WY)=>{WY.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/content",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/content":!0},$recursiveAnchor:!0,title:"Content vocabulary meta-schema",type:["object","boolean"],properties:{contentMediaType:{type:"string"},contentEncoding:{type:"string"},contentSchema:{$recursiveRef:"#"}}}});var lR=v((Tve,YY)=>{YY.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/core",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/core":!0},$recursiveAnchor:!0,title:"Core vocabulary meta-schema",type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference",$comment:"Non-empty fragments not allowed.",pattern:"^[^#]*#?$"},$schema:{type:"string",format:"uri"},$anchor:{type:"string",pattern:"^[A-Za-z][-A-Za-z0-9.:_]*$"},$ref:{type:"string",format:"uri-reference"},$recursiveRef:{type:"string",format:"uri-reference"},$recursiveAnchor:{type:"boolean",default:!1},$vocabulary:{type:"object",propertyNames:{type:"string",format:"uri"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$recursiveRef:"#"},default:{}}}}});var uR=v((Rve,GY)=>{GY.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/format",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/format":!0},$recursiveAnchor:!0,title:"Format vocabulary meta-schema",type:["object","boolean"],properties:{format:{type:"string"}}}});var pR=v((Cve,JY)=>{JY.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/meta-data",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/meta-data":!0},$recursiveAnchor:!0,title:"Meta-data vocabulary meta-schema",type:["object","boolean"],properties:{title:{type:"string"},description:{type:"string"},default:!0,deprecated:{type:"boolean",default:!1},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0}}}});var fR=v((kve,XY)=>{XY.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/validation",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/validation":!0},$recursiveAnchor:!0,title:"Validation vocabulary meta-schema",type:["object","boolean"],properties:{multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/$defs/nonNegativeInteger"},minLength:{$ref:"#/$defs/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},maxItems:{$ref:"#/$defs/nonNegativeInteger"},minItems:{$ref:"#/$defs/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxContains:{$ref:"#/$defs/nonNegativeInteger"},minContains:{$ref:"#/$defs/nonNegativeInteger",default:1},maxProperties:{$ref:"#/$defs/nonNegativeInteger"},minProperties:{$ref:"#/$defs/nonNegativeIntegerDefault0"},required:{$ref:"#/$defs/stringArray"},dependentRequired:{type:"object",additionalProperties:{$ref:"#/$defs/stringArray"}},const:!0,enum:{type:"array",items:!0},type:{anyOf:[{$ref:"#/$defs/simpleTypes"},{type:"array",items:{$ref:"#/$defs/simpleTypes"},minItems:1,uniqueItems:!0}]}},$defs:{nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{$ref:"#/$defs/nonNegativeInteger",default:0},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}}}});var dR=v(O0=>{"use strict";Object.defineProperty(O0,"__esModule",{value:!0});O0.default=oG;var QY=oR(),ZY=aR(),eG=cR(),tG=lR(),rG=uR(),nG=pR(),iG=fR(),sG=["/properties"];function oG(e){return[QY,ZY,eG,tG,t(this,rG),nG,t(this,iG)].forEach(r=>this.addMetaSchema(r,void 0,!1)),this;function t(r,n){return e?r.$dataMetaSchema(n,sG):n}}});var hR=v((it,mR)=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0});it.CodeGen=it.Name=it.nil=it.stringify=it.str=it._=it.KeywordCxt=void 0;var aG=jm(),cG=sR(),lG=Th(),uG=Ih(),pG=Lh(),fG=Kh(),dG=dR(),P0="https://json-schema.org/draft/2019-09/schema",Mp=class extends aG.default{constructor(t={}){super({...t,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),this.addVocabulary(lG.default),cG.default.forEach(t=>this.addVocabulary(t)),this.addVocabulary(uG.default),this.addVocabulary(pG.default),this.opts.discriminator&&this.addKeyword(fG.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:t,meta:r}=this.opts;r&&(dG.default.call(this,t),this.refs["http://json-schema.org/schema"]=P0)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(P0)?P0:void 0)}};mR.exports=it=Mp;Object.defineProperty(it,"__esModule",{value:!0});it.default=Mp;var mG=Bs();Object.defineProperty(it,"KeywordCxt",{enumerable:!0,get:function(){return mG.KeywordCxt}});var Ao=ne();Object.defineProperty(it,"_",{enumerable:!0,get:function(){return Ao._}});Object.defineProperty(it,"str",{enumerable:!0,get:function(){return Ao.str}});Object.defineProperty(it,"stringify",{enumerable:!0,get:function(){return Ao.stringify}});Object.defineProperty(it,"nil",{enumerable:!0,get:function(){return Ao.nil}});Object.defineProperty(it,"Name",{enumerable:!0,get:function(){return Ao.Name}});Object.defineProperty(it,"CodeGen",{enumerable:!0,get:function(){return Ao.CodeGen}})});var xR=v(Xr=>{"use strict";Object.defineProperty(Xr,"__esModule",{value:!0});Xr.formatNames=Xr.fastFormats=Xr.fullFormats=void 0;function To(e,t){return{validate:e,compare:t}}Xr.fullFormats={date:To(bR,A0),time:To(vR,T0),"date-time":To(PG,wR),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:AG,"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|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\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:qG,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:TG,int32:{type:"number",validate:kG},int64:{type:"number",validate:NG},float:{type:"number",validate:gR},double:{type:"number",validate:gR},password:!0,binary:!0};Xr.fastFormats={...Xr.fullFormats,date:To(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,A0),time:To(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,T0),"date-time":To(/^\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,wR),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};Xr.formatNames=Object.keys(Xr.fullFormats);function SG(e){return e%4===0&&(e%100!==0||e%400===0)}var _G=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,OG=[0,31,28,31,30,31,30,31,31,30,31,30,31];function bR(e){let t=_G.exec(e);if(!t)return!1;let r=+t[1],n=+t[2],i=+t[3];return n>=1&&n<=12&&i>=1&&i<=(n===2&&SG(r)?29:OG[n])}function A0(e,t){if(e&&t)return e>t?1:e<t?-1:0}var $0=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i;function vR(e,t){let r=$0.exec(e);if(!r)return!1;let n=+r[1],i=+r[2],s=+r[3],o=r[5];return(n<=23&&i<=59&&s<=59||n===23&&i===59&&s===60)&&(!t||o!=="")}function T0(e,t){if(!(e&&t))return;let r=$0.exec(e),n=$0.exec(t);if(r&&n)return e=r[1]+r[2]+r[3]+(r[4]||""),t=n[1]+n[2]+n[3]+(n[4]||""),e>t?1:e<t?-1:0}var E0=/t|\s/i;function PG(e){let t=e.split(E0);return t.length===2&&bR(t[0])&&vR(t[1],!0)}function wR(e,t){if(!(e&&t))return;let[r,n]=e.split(E0),[i,s]=t.split(E0),o=A0(r,i);if(o!==void 0)return o||T0(n,s)}var $G=/\/|:/,EG=/^(?:[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 AG(e){return $G.test(e)&&EG.test(e)}var yR=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function TG(e){return yR.lastIndex=0,yR.test(e)}var RG=-(2**31),CG=2**31-1;function kG(e){return Number.isInteger(e)&&e<=CG&&e>=RG}function NG(e){return Number.isInteger(e)}function gR(){return!0}var IG=/[^\\]\\Z/;function qG(e){if(IG.test(e))return!1;try{return new RegExp(e),!0}catch{return!1}}});var Ec=v(xe=>{"use strict";Object.defineProperty(xe,"__esModule",{value:!0});xe.regexpCode=xe.getEsmExportName=xe.getProperty=xe.safeStringify=xe.stringify=xe.strConcat=xe.addCodeArg=xe.str=xe._=xe.nil=xe._Code=xe.Name=xe.IDENTIFIER=xe._CodeOrName=void 0;var Pc=class{};xe._CodeOrName=Pc;xe.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var fs=class extends Pc{constructor(t){if(super(),!xe.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}}};xe.Name=fs;var wr=class extends Pc{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 fs&&(r[n.str]=(r[n.str]||0)+1),r),{})}};xe._Code=wr;xe.nil=new wr("");function SR(e,...t){let r=[e[0]],n=0;for(;n<t.length;)C0(r,t[n]),r.push(e[++n]);return new wr(r)}xe._=SR;var R0=new wr("+");function _R(e,...t){let r=[$c(e[0])],n=0;for(;n<t.length;)r.push(R0),C0(r,t[n]),r.push(R0,$c(e[++n]));return jG(r),new wr(r)}xe.str=_R;function C0(e,t){t instanceof wr?e.push(...t._items):t instanceof fs?e.push(t):e.push(DG(t))}xe.addCodeArg=C0;function jG(e){let t=1;for(;t<e.length-1;){if(e[t]===R0){let r=MG(e[t-1],e[t+1]);if(r!==void 0){e.splice(t-1,3,r);continue}e[t++]="+"}t++}}function MG(e,t){if(t==='""')return e;if(e==='""')return t;if(typeof e=="string")return t instanceof fs||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 fs))return`"${e}${t.slice(1)}`}function LG(e,t){return t.emptyStr()?e:e.emptyStr()?t:_R`${e}${t}`}xe.strConcat=LG;function DG(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:$c(Array.isArray(e)?e.join(","):e)}function FG(e){return new wr($c(e))}xe.stringify=FG;function $c(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}xe.safeStringify=$c;function BG(e){return typeof e=="string"&&xe.IDENTIFIER.test(e)?new wr(`.${e}`):SR`[${e}]`}xe.getProperty=BG;function VG(e){if(typeof e=="string"&&xe.IDENTIFIER.test(e))return new wr(`${e}`);throw new Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)}xe.getEsmExportName=VG;function UG(e){return new wr(e.toString())}xe.regexpCode=UG});var I0=v(Qt=>{"use strict";Object.defineProperty(Qt,"__esModule",{value:!0});Qt.ValueScope=Qt.ValueScopeName=Qt.Scope=Qt.varKinds=Qt.UsedValueState=void 0;var Xt=Ec(),k0=class extends Error{constructor(t){super(`CodeGen: "code" for ${t} not defined`),this.value=t.value}},Dp;(function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"})(Dp||(Qt.UsedValueState=Dp={}));Qt.varKinds={const:new Xt.Name("const"),let:new Xt.Name("let"),var:new Xt.Name("var")};var Fp=class{constructor({prefixes:t,parent:r}={}){this._names={},this._prefixes=t,this._parent=r}toName(t){return t instanceof Xt.Name?t:this.name(t)}name(t){return new Xt.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}}};Qt.Scope=Fp;var Bp=class extends Xt.Name{constructor(t,r){super(r),this.prefix=t}setValue(t,{property:r,itemIndex:n}){this.value=t,this.scopePath=(0,Xt._)`.${new Xt.Name(r)}[${n}]`}};Qt.ValueScopeName=Bp;var zG=(0,Xt._)`\n`,N0=class extends Fp{constructor(t){super(t),this._values={},this._scope=t.scope,this.opts={...t,_n:t.lines?zG:Xt.nil}}get(){return this._scope}name(t){return new Bp(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,o=(n=r.key)!==null&&n!==void 0?n:r.ref,a=this._values[s];if(a){let u=a.get(o);if(u)return u}else a=this._values[s]=new Map;a.set(o,i);let c=this._scope[s]||(this._scope[s]=[]),l=c.length;return c[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,Xt._)`${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=Xt.nil;for(let o in t){let a=t[o];if(!a)continue;let c=n[o]=n[o]||new Map;a.forEach(l=>{if(c.has(l))return;c.set(l,Dp.Started);let u=r(l);if(u){let p=this.opts.es5?Qt.varKinds.var:Qt.varKinds.const;s=(0,Xt._)`${s}${p} ${l} = ${u};${this.opts._n}`}else if(u=i==null?void 0:i(l))s=(0,Xt._)`${s}${u}${this.opts._n}`;else throw new k0(l);c.set(l,Dp.Completed)})}return s}};Qt.ValueScope=N0});var ae=v(le=>{"use strict";Object.defineProperty(le,"__esModule",{value:!0});le.or=le.and=le.not=le.CodeGen=le.operators=le.varKinds=le.ValueScopeName=le.ValueScope=le.Scope=le.Name=le.regexpCode=le.stringify=le.getProperty=le.nil=le.strConcat=le.str=le._=void 0;var me=Ec(),kr=I0(),fi=Ec();Object.defineProperty(le,"_",{enumerable:!0,get:function(){return fi._}});Object.defineProperty(le,"str",{enumerable:!0,get:function(){return fi.str}});Object.defineProperty(le,"strConcat",{enumerable:!0,get:function(){return fi.strConcat}});Object.defineProperty(le,"nil",{enumerable:!0,get:function(){return fi.nil}});Object.defineProperty(le,"getProperty",{enumerable:!0,get:function(){return fi.getProperty}});Object.defineProperty(le,"stringify",{enumerable:!0,get:function(){return fi.stringify}});Object.defineProperty(le,"regexpCode",{enumerable:!0,get:function(){return fi.regexpCode}});Object.defineProperty(le,"Name",{enumerable:!0,get:function(){return fi.Name}});var Hp=I0();Object.defineProperty(le,"Scope",{enumerable:!0,get:function(){return Hp.Scope}});Object.defineProperty(le,"ValueScope",{enumerable:!0,get:function(){return Hp.ValueScope}});Object.defineProperty(le,"ValueScopeName",{enumerable:!0,get:function(){return Hp.ValueScopeName}});Object.defineProperty(le,"varKinds",{enumerable:!0,get:function(){return Hp.varKinds}});le.operators={GT:new me._Code(">"),GTE:new me._Code(">="),LT:new me._Code("<"),LTE:new me._Code("<="),EQ:new me._Code("==="),NEQ:new me._Code("!=="),NOT:new me._Code("!"),OR:new me._Code("||"),AND:new me._Code("&&"),ADD:new me._Code("+")};var On=class{optimizeNodes(){return this}optimizeNames(t,r){return this}},q0=class extends On{constructor(t,r,n){super(),this.varKind=t,this.name=r,this.rhs=n}render({es5:t,_n:r}){let n=t?kr.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=Co(this.rhs,t,r)),this}get names(){return this.rhs instanceof me._CodeOrName?this.rhs.names:{}}},Vp=class extends On{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 me.Name&&!t[this.lhs.str]&&!this.sideEffects))return this.rhs=Co(this.rhs,t,r),this}get names(){let t=this.lhs instanceof me.Name?{}:{...this.lhs.names};return zp(t,this.rhs)}},j0=class extends Vp{constructor(t,r,n,i){super(t,n,i),this.op=r}render({_n:t}){return`${this.lhs} ${this.op}= ${this.rhs};`+t}},M0=class extends On{constructor(t){super(),this.label=t,this.names={}}render({_n:t}){return`${this.label}:`+t}},L0=class extends On{constructor(t){super(),this.label=t,this.names={}}render({_n:t}){return`break${this.label?` ${this.label}`:""};`+t}},D0=class extends On{constructor(t){super(),this.error=t}render({_n:t}){return`throw ${this.error};`+t}get names(){return this.error.names}},F0=class extends On{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=Co(this.code,t,r),this}get names(){return this.code instanceof me._CodeOrName?this.code.names:{}}},Ac=class extends On{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)||(HG(t,s.names),n.splice(i,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((t,r)=>hs(t,r.names),{})}},Pn=class extends Ac{render(t){return"{"+t._n+super.render(t)+"}"+t._n}},B0=class extends Ac{},Ro=class extends Pn{};Ro.kind="else";var ds=class e extends Pn{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 Ro(n):n}if(r)return t===!1?r instanceof e?r:r.nodes:this.nodes.length?this:new e(OR(t),r instanceof e?[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=Co(this.condition,t,r),this}get names(){let t=super.names;return zp(t,this.condition),this.else&&hs(t,this.else.names),t}};ds.kind="if";var ms=class extends Pn{};ms.kind="for";var V0=class extends ms{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=Co(this.iteration,t,r),this}get names(){return hs(super.names,this.iteration.names)}},U0=class extends ms{constructor(t,r,n,i){super(),this.varKind=t,this.name=r,this.from=n,this.to=i}render(t){let r=t.es5?kr.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=zp(super.names,this.from);return zp(t,this.to)}},Up=class extends ms{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=Co(this.iterable,t,r),this}get names(){return hs(super.names,this.iterable.names)}},Tc=class extends Pn{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)}};Tc.kind="func";var Rc=class extends Ac{render(t){return"return "+super.render(t)}};Rc.kind="return";var z0=class extends Pn{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&&hs(t,this.catch.names),this.finally&&hs(t,this.finally.names),t}},Cc=class extends Pn{constructor(t){super(),this.error=t}render(t){return`catch(${this.error})`+super.render(t)}};Cc.kind="catch";var kc=class extends Pn{render(t){return"finally"+super.render(t)}};kc.kind="finally";var H0=class{constructor(t,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
200
+ `:""},this._extScope=t,this._scope=new kr.Scope({parent:t}),this._nodes=[new B0]}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 q0(t,s,n)),s}const(t,r,n){return this._def(kr.varKinds.const,t,r,n)}let(t,r,n){return this._def(kr.varKinds.let,t,r,n)}var(t,r,n){return this._def(kr.varKinds.var,t,r,n)}assign(t,r,n){return this._leafNode(new Vp(t,r,n))}add(t,r){return this._leafNode(new j0(t,le.operators.ADD,r))}code(t){return typeof t=="function"?t():t!==me.nil&&this._leafNode(new F0(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,me.addCodeArg)(r,i));return r.push("}"),new me._Code(r)}if(t,r,n){if(this._blockNode(new ds(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 ds(t))}else(){return this._elseNode(new Ro)}endIf(){return this._endBlockNode(ds,Ro)}_for(t,r){return this._blockNode(t),r&&this.code(r).endFor(),this}for(t,r){return this._for(new V0(t),r)}forRange(t,r,n,i,s=this.opts.es5?kr.varKinds.var:kr.varKinds.let){let o=this._scope.toName(t);return this._for(new U0(s,o,r,n),()=>i(o))}forOf(t,r,n,i=kr.varKinds.const){let s=this._scope.toName(t);if(this.opts.es5){let o=r instanceof me.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,me._)`${o}.length`,a=>{this.var(s,(0,me._)`${o}[${a}]`),n(s)})}return this._for(new Up("of",i,s,r),()=>n(s))}forIn(t,r,n,i=this.opts.es5?kr.varKinds.var:kr.varKinds.const){if(this.opts.ownProperties)return this.forOf(t,(0,me._)`Object.keys(${r})`,n);let s=this._scope.toName(t);return this._for(new Up("in",i,s,r),()=>n(s))}endFor(){return this._endBlockNode(ms)}label(t){return this._leafNode(new M0(t))}break(t){return this._leafNode(new L0(t))}return(t){let r=new Rc;if(this._blockNode(r),this.code(t),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(Rc)}try(t,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let i=new z0;if(this._blockNode(i),this.code(t),r){let s=this.name("e");this._currNode=i.catch=new Cc(s),r(s)}return n&&(this._currNode=i.finally=new kc,this.code(n)),this._endBlockNode(Cc,kc)}throw(t){return this._leafNode(new D0(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=me.nil,n,i){return this._blockNode(new Tc(t,r,n)),i&&this.code(i).endFunc(),this}endFunc(){return this._endBlockNode(Tc)}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 ds))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}};le.CodeGen=H0;function hs(e,t){for(let r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function zp(e,t){return t instanceof me._CodeOrName?hs(e,t.names):e}function Co(e,t,r){if(e instanceof me.Name)return n(e);if(!i(e))return e;return new me._Code(e._items.reduce((s,o)=>(o instanceof me.Name&&(o=n(o)),o instanceof me._Code?s.push(...o._items):s.push(o),s),[]));function n(s){let o=r[s.str];return o===void 0||t[s.str]!==1?s:(delete t[s.str],o)}function i(s){return s instanceof me._Code&&s._items.some(o=>o instanceof me.Name&&t[o.str]===1&&r[o.str]!==void 0)}}function HG(e,t){for(let r in t)e[r]=(e[r]||0)-(t[r]||0)}function OR(e){return typeof e=="boolean"||typeof e=="number"||e===null?!e:(0,me._)`!${K0(e)}`}le.not=OR;var KG=PR(le.operators.AND);function WG(...e){return e.reduce(KG)}le.and=WG;var YG=PR(le.operators.OR);function GG(...e){return e.reduce(YG)}le.or=GG;function PR(e){return(t,r)=>t===me.nil?r:r===me.nil?t:(0,me._)`${K0(t)} ${e} ${K0(r)}`}function K0(e){return e instanceof me.Name?e:(0,me._)`(${e})`}});var Se=v(ue=>{"use strict";Object.defineProperty(ue,"__esModule",{value:!0});ue.checkStrictMode=ue.getErrorPath=ue.Type=ue.useFunc=ue.setEvaluated=ue.evaluatedPropsToName=ue.mergeEvaluated=ue.eachItem=ue.unescapeJsonPointer=ue.escapeJsonPointer=ue.escapeFragment=ue.unescapeFragment=ue.schemaRefOrVal=ue.schemaHasRulesButRef=ue.schemaHasRules=ue.checkUnknownRules=ue.alwaysValidSchema=ue.toHash=void 0;var Te=ae(),JG=Ec();function XG(e){let t={};for(let r of e)t[r]=!0;return t}ue.toHash=XG;function QG(e,t){return typeof t=="boolean"?t:Object.keys(t).length===0?!0:(AR(e,t),!TR(t,e.self.RULES.all))}ue.alwaysValidSchema=QG;function AR(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]||kR(e,`unknown keyword: "${s}"`)}ue.checkUnknownRules=AR;function TR(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(t[r])return!0;return!1}ue.schemaHasRules=TR;function ZG(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(r!=="$ref"&&t.all[r])return!0;return!1}ue.schemaHasRulesButRef=ZG;function eJ({topSchemaRef:e,schemaPath:t},r,n,i){if(!i){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,Te._)`${r}`}return(0,Te._)`${e}${t}${(0,Te.getProperty)(n)}`}ue.schemaRefOrVal=eJ;function tJ(e){return RR(decodeURIComponent(e))}ue.unescapeFragment=tJ;function rJ(e){return encodeURIComponent(Y0(e))}ue.escapeFragment=rJ;function Y0(e){return typeof e=="number"?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}ue.escapeJsonPointer=Y0;function RR(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}ue.unescapeJsonPointer=RR;function nJ(e,t){if(Array.isArray(e))for(let r of e)t(r);else t(e)}ue.eachItem=nJ;function $R({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:n}){return(i,s,o,a)=>{let c=o===void 0?s:o instanceof Te.Name?(s instanceof Te.Name?e(i,s,o):t(i,s,o),o):s instanceof Te.Name?(t(i,o,s),s):r(s,o);return a===Te.Name&&!(c instanceof Te.Name)?n(i,c):c}}ue.mergeEvaluated={props:$R({mergeNames:(e,t,r)=>e.if((0,Te._)`${r} !== true && ${t} !== undefined`,()=>{e.if((0,Te._)`${t} === true`,()=>e.assign(r,!0),()=>e.assign(r,(0,Te._)`${r} || {}`).code((0,Te._)`Object.assign(${r}, ${t})`))}),mergeToName:(e,t,r)=>e.if((0,Te._)`${r} !== true`,()=>{t===!0?e.assign(r,!0):(e.assign(r,(0,Te._)`${r} || {}`),G0(e,r,t))}),mergeValues:(e,t)=>e===!0?!0:{...e,...t},resultToName:CR}),items:$R({mergeNames:(e,t,r)=>e.if((0,Te._)`${r} !== true && ${t} !== undefined`,()=>e.assign(r,(0,Te._)`${t} === true ? true : ${r} > ${t} ? ${r} : ${t}`)),mergeToName:(e,t,r)=>e.if((0,Te._)`${r} !== true`,()=>e.assign(r,t===!0?!0:(0,Te._)`${r} > ${t} ? ${r} : ${t}`)),mergeValues:(e,t)=>e===!0?!0:Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})};function CR(e,t){if(t===!0)return e.var("props",!0);let r=e.var("props",(0,Te._)`{}`);return t!==void 0&&G0(e,r,t),r}ue.evaluatedPropsToName=CR;function G0(e,t,r){Object.keys(r).forEach(n=>e.assign((0,Te._)`${t}${(0,Te.getProperty)(n)}`,!0))}ue.setEvaluated=G0;var ER={};function iJ(e,t){return e.scopeValue("func",{ref:t,code:ER[t.code]||(ER[t.code]=new JG._Code(t.code))})}ue.useFunc=iJ;var W0;(function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"})(W0||(ue.Type=W0={}));function sJ(e,t,r){if(e instanceof Te.Name){let n=t===W0.Num;return r?n?(0,Te._)`"[" + ${e} + "]"`:(0,Te._)`"['" + ${e} + "']"`:n?(0,Te._)`"/" + ${e}`:(0,Te._)`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,Te.getProperty)(e).toString():"/"+Y0(e)}ue.getErrorPath=sJ;function kR(e,t,r=e.opts.strictSchema){if(r){if(t=`strict mode: ${t}`,r===!0)throw new Error(t);e.self.logger.warn(t)}}ue.checkStrictMode=kR});var $n=v(J0=>{"use strict";Object.defineProperty(J0,"__esModule",{value:!0});var $t=ae(),oJ={data:new $t.Name("data"),valCxt:new $t.Name("valCxt"),instancePath:new $t.Name("instancePath"),parentData:new $t.Name("parentData"),parentDataProperty:new $t.Name("parentDataProperty"),rootData:new $t.Name("rootData"),dynamicAnchors:new $t.Name("dynamicAnchors"),vErrors:new $t.Name("vErrors"),errors:new $t.Name("errors"),this:new $t.Name("this"),self:new $t.Name("self"),scope:new $t.Name("scope"),json:new $t.Name("json"),jsonPos:new $t.Name("jsonPos"),jsonLen:new $t.Name("jsonLen"),jsonPart:new $t.Name("jsonPart")};J0.default=oJ});var Nc=v(Et=>{"use strict";Object.defineProperty(Et,"__esModule",{value:!0});Et.extendErrors=Et.resetErrorsCount=Et.reportExtraError=Et.reportError=Et.keyword$DataError=Et.keywordError=void 0;var ve=ae(),Kp=Se(),Dt=$n();Et.keywordError={message:({keyword:e})=>(0,ve.str)`must pass "${e}" keyword validation`};Et.keyword$DataError={message:({keyword:e,schemaType:t})=>t?(0,ve.str)`"${e}" keyword must be ${t} ($data)`:(0,ve.str)`"${e}" keyword is invalid ($data)`};function aJ(e,t=Et.keywordError,r,n){let{it:i}=e,{gen:s,compositeRule:o,allErrors:a}=i,c=qR(e,t,r);(n!=null?n:o||a)?NR(s,c):IR(i,(0,ve._)`[${c}]`)}Et.reportError=aJ;function cJ(e,t=Et.keywordError,r){let{it:n}=e,{gen:i,compositeRule:s,allErrors:o}=n,a=qR(e,t,r);NR(i,a),s||o||IR(n,Dt.default.vErrors)}Et.reportExtraError=cJ;function lJ(e,t){e.assign(Dt.default.errors,t),e.if((0,ve._)`${Dt.default.vErrors} !== null`,()=>e.if(t,()=>e.assign((0,ve._)`${Dt.default.vErrors}.length`,t),()=>e.assign(Dt.default.vErrors,null)))}Et.resetErrorsCount=lJ;function uJ({gen:e,keyword:t,schemaValue:r,data:n,errsCount:i,it:s}){if(i===void 0)throw new Error("ajv implementation error");let o=e.name("err");e.forRange("i",i,Dt.default.errors,a=>{e.const(o,(0,ve._)`${Dt.default.vErrors}[${a}]`),e.if((0,ve._)`${o}.instancePath === undefined`,()=>e.assign((0,ve._)`${o}.instancePath`,(0,ve.strConcat)(Dt.default.instancePath,s.errorPath))),e.assign((0,ve._)`${o}.schemaPath`,(0,ve.str)`${s.errSchemaPath}/${t}`),s.opts.verbose&&(e.assign((0,ve._)`${o}.schema`,r),e.assign((0,ve._)`${o}.data`,n))})}Et.extendErrors=uJ;function NR(e,t){let r=e.const("err",t);e.if((0,ve._)`${Dt.default.vErrors} === null`,()=>e.assign(Dt.default.vErrors,(0,ve._)`[${r}]`),(0,ve._)`${Dt.default.vErrors}.push(${r})`),e.code((0,ve._)`${Dt.default.errors}++`)}function IR(e,t){let{gen:r,validateName:n,schemaEnv:i}=e;i.$async?r.throw((0,ve._)`new ${e.ValidationError}(${t})`):(r.assign((0,ve._)`${n}.errors`,t),r.return(!1))}var ys={keyword:new ve.Name("keyword"),schemaPath:new ve.Name("schemaPath"),params:new ve.Name("params"),propertyName:new ve.Name("propertyName"),message:new ve.Name("message"),schema:new ve.Name("schema"),parentSchema:new ve.Name("parentSchema")};function qR(e,t,r){let{createErrors:n}=e.it;return n===!1?(0,ve._)`{}`:pJ(e,t,r)}function pJ(e,t,r={}){let{gen:n,it:i}=e,s=[fJ(i,r),dJ(e,r)];return mJ(e,t,s),n.object(...s)}function fJ({errorPath:e},{instancePath:t}){let r=t?(0,ve.str)`${e}${(0,Kp.getErrorPath)(t,Kp.Type.Str)}`:e;return[Dt.default.instancePath,(0,ve.strConcat)(Dt.default.instancePath,r)]}function dJ({keyword:e,it:{errSchemaPath:t}},{schemaPath:r,parentSchema:n}){let i=n?t:(0,ve.str)`${t}/${e}`;return r&&(i=(0,ve.str)`${i}${(0,Kp.getErrorPath)(r,Kp.Type.Str)}`),[ys.schemaPath,i]}function mJ(e,{params:t,message:r},n){let{keyword:i,data:s,schemaValue:o,it:a}=e,{opts:c,propertyName:l,topSchemaRef:u,schemaPath:p}=a;n.push([ys.keyword,i],[ys.params,typeof t=="function"?t(e):t||(0,ve._)`{}`]),c.messages&&n.push([ys.message,typeof r=="function"?r(e):r]),c.verbose&&n.push([ys.schema,o],[ys.parentSchema,(0,ve._)`${u}${p}`],[Dt.default.data,s]),l&&n.push([ys.propertyName,l])}});var MR=v(ko=>{"use strict";Object.defineProperty(ko,"__esModule",{value:!0});ko.boolOrEmptySchema=ko.topBoolOrEmptySchema=void 0;var hJ=Nc(),yJ=ae(),gJ=$n(),bJ={message:"boolean schema is false"};function vJ(e){let{gen:t,schema:r,validateName:n}=e;r===!1?jR(e,!1):typeof r=="object"&&r.$async===!0?t.return(gJ.default.data):(t.assign((0,yJ._)`${n}.errors`,null),t.return(!0))}ko.topBoolOrEmptySchema=vJ;function wJ(e,t){let{gen:r,schema:n}=e;n===!1?(r.var(t,!1),jR(e)):r.var(t,!0)}ko.boolOrEmptySchema=wJ;function jR(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,hJ.reportError)(i,bJ,void 0,t)}});var X0=v(No=>{"use strict";Object.defineProperty(No,"__esModule",{value:!0});No.getRules=No.isJSONType=void 0;var xJ=["string","number","integer","boolean","null","object","array"],SJ=new Set(xJ);function _J(e){return typeof e=="string"&&SJ.has(e)}No.isJSONType=_J;function OJ(){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:{}}}No.getRules=OJ});var Q0=v(di=>{"use strict";Object.defineProperty(di,"__esModule",{value:!0});di.shouldUseRule=di.shouldUseGroup=di.schemaHasRulesForType=void 0;function PJ({schema:e,self:t},r){let n=t.RULES.types[r];return n&&n!==!0&&LR(e,n)}di.schemaHasRulesForType=PJ;function LR(e,t){return t.rules.some(r=>DR(e,r))}di.shouldUseGroup=LR;function DR(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))}di.shouldUseRule=DR});var Ic=v(At=>{"use strict";Object.defineProperty(At,"__esModule",{value:!0});At.reportTypeError=At.checkDataTypes=At.checkDataType=At.coerceAndCheckDataType=At.getJSONTypes=At.getSchemaTypes=At.DataType=void 0;var $J=X0(),EJ=Q0(),AJ=Nc(),oe=ae(),FR=Se(),Io;(function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"})(Io||(At.DataType=Io={}));function TJ(e){let t=BR(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}At.getSchemaTypes=TJ;function BR(e){let t=Array.isArray(e)?e:e?[e]:[];if(t.every($J.isJSONType))return t;throw new Error("type must be JSONType or JSONType[]: "+t.join(","))}At.getJSONTypes=BR;function RJ(e,t){let{gen:r,data:n,opts:i}=e,s=CJ(t,i.coerceTypes),o=t.length>0&&!(s.length===0&&t.length===1&&(0,EJ.schemaHasRulesForType)(e,t[0]));if(o){let a=eb(t,n,i.strictNumbers,Io.Wrong);r.if(a,()=>{s.length?kJ(e,t,s):tb(e)})}return o}At.coerceAndCheckDataType=RJ;var VR=new Set(["string","number","integer","boolean","null"]);function CJ(e,t){return t?e.filter(r=>VR.has(r)||t==="array"&&r==="array"):[]}function kJ(e,t,r){let{gen:n,data:i,opts:s}=e,o=n.let("dataType",(0,oe._)`typeof ${i}`),a=n.let("coerced",(0,oe._)`undefined`);s.coerceTypes==="array"&&n.if((0,oe._)`${o} == 'object' && Array.isArray(${i}) && ${i}.length == 1`,()=>n.assign(i,(0,oe._)`${i}[0]`).assign(o,(0,oe._)`typeof ${i}`).if(eb(t,i,s.strictNumbers),()=>n.assign(a,i))),n.if((0,oe._)`${a} !== undefined`);for(let l of r)(VR.has(l)||l==="array"&&s.coerceTypes==="array")&&c(l);n.else(),tb(e),n.endIf(),n.if((0,oe._)`${a} !== undefined`,()=>{n.assign(i,a),NJ(e,a)});function c(l){switch(l){case"string":n.elseIf((0,oe._)`${o} == "number" || ${o} == "boolean"`).assign(a,(0,oe._)`"" + ${i}`).elseIf((0,oe._)`${i} === null`).assign(a,(0,oe._)`""`);return;case"number":n.elseIf((0,oe._)`${o} == "boolean" || ${i} === null
201
201
  || (${o} == "string" && ${i} && ${i} == +${i})`).assign(a,(0,oe._)`+${i}`);return;case"integer":n.elseIf((0,oe._)`${o} === "boolean" || ${i} === null
202
202
  || (${o} === "string" && ${i} && ${i} == +${i} && !(${i} % 1))`).assign(a,(0,oe._)`+${i}`);return;case"boolean":n.elseIf((0,oe._)`${i} === "false" || ${i} === 0 || ${i} === null`).assign(a,!1).elseIf((0,oe._)`${i} === "true" || ${i} === 1`).assign(a,!0);return;case"null":n.elseIf((0,oe._)`${i} === "" || ${i} === 0 || ${i} === false`),n.assign(a,null);return;case"array":n.elseIf((0,oe._)`${o} === "string" || ${o} === "number"
203
- || ${o} === "boolean" || ${i} === null`).assign(a,(0,oe._)`[${i}]`)}}}function IJ({gen:e,parentData:t,parentDataProperty:r},n){e.if((0,oe._)`${t} !== undefined`,()=>e.assign((0,oe._)`${t}[${r}]`,n))}function Z0(e,t,r,n=Io.Correct){let i=n===Io.Correct?oe.operators.EQ:oe.operators.NEQ,s;switch(e){case"null":return(0,oe._)`${t} ${i} null`;case"array":s=(0,oe._)`Array.isArray(${t})`;break;case"object":s=(0,oe._)`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":s=o((0,oe._)`!(${t} % 1) && !isNaN(${t})`);break;case"number":s=o();break;default:return(0,oe._)`typeof ${t} ${i} ${e}`}return n===Io.Correct?s:(0,oe.not)(s);function o(a=oe.nil){return(0,oe.and)((0,oe._)`typeof ${t} == "number"`,a,r?(0,oe._)`isFinite(${t})`:oe.nil)}}At.checkDataType=Z0;function eb(e,t,r,n){if(e.length===1)return Z0(e[0],t,r,n);let i,s=(0,VR.toHash)(e);if(s.array&&s.object){let o=(0,oe._)`typeof ${t} != "object"`;i=s.null?o:(0,oe._)`!${t} || ${o}`,delete s.null,delete s.array,delete s.object}else i=oe.nil;s.number&&delete s.integer;for(let o in s)i=(0,oe.and)(i,Z0(o,t,r,n));return i}At.checkDataTypes=eb;var qJ={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>typeof e=="string"?(0,oe._)`{type: ${e}}`:(0,oe._)`{type: ${t}}`};function tb(e){let t=jJ(e);(0,TJ.reportError)(t,qJ)}At.reportTypeError=tb;function jJ(e){let{gen:t,data:r,schema:n}=e,i=(0,VR.schemaRefOrVal)(e,n,"type");return{gen:t,keyword:"type",data:r,schema:n.type,schemaCode:i,schemaValue:i,parentSchema:n,params:{},it:e}}});var KR=v(Wp=>{"use strict";Object.defineProperty(Wp,"__esModule",{value:!0});Wp.assignDefaults=void 0;var qo=ae(),MJ=Se();function LJ(e,t){let{properties:r,items:n}=e.schema;if(t==="object"&&r)for(let i in r)HR(e,i,r[i].default);else t==="array"&&Array.isArray(n)&&n.forEach((i,s)=>HR(e,s,i.default))}Wp.assignDefaults=LJ;function HR(e,t,r){let{gen:n,compositeRule:i,data:s,opts:o}=e;if(r===void 0)return;let a=(0,qo._)`${s}${(0,qo.getProperty)(t)}`;if(i){(0,MJ.checkStrictMode)(e,`default is ignored for: ${a}`);return}let c=(0,qo._)`${a} === undefined`;o.useDefaults==="empty"&&(c=(0,qo._)`${c} || ${a} === null || ${a} === ""`),n.if(c,(0,qo._)`${a} = ${(0,qo.stringify)(r)}`)}});var xr=v($e=>{"use strict";Object.defineProperty($e,"__esModule",{value:!0});$e.validateUnion=$e.validateArray=$e.usePattern=$e.callValidateCode=$e.schemaProperties=$e.allSchemaProperties=$e.noPropertyInData=$e.propertyInData=$e.isOwnProperty=$e.hasPropFunc=$e.reportMissingProp=$e.checkMissingProp=$e.checkReportMissingProp=void 0;var Ne=ae(),rb=Se(),mi=$n(),DJ=Se();function FJ(e,t){let{gen:r,data:n,it:i}=e;r.if(ib(r,n,t,i.opts.ownProperties),()=>{e.setParams({missingProperty:(0,Ne._)`${t}`},!0),e.error()})}$e.checkReportMissingProp=FJ;function BJ({gen:e,data:t,it:{opts:r}},n,i){return(0,Ne.or)(...n.map(s=>(0,Ne.and)(ib(e,t,s,r.ownProperties),(0,Ne._)`${i} = ${s}`)))}$e.checkMissingProp=BJ;function VJ(e,t){e.setParams({missingProperty:t},!0),e.error()}$e.reportMissingProp=VJ;function WR(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,Ne._)`Object.prototype.hasOwnProperty`})}$e.hasPropFunc=WR;function nb(e,t,r){return(0,Ne._)`${WR(e)}.call(${t}, ${r})`}$e.isOwnProperty=nb;function UJ(e,t,r,n){let i=(0,Ne._)`${t}${(0,Ne.getProperty)(r)} !== undefined`;return n?(0,Ne._)`${i} && ${nb(e,t,r)}`:i}$e.propertyInData=UJ;function ib(e,t,r,n){let i=(0,Ne._)`${t}${(0,Ne.getProperty)(r)} === undefined`;return n?(0,Ne.or)(i,(0,Ne.not)(nb(e,t,r))):i}$e.noPropertyInData=ib;function YR(e){return e?Object.keys(e).filter(t=>t!=="__proto__"):[]}$e.allSchemaProperties=YR;function zJ(e,t){return YR(t).filter(r=>!(0,rb.alwaysValidSchema)(e,t[r]))}$e.schemaProperties=zJ;function HJ({schemaCode:e,data:t,it:{gen:r,topSchemaRef:n,schemaPath:i,errorPath:s},it:o},a,c,l){let u=l?(0,Ne._)`${e}, ${t}, ${n}${i}`:t,p=[[mi.default.instancePath,(0,Ne.strConcat)(mi.default.instancePath,s)],[mi.default.parentData,o.parentData],[mi.default.parentDataProperty,o.parentDataProperty],[mi.default.rootData,mi.default.rootData]];o.opts.dynamicRef&&p.push([mi.default.dynamicAnchors,mi.default.dynamicAnchors]);let d=(0,Ne._)`${u}, ${r.object(...p)}`;return c!==Ne.nil?(0,Ne._)`${a}.call(${c}, ${d})`:(0,Ne._)`${a}(${d})`}$e.callValidateCode=HJ;var KJ=(0,Ne._)`new RegExp`;function WJ({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,Ne._)`${i.code==="new RegExp"?KJ:(0,DJ.useFunc)(e,i)}(${r}, ${n})`})}$e.usePattern=WJ;function YJ(e){let{gen:t,data:r,keyword:n,it:i}=e,s=t.name("valid");if(i.allErrors){let a=t.let("valid",!0);return o(()=>t.assign(a,!1)),a}return t.var(s,!0),o(()=>t.break()),s;function o(a){let c=t.const("len",(0,Ne._)`${r}.length`);t.forRange("i",0,c,l=>{e.subschema({keyword:n,dataProp:l,dataPropType:rb.Type.Num},s),t.if((0,Ne.not)(s),a)})}}$e.validateArray=YJ;function GJ(e){let{gen:t,schema:r,keyword:n,it:i}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(c=>(0,rb.alwaysValidSchema)(i,c))&&!i.opts.unevaluated)return;let o=t.let("valid",!1),a=t.name("_valid");t.block(()=>r.forEach((c,l)=>{let u=e.subschema({keyword:n,schemaProp:l,compositeRule:!0},a);t.assign(o,(0,Ne._)`${o} || ${a}`),e.mergeValidEvaluated(u,a)||t.if((0,Ne.not)(o))})),e.result(o,()=>e.reset(),()=>e.error(!0))}$e.validateUnion=GJ});var XR=v(Qr=>{"use strict";Object.defineProperty(Qr,"__esModule",{value:!0});Qr.validateKeywordUsage=Qr.validSchemaType=Qr.funcKeywordCode=Qr.macroKeywordCode=void 0;var Ft=ae(),gs=$n(),JJ=xr(),XJ=Nc();function QJ(e,t){let{gen:r,keyword:n,schema:i,parentSchema:s,it:o}=e,a=t.macro.call(o.self,i,s,o),c=JR(r,n,a);o.opts.validateSchema!==!1&&o.self.validateSchema(a,!0);let l=r.name("valid");e.subschema({schema:a,schemaPath:Ft.nil,errSchemaPath:`${o.errSchemaPath}/${n}`,topSchemaRef:c,compositeRule:!0},l),e.pass(l,()=>e.error(!0))}Qr.macroKeywordCode=QJ;function ZJ(e,t){var r;let{gen:n,keyword:i,schema:s,parentSchema:o,$data:a,it:c}=e;tX(c,t);let l=!a&&t.compile?t.compile.call(c.self,s,o,c):t.validate,u=JR(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)h(),t.modifying&&GR(e),y(()=>e.error());else{let g=t.async?m():f();t.modifying&&GR(e),y(()=>eX(e,g))}}function m(){let g=n.let("ruleErrs",null);return n.try(()=>h((0,Ft._)`await `),b=>n.assign(p,!1).if((0,Ft._)`${b} instanceof ${c.ValidationError}`,()=>n.assign(g,(0,Ft._)`${b}.errors`),()=>n.throw(b))),g}function f(){let g=(0,Ft._)`${u}.errors`;return n.assign(g,null),h(Ft.nil),g}function h(g=t.async?(0,Ft._)`await `:Ft.nil){let b=c.opts.passContext?gs.default.this:gs.default.self,w=!("compile"in t&&!a||t.schema===!1);n.assign(p,(0,Ft._)`${g}${(0,JJ.callValidateCode)(e,u,b,w)}`,t.modifying)}function y(g){var b;n.if((0,Ft.not)((b=t.valid)!==null&&b!==void 0?b:p),g)}}Qr.funcKeywordCode=ZJ;function GR(e){let{gen:t,data:r,it:n}=e;t.if(n.parentData,()=>t.assign(r,(0,Ft._)`${n.parentData}[${n.parentDataProperty}]`))}function eX(e,t){let{gen:r}=e;r.if((0,Ft._)`Array.isArray(${t})`,()=>{r.assign(gs.default.vErrors,(0,Ft._)`${gs.default.vErrors} === null ? ${t} : ${gs.default.vErrors}.concat(${t})`).assign(gs.default.errors,(0,Ft._)`${gs.default.vErrors}.length`),(0,XJ.extendErrors)(e)},()=>e.error())}function tX({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}function JR(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,Ft.stringify)(r)})}function rX(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")}Qr.validSchemaType=rX;function nX({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 o=i.dependencies;if(o!=null&&o.some(a=>!Object.prototype.hasOwnProperty.call(e,a)))throw new Error(`parent schema must have dependencies of ${s}: ${o.join(",")}`);if(i.validateSchema&&!i.validateSchema(e[s])){let c=`keyword "${s}" value is invalid at path "${n}": `+r.errorsText(i.validateSchema.errors);if(t.validateSchema==="log")r.logger.error(c);else throw new Error(c)}}Qr.validateKeywordUsage=nX});var ZR=v(hi=>{"use strict";Object.defineProperty(hi,"__esModule",{value:!0});hi.extendSubschemaMode=hi.extendSubschemaData=hi.getSubschema=void 0;var Zr=ae(),QR=Se();function iX(e,{keyword:t,schemaProp:r,schema:n,schemaPath:i,errSchemaPath:s,topSchemaRef:o}){if(t!==void 0&&n!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(t!==void 0){let a=e.schema[t];return r===void 0?{schema:a,schemaPath:(0,Zr._)`${e.schemaPath}${(0,Zr.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:a[r],schemaPath:(0,Zr._)`${e.schemaPath}${(0,Zr.getProperty)(t)}${(0,Zr.getProperty)(r)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,QR.escapeFragment)(r)}`}}if(n!==void 0){if(i===void 0||s===void 0||o===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:i,topSchemaRef:o,errSchemaPath:s}}throw new Error('either "keyword" or "schema" must be passed')}hi.getSubschema=iX;function sX(e,t,{dataProp:r,dataPropType:n,data:i,dataTypes:s,propertyName:o}){if(i!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:a}=t;if(r!==void 0){let{errorPath:l,dataPathArr:u,opts:p}=t,d=a.let("data",(0,Zr._)`${t.data}${(0,Zr.getProperty)(r)}`,!0);c(d),e.errorPath=(0,Zr.str)`${l}${(0,QR.getErrorPath)(r,n,p.jsPropertySyntax)}`,e.parentDataProperty=(0,Zr._)`${r}`,e.dataPathArr=[...u,e.parentDataProperty]}if(i!==void 0){let l=i instanceof Zr.Name?i:a.let("data",i,!0);c(l),o!==void 0&&(e.propertyName=o)}s&&(e.dataTypes=s);function c(l){e.data=l,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,l]}}hi.extendSubschemaData=sX;function oX(e,{jtdDiscriminator:t,jtdMetadata:r,compositeRule:n,createErrors:i,allErrors:s}){n!==void 0&&(e.compositeRule=n),i!==void 0&&(e.createErrors=i),s!==void 0&&(e.allErrors=s),e.jtdDiscriminator=t,e.jtdMetadata=r}hi.extendSubschemaMode=oX});var qc=v(Zt=>{"use strict";Object.defineProperty(Zt,"__esModule",{value:!0});Zt.getSchemaRefs=Zt.resolveUrl=Zt.normalizeId=Zt._getFullPath=Zt.getFullPath=Zt.inlineRef=void 0;var aX=Se(),cX=Sa(),lX=hm(),uX=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function pX(e,t=!0){return typeof e=="boolean"?!0:t===!0?!sb(e):t?e2(e)<=t:!1}Zt.inlineRef=pX;var fX=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function sb(e){for(let t in e){if(fX.has(t))return!0;let r=e[t];if(Array.isArray(r)&&r.some(sb)||typeof r=="object"&&sb(r))return!0}return!1}function e2(e){let t=0;for(let r in e){if(r==="$ref")return 1/0;if(t++,!uX.has(r)&&(typeof e[r]=="object"&&(0,aX.eachItem)(e[r],n=>t+=e2(n)),t===1/0))return 1/0}return t}function t2(e,t="",r){r!==!1&&(t=jo(t));let n=e.parse(t);return r2(e,n)}Zt.getFullPath=t2;function r2(e,t){return e.serialize(t).split("#")[0]+"#"}Zt._getFullPath=r2;var dX=/#\/?$/;function jo(e){return e?e.replace(dX,""):""}Zt.normalizeId=jo;function mX(e,t,r){return r=jo(r),e.resolve(t,r)}Zt.resolveUrl=mX;var hX=/^[a-z_][-a-z0-9._]*$/i;function yX(e,t){if(typeof e=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,i=jo(e[r]||t),s={"":i},o=t2(n,i,!1),a={},c=new Set;return lX(e,{allKeys:!0},(p,d,m,f)=>{if(f===void 0)return;let h=o+d,y=s[f];typeof p[r]=="string"&&(y=g.call(this,p[r])),b.call(this,p.$anchor),b.call(this,p.$dynamicAnchor),s[d]=y;function g(w){let x=this.opts.uriResolver.resolve;if(w=jo(y?x(y,w):w),c.has(w))throw u(w);c.add(w);let S=this.refs[w];return typeof S=="string"&&(S=this.refs[S]),typeof S=="object"?l(p,S.schema,w):w!==jo(h)&&(w[0]==="#"?(l(p,a[w],w),a[w]=p):this.refs[w]=h),w}function b(w){if(typeof w=="string"){if(!hX.test(w))throw new Error(`invalid anchor "${w}"`);g.call(this,`#${w}`)}}}),a;function l(p,d,m){if(d!==void 0&&!cX(p,d))throw u(m)}function u(p){return new Error(`reference "${p}" resolves to more than one schema`)}}Zt.getSchemaRefs=yX});var Lc=v(yi=>{"use strict";Object.defineProperty(yi,"__esModule",{value:!0});yi.getData=yi.KeywordCxt=yi.validateFunctionCode=void 0;var a2=DR(),n2=Ic(),ab=Q0(),Yp=Ic(),gX=KR(),Mc=XR(),ob=ZR(),W=ae(),ee=$n(),bX=qc(),En=Se(),jc=Nc();function vX(e){if(u2(e)&&(p2(e),l2(e))){SX(e);return}c2(e,()=>(0,a2.topBoolOrEmptySchema)(e))}yi.validateFunctionCode=vX;function c2({gen:e,validateName:t,schema:r,schemaEnv:n,opts:i},s){i.code.es5?e.func(t,(0,W._)`${ee.default.data}, ${ee.default.valCxt}`,n.$async,()=>{e.code((0,W._)`"use strict"; ${i2(r,i)}`),xX(e,i),e.code(s)}):e.func(t,(0,W._)`${ee.default.data}, ${wX(i)}`,n.$async,()=>e.code(i2(r,i)).code(s))}function wX(e){return(0,W._)`{${ee.default.instancePath}="", ${ee.default.parentData}, ${ee.default.parentDataProperty}, ${ee.default.rootData}=${ee.default.data}${e.dynamicRef?(0,W._)`, ${ee.default.dynamicAnchors}={}`:W.nil}}={}`}function xX(e,t){e.if(ee.default.valCxt,()=>{e.var(ee.default.instancePath,(0,W._)`${ee.default.valCxt}.${ee.default.instancePath}`),e.var(ee.default.parentData,(0,W._)`${ee.default.valCxt}.${ee.default.parentData}`),e.var(ee.default.parentDataProperty,(0,W._)`${ee.default.valCxt}.${ee.default.parentDataProperty}`),e.var(ee.default.rootData,(0,W._)`${ee.default.valCxt}.${ee.default.rootData}`),t.dynamicRef&&e.var(ee.default.dynamicAnchors,(0,W._)`${ee.default.valCxt}.${ee.default.dynamicAnchors}`)},()=>{e.var(ee.default.instancePath,(0,W._)`""`),e.var(ee.default.parentData,(0,W._)`undefined`),e.var(ee.default.parentDataProperty,(0,W._)`undefined`),e.var(ee.default.rootData,ee.default.data),t.dynamicRef&&e.var(ee.default.dynamicAnchors,(0,W._)`{}`)})}function SX(e){let{schema:t,opts:r,gen:n}=e;c2(e,()=>{r.$comment&&t.$comment&&d2(e),EX(e),n.let(ee.default.vErrors,null),n.let(ee.default.errors,0),r.unevaluated&&_X(e),f2(e),RX(e)})}function _X(e){let{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",(0,W._)`${r}.evaluated`),t.if((0,W._)`${e.evaluated}.dynamicProps`,()=>t.assign((0,W._)`${e.evaluated}.props`,(0,W._)`undefined`)),t.if((0,W._)`${e.evaluated}.dynamicItems`,()=>t.assign((0,W._)`${e.evaluated}.items`,(0,W._)`undefined`))}function i2(e,t){let r=typeof e=="object"&&e[t.schemaId];return r&&(t.code.source||t.code.process)?(0,W._)`/*# sourceURL=${r} */`:W.nil}function OX(e,t){if(u2(e)&&(p2(e),l2(e))){PX(e,t);return}(0,a2.boolOrEmptySchema)(e,t)}function l2({schema:e,self:t}){if(typeof e=="boolean")return!e;for(let r in e)if(t.RULES.all[r])return!0;return!1}function u2(e){return typeof e.schema!="boolean"}function PX(e,t){let{schema:r,gen:n,opts:i}=e;i.$comment&&r.$comment&&d2(e),AX(e),TX(e);let s=n.const("_errs",ee.default.errors);f2(e,s),n.var(t,(0,W._)`${s} === ${ee.default.errors}`)}function p2(e){(0,En.checkUnknownRules)(e),$X(e)}function f2(e,t){if(e.opts.jtd)return s2(e,[],!1,t);let r=(0,n2.getSchemaTypes)(e.schema),n=(0,n2.coerceAndCheckDataType)(e,r);s2(e,r,!n,t)}function $X(e){let{schema:t,errSchemaPath:r,opts:n,self:i}=e;t.$ref&&n.ignoreKeywordsWithRef&&(0,En.schemaHasRulesButRef)(t,i.RULES)&&i.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function EX(e){let{schema:t,opts:r}=e;t.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,En.checkStrictMode)(e,"default is ignored in the schema root")}function AX(e){let t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,bX.resolveUrl)(e.opts.uriResolver,e.baseId,t))}function TX(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}function d2({gen:e,schemaEnv:t,schema:r,errSchemaPath:n,opts:i}){let s=r.$comment;if(i.$comment===!0)e.code((0,W._)`${ee.default.self}.logger.log(${s})`);else if(typeof i.$comment=="function"){let o=(0,W.str)`${n}/$comment`,a=e.scopeValue("root",{ref:t.root});e.code((0,W._)`${ee.default.self}.opts.$comment(${s}, ${o}, ${a}.schema)`)}}function RX(e){let{gen:t,schemaEnv:r,validateName:n,ValidationError:i,opts:s}=e;r.$async?t.if((0,W._)`${ee.default.errors} === 0`,()=>t.return(ee.default.data),()=>t.throw((0,W._)`new ${i}(${ee.default.vErrors})`)):(t.assign((0,W._)`${n}.errors`,ee.default.vErrors),s.unevaluated&&CX(e),t.return((0,W._)`${ee.default.errors} === 0`))}function CX({gen:e,evaluated:t,props:r,items:n}){r instanceof W.Name&&e.assign((0,W._)`${t}.props`,r),n instanceof W.Name&&e.assign((0,W._)`${t}.items`,n)}function s2(e,t,r,n){let{gen:i,schema:s,data:o,allErrors:a,opts:c,self:l}=e,{RULES:u}=l;if(s.$ref&&(c.ignoreKeywordsWithRef||!(0,En.schemaHasRulesButRef)(s,u))){i.block(()=>h2(e,"$ref",u.all.$ref.definition));return}c.jtd||kX(e,t),i.block(()=>{for(let d of u.rules)p(d);p(u.post)});function p(d){(0,ab.shouldUseGroup)(s,d)&&(d.type?(i.if((0,Yp.checkDataType)(d.type,o,c.strictNumbers)),o2(e,d),t.length===1&&t[0]===d.type&&r&&(i.else(),(0,Yp.reportTypeError)(e)),i.endIf()):o2(e,d),a||i.if((0,W._)`${ee.default.errors} === ${n||0}`))}}function o2(e,t){let{gen:r,schema:n,opts:{useDefaults:i}}=e;i&&(0,gX.assignDefaults)(e,t.type),r.block(()=>{for(let s of t.rules)(0,ab.shouldUseRule)(n,s)&&h2(e,s.keyword,s.definition,t.type)})}function kX(e,t){e.schemaEnv.meta||!e.opts.strictTypes||(NX(e,t),e.opts.allowUnionTypes||IX(e,t),qX(e,e.dataTypes))}function NX(e,t){if(t.length){if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach(r=>{m2(e.dataTypes,r)||cb(e,`type "${r}" not allowed by context "${e.dataTypes.join(",")}"`)}),MX(e,t)}}function IX(e,t){t.length>1&&!(t.length===2&&t.includes("null"))&&cb(e,"use allowUnionTypes to allow union type keyword")}function qX(e,t){let r=e.self.RULES.all;for(let n in r){let i=r[n];if(typeof i=="object"&&(0,ab.shouldUseRule)(e.schema,i)){let{type:s}=i.definition;s.length&&!s.some(o=>jX(t,o))&&cb(e,`missing type "${s.join(",")}" for keyword "${n}"`)}}}function jX(e,t){return e.includes(t)||t==="number"&&e.includes("integer")}function m2(e,t){return e.includes(t)||t==="integer"&&e.includes("number")}function MX(e,t){let r=[];for(let n of e.dataTypes)m2(t,n)?r.push(n):t.includes("integer")&&n==="number"&&r.push("integer");e.dataTypes=r}function cb(e,t){let r=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${r}" (strictTypes)`,(0,En.checkStrictMode)(e,t,e.opts.strictTypes)}var Gp=class{constructor(t,r,n){if((0,Mc.validateKeywordUsage)(t,r,n),this.gen=t.gen,this.allErrors=t.allErrors,this.keyword=n,this.data=t.data,this.schema=t.schema[n],this.$data=r.$data&&t.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,En.schemaRefOrVal)(t,this.schema,n,this.$data),this.schemaType=r.schemaType,this.parentSchema=t.schema,this.params={},this.it=t,this.def=r,this.$data)this.schemaCode=t.gen.const("vSchema",y2(this.$data,t));else if(this.schemaCode=this.schemaValue,!(0,Mc.validSchemaType)(this.schema,r.schemaType,r.allowUndefined))throw new Error(`${n} value must be ${JSON.stringify(r.schemaType)}`);("code"in r?r.trackErrors:r.errors!==!1)&&(this.errsCount=t.gen.const("_errs",ee.default.errors))}result(t,r,n){this.failResult((0,W.not)(t),r,n)}failResult(t,r,n){this.gen.if(t),n?n():this.error(),r?(this.gen.else(),r(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(t,r){this.failResult((0,W.not)(t),void 0,r)}fail(t){if(t===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(t),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(t){if(!this.$data)return this.fail(t);let{schemaCode:r}=this;this.fail((0,W._)`${r} !== undefined && (${(0,W.or)(this.invalid$data(),t)})`)}error(t,r,n){if(r){this.setParams(r),this._error(t,n),this.setParams({});return}this._error(t,n)}_error(t,r){(t?jc.reportExtraError:jc.reportError)(this,this.def.error,r)}$dataError(){(0,jc.reportError)(this,this.def.$dataError||jc.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,jc.resetErrorsCount)(this.gen,this.errsCount)}ok(t){this.allErrors||this.gen.if(t)}setParams(t,r){r?Object.assign(this.params,t):this.params=t}block$data(t,r,n=W.nil){this.gen.block(()=>{this.check$data(t,n),r()})}check$data(t=W.nil,r=W.nil){if(!this.$data)return;let{gen:n,schemaCode:i,schemaType:s,def:o}=this;n.if((0,W.or)((0,W._)`${i} === undefined`,r)),t!==W.nil&&n.assign(t,!0),(s.length||o.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),t!==W.nil&&n.assign(t,!1)),n.else()}invalid$data(){let{gen:t,schemaCode:r,schemaType:n,def:i,it:s}=this;return(0,W.or)(o(),a());function o(){if(n.length){if(!(r instanceof W.Name))throw new Error("ajv implementation error");let c=Array.isArray(n)?n:[n];return(0,W._)`${(0,Yp.checkDataTypes)(c,r,s.opts.strictNumbers,Yp.DataType.Wrong)}`}return W.nil}function a(){if(i.validateSchema){let c=t.scopeValue("validate$data",{ref:i.validateSchema});return(0,W._)`!${c}(${r})`}return W.nil}}subschema(t,r){let n=(0,ob.getSubschema)(this.it,t);(0,ob.extendSubschemaData)(n,this.it,t),(0,ob.extendSubschemaMode)(n,t);let i={...this.it,...n,items:void 0,props:void 0};return OX(i,r),i}mergeEvaluated(t,r){let{it:n,gen:i}=this;n.opts.unevaluated&&(n.props!==!0&&t.props!==void 0&&(n.props=En.mergeEvaluated.props(i,t.props,n.props,r)),n.items!==!0&&t.items!==void 0&&(n.items=En.mergeEvaluated.items(i,t.items,n.items,r)))}mergeValidEvaluated(t,r){let{it:n,gen:i}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return i.if(r,()=>this.mergeEvaluated(t,W.Name)),!0}};yi.KeywordCxt=Gp;function h2(e,t,r,n){let i=new Gp(e,r,t);"code"in r?r.code(i,n):i.$data&&r.validate?(0,Mc.funcKeywordCode)(i,r):"macro"in r?(0,Mc.macroKeywordCode)(i,r):(r.compile||r.validate)&&(0,Mc.funcKeywordCode)(i,r)}var LX=/^\/(?:[^~]|~0|~1)*$/,DX=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function y2(e,{dataLevel:t,dataNames:r,dataPathArr:n}){let i,s;if(e==="")return ee.default.rootData;if(e[0]==="/"){if(!LX.test(e))throw new Error(`Invalid JSON-pointer: ${e}`);i=e,s=ee.default.rootData}else{let l=DX.exec(e);if(!l)throw new Error(`Invalid JSON-pointer: ${e}`);let u=+l[1];if(i=l[2],i==="#"){if(u>=t)throw new Error(c("property/index",u));return n[t-u]}if(u>t)throw new Error(c("data",u));if(s=r[t-u],!i)return s}let o=s,a=i.split("/");for(let l of a)l&&(s=(0,W._)`${s}${(0,W.getProperty)((0,En.unescapeJsonPointer)(l))}`,o=(0,W._)`${o} && ${s}`);return o;function c(l,u){return`Cannot access ${l} ${u} levels up, current level is ${t}`}}yi.getData=y2});var Jp=v(ub=>{"use strict";Object.defineProperty(ub,"__esModule",{value:!0});var lb=class extends Error{constructor(t){super("validation failed"),this.errors=t,this.ajv=this.validation=!0}};ub.default=lb});var Dc=v(db=>{"use strict";Object.defineProperty(db,"__esModule",{value:!0});var pb=qc(),fb=class extends Error{constructor(t,r,n,i){super(i||`can't resolve reference ${n} from id ${r}`),this.missingRef=(0,pb.resolveUrl)(t,r,n),this.missingSchema=(0,pb.normalizeId)((0,pb.getFullPath)(t,this.missingRef))}};db.default=fb});var Qp=v(Sr=>{"use strict";Object.defineProperty(Sr,"__esModule",{value:!0});Sr.resolveSchema=Sr.getCompilingSchema=Sr.resolveRef=Sr.compileSchema=Sr.SchemaEnv=void 0;var Nr=ae(),FX=Jp(),bs=$n(),Ir=qc(),g2=Se(),BX=Lc(),Mo=class{constructor(t){var r;this.refs={},this.dynamicAnchors={};let n;typeof t.schema=="object"&&(n=t.schema),this.schema=t.schema,this.schemaId=t.schemaId,this.root=t.root||this,this.baseId=(r=t.baseId)!==null&&r!==void 0?r:(0,Ir.normalizeId)(n==null?void 0:n[t.schemaId||"$id"]),this.schemaPath=t.schemaPath,this.localRefs=t.localRefs,this.meta=t.meta,this.$async=n==null?void 0:n.$async,this.refs={}}};Sr.SchemaEnv=Mo;function hb(e){let t=b2.call(this,e);if(t)return t;let r=(0,Ir.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:n,lines:i}=this.opts.code,{ownProperties:s}=this.opts,o=new Nr.CodeGen(this.scope,{es5:n,lines:i,ownProperties:s}),a;e.$async&&(a=o.scopeValue("Error",{ref:FX.default,code:(0,Nr._)`require("ajv/dist/runtime/validation_error").default`}));let c=o.scopeName("validate");e.validateName=c;let l={gen:o,allErrors:this.opts.allErrors,data:bs.default.data,parentData:bs.default.parentData,parentDataProperty:bs.default.parentDataProperty,dataNames:[bs.default.data],dataPathArr:[Nr.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:o.scopeValue("schema",this.opts.code.source===!0?{ref:e.schema,code:(0,Nr.stringify)(e.schema)}:{ref:e.schema}),validateName:c,ValidationError:a,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:Nr.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,Nr._)`""`,opts:this.opts,self:this},u;try{this._compilations.add(e),(0,BX.validateFunctionCode)(l),o.optimize(this.opts.code.optimize);let p=o.toString();u=`${o.scopeRefs(bs.default.scope)}return ${p}`,this.opts.code.process&&(u=this.opts.code.process(u,e));let m=new Function(`${bs.default.self}`,`${bs.default.scope}`,u)(this,this.scope.get());if(this.scope.value(c,{ref:m}),m.errors=null,m.schema=e.schema,m.schemaEnv=e,e.$async&&(m.$async=!0),this.opts.code.source===!0&&(m.source={validateName:c,validateCode:p,scopeValues:o._values}),this.opts.unevaluated){let{props:f,items:h}=l;m.evaluated={props:f instanceof Nr.Name?void 0:f,items:h instanceof Nr.Name?void 0:h,dynamicProps:f instanceof Nr.Name,dynamicItems:h instanceof Nr.Name},m.source&&(m.source.evaluated=(0,Nr.stringify)(m.evaluated))}return e.validate=m,e}catch(p){throw delete e.validate,delete e.validateName,u&&this.logger.error("Error compiling schema, function code:",u),p}finally{this._compilations.delete(e)}}Sr.compileSchema=hb;function VX(e,t,r){var n;r=(0,Ir.resolveUrl)(this.opts.uriResolver,t,r);let i=e.refs[r];if(i)return i;let s=HX.call(this,e,r);if(s===void 0){let o=(n=e.localRefs)===null||n===void 0?void 0:n[r],{schemaId:a}=this.opts;o&&(s=new Mo({schema:o,schemaId:a,root:e,baseId:t}))}if(s!==void 0)return e.refs[r]=UX.call(this,s)}Sr.resolveRef=VX;function UX(e){return(0,Ir.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:hb.call(this,e)}function b2(e){for(let t of this._compilations)if(zX(t,e))return t}Sr.getCompilingSchema=b2;function zX(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function HX(e,t){let r;for(;typeof(r=this.refs[t])=="string";)t=r;return r||this.schemas[t]||Xp.call(this,e,t)}function Xp(e,t){let r=this.opts.uriResolver.parse(t),n=(0,Ir._getFullPath)(this.opts.uriResolver,r),i=(0,Ir.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&n===i)return mb.call(this,r,e);let s=(0,Ir.normalizeId)(n),o=this.refs[s]||this.schemas[s];if(typeof o=="string"){let a=Xp.call(this,e,o);return typeof(a==null?void 0:a.schema)!="object"?void 0:mb.call(this,r,a)}if(typeof(o==null?void 0:o.schema)=="object"){if(o.validate||hb.call(this,o),s===(0,Ir.normalizeId)(t)){let{schema:a}=o,{schemaId:c}=this.opts,l=a[c];return l&&(i=(0,Ir.resolveUrl)(this.opts.uriResolver,i,l)),new Mo({schema:a,schemaId:c,root:e,baseId:i})}return mb.call(this,r,o)}}Sr.resolveSchema=Xp;var KX=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function mb(e,{baseId:t,schema:r,root:n}){var i;if(((i=e.fragment)===null||i===void 0?void 0:i[0])!=="/")return;for(let a of e.fragment.slice(1).split("/")){if(typeof r=="boolean")return;let c=r[(0,g2.unescapeFragment)(a)];if(c===void 0)return;r=c;let l=typeof r=="object"&&r[this.opts.schemaId];!KX.has(a)&&l&&(t=(0,Ir.resolveUrl)(this.opts.uriResolver,t,l))}let s;if(typeof r!="boolean"&&r.$ref&&!(0,g2.schemaHasRulesButRef)(r,this.RULES)){let a=(0,Ir.resolveUrl)(this.opts.uriResolver,t,r.$ref);s=Xp.call(this,n,a)}let{schemaId:o}=this.opts;if(s=s||new Mo({schema:r,schemaId:o,root:n,baseId:t}),s.schema!==s.root.schema)return s}});var v2=v((n1e,WX)=>{WX.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var x2=v((i1e,w2)=>{"use strict";var YX={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};w2.exports={HEX:YX}});var T2=v((s1e,A2)=>{"use strict";var{HEX:GX}=x2();function P2(e){if(E2(e,".")<3)return{host:e,isIPV4:!1};let t=e.match(/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/u)||[],[r]=t;return r?{host:XX(r,"."),isIPV4:!0}:{host:e,isIPV4:!1}}function yb(e,t=!1){let r="",n=!0;for(let i of e){if(GX[i]===void 0)return;i!=="0"&&n===!0&&(n=!1),n||(r+=i)}return t&&r.length===0&&(r="0"),r}function JX(e){let t=0,r={error:!1,address:"",zone:""},n=[],i=[],s=!1,o=!1,a=!1;function c(){if(i.length){if(s===!1){let l=yb(i);if(l!==void 0)n.push(l);else return r.error=!0,!1}i.length=0}return!0}for(let l=0;l<e.length;l++){let u=e[l];if(!(u==="["||u==="]"))if(u===":"){if(o===!0&&(a=!0),!c())break;if(t++,n.push(":"),t>7){r.error=!0;break}l-1>=0&&e[l-1]===":"&&(o=!0);continue}else if(u==="%"){if(!c())break;s=!0}else{i.push(u);continue}}return i.length&&(s?r.zone=i.join(""):a?n.push(i.join("")):n.push(yb(i))),r.address=n.join(""),r}function $2(e,t={}){if(E2(e,":")<2)return{host:e,isIPV6:!1};let r=JX(e);if(r.error)return{host:e,isIPV6:!1};{let n=r.address,i=r.address;return r.zone&&(n+="%"+r.zone,i+="%25"+r.zone),{host:n,escapedHost:i,isIPV6:!0}}}function XX(e,t){let r="",n=!0,i=e.length;for(let s=0;s<i;s++){let o=e[s];o==="0"&&n?(s+1<=i&&e[s+1]===t||s+1===i)&&(r+=o,n=!1):(o===t?n=!0:n=!1,r+=o)}return r}function E2(e,t){let r=0;for(let n=0;n<e.length;n++)e[n]===t&&r++;return r}var S2=/^\.\.?\//u,_2=/^\/\.(?:\/|$)/u,O2=/^\/\.\.(?:\/|$)/u,QX=/^\/?(?:.|\n)*?(?=\/|$)/u;function ZX(e){let t=[];for(;e.length;)if(e.match(S2))e=e.replace(S2,"");else if(e.match(_2))e=e.replace(_2,"/");else if(e.match(O2))e=e.replace(O2,"/"),t.pop();else if(e==="."||e==="..")e="";else{let r=e.match(QX);if(r){let n=r[0];e=e.slice(n.length),t.push(n)}else throw new Error("Unexpected dot segment condition")}return t.join("")}function eQ(e,t){let r=t!==!0?escape:unescape;return e.scheme!==void 0&&(e.scheme=r(e.scheme)),e.userinfo!==void 0&&(e.userinfo=r(e.userinfo)),e.host!==void 0&&(e.host=r(e.host)),e.path!==void 0&&(e.path=r(e.path)),e.query!==void 0&&(e.query=r(e.query)),e.fragment!==void 0&&(e.fragment=r(e.fragment)),e}function tQ(e,t){let r=[];if(e.userinfo!==void 0&&(r.push(e.userinfo),r.push("@")),e.host!==void 0){let n=unescape(e.host),i=P2(n);if(i.isIPV4)n=i.host;else{let s=$2(i.host,{isIPV4:!1});s.isIPV6===!0?n=`[${s.escapedHost}]`:n=e.host}r.push(n)}return(typeof e.port=="number"||typeof e.port=="string")&&(r.push(":"),r.push(String(e.port))),r.length?r.join(""):void 0}A2.exports={recomposeAuthority:tQ,normalizeComponentEncoding:eQ,removeDotSegments:ZX,normalizeIPv4:P2,normalizeIPv6:$2,stringArrayToHexStripped:yb}});var q2=v((o1e,I2)=>{"use strict";var rQ=/^[\da-f]{8}\b-[\da-f]{4}\b-[\da-f]{4}\b-[\da-f]{4}\b-[\da-f]{12}$/iu,nQ=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu;function R2(e){return typeof e.secure=="boolean"?e.secure:String(e.scheme).toLowerCase()==="wss"}function C2(e){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e}function k2(e){let t=String(e.scheme).toLowerCase()==="https";return(e.port===(t?443:80)||e.port==="")&&(e.port=void 0),e.path||(e.path="/"),e}function iQ(e){return e.secure=R2(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e}function sQ(e){if((e.port===(R2(e)?443:80)||e.port==="")&&(e.port=void 0),typeof e.secure=="boolean"&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){let[t,r]=e.resourceName.split("?");e.path=t&&t!=="/"?t:void 0,e.query=r,e.resourceName=void 0}return e.fragment=void 0,e}function oQ(e,t){if(!e.path)return e.error="URN can not be parsed",e;let r=e.path.match(nQ);if(r){let n=t.scheme||e.scheme||"urn";e.nid=r[1].toLowerCase(),e.nss=r[2];let i=`${n}:${t.nid||e.nid}`,s=gb[i];e.path=void 0,s&&(e=s.parse(e,t))}else e.error=e.error||"URN can not be parsed.";return e}function aQ(e,t){let r=t.scheme||e.scheme||"urn",n=e.nid.toLowerCase(),i=`${r}:${t.nid||n}`,s=gb[i];s&&(e=s.serialize(e,t));let o=e,a=e.nss;return o.path=`${n||t.nid}:${a}`,t.skipEscape=!0,o}function cQ(e,t){let r=e;return r.uuid=r.nss,r.nss=void 0,!t.tolerant&&(!r.uuid||!rQ.test(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}function lQ(e){let t=e;return t.nss=(e.uuid||"").toLowerCase(),t}var N2={scheme:"http",domainHost:!0,parse:C2,serialize:k2},uQ={scheme:"https",domainHost:N2.domainHost,parse:C2,serialize:k2},Zp={scheme:"ws",domainHost:!0,parse:iQ,serialize:sQ},pQ={scheme:"wss",domainHost:Zp.domainHost,parse:Zp.parse,serialize:Zp.serialize},fQ={scheme:"urn",parse:oQ,serialize:aQ,skipNormalize:!0},dQ={scheme:"urn:uuid",parse:cQ,serialize:lQ,skipNormalize:!0},gb={http:N2,https:uQ,ws:Zp,wss:pQ,urn:fQ,"urn:uuid":dQ};I2.exports=gb});var M2=v((a1e,tf)=>{"use strict";var{normalizeIPv6:mQ,normalizeIPv4:hQ,removeDotSegments:Fc,recomposeAuthority:yQ,normalizeComponentEncoding:ef}=T2(),bb=q2();function gQ(e,t){return typeof e=="string"?e=en(An(e,t),t):typeof e=="object"&&(e=An(en(e,t),t)),e}function bQ(e,t,r){let n=Object.assign({scheme:"null"},r),i=j2(An(e,n),An(t,n),n,!0);return en(i,{...n,skipEscape:!0})}function j2(e,t,r,n){let i={};return n||(e=An(en(e,r),r),t=An(en(t,r),r)),r=r||{},!r.tolerant&&t.scheme?(i.scheme=t.scheme,i.userinfo=t.userinfo,i.host=t.host,i.port=t.port,i.path=Fc(t.path||""),i.query=t.query):(t.userinfo!==void 0||t.host!==void 0||t.port!==void 0?(i.userinfo=t.userinfo,i.host=t.host,i.port=t.port,i.path=Fc(t.path||""),i.query=t.query):(t.path?(t.path.charAt(0)==="/"?i.path=Fc(t.path):((e.userinfo!==void 0||e.host!==void 0||e.port!==void 0)&&!e.path?i.path="/"+t.path:e.path?i.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:i.path=t.path,i.path=Fc(i.path)),i.query=t.query):(i.path=e.path,t.query!==void 0?i.query=t.query:i.query=e.query),i.userinfo=e.userinfo,i.host=e.host,i.port=e.port),i.scheme=e.scheme),i.fragment=t.fragment,i}function vQ(e,t,r){return typeof e=="string"?(e=unescape(e),e=en(ef(An(e,r),!0),{...r,skipEscape:!0})):typeof e=="object"&&(e=en(ef(e,!0),{...r,skipEscape:!0})),typeof t=="string"?(t=unescape(t),t=en(ef(An(t,r),!0),{...r,skipEscape:!0})):typeof t=="object"&&(t=en(ef(t,!0),{...r,skipEscape:!0})),e.toLowerCase()===t.toLowerCase()}function en(e,t){let r={host:e.host,scheme:e.scheme,userinfo:e.userinfo,port:e.port,path:e.path,query:e.query,nid:e.nid,nss:e.nss,uuid:e.uuid,fragment:e.fragment,reference:e.reference,resourceName:e.resourceName,secure:e.secure,error:""},n=Object.assign({},t),i=[],s=bb[(n.scheme||r.scheme||"").toLowerCase()];s&&s.serialize&&s.serialize(r,n),r.path!==void 0&&(n.skipEscape?r.path=unescape(r.path):(r.path=escape(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),n.reference!=="suffix"&&r.scheme&&i.push(r.scheme,":");let o=yQ(r,n);if(o!==void 0&&(n.reference!=="suffix"&&i.push("//"),i.push(o),r.path&&r.path.charAt(0)!=="/"&&i.push("/")),r.path!==void 0){let a=r.path;!n.absolutePath&&(!s||!s.absolutePath)&&(a=Fc(a)),o===void 0&&(a=a.replace(/^\/\//u,"/%2F")),i.push(a)}return r.query!==void 0&&i.push("?",r.query),r.fragment!==void 0&&i.push("#",r.fragment),i.join("")}var wQ=Array.from({length:127},(e,t)=>/[^!"$&'()*+,\-.;=_`a-z{}~]/u.test(String.fromCharCode(t)));function xQ(e){let t=0;for(let r=0,n=e.length;r<n;++r)if(t=e.charCodeAt(r),t>126||wQ[t])return!0;return!1}var SQ=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function An(e,t){let r=Object.assign({},t),n={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},i=e.indexOf("%")!==-1,s=!1;r.reference==="suffix"&&(e=(r.scheme?r.scheme+":":"")+"//"+e);let o=e.match(SQ);if(o){if(n.scheme=o[1],n.userinfo=o[3],n.host=o[4],n.port=parseInt(o[5],10),n.path=o[6]||"",n.query=o[7],n.fragment=o[8],isNaN(n.port)&&(n.port=o[5]),n.host){let c=hQ(n.host);if(c.isIPV4===!1){let l=mQ(c.host,{isIPV4:!1});n.host=l.host.toLowerCase(),s=l.isIPV6}else n.host=c.host,s=!0}n.scheme===void 0&&n.userinfo===void 0&&n.host===void 0&&n.port===void 0&&!n.path&&n.query===void 0?n.reference="same-document":n.scheme===void 0?n.reference="relative":n.fragment===void 0?n.reference="absolute":n.reference="uri",r.reference&&r.reference!=="suffix"&&r.reference!==n.reference&&(n.error=n.error||"URI is not a "+r.reference+" reference.");let a=bb[(r.scheme||n.scheme||"").toLowerCase()];if(!r.unicodeSupport&&(!a||!a.unicodeSupport)&&n.host&&(r.domainHost||a&&a.domainHost)&&s===!1&&xQ(n.host))try{n.host=URL.domainToASCII(n.host.toLowerCase())}catch(c){n.error=n.error||"Host's domain name can not be converted to ASCII: "+c}(!a||a&&!a.skipNormalize)&&(i&&n.scheme!==void 0&&(n.scheme=unescape(n.scheme)),i&&n.host!==void 0&&(n.host=unescape(n.host)),n.path!==void 0&&n.path.length&&(n.path=escape(unescape(n.path))),n.fragment!==void 0&&n.fragment.length&&(n.fragment=encodeURI(decodeURIComponent(n.fragment)))),a&&a.parse&&a.parse(n,r)}else n.error=n.error||"URI can not be parsed.";return n}var vb={SCHEMES:bb,normalize:gQ,resolve:bQ,resolveComponents:j2,equal:vQ,serialize:en,parse:An};tf.exports=vb;tf.exports.default=vb;tf.exports.fastUri=vb});var D2=v(wb=>{"use strict";Object.defineProperty(wb,"__esModule",{value:!0});var L2=M2();L2.code='require("ajv/dist/runtime/uri").default';wb.default=L2});var W2=v(yt=>{"use strict";Object.defineProperty(yt,"__esModule",{value:!0});yt.CodeGen=yt.Name=yt.nil=yt.stringify=yt.str=yt._=yt.KeywordCxt=void 0;var _Q=Lc();Object.defineProperty(yt,"KeywordCxt",{enumerable:!0,get:function(){return _Q.KeywordCxt}});var Lo=ae();Object.defineProperty(yt,"_",{enumerable:!0,get:function(){return Lo._}});Object.defineProperty(yt,"str",{enumerable:!0,get:function(){return Lo.str}});Object.defineProperty(yt,"stringify",{enumerable:!0,get:function(){return Lo.stringify}});Object.defineProperty(yt,"nil",{enumerable:!0,get:function(){return Lo.nil}});Object.defineProperty(yt,"Name",{enumerable:!0,get:function(){return Lo.Name}});Object.defineProperty(yt,"CodeGen",{enumerable:!0,get:function(){return Lo.CodeGen}});var OQ=Jp(),z2=Dc(),PQ=X0(),Bc=Qp(),$Q=ae(),Vc=qc(),rf=Ic(),Sb=Se(),F2=v2(),EQ=D2(),H2=(e,t)=>new RegExp(e,t);H2.code="new RegExp";var AQ=["removeAdditional","useDefaults","coerceTypes"],TQ=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),RQ={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."},CQ={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},B2=200;function kQ(e){var t,r,n,i,s,o,a,c,l,u,p,d,m,f,h,y,g,b,w,x,S,T,_,P,E;let F=e.strict,$=(t=e.code)===null||t===void 0?void 0:t.optimize,O=$===!0||$===void 0?1:$||0,k=(n=(r=e.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:H2,L=(i=e.uriResolver)!==null&&i!==void 0?i:EQ.default;return{strictSchema:(o=(s=e.strictSchema)!==null&&s!==void 0?s:F)!==null&&o!==void 0?o:!0,strictNumbers:(c=(a=e.strictNumbers)!==null&&a!==void 0?a:F)!==null&&c!==void 0?c:!0,strictTypes:(u=(l=e.strictTypes)!==null&&l!==void 0?l:F)!==null&&u!==void 0?u:"log",strictTuples:(d=(p=e.strictTuples)!==null&&p!==void 0?p:F)!==null&&d!==void 0?d:"log",strictRequired:(f=(m=e.strictRequired)!==null&&m!==void 0?m:F)!==null&&f!==void 0?f:!1,code:e.code?{...e.code,optimize:O,regExp:k}:{optimize:O,regExp:k},loopRequired:(h=e.loopRequired)!==null&&h!==void 0?h:B2,loopEnum:(y=e.loopEnum)!==null&&y!==void 0?y:B2,meta:(g=e.meta)!==null&&g!==void 0?g:!0,messages:(b=e.messages)!==null&&b!==void 0?b:!0,inlineRefs:(w=e.inlineRefs)!==null&&w!==void 0?w:!0,schemaId:(x=e.schemaId)!==null&&x!==void 0?x:"$id",addUsedSchema:(S=e.addUsedSchema)!==null&&S!==void 0?S:!0,validateSchema:(T=e.validateSchema)!==null&&T!==void 0?T:!0,validateFormats:(_=e.validateFormats)!==null&&_!==void 0?_:!0,unicodeRegExp:(P=e.unicodeRegExp)!==null&&P!==void 0?P:!0,int32range:(E=e.int32range)!==null&&E!==void 0?E:!0,uriResolver:L}}var Uc=class{constructor(t={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,t=this.opts={...t,...kQ(t)};let{es5:r,lines:n}=this.opts.code;this.scope=new $Q.ValueScope({scope:{},prefixes:TQ,es5:r,lines:n}),this.logger=LQ(t.logger);let i=t.validateFormats;t.validateFormats=!1,this.RULES=(0,PQ.getRules)(),V2.call(this,RQ,t,"NOT SUPPORTED"),V2.call(this,CQ,t,"DEPRECATED","warn"),this._metaOpts=jQ.call(this),t.formats&&IQ.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),t.keywords&&qQ.call(this,t.keywords),typeof t.meta=="object"&&this.addMetaSchema(t.meta),NQ.call(this),t.validateFormats=i}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:t,meta:r,schemaId:n}=this.opts,i=F2;n==="id"&&(i={...F2},i.id=i.$id,delete i.$id),r&&t&&this.addMetaSchema(i,i[n],!1)}defaultMeta(){let{meta:t,schemaId:r}=this.opts;return this.opts.defaultMeta=typeof t=="object"?t[r]||t:void 0}validate(t,r){let n;if(typeof t=="string"){if(n=this.getSchema(t),!n)throw new Error(`no schema with key or ref "${t}"`)}else n=this.compile(t);let i=n(r);return"$async"in n||(this.errors=n.errors),i}compile(t,r){let n=this._addSchema(t,r);return n.validate||this._compileSchemaEnv(n)}compileAsync(t,r){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:n}=this.opts;return i.call(this,t,r);async function i(u,p){await s.call(this,u.$schema);let d=this._addSchema(u,p);return d.validate||o.call(this,d)}async function s(u){u&&!this.getSchema(u)&&await i.call(this,{$ref:u},!0)}async function o(u){try{return this._compileSchemaEnv(u)}catch(p){if(!(p instanceof z2.default))throw p;return a.call(this,p),await c.call(this,p.missingSchema),o.call(this,u)}}function a({missingSchema:u,missingRef:p}){if(this.refs[u])throw new Error(`AnySchema ${u} is loaded but ${p} cannot be resolved`)}async function c(u){let p=await l.call(this,u);this.refs[u]||await s.call(this,p.$schema),this.refs[u]||this.addSchema(p,u,r)}async function l(u){let p=this._loading[u];if(p)return p;try{return await(this._loading[u]=n(u))}finally{delete this._loading[u]}}}addSchema(t,r,n,i=this.opts.validateSchema){if(Array.isArray(t)){for(let o of t)this.addSchema(o,void 0,n,i);return this}let s;if(typeof t=="object"){let{schemaId:o}=this.opts;if(s=t[o],s!==void 0&&typeof s!="string")throw new Error(`schema ${o} must be string`)}return r=(0,Vc.normalizeId)(r||s),this._checkUnique(r),this.schemas[r]=this._addSchema(t,n,r,i,!0),this}addMetaSchema(t,r,n=this.opts.validateSchema){return this.addSchema(t,r,!0,n),this}validateSchema(t,r){if(typeof t=="boolean")return!0;let n;if(n=t.$schema,n!==void 0&&typeof n!="string")throw new Error("$schema must be a string");if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let i=this.validate(n,t);if(!i&&r){let s="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(s);else throw new Error(s)}return i}getSchema(t){let r;for(;typeof(r=U2.call(this,t))=="string";)t=r;if(r===void 0){let{schemaId:n}=this.opts,i=new Bc.SchemaEnv({schema:{},schemaId:n});if(r=Bc.resolveSchema.call(this,i,t),!r)return;this.refs[t]=r}return r.validate||this._compileSchemaEnv(r)}removeSchema(t){if(t instanceof RegExp)return this._removeAllSchemas(this.schemas,t),this._removeAllSchemas(this.refs,t),this;switch(typeof t){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let r=U2.call(this,t);return typeof r=="object"&&this._cache.delete(r.schema),delete this.schemas[t],delete this.refs[t],this}case"object":{let r=t;this._cache.delete(r);let n=t[this.opts.schemaId];return n&&(n=(0,Vc.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(t){for(let r of t)this.addKeyword(r);return this}addKeyword(t,r){let n;if(typeof t=="string")n=t,typeof r=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),r.keyword=n);else if(typeof t=="object"&&r===void 0){if(r=t,n=r.keyword,Array.isArray(n)&&!n.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(FQ.call(this,n,r),!r)return(0,Sb.eachItem)(n,s=>xb.call(this,s)),this;VQ.call(this,r);let i={...r,type:(0,rf.getJSONTypes)(r.type),schemaType:(0,rf.getJSONTypes)(r.schemaType)};return(0,Sb.eachItem)(n,i.type.length===0?s=>xb.call(this,s,i):s=>i.type.forEach(o=>xb.call(this,s,i,o))),this}getKeyword(t){let r=this.RULES.all[t];return typeof r=="object"?r.definition:!!r}removeKeyword(t){let{RULES:r}=this;delete r.keywords[t],delete r.all[t];for(let n of r.rules){let i=n.rules.findIndex(s=>s.keyword===t);i>=0&&n.rules.splice(i,1)}return this}addFormat(t,r){return typeof r=="string"&&(r=new RegExp(r)),this.formats[t]=r,this}errorsText(t=this.errors,{separator:r=", ",dataVar:n="data"}={}){return!t||t.length===0?"No errors":t.map(i=>`${n}${i.instancePath} ${i.message}`).reduce((i,s)=>i+r+s)}$dataMetaSchema(t,r){let n=this.RULES.all;t=JSON.parse(JSON.stringify(t));for(let i of r){let s=i.split("/").slice(1),o=t;for(let a of s)o=o[a];for(let a in n){let c=n[a];if(typeof c!="object")continue;let{$data:l}=c.definition,u=o[a];l&&u&&(o[a]=K2(u))}}return t}_removeAllSchemas(t,r){for(let n in t){let i=t[n];(!r||r.test(n))&&(typeof i=="string"?delete t[n]:i&&!i.meta&&(this._cache.delete(i.schema),delete t[n]))}}_addSchema(t,r,n,i=this.opts.validateSchema,s=this.opts.addUsedSchema){let o,{schemaId:a}=this.opts;if(typeof t=="object")o=t[a];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof t!="boolean")throw new Error("schema must be object or boolean")}let c=this._cache.get(t);if(c!==void 0)return c;n=(0,Vc.normalizeId)(o||n);let l=Vc.getSchemaRefs.call(this,t,n);return c=new Bc.SchemaEnv({schema:t,schemaId:a,meta:r,baseId:n,localRefs:l}),this._cache.set(c.schema,c),s&&!n.startsWith("#")&&(n&&this._checkUnique(n),this.refs[n]=c),i&&this.validateSchema(t,!0),c}_checkUnique(t){if(this.schemas[t]||this.refs[t])throw new Error(`schema with key or id "${t}" already exists`)}_compileSchemaEnv(t){if(t.meta?this._compileMetaSchema(t):Bc.compileSchema.call(this,t),!t.validate)throw new Error("ajv implementation error");return t.validate}_compileMetaSchema(t){let r=this.opts;this.opts=this._metaOpts;try{Bc.compileSchema.call(this,t)}finally{this.opts=r}}};Uc.ValidationError=OQ.default;Uc.MissingRefError=z2.default;yt.default=Uc;function V2(e,t,r,n="error"){for(let i in e){let s=i;s in t&&this.logger[n](`${r}: option ${i}. ${e[s]}`)}}function U2(e){return e=(0,Vc.normalizeId)(e),this.schemas[e]||this.refs[e]}function NQ(){let e=this.opts.schemas;if(e)if(Array.isArray(e))this.addSchema(e);else for(let t in e)this.addSchema(e[t],t)}function IQ(){for(let e in this.opts.formats){let t=this.opts.formats[e];t&&this.addFormat(e,t)}}function qQ(e){if(Array.isArray(e)){this.addVocabulary(e);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let t in e){let r=e[t];r.keyword||(r.keyword=t),this.addKeyword(r)}}function jQ(){let e={...this.opts};for(let t of AQ)delete e[t];return e}var MQ={log(){},warn(){},error(){}};function LQ(e){if(e===!1)return MQ;if(e===void 0)return console;if(e.log&&e.warn&&e.error)return e;throw new Error("logger must implement log, warn and error methods")}var DQ=/^[a-z_$][a-z0-9_$:-]*$/i;function FQ(e,t){let{RULES:r}=this;if((0,Sb.eachItem)(e,n=>{if(r.keywords[n])throw new Error(`Keyword ${n} is already defined`);if(!DQ.test(n))throw new Error(`Keyword ${n} has invalid name`)}),!!t&&t.$data&&!("code"in t||"validate"in t))throw new Error('$data keyword must have "code" or "validate" function')}function xb(e,t,r){var n;let i=t==null?void 0:t.post;if(r&&i)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:s}=this,o=i?s.post:s.rules.find(({type:c})=>c===r);if(o||(o={type:r,rules:[]},s.rules.push(o)),s.keywords[e]=!0,!t)return;let a={keyword:e,definition:{...t,type:(0,rf.getJSONTypes)(t.type),schemaType:(0,rf.getJSONTypes)(t.schemaType)}};t.before?BQ.call(this,o,a,t.before):o.rules.push(a),s.all[e]=a,(n=t.implements)===null||n===void 0||n.forEach(c=>this.addKeyword(c))}function BQ(e,t,r){let n=e.rules.findIndex(i=>i.keyword===r);n>=0?e.rules.splice(n,0,t):(e.rules.push(t),this.logger.warn(`rule ${r} is not defined`))}function VQ(e){let{metaSchema:t}=e;t!==void 0&&(e.$data&&this.opts.$data&&(t=K2(t)),e.validateSchema=this.compile(t,!0))}var UQ={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function K2(e){return{anyOf:[e,UQ]}}});var Y2=v(_b=>{"use strict";Object.defineProperty(_b,"__esModule",{value:!0});var zQ={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};_b.default=zQ});var Q2=v(vs=>{"use strict";Object.defineProperty(vs,"__esModule",{value:!0});vs.callRef=vs.getValidate=void 0;var HQ=Dc(),G2=xr(),er=ae(),Do=$n(),J2=Qp(),nf=Se(),KQ={keyword:"$ref",schemaType:"string",code(e){let{gen:t,schema:r,it:n}=e,{baseId:i,schemaEnv:s,validateName:o,opts:a,self:c}=n,{root:l}=s;if((r==="#"||r==="#/")&&i===l.baseId)return p();let u=J2.resolveRef.call(c,l,i,r);if(u===void 0)throw new HQ.default(n.opts.uriResolver,i,r);if(u instanceof J2.SchemaEnv)return d(u);return m(u);function p(){if(s===l)return sf(e,o,s,s.$async);let f=t.scopeValue("root",{ref:l});return sf(e,(0,er._)`${f}.validate`,l,l.$async)}function d(f){let h=X2(e,f);sf(e,h,f,f.$async)}function m(f){let h=t.scopeValue("schema",a.code.source===!0?{ref:f,code:(0,er.stringify)(f)}:{ref:f}),y=t.name("valid"),g=e.subschema({schema:f,dataTypes:[],schemaPath:er.nil,topSchemaRef:h,errSchemaPath:r},y);e.mergeEvaluated(g),e.ok(y)}}};function X2(e,t){let{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):(0,er._)`${r.scopeValue("wrapper",{ref:t})}.validate`}vs.getValidate=X2;function sf(e,t,r,n){let{gen:i,it:s}=e,{allErrors:o,schemaEnv:a,opts:c}=s,l=c.passContext?Do.default.this:er.nil;n?u():p();function u(){if(!a.$async)throw new Error("async schema referenced by sync schema");let f=i.let("valid");i.try(()=>{i.code((0,er._)`await ${(0,G2.callValidateCode)(e,t,l)}`),m(t),o||i.assign(f,!0)},h=>{i.if((0,er._)`!(${h} instanceof ${s.ValidationError})`,()=>i.throw(h)),d(h),o||i.assign(f,!1)}),e.ok(f)}function p(){e.result((0,G2.callValidateCode)(e,t,l),()=>m(t),()=>d(t))}function d(f){let h=(0,er._)`${f}.errors`;i.assign(Do.default.vErrors,(0,er._)`${Do.default.vErrors} === null ? ${h} : ${Do.default.vErrors}.concat(${h})`),i.assign(Do.default.errors,(0,er._)`${Do.default.vErrors}.length`)}function m(f){var h;if(!s.opts.unevaluated)return;let y=(h=r==null?void 0:r.validate)===null||h===void 0?void 0:h.evaluated;if(s.props!==!0)if(y&&!y.dynamicProps)y.props!==void 0&&(s.props=nf.mergeEvaluated.props(i,y.props,s.props));else{let g=i.var("props",(0,er._)`${f}.evaluated.props`);s.props=nf.mergeEvaluated.props(i,g,s.props,er.Name)}if(s.items!==!0)if(y&&!y.dynamicItems)y.items!==void 0&&(s.items=nf.mergeEvaluated.items(i,y.items,s.items));else{let g=i.var("items",(0,er._)`${f}.evaluated.items`);s.items=nf.mergeEvaluated.items(i,g,s.items,er.Name)}}}vs.callRef=sf;vs.default=KQ});var Z2=v(Ob=>{"use strict";Object.defineProperty(Ob,"__esModule",{value:!0});var WQ=Y2(),YQ=Q2(),GQ=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",WQ.default,YQ.default];Ob.default=GQ});var eC=v(Pb=>{"use strict";Object.defineProperty(Pb,"__esModule",{value:!0});var of=ae(),gi=of.operators,af={maximum:{okStr:"<=",ok:gi.LTE,fail:gi.GT},minimum:{okStr:">=",ok:gi.GTE,fail:gi.LT},exclusiveMaximum:{okStr:"<",ok:gi.LT,fail:gi.GTE},exclusiveMinimum:{okStr:">",ok:gi.GT,fail:gi.LTE}},JQ={message:({keyword:e,schemaCode:t})=>(0,of.str)`must be ${af[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,of._)`{comparison: ${af[e].okStr}, limit: ${t}}`},XQ={keyword:Object.keys(af),type:"number",schemaType:"number",$data:!0,error:JQ,code(e){let{keyword:t,data:r,schemaCode:n}=e;e.fail$data((0,of._)`${r} ${af[t].fail} ${n} || isNaN(${r})`)}};Pb.default=XQ});var tC=v($b=>{"use strict";Object.defineProperty($b,"__esModule",{value:!0});var zc=ae(),QQ={message:({schemaCode:e})=>(0,zc.str)`must be multiple of ${e}`,params:({schemaCode:e})=>(0,zc._)`{multipleOf: ${e}}`},ZQ={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:QQ,code(e){let{gen:t,data:r,schemaCode:n,it:i}=e,s=i.opts.multipleOfPrecision,o=t.let("res"),a=s?(0,zc._)`Math.abs(Math.round(${o}) - ${o}) > 1e-${s}`:(0,zc._)`${o} !== parseInt(${o})`;e.fail$data((0,zc._)`(${n} === 0 || (${o} = ${r}/${n}, ${a}))`)}};$b.default=ZQ});var nC=v(Eb=>{"use strict";Object.defineProperty(Eb,"__esModule",{value:!0});function rC(e){let t=e.length,r=0,n=0,i;for(;n<t;)r++,i=e.charCodeAt(n++),i>=55296&&i<=56319&&n<t&&(i=e.charCodeAt(n),(i&64512)===56320&&n++);return r}Eb.default=rC;rC.code='require("ajv/dist/runtime/ucs2length").default'});var iC=v(Ab=>{"use strict";Object.defineProperty(Ab,"__esModule",{value:!0});var ws=ae(),eZ=Se(),tZ=nC(),rZ={message({keyword:e,schemaCode:t}){let r=e==="maxLength"?"more":"fewer";return(0,ws.str)`must NOT have ${r} than ${t} characters`},params:({schemaCode:e})=>(0,ws._)`{limit: ${e}}`},nZ={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:rZ,code(e){let{keyword:t,data:r,schemaCode:n,it:i}=e,s=t==="maxLength"?ws.operators.GT:ws.operators.LT,o=i.opts.unicode===!1?(0,ws._)`${r}.length`:(0,ws._)`${(0,eZ.useFunc)(e.gen,tZ.default)}(${r})`;e.fail$data((0,ws._)`${o} ${s} ${n}`)}};Ab.default=nZ});var sC=v(Tb=>{"use strict";Object.defineProperty(Tb,"__esModule",{value:!0});var iZ=xr(),cf=ae(),sZ={message:({schemaCode:e})=>(0,cf.str)`must match pattern "${e}"`,params:({schemaCode:e})=>(0,cf._)`{pattern: ${e}}`},oZ={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:sZ,code(e){let{data:t,$data:r,schema:n,schemaCode:i,it:s}=e,o=s.opts.unicodeRegExp?"u":"",a=r?(0,cf._)`(new RegExp(${i}, ${o}))`:(0,iZ.usePattern)(e,n);e.fail$data((0,cf._)`!${a}.test(${t})`)}};Tb.default=oZ});var oC=v(Rb=>{"use strict";Object.defineProperty(Rb,"__esModule",{value:!0});var Hc=ae(),aZ={message({keyword:e,schemaCode:t}){let r=e==="maxProperties"?"more":"fewer";return(0,Hc.str)`must NOT have ${r} than ${t} properties`},params:({schemaCode:e})=>(0,Hc._)`{limit: ${e}}`},cZ={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:aZ,code(e){let{keyword:t,data:r,schemaCode:n}=e,i=t==="maxProperties"?Hc.operators.GT:Hc.operators.LT;e.fail$data((0,Hc._)`Object.keys(${r}).length ${i} ${n}`)}};Rb.default=cZ});var aC=v(Cb=>{"use strict";Object.defineProperty(Cb,"__esModule",{value:!0});var Kc=xr(),Wc=ae(),lZ=Se(),uZ={message:({params:{missingProperty:e}})=>(0,Wc.str)`must have required property '${e}'`,params:({params:{missingProperty:e}})=>(0,Wc._)`{missingProperty: ${e}}`},pZ={keyword:"required",type:"object",schemaType:"array",$data:!0,error:uZ,code(e){let{gen:t,schema:r,schemaCode:n,data:i,$data:s,it:o}=e,{opts:a}=o;if(!s&&r.length===0)return;let c=r.length>=a.loopRequired;if(o.allErrors?l():u(),a.strictRequired){let m=e.parentSchema.properties,{definedProperties:f}=e.it;for(let h of r)if((m==null?void 0:m[h])===void 0&&!f.has(h)){let y=o.schemaEnv.baseId+o.errSchemaPath,g=`required property "${h}" is not defined at "${y}" (strictRequired)`;(0,lZ.checkStrictMode)(o,g,o.opts.strictRequired)}}function l(){if(c||s)e.block$data(Wc.nil,p);else for(let m of r)(0,Kc.checkReportMissingProp)(e,m)}function u(){let m=t.let("missing");if(c||s){let f=t.let("valid",!0);e.block$data(f,()=>d(m,f)),e.ok(f)}else t.if((0,Kc.checkMissingProp)(e,r,m)),(0,Kc.reportMissingProp)(e,m),t.else()}function p(){t.forOf("prop",n,m=>{e.setParams({missingProperty:m}),t.if((0,Kc.noPropertyInData)(t,i,m,a.ownProperties),()=>e.error())})}function d(m,f){e.setParams({missingProperty:m}),t.forOf(m,n,()=>{t.assign(f,(0,Kc.propertyInData)(t,i,m,a.ownProperties)),t.if((0,Wc.not)(f),()=>{e.error(),t.break()})},Wc.nil)}}};Cb.default=pZ});var cC=v(kb=>{"use strict";Object.defineProperty(kb,"__esModule",{value:!0});var Yc=ae(),fZ={message({keyword:e,schemaCode:t}){let r=e==="maxItems"?"more":"fewer";return(0,Yc.str)`must NOT have ${r} than ${t} items`},params:({schemaCode:e})=>(0,Yc._)`{limit: ${e}}`},dZ={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:fZ,code(e){let{keyword:t,data:r,schemaCode:n}=e,i=t==="maxItems"?Yc.operators.GT:Yc.operators.LT;e.fail$data((0,Yc._)`${r}.length ${i} ${n}`)}};kb.default=dZ});var lf=v(Nb=>{"use strict";Object.defineProperty(Nb,"__esModule",{value:!0});var lC=Sa();lC.code='require("ajv/dist/runtime/equal").default';Nb.default=lC});var uC=v(qb=>{"use strict";Object.defineProperty(qb,"__esModule",{value:!0});var Ib=Ic(),gt=ae(),mZ=Se(),hZ=lf(),yZ={message:({params:{i:e,j:t}})=>(0,gt.str)`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>(0,gt._)`{i: ${e}, j: ${t}}`},gZ={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:yZ,code(e){let{gen:t,data:r,$data:n,schema:i,parentSchema:s,schemaCode:o,it:a}=e;if(!n&&!i)return;let c=t.let("valid"),l=s.items?(0,Ib.getSchemaTypes)(s.items):[];e.block$data(c,u,(0,gt._)`${o} === false`),e.ok(c);function u(){let f=t.let("i",(0,gt._)`${r}.length`),h=t.let("j");e.setParams({i:f,j:h}),t.assign(c,!0),t.if((0,gt._)`${f} > 1`,()=>(p()?d:m)(f,h))}function p(){return l.length>0&&!l.some(f=>f==="object"||f==="array")}function d(f,h){let y=t.name("item"),g=(0,Ib.checkDataTypes)(l,y,a.opts.strictNumbers,Ib.DataType.Wrong),b=t.const("indices",(0,gt._)`{}`);t.for((0,gt._)`;${f}--;`,()=>{t.let(y,(0,gt._)`${r}[${f}]`),t.if(g,(0,gt._)`continue`),l.length>1&&t.if((0,gt._)`typeof ${y} == "string"`,(0,gt._)`${y} += "_"`),t.if((0,gt._)`typeof ${b}[${y}] == "number"`,()=>{t.assign(h,(0,gt._)`${b}[${y}]`),e.error(),t.assign(c,!1).break()}).code((0,gt._)`${b}[${y}] = ${f}`)})}function m(f,h){let y=(0,mZ.useFunc)(t,hZ.default),g=t.name("outer");t.label(g).for((0,gt._)`;${f}--;`,()=>t.for((0,gt._)`${h} = ${f}; ${h}--;`,()=>t.if((0,gt._)`${y}(${r}[${f}], ${r}[${h}])`,()=>{e.error(),t.assign(c,!1).break(g)})))}}};qb.default=gZ});var pC=v(Mb=>{"use strict";Object.defineProperty(Mb,"__esModule",{value:!0});var jb=ae(),bZ=Se(),vZ=lf(),wZ={message:"must be equal to constant",params:({schemaCode:e})=>(0,jb._)`{allowedValue: ${e}}`},xZ={keyword:"const",$data:!0,error:wZ,code(e){let{gen:t,data:r,$data:n,schemaCode:i,schema:s}=e;n||s&&typeof s=="object"?e.fail$data((0,jb._)`!${(0,bZ.useFunc)(t,vZ.default)}(${r}, ${i})`):e.fail((0,jb._)`${s} !== ${r}`)}};Mb.default=xZ});var fC=v(Lb=>{"use strict";Object.defineProperty(Lb,"__esModule",{value:!0});var Gc=ae(),SZ=Se(),_Z=lf(),OZ={message:"must be equal to one of the allowed values",params:({schemaCode:e})=>(0,Gc._)`{allowedValues: ${e}}`},PZ={keyword:"enum",schemaType:"array",$data:!0,error:OZ,code(e){let{gen:t,data:r,$data:n,schema:i,schemaCode:s,it:o}=e;if(!n&&i.length===0)throw new Error("enum must have non-empty array");let a=i.length>=o.opts.loopEnum,c,l=()=>c!=null?c:c=(0,SZ.useFunc)(t,_Z.default),u;if(a||n)u=t.let("valid"),e.block$data(u,p);else{if(!Array.isArray(i))throw new Error("ajv implementation error");let m=t.const("vSchema",s);u=(0,Gc.or)(...i.map((f,h)=>d(m,h)))}e.pass(u);function p(){t.assign(u,!1),t.forOf("v",s,m=>t.if((0,Gc._)`${l()}(${r}, ${m})`,()=>t.assign(u,!0).break()))}function d(m,f){let h=i[f];return typeof h=="object"&&h!==null?(0,Gc._)`${l()}(${r}, ${m}[${f}])`:(0,Gc._)`${r} === ${h}`}}};Lb.default=PZ});var dC=v(Db=>{"use strict";Object.defineProperty(Db,"__esModule",{value:!0});var $Z=eC(),EZ=tC(),AZ=iC(),TZ=sC(),RZ=oC(),CZ=aC(),kZ=cC(),NZ=uC(),IZ=pC(),qZ=fC(),jZ=[$Z.default,EZ.default,AZ.default,TZ.default,RZ.default,CZ.default,kZ.default,NZ.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},IZ.default,qZ.default];Db.default=jZ});var Bb=v(Jc=>{"use strict";Object.defineProperty(Jc,"__esModule",{value:!0});Jc.validateAdditionalItems=void 0;var xs=ae(),Fb=Se(),MZ={message:({params:{len:e}})=>(0,xs.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,xs._)`{limit: ${e}}`},LZ={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:MZ,code(e){let{parentSchema:t,it:r}=e,{items:n}=t;if(!Array.isArray(n)){(0,Fb.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}mC(e,n)}};function mC(e,t){let{gen:r,schema:n,data:i,keyword:s,it:o}=e;o.items=!0;let a=r.const("len",(0,xs._)`${i}.length`);if(n===!1)e.setParams({len:t.length}),e.pass((0,xs._)`${a} <= ${t.length}`);else if(typeof n=="object"&&!(0,Fb.alwaysValidSchema)(o,n)){let l=r.var("valid",(0,xs._)`${a} <= ${t.length}`);r.if((0,xs.not)(l),()=>c(l)),e.ok(l)}function c(l){r.forRange("i",t.length,a,u=>{e.subschema({keyword:s,dataProp:u,dataPropType:Fb.Type.Num},l),o.allErrors||r.if((0,xs.not)(l),()=>r.break())})}}Jc.validateAdditionalItems=mC;Jc.default=LZ});var Vb=v(Xc=>{"use strict";Object.defineProperty(Xc,"__esModule",{value:!0});Xc.validateTuple=void 0;var hC=ae(),uf=Se(),DZ=xr(),FZ={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){let{schema:t,it:r}=e;if(Array.isArray(t))return yC(e,"additionalItems",t);r.items=!0,!(0,uf.alwaysValidSchema)(r,t)&&e.ok((0,DZ.validateArray)(e))}};function yC(e,t,r=e.schema){let{gen:n,parentSchema:i,data:s,keyword:o,it:a}=e;u(i),a.opts.unevaluated&&r.length&&a.items!==!0&&(a.items=uf.mergeEvaluated.items(n,r.length,a.items));let c=n.name("valid"),l=n.const("len",(0,hC._)`${s}.length`);r.forEach((p,d)=>{(0,uf.alwaysValidSchema)(a,p)||(n.if((0,hC._)`${l} > ${d}`,()=>e.subschema({keyword:o,schemaProp:d,dataProp:d},c)),e.ok(c))});function u(p){let{opts:d,errSchemaPath:m}=a,f=r.length,h=f===p.minItems&&(f===p.maxItems||p[t]===!1);if(d.strictTuples&&!h){let y=`"${o}" is ${f}-tuple, but minItems or maxItems/${t} are not specified or different at path "${m}"`;(0,uf.checkStrictMode)(a,y,d.strictTuples)}}}Xc.validateTuple=yC;Xc.default=FZ});var gC=v(Ub=>{"use strict";Object.defineProperty(Ub,"__esModule",{value:!0});var BZ=Vb(),VZ={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,BZ.validateTuple)(e,"items")};Ub.default=VZ});var vC=v(zb=>{"use strict";Object.defineProperty(zb,"__esModule",{value:!0});var bC=ae(),UZ=Se(),zZ=xr(),HZ=Bb(),KZ={message:({params:{len:e}})=>(0,bC.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,bC._)`{limit: ${e}}`},WZ={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:KZ,code(e){let{schema:t,parentSchema:r,it:n}=e,{prefixItems:i}=r;n.items=!0,!(0,UZ.alwaysValidSchema)(n,t)&&(i?(0,HZ.validateAdditionalItems)(e,i):e.ok((0,zZ.validateArray)(e)))}};zb.default=WZ});var wC=v(Hb=>{"use strict";Object.defineProperty(Hb,"__esModule",{value:!0});var _r=ae(),pf=Se(),YZ={message:({params:{min:e,max:t}})=>t===void 0?(0,_r.str)`must contain at least ${e} valid item(s)`:(0,_r.str)`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>t===void 0?(0,_r._)`{minContains: ${e}}`:(0,_r._)`{minContains: ${e}, maxContains: ${t}}`},GZ={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:YZ,code(e){let{gen:t,schema:r,parentSchema:n,data:i,it:s}=e,o,a,{minContains:c,maxContains:l}=n;s.opts.next?(o=c===void 0?1:c,a=l):o=1;let u=t.const("len",(0,_r._)`${i}.length`);if(e.setParams({min:o,max:a}),a===void 0&&o===0){(0,pf.checkStrictMode)(s,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(a!==void 0&&o>a){(0,pf.checkStrictMode)(s,'"minContains" > "maxContains" is always invalid'),e.fail();return}if((0,pf.alwaysValidSchema)(s,r)){let h=(0,_r._)`${u} >= ${o}`;a!==void 0&&(h=(0,_r._)`${h} && ${u} <= ${a}`),e.pass(h);return}s.items=!0;let p=t.name("valid");a===void 0&&o===1?m(p,()=>t.if(p,()=>t.break())):o===0?(t.let(p,!0),a!==void 0&&t.if((0,_r._)`${i}.length > 0`,d)):(t.let(p,!1),d()),e.result(p,()=>e.reset());function d(){let h=t.name("_valid"),y=t.let("count",0);m(h,()=>t.if(h,()=>f(y)))}function m(h,y){t.forRange("i",0,u,g=>{e.subschema({keyword:"contains",dataProp:g,dataPropType:pf.Type.Num,compositeRule:!0},h),y()})}function f(h){t.code((0,_r._)`${h}++`),a===void 0?t.if((0,_r._)`${h} >= ${o}`,()=>t.assign(p,!0).break()):(t.if((0,_r._)`${h} > ${a}`,()=>t.assign(p,!1).break()),o===1?t.assign(p,!0):t.if((0,_r._)`${h} >= ${o}`,()=>t.assign(p,!0)))}}};Hb.default=GZ});var _C=v(tn=>{"use strict";Object.defineProperty(tn,"__esModule",{value:!0});tn.validateSchemaDeps=tn.validatePropertyDeps=tn.error=void 0;var Kb=ae(),JZ=Se(),Qc=xr();tn.error={message:({params:{property:e,depsCount:t,deps:r}})=>{let n=t===1?"property":"properties";return(0,Kb.str)`must have ${n} ${r} when property ${e} is present`},params:({params:{property:e,depsCount:t,deps:r,missingProperty:n}})=>(0,Kb._)`{property: ${e},
203
+ || ${o} === "boolean" || ${i} === null`).assign(a,(0,oe._)`[${i}]`)}}}function NJ({gen:e,parentData:t,parentDataProperty:r},n){e.if((0,oe._)`${t} !== undefined`,()=>e.assign((0,oe._)`${t}[${r}]`,n))}function Z0(e,t,r,n=Io.Correct){let i=n===Io.Correct?oe.operators.EQ:oe.operators.NEQ,s;switch(e){case"null":return(0,oe._)`${t} ${i} null`;case"array":s=(0,oe._)`Array.isArray(${t})`;break;case"object":s=(0,oe._)`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":s=o((0,oe._)`!(${t} % 1) && !isNaN(${t})`);break;case"number":s=o();break;default:return(0,oe._)`typeof ${t} ${i} ${e}`}return n===Io.Correct?s:(0,oe.not)(s);function o(a=oe.nil){return(0,oe.and)((0,oe._)`typeof ${t} == "number"`,a,r?(0,oe._)`isFinite(${t})`:oe.nil)}}At.checkDataType=Z0;function eb(e,t,r,n){if(e.length===1)return Z0(e[0],t,r,n);let i,s=(0,FR.toHash)(e);if(s.array&&s.object){let o=(0,oe._)`typeof ${t} != "object"`;i=s.null?o:(0,oe._)`!${t} || ${o}`,delete s.null,delete s.array,delete s.object}else i=oe.nil;s.number&&delete s.integer;for(let o in s)i=(0,oe.and)(i,Z0(o,t,r,n));return i}At.checkDataTypes=eb;var IJ={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>typeof e=="string"?(0,oe._)`{type: ${e}}`:(0,oe._)`{type: ${t}}`};function tb(e){let t=qJ(e);(0,AJ.reportError)(t,IJ)}At.reportTypeError=tb;function qJ(e){let{gen:t,data:r,schema:n}=e,i=(0,FR.schemaRefOrVal)(e,n,"type");return{gen:t,keyword:"type",data:r,schema:n.type,schemaCode:i,schemaValue:i,parentSchema:n,params:{},it:e}}});var zR=v(Wp=>{"use strict";Object.defineProperty(Wp,"__esModule",{value:!0});Wp.assignDefaults=void 0;var qo=ae(),jJ=Se();function MJ(e,t){let{properties:r,items:n}=e.schema;if(t==="object"&&r)for(let i in r)UR(e,i,r[i].default);else t==="array"&&Array.isArray(n)&&n.forEach((i,s)=>UR(e,s,i.default))}Wp.assignDefaults=MJ;function UR(e,t,r){let{gen:n,compositeRule:i,data:s,opts:o}=e;if(r===void 0)return;let a=(0,qo._)`${s}${(0,qo.getProperty)(t)}`;if(i){(0,jJ.checkStrictMode)(e,`default is ignored for: ${a}`);return}let c=(0,qo._)`${a} === undefined`;o.useDefaults==="empty"&&(c=(0,qo._)`${c} || ${a} === null || ${a} === ""`),n.if(c,(0,qo._)`${a} = ${(0,qo.stringify)(r)}`)}});var xr=v($e=>{"use strict";Object.defineProperty($e,"__esModule",{value:!0});$e.validateUnion=$e.validateArray=$e.usePattern=$e.callValidateCode=$e.schemaProperties=$e.allSchemaProperties=$e.noPropertyInData=$e.propertyInData=$e.isOwnProperty=$e.hasPropFunc=$e.reportMissingProp=$e.checkMissingProp=$e.checkReportMissingProp=void 0;var Ne=ae(),rb=Se(),mi=$n(),LJ=Se();function DJ(e,t){let{gen:r,data:n,it:i}=e;r.if(ib(r,n,t,i.opts.ownProperties),()=>{e.setParams({missingProperty:(0,Ne._)`${t}`},!0),e.error()})}$e.checkReportMissingProp=DJ;function FJ({gen:e,data:t,it:{opts:r}},n,i){return(0,Ne.or)(...n.map(s=>(0,Ne.and)(ib(e,t,s,r.ownProperties),(0,Ne._)`${i} = ${s}`)))}$e.checkMissingProp=FJ;function BJ(e,t){e.setParams({missingProperty:t},!0),e.error()}$e.reportMissingProp=BJ;function HR(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,Ne._)`Object.prototype.hasOwnProperty`})}$e.hasPropFunc=HR;function nb(e,t,r){return(0,Ne._)`${HR(e)}.call(${t}, ${r})`}$e.isOwnProperty=nb;function VJ(e,t,r,n){let i=(0,Ne._)`${t}${(0,Ne.getProperty)(r)} !== undefined`;return n?(0,Ne._)`${i} && ${nb(e,t,r)}`:i}$e.propertyInData=VJ;function ib(e,t,r,n){let i=(0,Ne._)`${t}${(0,Ne.getProperty)(r)} === undefined`;return n?(0,Ne.or)(i,(0,Ne.not)(nb(e,t,r))):i}$e.noPropertyInData=ib;function KR(e){return e?Object.keys(e).filter(t=>t!=="__proto__"):[]}$e.allSchemaProperties=KR;function UJ(e,t){return KR(t).filter(r=>!(0,rb.alwaysValidSchema)(e,t[r]))}$e.schemaProperties=UJ;function zJ({schemaCode:e,data:t,it:{gen:r,topSchemaRef:n,schemaPath:i,errorPath:s},it:o},a,c,l){let u=l?(0,Ne._)`${e}, ${t}, ${n}${i}`:t,p=[[mi.default.instancePath,(0,Ne.strConcat)(mi.default.instancePath,s)],[mi.default.parentData,o.parentData],[mi.default.parentDataProperty,o.parentDataProperty],[mi.default.rootData,mi.default.rootData]];o.opts.dynamicRef&&p.push([mi.default.dynamicAnchors,mi.default.dynamicAnchors]);let d=(0,Ne._)`${u}, ${r.object(...p)}`;return c!==Ne.nil?(0,Ne._)`${a}.call(${c}, ${d})`:(0,Ne._)`${a}(${d})`}$e.callValidateCode=zJ;var HJ=(0,Ne._)`new RegExp`;function KJ({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,Ne._)`${i.code==="new RegExp"?HJ:(0,LJ.useFunc)(e,i)}(${r}, ${n})`})}$e.usePattern=KJ;function WJ(e){let{gen:t,data:r,keyword:n,it:i}=e,s=t.name("valid");if(i.allErrors){let a=t.let("valid",!0);return o(()=>t.assign(a,!1)),a}return t.var(s,!0),o(()=>t.break()),s;function o(a){let c=t.const("len",(0,Ne._)`${r}.length`);t.forRange("i",0,c,l=>{e.subschema({keyword:n,dataProp:l,dataPropType:rb.Type.Num},s),t.if((0,Ne.not)(s),a)})}}$e.validateArray=WJ;function YJ(e){let{gen:t,schema:r,keyword:n,it:i}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(c=>(0,rb.alwaysValidSchema)(i,c))&&!i.opts.unevaluated)return;let o=t.let("valid",!1),a=t.name("_valid");t.block(()=>r.forEach((c,l)=>{let u=e.subschema({keyword:n,schemaProp:l,compositeRule:!0},a);t.assign(o,(0,Ne._)`${o} || ${a}`),e.mergeValidEvaluated(u,a)||t.if((0,Ne.not)(o))})),e.result(o,()=>e.reset(),()=>e.error(!0))}$e.validateUnion=YJ});var GR=v(Qr=>{"use strict";Object.defineProperty(Qr,"__esModule",{value:!0});Qr.validateKeywordUsage=Qr.validSchemaType=Qr.funcKeywordCode=Qr.macroKeywordCode=void 0;var Ft=ae(),gs=$n(),GJ=xr(),JJ=Nc();function XJ(e,t){let{gen:r,keyword:n,schema:i,parentSchema:s,it:o}=e,a=t.macro.call(o.self,i,s,o),c=YR(r,n,a);o.opts.validateSchema!==!1&&o.self.validateSchema(a,!0);let l=r.name("valid");e.subschema({schema:a,schemaPath:Ft.nil,errSchemaPath:`${o.errSchemaPath}/${n}`,topSchemaRef:c,compositeRule:!0},l),e.pass(l,()=>e.error(!0))}Qr.macroKeywordCode=XJ;function QJ(e,t){var r;let{gen:n,keyword:i,schema:s,parentSchema:o,$data:a,it:c}=e;eX(c,t);let l=!a&&t.compile?t.compile.call(c.self,s,o,c):t.validate,u=YR(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)h(),t.modifying&&WR(e),y(()=>e.error());else{let g=t.async?m():f();t.modifying&&WR(e),y(()=>ZJ(e,g))}}function m(){let g=n.let("ruleErrs",null);return n.try(()=>h((0,Ft._)`await `),b=>n.assign(p,!1).if((0,Ft._)`${b} instanceof ${c.ValidationError}`,()=>n.assign(g,(0,Ft._)`${b}.errors`),()=>n.throw(b))),g}function f(){let g=(0,Ft._)`${u}.errors`;return n.assign(g,null),h(Ft.nil),g}function h(g=t.async?(0,Ft._)`await `:Ft.nil){let b=c.opts.passContext?gs.default.this:gs.default.self,w=!("compile"in t&&!a||t.schema===!1);n.assign(p,(0,Ft._)`${g}${(0,GJ.callValidateCode)(e,u,b,w)}`,t.modifying)}function y(g){var b;n.if((0,Ft.not)((b=t.valid)!==null&&b!==void 0?b:p),g)}}Qr.funcKeywordCode=QJ;function WR(e){let{gen:t,data:r,it:n}=e;t.if(n.parentData,()=>t.assign(r,(0,Ft._)`${n.parentData}[${n.parentDataProperty}]`))}function ZJ(e,t){let{gen:r}=e;r.if((0,Ft._)`Array.isArray(${t})`,()=>{r.assign(gs.default.vErrors,(0,Ft._)`${gs.default.vErrors} === null ? ${t} : ${gs.default.vErrors}.concat(${t})`).assign(gs.default.errors,(0,Ft._)`${gs.default.vErrors}.length`),(0,JJ.extendErrors)(e)},()=>e.error())}function eX({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}function YR(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,Ft.stringify)(r)})}function tX(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")}Qr.validSchemaType=tX;function rX({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 o=i.dependencies;if(o!=null&&o.some(a=>!Object.prototype.hasOwnProperty.call(e,a)))throw new Error(`parent schema must have dependencies of ${s}: ${o.join(",")}`);if(i.validateSchema&&!i.validateSchema(e[s])){let c=`keyword "${s}" value is invalid at path "${n}": `+r.errorsText(i.validateSchema.errors);if(t.validateSchema==="log")r.logger.error(c);else throw new Error(c)}}Qr.validateKeywordUsage=rX});var XR=v(hi=>{"use strict";Object.defineProperty(hi,"__esModule",{value:!0});hi.extendSubschemaMode=hi.extendSubschemaData=hi.getSubschema=void 0;var Zr=ae(),JR=Se();function nX(e,{keyword:t,schemaProp:r,schema:n,schemaPath:i,errSchemaPath:s,topSchemaRef:o}){if(t!==void 0&&n!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(t!==void 0){let a=e.schema[t];return r===void 0?{schema:a,schemaPath:(0,Zr._)`${e.schemaPath}${(0,Zr.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:a[r],schemaPath:(0,Zr._)`${e.schemaPath}${(0,Zr.getProperty)(t)}${(0,Zr.getProperty)(r)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,JR.escapeFragment)(r)}`}}if(n!==void 0){if(i===void 0||s===void 0||o===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:i,topSchemaRef:o,errSchemaPath:s}}throw new Error('either "keyword" or "schema" must be passed')}hi.getSubschema=nX;function iX(e,t,{dataProp:r,dataPropType:n,data:i,dataTypes:s,propertyName:o}){if(i!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:a}=t;if(r!==void 0){let{errorPath:l,dataPathArr:u,opts:p}=t,d=a.let("data",(0,Zr._)`${t.data}${(0,Zr.getProperty)(r)}`,!0);c(d),e.errorPath=(0,Zr.str)`${l}${(0,JR.getErrorPath)(r,n,p.jsPropertySyntax)}`,e.parentDataProperty=(0,Zr._)`${r}`,e.dataPathArr=[...u,e.parentDataProperty]}if(i!==void 0){let l=i instanceof Zr.Name?i:a.let("data",i,!0);c(l),o!==void 0&&(e.propertyName=o)}s&&(e.dataTypes=s);function c(l){e.data=l,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,l]}}hi.extendSubschemaData=iX;function sX(e,{jtdDiscriminator:t,jtdMetadata:r,compositeRule:n,createErrors:i,allErrors:s}){n!==void 0&&(e.compositeRule=n),i!==void 0&&(e.createErrors=i),s!==void 0&&(e.allErrors=s),e.jtdDiscriminator=t,e.jtdMetadata=r}hi.extendSubschemaMode=sX});var qc=v(Zt=>{"use strict";Object.defineProperty(Zt,"__esModule",{value:!0});Zt.getSchemaRefs=Zt.resolveUrl=Zt.normalizeId=Zt._getFullPath=Zt.getFullPath=Zt.inlineRef=void 0;var oX=Se(),aX=Sa(),cX=hm(),lX=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function uX(e,t=!0){return typeof e=="boolean"?!0:t===!0?!sb(e):t?QR(e)<=t:!1}Zt.inlineRef=uX;var pX=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function sb(e){for(let t in e){if(pX.has(t))return!0;let r=e[t];if(Array.isArray(r)&&r.some(sb)||typeof r=="object"&&sb(r))return!0}return!1}function QR(e){let t=0;for(let r in e){if(r==="$ref")return 1/0;if(t++,!lX.has(r)&&(typeof e[r]=="object"&&(0,oX.eachItem)(e[r],n=>t+=QR(n)),t===1/0))return 1/0}return t}function ZR(e,t="",r){r!==!1&&(t=jo(t));let n=e.parse(t);return e2(e,n)}Zt.getFullPath=ZR;function e2(e,t){return e.serialize(t).split("#")[0]+"#"}Zt._getFullPath=e2;var fX=/#\/?$/;function jo(e){return e?e.replace(fX,""):""}Zt.normalizeId=jo;function dX(e,t,r){return r=jo(r),e.resolve(t,r)}Zt.resolveUrl=dX;var mX=/^[a-z_][-a-z0-9._]*$/i;function hX(e,t){if(typeof e=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,i=jo(e[r]||t),s={"":i},o=ZR(n,i,!1),a={},c=new Set;return cX(e,{allKeys:!0},(p,d,m,f)=>{if(f===void 0)return;let h=o+d,y=s[f];typeof p[r]=="string"&&(y=g.call(this,p[r])),b.call(this,p.$anchor),b.call(this,p.$dynamicAnchor),s[d]=y;function g(w){let x=this.opts.uriResolver.resolve;if(w=jo(y?x(y,w):w),c.has(w))throw u(w);c.add(w);let S=this.refs[w];return typeof S=="string"&&(S=this.refs[S]),typeof S=="object"?l(p,S.schema,w):w!==jo(h)&&(w[0]==="#"?(l(p,a[w],w),a[w]=p):this.refs[w]=h),w}function b(w){if(typeof w=="string"){if(!mX.test(w))throw new Error(`invalid anchor "${w}"`);g.call(this,`#${w}`)}}}),a;function l(p,d,m){if(d!==void 0&&!aX(p,d))throw u(m)}function u(p){return new Error(`reference "${p}" resolves to more than one schema`)}}Zt.getSchemaRefs=hX});var Lc=v(yi=>{"use strict";Object.defineProperty(yi,"__esModule",{value:!0});yi.getData=yi.KeywordCxt=yi.validateFunctionCode=void 0;var s2=MR(),t2=Ic(),ab=Q0(),Yp=Ic(),yX=zR(),Mc=GR(),ob=XR(),W=ae(),ee=$n(),gX=qc(),En=Se(),jc=Nc();function bX(e){if(c2(e)&&(l2(e),a2(e))){xX(e);return}o2(e,()=>(0,s2.topBoolOrEmptySchema)(e))}yi.validateFunctionCode=bX;function o2({gen:e,validateName:t,schema:r,schemaEnv:n,opts:i},s){i.code.es5?e.func(t,(0,W._)`${ee.default.data}, ${ee.default.valCxt}`,n.$async,()=>{e.code((0,W._)`"use strict"; ${r2(r,i)}`),wX(e,i),e.code(s)}):e.func(t,(0,W._)`${ee.default.data}, ${vX(i)}`,n.$async,()=>e.code(r2(r,i)).code(s))}function vX(e){return(0,W._)`{${ee.default.instancePath}="", ${ee.default.parentData}, ${ee.default.parentDataProperty}, ${ee.default.rootData}=${ee.default.data}${e.dynamicRef?(0,W._)`, ${ee.default.dynamicAnchors}={}`:W.nil}}={}`}function wX(e,t){e.if(ee.default.valCxt,()=>{e.var(ee.default.instancePath,(0,W._)`${ee.default.valCxt}.${ee.default.instancePath}`),e.var(ee.default.parentData,(0,W._)`${ee.default.valCxt}.${ee.default.parentData}`),e.var(ee.default.parentDataProperty,(0,W._)`${ee.default.valCxt}.${ee.default.parentDataProperty}`),e.var(ee.default.rootData,(0,W._)`${ee.default.valCxt}.${ee.default.rootData}`),t.dynamicRef&&e.var(ee.default.dynamicAnchors,(0,W._)`${ee.default.valCxt}.${ee.default.dynamicAnchors}`)},()=>{e.var(ee.default.instancePath,(0,W._)`""`),e.var(ee.default.parentData,(0,W._)`undefined`),e.var(ee.default.parentDataProperty,(0,W._)`undefined`),e.var(ee.default.rootData,ee.default.data),t.dynamicRef&&e.var(ee.default.dynamicAnchors,(0,W._)`{}`)})}function xX(e){let{schema:t,opts:r,gen:n}=e;o2(e,()=>{r.$comment&&t.$comment&&p2(e),$X(e),n.let(ee.default.vErrors,null),n.let(ee.default.errors,0),r.unevaluated&&SX(e),u2(e),TX(e)})}function SX(e){let{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",(0,W._)`${r}.evaluated`),t.if((0,W._)`${e.evaluated}.dynamicProps`,()=>t.assign((0,W._)`${e.evaluated}.props`,(0,W._)`undefined`)),t.if((0,W._)`${e.evaluated}.dynamicItems`,()=>t.assign((0,W._)`${e.evaluated}.items`,(0,W._)`undefined`))}function r2(e,t){let r=typeof e=="object"&&e[t.schemaId];return r&&(t.code.source||t.code.process)?(0,W._)`/*# sourceURL=${r} */`:W.nil}function _X(e,t){if(c2(e)&&(l2(e),a2(e))){OX(e,t);return}(0,s2.boolOrEmptySchema)(e,t)}function a2({schema:e,self:t}){if(typeof e=="boolean")return!e;for(let r in e)if(t.RULES.all[r])return!0;return!1}function c2(e){return typeof e.schema!="boolean"}function OX(e,t){let{schema:r,gen:n,opts:i}=e;i.$comment&&r.$comment&&p2(e),EX(e),AX(e);let s=n.const("_errs",ee.default.errors);u2(e,s),n.var(t,(0,W._)`${s} === ${ee.default.errors}`)}function l2(e){(0,En.checkUnknownRules)(e),PX(e)}function u2(e,t){if(e.opts.jtd)return n2(e,[],!1,t);let r=(0,t2.getSchemaTypes)(e.schema),n=(0,t2.coerceAndCheckDataType)(e,r);n2(e,r,!n,t)}function PX(e){let{schema:t,errSchemaPath:r,opts:n,self:i}=e;t.$ref&&n.ignoreKeywordsWithRef&&(0,En.schemaHasRulesButRef)(t,i.RULES)&&i.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function $X(e){let{schema:t,opts:r}=e;t.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,En.checkStrictMode)(e,"default is ignored in the schema root")}function EX(e){let t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,gX.resolveUrl)(e.opts.uriResolver,e.baseId,t))}function AX(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}function p2({gen:e,schemaEnv:t,schema:r,errSchemaPath:n,opts:i}){let s=r.$comment;if(i.$comment===!0)e.code((0,W._)`${ee.default.self}.logger.log(${s})`);else if(typeof i.$comment=="function"){let o=(0,W.str)`${n}/$comment`,a=e.scopeValue("root",{ref:t.root});e.code((0,W._)`${ee.default.self}.opts.$comment(${s}, ${o}, ${a}.schema)`)}}function TX(e){let{gen:t,schemaEnv:r,validateName:n,ValidationError:i,opts:s}=e;r.$async?t.if((0,W._)`${ee.default.errors} === 0`,()=>t.return(ee.default.data),()=>t.throw((0,W._)`new ${i}(${ee.default.vErrors})`)):(t.assign((0,W._)`${n}.errors`,ee.default.vErrors),s.unevaluated&&RX(e),t.return((0,W._)`${ee.default.errors} === 0`))}function RX({gen:e,evaluated:t,props:r,items:n}){r instanceof W.Name&&e.assign((0,W._)`${t}.props`,r),n instanceof W.Name&&e.assign((0,W._)`${t}.items`,n)}function n2(e,t,r,n){let{gen:i,schema:s,data:o,allErrors:a,opts:c,self:l}=e,{RULES:u}=l;if(s.$ref&&(c.ignoreKeywordsWithRef||!(0,En.schemaHasRulesButRef)(s,u))){i.block(()=>d2(e,"$ref",u.all.$ref.definition));return}c.jtd||CX(e,t),i.block(()=>{for(let d of u.rules)p(d);p(u.post)});function p(d){(0,ab.shouldUseGroup)(s,d)&&(d.type?(i.if((0,Yp.checkDataType)(d.type,o,c.strictNumbers)),i2(e,d),t.length===1&&t[0]===d.type&&r&&(i.else(),(0,Yp.reportTypeError)(e)),i.endIf()):i2(e,d),a||i.if((0,W._)`${ee.default.errors} === ${n||0}`))}}function i2(e,t){let{gen:r,schema:n,opts:{useDefaults:i}}=e;i&&(0,yX.assignDefaults)(e,t.type),r.block(()=>{for(let s of t.rules)(0,ab.shouldUseRule)(n,s)&&d2(e,s.keyword,s.definition,t.type)})}function CX(e,t){e.schemaEnv.meta||!e.opts.strictTypes||(kX(e,t),e.opts.allowUnionTypes||NX(e,t),IX(e,e.dataTypes))}function kX(e,t){if(t.length){if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach(r=>{f2(e.dataTypes,r)||cb(e,`type "${r}" not allowed by context "${e.dataTypes.join(",")}"`)}),jX(e,t)}}function NX(e,t){t.length>1&&!(t.length===2&&t.includes("null"))&&cb(e,"use allowUnionTypes to allow union type keyword")}function IX(e,t){let r=e.self.RULES.all;for(let n in r){let i=r[n];if(typeof i=="object"&&(0,ab.shouldUseRule)(e.schema,i)){let{type:s}=i.definition;s.length&&!s.some(o=>qX(t,o))&&cb(e,`missing type "${s.join(",")}" for keyword "${n}"`)}}}function qX(e,t){return e.includes(t)||t==="number"&&e.includes("integer")}function f2(e,t){return e.includes(t)||t==="integer"&&e.includes("number")}function jX(e,t){let r=[];for(let n of e.dataTypes)f2(t,n)?r.push(n):t.includes("integer")&&n==="number"&&r.push("integer");e.dataTypes=r}function cb(e,t){let r=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${r}" (strictTypes)`,(0,En.checkStrictMode)(e,t,e.opts.strictTypes)}var Gp=class{constructor(t,r,n){if((0,Mc.validateKeywordUsage)(t,r,n),this.gen=t.gen,this.allErrors=t.allErrors,this.keyword=n,this.data=t.data,this.schema=t.schema[n],this.$data=r.$data&&t.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,En.schemaRefOrVal)(t,this.schema,n,this.$data),this.schemaType=r.schemaType,this.parentSchema=t.schema,this.params={},this.it=t,this.def=r,this.$data)this.schemaCode=t.gen.const("vSchema",m2(this.$data,t));else if(this.schemaCode=this.schemaValue,!(0,Mc.validSchemaType)(this.schema,r.schemaType,r.allowUndefined))throw new Error(`${n} value must be ${JSON.stringify(r.schemaType)}`);("code"in r?r.trackErrors:r.errors!==!1)&&(this.errsCount=t.gen.const("_errs",ee.default.errors))}result(t,r,n){this.failResult((0,W.not)(t),r,n)}failResult(t,r,n){this.gen.if(t),n?n():this.error(),r?(this.gen.else(),r(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(t,r){this.failResult((0,W.not)(t),void 0,r)}fail(t){if(t===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(t),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(t){if(!this.$data)return this.fail(t);let{schemaCode:r}=this;this.fail((0,W._)`${r} !== undefined && (${(0,W.or)(this.invalid$data(),t)})`)}error(t,r,n){if(r){this.setParams(r),this._error(t,n),this.setParams({});return}this._error(t,n)}_error(t,r){(t?jc.reportExtraError:jc.reportError)(this,this.def.error,r)}$dataError(){(0,jc.reportError)(this,this.def.$dataError||jc.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,jc.resetErrorsCount)(this.gen,this.errsCount)}ok(t){this.allErrors||this.gen.if(t)}setParams(t,r){r?Object.assign(this.params,t):this.params=t}block$data(t,r,n=W.nil){this.gen.block(()=>{this.check$data(t,n),r()})}check$data(t=W.nil,r=W.nil){if(!this.$data)return;let{gen:n,schemaCode:i,schemaType:s,def:o}=this;n.if((0,W.or)((0,W._)`${i} === undefined`,r)),t!==W.nil&&n.assign(t,!0),(s.length||o.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),t!==W.nil&&n.assign(t,!1)),n.else()}invalid$data(){let{gen:t,schemaCode:r,schemaType:n,def:i,it:s}=this;return(0,W.or)(o(),a());function o(){if(n.length){if(!(r instanceof W.Name))throw new Error("ajv implementation error");let c=Array.isArray(n)?n:[n];return(0,W._)`${(0,Yp.checkDataTypes)(c,r,s.opts.strictNumbers,Yp.DataType.Wrong)}`}return W.nil}function a(){if(i.validateSchema){let c=t.scopeValue("validate$data",{ref:i.validateSchema});return(0,W._)`!${c}(${r})`}return W.nil}}subschema(t,r){let n=(0,ob.getSubschema)(this.it,t);(0,ob.extendSubschemaData)(n,this.it,t),(0,ob.extendSubschemaMode)(n,t);let i={...this.it,...n,items:void 0,props:void 0};return _X(i,r),i}mergeEvaluated(t,r){let{it:n,gen:i}=this;n.opts.unevaluated&&(n.props!==!0&&t.props!==void 0&&(n.props=En.mergeEvaluated.props(i,t.props,n.props,r)),n.items!==!0&&t.items!==void 0&&(n.items=En.mergeEvaluated.items(i,t.items,n.items,r)))}mergeValidEvaluated(t,r){let{it:n,gen:i}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return i.if(r,()=>this.mergeEvaluated(t,W.Name)),!0}};yi.KeywordCxt=Gp;function d2(e,t,r,n){let i=new Gp(e,r,t);"code"in r?r.code(i,n):i.$data&&r.validate?(0,Mc.funcKeywordCode)(i,r):"macro"in r?(0,Mc.macroKeywordCode)(i,r):(r.compile||r.validate)&&(0,Mc.funcKeywordCode)(i,r)}var MX=/^\/(?:[^~]|~0|~1)*$/,LX=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function m2(e,{dataLevel:t,dataNames:r,dataPathArr:n}){let i,s;if(e==="")return ee.default.rootData;if(e[0]==="/"){if(!MX.test(e))throw new Error(`Invalid JSON-pointer: ${e}`);i=e,s=ee.default.rootData}else{let l=LX.exec(e);if(!l)throw new Error(`Invalid JSON-pointer: ${e}`);let u=+l[1];if(i=l[2],i==="#"){if(u>=t)throw new Error(c("property/index",u));return n[t-u]}if(u>t)throw new Error(c("data",u));if(s=r[t-u],!i)return s}let o=s,a=i.split("/");for(let l of a)l&&(s=(0,W._)`${s}${(0,W.getProperty)((0,En.unescapeJsonPointer)(l))}`,o=(0,W._)`${o} && ${s}`);return o;function c(l,u){return`Cannot access ${l} ${u} levels up, current level is ${t}`}}yi.getData=m2});var Jp=v(ub=>{"use strict";Object.defineProperty(ub,"__esModule",{value:!0});var lb=class extends Error{constructor(t){super("validation failed"),this.errors=t,this.ajv=this.validation=!0}};ub.default=lb});var Dc=v(db=>{"use strict";Object.defineProperty(db,"__esModule",{value:!0});var pb=qc(),fb=class extends Error{constructor(t,r,n,i){super(i||`can't resolve reference ${n} from id ${r}`),this.missingRef=(0,pb.resolveUrl)(t,r,n),this.missingSchema=(0,pb.normalizeId)((0,pb.getFullPath)(t,this.missingRef))}};db.default=fb});var Qp=v(Sr=>{"use strict";Object.defineProperty(Sr,"__esModule",{value:!0});Sr.resolveSchema=Sr.getCompilingSchema=Sr.resolveRef=Sr.compileSchema=Sr.SchemaEnv=void 0;var Nr=ae(),DX=Jp(),bs=$n(),Ir=qc(),h2=Se(),FX=Lc(),Mo=class{constructor(t){var r;this.refs={},this.dynamicAnchors={};let n;typeof t.schema=="object"&&(n=t.schema),this.schema=t.schema,this.schemaId=t.schemaId,this.root=t.root||this,this.baseId=(r=t.baseId)!==null&&r!==void 0?r:(0,Ir.normalizeId)(n==null?void 0:n[t.schemaId||"$id"]),this.schemaPath=t.schemaPath,this.localRefs=t.localRefs,this.meta=t.meta,this.$async=n==null?void 0:n.$async,this.refs={}}};Sr.SchemaEnv=Mo;function hb(e){let t=y2.call(this,e);if(t)return t;let r=(0,Ir.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:n,lines:i}=this.opts.code,{ownProperties:s}=this.opts,o=new Nr.CodeGen(this.scope,{es5:n,lines:i,ownProperties:s}),a;e.$async&&(a=o.scopeValue("Error",{ref:DX.default,code:(0,Nr._)`require("ajv/dist/runtime/validation_error").default`}));let c=o.scopeName("validate");e.validateName=c;let l={gen:o,allErrors:this.opts.allErrors,data:bs.default.data,parentData:bs.default.parentData,parentDataProperty:bs.default.parentDataProperty,dataNames:[bs.default.data],dataPathArr:[Nr.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:o.scopeValue("schema",this.opts.code.source===!0?{ref:e.schema,code:(0,Nr.stringify)(e.schema)}:{ref:e.schema}),validateName:c,ValidationError:a,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:Nr.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,Nr._)`""`,opts:this.opts,self:this},u;try{this._compilations.add(e),(0,FX.validateFunctionCode)(l),o.optimize(this.opts.code.optimize);let p=o.toString();u=`${o.scopeRefs(bs.default.scope)}return ${p}`,this.opts.code.process&&(u=this.opts.code.process(u,e));let m=new Function(`${bs.default.self}`,`${bs.default.scope}`,u)(this,this.scope.get());if(this.scope.value(c,{ref:m}),m.errors=null,m.schema=e.schema,m.schemaEnv=e,e.$async&&(m.$async=!0),this.opts.code.source===!0&&(m.source={validateName:c,validateCode:p,scopeValues:o._values}),this.opts.unevaluated){let{props:f,items:h}=l;m.evaluated={props:f instanceof Nr.Name?void 0:f,items:h instanceof Nr.Name?void 0:h,dynamicProps:f instanceof Nr.Name,dynamicItems:h instanceof Nr.Name},m.source&&(m.source.evaluated=(0,Nr.stringify)(m.evaluated))}return e.validate=m,e}catch(p){throw delete e.validate,delete e.validateName,u&&this.logger.error("Error compiling schema, function code:",u),p}finally{this._compilations.delete(e)}}Sr.compileSchema=hb;function BX(e,t,r){var n;r=(0,Ir.resolveUrl)(this.opts.uriResolver,t,r);let i=e.refs[r];if(i)return i;let s=zX.call(this,e,r);if(s===void 0){let o=(n=e.localRefs)===null||n===void 0?void 0:n[r],{schemaId:a}=this.opts;o&&(s=new Mo({schema:o,schemaId:a,root:e,baseId:t}))}if(s!==void 0)return e.refs[r]=VX.call(this,s)}Sr.resolveRef=BX;function VX(e){return(0,Ir.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:hb.call(this,e)}function y2(e){for(let t of this._compilations)if(UX(t,e))return t}Sr.getCompilingSchema=y2;function UX(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function zX(e,t){let r;for(;typeof(r=this.refs[t])=="string";)t=r;return r||this.schemas[t]||Xp.call(this,e,t)}function Xp(e,t){let r=this.opts.uriResolver.parse(t),n=(0,Ir._getFullPath)(this.opts.uriResolver,r),i=(0,Ir.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&n===i)return mb.call(this,r,e);let s=(0,Ir.normalizeId)(n),o=this.refs[s]||this.schemas[s];if(typeof o=="string"){let a=Xp.call(this,e,o);return typeof(a==null?void 0:a.schema)!="object"?void 0:mb.call(this,r,a)}if(typeof(o==null?void 0:o.schema)=="object"){if(o.validate||hb.call(this,o),s===(0,Ir.normalizeId)(t)){let{schema:a}=o,{schemaId:c}=this.opts,l=a[c];return l&&(i=(0,Ir.resolveUrl)(this.opts.uriResolver,i,l)),new Mo({schema:a,schemaId:c,root:e,baseId:i})}return mb.call(this,r,o)}}Sr.resolveSchema=Xp;var HX=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function mb(e,{baseId:t,schema:r,root:n}){var i;if(((i=e.fragment)===null||i===void 0?void 0:i[0])!=="/")return;for(let a of e.fragment.slice(1).split("/")){if(typeof r=="boolean")return;let c=r[(0,h2.unescapeFragment)(a)];if(c===void 0)return;r=c;let l=typeof r=="object"&&r[this.opts.schemaId];!HX.has(a)&&l&&(t=(0,Ir.resolveUrl)(this.opts.uriResolver,t,l))}let s;if(typeof r!="boolean"&&r.$ref&&!(0,h2.schemaHasRulesButRef)(r,this.RULES)){let a=(0,Ir.resolveUrl)(this.opts.uriResolver,t,r.$ref);s=Xp.call(this,n,a)}let{schemaId:o}=this.opts;if(s=s||new Mo({schema:r,schemaId:o,root:n,baseId:t}),s.schema!==s.root.schema)return s}});var g2=v((e1e,KX)=>{KX.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var v2=v((t1e,b2)=>{"use strict";var WX={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};b2.exports={HEX:WX}});var E2=v((r1e,$2)=>{"use strict";var{HEX:YX}=v2();function _2(e){if(P2(e,".")<3)return{host:e,isIPV4:!1};let t=e.match(/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/u)||[],[r]=t;return r?{host:JX(r,"."),isIPV4:!0}:{host:e,isIPV4:!1}}function yb(e,t=!1){let r="",n=!0;for(let i of e){if(YX[i]===void 0)return;i!=="0"&&n===!0&&(n=!1),n||(r+=i)}return t&&r.length===0&&(r="0"),r}function GX(e){let t=0,r={error:!1,address:"",zone:""},n=[],i=[],s=!1,o=!1,a=!1;function c(){if(i.length){if(s===!1){let l=yb(i);if(l!==void 0)n.push(l);else return r.error=!0,!1}i.length=0}return!0}for(let l=0;l<e.length;l++){let u=e[l];if(!(u==="["||u==="]"))if(u===":"){if(o===!0&&(a=!0),!c())break;if(t++,n.push(":"),t>7){r.error=!0;break}l-1>=0&&e[l-1]===":"&&(o=!0);continue}else if(u==="%"){if(!c())break;s=!0}else{i.push(u);continue}}return i.length&&(s?r.zone=i.join(""):a?n.push(i.join("")):n.push(yb(i))),r.address=n.join(""),r}function O2(e,t={}){if(P2(e,":")<2)return{host:e,isIPV6:!1};let r=GX(e);if(r.error)return{host:e,isIPV6:!1};{let n=r.address,i=r.address;return r.zone&&(n+="%"+r.zone,i+="%25"+r.zone),{host:n,escapedHost:i,isIPV6:!0}}}function JX(e,t){let r="",n=!0,i=e.length;for(let s=0;s<i;s++){let o=e[s];o==="0"&&n?(s+1<=i&&e[s+1]===t||s+1===i)&&(r+=o,n=!1):(o===t?n=!0:n=!1,r+=o)}return r}function P2(e,t){let r=0;for(let n=0;n<e.length;n++)e[n]===t&&r++;return r}var w2=/^\.\.?\//u,x2=/^\/\.(?:\/|$)/u,S2=/^\/\.\.(?:\/|$)/u,XX=/^\/?(?:.|\n)*?(?=\/|$)/u;function QX(e){let t=[];for(;e.length;)if(e.match(w2))e=e.replace(w2,"");else if(e.match(x2))e=e.replace(x2,"/");else if(e.match(S2))e=e.replace(S2,"/"),t.pop();else if(e==="."||e==="..")e="";else{let r=e.match(XX);if(r){let n=r[0];e=e.slice(n.length),t.push(n)}else throw new Error("Unexpected dot segment condition")}return t.join("")}function ZX(e,t){let r=t!==!0?escape:unescape;return e.scheme!==void 0&&(e.scheme=r(e.scheme)),e.userinfo!==void 0&&(e.userinfo=r(e.userinfo)),e.host!==void 0&&(e.host=r(e.host)),e.path!==void 0&&(e.path=r(e.path)),e.query!==void 0&&(e.query=r(e.query)),e.fragment!==void 0&&(e.fragment=r(e.fragment)),e}function eQ(e,t){let r=[];if(e.userinfo!==void 0&&(r.push(e.userinfo),r.push("@")),e.host!==void 0){let n=unescape(e.host),i=_2(n);if(i.isIPV4)n=i.host;else{let s=O2(i.host,{isIPV4:!1});s.isIPV6===!0?n=`[${s.escapedHost}]`:n=e.host}r.push(n)}return(typeof e.port=="number"||typeof e.port=="string")&&(r.push(":"),r.push(String(e.port))),r.length?r.join(""):void 0}$2.exports={recomposeAuthority:eQ,normalizeComponentEncoding:ZX,removeDotSegments:QX,normalizeIPv4:_2,normalizeIPv6:O2,stringArrayToHexStripped:yb}});var N2=v((n1e,k2)=>{"use strict";var tQ=/^[\da-f]{8}\b-[\da-f]{4}\b-[\da-f]{4}\b-[\da-f]{4}\b-[\da-f]{12}$/iu,rQ=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu;function A2(e){return typeof e.secure=="boolean"?e.secure:String(e.scheme).toLowerCase()==="wss"}function T2(e){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e}function R2(e){let t=String(e.scheme).toLowerCase()==="https";return(e.port===(t?443:80)||e.port==="")&&(e.port=void 0),e.path||(e.path="/"),e}function nQ(e){return e.secure=A2(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e}function iQ(e){if((e.port===(A2(e)?443:80)||e.port==="")&&(e.port=void 0),typeof e.secure=="boolean"&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){let[t,r]=e.resourceName.split("?");e.path=t&&t!=="/"?t:void 0,e.query=r,e.resourceName=void 0}return e.fragment=void 0,e}function sQ(e,t){if(!e.path)return e.error="URN can not be parsed",e;let r=e.path.match(rQ);if(r){let n=t.scheme||e.scheme||"urn";e.nid=r[1].toLowerCase(),e.nss=r[2];let i=`${n}:${t.nid||e.nid}`,s=gb[i];e.path=void 0,s&&(e=s.parse(e,t))}else e.error=e.error||"URN can not be parsed.";return e}function oQ(e,t){let r=t.scheme||e.scheme||"urn",n=e.nid.toLowerCase(),i=`${r}:${t.nid||n}`,s=gb[i];s&&(e=s.serialize(e,t));let o=e,a=e.nss;return o.path=`${n||t.nid}:${a}`,t.skipEscape=!0,o}function aQ(e,t){let r=e;return r.uuid=r.nss,r.nss=void 0,!t.tolerant&&(!r.uuid||!tQ.test(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}function cQ(e){let t=e;return t.nss=(e.uuid||"").toLowerCase(),t}var C2={scheme:"http",domainHost:!0,parse:T2,serialize:R2},lQ={scheme:"https",domainHost:C2.domainHost,parse:T2,serialize:R2},Zp={scheme:"ws",domainHost:!0,parse:nQ,serialize:iQ},uQ={scheme:"wss",domainHost:Zp.domainHost,parse:Zp.parse,serialize:Zp.serialize},pQ={scheme:"urn",parse:sQ,serialize:oQ,skipNormalize:!0},fQ={scheme:"urn:uuid",parse:aQ,serialize:cQ,skipNormalize:!0},gb={http:C2,https:lQ,ws:Zp,wss:uQ,urn:pQ,"urn:uuid":fQ};k2.exports=gb});var q2=v((i1e,tf)=>{"use strict";var{normalizeIPv6:dQ,normalizeIPv4:mQ,removeDotSegments:Fc,recomposeAuthority:hQ,normalizeComponentEncoding:ef}=E2(),bb=N2();function yQ(e,t){return typeof e=="string"?e=en(An(e,t),t):typeof e=="object"&&(e=An(en(e,t),t)),e}function gQ(e,t,r){let n=Object.assign({scheme:"null"},r),i=I2(An(e,n),An(t,n),n,!0);return en(i,{...n,skipEscape:!0})}function I2(e,t,r,n){let i={};return n||(e=An(en(e,r),r),t=An(en(t,r),r)),r=r||{},!r.tolerant&&t.scheme?(i.scheme=t.scheme,i.userinfo=t.userinfo,i.host=t.host,i.port=t.port,i.path=Fc(t.path||""),i.query=t.query):(t.userinfo!==void 0||t.host!==void 0||t.port!==void 0?(i.userinfo=t.userinfo,i.host=t.host,i.port=t.port,i.path=Fc(t.path||""),i.query=t.query):(t.path?(t.path.charAt(0)==="/"?i.path=Fc(t.path):((e.userinfo!==void 0||e.host!==void 0||e.port!==void 0)&&!e.path?i.path="/"+t.path:e.path?i.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:i.path=t.path,i.path=Fc(i.path)),i.query=t.query):(i.path=e.path,t.query!==void 0?i.query=t.query:i.query=e.query),i.userinfo=e.userinfo,i.host=e.host,i.port=e.port),i.scheme=e.scheme),i.fragment=t.fragment,i}function bQ(e,t,r){return typeof e=="string"?(e=unescape(e),e=en(ef(An(e,r),!0),{...r,skipEscape:!0})):typeof e=="object"&&(e=en(ef(e,!0),{...r,skipEscape:!0})),typeof t=="string"?(t=unescape(t),t=en(ef(An(t,r),!0),{...r,skipEscape:!0})):typeof t=="object"&&(t=en(ef(t,!0),{...r,skipEscape:!0})),e.toLowerCase()===t.toLowerCase()}function en(e,t){let r={host:e.host,scheme:e.scheme,userinfo:e.userinfo,port:e.port,path:e.path,query:e.query,nid:e.nid,nss:e.nss,uuid:e.uuid,fragment:e.fragment,reference:e.reference,resourceName:e.resourceName,secure:e.secure,error:""},n=Object.assign({},t),i=[],s=bb[(n.scheme||r.scheme||"").toLowerCase()];s&&s.serialize&&s.serialize(r,n),r.path!==void 0&&(n.skipEscape?r.path=unescape(r.path):(r.path=escape(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),n.reference!=="suffix"&&r.scheme&&i.push(r.scheme,":");let o=hQ(r,n);if(o!==void 0&&(n.reference!=="suffix"&&i.push("//"),i.push(o),r.path&&r.path.charAt(0)!=="/"&&i.push("/")),r.path!==void 0){let a=r.path;!n.absolutePath&&(!s||!s.absolutePath)&&(a=Fc(a)),o===void 0&&(a=a.replace(/^\/\//u,"/%2F")),i.push(a)}return r.query!==void 0&&i.push("?",r.query),r.fragment!==void 0&&i.push("#",r.fragment),i.join("")}var vQ=Array.from({length:127},(e,t)=>/[^!"$&'()*+,\-.;=_`a-z{}~]/u.test(String.fromCharCode(t)));function wQ(e){let t=0;for(let r=0,n=e.length;r<n;++r)if(t=e.charCodeAt(r),t>126||vQ[t])return!0;return!1}var xQ=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function An(e,t){let r=Object.assign({},t),n={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},i=e.indexOf("%")!==-1,s=!1;r.reference==="suffix"&&(e=(r.scheme?r.scheme+":":"")+"//"+e);let o=e.match(xQ);if(o){if(n.scheme=o[1],n.userinfo=o[3],n.host=o[4],n.port=parseInt(o[5],10),n.path=o[6]||"",n.query=o[7],n.fragment=o[8],isNaN(n.port)&&(n.port=o[5]),n.host){let c=mQ(n.host);if(c.isIPV4===!1){let l=dQ(c.host,{isIPV4:!1});n.host=l.host.toLowerCase(),s=l.isIPV6}else n.host=c.host,s=!0}n.scheme===void 0&&n.userinfo===void 0&&n.host===void 0&&n.port===void 0&&!n.path&&n.query===void 0?n.reference="same-document":n.scheme===void 0?n.reference="relative":n.fragment===void 0?n.reference="absolute":n.reference="uri",r.reference&&r.reference!=="suffix"&&r.reference!==n.reference&&(n.error=n.error||"URI is not a "+r.reference+" reference.");let a=bb[(r.scheme||n.scheme||"").toLowerCase()];if(!r.unicodeSupport&&(!a||!a.unicodeSupport)&&n.host&&(r.domainHost||a&&a.domainHost)&&s===!1&&wQ(n.host))try{n.host=URL.domainToASCII(n.host.toLowerCase())}catch(c){n.error=n.error||"Host's domain name can not be converted to ASCII: "+c}(!a||a&&!a.skipNormalize)&&(i&&n.scheme!==void 0&&(n.scheme=unescape(n.scheme)),i&&n.host!==void 0&&(n.host=unescape(n.host)),n.path!==void 0&&n.path.length&&(n.path=escape(unescape(n.path))),n.fragment!==void 0&&n.fragment.length&&(n.fragment=encodeURI(decodeURIComponent(n.fragment)))),a&&a.parse&&a.parse(n,r)}else n.error=n.error||"URI can not be parsed.";return n}var vb={SCHEMES:bb,normalize:yQ,resolve:gQ,resolveComponents:I2,equal:bQ,serialize:en,parse:An};tf.exports=vb;tf.exports.default=vb;tf.exports.fastUri=vb});var M2=v(wb=>{"use strict";Object.defineProperty(wb,"__esModule",{value:!0});var j2=q2();j2.code='require("ajv/dist/runtime/uri").default';wb.default=j2});var H2=v(yt=>{"use strict";Object.defineProperty(yt,"__esModule",{value:!0});yt.CodeGen=yt.Name=yt.nil=yt.stringify=yt.str=yt._=yt.KeywordCxt=void 0;var SQ=Lc();Object.defineProperty(yt,"KeywordCxt",{enumerable:!0,get:function(){return SQ.KeywordCxt}});var Lo=ae();Object.defineProperty(yt,"_",{enumerable:!0,get:function(){return Lo._}});Object.defineProperty(yt,"str",{enumerable:!0,get:function(){return Lo.str}});Object.defineProperty(yt,"stringify",{enumerable:!0,get:function(){return Lo.stringify}});Object.defineProperty(yt,"nil",{enumerable:!0,get:function(){return Lo.nil}});Object.defineProperty(yt,"Name",{enumerable:!0,get:function(){return Lo.Name}});Object.defineProperty(yt,"CodeGen",{enumerable:!0,get:function(){return Lo.CodeGen}});var _Q=Jp(),V2=Dc(),OQ=X0(),Bc=Qp(),PQ=ae(),Vc=qc(),rf=Ic(),Sb=Se(),L2=g2(),$Q=M2(),U2=(e,t)=>new RegExp(e,t);U2.code="new RegExp";var EQ=["removeAdditional","useDefaults","coerceTypes"],AQ=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),TQ={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."},RQ={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},D2=200;function CQ(e){var t,r,n,i,s,o,a,c,l,u,p,d,m,f,h,y,g,b,w,x,S,T,_,P,E;let F=e.strict,$=(t=e.code)===null||t===void 0?void 0:t.optimize,O=$===!0||$===void 0?1:$||0,k=(n=(r=e.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:U2,L=(i=e.uriResolver)!==null&&i!==void 0?i:$Q.default;return{strictSchema:(o=(s=e.strictSchema)!==null&&s!==void 0?s:F)!==null&&o!==void 0?o:!0,strictNumbers:(c=(a=e.strictNumbers)!==null&&a!==void 0?a:F)!==null&&c!==void 0?c:!0,strictTypes:(u=(l=e.strictTypes)!==null&&l!==void 0?l:F)!==null&&u!==void 0?u:"log",strictTuples:(d=(p=e.strictTuples)!==null&&p!==void 0?p:F)!==null&&d!==void 0?d:"log",strictRequired:(f=(m=e.strictRequired)!==null&&m!==void 0?m:F)!==null&&f!==void 0?f:!1,code:e.code?{...e.code,optimize:O,regExp:k}:{optimize:O,regExp:k},loopRequired:(h=e.loopRequired)!==null&&h!==void 0?h:D2,loopEnum:(y=e.loopEnum)!==null&&y!==void 0?y:D2,meta:(g=e.meta)!==null&&g!==void 0?g:!0,messages:(b=e.messages)!==null&&b!==void 0?b:!0,inlineRefs:(w=e.inlineRefs)!==null&&w!==void 0?w:!0,schemaId:(x=e.schemaId)!==null&&x!==void 0?x:"$id",addUsedSchema:(S=e.addUsedSchema)!==null&&S!==void 0?S:!0,validateSchema:(T=e.validateSchema)!==null&&T!==void 0?T:!0,validateFormats:(_=e.validateFormats)!==null&&_!==void 0?_:!0,unicodeRegExp:(P=e.unicodeRegExp)!==null&&P!==void 0?P:!0,int32range:(E=e.int32range)!==null&&E!==void 0?E:!0,uriResolver:L}}var Uc=class{constructor(t={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,t=this.opts={...t,...CQ(t)};let{es5:r,lines:n}=this.opts.code;this.scope=new PQ.ValueScope({scope:{},prefixes:AQ,es5:r,lines:n}),this.logger=MQ(t.logger);let i=t.validateFormats;t.validateFormats=!1,this.RULES=(0,OQ.getRules)(),F2.call(this,TQ,t,"NOT SUPPORTED"),F2.call(this,RQ,t,"DEPRECATED","warn"),this._metaOpts=qQ.call(this),t.formats&&NQ.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),t.keywords&&IQ.call(this,t.keywords),typeof t.meta=="object"&&this.addMetaSchema(t.meta),kQ.call(this),t.validateFormats=i}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:t,meta:r,schemaId:n}=this.opts,i=L2;n==="id"&&(i={...L2},i.id=i.$id,delete i.$id),r&&t&&this.addMetaSchema(i,i[n],!1)}defaultMeta(){let{meta:t,schemaId:r}=this.opts;return this.opts.defaultMeta=typeof t=="object"?t[r]||t:void 0}validate(t,r){let n;if(typeof t=="string"){if(n=this.getSchema(t),!n)throw new Error(`no schema with key or ref "${t}"`)}else n=this.compile(t);let i=n(r);return"$async"in n||(this.errors=n.errors),i}compile(t,r){let n=this._addSchema(t,r);return n.validate||this._compileSchemaEnv(n)}compileAsync(t,r){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:n}=this.opts;return i.call(this,t,r);async function i(u,p){await s.call(this,u.$schema);let d=this._addSchema(u,p);return d.validate||o.call(this,d)}async function s(u){u&&!this.getSchema(u)&&await i.call(this,{$ref:u},!0)}async function o(u){try{return this._compileSchemaEnv(u)}catch(p){if(!(p instanceof V2.default))throw p;return a.call(this,p),await c.call(this,p.missingSchema),o.call(this,u)}}function a({missingSchema:u,missingRef:p}){if(this.refs[u])throw new Error(`AnySchema ${u} is loaded but ${p} cannot be resolved`)}async function c(u){let p=await l.call(this,u);this.refs[u]||await s.call(this,p.$schema),this.refs[u]||this.addSchema(p,u,r)}async function l(u){let p=this._loading[u];if(p)return p;try{return await(this._loading[u]=n(u))}finally{delete this._loading[u]}}}addSchema(t,r,n,i=this.opts.validateSchema){if(Array.isArray(t)){for(let o of t)this.addSchema(o,void 0,n,i);return this}let s;if(typeof t=="object"){let{schemaId:o}=this.opts;if(s=t[o],s!==void 0&&typeof s!="string")throw new Error(`schema ${o} must be string`)}return r=(0,Vc.normalizeId)(r||s),this._checkUnique(r),this.schemas[r]=this._addSchema(t,n,r,i,!0),this}addMetaSchema(t,r,n=this.opts.validateSchema){return this.addSchema(t,r,!0,n),this}validateSchema(t,r){if(typeof t=="boolean")return!0;let n;if(n=t.$schema,n!==void 0&&typeof n!="string")throw new Error("$schema must be a string");if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let i=this.validate(n,t);if(!i&&r){let s="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(s);else throw new Error(s)}return i}getSchema(t){let r;for(;typeof(r=B2.call(this,t))=="string";)t=r;if(r===void 0){let{schemaId:n}=this.opts,i=new Bc.SchemaEnv({schema:{},schemaId:n});if(r=Bc.resolveSchema.call(this,i,t),!r)return;this.refs[t]=r}return r.validate||this._compileSchemaEnv(r)}removeSchema(t){if(t instanceof RegExp)return this._removeAllSchemas(this.schemas,t),this._removeAllSchemas(this.refs,t),this;switch(typeof t){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let r=B2.call(this,t);return typeof r=="object"&&this._cache.delete(r.schema),delete this.schemas[t],delete this.refs[t],this}case"object":{let r=t;this._cache.delete(r);let n=t[this.opts.schemaId];return n&&(n=(0,Vc.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(t){for(let r of t)this.addKeyword(r);return this}addKeyword(t,r){let n;if(typeof t=="string")n=t,typeof r=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),r.keyword=n);else if(typeof t=="object"&&r===void 0){if(r=t,n=r.keyword,Array.isArray(n)&&!n.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(DQ.call(this,n,r),!r)return(0,Sb.eachItem)(n,s=>xb.call(this,s)),this;BQ.call(this,r);let i={...r,type:(0,rf.getJSONTypes)(r.type),schemaType:(0,rf.getJSONTypes)(r.schemaType)};return(0,Sb.eachItem)(n,i.type.length===0?s=>xb.call(this,s,i):s=>i.type.forEach(o=>xb.call(this,s,i,o))),this}getKeyword(t){let r=this.RULES.all[t];return typeof r=="object"?r.definition:!!r}removeKeyword(t){let{RULES:r}=this;delete r.keywords[t],delete r.all[t];for(let n of r.rules){let i=n.rules.findIndex(s=>s.keyword===t);i>=0&&n.rules.splice(i,1)}return this}addFormat(t,r){return typeof r=="string"&&(r=new RegExp(r)),this.formats[t]=r,this}errorsText(t=this.errors,{separator:r=", ",dataVar:n="data"}={}){return!t||t.length===0?"No errors":t.map(i=>`${n}${i.instancePath} ${i.message}`).reduce((i,s)=>i+r+s)}$dataMetaSchema(t,r){let n=this.RULES.all;t=JSON.parse(JSON.stringify(t));for(let i of r){let s=i.split("/").slice(1),o=t;for(let a of s)o=o[a];for(let a in n){let c=n[a];if(typeof c!="object")continue;let{$data:l}=c.definition,u=o[a];l&&u&&(o[a]=z2(u))}}return t}_removeAllSchemas(t,r){for(let n in t){let i=t[n];(!r||r.test(n))&&(typeof i=="string"?delete t[n]:i&&!i.meta&&(this._cache.delete(i.schema),delete t[n]))}}_addSchema(t,r,n,i=this.opts.validateSchema,s=this.opts.addUsedSchema){let o,{schemaId:a}=this.opts;if(typeof t=="object")o=t[a];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof t!="boolean")throw new Error("schema must be object or boolean")}let c=this._cache.get(t);if(c!==void 0)return c;n=(0,Vc.normalizeId)(o||n);let l=Vc.getSchemaRefs.call(this,t,n);return c=new Bc.SchemaEnv({schema:t,schemaId:a,meta:r,baseId:n,localRefs:l}),this._cache.set(c.schema,c),s&&!n.startsWith("#")&&(n&&this._checkUnique(n),this.refs[n]=c),i&&this.validateSchema(t,!0),c}_checkUnique(t){if(this.schemas[t]||this.refs[t])throw new Error(`schema with key or id "${t}" already exists`)}_compileSchemaEnv(t){if(t.meta?this._compileMetaSchema(t):Bc.compileSchema.call(this,t),!t.validate)throw new Error("ajv implementation error");return t.validate}_compileMetaSchema(t){let r=this.opts;this.opts=this._metaOpts;try{Bc.compileSchema.call(this,t)}finally{this.opts=r}}};Uc.ValidationError=_Q.default;Uc.MissingRefError=V2.default;yt.default=Uc;function F2(e,t,r,n="error"){for(let i in e){let s=i;s in t&&this.logger[n](`${r}: option ${i}. ${e[s]}`)}}function B2(e){return e=(0,Vc.normalizeId)(e),this.schemas[e]||this.refs[e]}function kQ(){let e=this.opts.schemas;if(e)if(Array.isArray(e))this.addSchema(e);else for(let t in e)this.addSchema(e[t],t)}function NQ(){for(let e in this.opts.formats){let t=this.opts.formats[e];t&&this.addFormat(e,t)}}function IQ(e){if(Array.isArray(e)){this.addVocabulary(e);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let t in e){let r=e[t];r.keyword||(r.keyword=t),this.addKeyword(r)}}function qQ(){let e={...this.opts};for(let t of EQ)delete e[t];return e}var jQ={log(){},warn(){},error(){}};function MQ(e){if(e===!1)return jQ;if(e===void 0)return console;if(e.log&&e.warn&&e.error)return e;throw new Error("logger must implement log, warn and error methods")}var LQ=/^[a-z_$][a-z0-9_$:-]*$/i;function DQ(e,t){let{RULES:r}=this;if((0,Sb.eachItem)(e,n=>{if(r.keywords[n])throw new Error(`Keyword ${n} is already defined`);if(!LQ.test(n))throw new Error(`Keyword ${n} has invalid name`)}),!!t&&t.$data&&!("code"in t||"validate"in t))throw new Error('$data keyword must have "code" or "validate" function')}function xb(e,t,r){var n;let i=t==null?void 0:t.post;if(r&&i)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:s}=this,o=i?s.post:s.rules.find(({type:c})=>c===r);if(o||(o={type:r,rules:[]},s.rules.push(o)),s.keywords[e]=!0,!t)return;let a={keyword:e,definition:{...t,type:(0,rf.getJSONTypes)(t.type),schemaType:(0,rf.getJSONTypes)(t.schemaType)}};t.before?FQ.call(this,o,a,t.before):o.rules.push(a),s.all[e]=a,(n=t.implements)===null||n===void 0||n.forEach(c=>this.addKeyword(c))}function FQ(e,t,r){let n=e.rules.findIndex(i=>i.keyword===r);n>=0?e.rules.splice(n,0,t):(e.rules.push(t),this.logger.warn(`rule ${r} is not defined`))}function BQ(e){let{metaSchema:t}=e;t!==void 0&&(e.$data&&this.opts.$data&&(t=z2(t)),e.validateSchema=this.compile(t,!0))}var VQ={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function z2(e){return{anyOf:[e,VQ]}}});var K2=v(_b=>{"use strict";Object.defineProperty(_b,"__esModule",{value:!0});var UQ={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};_b.default=UQ});var J2=v(vs=>{"use strict";Object.defineProperty(vs,"__esModule",{value:!0});vs.callRef=vs.getValidate=void 0;var zQ=Dc(),W2=xr(),er=ae(),Do=$n(),Y2=Qp(),nf=Se(),HQ={keyword:"$ref",schemaType:"string",code(e){let{gen:t,schema:r,it:n}=e,{baseId:i,schemaEnv:s,validateName:o,opts:a,self:c}=n,{root:l}=s;if((r==="#"||r==="#/")&&i===l.baseId)return p();let u=Y2.resolveRef.call(c,l,i,r);if(u===void 0)throw new zQ.default(n.opts.uriResolver,i,r);if(u instanceof Y2.SchemaEnv)return d(u);return m(u);function p(){if(s===l)return sf(e,o,s,s.$async);let f=t.scopeValue("root",{ref:l});return sf(e,(0,er._)`${f}.validate`,l,l.$async)}function d(f){let h=G2(e,f);sf(e,h,f,f.$async)}function m(f){let h=t.scopeValue("schema",a.code.source===!0?{ref:f,code:(0,er.stringify)(f)}:{ref:f}),y=t.name("valid"),g=e.subschema({schema:f,dataTypes:[],schemaPath:er.nil,topSchemaRef:h,errSchemaPath:r},y);e.mergeEvaluated(g),e.ok(y)}}};function G2(e,t){let{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):(0,er._)`${r.scopeValue("wrapper",{ref:t})}.validate`}vs.getValidate=G2;function sf(e,t,r,n){let{gen:i,it:s}=e,{allErrors:o,schemaEnv:a,opts:c}=s,l=c.passContext?Do.default.this:er.nil;n?u():p();function u(){if(!a.$async)throw new Error("async schema referenced by sync schema");let f=i.let("valid");i.try(()=>{i.code((0,er._)`await ${(0,W2.callValidateCode)(e,t,l)}`),m(t),o||i.assign(f,!0)},h=>{i.if((0,er._)`!(${h} instanceof ${s.ValidationError})`,()=>i.throw(h)),d(h),o||i.assign(f,!1)}),e.ok(f)}function p(){e.result((0,W2.callValidateCode)(e,t,l),()=>m(t),()=>d(t))}function d(f){let h=(0,er._)`${f}.errors`;i.assign(Do.default.vErrors,(0,er._)`${Do.default.vErrors} === null ? ${h} : ${Do.default.vErrors}.concat(${h})`),i.assign(Do.default.errors,(0,er._)`${Do.default.vErrors}.length`)}function m(f){var h;if(!s.opts.unevaluated)return;let y=(h=r==null?void 0:r.validate)===null||h===void 0?void 0:h.evaluated;if(s.props!==!0)if(y&&!y.dynamicProps)y.props!==void 0&&(s.props=nf.mergeEvaluated.props(i,y.props,s.props));else{let g=i.var("props",(0,er._)`${f}.evaluated.props`);s.props=nf.mergeEvaluated.props(i,g,s.props,er.Name)}if(s.items!==!0)if(y&&!y.dynamicItems)y.items!==void 0&&(s.items=nf.mergeEvaluated.items(i,y.items,s.items));else{let g=i.var("items",(0,er._)`${f}.evaluated.items`);s.items=nf.mergeEvaluated.items(i,g,s.items,er.Name)}}}vs.callRef=sf;vs.default=HQ});var X2=v(Ob=>{"use strict";Object.defineProperty(Ob,"__esModule",{value:!0});var KQ=K2(),WQ=J2(),YQ=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",KQ.default,WQ.default];Ob.default=YQ});var Q2=v(Pb=>{"use strict";Object.defineProperty(Pb,"__esModule",{value:!0});var of=ae(),gi=of.operators,af={maximum:{okStr:"<=",ok:gi.LTE,fail:gi.GT},minimum:{okStr:">=",ok:gi.GTE,fail:gi.LT},exclusiveMaximum:{okStr:"<",ok:gi.LT,fail:gi.GTE},exclusiveMinimum:{okStr:">",ok:gi.GT,fail:gi.LTE}},GQ={message:({keyword:e,schemaCode:t})=>(0,of.str)`must be ${af[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,of._)`{comparison: ${af[e].okStr}, limit: ${t}}`},JQ={keyword:Object.keys(af),type:"number",schemaType:"number",$data:!0,error:GQ,code(e){let{keyword:t,data:r,schemaCode:n}=e;e.fail$data((0,of._)`${r} ${af[t].fail} ${n} || isNaN(${r})`)}};Pb.default=JQ});var Z2=v($b=>{"use strict";Object.defineProperty($b,"__esModule",{value:!0});var zc=ae(),XQ={message:({schemaCode:e})=>(0,zc.str)`must be multiple of ${e}`,params:({schemaCode:e})=>(0,zc._)`{multipleOf: ${e}}`},QQ={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:XQ,code(e){let{gen:t,data:r,schemaCode:n,it:i}=e,s=i.opts.multipleOfPrecision,o=t.let("res"),a=s?(0,zc._)`Math.abs(Math.round(${o}) - ${o}) > 1e-${s}`:(0,zc._)`${o} !== parseInt(${o})`;e.fail$data((0,zc._)`(${n} === 0 || (${o} = ${r}/${n}, ${a}))`)}};$b.default=QQ});var tC=v(Eb=>{"use strict";Object.defineProperty(Eb,"__esModule",{value:!0});function eC(e){let t=e.length,r=0,n=0,i;for(;n<t;)r++,i=e.charCodeAt(n++),i>=55296&&i<=56319&&n<t&&(i=e.charCodeAt(n),(i&64512)===56320&&n++);return r}Eb.default=eC;eC.code='require("ajv/dist/runtime/ucs2length").default'});var rC=v(Ab=>{"use strict";Object.defineProperty(Ab,"__esModule",{value:!0});var ws=ae(),ZQ=Se(),eZ=tC(),tZ={message({keyword:e,schemaCode:t}){let r=e==="maxLength"?"more":"fewer";return(0,ws.str)`must NOT have ${r} than ${t} characters`},params:({schemaCode:e})=>(0,ws._)`{limit: ${e}}`},rZ={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:tZ,code(e){let{keyword:t,data:r,schemaCode:n,it:i}=e,s=t==="maxLength"?ws.operators.GT:ws.operators.LT,o=i.opts.unicode===!1?(0,ws._)`${r}.length`:(0,ws._)`${(0,ZQ.useFunc)(e.gen,eZ.default)}(${r})`;e.fail$data((0,ws._)`${o} ${s} ${n}`)}};Ab.default=rZ});var nC=v(Tb=>{"use strict";Object.defineProperty(Tb,"__esModule",{value:!0});var nZ=xr(),cf=ae(),iZ={message:({schemaCode:e})=>(0,cf.str)`must match pattern "${e}"`,params:({schemaCode:e})=>(0,cf._)`{pattern: ${e}}`},sZ={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:iZ,code(e){let{data:t,$data:r,schema:n,schemaCode:i,it:s}=e,o=s.opts.unicodeRegExp?"u":"",a=r?(0,cf._)`(new RegExp(${i}, ${o}))`:(0,nZ.usePattern)(e,n);e.fail$data((0,cf._)`!${a}.test(${t})`)}};Tb.default=sZ});var iC=v(Rb=>{"use strict";Object.defineProperty(Rb,"__esModule",{value:!0});var Hc=ae(),oZ={message({keyword:e,schemaCode:t}){let r=e==="maxProperties"?"more":"fewer";return(0,Hc.str)`must NOT have ${r} than ${t} properties`},params:({schemaCode:e})=>(0,Hc._)`{limit: ${e}}`},aZ={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:oZ,code(e){let{keyword:t,data:r,schemaCode:n}=e,i=t==="maxProperties"?Hc.operators.GT:Hc.operators.LT;e.fail$data((0,Hc._)`Object.keys(${r}).length ${i} ${n}`)}};Rb.default=aZ});var sC=v(Cb=>{"use strict";Object.defineProperty(Cb,"__esModule",{value:!0});var Kc=xr(),Wc=ae(),cZ=Se(),lZ={message:({params:{missingProperty:e}})=>(0,Wc.str)`must have required property '${e}'`,params:({params:{missingProperty:e}})=>(0,Wc._)`{missingProperty: ${e}}`},uZ={keyword:"required",type:"object",schemaType:"array",$data:!0,error:lZ,code(e){let{gen:t,schema:r,schemaCode:n,data:i,$data:s,it:o}=e,{opts:a}=o;if(!s&&r.length===0)return;let c=r.length>=a.loopRequired;if(o.allErrors?l():u(),a.strictRequired){let m=e.parentSchema.properties,{definedProperties:f}=e.it;for(let h of r)if((m==null?void 0:m[h])===void 0&&!f.has(h)){let y=o.schemaEnv.baseId+o.errSchemaPath,g=`required property "${h}" is not defined at "${y}" (strictRequired)`;(0,cZ.checkStrictMode)(o,g,o.opts.strictRequired)}}function l(){if(c||s)e.block$data(Wc.nil,p);else for(let m of r)(0,Kc.checkReportMissingProp)(e,m)}function u(){let m=t.let("missing");if(c||s){let f=t.let("valid",!0);e.block$data(f,()=>d(m,f)),e.ok(f)}else t.if((0,Kc.checkMissingProp)(e,r,m)),(0,Kc.reportMissingProp)(e,m),t.else()}function p(){t.forOf("prop",n,m=>{e.setParams({missingProperty:m}),t.if((0,Kc.noPropertyInData)(t,i,m,a.ownProperties),()=>e.error())})}function d(m,f){e.setParams({missingProperty:m}),t.forOf(m,n,()=>{t.assign(f,(0,Kc.propertyInData)(t,i,m,a.ownProperties)),t.if((0,Wc.not)(f),()=>{e.error(),t.break()})},Wc.nil)}}};Cb.default=uZ});var oC=v(kb=>{"use strict";Object.defineProperty(kb,"__esModule",{value:!0});var Yc=ae(),pZ={message({keyword:e,schemaCode:t}){let r=e==="maxItems"?"more":"fewer";return(0,Yc.str)`must NOT have ${r} than ${t} items`},params:({schemaCode:e})=>(0,Yc._)`{limit: ${e}}`},fZ={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:pZ,code(e){let{keyword:t,data:r,schemaCode:n}=e,i=t==="maxItems"?Yc.operators.GT:Yc.operators.LT;e.fail$data((0,Yc._)`${r}.length ${i} ${n}`)}};kb.default=fZ});var lf=v(Nb=>{"use strict";Object.defineProperty(Nb,"__esModule",{value:!0});var aC=Sa();aC.code='require("ajv/dist/runtime/equal").default';Nb.default=aC});var cC=v(qb=>{"use strict";Object.defineProperty(qb,"__esModule",{value:!0});var Ib=Ic(),gt=ae(),dZ=Se(),mZ=lf(),hZ={message:({params:{i:e,j:t}})=>(0,gt.str)`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>(0,gt._)`{i: ${e}, j: ${t}}`},yZ={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:hZ,code(e){let{gen:t,data:r,$data:n,schema:i,parentSchema:s,schemaCode:o,it:a}=e;if(!n&&!i)return;let c=t.let("valid"),l=s.items?(0,Ib.getSchemaTypes)(s.items):[];e.block$data(c,u,(0,gt._)`${o} === false`),e.ok(c);function u(){let f=t.let("i",(0,gt._)`${r}.length`),h=t.let("j");e.setParams({i:f,j:h}),t.assign(c,!0),t.if((0,gt._)`${f} > 1`,()=>(p()?d:m)(f,h))}function p(){return l.length>0&&!l.some(f=>f==="object"||f==="array")}function d(f,h){let y=t.name("item"),g=(0,Ib.checkDataTypes)(l,y,a.opts.strictNumbers,Ib.DataType.Wrong),b=t.const("indices",(0,gt._)`{}`);t.for((0,gt._)`;${f}--;`,()=>{t.let(y,(0,gt._)`${r}[${f}]`),t.if(g,(0,gt._)`continue`),l.length>1&&t.if((0,gt._)`typeof ${y} == "string"`,(0,gt._)`${y} += "_"`),t.if((0,gt._)`typeof ${b}[${y}] == "number"`,()=>{t.assign(h,(0,gt._)`${b}[${y}]`),e.error(),t.assign(c,!1).break()}).code((0,gt._)`${b}[${y}] = ${f}`)})}function m(f,h){let y=(0,dZ.useFunc)(t,mZ.default),g=t.name("outer");t.label(g).for((0,gt._)`;${f}--;`,()=>t.for((0,gt._)`${h} = ${f}; ${h}--;`,()=>t.if((0,gt._)`${y}(${r}[${f}], ${r}[${h}])`,()=>{e.error(),t.assign(c,!1).break(g)})))}}};qb.default=yZ});var lC=v(Mb=>{"use strict";Object.defineProperty(Mb,"__esModule",{value:!0});var jb=ae(),gZ=Se(),bZ=lf(),vZ={message:"must be equal to constant",params:({schemaCode:e})=>(0,jb._)`{allowedValue: ${e}}`},wZ={keyword:"const",$data:!0,error:vZ,code(e){let{gen:t,data:r,$data:n,schemaCode:i,schema:s}=e;n||s&&typeof s=="object"?e.fail$data((0,jb._)`!${(0,gZ.useFunc)(t,bZ.default)}(${r}, ${i})`):e.fail((0,jb._)`${s} !== ${r}`)}};Mb.default=wZ});var uC=v(Lb=>{"use strict";Object.defineProperty(Lb,"__esModule",{value:!0});var Gc=ae(),xZ=Se(),SZ=lf(),_Z={message:"must be equal to one of the allowed values",params:({schemaCode:e})=>(0,Gc._)`{allowedValues: ${e}}`},OZ={keyword:"enum",schemaType:"array",$data:!0,error:_Z,code(e){let{gen:t,data:r,$data:n,schema:i,schemaCode:s,it:o}=e;if(!n&&i.length===0)throw new Error("enum must have non-empty array");let a=i.length>=o.opts.loopEnum,c,l=()=>c!=null?c:c=(0,xZ.useFunc)(t,SZ.default),u;if(a||n)u=t.let("valid"),e.block$data(u,p);else{if(!Array.isArray(i))throw new Error("ajv implementation error");let m=t.const("vSchema",s);u=(0,Gc.or)(...i.map((f,h)=>d(m,h)))}e.pass(u);function p(){t.assign(u,!1),t.forOf("v",s,m=>t.if((0,Gc._)`${l()}(${r}, ${m})`,()=>t.assign(u,!0).break()))}function d(m,f){let h=i[f];return typeof h=="object"&&h!==null?(0,Gc._)`${l()}(${r}, ${m}[${f}])`:(0,Gc._)`${r} === ${h}`}}};Lb.default=OZ});var pC=v(Db=>{"use strict";Object.defineProperty(Db,"__esModule",{value:!0});var PZ=Q2(),$Z=Z2(),EZ=rC(),AZ=nC(),TZ=iC(),RZ=sC(),CZ=oC(),kZ=cC(),NZ=lC(),IZ=uC(),qZ=[PZ.default,$Z.default,EZ.default,AZ.default,TZ.default,RZ.default,CZ.default,kZ.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},NZ.default,IZ.default];Db.default=qZ});var Bb=v(Jc=>{"use strict";Object.defineProperty(Jc,"__esModule",{value:!0});Jc.validateAdditionalItems=void 0;var xs=ae(),Fb=Se(),jZ={message:({params:{len:e}})=>(0,xs.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,xs._)`{limit: ${e}}`},MZ={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:jZ,code(e){let{parentSchema:t,it:r}=e,{items:n}=t;if(!Array.isArray(n)){(0,Fb.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}fC(e,n)}};function fC(e,t){let{gen:r,schema:n,data:i,keyword:s,it:o}=e;o.items=!0;let a=r.const("len",(0,xs._)`${i}.length`);if(n===!1)e.setParams({len:t.length}),e.pass((0,xs._)`${a} <= ${t.length}`);else if(typeof n=="object"&&!(0,Fb.alwaysValidSchema)(o,n)){let l=r.var("valid",(0,xs._)`${a} <= ${t.length}`);r.if((0,xs.not)(l),()=>c(l)),e.ok(l)}function c(l){r.forRange("i",t.length,a,u=>{e.subschema({keyword:s,dataProp:u,dataPropType:Fb.Type.Num},l),o.allErrors||r.if((0,xs.not)(l),()=>r.break())})}}Jc.validateAdditionalItems=fC;Jc.default=MZ});var Vb=v(Xc=>{"use strict";Object.defineProperty(Xc,"__esModule",{value:!0});Xc.validateTuple=void 0;var dC=ae(),uf=Se(),LZ=xr(),DZ={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){let{schema:t,it:r}=e;if(Array.isArray(t))return mC(e,"additionalItems",t);r.items=!0,!(0,uf.alwaysValidSchema)(r,t)&&e.ok((0,LZ.validateArray)(e))}};function mC(e,t,r=e.schema){let{gen:n,parentSchema:i,data:s,keyword:o,it:a}=e;u(i),a.opts.unevaluated&&r.length&&a.items!==!0&&(a.items=uf.mergeEvaluated.items(n,r.length,a.items));let c=n.name("valid"),l=n.const("len",(0,dC._)`${s}.length`);r.forEach((p,d)=>{(0,uf.alwaysValidSchema)(a,p)||(n.if((0,dC._)`${l} > ${d}`,()=>e.subschema({keyword:o,schemaProp:d,dataProp:d},c)),e.ok(c))});function u(p){let{opts:d,errSchemaPath:m}=a,f=r.length,h=f===p.minItems&&(f===p.maxItems||p[t]===!1);if(d.strictTuples&&!h){let y=`"${o}" is ${f}-tuple, but minItems or maxItems/${t} are not specified or different at path "${m}"`;(0,uf.checkStrictMode)(a,y,d.strictTuples)}}}Xc.validateTuple=mC;Xc.default=DZ});var hC=v(Ub=>{"use strict";Object.defineProperty(Ub,"__esModule",{value:!0});var FZ=Vb(),BZ={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,FZ.validateTuple)(e,"items")};Ub.default=BZ});var gC=v(zb=>{"use strict";Object.defineProperty(zb,"__esModule",{value:!0});var yC=ae(),VZ=Se(),UZ=xr(),zZ=Bb(),HZ={message:({params:{len:e}})=>(0,yC.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,yC._)`{limit: ${e}}`},KZ={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:HZ,code(e){let{schema:t,parentSchema:r,it:n}=e,{prefixItems:i}=r;n.items=!0,!(0,VZ.alwaysValidSchema)(n,t)&&(i?(0,zZ.validateAdditionalItems)(e,i):e.ok((0,UZ.validateArray)(e)))}};zb.default=KZ});var bC=v(Hb=>{"use strict";Object.defineProperty(Hb,"__esModule",{value:!0});var _r=ae(),pf=Se(),WZ={message:({params:{min:e,max:t}})=>t===void 0?(0,_r.str)`must contain at least ${e} valid item(s)`:(0,_r.str)`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>t===void 0?(0,_r._)`{minContains: ${e}}`:(0,_r._)`{minContains: ${e}, maxContains: ${t}}`},YZ={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:WZ,code(e){let{gen:t,schema:r,parentSchema:n,data:i,it:s}=e,o,a,{minContains:c,maxContains:l}=n;s.opts.next?(o=c===void 0?1:c,a=l):o=1;let u=t.const("len",(0,_r._)`${i}.length`);if(e.setParams({min:o,max:a}),a===void 0&&o===0){(0,pf.checkStrictMode)(s,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(a!==void 0&&o>a){(0,pf.checkStrictMode)(s,'"minContains" > "maxContains" is always invalid'),e.fail();return}if((0,pf.alwaysValidSchema)(s,r)){let h=(0,_r._)`${u} >= ${o}`;a!==void 0&&(h=(0,_r._)`${h} && ${u} <= ${a}`),e.pass(h);return}s.items=!0;let p=t.name("valid");a===void 0&&o===1?m(p,()=>t.if(p,()=>t.break())):o===0?(t.let(p,!0),a!==void 0&&t.if((0,_r._)`${i}.length > 0`,d)):(t.let(p,!1),d()),e.result(p,()=>e.reset());function d(){let h=t.name("_valid"),y=t.let("count",0);m(h,()=>t.if(h,()=>f(y)))}function m(h,y){t.forRange("i",0,u,g=>{e.subschema({keyword:"contains",dataProp:g,dataPropType:pf.Type.Num,compositeRule:!0},h),y()})}function f(h){t.code((0,_r._)`${h}++`),a===void 0?t.if((0,_r._)`${h} >= ${o}`,()=>t.assign(p,!0).break()):(t.if((0,_r._)`${h} > ${a}`,()=>t.assign(p,!1).break()),o===1?t.assign(p,!0):t.if((0,_r._)`${h} >= ${o}`,()=>t.assign(p,!0)))}}};Hb.default=YZ});var xC=v(tn=>{"use strict";Object.defineProperty(tn,"__esModule",{value:!0});tn.validateSchemaDeps=tn.validatePropertyDeps=tn.error=void 0;var Kb=ae(),GZ=Se(),Qc=xr();tn.error={message:({params:{property:e,depsCount:t,deps:r}})=>{let n=t===1?"property":"properties";return(0,Kb.str)`must have ${n} ${r} when property ${e} is present`},params:({params:{property:e,depsCount:t,deps:r,missingProperty:n}})=>(0,Kb._)`{property: ${e},
204
204
  missingProperty: ${n},
205
205
  depsCount: ${t},
206
- deps: ${r}}`};var XZ={keyword:"dependencies",type:"object",schemaType:"object",error:tn.error,code(e){let[t,r]=QZ(e);xC(e,t),SC(e,r)}};function QZ({schema:e}){let t={},r={};for(let n in e){if(n==="__proto__")continue;let i=Array.isArray(e[n])?t:r;i[n]=e[n]}return[t,r]}function xC(e,t=e.schema){let{gen:r,data:n,it:i}=e;if(Object.keys(t).length===0)return;let s=r.let("missing");for(let o in t){let a=t[o];if(a.length===0)continue;let c=(0,Qc.propertyInData)(r,n,o,i.opts.ownProperties);e.setParams({property:o,depsCount:a.length,deps:a.join(", ")}),i.allErrors?r.if(c,()=>{for(let l of a)(0,Qc.checkReportMissingProp)(e,l)}):(r.if((0,Kb._)`${c} && (${(0,Qc.checkMissingProp)(e,a,s)})`),(0,Qc.reportMissingProp)(e,s),r.else())}}tn.validatePropertyDeps=xC;function SC(e,t=e.schema){let{gen:r,data:n,keyword:i,it:s}=e,o=r.name("valid");for(let a in t)(0,JZ.alwaysValidSchema)(s,t[a])||(r.if((0,Qc.propertyInData)(r,n,a,s.opts.ownProperties),()=>{let c=e.subschema({keyword:i,schemaProp:a},o);e.mergeValidEvaluated(c,o)},()=>r.var(o,!0)),e.ok(o))}tn.validateSchemaDeps=SC;tn.default=XZ});var PC=v(Wb=>{"use strict";Object.defineProperty(Wb,"__esModule",{value:!0});var OC=ae(),ZZ=Se(),eee={message:"property name must be valid",params:({params:e})=>(0,OC._)`{propertyName: ${e.propertyName}}`},tee={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:eee,code(e){let{gen:t,schema:r,data:n,it:i}=e;if((0,ZZ.alwaysValidSchema)(i,r))return;let s=t.name("valid");t.forIn("key",n,o=>{e.setParams({propertyName:o}),e.subschema({keyword:"propertyNames",data:o,dataTypes:["string"],propertyName:o,compositeRule:!0},s),t.if((0,OC.not)(s),()=>{e.error(!0),i.allErrors||t.break()})}),e.ok(s)}};Wb.default=tee});var Gb=v(Yb=>{"use strict";Object.defineProperty(Yb,"__esModule",{value:!0});var ff=xr(),qr=ae(),ree=$n(),df=Se(),nee={message:"must NOT have additional properties",params:({params:e})=>(0,qr._)`{additionalProperty: ${e.additionalProperty}}`},iee={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:nee,code(e){let{gen:t,schema:r,parentSchema:n,data:i,errsCount:s,it:o}=e;if(!s)throw new Error("ajv implementation error");let{allErrors:a,opts:c}=o;if(o.props=!0,c.removeAdditional!=="all"&&(0,df.alwaysValidSchema)(o,r))return;let l=(0,ff.allSchemaProperties)(n.properties),u=(0,ff.allSchemaProperties)(n.patternProperties);p(),e.ok((0,qr._)`${s} === ${ree.default.errors}`);function p(){t.forIn("key",i,y=>{!l.length&&!u.length?f(y):t.if(d(y),()=>f(y))})}function d(y){let g;if(l.length>8){let b=(0,df.schemaRefOrVal)(o,n.properties,"properties");g=(0,ff.isOwnProperty)(t,b,y)}else l.length?g=(0,qr.or)(...l.map(b=>(0,qr._)`${y} === ${b}`)):g=qr.nil;return u.length&&(g=(0,qr.or)(g,...u.map(b=>(0,qr._)`${(0,ff.usePattern)(e,b)}.test(${y})`))),(0,qr.not)(g)}function m(y){t.code((0,qr._)`delete ${i}[${y}]`)}function f(y){if(c.removeAdditional==="all"||c.removeAdditional&&r===!1){m(y);return}if(r===!1){e.setParams({additionalProperty:y}),e.error(),a||t.break();return}if(typeof r=="object"&&!(0,df.alwaysValidSchema)(o,r)){let g=t.name("valid");c.removeAdditional==="failing"?(h(y,g,!1),t.if((0,qr.not)(g),()=>{e.reset(),m(y)})):(h(y,g),a||t.if((0,qr.not)(g),()=>t.break()))}}function h(y,g,b){let w={keyword:"additionalProperties",dataProp:y,dataPropType:df.Type.Str};b===!1&&Object.assign(w,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(w,g)}}};Yb.default=iee});var AC=v(Xb=>{"use strict";Object.defineProperty(Xb,"__esModule",{value:!0});var see=Lc(),$C=xr(),Jb=Se(),EC=Gb(),oee={keyword:"properties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,parentSchema:n,data:i,it:s}=e;s.opts.removeAdditional==="all"&&n.additionalProperties===void 0&&EC.default.code(new see.KeywordCxt(s,EC.default,"additionalProperties"));let o=(0,$C.allSchemaProperties)(r);for(let p of o)s.definedProperties.add(p);s.opts.unevaluated&&o.length&&s.props!==!0&&(s.props=Jb.mergeEvaluated.props(t,(0,Jb.toHash)(o),s.props));let a=o.filter(p=>!(0,Jb.alwaysValidSchema)(s,r[p]));if(a.length===0)return;let c=t.name("valid");for(let p of a)l(p)?u(p):(t.if((0,$C.propertyInData)(t,i,p,s.opts.ownProperties)),u(p),s.allErrors||t.else().var(c,!0),t.endIf()),e.it.definedProperties.add(p),e.ok(c);function l(p){return s.opts.useDefaults&&!s.compositeRule&&r[p].default!==void 0}function u(p){e.subschema({keyword:"properties",schemaProp:p,dataProp:p},c)}}};Xb.default=oee});var kC=v(Qb=>{"use strict";Object.defineProperty(Qb,"__esModule",{value:!0});var TC=xr(),mf=ae(),RC=Se(),CC=Se(),aee={keyword:"patternProperties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,data:n,parentSchema:i,it:s}=e,{opts:o}=s,a=(0,TC.allSchemaProperties)(r),c=a.filter(h=>(0,RC.alwaysValidSchema)(s,r[h]));if(a.length===0||c.length===a.length&&(!s.opts.unevaluated||s.props===!0))return;let l=o.strictSchema&&!o.allowMatchingProperties&&i.properties,u=t.name("valid");s.props!==!0&&!(s.props instanceof mf.Name)&&(s.props=(0,CC.evaluatedPropsToName)(t,s.props));let{props:p}=s;d();function d(){for(let h of a)l&&m(h),s.allErrors?f(h):(t.var(u,!0),f(h),t.if(u))}function m(h){for(let y in l)new RegExp(h).test(y)&&(0,RC.checkStrictMode)(s,`property ${y} matches pattern ${h} (use allowMatchingProperties)`)}function f(h){t.forIn("key",n,y=>{t.if((0,mf._)`${(0,TC.usePattern)(e,h)}.test(${y})`,()=>{let g=c.includes(h);g||e.subschema({keyword:"patternProperties",schemaProp:h,dataProp:y,dataPropType:CC.Type.Str},u),s.opts.unevaluated&&p!==!0?t.assign((0,mf._)`${p}[${y}]`,!0):!g&&!s.allErrors&&t.if((0,mf.not)(u),()=>t.break())})})}}};Qb.default=aee});var NC=v(Zb=>{"use strict";Object.defineProperty(Zb,"__esModule",{value:!0});var cee=Se(),lee={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){let{gen:t,schema:r,it:n}=e;if((0,cee.alwaysValidSchema)(n,r)){e.fail();return}let i=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},i),e.failResult(i,()=>e.reset(),()=>e.error())},error:{message:"must NOT be valid"}};Zb.default=lee});var IC=v(ev=>{"use strict";Object.defineProperty(ev,"__esModule",{value:!0});var uee=xr(),pee={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:uee.validateUnion,error:{message:"must match a schema in anyOf"}};ev.default=pee});var qC=v(tv=>{"use strict";Object.defineProperty(tv,"__esModule",{value:!0});var hf=ae(),fee=Se(),dee={message:"must match exactly one schema in oneOf",params:({params:e})=>(0,hf._)`{passingSchemas: ${e.passing}}`},mee={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:dee,code(e){let{gen:t,schema:r,parentSchema:n,it:i}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(i.opts.discriminator&&n.discriminator)return;let s=r,o=t.let("valid",!1),a=t.let("passing",null),c=t.name("_valid");e.setParams({passing:a}),t.block(l),e.result(o,()=>e.reset(),()=>e.error(!0));function l(){s.forEach((u,p)=>{let d;(0,fee.alwaysValidSchema)(i,u)?t.var(c,!0):d=e.subschema({keyword:"oneOf",schemaProp:p,compositeRule:!0},c),p>0&&t.if((0,hf._)`${c} && ${o}`).assign(o,!1).assign(a,(0,hf._)`[${a}, ${p}]`).else(),t.if(c,()=>{t.assign(o,!0),t.assign(a,p),d&&e.mergeEvaluated(d,hf.Name)})})}}};tv.default=mee});var jC=v(rv=>{"use strict";Object.defineProperty(rv,"__esModule",{value:!0});var hee=Se(),yee={keyword:"allOf",schemaType:"array",code(e){let{gen:t,schema:r,it:n}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");let i=t.name("valid");r.forEach((s,o)=>{if((0,hee.alwaysValidSchema)(n,s))return;let a=e.subschema({keyword:"allOf",schemaProp:o},i);e.ok(i),e.mergeEvaluated(a)})}};rv.default=yee});var DC=v(nv=>{"use strict";Object.defineProperty(nv,"__esModule",{value:!0});var yf=ae(),LC=Se(),gee={message:({params:e})=>(0,yf.str)`must match "${e.ifClause}" schema`,params:({params:e})=>(0,yf._)`{failingKeyword: ${e.ifClause}}`},bee={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:gee,code(e){let{gen:t,parentSchema:r,it:n}=e;r.then===void 0&&r.else===void 0&&(0,LC.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let i=MC(n,"then"),s=MC(n,"else");if(!i&&!s)return;let o=t.let("valid",!0),a=t.name("_valid");if(c(),e.reset(),i&&s){let u=t.let("ifClause");e.setParams({ifClause:u}),t.if(a,l("then",u),l("else",u))}else i?t.if(a,l("then")):t.if((0,yf.not)(a),l("else"));e.pass(o,()=>e.error(!0));function c(){let u=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},a);e.mergeEvaluated(u)}function l(u,p){return()=>{let d=e.subschema({keyword:u},a);t.assign(o,a),e.mergeValidEvaluated(d,o),p?t.assign(p,(0,yf._)`${u}`):e.setParams({ifClause:u})}}}};function MC(e,t){let r=e.schema[t];return r!==void 0&&!(0,LC.alwaysValidSchema)(e,r)}nv.default=bee});var FC=v(iv=>{"use strict";Object.defineProperty(iv,"__esModule",{value:!0});var vee=Se(),wee={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){t.if===void 0&&(0,vee.checkStrictMode)(r,`"${e}" without "if" is ignored`)}};iv.default=wee});var BC=v(sv=>{"use strict";Object.defineProperty(sv,"__esModule",{value:!0});var xee=Bb(),See=gC(),_ee=Vb(),Oee=vC(),Pee=wC(),$ee=_C(),Eee=PC(),Aee=Gb(),Tee=AC(),Ree=kC(),Cee=NC(),kee=IC(),Nee=qC(),Iee=jC(),qee=DC(),jee=FC();function Mee(e=!1){let t=[Cee.default,kee.default,Nee.default,Iee.default,qee.default,jee.default,Eee.default,Aee.default,$ee.default,Tee.default,Ree.default];return e?t.push(See.default,Oee.default):t.push(xee.default,_ee.default),t.push(Pee.default),t}sv.default=Mee});var VC=v(ov=>{"use strict";Object.defineProperty(ov,"__esModule",{value:!0});var Ye=ae(),Lee={message:({schemaCode:e})=>(0,Ye.str)`must match format "${e}"`,params:({schemaCode:e})=>(0,Ye._)`{format: ${e}}`},Dee={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:Lee,code(e,t){let{gen:r,data:n,$data:i,schema:s,schemaCode:o,it:a}=e,{opts:c,errSchemaPath:l,schemaEnv:u,self:p}=a;if(!c.validateFormats)return;i?d():m();function d(){let f=r.scopeValue("formats",{ref:p.formats,code:c.code.formats}),h=r.const("fDef",(0,Ye._)`${f}[${o}]`),y=r.let("fType"),g=r.let("format");r.if((0,Ye._)`typeof ${h} == "object" && !(${h} instanceof RegExp)`,()=>r.assign(y,(0,Ye._)`${h}.type || "string"`).assign(g,(0,Ye._)`${h}.validate`),()=>r.assign(y,(0,Ye._)`"string"`).assign(g,h)),e.fail$data((0,Ye.or)(b(),w()));function b(){return c.strictSchema===!1?Ye.nil:(0,Ye._)`${o} && !${g}`}function w(){let x=u.$async?(0,Ye._)`(${h}.async ? await ${g}(${n}) : ${g}(${n}))`:(0,Ye._)`${g}(${n})`,S=(0,Ye._)`(typeof ${g} == "function" ? ${x} : ${g}.test(${n}))`;return(0,Ye._)`${g} && ${g} !== true && ${y} === ${t} && !${S}`}}function m(){let f=p.formats[s];if(!f){b();return}if(f===!0)return;let[h,y,g]=w(f);h===t&&e.pass(x());function b(){if(c.strictSchema===!1){p.logger.warn(S());return}throw new Error(S());function S(){return`unknown format "${s}" ignored in schema at path "${l}"`}}function w(S){let T=S instanceof RegExp?(0,Ye.regexpCode)(S):c.code.formats?(0,Ye._)`${c.code.formats}${(0,Ye.getProperty)(s)}`:void 0,_=r.scopeValue("formats",{key:s,ref:S,code:T});return typeof S=="object"&&!(S instanceof RegExp)?[S.type||"string",S.validate,(0,Ye._)`${_}.validate`]:["string",S,_]}function x(){if(typeof f=="object"&&!(f instanceof RegExp)&&f.async){if(!u.$async)throw new Error("async format in sync schema");return(0,Ye._)`await ${g}(${n})`}return typeof y=="function"?(0,Ye._)`${g}(${n})`:(0,Ye._)`${g}.test(${n})`}}}};ov.default=Dee});var UC=v(av=>{"use strict";Object.defineProperty(av,"__esModule",{value:!0});var Fee=VC(),Bee=[Fee.default];av.default=Bee});var zC=v(Fo=>{"use strict";Object.defineProperty(Fo,"__esModule",{value:!0});Fo.contentVocabulary=Fo.metadataVocabulary=void 0;Fo.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Fo.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var KC=v(cv=>{"use strict";Object.defineProperty(cv,"__esModule",{value:!0});var Vee=Z2(),Uee=dC(),zee=BC(),Hee=UC(),HC=zC(),Kee=[Vee.default,Uee.default,(0,zee.default)(),Hee.default,HC.metadataVocabulary,HC.contentVocabulary];cv.default=Kee});var YC=v(gf=>{"use strict";Object.defineProperty(gf,"__esModule",{value:!0});gf.DiscrError=void 0;var WC;(function(e){e.Tag="tag",e.Mapping="mapping"})(WC||(gf.DiscrError=WC={}))});var JC=v(uv=>{"use strict";Object.defineProperty(uv,"__esModule",{value:!0});var Bo=ae(),lv=YC(),GC=Qp(),Wee=Dc(),Yee=Se(),Gee={message:({params:{discrError:e,tagName:t}})=>e===lv.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:r}})=>(0,Bo._)`{error: ${e}, tag: ${r}, tagValue: ${t}}`},Jee={keyword:"discriminator",type:"object",schemaType:"object",error:Gee,code(e){let{gen:t,data:r,schema:n,parentSchema:i,it:s}=e,{oneOf:o}=i;if(!s.opts.discriminator)throw new Error("discriminator: requires discriminator option");let a=n.propertyName;if(typeof a!="string")throw new Error("discriminator: requires propertyName");if(n.mapping)throw new Error("discriminator: mapping is not supported");if(!o)throw new Error("discriminator: requires oneOf keyword");let c=t.let("valid",!1),l=t.const("tag",(0,Bo._)`${r}${(0,Bo.getProperty)(a)}`);t.if((0,Bo._)`typeof ${l} == "string"`,()=>u(),()=>e.error(!1,{discrError:lv.DiscrError.Tag,tag:l,tagName:a})),e.ok(c);function u(){let m=d();t.if(!1);for(let f in m)t.elseIf((0,Bo._)`${l} === ${f}`),t.assign(c,p(m[f]));t.else(),e.error(!1,{discrError:lv.DiscrError.Mapping,tag:l,tagName:a}),t.endIf()}function p(m){let f=t.name("valid"),h=e.subschema({keyword:"oneOf",schemaProp:m},f);return e.mergeEvaluated(h,Bo.Name),f}function d(){var m;let f={},h=g(i),y=!0;for(let x=0;x<o.length;x++){let S=o[x];if(S!=null&&S.$ref&&!(0,Yee.schemaHasRulesButRef)(S,s.self.RULES)){let _=S.$ref;if(S=GC.resolveRef.call(s.self,s.schemaEnv.root,s.baseId,_),S instanceof GC.SchemaEnv&&(S=S.schema),S===void 0)throw new Wee.default(s.opts.uriResolver,s.baseId,_)}let T=(m=S==null?void 0:S.properties)===null||m===void 0?void 0:m[a];if(typeof T!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${a}"`);y=y&&(h||g(S)),b(T,x)}if(!y)throw new Error(`discriminator: "${a}" must be required`);return f;function g({required:x}){return Array.isArray(x)&&x.includes(a)}function b(x,S){if(x.const)w(x.const,S);else if(x.enum)for(let T of x.enum)w(T,S);else throw new Error(`discriminator: "properties/${a}" must have "const" or "enum"`)}function w(x,S){if(typeof x!="string"||x in f)throw new Error(`discriminator: "${a}" values must be unique strings`);f[x]=S}}}};uv.default=Jee});var XC=v((G1e,Xee)=>{Xee.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}});var ZC=v((Ie,pv)=>{"use strict";Object.defineProperty(Ie,"__esModule",{value:!0});Ie.MissingRefError=Ie.ValidationError=Ie.CodeGen=Ie.Name=Ie.nil=Ie.stringify=Ie.str=Ie._=Ie.KeywordCxt=Ie.Ajv=void 0;var Qee=W2(),Zee=KC(),ete=JC(),QC=XC(),tte=["/properties"],bf="http://json-schema.org/draft-07/schema",Vo=class extends Qee.default{_addVocabularies(){super._addVocabularies(),Zee.default.forEach(t=>this.addVocabulary(t)),this.opts.discriminator&&this.addKeyword(ete.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let t=this.opts.$data?this.$dataMetaSchema(QC,tte):QC;this.addMetaSchema(t,bf,!1),this.refs["http://json-schema.org/schema"]=bf}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(bf)?bf:void 0)}};Ie.Ajv=Vo;pv.exports=Ie=Vo;pv.exports.Ajv=Vo;Object.defineProperty(Ie,"__esModule",{value:!0});Ie.default=Vo;var rte=Lc();Object.defineProperty(Ie,"KeywordCxt",{enumerable:!0,get:function(){return rte.KeywordCxt}});var Uo=ae();Object.defineProperty(Ie,"_",{enumerable:!0,get:function(){return Uo._}});Object.defineProperty(Ie,"str",{enumerable:!0,get:function(){return Uo.str}});Object.defineProperty(Ie,"stringify",{enumerable:!0,get:function(){return Uo.stringify}});Object.defineProperty(Ie,"nil",{enumerable:!0,get:function(){return Uo.nil}});Object.defineProperty(Ie,"Name",{enumerable:!0,get:function(){return Uo.Name}});Object.defineProperty(Ie,"CodeGen",{enumerable:!0,get:function(){return Uo.CodeGen}});var nte=Jp();Object.defineProperty(Ie,"ValidationError",{enumerable:!0,get:function(){return nte.default}});var ite=Dc();Object.defineProperty(Ie,"MissingRefError",{enumerable:!0,get:function(){return ite.default}})});var ek=v(zo=>{"use strict";Object.defineProperty(zo,"__esModule",{value:!0});zo.formatLimitDefinition=void 0;var ste=ZC(),jr=ae(),bi=jr.operators,vf={formatMaximum:{okStr:"<=",ok:bi.LTE,fail:bi.GT},formatMinimum:{okStr:">=",ok:bi.GTE,fail:bi.LT},formatExclusiveMaximum:{okStr:"<",ok:bi.LT,fail:bi.GTE},formatExclusiveMinimum:{okStr:">",ok:bi.GT,fail:bi.LTE}},ote={message:({keyword:e,schemaCode:t})=>jr.str`should be ${vf[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>jr._`{comparison: ${vf[e].okStr}, limit: ${t}}`};zo.formatLimitDefinition={keyword:Object.keys(vf),type:"string",schemaType:"string",$data:!0,error:ote,code(e){let{gen:t,data:r,schemaCode:n,keyword:i,it:s}=e,{opts:o,self:a}=s;if(!o.validateFormats)return;let c=new ste.KeywordCxt(s,a.RULES.all.format.definition,"format");c.$data?l():u();function l(){let d=t.scopeValue("formats",{ref:a.formats,code:o.code.formats}),m=t.const("fmt",jr._`${d}[${c.schemaCode}]`);e.fail$data(jr.or(jr._`typeof ${m} != "object"`,jr._`${m} instanceof RegExp`,jr._`typeof ${m}.compare != "function"`,p(m)))}function u(){let d=c.schema,m=a.formats[d];if(!m||m===!0)return;if(typeof m!="object"||m instanceof RegExp||typeof m.compare!="function")throw new Error(`"${i}": format "${d}" does not define "compare" function`);let f=t.scopeValue("formats",{key:d,ref:m,code:o.code.formats?jr._`${o.code.formats}${jr.getProperty(d)}`:void 0});e.fail$data(p(f))}function p(d){return jr._`${d}.compare(${r}, ${n}) ${vf[i].fail} 0`}},dependencies:["format"]};var ate=e=>(e.addKeyword(zo.formatLimitDefinition),e);zo.default=ate});var ik=v((Zc,nk)=>{"use strict";Object.defineProperty(Zc,"__esModule",{value:!0});var Ho=_R(),cte=ek(),fv=ae(),tk=new fv.Name("fullFormats"),lte=new fv.Name("fastFormats"),dv=(e,t={keywords:!0})=>{if(Array.isArray(t))return rk(e,t,Ho.fullFormats,tk),e;let[r,n]=t.mode==="fast"?[Ho.fastFormats,lte]:[Ho.fullFormats,tk],i=t.formats||Ho.formatNames;return rk(e,i,r,n),t.keywords&&cte.default(e),e};dv.get=(e,t="full")=>{let n=(t==="fast"?Ho.fastFormats:Ho.fullFormats)[e];if(!n)throw new Error(`Unknown format "${e}"`);return n};function rk(e,t,r,n){var i,s;(i=(s=e.opts.code).formats)!==null&&i!==void 0||(s.formats=fv._`require("ajv-formats/dist/formats").${n}`);for(let o of t)e.addFormat(o,r[o])}nk.exports=Zc=dv;Object.defineProperty(Zc,"__esModule",{value:!0});Zc.default=dv});var vte={};wf(vte,{createMockServer:()=>Sk});module.exports=Rk(vte);var Oi=Ue(require("fs"),1),Gf=Ue(require("path"),1);var zv=Ue(Iv(),1);var Go=e=>{if(typeof e!="string")throw new TypeError("invalid pattern");if(e.length>65536)throw new TypeError("pattern is too long")};var Lk={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},Jo=e=>e.replace(/[[\]\\-]/g,"\\$&"),Dk=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),qv=e=>e.join(""),jv=(e,t)=>{let r=t;if(e.charAt(r)!=="[")throw new Error("not in a brace expression");let n=[],i=[],s=r+1,o=!1,a=!1,c=!1,l=!1,u=r,p="";e:for(;s<e.length;){let h=e.charAt(s);if((h==="!"||h==="^")&&s===r+1){l=!0,s++;continue}if(h==="]"&&o&&!c){u=s+1;break}if(o=!0,h==="\\"&&!c){c=!0,s++;continue}if(h==="["&&!c){for(let[y,[g,b,w]]of Object.entries(Lk))if(e.startsWith(y,s)){if(p)return["$.",!1,e.length-r,!0];s+=y.length,w?i.push(g):n.push(g),a=a||b;continue e}}if(c=!1,p){h>p?n.push(Jo(p)+"-"+Jo(h)):h===p&&n.push(Jo(h)),p="",s++;continue}if(e.startsWith("-]",s+1)){n.push(Jo(h+"-")),s+=2;continue}if(e.startsWith("-",s+1)){p=h,s+=2;continue}n.push(Jo(h)),s++}if(u<s)return["",!1,0,!1];if(!n.length&&!i.length)return["$.",!1,e.length-r,!0];if(i.length===0&&n.length===1&&/^\\?.$/.test(n[0])&&!l){let h=n[0].length===2?n[0].slice(-1):n[0];return[Dk(h),!1,u-r,!1]}let d="["+(l?"^":"")+qv(n)+"]",m="["+(l?"":"^")+qv(i)+"]";return[n.length&&i.length?"("+d+"|"+m+")":n.length?d:m,a,u-r,!0]};var Rn=(e,{windowsPathsNoEscape:t=!1}={})=>t?e.replace(/\[([^\/\\])\]/g,"$1"):e.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1");var Fk=new Set(["!","?","+","*","@"]),Mv=e=>Fk.has(e),Bk="(?!(?:^|/)\\.\\.?(?:$|/))",el="(?!\\.)",Vk=new Set(["[","."]),Uk=new Set(["..","."]),zk=new Set("().*{}+?[]^$\\!"),Hk=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Pf="[^/]",Lv=Pf+"*?",Dv=Pf+"+?",et,st,nn,je,Ge,Cn,vi,kn,Mr,wi,Xo,xi,Fv,Nn,tl,Of,Bv,Tt=class Tt{constructor(t,r,n={}){Bt(this,xi);xv(this,"type");Bt(this,et);Bt(this,st);Bt(this,nn,!1);Bt(this,je,[]);Bt(this,Ge);Bt(this,Cn);Bt(this,vi);Bt(this,kn,!1);Bt(this,Mr);Bt(this,wi);Bt(this,Xo,!1);this.type=t,t&&ze(this,st,!0),ze(this,Ge,r),ze(this,et,D(this,Ge)?D(D(this,Ge),et):this),ze(this,Mr,D(this,et)===this?n:D(D(this,et),Mr)),ze(this,vi,D(this,et)===this?[]:D(D(this,et),vi)),t==="!"&&!D(D(this,et),kn)&&D(this,vi).push(this),ze(this,Cn,D(this,Ge)?D(D(this,Ge),je).length:0)}get hasMagic(){if(D(this,st)!==void 0)return D(this,st);for(let t of D(this,je))if(typeof t!="string"&&(t.type||t.hasMagic))return ze(this,st,!0);return D(this,st)}toString(){return D(this,wi)!==void 0?D(this,wi):this.type?ze(this,wi,this.type+"("+D(this,je).map(t=>String(t)).join("|")+")"):ze(this,wi,D(this,je).map(t=>String(t)).join(""))}push(...t){for(let r of t)if(r!==""){if(typeof r!="string"&&!(r instanceof Tt&&D(r,Ge)===this))throw new Error("invalid part: "+r);D(this,je).push(r)}}toJSON(){var r;let t=this.type===null?D(this,je).slice().map(n=>typeof n=="string"?n:n.toJSON()):[this.type,...D(this,je).map(n=>n.toJSON())];return this.isStart()&&!this.type&&t.unshift([]),this.isEnd()&&(this===D(this,et)||D(D(this,et),kn)&&((r=D(this,Ge))==null?void 0:r.type)==="!")&&t.push({}),t}isStart(){var r;if(D(this,et)===this)return!0;if(!((r=D(this,Ge))!=null&&r.isStart()))return!1;if(D(this,Cn)===0)return!0;let t=D(this,Ge);for(let n=0;n<D(this,Cn);n++){let i=D(t,je)[n];if(!(i instanceof Tt&&i.type==="!"))return!1}return!0}isEnd(){var r,n,i;if(D(this,et)===this||((r=D(this,Ge))==null?void 0:r.type)==="!")return!0;if(!((n=D(this,Ge))!=null&&n.isEnd()))return!1;if(!this.type)return(i=D(this,Ge))==null?void 0:i.isEnd();let t=D(this,Ge)?D(D(this,Ge),je).length:0;return D(this,Cn)===t-1}copyIn(t){typeof t=="string"?this.push(t):this.push(t.clone(this))}clone(t){let r=new Tt(this.type,t);for(let n of D(this,je))r.copyIn(n);return r}static fromGlob(t,r={}){var i;let n=new Tt(null,void 0,r);return Tn(i=Tt,Nn,tl).call(i,t,n,0,r),n}toMMPattern(){if(this!==D(this,et))return D(this,et).toMMPattern();let t=this.toString(),[r,n,i,s]=this.toRegExpSource();if(!(i||D(this,st)||D(this,Mr).nocase&&!D(this,Mr).nocaseMagicOnly&&t.toUpperCase()!==t.toLowerCase()))return n;let a=(D(this,Mr).nocase?"i":"")+(s?"u":"");return Object.assign(new RegExp(`^${r}$`,a),{_src:r,_glob:t})}get options(){return D(this,Mr)}toRegExpSource(t){var c;let r=t!=null?t:!!D(this,Mr).dot;if(D(this,et)===this&&Tn(this,xi,Fv).call(this),!this.type){let l=this.isStart()&&this.isEnd(),u=D(this,je).map(f=>{var w;let[h,y,g,b]=typeof f=="string"?Tn(w=Tt,Nn,Bv).call(w,f,D(this,st),l):f.toRegExpSource(t);return ze(this,st,D(this,st)||g),ze(this,nn,D(this,nn)||b),h}).join(""),p="";if(this.isStart()&&typeof D(this,je)[0]=="string"&&!(D(this,je).length===1&&Uk.has(D(this,je)[0]))){let h=Vk,y=r&&h.has(u.charAt(0))||u.startsWith("\\.")&&h.has(u.charAt(2))||u.startsWith("\\.\\.")&&h.has(u.charAt(4)),g=!r&&!t&&h.has(u.charAt(0));p=y?Bk:g?el:""}let d="";return this.isEnd()&&D(D(this,et),kn)&&((c=D(this,Ge))==null?void 0:c.type)==="!"&&(d="(?:$|\\/)"),[p+u+d,Rn(u),ze(this,st,!!D(this,st)),D(this,nn)]}let n=this.type==="*"||this.type==="+",i=this.type==="!"?"(?:(?!(?:":"(?:",s=Tn(this,xi,Of).call(this,r);if(this.isStart()&&this.isEnd()&&!s&&this.type!=="!"){let l=this.toString();return ze(this,je,[l]),this.type=null,ze(this,st,void 0),[l,Rn(this.toString()),!1,!1]}let o=!n||t||r||!el?"":Tn(this,xi,Of).call(this,!0);o===s&&(o=""),o&&(s=`(?:${s})(?:${o})*?`);let a="";if(this.type==="!"&&D(this,Xo))a=(this.isStart()&&!r?el:"")+Dv;else{let l=this.type==="!"?"))"+(this.isStart()&&!r&&!t?el:"")+Lv+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&o?")":this.type==="*"&&o?")?":`)${this.type}`;a=i+s+l}return[a,Rn(s),ze(this,st,!!D(this,st)),D(this,nn)]}};et=new WeakMap,st=new WeakMap,nn=new WeakMap,je=new WeakMap,Ge=new WeakMap,Cn=new WeakMap,vi=new WeakMap,kn=new WeakMap,Mr=new WeakMap,wi=new WeakMap,Xo=new WeakMap,xi=new WeakSet,Fv=function(){if(this!==D(this,et))throw new Error("should only call on root");if(D(this,kn))return this;this.toString(),ze(this,kn,!0);let t;for(;t=D(this,vi).pop();){if(t.type!=="!")continue;let r=t,n=D(r,Ge);for(;n;){for(let i=D(r,Cn)+1;!n.type&&i<D(n,je).length;i++)for(let s of D(t,je)){if(typeof s=="string")throw new Error("string part in extglob AST??");s.copyIn(D(n,je)[i])}r=n,n=D(r,Ge)}}return this},Nn=new WeakSet,tl=function(t,r,n,i){var m,f;let s=!1,o=!1,a=-1,c=!1;if(r.type===null){let h=n,y="";for(;h<t.length;){let g=t.charAt(h++);if(s||g==="\\"){s=!s,y+=g;continue}if(o){h===a+1?(g==="^"||g==="!")&&(c=!0):g==="]"&&!(h===a+2&&c)&&(o=!1),y+=g;continue}else if(g==="["){o=!0,a=h,c=!1,y+=g;continue}if(!i.noext&&Mv(g)&&t.charAt(h)==="("){r.push(y),y="";let b=new Tt(g,r);h=Tn(m=Tt,Nn,tl).call(m,t,b,h,i),r.push(b);continue}y+=g}return r.push(y),h}let l=n+1,u=new Tt(null,r),p=[],d="";for(;l<t.length;){let h=t.charAt(l++);if(s||h==="\\"){s=!s,d+=h;continue}if(o){l===a+1?(h==="^"||h==="!")&&(c=!0):h==="]"&&!(l===a+2&&c)&&(o=!1),d+=h;continue}else if(h==="["){o=!0,a=l,c=!1,d+=h;continue}if(Mv(h)&&t.charAt(l)==="("){u.push(d),d="";let y=new Tt(h,u);u.push(y),l=Tn(f=Tt,Nn,tl).call(f,t,y,l,i);continue}if(h==="|"){u.push(d),d="",p.push(u),u=new Tt(null,r);continue}if(h===")")return d===""&&D(r,je).length===0&&ze(r,Xo,!0),u.push(d),d="",r.push(...p,u),l;d+=h}return r.type=null,ze(r,st,void 0),ze(r,je,[t.substring(n-1)]),l},Of=function(t){return D(this,je).map(r=>{if(typeof r=="string")throw new Error("string type in extglob ast??");let[n,i,s,o]=r.toRegExpSource(t);return ze(this,nn,D(this,nn)||o),n}).filter(r=>!(this.isStart()&&this.isEnd())||!!r).join("|")},Bv=function(t,r,n=!1){let i=!1,s="",o=!1;for(let a=0;a<t.length;a++){let c=t.charAt(a);if(i){i=!1,s+=(zk.has(c)?"\\":"")+c;continue}if(c==="\\"){a===t.length-1?s+="\\\\":i=!0;continue}if(c==="["){let[l,u,p,d]=jv(t,a);if(p){s+=l,o=o||u,a+=p-1,r=r||d;continue}}if(c==="*"){n&&t==="*"?s+=Dv:s+=Lv,r=!0;continue}if(c==="?"){s+=Pf,r=!0;continue}s+=Hk(c)}return[s,Rn(t),!!r,o]},Bt(Tt,Nn);var Ss=Tt;var $f=(e,{windowsPathsNoEscape:t=!1}={})=>t?e.replace(/[?*()[\]]/g,"[$&]"):e.replace(/[?*()[\]\\]/g,"\\$&");var ct=(e,t,r={})=>(Go(t),!r.nocomment&&t.charAt(0)==="#"?!1:new _s(t,r).match(e)),Kk=/^\*+([^+@!?\*\[\(]*)$/,Wk=e=>t=>!t.startsWith(".")&&t.endsWith(e),Yk=e=>t=>t.endsWith(e),Gk=e=>(e=e.toLowerCase(),t=>!t.startsWith(".")&&t.toLowerCase().endsWith(e)),Jk=e=>(e=e.toLowerCase(),t=>t.toLowerCase().endsWith(e)),Xk=/^\*+\.\*+$/,Qk=e=>!e.startsWith(".")&&e.includes("."),Zk=e=>e!=="."&&e!==".."&&e.includes("."),eN=/^\.\*+$/,tN=e=>e!=="."&&e!==".."&&e.startsWith("."),rN=/^\*+$/,nN=e=>e.length!==0&&!e.startsWith("."),iN=e=>e.length!==0&&e!=="."&&e!=="..",sN=/^\?+([^+@!?\*\[\(]*)?$/,oN=([e,t=""])=>{let r=Hv([e]);return t?(t=t.toLowerCase(),n=>r(n)&&n.toLowerCase().endsWith(t)):r},aN=([e,t=""])=>{let r=Kv([e]);return t?(t=t.toLowerCase(),n=>r(n)&&n.toLowerCase().endsWith(t)):r},cN=([e,t=""])=>{let r=Kv([e]);return t?n=>r(n)&&n.endsWith(t):r},lN=([e,t=""])=>{let r=Hv([e]);return t?n=>r(n)&&n.endsWith(t):r},Hv=([e])=>{let t=e.length;return r=>r.length===t&&!r.startsWith(".")},Kv=([e])=>{let t=e.length;return r=>r.length===t&&r!=="."&&r!==".."},Wv=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",Vv={win32:{sep:"\\"},posix:{sep:"/"}},uN=Wv==="win32"?Vv.win32.sep:Vv.posix.sep;ct.sep=uN;var lr=Symbol("globstar **");ct.GLOBSTAR=lr;var pN="[^/]",fN=pN+"*?",dN="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",mN="(?:(?!(?:\\/|^)\\.).)*?",hN=(e,t={})=>r=>ct(r,e,t);ct.filter=hN;var cr=(e,t={})=>Object.assign({},e,t),yN=e=>{if(!e||typeof e!="object"||!Object.keys(e).length)return ct;let t=ct;return Object.assign((n,i,s={})=>t(n,i,cr(e,s)),{Minimatch:class extends t.Minimatch{constructor(i,s={}){super(i,cr(e,s))}static defaults(i){return t.defaults(cr(e,i)).Minimatch}},AST:class extends t.AST{constructor(i,s,o={}){super(i,s,cr(e,o))}static fromGlob(i,s={}){return t.AST.fromGlob(i,cr(e,s))}},unescape:(n,i={})=>t.unescape(n,cr(e,i)),escape:(n,i={})=>t.escape(n,cr(e,i)),filter:(n,i={})=>t.filter(n,cr(e,i)),defaults:n=>t.defaults(cr(e,n)),makeRe:(n,i={})=>t.makeRe(n,cr(e,i)),braceExpand:(n,i={})=>t.braceExpand(n,cr(e,i)),match:(n,i,s={})=>t.match(n,i,cr(e,s)),sep:t.sep,GLOBSTAR:lr})};ct.defaults=yN;var Yv=(e,t={})=>(Go(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:(0,zv.default)(e));ct.braceExpand=Yv;var gN=(e,t={})=>new _s(e,t).makeRe();ct.makeRe=gN;var bN=(e,t,r={})=>{let n=new _s(t,r);return e=e.filter(i=>n.match(i)),n.options.nonull&&!e.length&&e.push(t),e};ct.match=bN;var Uv=/[?*]|[+@!]\(.*?\)|\[|\]/,vN=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),_s=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(t,r={}){Go(t),r=r||{},this.options=r,this.pattern=t,this.platform=r.platform||Wv,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!r.windowsPathsNoEscape||r.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!r.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!r.nonegate,this.comment=!1,this.empty=!1,this.partial=!!r.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=r.windowsNoMagicRoot!==void 0?r.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let t of this.set)for(let r of t)if(typeof r!="string")return!0;return!1}debug(...t){}make(){let t=this.pattern,r=this.options;if(!r.nocomment&&t.charAt(0)==="#"){this.comment=!0;return}if(!t){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],r.debug&&(this.debug=(...s)=>console.error(...s)),this.debug(this.pattern,this.globSet);let n=this.globSet.map(s=>this.slashSplit(s));this.globParts=this.preprocess(n),this.debug(this.pattern,this.globParts);let i=this.globParts.map((s,o,a)=>{if(this.isWindows&&this.windowsNoMagicRoot){let c=s[0]===""&&s[1]===""&&(s[2]==="?"||!Uv.test(s[2]))&&!Uv.test(s[3]),l=/^[a-z]:/i.test(s[0]);if(c)return[...s.slice(0,4),...s.slice(4).map(u=>this.parse(u))];if(l)return[s[0],...s.slice(1).map(u=>this.parse(u))]}return s.map(c=>this.parse(c))});if(this.debug(this.pattern,i),this.set=i.filter(s=>s.indexOf(!1)===-1),this.isWindows)for(let s=0;s<this.set.length;s++){let o=this.set[s];o[0]===""&&o[1]===""&&this.globParts[s][2]==="?"&&typeof o[3]=="string"&&/^[a-z]:$/i.test(o[3])&&(o[2]="?")}this.debug(this.pattern,this.set)}preprocess(t){if(this.options.noglobstar)for(let n=0;n<t.length;n++)for(let i=0;i<t[n].length;i++)t[n][i]==="**"&&(t[n][i]="*");let{optimizationLevel:r=1}=this.options;return r>=2?(t=this.firstPhasePreProcess(t),t=this.secondPhasePreProcess(t)):r>=1?t=this.levelOneOptimize(t):t=this.adjascentGlobstarOptimize(t),t}adjascentGlobstarOptimize(t){return t.map(r=>{let n=-1;for(;(n=r.indexOf("**",n+1))!==-1;){let i=n;for(;r[i+1]==="**";)i++;i!==n&&r.splice(n,i-n)}return r})}levelOneOptimize(t){return t.map(r=>(r=r.reduce((n,i)=>{let s=n[n.length-1];return i==="**"&&s==="**"?n:i===".."&&s&&s!==".."&&s!=="."&&s!=="**"?(n.pop(),n):(n.push(i),n)},[]),r.length===0?[""]:r))}levelTwoFileOptimize(t){Array.isArray(t)||(t=this.slashSplit(t));let r=!1;do{if(r=!1,!this.preserveMultipleSlashes){for(let i=1;i<t.length-1;i++){let s=t[i];i===1&&s===""&&t[0]===""||(s==="."||s==="")&&(r=!0,t.splice(i,1),i--)}t[0]==="."&&t.length===2&&(t[1]==="."||t[1]==="")&&(r=!0,t.pop())}let n=0;for(;(n=t.indexOf("..",n+1))!==-1;){let i=t[n-1];i&&i!=="."&&i!==".."&&i!=="**"&&(r=!0,t.splice(n-1,2),n-=2)}}while(r);return t.length===0?[""]:t}firstPhasePreProcess(t){let r=!1;do{r=!1;for(let n of t){let i=-1;for(;(i=n.indexOf("**",i+1))!==-1;){let o=i;for(;n[o+1]==="**";)o++;o>i&&n.splice(i+1,o-i);let a=n[i+1],c=n[i+2],l=n[i+3];if(a!==".."||!c||c==="."||c===".."||!l||l==="."||l==="..")continue;r=!0,n.splice(i,1);let u=n.slice(0);u[i]="**",t.push(u),i--}if(!this.preserveMultipleSlashes){for(let o=1;o<n.length-1;o++){let a=n[o];o===1&&a===""&&n[0]===""||(a==="."||a==="")&&(r=!0,n.splice(o,1),o--)}n[0]==="."&&n.length===2&&(n[1]==="."||n[1]==="")&&(r=!0,n.pop())}let s=0;for(;(s=n.indexOf("..",s+1))!==-1;){let o=n[s-1];if(o&&o!=="."&&o!==".."&&o!=="**"){r=!0;let c=s===1&&n[s+1]==="**"?["."]:[];n.splice(s-1,2,...c),n.length===0&&n.push(""),s-=2}}}}while(r);return t}secondPhasePreProcess(t){for(let r=0;r<t.length-1;r++)for(let n=r+1;n<t.length;n++){let i=this.partsMatch(t[r],t[n],!this.preserveMultipleSlashes);if(i){t[r]=[],t[n]=i;break}}return t.filter(r=>r.length)}partsMatch(t,r,n=!1){let i=0,s=0,o=[],a="";for(;i<t.length&&s<r.length;)if(t[i]===r[s])o.push(a==="b"?r[s]:t[i]),i++,s++;else if(n&&t[i]==="**"&&r[s]===t[i+1])o.push(t[i]),i++;else if(n&&r[s]==="**"&&t[i]===r[s+1])o.push(r[s]),s++;else if(t[i]==="*"&&r[s]&&(this.options.dot||!r[s].startsWith("."))&&r[s]!=="**"){if(a==="b")return!1;a="a",o.push(t[i]),i++,s++}else if(r[s]==="*"&&t[i]&&(this.options.dot||!t[i].startsWith("."))&&t[i]!=="**"){if(a==="a")return!1;a="b",o.push(r[s]),i++,s++}else return!1;return t.length===r.length&&o}parseNegate(){if(this.nonegate)return;let t=this.pattern,r=!1,n=0;for(let i=0;i<t.length&&t.charAt(i)==="!";i++)r=!r,n++;n&&(this.pattern=t.slice(n)),this.negate=r}matchOne(t,r,n=!1){let i=this.options;if(this.isWindows){let h=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),y=!h&&t[0]===""&&t[1]===""&&t[2]==="?"&&/^[a-z]:$/i.test(t[3]),g=typeof r[0]=="string"&&/^[a-z]:$/i.test(r[0]),b=!g&&r[0]===""&&r[1]===""&&r[2]==="?"&&typeof r[3]=="string"&&/^[a-z]:$/i.test(r[3]),w=y?3:h?0:void 0,x=b?3:g?0:void 0;if(typeof w=="number"&&typeof x=="number"){let[S,T]=[t[w],r[x]];S.toLowerCase()===T.toLowerCase()&&(r[x]=S,x>w?r=r.slice(x):w>x&&(t=t.slice(w)))}}let{optimizationLevel:s=1}=this.options;s>=2&&(t=this.levelTwoFileOptimize(t)),this.debug("matchOne",this,{file:t,pattern:r}),this.debug("matchOne",t.length,r.length);for(var o=0,a=0,c=t.length,l=r.length;o<c&&a<l;o++,a++){this.debug("matchOne loop");var u=r[a],p=t[o];if(this.debug(r,u,p),u===!1)return!1;if(u===lr){this.debug("GLOBSTAR",[r,u,p]);var d=o,m=a+1;if(m===l){for(this.debug("** at the end");o<c;o++)if(t[o]==="."||t[o]===".."||!i.dot&&t[o].charAt(0)===".")return!1;return!0}for(;d<c;){var f=t[d];if(this.debug(`
206
+ deps: ${r}}`};var JZ={keyword:"dependencies",type:"object",schemaType:"object",error:tn.error,code(e){let[t,r]=XZ(e);vC(e,t),wC(e,r)}};function XZ({schema:e}){let t={},r={};for(let n in e){if(n==="__proto__")continue;let i=Array.isArray(e[n])?t:r;i[n]=e[n]}return[t,r]}function vC(e,t=e.schema){let{gen:r,data:n,it:i}=e;if(Object.keys(t).length===0)return;let s=r.let("missing");for(let o in t){let a=t[o];if(a.length===0)continue;let c=(0,Qc.propertyInData)(r,n,o,i.opts.ownProperties);e.setParams({property:o,depsCount:a.length,deps:a.join(", ")}),i.allErrors?r.if(c,()=>{for(let l of a)(0,Qc.checkReportMissingProp)(e,l)}):(r.if((0,Kb._)`${c} && (${(0,Qc.checkMissingProp)(e,a,s)})`),(0,Qc.reportMissingProp)(e,s),r.else())}}tn.validatePropertyDeps=vC;function wC(e,t=e.schema){let{gen:r,data:n,keyword:i,it:s}=e,o=r.name("valid");for(let a in t)(0,GZ.alwaysValidSchema)(s,t[a])||(r.if((0,Qc.propertyInData)(r,n,a,s.opts.ownProperties),()=>{let c=e.subschema({keyword:i,schemaProp:a},o);e.mergeValidEvaluated(c,o)},()=>r.var(o,!0)),e.ok(o))}tn.validateSchemaDeps=wC;tn.default=JZ});var _C=v(Wb=>{"use strict";Object.defineProperty(Wb,"__esModule",{value:!0});var SC=ae(),QZ=Se(),ZZ={message:"property name must be valid",params:({params:e})=>(0,SC._)`{propertyName: ${e.propertyName}}`},eee={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:ZZ,code(e){let{gen:t,schema:r,data:n,it:i}=e;if((0,QZ.alwaysValidSchema)(i,r))return;let s=t.name("valid");t.forIn("key",n,o=>{e.setParams({propertyName:o}),e.subschema({keyword:"propertyNames",data:o,dataTypes:["string"],propertyName:o,compositeRule:!0},s),t.if((0,SC.not)(s),()=>{e.error(!0),i.allErrors||t.break()})}),e.ok(s)}};Wb.default=eee});var Gb=v(Yb=>{"use strict";Object.defineProperty(Yb,"__esModule",{value:!0});var ff=xr(),qr=ae(),tee=$n(),df=Se(),ree={message:"must NOT have additional properties",params:({params:e})=>(0,qr._)`{additionalProperty: ${e.additionalProperty}}`},nee={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:ree,code(e){let{gen:t,schema:r,parentSchema:n,data:i,errsCount:s,it:o}=e;if(!s)throw new Error("ajv implementation error");let{allErrors:a,opts:c}=o;if(o.props=!0,c.removeAdditional!=="all"&&(0,df.alwaysValidSchema)(o,r))return;let l=(0,ff.allSchemaProperties)(n.properties),u=(0,ff.allSchemaProperties)(n.patternProperties);p(),e.ok((0,qr._)`${s} === ${tee.default.errors}`);function p(){t.forIn("key",i,y=>{!l.length&&!u.length?f(y):t.if(d(y),()=>f(y))})}function d(y){let g;if(l.length>8){let b=(0,df.schemaRefOrVal)(o,n.properties,"properties");g=(0,ff.isOwnProperty)(t,b,y)}else l.length?g=(0,qr.or)(...l.map(b=>(0,qr._)`${y} === ${b}`)):g=qr.nil;return u.length&&(g=(0,qr.or)(g,...u.map(b=>(0,qr._)`${(0,ff.usePattern)(e,b)}.test(${y})`))),(0,qr.not)(g)}function m(y){t.code((0,qr._)`delete ${i}[${y}]`)}function f(y){if(c.removeAdditional==="all"||c.removeAdditional&&r===!1){m(y);return}if(r===!1){e.setParams({additionalProperty:y}),e.error(),a||t.break();return}if(typeof r=="object"&&!(0,df.alwaysValidSchema)(o,r)){let g=t.name("valid");c.removeAdditional==="failing"?(h(y,g,!1),t.if((0,qr.not)(g),()=>{e.reset(),m(y)})):(h(y,g),a||t.if((0,qr.not)(g),()=>t.break()))}}function h(y,g,b){let w={keyword:"additionalProperties",dataProp:y,dataPropType:df.Type.Str};b===!1&&Object.assign(w,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(w,g)}}};Yb.default=nee});var $C=v(Xb=>{"use strict";Object.defineProperty(Xb,"__esModule",{value:!0});var iee=Lc(),OC=xr(),Jb=Se(),PC=Gb(),see={keyword:"properties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,parentSchema:n,data:i,it:s}=e;s.opts.removeAdditional==="all"&&n.additionalProperties===void 0&&PC.default.code(new iee.KeywordCxt(s,PC.default,"additionalProperties"));let o=(0,OC.allSchemaProperties)(r);for(let p of o)s.definedProperties.add(p);s.opts.unevaluated&&o.length&&s.props!==!0&&(s.props=Jb.mergeEvaluated.props(t,(0,Jb.toHash)(o),s.props));let a=o.filter(p=>!(0,Jb.alwaysValidSchema)(s,r[p]));if(a.length===0)return;let c=t.name("valid");for(let p of a)l(p)?u(p):(t.if((0,OC.propertyInData)(t,i,p,s.opts.ownProperties)),u(p),s.allErrors||t.else().var(c,!0),t.endIf()),e.it.definedProperties.add(p),e.ok(c);function l(p){return s.opts.useDefaults&&!s.compositeRule&&r[p].default!==void 0}function u(p){e.subschema({keyword:"properties",schemaProp:p,dataProp:p},c)}}};Xb.default=see});var RC=v(Qb=>{"use strict";Object.defineProperty(Qb,"__esModule",{value:!0});var EC=xr(),mf=ae(),AC=Se(),TC=Se(),oee={keyword:"patternProperties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,data:n,parentSchema:i,it:s}=e,{opts:o}=s,a=(0,EC.allSchemaProperties)(r),c=a.filter(h=>(0,AC.alwaysValidSchema)(s,r[h]));if(a.length===0||c.length===a.length&&(!s.opts.unevaluated||s.props===!0))return;let l=o.strictSchema&&!o.allowMatchingProperties&&i.properties,u=t.name("valid");s.props!==!0&&!(s.props instanceof mf.Name)&&(s.props=(0,TC.evaluatedPropsToName)(t,s.props));let{props:p}=s;d();function d(){for(let h of a)l&&m(h),s.allErrors?f(h):(t.var(u,!0),f(h),t.if(u))}function m(h){for(let y in l)new RegExp(h).test(y)&&(0,AC.checkStrictMode)(s,`property ${y} matches pattern ${h} (use allowMatchingProperties)`)}function f(h){t.forIn("key",n,y=>{t.if((0,mf._)`${(0,EC.usePattern)(e,h)}.test(${y})`,()=>{let g=c.includes(h);g||e.subschema({keyword:"patternProperties",schemaProp:h,dataProp:y,dataPropType:TC.Type.Str},u),s.opts.unevaluated&&p!==!0?t.assign((0,mf._)`${p}[${y}]`,!0):!g&&!s.allErrors&&t.if((0,mf.not)(u),()=>t.break())})})}}};Qb.default=oee});var CC=v(Zb=>{"use strict";Object.defineProperty(Zb,"__esModule",{value:!0});var aee=Se(),cee={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){let{gen:t,schema:r,it:n}=e;if((0,aee.alwaysValidSchema)(n,r)){e.fail();return}let i=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},i),e.failResult(i,()=>e.reset(),()=>e.error())},error:{message:"must NOT be valid"}};Zb.default=cee});var kC=v(ev=>{"use strict";Object.defineProperty(ev,"__esModule",{value:!0});var lee=xr(),uee={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:lee.validateUnion,error:{message:"must match a schema in anyOf"}};ev.default=uee});var NC=v(tv=>{"use strict";Object.defineProperty(tv,"__esModule",{value:!0});var hf=ae(),pee=Se(),fee={message:"must match exactly one schema in oneOf",params:({params:e})=>(0,hf._)`{passingSchemas: ${e.passing}}`},dee={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:fee,code(e){let{gen:t,schema:r,parentSchema:n,it:i}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(i.opts.discriminator&&n.discriminator)return;let s=r,o=t.let("valid",!1),a=t.let("passing",null),c=t.name("_valid");e.setParams({passing:a}),t.block(l),e.result(o,()=>e.reset(),()=>e.error(!0));function l(){s.forEach((u,p)=>{let d;(0,pee.alwaysValidSchema)(i,u)?t.var(c,!0):d=e.subschema({keyword:"oneOf",schemaProp:p,compositeRule:!0},c),p>0&&t.if((0,hf._)`${c} && ${o}`).assign(o,!1).assign(a,(0,hf._)`[${a}, ${p}]`).else(),t.if(c,()=>{t.assign(o,!0),t.assign(a,p),d&&e.mergeEvaluated(d,hf.Name)})})}}};tv.default=dee});var IC=v(rv=>{"use strict";Object.defineProperty(rv,"__esModule",{value:!0});var mee=Se(),hee={keyword:"allOf",schemaType:"array",code(e){let{gen:t,schema:r,it:n}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");let i=t.name("valid");r.forEach((s,o)=>{if((0,mee.alwaysValidSchema)(n,s))return;let a=e.subschema({keyword:"allOf",schemaProp:o},i);e.ok(i),e.mergeEvaluated(a)})}};rv.default=hee});var MC=v(nv=>{"use strict";Object.defineProperty(nv,"__esModule",{value:!0});var yf=ae(),jC=Se(),yee={message:({params:e})=>(0,yf.str)`must match "${e.ifClause}" schema`,params:({params:e})=>(0,yf._)`{failingKeyword: ${e.ifClause}}`},gee={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:yee,code(e){let{gen:t,parentSchema:r,it:n}=e;r.then===void 0&&r.else===void 0&&(0,jC.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let i=qC(n,"then"),s=qC(n,"else");if(!i&&!s)return;let o=t.let("valid",!0),a=t.name("_valid");if(c(),e.reset(),i&&s){let u=t.let("ifClause");e.setParams({ifClause:u}),t.if(a,l("then",u),l("else",u))}else i?t.if(a,l("then")):t.if((0,yf.not)(a),l("else"));e.pass(o,()=>e.error(!0));function c(){let u=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},a);e.mergeEvaluated(u)}function l(u,p){return()=>{let d=e.subschema({keyword:u},a);t.assign(o,a),e.mergeValidEvaluated(d,o),p?t.assign(p,(0,yf._)`${u}`):e.setParams({ifClause:u})}}}};function qC(e,t){let r=e.schema[t];return r!==void 0&&!(0,jC.alwaysValidSchema)(e,r)}nv.default=gee});var LC=v(iv=>{"use strict";Object.defineProperty(iv,"__esModule",{value:!0});var bee=Se(),vee={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){t.if===void 0&&(0,bee.checkStrictMode)(r,`"${e}" without "if" is ignored`)}};iv.default=vee});var DC=v(sv=>{"use strict";Object.defineProperty(sv,"__esModule",{value:!0});var wee=Bb(),xee=hC(),See=Vb(),_ee=gC(),Oee=bC(),Pee=xC(),$ee=_C(),Eee=Gb(),Aee=$C(),Tee=RC(),Ree=CC(),Cee=kC(),kee=NC(),Nee=IC(),Iee=MC(),qee=LC();function jee(e=!1){let t=[Ree.default,Cee.default,kee.default,Nee.default,Iee.default,qee.default,$ee.default,Eee.default,Pee.default,Aee.default,Tee.default];return e?t.push(xee.default,_ee.default):t.push(wee.default,See.default),t.push(Oee.default),t}sv.default=jee});var FC=v(ov=>{"use strict";Object.defineProperty(ov,"__esModule",{value:!0});var Ye=ae(),Mee={message:({schemaCode:e})=>(0,Ye.str)`must match format "${e}"`,params:({schemaCode:e})=>(0,Ye._)`{format: ${e}}`},Lee={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:Mee,code(e,t){let{gen:r,data:n,$data:i,schema:s,schemaCode:o,it:a}=e,{opts:c,errSchemaPath:l,schemaEnv:u,self:p}=a;if(!c.validateFormats)return;i?d():m();function d(){let f=r.scopeValue("formats",{ref:p.formats,code:c.code.formats}),h=r.const("fDef",(0,Ye._)`${f}[${o}]`),y=r.let("fType"),g=r.let("format");r.if((0,Ye._)`typeof ${h} == "object" && !(${h} instanceof RegExp)`,()=>r.assign(y,(0,Ye._)`${h}.type || "string"`).assign(g,(0,Ye._)`${h}.validate`),()=>r.assign(y,(0,Ye._)`"string"`).assign(g,h)),e.fail$data((0,Ye.or)(b(),w()));function b(){return c.strictSchema===!1?Ye.nil:(0,Ye._)`${o} && !${g}`}function w(){let x=u.$async?(0,Ye._)`(${h}.async ? await ${g}(${n}) : ${g}(${n}))`:(0,Ye._)`${g}(${n})`,S=(0,Ye._)`(typeof ${g} == "function" ? ${x} : ${g}.test(${n}))`;return(0,Ye._)`${g} && ${g} !== true && ${y} === ${t} && !${S}`}}function m(){let f=p.formats[s];if(!f){b();return}if(f===!0)return;let[h,y,g]=w(f);h===t&&e.pass(x());function b(){if(c.strictSchema===!1){p.logger.warn(S());return}throw new Error(S());function S(){return`unknown format "${s}" ignored in schema at path "${l}"`}}function w(S){let T=S instanceof RegExp?(0,Ye.regexpCode)(S):c.code.formats?(0,Ye._)`${c.code.formats}${(0,Ye.getProperty)(s)}`:void 0,_=r.scopeValue("formats",{key:s,ref:S,code:T});return typeof S=="object"&&!(S instanceof RegExp)?[S.type||"string",S.validate,(0,Ye._)`${_}.validate`]:["string",S,_]}function x(){if(typeof f=="object"&&!(f instanceof RegExp)&&f.async){if(!u.$async)throw new Error("async format in sync schema");return(0,Ye._)`await ${g}(${n})`}return typeof y=="function"?(0,Ye._)`${g}(${n})`:(0,Ye._)`${g}.test(${n})`}}}};ov.default=Lee});var BC=v(av=>{"use strict";Object.defineProperty(av,"__esModule",{value:!0});var Dee=FC(),Fee=[Dee.default];av.default=Fee});var VC=v(Fo=>{"use strict";Object.defineProperty(Fo,"__esModule",{value:!0});Fo.contentVocabulary=Fo.metadataVocabulary=void 0;Fo.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Fo.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var zC=v(cv=>{"use strict";Object.defineProperty(cv,"__esModule",{value:!0});var Bee=X2(),Vee=pC(),Uee=DC(),zee=BC(),UC=VC(),Hee=[Bee.default,Vee.default,(0,Uee.default)(),zee.default,UC.metadataVocabulary,UC.contentVocabulary];cv.default=Hee});var KC=v(gf=>{"use strict";Object.defineProperty(gf,"__esModule",{value:!0});gf.DiscrError=void 0;var HC;(function(e){e.Tag="tag",e.Mapping="mapping"})(HC||(gf.DiscrError=HC={}))});var YC=v(uv=>{"use strict";Object.defineProperty(uv,"__esModule",{value:!0});var Bo=ae(),lv=KC(),WC=Qp(),Kee=Dc(),Wee=Se(),Yee={message:({params:{discrError:e,tagName:t}})=>e===lv.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:r}})=>(0,Bo._)`{error: ${e}, tag: ${r}, tagValue: ${t}}`},Gee={keyword:"discriminator",type:"object",schemaType:"object",error:Yee,code(e){let{gen:t,data:r,schema:n,parentSchema:i,it:s}=e,{oneOf:o}=i;if(!s.opts.discriminator)throw new Error("discriminator: requires discriminator option");let a=n.propertyName;if(typeof a!="string")throw new Error("discriminator: requires propertyName");if(n.mapping)throw new Error("discriminator: mapping is not supported");if(!o)throw new Error("discriminator: requires oneOf keyword");let c=t.let("valid",!1),l=t.const("tag",(0,Bo._)`${r}${(0,Bo.getProperty)(a)}`);t.if((0,Bo._)`typeof ${l} == "string"`,()=>u(),()=>e.error(!1,{discrError:lv.DiscrError.Tag,tag:l,tagName:a})),e.ok(c);function u(){let m=d();t.if(!1);for(let f in m)t.elseIf((0,Bo._)`${l} === ${f}`),t.assign(c,p(m[f]));t.else(),e.error(!1,{discrError:lv.DiscrError.Mapping,tag:l,tagName:a}),t.endIf()}function p(m){let f=t.name("valid"),h=e.subschema({keyword:"oneOf",schemaProp:m},f);return e.mergeEvaluated(h,Bo.Name),f}function d(){var m;let f={},h=g(i),y=!0;for(let x=0;x<o.length;x++){let S=o[x];if(S!=null&&S.$ref&&!(0,Wee.schemaHasRulesButRef)(S,s.self.RULES)){let _=S.$ref;if(S=WC.resolveRef.call(s.self,s.schemaEnv.root,s.baseId,_),S instanceof WC.SchemaEnv&&(S=S.schema),S===void 0)throw new Kee.default(s.opts.uriResolver,s.baseId,_)}let T=(m=S==null?void 0:S.properties)===null||m===void 0?void 0:m[a];if(typeof T!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${a}"`);y=y&&(h||g(S)),b(T,x)}if(!y)throw new Error(`discriminator: "${a}" must be required`);return f;function g({required:x}){return Array.isArray(x)&&x.includes(a)}function b(x,S){if(x.const)w(x.const,S);else if(x.enum)for(let T of x.enum)w(T,S);else throw new Error(`discriminator: "properties/${a}" must have "const" or "enum"`)}function w(x,S){if(typeof x!="string"||x in f)throw new Error(`discriminator: "${a}" values must be unique strings`);f[x]=S}}}};uv.default=Gee});var GC=v((K1e,Jee)=>{Jee.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}});var XC=v((Ie,pv)=>{"use strict";Object.defineProperty(Ie,"__esModule",{value:!0});Ie.MissingRefError=Ie.ValidationError=Ie.CodeGen=Ie.Name=Ie.nil=Ie.stringify=Ie.str=Ie._=Ie.KeywordCxt=Ie.Ajv=void 0;var Xee=H2(),Qee=zC(),Zee=YC(),JC=GC(),ete=["/properties"],bf="http://json-schema.org/draft-07/schema",Vo=class extends Xee.default{_addVocabularies(){super._addVocabularies(),Qee.default.forEach(t=>this.addVocabulary(t)),this.opts.discriminator&&this.addKeyword(Zee.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let t=this.opts.$data?this.$dataMetaSchema(JC,ete):JC;this.addMetaSchema(t,bf,!1),this.refs["http://json-schema.org/schema"]=bf}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(bf)?bf:void 0)}};Ie.Ajv=Vo;pv.exports=Ie=Vo;pv.exports.Ajv=Vo;Object.defineProperty(Ie,"__esModule",{value:!0});Ie.default=Vo;var tte=Lc();Object.defineProperty(Ie,"KeywordCxt",{enumerable:!0,get:function(){return tte.KeywordCxt}});var Uo=ae();Object.defineProperty(Ie,"_",{enumerable:!0,get:function(){return Uo._}});Object.defineProperty(Ie,"str",{enumerable:!0,get:function(){return Uo.str}});Object.defineProperty(Ie,"stringify",{enumerable:!0,get:function(){return Uo.stringify}});Object.defineProperty(Ie,"nil",{enumerable:!0,get:function(){return Uo.nil}});Object.defineProperty(Ie,"Name",{enumerable:!0,get:function(){return Uo.Name}});Object.defineProperty(Ie,"CodeGen",{enumerable:!0,get:function(){return Uo.CodeGen}});var rte=Jp();Object.defineProperty(Ie,"ValidationError",{enumerable:!0,get:function(){return rte.default}});var nte=Dc();Object.defineProperty(Ie,"MissingRefError",{enumerable:!0,get:function(){return nte.default}})});var QC=v(zo=>{"use strict";Object.defineProperty(zo,"__esModule",{value:!0});zo.formatLimitDefinition=void 0;var ite=XC(),jr=ae(),bi=jr.operators,vf={formatMaximum:{okStr:"<=",ok:bi.LTE,fail:bi.GT},formatMinimum:{okStr:">=",ok:bi.GTE,fail:bi.LT},formatExclusiveMaximum:{okStr:"<",ok:bi.LT,fail:bi.GTE},formatExclusiveMinimum:{okStr:">",ok:bi.GT,fail:bi.LTE}},ste={message:({keyword:e,schemaCode:t})=>jr.str`should be ${vf[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>jr._`{comparison: ${vf[e].okStr}, limit: ${t}}`};zo.formatLimitDefinition={keyword:Object.keys(vf),type:"string",schemaType:"string",$data:!0,error:ste,code(e){let{gen:t,data:r,schemaCode:n,keyword:i,it:s}=e,{opts:o,self:a}=s;if(!o.validateFormats)return;let c=new ite.KeywordCxt(s,a.RULES.all.format.definition,"format");c.$data?l():u();function l(){let d=t.scopeValue("formats",{ref:a.formats,code:o.code.formats}),m=t.const("fmt",jr._`${d}[${c.schemaCode}]`);e.fail$data(jr.or(jr._`typeof ${m} != "object"`,jr._`${m} instanceof RegExp`,jr._`typeof ${m}.compare != "function"`,p(m)))}function u(){let d=c.schema,m=a.formats[d];if(!m||m===!0)return;if(typeof m!="object"||m instanceof RegExp||typeof m.compare!="function")throw new Error(`"${i}": format "${d}" does not define "compare" function`);let f=t.scopeValue("formats",{key:d,ref:m,code:o.code.formats?jr._`${o.code.formats}${jr.getProperty(d)}`:void 0});e.fail$data(p(f))}function p(d){return jr._`${d}.compare(${r}, ${n}) ${vf[i].fail} 0`}},dependencies:["format"]};var ote=e=>(e.addKeyword(zo.formatLimitDefinition),e);zo.default=ote});var rk=v((Zc,tk)=>{"use strict";Object.defineProperty(Zc,"__esModule",{value:!0});var Ho=xR(),ate=QC(),fv=ae(),ZC=new fv.Name("fullFormats"),cte=new fv.Name("fastFormats"),dv=(e,t={keywords:!0})=>{if(Array.isArray(t))return ek(e,t,Ho.fullFormats,ZC),e;let[r,n]=t.mode==="fast"?[Ho.fastFormats,cte]:[Ho.fullFormats,ZC],i=t.formats||Ho.formatNames;return ek(e,i,r,n),t.keywords&&ate.default(e),e};dv.get=(e,t="full")=>{let n=(t==="fast"?Ho.fastFormats:Ho.fullFormats)[e];if(!n)throw new Error(`Unknown format "${e}"`);return n};function ek(e,t,r,n){var i,s;(i=(s=e.opts.code).formats)!==null&&i!==void 0||(s.formats=fv._`require("ajv-formats/dist/formats").${n}`);for(let o of t)e.addFormat(o,r[o])}tk.exports=Zc=dv;Object.defineProperty(Zc,"__esModule",{value:!0});Zc.default=dv});var vte={};wf(vte,{createMockServer:()=>Sk});module.exports=Rk(vte);var Oi=Ue(require("fs"),1),Gf=Ue(require("path"),1);var zv=Ue(Iv(),1);var Go=e=>{if(typeof e!="string")throw new TypeError("invalid pattern");if(e.length>65536)throw new TypeError("pattern is too long")};var Lk={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},Jo=e=>e.replace(/[[\]\\-]/g,"\\$&"),Dk=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),qv=e=>e.join(""),jv=(e,t)=>{let r=t;if(e.charAt(r)!=="[")throw new Error("not in a brace expression");let n=[],i=[],s=r+1,o=!1,a=!1,c=!1,l=!1,u=r,p="";e:for(;s<e.length;){let h=e.charAt(s);if((h==="!"||h==="^")&&s===r+1){l=!0,s++;continue}if(h==="]"&&o&&!c){u=s+1;break}if(o=!0,h==="\\"&&!c){c=!0,s++;continue}if(h==="["&&!c){for(let[y,[g,b,w]]of Object.entries(Lk))if(e.startsWith(y,s)){if(p)return["$.",!1,e.length-r,!0];s+=y.length,w?i.push(g):n.push(g),a=a||b;continue e}}if(c=!1,p){h>p?n.push(Jo(p)+"-"+Jo(h)):h===p&&n.push(Jo(h)),p="",s++;continue}if(e.startsWith("-]",s+1)){n.push(Jo(h+"-")),s+=2;continue}if(e.startsWith("-",s+1)){p=h,s+=2;continue}n.push(Jo(h)),s++}if(u<s)return["",!1,0,!1];if(!n.length&&!i.length)return["$.",!1,e.length-r,!0];if(i.length===0&&n.length===1&&/^\\?.$/.test(n[0])&&!l){let h=n[0].length===2?n[0].slice(-1):n[0];return[Dk(h),!1,u-r,!1]}let d="["+(l?"^":"")+qv(n)+"]",m="["+(l?"":"^")+qv(i)+"]";return[n.length&&i.length?"("+d+"|"+m+")":n.length?d:m,a,u-r,!0]};var Rn=(e,{windowsPathsNoEscape:t=!1}={})=>t?e.replace(/\[([^\/\\])\]/g,"$1"):e.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1");var Fk=new Set(["!","?","+","*","@"]),Mv=e=>Fk.has(e),Bk="(?!(?:^|/)\\.\\.?(?:$|/))",el="(?!\\.)",Vk=new Set(["[","."]),Uk=new Set(["..","."]),zk=new Set("().*{}+?[]^$\\!"),Hk=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Pf="[^/]",Lv=Pf+"*?",Dv=Pf+"+?",et,st,nn,je,Ge,Cn,vi,kn,Mr,wi,Xo,xi,Fv,Nn,tl,Of,Bv,Tt=class Tt{constructor(t,r,n={}){Bt(this,xi);xv(this,"type");Bt(this,et);Bt(this,st);Bt(this,nn,!1);Bt(this,je,[]);Bt(this,Ge);Bt(this,Cn);Bt(this,vi);Bt(this,kn,!1);Bt(this,Mr);Bt(this,wi);Bt(this,Xo,!1);this.type=t,t&&ze(this,st,!0),ze(this,Ge,r),ze(this,et,D(this,Ge)?D(D(this,Ge),et):this),ze(this,Mr,D(this,et)===this?n:D(D(this,et),Mr)),ze(this,vi,D(this,et)===this?[]:D(D(this,et),vi)),t==="!"&&!D(D(this,et),kn)&&D(this,vi).push(this),ze(this,Cn,D(this,Ge)?D(D(this,Ge),je).length:0)}get hasMagic(){if(D(this,st)!==void 0)return D(this,st);for(let t of D(this,je))if(typeof t!="string"&&(t.type||t.hasMagic))return ze(this,st,!0);return D(this,st)}toString(){return D(this,wi)!==void 0?D(this,wi):this.type?ze(this,wi,this.type+"("+D(this,je).map(t=>String(t)).join("|")+")"):ze(this,wi,D(this,je).map(t=>String(t)).join(""))}push(...t){for(let r of t)if(r!==""){if(typeof r!="string"&&!(r instanceof Tt&&D(r,Ge)===this))throw new Error("invalid part: "+r);D(this,je).push(r)}}toJSON(){var r;let t=this.type===null?D(this,je).slice().map(n=>typeof n=="string"?n:n.toJSON()):[this.type,...D(this,je).map(n=>n.toJSON())];return this.isStart()&&!this.type&&t.unshift([]),this.isEnd()&&(this===D(this,et)||D(D(this,et),kn)&&((r=D(this,Ge))==null?void 0:r.type)==="!")&&t.push({}),t}isStart(){var r;if(D(this,et)===this)return!0;if(!((r=D(this,Ge))!=null&&r.isStart()))return!1;if(D(this,Cn)===0)return!0;let t=D(this,Ge);for(let n=0;n<D(this,Cn);n++){let i=D(t,je)[n];if(!(i instanceof Tt&&i.type==="!"))return!1}return!0}isEnd(){var r,n,i;if(D(this,et)===this||((r=D(this,Ge))==null?void 0:r.type)==="!")return!0;if(!((n=D(this,Ge))!=null&&n.isEnd()))return!1;if(!this.type)return(i=D(this,Ge))==null?void 0:i.isEnd();let t=D(this,Ge)?D(D(this,Ge),je).length:0;return D(this,Cn)===t-1}copyIn(t){typeof t=="string"?this.push(t):this.push(t.clone(this))}clone(t){let r=new Tt(this.type,t);for(let n of D(this,je))r.copyIn(n);return r}static fromGlob(t,r={}){var i;let n=new Tt(null,void 0,r);return Tn(i=Tt,Nn,tl).call(i,t,n,0,r),n}toMMPattern(){if(this!==D(this,et))return D(this,et).toMMPattern();let t=this.toString(),[r,n,i,s]=this.toRegExpSource();if(!(i||D(this,st)||D(this,Mr).nocase&&!D(this,Mr).nocaseMagicOnly&&t.toUpperCase()!==t.toLowerCase()))return n;let a=(D(this,Mr).nocase?"i":"")+(s?"u":"");return Object.assign(new RegExp(`^${r}$`,a),{_src:r,_glob:t})}get options(){return D(this,Mr)}toRegExpSource(t){var c;let r=t!=null?t:!!D(this,Mr).dot;if(D(this,et)===this&&Tn(this,xi,Fv).call(this),!this.type){let l=this.isStart()&&this.isEnd(),u=D(this,je).map(f=>{var w;let[h,y,g,b]=typeof f=="string"?Tn(w=Tt,Nn,Bv).call(w,f,D(this,st),l):f.toRegExpSource(t);return ze(this,st,D(this,st)||g),ze(this,nn,D(this,nn)||b),h}).join(""),p="";if(this.isStart()&&typeof D(this,je)[0]=="string"&&!(D(this,je).length===1&&Uk.has(D(this,je)[0]))){let h=Vk,y=r&&h.has(u.charAt(0))||u.startsWith("\\.")&&h.has(u.charAt(2))||u.startsWith("\\.\\.")&&h.has(u.charAt(4)),g=!r&&!t&&h.has(u.charAt(0));p=y?Bk:g?el:""}let d="";return this.isEnd()&&D(D(this,et),kn)&&((c=D(this,Ge))==null?void 0:c.type)==="!"&&(d="(?:$|\\/)"),[p+u+d,Rn(u),ze(this,st,!!D(this,st)),D(this,nn)]}let n=this.type==="*"||this.type==="+",i=this.type==="!"?"(?:(?!(?:":"(?:",s=Tn(this,xi,Of).call(this,r);if(this.isStart()&&this.isEnd()&&!s&&this.type!=="!"){let l=this.toString();return ze(this,je,[l]),this.type=null,ze(this,st,void 0),[l,Rn(this.toString()),!1,!1]}let o=!n||t||r||!el?"":Tn(this,xi,Of).call(this,!0);o===s&&(o=""),o&&(s=`(?:${s})(?:${o})*?`);let a="";if(this.type==="!"&&D(this,Xo))a=(this.isStart()&&!r?el:"")+Dv;else{let l=this.type==="!"?"))"+(this.isStart()&&!r&&!t?el:"")+Lv+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&o?")":this.type==="*"&&o?")?":`)${this.type}`;a=i+s+l}return[a,Rn(s),ze(this,st,!!D(this,st)),D(this,nn)]}};et=new WeakMap,st=new WeakMap,nn=new WeakMap,je=new WeakMap,Ge=new WeakMap,Cn=new WeakMap,vi=new WeakMap,kn=new WeakMap,Mr=new WeakMap,wi=new WeakMap,Xo=new WeakMap,xi=new WeakSet,Fv=function(){if(this!==D(this,et))throw new Error("should only call on root");if(D(this,kn))return this;this.toString(),ze(this,kn,!0);let t;for(;t=D(this,vi).pop();){if(t.type!=="!")continue;let r=t,n=D(r,Ge);for(;n;){for(let i=D(r,Cn)+1;!n.type&&i<D(n,je).length;i++)for(let s of D(t,je)){if(typeof s=="string")throw new Error("string part in extglob AST??");s.copyIn(D(n,je)[i])}r=n,n=D(r,Ge)}}return this},Nn=new WeakSet,tl=function(t,r,n,i){var m,f;let s=!1,o=!1,a=-1,c=!1;if(r.type===null){let h=n,y="";for(;h<t.length;){let g=t.charAt(h++);if(s||g==="\\"){s=!s,y+=g;continue}if(o){h===a+1?(g==="^"||g==="!")&&(c=!0):g==="]"&&!(h===a+2&&c)&&(o=!1),y+=g;continue}else if(g==="["){o=!0,a=h,c=!1,y+=g;continue}if(!i.noext&&Mv(g)&&t.charAt(h)==="("){r.push(y),y="";let b=new Tt(g,r);h=Tn(m=Tt,Nn,tl).call(m,t,b,h,i),r.push(b);continue}y+=g}return r.push(y),h}let l=n+1,u=new Tt(null,r),p=[],d="";for(;l<t.length;){let h=t.charAt(l++);if(s||h==="\\"){s=!s,d+=h;continue}if(o){l===a+1?(h==="^"||h==="!")&&(c=!0):h==="]"&&!(l===a+2&&c)&&(o=!1),d+=h;continue}else if(h==="["){o=!0,a=l,c=!1,d+=h;continue}if(Mv(h)&&t.charAt(l)==="("){u.push(d),d="";let y=new Tt(h,u);u.push(y),l=Tn(f=Tt,Nn,tl).call(f,t,y,l,i);continue}if(h==="|"){u.push(d),d="",p.push(u),u=new Tt(null,r);continue}if(h===")")return d===""&&D(r,je).length===0&&ze(r,Xo,!0),u.push(d),d="",r.push(...p,u),l;d+=h}return r.type=null,ze(r,st,void 0),ze(r,je,[t.substring(n-1)]),l},Of=function(t){return D(this,je).map(r=>{if(typeof r=="string")throw new Error("string type in extglob ast??");let[n,i,s,o]=r.toRegExpSource(t);return ze(this,nn,D(this,nn)||o),n}).filter(r=>!(this.isStart()&&this.isEnd())||!!r).join("|")},Bv=function(t,r,n=!1){let i=!1,s="",o=!1;for(let a=0;a<t.length;a++){let c=t.charAt(a);if(i){i=!1,s+=(zk.has(c)?"\\":"")+c;continue}if(c==="\\"){a===t.length-1?s+="\\\\":i=!0;continue}if(c==="["){let[l,u,p,d]=jv(t,a);if(p){s+=l,o=o||u,a+=p-1,r=r||d;continue}}if(c==="*"){n&&t==="*"?s+=Dv:s+=Lv,r=!0;continue}if(c==="?"){s+=Pf,r=!0;continue}s+=Hk(c)}return[s,Rn(t),!!r,o]},Bt(Tt,Nn);var Ss=Tt;var $f=(e,{windowsPathsNoEscape:t=!1}={})=>t?e.replace(/[?*()[\]]/g,"[$&]"):e.replace(/[?*()[\]\\]/g,"\\$&");var ct=(e,t,r={})=>(Go(t),!r.nocomment&&t.charAt(0)==="#"?!1:new _s(t,r).match(e)),Kk=/^\*+([^+@!?\*\[\(]*)$/,Wk=e=>t=>!t.startsWith(".")&&t.endsWith(e),Yk=e=>t=>t.endsWith(e),Gk=e=>(e=e.toLowerCase(),t=>!t.startsWith(".")&&t.toLowerCase().endsWith(e)),Jk=e=>(e=e.toLowerCase(),t=>t.toLowerCase().endsWith(e)),Xk=/^\*+\.\*+$/,Qk=e=>!e.startsWith(".")&&e.includes("."),Zk=e=>e!=="."&&e!==".."&&e.includes("."),eN=/^\.\*+$/,tN=e=>e!=="."&&e!==".."&&e.startsWith("."),rN=/^\*+$/,nN=e=>e.length!==0&&!e.startsWith("."),iN=e=>e.length!==0&&e!=="."&&e!=="..",sN=/^\?+([^+@!?\*\[\(]*)?$/,oN=([e,t=""])=>{let r=Hv([e]);return t?(t=t.toLowerCase(),n=>r(n)&&n.toLowerCase().endsWith(t)):r},aN=([e,t=""])=>{let r=Kv([e]);return t?(t=t.toLowerCase(),n=>r(n)&&n.toLowerCase().endsWith(t)):r},cN=([e,t=""])=>{let r=Kv([e]);return t?n=>r(n)&&n.endsWith(t):r},lN=([e,t=""])=>{let r=Hv([e]);return t?n=>r(n)&&n.endsWith(t):r},Hv=([e])=>{let t=e.length;return r=>r.length===t&&!r.startsWith(".")},Kv=([e])=>{let t=e.length;return r=>r.length===t&&r!=="."&&r!==".."},Wv=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",Vv={win32:{sep:"\\"},posix:{sep:"/"}},uN=Wv==="win32"?Vv.win32.sep:Vv.posix.sep;ct.sep=uN;var lr=Symbol("globstar **");ct.GLOBSTAR=lr;var pN="[^/]",fN=pN+"*?",dN="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",mN="(?:(?!(?:\\/|^)\\.).)*?",hN=(e,t={})=>r=>ct(r,e,t);ct.filter=hN;var cr=(e,t={})=>Object.assign({},e,t),yN=e=>{if(!e||typeof e!="object"||!Object.keys(e).length)return ct;let t=ct;return Object.assign((n,i,s={})=>t(n,i,cr(e,s)),{Minimatch:class extends t.Minimatch{constructor(i,s={}){super(i,cr(e,s))}static defaults(i){return t.defaults(cr(e,i)).Minimatch}},AST:class extends t.AST{constructor(i,s,o={}){super(i,s,cr(e,o))}static fromGlob(i,s={}){return t.AST.fromGlob(i,cr(e,s))}},unescape:(n,i={})=>t.unescape(n,cr(e,i)),escape:(n,i={})=>t.escape(n,cr(e,i)),filter:(n,i={})=>t.filter(n,cr(e,i)),defaults:n=>t.defaults(cr(e,n)),makeRe:(n,i={})=>t.makeRe(n,cr(e,i)),braceExpand:(n,i={})=>t.braceExpand(n,cr(e,i)),match:(n,i,s={})=>t.match(n,i,cr(e,s)),sep:t.sep,GLOBSTAR:lr})};ct.defaults=yN;var Yv=(e,t={})=>(Go(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:(0,zv.default)(e));ct.braceExpand=Yv;var gN=(e,t={})=>new _s(e,t).makeRe();ct.makeRe=gN;var bN=(e,t,r={})=>{let n=new _s(t,r);return e=e.filter(i=>n.match(i)),n.options.nonull&&!e.length&&e.push(t),e};ct.match=bN;var Uv=/[?*]|[+@!]\(.*?\)|\[|\]/,vN=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),_s=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(t,r={}){Go(t),r=r||{},this.options=r,this.pattern=t,this.platform=r.platform||Wv,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!r.windowsPathsNoEscape||r.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!r.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!r.nonegate,this.comment=!1,this.empty=!1,this.partial=!!r.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=r.windowsNoMagicRoot!==void 0?r.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let t of this.set)for(let r of t)if(typeof r!="string")return!0;return!1}debug(...t){}make(){let t=this.pattern,r=this.options;if(!r.nocomment&&t.charAt(0)==="#"){this.comment=!0;return}if(!t){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],r.debug&&(this.debug=(...s)=>console.error(...s)),this.debug(this.pattern,this.globSet);let n=this.globSet.map(s=>this.slashSplit(s));this.globParts=this.preprocess(n),this.debug(this.pattern,this.globParts);let i=this.globParts.map((s,o,a)=>{if(this.isWindows&&this.windowsNoMagicRoot){let c=s[0]===""&&s[1]===""&&(s[2]==="?"||!Uv.test(s[2]))&&!Uv.test(s[3]),l=/^[a-z]:/i.test(s[0]);if(c)return[...s.slice(0,4),...s.slice(4).map(u=>this.parse(u))];if(l)return[s[0],...s.slice(1).map(u=>this.parse(u))]}return s.map(c=>this.parse(c))});if(this.debug(this.pattern,i),this.set=i.filter(s=>s.indexOf(!1)===-1),this.isWindows)for(let s=0;s<this.set.length;s++){let o=this.set[s];o[0]===""&&o[1]===""&&this.globParts[s][2]==="?"&&typeof o[3]=="string"&&/^[a-z]:$/i.test(o[3])&&(o[2]="?")}this.debug(this.pattern,this.set)}preprocess(t){if(this.options.noglobstar)for(let n=0;n<t.length;n++)for(let i=0;i<t[n].length;i++)t[n][i]==="**"&&(t[n][i]="*");let{optimizationLevel:r=1}=this.options;return r>=2?(t=this.firstPhasePreProcess(t),t=this.secondPhasePreProcess(t)):r>=1?t=this.levelOneOptimize(t):t=this.adjascentGlobstarOptimize(t),t}adjascentGlobstarOptimize(t){return t.map(r=>{let n=-1;for(;(n=r.indexOf("**",n+1))!==-1;){let i=n;for(;r[i+1]==="**";)i++;i!==n&&r.splice(n,i-n)}return r})}levelOneOptimize(t){return t.map(r=>(r=r.reduce((n,i)=>{let s=n[n.length-1];return i==="**"&&s==="**"?n:i===".."&&s&&s!==".."&&s!=="."&&s!=="**"?(n.pop(),n):(n.push(i),n)},[]),r.length===0?[""]:r))}levelTwoFileOptimize(t){Array.isArray(t)||(t=this.slashSplit(t));let r=!1;do{if(r=!1,!this.preserveMultipleSlashes){for(let i=1;i<t.length-1;i++){let s=t[i];i===1&&s===""&&t[0]===""||(s==="."||s==="")&&(r=!0,t.splice(i,1),i--)}t[0]==="."&&t.length===2&&(t[1]==="."||t[1]==="")&&(r=!0,t.pop())}let n=0;for(;(n=t.indexOf("..",n+1))!==-1;){let i=t[n-1];i&&i!=="."&&i!==".."&&i!=="**"&&(r=!0,t.splice(n-1,2),n-=2)}}while(r);return t.length===0?[""]:t}firstPhasePreProcess(t){let r=!1;do{r=!1;for(let n of t){let i=-1;for(;(i=n.indexOf("**",i+1))!==-1;){let o=i;for(;n[o+1]==="**";)o++;o>i&&n.splice(i+1,o-i);let a=n[i+1],c=n[i+2],l=n[i+3];if(a!==".."||!c||c==="."||c===".."||!l||l==="."||l==="..")continue;r=!0,n.splice(i,1);let u=n.slice(0);u[i]="**",t.push(u),i--}if(!this.preserveMultipleSlashes){for(let o=1;o<n.length-1;o++){let a=n[o];o===1&&a===""&&n[0]===""||(a==="."||a==="")&&(r=!0,n.splice(o,1),o--)}n[0]==="."&&n.length===2&&(n[1]==="."||n[1]==="")&&(r=!0,n.pop())}let s=0;for(;(s=n.indexOf("..",s+1))!==-1;){let o=n[s-1];if(o&&o!=="."&&o!==".."&&o!=="**"){r=!0;let c=s===1&&n[s+1]==="**"?["."]:[];n.splice(s-1,2,...c),n.length===0&&n.push(""),s-=2}}}}while(r);return t}secondPhasePreProcess(t){for(let r=0;r<t.length-1;r++)for(let n=r+1;n<t.length;n++){let i=this.partsMatch(t[r],t[n],!this.preserveMultipleSlashes);if(i){t[r]=[],t[n]=i;break}}return t.filter(r=>r.length)}partsMatch(t,r,n=!1){let i=0,s=0,o=[],a="";for(;i<t.length&&s<r.length;)if(t[i]===r[s])o.push(a==="b"?r[s]:t[i]),i++,s++;else if(n&&t[i]==="**"&&r[s]===t[i+1])o.push(t[i]),i++;else if(n&&r[s]==="**"&&t[i]===r[s+1])o.push(r[s]),s++;else if(t[i]==="*"&&r[s]&&(this.options.dot||!r[s].startsWith("."))&&r[s]!=="**"){if(a==="b")return!1;a="a",o.push(t[i]),i++,s++}else if(r[s]==="*"&&t[i]&&(this.options.dot||!t[i].startsWith("."))&&t[i]!=="**"){if(a==="a")return!1;a="b",o.push(r[s]),i++,s++}else return!1;return t.length===r.length&&o}parseNegate(){if(this.nonegate)return;let t=this.pattern,r=!1,n=0;for(let i=0;i<t.length&&t.charAt(i)==="!";i++)r=!r,n++;n&&(this.pattern=t.slice(n)),this.negate=r}matchOne(t,r,n=!1){let i=this.options;if(this.isWindows){let h=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),y=!h&&t[0]===""&&t[1]===""&&t[2]==="?"&&/^[a-z]:$/i.test(t[3]),g=typeof r[0]=="string"&&/^[a-z]:$/i.test(r[0]),b=!g&&r[0]===""&&r[1]===""&&r[2]==="?"&&typeof r[3]=="string"&&/^[a-z]:$/i.test(r[3]),w=y?3:h?0:void 0,x=b?3:g?0:void 0;if(typeof w=="number"&&typeof x=="number"){let[S,T]=[t[w],r[x]];S.toLowerCase()===T.toLowerCase()&&(r[x]=S,x>w?r=r.slice(x):w>x&&(t=t.slice(w)))}}let{optimizationLevel:s=1}=this.options;s>=2&&(t=this.levelTwoFileOptimize(t)),this.debug("matchOne",this,{file:t,pattern:r}),this.debug("matchOne",t.length,r.length);for(var o=0,a=0,c=t.length,l=r.length;o<c&&a<l;o++,a++){this.debug("matchOne loop");var u=r[a],p=t[o];if(this.debug(r,u,p),u===!1)return!1;if(u===lr){this.debug("GLOBSTAR",[r,u,p]);var d=o,m=a+1;if(m===l){for(this.debug("** at the end");o<c;o++)if(t[o]==="."||t[o]===".."||!i.dot&&t[o].charAt(0)===".")return!1;return!0}for(;d<c;){var f=t[d];if(this.debug(`
207
207
  globstar while`,t,d,r,m,f),this.matchOne(t.slice(d),r.slice(m),n))return this.debug("globstar found match!",d,c,f),!0;if(f==="."||f===".."||!i.dot&&f.charAt(0)==="."){this.debug("dot detected!",t,d,r,m);break}this.debug("globstar swallow a segment, and continue"),d++}return!!(n&&(this.debug(`
208
208
  >>> no match, partial?`,t,d,r,m),d===c))}let h;if(typeof u=="string"?(h=p===u,this.debug("string match",u,p,h)):(h=u.test(p),this.debug("pattern match",u,p,h)),!h)return!1}if(o===c&&a===l)return!0;if(o===c)return n;if(a===l)return o===c-1&&t[o]==="";throw new Error("wtf?")}braceExpand(){return Yv(this.pattern,this.options)}parse(t){Go(t);let r=this.options;if(t==="**")return lr;if(t==="")return"";let n,i=null;(n=t.match(rN))?i=r.dot?iN:nN:(n=t.match(Kk))?i=(r.nocase?r.dot?Jk:Gk:r.dot?Yk:Wk)(n[1]):(n=t.match(sN))?i=(r.nocase?r.dot?aN:oN:r.dot?cN:lN)(n):(n=t.match(Xk))?i=r.dot?Zk:Qk:(n=t.match(eN))&&(i=tN);let s=Ss.fromGlob(t,this.options).toMMPattern();return i&&typeof s=="object"&&Reflect.defineProperty(s,"test",{value:i}),s}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let t=this.set;if(!t.length)return this.regexp=!1,this.regexp;let r=this.options,n=r.noglobstar?fN:r.dot?dN:mN,i=new Set(r.nocase?["i"]:[]),s=t.map(c=>{let l=c.map(u=>{if(u instanceof RegExp)for(let p of u.flags.split(""))i.add(p);return typeof u=="string"?vN(u):u===lr?lr:u._src});return l.forEach((u,p)=>{let d=l[p+1],m=l[p-1];u!==lr||m===lr||(m===void 0?d!==void 0&&d!==lr?l[p+1]="(?:\\/|"+n+"\\/)?"+d:l[p]=n:d===void 0?l[p-1]=m+"(?:\\/|"+n+")?":d!==lr&&(l[p-1]=m+"(?:\\/|\\/"+n+"\\/)"+d,l[p+1]=lr))}),l.filter(u=>u!==lr).join("/")}).join("|"),[o,a]=t.length>1?["(?:",")"]:["",""];s="^"+o+s+a+"$",this.negate&&(s="^(?!"+s+").+$");try{this.regexp=new RegExp(s,[...i].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(t){return this.preserveMultipleSlashes?t.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(t)?["",...t.split(/\/+/)]:t.split(/\/+/)}match(t,r=this.partial){if(this.debug("match",t,this.pattern),this.comment)return!1;if(this.empty)return t==="";if(t==="/"&&r)return!0;let n=this.options;this.isWindows&&(t=t.split("\\").join("/"));let i=this.slashSplit(t);this.debug(this.pattern,"split",i);let s=this.set;this.debug(this.pattern,"set",s);let o=i[i.length-1];if(!o)for(let a=i.length-2;!o&&a>=0;a--)o=i[a];for(let a=0;a<s.length;a++){let c=s[a],l=i;if(n.matchBase&&c.length===1&&(l=[o]),this.matchOne(l,c,r))return n.flipNegate?!0:!this.negate}return n.flipNegate?!1:this.negate}static defaults(t){return ct.defaults(t).Minimatch}};ct.AST=Ss;ct.Minimatch=_s;ct.escape=$f;ct.unescape=Rn;var xj=Ue(Tf(),1);function u1(e){return typeof e>"u"||e===null}function wN(e){return typeof e=="object"&&e!==null}function xN(e){return Array.isArray(e)?e:u1(e)?[]:[e]}function SN(e,t){var r,n,i,s;if(t)for(s=Object.keys(t),r=0,n=s.length;r<n;r+=1)i=s[r],e[i]=t[i];return e}function _N(e,t){var r="",n;for(n=0;n<t;n+=1)r+=e;return r}function ON(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var PN=u1,$N=wN,EN=xN,AN=_N,TN=ON,RN=SN,tt={isNothing:PN,isObject:$N,toArray:EN,repeat:AN,isNegativeZero:TN,extend:RN};function p1(e,t){var r="",n=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(r+='in "'+e.mark.name+'" '),r+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!t&&e.mark.snippet&&(r+=`
209
209
 
@@ -242,7 +242,7 @@ globstar while`,t,d,r,m,f),this.matchOne(t.slice(d),r.slice(m),n))return this.de
242
242
  `;function CB(e){return e?ul(e)?rr.join(rr.dirname(e),La):rr.join(e,La):Or?void 0:rr.join(process.cwd(),La)}var hu=class{constructor(t,r){this.rawConfig=t,this.configFile=r,this.ignore={},this._usedRules=new Set,this._usedVersions=new Set,this.plugins=t.plugins||[],this.doNotResolveExamples=!!t.doNotResolveExamples,this.recommendedFallback=t.recommendedFallback||!1,wO(["rules","oas2Rules","oas3_0Rules","oas3_1Rules","async2Rules","async3Rules","arazzo1Rules","overlay1Rules"],t),this.rules={[z.OAS2]:{...t.rules,...t.oas2Rules},[z.OAS3_0]:{...t.rules,...t.oas3_0Rules},[z.OAS3_1]:{...t.rules,...t.oas3_1Rules},[z.Async2]:{...t.rules,...t.async2Rules},[z.Async3]:{...t.rules,...t.async3Rules},[z.Arazzo1]:{...t.rules,...t.arazzo1Rules},[z.Overlay1]:{...t.rules,...t.overlay1Rules}},this.preprocessors={[z.OAS2]:{...t.preprocessors,...t.oas2Preprocessors},[z.OAS3_0]:{...t.preprocessors,...t.oas3_0Preprocessors},[z.OAS3_1]:{...t.preprocessors,...t.oas3_1Preprocessors},[z.Async2]:{...t.preprocessors,...t.async2Preprocessors},[z.Async3]:{...t.preprocessors,...t.async3Preprocessors},[z.Arazzo1]:{...t.arazzo1Preprocessors},[z.Overlay1]:{...t.preprocessors,...t.overlay1Preprocessors}},this.decorators={[z.OAS2]:{...t.decorators,...t.oas2Decorators},[z.OAS3_0]:{...t.decorators,...t.oas3_0Decorators},[z.OAS3_1]:{...t.decorators,...t.oas3_1Decorators},[z.Async2]:{...t.decorators,...t.async2Decorators},[z.Async3]:{...t.decorators,...t.async3Decorators},[z.Arazzo1]:{...t.arazzo1Decorators},[z.Overlay1]:{...t.decorators,...t.overlay1Decorators}},this.extendPaths=t.extendPaths||[],this.pluginPaths=t.pluginPaths||[],this.resolveIgnore(CB(r))}resolveIgnore(t){if(!(!t||!ul(t))){this.ignore=jn(yu.readFileSync(t,"utf-8"))||{},wO(Object.keys(this.ignore),this.ignore);for(let r of Object.keys(this.ignore)){this.ignore[zt(r)?r:rr.resolve(rr.dirname(t),r)]=this.ignore[r];for(let n of Object.keys(this.ignore[r]))this.ignore[r][n]=new Set(this.ignore[r][n]);zt(r)||delete this.ignore[r]}}}saveIgnore(){let t=this.configFile?rr.dirname(this.configFile):process.cwd(),r=rr.join(t,La),n={};for(let i of Object.keys(this.ignore)){let s=zt(i)?i:Zf(rr.relative(t,i)),o=n[s]=this.ignore[i];for(let a of Object.keys(o))o[a]=Array.from(o[a])}yu.writeFileSync(r,RB+cl(n))}addIgnore(t){let r=this.ignore,n=t.location[0];if(n.pointer===void 0)return;let i=r[n.source.absoluteRef]=r[n.source.absoluteRef]||{};(i[t.ruleId]=i[t.ruleId]||new Set).add(n.pointer)}addProblemToIgnore(t){let r=t.location[0];if(r.pointer===void 0)return t;let i=(this.ignore[r.source.absoluteRef]||{})[t.ruleId],s=i&&i.has(r.pointer);return s?{...t,ignored:s}:t}extendTypes(t,r){let n=t;for(let i of this.plugins)if(i.typeExtension!==void 0)switch(r){case z.OAS3_0:case z.OAS3_1:if(!i.typeExtension.oas3)continue;n=i.typeExtension.oas3(n,r);break;case z.OAS2:if(!i.typeExtension.oas2)continue;n=i.typeExtension.oas2(n,r);break;case z.Async2:if(!i.typeExtension.async2)continue;n=i.typeExtension.async2(n,r);break;case z.Async3:if(!i.typeExtension.async3)continue;n=i.typeExtension.async3(n,r);break;case z.Arazzo1:if(!i.typeExtension.arazzo1)continue;n=i.typeExtension.arazzo1(n,r);break;case z.Overlay1:if(!i.typeExtension.overlay1)continue;n=i.typeExtension.overlay1(n,r);break;default:throw new Error("Not implemented")}return n}getRuleSettings(t,r){this._usedRules.add(t),this._usedVersions.add(r);let n=this.rules[r][t]||"off";return typeof n=="string"?{severity:n}:{severity:"error",...n}}getPreprocessorSettings(t,r){this._usedRules.add(t),this._usedVersions.add(r);let n=this.preprocessors[r][t]||"off";return typeof n=="string"?{severity:n==="on"?"error":n}:{severity:"error",...n}}getDecoratorSettings(t,r){this._usedRules.add(t),this._usedVersions.add(r);let n=this.decorators[r][t]||"off";return typeof n=="string"?{severity:n==="on"?"error":n}:{severity:"error",...n}}getUnusedRules(){let t=[],r=[],n=[];for(let i of Array.from(this._usedVersions))t.push(...Object.keys(this.rules[i]).filter(s=>!this._usedRules.has(s))),r.push(...Object.keys(this.decorators[i]).filter(s=>!this._usedRules.has(s))),n.push(...Object.keys(this.preprocessors[i]).filter(s=>!this._usedRules.has(s)));return{rules:t,preprocessors:n,decorators:r}}getRulesForSpecVersion(t){switch(t){case we.OAS3:let r=[];return this.plugins.forEach(c=>{var l;return((l=c.preprocessors)==null?void 0:l.oas3)&&r.push(c.preprocessors.oas3)}),this.plugins.forEach(c=>{var l;return((l=c.rules)==null?void 0:l.oas3)&&r.push(c.rules.oas3)}),this.plugins.forEach(c=>{var l;return((l=c.decorators)==null?void 0:l.oas3)&&r.push(c.decorators.oas3)}),r;case we.OAS2:let n=[];return this.plugins.forEach(c=>{var l;return((l=c.preprocessors)==null?void 0:l.oas2)&&n.push(c.preprocessors.oas2)}),this.plugins.forEach(c=>{var l;return((l=c.rules)==null?void 0:l.oas2)&&n.push(c.rules.oas2)}),this.plugins.forEach(c=>{var l;return((l=c.decorators)==null?void 0:l.oas2)&&n.push(c.decorators.oas2)}),n;case we.Async2:let i=[];return this.plugins.forEach(c=>{var l;return((l=c.preprocessors)==null?void 0:l.async2)&&i.push(c.preprocessors.async2)}),this.plugins.forEach(c=>{var l;return((l=c.rules)==null?void 0:l.async2)&&i.push(c.rules.async2)}),this.plugins.forEach(c=>{var l;return((l=c.decorators)==null?void 0:l.async2)&&i.push(c.decorators.async2)}),i;case we.Async3:let s=[];return this.plugins.forEach(c=>{var l;return((l=c.preprocessors)==null?void 0:l.async3)&&s.push(c.preprocessors.async3)}),this.plugins.forEach(c=>{var l;return((l=c.rules)==null?void 0:l.async3)&&s.push(c.rules.async3)}),this.plugins.forEach(c=>{var l;return((l=c.decorators)==null?void 0:l.async3)&&s.push(c.decorators.async3)}),s;case we.Arazzo1:let o=[];return this.plugins.forEach(c=>{var l;return((l=c.preprocessors)==null?void 0:l.arazzo1)&&o.push(c.preprocessors.arazzo1)}),this.plugins.forEach(c=>{var l;return((l=c.rules)==null?void 0:l.arazzo1)&&o.push(c.rules.arazzo1)}),this.plugins.forEach(c=>{var l;return((l=c.decorators)==null?void 0:l.arazzo1)&&o.push(c.decorators.arazzo1)}),o;case we.Overlay1:let a=[];return this.plugins.forEach(c=>{var l;return((l=c.preprocessors)==null?void 0:l.overlay1)&&a.push(c.preprocessors.overlay1)}),this.plugins.forEach(c=>{var l;return((l=c.rules)==null?void 0:l.overlay1)&&a.push(c.rules.overlay1)}),this.plugins.forEach(c=>{var l;return((l=c.decorators)==null?void 0:l.overlay1)&&a.push(c.decorators.overlay1)}),a}}skipRules(t){for(let r of t||[])for(let n of Object.values(z))if(this.rules[n][r])this.rules[n][r]="off";else if(Array.isArray(this.rules[n].assertions))for(let i of this.rules[n].assertions)i.assertionId===r&&(i.severity="off")}skipPreprocessors(t){for(let r of t||[])for(let n of Object.values(z))this.preprocessors[n][r]&&(this.preprocessors[n][r]="off")}skipDecorators(t){for(let r of t||[])for(let n of Object.values(z))this.decorators[n][r]&&(this.decorators[n][r]="off")}};function wO(e,t){for(let r of e)t[r]&&Ee(t[r])&&"spec"in t[r]&&(pl("spec","struct"),t[r].struct=t[r].spec,delete t[r].spec)}var Ui=class{constructor(t,r){this.rawConfig=t,this.configFile=r,this.apis=t.apis||{},this.styleguide=new hu(t.styleguide||{},r),this.theme=t.theme||{},this.resolve=ey(t==null?void 0:t.resolve),this.telemetry=t.telemetry}};function gu(e,t,r,n){return e.flatMap(i=>Object.keys(i).map(s=>{let o=i[s],a=r==="rules"?t.getRuleSettings(s,n):r==="preprocessors"?t.getPreprocessorSettings(s,n):t.getDecoratorSettings(s,n);if(a.severity==="off")return;let c=a.severity,l=a.message,u=o(a);return Array.isArray(u)?u.map(p=>({severity:c,ruleId:s,message:l,visitor:p})):{severity:c,message:l,ruleId:s,visitor:u}})).flatMap(i=>i).filter(ll)}var NB=Ue(SO(),1);var kB=Ue(Gh(),1);var vu=Ue(require("fs"),1),wu=Ue(require("path"),1);var Fa=class{constructor(t,r,n){this.absoluteRef=t,this.body=r,this.mimeType=n}getAst(t){var r;return this._ast===void 0&&(this._ast=(r=t(this.body,{filename:this.absoluteRef}))!=null?r:void 0,this._ast&&this._ast.kind===0&&this._ast.value===""&&this._ast.startPosition!==1&&(this._ast.startPosition=1,this._ast.endPosition=1)),this._ast}getLines(){return this._lines===void 0&&(this._lines=this.body.split(/\r\n|[\n\r]/g)),this._lines}},bu=class e extends Error{constructor(t){super(t.message),this.originalError=t,Object.setPrototypeOf(this,e.prototype)}},FB=/\((\d+):(\d+)\)$/,Kn=class e extends Error{constructor(t,r){super(t.message.split(`
243
243
  `)[0]),this.originalError=t,this.source=r,Object.setPrototypeOf(this,e.prototype);let[,n,i]=this.message.match(FB)||[];this.line=parseInt(n,10),this.col=parseInt(i,10)}};function zi(e,t){return e+"::"+t}var Wn=class{constructor(t={http:{headers:[]}}){this.config=t,this.cache=new Map}getFiles(){return new Set(Array.from(this.cache.keys()))}resolveExternalRef(t,r){return zt(r)?r:t&&zt(t)?new URL(r,t).href:wu.resolve(t?wu.dirname(t):process.cwd(),r)}async loadExternalRef(t){try{if(zt(t)){let{body:r,mimeType:n}=await Qf(t,this.config.http);return new Fa(t,r,n)}else{if(vu.lstatSync(t).isDirectory())throw new Error(`Expected a file but received a folder at ${t}.`);let r=await vu.promises.readFile(t,"utf-8");return new Fa(t,r.replace(/\r\n/g,`
244
244
  `))}}catch(r){throw r.message=r.message.replace(", lstat",""),new bu(r)}}parseDocument(t,r=!1){var i;let n=t.absoluteRef.substr(t.absoluteRef.lastIndexOf("."));if(![".json",".json",".yml",".yaml"].includes(n)&&!((i=t.mimeType)!=null&&i.match(/(json|yaml|openapi)/))&&!r)return{source:t,parsed:t.body};try{return{source:t,parsed:jn(t.body,{filename:t.absoluteRef})}}catch(s){throw new Kn(s,t)}}async resolveDocument(t,r,n=!1){let i=this.resolveExternalRef(t,r),s=this.cache.get(i);if(s)return s;let o=this.loadExternalRef(i).then(a=>this.parseDocument(a,n));return this.cache.set(i,o),o}};function _O(e,t){return{prev:e,node:t}}function BB(e,t){for(;e;){if(e.node===t)return!0;e=e.prev}return!1}var Da={name:"unknown",properties:{}},VB={name:"scalar",properties:{}};async function Qs(e){let{rootDocument:t,externalRefResolver:r,rootType:n}=e,i=new Map,s=new Set,o=[];c(t.parsed,t,"#/",n);let a;do a=await Promise.all(o);while(o.length!==a.length);return i;function c(l,u,p,d){let m=u.source.absoluteRef,f=new Map;h(l,d,m+p);function h(g,b,w){if(typeof g!="object"||g===null)return;let x=`${b.name}::${w}`;if(s.has(x))return;s.add(x);let[S,T]=Object.entries(g).find(([_])=>_==="$anchor")||[];if(T&&f.set(`#${T}`,g),Array.isArray(g)){let _=b.items;if(_===void 0&&b!==Da&&b!==Dr)return;let P=typeof _=="function";for(let E=0;E<g.length;E++){let F=P?_(g[E],Ei(w,E)):_;F===void 0&&b!==Da&&b!==Dr||h(g[E],an(F)?F:Da,Ei(w,E))}return}for(let _ of Object.keys(g)){let P=g[_],E=b.properties[_];E===void 0&&(E=b.additionalProperties),typeof E=="function"&&(E=E(P,_)),E===void 0&&(E=Da),b.extensionsPrefix&&_.startsWith(b.extensionsPrefix)&&E===Da&&(E=Dr),!an(E)&&(E!=null&&E.directResolveAs)&&(E=E.directResolveAs,P={$ref:P}),E&&E.name===void 0&&E.resolvable!==!1&&(E=VB),!(!an(E)||typeof P!="object")&&h(P,E,Ei(w,Ai(_)))}if(Fe(g)){let _=y(u,g,{prev:null,node:g}).then(P=>{P.resolved&&c(P.node,P.document,P.nodePointer,b)});o.push(_)}if(fl(g)){let _=y(u,{$ref:g.externalValue},{prev:null,node:g}).then(P=>{P.resolved&&c(P.node,P.document,P.nodePointer,b)});o.push(_)}}async function y(g,b,w){if(BB(w.prev,b))throw new Error("Self-referencing circular pointer");if(iw(b.$ref)){await tw();let O={resolved:!0,isRemote:!1,node:f.get(b.$ref),document:g,nodePointer:b.$ref},k=zi(g.source.absoluteRef,b.$ref);return i.set(k,O),O}let{uri:x,pointer:S}=rw(b.$ref),T=x!==null,_;try{_=T?await r.resolveDocument(g.source.absoluteRef,x):g}catch(O){let k={resolved:!1,isRemote:T,document:void 0,error:O},L=zi(g.source.absoluteRef,b.$ref);return i.set(L,k),k}let P={resolved:!0,document:_,isRemote:T,node:g.parsed,nodePointer:"#/"},E=_.parsed,F=S;for(let O of F)if(typeof E!="object"){E=void 0;break}else if(E[O]!==void 0)E=E[O],P.nodePointer=Ei(P.nodePointer,Ai(O));else if(Fe(E)){if(P=await y(_,E,_O(w,E)),_=P.document||_,typeof P.node!="object"){E=void 0;break}E=P.node[O],P.nodePointer=Ei(P.nodePointer,Ai(O))}else{E=void 0;break}P.node=E,P.document=_;let $=zi(g.source.absoluteRef,b.$ref);return P.document&&Fe(E)&&(P=await y(P.document,E,_O(w,E))),i.set($,P),{...P}}}}function xu(e,t,r){var s;let n=e.error;n instanceof Kn&&t({message:"Failed to parse: "+n.message,location:{source:n.source,pointer:void 0,start:{col:n.col,line:n.line}}});let i=(s=e.error)==null?void 0:s.message;t({location:r,message:`Can't resolve $ref${i?": "+i:""}`})}var $O;(function(e){e.empty="empty",e.invalidDefaultValue="invalidDefaultValue"})($O||($O={}));var HB=Ue(Tf(),1);var KB="Schema",WB="Parameter",YB="Response",GB="RequestBody",bae={[KB]:"schemas",[WB]:"parameters",[YB]:"responses",[GB]:"requestBodies"};var BV={Root:"DefinitionRoot",ServerVariablesMap:"ServerVariableMap",Paths:["PathMap","PathsMap"],CallbacksMap:"CallbackMap",MediaTypesMap:"MediaTypeMap",ExamplesMap:"ExampleMap",EncodingMap:"EncodingsMap",HeadersMap:"HeaderMap",LinksMap:"LinkMap",OAuth2Flows:"SecuritySchemeFlows",Responses:"ResponsesMap"};function eo(e,t){let r={};r.any={enter:[],leave:[]};for(let o of Object.keys(t))r[o]={enter:[],leave:[]};r.ref={enter:[],leave:[]};for(let{ruleId:o,severity:a,message:c,visitor:l}of e)s({ruleId:o,severity:a,message:c},l,null);for(let o of Object.keys(r))r[o].enter.sort((a,c)=>c.depth-a.depth),r[o].leave.sort((a,c)=>a.depth-c.depth);return r;function n(o,a,c,l,u=[]){if(u.includes(a))return;u=[...u,a];let p=new Set;for(let m of Object.values(a.properties)){if(m===c){d(o,u);continue}typeof m=="object"&&m!==null&&m.name&&p.add(m)}a.additionalProperties&&typeof a.additionalProperties!="function"&&(a.additionalProperties===c?d(o,u):a.additionalProperties.name!==void 0&&p.add(a.additionalProperties)),a.items&&typeof a.items!="function"&&(a.items===c?d(o,u):a.items.name!==void 0&&p.add(a.items)),a.extensionsPrefix&&p.add(Dr);for(let m of Array.from(p.values()))n(o,m,c,l,u);function d(m,f){for(let h of f.slice(1))r[h.name]=r[h.name]||{enter:[],leave:[]},r[h.name].enter.push({...m,visit:()=>{},depth:0,context:{isSkippedLevel:!0,seen:new Set,parent:l}})}}function i(o,a){if(Array.isArray(a)){let c=a.find(l=>o[l])||void 0;return c&&o[c]}return o[a]}function s(o,a,c,l=0){let u=Object.keys(t);if(l===0)u.push("any"),u.push("ref");else{if(a.any)throw new Error("any() is allowed only on top level");if(a.ref)throw new Error("ref() is allowed only on top level")}for(let p of u){let d=a[p]||i(a,BV[p]),m=r[p];if(!d)continue;let f,h,y,g=typeof d=="object";if(p==="ref"&&g&&d.skip)throw new Error("ref() visitor does not support skip");typeof d=="function"?f=d:g&&(f=d.enter,h=d.leave,y=d.skip);let b={activatedOn:null,type:t[p],parent:c,isSkippedLevel:!1};if(typeof d=="object"&&s(o,d,b,l+1),c&&n(o,c.type,t[p],c),f||g){if(f&&typeof f!="function")throw new Error("DEV: should be function");m.enter.push({...o,visit:f||(()=>{}),skip:y,depth:l,context:b})}if(h){if(typeof h!="function")throw new Error("DEV: should be function");m.leave.push({...o,visit:h,depth:l,context:b})}}}}function VV(e){var r;let t={};for(;e.parent;)t[e.parent.type.name]=(r=e.parent.activatedOn)==null?void 0:r.value.node,e=e.parent;return t}function UV(e){var r,n;let t={};for(;e.parent;)(r=e.parent.activatedOn)!=null&&r.value.location&&(t[e.parent.type.name]=(n=e.parent.activatedOn)==null?void 0:n.value.location),e=e.parent;return t}function Va(e){let{document:t,rootType:r,normalizedVisitors:n,resolvedRefMap:i,ctx:s}=e,o={},a=new Set;c(t.parsed,r,new $i(t.source,"#/"),void 0,"");function c(l,u,p,d,m){var P,E,F,$,O,k,L,q,I,B,N;let f=(C,H=y.source.absoluteRef)=>{if(!Fe(C))return{location:p,node:C};let V=zi(H,C.$ref),re=i.get(V);if(!re)return{location:void 0,node:void 0};let{resolved:he,node:Ve,document:Ce,nodePointer:J,error:ye}=re;return{location:he?new $i(Ce.source,J):ye instanceof Kn?new $i(ye.source,""):void 0,node:Ve,error:ye}},h=p,y=p,{node:g,location:b,error:w}=f(l),x=new Set;if(Fe(l)){let C=n.ref.enter;for(let{visit:H,ruleId:V,severity:re,message:he,context:Ve}of C){x.add(Ve);let Ce=T.bind(void 0,V,re,he);H(l,{report:Ce,resolve:f,rawNode:l,rawLocation:h,location:p,type:u,parent:d,key:m,parentLocations:{},oasVersion:s.oasVersion,getVisitorData:_.bind(void 0,V)},{node:g,location:b,error:w}),b!=null&&b.source.absoluteRef&&s.refTypes&&s.refTypes.set(b==null?void 0:b.source.absoluteRef,u)}}if(g!==void 0&&b&&u.name!=="scalar"){y=b;let C=(E=(P=o[u.name])==null?void 0:P.has)==null?void 0:E.call(P,g),H=!1,re=n.any.enter.concat(((F=n[u.name])==null?void 0:F.enter)||[]),he=[];for(let{context:J,visit:ye,skip:De,ruleId:rn,severity:qe,message:_k}of re){if(a.has(`${y.absolutePointer}${y.pointer}`))break;if(J.isSkippedLevel)J.parent.activatedOn&&!J.parent.activatedOn.value.nextLevelTypeActivated&&!J.seen.has(l)&&(J.seen.add(l),H=!0,he.push(J));else if(J.parent&&J.parent.activatedOn&&(($=J.activatedOn)==null?void 0:$.value.withParentNode)!==J.parent.activatedOn.value.node&&((O=J.parent.activatedOn.value.nextLevelTypeActivated)==null?void 0:O.value)!==u||!J.parent&&!C){he.push(J);let bv={node:g,location:b,nextLevelTypeActivated:null,withParentNode:(L=(k=J.parent)==null?void 0:k.activatedOn)==null?void 0:L.value.node,skipped:(B=((I=(q=J.parent)==null?void 0:q.activatedOn)==null?void 0:I.value.skipped)||(De==null?void 0:De(g,m,{location:p,rawLocation:h,resolve:f,rawNode:l})))!=null?B:!1};J.activatedOn=Jf(J.activatedOn,bv);let Ko=J.parent;for(;Ko;)Ko.activatedOn.value.nextLevelTypeActivated=Jf(Ko.activatedOn.value.nextLevelTypeActivated,u),Ko=Ko.parent;bv.skipped||(H=!0,x.add(J),S(ye,g,l,J,rn,qe,_k))}}if(H||!C){if(o[u.name]=o[u.name]||new Set,o[u.name].add(g),Array.isArray(g)){let J=u.items;if(J!==void 0){let ye=typeof J=="function";for(let De=0;De<g.length;De++){let rn=ye?J(g[De],b.child([De]).absolutePointer):J;an(rn)&&c(g[De],rn,b.child([De]),g,De)}}}else if(typeof g=="object"&&g!==null){let J=Object.keys(u.properties);u.additionalProperties?J.push(...Object.keys(g).filter(ye=>!J.includes(ye))):u.extensionsPrefix&&J.push(...Object.keys(g).filter(ye=>ye.startsWith(u.extensionsPrefix))),Fe(l)&&J.push(...Object.keys(l).filter(ye=>ye!=="$ref"&&!J.includes(ye)));for(let ye of J){let De=g[ye],rn=b;De===void 0&&(De=l[ye],rn=p);let qe=u.properties[ye];qe===void 0&&(qe=u.additionalProperties),typeof qe=="function"&&(qe=qe(De,ye)),qe===void 0&&u.extensionsPrefix&&ye.startsWith(u.extensionsPrefix)&&(qe=Dr),!an(qe)&&(qe!=null&&qe.directResolveAs)&&(qe=qe.directResolveAs,De={$ref:De}),qe&&qe.name===void 0&&qe.resolvable!==!1&&(qe={name:"scalar",properties:{}}),!(!an(qe)||qe.name==="scalar"&&!Fe(De))&&c(De,qe,rn.child([ye]),g,ye)}}}let Ve=n.any.leave,Ce=(((N=n[u.name])==null?void 0:N.leave)||[]).concat(Ve);for(let J of he.reverse())if(J.isSkippedLevel)J.seen.delete(g);else if(J.activatedOn=Xf(J.activatedOn),J.parent){let ye=J.parent;for(;ye;)ye.activatedOn.value.nextLevelTypeActivated=Xf(ye.activatedOn.value.nextLevelTypeActivated),ye=ye.parent}for(let{context:J,visit:ye,ruleId:De,severity:rn,message:qe}of Ce)!J.isSkippedLevel&&x.has(J)&&S(ye,g,l,J,De,rn,qe)}if(y=p,Fe(l)){let C=n.ref.leave;for(let{visit:H,ruleId:V,severity:re,context:he,message:Ve}of C)if(x.has(he)){let Ce=T.bind(void 0,V,re,Ve);H(l,{report:Ce,resolve:f,rawNode:l,rawLocation:h,location:p,type:u,parent:d,key:m,parentLocations:{},oasVersion:s.oasVersion,getVisitorData:_.bind(void 0,V)},{node:g,location:b,error:w})}}function S(C,H,V,re,he,Ve,Ce){let J=T.bind(void 0,he,Ve,Ce);C(H,{report:J,resolve:f,rawNode:V,location:y,rawLocation:h,type:u,parent:d,key:m,parentLocations:UV(re),oasVersion:s.oasVersion,ignoreNextVisitorsOnNode:()=>{a.add(`${y.absolutePointer}${y.pointer}`)},getVisitorData:_.bind(void 0,he)},VV(re),re)}function T(C,H,V,re){let Ve=(re.location?Array.isArray(re.location)?re.location:[re.location]:[{...y,reportOnKey:!1}]).map(J=>({...y,reportOnKey:!1,...J})),Ce=re.forceSeverity||H;Ce!=="off"&&s.problems.push({ruleId:re.ruleId||C,severity:Ce,...re,message:V?V.replace("{{message}}",re.message):re.message,suggest:re.suggest||[],location:Ve})}function _(C){return s.visitorsData[C]=s.visitorsData[C]||{},s.visitorsData[C]}}}var CO=()=>{let e=new Map;function t(n,i,s){var o,a;e.set(n.absolutePointer,{usedIn:(a=(o=e.get(n.absolutePointer))==null?void 0:o.usedIn)!=null?a:[],componentType:i,name:s})}function r(n,i){let s=i.length;for(let[o,{usedIn:a,name:c,componentType:l}]of e)!a.some(p=>!i.some(d=>p.absolutePointer.startsWith(d)&&(p.absolutePointer.length===d.length||p.absolutePointer[d.length]==="/")))&&l&&(i.push(o),delete n[l][c],e.delete(o),on(n[l])&&delete n[l]);return i.length>s?r(n,i):i.length}return{ref:{leave(n,{location:i,type:s,resolve:o,key:a}){if(["Schema","Parameter","Response","SecurityScheme"].includes(s.name)){let c=o(n);if(!c.location)return;let[l,u]=c.location.absolutePointer.split("#",2),p=u.split("/").slice(0,3).join("/"),d=`${l}#${p}`,m=e.get(d);m?m.usedIn.push(i):e.set(d,{usedIn:[i],name:a.toString()})}}},Root:{leave(n,i){let s=i.getVisitorData();s.removedCount=r(n,[])}},NamedSchemas:{Schema(n,{location:i,key:s}){n.allOf||t(i,"definitions",s.toString())}},NamedParameters:{Parameter(n,{location:i,key:s}){t(i,"parameters",s.toString())}},NamedResponses:{Response(n,{location:i,key:s}){t(i,"responses",s.toString())}},NamedSecuritySchemes:{SecurityScheme(n,{location:i,key:s}){t(i,"securityDefinitions",s.toString())}}}};var kO=()=>{let e=new Map;function t(n,i,s){var o,a;e.set(n.absolutePointer,{usedIn:(a=(o=e.get(n.absolutePointer))==null?void 0:o.usedIn)!=null?a:[],componentType:i,name:s})}function r(n,i){let s=i.length;for(let[o,{usedIn:a,name:c,componentType:l}]of e)if(!a.some(p=>!i.some(d=>p.absolutePointer.startsWith(d)&&(p.absolutePointer.length===d.length||p.absolutePointer[d.length]==="/")))&&l&&n.components){i.push(o);let p=n.components[l];delete p[c],e.delete(o),on(p)&&delete n.components[l]}return i.length>s?r(n,i):i.length}return{ref:{leave(n,{location:i,type:s,resolve:o,key:a}){if(["Schema","Header","Parameter","Response","Example","RequestBody"].includes(s.name)){let c=o(n);if(!c.location)return;let[l,u]=c.location.absolutePointer.split("#",2),p=u.split("/").slice(0,4).join("/"),d=`${l}#${p}`,m=e.get(d);m?m.usedIn.push(i):e.set(d,{usedIn:[i],name:a.toString()})}}},Root:{leave(n,i){let s=i.getVisitorData();s.removedCount=r(n,[]),on(n.components)&&delete n.components}},NamedSchemas:{Schema(n,{location:i,key:s}){n.allOf||t(i,"schemas",s.toString())}},NamedParameters:{Parameter(n,{location:i,key:s}){t(i,"parameters",s.toString())}},NamedResponses:{Response(n,{location:i,key:s}){t(i,"responses",s.toString())}},NamedExamples:{Example(n,{location:i,key:s}){t(i,"examples",s.toString())}},NamedRequestBodies:{RequestBody(n,{location:i,key:s}){t(i,"requestBodies",s.toString())}},NamedHeaders:{Header(n,{location:i,key:s}){t(i,"headers",s.toString())}}}};var NO;(function(e){e.Version2="oas2",e.Version3_0="oas3_0",e.Version3_1="oas3_1"})(NO||(NO={}));var Lde=eo([{severity:"error",ruleId:"configBundler",visitor:{ref:{leave(e,t,r){ay(e,r,t)}}}}],Zh);async function cy(e){var o;let{ref:t,doc:r,externalRefResolver:n=new Wn(e.config.resolve),base:i=null}=e;if(!(t||r))throw new Error(`Document or reference is required.
245
- `);let s=r===void 0?await n.resolveDocument(i,t,!0):r;if(s instanceof Error)throw s;return(o=e.collectSpecData)==null||o.call(e,s.parsed),qO({document:s,...e,config:e.config.styleguide,externalRefResolver:n})}async function qO(e){let{document:t,config:r,customTypes:n,externalRefResolver:i,dereference:s=!1,removeUnusedComponents:o=!1,keepUrlRefs:a=!1}=e,c=la(t.parsed),l=Pl(c),u=r.getRulesForSpecVersion(l),p=Rs(r.extendTypes(n!=null?n:ki(c),c),r),d=gu(u,r,"preprocessors",c),m=gu(u,r,"decorators",c),f={problems:[],oasVersion:c,refTypes:new Map,visitorsData:{}};o&&m.push({severity:"error",ruleId:"remove-unused-components",visitor:l===we.OAS2?CO({}):kO({})});let h=await Qs({rootDocument:t,rootType:p.Root,externalRefResolver:i});d.length>0&&(Va({document:t,rootType:p.Root,normalizedVisitors:eo(d,p),resolvedRefMap:h,ctx:f}),h=await Qs({rootDocument:t,rootType:p.Root,externalRefResolver:i}));let y=eo([{severity:"error",ruleId:"bundler",visitor:zV(l,s,t,h,a)},...m],p);return Va({document:t,rootType:p.Root,normalizedVisitors:y,resolvedRefMap:h,ctx:f}),{bundle:t,problems:f.problems.map(g=>r.addProblemToIgnore(g)),fileDependencies:i.getFiles(),rootType:p.Root,refTypes:f.refTypes,visitorsData:f.visitorsData}}function oy(e,t){switch(t){case we.OAS3:switch(e){case"Schema":return"schemas";case"Parameter":return"parameters";case"Response":return"responses";case"Example":return"examples";case"RequestBody":return"requestBodies";case"Header":return"headers";case"SecuritySchema":return"securitySchemes";case"Link":return"links";case"Callback":return"callbacks";default:return null}case we.OAS2:switch(e){case"Schema":return"definitions";case"Parameter":return"parameters";case"Response":return"responses";default:return null}case we.Async2:switch(e){case"Schema":return"schemas";case"Parameter":return"parameters";default:return null}case we.Async3:switch(e){case"Schema":return"schemas";case"Parameter":return"parameters";default:return null}case we.Arazzo1:switch(e){case"Root.workflows_items.parameters_items":case"Root.workflows_items.steps_items.parameters_items":return"parameters";default:return null}case we.Overlay1:return null}}function ay(e,t,r){if(!Ee(t.node))r.parent[r.key]=t.node;else{delete e.$ref;let n=Object.assign({},t.node,e);Object.assign(e,n)}}function zV(e,t,r,n,i){let s,o,a={ref:{leave(d,m,f){if(!f.location||f.node===void 0){xu(f,m.report,m.location);return}if(f.location.source===r.source&&f.location.source===m.location.source&&m.type.name!=="scalar"&&!t||i&&zt(d.$ref))return;let h=oy(m.type.name,e);h?t?(l(h,f,m),ay(d,f,m)):(d.$ref=l(h,f,m),c(d,f,m)):ay(d,f,m)}},Example:{leave(d,m){if(fl(d)&&d.value===void 0){let f=m.resolve({$ref:d.externalValue});if(!f.location||f.node===void 0){xu(f,m.report,m.location);return}if(i&&zt(d.externalValue))return;d.value=m.resolve({$ref:d.externalValue}).node,delete d.externalValue}}},Root:{enter(d,m){o=m.location,e===we.OAS3?s=d.components=d.components||{}:e===we.OAS2?s=d:e===we.Async2?s=d.components=d.components||{}:e===we.Async3?s=d.components=d.components||{}:e===we.Arazzo1&&(s=d.components=d.components||{})}}};e===we.OAS3&&(a.DiscriminatorMapping={leave(d,m){for(let f of Object.keys(d)){let h=d[f],y=m.resolve({$ref:h});if(!y.location||y.node===void 0){xu(y,m.report,m.location.child(f));return}let g=oy("Schema",e);d[f]=l(g,y,m)}}});function c(d,m,f){let h=zi(f.location.source.absoluteRef,d.$ref);n.set(h,{document:r,isRemote:!1,node:m.node,nodePointer:d.$ref,resolved:!0})}function l(d,m,f){s[d]=s[d]||{};let h=p(m,d,f);return s[d][h]=m.node,e===we.OAS3||e===we.Async2||e===we.Async3?`#/components/${d}/${h}`:`#/${d}/${h}`}function u(d,m,f){var h;return Fe(d)&&((h=f.resolve(d,o.absolutePointer).location)==null?void 0:h.absolutePointer)===m.location.absolutePointer?!0:na(d,m.node)}function p(d,m,f){let[h,y]=[d.location.source.absoluteRef,d.location.pointer],g=s[m],b="",w=y.slice(2).split("/").filter(Ln);for(;w.length>0;)if(b=w.pop()+(b?`-${b}`:""),!g||!g[b]||u(g[b],d,f))return b;if(b=nw(h)+(b?`_${b}`:""),!g[b]||u(g[b],d,f))return b;let x=b,S=2;for(;g[b]&&!u(g[b],d,f);)b=`${x}-${S}`,S++;return g[b]||f.report({message:`Two schemas are referenced with the same name but different content. Renamed ${x} to ${b}.`,location:f.location,forceSeverity:"warn"}),b}return a}var r$=Ue(t$(),1);var Bme={warn:e=>Rt.bgYellow(Rt.black(e)),error:Rt.bgRed},Vme={warn:Rt.yellow,error:Rt.red};var k7=Ue(Md(),1);async function n$(e){let t={config:new Ui({}),dereference:!0};if(typeof e=="string"&&(t.ref=e),typeof e=="object"){if(e["x-redocly-dereferenced"])return e;t.doc={source:{absoluteRef:"/"},parsed:e}}let{bundle:{parsed:r}}=await cy(t);return r["x-redocly-dereferenced"]=!0,r}var tT=Ue(eT());async function rT(e){return tY(e)?rY(e):e}function tY(e){return e.swagger!==void 0}async function rY(e){let{openapi:t}=await tT.convertObj(e,{patch:!0,warnOnly:!0,text:"{}",anchors:!0});return t}function nT(e,t){return t.every(r=>e.includes(r))}var nY=["origin","access-control-request-method","access-control-request-headers"];function iT(e){let t=Object.keys(e.headers).map(r=>r.toLowerCase());return e.method==="OPTIONS"&&nT(t,nY)}function oT(e=[],t=[]){return Object.values({...sT(e),...sT(t)})}function sT(e){return Object.fromEntries(e.map(t=>[t.name,t]))}function Oo(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var m0=/{(.+)}/,h0=/\\\{[^\\]+\\\}/g;function aT(e,t){let r=e==null?void 0:e[t];if(r)return{...r,pathTemplate:t};let n=xc(t);for(let i of Object.keys(e)){let s=xc(i);if(iY(s,n))return{...e[i],pathTemplate:i}}return null}function iY(e,t){let r=e.length;if(r!==t.length)return!1;for(let n=0;n<r;n++)if(!sY(e[n],t[n]))return!1;return!0}function sY(e,t){if(!m0.test(e))return t===e;let n=Oo(e).replace(h0,"(.*)");return new RegExp(n).test(t)}function xc(e){return e.slice(1).split("/").map(t=>{if(!t)return t;try{return decodeURIComponent(t)}catch{return t}})}function cT(e){let{responses:t}=e;if(!t)throw new Pe("Operation does not specify any response.");return oY(t)||aY(t)||cY(t)}function oY(e){let t=Object.keys(e).filter(n=>Number(n)>=200&&Number(n)<300).sort()[0];return t?{...e[t],statusCode:Number(t)}:null}function aY(e){let t=e.default;return t?{...t,statusCode:200}:null}function cY(e){let t=Object.keys(e)[0];return{...e[t],statusCode:Number(t)}}var lT=e=>{return r=>{let n=["message","error","summary","description","detail","title","problem","failure","fault"];if(typeof r=="object"&&!Array.isArray(r)){for(let i of n)if(t(r,i,1))break}};function t(r,n,i){if(typeof r[n]=="string"||r[n]===null)return r[n]=e.message,!0;for(let s of Object.keys(r)){let o=Array.isArray(r[s])?r[s][0]:r[s];if(typeof o=="object"&&o!==null&&!Array.isArray(o)&&i<3)return t(o,n,i+1)}return!1}};var uT=e=>t=>{if(!t||!e)return;typeof t=="object"&&typeof e=="object"&&r(t,e);function r(n,i){Object.keys(n).forEach(s=>{let o=n[s],a=i[s];if(a==null||!(typeof o==typeof a))return;if(["string","number","boolean"].includes(typeof a)){n[s]=i[s];return}return r(o,a)})}};var lY="Validation Error: The forced X-Redocly-Response-Status header's value should be a number.",uY="Range Error: Status code is out of range in forced X-Redocly-Response-Status header.";function pT(e){let t=Number(e["x-redocly-response-status"]);if(isNaN(t))throw new Pe(lY);if(t<100||t>999)throw new Pe(uY);return t}function Po(e){return e["x-redocly-response-body-example"]}var mT=Ue(dT());function Sc(e,t){return mT.sample(e,{quiet:!0,format:(t==null?void 0:t.type)==="application/xml"?"xml":"json"})}var pY="The desired example was not found";function hT(e,t,r){var i;let n=t&&e&&t[e];if(n)return n.value;if(e&&r)throw new Pe(pY);return t&&((i=Object.values(t)[0])==null?void 0:i.value)}var Ze=class extends Error{constructor(r,n){super(n);this.statusCodes=r;this.message=n}},Op=class extends Ze{constructor(r){super([404,400],`Path ${r} not found`);this.path=r}},Pp=class extends Ze{constructor(r,n){super([405,400],`Method "${r}" is not supported by the target path "${n}"`);this.method=r;this.path=n}},$p=class extends Ze{constructor(){super([400,422],"Body is required, but it is missing from the request")}},Ep=class extends Ze{constructor(){super([400],"Body is required, but the Content-Type header is missing from the request")}},Ap=class extends Ze{constructor(r,n){super([400,422],`Required ${r} parameter "${n}" is missing`);this.paramType=r;this.paramName=n}},Tp=class extends Ze{constructor(r){super([415,400],`Media type "${r}" is not supported`);this.mediaType=r}},Rp=class extends Ze{constructor(r,n,i){super([422,400],`Error validating ${r} parameter "${n}". ${i}`);this.paramType=r;this.paramName=n;this.validationError=i}},Cp=class extends Ze{constructor(r){super([422,400],`Error validating body. ${r}`);this.validationError=r}},kp=class extends Ze{constructor(r){super([401,400],`Not authenticated. Supported authentication types: ${r}.`);this.authenticationTypes=r}},Pe=class extends Ze{constructor(t){super([500],`Mock server error. ${t}`)}},Np=class extends Ze{constructor(t){super([400],`Body deserialization error. ${t}`)}},Ip=class extends Ze{constructor(t){super([400],`Parameter deserialization error. ${t}`)}};var yT=["application/json","application/xml","text/plain","application/vnd.api+json","application/problem+json","*/*"];function gT(e){return e.split(";")[0]}function fY(e,t){return e&&yT.includes(e)?e:t.length?t.find(r=>yT.includes(gT(r))):"application/json"}function bT(e,t){let r=Object.keys(e),n=fY(t,r);if(!n)throw new Pe("Could not generate response. No supported media type found in definition.");return{...e[n],mediaType:gT(n)}}function _c(e,t=!1){let r={};for(let n=0;n<e.length;n+=2){let i=t?e[n].toLowerCase():e[n],s=e[n+1];r[i]=s}return r}function qp(e,t){let r={};for(let n of e){let[i,s]=n.split(t);r[i]=s}return r}function vT(e,t,r){if((r==null?void 0:r.type)==="array")return e?e.split(","):[];if((r==null?void 0:r.type)==="object"){let n=e.split(",");return t?qp(n,"="):_c(n)}return e}function wT(e){return e!=null&&typeof e=="object"}function xT(e,t){return Array.isArray(e)?dY(e):wT(e)?mY(e,t):hY(e)}function dY(e){return e.join(",")}function mY(e,t){let r=t?"=":",";return Object.entries(e).map(n=>n.join(r)).join(",")}function hY(e){return String(e)}function ST(e,t,r){switch(t){case"simple":return xT(e,r);default:throw new Pe(`Serialization style ${t} is not supported.`)}}function _T(e,t,r){if(!e)return;let n=r==null?void 0:r.type;return n==="array"?t?yY(e):gY(e):n==="object"?t?bY(e):vY(e):Array.isArray(e)?e[e.length-1]:e}function yY(e){return Array.isArray(e)?e:[e]}function gY(e){return(Array.isArray(e)?e.pop():e).split(",")}function bY(e){let t=Array.isArray(e)?e.join(""):e;return qp(t.split("&"),"=")}function vY(e){let t=(Array.isArray(e)?e.pop()||"":e).split(",");return _c(t)}function OT(e,t,r,n){if(r==="simple")return vT(e,n,t);if(r==="form")return _T(e,n,t);throw new Pe(`Deserialization style ${r} is not supported.`)}function g0(e){return JSON.stringify(e)}function ui(e,t="utf-8"){let r=g0(e);return Buffer.from(r,t)}function b0(e){return String(e)}function PT(e,t){let r=b0(e);return Buffer.from(r,t)}function $T(e){return typeof e=="string"?e:JSON.stringify(e)}function ET(e,t){return Buffer.from(e,t)}function AT(e,t){var r;if(t.type==="application/json"||(r=t.type)!=null&&r.endsWith("+json"))return g0(e);if(t.type==="text/plain")return b0(e);if(t.type==="application/xml")return $T(e);throw new Pe(`Media type ${t.type} is not supported.`)}function v0(e,t){var n;let r=t.parameters.charset||"utf-8";if(t.type==="application/json"||(n=t.type)!=null&&n.endsWith("+json")||t.type==="*/*")return ui(e);if(t.type==="text/plain")return PT(e,r);if(t.type==="application/xml")return ET(e,r);throw new Pe(`Media type ${t.type} is not supported.`)}function TT(e,t){let r=w0(e.toString(t));return xY(wY(r))}function w0(e){let t={};for(let r of e.split("&")){let[n,...i]=r.split("="),s=i.length>0?i.join("="):void 0;t[n]===void 0&&(t[n]=[]),s&&t[n].push(s)}return t}function wY(e){let t={};for(let[r,n]of Object.entries(e))t[decodeURIComponent(r)]=n.map(decodeURIComponent);return t}function xY(e){let t={};for(let r of Object.keys(e)){let n=r.match(/[^[]*/i);if(!n)continue;let i=r.match(/\[.*?\]/g)||[];i=[n[0]].concat(i).map(function(o){return o.replace(/\[|\]/g,"")});let s=t;for(;i.length;){let o=i.shift();o&&(o in s||(s[o]=i.length?isNaN(+i[0])&&{}||[]:e[r].join("")),s=s[o])}}return t}function RT(e,t){return JSON.parse(e.toString(t))}function CT(e,t){return e.toString(t)}function kT(e,t){return e.toString(t)}function NT(e,t){let r=t.type,n=t.parameters.charset;if(r==="text/plain")return CT(e,n);if(r==="application/json"||r!=null&&r.endsWith("+json"))return RT(e,n);if(r==="application/x-www-form-urlencoded")return TT(e,n);if(r==="application/xml")return kT(e,n);throw new Pe(`Media type ${t.type} deserialization is not supported.`)}var IT=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,SY=/\\([\u000b\u0020-\u00ff])/g,_Y=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;function pi(e){if(!e)throw new Error("argument mediaType is required");let t=e.indexOf(";"),r=t!==-1?e.substring(0,t).trim():e.trim();if(!_Y.test(r))throw new Error("invalid media type");let n={};if(t!==-1){let i,s,o;for(IT.lastIndex=t;s=IT.exec(e);){if(s.index!==t)throw new Error("invalid parameter format");t+=s[0].length,i=s[1].toLowerCase(),o=s[2],o[0]==='"'&&(o=o.substring(1,o.length-2).replace(SY,"$1")),n[i]=o}if(t!==e.length)throw new Error("invalid parameter format")}return{type:r,parameters:n}}function qT(e,t,r){let{mediaType:n,schema:i,example:s,examples:o}=bT(e,t==null?void 0:t.contentType),a=pi(n),c=t==null?void 0:t.exampleId,l=hT(c,o,r==null?void 0:r.errorIfForcedExampleNotFound)||s;if(l&&(r!=null&&r.strictExamples))return{mediaType:n,data:v0(l,a)};let u=l||Sc(i,a);return t!=null&&t.enhancers&&t.enhancers.forEach(p=>p(u)),{mediaType:n,data:v0(u,a)}}function x0(e,t){var r;return e||t&&((r=Object.values(t)[0])==null?void 0:r.value)}function jT(e){let{schema:t,content:r}=e;if(t)return OY(t,e);if(r)return PY(r);throw new Pe("Response header specifies no schema nor content.")}function OY(e,t){let{example:r,examples:n,style:i="simple",explode:s=!0}=t,o=x0(r,n)||Sc(e);return ST(o,i,s)}function PY(e){let[[t,r]]=Object.entries(e),{example:n,examples:i,schema:s}=r,o=pi(t),a=x0(n,i)||Sc(s);return AT(a,o)}function $o(e,t,r){let{statusCode:n,headers:i,content:s}=e,o=s&&qT(s,t,r),a=$Y(i,o==null?void 0:o.mediaType);return{statusCode:n,headers:a,body:o==null?void 0:o.data}}function $Y(e,t){let r=e&&EY(e),n={...t&&{"Content-Type":t}};return{...r,...n}}function EY(e){let t=Object.entries(e).map(([r,n])=>[r,jT(n)]);return Object.fromEntries(t)}function MT(e,t,r,n){var a;let i=cT(r),s=Po(t),o=[];return e.requestBody&&o.push(uT(e.requestBody)),$o(i,{exampleId:s,enhancers:o,contentType:(a=e==null?void 0:e.headers)==null?void 0:a["content-type"]},n)}function Oc(e,t){return{statusCode:e,body:ui({message:t}),headers:{"Content-Type":"application/json"}}}function LT(e,t){let{responses:r}=e;if(!r)return null;let n=t.find(i=>r[i]);return n?{...r[n],statusCode:n}:null}function DT(e,t,r,n){let i=LT(t,e.statusCodes);return i&&i.content?$o(i,r,n):Oc(e.statusCodes[0],e.message)}function FT(e,t,r,{throwUnexpected:n=!1}={},i){if(e instanceof Ze){let s=t&&Po(t),o=[lT(e)];return AY(e,r,{exampleId:s,enhancers:o},i)}if(n)throw e;return Oc(500,"Mock server encountered an internal error while handling your request: "+e.message)}function AY(e,t,r,n){return t?DT(e,t,r,n):Oc(e.statusCodes[0],e.message)}function BT(e,t){let{responses:r}=t;if(!r)return null;let n=r[e];return n?{...n,statusCode:e}:null}var TY=[100,101,102,103,200,201,202,203,204,205,206,207,208,226,300,301,302,303,304,307,308,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,421,422,423,424,425,426,428,429,431,451,500,501,502,503,504,505,506,507,508,510,511],S0="The X-Redocly-Response-Status header was detected. Forced response with status code",VT=TY.reduce((e,t)=>({...e,[t]:{statusCode:t,body:ui({message:`${S0} ${t}.`}),headers:{"Content-Type":"application/json"}}}),{});function UT(e){let t=VT[e];return t||{statusCode:e,body:ui({message:`${S0} ${e}`}),headers:{"Content-Type":"application/json"}}}function zT(e,t,r){let n=pT(e),i=Po(e),s=t&&BT(n,t);return s?$o(s,{exampleId:i},r):UT(n)}function jp(e,t){let{path:r,method:n}=t,{paths:i}=e,s=i&&aT(i,r);if(!s)throw new Op(r);let o=s[n.toLocaleLowerCase()];if(!o)throw new Pp(n,r);return{...o,parameters:oT(s.parameters,o.parameters),pathTemplate:s.pathTemplate}}function HT(e){if(!e||!e.headers)return{};let t=["x-redocly-response-status","x-redocly-response-body-example","x-redocly-cookie"],r={};for(let n of t)e.headers[n]&&(r[n]=e.headers[n]);return r}function KT(e){return e["x-redocly-response-status"]!==void 0}function WT(e,t,r,n){let i=RY(r,e);return zT(t,i,n)}function RY(e,t){try{return jp(e,t)}catch{return}}function YT(e,t){let{in:r,name:n}=t;switch(r){case"query":return CY(e,n);case"header":return kY(e,n);case"cookie":return NY(e,n);default:throw new Pe(`Api key location "${r}" is not supported.`)}}function CY(e,t){return!!e.query&&GT(t).test(e.query)}function kY(e,t){return!!e.headers[t.toLowerCase()]}function NY(e,t){let r=e.headers.cookie;return!!r&&GT(t).test(r)}function GT(e){return new RegExp(`${Oo(e)}=.+`)}function Eo(e){let t=e.headers.authorization;if(!t)return!1;let[r,n]=t.split(" ");return r.toLowerCase()==="bearer"&&IY(n)}function IY(e){return!!e&&e.length>0}function JT(e){let t=e.headers.authorization;if(!t)return!1;let[r,n]=t.split(" ");return r.toLowerCase()==="basic"&&qY(n)}function qY(e){return!!e&&Buffer.from(e,"base64").toString().split(":").length===2}var jY=[/username=.+/,/response=.+/];function XT(e){let t=e.headers.authorization;if(!t)return!1;let[r,...n]=t.split(" ");return r.toLowerCase()==="digest"&&MY(n.join(""))}function MY(e){return jY.every(t=>t.test(e))}function QT(e,t){let{scheme:r}=t;switch(r){case"basic":return JT(e);case"bearer":return Eo(e);case"digest":return XT(e);default:throw new Pe(`Http authentication schema "${r}" is not supported.`)}}function ZT(e){return Eo(e)}function eR(e){return Eo(e)}function tR(e,t){switch(t.type){case"apiKey":return YT(e,t);case"http":return QT(e,t);case"oauth2":return ZT(e);case"openIdConnect":return eR(e)}}function rR(e){return e!=null}function nR(e,t,r){let n=DY(t,r),i=FY(r);if(!(n.some(o=>LY(e,o,i))||n.length===0))throw new kp(n.map(o=>Object.keys(o)[0]))}function LY(e,t,r){return Object.keys(t).map(n=>r[n]).filter(rR).every(n=>tR(e,n))}function DY(e,t){return e.security||t.security||[]}function FY(e){var t;return((t=e.components)==null?void 0:t.securitySchemes)||{}}function sR(e,t){let r=null;for(let[n,i]of Object.entries(t)){let s=pi(n).type;if(s===e)return i;let o=s.split("/"),a=e.split("/");if(o[0]!==a[0]){o[0]==="*"&&(r!=null||(r=i));continue}let c=o[1];if(iR(c)===iR(a[1]))return i;c==="*"&&(r=i)}return r}function iR(e=""){return e.split("+").pop()}var yv=Ue(gR());var Lp={};wf(Lp,{$id:()=>gG,$schema:()=>yG,default:()=>SG,definitions:()=>vG,properties:()=>xG,title:()=>bG,type:()=>wG});var yG="http://json-schema.org/draft-07/schema#",gG="http://json-schema.org/draft-07/schema#",bG="Core schema meta-schema",vG={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:[]}},wG=["object","boolean"],xG={$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:"#"}},SG={$schema:yG,$id:gG,title:bG,definitions:vG,type:wG,properties:xG,default:!0};var gv=Ue(ik()),sk={strict:!1,allErrors:!0,discriminator:!0},mv=new yv.default(sk).addMetaSchema(Lp);(0,gv.default)(mv);var hv=new yv.default({...sk,coerceTypes:!0}).addMetaSchema(Lp);(0,gv.default)(hv);function ok(e,t){return mv.validate(t,e)?null:mv.errorsText()}function ak(e,t){return t?hv.validate(t,e)?null:hv.errorsText():null}async function ck(e,t){let r=ute(e);if(!r){if(t.required)throw new Ep;return}let n=sR(r.type,t.content);if(!n)throw new Tp(r.type);let i=await e.getBody();if(!i){if(t.required)throw new $p;return}let s;try{s=NT(i,r)}catch(o){throw o instanceof Ze?o:new Np(o.message||o)}return r.type==="application/xml"||n.schema&&pte(s,n.schema),s}function ute(e){let t=e.headers["content-type"];return t?pi(t):void 0}function pte(e,t){let r=ok(e,t);if(r)throw new Cp(r)}function lk(e,t){var s;let r=xc(t),n=xc(e),i={};for(let[o,a]of r.entries()){if(!m0.test(a))continue;let c=n[o],u=Oo(a).replace(h0,"(.*)"),p=(s=new RegExp(u).exec(c))==null?void 0:s.slice(1),d=Array.from(a.matchAll(/{(.*?)}/g));for(let[m,f]of d.entries()){let[,h]=f;i[h]=(p==null?void 0:p[m])||""}}return i}var fte={path:{style:"simple",explode:!1},query:{style:"form",explode:!0},header:{style:"simple",explode:!1},cookie:{style:"form",explode:!0}};function uk(e,t){var a,c;let r=t.in,n=t.schema,i=fte[r],s=OT(e,n,(a=t.style)!=null?a:i.style,(c=t.explode)!=null?c:i.explode),o=ak(s,n);if(o)throw new Rp(r,t.name,o);return s}function pk(e,t){try{if(t.schema)return uk(e,t);if(t.content)throw new Pe("Media-type parameter deserialization is not supported")}catch(r){throw r instanceof Ze?r:new Ip(r.message||r)}return Array.isArray(e)?e.join(","):e}var dte=["Content-Type"];function fk(e){return e.filter(({name:t,in:r})=>!(r==="header"&&dte.includes(t)))}function dk(e,t,r){let n={path:{},query:{},header:{},cookie:{}};if(!r)return n;let i=t==="GET"?fk(r):r;for(let s of i){let o=s.in,a=mte(s),c=e[o][a];if(!c){if(s.required)throw new Ap(o,a);continue}let l=pk(c,s);n[o][a]=l}return n}function mte(e){return e.in==="header"?e.name.toLowerCase():e.name}function mk(e,t){if(e===void 0)return{};if(t)for(let r of t){let n=r.schema;if((n==null?void 0:n.type)==="object"&&hte(r))return{[r.name]:[e]}}return w0(e)}function hte(e){return e.in==="query"&&(e.style==="form"||!e.style)&&(e.explode||e.explode===void 0)}function hk(e){let t={};if(!e)return t;for(let r of e.split(";")){let[n,...i]=r.split("="),s=i.join("=");t[n]=s}return t}async function yk(e,t){let r=t.parameters,n={path:lk(e.path,t.pathTemplate),query:mk(e.query,r),header:e.headers,cookie:hk(e.headers.cookie)},i=dk(n,e.method,r),s=t.requestBody&&await ck(e,t.requestBody);return{path:e.path,method:e.method,parameters:i,headers:e.headers,requestBody:s,enforced:{}}}function gk(e){let t=Object.entries(e).map(([r,n])=>[r.toLowerCase(),n]);return Object.fromEntries(t)}function bk(e){if(e!==void 0)return e.startsWith("?")?e.slice(1):e}function vk(e){return{path:e.path,method:e.method,query:bk(e.query),headers:gk(e.headers),getBody:()=>e.getBody()}}function wk(e,t){t["x-redocly-cookie"]&&(e.headers.cookie=t["x-redocly-cookie"])}var yte={"access-control-allow-origin":"*","access-control-allow-headers":"*","access-control-allow-methods":"*"};async function xk(...e){let t=await bte(...e);return{...t,headers:{...gte(t.headers),...yte}}}function gte(e){return Object.fromEntries(Object.entries(e||{}).filter(([t])=>!t.toLocaleLowerCase().startsWith("access-control")))}async function bte(e,t,r,n){let i,s;try{let o=vk(e);if(s=HT(o),wk(o,s),KT(s))return WT(o,s,t,r);if(iT(e))return{statusCode:200};i=jp(t,o),nR(o,i,t);let a=await yk(o,i);return MT(a,s,i,r)}catch(o){return console.log(o.message),FT(o,s,i,n,r)}}async function Sk(e,t){let r=await n$(e),n=await rT(r),{strictExamples:i=!1,errorIfForcedExampleNotFound:s=!1}=t||{};return(o,a)=>xk(o,n,{strictExamples:i,errorIfForcedExampleNotFound:s},a)}0&&(module.exports={createMockServer});
245
+ `);let s=r===void 0?await n.resolveDocument(i,t,!0):r;if(s instanceof Error)throw s;return(o=e.collectSpecData)==null||o.call(e,s.parsed),qO({document:s,...e,config:e.config.styleguide,externalRefResolver:n})}async function qO(e){let{document:t,config:r,customTypes:n,externalRefResolver:i,dereference:s=!1,removeUnusedComponents:o=!1,keepUrlRefs:a=!1}=e,c=la(t.parsed),l=Pl(c),u=r.getRulesForSpecVersion(l),p=Rs(r.extendTypes(n!=null?n:ki(c),c),r),d=gu(u,r,"preprocessors",c),m=gu(u,r,"decorators",c),f={problems:[],oasVersion:c,refTypes:new Map,visitorsData:{}};o&&m.push({severity:"error",ruleId:"remove-unused-components",visitor:l===we.OAS2?CO({}):kO({})});let h=await Qs({rootDocument:t,rootType:p.Root,externalRefResolver:i});d.length>0&&(Va({document:t,rootType:p.Root,normalizedVisitors:eo(d,p),resolvedRefMap:h,ctx:f}),h=await Qs({rootDocument:t,rootType:p.Root,externalRefResolver:i}));let y=eo([{severity:"error",ruleId:"bundler",visitor:zV(l,s,t,h,a)},...m],p);return Va({document:t,rootType:p.Root,normalizedVisitors:y,resolvedRefMap:h,ctx:f}),{bundle:t,problems:f.problems.map(g=>r.addProblemToIgnore(g)),fileDependencies:i.getFiles(),rootType:p.Root,refTypes:f.refTypes,visitorsData:f.visitorsData}}function oy(e,t){switch(t){case we.OAS3:switch(e){case"Schema":return"schemas";case"Parameter":return"parameters";case"Response":return"responses";case"Example":return"examples";case"RequestBody":return"requestBodies";case"Header":return"headers";case"SecuritySchema":return"securitySchemes";case"Link":return"links";case"Callback":return"callbacks";default:return null}case we.OAS2:switch(e){case"Schema":return"definitions";case"Parameter":return"parameters";case"Response":return"responses";default:return null}case we.Async2:switch(e){case"Schema":return"schemas";case"Parameter":return"parameters";default:return null}case we.Async3:switch(e){case"Schema":return"schemas";case"Parameter":return"parameters";default:return null}case we.Arazzo1:switch(e){case"Root.workflows_items.parameters_items":case"Root.workflows_items.steps_items.parameters_items":return"parameters";default:return null}case we.Overlay1:return null}}function ay(e,t,r){if(!Ee(t.node))r.parent[r.key]=t.node;else{delete e.$ref;let n=Object.assign({},t.node,e);Object.assign(e,n)}}function zV(e,t,r,n,i){let s,o,a={ref:{leave(d,m,f){if(!f.location||f.node===void 0){xu(f,m.report,m.location);return}if(f.location.source===r.source&&f.location.source===m.location.source&&m.type.name!=="scalar"&&!t||i&&zt(d.$ref))return;let h=oy(m.type.name,e);h?t?(l(h,f,m),ay(d,f,m)):(d.$ref=l(h,f,m),c(d,f,m)):ay(d,f,m)}},Example:{leave(d,m){if(fl(d)&&d.value===void 0){let f=m.resolve({$ref:d.externalValue});if(!f.location||f.node===void 0){xu(f,m.report,m.location);return}if(i&&zt(d.externalValue))return;d.value=m.resolve({$ref:d.externalValue}).node,delete d.externalValue}}},Root:{enter(d,m){o=m.location,e===we.OAS3?s=d.components=d.components||{}:e===we.OAS2?s=d:e===we.Async2?s=d.components=d.components||{}:e===we.Async3?s=d.components=d.components||{}:e===we.Arazzo1&&(s=d.components=d.components||{})}}};e===we.OAS3&&(a.DiscriminatorMapping={leave(d,m){for(let f of Object.keys(d)){let h=d[f],y=m.resolve({$ref:h});if(!y.location||y.node===void 0){xu(y,m.report,m.location.child(f));return}let g=oy("Schema",e);d[f]=l(g,y,m)}}});function c(d,m,f){let h=zi(f.location.source.absoluteRef,d.$ref);n.set(h,{document:r,isRemote:!1,node:m.node,nodePointer:d.$ref,resolved:!0})}function l(d,m,f){s[d]=s[d]||{};let h=p(m,d,f);return s[d][h]=m.node,e===we.OAS3||e===we.Async2||e===we.Async3?`#/components/${d}/${h}`:`#/${d}/${h}`}function u(d,m,f){var h;return Fe(d)&&((h=f.resolve(d,o.absolutePointer).location)==null?void 0:h.absolutePointer)===m.location.absolutePointer?!0:na(d,m.node)}function p(d,m,f){let[h,y]=[d.location.source.absoluteRef,d.location.pointer],g=s[m],b="",w=y.slice(2).split("/").filter(Ln);for(;w.length>0;)if(b=w.pop()+(b?`-${b}`:""),!g||!g[b]||u(g[b],d,f))return b;if(b=nw(h)+(b?`_${b}`:""),!g[b]||u(g[b],d,f))return b;let x=b,S=2;for(;g[b]&&!u(g[b],d,f);)b=`${x}-${S}`,S++;return g[b]||f.report({message:`Two schemas are referenced with the same name but different content. Renamed ${x} to ${b}.`,location:f.location,forceSeverity:"warn"}),b}return a}var r$=Ue(t$(),1);var Bme={warn:e=>Rt.bgYellow(Rt.black(e)),error:Rt.bgRed},Vme={warn:Rt.yellow,error:Rt.red};var k7=Ue(Md(),1);async function n$(e){let t={config:new Ui({}),dereference:!0};if(typeof e=="string"&&(t.ref=e),typeof e=="object"){if(e["x-redocly-dereferenced"])return e;t.doc={source:{absoluteRef:"/"},parsed:e}}let{bundle:{parsed:r}}=await cy(t);return r["x-redocly-dereferenced"]=!0,r}var tT=Ue(eT());async function rT(e){return tY(e)?rY(e):e}function tY(e){return e.swagger!==void 0}async function rY(e){let{openapi:t}=await tT.convertObj(e,{patch:!0,warnOnly:!0,text:"{}",anchors:!0});return t}function nT(e){let{responses:t}=e;if(!t)throw new Pe("Operation does not specify any response.");return nY(t)||iY(t)||sY(t)}function nY(e){let t=Object.keys(e).filter(n=>Number(n)>=200&&Number(n)<300).sort()[0];return t?{...e[t],statusCode:Number(t)}:null}function iY(e){let t=e.default;return t?{...t,statusCode:200}:null}function sY(e){let t=Object.keys(e)[0];return{...e[t],statusCode:Number(t)}}var iT=e=>{return r=>{let n=["message","error","summary","description","detail","title","problem","failure","fault"];if(typeof r=="object"&&!Array.isArray(r)){for(let i of n)if(t(r,i,1))break}};function t(r,n,i){if(typeof r[n]=="string"||r[n]===null)return r[n]=e.message,!0;for(let s of Object.keys(r)){let o=Array.isArray(r[s])?r[s][0]:r[s];if(typeof o=="object"&&o!==null&&!Array.isArray(o)&&i<3)return t(o,n,i+1)}return!1}};var sT=e=>t=>{if(!t||!e)return;typeof t=="object"&&typeof e=="object"&&r(t,e);function r(n,i){Object.keys(n).forEach(s=>{let o=n[s],a=i[s];if(a==null||!(typeof o==typeof a))return;if(["string","number","boolean"].includes(typeof a)){n[s]=i[s];return}return r(o,a)})}};var oY="Validation Error: The forced X-Redocly-Response-Status header's value should be a number.",aY="Range Error: Status code is out of range in forced X-Redocly-Response-Status header.";function oT(e){let t=Number(e["x-redocly-response-status"]);if(isNaN(t))throw new Pe(oY);if(t<100||t>999)throw new Pe(aY);return t}function Oo(e){return e["x-redocly-response-body-example"]}function xc(e,t=!1){let r={};for(let n=0;n<e.length;n+=2){let i=t?e[n].toLowerCase():e[n],s=e[n+1];r[i]=s}return r}function Op(e,t){let r={};for(let n of e){let[i,s]=n.split(t);r[i]=s}return r}function aT(e,t,r){if((r==null?void 0:r.type)==="array")return e?e.split(","):[];if((r==null?void 0:r.type)==="object"){let n=e.split(",");return t?Op(n,"="):xc(n)}return e}function cT(e){return e!=null&&typeof e=="object"}function lT(e,t){return Array.isArray(e)?cY(e):cT(e)?lY(e,t):uY(e)}function cY(e){return e.join(",")}function lY(e,t){let r=t?"=":",";return Object.entries(e).map(n=>n.join(r)).join(",")}function uY(e){return String(e)}function uT(e,t,r){switch(t){case"simple":return lT(e,r);default:throw new Pe(`Serialization style ${t} is not supported.`)}}function pT(e,t,r){if(!e)return;let n=r==null?void 0:r.type;return n==="array"?t?pY(e):fY(e):n==="object"?t?dY(e):mY(e):Array.isArray(e)?e[e.length-1]:e}function pY(e){return Array.isArray(e)?e:[e]}function fY(e){return(Array.isArray(e)?e.pop():e).split(",")}function dY(e){let t=Array.isArray(e)?e.join(""):e;return Op(t.split("&"),"=")}function mY(e){let t=(Array.isArray(e)?e.pop()||"":e).split(",");return xc(t)}function fT(e,t,r,n){if(r==="simple")return aT(e,n,t);if(r==="form")return pT(e,n,t);throw new Pe(`Deserialization style ${r} is not supported.`)}var Ze=class extends Error{constructor(r,n){super(n);this.statusCodes=r;this.message=n}},Pp=class extends Ze{constructor(r){super([404,400],`Path ${r} not found`);this.path=r}},$p=class extends Ze{constructor(r,n){super([405,400],`Method "${r}" is not supported by the target path "${n}"`);this.method=r;this.path=n}},Ep=class extends Ze{constructor(){super([400,422],"Body is required, but it is missing from the request")}},Ap=class extends Ze{constructor(){super([400],"Body is required, but the Content-Type header is missing from the request")}},Tp=class extends Ze{constructor(r,n){super([400,422],`Required ${r} parameter "${n}" is missing`);this.paramType=r;this.paramName=n}},Rp=class extends Ze{constructor(r){super([415,400],`Media type "${r}" is not supported`);this.mediaType=r}},Cp=class extends Ze{constructor(r,n,i){super([422,400],`Error validating ${r} parameter "${n}". ${i}`);this.paramType=r;this.paramName=n;this.validationError=i}},kp=class extends Ze{constructor(r){super([422,400],`Error validating body. ${r}`);this.validationError=r}},Np=class extends Ze{constructor(r){super([401,400],`Not authenticated. Supported authentication types: ${r}.`);this.authenticationTypes=r}},Pe=class extends Ze{constructor(t){super([500],`Mock server error. ${t}`)}},Ip=class extends Ze{constructor(t){super([400],`Body deserialization error. ${t}`)}},qp=class extends Ze{constructor(t){super([400],`Parameter deserialization error. ${t}`)}};function m0(e){return JSON.stringify(e)}function ui(e,t="utf-8"){let r=m0(e);return Buffer.from(r,t)}function h0(e){return String(e)}function dT(e,t){let r=h0(e);return Buffer.from(r,t)}function mT(e){return typeof e=="string"?e:JSON.stringify(e)}function hT(e,t){return Buffer.from(e,t)}function yT(e,t){var r;if(t.type==="application/json"||(r=t.type)!=null&&r.endsWith("+json"))return m0(e);if(t.type==="text/plain")return h0(e);if(t.type==="application/xml")return mT(e);throw new Pe(`Media type ${t.type} is not supported.`)}function y0(e,t){var n;let r=t.parameters.charset||"utf-8";if(t.type==="application/json"||(n=t.type)!=null&&n.endsWith("+json")||t.type==="*/*")return ui(e);if(t.type==="text/plain")return dT(e,r);if(t.type==="application/xml")return hT(e,r);throw new Pe(`Media type ${t.type} is not supported.`)}function gT(e,t){let r=g0(e.toString(t));return yY(hY(r))}function g0(e){let t={};for(let r of e.split("&")){let[n,...i]=r.split("="),s=i.length>0?i.join("="):void 0;t[n]===void 0&&(t[n]=[]),s&&t[n].push(s)}return t}function hY(e){let t={};for(let[r,n]of Object.entries(e))t[decodeURIComponent(r)]=n.map(decodeURIComponent);return t}function yY(e){let t={};for(let r of Object.keys(e)){let n=r.match(/[^[]*/i);if(!n)continue;let i=r.match(/\[.*?\]/g)||[];i=[n[0]].concat(i).map(function(o){return o.replace(/\[|\]/g,"")});let s=t;for(;i.length;){let o=i.shift();o&&(o in s||(s[o]=i.length?isNaN(+i[0])&&{}||[]:e[r].join("")),s=s[o])}}return t}function bT(e,t){return JSON.parse(e.toString(t))}function vT(e,t){return e.toString(t)}function wT(e,t){return e.toString(t)}function xT(e,t){let r=t.type,n=t.parameters.charset;if(r==="text/plain")return vT(e,n);if(r==="application/json"||r!=null&&r.endsWith("+json"))return bT(e,n);if(r==="application/x-www-form-urlencoded")return gT(e,n);if(r==="application/xml")return wT(e,n);throw new Pe(`Media type ${t.type} deserialization is not supported.`)}var ST=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,gY=/\\([\u000b\u0020-\u00ff])/g,bY=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;function pi(e){if(!e)throw new Error("argument mediaType is required");let t=e.indexOf(";"),r=t!==-1?e.substring(0,t).trim():e.trim();if(!bY.test(r))throw new Error("invalid media type");let n={};if(t!==-1){let i,s,o;for(ST.lastIndex=t;s=ST.exec(e);){if(s.index!==t)throw new Error("invalid parameter format");t+=s[0].length,i=s[1].toLowerCase(),o=s[2],o[0]==='"'&&(o=o.substring(1,o.length-2).replace(gY,"$1")),n[i]=o}if(t!==e.length)throw new Error("invalid parameter format")}return{type:r,parameters:n}}var PT=Ue(OT());function Sc(e,t){return PT.sample(e,{quiet:!0,format:(t==null?void 0:t.type)==="application/xml"?"xml":"json"})}var vY="The desired example was not found";function $T(e,t,r){var i;let n=t&&e&&t[e];if(n)return n.value;if(e&&r)throw new Pe(vY);return t&&((i=Object.values(t)[0])==null?void 0:i.value)}var ET=["application/json","application/xml","text/plain","application/vnd.api+json","application/problem+json","*/*"];function AT(e){return e.split(";")[0]}function wY(e,t){return e&&ET.includes(e)?e:t.length?t.find(r=>ET.includes(AT(r))):"application/json"}function TT(e,t){let r=Object.keys(e),n=wY(t,r);if(!n)throw new Pe("Could not generate response. No supported media type found in definition.");return{...e[n],mediaType:AT(n)}}function RT(e,t,r){let{mediaType:n,schema:i,example:s,examples:o}=TT(e,t==null?void 0:t.contentType),a=pi(n),c=t==null?void 0:t.exampleId,l=$T(c,o,r==null?void 0:r.errorIfForcedExampleNotFound)||s;if(l&&(r!=null&&r.strictExamples))return{mediaType:n,data:y0(l,a)};let u=l||Sc(i,a);return t!=null&&t.enhancers&&t.enhancers.forEach(p=>p(u)),{mediaType:n,data:y0(u,a)}}function v0(e,t){var r;return e||t&&((r=Object.values(t)[0])==null?void 0:r.value)}function CT(e){let{schema:t,content:r}=e;if(t)return xY(t,e);if(r)return SY(r);throw new Pe("Response header specifies no schema nor content.")}function xY(e,t){let{example:r,examples:n,style:i="simple",explode:s=!0}=t,o=v0(r,n)||Sc(e);return uT(o,i,s)}function SY(e){let[[t,r]]=Object.entries(e),{example:n,examples:i,schema:s}=r,o=pi(t),a=v0(n,i)||Sc(s);return yT(a,o)}function Po(e,t,r){let{statusCode:n,headers:i,content:s}=e,o=s&&RT(s,t,r),a=_Y(i,o==null?void 0:o.mediaType);return{statusCode:n,headers:a,body:o==null?void 0:o.data}}function _Y(e,t){let r=e&&OY(e),n={...t&&{"Content-Type":t}};return{...r,...n}}function OY(e){let t=Object.entries(e).map(([r,n])=>[r,CT(n)]);return Object.fromEntries(t)}function kT(e,t,r,n){var a;let i=nT(r),s=Oo(t),o=[];return e.requestBody&&o.push(sT(e.requestBody)),Po(i,{exampleId:s,enhancers:o,contentType:(a=e==null?void 0:e.headers)==null?void 0:a["content-type"]},n)}function _c(e,t){return{statusCode:e,body:ui({message:t}),headers:{"Content-Type":"application/json"}}}function NT(e,t){let{responses:r}=e;if(!r)return null;let n=t.find(i=>r[i]);return n?{...r[n],statusCode:n}:null}function IT(e,t,r,n){let i=NT(t,e.statusCodes);return i&&i.content?Po(i,r,n):_c(e.statusCodes[0],e.message)}function qT(e,t,r,{throwUnexpected:n=!1}={},i){if(e instanceof Ze){let s=t&&Oo(t),o=[iT(e)];return PY(e,r,{exampleId:s,enhancers:o},i)}if(n)throw e;return _c(500,"Mock server encountered an internal error while handling your request: "+e.message)}function PY(e,t,r,n){return t?IT(e,t,r,n):_c(e.statusCodes[0],e.message)}function jT(e,t){let{responses:r}=t;if(!r)return null;let n=r[e];return n?{...n,statusCode:e}:null}var $Y=[100,101,102,103,200,201,202,203,204,205,206,207,208,226,300,301,302,303,304,307,308,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,421,422,423,424,425,426,428,429,431,451,500,501,502,503,504,505,506,507,508,510,511],w0="The X-Redocly-Response-Status header was detected. Forced response with status code",MT=$Y.reduce((e,t)=>({...e,[t]:{statusCode:t,body:ui({message:`${w0} ${t}.`}),headers:{"Content-Type":"application/json"}}}),{});function LT(e){let t=MT[e];return t||{statusCode:e,body:ui({message:`${w0} ${e}`}),headers:{"Content-Type":"application/json"}}}function DT(e,t,r){let n=oT(e),i=Oo(e),s=t&&jT(n,t);return s?Po(s,{exampleId:i},r):LT(n)}function BT(e=[],t=[]){return Object.values({...FT(e),...FT(t)})}function FT(e){return Object.fromEntries(e.map(t=>[t.name,t]))}function $o(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var x0=/{(.+)}/,S0=/\\\{[^\\]+\\\}/g;function VT(e,t){let r=e==null?void 0:e[t];if(r)return{...r,pathTemplate:t};let n=Oc(t);for(let i of Object.keys(e)){let s=Oc(i);if(EY(s,n))return{...e[i],pathTemplate:i}}return null}function EY(e,t){let r=e.length;if(r!==t.length)return!1;for(let n=0;n<r;n++)if(!AY(e[n],t[n]))return!1;return!0}function AY(e,t){if(!x0.test(e))return t===e;let n=$o(e).replace(S0,"(.*)");return new RegExp(n).test(t)}function Oc(e){return e.slice(1).split("/").map(t=>{if(!t)return t;try{return decodeURIComponent(t)}catch{return t}})}function jp(e,t){let{path:r,method:n}=t,{paths:i}=e,s=i&&VT(i,r);if(!s)throw new Pp(r);let o=s[n.toLocaleLowerCase()];if(!o)throw new $p(n,r);return{...o,parameters:BT(s.parameters,o.parameters),pathTemplate:s.pathTemplate}}function UT(e){if(!e||!e.headers)return{};let t=["x-redocly-response-status","x-redocly-response-body-example","x-redocly-cookie"],r={};for(let n of t)e.headers[n]&&(r[n]=e.headers[n]);return r}function zT(e){return e["x-redocly-response-status"]!==void 0}function HT(e,t,r,n){let i=TY(r,e);return DT(t,i,n)}function TY(e,t){try{return jp(e,t)}catch{return}}function KT(e){return e!=null}function WT(e,t){let{in:r,name:n}=t;switch(r){case"query":return RY(e,n);case"header":return CY(e,n);case"cookie":return kY(e,n);default:throw new Pe(`Api key location "${r}" is not supported.`)}}function RY(e,t){return!!e.query&&YT(t).test(e.query)}function CY(e,t){return!!e.headers[t.toLowerCase()]}function kY(e,t){let r=e.headers.cookie;return!!r&&YT(t).test(r)}function YT(e){return new RegExp(`${$o(e)}=.+`)}function Eo(e){let t=e.headers.authorization;if(!t)return!1;let[r,n]=t.split(" ");return r.toLowerCase()==="bearer"&&NY(n)}function NY(e){return!!e&&e.length>0}function GT(e){let t=e.headers.authorization;if(!t)return!1;let[r,n]=t.split(" ");return r.toLowerCase()==="basic"&&IY(n)}function IY(e){return!!e&&Buffer.from(e,"base64").toString().split(":").length===2}var qY=[/username=.+/,/response=.+/];function JT(e){let t=e.headers.authorization;if(!t)return!1;let[r,...n]=t.split(" ");return r.toLowerCase()==="digest"&&jY(n.join(""))}function jY(e){return qY.every(t=>t.test(e))}function XT(e,t){let{scheme:r}=t;switch(r){case"basic":return GT(e);case"bearer":return Eo(e);case"digest":return JT(e);default:throw new Pe(`Http authentication schema "${r}" is not supported.`)}}function QT(e){return Eo(e)}function ZT(e){return Eo(e)}function eR(e,t){switch(t.type){case"apiKey":return WT(e,t);case"http":return XT(e,t);case"oauth2":return QT(e);case"openIdConnect":return ZT(e)}}function tR(e,t,r){let n=LY(t,r),i=DY(r);if(!(n.some(o=>MY(e,o,i))||n.length===0))throw new Np(n.map(o=>Object.keys(o)[0]))}function MY(e,t,r){return Object.keys(t).map(n=>r[n]).filter(KT).every(n=>eR(e,n))}function LY(e,t){return e.security||t.security||[]}function DY(e){var t;return((t=e.components)==null?void 0:t.securitySchemes)||{}}function nR(e,t){let r=null;for(let[n,i]of Object.entries(t)){let s=pi(n).type;if(s===e)return i;let o=s.split("/"),a=e.split("/");if(o[0]!==a[0]){o[0]==="*"&&(r!=null||(r=i));continue}let c=o[1];if(rR(c)===rR(a[1]))return i;c==="*"&&(r=i)}return r}function rR(e=""){return e.split("+").pop()}var yv=Ue(hR());var Lp={};wf(Lp,{$id:()=>yG,$schema:()=>hG,default:()=>xG,definitions:()=>bG,properties:()=>wG,title:()=>gG,type:()=>vG});var hG="http://json-schema.org/draft-07/schema#",yG="http://json-schema.org/draft-07/schema#",gG="Core schema meta-schema",bG={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:[]}},vG=["object","boolean"],wG={$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:"#"}},xG={$schema:hG,$id:yG,title:gG,definitions:bG,type:vG,properties:wG,default:!0};var gv=Ue(rk()),nk={strict:!1,allErrors:!0,discriminator:!0},mv=new yv.default(nk).addMetaSchema(Lp);(0,gv.default)(mv);var hv=new yv.default({...nk,coerceTypes:!0}).addMetaSchema(Lp);(0,gv.default)(hv);function ik(e,t){return mv.validate(t,e)?null:mv.errorsText()}function sk(e,t){return t?hv.validate(t,e)?null:hv.errorsText():null}async function ok(e,t){let r=lte(e);if(!r){if(t.required)throw new Ap;return}let n=nR(r.type,t.content);if(!n)throw new Rp(r.type);let i=await e.getBody();if(!i){if(t.required)throw new Ep;return}let s;try{s=xT(i,r)}catch(o){throw o instanceof Ze?o:new Ip(o.message||o)}return r.type==="application/xml"||n.schema&&ute(s,n.schema),s}function lte(e){let t=e.headers["content-type"];return t?pi(t):void 0}function ute(e,t){let r=ik(e,t);if(r)throw new kp(r)}function ak(e,t){var s;let r=Oc(t),n=Oc(e),i={};for(let[o,a]of r.entries()){if(!x0.test(a))continue;let c=n[o],u=$o(a).replace(S0,"(.*)"),p=(s=new RegExp(u).exec(c))==null?void 0:s.slice(1),d=Array.from(a.matchAll(/{(.*?)}/g));for(let[m,f]of d.entries()){let[,h]=f;i[h]=(p==null?void 0:p[m])||""}}return i}var pte=["Content-Type"];function ck(e){return e.filter(({name:t,in:r})=>!(r==="header"&&pte.includes(t)))}var fte={path:{style:"simple",explode:!1},query:{style:"form",explode:!0},header:{style:"simple",explode:!1},cookie:{style:"form",explode:!0}};function lk(e,t){var a,c;let r=t.in,n=t.schema,i=fte[r],s=fT(e,n,(a=t.style)!=null?a:i.style,(c=t.explode)!=null?c:i.explode),o=sk(s,n);if(o)throw new Cp(r,t.name,o);return s}function uk(e,t){try{if(t.schema)return lk(e,t);if(t.content)throw new Pe("Media-type parameter deserialization is not supported")}catch(r){throw r instanceof Ze?r:new qp(r.message||r)}return Array.isArray(e)?e.join(","):e}function pk(e,t,r){let n={path:{},query:{},header:{},cookie:{}};if(!r)return n;let i=t==="GET"?ck(r):r;for(let s of i){let o=s.in,a=dte(s),c=e[o][a];if(!c){if(s.required)throw new Tp(o,a);continue}let l=uk(c,s);n[o][a]=l}return n}function dte(e){return e.in==="header"?e.name.toLowerCase():e.name}function fk(e,t){if(e===void 0)return{};if(t)for(let r of t){let n=r.schema;if((n==null?void 0:n.type)==="object"&&mte(r))return{[r.name]:[e]}}return g0(e)}function mte(e){return e.in==="query"&&(e.style==="form"||!e.style)&&(e.explode||e.explode===void 0)}function dk(e){let t={};if(!e)return t;for(let r of e.split(";")){let[n,...i]=r.split("="),s=i.join("=");t[n]=s}return t}async function mk(e,t){let r=t.parameters,n={path:ak(e.path,t.pathTemplate),query:fk(e.query,r),header:e.headers,cookie:dk(e.headers.cookie)},i=pk(n,e.method,r),s=t.requestBody&&await ok(e,t.requestBody);return{path:e.path,method:e.method,parameters:i,headers:e.headers,requestBody:s,enforced:{}}}function hk(e){let t=Object.entries(e).map(([r,n])=>[r.toLowerCase(),n]);return Object.fromEntries(t)}function yk(e){if(e!==void 0)return e.startsWith("?")?e.slice(1):e}function gk(e){return{path:e.path,method:e.method,query:yk(e.query),headers:hk(e.headers),getBody:()=>e.getBody()}}function bk(e,t){t["x-redocly-cookie"]&&(e.headers.cookie=t["x-redocly-cookie"])}function vk(e,t){return t.every(r=>e.includes(r))}var hte=["origin","access-control-request-method","access-control-request-headers"];function wk(e){let t=Object.keys(e.headers).map(r=>r.toLowerCase());return e.method==="OPTIONS"&&vk(t,hte)}var yte={"access-control-allow-origin":"*","access-control-allow-headers":"*","access-control-allow-methods":"*"};async function xk(...e){let t=await bte(...e);return{...t,headers:{...gte(t.headers),...yte}}}function gte(e){return Object.fromEntries(Object.entries(e||{}).filter(([t])=>!t.toLocaleLowerCase().startsWith("access-control")))}async function bte(e,t,r,n){let i,s;try{let o=gk(e);if(s=UT(o),bk(o,s),zT(s))return HT(o,s,t,r);if(wk(e))return{statusCode:200};i=jp(t,o),tR(o,i,t);let a=await mk(o,i);return kT(a,s,i,r)}catch(o){return console.log(o.message),qT(o,s,i,n,r)}}async function Sk(e,t){let r=await n$(e),n=await rT(r),{strictExamples:i=!1,errorIfForcedExampleNotFound:s=!1}=t||{};return(o,a)=>xk(o,n,{strictExamples:i,errorIfForcedExampleNotFound:s},a)}0&&(module.exports={createMockServer});
246
246
  /*! Bundled license information:
247
247
 
248
248
  js-yaml/dist/js-yaml.mjs: