@nsshunt/stsoauth2plugin 0.1.7 → 0.1.10

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.
@@ -0,0 +1,7 @@
1
+ var id=Object.defineProperty,cd=Object.defineProperties;var ud=Object.getOwnPropertyDescriptors;var Vo=Object.getOwnPropertySymbols;var ld=Object.prototype.hasOwnProperty,fd=Object.prototype.propertyIsEnumerable;var Os=(ee,ae,ie)=>ae in ee?id(ee,ae,{enumerable:!0,configurable:!0,writable:!0,value:ie}):ee[ae]=ie,Q=(ee,ae)=>{for(var ie in ae||(ae={}))ld.call(ae,ie)&&Os(ee,ie,ae[ie]);if(Vo)for(var ie of Vo(ae))fd.call(ae,ie)&&Os(ee,ie,ae[ie]);return ee},le=(ee,ae)=>cd(ee,ud(ae));var _r=(ee,ae,ie)=>(Os(ee,typeof ae!="symbol"?ae+"":ae,ie),ie),zo=(ee,ae,ie)=>{if(!ae.has(ee))throw TypeError("Cannot "+ie)};var V=(ee,ae,ie)=>(zo(ee,ae,"read from private field"),ie?ie.call(ee):ae.get(ee)),Se=(ee,ae,ie)=>{if(ae.has(ee))throw TypeError("Cannot add the same private member more than once");ae instanceof WeakSet?ae.add(ee):ae.set(ee,ie)},ce=(ee,ae,ie,ct)=>(zo(ee,ae,"write to private field"),ct?ct.call(ee,ie):ae.set(ee,ie),ie);(function(){var Ht,bt,Fe,Ot,Ar,yn,He,vt,Nt,Ke,Kt,$n,tt,Cr,Ir,Dr,cr,jr,kr,Ur;"use strict";var ee=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},ae={exports:{}},ie=1e3,ct=ie*60,Qt=ct*60,Tt=Qt*24,Ho=Tt*7,Ko=Tt*365.25,Bo=function(e,t){t=t||{};var r=typeof e;if(r==="string"&&e.length>0)return Jo(e);if(r==="number"&&isFinite(e))return t.long?Go(e):qo(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function Jo(e){if(e=String(e),!(e.length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!!t){var r=parseFloat(t[1]),n=(t[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*Ko;case"weeks":case"week":case"w":return r*Ho;case"days":case"day":case"d":return r*Tt;case"hours":case"hour":case"hrs":case"hr":case"h":return r*Qt;case"minutes":case"minute":case"mins":case"min":case"m":return r*ct;case"seconds":case"second":case"secs":case"sec":case"s":return r*ie;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function qo(e){var t=Math.abs(e);return t>=Tt?Math.round(e/Tt)+"d":t>=Qt?Math.round(e/Qt)+"h":t>=ct?Math.round(e/ct)+"m":t>=ie?Math.round(e/ie)+"s":e+"ms"}function Go(e){var t=Math.abs(e);return t>=Tt?qr(e,t,Tt,"day"):t>=Qt?qr(e,t,Qt,"hour"):t>=ct?qr(e,t,ct,"minute"):t>=ie?qr(e,t,ie,"second"):e+" ms"}function qr(e,t,r,n){var s=t>=r*1.5;return Math.round(e/r)+" "+n+(s?"s":"")}function Qo(e){r.debug=r,r.default=r,r.coerce=f,r.disable=a,r.enable=s,r.enabled=o,r.humanize=Bo,r.destroy=p,Object.keys(e).forEach(i=>{r[i]=e[i]}),r.names=[],r.skips=[],r.formatters={};function t(i){let h=0;for(let E=0;E<i.length;E++)h=(h<<5)-h+i.charCodeAt(E),h|=0;return r.colors[Math.abs(h)%r.colors.length]}r.selectColor=t;function r(i){let h,E=null,T,I;function j(...y){if(!j.enabled)return;const _=j,b=Number(new Date),O=b-(h||b);_.diff=O,_.prev=h,_.curr=b,h=b,y[0]=r.coerce(y[0]),typeof y[0]!="string"&&y.unshift("%O");let A=0;y[0]=y[0].replace(/%([a-zA-Z%])/g,($,N)=>{if($==="%%")return"%";A++;const D=r.formatters[N];if(typeof D=="function"){const B=y[A];$=D.call(_,B),y.splice(A,1),A--}return $}),r.formatArgs.call(_,y),(_.log||r.log).apply(_,y)}return j.namespace=i,j.useColors=r.useColors(),j.color=r.selectColor(i),j.extend=n,j.destroy=r.destroy,Object.defineProperty(j,"enabled",{enumerable:!0,configurable:!1,get:()=>E!==null?E:(T!==r.namespaces&&(T=r.namespaces,I=r.enabled(i)),I),set:y=>{E=y}}),typeof r.init=="function"&&r.init(j),j}function n(i,h){const E=r(this.namespace+(typeof h=="undefined"?":":h)+i);return E.log=this.log,E}function s(i){r.save(i),r.namespaces=i,r.names=[],r.skips=[];let h;const E=(typeof i=="string"?i:"").split(/[\s,]+/),T=E.length;for(h=0;h<T;h++)!E[h]||(i=E[h].replace(/\*/g,".*?"),i[0]==="-"?r.skips.push(new RegExp("^"+i.slice(1)+"$")):r.names.push(new RegExp("^"+i+"$")))}function a(){const i=[...r.names.map(l),...r.skips.map(l).map(h=>"-"+h)].join(",");return r.enable(""),i}function o(i){if(i[i.length-1]==="*")return!0;let h,E;for(h=0,E=r.skips.length;h<E;h++)if(r.skips[h].test(i))return!1;for(h=0,E=r.names.length;h<E;h++)if(r.names[h].test(i))return!0;return!1}function l(i){return i.toString().substring(2,i.toString().length-2).replace(/\.\*\?$/,"*")}function f(i){return i instanceof Error?i.stack||i.message:i}function p(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return r.enable(r.load()),r}var Yo=Qo;(function(e,t){t.formatArgs=n,t.save=s,t.load=a,t.useColors=r,t.storage=o(),t.destroy=(()=>{let f=!1;return()=>{f||(f=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function r(){return typeof window!="undefined"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator!="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document!="undefined"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window!="undefined"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator!="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator!="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function n(f){if(f[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+f[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const p="color: "+this.color;f.splice(1,0,p,"color: inherit");let i=0,h=0;f[0].replace(/%[a-zA-Z%]/g,E=>{E!=="%%"&&(i++,E==="%c"&&(h=i))}),f.splice(h,0,p)}t.log=console.debug||console.log||(()=>{});function s(f){try{f?t.storage.setItem("debug",f):t.storage.removeItem("debug")}catch{}}function a(){let f;try{f=t.storage.getItem("debug")}catch{}return!f&&typeof process!="undefined"&&"env"in process&&(f={}.DEBUG),f}function o(){try{return localStorage}catch{}}e.exports=Yo(t);const{formatters:l}=e.exports;l.j=function(f){try{return JSON.stringify(f)}catch(p){return"[UnexpectedJSONParseError]: "+p.message}}})(ae,ae.exports);var Ns=ae.exports,On={exports:{}},Ps=function(t,r){return function(){for(var s=new Array(arguments.length),a=0;a<s.length;a++)s[a]=arguments[a];return t.apply(r,s)}},Wo=Ps,Nn=Object.prototype.toString,Pn=function(e){return function(t){var r=Nn.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())}}(Object.create(null));function At(e){return e=e.toLowerCase(),function(r){return Pn(r)===e}}function Tn(e){return Array.isArray(e)}function Gr(e){return typeof e=="undefined"}function Xo(e){return e!==null&&!Gr(e)&&e.constructor!==null&&!Gr(e.constructor)&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e)}var Ts=At("ArrayBuffer");function Zo(e){var t;return typeof ArrayBuffer!="undefined"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Ts(e.buffer),t}function xo(e){return typeof e=="string"}function ei(e){return typeof e=="number"}function As(e){return e!==null&&typeof e=="object"}function Qr(e){if(Pn(e)!=="object")return!1;var t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}var ti=At("Date"),ri=At("File"),ni=At("Blob"),si=At("FileList");function An(e){return Nn.call(e)==="[object Function]"}function ai(e){return As(e)&&An(e.pipe)}function oi(e){var t="[object FormData]";return e&&(typeof FormData=="function"&&e instanceof FormData||Nn.call(e)===t||An(e.toString)&&e.toString()===t)}var ii=At("URLSearchParams");function ci(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function ui(){return typeof navigator!="undefined"&&(navigator.product==="ReactNative"||navigator.product==="NativeScript"||navigator.product==="NS")?!1:typeof window!="undefined"&&typeof document!="undefined"}function Cn(e,t){if(!(e===null||typeof e=="undefined"))if(typeof e!="object"&&(e=[e]),Tn(e))for(var r=0,n=e.length;r<n;r++)t.call(null,e[r],r,e);else for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.call(null,e[s],s,e)}function In(){var e={};function t(s,a){Qr(e[a])&&Qr(s)?e[a]=In(e[a],s):Qr(s)?e[a]=In({},s):Tn(s)?e[a]=s.slice():e[a]=s}for(var r=0,n=arguments.length;r<n;r++)Cn(arguments[r],t);return e}function li(e,t,r){return Cn(t,function(s,a){r&&typeof s=="function"?e[a]=Wo(s,r):e[a]=s}),e}function fi(e){return e.charCodeAt(0)===65279&&(e=e.slice(1)),e}function di(e,t,r,n){e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,r&&Object.assign(e.prototype,r)}function hi(e,t,r){var n,s,a,o={};t=t||{};do{for(n=Object.getOwnPropertyNames(e),s=n.length;s-- >0;)a=n[s],o[a]||(t[a]=e[a],o[a]=!0);e=Object.getPrototypeOf(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t}function pi(e,t,r){e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;var n=e.indexOf(t,r);return n!==-1&&n===r}function mi(e){if(!e)return null;var t=e.length;if(Gr(t))return null;for(var r=new Array(t);t-- >0;)r[t]=e[t];return r}var vi=function(e){return function(t){return e&&t instanceof e}}(typeof Uint8Array!="undefined"&&Object.getPrototypeOf(Uint8Array)),Pe={isArray:Tn,isArrayBuffer:Ts,isBuffer:Xo,isFormData:oi,isArrayBufferView:Zo,isString:xo,isNumber:ei,isObject:As,isPlainObject:Qr,isUndefined:Gr,isDate:ti,isFile:ri,isBlob:ni,isFunction:An,isStream:ai,isURLSearchParams:ii,isStandardBrowserEnv:ui,forEach:Cn,merge:In,extend:li,trim:ci,stripBOM:fi,inherits:di,toFlatObject:hi,kindOf:Pn,kindOfTest:At,endsWith:pi,toArray:mi,isTypedArray:vi,isFileList:si},Yt=Pe;function Cs(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var Is=function(t,r,n){if(!r)return t;var s;if(n)s=n(r);else if(Yt.isURLSearchParams(r))s=r.toString();else{var a=[];Yt.forEach(r,function(f,p){f===null||typeof f=="undefined"||(Yt.isArray(f)?p=p+"[]":f=[f],Yt.forEach(f,function(h){Yt.isDate(h)?h=h.toISOString():Yt.isObject(h)&&(h=JSON.stringify(h)),a.push(Cs(p)+"="+Cs(h))}))}),s=a.join("&")}if(s){var o=t.indexOf("#");o!==-1&&(t=t.slice(0,o)),t+=(t.indexOf("?")===-1?"?":"&")+s}return t},_i=Pe;function Yr(){this.handlers=[]}Yr.prototype.use=function(t,r,n){return this.handlers.push({fulfilled:t,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1},Yr.prototype.eject=function(t){this.handlers[t]&&(this.handlers[t]=null)},Yr.prototype.forEach=function(t){_i.forEach(this.handlers,function(n){n!==null&&t(n)})};var gi=Yr,Ei=Pe,yi=function(t,r){Ei.forEach(t,function(s,a){a!==r&&a.toUpperCase()===r.toUpperCase()&&(t[r]=s,delete t[a])})},Ds=Pe;function Wt(e,t,r,n,s){Error.call(this),this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),s&&(this.response=s)}Ds.inherits(Wt,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var js=Wt.prototype,ks={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED"].forEach(function(e){ks[e]={value:e}}),Object.defineProperties(Wt,ks),Object.defineProperty(js,"isAxiosError",{value:!0}),Wt.from=function(e,t,r,n,s,a){var o=Object.create(js);return Ds.toFlatObject(e,o,function(f){return f!==Error.prototype}),Wt.call(o,e.message,t,r,n,s),o.name=e.name,a&&Object.assign(o,a),o};var Xt=Wt,Us={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Ge=Pe;function $i(e,t){t=t||new FormData;var r=[];function n(a){return a===null?"":Ge.isDate(a)?a.toISOString():Ge.isArrayBuffer(a)||Ge.isTypedArray(a)?typeof Blob=="function"?new Blob([a]):Buffer.from(a):a}function s(a,o){if(Ge.isPlainObject(a)||Ge.isArray(a)){if(r.indexOf(a)!==-1)throw Error("Circular reference detected in "+o);r.push(a),Ge.forEach(a,function(f,p){if(!Ge.isUndefined(f)){var i=o?o+"."+p:p,h;if(f&&!o&&typeof f=="object"){if(Ge.endsWith(p,"{}"))f=JSON.stringify(f);else if(Ge.endsWith(p,"[]")&&(h=Ge.toArray(f))){h.forEach(function(E){!Ge.isUndefined(E)&&t.append(i,n(E))});return}}s(f,i)}}),r.pop()}else t.append(o,n(a))}return s(e),t}var Fs=$i,Dn=Xt,wi=function(t,r,n){var s=n.config.validateStatus;!n.status||!s||s(n.status)?t(n):r(new Dn("Request failed with status code "+n.status,[Dn.ERR_BAD_REQUEST,Dn.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))},Wr=Pe,Si=Wr.isStandardBrowserEnv()?function(){return{write:function(r,n,s,a,o,l){var f=[];f.push(r+"="+encodeURIComponent(n)),Wr.isNumber(s)&&f.push("expires="+new Date(s).toGMTString()),Wr.isString(a)&&f.push("path="+a),Wr.isString(o)&&f.push("domain="+o),l===!0&&f.push("secure"),document.cookie=f.join("; ")},read:function(r){var n=document.cookie.match(new RegExp("(^|;\\s*)("+r+")=([^;]*)"));return n?decodeURIComponent(n[3]):null},remove:function(r){this.write(r,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}(),Ri=function(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)},bi=function(t,r){return r?t.replace(/\/+$/,"")+"/"+r.replace(/^\/+/,""):t},Oi=Ri,Ni=bi,Ms=function(t,r){return t&&!Oi(r)?Ni(t,r):r},jn=Pe,Pi=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"],Ti=function(t){var r={},n,s,a;return t&&jn.forEach(t.split(`
2
+ `),function(l){if(a=l.indexOf(":"),n=jn.trim(l.substr(0,a)).toLowerCase(),s=jn.trim(l.substr(a+1)),n){if(r[n]&&Pi.indexOf(n)>=0)return;n==="set-cookie"?r[n]=(r[n]?r[n]:[]).concat([s]):r[n]=r[n]?r[n]+", "+s:s}}),r},Ls=Pe,Ai=Ls.isStandardBrowserEnv()?function(){var t=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a"),n;function s(a){var o=a;return t&&(r.setAttribute("href",o),o=r.href),r.setAttribute("href",o),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:r.pathname.charAt(0)==="/"?r.pathname:"/"+r.pathname}}return n=s(window.location.href),function(o){var l=Ls.isString(o)?s(o):o;return l.protocol===n.protocol&&l.host===n.host}}():function(){return function(){return!0}}(),kn=Xt,Ci=Pe;function Vs(e){kn.call(this,e==null?"canceled":e,kn.ERR_CANCELED),this.name="CanceledError"}Ci.inherits(Vs,kn,{__CANCEL__:!0});var Xr=Vs,Ii=function(t){var r=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return r&&r[1]||""},gr=Pe,Di=wi,ji=Si,ki=Is,Ui=Ms,Fi=Ti,Mi=Ai,Li=Us,ut=Xt,Vi=Xr,zi=Ii,zs=function(t){return new Promise(function(n,s){var a=t.data,o=t.headers,l=t.responseType,f;function p(){t.cancelToken&&t.cancelToken.unsubscribe(f),t.signal&&t.signal.removeEventListener("abort",f)}gr.isFormData(a)&&gr.isStandardBrowserEnv()&&delete o["Content-Type"];var i=new XMLHttpRequest;if(t.auth){var h=t.auth.username||"",E=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";o.Authorization="Basic "+btoa(h+":"+E)}var T=Ui(t.baseURL,t.url);i.open(t.method.toUpperCase(),ki(T,t.params,t.paramsSerializer),!0),i.timeout=t.timeout;function I(){if(!!i){var _="getAllResponseHeaders"in i?Fi(i.getAllResponseHeaders()):null,b=!l||l==="text"||l==="json"?i.responseText:i.response,O={data:b,status:i.status,statusText:i.statusText,headers:_,config:t,request:i};Di(function(H){n(H),p()},function(H){s(H),p()},O),i=null}}if("onloadend"in i?i.onloadend=I:i.onreadystatechange=function(){!i||i.readyState!==4||i.status===0&&!(i.responseURL&&i.responseURL.indexOf("file:")===0)||setTimeout(I)},i.onabort=function(){!i||(s(new ut("Request aborted",ut.ECONNABORTED,t,i)),i=null)},i.onerror=function(){s(new ut("Network Error",ut.ERR_NETWORK,t,i,i)),i=null},i.ontimeout=function(){var b=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded",O=t.transitional||Li;t.timeoutErrorMessage&&(b=t.timeoutErrorMessage),s(new ut(b,O.clarifyTimeoutError?ut.ETIMEDOUT:ut.ECONNABORTED,t,i)),i=null},gr.isStandardBrowserEnv()){var j=(t.withCredentials||Mi(T))&&t.xsrfCookieName?ji.read(t.xsrfCookieName):void 0;j&&(o[t.xsrfHeaderName]=j)}"setRequestHeader"in i&&gr.forEach(o,function(b,O){typeof a=="undefined"&&O.toLowerCase()==="content-type"?delete o[O]:i.setRequestHeader(O,b)}),gr.isUndefined(t.withCredentials)||(i.withCredentials=!!t.withCredentials),l&&l!=="json"&&(i.responseType=t.responseType),typeof t.onDownloadProgress=="function"&&i.addEventListener("progress",t.onDownloadProgress),typeof t.onUploadProgress=="function"&&i.upload&&i.upload.addEventListener("progress",t.onUploadProgress),(t.cancelToken||t.signal)&&(f=function(_){!i||(s(!_||_&&_.type?new Vi:_),i.abort(),i=null)},t.cancelToken&&t.cancelToken.subscribe(f),t.signal&&(t.signal.aborted?f():t.signal.addEventListener("abort",f))),a||(a=null);var y=zi(T);if(y&&["http","https","file"].indexOf(y)===-1){s(new ut("Unsupported protocol "+y+":",ut.ERR_BAD_REQUEST,t));return}i.send(a)})},Hi=null,Oe=Pe,Hs=yi,Ks=Xt,Ki=Us,Bi=Fs,Ji={"Content-Type":"application/x-www-form-urlencoded"};function Bs(e,t){!Oe.isUndefined(e)&&Oe.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}function qi(){var e;return(typeof XMLHttpRequest!="undefined"||typeof process!="undefined"&&Object.prototype.toString.call(process)==="[object process]")&&(e=zs),e}function Gi(e,t,r){if(Oe.isString(e))try{return(t||JSON.parse)(e),Oe.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(e)}var Zr={transitional:Ki,adapter:qi(),transformRequest:[function(t,r){if(Hs(r,"Accept"),Hs(r,"Content-Type"),Oe.isFormData(t)||Oe.isArrayBuffer(t)||Oe.isBuffer(t)||Oe.isStream(t)||Oe.isFile(t)||Oe.isBlob(t))return t;if(Oe.isArrayBufferView(t))return t.buffer;if(Oe.isURLSearchParams(t))return Bs(r,"application/x-www-form-urlencoded;charset=utf-8"),t.toString();var n=Oe.isObject(t),s=r&&r["Content-Type"],a;if((a=Oe.isFileList(t))||n&&s==="multipart/form-data"){var o=this.env&&this.env.FormData;return Bi(a?{"files[]":t}:t,o&&new o)}else if(n||s==="application/json")return Bs(r,"application/json"),Gi(t);return t}],transformResponse:[function(t){var r=this.transitional||Zr.transitional,n=r&&r.silentJSONParsing,s=r&&r.forcedJSONParsing,a=!n&&this.responseType==="json";if(a||s&&Oe.isString(t)&&t.length)try{return JSON.parse(t)}catch(o){if(a)throw o.name==="SyntaxError"?Ks.from(o,Ks.ERR_BAD_RESPONSE,this,null,this.response):o}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Hi},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};Oe.forEach(["delete","get","head"],function(t){Zr.headers[t]={}}),Oe.forEach(["post","put","patch"],function(t){Zr.headers[t]=Oe.merge(Ji)});var Un=Zr,Qi=Pe,Yi=Un,Wi=function(t,r,n){var s=this||Yi;return Qi.forEach(n,function(o){t=o.call(s,t,r)}),t},Js=function(t){return!!(t&&t.__CANCEL__)},qs=Pe,Fn=Wi,Xi=Js,Zi=Un,xi=Xr;function Mn(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new xi}var ec=function(t){Mn(t),t.headers=t.headers||{},t.data=Fn.call(t,t.data,t.headers,t.transformRequest),t.headers=qs.merge(t.headers.common||{},t.headers[t.method]||{},t.headers),qs.forEach(["delete","get","head","post","put","patch","common"],function(s){delete t.headers[s]});var r=t.adapter||Zi.adapter;return r(t).then(function(s){return Mn(t),s.data=Fn.call(t,s.data,s.headers,t.transformResponse),s},function(s){return Xi(s)||(Mn(t),s&&s.response&&(s.response.data=Fn.call(t,s.response.data,s.response.headers,t.transformResponse))),Promise.reject(s)})},Ue=Pe,Gs=function(t,r){r=r||{};var n={};function s(i,h){return Ue.isPlainObject(i)&&Ue.isPlainObject(h)?Ue.merge(i,h):Ue.isPlainObject(h)?Ue.merge({},h):Ue.isArray(h)?h.slice():h}function a(i){if(Ue.isUndefined(r[i])){if(!Ue.isUndefined(t[i]))return s(void 0,t[i])}else return s(t[i],r[i])}function o(i){if(!Ue.isUndefined(r[i]))return s(void 0,r[i])}function l(i){if(Ue.isUndefined(r[i])){if(!Ue.isUndefined(t[i]))return s(void 0,t[i])}else return s(void 0,r[i])}function f(i){if(i in r)return s(t[i],r[i]);if(i in t)return s(void 0,t[i])}var p={url:o,method:o,data:o,baseURL:l,transformRequest:l,transformResponse:l,paramsSerializer:l,timeout:l,timeoutMessage:l,withCredentials:l,adapter:l,responseType:l,xsrfCookieName:l,xsrfHeaderName:l,onUploadProgress:l,onDownloadProgress:l,decompress:l,maxContentLength:l,maxBodyLength:l,beforeRedirect:l,transport:l,httpAgent:l,httpsAgent:l,cancelToken:l,socketPath:l,responseEncoding:l,validateStatus:f};return Ue.forEach(Object.keys(t).concat(Object.keys(r)),function(h){var E=p[h]||a,T=E(h);Ue.isUndefined(T)&&E!==f||(n[h]=T)}),n},Qs={version:"0.27.2"},tc=Qs.version,gt=Xt,Ln={};["object","boolean","number","function","string","symbol"].forEach(function(e,t){Ln[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});var Ys={};Ln.transitional=function(t,r,n){function s(a,o){return"[Axios v"+tc+"] Transitional option '"+a+"'"+o+(n?". "+n:"")}return function(a,o,l){if(t===!1)throw new gt(s(o," has been removed"+(r?" in "+r:"")),gt.ERR_DEPRECATED);return r&&!Ys[o]&&(Ys[o]=!0,console.warn(s(o," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(a,o,l):!0}};function rc(e,t,r){if(typeof e!="object")throw new gt("options must be an object",gt.ERR_BAD_OPTION_VALUE);for(var n=Object.keys(e),s=n.length;s-- >0;){var a=n[s],o=t[a];if(o){var l=e[a],f=l===void 0||o(l,a,e);if(f!==!0)throw new gt("option "+a+" must be "+f,gt.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new gt("Unknown option "+a,gt.ERR_BAD_OPTION)}}var nc={assertOptions:rc,validators:Ln},Ws=Pe,sc=Is,Xs=gi,Zs=ec,xr=Gs,ac=Ms,xs=nc,Zt=xs.validators;function xt(e){this.defaults=e,this.interceptors={request:new Xs,response:new Xs}}xt.prototype.request=function(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=xr(this.defaults,r),r.method?r.method=r.method.toLowerCase():this.defaults.method?r.method=this.defaults.method.toLowerCase():r.method="get";var n=r.transitional;n!==void 0&&xs.assertOptions(n,{silentJSONParsing:Zt.transitional(Zt.boolean),forcedJSONParsing:Zt.transitional(Zt.boolean),clarifyTimeoutError:Zt.transitional(Zt.boolean)},!1);var s=[],a=!0;this.interceptors.request.forEach(function(T){typeof T.runWhen=="function"&&T.runWhen(r)===!1||(a=a&&T.synchronous,s.unshift(T.fulfilled,T.rejected))});var o=[];this.interceptors.response.forEach(function(T){o.push(T.fulfilled,T.rejected)});var l;if(!a){var f=[Zs,void 0];for(Array.prototype.unshift.apply(f,s),f=f.concat(o),l=Promise.resolve(r);f.length;)l=l.then(f.shift(),f.shift());return l}for(var p=r;s.length;){var i=s.shift(),h=s.shift();try{p=i(p)}catch(E){h(E);break}}try{l=Zs(p)}catch(E){return Promise.reject(E)}for(;o.length;)l=l.then(o.shift(),o.shift());return l},xt.prototype.getUri=function(t){t=xr(this.defaults,t);var r=ac(t.baseURL,t.url);return sc(r,t.params,t.paramsSerializer)},Ws.forEach(["delete","get","head","options"],function(t){xt.prototype[t]=function(r,n){return this.request(xr(n||{},{method:t,url:r,data:(n||{}).data}))}}),Ws.forEach(["post","put","patch"],function(t){function r(n){return function(a,o,l){return this.request(xr(l||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:a,data:o}))}}xt.prototype[t]=r(),xt.prototype[t+"Form"]=r(!0)});var oc=xt,ic=Xr;function er(e){if(typeof e!="function")throw new TypeError("executor must be a function.");var t;this.promise=new Promise(function(s){t=s});var r=this;this.promise.then(function(n){if(!!r._listeners){var s,a=r._listeners.length;for(s=0;s<a;s++)r._listeners[s](n);r._listeners=null}}),this.promise.then=function(n){var s,a=new Promise(function(o){r.subscribe(o),s=o}).then(n);return a.cancel=function(){r.unsubscribe(s)},a},e(function(s){r.reason||(r.reason=new ic(s),t(r.reason))})}er.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},er.prototype.subscribe=function(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]},er.prototype.unsubscribe=function(t){if(!!this._listeners){var r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}},er.source=function(){var t,r=new er(function(s){t=s});return{token:r,cancel:t}};var cc=er,uc=function(t){return function(n){return t.apply(null,n)}},lc=Pe,fc=function(t){return lc.isObject(t)&&t.isAxiosError===!0},ea=Pe,dc=Ps,en=oc,hc=Gs,pc=Un;function ta(e){var t=new en(e),r=dc(en.prototype.request,t);return ea.extend(r,en.prototype,t),ea.extend(r,t),r.create=function(s){return ta(hc(e,s))},r}var De=ta(pc);De.Axios=en,De.CanceledError=Xr,De.CancelToken=cc,De.isCancel=Js,De.VERSION=Qs.version,De.toFormData=Fs,De.AxiosError=Xt,De.Cancel=De.CanceledError,De.all=function(t){return Promise.all(t)},De.spread=uc,De.isAxiosError=fc,On.exports=De,On.exports.default=De;var Vn=On.exports,Ct={},tn={};Object.defineProperty(tn,"__esModule",{value:!0}),tn.GetErrorPayload=void 0;function mc(e,t=null){return{error:e.code,error_description:e.description,timestamp:Date.now(),details:t}}tn.GetErrorPayload=mc;var rn={},It={},zn={exports:{}},ra={},We={},tr={},Er={},ue={},yr={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.regexpCode=e.getEsmExportName=e.getProperty=e.safeStringify=e.stringify=e.strConcat=e.addCodeArg=e.str=e._=e.nil=e._Code=e.Name=e.IDENTIFIER=e._CodeOrName=void 0;class t{}e._CodeOrName=t,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class r extends t{constructor(b){if(super(),!e.IDENTIFIER.test(b))throw new Error("CodeGen: name must be a valid identifier");this.str=b}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}e.Name=r;class n extends t{constructor(b){super(),this._items=typeof b=="string"?[b]:b}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const b=this._items[0];return b===""||b==='""'}get str(){var b;return(b=this._str)!==null&&b!==void 0?b:this._str=this._items.reduce((O,A)=>`${O}${A}`,"")}get names(){var b;return(b=this._names)!==null&&b!==void 0?b:this._names=this._items.reduce((O,A)=>(A instanceof r&&(O[A.str]=(O[A.str]||0)+1),O),{})}}e._Code=n,e.nil=new n("");function s(_,...b){const O=[_[0]];let A=0;for(;A<b.length;)l(O,b[A]),O.push(_[++A]);return new n(O)}e._=s;const a=new n("+");function o(_,...b){const O=[T(_[0])];let A=0;for(;A<b.length;)O.push(a),l(O,b[A]),O.push(a,T(_[++A]));return f(O),new n(O)}e.str=o;function l(_,b){b instanceof n?_.push(...b._items):b instanceof r?_.push(b):_.push(h(b))}e.addCodeArg=l;function f(_){let b=1;for(;b<_.length-1;){if(_[b]===a){const O=p(_[b-1],_[b+1]);if(O!==void 0){_.splice(b-1,3,O);continue}_[b++]="+"}b++}}function p(_,b){if(b==='""')return _;if(_==='""')return b;if(typeof _=="string")return b instanceof r||_[_.length-1]!=='"'?void 0:typeof b!="string"?`${_.slice(0,-1)}${b}"`:b[0]==='"'?_.slice(0,-1)+b.slice(1):void 0;if(typeof b=="string"&&b[0]==='"'&&!(_ instanceof r))return`"${_}${b.slice(1)}`}function i(_,b){return b.emptyStr()?_:_.emptyStr()?b:o`${_}${b}`}e.strConcat=i;function h(_){return typeof _=="number"||typeof _=="boolean"||_===null?_:T(Array.isArray(_)?_.join(","):_)}function E(_){return new n(T(_))}e.stringify=E;function T(_){return JSON.stringify(_).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.safeStringify=T;function I(_){return typeof _=="string"&&e.IDENTIFIER.test(_)?new n(`.${_}`):s`[${_}]`}e.getProperty=I;function j(_){if(typeof _=="string"&&e.IDENTIFIER.test(_))return new n(`${_}`);throw new Error(`CodeGen: invalid export name: ${_}, use explicit $id name mapping`)}e.getEsmExportName=j;function y(_){return new n(_.toString())}e.regexpCode=y})(yr);var Hn={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;const t=yr;class r extends Error{constructor(p){super(`CodeGen: "code" for ${p} not defined`),this.value=p.value}}var n;(function(f){f[f.Started=0]="Started",f[f.Completed=1]="Completed"})(n=e.UsedValueState||(e.UsedValueState={})),e.varKinds={const:new t.Name("const"),let:new t.Name("let"),var:new t.Name("var")};class s{constructor({prefixes:p,parent:i}={}){this._names={},this._prefixes=p,this._parent=i}toName(p){return p instanceof t.Name?p:this.name(p)}name(p){return new t.Name(this._newName(p))}_newName(p){const i=this._names[p]||this._nameGroup(p);return`${p}${i.index++}`}_nameGroup(p){var i,h;if(((h=(i=this._parent)===null||i===void 0?void 0:i._prefixes)===null||h===void 0?void 0:h.has(p))||this._prefixes&&!this._prefixes.has(p))throw new Error(`CodeGen: prefix "${p}" is not allowed in this scope`);return this._names[p]={prefix:p,index:0}}}e.Scope=s;class a extends t.Name{constructor(p,i){super(i),this.prefix=p}setValue(p,{property:i,itemIndex:h}){this.value=p,this.scopePath=(0,t._)`.${new t.Name(i)}[${h}]`}}e.ValueScopeName=a;const o=(0,t._)`\n`;class l extends s{constructor(p){super(p),this._values={},this._scope=p.scope,this.opts=le(Q({},p),{_n:p.lines?o:t.nil})}get(){return this._scope}name(p){return new a(p,this._newName(p))}value(p,i){var h;if(i.ref===void 0)throw new Error("CodeGen: ref must be passed in value");const E=this.toName(p),{prefix:T}=E,I=(h=i.key)!==null&&h!==void 0?h:i.ref;let j=this._values[T];if(j){const b=j.get(I);if(b)return b}else j=this._values[T]=new Map;j.set(I,E);const y=this._scope[T]||(this._scope[T]=[]),_=y.length;return y[_]=i.ref,E.setValue(i,{property:T,itemIndex:_}),E}getValue(p,i){const h=this._values[p];if(!!h)return h.get(i)}scopeRefs(p,i=this._values){return this._reduceValues(i,h=>{if(h.scopePath===void 0)throw new Error(`CodeGen: name "${h}" has no value`);return(0,t._)`${p}${h.scopePath}`})}scopeCode(p=this._values,i,h){return this._reduceValues(p,E=>{if(E.value===void 0)throw new Error(`CodeGen: name "${E}" has no value`);return E.value.code},i,h)}_reduceValues(p,i,h={},E){let T=t.nil;for(const I in p){const j=p[I];if(!j)continue;const y=h[I]=h[I]||new Map;j.forEach(_=>{if(y.has(_))return;y.set(_,n.Started);let b=i(_);if(b){const O=this.opts.es5?e.varKinds.var:e.varKinds.const;T=(0,t._)`${T}${O} ${_} = ${b};${this.opts._n}`}else if(b=E==null?void 0:E(_))T=(0,t._)`${T}${b}${this.opts._n}`;else throw new r(_);y.set(_,n.Completed)})}return T}}e.ValueScope=l})(Hn),function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.or=e.and=e.not=e.CodeGen=e.operators=e.varKinds=e.ValueScopeName=e.ValueScope=e.Scope=e.Name=e.regexpCode=e.stringify=e.getProperty=e.nil=e.strConcat=e.str=e._=void 0;const t=yr,r=Hn;var n=yr;Object.defineProperty(e,"_",{enumerable:!0,get:function(){return n._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return n.str}}),Object.defineProperty(e,"strConcat",{enumerable:!0,get:function(){return n.strConcat}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return n.nil}}),Object.defineProperty(e,"getProperty",{enumerable:!0,get:function(){return n.getProperty}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return n.stringify}}),Object.defineProperty(e,"regexpCode",{enumerable:!0,get:function(){return n.regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return n.Name}});var s=Hn;Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return s.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return s.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return s.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return s.varKinds}}),e.operators={GT:new t._Code(">"),GTE:new t._Code(">="),LT:new t._Code("<"),LTE:new t._Code("<="),EQ:new t._Code("==="),NEQ:new t._Code("!=="),NOT:new t._Code("!"),OR:new t._Code("||"),AND:new t._Code("&&"),ADD:new t._Code("+")};class a{optimizeNodes(){return this}optimizeNames(c,m){return this}}class o extends a{constructor(c,m,P){super(),this.varKind=c,this.name=m,this.rhs=P}render({es5:c,_n:m}){const P=c?r.varKinds.var:this.varKind,U=this.rhs===void 0?"":` = ${this.rhs}`;return`${P} ${this.name}${U};`+m}optimizeNames(c,m){if(!!c[this.name.str])return this.rhs&&(this.rhs=X(this.rhs,c,m)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}}class l extends a{constructor(c,m,P){super(),this.lhs=c,this.rhs=m,this.sideEffects=P}render({_n:c}){return`${this.lhs} = ${this.rhs};`+c}optimizeNames(c,m){if(!(this.lhs instanceof t.Name&&!c[this.lhs.str]&&!this.sideEffects))return this.rhs=X(this.rhs,c,m),this}get names(){const c=this.lhs instanceof t.Name?{}:Q({},this.lhs.names);return oe(c,this.rhs)}}class f extends l{constructor(c,m,P,U){super(c,P,U),this.op=m}render({_n:c}){return`${this.lhs} ${this.op}= ${this.rhs};`+c}}class p extends a{constructor(c){super(),this.label=c,this.names={}}render({_n:c}){return`${this.label}:`+c}}class i extends a{constructor(c){super(),this.label=c,this.names={}}render({_n:c}){return`break${this.label?` ${this.label}`:""};`+c}}class h extends a{constructor(c){super(),this.error=c}render({_n:c}){return`throw ${this.error};`+c}get names(){return this.error.names}}class E extends a{constructor(c){super(),this.code=c}render({_n:c}){return`${this.code};`+c}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(c,m){return this.code=X(this.code,c,m),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}}class T extends a{constructor(c=[]){super(),this.nodes=c}render(c){return this.nodes.reduce((m,P)=>m+P.render(c),"")}optimizeNodes(){const{nodes:c}=this;let m=c.length;for(;m--;){const P=c[m].optimizeNodes();Array.isArray(P)?c.splice(m,1,...P):P?c[m]=P:c.splice(m,1)}return c.length>0?this:void 0}optimizeNames(c,m){const{nodes:P}=this;let U=P.length;for(;U--;){const F=P[U];F.optimizeNames(c,m)||(ve(c,F.names),P.splice(U,1))}return P.length>0?this:void 0}get names(){return this.nodes.reduce((c,m)=>W(c,m.names),{})}}class I extends T{render(c){return"{"+c._n+super.render(c)+"}"+c._n}}class j extends T{}class y extends I{}y.kind="else";class _ extends I{constructor(c,m){super(m),this.condition=c}render(c){let m=`if(${this.condition})`+super.render(c);return this.else&&(m+="else "+this.else.render(c)),m}optimizeNodes(){super.optimizeNodes();const c=this.condition;if(c===!0)return this.nodes;let m=this.else;if(m){const P=m.optimizeNodes();m=this.else=Array.isArray(P)?new y(P):P}if(m)return c===!1?m instanceof _?m:m.nodes:this.nodes.length?this:new _(Ee(c),m instanceof _?[m]:m.nodes);if(!(c===!1||!this.nodes.length))return this}optimizeNames(c,m){var P;if(this.else=(P=this.else)===null||P===void 0?void 0:P.optimizeNames(c,m),!!(super.optimizeNames(c,m)||this.else))return this.condition=X(this.condition,c,m),this}get names(){const c=super.names;return oe(c,this.condition),this.else&&W(c,this.else.names),c}}_.kind="if";class b extends I{}b.kind="for";class O extends b{constructor(c){super(),this.iteration=c}render(c){return`for(${this.iteration})`+super.render(c)}optimizeNames(c,m){if(!!super.optimizeNames(c,m))return this.iteration=X(this.iteration,c,m),this}get names(){return W(super.names,this.iteration.names)}}class A extends b{constructor(c,m,P,U){super(),this.varKind=c,this.name=m,this.from=P,this.to=U}render(c){const m=c.es5?r.varKinds.var:this.varKind,{name:P,from:U,to:F}=this;return`for(${m} ${P}=${U}; ${P}<${F}; ${P}++)`+super.render(c)}get names(){const c=oe(super.names,this.from);return oe(c,this.to)}}class H extends b{constructor(c,m,P,U){super(),this.loop=c,this.varKind=m,this.name=P,this.iterable=U}render(c){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(c)}optimizeNames(c,m){if(!!super.optimizeNames(c,m))return this.iterable=X(this.iterable,c,m),this}get names(){return W(super.names,this.iterable.names)}}class $ extends I{constructor(c,m,P){super(),this.name=c,this.args=m,this.async=P}render(c){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(c)}}$.kind="func";class N extends T{render(c){return"return "+super.render(c)}}N.kind="return";class D extends I{render(c){let m="try"+super.render(c);return this.catch&&(m+=this.catch.render(c)),this.finally&&(m+=this.finally.render(c)),m}optimizeNodes(){var c,m;return super.optimizeNodes(),(c=this.catch)===null||c===void 0||c.optimizeNodes(),(m=this.finally)===null||m===void 0||m.optimizeNodes(),this}optimizeNames(c,m){var P,U;return super.optimizeNames(c,m),(P=this.catch)===null||P===void 0||P.optimizeNames(c,m),(U=this.finally)===null||U===void 0||U.optimizeNames(c,m),this}get names(){const c=super.names;return this.catch&&W(c,this.catch.names),this.finally&&W(c,this.finally.names),c}}class B extends I{constructor(c){super(),this.error=c}render(c){return`catch(${this.error})`+super.render(c)}}B.kind="catch";class G extends I{render(c){return"finally"+super.render(c)}}G.kind="finally";class pe{constructor(c,m={}){this._values={},this._blockStarts=[],this._constants={},this.opts=le(Q({},m),{_n:m.lines?`
3
+ `:""}),this._extScope=c,this._scope=new r.Scope({parent:c}),this._nodes=[new j]}toString(){return this._root.render(this.opts)}name(c){return this._scope.name(c)}scopeName(c){return this._extScope.name(c)}scopeValue(c,m){const P=this._extScope.value(c,m);return(this._values[P.prefix]||(this._values[P.prefix]=new Set)).add(P),P}getScopeValue(c,m){return this._extScope.getValue(c,m)}scopeRefs(c){return this._extScope.scopeRefs(c,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(c,m,P,U){const F=this._scope.toName(m);return P!==void 0&&U&&(this._constants[F.str]=P),this._leafNode(new o(c,F,P)),F}const(c,m,P){return this._def(r.varKinds.const,c,m,P)}let(c,m,P){return this._def(r.varKinds.let,c,m,P)}var(c,m,P){return this._def(r.varKinds.var,c,m,P)}assign(c,m,P){return this._leafNode(new l(c,m,P))}add(c,m){return this._leafNode(new f(c,e.operators.ADD,m))}code(c){return typeof c=="function"?c():c!==t.nil&&this._leafNode(new E(c)),this}object(...c){const m=["{"];for(const[P,U]of c)m.length>1&&m.push(","),m.push(P),(P!==U||this.opts.es5)&&(m.push(":"),(0,t.addCodeArg)(m,U));return m.push("}"),new t._Code(m)}if(c,m,P){if(this._blockNode(new _(c)),m&&P)this.code(m).else().code(P).endIf();else if(m)this.code(m).endIf();else if(P)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(c){return this._elseNode(new _(c))}else(){return this._elseNode(new y)}endIf(){return this._endBlockNode(_,y)}_for(c,m){return this._blockNode(c),m&&this.code(m).endFor(),this}for(c,m){return this._for(new O(c),m)}forRange(c,m,P,U,F=this.opts.es5?r.varKinds.var:r.varKinds.let){const Z=this._scope.toName(c);return this._for(new A(F,Z,m,P),()=>U(Z))}forOf(c,m,P,U=r.varKinds.const){const F=this._scope.toName(c);if(this.opts.es5){const Z=m instanceof t.Name?m:this.var("_arr",m);return this.forRange("_i",0,(0,t._)`${Z}.length`,re=>{this.var(F,(0,t._)`${Z}[${re}]`),P(F)})}return this._for(new H("of",U,F,m),()=>P(F))}forIn(c,m,P,U=this.opts.es5?r.varKinds.var:r.varKinds.const){if(this.opts.ownProperties)return this.forOf(c,(0,t._)`Object.keys(${m})`,P);const F=this._scope.toName(c);return this._for(new H("in",U,F,m),()=>P(F))}endFor(){return this._endBlockNode(b)}label(c){return this._leafNode(new p(c))}break(c){return this._leafNode(new i(c))}return(c){const m=new N;if(this._blockNode(m),this.code(c),m.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(N)}try(c,m,P){if(!m&&!P)throw new Error('CodeGen: "try" without "catch" and "finally"');const U=new D;if(this._blockNode(U),this.code(c),m){const F=this.name("e");this._currNode=U.catch=new B(F),m(F)}return P&&(this._currNode=U.finally=new G,this.code(P)),this._endBlockNode(B,G)}throw(c){return this._leafNode(new h(c))}block(c,m){return this._blockStarts.push(this._nodes.length),c&&this.code(c).endBlock(m),this}endBlock(c){const m=this._blockStarts.pop();if(m===void 0)throw new Error("CodeGen: not in self-balancing block");const P=this._nodes.length-m;if(P<0||c!==void 0&&P!==c)throw new Error(`CodeGen: wrong number of nodes: ${P} vs ${c} expected`);return this._nodes.length=m,this}func(c,m=t.nil,P,U){return this._blockNode(new $(c,m,P)),U&&this.code(U).endFunc(),this}endFunc(){return this._endBlockNode($)}optimize(c=1){for(;c-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(c){return this._currNode.nodes.push(c),this}_blockNode(c){this._currNode.nodes.push(c),this._nodes.push(c)}_endBlockNode(c,m){const P=this._currNode;if(P instanceof c||m&&P instanceof m)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${m?`${c.kind}/${m.kind}`:c.kind}"`)}_elseNode(c){const m=this._currNode;if(!(m instanceof _))throw new Error('CodeGen: "else" without "if"');return this._currNode=m.else=c,this}get _root(){return this._nodes[0]}get _currNode(){const c=this._nodes;return c[c.length-1]}set _currNode(c){const m=this._nodes;m[m.length-1]=c}}e.CodeGen=pe;function W(w,c){for(const m in c)w[m]=(w[m]||0)+(c[m]||0);return w}function oe(w,c){return c instanceof t._CodeOrName?W(w,c.names):w}function X(w,c,m){if(w instanceof t.Name)return P(w);if(!U(w))return w;return new t._Code(w._items.reduce((F,Z)=>(Z instanceof t.Name&&(Z=P(Z)),Z instanceof t._Code?F.push(...Z._items):F.push(Z),F),[]));function P(F){const Z=m[F.str];return Z===void 0||c[F.str]!==1?F:(delete c[F.str],Z)}function U(F){return F instanceof t._Code&&F._items.some(Z=>Z instanceof t.Name&&c[Z.str]===1&&m[Z.str]!==void 0)}}function ve(w,c){for(const m in c)w[m]=(w[m]||0)-(c[m]||0)}function Ee(w){return typeof w=="boolean"||typeof w=="number"||w===null?!w:(0,t._)`!${C(w)}`}e.not=Ee;const Ne=g(e.operators.AND);function Be(...w){return w.reduce(Ne)}e.and=Be;const ur=g(e.operators.OR);function k(...w){return w.reduce(ur)}e.or=k;function g(w){return(c,m)=>c===t.nil?m:m===t.nil?c:(0,t._)`${C(c)} ${w} ${C(m)}`}function C(w){return w instanceof t.Name?w:(0,t._)`(${w})`}}(ue);var be={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.checkStrictMode=e.getErrorPath=e.Type=e.useFunc=e.setEvaluated=e.evaluatedPropsToName=e.mergeEvaluated=e.eachItem=e.unescapeJsonPointer=e.escapeJsonPointer=e.escapeFragment=e.unescapeFragment=e.schemaRefOrVal=e.schemaHasRulesButRef=e.schemaHasRules=e.checkUnknownRules=e.alwaysValidSchema=e.toHash=void 0;const t=ue,r=yr;function n($){const N={};for(const D of $)N[D]=!0;return N}e.toHash=n;function s($,N){return typeof N=="boolean"?N:Object.keys(N).length===0?!0:(a($,N),!o(N,$.self.RULES.all))}e.alwaysValidSchema=s;function a($,N=$.schema){const{opts:D,self:B}=$;if(!D.strictSchema||typeof N=="boolean")return;const G=B.RULES.keywords;for(const pe in N)G[pe]||H($,`unknown keyword: "${pe}"`)}e.checkUnknownRules=a;function o($,N){if(typeof $=="boolean")return!$;for(const D in $)if(N[D])return!0;return!1}e.schemaHasRules=o;function l($,N){if(typeof $=="boolean")return!$;for(const D in $)if(D!=="$ref"&&N.all[D])return!0;return!1}e.schemaHasRulesButRef=l;function f({topSchemaRef:$,schemaPath:N},D,B,G){if(!G){if(typeof D=="number"||typeof D=="boolean")return D;if(typeof D=="string")return(0,t._)`${D}`}return(0,t._)`${$}${N}${(0,t.getProperty)(B)}`}e.schemaRefOrVal=f;function p($){return E(decodeURIComponent($))}e.unescapeFragment=p;function i($){return encodeURIComponent(h($))}e.escapeFragment=i;function h($){return typeof $=="number"?`${$}`:$.replace(/~/g,"~0").replace(/\//g,"~1")}e.escapeJsonPointer=h;function E($){return $.replace(/~1/g,"/").replace(/~0/g,"~")}e.unescapeJsonPointer=E;function T($,N){if(Array.isArray($))for(const D of $)N(D);else N($)}e.eachItem=T;function I({mergeNames:$,mergeToName:N,mergeValues:D,resultToName:B}){return(G,pe,W,oe)=>{const X=W===void 0?pe:W instanceof t.Name?(pe instanceof t.Name?$(G,pe,W):N(G,pe,W),W):pe instanceof t.Name?(N(G,W,pe),pe):D(pe,W);return oe===t.Name&&!(X instanceof t.Name)?B(G,X):X}}e.mergeEvaluated={props:I({mergeNames:($,N,D)=>$.if((0,t._)`${D} !== true && ${N} !== undefined`,()=>{$.if((0,t._)`${N} === true`,()=>$.assign(D,!0),()=>$.assign(D,(0,t._)`${D} || {}`).code((0,t._)`Object.assign(${D}, ${N})`))}),mergeToName:($,N,D)=>$.if((0,t._)`${D} !== true`,()=>{N===!0?$.assign(D,!0):($.assign(D,(0,t._)`${D} || {}`),y($,D,N))}),mergeValues:($,N)=>$===!0?!0:Q(Q({},$),N),resultToName:j}),items:I({mergeNames:($,N,D)=>$.if((0,t._)`${D} !== true && ${N} !== undefined`,()=>$.assign(D,(0,t._)`${N} === true ? true : ${D} > ${N} ? ${D} : ${N}`)),mergeToName:($,N,D)=>$.if((0,t._)`${D} !== true`,()=>$.assign(D,N===!0?!0:(0,t._)`${D} > ${N} ? ${D} : ${N}`)),mergeValues:($,N)=>$===!0?!0:Math.max($,N),resultToName:($,N)=>$.var("items",N)})};function j($,N){if(N===!0)return $.var("props",!0);const D=$.var("props",(0,t._)`{}`);return N!==void 0&&y($,D,N),D}e.evaluatedPropsToName=j;function y($,N,D){Object.keys(D).forEach(B=>$.assign((0,t._)`${N}${(0,t.getProperty)(B)}`,!0))}e.setEvaluated=y;const _={};function b($,N){return $.scopeValue("func",{ref:N,code:_[N.code]||(_[N.code]=new r._Code(N.code))})}e.useFunc=b;var O;(function($){$[$.Num=0]="Num",$[$.Str=1]="Str"})(O=e.Type||(e.Type={}));function A($,N,D){if($ instanceof t.Name){const B=N===O.Num;return D?B?(0,t._)`"[" + ${$} + "]"`:(0,t._)`"['" + ${$} + "']"`:B?(0,t._)`"/" + ${$}`:(0,t._)`"/" + ${$}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return D?(0,t.getProperty)($).toString():"/"+h($)}e.getErrorPath=A;function H($,N,D=$.opts.strictSchema){if(!!D){if(N=`strict mode: ${N}`,D===!0)throw new Error(N);$.self.logger.warn(N)}}e.checkStrictMode=H})(be);var Le={};Object.defineProperty(Le,"__esModule",{value:!0});const Ae=ue,vc={data:new Ae.Name("data"),valCxt:new Ae.Name("valCxt"),instancePath:new Ae.Name("instancePath"),parentData:new Ae.Name("parentData"),parentDataProperty:new Ae.Name("parentDataProperty"),rootData:new Ae.Name("rootData"),dynamicAnchors:new Ae.Name("dynamicAnchors"),vErrors:new Ae.Name("vErrors"),errors:new Ae.Name("errors"),this:new Ae.Name("this"),self:new Ae.Name("self"),scope:new Ae.Name("scope"),json:new Ae.Name("json"),jsonPos:new Ae.Name("jsonPos"),jsonLen:new Ae.Name("jsonLen"),jsonPart:new Ae.Name("jsonPart")};Le.default=vc,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;const t=ue,r=be,n=Le;e.keywordError={message:({keyword:y})=>(0,t.str)`must pass "${y}" keyword validation`},e.keyword$DataError={message:({keyword:y,schemaType:_})=>_?(0,t.str)`"${y}" keyword must be ${_} ($data)`:(0,t.str)`"${y}" keyword is invalid ($data)`};function s(y,_=e.keywordError,b,O){const{it:A}=y,{gen:H,compositeRule:$,allErrors:N}=A,D=h(y,_,b);(O!=null?O:$||N)?f(H,D):p(A,(0,t._)`[${D}]`)}e.reportError=s;function a(y,_=e.keywordError,b){const{it:O}=y,{gen:A,compositeRule:H,allErrors:$}=O,N=h(y,_,b);f(A,N),H||$||p(O,n.default.vErrors)}e.reportExtraError=a;function o(y,_){y.assign(n.default.errors,_),y.if((0,t._)`${n.default.vErrors} !== null`,()=>y.if(_,()=>y.assign((0,t._)`${n.default.vErrors}.length`,_),()=>y.assign(n.default.vErrors,null)))}e.resetErrorsCount=o;function l({gen:y,keyword:_,schemaValue:b,data:O,errsCount:A,it:H}){if(A===void 0)throw new Error("ajv implementation error");const $=y.name("err");y.forRange("i",A,n.default.errors,N=>{y.const($,(0,t._)`${n.default.vErrors}[${N}]`),y.if((0,t._)`${$}.instancePath === undefined`,()=>y.assign((0,t._)`${$}.instancePath`,(0,t.strConcat)(n.default.instancePath,H.errorPath))),y.assign((0,t._)`${$}.schemaPath`,(0,t.str)`${H.errSchemaPath}/${_}`),H.opts.verbose&&(y.assign((0,t._)`${$}.schema`,b),y.assign((0,t._)`${$}.data`,O))})}e.extendErrors=l;function f(y,_){const b=y.const("err",_);y.if((0,t._)`${n.default.vErrors} === null`,()=>y.assign(n.default.vErrors,(0,t._)`[${b}]`),(0,t._)`${n.default.vErrors}.push(${b})`),y.code((0,t._)`${n.default.errors}++`)}function p(y,_){const{gen:b,validateName:O,schemaEnv:A}=y;A.$async?b.throw((0,t._)`new ${y.ValidationError}(${_})`):(b.assign((0,t._)`${O}.errors`,_),b.return(!1))}const i={keyword:new t.Name("keyword"),schemaPath:new t.Name("schemaPath"),params:new t.Name("params"),propertyName:new t.Name("propertyName"),message:new t.Name("message"),schema:new t.Name("schema"),parentSchema:new t.Name("parentSchema")};function h(y,_,b){const{createErrors:O}=y.it;return O===!1?(0,t._)`{}`:E(y,_,b)}function E(y,_,b={}){const{gen:O,it:A}=y,H=[T(A,b),I(y,b)];return j(y,_,H),O.object(...H)}function T({errorPath:y},{instancePath:_}){const b=_?(0,t.str)`${y}${(0,r.getErrorPath)(_,r.Type.Str)}`:y;return[n.default.instancePath,(0,t.strConcat)(n.default.instancePath,b)]}function I({keyword:y,it:{errSchemaPath:_}},{schemaPath:b,parentSchema:O}){let A=O?_:(0,t.str)`${_}/${y}`;return b&&(A=(0,t.str)`${A}${(0,r.getErrorPath)(b,r.Type.Str)}`),[i.schemaPath,A]}function j(y,{params:_,message:b},O){const{keyword:A,data:H,schemaValue:$,it:N}=y,{opts:D,propertyName:B,topSchemaRef:G,schemaPath:pe}=N;O.push([i.keyword,A],[i.params,typeof _=="function"?_(y):_||(0,t._)`{}`]),D.messages&&O.push([i.message,typeof b=="function"?b(y):b]),D.verbose&&O.push([i.schema,$],[i.parentSchema,(0,t._)`${G}${pe}`],[n.default.data,H]),B&&O.push([i.propertyName,B])}}(Er),Object.defineProperty(tr,"__esModule",{value:!0}),tr.boolOrEmptySchema=tr.topBoolOrEmptySchema=void 0;const _c=Er,gc=ue,Ec=Le,yc={message:"boolean schema is false"};function $c(e){const{gen:t,schema:r,validateName:n}=e;r===!1?na(e,!1):typeof r=="object"&&r.$async===!0?t.return(Ec.default.data):(t.assign((0,gc._)`${n}.errors`,null),t.return(!0))}tr.topBoolOrEmptySchema=$c;function wc(e,t){const{gen:r,schema:n}=e;n===!1?(r.var(t,!1),na(e)):r.var(t,!0)}tr.boolOrEmptySchema=wc;function na(e,t){const{gen:r,data:n}=e,s={gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,_c.reportError)(s,yc,void 0,t)}var nn={},Dt={};Object.defineProperty(Dt,"__esModule",{value:!0}),Dt.getRules=Dt.isJSONType=void 0;const Sc=["string","number","integer","boolean","null","object","array"],Rc=new Set(Sc);function bc(e){return typeof e=="string"&&Rc.has(e)}Dt.isJSONType=bc;function Oc(){const e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:le(Q({},e),{integer:!0,boolean:!0,null:!0}),rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}Dt.getRules=Oc;var lt={};Object.defineProperty(lt,"__esModule",{value:!0}),lt.shouldUseRule=lt.shouldUseGroup=lt.schemaHasRulesForType=void 0;function Nc({schema:e,self:t},r){const n=t.RULES.types[r];return n&&n!==!0&&sa(e,n)}lt.schemaHasRulesForType=Nc;function sa(e,t){return t.rules.some(r=>aa(e,r))}lt.shouldUseGroup=sa;function aa(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))}lt.shouldUseRule=aa,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.reportTypeError=e.checkDataTypes=e.checkDataType=e.coerceAndCheckDataType=e.getJSONTypes=e.getSchemaTypes=e.DataType=void 0;const t=Dt,r=lt,n=Er,s=ue,a=be;var o;(function(O){O[O.Correct=0]="Correct",O[O.Wrong=1]="Wrong"})(o=e.DataType||(e.DataType={}));function l(O){const A=f(O.type);if(A.includes("null")){if(O.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!A.length&&O.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');O.nullable===!0&&A.push("null")}return A}e.getSchemaTypes=l;function f(O){const A=Array.isArray(O)?O:O?[O]:[];if(A.every(t.isJSONType))return A;throw new Error("type must be JSONType or JSONType[]: "+A.join(","))}e.getJSONTypes=f;function p(O,A){const{gen:H,data:$,opts:N}=O,D=h(A,N.coerceTypes),B=A.length>0&&!(D.length===0&&A.length===1&&(0,r.schemaHasRulesForType)(O,A[0]));if(B){const G=j(A,$,N.strictNumbers,o.Wrong);H.if(G,()=>{D.length?E(O,A,D):_(O)})}return B}e.coerceAndCheckDataType=p;const i=new Set(["string","number","integer","boolean","null"]);function h(O,A){return A?O.filter(H=>i.has(H)||A==="array"&&H==="array"):[]}function E(O,A,H){const{gen:$,data:N,opts:D}=O,B=$.let("dataType",(0,s._)`typeof ${N}`),G=$.let("coerced",(0,s._)`undefined`);D.coerceTypes==="array"&&$.if((0,s._)`${B} == 'object' && Array.isArray(${N}) && ${N}.length == 1`,()=>$.assign(N,(0,s._)`${N}[0]`).assign(B,(0,s._)`typeof ${N}`).if(j(A,N,D.strictNumbers),()=>$.assign(G,N))),$.if((0,s._)`${G} !== undefined`);for(const W of H)(i.has(W)||W==="array"&&D.coerceTypes==="array")&&pe(W);$.else(),_(O),$.endIf(),$.if((0,s._)`${G} !== undefined`,()=>{$.assign(N,G),T(O,G)});function pe(W){switch(W){case"string":$.elseIf((0,s._)`${B} == "number" || ${B} == "boolean"`).assign(G,(0,s._)`"" + ${N}`).elseIf((0,s._)`${N} === null`).assign(G,(0,s._)`""`);return;case"number":$.elseIf((0,s._)`${B} == "boolean" || ${N} === null
4
+ || (${B} == "string" && ${N} && ${N} == +${N})`).assign(G,(0,s._)`+${N}`);return;case"integer":$.elseIf((0,s._)`${B} === "boolean" || ${N} === null
5
+ || (${B} === "string" && ${N} && ${N} == +${N} && !(${N} % 1))`).assign(G,(0,s._)`+${N}`);return;case"boolean":$.elseIf((0,s._)`${N} === "false" || ${N} === 0 || ${N} === null`).assign(G,!1).elseIf((0,s._)`${N} === "true" || ${N} === 1`).assign(G,!0);return;case"null":$.elseIf((0,s._)`${N} === "" || ${N} === 0 || ${N} === false`),$.assign(G,null);return;case"array":$.elseIf((0,s._)`${B} === "string" || ${B} === "number"
6
+ || ${B} === "boolean" || ${N} === null`).assign(G,(0,s._)`[${N}]`)}}}function T({gen:O,parentData:A,parentDataProperty:H},$){O.if((0,s._)`${A} !== undefined`,()=>O.assign((0,s._)`${A}[${H}]`,$))}function I(O,A,H,$=o.Correct){const N=$===o.Correct?s.operators.EQ:s.operators.NEQ;let D;switch(O){case"null":return(0,s._)`${A} ${N} null`;case"array":D=(0,s._)`Array.isArray(${A})`;break;case"object":D=(0,s._)`${A} && typeof ${A} == "object" && !Array.isArray(${A})`;break;case"integer":D=B((0,s._)`!(${A} % 1) && !isNaN(${A})`);break;case"number":D=B();break;default:return(0,s._)`typeof ${A} ${N} ${O}`}return $===o.Correct?D:(0,s.not)(D);function B(G=s.nil){return(0,s.and)((0,s._)`typeof ${A} == "number"`,G,H?(0,s._)`isFinite(${A})`:s.nil)}}e.checkDataType=I;function j(O,A,H,$){if(O.length===1)return I(O[0],A,H,$);let N;const D=(0,a.toHash)(O);if(D.array&&D.object){const B=(0,s._)`typeof ${A} != "object"`;N=D.null?B:(0,s._)`!${A} || ${B}`,delete D.null,delete D.array,delete D.object}else N=s.nil;D.number&&delete D.integer;for(const B in D)N=(0,s.and)(N,I(B,A,H,$));return N}e.checkDataTypes=j;const y={message:({schema:O})=>`must be ${O}`,params:({schema:O,schemaValue:A})=>typeof O=="string"?(0,s._)`{type: ${O}}`:(0,s._)`{type: ${A}}`};function _(O){const A=b(O);(0,n.reportError)(A,y)}e.reportTypeError=_;function b(O){const{gen:A,data:H,schema:$}=O,N=(0,a.schemaRefOrVal)(O,$,"type");return{gen:A,keyword:"type",data:H,schema:$.type,schemaCode:N,schemaValue:N,parentSchema:$,params:{},it:O}}}(nn);var sn={};Object.defineProperty(sn,"__esModule",{value:!0}),sn.assignDefaults=void 0;const rr=ue,Pc=be;function Tc(e,t){const{properties:r,items:n}=e.schema;if(t==="object"&&r)for(const s in r)oa(e,s,r[s].default);else t==="array"&&Array.isArray(n)&&n.forEach((s,a)=>oa(e,a,s.default))}sn.assignDefaults=Tc;function oa(e,t,r){const{gen:n,compositeRule:s,data:a,opts:o}=e;if(r===void 0)return;const l=(0,rr._)`${a}${(0,rr.getProperty)(t)}`;if(s){(0,Pc.checkStrictMode)(e,`default is ignored for: ${l}`);return}let f=(0,rr._)`${l} === undefined`;o.useDefaults==="empty"&&(f=(0,rr._)`${f} || ${l} === null || ${l} === ""`),n.if(f,(0,rr._)`${l} = ${(0,rr.stringify)(r)}`)}var Xe={},ne={};Object.defineProperty(ne,"__esModule",{value:!0}),ne.validateUnion=ne.validateArray=ne.usePattern=ne.callValidateCode=ne.schemaProperties=ne.allSchemaProperties=ne.noPropertyInData=ne.propertyInData=ne.isOwnProperty=ne.hasPropFunc=ne.reportMissingProp=ne.checkMissingProp=ne.checkReportMissingProp=void 0;const de=ue,Kn=be,Et=Le,Ac=be;function Cc(e,t){const{gen:r,data:n,it:s}=e;r.if(Jn(r,n,t,s.opts.ownProperties),()=>{e.setParams({missingProperty:(0,de._)`${t}`},!0),e.error()})}ne.checkReportMissingProp=Cc;function Ic({gen:e,data:t,it:{opts:r}},n,s){return(0,de.or)(...n.map(a=>(0,de.and)(Jn(e,t,a,r.ownProperties),(0,de._)`${s} = ${a}`)))}ne.checkMissingProp=Ic;function Dc(e,t){e.setParams({missingProperty:t},!0),e.error()}ne.reportMissingProp=Dc;function ia(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,de._)`Object.prototype.hasOwnProperty`})}ne.hasPropFunc=ia;function Bn(e,t,r){return(0,de._)`${ia(e)}.call(${t}, ${r})`}ne.isOwnProperty=Bn;function jc(e,t,r,n){const s=(0,de._)`${t}${(0,de.getProperty)(r)} !== undefined`;return n?(0,de._)`${s} && ${Bn(e,t,r)}`:s}ne.propertyInData=jc;function Jn(e,t,r,n){const s=(0,de._)`${t}${(0,de.getProperty)(r)} === undefined`;return n?(0,de.or)(s,(0,de.not)(Bn(e,t,r))):s}ne.noPropertyInData=Jn;function ca(e){return e?Object.keys(e).filter(t=>t!=="__proto__"):[]}ne.allSchemaProperties=ca;function kc(e,t){return ca(t).filter(r=>!(0,Kn.alwaysValidSchema)(e,t[r]))}ne.schemaProperties=kc;function Uc({schemaCode:e,data:t,it:{gen:r,topSchemaRef:n,schemaPath:s,errorPath:a},it:o},l,f,p){const i=p?(0,de._)`${e}, ${t}, ${n}${s}`:t,h=[[Et.default.instancePath,(0,de.strConcat)(Et.default.instancePath,a)],[Et.default.parentData,o.parentData],[Et.default.parentDataProperty,o.parentDataProperty],[Et.default.rootData,Et.default.rootData]];o.opts.dynamicRef&&h.push([Et.default.dynamicAnchors,Et.default.dynamicAnchors]);const E=(0,de._)`${i}, ${r.object(...h)}`;return f!==de.nil?(0,de._)`${l}.call(${f}, ${E})`:(0,de._)`${l}(${E})`}ne.callValidateCode=Uc;const Fc=(0,de._)`new RegExp`;function Mc({gen:e,it:{opts:t}},r){const n=t.unicodeRegExp?"u":"",{regExp:s}=t.code,a=s(r,n);return e.scopeValue("pattern",{key:a.toString(),ref:a,code:(0,de._)`${s.code==="new RegExp"?Fc:(0,Ac.useFunc)(e,s)}(${r}, ${n})`})}ne.usePattern=Mc;function Lc(e){const{gen:t,data:r,keyword:n,it:s}=e,a=t.name("valid");if(s.allErrors){const l=t.let("valid",!0);return o(()=>t.assign(l,!1)),l}return t.var(a,!0),o(()=>t.break()),a;function o(l){const f=t.const("len",(0,de._)`${r}.length`);t.forRange("i",0,f,p=>{e.subschema({keyword:n,dataProp:p,dataPropType:Kn.Type.Num},a),t.if((0,de.not)(a),l)})}}ne.validateArray=Lc;function Vc(e){const{gen:t,schema:r,keyword:n,it:s}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(f=>(0,Kn.alwaysValidSchema)(s,f))&&!s.opts.unevaluated)return;const o=t.let("valid",!1),l=t.name("_valid");t.block(()=>r.forEach((f,p)=>{const i=e.subschema({keyword:n,schemaProp:p,compositeRule:!0},l);t.assign(o,(0,de._)`${o} || ${l}`),e.mergeValidEvaluated(i,l)||t.if((0,de.not)(o))})),e.result(o,()=>e.reset(),()=>e.error(!0))}ne.validateUnion=Vc,Object.defineProperty(Xe,"__esModule",{value:!0}),Xe.validateKeywordUsage=Xe.validSchemaType=Xe.funcKeywordCode=Xe.macroKeywordCode=void 0;const Ie=ue,jt=Le,zc=ne,Hc=Er;function Kc(e,t){const{gen:r,keyword:n,schema:s,parentSchema:a,it:o}=e,l=t.macro.call(o.self,s,a,o),f=la(r,n,l);o.opts.validateSchema!==!1&&o.self.validateSchema(l,!0);const p=r.name("valid");e.subschema({schema:l,schemaPath:Ie.nil,errSchemaPath:`${o.errSchemaPath}/${n}`,topSchemaRef:f,compositeRule:!0},p),e.pass(p,()=>e.error(!0))}Xe.macroKeywordCode=Kc;function Bc(e,t){var r;const{gen:n,keyword:s,schema:a,parentSchema:o,$data:l,it:f}=e;qc(f,t);const p=!l&&t.compile?t.compile.call(f.self,a,o,f):t.validate,i=la(n,s,p),h=n.let("valid");e.block$data(h,E),e.ok((r=t.valid)!==null&&r!==void 0?r:h);function E(){if(t.errors===!1)j(),t.modifying&&ua(e),y(()=>e.error());else{const _=t.async?T():I();t.modifying&&ua(e),y(()=>Jc(e,_))}}function T(){const _=n.let("ruleErrs",null);return n.try(()=>j((0,Ie._)`await `),b=>n.assign(h,!1).if((0,Ie._)`${b} instanceof ${f.ValidationError}`,()=>n.assign(_,(0,Ie._)`${b}.errors`),()=>n.throw(b))),_}function I(){const _=(0,Ie._)`${i}.errors`;return n.assign(_,null),j(Ie.nil),_}function j(_=t.async?(0,Ie._)`await `:Ie.nil){const b=f.opts.passContext?jt.default.this:jt.default.self,O=!("compile"in t&&!l||t.schema===!1);n.assign(h,(0,Ie._)`${_}${(0,zc.callValidateCode)(e,i,b,O)}`,t.modifying)}function y(_){var b;n.if((0,Ie.not)((b=t.valid)!==null&&b!==void 0?b:h),_)}}Xe.funcKeywordCode=Bc;function ua(e){const{gen:t,data:r,it:n}=e;t.if(n.parentData,()=>t.assign(r,(0,Ie._)`${n.parentData}[${n.parentDataProperty}]`))}function Jc(e,t){const{gen:r}=e;r.if((0,Ie._)`Array.isArray(${t})`,()=>{r.assign(jt.default.vErrors,(0,Ie._)`${jt.default.vErrors} === null ? ${t} : ${jt.default.vErrors}.concat(${t})`).assign(jt.default.errors,(0,Ie._)`${jt.default.vErrors}.length`),(0,Hc.extendErrors)(e)},()=>e.error())}function qc({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}function la(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,Ie.stringify)(r)})}function Gc(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=="undefined")}Xe.validSchemaType=Gc;function Qc({schema:e,opts:t,self:r,errSchemaPath:n},s,a){if(Array.isArray(s.keyword)?!s.keyword.includes(a):s.keyword!==a)throw new Error("ajv implementation error");const o=s.dependencies;if(o!=null&&o.some(l=>!Object.prototype.hasOwnProperty.call(e,l)))throw new Error(`parent schema must have dependencies of ${a}: ${o.join(",")}`);if(s.validateSchema&&!s.validateSchema(e[a])){const f=`keyword "${a}" value is invalid at path "${n}": `+r.errorsText(s.validateSchema.errors);if(t.validateSchema==="log")r.logger.error(f);else throw new Error(f)}}Xe.validateKeywordUsage=Qc;var yt={};Object.defineProperty(yt,"__esModule",{value:!0}),yt.extendSubschemaMode=yt.extendSubschemaData=yt.getSubschema=void 0;const Ze=ue,fa=be;function Yc(e,{keyword:t,schemaProp:r,schema:n,schemaPath:s,errSchemaPath:a,topSchemaRef:o}){if(t!==void 0&&n!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(t!==void 0){const l=e.schema[t];return r===void 0?{schema:l,schemaPath:(0,Ze._)`${e.schemaPath}${(0,Ze.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:l[r],schemaPath:(0,Ze._)`${e.schemaPath}${(0,Ze.getProperty)(t)}${(0,Ze.getProperty)(r)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,fa.escapeFragment)(r)}`}}if(n!==void 0){if(s===void 0||a===void 0||o===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:s,topSchemaRef:o,errSchemaPath:a}}throw new Error('either "keyword" or "schema" must be passed')}yt.getSubschema=Yc;function Wc(e,t,{dataProp:r,dataPropType:n,data:s,dataTypes:a,propertyName:o}){if(s!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:l}=t;if(r!==void 0){const{errorPath:p,dataPathArr:i,opts:h}=t,E=l.let("data",(0,Ze._)`${t.data}${(0,Ze.getProperty)(r)}`,!0);f(E),e.errorPath=(0,Ze.str)`${p}${(0,fa.getErrorPath)(r,n,h.jsPropertySyntax)}`,e.parentDataProperty=(0,Ze._)`${r}`,e.dataPathArr=[...i,e.parentDataProperty]}if(s!==void 0){const p=s instanceof Ze.Name?s:l.let("data",s,!0);f(p),o!==void 0&&(e.propertyName=o)}a&&(e.dataTypes=a);function f(p){e.data=p,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,p]}}yt.extendSubschemaData=Wc;function Xc(e,{jtdDiscriminator:t,jtdMetadata:r,compositeRule:n,createErrors:s,allErrors:a}){n!==void 0&&(e.compositeRule=n),s!==void 0&&(e.createErrors=s),a!==void 0&&(e.allErrors=a),e.jtdDiscriminator=t,e.jtdMetadata=r}yt.extendSubschemaMode=Xc;var Te={},Zc=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var n,s,a;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(s=n;s--!==0;)if(!e(t[s],r[s]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(a=Object.keys(t),n=a.length,n!==Object.keys(r).length)return!1;for(s=n;s--!==0;)if(!Object.prototype.hasOwnProperty.call(r,a[s]))return!1;for(s=n;s--!==0;){var o=a[s];if(!e(t[o],r[o]))return!1}return!0}return t!==t&&r!==r},da={exports:{}},$t=da.exports=function(e,t,r){typeof t=="function"&&(r=t,t={}),r=t.cb||r;var n=typeof r=="function"?r:r.pre||function(){},s=r.post||function(){};an(t,n,s,e,"",e)};$t.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},$t.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},$t.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},$t.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function an(e,t,r,n,s,a,o,l,f,p){if(n&&typeof n=="object"&&!Array.isArray(n)){t(n,s,a,o,l,f,p);for(var i in n){var h=n[i];if(Array.isArray(h)){if(i in $t.arrayKeywords)for(var E=0;E<h.length;E++)an(e,t,r,h[E],s+"/"+i+"/"+E,a,s,i,n,E)}else if(i in $t.propsKeywords){if(h&&typeof h=="object")for(var T in h)an(e,t,r,h[T],s+"/"+i+"/"+xc(T),a,s,i,n,T)}else(i in $t.keywords||e.allKeys&&!(i in $t.skipKeywords))&&an(e,t,r,h,s+"/"+i,a,s,i,n)}r(n,s,a,o,l,f,p)}}function xc(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}Object.defineProperty(Te,"__esModule",{value:!0}),Te.getSchemaRefs=Te.resolveUrl=Te.normalizeId=Te._getFullPath=Te.getFullPath=Te.inlineRef=void 0;const eu=be,tu=Zc,ru=da.exports,nu=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function su(e,t=!0){return typeof e=="boolean"?!0:t===!0?!qn(e):t?ha(e)<=t:!1}Te.inlineRef=su;const au=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function qn(e){for(const t in e){if(au.has(t))return!0;const r=e[t];if(Array.isArray(r)&&r.some(qn)||typeof r=="object"&&qn(r))return!0}return!1}function ha(e){let t=0;for(const r in e){if(r==="$ref")return 1/0;if(t++,!nu.has(r)&&(typeof e[r]=="object"&&(0,eu.eachItem)(e[r],n=>t+=ha(n)),t===1/0))return 1/0}return t}function pa(e,t="",r){r!==!1&&(t=nr(t));const n=e.parse(t);return ma(e,n)}Te.getFullPath=pa;function ma(e,t){return e.serialize(t).split("#")[0]+"#"}Te._getFullPath=ma;const ou=/#\/?$/;function nr(e){return e?e.replace(ou,""):""}Te.normalizeId=nr;function iu(e,t,r){return r=nr(r),e.resolve(t,r)}Te.resolveUrl=iu;const cu=/^[a-z_][-a-z0-9._]*$/i;function uu(e,t){if(typeof e=="boolean")return{};const{schemaId:r,uriResolver:n}=this.opts,s=nr(e[r]||t),a={"":s},o=pa(n,s,!1),l={},f=new Set;return ru(e,{allKeys:!0},(h,E,T,I)=>{if(I===void 0)return;const j=o+E;let y=a[I];typeof h[r]=="string"&&(y=_.call(this,h[r])),b.call(this,h.$anchor),b.call(this,h.$dynamicAnchor),a[E]=y;function _(O){const A=this.opts.uriResolver.resolve;if(O=nr(y?A(y,O):O),f.has(O))throw i(O);f.add(O);let H=this.refs[O];return typeof H=="string"&&(H=this.refs[H]),typeof H=="object"?p(h,H.schema,O):O!==nr(j)&&(O[0]==="#"?(p(h,l[O],O),l[O]=h):this.refs[O]=j),O}function b(O){if(typeof O=="string"){if(!cu.test(O))throw new Error(`invalid anchor "${O}"`);_.call(this,`#${O}`)}}}),l;function p(h,E,T){if(E!==void 0&&!tu(h,E))throw i(T)}function i(h){return new Error(`reference "${h}" resolves to more than one schema`)}}Te.getSchemaRefs=uu,Object.defineProperty(We,"__esModule",{value:!0}),We.getData=We.KeywordCxt=We.validateFunctionCode=void 0;const va=tr,_a=nn,Gn=lt,on=nn,lu=sn,$r=Xe,Qn=yt,M=ue,J=Le,fu=Te,ft=be,wr=Er;function du(e){if($a(e)&&(wa(e),ya(e))){mu(e);return}ga(e,()=>(0,va.topBoolOrEmptySchema)(e))}We.validateFunctionCode=du;function ga({gen:e,validateName:t,schema:r,schemaEnv:n,opts:s},a){s.code.es5?e.func(t,(0,M._)`${J.default.data}, ${J.default.valCxt}`,n.$async,()=>{e.code((0,M._)`"use strict"; ${Ea(r,s)}`),pu(e,s),e.code(a)}):e.func(t,(0,M._)`${J.default.data}, ${hu(s)}`,n.$async,()=>e.code(Ea(r,s)).code(a))}function hu(e){return(0,M._)`{${J.default.instancePath}="", ${J.default.parentData}, ${J.default.parentDataProperty}, ${J.default.rootData}=${J.default.data}${e.dynamicRef?(0,M._)`, ${J.default.dynamicAnchors}={}`:M.nil}}={}`}function pu(e,t){e.if(J.default.valCxt,()=>{e.var(J.default.instancePath,(0,M._)`${J.default.valCxt}.${J.default.instancePath}`),e.var(J.default.parentData,(0,M._)`${J.default.valCxt}.${J.default.parentData}`),e.var(J.default.parentDataProperty,(0,M._)`${J.default.valCxt}.${J.default.parentDataProperty}`),e.var(J.default.rootData,(0,M._)`${J.default.valCxt}.${J.default.rootData}`),t.dynamicRef&&e.var(J.default.dynamicAnchors,(0,M._)`${J.default.valCxt}.${J.default.dynamicAnchors}`)},()=>{e.var(J.default.instancePath,(0,M._)`""`),e.var(J.default.parentData,(0,M._)`undefined`),e.var(J.default.parentDataProperty,(0,M._)`undefined`),e.var(J.default.rootData,J.default.data),t.dynamicRef&&e.var(J.default.dynamicAnchors,(0,M._)`{}`)})}function mu(e){const{schema:t,opts:r,gen:n}=e;ga(e,()=>{r.$comment&&t.$comment&&Ra(e),yu(e),n.let(J.default.vErrors,null),n.let(J.default.errors,0),r.unevaluated&&vu(e),Sa(e),Su(e)})}function vu(e){const{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",(0,M._)`${r}.evaluated`),t.if((0,M._)`${e.evaluated}.dynamicProps`,()=>t.assign((0,M._)`${e.evaluated}.props`,(0,M._)`undefined`)),t.if((0,M._)`${e.evaluated}.dynamicItems`,()=>t.assign((0,M._)`${e.evaluated}.items`,(0,M._)`undefined`))}function Ea(e,t){const r=typeof e=="object"&&e[t.schemaId];return r&&(t.code.source||t.code.process)?(0,M._)`/*# sourceURL=${r} */`:M.nil}function _u(e,t){if($a(e)&&(wa(e),ya(e))){gu(e,t);return}(0,va.boolOrEmptySchema)(e,t)}function ya({schema:e,self:t}){if(typeof e=="boolean")return!e;for(const r in e)if(t.RULES.all[r])return!0;return!1}function $a(e){return typeof e.schema!="boolean"}function gu(e,t){const{schema:r,gen:n,opts:s}=e;s.$comment&&r.$comment&&Ra(e),$u(e),wu(e);const a=n.const("_errs",J.default.errors);Sa(e,a),n.var(t,(0,M._)`${a} === ${J.default.errors}`)}function wa(e){(0,ft.checkUnknownRules)(e),Eu(e)}function Sa(e,t){if(e.opts.jtd)return ba(e,[],!1,t);const r=(0,_a.getSchemaTypes)(e.schema),n=(0,_a.coerceAndCheckDataType)(e,r);ba(e,r,!n,t)}function Eu(e){const{schema:t,errSchemaPath:r,opts:n,self:s}=e;t.$ref&&n.ignoreKeywordsWithRef&&(0,ft.schemaHasRulesButRef)(t,s.RULES)&&s.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function yu(e){const{schema:t,opts:r}=e;t.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,ft.checkStrictMode)(e,"default is ignored in the schema root")}function $u(e){const t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,fu.resolveUrl)(e.opts.uriResolver,e.baseId,t))}function wu(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}function Ra({gen:e,schemaEnv:t,schema:r,errSchemaPath:n,opts:s}){const a=r.$comment;if(s.$comment===!0)e.code((0,M._)`${J.default.self}.logger.log(${a})`);else if(typeof s.$comment=="function"){const o=(0,M.str)`${n}/$comment`,l=e.scopeValue("root",{ref:t.root});e.code((0,M._)`${J.default.self}.opts.$comment(${a}, ${o}, ${l}.schema)`)}}function Su(e){const{gen:t,schemaEnv:r,validateName:n,ValidationError:s,opts:a}=e;r.$async?t.if((0,M._)`${J.default.errors} === 0`,()=>t.return(J.default.data),()=>t.throw((0,M._)`new ${s}(${J.default.vErrors})`)):(t.assign((0,M._)`${n}.errors`,J.default.vErrors),a.unevaluated&&Ru(e),t.return((0,M._)`${J.default.errors} === 0`))}function Ru({gen:e,evaluated:t,props:r,items:n}){r instanceof M.Name&&e.assign((0,M._)`${t}.props`,r),n instanceof M.Name&&e.assign((0,M._)`${t}.items`,n)}function ba(e,t,r,n){const{gen:s,schema:a,data:o,allErrors:l,opts:f,self:p}=e,{RULES:i}=p;if(a.$ref&&(f.ignoreKeywordsWithRef||!(0,ft.schemaHasRulesButRef)(a,i))){s.block(()=>Ta(e,"$ref",i.all.$ref.definition));return}f.jtd||bu(e,t),s.block(()=>{for(const E of i.rules)h(E);h(i.post)});function h(E){!(0,Gn.shouldUseGroup)(a,E)||(E.type?(s.if((0,on.checkDataType)(E.type,o,f.strictNumbers)),Oa(e,E),t.length===1&&t[0]===E.type&&r&&(s.else(),(0,on.reportTypeError)(e)),s.endIf()):Oa(e,E),l||s.if((0,M._)`${J.default.errors} === ${n||0}`))}}function Oa(e,t){const{gen:r,schema:n,opts:{useDefaults:s}}=e;s&&(0,lu.assignDefaults)(e,t.type),r.block(()=>{for(const a of t.rules)(0,Gn.shouldUseRule)(n,a)&&Ta(e,a.keyword,a.definition,t.type)})}function bu(e,t){e.schemaEnv.meta||!e.opts.strictTypes||(Ou(e,t),e.opts.allowUnionTypes||Nu(e,t),Pu(e,e.dataTypes))}function Ou(e,t){if(!!t.length){if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach(r=>{Na(e.dataTypes,r)||Yn(e,`type "${r}" not allowed by context "${e.dataTypes.join(",")}"`)}),e.dataTypes=e.dataTypes.filter(r=>Na(t,r))}}function Nu(e,t){t.length>1&&!(t.length===2&&t.includes("null"))&&Yn(e,"use allowUnionTypes to allow union type keyword")}function Pu(e,t){const r=e.self.RULES.all;for(const n in r){const s=r[n];if(typeof s=="object"&&(0,Gn.shouldUseRule)(e.schema,s)){const{type:a}=s.definition;a.length&&!a.some(o=>Tu(t,o))&&Yn(e,`missing type "${a.join(",")}" for keyword "${n}"`)}}}function Tu(e,t){return e.includes(t)||t==="number"&&e.includes("integer")}function Na(e,t){return e.includes(t)||t==="integer"&&e.includes("number")}function Yn(e,t){t+=` at "${e.schemaEnv.baseId+e.errSchemaPath}" (strictTypes)`,(0,ft.checkStrictMode)(e,t,e.opts.strictTypes)}class Pa{constructor(t,r,n){if((0,$r.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,ft.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",Aa(this.$data,t));else if(this.schemaCode=this.schemaValue,!(0,$r.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",J.default.errors))}result(t,r,n){this.failResult((0,M.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,M.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);const{schemaCode:r}=this;this.fail((0,M._)`${r} !== undefined && (${(0,M.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?wr.reportExtraError:wr.reportError)(this,this.def.error,r)}$dataError(){(0,wr.reportError)(this,this.def.$dataError||wr.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,wr.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=M.nil){this.gen.block(()=>{this.check$data(t,n),r()})}check$data(t=M.nil,r=M.nil){if(!this.$data)return;const{gen:n,schemaCode:s,schemaType:a,def:o}=this;n.if((0,M.or)((0,M._)`${s} === undefined`,r)),t!==M.nil&&n.assign(t,!0),(a.length||o.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),t!==M.nil&&n.assign(t,!1)),n.else()}invalid$data(){const{gen:t,schemaCode:r,schemaType:n,def:s,it:a}=this;return(0,M.or)(o(),l());function o(){if(n.length){if(!(r instanceof M.Name))throw new Error("ajv implementation error");const f=Array.isArray(n)?n:[n];return(0,M._)`${(0,on.checkDataTypes)(f,r,a.opts.strictNumbers,on.DataType.Wrong)}`}return M.nil}function l(){if(s.validateSchema){const f=t.scopeValue("validate$data",{ref:s.validateSchema});return(0,M._)`!${f}(${r})`}return M.nil}}subschema(t,r){const n=(0,Qn.getSubschema)(this.it,t);(0,Qn.extendSubschemaData)(n,this.it,t),(0,Qn.extendSubschemaMode)(n,t);const s=le(Q(Q({},this.it),n),{items:void 0,props:void 0});return _u(s,r),s}mergeEvaluated(t,r){const{it:n,gen:s}=this;!n.opts.unevaluated||(n.props!==!0&&t.props!==void 0&&(n.props=ft.mergeEvaluated.props(s,t.props,n.props,r)),n.items!==!0&&t.items!==void 0&&(n.items=ft.mergeEvaluated.items(s,t.items,n.items,r)))}mergeValidEvaluated(t,r){const{it:n,gen:s}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return s.if(r,()=>this.mergeEvaluated(t,M.Name)),!0}}We.KeywordCxt=Pa;function Ta(e,t,r,n){const s=new Pa(e,r,t);"code"in r?r.code(s,n):s.$data&&r.validate?(0,$r.funcKeywordCode)(s,r):"macro"in r?(0,$r.macroKeywordCode)(s,r):(r.compile||r.validate)&&(0,$r.funcKeywordCode)(s,r)}const Au=/^\/(?:[^~]|~0|~1)*$/,Cu=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function Aa(e,{dataLevel:t,dataNames:r,dataPathArr:n}){let s,a;if(e==="")return J.default.rootData;if(e[0]==="/"){if(!Au.test(e))throw new Error(`Invalid JSON-pointer: ${e}`);s=e,a=J.default.rootData}else{const p=Cu.exec(e);if(!p)throw new Error(`Invalid JSON-pointer: ${e}`);const i=+p[1];if(s=p[2],s==="#"){if(i>=t)throw new Error(f("property/index",i));return n[t-i]}if(i>t)throw new Error(f("data",i));if(a=r[t-i],!s)return a}let o=a;const l=s.split("/");for(const p of l)p&&(a=(0,M._)`${a}${(0,M.getProperty)((0,ft.unescapeJsonPointer)(p))}`,o=(0,M._)`${o} && ${a}`);return o;function f(p,i){return`Cannot access ${p} ${i} levels up, current level is ${t}`}}We.getData=Aa;var cn={};Object.defineProperty(cn,"__esModule",{value:!0});class Iu extends Error{constructor(t){super("validation failed"),this.errors=t,this.ajv=this.validation=!0}}cn.default=Iu;var kt={};Object.defineProperty(kt,"__esModule",{value:!0});const Wn=Te;class Du extends Error{constructor(t,r,n,s){super(s||`can't resolve reference ${n} from id ${r}`),this.missingRef=(0,Wn.resolveUrl)(t,r,n),this.missingSchema=(0,Wn.normalizeId)((0,Wn.getFullPath)(t,this.missingRef))}}kt.default=Du;var Ce={};Object.defineProperty(Ce,"__esModule",{value:!0}),Ce.resolveSchema=Ce.getCompilingSchema=Ce.resolveRef=Ce.compileSchema=Ce.SchemaEnv=void 0;const Qe=ue,ju=cn,Ut=Le,Ye=Te,Ca=be,ku=We;class un{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,Ye.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={}}}Ce.SchemaEnv=un;function Xn(e){const t=Ia.call(this,e);if(t)return t;const r=(0,Ye.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:n,lines:s}=this.opts.code,{ownProperties:a}=this.opts,o=new Qe.CodeGen(this.scope,{es5:n,lines:s,ownProperties:a});let l;e.$async&&(l=o.scopeValue("Error",{ref:ju.default,code:(0,Qe._)`require("ajv/dist/runtime/validation_error").default`}));const f=o.scopeName("validate");e.validateName=f;const p={gen:o,allErrors:this.opts.allErrors,data:Ut.default.data,parentData:Ut.default.parentData,parentDataProperty:Ut.default.parentDataProperty,dataNames:[Ut.default.data],dataPathArr:[Qe.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:o.scopeValue("schema",this.opts.code.source===!0?{ref:e.schema,code:(0,Qe.stringify)(e.schema)}:{ref:e.schema}),validateName:f,ValidationError:l,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:Qe.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,Qe._)`""`,opts:this.opts,self:this};let i;try{this._compilations.add(e),(0,ku.validateFunctionCode)(p),o.optimize(this.opts.code.optimize);const h=o.toString();i=`${o.scopeRefs(Ut.default.scope)}return ${h}`,this.opts.code.process&&(i=this.opts.code.process(i,e));const T=new Function(`${Ut.default.self}`,`${Ut.default.scope}`,i)(this,this.scope.get());if(this.scope.value(f,{ref:T}),T.errors=null,T.schema=e.schema,T.schemaEnv=e,e.$async&&(T.$async=!0),this.opts.code.source===!0&&(T.source={validateName:f,validateCode:h,scopeValues:o._values}),this.opts.unevaluated){const{props:I,items:j}=p;T.evaluated={props:I instanceof Qe.Name?void 0:I,items:j instanceof Qe.Name?void 0:j,dynamicProps:I instanceof Qe.Name,dynamicItems:j instanceof Qe.Name},T.source&&(T.source.evaluated=(0,Qe.stringify)(T.evaluated))}return e.validate=T,e}catch(h){throw delete e.validate,delete e.validateName,i&&this.logger.error("Error compiling schema, function code:",i),h}finally{this._compilations.delete(e)}}Ce.compileSchema=Xn;function Uu(e,t,r){var n;r=(0,Ye.resolveUrl)(this.opts.uriResolver,t,r);const s=e.refs[r];if(s)return s;let a=Lu.call(this,e,r);if(a===void 0){const o=(n=e.localRefs)===null||n===void 0?void 0:n[r],{schemaId:l}=this.opts;o&&(a=new un({schema:o,schemaId:l,root:e,baseId:t}))}if(a!==void 0)return e.refs[r]=Fu.call(this,a)}Ce.resolveRef=Uu;function Fu(e){return(0,Ye.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:Xn.call(this,e)}function Ia(e){for(const t of this._compilations)if(Mu(t,e))return t}Ce.getCompilingSchema=Ia;function Mu(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function Lu(e,t){let r;for(;typeof(r=this.refs[t])=="string";)t=r;return r||this.schemas[t]||ln.call(this,e,t)}function ln(e,t){const r=this.opts.uriResolver.parse(t),n=(0,Ye._getFullPath)(this.opts.uriResolver,r);let s=(0,Ye.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&n===s)return Zn.call(this,r,e);const a=(0,Ye.normalizeId)(n),o=this.refs[a]||this.schemas[a];if(typeof o=="string"){const l=ln.call(this,e,o);return typeof(l==null?void 0:l.schema)!="object"?void 0:Zn.call(this,r,l)}if(typeof(o==null?void 0:o.schema)=="object"){if(o.validate||Xn.call(this,o),a===(0,Ye.normalizeId)(t)){const{schema:l}=o,{schemaId:f}=this.opts,p=l[f];return p&&(s=(0,Ye.resolveUrl)(this.opts.uriResolver,s,p)),new un({schema:l,schemaId:f,root:e,baseId:s})}return Zn.call(this,r,o)}}Ce.resolveSchema=ln;const Vu=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function Zn(e,{baseId:t,schema:r,root:n}){var s;if(((s=e.fragment)===null||s===void 0?void 0:s[0])!=="/")return;for(const l of e.fragment.slice(1).split("/")){if(typeof r=="boolean")return;const f=r[(0,Ca.unescapeFragment)(l)];if(f===void 0)return;r=f;const p=typeof r=="object"&&r[this.opts.schemaId];!Vu.has(l)&&p&&(t=(0,Ye.resolveUrl)(this.opts.uriResolver,t,p))}let a;if(typeof r!="boolean"&&r.$ref&&!(0,Ca.schemaHasRulesButRef)(r,this.RULES)){const l=(0,Ye.resolveUrl)(this.opts.uriResolver,t,r.$ref);a=ln.call(this,n,l)}const{schemaId:o}=this.opts;if(a=a||new un({schema:r,schemaId:o,root:n,baseId:t}),a.schema!==a.root.schema)return a}var zu={$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},xn={},es={exports:{}};/** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */(function(e,t){(function(r,n){n(t)})(ee,function(r){function n(){for(var d=arguments.length,u=Array(d),v=0;v<d;v++)u[v]=arguments[v];if(u.length>1){u[0]=u[0].slice(0,-1);for(var R=u.length-1,S=1;S<R;++S)u[S]=u[S].slice(1,-1);return u[R]=u[R].slice(1),u.join("")}else return u[0]}function s(d){return"(?:"+d+")"}function a(d){return d===void 0?"undefined":d===null?"null":Object.prototype.toString.call(d).split(" ").pop().split("]").shift().toLowerCase()}function o(d){return d.toUpperCase()}function l(d){return d!=null?d instanceof Array?d:typeof d.length!="number"||d.split||d.setInterval||d.call?[d]:Array.prototype.slice.call(d):[]}function f(d,u){var v=d;if(u)for(var R in u)v[R]=u[R];return v}function p(d){var u="[A-Za-z]",v="[0-9]",R=n(v,"[A-Fa-f]"),S=s(s("%[EFef]"+R+"%"+R+R+"%"+R+R)+"|"+s("%[89A-Fa-f]"+R+"%"+R+R)+"|"+s("%"+R+R)),z="[\\:\\/\\?\\#\\[\\]\\@]",K="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",se=n(z,K),me=d?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]",$e=d?"[\\uE000-\\uF8FF]":"[]",x=n(u,v,"[\\-\\.\\_\\~]",me);s(u+n(u,v,"[\\+\\-\\.]")+"*"),s(s(S+"|"+n(x,K,"[\\:]"))+"*");var fe=s(s("25[0-5]")+"|"+s("2[0-4]"+v)+"|"+s("1"+v+v)+"|"+s("0?[1-9]"+v)+"|0?0?"+v),we=s(fe+"\\."+fe+"\\."+fe+"\\."+fe),q=s(R+"{1,4}"),_e=s(s(q+"\\:"+q)+"|"+we),Re=s(s(q+"\\:")+"{6}"+_e),ge=s("\\:\\:"+s(q+"\\:")+"{5}"+_e),Pt=s(s(q)+"?\\:\\:"+s(q+"\\:")+"{4}"+_e),at=s(s(s(q+"\\:")+"{0,1}"+q)+"?\\:\\:"+s(q+"\\:")+"{3}"+_e),ot=s(s(s(q+"\\:")+"{0,2}"+q)+"?\\:\\:"+s(q+"\\:")+"{2}"+_e),vr=s(s(s(q+"\\:")+"{0,3}"+q)+"?\\:\\:"+q+"\\:"+_e),qt=s(s(s(q+"\\:")+"{0,4}"+q)+"?\\:\\:"+_e),qe=s(s(s(q+"\\:")+"{0,5}"+q)+"?\\:\\:"+q),it=s(s(s(q+"\\:")+"{0,6}"+q)+"?\\:\\:"),Gt=s([Re,ge,Pt,at,ot,vr,qt,qe,it].join("|")),_t=s(s(x+"|"+S)+"+");s("[vV]"+R+"+\\."+n(x,K,"[\\:]")+"+"),s(s(S+"|"+n(x,K))+"*");var Br=s(S+"|"+n(x,K,"[\\:\\@]"));return s(s(S+"|"+n(x,K,"[\\@]"))+"+"),s(s(Br+"|"+n("[\\/\\?]",$e))+"*"),{NOT_SCHEME:new RegExp(n("[^]",u,v,"[\\+\\-\\.]"),"g"),NOT_USERINFO:new RegExp(n("[^\\%\\:]",x,K),"g"),NOT_HOST:new RegExp(n("[^\\%\\[\\]\\:]",x,K),"g"),NOT_PATH:new RegExp(n("[^\\%\\/\\:\\@]",x,K),"g"),NOT_PATH_NOSCHEME:new RegExp(n("[^\\%\\/\\@]",x,K),"g"),NOT_QUERY:new RegExp(n("[^\\%]",x,K,"[\\:\\@\\/\\?]",$e),"g"),NOT_FRAGMENT:new RegExp(n("[^\\%]",x,K,"[\\:\\@\\/\\?]"),"g"),ESCAPE:new RegExp(n("[^]",x,K),"g"),UNRESERVED:new RegExp(x,"g"),OTHER_CHARS:new RegExp(n("[^\\%]",x,se),"g"),PCT_ENCODED:new RegExp(S,"g"),IPV4ADDRESS:new RegExp("^("+we+")$"),IPV6ADDRESS:new RegExp("^\\[?("+Gt+")"+s(s("\\%25|\\%(?!"+R+"{2})")+"("+_t+")")+"?\\]?$")}}var i=p(!1),h=p(!0),E=function(){function d(u,v){var R=[],S=!0,z=!1,K=void 0;try{for(var se=u[Symbol.iterator](),me;!(S=(me=se.next()).done)&&(R.push(me.value),!(v&&R.length===v));S=!0);}catch($e){z=!0,K=$e}finally{try{!S&&se.return&&se.return()}finally{if(z)throw K}}return R}return function(u,v){if(Array.isArray(u))return u;if(Symbol.iterator in Object(u))return d(u,v);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),T=function(d){if(Array.isArray(d)){for(var u=0,v=Array(d.length);u<d.length;u++)v[u]=d[u];return v}else return Array.from(d)},I=2147483647,j=36,y=1,_=26,b=38,O=700,A=72,H=128,$="-",N=/^xn--/,D=/[^\0-\x7E]/,B=/[\x2E\u3002\uFF0E\uFF61]/g,G={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},pe=j-y,W=Math.floor,oe=String.fromCharCode;function X(d){throw new RangeError(G[d])}function ve(d,u){for(var v=[],R=d.length;R--;)v[R]=u(d[R]);return v}function Ee(d,u){var v=d.split("@"),R="";v.length>1&&(R=v[0]+"@",d=v[1]),d=d.replace(B,".");var S=d.split("."),z=ve(S,u).join(".");return R+z}function Ne(d){for(var u=[],v=0,R=d.length;v<R;){var S=d.charCodeAt(v++);if(S>=55296&&S<=56319&&v<R){var z=d.charCodeAt(v++);(z&64512)==56320?u.push(((S&1023)<<10)+(z&1023)+65536):(u.push(S),v--)}else u.push(S)}return u}var Be=function(u){return String.fromCodePoint.apply(String,T(u))},ur=function(u){return u-48<10?u-22:u-65<26?u-65:u-97<26?u-97:j},k=function(u,v){return u+22+75*(u<26)-((v!=0)<<5)},g=function(u,v,R){var S=0;for(u=R?W(u/O):u>>1,u+=W(u/v);u>pe*_>>1;S+=j)u=W(u/pe);return W(S+(pe+1)*u/(u+b))},C=function(u){var v=[],R=u.length,S=0,z=H,K=A,se=u.lastIndexOf($);se<0&&(se=0);for(var me=0;me<se;++me)u.charCodeAt(me)>=128&&X("not-basic"),v.push(u.charCodeAt(me));for(var $e=se>0?se+1:0;$e<R;){for(var x=S,fe=1,we=j;;we+=j){$e>=R&&X("invalid-input");var q=ur(u.charCodeAt($e++));(q>=j||q>W((I-S)/fe))&&X("overflow"),S+=q*fe;var _e=we<=K?y:we>=K+_?_:we-K;if(q<_e)break;var Re=j-_e;fe>W(I/Re)&&X("overflow"),fe*=Re}var ge=v.length+1;K=g(S-x,ge,x==0),W(S/ge)>I-z&&X("overflow"),z+=W(S/ge),S%=ge,v.splice(S++,0,z)}return String.fromCodePoint.apply(String,v)},w=function(u){var v=[];u=Ne(u);var R=u.length,S=H,z=0,K=A,se=!0,me=!1,$e=void 0;try{for(var x=u[Symbol.iterator](),fe;!(se=(fe=x.next()).done);se=!0){var we=fe.value;we<128&&v.push(oe(we))}}catch(Jr){me=!0,$e=Jr}finally{try{!se&&x.return&&x.return()}finally{if(me)throw $e}}var q=v.length,_e=q;for(q&&v.push($);_e<R;){var Re=I,ge=!0,Pt=!1,at=void 0;try{for(var ot=u[Symbol.iterator](),vr;!(ge=(vr=ot.next()).done);ge=!0){var qt=vr.value;qt>=S&&qt<Re&&(Re=qt)}}catch(Jr){Pt=!0,at=Jr}finally{try{!ge&&ot.return&&ot.return()}finally{if(Pt)throw at}}var qe=_e+1;Re-S>W((I-z)/qe)&&X("overflow"),z+=(Re-S)*qe,S=Re;var it=!0,Gt=!1,_t=void 0;try{for(var Br=u[Symbol.iterator](),Uo;!(it=(Uo=Br.next()).done);it=!0){var Fo=Uo.value;if(Fo<S&&++z>I&&X("overflow"),Fo==S){for(var Sn=z,Rn=j;;Rn+=j){var bn=Rn<=K?y:Rn>=K+_?_:Rn-K;if(Sn<bn)break;var Mo=Sn-bn,Lo=j-bn;v.push(oe(k(bn+Mo%Lo,0))),Sn=W(Mo/Lo)}v.push(oe(k(Sn,0))),K=g(z,qe,_e==q),z=0,++_e}}}catch(Jr){Gt=!0,_t=Jr}finally{try{!it&&Br.return&&Br.return()}finally{if(Gt)throw _t}}++z,++S}return v.join("")},c=function(u){return Ee(u,function(v){return N.test(v)?C(v.slice(4).toLowerCase()):v})},m=function(u){return Ee(u,function(v){return D.test(v)?"xn--"+w(v):v})},P={version:"2.1.0",ucs2:{decode:Ne,encode:Be},decode:C,encode:w,toASCII:m,toUnicode:c},U={};function F(d){var u=d.charCodeAt(0),v=void 0;return u<16?v="%0"+u.toString(16).toUpperCase():u<128?v="%"+u.toString(16).toUpperCase():u<2048?v="%"+(u>>6|192).toString(16).toUpperCase()+"%"+(u&63|128).toString(16).toUpperCase():v="%"+(u>>12|224).toString(16).toUpperCase()+"%"+(u>>6&63|128).toString(16).toUpperCase()+"%"+(u&63|128).toString(16).toUpperCase(),v}function Z(d){for(var u="",v=0,R=d.length;v<R;){var S=parseInt(d.substr(v+1,2),16);if(S<128)u+=String.fromCharCode(S),v+=3;else if(S>=194&&S<224){if(R-v>=6){var z=parseInt(d.substr(v+4,2),16);u+=String.fromCharCode((S&31)<<6|z&63)}else u+=d.substr(v,6);v+=6}else if(S>=224){if(R-v>=9){var K=parseInt(d.substr(v+4,2),16),se=parseInt(d.substr(v+7,2),16);u+=String.fromCharCode((S&15)<<12|(K&63)<<6|se&63)}else u+=d.substr(v,9);v+=9}else u+=d.substr(v,3),v+=3}return u}function re(d,u){function v(R){var S=Z(R);return S.match(u.UNRESERVED)?S:R}return d.scheme&&(d.scheme=String(d.scheme).replace(u.PCT_ENCODED,v).toLowerCase().replace(u.NOT_SCHEME,"")),d.userinfo!==void 0&&(d.userinfo=String(d.userinfo).replace(u.PCT_ENCODED,v).replace(u.NOT_USERINFO,F).replace(u.PCT_ENCODED,o)),d.host!==void 0&&(d.host=String(d.host).replace(u.PCT_ENCODED,v).toLowerCase().replace(u.NOT_HOST,F).replace(u.PCT_ENCODED,o)),d.path!==void 0&&(d.path=String(d.path).replace(u.PCT_ENCODED,v).replace(d.scheme?u.NOT_PATH:u.NOT_PATH_NOSCHEME,F).replace(u.PCT_ENCODED,o)),d.query!==void 0&&(d.query=String(d.query).replace(u.PCT_ENCODED,v).replace(u.NOT_QUERY,F).replace(u.PCT_ENCODED,o)),d.fragment!==void 0&&(d.fragment=String(d.fragment).replace(u.PCT_ENCODED,v).replace(u.NOT_FRAGMENT,F).replace(u.PCT_ENCODED,o)),d}function ye(d){return d.replace(/^0*(.*)/,"$1")||"0"}function rt(d,u){var v=d.match(u.IPV4ADDRESS)||[],R=E(v,2),S=R[1];return S?S.split(".").map(ye).join("."):d}function lr(d,u){var v=d.match(u.IPV6ADDRESS)||[],R=E(v,3),S=R[1],z=R[2];if(S){for(var K=S.toLowerCase().split("::").reverse(),se=E(K,2),me=se[0],$e=se[1],x=$e?$e.split(":").map(ye):[],fe=me.split(":").map(ye),we=u.IPV4ADDRESS.test(fe[fe.length-1]),q=we?7:8,_e=fe.length-q,Re=Array(q),ge=0;ge<q;++ge)Re[ge]=x[ge]||fe[_e+ge]||"";we&&(Re[q-1]=rt(Re[q-1],u));var Pt=Re.reduce(function(qe,it,Gt){if(!it||it==="0"){var _t=qe[qe.length-1];_t&&_t.index+_t.length===Gt?_t.length++:qe.push({index:Gt,length:1})}return qe},[]),at=Pt.sort(function(qe,it){return it.length-qe.length})[0],ot=void 0;if(at&&at.length>1){var vr=Re.slice(0,at.index),qt=Re.slice(at.index+at.length);ot=vr.join(":")+"::"+qt.join(":")}else ot=Re.join(":");return z&&(ot+="%"+z),ot}else return d}var Fr=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,Mr="".match(/(){0}/)[1]===void 0;function Me(d){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},v={},R=u.iri!==!1?h:i;u.reference==="suffix"&&(d=(u.scheme?u.scheme+":":"")+"//"+d);var S=d.match(Fr);if(S){Mr?(v.scheme=S[1],v.userinfo=S[3],v.host=S[4],v.port=parseInt(S[5],10),v.path=S[6]||"",v.query=S[7],v.fragment=S[8],isNaN(v.port)&&(v.port=S[5])):(v.scheme=S[1]||void 0,v.userinfo=d.indexOf("@")!==-1?S[3]:void 0,v.host=d.indexOf("//")!==-1?S[4]:void 0,v.port=parseInt(S[5],10),v.path=S[6]||"",v.query=d.indexOf("?")!==-1?S[7]:void 0,v.fragment=d.indexOf("#")!==-1?S[8]:void 0,isNaN(v.port)&&(v.port=d.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?S[4]:void 0)),v.host&&(v.host=lr(rt(v.host,R),R)),v.scheme===void 0&&v.userinfo===void 0&&v.host===void 0&&v.port===void 0&&!v.path&&v.query===void 0?v.reference="same-document":v.scheme===void 0?v.reference="relative":v.fragment===void 0?v.reference="absolute":v.reference="uri",u.reference&&u.reference!=="suffix"&&u.reference!==v.reference&&(v.error=v.error||"URI is not a "+u.reference+" reference.");var z=U[(u.scheme||v.scheme||"").toLowerCase()];if(!u.unicodeSupport&&(!z||!z.unicodeSupport)){if(v.host&&(u.domainHost||z&&z.domainHost))try{v.host=P.toASCII(v.host.replace(R.PCT_ENCODED,Z).toLowerCase())}catch(K){v.error=v.error||"Host's domain name can not be converted to ASCII via punycode: "+K}re(v,i)}else re(v,R);z&&z.parse&&z.parse(v,u)}else v.error=v.error||"URI can not be parsed.";return v}function Lr(d,u){var v=u.iri!==!1?h:i,R=[];return d.userinfo!==void 0&&(R.push(d.userinfo),R.push("@")),d.host!==void 0&&R.push(lr(rt(String(d.host),v),v).replace(v.IPV6ADDRESS,function(S,z,K){return"["+z+(K?"%25"+K:"")+"]"})),(typeof d.port=="number"||typeof d.port=="string")&&(R.push(":"),R.push(String(d.port))),R.length?R.join(""):void 0}var fr=/^\.\.?\//,dr=/^\/\.(\/|$)/,hr=/^\/\.\.(\/|$)/,Vr=/^\/?(?:.|\n)*?(?=\/|$)/;function nt(d){for(var u=[];d.length;)if(d.match(fr))d=d.replace(fr,"");else if(d.match(dr))d=d.replace(dr,"/");else if(d.match(hr))d=d.replace(hr,"/"),u.pop();else if(d==="."||d==="..")d="";else{var v=d.match(Vr);if(v){var R=v[0];d=d.slice(R.length),u.push(R)}else throw new Error("Unexpected dot segment condition")}return u.join("")}function ke(d){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},v=u.iri?h:i,R=[],S=U[(u.scheme||d.scheme||"").toLowerCase()];if(S&&S.serialize&&S.serialize(d,u),d.host&&!v.IPV6ADDRESS.test(d.host)){if(u.domainHost||S&&S.domainHost)try{d.host=u.iri?P.toUnicode(d.host):P.toASCII(d.host.replace(v.PCT_ENCODED,Z).toLowerCase())}catch(se){d.error=d.error||"Host's domain name can not be converted to "+(u.iri?"Unicode":"ASCII")+" via punycode: "+se}}re(d,v),u.reference!=="suffix"&&d.scheme&&(R.push(d.scheme),R.push(":"));var z=Lr(d,u);if(z!==void 0&&(u.reference!=="suffix"&&R.push("//"),R.push(z),d.path&&d.path.charAt(0)!=="/"&&R.push("/")),d.path!==void 0){var K=d.path;!u.absolutePath&&(!S||!S.absolutePath)&&(K=nt(K)),z===void 0&&(K=K.replace(/^\/\//,"/%2F")),R.push(K)}return d.query!==void 0&&(R.push("?"),R.push(d.query)),d.fragment!==void 0&&(R.push("#"),R.push(d.fragment)),R.join("")}function pr(d,u){var v=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},R=arguments[3],S={};return R||(d=Me(ke(d,v),v),u=Me(ke(u,v),v)),v=v||{},!v.tolerant&&u.scheme?(S.scheme=u.scheme,S.userinfo=u.userinfo,S.host=u.host,S.port=u.port,S.path=nt(u.path||""),S.query=u.query):(u.userinfo!==void 0||u.host!==void 0||u.port!==void 0?(S.userinfo=u.userinfo,S.host=u.host,S.port=u.port,S.path=nt(u.path||""),S.query=u.query):(u.path?(u.path.charAt(0)==="/"?S.path=nt(u.path):((d.userinfo!==void 0||d.host!==void 0||d.port!==void 0)&&!d.path?S.path="/"+u.path:d.path?S.path=d.path.slice(0,d.path.lastIndexOf("/")+1)+u.path:S.path=u.path,S.path=nt(S.path)),S.query=u.query):(S.path=d.path,u.query!==void 0?S.query=u.query:S.query=d.query),S.userinfo=d.userinfo,S.host=d.host,S.port=d.port),S.scheme=d.scheme),S.fragment=u.fragment,S}function zr(d,u,v){var R=f({scheme:"null"},v);return ke(pr(Me(d,R),Me(u,R),R,!0),R)}function Bt(d,u){return typeof d=="string"?d=ke(Me(d,u),u):a(d)==="object"&&(d=Me(ke(d,u),u)),d}function Hr(d,u,v){return typeof d=="string"?d=ke(Me(d,v),v):a(d)==="object"&&(d=ke(d,v)),typeof u=="string"?u=ke(Me(u,v),v):a(u)==="object"&&(u=ke(u,v)),d===u}function wn(d,u){return d&&d.toString().replace(!u||!u.iri?i.ESCAPE:h.ESCAPE,F)}function Je(d,u){return d&&d.toString().replace(!u||!u.iri?i.PCT_ENCODED:h.PCT_ENCODED,Z)}var Jt={scheme:"http",domainHost:!0,parse:function(u,v){return u.host||(u.error=u.error||"HTTP URIs must have a host."),u},serialize:function(u,v){var R=String(u.scheme).toLowerCase()==="https";return(u.port===(R?443:80)||u.port==="")&&(u.port=void 0),u.path||(u.path="/"),u}},Po={scheme:"https",domainHost:Jt.domainHost,parse:Jt.parse,serialize:Jt.serialize};function To(d){return typeof d.secure=="boolean"?d.secure:String(d.scheme).toLowerCase()==="wss"}var Kr={scheme:"ws",domainHost:!0,parse:function(u,v){var R=u;return R.secure=To(R),R.resourceName=(R.path||"/")+(R.query?"?"+R.query:""),R.path=void 0,R.query=void 0,R},serialize:function(u,v){if((u.port===(To(u)?443:80)||u.port==="")&&(u.port=void 0),typeof u.secure=="boolean"&&(u.scheme=u.secure?"wss":"ws",u.secure=void 0),u.resourceName){var R=u.resourceName.split("?"),S=E(R,2),z=S[0],K=S[1];u.path=z&&z!=="/"?z:void 0,u.query=K,u.resourceName=void 0}return u.fragment=void 0,u}},Ao={scheme:"wss",domainHost:Kr.domainHost,parse:Kr.parse,serialize:Kr.serialize},Wf={},Co="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",st="[0-9A-Fa-f]",Xf=s(s("%[EFef]"+st+"%"+st+st+"%"+st+st)+"|"+s("%[89A-Fa-f]"+st+"%"+st+st)+"|"+s("%"+st+st)),Zf="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]",xf="[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",ed=n(xf,'[\\"\\\\]'),td="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]",rd=new RegExp(Co,"g"),mr=new RegExp(Xf,"g"),nd=new RegExp(n("[^]",Zf,"[\\.]",'[\\"]',ed),"g"),Io=new RegExp(n("[^]",Co,td),"g"),sd=Io;function bs(d){var u=Z(d);return u.match(rd)?u:d}var Do={scheme:"mailto",parse:function(u,v){var R=u,S=R.to=R.path?R.path.split(","):[];if(R.path=void 0,R.query){for(var z=!1,K={},se=R.query.split("&"),me=0,$e=se.length;me<$e;++me){var x=se[me].split("=");switch(x[0]){case"to":for(var fe=x[1].split(","),we=0,q=fe.length;we<q;++we)S.push(fe[we]);break;case"subject":R.subject=Je(x[1],v);break;case"body":R.body=Je(x[1],v);break;default:z=!0,K[Je(x[0],v)]=Je(x[1],v);break}}z&&(R.headers=K)}R.query=void 0;for(var _e=0,Re=S.length;_e<Re;++_e){var ge=S[_e].split("@");if(ge[0]=Je(ge[0]),v.unicodeSupport)ge[1]=Je(ge[1],v).toLowerCase();else try{ge[1]=P.toASCII(Je(ge[1],v).toLowerCase())}catch(Pt){R.error=R.error||"Email address's domain name can not be converted to ASCII via punycode: "+Pt}S[_e]=ge.join("@")}return R},serialize:function(u,v){var R=u,S=l(u.to);if(S){for(var z=0,K=S.length;z<K;++z){var se=String(S[z]),me=se.lastIndexOf("@"),$e=se.slice(0,me).replace(mr,bs).replace(mr,o).replace(nd,F),x=se.slice(me+1);try{x=v.iri?P.toUnicode(x):P.toASCII(Je(x,v).toLowerCase())}catch(_e){R.error=R.error||"Email address's domain name can not be converted to "+(v.iri?"Unicode":"ASCII")+" via punycode: "+_e}S[z]=$e+"@"+x}R.path=S.join(",")}var fe=u.headers=u.headers||{};u.subject&&(fe.subject=u.subject),u.body&&(fe.body=u.body);var we=[];for(var q in fe)fe[q]!==Wf[q]&&we.push(q.replace(mr,bs).replace(mr,o).replace(Io,F)+"="+fe[q].replace(mr,bs).replace(mr,o).replace(sd,F));return we.length&&(R.query=we.join("&")),R}},ad=/^([^\:]+)\:(.*)/,jo={scheme:"urn",parse:function(u,v){var R=u.path&&u.path.match(ad),S=u;if(R){var z=v.scheme||S.scheme||"urn",K=R[1].toLowerCase(),se=R[2],me=z+":"+(v.nid||K),$e=U[me];S.nid=K,S.nss=se,S.path=void 0,$e&&(S=$e.parse(S,v))}else S.error=S.error||"URN can not be parsed.";return S},serialize:function(u,v){var R=v.scheme||u.scheme||"urn",S=u.nid,z=R+":"+(v.nid||S),K=U[z];K&&(u=K.serialize(u,v));var se=u,me=u.nss;return se.path=(S||v.nid)+":"+me,se}},od=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/,ko={scheme:"urn:uuid",parse:function(u,v){var R=u;return R.uuid=R.nss,R.nss=void 0,!v.tolerant&&(!R.uuid||!R.uuid.match(od))&&(R.error=R.error||"UUID is not valid."),R},serialize:function(u,v){var R=u;return R.nss=(u.uuid||"").toLowerCase(),R}};U[Jt.scheme]=Jt,U[Po.scheme]=Po,U[Kr.scheme]=Kr,U[Ao.scheme]=Ao,U[Do.scheme]=Do,U[jo.scheme]=jo,U[ko.scheme]=ko,r.SCHEMES=U,r.pctEncChar=F,r.pctDecChars=Z,r.parse=Me,r.removeDotSegments=nt,r.serialize=ke,r.resolveComponents=pr,r.resolve=zr,r.normalize=Bt,r.equal=Hr,r.escapeComponent=wn,r.unescapeComponent=Je,Object.defineProperty(r,"__esModule",{value:!0})})})(es,es.exports),Object.defineProperty(xn,"__esModule",{value:!0});const Da=es.exports;Da.code='require("ajv/dist/runtime/uri").default',xn.default=Da,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=void 0;var t=We;Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return t.KeywordCxt}});var r=ue;Object.defineProperty(e,"_",{enumerable:!0,get:function(){return r._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return r.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return r.CodeGen}});const n=cn,s=kt,a=Dt,o=Ce,l=ue,f=Te,p=nn,i=be,h=zu,E=xn,T=(k,g)=>new RegExp(k,g);T.code="new RegExp";const I=["removeAdditional","useDefaults","coerceTypes"],j=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),y={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},_={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},b=200;function O(k){var g,C,w,c,m,P,U,F,Z,re,ye,rt,lr,Fr,Mr,Me,Lr,fr,dr,hr,Vr,nt,ke,pr,zr;const Bt=k.strict,Hr=(g=k.code)===null||g===void 0?void 0:g.optimize,wn=Hr===!0||Hr===void 0?1:Hr||0,Je=(w=(C=k.code)===null||C===void 0?void 0:C.regExp)!==null&&w!==void 0?w:T,Jt=(c=k.uriResolver)!==null&&c!==void 0?c:E.default;return{strictSchema:(P=(m=k.strictSchema)!==null&&m!==void 0?m:Bt)!==null&&P!==void 0?P:!0,strictNumbers:(F=(U=k.strictNumbers)!==null&&U!==void 0?U:Bt)!==null&&F!==void 0?F:!0,strictTypes:(re=(Z=k.strictTypes)!==null&&Z!==void 0?Z:Bt)!==null&&re!==void 0?re:"log",strictTuples:(rt=(ye=k.strictTuples)!==null&&ye!==void 0?ye:Bt)!==null&&rt!==void 0?rt:"log",strictRequired:(Fr=(lr=k.strictRequired)!==null&&lr!==void 0?lr:Bt)!==null&&Fr!==void 0?Fr:!1,code:k.code?le(Q({},k.code),{optimize:wn,regExp:Je}):{optimize:wn,regExp:Je},loopRequired:(Mr=k.loopRequired)!==null&&Mr!==void 0?Mr:b,loopEnum:(Me=k.loopEnum)!==null&&Me!==void 0?Me:b,meta:(Lr=k.meta)!==null&&Lr!==void 0?Lr:!0,messages:(fr=k.messages)!==null&&fr!==void 0?fr:!0,inlineRefs:(dr=k.inlineRefs)!==null&&dr!==void 0?dr:!0,schemaId:(hr=k.schemaId)!==null&&hr!==void 0?hr:"$id",addUsedSchema:(Vr=k.addUsedSchema)!==null&&Vr!==void 0?Vr:!0,validateSchema:(nt=k.validateSchema)!==null&&nt!==void 0?nt:!0,validateFormats:(ke=k.validateFormats)!==null&&ke!==void 0?ke:!0,unicodeRegExp:(pr=k.unicodeRegExp)!==null&&pr!==void 0?pr:!0,int32range:(zr=k.int32range)!==null&&zr!==void 0?zr:!0,uriResolver:Jt}}class A{constructor(g={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,g=this.opts=Q(Q({},g),O(g));const{es5:C,lines:w}=this.opts.code;this.scope=new l.ValueScope({scope:{},prefixes:j,es5:C,lines:w}),this.logger=W(g.logger);const c=g.validateFormats;g.validateFormats=!1,this.RULES=(0,a.getRules)(),H.call(this,y,g,"NOT SUPPORTED"),H.call(this,_,g,"DEPRECATED","warn"),this._metaOpts=G.call(this),g.formats&&D.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),g.keywords&&B.call(this,g.keywords),typeof g.meta=="object"&&this.addMetaSchema(g.meta),N.call(this),g.validateFormats=c}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:g,meta:C,schemaId:w}=this.opts;let c=h;w==="id"&&(c=Q({},h),c.id=c.$id,delete c.$id),C&&g&&this.addMetaSchema(c,c[w],!1)}defaultMeta(){const{meta:g,schemaId:C}=this.opts;return this.opts.defaultMeta=typeof g=="object"?g[C]||g:void 0}validate(g,C){let w;if(typeof g=="string"){if(w=this.getSchema(g),!w)throw new Error(`no schema with key or ref "${g}"`)}else w=this.compile(g);const c=w(C);return"$async"in w||(this.errors=w.errors),c}compile(g,C){const w=this._addSchema(g,C);return w.validate||this._compileSchemaEnv(w)}compileAsync(g,C){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");const{loadSchema:w}=this.opts;return c.call(this,g,C);async function c(re,ye){await m.call(this,re.$schema);const rt=this._addSchema(re,ye);return rt.validate||P.call(this,rt)}async function m(re){re&&!this.getSchema(re)&&await c.call(this,{$ref:re},!0)}async function P(re){try{return this._compileSchemaEnv(re)}catch(ye){if(!(ye instanceof s.default))throw ye;return U.call(this,ye),await F.call(this,ye.missingSchema),P.call(this,re)}}function U({missingSchema:re,missingRef:ye}){if(this.refs[re])throw new Error(`AnySchema ${re} is loaded but ${ye} cannot be resolved`)}async function F(re){const ye=await Z.call(this,re);this.refs[re]||await m.call(this,ye.$schema),this.refs[re]||this.addSchema(ye,re,C)}async function Z(re){const ye=this._loading[re];if(ye)return ye;try{return await(this._loading[re]=w(re))}finally{delete this._loading[re]}}}addSchema(g,C,w,c=this.opts.validateSchema){if(Array.isArray(g)){for(const P of g)this.addSchema(P,void 0,w,c);return this}let m;if(typeof g=="object"){const{schemaId:P}=this.opts;if(m=g[P],m!==void 0&&typeof m!="string")throw new Error(`schema ${P} must be string`)}return C=(0,f.normalizeId)(C||m),this._checkUnique(C),this.schemas[C]=this._addSchema(g,w,C,c,!0),this}addMetaSchema(g,C,w=this.opts.validateSchema){return this.addSchema(g,C,!0,w),this}validateSchema(g,C){if(typeof g=="boolean")return!0;let w;if(w=g.$schema,w!==void 0&&typeof w!="string")throw new Error("$schema must be a string");if(w=w||this.opts.defaultMeta||this.defaultMeta(),!w)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const c=this.validate(w,g);if(!c&&C){const m="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(m);else throw new Error(m)}return c}getSchema(g){let C;for(;typeof(C=$.call(this,g))=="string";)g=C;if(C===void 0){const{schemaId:w}=this.opts,c=new o.SchemaEnv({schema:{},schemaId:w});if(C=o.resolveSchema.call(this,c,g),!C)return;this.refs[g]=C}return C.validate||this._compileSchemaEnv(C)}removeSchema(g){if(g instanceof RegExp)return this._removeAllSchemas(this.schemas,g),this._removeAllSchemas(this.refs,g),this;switch(typeof g){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const C=$.call(this,g);return typeof C=="object"&&this._cache.delete(C.schema),delete this.schemas[g],delete this.refs[g],this}case"object":{const C=g;this._cache.delete(C);let w=g[this.opts.schemaId];return w&&(w=(0,f.normalizeId)(w),delete this.schemas[w],delete this.refs[w]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(g){for(const C of g)this.addKeyword(C);return this}addKeyword(g,C){let w;if(typeof g=="string")w=g,typeof C=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),C.keyword=w);else if(typeof g=="object"&&C===void 0){if(C=g,w=C.keyword,Array.isArray(w)&&!w.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(X.call(this,w,C),!C)return(0,i.eachItem)(w,m=>ve.call(this,m)),this;Ne.call(this,C);const c=le(Q({},C),{type:(0,p.getJSONTypes)(C.type),schemaType:(0,p.getJSONTypes)(C.schemaType)});return(0,i.eachItem)(w,c.type.length===0?m=>ve.call(this,m,c):m=>c.type.forEach(P=>ve.call(this,m,c,P))),this}getKeyword(g){const C=this.RULES.all[g];return typeof C=="object"?C.definition:!!C}removeKeyword(g){const{RULES:C}=this;delete C.keywords[g],delete C.all[g];for(const w of C.rules){const c=w.rules.findIndex(m=>m.keyword===g);c>=0&&w.rules.splice(c,1)}return this}addFormat(g,C){return typeof C=="string"&&(C=new RegExp(C)),this.formats[g]=C,this}errorsText(g=this.errors,{separator:C=", ",dataVar:w="data"}={}){return!g||g.length===0?"No errors":g.map(c=>`${w}${c.instancePath} ${c.message}`).reduce((c,m)=>c+C+m)}$dataMetaSchema(g,C){const w=this.RULES.all;g=JSON.parse(JSON.stringify(g));for(const c of C){const m=c.split("/").slice(1);let P=g;for(const U of m)P=P[U];for(const U in w){const F=w[U];if(typeof F!="object")continue;const{$data:Z}=F.definition,re=P[U];Z&&re&&(P[U]=ur(re))}}return g}_removeAllSchemas(g,C){for(const w in g){const c=g[w];(!C||C.test(w))&&(typeof c=="string"?delete g[w]:c&&!c.meta&&(this._cache.delete(c.schema),delete g[w]))}}_addSchema(g,C,w,c=this.opts.validateSchema,m=this.opts.addUsedSchema){let P;const{schemaId:U}=this.opts;if(typeof g=="object")P=g[U];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof g!="boolean")throw new Error("schema must be object or boolean")}let F=this._cache.get(g);if(F!==void 0)return F;w=(0,f.normalizeId)(P||w);const Z=f.getSchemaRefs.call(this,g,w);return F=new o.SchemaEnv({schema:g,schemaId:U,meta:C,baseId:w,localRefs:Z}),this._cache.set(F.schema,F),m&&!w.startsWith("#")&&(w&&this._checkUnique(w),this.refs[w]=F),c&&this.validateSchema(g,!0),F}_checkUnique(g){if(this.schemas[g]||this.refs[g])throw new Error(`schema with key or id "${g}" already exists`)}_compileSchemaEnv(g){if(g.meta?this._compileMetaSchema(g):o.compileSchema.call(this,g),!g.validate)throw new Error("ajv implementation error");return g.validate}_compileMetaSchema(g){const C=this.opts;this.opts=this._metaOpts;try{o.compileSchema.call(this,g)}finally{this.opts=C}}}e.default=A,A.ValidationError=n.default,A.MissingRefError=s.default;function H(k,g,C,w="error"){for(const c in k){const m=c;m in g&&this.logger[w](`${C}: option ${c}. ${k[m]}`)}}function $(k){return k=(0,f.normalizeId)(k),this.schemas[k]||this.refs[k]}function N(){const k=this.opts.schemas;if(!!k)if(Array.isArray(k))this.addSchema(k);else for(const g in k)this.addSchema(k[g],g)}function D(){for(const k in this.opts.formats){const g=this.opts.formats[k];g&&this.addFormat(k,g)}}function B(k){if(Array.isArray(k)){this.addVocabulary(k);return}this.logger.warn("keywords option as map is deprecated, pass array");for(const g in k){const C=k[g];C.keyword||(C.keyword=g),this.addKeyword(C)}}function G(){const k=Q({},this.opts);for(const g of I)delete k[g];return k}const pe={log(){},warn(){},error(){}};function W(k){if(k===!1)return pe;if(k===void 0)return console;if(k.log&&k.warn&&k.error)return k;throw new Error("logger must implement log, warn and error methods")}const oe=/^[a-z_$][a-z0-9_$:-]*$/i;function X(k,g){const{RULES:C}=this;if((0,i.eachItem)(k,w=>{if(C.keywords[w])throw new Error(`Keyword ${w} is already defined`);if(!oe.test(w))throw new Error(`Keyword ${w} has invalid name`)}),!!g&&g.$data&&!("code"in g||"validate"in g))throw new Error('$data keyword must have "code" or "validate" function')}function ve(k,g,C){var w;const c=g==null?void 0:g.post;if(C&&c)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:m}=this;let P=c?m.post:m.rules.find(({type:F})=>F===C);if(P||(P={type:C,rules:[]},m.rules.push(P)),m.keywords[k]=!0,!g)return;const U={keyword:k,definition:le(Q({},g),{type:(0,p.getJSONTypes)(g.type),schemaType:(0,p.getJSONTypes)(g.schemaType)})};g.before?Ee.call(this,P,U,g.before):P.rules.push(U),m.all[k]=U,(w=g.implements)===null||w===void 0||w.forEach(F=>this.addKeyword(F))}function Ee(k,g,C){const w=k.rules.findIndex(c=>c.keyword===C);w>=0?k.rules.splice(w,0,g):(k.rules.push(g),this.logger.warn(`rule ${C} is not defined`))}function Ne(k){let{metaSchema:g}=k;g!==void 0&&(k.$data&&this.opts.$data&&(g=ur(g)),k.validateSchema=this.compile(g,!0))}const Be={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function ur(k){return{anyOf:[k,Be]}}}(ra);var ts={},Ft={},Mt={};Object.defineProperty(Mt,"__esModule",{value:!0}),Mt.callRef=Mt.getValidate=void 0;const Hu=kt,ja=ne,je=ue,sr=Le,ka=Ce,fn=be,Ku={keyword:"$ref",schemaType:"string",code(e){const{gen:t,schema:r,it:n}=e,{baseId:s,schemaEnv:a,validateName:o,opts:l,self:f}=n,{root:p}=a;if((r==="#"||r==="#/")&&s===p.baseId)return h();const i=ka.resolveRef.call(f,p,s,r);if(i===void 0)throw new Hu.default(n.opts.uriResolver,s,r);if(i instanceof ka.SchemaEnv)return E(i);return T(i);function h(){if(a===p)return dn(e,o,a,a.$async);const I=t.scopeValue("root",{ref:p});return dn(e,(0,je._)`${I}.validate`,p,p.$async)}function E(I){const j=Ua(e,I);dn(e,j,I,I.$async)}function T(I){const j=t.scopeValue("schema",l.code.source===!0?{ref:I,code:(0,je.stringify)(I)}:{ref:I}),y=t.name("valid"),_=e.subschema({schema:I,dataTypes:[],schemaPath:je.nil,topSchemaRef:j,errSchemaPath:r},y);e.mergeEvaluated(_),e.ok(y)}}};function Ua(e,t){const{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):(0,je._)`${r.scopeValue("wrapper",{ref:t})}.validate`}Mt.getValidate=Ua;function dn(e,t,r,n){const{gen:s,it:a}=e,{allErrors:o,schemaEnv:l,opts:f}=a,p=f.passContext?sr.default.this:je.nil;n?i():h();function i(){if(!l.$async)throw new Error("async schema referenced by sync schema");const I=s.let("valid");s.try(()=>{s.code((0,je._)`await ${(0,ja.callValidateCode)(e,t,p)}`),T(t),o||s.assign(I,!0)},j=>{s.if((0,je._)`!(${j} instanceof ${a.ValidationError})`,()=>s.throw(j)),E(j),o||s.assign(I,!1)}),e.ok(I)}function h(){e.result((0,ja.callValidateCode)(e,t,p),()=>T(t),()=>E(t))}function E(I){const j=(0,je._)`${I}.errors`;s.assign(sr.default.vErrors,(0,je._)`${sr.default.vErrors} === null ? ${j} : ${sr.default.vErrors}.concat(${j})`),s.assign(sr.default.errors,(0,je._)`${sr.default.vErrors}.length`)}function T(I){var j;if(!a.opts.unevaluated)return;const y=(j=r==null?void 0:r.validate)===null||j===void 0?void 0:j.evaluated;if(a.props!==!0)if(y&&!y.dynamicProps)y.props!==void 0&&(a.props=fn.mergeEvaluated.props(s,y.props,a.props));else{const _=s.var("props",(0,je._)`${I}.evaluated.props`);a.props=fn.mergeEvaluated.props(s,_,a.props,je.Name)}if(a.items!==!0)if(y&&!y.dynamicItems)y.items!==void 0&&(a.items=fn.mergeEvaluated.items(s,y.items,a.items));else{const _=s.var("items",(0,je._)`${I}.evaluated.items`);a.items=fn.mergeEvaluated.items(s,_,a.items,je.Name)}}}Mt.callRef=dn,Mt.default=Ku;var Ve={};Object.defineProperty(Ve,"__esModule",{value:!0}),Ve.checkMetadata=void 0;const Bu=be,Ju={keyword:"metadata",schemaType:"object",code(e){Fa(e);const{gen:t,schema:r,it:n}=e;if((0,Bu.alwaysValidSchema)(n,r))return;const s=t.name("valid");e.subschema({keyword:"metadata",jtdMetadata:!0},s),e.ok(s)}};function Fa({it:e,keyword:t},r){if(e.jtdMetadata!==r)throw new Error(`JTD: "${t}" cannot be used in this schema location`)}Ve.checkMetadata=Fa,Ve.default=Ju,Object.defineProperty(Ft,"__esModule",{value:!0}),Ft.hasRef=void 0;const Ma=Ce,Sr=ue,qu=kt,La=Le,Va=Mt,Gu=Ve,Qu={keyword:"ref",schemaType:"string",code(e){(0,Gu.checkMetadata)(e);const{gen:t,data:r,schema:n,parentSchema:s,it:a}=e,{schemaEnv:{root:o}}=a,l=t.name("valid");s.nullable?(t.var(l,(0,Sr._)`${r} === null`),t.if((0,Sr.not)(l),f)):(t.var(l,!1),f()),e.ok(l);function f(){var h;const E=(h=o.schema.definitions)===null||h===void 0?void 0:h[n];if(!E)throw new qu.default(a.opts.uriResolver,"",n,`No definition ${n}`);rs(E)||!a.opts.inlineRefs?p(E):i(E)}function p(h){const E=Ma.compileSchema.call(a.self,new Ma.SchemaEnv({schema:h,root:o,schemaPath:`/definitions/${n}`})),T=(0,Va.getValidate)(e,E),I=t.const("_errs",La.default.errors);(0,Va.callRef)(e,T,E,E.$async),t.assign(l,(0,Sr._)`${I} === ${La.default.errors}`)}function i(h){const E=t.scopeValue("schema",a.opts.code.source===!0?{ref:h,code:(0,Sr.stringify)(h)}:{ref:h});e.subschema({schema:h,dataTypes:[],schemaPath:Sr.nil,topSchemaRef:E,errSchemaPath:`/definitions/${n}`},l)}}};function rs(e){for(const t in e){let r;if(t==="ref"||typeof(r=e[t])=="object"&&rs(r))return!0}return!1}Ft.hasRef=rs,Ft.default=Qu;var ns={},hn={};Object.defineProperty(hn,"__esModule",{value:!0});const Yu=/t|\s/i,Wu=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,Xu=/^(\d\d):(\d\d):(\d\d)(?:\.\d+)?(?:z|([+-]\d\d)(?::?(\d\d))?)$/i,Zu=[0,31,28,31,30,31,30,31,31,30,31,30,31];function za(e,t){const r=e.split(Yu);return r.length===2&&Ha(r[0])&&xu(r[1])||t&&r.length===1&&Ha(r[0])}hn.default=za;function Ha(e){const t=Wu.exec(e);if(!t)return!1;const r=+t[1],n=+t[2],s=+t[3];return n>=1&&n<=12&&s>=1&&(s<=Zu[n]||n===2&&s===29&&(r%100===0?r%400===0:r%4===0))}function xu(e){const t=Xu.exec(e);if(!t)return!1;const r=+t[1],n=+t[2],s=+t[3],a=+(t[4]||0),o=+(t[5]||0);return r<=23&&n<=59&&s<=59||r-a===23&&n-o===59&&s===60}za.code='require("ajv/dist/runtime/timestamp").default';var ze={};Object.defineProperty(ze,"__esModule",{value:!0}),ze.typeErrorParams=ze.typeErrorMessage=ze.typeError=void 0;const el=ue;function tl(e){return{message:t=>Ka(t,e),params:t=>Ba(t,e)}}ze.typeError=tl;function Ka({parentSchema:e},t){return e!=null&&e.nullable?`must be ${t} or null`:`must be ${t}`}ze.typeErrorMessage=Ka;function Ba({parentSchema:e},t){return(0,el._)`{type: ${t}, nullable: ${!!(e!=null&&e.nullable)}}`}ze.typeErrorParams=Ba,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.intRange=void 0;const t=ue,r=hn,n=be,s=Ve,a=ze;e.intRange={int8:[-128,127,3],uint8:[0,255,3],int16:[-32768,32767,5],uint16:[0,65535,5],int32:[-2147483648,2147483647,10],uint32:[0,4294967295,10]};const o={message:p=>(0,a.typeErrorMessage)(p,p.schema),params:p=>(0,a.typeErrorParams)(p,p.schema)};function l(p){const{gen:i,data:h,it:E}=p,{timestamp:T,allowDate:I}=E.opts;if(T==="date")return(0,t._)`${h} instanceof Date `;const j=(0,n.useFunc)(i,r.default),y=I?(0,t._)`, true`:t.nil,_=(0,t._)`typeof ${h} == "string" && ${j}(${h}${y})`;return T==="string"?_:(0,t.or)((0,t._)`${h} instanceof Date`,_)}const f={keyword:"type",schemaType:"string",error:o,code(p){(0,s.checkMetadata)(p);const{data:i,schema:h,parentSchema:E,it:T}=p;let I;switch(h){case"boolean":case"string":I=(0,t._)`typeof ${i} == ${h}`;break;case"timestamp":{I=l(p);break}case"float32":case"float64":I=(0,t._)`typeof ${i} == "number"`;break;default:{const j=h;if(I=(0,t._)`typeof ${i} == "number" && isFinite(${i}) && !(${i} % 1)`,!T.opts.int32range&&(j==="int32"||j==="uint32"))j==="uint32"&&(I=(0,t._)`${I} && ${i} >= 0`);else{const[y,_]=e.intRange[j];I=(0,t._)`${I} && ${i} >= ${y} && ${i} <= ${_}`}}}p.pass(E.nullable?(0,t.or)((0,t._)`${i} === null`,I):I)}};e.default=f}(ns);var ss={},xe={};Object.defineProperty(xe,"__esModule",{value:!0}),xe.checkNullableObject=xe.checkNullable=void 0;const pn=ue;function Ja({gen:e,data:t,parentSchema:r},n=pn.nil){const s=e.name("valid");return r.nullable?(e.let(s,(0,pn._)`${t} === null`),n=(0,pn.not)(s)):e.let(s,!1),[s,n]}xe.checkNullable=Ja;function rl(e,t){const[r,n]=Ja(e,t);return[r,(0,pn._)`${n} && typeof ${e.data} == "object" && !Array.isArray(${e.data})`]}xe.checkNullableObject=rl,Object.defineProperty(ss,"__esModule",{value:!0});const wt=ue,nl=Ve,sl=xe,al={keyword:"enum",schemaType:"array",error:{message:"must be equal to one of the allowed values",params:({schemaCode:e})=>(0,wt._)`{allowedValues: ${e}}`},code(e){(0,nl.checkMetadata)(e);const{gen:t,data:r,schema:n,schemaValue:s,parentSchema:a,it:o}=e;if(n.length===0)throw new Error("enum must have non-empty array");if(n.length!==new Set(n).size)throw new Error("enum items must be unique");let l;const f=(0,wt._)`typeof ${r} == "string"`;if(n.length>=o.opts.loopEnum){let i;[l,i]=(0,sl.checkNullable)(e,f),t.if(i,p)}else{if(!Array.isArray(n))throw new Error("ajv implementation error");l=(0,wt.and)(f,(0,wt.or)(...n.map(i=>(0,wt._)`${r} === ${i}`))),a.nullable&&(l=(0,wt.or)((0,wt._)`${r} === null`,l))}e.pass(l);function p(){t.forOf("v",s,i=>t.if((0,wt._)`${l} = ${r} === ${i}`,()=>t.break()))}}};ss.default=al;var as={};Object.defineProperty(as,"__esModule",{value:!0});const ol=be,il=ne,qa=ue,cl=Ve,ul=xe,ll={keyword:"elements",schemaType:"object",error:(0,ze.typeError)("array"),code(e){(0,cl.checkMetadata)(e);const{gen:t,data:r,schema:n,it:s}=e;if((0,ol.alwaysValidSchema)(s,n))return;const[a]=(0,ul.checkNullable)(e);t.if((0,qa.not)(a),()=>t.if((0,qa._)`Array.isArray(${r})`,()=>t.assign(a,(0,il.validateArray)(e)),()=>e.error())),e.ok(a)}};as.default=ll;var os={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateProperties=e.error=void 0;const t=ne,r=be,n=ue,s=Ve,a=xe,o=ze;var l;(function(i){i.Additional="additional",i.Missing="missing"})(l||(l={})),e.error={message:i=>{const{params:h}=i;return h.propError?h.propError===l.Additional?"must NOT have additional properties":`must have property '${h.missingProperty}'`:(0,o.typeErrorMessage)(i,"object")},params:i=>{const{params:h}=i;return h.propError?h.propError===l.Additional?(0,n._)`{error: ${h.propError}, additionalProperty: ${h.additionalProperty}}`:(0,n._)`{error: ${h.propError}, missingProperty: ${h.missingProperty}}`:(0,o.typeErrorParams)(i,"object")}};const f={keyword:"properties",schemaType:"object",error:e.error,code:p};function p(i){(0,s.checkMetadata)(i);const{gen:h,data:E,parentSchema:T,it:I}=i,{additionalProperties:j,nullable:y}=T;if(I.jtdDiscriminator&&y)throw new Error("JTD: nullable inside discriminator mapping");if(N())throw new Error("JTD: properties and optionalProperties have common members");const[_,b]=D("properties"),[O,A]=D("optionalProperties");if(b.length===0&&A.length===0&&j)return;const[H,$]=I.jtdDiscriminator===void 0?(0,a.checkNullableObject)(i,E):[h.let("valid",!1),!0];h.if($,()=>h.assign(H,!0).block(()=>{B(b,"properties",!0),B(A,"optionalProperties"),j||pe()})),i.pass(H);function N(){const oe=T.properties,X=T.optionalProperties;if(!(oe&&X))return!1;for(const ve in oe)if(Object.prototype.hasOwnProperty.call(X,ve))return!0;return!1}function D(oe){const X=T[oe],ve=X?(0,t.allSchemaProperties)(X):[];if(I.jtdDiscriminator&&ve.some(Ne=>Ne===I.jtdDiscriminator))throw new Error(`JTD: discriminator tag used in ${oe}`);const Ee=ve.filter(Ne=>!(0,r.alwaysValidSchema)(I,X[Ne]));return[ve,Ee]}function B(oe,X,ve){const Ee=h.var("valid");for(const Be of oe)h.if((0,t.propertyInData)(h,E,Be,I.opts.ownProperties),()=>G(Be,X,Ee),()=>Ne(Be)),i.ok(Ee);function Ne(Be){ve?(h.assign(Ee,!1),i.error(!1,{propError:l.Missing,missingProperty:Be},{schemaPath:Be})):h.assign(Ee,!0)}}function G(oe,X,ve){i.subschema({keyword:X,schemaProp:oe,dataProp:oe},ve)}function pe(){h.forIn("key",E,oe=>{const X=I.jtdDiscriminator===void 0?_:[I.jtdDiscriminator].concat(_),ve=W(oe,X,"properties"),Ee=W(oe,O,"optionalProperties"),Ne=ve===!0?Ee:Ee===!0?ve:(0,n.and)(ve,Ee);h.if(Ne,()=>{I.opts.removeAdditional?h.code((0,n._)`delete ${E}[${oe}]`):(i.error(!1,{propError:l.Additional,additionalProperty:oe},{instancePath:oe,parentSchema:!0}),I.opts.allErrors||h.break())})})}function W(oe,X,ve){let Ee;if(X.length>8){const Ne=(0,r.schemaRefOrVal)(I,T[ve],ve);Ee=(0,n.not)((0,t.isOwnProperty)(h,Ne,oe))}else X.length?Ee=(0,n.and)(...X.map(Ne=>(0,n._)`${oe} !== ${Ne}`)):Ee=!0;return Ee}}e.validateProperties=p,e.default=f})(os);var is={};Object.defineProperty(is,"__esModule",{value:!0});const Ga=os,fl={keyword:"optionalProperties",schemaType:"object",error:Ga.error,code(e){e.parentSchema.properties||(0,Ga.validateProperties)(e)}};is.default=fl;var cs={},Qa={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DiscrError=void 0,function(t){t.Tag="tag",t.Mapping="mapping"}(e.DiscrError||(e.DiscrError={}))})(Qa),Object.defineProperty(cs,"__esModule",{value:!0});const Lt=ue,dl=Ve,hl=xe,Ya=ze,mn=Qa,pl={keyword:"discriminator",schemaType:"string",implements:["mapping"],error:{message:e=>{const{schema:t,params:r}=e;return r.discrError?r.discrError===mn.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in mapping`:(0,Ya.typeErrorMessage)(e,"object")},params:e=>{const{schema:t,params:r}=e;return r.discrError?(0,Lt._)`{error: ${r.discrError}, tag: ${t}, tagValue: ${r.tag}}`:(0,Ya.typeErrorParams)(e,"object")}},code(e){(0,dl.checkMetadata)(e);const{gen:t,data:r,schema:n,parentSchema:s}=e,[a,o]=(0,hl.checkNullableObject)(e,r);t.if(o),l(),t.elseIf((0,Lt.not)(a)),e.error(),t.endIf(),e.ok(a);function l(){const i=t.const("tag",(0,Lt._)`${r}${(0,Lt.getProperty)(n)}`);t.if((0,Lt._)`${i} === undefined`),e.error(!1,{discrError:mn.DiscrError.Tag,tag:i}),t.elseIf((0,Lt._)`typeof ${i} == "string"`),f(i),t.else(),e.error(!1,{discrError:mn.DiscrError.Tag,tag:i},{instancePath:n}),t.endIf()}function f(i){t.if(!1);for(const h in s.mapping)t.elseIf((0,Lt._)`${i} === ${h}`),t.assign(a,p(h));t.else(),e.error(!1,{discrError:mn.DiscrError.Mapping,tag:i},{instancePath:n,schemaPath:"mapping",parentSchema:!0}),t.endIf()}function p(i){const h=t.name("valid");return e.subschema({keyword:"mapping",schemaProp:i,jtdDiscriminator:n},h),h}}};cs.default=pl;var us={};Object.defineProperty(us,"__esModule",{value:!0});const Wa=be,Xa=ue,ml=Ve,vl=xe,_l={keyword:"values",schemaType:"object",error:(0,ze.typeError)("object"),code(e){(0,ml.checkMetadata)(e);const{gen:t,data:r,schema:n,it:s}=e;if((0,Wa.alwaysValidSchema)(s,n))return;const[a,o]=(0,vl.checkNullableObject)(e,r);t.if(o),t.assign(a,l()),t.elseIf((0,Xa.not)(a)),e.error(),t.endIf(),e.ok(a);function l(){const f=t.name("valid");if(s.allErrors){const i=t.let("valid",!0);return p(()=>t.assign(i,!1)),i}return t.var(f,!0),p(()=>t.break()),f;function p(i){t.forIn("key",r,h=>{e.subschema({keyword:"values",dataProp:h,dataPropType:Wa.Type.Str},f),t.if((0,Xa.not)(f),i)})}}}};us.default=_l;var ls={};Object.defineProperty(ls,"__esModule",{value:!0});const gl={keyword:"union",schemaType:"array",trackErrors:!0,code:ne.validateUnion,error:{message:"must match a schema in union"}};ls.default=gl,Object.defineProperty(ts,"__esModule",{value:!0});const El=Ft,yl=ns,$l=ss,wl=as,Sl=os,Rl=is,bl=cs,Ol=us,Nl=ls,Pl=Ve,Tl=["definitions",El.default,yl.default,$l.default,wl.default,Sl.default,Rl.default,bl.default,Ol.default,Nl.default,Pl.default,{keyword:"additionalProperties",schemaType:"boolean"},{keyword:"nullable",schemaType:"boolean"}];ts.default=Tl;var fs={};Object.defineProperty(fs,"__esModule",{value:!0});const dt=e=>{const t={nullable:{type:"boolean"},metadata:{optionalProperties:{union:{elements:{ref:"schema"}}},additionalProperties:!0}};return e&&(t.definitions={values:{ref:"schema"}}),t},Al=e=>({optionalProperties:dt(e)}),Cl=e=>({properties:{ref:{type:"string"}},optionalProperties:dt(e)}),Il=e=>({properties:{type:{enum:["boolean","timestamp","string","float32","float64","int8","uint8","int16","uint16","int32","uint32"]}},optionalProperties:dt(e)}),Dl=e=>({properties:{enum:{elements:{type:"string"}}},optionalProperties:dt(e)}),jl=e=>({properties:{elements:{ref:"schema"}},optionalProperties:dt(e)}),Za=e=>({properties:{properties:{values:{ref:"schema"}}},optionalProperties:Q({optionalProperties:{values:{ref:"schema"}},additionalProperties:{type:"boolean"}},dt(e))}),xa=e=>({properties:{optionalProperties:{values:{ref:"schema"}}},optionalProperties:Q({additionalProperties:{type:"boolean"}},dt(e))}),kl=e=>({properties:{discriminator:{type:"string"},mapping:{values:{metadata:{union:[Za(!1),xa(!1)]}}}},optionalProperties:dt(e)}),Ul=e=>({properties:{values:{ref:"schema"}},optionalProperties:dt(e)}),eo=e=>({metadata:{union:[Al,Cl,Il,Dl,jl,Za,xa,kl,Ul].map(t=>t(e))}}),Fl=Q({definitions:{schema:eo(!1)}},eo(!0));fs.default=Fl;var ds={},Rr={};Object.defineProperty(Rr,"__esModule",{value:!0}),Rr.jtdForms=void 0,Rr.jtdForms=["elements","values","discriminator","properties","optionalProperties","enum","type","ref"];var hs={};Object.defineProperty(hs,"__esModule",{value:!0});const ps=/[\\"\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,Ml={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};function to(e){return ps.lastIndex=0,'"'+(ps.test(e)?e.replace(ps,t=>{const r=Ml[t];return typeof r=="string"?r:"\\u"+("0000"+t.charCodeAt(0).toString(16)).slice(-4)}):e)+'"'}hs.default=to,to.code='require("ajv/dist/runtime/quote").default',Object.defineProperty(ds,"__esModule",{value:!0});const Ll=Rr,ro=Ce,te=ue,Vl=kt,he=Le,zl=ne,Hl=Ft,Kl=be,Bl=hs,Jl={elements:Gl,values:Ql,discriminator:Yl,properties:ao,optionalProperties:ao,enum:Or,type:Wl,ref:Zl};function no(e,t){const r=ro.getCompilingSchema.call(this,e);if(r)return r;const{es5:n,lines:s}=this.opts.code,{ownProperties:a}=this.opts,o=new te.CodeGen(this.scope,{es5:n,lines:s,ownProperties:a}),l=o.scopeName("serialize"),f={self:this,gen:o,schema:e.schema,schemaEnv:e,definitions:t,data:he.default.data};let p;try{this._compilations.add(e),e.serializeName=l,o.func(l,he.default.data,!1,()=>{o.let(he.default.json,(0,te.str)``),br(f),o.return(he.default.json)}),o.optimize(this.opts.code.optimize);const i=o.toString();p=`${o.scopeRefs(he.default.scope)}return ${i}`;const E=new Function(`${he.default.scope}`,p)(this.scope.get());this.scope.value(l,{ref:E}),e.serialize=E}catch(i){throw p&&this.logger.error("Error compiling serializer, function code:",p),delete e.serialize,delete e.serializeName,i}finally{this._compilations.delete(e)}return e}ds.default=no;function br(e){let t;for(const r of Ll.jtdForms)if(r in e.schema){t=r;break}ql(e,t?Jl[t]:ef)}function ql(e,t){const{gen:r,schema:n,data:s}=e;if(!n.nullable)return t(e);r.if((0,te._)`${s} === undefined || ${s} === null`,()=>r.add(he.default.json,(0,te._)`"null"`),()=>t(e))}function Gl(e){const{gen:t,schema:r,data:n}=e;t.add(he.default.json,(0,te.str)`[`);const s=t.let("first",!0);t.forOf("el",n,a=>{io(e,s),br(le(Q({},e),{schema:r.elements,data:a}))}),t.add(he.default.json,(0,te.str)`]`)}function Ql(e){const{gen:t,schema:r,data:n}=e;t.add(he.default.json,(0,te.str)`{`);const s=t.let("first",!0);t.forIn("key",n,a=>so(e,a,r.values,s)),t.add(he.default.json,(0,te.str)`}`)}function so(e,t,r,n){const{gen:s,data:a}=e;io(e,n),Or(le(Q({},e),{data:t})),s.add(he.default.json,(0,te.str)`:`);const o=s.const("value",(0,te._)`${a}${(0,te.getProperty)(t)}`);br(le(Q({},e),{schema:r,data:o}))}function Yl(e){const{gen:t,schema:r,data:n}=e,{discriminator:s}=r;t.add(he.default.json,(0,te.str)`{${JSON.stringify(s)}:`);const a=t.const("tag",(0,te._)`${n}${(0,te.getProperty)(s)}`);Or(le(Q({},e),{data:a})),t.if(!1);for(const o in r.mapping){t.elseIf((0,te._)`${a} === ${o}`);const l=r.mapping[o];oo(le(Q({},e),{schema:l}),s)}t.endIf(),t.add(he.default.json,(0,te.str)`}`)}function ao(e){const{gen:t}=e;t.add(he.default.json,(0,te.str)`{`),oo(e),t.add(he.default.json,(0,te.str)`}`)}function oo(e,t){const{gen:r,schema:n,data:s}=e,{properties:a,optionalProperties:o}=n,l=h(a),f=h(o),p=E(l.concat(f));let i=!t;for(const y of l)I(y,a[y],T(y));for(const y of f){const _=T(y);r.if((0,te.and)((0,te._)`${_} !== undefined`,(0,zl.isOwnProperty)(r,s,y)),()=>I(y,o[y],_))}n.additionalProperties&&r.forIn("key",s,y=>r.if(j(y,p),()=>so(e,y,{},r.let("first",i))));function h(y){return y?Object.keys(y):[]}function E(y){if(t&&y.push(t),new Set(y).size!==y.length)throw new Error("JTD: properties/optionalProperties/disciminator overlap");return y}function T(y){return r.const("value",(0,te._)`${s}${(0,te.getProperty)(y)}`)}function I(y,_,b){i?i=!1:r.add(he.default.json,(0,te.str)`,`),r.add(he.default.json,(0,te.str)`${JSON.stringify(y)}:`),br(le(Q({},e),{schema:_,data:b}))}function j(y,_){return _.length?(0,te.and)(..._.map(b=>(0,te._)`${y} !== ${b}`)):!0}}function Wl(e){const{gen:t,schema:r,data:n}=e;switch(r.type){case"boolean":t.add(he.default.json,(0,te._)`${n} ? "true" : "false"`);break;case"string":Or(e);break;case"timestamp":t.if((0,te._)`${n} instanceof Date`,()=>t.add(he.default.json,(0,te._)`'"' + ${n}.toISOString() + '"'`),()=>Or(e));break;default:Xl(e)}}function Or({gen:e,data:t}){e.add(he.default.json,(0,te._)`${(0,Kl.useFunc)(e,Bl.default)}(${t})`)}function Xl({gen:e,data:t}){e.add(he.default.json,(0,te._)`"" + ${t}`)}function Zl(e){const{gen:t,self:r,data:n,definitions:s,schema:a,schemaEnv:o}=e,{ref:l}=a,f=s[l];if(!f)throw new Vl.default(r.opts.uriResolver,"",l,`No definition ${l}`);if(!(0,Hl.hasRef)(f))return br(le(Q({},e),{schema:f}));const{root:p}=o,i=no.call(r,new ro.SchemaEnv({schema:f,root:p}),s);t.add(he.default.json,(0,te._)`${xl(t,i)}(${n})`)}function xl(e,t){return t.serialize?e.scopeValue("serialize",{ref:t.serialize}):(0,te._)`${e.scopeValue("wrapper",{ref:t})}.serialize`}function ef({gen:e,data:t}){e.add(he.default.json,(0,te._)`JSON.stringify(${t})`)}function io({gen:e},t){e.if(t,()=>e.assign(t,!1),()=>e.add(he.default.json,(0,te.str)`,`))}var ms={},St={};Object.defineProperty(St,"__esModule",{value:!0}),St.parseJsonString=St.parseJsonNumber=St.parseJson=void 0;const tf=/position\s(\d+)$/;function ht(e,t){let r;ht.message=void 0;let n;t&&(e=e.slice(t));try{return ht.position=t+e.length,JSON.parse(e)}catch(s){if(n=tf.exec(s.message),!n){ht.message="unexpected end";return}r=+n[1];const a=e[r];e=e.slice(0,r),ht.position=t+r;try{return JSON.parse(e)}catch{ht.message=`unexpected token ${a}`;return}}}St.parseJson=ht,ht.message=void 0,ht.position=0,ht.code='require("ajv/dist/runtime/parseJson").parseJson';function pt(e,t,r){let n="",s;if(pt.message=void 0,e[t]==="-"&&(n+="-",t++),e[t]==="0")n+="0",t++;else if(!a(r)){o();return}if(r)return pt.position=t,+n;if(e[t]==="."&&(n+=".",t++,!a())){o();return}if(s=e[t],(s==="e"||s==="E")&&(n+="e",t++,s=e[t],(s==="+"||s==="-")&&(n+=s,t++),!a())){o();return}return pt.position=t,+n;function a(l){let f=!1;for(;s=e[t],s>="0"&&s<="9"&&(l===void 0||l-- >0);)f=!0,n+=s,t++;return f}function o(){pt.position=t,pt.message=t<e.length?`unexpected token ${e[t]}`:"unexpected end"}}St.parseJsonNumber=pt,pt.message=void 0,pt.position=0,pt.code='require("ajv/dist/runtime/parseJson").parseJsonNumber';const co={b:"\b",f:"\f",n:`
7
+ `,r:"\r",t:" ",'"':'"',"/":"/","\\":"\\"},rf="a".charCodeAt(0),nf="0".charCodeAt(0);function Rt(e,t){let r="",n;for(Rt.message=void 0;n=e[t++],n!=='"';)if(n==="\\")if(n=e[t],n in co)r+=co[n],t++;else if(n==="u"){t++;let a=4,o=0;for(;a--;){if(o<<=4,n=e[t],n===void 0){s("unexpected end");return}if(n=n.toLowerCase(),n>="a"&&n<="f")o+=n.charCodeAt(0)-rf+10;else if(n>="0"&&n<="9")o+=n.charCodeAt(0)-nf;else{s(`unexpected token ${n}`);return}t++}r+=String.fromCharCode(o)}else{s(`unexpected token ${n}`);return}else if(n===void 0){s("unexpected end");return}else if(n.charCodeAt(0)>=32)r+=n;else{s(`unexpected token ${n}`);return}return Rt.position=t,r;function s(a){Rt.position=t,Rt.message=a}}St.parseJsonString=Rt,Rt.message=void 0,Rt.position=0,Rt.code='require("ajv/dist/runtime/parseJson").parseJsonString',Object.defineProperty(ms,"__esModule",{value:!0});const sf=Rr,uo=Ce,L=ue,af=kt,Y=Le,of=ne,cf=Ft,uf=ns,vs=St,lo=be,lf=hn,ff={elements:mf,values:vf,discriminator:gf,properties:po,optionalProperties:po,enum:yf,type:Ef,ref:$f};function fo(e,t){const r=uo.getCompilingSchema.call(this,e);if(r)return r;const{es5:n,lines:s}=this.opts.code,{ownProperties:a}=this.opts,o=new L.CodeGen(this.scope,{es5:n,lines:s,ownProperties:a}),l=o.scopeName("parse"),f={self:this,gen:o,schema:e.schema,schemaEnv:e,definitions:t,data:Y.default.data,parseName:l,char:o.name("c")};let p;try{this._compilations.add(e),e.parseName=l,df(f),o.optimize(this.opts.code.optimize);const i=o.toString();p=`${o.scopeRefs(Y.default.scope)}return ${i}`;const E=new Function(`${Y.default.scope}`,p)(this.scope.get());this.scope.value(l,{ref:E}),e.parse=E}catch(i){throw p&&this.logger.error("Error compiling parser, function code:",p),delete e.parse,delete e.parseName,i}finally{this._compilations.delete(e)}return e}ms.default=fo;const _s=(0,L._)`undefined`;function df(e){const{gen:t,parseName:r,char:n}=e;t.func(r,(0,L._)`${Y.default.json}, ${Y.default.jsonPos}, ${Y.default.jsonPart}`,!1,()=>{t.let(Y.default.data),t.let(n),t.assign((0,L._)`${r}.message`,_s),t.assign((0,L._)`${r}.position`,_s),t.assign(Y.default.jsonPos,(0,L._)`${Y.default.jsonPos} || 0`),t.const(Y.default.jsonLen,(0,L._)`${Y.default.json}.length`),vn(e),ws(e),t.if(Y.default.jsonPart,()=>{t.assign((0,L._)`${r}.position`,Y.default.jsonPos),t.return(Y.default.data)}),t.if((0,L._)`${Y.default.jsonPos} === ${Y.default.jsonLen}`,()=>t.return(Y.default.data)),ar(e)})}function vn(e){let t;for(const r of sf.jtdForms)if(r in e.schema){t=r;break}t?pf(e,ff[t]):ys(e)}const hf=go(!0,go(!1,ar));function pf(e,t){const{gen:r,schema:n,data:s}=e;if(!n.nullable)return t(e);Nr(e,"null",t,()=>r.assign(s,null))}function mf(e){const{gen:t,schema:r,data:n}=e;et(e,"[");const s=t.let("i",0);t.assign(n,(0,L._)`[]`),gs(e,"]",()=>{const a=t.let("el");vn(le(Q({},e),{schema:r.elements,data:a})),t.assign((0,L._)`${n}[${s}++]`,a)})}function vf(e){const{gen:t,schema:r,data:n}=e;et(e,"{"),t.assign(n,(0,L._)`{}`),gs(e,"}",()=>_f(e,r.values))}function gs(e,t,r){ho(e,t,r),et(e,t)}function ho(e,t,r){const{gen:n}=e;n.for((0,L._)`;${Y.default.jsonPos}<${Y.default.jsonLen} && ${_n(1)}!==${t};`,()=>{r(),Nr(e,",",()=>n.break(),s)});function s(){Nr(e,t,()=>{},ar)}}function _f(e,t){const{gen:r}=e,n=r.let("key");Vt(le(Q({},e),{data:n})),et(e,":"),_o(e,n,t)}function gf(e){const{gen:t,data:r,schema:n}=e,{discriminator:s,mapping:a}=n;et(e,"{"),t.assign(r,(0,L._)`{}`);const o=t.const("pos",Y.default.jsonPos),l=t.let("value"),f=t.let("tag");ho(e,"}",()=>{const p=t.let("key");Vt(le(Q({},e),{data:p})),et(e,":"),t.if((0,L._)`${p} === ${s}`,()=>{Vt(le(Q({},e),{data:f})),t.assign((0,L._)`${r}[${p}]`,f),t.break()},()=>ys(le(Q({},e),{data:l})))}),t.assign(Y.default.jsonPos,o),t.if((0,L._)`${f} === undefined`),mt(e,(0,L.str)`discriminator tag not found`);for(const p in a)t.elseIf((0,L._)`${f} === ${p}`),mo(le(Q({},e),{schema:a[p]}),s);t.else(),mt(e,(0,L.str)`discriminator value not in schema`),t.endIf()}function po(e){const{gen:t,data:r}=e;et(e,"{"),t.assign(r,(0,L._)`{}`),mo(e)}function mo(e,t){const{gen:r,schema:n,data:s}=e,{properties:a,optionalProperties:o,additionalProperties:l}=n;if(gs(e,"}",()=>{const f=r.let("key");if(Vt(le(Q({},e),{data:f})),et(e,":"),r.if(!1),vo(e,f,a),vo(e,f,o),t){r.elseIf((0,L._)`${f} === ${t}`);const p=r.let("tag");Vt(le(Q({},e),{data:p}))}r.else(),l?ys(le(Q({},e),{data:(0,L._)`${s}[${f}]`})):mt(e,(0,L.str)`property ${f} not allowed`),r.endIf()}),a){const f=(0,of.hasPropFunc)(r),p=(0,L.and)(...Object.keys(a).map(i=>(0,L._)`${f}.call(${s}, ${i})`));r.if((0,L.not)(p),()=>mt(e,(0,L.str)`missing required properties`))}}function vo(e,t,r={}){const{gen:n}=e;for(const s in r)n.elseIf((0,L._)`${t} === ${s}`),_o(e,t,r[s])}function _o(e,t,r){vn(le(Q({},e),{schema:r,data:(0,L._)`${e.data}[${t}]`}))}function Ef(e){const{gen:t,schema:r,data:n,self:s}=e;switch(r.type){case"boolean":hf(e);break;case"string":Vt(e);break;case"timestamp":{Vt(e);const a=(0,lo.useFunc)(t,lf.default),{allowDate:o,parseDate:l}=s.opts,f=o?(0,L._)`!${a}(${n}, true)`:(0,L._)`!${a}(${n})`,p=l?(0,L.or)(f,(0,L._)`(${n} = new Date(${n}), false)`,(0,L._)`isNaN(${n}.valueOf())`):f;t.if(p,()=>mt(e,(0,L.str)`invalid timestamp`));break}case"float32":case"float64":Es(e);break;default:{const a=r.type;if(!s.opts.int32range&&(a==="int32"||a==="uint32"))Es(e,16),a==="uint32"&&t.if((0,L._)`${n} < 0`,()=>mt(e,(0,L.str)`integer out of range`));else{const[o,l,f]=uf.intRange[a];Es(e,f),t.if((0,L._)`${n} < ${o} || ${n} > ${l}`,()=>mt(e,(0,L.str)`integer out of range`))}}}}function Vt(e){et(e,'"'),$s(e,vs.parseJsonString)}function yf(e){const{gen:t,data:r,schema:n}=e,s=n.enum;et(e,'"'),t.if(!1);for(const a of s){const o=JSON.stringify(a).slice(1);t.elseIf((0,L._)`${_n(o.length)} === ${o}`),t.assign(r,(0,L.str)`${a}`),t.add(Y.default.jsonPos,o.length)}t.else(),ar(e),t.endIf()}function Es(e,t){const{gen:r}=e;ws(e),r.if((0,L._)`"-0123456789".indexOf(${_n(1)}) < 0`,()=>ar(e),()=>$s(e,vs.parseJsonNumber,t))}function go(e,t){return r=>{const{gen:n,data:s}=r;Nr(r,`${e}`,()=>t(r),()=>n.assign(s,e))}}function $f(e){const{gen:t,self:r,definitions:n,schema:s,schemaEnv:a}=e,{ref:o}=s,l=n[o];if(!l)throw new af.default(r.opts.uriResolver,"",o,`No definition ${o}`);if(!(0,cf.hasRef)(l))return vn(le(Q({},e),{schema:l}));const{root:f}=a,p=fo.call(r,new uo.SchemaEnv({schema:l,root:f}),n);Eo(e,wf(t,p),!0)}function wf(e,t){return t.parse?e.scopeValue("parse",{ref:t.parse}):(0,L._)`${e.scopeValue("wrapper",{ref:t})}.parse`}function ys(e){$s(e,vs.parseJson)}function $s(e,t,r){Eo(e,(0,lo.useFunc)(e.gen,t),r)}function Eo(e,t,r){const{gen:n,data:s}=e;n.assign(s,(0,L._)`${t}(${Y.default.json}, ${Y.default.jsonPos}${r?(0,L._)`, ${r}`:L.nil})`),n.assign(Y.default.jsonPos,(0,L._)`${t}.position`),n.if((0,L._)`${s} === undefined`,()=>mt(e,(0,L._)`${t}.message`))}function et(e,t){Nr(e,t,ar)}function Nr(e,t,r,n){const{gen:s}=e,a=t.length;ws(e),s.if((0,L._)`${_n(a)} === ${t}`,()=>{s.add(Y.default.jsonPos,a),n==null||n(e)},()=>r(e))}function ws({gen:e,char:t}){e.code((0,L._)`while((${t}=${Y.default.json}[${Y.default.jsonPos}],${t}===" "||${t}==="\\n"||${t}==="\\r"||${t}==="\\t"))${Y.default.jsonPos}++;`)}function _n(e){return e===1?(0,L._)`${Y.default.json}[${Y.default.jsonPos}]`:(0,L._)`${Y.default.json}.slice(${Y.default.jsonPos}, ${Y.default.jsonPos}+${e})`}function ar(e){mt(e,(0,L._)`"unexpected token " + ${Y.default.json}[${Y.default.jsonPos}]`)}function mt({gen:e,parseName:t},r){e.assign((0,L._)`${t}.message`,r),e.assign((0,L._)`${t}.position`,Y.default.jsonPos),e.return(_s)}(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=void 0;const r=ra,n=ts,s=fs,a=ds,o=ms,l="JTD-meta-schema";class f extends r.default{constructor(E={}){super(le(Q({},E),{jtd:!0}))}_addVocabularies(){super._addVocabularies(),this.addVocabulary(n.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema(),this.opts.meta&&this.addMetaSchema(s.default,l,!1)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(l)?l:void 0)}compileSerializer(E){const T=this._addSchema(E);return T.serialize||this._compileSerializer(T)}compileParser(E){const T=this._addSchema(E);return T.parse||this._compileParser(T)}_compileSerializer(E){if(a.default.call(this,E,E.schema.definitions||{}),!E.serialize)throw new Error("ajv implementation error");return E.serialize}_compileParser(E){if(o.default.call(this,E,E.schema.definitions||{}),!E.parse)throw new Error("ajv implementation error");return E.parse}}e.exports=t=f,Object.defineProperty(t,"__esModule",{value:!0}),t.default=f;var p=We;Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return p.KeywordCxt}});var i=ue;Object.defineProperty(t,"_",{enumerable:!0,get:function(){return i._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return i.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return i.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return i.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return i.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return i.CodeGen}})})(zn,zn.exports);var Sf=ee&&ee.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(It,"__esModule",{value:!0}),It.Validate=It.AddSchema=void 0;const Rf=Sf(zn.exports),yo=new Rf.default,bf=(e,t)=>e(t)?null:e.errors;function Of(e,t){yo.addSchema(t,e)}It.AddSchema=Of;function Nf(e,t){const r=yo.getSchema(e);if(r)return bf(r,t)}It.Validate=Nf,Object.defineProperty(rn,"__esModule",{value:!0}),rn.STSOptionsBase=void 0;const Pf=It;class Tf{constructor(t=null){_r(this,"_options");this._options=t,t!==null&&(typeof t.validator=="undefined"||(0,Pf.Validate)(t.validator,t))}get options(){return this._options}}rn.STSOptionsBase=Tf;var or={};Object.defineProperty(or,"__esModule",{value:!0}),or.JestSleep=or.Sleep=void 0;async function $o(e=1e3){return new Promise(t=>setTimeout(t,e))}or.Sleep=$o;async function Af(){return $o(100)}or.JestSleep=Af;var wo={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.compareParameterTypes=e.OAuth2ParameterErrorType=e.OIDCAddressClaim=e.OIDCStandardClaim=e.OAuth2ParameterType=void 0,function(n){n.AUDIENCE="AUDIENCE",n.CLIENT_ID="client_id",n.CLIENT_SECRET="client_secret",n.RESPONSE_TYPE="response_type",n.SCOPE="scope",n.STATE="state",n.REDIRECT_URI="redirect_uri",n.ERROR="error",n.ERROR_DESCRIPTION="error_description",n.ERROR_CODES="error_codes",n.ERROR_URI="error_uri",n.GRANT_TYPE="grant_type",n.CODE="code",n.ACCESS_TOKEN="access_token",n.TOKEN_TYPE="token_type",n.EXPIRES_IN="expires_in",n.USERNAME="username",n.PASSWORD="password",n.REFRESH_TOKEN="refresh_token",n.RESPONSE_MODE="response_mode",n.TIMESTAMP="timestamp",n.TRACE_ID="trace_id",n.CORRELATION_ID="correlation_id"}(e.OAuth2ParameterType||(e.OAuth2ParameterType={})),function(n){n.SUB="sub",n.NAME="name",n.GIVEN_NAME="given_name",n.FAMILY_NAME="family_name",n.MIDDLE_NAME="middle_name",n.NICKNAME="nickname",n.PREFERRED_USERNAME="preferred_username",n.PROFILE="profile",n.PICTURE="picture",n.WEBSITE="website",n.EMAIL="email",n.EMAIL_VERIFIED="email_verified",n.GENDER="gender",n.BIRTHDATE="birthdate",n.ZONEINFO="zoneinfo",n.LOCALE="locale",n.PHONE_NUMBER="phone_number",n.PHONE_NUMBER_VERIFIED="phone_number_verified",n.ADDRESS="address",n.CLIENT_SECRET="client_secret",n.NONCE="nonce"}(e.OIDCStandardClaim||(e.OIDCStandardClaim={})),function(n){n.FORMATTED="formatted",n.STREET_ADDRESS="street_address",n.LOCALITY="locality",n.REGION="region",n.COUNTRY="country"}(e.OIDCAddressClaim||(e.OIDCAddressClaim={}));class t{}_r(t,"NOT_EQUAL",{code:"STS_OAUTH2_ERR_0001",description:"Parameter values not equal."}),_r(t,"NOT_PRESENT",{code:"STS_OAUTH2_ERR_0002",description:"Parameter not provided."}),_r(t,"INVALID_FORMAT",{code:"STS_OAUTH2_ERR_0003",description:"Parameter value format invalid."}),_r(t,"EXPIRED",{code:"STS_OAUTH2_ERR_0004",description:"Parameter value expired."}),e.OAuth2ParameterErrorType=t;function r(n,s,a){const o=[];for(let l=0;l<a.length;l++){const f=a[l];if(n[l].localeCompare(s[l])!==0){const p={error:t.NOT_EQUAL.code,error_description:t.NOT_EQUAL.description,timestamp:Date.now(),details:`${t.NOT_EQUAL.description}: Parameter: [${f}]`};o.push(p)}}return o}e.compareParameterTypes=r})(wo),function(e){var t=ee&&ee.__createBinding||(Object.create?function(s,a,o,l){l===void 0&&(l=o);var f=Object.getOwnPropertyDescriptor(a,o);(!f||("get"in f?!a.__esModule:f.writable||f.configurable))&&(f={enumerable:!0,get:function(){return a[o]}}),Object.defineProperty(s,l,f)}:function(s,a,o,l){l===void 0&&(l=o),s[l]=a[o]}),r=ee&&ee.__exportStar||function(s,a){for(var o in s)o!=="default"&&!Object.prototype.hasOwnProperty.call(a,o)&&t(a,s,o)};Object.defineProperty(e,"__esModule",{value:!0}),e.$stsgdf=e.$stsgd=void 0,r(tn,e),r(rn,e),r(or,e),r(It,e),r(wo,e),e.$stsgd={};function n(){return e.$stsgd}e.$stsgdf=n}(Ct);class Cf{constructor(){this.DigestMessage=async function(t){const n=new TextEncoder().encode(t),s=await crypto.subtle.digest("SHA-256",n),a=Array.from(new Uint8Array(s));return btoa(String.fromCharCode(...a))},this.CreateRandomString=(t=43)=>{const r=Array.from(crypto.getRandomValues(new Uint8Array(t)));return btoa(String.fromCharCode(...r))},this.CreateRandomStringEx=()=>{const t="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_~.";let r="";return Array.from(crypto.getRandomValues(new Uint8Array(43))).forEach(s=>r+=t[s%t.length]),r}}}class If{constructor(){this.DecodeQueryParams=t=>{const r={};return Object.keys(t).filter(n=>typeof t[n]!="undefined").map(n=>{r[decodeURIComponent(n)]=decodeURIComponent(t[n])}),r},this.CreateQueryParams=t=>Object.keys(t).filter(r=>typeof t[r]!="undefined").map(r=>Array.isArray(t[r])?encodeURIComponent(r)+"="+encodeURIComponent(t[r].join(" ")):encodeURIComponent(r)+"="+encodeURIComponent(t[r])).join("&"),this._GetQueryParams=t=>{let r={};const n=t.split("?");if(n.length==2){const s=n[1].split("&"),a={};let o="";s.forEach(function(l){o=l.split("="),o.length==2&&(a[o[0]]=o[1])}),r=this.DecodeQueryParams(a)}return r},this.GetQueryParams=()=>this._GetQueryParams(window.location.href)}}function Ss(e){this.message=e}Ss.prototype=new Error,Ss.prototype.name="InvalidCharacterError";var So=typeof window!="undefined"&&window.atob&&window.atob.bind(window)||function(e){var t=String(e).replace(/=+$/,"");if(t.length%4==1)throw new Ss("'atob' failed: The string to be decoded is not correctly encoded.");for(var r,n,s=0,a=0,o="";n=t.charAt(a++);~n&&(r=s%4?64*r+n:n,s++%4)?o+=String.fromCharCode(255&r>>(-2*s&6)):0)n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(n);return o};function Df(e){var t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw"Illegal base64url string!"}try{return function(r){return decodeURIComponent(So(r).replace(/(.)/g,function(n,s){var a=s.charCodeAt(0).toString(16).toUpperCase();return a.length<2&&(a="0"+a),"%"+a}))}(t)}catch{return So(t)}}function gn(e){this.message=e}function jf(e,t){if(typeof e!="string")throw new gn("Invalid token specified");var r=(t=t||{}).header===!0?0:1;try{return JSON.parse(Df(e.split(".")[r]))}catch(n){throw new gn("Invalid token specified: "+n.message)}}gn.prototype=new Error,gn.prototype.name="InvalidTokenError";var Pr=ee&&ee.__assign||function(){return Pr=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s])}return e},Pr.apply(this,arguments)};function Tr(e,t){if(!t)return"";var r="; "+e;return t===!0?r:r+"="+t}function kf(e){if(typeof e.expires=="number"){var t=new Date;t.setMilliseconds(t.getMilliseconds()+e.expires*864e5),e.expires=t}return Tr("Expires",e.expires?e.expires.toUTCString():"")+Tr("Domain",e.domain)+Tr("Path",e.path)+Tr("Secure",e.secure)+Tr("SameSite",e.sameSite)}function Uf(e,t,r){return encodeURIComponent(e).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/\(/g,"%28").replace(/\)/g,"%29")+"="+encodeURIComponent(t).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent)+kf(r)}function Ff(e){for(var t={},r=e?e.split("; "):[],n=/(%[\dA-F]{2})+/gi,s=0;s<r.length;s++){var a=r[s].split("="),o=a.slice(1).join("=");o.charAt(0)==='"'&&(o=o.slice(1,-1));try{var l=a[0].replace(n,decodeURIComponent);t[l]=o.replace(n,decodeURIComponent)}catch{}}return t}function Mf(){return Ff(document.cookie)}function Lf(e){return Mf()[e]}var Vf=Lf;function Ro(e,t,r){document.cookie=Uf(e,t,Pr({path:"/"},r))}var zf=Ro;function Hf(e,t){Ro(e,"",Pr(Pr({},t),{expires:-1}))}var Kf=Hf;const En=Ns(`proc:${process.pid}:storage.ts`);var bo=(e=>(e.LOCAL_STORAGE="LocalStorage",e.SESSION_STORAGE="SessionStorage",e.COOKIE_STORAGE="CookieStorage",e.MEMORY_STORAGE="MemoryStorage",e))(bo||{});class Bf{constructor(){this.get=t=>{const r=Vf(t);return r?JSON.parse(r):null},this.set=(t,r,n={})=>{let s={};window.location.protocol==="https:"&&(s={secure:!0,sameSite:"none"}),n&&n.daysUntilExpire?s.expires=n.daysUntilExpire:s.expires=1,En(`CookieStorage.set: key: ${t}, value: [${r}]`),zf(t,JSON.stringify(r),s)},this.remove=t=>{Kf(t)}}}class Jf{constructor(){this.get=t=>{const r=sessionStorage.getItem(t);return typeof r=="undefined"||r===null?null:JSON.parse(r)},this.set=(t,r)=>{En(`SessionStorage.set: key: ${t}, value: [${r}]`),sessionStorage.setItem(t,JSON.stringify(r))},this.remove=t=>{sessionStorage.removeItem(t)}}}class qf{constructor(){this.get=t=>{const r=localStorage.getItem(t);return typeof r=="undefined"||r===null?null:JSON.parse(r)},this.set=(t,r)=>{En(`LocalStorage.set: key: ${t}, value: [${r}]`),localStorage.setItem(t,JSON.stringify(r))},this.remove=t=>{localStorage.removeItem(t)}}}class Gf{constructor(){Se(this,Ht,void 0);ce(this,Ht,{}),this.get=t=>{const r=V(this,Ht)[t];return typeof r=="undefined"||r===null?null:r},this.set=(t,r)=>{En(`MemoryStorage.set: key: ${t}, value: [${r}]`),V(this,Ht)[t]=r},this.remove=t=>{delete V(this,Ht)[t]}}}Ht=new WeakMap;class Qf{constructor(t){Se(this,bt,null);switch(t.clientStorageType){case"SessionStorage":ce(this,bt,new Jf);break;case"LocalStorage":ce(this,bt,new qf);break;case"CookieStorage":ce(this,bt,new Bf);break;case"MemoryStorage":ce(this,bt,new Gf);break;default:throw new Error(`Unknown [${t.clientStorageType}] storage type.`)}}GetStorage(){return V(this,bt)}}bt=new WeakMap;var ir;(function(e){e[e.ACCEPTED=202]="ACCEPTED",e[e.BAD_GATEWAY=502]="BAD_GATEWAY",e[e.BAD_REQUEST=400]="BAD_REQUEST",e[e.CONFLICT=409]="CONFLICT",e[e.CONTINUE=100]="CONTINUE",e[e.CREATED=201]="CREATED",e[e.EXPECTATION_FAILED=417]="EXPECTATION_FAILED",e[e.FAILED_DEPENDENCY=424]="FAILED_DEPENDENCY",e[e.FORBIDDEN=403]="FORBIDDEN",e[e.GATEWAY_TIMEOUT=504]="GATEWAY_TIMEOUT",e[e.GONE=410]="GONE",e[e.HTTP_VERSION_NOT_SUPPORTED=505]="HTTP_VERSION_NOT_SUPPORTED",e[e.IM_A_TEAPOT=418]="IM_A_TEAPOT",e[e.INSUFFICIENT_SPACE_ON_RESOURCE=419]="INSUFFICIENT_SPACE_ON_RESOURCE",e[e.INSUFFICIENT_STORAGE=507]="INSUFFICIENT_STORAGE",e[e.INTERNAL_SERVER_ERROR=500]="INTERNAL_SERVER_ERROR",e[e.LENGTH_REQUIRED=411]="LENGTH_REQUIRED",e[e.LOCKED=423]="LOCKED",e[e.METHOD_FAILURE=420]="METHOD_FAILURE",e[e.METHOD_NOT_ALLOWED=405]="METHOD_NOT_ALLOWED",e[e.MOVED_PERMANENTLY=301]="MOVED_PERMANENTLY",e[e.MOVED_TEMPORARILY=302]="MOVED_TEMPORARILY",e[e.MULTI_STATUS=207]="MULTI_STATUS",e[e.MULTIPLE_CHOICES=300]="MULTIPLE_CHOICES",e[e.NETWORK_AUTHENTICATION_REQUIRED=511]="NETWORK_AUTHENTICATION_REQUIRED",e[e.NO_CONTENT=204]="NO_CONTENT",e[e.NON_AUTHORITATIVE_INFORMATION=203]="NON_AUTHORITATIVE_INFORMATION",e[e.NOT_ACCEPTABLE=406]="NOT_ACCEPTABLE",e[e.NOT_FOUND=404]="NOT_FOUND",e[e.NOT_IMPLEMENTED=501]="NOT_IMPLEMENTED",e[e.NOT_MODIFIED=304]="NOT_MODIFIED",e[e.OK=200]="OK",e[e.PARTIAL_CONTENT=206]="PARTIAL_CONTENT",e[e.PAYMENT_REQUIRED=402]="PAYMENT_REQUIRED",e[e.PERMANENT_REDIRECT=308]="PERMANENT_REDIRECT",e[e.PRECONDITION_FAILED=412]="PRECONDITION_FAILED",e[e.PRECONDITION_REQUIRED=428]="PRECONDITION_REQUIRED",e[e.PROCESSING=102]="PROCESSING",e[e.PROXY_AUTHENTICATION_REQUIRED=407]="PROXY_AUTHENTICATION_REQUIRED",e[e.REQUEST_HEADER_FIELDS_TOO_LARGE=431]="REQUEST_HEADER_FIELDS_TOO_LARGE",e[e.REQUEST_TIMEOUT=408]="REQUEST_TIMEOUT",e[e.REQUEST_TOO_LONG=413]="REQUEST_TOO_LONG",e[e.REQUEST_URI_TOO_LONG=414]="REQUEST_URI_TOO_LONG",e[e.REQUESTED_RANGE_NOT_SATISFIABLE=416]="REQUESTED_RANGE_NOT_SATISFIABLE",e[e.RESET_CONTENT=205]="RESET_CONTENT",e[e.SEE_OTHER=303]="SEE_OTHER",e[e.SERVICE_UNAVAILABLE=503]="SERVICE_UNAVAILABLE",e[e.SWITCHING_PROTOCOLS=101]="SWITCHING_PROTOCOLS",e[e.TEMPORARY_REDIRECT=307]="TEMPORARY_REDIRECT",e[e.TOO_MANY_REQUESTS=429]="TOO_MANY_REQUESTS",e[e.UNAUTHORIZED=401]="UNAUTHORIZED",e[e.UNAVAILABLE_FOR_LEGAL_REASONS=451]="UNAVAILABLE_FOR_LEGAL_REASONS",e[e.UNPROCESSABLE_ENTITY=422]="UNPROCESSABLE_ENTITY",e[e.UNSUPPORTED_MEDIA_TYPE=415]="UNSUPPORTED_MEDIA_TYPE",e[e.USE_PROXY=305]="USE_PROXY",e[e.MISDIRECTED_REQUEST=421]="MISDIRECTED_REQUEST"})(ir||(ir={}));var Oo=(e=>(e.CODE="code",e.ID_TOKEN="id_token",e.TOKEN="token",e))(Oo||{}),No=(e=>(e.QUERY="query",e.FRAGMENT="fragment",e.FORM_POST="form_post",e))(No||{}),Rs=(e=>(e.CLIENT_CREDENTIALS="client_credentials",e.AUTHORIZATION_CODE="authorization_code",e.REFRESH_TOKEN="refresh_token",e))(Rs||{}),zt=(e=>(e.RESTORE_SESSION="RestoreSession",e.AUTHORIZE="Authorize",e.HANDLE_REDIRECT="HandleRedirect",e.LOGOUT="Logout",e.AUTHENTICATE_EVENT="AuthenticateEvent",e.ERROR="Error",e))(zt||{});Ns(`proc:${process.pid}:stsoauth2worker.ts`);class Yf{constructor(t){Se(this,Fe,void 0);Se(this,Ot,void 0);Se(this,Ar,void 0);Se(this,yn,void 0);Se(this,He,void 0);Se(this,vt,void 0);Se(this,Nt,void 0);Se(this,Ke,void 0);Se(this,Kt,void 0);Se(this,$n,void 0);Se(this,tt,void 0);Se(this,Cr,void 0);Se(this,Ir,void 0);Se(this,Dr,void 0);Se(this,cr,void 0);Se(this,jr,void 0);Se(this,kr,void 0);Se(this,Ur,void 0);ce(this,Fe,null),ce(this,Ot,new Cf),ce(this,Ar,new If),ce(this,yn,"authorize_options.stsmda.com.au"),ce(this,He,"session.stsmda.com.au"),ce(this,vt,null),ce(this,Nt,null),ce(this,Ke,null),ce(this,Kt,null),ce(this,$n,0),this.SetupListener=()=>{V(this,Kt).onmessage=async r=>{const n=r.data;switch(n.command){case zt.RESTORE_SESSION:V(this,tt).call(this,n,await V(this,Cr).call(this));break;case zt.AUTHORIZE:V(this,tt).call(this,n,await V(this,Ir).call(this));break;case zt.HANDLE_REDIRECT:V(this,tt).call(this,n,await V(this,Dr).call(this,n.payload));break;case zt.LOGOUT:V(this,tt).call(this,n,await V(this,Ur).call(this));break;default:throw new Error(`Command: [${n.command}'] not found.`)}}},ce(this,tt,async(r,n)=>{const s={messageId:r.messageId,command:r.command,payload:n};V(this,Kt).postMessage(s)}),ce(this,Cr,async()=>{let r=null;if(r=V(this,Fe).get(V(this,He)),r!==null)console.log("Session restored from client storage."),V(this,vt)&&V(this,vt).UpdateInstrument("m",{LogMessage:"Session restored from client storage."});else{const n=`${{}.BROKER_ENDPOINT}:${{}.BROKER_PORT}${{}.BROKER_API_ROOT}/session`;console.log("RestoreSession"),console.log(n),V(this,vt)&&(V(this,vt).UpdateInstrument("m",{LogMessage:"RestoreSession"}),V(this,vt).UpdateInstrument("m",{LogMessage:n}));try{const s=await Vn({method:"post",url:n,data:{[Ct.OAuth2ParameterType.CLIENT_ID]:{}.CLIENT_ID,[Ct.OAuth2ParameterType.SCOPE]:{}.SCOPE,[Ct.OAuth2ParameterType.REDIRECT_URI]:{}.REDIRECT_URI,[Ct.OAuth2ParameterType.AUDIENCE]:{}.AUDIENCE},withCredentials:!0,timeout:parseInt({}.TIMEOUT)});s.data.status===ir.OK?(r=s.data.detail,V(this,Fe).set(V(this,He),r),console.log("Session restored from server side cookie.")):(console.log("Could not restore previous session:-"),console.log(JSON.stringify(s.data)))}catch(s){console.log("Could not restore previous session (error state):-"),console.log(s),console.log(JSON.stringify(s))}}return r!==null?(V(this,Ke).call(this,r.id_token),console.log("Refreshing tokens ..."),V(this,kr).call(this)):(V(this,Ke).call(this,null),!1)}),ce(this,Ir,async()=>{console.log("Authorize ...");const r={}.CLIENT_ID,n=V(this,Ot).CreateRandomString(),s=[Oo.CODE],a={}.REDIRECT_URI,o=No.QUERY,l={}.SCOPE,f=V(this,Ot).CreateRandomString(),p=V(this,Ot).CreateRandomString(),i=await V(this,Ot).DigestMessage(p),E={client_id:r,nonce:n,response_type:s,redirect_uri:a,response_mode:o,scope:l,state:f,code_challenge:i,code_challenge_method:"S256"},T=`${{}.AUTH_ENDPOINT}:${{}.AUTH_PORT}${{}.AUTH_APIROOT}?${V(this,Ar).CreateQueryParams(E)}`;return console.log(T),E.code_verifier=p,console.log(`Authorize:authorizeOptions: [${JSON.stringify(E)}]`),{url:T,authorizeOptions:E}}),ce(this,Dr,async r=>{const n=r.queryVars,s=r.authorizeOptions;if(console.log("HandleRedirect"),console.log(`HandleRedirect:Query Vars: [${JSON.stringify(n)}]`),n[Ct.OAuth2ParameterType.CODE]){const a=n;console.log(`authorizeOptions from transaction state: [${JSON.stringify(s)}]`);const o=a.state;return s.state.localeCompare(o)===0?(console.log("redirected state (from queryVars) matched previously saved transaction authorizeOptions state"),await V(this,jr).call(this,s,a)):(console.log("redirected state (from queryVars) did NOT match previously saved transaction authorizeOptions state"),V(this,Nt).call(this,{message:"State un-matched"}),!1)}else if(n[Ct.OAuth2ParameterType.ERROR]){const a=n;return a.error,a.error_description,V(this,Nt).call(this,{message:"State un-matched"}),!1}else return V(this,Nt).call(this,{message:"State un-matched"}),!1}),ce(this,cr,async r=>{console.log("#GetTokenFromBroker"),V(this,Fe).remove(V(this,He));const n=`${{}.BROKER_ENDPOINT}:${{}.BROKER_PORT}${{}.BROKER_API_ROOT}/token`;console.log(`#GetTokenFromBroker:url = [${n}]`),console.log(r);try{const s=await Vn({method:"post",url:n,data:r,withCredentials:!0,timeout:parseInt({}.TIMEOUT)});if(console.log(`retVal: ${JSON.stringify(s)}`),s.status===ir.OK){console.log("Storing tokens...");const a=s.data;return V(this,Ke).call(this,a.id_token),V(this,Fe).set(V(this,He),a),!0}else if(s.status===ir.UNAUTHORIZED){console.log("NOT Storing tokens..."),console.log(s.status),V(this,Ke).call(this,null);const a=s.data;return!1}else return console.log("NOT Storing tokens..."),console.log(s.status),V(this,Ke).call(this,null),console.log("Could not obtain access_token from token end-point:-"),console.log(JSON.stringify(s.data)),!1}catch(s){return V(this,Ke).call(this,null),console.log(s),console.log(JSON.stringify(s)),!1}}),ce(this,jr,async(r,n)=>{console.log("#GetToken"),console.log(n),V(this,Fe).set(V(this,He),null);const s={client_id:{}.CLIENT_ID,scope:{}.SCOPE,code:n.code,redirect_uri:{}.REDIRECT_URI,grant_type:Rs.AUTHORIZATION_CODE,code_verifier:r.code_verifier};return V(this,cr).call(this,s)}),ce(this,kr,async()=>{console.log("RefreshToken");const r=V(this,Fe).get(V(this,He));if(r){const n={client_id:{}.CLIENT_ID,scope:{}.SCOPE,refresh_token:r.refresh_token,grant_type:Rs.REFRESH_TOKEN};return V(this,cr).call(this,n)}else return!1}),ce(this,Ur,async()=>{console.log("Logout");const r=`${{}.BROKER_ENDPOINT}:${{}.BROKER_PORT}${{}.BROKER_API_ROOT}/logout`;console.log(r);const s=V(this,Fe).get(V(this,He)).refresh_token;console.log(s);const a=jf(s);console.log(a);const o=a.sts_session;console.log(o),V(this,Fe).remove(V(this,He)),V(this,Ke).call(this,null);try{const l=await Vn({method:"post",url:r,data:{sessionId:o},withCredentials:!0,timeout:parseInt({}.TIMEOUT)});return l.data.status===ir.OK?!0:(console.log("Error during logout (server side)"),console.log(JSON.stringify(l.data)),!1)}catch(l){return console.log("Error during logout (server side)"),console.log(l),console.log(JSON.stringify(l)),!1}}),ce(this,Fe,new Qf({clientStorageType:bo.MEMORY_STORAGE}).GetStorage()),ce(this,Ke,r=>{const n={messageId:-1,command:zt.AUTHENTICATE_EVENT};V(this,tt).call(this,n,r)}),ce(this,Nt,r=>{const n={messageId:-1,command:zt.ERROR};V(this,tt).call(this,n,r)}),ce(this,Kt,t),this.SetupListener()}}Fe=new WeakMap,Ot=new WeakMap,Ar=new WeakMap,yn=new WeakMap,He=new WeakMap,vt=new WeakMap,Nt=new WeakMap,Ke=new WeakMap,Kt=new WeakMap,$n=new WeakMap,tt=new WeakMap,Cr=new WeakMap,Ir=new WeakMap,Dr=new WeakMap,cr=new WeakMap,jr=new WeakMap,kr=new WeakMap,Ur=new WeakMap,onmessage=async function(e){const t=e.data;new Yf(t)}})();