@nsshunt/stsoauth2plugin 0.1.2 → 0.1.3
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.
- package/dist/384.index.js +1 -1
- package/dist/index.js +2 -2
- package/package.json +1 -1
- package/webpack.config.js +1 -1
package/dist/384.index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var stsoauth2plugin;(()=>{"use strict";var e,t,s={9384:(e,t,s)=>{var o=s(1227),r=s.n(o),n=s(9669),a=s.n(n),i=s(7557);var c,l,h=s(6245),u=s(6378),p=function(e,t,s,o){if("a"===s&&!o)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===s?o:"a"===s?o.call(e):o?o.value:t.get(e)},f=function(e,t,s,o,r){if("m"===o)throw new TypeError("Private method is not writable");if("a"===o&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===o?r.call(e,s):r?r.value=s:t.set(e,s),s};const d=r()(`proc:${process.pid}:storage.ts`);var g;!function(e){e.LOCAL_STORAGE="LocalStorage",e.SESSION_STORAGE="SessionStorage",e.COOKIE_STORAGE="CookieStorage",e.MEMORY_STORAGE="MemoryStorage"}(g||(g={}));class m{constructor(){this.get=e=>{const t=u.get(e);return t?JSON.parse(t):null},this.set=(e,t,s={})=>{let o={};"https:"===window.location.protocol&&(o={secure:!0,sameSite:"none"}),s&&s.daysUntilExpire?o.expires=s.daysUntilExpire:o.expires=1,d(`CookieStorage.set: key: ${e}, value: [${t}]`),u.set(e,JSON.stringify(t),o)},this.remove=e=>{u.remove(e)}}}class O{constructor(){this.get=e=>{const t=sessionStorage.getItem(e);return null==t?null:JSON.parse(t)},this.set=(e,t)=>{d(`SessionStorage.set: key: ${e}, value: [${t}]`),sessionStorage.setItem(e,JSON.stringify(t))},this.remove=e=>{sessionStorage.removeItem(e)}}}class E{constructor(){this.get=e=>{const t=localStorage.getItem(e);return null==t?null:JSON.parse(t)},this.set=(e,t)=>{d(`LocalStorage.set: key: ${e}, value: [${t}]`),localStorage.setItem(e,JSON.stringify(t))},this.remove=e=>{localStorage.removeItem(e)}}}class w{constructor(){c.set(this,{}),this.get=e=>{const t=p(this,c,"f")[e];return null==t?null:t},this.set=(e,t)=>{d(`MemoryStorage.set: key: ${e}, value: [${t}]`),p(this,c,"f")[e]=t},this.remove=e=>{delete p(this,c,"f")[e]}}}c=new WeakMap;class R{constructor(e){switch(l.set(this,null),e.clientStorageType){case g.SESSION_STORAGE:f(this,l,new O,"f");break;case g.LOCAL_STORAGE:f(this,l,new E,"f");break;case g.COOKIE_STORAGE:f(this,l,new m,"f");break;case g.MEMORY_STORAGE:f(this,l,new w,"f");break;default:throw new Error(`Unknown [${e.clientStorageType}] storage type.`)}}GetStorage(){return p(this,l,"f")}}l=new WeakMap;var y,T,v,S,_=s(6647);!function(e){e.CODE="code",e.ID_TOKEN="id_token",e.TOKEN="token"}(y||(y={})),function(e){e.QUERY="query",e.FRAGMENT="fragment",e.FORM_POST="form_post"}(T||(T={})),function(e){e.CLIENT_CREDENTIALS="client_credentials",e.AUTHORIZATION_CODE="authorization_code",e.REFRESH_TOKEN="refresh_token"}(v||(v={})),function(e){e.RESTORE_SESSION="RestoreSession",e.AUTHORIZE="Authorize",e.HANDLE_REDIRECT="HandleRedirect",e.LOGOUT="Logout",e.AUTHENTICATE_EVENT="AuthenticateEvent",e.ERROR="Error"}(S||(S={}));var I,k,C,A,N,P,M,U,b,$,D,L,W,G,H,K,x,J,j=function(e,t,s,o,r){if("m"===o)throw new TypeError("Private method is not writable");if("a"===o&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===o?r.call(e,s):r?r.value=s:t.set(e,s),s},B=function(e,t,s,o){if("a"===s&&!o)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===s?o:"a"===s?o.call(e):o?o.value:t.get(e)};r()(`proc:${process.pid}:stsoauth2worker.ts`);class z{constructor(e){I.set(this,null),k.set(this,new class{constructor(){this.DigestMessage=async function(e){const t=(new TextEncoder).encode(e),s=await crypto.subtle.digest("SHA-256",t),o=Array.from(new Uint8Array(s));return btoa(String.fromCharCode(...o))},this.CreateRandomString=(e=43)=>{const t=Array.from(crypto.getRandomValues(new Uint8Array(e)));return btoa(String.fromCharCode(...t))},this.CreateRandomStringEx=()=>{const e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_~.";let t="";return Array.from(crypto.getRandomValues(new Uint8Array(43))).forEach((s=>t+=e[s%e.length])),t}}}),C.set(this,new class{constructor(){this.DecodeQueryParams=e=>{const t={};return Object.keys(e).filter((t=>void 0!==e[t])).map((s=>{t[decodeURIComponent(s)]=decodeURIComponent(e[s])})),t},this.CreateQueryParams=e=>Object.keys(e).filter((t=>void 0!==e[t])).map((t=>Array.isArray(e[t])?encodeURIComponent(t)+"="+encodeURIComponent(e[t].join(" ")):encodeURIComponent(t)+"="+encodeURIComponent(e[t]))).join("&"),this._GetQueryParams=e=>{let t={};const s=e.split("?");if(2==s.length){const e=s[1].split("&"),o={};let r="";e.forEach((function(e){r=e.split("="),2==r.length&&(o[r[0]]=r[1])})),t=this.DecodeQueryParams(o)}return t},this.GetQueryParams=()=>this._GetQueryParams(window.location.href)}}),A.set(this,"authorize_options.stsmda.com.au"),N.set(this,"session.stsmda.com.au"),P.set(this,null),M.set(this,null),U.set(this,null),b.set(this,null),$.set(this,0),this.SetupListener=()=>{B(this,b,"f").onmessage=async e=>{const t=e.data;switch(t.command){case S.RESTORE_SESSION:B(this,D,"f").call(this,t,await B(this,L,"f").call(this));break;case S.AUTHORIZE:B(this,D,"f").call(this,t,await B(this,W,"f").call(this));break;case S.HANDLE_REDIRECT:B(this,D,"f").call(this,t,await B(this,G,"f").call(this,t.payload));break;case S.LOGOUT:B(this,D,"f").call(this,t,await B(this,J,"f").call(this));break;default:throw new Error(`Command: [${t.command}'] not found.`)}}},D.set(this,(async(e,t)=>{const s={messageId:e.messageId,command:e.command,payload:t};B(this,b,"f").postMessage(s)})),L.set(this,(async()=>{let e=null;if(e=B(this,I,"f").get(B(this,N,"f")),null!==e)console.log("Session restored from client storage."),B(this,P,"f")&&B(this,P,"f").UpdateInstrument("m",{LogMessage:"Session restored from client storage."});else{const t=`${process.env.BROKER_ENDPOINT}:${process.env.BROKER_PORT}${process.env.BROKER_API_ROOT}/session`;console.log("RestoreSession"),console.log(t),B(this,P,"f")&&(B(this,P,"f").UpdateInstrument("m",{LogMessage:"RestoreSession"}),B(this,P,"f").UpdateInstrument("m",{LogMessage:t}));try{const s=await a()({method:"post",url:t,data:{[i.OAuth2ParameterType.CLIENT_ID]:process.env.CLIENT_ID,[i.OAuth2ParameterType.SCOPE]:process.env.SCOPE,[i.OAuth2ParameterType.REDIRECT_URI]:process.env.REDIRECT_URI,[i.OAuth2ParameterType.AUDIENCE]:process.env.AUDIENCE},withCredentials:!0,timeout:parseInt(process.env.TIMEOUT)});s.data.status===_.W.OK?(e=s.data.detail,B(this,I,"f").set(B(this,N,"f"),e),console.log("Session restored from server side cookie.")):(console.log("Could not restore previous session:-"),console.log(JSON.stringify(s.data)))}catch(e){console.log("Could not restore previous session (error state):-"),console.log(e),console.log(JSON.stringify(e))}}return null!==e?(B(this,U,"f").call(this,e.id_token),console.log("Refreshing tokens ..."),B(this,x,"f").call(this)):(B(this,U,"f").call(this,null),!1)})),W.set(this,(async()=>{console.log("Authorize ...");const e=process.env.CLIENT_ID,t=B(this,k,"f").CreateRandomString(),s=[y.CODE],o=process.env.REDIRECT_URI,r=T.QUERY,n=process.env.SCOPE,a=B(this,k,"f").CreateRandomString(),i=B(this,k,"f").CreateRandomString(),c={client_id:e,nonce:t,response_type:s,redirect_uri:o,response_mode:r,scope:n,state:a,code_challenge:await B(this,k,"f").DigestMessage(i),code_challenge_method:"S256"},l=`${process.env.AUTH_ENDPOINT}:${process.env.AUTH_PORT}${process.env.AUTH_APIROOT}?${B(this,C,"f").CreateQueryParams(c)}`;return console.log(l),c.code_verifier=i,console.log(`Authorize:authorizeOptions: [${JSON.stringify(c)}]`),{url:l,authorizeOptions:c}})),G.set(this,(async e=>{const t=e.queryVars,s=e.authorizeOptions;if(console.log("HandleRedirect"),console.log(`HandleRedirect:Query Vars: [${JSON.stringify(t)}]`),t[i.OAuth2ParameterType.CODE]){const e=t;console.log(`authorizeOptions from transaction state: [${JSON.stringify(s)}]`);const o=e.state;return 0===s.state.localeCompare(o)?(console.log("redirected state (from queryVars) matched previously saved transaction authorizeOptions state"),await B(this,K,"f").call(this,s,e)):(console.log("redirected state (from queryVars) did NOT match previously saved transaction authorizeOptions state"),B(this,M,"f").call(this,{message:"State un-matched"}),!1)}if(t[i.OAuth2ParameterType.ERROR]){const e=t;return e.error,e.error_description,B(this,M,"f").call(this,{message:"State un-matched"}),!1}return B(this,M,"f").call(this,{message:"State un-matched"}),!1})),H.set(this,(async e=>{console.log("#GetTokenFromBroker"),B(this,I,"f").remove(B(this,N,"f"));const t=`${process.env.BROKER_ENDPOINT}:${process.env.BROKER_PORT}${process.env.BROKER_API_ROOT}/token`;console.log(`#GetTokenFromBroker:url = [${t}]`),console.log(e);try{const s=await a()({method:"post",url:t,data:e,withCredentials:!0,timeout:parseInt(process.env.TIMEOUT)});if(console.log(`retVal: ${JSON.stringify(s)}`),s.status===_.W.OK){console.log("Storing tokens...");const e=s.data;return B(this,U,"f").call(this,e.id_token),B(this,I,"f").set(B(this,N,"f"),e),!0}return s.status===_.W.UNAUTHORIZED?(console.log("NOT Storing tokens..."),console.log(s.status),B(this,U,"f").call(this,null),s.data,!1):(console.log("NOT Storing tokens..."),console.log(s.status),B(this,U,"f").call(this,null),console.log("Could not obtain access_token from token end-point:-"),console.log(JSON.stringify(s.data)),!1)}catch(e){return B(this,U,"f").call(this,null),console.log(e),console.log(JSON.stringify(e)),!1}})),K.set(this,(async(e,t)=>{console.log("#GetToken"),console.log(t),B(this,I,"f").set(B(this,N,"f"),null);const s={client_id:process.env.CLIENT_ID,scope:process.env.SCOPE,code:t.code,redirect_uri:process.env.REDIRECT_URI,grant_type:v.AUTHORIZATION_CODE,code_verifier:e.code_verifier};return B(this,H,"f").call(this,s)})),x.set(this,(async()=>{console.log("RefreshToken");const e=B(this,I,"f").get(B(this,N,"f"));if(e){const t={client_id:process.env.CLIENT_ID,scope:process.env.SCOPE,refresh_token:e.refresh_token,grant_type:v.REFRESH_TOKEN};return B(this,H,"f").call(this,t)}return!1})),J.set(this,(async()=>{console.log("Logout");const e=`${process.env.BROKER_ENDPOINT}:${process.env.BROKER_PORT}${process.env.BROKER_API_ROOT}/logout`;console.log(e);const t=B(this,I,"f").get(B(this,N,"f")).refresh_token;console.log(t);const s=(0,h.Z)(t);console.log(s);const o=s.sts_session;console.log(o),B(this,I,"f").remove(B(this,N,"f")),B(this,U,"f").call(this,null);try{const t=await a()({method:"post",url:e,data:{sessionId:o},withCredentials:!0,timeout:parseInt(process.env.TIMEOUT)});return t.data.status===_.W.OK||(console.log("Error during logout (server side)"),console.log(JSON.stringify(t.data)),!1)}catch(e){return console.log("Error during logout (server side)"),console.log(e),console.log(JSON.stringify(e)),!1}})),j(this,I,new R({clientStorageType:g.MEMORY_STORAGE}).GetStorage(),"f"),j(this,U,(e=>{const t={messageId:-1,command:S.AUTHENTICATE_EVENT};B(this,D,"f").call(this,t,e)}),"f"),j(this,M,(e=>{const t={messageId:-1,command:S.ERROR};B(this,D,"f").call(this,t,e)}),"f"),j(this,b,e,"f"),this.SetupListener()}}I=new WeakMap,k=new WeakMap,C=new WeakMap,A=new WeakMap,N=new WeakMap,P=new WeakMap,M=new WeakMap,U=new WeakMap,b=new WeakMap,$=new WeakMap,D=new WeakMap,L=new WeakMap,W=new WeakMap,G=new WeakMap,H=new WeakMap,K=new WeakMap,x=new WeakMap,J=new WeakMap;let Q=null;onmessage=async function(e){const t=e.data;Q=new z(t)}}},o={};function r(e){var t=o[e];if(void 0!==t)return t.exports;var n=o[e]={exports:{}};return s[e].call(n.exports,n,n.exports,r),n.exports}r.m=s,r.x=()=>{var e=r.O(void 0,[311],(()=>r(9384)));return r.O(e)},e=[],r.O=(t,s,o,n)=>{if(!s){var a=1/0;for(h=0;h<e.length;h++){for(var[s,o,n]=e[h],i=!0,c=0;c<s.length;c++)(!1&n||a>=n)&&Object.keys(r.O).every((e=>r.O[e](s[c])))?s.splice(c--,1):(i=!1,n<a&&(a=n));if(i){e.splice(h--,1);var l=o();void 0!==l&&(t=l)}}return t}n=n||0;for(var h=e.length;h>0&&e[h-1][2]>n;h--)e[h]=e[h-1];e[h]=[s,o,n]},r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var s in t)r.o(t,s)&&!r.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce(((t,s)=>(r.f[s](e,t),t)),[])),r.u=e=>e+".index.js",r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e;r.g.importScripts&&(e=r.g.location+"");var t=r.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var s=t.getElementsByTagName("script");s.length&&(e=s[s.length-1].src)}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),r.p=e})(),(()=>{var e={384:1};r.f.i=(t,s)=>{e[t]||importScripts(r.p+r.u(t))};var t=self.webpackChunkstsoauth2plugin=self.webpackChunkstsoauth2plugin||[],s=t.push.bind(t);t.push=t=>{var[o,n,a]=t;for(var i in n)r.o(n,i)&&(r.m[i]=n[i]);for(a&&a(r);o.length;)e[o.pop()]=1;s(t)}})(),t=r.x,r.x=()=>r.e(311).then(t);var n=r.x();stsoauth2plugin=n})();
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("stsoauth2plugin",[],t):"object"==typeof exports?exports.stsoauth2plugin=t():e.stsoauth2plugin=t()}(self,(()=>(()=>{"use strict";var e,t,s={9384:(e,t,s)=>{var o=s(1227),r=s.n(o),n=s(9669),a=s.n(n),i=s(7557);var c,l,h=s(6245),u=s(6378),p=function(e,t,s,o){if("a"===s&&!o)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===s?o:"a"===s?o.call(e):o?o.value:t.get(e)},f=function(e,t,s,o,r){if("m"===o)throw new TypeError("Private method is not writable");if("a"===o&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===o?r.call(e,s):r?r.value=s:t.set(e,s),s};const d=r()(`proc:${process.pid}:storage.ts`);var g;!function(e){e.LOCAL_STORAGE="LocalStorage",e.SESSION_STORAGE="SessionStorage",e.COOKIE_STORAGE="CookieStorage",e.MEMORY_STORAGE="MemoryStorage"}(g||(g={}));class m{constructor(){this.get=e=>{const t=u.get(e);return t?JSON.parse(t):null},this.set=(e,t,s={})=>{let o={};"https:"===window.location.protocol&&(o={secure:!0,sameSite:"none"}),s&&s.daysUntilExpire?o.expires=s.daysUntilExpire:o.expires=1,d(`CookieStorage.set: key: ${e}, value: [${t}]`),u.set(e,JSON.stringify(t),o)},this.remove=e=>{u.remove(e)}}}class O{constructor(){this.get=e=>{const t=sessionStorage.getItem(e);return null==t?null:JSON.parse(t)},this.set=(e,t)=>{d(`SessionStorage.set: key: ${e}, value: [${t}]`),sessionStorage.setItem(e,JSON.stringify(t))},this.remove=e=>{sessionStorage.removeItem(e)}}}class E{constructor(){this.get=e=>{const t=localStorage.getItem(e);return null==t?null:JSON.parse(t)},this.set=(e,t)=>{d(`LocalStorage.set: key: ${e}, value: [${t}]`),localStorage.setItem(e,JSON.stringify(t))},this.remove=e=>{localStorage.removeItem(e)}}}class y{constructor(){c.set(this,{}),this.get=e=>{const t=p(this,c,"f")[e];return null==t?null:t},this.set=(e,t)=>{d(`MemoryStorage.set: key: ${e}, value: [${t}]`),p(this,c,"f")[e]=t},this.remove=e=>{delete p(this,c,"f")[e]}}}c=new WeakMap;class w{constructor(e){switch(l.set(this,null),e.clientStorageType){case g.SESSION_STORAGE:f(this,l,new O,"f");break;case g.LOCAL_STORAGE:f(this,l,new E,"f");break;case g.COOKIE_STORAGE:f(this,l,new m,"f");break;case g.MEMORY_STORAGE:f(this,l,new y,"f");break;default:throw new Error(`Unknown [${e.clientStorageType}] storage type.`)}}GetStorage(){return p(this,l,"f")}}l=new WeakMap;var R,T,S,v,_=s(6647);!function(e){e.CODE="code",e.ID_TOKEN="id_token",e.TOKEN="token"}(R||(R={})),function(e){e.QUERY="query",e.FRAGMENT="fragment",e.FORM_POST="form_post"}(T||(T={})),function(e){e.CLIENT_CREDENTIALS="client_credentials",e.AUTHORIZATION_CODE="authorization_code",e.REFRESH_TOKEN="refresh_token"}(S||(S={})),function(e){e.RESTORE_SESSION="RestoreSession",e.AUTHORIZE="Authorize",e.HANDLE_REDIRECT="HandleRedirect",e.LOGOUT="Logout",e.AUTHENTICATE_EVENT="AuthenticateEvent",e.ERROR="Error"}(v||(v={}));var I,k,C,A,N,b,P,M,U,$,D,L,W,x,G,j,H,K,J=function(e,t,s,o,r){if("m"===o)throw new TypeError("Private method is not writable");if("a"===o&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===o?r.call(e,s):r?r.value=s:t.set(e,s),s},B=function(e,t,s,o){if("a"===s&&!o)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===s?o:"a"===s?o.call(e):o?o.value:t.get(e)};r()(`proc:${process.pid}:stsoauth2worker.ts`);class z{constructor(e){I.set(this,null),k.set(this,new class{constructor(){this.DigestMessage=async function(e){const t=(new TextEncoder).encode(e),s=await crypto.subtle.digest("SHA-256",t),o=Array.from(new Uint8Array(s));return btoa(String.fromCharCode(...o))},this.CreateRandomString=(e=43)=>{const t=Array.from(crypto.getRandomValues(new Uint8Array(e)));return btoa(String.fromCharCode(...t))},this.CreateRandomStringEx=()=>{const e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_~.";let t="";return Array.from(crypto.getRandomValues(new Uint8Array(43))).forEach((s=>t+=e[s%e.length])),t}}}),C.set(this,new class{constructor(){this.DecodeQueryParams=e=>{const t={};return Object.keys(e).filter((t=>void 0!==e[t])).map((s=>{t[decodeURIComponent(s)]=decodeURIComponent(e[s])})),t},this.CreateQueryParams=e=>Object.keys(e).filter((t=>void 0!==e[t])).map((t=>Array.isArray(e[t])?encodeURIComponent(t)+"="+encodeURIComponent(e[t].join(" ")):encodeURIComponent(t)+"="+encodeURIComponent(e[t]))).join("&"),this._GetQueryParams=e=>{let t={};const s=e.split("?");if(2==s.length){const e=s[1].split("&"),o={};let r="";e.forEach((function(e){r=e.split("="),2==r.length&&(o[r[0]]=r[1])})),t=this.DecodeQueryParams(o)}return t},this.GetQueryParams=()=>this._GetQueryParams(window.location.href)}}),A.set(this,"authorize_options.stsmda.com.au"),N.set(this,"session.stsmda.com.au"),b.set(this,null),P.set(this,null),M.set(this,null),U.set(this,null),$.set(this,0),this.SetupListener=()=>{B(this,U,"f").onmessage=async e=>{const t=e.data;switch(t.command){case v.RESTORE_SESSION:B(this,D,"f").call(this,t,await B(this,L,"f").call(this));break;case v.AUTHORIZE:B(this,D,"f").call(this,t,await B(this,W,"f").call(this));break;case v.HANDLE_REDIRECT:B(this,D,"f").call(this,t,await B(this,x,"f").call(this,t.payload));break;case v.LOGOUT:B(this,D,"f").call(this,t,await B(this,K,"f").call(this));break;default:throw new Error(`Command: [${t.command}'] not found.`)}}},D.set(this,(async(e,t)=>{const s={messageId:e.messageId,command:e.command,payload:t};B(this,U,"f").postMessage(s)})),L.set(this,(async()=>{let e=null;if(e=B(this,I,"f").get(B(this,N,"f")),null!==e)console.log("Session restored from client storage."),B(this,b,"f")&&B(this,b,"f").UpdateInstrument("m",{LogMessage:"Session restored from client storage."});else{const t=`${process.env.BROKER_ENDPOINT}:${process.env.BROKER_PORT}${process.env.BROKER_API_ROOT}/session`;console.log("RestoreSession"),console.log(t),B(this,b,"f")&&(B(this,b,"f").UpdateInstrument("m",{LogMessage:"RestoreSession"}),B(this,b,"f").UpdateInstrument("m",{LogMessage:t}));try{const s=await a()({method:"post",url:t,data:{[i.OAuth2ParameterType.CLIENT_ID]:process.env.CLIENT_ID,[i.OAuth2ParameterType.SCOPE]:process.env.SCOPE,[i.OAuth2ParameterType.REDIRECT_URI]:process.env.REDIRECT_URI,[i.OAuth2ParameterType.AUDIENCE]:process.env.AUDIENCE},withCredentials:!0,timeout:parseInt(process.env.TIMEOUT)});s.data.status===_.W.OK?(e=s.data.detail,B(this,I,"f").set(B(this,N,"f"),e),console.log("Session restored from server side cookie.")):(console.log("Could not restore previous session:-"),console.log(JSON.stringify(s.data)))}catch(e){console.log("Could not restore previous session (error state):-"),console.log(e),console.log(JSON.stringify(e))}}return null!==e?(B(this,M,"f").call(this,e.id_token),console.log("Refreshing tokens ..."),B(this,H,"f").call(this)):(B(this,M,"f").call(this,null),!1)})),W.set(this,(async()=>{console.log("Authorize ...");const e=process.env.CLIENT_ID,t=B(this,k,"f").CreateRandomString(),s=[R.CODE],o=process.env.REDIRECT_URI,r=T.QUERY,n=process.env.SCOPE,a=B(this,k,"f").CreateRandomString(),i=B(this,k,"f").CreateRandomString(),c={client_id:e,nonce:t,response_type:s,redirect_uri:o,response_mode:r,scope:n,state:a,code_challenge:await B(this,k,"f").DigestMessage(i),code_challenge_method:"S256"},l=`${process.env.AUTH_ENDPOINT}:${process.env.AUTH_PORT}${process.env.AUTH_APIROOT}?${B(this,C,"f").CreateQueryParams(c)}`;return console.log(l),c.code_verifier=i,console.log(`Authorize:authorizeOptions: [${JSON.stringify(c)}]`),{url:l,authorizeOptions:c}})),x.set(this,(async e=>{const t=e.queryVars,s=e.authorizeOptions;if(console.log("HandleRedirect"),console.log(`HandleRedirect:Query Vars: [${JSON.stringify(t)}]`),t[i.OAuth2ParameterType.CODE]){const e=t;console.log(`authorizeOptions from transaction state: [${JSON.stringify(s)}]`);const o=e.state;return 0===s.state.localeCompare(o)?(console.log("redirected state (from queryVars) matched previously saved transaction authorizeOptions state"),await B(this,j,"f").call(this,s,e)):(console.log("redirected state (from queryVars) did NOT match previously saved transaction authorizeOptions state"),B(this,P,"f").call(this,{message:"State un-matched"}),!1)}if(t[i.OAuth2ParameterType.ERROR]){const e=t;return e.error,e.error_description,B(this,P,"f").call(this,{message:"State un-matched"}),!1}return B(this,P,"f").call(this,{message:"State un-matched"}),!1})),G.set(this,(async e=>{console.log("#GetTokenFromBroker"),B(this,I,"f").remove(B(this,N,"f"));const t=`${process.env.BROKER_ENDPOINT}:${process.env.BROKER_PORT}${process.env.BROKER_API_ROOT}/token`;console.log(`#GetTokenFromBroker:url = [${t}]`),console.log(e);try{const s=await a()({method:"post",url:t,data:e,withCredentials:!0,timeout:parseInt(process.env.TIMEOUT)});if(console.log(`retVal: ${JSON.stringify(s)}`),s.status===_.W.OK){console.log("Storing tokens...");const e=s.data;return B(this,M,"f").call(this,e.id_token),B(this,I,"f").set(B(this,N,"f"),e),!0}return s.status===_.W.UNAUTHORIZED?(console.log("NOT Storing tokens..."),console.log(s.status),B(this,M,"f").call(this,null),s.data,!1):(console.log("NOT Storing tokens..."),console.log(s.status),B(this,M,"f").call(this,null),console.log("Could not obtain access_token from token end-point:-"),console.log(JSON.stringify(s.data)),!1)}catch(e){return B(this,M,"f").call(this,null),console.log(e),console.log(JSON.stringify(e)),!1}})),j.set(this,(async(e,t)=>{console.log("#GetToken"),console.log(t),B(this,I,"f").set(B(this,N,"f"),null);const s={client_id:process.env.CLIENT_ID,scope:process.env.SCOPE,code:t.code,redirect_uri:process.env.REDIRECT_URI,grant_type:S.AUTHORIZATION_CODE,code_verifier:e.code_verifier};return B(this,G,"f").call(this,s)})),H.set(this,(async()=>{console.log("RefreshToken");const e=B(this,I,"f").get(B(this,N,"f"));if(e){const t={client_id:process.env.CLIENT_ID,scope:process.env.SCOPE,refresh_token:e.refresh_token,grant_type:S.REFRESH_TOKEN};return B(this,G,"f").call(this,t)}return!1})),K.set(this,(async()=>{console.log("Logout");const e=`${process.env.BROKER_ENDPOINT}:${process.env.BROKER_PORT}${process.env.BROKER_API_ROOT}/logout`;console.log(e);const t=B(this,I,"f").get(B(this,N,"f")).refresh_token;console.log(t);const s=(0,h.Z)(t);console.log(s);const o=s.sts_session;console.log(o),B(this,I,"f").remove(B(this,N,"f")),B(this,M,"f").call(this,null);try{const t=await a()({method:"post",url:e,data:{sessionId:o},withCredentials:!0,timeout:parseInt(process.env.TIMEOUT)});return t.data.status===_.W.OK||(console.log("Error during logout (server side)"),console.log(JSON.stringify(t.data)),!1)}catch(e){return console.log("Error during logout (server side)"),console.log(e),console.log(JSON.stringify(e)),!1}})),J(this,I,new w({clientStorageType:g.MEMORY_STORAGE}).GetStorage(),"f"),J(this,M,(e=>{const t={messageId:-1,command:v.AUTHENTICATE_EVENT};B(this,D,"f").call(this,t,e)}),"f"),J(this,P,(e=>{const t={messageId:-1,command:v.ERROR};B(this,D,"f").call(this,t,e)}),"f"),J(this,U,e,"f"),this.SetupListener()}}I=new WeakMap,k=new WeakMap,C=new WeakMap,A=new WeakMap,N=new WeakMap,b=new WeakMap,P=new WeakMap,M=new WeakMap,U=new WeakMap,$=new WeakMap,D=new WeakMap,L=new WeakMap,W=new WeakMap,x=new WeakMap,G=new WeakMap,j=new WeakMap,H=new WeakMap,K=new WeakMap;let Q=null;onmessage=async function(e){const t=e.data;Q=new z(t)}}},o={};function r(e){var t=o[e];if(void 0!==t)return t.exports;var n=o[e]={exports:{}};return s[e].call(n.exports,n,n.exports,r),n.exports}return r.m=s,r.x=()=>{var e=r.O(void 0,[311],(()=>r(9384)));return r.O(e)},e=[],r.O=(t,s,o,n)=>{if(!s){var a=1/0;for(h=0;h<e.length;h++){for(var[s,o,n]=e[h],i=!0,c=0;c<s.length;c++)(!1&n||a>=n)&&Object.keys(r.O).every((e=>r.O[e](s[c])))?s.splice(c--,1):(i=!1,n<a&&(a=n));if(i){e.splice(h--,1);var l=o();void 0!==l&&(t=l)}}return t}n=n||0;for(var h=e.length;h>0&&e[h-1][2]>n;h--)e[h]=e[h-1];e[h]=[s,o,n]},r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var s in t)r.o(t,s)&&!r.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce(((t,s)=>(r.f[s](e,t),t)),[])),r.u=e=>e+".index.js",r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e;r.g.importScripts&&(e=r.g.location+"");var t=r.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var s=t.getElementsByTagName("script");s.length&&(e=s[s.length-1].src)}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),r.p=e})(),(()=>{var e={384:1};r.f.i=(t,s)=>{e[t]||importScripts(r.p+r.u(t))};var t=self.webpackChunkstsoauth2plugin=self.webpackChunkstsoauth2plugin||[],s=t.push.bind(t);t.push=t=>{var[o,n,a]=t;for(var i in n)r.o(n,i)&&(r.m[i]=n[i]);for(a&&a(r);o.length;)e[o.pop()]=1;s(t)}})(),t=r.x,r.x=()=>r.e(311).then(t),r.x()})()));
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*! For license information please see index.js.LICENSE.txt */
|
|
2
|
-
var stsoauth2plugin;(()=>{var e={2266:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GetErrorPayload=void 0,t.GetErrorPayload=function(e,t=null){return{error:e.code,error_description:e.description,timestamp:Date.now(),details:t}}},7557:function(e,t,r){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,r,s){void 0===s&&(s=r);var n=Object.getOwnPropertyDescriptor(t,r);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,s,n)}:function(e,t,r,s){void 0===s&&(s=r),e[s]=t[r]}),n=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||s(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.$stsgdf=t.$stsgd=void 0,n(r(2266),t),n(r(2226),t),n(r(5514),t),n(r(6322),t),n(r(8415),t),t.$stsgd={},t.$stsgdf=function(){return t.$stsgd}},8415:(e,t)=>{"use strict";var r,s,n;Object.defineProperty(t,"__esModule",{value:!0}),t.compareParameterTypes=t.OAuth2ParameterErrorType=t.OIDCAddressClaim=t.OIDCStandardClaim=t.OAuth2ParameterType=void 0,(n=t.OAuth2ParameterType||(t.OAuth2ParameterType={})).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",(s=t.OIDCStandardClaim||(t.OIDCStandardClaim={})).SUB="sub",s.NAME="name",s.GIVEN_NAME="given_name",s.FAMILY_NAME="family_name",s.MIDDLE_NAME="middle_name",s.NICKNAME="nickname",s.PREFERRED_USERNAME="preferred_username",s.PROFILE="profile",s.PICTURE="picture",s.WEBSITE="website",s.EMAIL="email",s.EMAIL_VERIFIED="email_verified",s.GENDER="gender",s.BIRTHDATE="birthdate",s.ZONEINFO="zoneinfo",s.LOCALE="locale",s.PHONE_NUMBER="phone_number",s.PHONE_NUMBER_VERIFIED="phone_number_verified",s.ADDRESS="address",s.CLIENT_SECRET="client_secret",s.NONCE="nonce",(r=t.OIDCAddressClaim||(t.OIDCAddressClaim={})).FORMATTED="formatted",r.STREET_ADDRESS="street_address",r.LOCALITY="locality",r.REGION="region",r.COUNTRY="country";class o{static NOT_EQUAL={code:"STS_OAUTH2_ERR_0001",description:"Parameter values not equal."};static NOT_PRESENT={code:"STS_OAUTH2_ERR_0002",description:"Parameter not provided."};static INVALID_FORMAT={code:"STS_OAUTH2_ERR_0003",description:"Parameter value format invalid."};static EXPIRED={code:"STS_OAUTH2_ERR_0004",description:"Parameter value expired."}}t.OAuth2ParameterErrorType=o,t.compareParameterTypes=function(e,t,r){const s=[];for(let n=0;n<r.length;n++){const a=r[n];if(0!==e[n].localeCompare(t[n])){const e={error:o.NOT_EQUAL.code,error_description:o.NOT_EQUAL.description,timestamp:Date.now(),details:`${o.NOT_EQUAL.description}: Parameter: [${a}]`};s.push(e)}}return s}},5514:(e,t)=>{"use strict";async function r(e=1e3){return new Promise((t=>setTimeout(t,e)))}Object.defineProperty(t,"__esModule",{value:!0}),t.JestSleep=t.Sleep=void 0,t.Sleep=r,t.JestSleep=async function(){return r(100)}},2226:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.STSOptionsBase=void 0;const s=r(6322);t.STSOptionsBase=class{_options;constructor(e=null){this._options=e,null!==e&&(void 0===e.validator||(0,s.Validate)(e.validator,e))}get options(){return this._options}}},6322:function(e,t,r){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Validate=t.AddSchema=void 0;const n=new(s(r(4179)).default);t.AddSchema=function(e,t){n.addSchema(t,e)},t.Validate=function(e,t){const r=n.getSchema(e);if(r)return((e,t)=>e(t)?null:e.errors)(r,t)}},6114:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.regexpCode=t.getEsmExportName=t.getProperty=t.safeStringify=t.stringify=t.strConcat=t.addCodeArg=t.str=t._=t.nil=t._Code=t.Name=t.IDENTIFIER=t._CodeOrName=void 0;class r{}t._CodeOrName=r,t.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class s extends r{constructor(e){if(super(),!t.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}t.Name=s;class n extends r{constructor(e){super(),this._items="string"==typeof e?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const e=this._items[0];return""===e||'""'===e}get str(){var e;return null!==(e=this._str)&&void 0!==e?e:this._str=this._items.reduce(((e,t)=>`${e}${t}`),"")}get names(){var e;return null!==(e=this._names)&&void 0!==e?e:this._names=this._items.reduce(((e,t)=>(t instanceof s&&(e[t.str]=(e[t.str]||0)+1),e)),{})}}function o(e,...t){const r=[e[0]];let s=0;for(;s<t.length;)c(r,t[s]),r.push(e[++s]);return new n(r)}t._Code=n,t.nil=new n(""),t._=o;const a=new n("+");function i(e,...t){const r=[u(e[0])];let s=0;for(;s<t.length;)r.push(a),c(r,t[s]),r.push(a,u(e[++s]));return function(e){let t=1;for(;t<e.length-1;){if(e[t]===a){const r=l(e[t-1],e[t+1]);if(void 0!==r){e.splice(t-1,3,r);continue}e[t++]="+"}t++}}(r),new n(r)}function c(e,t){var r;t instanceof n?e.push(...t._items):t instanceof s?e.push(t):e.push("number"==typeof(r=t)||"boolean"==typeof r||null===r?r:u(Array.isArray(r)?r.join(","):r))}function l(e,t){if('""'===t)return e;if('""'===e)return t;if("string"==typeof e){if(t instanceof s||'"'!==e[e.length-1])return;return"string"!=typeof t?`${e.slice(0,-1)}${t}"`:'"'===t[0]?e.slice(0,-1)+t.slice(1):void 0}return"string"!=typeof t||'"'!==t[0]||e instanceof s?void 0:`"${e}${t.slice(1)}`}function u(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}t.str=i,t.addCodeArg=c,t.strConcat=function(e,t){return t.emptyStr()?e:e.emptyStr()?t:i`${e}${t}`},t.stringify=function(e){return new n(u(e))},t.safeStringify=u,t.getProperty=function(e){return"string"==typeof e&&t.IDENTIFIER.test(e)?new n(`.${e}`):o`[${e}]`},t.getEsmExportName=function(e){if("string"==typeof e&&t.IDENTIFIER.test(e))return new n(`${e}`);throw new Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)},t.regexpCode=function(e){return new n(e.toString())}},9411:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.or=t.and=t.not=t.CodeGen=t.operators=t.varKinds=t.ValueScopeName=t.ValueScope=t.Scope=t.Name=t.regexpCode=t.stringify=t.getProperty=t.nil=t.strConcat=t.str=t._=void 0;const s=r(6114),n=r(941);var o=r(6114);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return o._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return o.str}}),Object.defineProperty(t,"strConcat",{enumerable:!0,get:function(){return o.strConcat}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return o.nil}}),Object.defineProperty(t,"getProperty",{enumerable:!0,get:function(){return o.getProperty}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return o.stringify}}),Object.defineProperty(t,"regexpCode",{enumerable:!0,get:function(){return o.regexpCode}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return o.Name}});var a=r(941);Object.defineProperty(t,"Scope",{enumerable:!0,get:function(){return a.Scope}}),Object.defineProperty(t,"ValueScope",{enumerable:!0,get:function(){return a.ValueScope}}),Object.defineProperty(t,"ValueScopeName",{enumerable:!0,get:function(){return a.ValueScopeName}}),Object.defineProperty(t,"varKinds",{enumerable:!0,get:function(){return a.varKinds}}),t.operators={GT:new s._Code(">"),GTE:new s._Code(">="),LT:new s._Code("<"),LTE:new s._Code("<="),EQ:new s._Code("==="),NEQ:new s._Code("!=="),NOT:new s._Code("!"),OR:new s._Code("||"),AND:new s._Code("&&"),ADD:new s._Code("+")};class i{optimizeNodes(){return this}optimizeNames(e,t){return this}}class c extends i{constructor(e,t,r){super(),this.varKind=e,this.name=t,this.rhs=r}render({es5:e,_n:t}){const r=e?n.varKinds.var:this.varKind,s=void 0===this.rhs?"":` = ${this.rhs}`;return`${r} ${this.name}${s};`+t}optimizeNames(e,t){if(e[this.name.str])return this.rhs&&(this.rhs=k(this.rhs,e,t)),this}get names(){return this.rhs instanceof s._CodeOrName?this.rhs.names:{}}}class l extends i{constructor(e,t,r){super(),this.lhs=e,this.rhs=t,this.sideEffects=r}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,t){if(!(this.lhs instanceof s.Name)||e[this.lhs.str]||this.sideEffects)return this.rhs=k(this.rhs,e,t),this}get names(){return j(this.lhs instanceof s.Name?{}:{...this.lhs.names},this.rhs)}}class u extends l{constructor(e,t,r,s){super(e,r,s),this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class d extends i{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class f extends i{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}}class h extends i{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class p extends i{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,t){return this.code=k(this.code,e,t),this}get names(){return this.code instanceof s._CodeOrName?this.code.names:{}}}class m extends i{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce(((t,r)=>t+r.render(e)),"")}optimizeNodes(){const{nodes:e}=this;let t=e.length;for(;t--;){const r=e[t].optimizeNodes();Array.isArray(r)?e.splice(t,1,...r):r?e[t]=r:e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){const{nodes:r}=this;let s=r.length;for(;s--;){const n=r[s];n.optimizeNames(e,t)||(T(e,n.names),r.splice(s,1))}return r.length>0?this:void 0}get names(){return this.nodes.reduce(((e,t)=>R(e,t.names)),{})}}class g extends m{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class y extends m{}class v extends g{}v.kind="else";class _ extends g{constructor(e,t){super(t),this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);return this.else&&(t+="else "+this.else.render(e)),t}optimizeNodes(){super.optimizeNodes();const e=this.condition;if(!0===e)return this.nodes;let t=this.else;if(t){const e=t.optimizeNodes();t=this.else=Array.isArray(e)?new v(e):e}return t?!1===e?t instanceof _?t:t.nodes:this.nodes.length?this:new _(I(e),t instanceof _?[t]:t.nodes):!1!==e&&this.nodes.length?this:void 0}optimizeNames(e,t){var r;if(this.else=null===(r=this.else)||void 0===r?void 0:r.optimizeNames(e,t),super.optimizeNames(e,t)||this.else)return this.condition=k(this.condition,e,t),this}get names(){const e=super.names;return j(e,this.condition),this.else&&R(e,this.else.names),e}}_.kind="if";class $ extends g{}$.kind="for";class w extends ${constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iteration=k(this.iteration,e,t),this}get names(){return R(super.names,this.iteration.names)}}class E extends ${constructor(e,t,r,s){super(),this.varKind=e,this.name=t,this.from=r,this.to=s}render(e){const t=e.es5?n.varKinds.var:this.varKind,{name:r,from:s,to:o}=this;return`for(${t} ${r}=${s}; ${r}<${o}; ${r}++)`+super.render(e)}get names(){const e=j(super.names,this.from);return j(e,this.to)}}class b extends ${constructor(e,t,r,s){super(),this.loop=e,this.varKind=t,this.name=r,this.iterable=s}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iterable=k(this.iterable,e,t),this}get names(){return R(super.names,this.iterable.names)}}class S extends g{constructor(e,t,r){super(),this.name=e,this.args=t,this.async=r}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}}S.kind="func";class P extends m{render(e){return"return "+super.render(e)}}P.kind="return";class C extends g{render(e){let t="try"+super.render(e);return this.catch&&(t+=this.catch.render(e)),this.finally&&(t+=this.finally.render(e)),t}optimizeNodes(){var e,t;return super.optimizeNodes(),null===(e=this.catch)||void 0===e||e.optimizeNodes(),null===(t=this.finally)||void 0===t||t.optimizeNodes(),this}optimizeNames(e,t){var r,s;return super.optimizeNames(e,t),null===(r=this.catch)||void 0===r||r.optimizeNames(e,t),null===(s=this.finally)||void 0===s||s.optimizeNames(e,t),this}get names(){const e=super.names;return this.catch&&R(e,this.catch.names),this.finally&&R(e,this.finally.names),e}}class N extends g{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}N.kind="catch";class O extends g{render(e){return"finally"+super.render(e)}}function R(e,t){for(const r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function j(e,t){return t instanceof s._CodeOrName?R(e,t.names):e}function k(e,t,r){return e instanceof s.Name?o(e):(n=e)instanceof s._Code&&n._items.some((e=>e instanceof s.Name&&1===t[e.str]&&void 0!==r[e.str]))?new s._Code(e._items.reduce(((e,t)=>(t instanceof s.Name&&(t=o(t)),t instanceof s._Code?e.push(...t._items):e.push(t),e)),[])):e;var n;function o(e){const s=r[e.str];return void 0===s||1!==t[e.str]?e:(delete t[e.str],s)}}function T(e,t){for(const r in t)e[r]=(e[r]||0)-(t[r]||0)}function I(e){return"boolean"==typeof e||"number"==typeof e||null===e?!e:s._`!${M(e)}`}O.kind="finally",t.CodeGen=class{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?"\n":""},this._extScope=e,this._scope=new n.Scope({parent:e}),this._nodes=[new y]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,t){const r=this._extScope.value(e,t);return(this._values[r.prefix]||(this._values[r.prefix]=new Set)).add(r),r}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,r,s){const n=this._scope.toName(t);return void 0!==r&&s&&(this._constants[n.str]=r),this._leafNode(new c(e,n,r)),n}const(e,t,r){return this._def(n.varKinds.const,e,t,r)}let(e,t,r){return this._def(n.varKinds.let,e,t,r)}var(e,t,r){return this._def(n.varKinds.var,e,t,r)}assign(e,t,r){return this._leafNode(new l(e,t,r))}add(e,r){return this._leafNode(new u(e,t.operators.ADD,r))}code(e){return"function"==typeof e?e():e!==s.nil&&this._leafNode(new p(e)),this}object(...e){const t=["{"];for(const[r,n]of e)t.length>1&&t.push(","),t.push(r),(r!==n||this.opts.es5)&&(t.push(":"),(0,s.addCodeArg)(t,n));return t.push("}"),new s._Code(t)}if(e,t,r){if(this._blockNode(new _(e)),t&&r)this.code(t).else().code(r).endIf();else if(t)this.code(t).endIf();else if(r)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new _(e))}else(){return this._elseNode(new v)}endIf(){return this._endBlockNode(_,v)}_for(e,t){return this._blockNode(e),t&&this.code(t).endFor(),this}for(e,t){return this._for(new w(e),t)}forRange(e,t,r,s,o=(this.opts.es5?n.varKinds.var:n.varKinds.let)){const a=this._scope.toName(e);return this._for(new E(o,a,t,r),(()=>s(a)))}forOf(e,t,r,o=n.varKinds.const){const a=this._scope.toName(e);if(this.opts.es5){const e=t instanceof s.Name?t:this.var("_arr",t);return this.forRange("_i",0,s._`${e}.length`,(t=>{this.var(a,s._`${e}[${t}]`),r(a)}))}return this._for(new b("of",o,a,t),(()=>r(a)))}forIn(e,t,r,o=(this.opts.es5?n.varKinds.var:n.varKinds.const)){if(this.opts.ownProperties)return this.forOf(e,s._`Object.keys(${t})`,r);const a=this._scope.toName(e);return this._for(new b("in",o,a,t),(()=>r(a)))}endFor(){return this._endBlockNode($)}label(e){return this._leafNode(new d(e))}break(e){return this._leafNode(new f(e))}return(e){const t=new P;if(this._blockNode(t),this.code(e),1!==t.nodes.length)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(P)}try(e,t,r){if(!t&&!r)throw new Error('CodeGen: "try" without "catch" and "finally"');const s=new C;if(this._blockNode(s),this.code(e),t){const e=this.name("e");this._currNode=s.catch=new N(e),t(e)}return r&&(this._currNode=s.finally=new O,this.code(r)),this._endBlockNode(N,O)}throw(e){return this._leafNode(new h(e))}block(e,t){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(t),this}endBlock(e){const t=this._blockStarts.pop();if(void 0===t)throw new Error("CodeGen: not in self-balancing block");const r=this._nodes.length-t;if(r<0||void 0!==e&&r!==e)throw new Error(`CodeGen: wrong number of nodes: ${r} vs ${e} expected`);return this._nodes.length=t,this}func(e,t=s.nil,r,n){return this._blockNode(new S(e,t,r)),n&&this.code(n).endFunc(),this}endFunc(){return this._endBlockNode(S)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,t){const r=this._currNode;if(r instanceof e||t&&r instanceof t)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){const t=this._currNode;if(!(t instanceof _))throw new Error('CodeGen: "else" without "if"');return this._currNode=t.else=e,this}get _root(){return this._nodes[0]}get _currNode(){const e=this._nodes;return e[e.length-1]}set _currNode(e){const t=this._nodes;t[t.length-1]=e}},t.not=I;const A=x(t.operators.AND);t.and=function(...e){return e.reduce(A)};const D=x(t.operators.OR);function x(e){return(t,r)=>t===s.nil?r:r===s.nil?t:s._`${M(t)} ${e} ${M(r)}`}function M(e){return e instanceof s.Name?e:s._`(${e})`}t.or=function(...e){return e.reduce(D)}},941:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ValueScope=t.ValueScopeName=t.Scope=t.varKinds=t.UsedValueState=void 0;const s=r(6114);class n extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}}var o;!function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"}(o=t.UsedValueState||(t.UsedValueState={})),t.varKinds={const:new s.Name("const"),let:new s.Name("let"),var:new s.Name("var")};class a{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof s.Name?e:this.name(e)}name(e){return new s.Name(this._newName(e))}_newName(e){return`${e}${(this._names[e]||this._nameGroup(e)).index++}`}_nameGroup(e){var t,r;if((null===(r=null===(t=this._parent)||void 0===t?void 0:t._prefixes)||void 0===r?void 0:r.has(e))||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}}t.Scope=a;class i extends s.Name{constructor(e,t){super(t),this.prefix=e}setValue(e,{property:t,itemIndex:r}){this.value=e,this.scopePath=s._`.${new s.Name(t)}[${r}]`}}t.ValueScopeName=i;const c=s._`\n`;t.ValueScope=class extends a{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?c:s.nil}}get(){return this._scope}name(e){return new i(e,this._newName(e))}value(e,t){var r;if(void 0===t.ref)throw new Error("CodeGen: ref must be passed in value");const s=this.toName(e),{prefix:n}=s,o=null!==(r=t.key)&&void 0!==r?r:t.ref;let a=this._values[n];if(a){const e=a.get(o);if(e)return e}else a=this._values[n]=new Map;a.set(o,s);const i=this._scope[n]||(this._scope[n]=[]),c=i.length;return i[c]=t.ref,s.setValue(t,{property:n,itemIndex:c}),s}getValue(e,t){const r=this._values[e];if(r)return r.get(t)}scopeRefs(e,t=this._values){return this._reduceValues(t,(t=>{if(void 0===t.scopePath)throw new Error(`CodeGen: name "${t}" has no value`);return s._`${e}${t.scopePath}`}))}scopeCode(e=this._values,t,r){return this._reduceValues(e,(e=>{if(void 0===e.value)throw new Error(`CodeGen: name "${e}" has no value`);return e.value.code}),t,r)}_reduceValues(e,r,a={},i){let c=s.nil;for(const l in e){const u=e[l];if(!u)continue;const d=a[l]=a[l]||new Map;u.forEach((e=>{if(d.has(e))return;d.set(e,o.Started);let a=r(e);if(a){const r=this.opts.es5?t.varKinds.var:t.varKinds.const;c=s._`${c}${r} ${e} = ${a};${this.opts._n}`}else{if(!(a=null==i?void 0:i(e)))throw new n(e);c=s._`${c}${a}${this.opts._n}`}d.set(e,o.Completed)}))}return c}}},6782:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.extendErrors=t.resetErrorsCount=t.reportExtraError=t.reportError=t.keyword$DataError=t.keywordError=void 0;const s=r(9411),n=r(2390),o=r(6579);function a(e,t){const r=e.const("err",t);e.if(s._`${o.default.vErrors} === null`,(()=>e.assign(o.default.vErrors,s._`[${r}]`)),s._`${o.default.vErrors}.push(${r})`),e.code(s._`${o.default.errors}++`)}function i(e,t){const{gen:r,validateName:n,schemaEnv:o}=e;o.$async?r.throw(s._`new ${e.ValidationError}(${t})`):(r.assign(s._`${n}.errors`,t),r.return(!1))}t.keywordError={message:({keyword:e})=>s.str`must pass "${e}" keyword validation`},t.keyword$DataError={message:({keyword:e,schemaType:t})=>t?s.str`"${e}" keyword must be ${t} ($data)`:s.str`"${e}" keyword is invalid ($data)`},t.reportError=function(e,r=t.keywordError,n,o){const{it:c}=e,{gen:u,compositeRule:d,allErrors:f}=c,h=l(e,r,n);(null!=o?o:d||f)?a(u,h):i(c,s._`[${h}]`)},t.reportExtraError=function(e,r=t.keywordError,s){const{it:n}=e,{gen:c,compositeRule:u,allErrors:d}=n;a(c,l(e,r,s)),u||d||i(n,o.default.vErrors)},t.resetErrorsCount=function(e,t){e.assign(o.default.errors,t),e.if(s._`${o.default.vErrors} !== null`,(()=>e.if(t,(()=>e.assign(s._`${o.default.vErrors}.length`,t)),(()=>e.assign(o.default.vErrors,null)))))},t.extendErrors=function({gen:e,keyword:t,schemaValue:r,data:n,errsCount:a,it:i}){if(void 0===a)throw new Error("ajv implementation error");const c=e.name("err");e.forRange("i",a,o.default.errors,(a=>{e.const(c,s._`${o.default.vErrors}[${a}]`),e.if(s._`${c}.instancePath === undefined`,(()=>e.assign(s._`${c}.instancePath`,(0,s.strConcat)(o.default.instancePath,i.errorPath)))),e.assign(s._`${c}.schemaPath`,s.str`${i.errSchemaPath}/${t}`),i.opts.verbose&&(e.assign(s._`${c}.schema`,r),e.assign(s._`${c}.data`,n))}))};const c={keyword:new s.Name("keyword"),schemaPath:new s.Name("schemaPath"),params:new s.Name("params"),propertyName:new s.Name("propertyName"),message:new s.Name("message"),schema:new s.Name("schema"),parentSchema:new s.Name("parentSchema")};function l(e,t,r){const{createErrors:n}=e.it;return!1===n?s._`{}`:function(e,t,r={}){const{gen:n,it:a}=e,i=[u(a,r),d(e,r)];return function(e,{params:t,message:r},n){const{keyword:a,data:i,schemaValue:l,it:u}=e,{opts:d,propertyName:f,topSchemaRef:h,schemaPath:p}=u;n.push([c.keyword,a],[c.params,"function"==typeof t?t(e):t||s._`{}`]),d.messages&&n.push([c.message,"function"==typeof r?r(e):r]),d.verbose&&n.push([c.schema,l],[c.parentSchema,s._`${h}${p}`],[o.default.data,i]),f&&n.push([c.propertyName,f])}(e,t,i),n.object(...i)}(e,t,r)}function u({errorPath:e},{instancePath:t}){const r=t?s.str`${e}${(0,n.getErrorPath)(t,n.Type.Str)}`:e;return[o.default.instancePath,(0,s.strConcat)(o.default.instancePath,r)]}function d({keyword:e,it:{errSchemaPath:t}},{schemaPath:r,parentSchema:o}){let a=o?t:s.str`${t}/${e}`;return r&&(a=s.str`${a}${(0,n.getErrorPath)(r,n.Type.Str)}`),[c.schemaPath,a]}},3584:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resolveSchema=t.getCompilingSchema=t.resolveRef=t.compileSchema=t.SchemaEnv=void 0;const s=r(9411),n=r(1205),o=r(6579),a=r(4209),i=r(2390),c=r(9509);class l{constructor(e){var t;let r;this.refs={},this.dynamicAnchors={},"object"==typeof e.schema&&(r=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=null!==(t=e.baseId)&&void 0!==t?t:(0,a.normalizeId)(null==r?void 0:r[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=null==r?void 0:r.$async,this.refs={}}}function u(e){const t=f.call(this,e);if(t)return t;const r=(0,a.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:i,lines:l}=this.opts.code,{ownProperties:u}=this.opts,d=new s.CodeGen(this.scope,{es5:i,lines:l,ownProperties:u});let h;e.$async&&(h=d.scopeValue("Error",{ref:n.default,code:s._`require("ajv/dist/runtime/validation_error").default`}));const p=d.scopeName("validate");e.validateName=p;const m={gen:d,allErrors:this.opts.allErrors,data:o.default.data,parentData:o.default.parentData,parentDataProperty:o.default.parentDataProperty,dataNames:[o.default.data],dataPathArr:[s.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:d.scopeValue("schema",!0===this.opts.code.source?{ref:e.schema,code:(0,s.stringify)(e.schema)}:{ref:e.schema}),validateName:p,ValidationError:h,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:s.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:s._`""`,opts:this.opts,self:this};let g;try{this._compilations.add(e),(0,c.validateFunctionCode)(m),d.optimize(this.opts.code.optimize);const t=d.toString();g=`${d.scopeRefs(o.default.scope)}return ${t}`,this.opts.code.process&&(g=this.opts.code.process(g,e));const r=new Function(`${o.default.self}`,`${o.default.scope}`,g)(this,this.scope.get());if(this.scope.value(p,{ref:r}),r.errors=null,r.schema=e.schema,r.schemaEnv=e,e.$async&&(r.$async=!0),!0===this.opts.code.source&&(r.source={validateName:p,validateCode:t,scopeValues:d._values}),this.opts.unevaluated){const{props:e,items:t}=m;r.evaluated={props:e instanceof s.Name?void 0:e,items:t instanceof s.Name?void 0:t,dynamicProps:e instanceof s.Name,dynamicItems:t instanceof s.Name},r.source&&(r.source.evaluated=(0,s.stringify)(r.evaluated))}return e.validate=r,e}catch(t){throw delete e.validate,delete e.validateName,g&&this.logger.error("Error compiling schema, function code:",g),t}finally{this._compilations.delete(e)}}function d(e){return(0,a.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:u.call(this,e)}function f(e){for(const s of this._compilations)if(r=e,(t=s).schema===r.schema&&t.root===r.root&&t.baseId===r.baseId)return s;var t,r}function h(e,t){let r;for(;"string"==typeof(r=this.refs[t]);)t=r;return r||this.schemas[t]||p.call(this,e,t)}function p(e,t){const r=this.opts.uriResolver.parse(t),s=(0,a._getFullPath)(this.opts.uriResolver,r);let n=(0,a.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&s===n)return g.call(this,r,e);const o=(0,a.normalizeId)(s),i=this.refs[o]||this.schemas[o];if("string"==typeof i){const t=p.call(this,e,i);if("object"!=typeof(null==t?void 0:t.schema))return;return g.call(this,r,t)}if("object"==typeof(null==i?void 0:i.schema)){if(i.validate||u.call(this,i),o===(0,a.normalizeId)(t)){const{schema:t}=i,{schemaId:r}=this.opts,s=t[r];return s&&(n=(0,a.resolveUrl)(this.opts.uriResolver,n,s)),new l({schema:t,schemaId:r,root:e,baseId:n})}return g.call(this,r,i)}}t.SchemaEnv=l,t.compileSchema=u,t.resolveRef=function(e,t,r){var s;r=(0,a.resolveUrl)(this.opts.uriResolver,t,r);const n=e.refs[r];if(n)return n;let o=h.call(this,e,r);if(void 0===o){const n=null===(s=e.localRefs)||void 0===s?void 0:s[r],{schemaId:a}=this.opts;n&&(o=new l({schema:n,schemaId:a,root:e,baseId:t}))}return void 0!==o?e.refs[r]=d.call(this,o):void 0},t.getCompilingSchema=f,t.resolveSchema=p;const m=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function g(e,{baseId:t,schema:r,root:s}){var n;if("/"!==(null===(n=e.fragment)||void 0===n?void 0:n[0]))return;for(const s of e.fragment.slice(1).split("/")){if("boolean"==typeof r)return;const e=r[(0,i.unescapeFragment)(s)];if(void 0===e)return;const n="object"==typeof(r=e)&&r[this.opts.schemaId];!m.has(s)&&n&&(t=(0,a.resolveUrl)(this.opts.uriResolver,t,n))}let o;if("boolean"!=typeof r&&r.$ref&&!(0,i.schemaHasRulesButRef)(r,this.RULES)){const e=(0,a.resolveUrl)(this.opts.uriResolver,t,r.$ref);o=p.call(this,s,e)}const{schemaId:c}=this.opts;return o=o||new l({schema:r,schemaId:c,root:s,baseId:t}),o.schema!==o.root.schema?o:void 0}},9378:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=r(2105),n=r(3584),o=r(9411),a=r(3003),i=r(6579),c=r(2309),l=r(1837),u=r(4394),d=r(3561),f=r(2390),h=r(6596),p={elements:function(e){const{gen:t,schema:r,data:s}=e;k(e,"[");const n=t.let("i",0);t.assign(s,o._`[]`),_(e,"]",(()=>{const a=t.let("el");y({...e,schema:r.elements,data:a}),t.assign(o._`${s}[${n}++]`,a)}))},values:function(e){const{gen:t,schema:r,data:s}=e;k(e,"{"),t.assign(s,o._`{}`),_(e,"}",(()=>function(e,t){const{gen:r}=e,s=r.let("key");P({...e,data:s}),k(e,":"),S(e,s,t)}(e,r.values)))},discriminator:function(e){const{gen:t,data:r,schema:s}=e,{discriminator:n,mapping:a}=s;k(e,"{"),t.assign(r,o._`{}`);const c=t.const("pos",i.default.jsonPos),l=t.let("value"),u=t.let("tag");$(e,"}",(()=>{const s=t.let("key");P({...e,data:s}),k(e,":"),t.if(o._`${s} === ${n}`,(()=>{P({...e,data:u}),t.assign(o._`${r}[${s}]`,u),t.break()}),(()=>O({...e,data:l})))})),t.assign(i.default.jsonPos,c),t.if(o._`${u} === undefined`),x(e,o.str`discriminator tag not found`);for(const r in a)t.elseIf(o._`${u} === ${r}`),E({...e,schema:a[r]},n);t.else(),x(e,o.str`discriminator value not in schema`),t.endIf()},properties:w,optionalProperties:w,enum:function(e){const{gen:t,data:r,schema:s}=e,n=s.enum;k(e,'"'),t.if(!1);for(const e of n){const s=JSON.stringify(e).slice(1);t.elseIf(o._`${A(s.length)} === ${s}`),t.assign(r,o.str`${e}`),t.add(i.default.jsonPos,s.length)}t.else(),D(e),t.endIf()},type:function(e){const{gen:t,schema:r,data:s,self:n}=e;switch(r.type){case"boolean":v(e);break;case"string":P(e);break;case"timestamp":{P(e);const r=(0,f.useFunc)(t,h.default),{allowDate:a,parseDate:i}=n.opts,c=a?o._`!${r}(${s}, true)`:o._`!${r}(${s})`,l=i?(0,o.or)(c,o._`(${s} = new Date(${s}), false)`,o._`isNaN(${s}.valueOf())`):c;t.if(l,(()=>x(e,o.str`invalid timestamp`)));break}case"float32":case"float64":C(e);break;default:{const a=r.type;if(n.opts.int32range||"int32"!==a&&"uint32"!==a){const[r,n,i]=u.intRange[a];C(e,i),t.if(o._`${s} < ${r} || ${s} > ${n}`,(()=>x(e,o.str`integer out of range`)))}else C(e,16),"uint32"===a&&t.if(o._`${s} < 0`,(()=>x(e,o.str`integer out of range`)))}}},ref:function(e){const{gen:t,self:r,definitions:s,schema:i,schemaEnv:c}=e,{ref:u}=i,d=s[u];if(!d)throw new a.default(r.opts.uriResolver,"",u,`No definition ${u}`);if(!(0,l.hasRef)(d))return y({...e,schema:d});const{root:f}=c;j(e,function(e,t){return t.parse?e.scopeValue("parse",{ref:t.parse}):o._`${e.scopeValue("wrapper",{ref:t})}.parse`}(t,m.call(r,new n.SchemaEnv({schema:d,root:f}),s)),!0)}};function m(e,t){const r=n.getCompilingSchema.call(this,e);if(r)return r;const{es5:s,lines:a}=this.opts.code,{ownProperties:c}=this.opts,l=new o.CodeGen(this.scope,{es5:s,lines:a,ownProperties:c}),u=l.scopeName("parse"),d={self:this,gen:l,schema:e.schema,schemaEnv:e,definitions:t,data:i.default.data,parseName:u,char:l.name("c")};let f;try{this._compilations.add(e),e.parseName=u,function(e){const{gen:t,parseName:r,char:s}=e;t.func(r,o._`${i.default.json}, ${i.default.jsonPos}, ${i.default.jsonPart}`,!1,(()=>{t.let(i.default.data),t.let(s),t.assign(o._`${r}.message`,g),t.assign(o._`${r}.position`,g),t.assign(i.default.jsonPos,o._`${i.default.jsonPos} || 0`),t.const(i.default.jsonLen,o._`${i.default.json}.length`),y(e),I(e),t.if(i.default.jsonPart,(()=>{t.assign(o._`${r}.position`,i.default.jsonPos),t.return(i.default.data)})),t.if(o._`${i.default.jsonPos} === ${i.default.jsonLen}`,(()=>t.return(i.default.data))),D(e)}))}(d),l.optimize(this.opts.code.optimize);const t=l.toString();f=`${l.scopeRefs(i.default.scope)}return ${t}`;const r=new Function(`${i.default.scope}`,f)(this.scope.get());this.scope.value(u,{ref:r}),e.parse=r}catch(t){throw f&&this.logger.error("Error compiling parser, function code:",f),delete e.parse,delete e.parseName,t}finally{this._compilations.delete(e)}return e}t.default=m;const g=o._`undefined`;function y(e){let t;for(const r of s.jtdForms)if(r in e.schema){t=r;break}t?function(e,t){const{gen:r,schema:s,data:n}=e;if(!s.nullable)return t(e);T(e,"null",t,(()=>r.assign(n,null)))}(e,p[t]):O(e)}const v=N(!0,N(!1,D));function _(e,t,r){$(e,t,r),k(e,t)}function $(e,t,r){const{gen:s}=e;function n(){T(e,t,(()=>{}),D)}s.for(o._`;${i.default.jsonPos}<${i.default.jsonLen} && ${A(1)}!==${t};`,(()=>{r(),T(e,",",(()=>s.break()),n)}))}function w(e){const{gen:t,data:r}=e;k(e,"{"),t.assign(r,o._`{}`),E(e)}function E(e,t){const{gen:r,schema:s,data:n}=e,{properties:a,optionalProperties:i,additionalProperties:l}=s;if(_(e,"}",(()=>{const s=r.let("key");if(P({...e,data:s}),k(e,":"),r.if(!1),b(e,s,a),b(e,s,i),t){r.elseIf(o._`${s} === ${t}`);const n=r.let("tag");P({...e,data:n})}r.else(),l?O({...e,data:o._`${n}[${s}]`}):x(e,o.str`property ${s} not allowed`),r.endIf()})),a){const t=(0,c.hasPropFunc)(r),s=(0,o.and)(...Object.keys(a).map((e=>o._`${t}.call(${n}, ${e})`)));r.if((0,o.not)(s),(()=>x(e,o.str`missing required properties`)))}}function b(e,t,r={}){const{gen:s}=e;for(const n in r)s.elseIf(o._`${t} === ${n}`),S(e,t,r[n])}function S(e,t,r){y({...e,schema:r,data:o._`${e.data}[${t}]`})}function P(e){k(e,'"'),R(e,d.parseJsonString)}function C(e,t){const{gen:r}=e;I(e),r.if(o._`"-0123456789".indexOf(${A(1)}) < 0`,(()=>D(e)),(()=>R(e,d.parseJsonNumber,t)))}function N(e,t){return r=>{const{gen:s,data:n}=r;T(r,`${e}`,(()=>t(r)),(()=>s.assign(n,e)))}}function O(e){R(e,d.parseJson)}function R(e,t,r){j(e,(0,f.useFunc)(e.gen,t),r)}function j(e,t,r){const{gen:s,data:n}=e;s.assign(n,o._`${t}(${i.default.json}, ${i.default.jsonPos}${r?o._`, ${r}`:o.nil})`),s.assign(i.default.jsonPos,o._`${t}.position`),s.if(o._`${n} === undefined`,(()=>x(e,o._`${t}.message`)))}function k(e,t){T(e,t,D)}function T(e,t,r,s){const{gen:n}=e,a=t.length;I(e),n.if(o._`${A(a)} === ${t}`,(()=>{n.add(i.default.jsonPos,a),null==s||s(e)}),(()=>r(e)))}function I({gen:e,char:t}){e.code(o._`while((${t}=${i.default.json}[${i.default.jsonPos}],${t}===" "||${t}==="\\n"||${t}==="\\r"||${t}==="\\t"))${i.default.jsonPos}++;`)}function A(e){return 1===e?o._`${i.default.json}[${i.default.jsonPos}]`:o._`${i.default.json}.slice(${i.default.jsonPos}, ${i.default.jsonPos}+${e})`}function D(e){x(e,o._`"unexpected token " + ${i.default.json}[${i.default.jsonPos}]`)}function x({gen:e,parseName:t},r){e.assign(o._`${t}.message`,r),e.assign(o._`${t}.position`,i.default.jsonPos),e.return(g)}},1509:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=r(2105),n=r(3584),o=r(9411),a=r(3003),i=r(6579),c=r(2309),l=r(1837),u=r(2390),d=r(3456),f={elements:function(e){const{gen:t,schema:r,data:s}=e;t.add(i.default.json,o.str`[`);const n=t.let("first",!0);t.forOf("el",s,(t=>{$(e,n),p({...e,schema:r.elements,data:t})})),t.add(i.default.json,o.str`]`)},values:function(e){const{gen:t,schema:r,data:s}=e;t.add(i.default.json,o.str`{`);const n=t.let("first",!0);t.forIn("key",s,(t=>m(e,t,r.values,n))),t.add(i.default.json,o.str`}`)},discriminator:function(e){const{gen:t,schema:r,data:s}=e,{discriminator:n}=r;t.add(i.default.json,o.str`{${JSON.stringify(n)}:`);const a=t.const("tag",o._`${s}${(0,o.getProperty)(n)}`);v({...e,data:a}),t.if(!1);for(const s in r.mapping){t.elseIf(o._`${a} === ${s}`);const i=r.mapping[s];y({...e,schema:i},n)}t.endIf(),t.add(i.default.json,o.str`}`)},properties:g,optionalProperties:g,enum:v,type:function(e){const{gen:t,schema:r,data:s}=e;switch(r.type){case"boolean":t.add(i.default.json,o._`${s} ? "true" : "false"`);break;case"string":v(e);break;case"timestamp":t.if(o._`${s} instanceof Date`,(()=>t.add(i.default.json,o._`'"' + ${s}.toISOString() + '"'`)),(()=>v(e)));break;default:!function({gen:e,data:t}){e.add(i.default.json,o._`"" + ${t}`)}(e)}},ref:function(e){const{gen:t,self:r,data:s,definitions:c,schema:u,schemaEnv:d}=e,{ref:f}=u,m=c[f];if(!m)throw new a.default(r.opts.uriResolver,"",f,`No definition ${f}`);if(!(0,l.hasRef)(m))return p({...e,schema:m});const{root:g}=d,y=h.call(r,new n.SchemaEnv({schema:m,root:g}),c);t.add(i.default.json,o._`${function(e,t){return t.serialize?e.scopeValue("serialize",{ref:t.serialize}):o._`${e.scopeValue("wrapper",{ref:t})}.serialize`}(t,y)}(${s})`)}};function h(e,t){const r=n.getCompilingSchema.call(this,e);if(r)return r;const{es5:s,lines:a}=this.opts.code,{ownProperties:c}=this.opts,l=new o.CodeGen(this.scope,{es5:s,lines:a,ownProperties:c}),u=l.scopeName("serialize"),d={self:this,gen:l,schema:e.schema,schemaEnv:e,definitions:t,data:i.default.data};let f;try{this._compilations.add(e),e.serializeName=u,l.func(u,i.default.data,!1,(()=>{l.let(i.default.json,o.str``),p(d),l.return(i.default.json)})),l.optimize(this.opts.code.optimize);const t=l.toString();f=`${l.scopeRefs(i.default.scope)}return ${t}`;const r=new Function(`${i.default.scope}`,f)(this.scope.get());this.scope.value(u,{ref:r}),e.serialize=r}catch(t){throw f&&this.logger.error("Error compiling serializer, function code:",f),delete e.serialize,delete e.serializeName,t}finally{this._compilations.delete(e)}return e}function p(e){let t;for(const r of s.jtdForms)if(r in e.schema){t=r;break}!function(e,t){const{gen:r,schema:s,data:n}=e;if(!s.nullable)return t(e);r.if(o._`${n} === undefined || ${n} === null`,(()=>r.add(i.default.json,o._`"null"`)),(()=>t(e)))}(e,t?f[t]:_)}function m(e,t,r,s){const{gen:n,data:a}=e;$(e,s),v({...e,data:t}),n.add(i.default.json,o.str`:`);const c=n.const("value",o._`${a}${(0,o.getProperty)(t)}`);p({...e,schema:r,data:c})}function g(e){const{gen:t}=e;t.add(i.default.json,o.str`{`),y(e),t.add(i.default.json,o.str`}`)}function y(e,t){const{gen:r,schema:s,data:n}=e,{properties:a,optionalProperties:l}=s,u=g(a),d=g(l),f=function(e){if(t&&e.push(t),new Set(e).size!==e.length)throw new Error("JTD: properties/optionalProperties/disciminator overlap");return e}(u.concat(d));let h=!t;for(const e of u)v(e,a[e],y(e));for(const e of d){const t=y(e);r.if((0,o.and)(o._`${t} !== undefined`,(0,c.isOwnProperty)(r,n,e)),(()=>v(e,l[e],t)))}function g(e){return e?Object.keys(e):[]}function y(e){return r.const("value",o._`${n}${(0,o.getProperty)(e)}`)}function v(t,s,n){h?h=!1:r.add(i.default.json,o.str`,`),r.add(i.default.json,o.str`${JSON.stringify(t)}:`),p({...e,schema:s,data:n})}s.additionalProperties&&r.forIn("key",n,(t=>r.if(function(e,t){return!t.length||(0,o.and)(...t.map((t=>o._`${e} !== ${t}`)))}(t,f),(()=>m(e,t,{},r.let("first",h))))))}function v({gen:e,data:t}){e.add(i.default.json,o._`${(0,u.useFunc)(e,d.default)}(${t})`)}function _({gen:e,data:t}){e.add(i.default.json,o._`JSON.stringify(${t})`)}function $({gen:e},t){e.if(t,(()=>e.assign(t,!1)),(()=>e.add(i.default.json,o.str`,`)))}t.default=h},2105:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.jtdForms=void 0,t.jtdForms=["elements","values","discriminator","properties","optionalProperties","enum","type","ref"]},6579:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=r(9411),n={data:new s.Name("data"),valCxt:new s.Name("valCxt"),instancePath:new s.Name("instancePath"),parentData:new s.Name("parentData"),parentDataProperty:new s.Name("parentDataProperty"),rootData:new s.Name("rootData"),dynamicAnchors:new s.Name("dynamicAnchors"),vErrors:new s.Name("vErrors"),errors:new s.Name("errors"),this:new s.Name("this"),self:new s.Name("self"),scope:new s.Name("scope"),json:new s.Name("json"),jsonPos:new s.Name("jsonPos"),jsonLen:new s.Name("jsonLen"),jsonPart:new s.Name("jsonPart")};t.default=n},3003:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=r(4209);class n extends Error{constructor(e,t,r,n){super(n||`can't resolve reference ${r} from id ${t}`),this.missingRef=(0,s.resolveUrl)(e,t,r),this.missingSchema=(0,s.normalizeId)((0,s.getFullPath)(e,this.missingRef))}}t.default=n},4209:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getSchemaRefs=t.resolveUrl=t.normalizeId=t._getFullPath=t.getFullPath=t.inlineRef=void 0;const s=r(2390),n=r(4063),o=r(2125),a=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);t.inlineRef=function(e,t=!0){return"boolean"==typeof e||(!0===t?!c(e):!!t&&l(e)<=t)};const i=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function c(e){for(const t in e){if(i.has(t))return!0;const r=e[t];if(Array.isArray(r)&&r.some(c))return!0;if("object"==typeof r&&c(r))return!0}return!1}function l(e){let t=0;for(const r in e){if("$ref"===r)return 1/0;if(t++,!a.has(r)&&("object"==typeof e[r]&&(0,s.eachItem)(e[r],(e=>t+=l(e))),t===1/0))return 1/0}return t}function u(e,t="",r){!1!==r&&(t=h(t));const s=e.parse(t);return d(e,s)}function d(e,t){return e.serialize(t).split("#")[0]+"#"}t.getFullPath=u,t._getFullPath=d;const f=/#\/?$/;function h(e){return e?e.replace(f,""):""}t.normalizeId=h,t.resolveUrl=function(e,t,r){return r=h(r),e.resolve(t,r)};const p=/^[a-z_][-a-z0-9._]*$/i;t.getSchemaRefs=function(e,t){if("boolean"==typeof e)return{};const{schemaId:r,uriResolver:s}=this.opts,a=h(e[r]||t),i={"":a},c=u(s,a,!1),l={},d=new Set;return o(e,{allKeys:!0},((e,t,s,n)=>{if(void 0===n)return;const o=c+t;let a=i[n];function u(t){const r=this.opts.uriResolver.resolve;if(t=h(a?r(a,t):t),d.has(t))throw m(t);d.add(t);let s=this.refs[t];return"string"==typeof s&&(s=this.refs[s]),"object"==typeof s?f(e,s.schema,t):t!==h(o)&&("#"===t[0]?(f(e,l[t],t),l[t]=e):this.refs[t]=o),t}function g(e){if("string"==typeof e){if(!p.test(e))throw new Error(`invalid anchor "${e}"`);u.call(this,`#${e}`)}}"string"==typeof e[r]&&(a=u.call(this,e[r])),g.call(this,e.$anchor),g.call(this,e.$dynamicAnchor),i[t]=a})),l;function f(e,t,r){if(void 0!==t&&!n(e,t))throw m(r)}function m(e){return new Error(`reference "${e}" resolves to more than one schema`)}}},1819:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getRules=t.isJSONType=void 0;const r=new Set(["string","number","integer","boolean","null","object","array"]);t.isJSONType=function(e){return"string"==typeof e&&r.has(e)},t.getRules=function(){const e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}},2390:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.checkStrictMode=t.getErrorPath=t.Type=t.useFunc=t.setEvaluated=t.evaluatedPropsToName=t.mergeEvaluated=t.eachItem=t.unescapeJsonPointer=t.escapeJsonPointer=t.escapeFragment=t.unescapeFragment=t.schemaRefOrVal=t.schemaHasRulesButRef=t.schemaHasRules=t.checkUnknownRules=t.alwaysValidSchema=t.toHash=void 0;const s=r(9411),n=r(6114);function o(e,t=e.schema){const{opts:r,self:s}=e;if(!r.strictSchema)return;if("boolean"==typeof t)return;const n=s.RULES.keywords;for(const r in t)n[r]||p(e,`unknown keyword: "${r}"`)}function a(e,t){if("boolean"==typeof e)return!e;for(const r in e)if(t[r])return!0;return!1}function i(e){return"number"==typeof e?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}function c(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function l({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:n}){return(o,a,i,c)=>{const l=void 0===i?a:i instanceof s.Name?(a instanceof s.Name?e(o,a,i):t(o,a,i),i):a instanceof s.Name?(t(o,i,a),a):r(a,i);return c!==s.Name||l instanceof s.Name?l:n(o,l)}}function u(e,t){if(!0===t)return e.var("props",!0);const r=e.var("props",s._`{}`);return void 0!==t&&d(e,r,t),r}function d(e,t,r){Object.keys(r).forEach((r=>e.assign(s._`${t}${(0,s.getProperty)(r)}`,!0)))}t.toHash=function(e){const t={};for(const r of e)t[r]=!0;return t},t.alwaysValidSchema=function(e,t){return"boolean"==typeof t?t:0===Object.keys(t).length||(o(e,t),!a(t,e.self.RULES.all))},t.checkUnknownRules=o,t.schemaHasRules=a,t.schemaHasRulesButRef=function(e,t){if("boolean"==typeof e)return!e;for(const r in e)if("$ref"!==r&&t.all[r])return!0;return!1},t.schemaRefOrVal=function({topSchemaRef:e,schemaPath:t},r,n,o){if(!o){if("number"==typeof r||"boolean"==typeof r)return r;if("string"==typeof r)return s._`${r}`}return s._`${e}${t}${(0,s.getProperty)(n)}`},t.unescapeFragment=function(e){return c(decodeURIComponent(e))},t.escapeFragment=function(e){return encodeURIComponent(i(e))},t.escapeJsonPointer=i,t.unescapeJsonPointer=c,t.eachItem=function(e,t){if(Array.isArray(e))for(const r of e)t(r);else t(e)},t.mergeEvaluated={props:l({mergeNames:(e,t,r)=>e.if(s._`${r} !== true && ${t} !== undefined`,(()=>{e.if(s._`${t} === true`,(()=>e.assign(r,!0)),(()=>e.assign(r,s._`${r} || {}`).code(s._`Object.assign(${r}, ${t})`)))})),mergeToName:(e,t,r)=>e.if(s._`${r} !== true`,(()=>{!0===t?e.assign(r,!0):(e.assign(r,s._`${r} || {}`),d(e,r,t))})),mergeValues:(e,t)=>!0===e||{...e,...t},resultToName:u}),items:l({mergeNames:(e,t,r)=>e.if(s._`${r} !== true && ${t} !== undefined`,(()=>e.assign(r,s._`${t} === true ? true : ${r} > ${t} ? ${r} : ${t}`))),mergeToName:(e,t,r)=>e.if(s._`${r} !== true`,(()=>e.assign(r,!0===t||s._`${r} > ${t} ? ${r} : ${t}`))),mergeValues:(e,t)=>!0===e||Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})},t.evaluatedPropsToName=u,t.setEvaluated=d;const f={};var h;function p(e,t,r=e.opts.strictSchema){if(r){if(t=`strict mode: ${t}`,!0===r)throw new Error(t);e.self.logger.warn(t)}}t.useFunc=function(e,t){return e.scopeValue("func",{ref:t,code:f[t.code]||(f[t.code]=new n._Code(t.code))})},function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"}(h=t.Type||(t.Type={})),t.getErrorPath=function(e,t,r){if(e instanceof s.Name){const n=t===h.Num;return r?n?s._`"[" + ${e} + "]"`:s._`"['" + ${e} + "']"`:n?s._`"/" + ${e}`:s._`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,s.getProperty)(e).toString():"/"+i(e)},t.checkStrictMode=p},2411:(e,t)=>{"use strict";function r(e,t){return t.rules.some((t=>s(e,t)))}function s(e,t){var r;return void 0!==e[t.keyword]||(null===(r=t.definition.implements)||void 0===r?void 0:r.some((t=>void 0!==e[t])))}Object.defineProperty(t,"__esModule",{value:!0}),t.shouldUseRule=t.shouldUseGroup=t.schemaHasRulesForType=void 0,t.schemaHasRulesForType=function({schema:e,self:t},s){const n=t.RULES.types[s];return n&&!0!==n&&r(e,n)},t.shouldUseGroup=r,t.shouldUseRule=s},3343:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.boolOrEmptySchema=t.topBoolOrEmptySchema=void 0;const s=r(6782),n=r(9411),o=r(6579),a={message:"boolean schema is false"};function i(e,t){const{gen:r,data:n}=e,o={gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,s.reportError)(o,a,void 0,t)}t.topBoolOrEmptySchema=function(e){const{gen:t,schema:r,validateName:s}=e;!1===r?i(e,!1):"object"==typeof r&&!0===r.$async?t.return(o.default.data):(t.assign(n._`${s}.errors`,null),t.return(!0))},t.boolOrEmptySchema=function(e,t){const{gen:r,schema:s}=e;!1===s?(r.var(t,!1),i(e)):r.var(t,!0)}},1312:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.reportTypeError=t.checkDataTypes=t.checkDataType=t.coerceAndCheckDataType=t.getJSONTypes=t.getSchemaTypes=t.DataType=void 0;const s=r(1819),n=r(2411),o=r(6782),a=r(9411),i=r(2390);var c;function l(e){const t=Array.isArray(e)?e:e?[e]:[];if(t.every(s.isJSONType))return t;throw new Error("type must be JSONType or JSONType[]: "+t.join(","))}!function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"}(c=t.DataType||(t.DataType={})),t.getSchemaTypes=function(e){const t=l(e.type);if(t.includes("null")){if(!1===e.nullable)throw new Error("type: null contradicts nullable: false")}else{if(!t.length&&void 0!==e.nullable)throw new Error('"nullable" cannot be used without "type"');!0===e.nullable&&t.push("null")}return t},t.getJSONTypes=l,t.coerceAndCheckDataType=function(e,t){const{gen:r,data:s,opts:o}=e,i=function(e,t){return t?e.filter((e=>u.has(e)||"array"===t&&"array"===e)):[]}(t,o.coerceTypes),l=t.length>0&&!(0===i.length&&1===t.length&&(0,n.schemaHasRulesForType)(e,t[0]));if(l){const n=f(t,s,o.strictNumbers,c.Wrong);r.if(n,(()=>{i.length?function(e,t,r){const{gen:s,data:n,opts:o}=e,i=s.let("dataType",a._`typeof ${n}`),c=s.let("coerced",a._`undefined`);"array"===o.coerceTypes&&s.if(a._`${i} == 'object' && Array.isArray(${n}) && ${n}.length == 1`,(()=>s.assign(n,a._`${n}[0]`).assign(i,a._`typeof ${n}`).if(f(t,n,o.strictNumbers),(()=>s.assign(c,n))))),s.if(a._`${c} !== undefined`);for(const e of r)(u.has(e)||"array"===e&&"array"===o.coerceTypes)&&l(e);function l(e){switch(e){case"string":return void s.elseIf(a._`${i} == "number" || ${i} == "boolean"`).assign(c,a._`"" + ${n}`).elseIf(a._`${n} === null`).assign(c,a._`""`);case"number":return void s.elseIf(a._`${i} == "boolean" || ${n} === null
|
|
2
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("stsoauth2plugin",[],t):"object"==typeof exports?exports.stsoauth2plugin=t():e.stsoauth2plugin=t()}(self,(()=>(()=>{var e={2266:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GetErrorPayload=void 0,t.GetErrorPayload=function(e,t=null){return{error:e.code,error_description:e.description,timestamp:Date.now(),details:t}}},7557:function(e,t,r){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,r,s){void 0===s&&(s=r);var n=Object.getOwnPropertyDescriptor(t,r);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,s,n)}:function(e,t,r,s){void 0===s&&(s=r),e[s]=t[r]}),n=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||s(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.$stsgdf=t.$stsgd=void 0,n(r(2266),t),n(r(2226),t),n(r(5514),t),n(r(6322),t),n(r(8415),t),t.$stsgd={},t.$stsgdf=function(){return t.$stsgd}},8415:(e,t)=>{"use strict";var r,s,n;Object.defineProperty(t,"__esModule",{value:!0}),t.compareParameterTypes=t.OAuth2ParameterErrorType=t.OIDCAddressClaim=t.OIDCStandardClaim=t.OAuth2ParameterType=void 0,(n=t.OAuth2ParameterType||(t.OAuth2ParameterType={})).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",(s=t.OIDCStandardClaim||(t.OIDCStandardClaim={})).SUB="sub",s.NAME="name",s.GIVEN_NAME="given_name",s.FAMILY_NAME="family_name",s.MIDDLE_NAME="middle_name",s.NICKNAME="nickname",s.PREFERRED_USERNAME="preferred_username",s.PROFILE="profile",s.PICTURE="picture",s.WEBSITE="website",s.EMAIL="email",s.EMAIL_VERIFIED="email_verified",s.GENDER="gender",s.BIRTHDATE="birthdate",s.ZONEINFO="zoneinfo",s.LOCALE="locale",s.PHONE_NUMBER="phone_number",s.PHONE_NUMBER_VERIFIED="phone_number_verified",s.ADDRESS="address",s.CLIENT_SECRET="client_secret",s.NONCE="nonce",(r=t.OIDCAddressClaim||(t.OIDCAddressClaim={})).FORMATTED="formatted",r.STREET_ADDRESS="street_address",r.LOCALITY="locality",r.REGION="region",r.COUNTRY="country";class o{static NOT_EQUAL={code:"STS_OAUTH2_ERR_0001",description:"Parameter values not equal."};static NOT_PRESENT={code:"STS_OAUTH2_ERR_0002",description:"Parameter not provided."};static INVALID_FORMAT={code:"STS_OAUTH2_ERR_0003",description:"Parameter value format invalid."};static EXPIRED={code:"STS_OAUTH2_ERR_0004",description:"Parameter value expired."}}t.OAuth2ParameterErrorType=o,t.compareParameterTypes=function(e,t,r){const s=[];for(let n=0;n<r.length;n++){const a=r[n];if(0!==e[n].localeCompare(t[n])){const e={error:o.NOT_EQUAL.code,error_description:o.NOT_EQUAL.description,timestamp:Date.now(),details:`${o.NOT_EQUAL.description}: Parameter: [${a}]`};s.push(e)}}return s}},5514:(e,t)=>{"use strict";async function r(e=1e3){return new Promise((t=>setTimeout(t,e)))}Object.defineProperty(t,"__esModule",{value:!0}),t.JestSleep=t.Sleep=void 0,t.Sleep=r,t.JestSleep=async function(){return r(100)}},2226:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.STSOptionsBase=void 0;const s=r(6322);t.STSOptionsBase=class{_options;constructor(e=null){this._options=e,null!==e&&(void 0===e.validator||(0,s.Validate)(e.validator,e))}get options(){return this._options}}},6322:function(e,t,r){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Validate=t.AddSchema=void 0;const n=new(s(r(4179)).default);t.AddSchema=function(e,t){n.addSchema(t,e)},t.Validate=function(e,t){const r=n.getSchema(e);if(r)return((e,t)=>e(t)?null:e.errors)(r,t)}},6114:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.regexpCode=t.getEsmExportName=t.getProperty=t.safeStringify=t.stringify=t.strConcat=t.addCodeArg=t.str=t._=t.nil=t._Code=t.Name=t.IDENTIFIER=t._CodeOrName=void 0;class r{}t._CodeOrName=r,t.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class s extends r{constructor(e){if(super(),!t.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}t.Name=s;class n extends r{constructor(e){super(),this._items="string"==typeof e?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const e=this._items[0];return""===e||'""'===e}get str(){var e;return null!==(e=this._str)&&void 0!==e?e:this._str=this._items.reduce(((e,t)=>`${e}${t}`),"")}get names(){var e;return null!==(e=this._names)&&void 0!==e?e:this._names=this._items.reduce(((e,t)=>(t instanceof s&&(e[t.str]=(e[t.str]||0)+1),e)),{})}}function o(e,...t){const r=[e[0]];let s=0;for(;s<t.length;)c(r,t[s]),r.push(e[++s]);return new n(r)}t._Code=n,t.nil=new n(""),t._=o;const a=new n("+");function i(e,...t){const r=[u(e[0])];let s=0;for(;s<t.length;)r.push(a),c(r,t[s]),r.push(a,u(e[++s]));return function(e){let t=1;for(;t<e.length-1;){if(e[t]===a){const r=l(e[t-1],e[t+1]);if(void 0!==r){e.splice(t-1,3,r);continue}e[t++]="+"}t++}}(r),new n(r)}function c(e,t){var r;t instanceof n?e.push(...t._items):t instanceof s?e.push(t):e.push("number"==typeof(r=t)||"boolean"==typeof r||null===r?r:u(Array.isArray(r)?r.join(","):r))}function l(e,t){if('""'===t)return e;if('""'===e)return t;if("string"==typeof e){if(t instanceof s||'"'!==e[e.length-1])return;return"string"!=typeof t?`${e.slice(0,-1)}${t}"`:'"'===t[0]?e.slice(0,-1)+t.slice(1):void 0}return"string"!=typeof t||'"'!==t[0]||e instanceof s?void 0:`"${e}${t.slice(1)}`}function u(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}t.str=i,t.addCodeArg=c,t.strConcat=function(e,t){return t.emptyStr()?e:e.emptyStr()?t:i`${e}${t}`},t.stringify=function(e){return new n(u(e))},t.safeStringify=u,t.getProperty=function(e){return"string"==typeof e&&t.IDENTIFIER.test(e)?new n(`.${e}`):o`[${e}]`},t.getEsmExportName=function(e){if("string"==typeof e&&t.IDENTIFIER.test(e))return new n(`${e}`);throw new Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)},t.regexpCode=function(e){return new n(e.toString())}},9411:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.or=t.and=t.not=t.CodeGen=t.operators=t.varKinds=t.ValueScopeName=t.ValueScope=t.Scope=t.Name=t.regexpCode=t.stringify=t.getProperty=t.nil=t.strConcat=t.str=t._=void 0;const s=r(6114),n=r(941);var o=r(6114);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return o._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return o.str}}),Object.defineProperty(t,"strConcat",{enumerable:!0,get:function(){return o.strConcat}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return o.nil}}),Object.defineProperty(t,"getProperty",{enumerable:!0,get:function(){return o.getProperty}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return o.stringify}}),Object.defineProperty(t,"regexpCode",{enumerable:!0,get:function(){return o.regexpCode}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return o.Name}});var a=r(941);Object.defineProperty(t,"Scope",{enumerable:!0,get:function(){return a.Scope}}),Object.defineProperty(t,"ValueScope",{enumerable:!0,get:function(){return a.ValueScope}}),Object.defineProperty(t,"ValueScopeName",{enumerable:!0,get:function(){return a.ValueScopeName}}),Object.defineProperty(t,"varKinds",{enumerable:!0,get:function(){return a.varKinds}}),t.operators={GT:new s._Code(">"),GTE:new s._Code(">="),LT:new s._Code("<"),LTE:new s._Code("<="),EQ:new s._Code("==="),NEQ:new s._Code("!=="),NOT:new s._Code("!"),OR:new s._Code("||"),AND:new s._Code("&&"),ADD:new s._Code("+")};class i{optimizeNodes(){return this}optimizeNames(e,t){return this}}class c extends i{constructor(e,t,r){super(),this.varKind=e,this.name=t,this.rhs=r}render({es5:e,_n:t}){const r=e?n.varKinds.var:this.varKind,s=void 0===this.rhs?"":` = ${this.rhs}`;return`${r} ${this.name}${s};`+t}optimizeNames(e,t){if(e[this.name.str])return this.rhs&&(this.rhs=k(this.rhs,e,t)),this}get names(){return this.rhs instanceof s._CodeOrName?this.rhs.names:{}}}class l extends i{constructor(e,t,r){super(),this.lhs=e,this.rhs=t,this.sideEffects=r}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,t){if(!(this.lhs instanceof s.Name)||e[this.lhs.str]||this.sideEffects)return this.rhs=k(this.rhs,e,t),this}get names(){return j(this.lhs instanceof s.Name?{}:{...this.lhs.names},this.rhs)}}class u extends l{constructor(e,t,r,s){super(e,r,s),this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class d extends i{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class f extends i{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}}class h extends i{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class p extends i{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,t){return this.code=k(this.code,e,t),this}get names(){return this.code instanceof s._CodeOrName?this.code.names:{}}}class m extends i{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce(((t,r)=>t+r.render(e)),"")}optimizeNodes(){const{nodes:e}=this;let t=e.length;for(;t--;){const r=e[t].optimizeNodes();Array.isArray(r)?e.splice(t,1,...r):r?e[t]=r:e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){const{nodes:r}=this;let s=r.length;for(;s--;){const n=r[s];n.optimizeNames(e,t)||(T(e,n.names),r.splice(s,1))}return r.length>0?this:void 0}get names(){return this.nodes.reduce(((e,t)=>R(e,t.names)),{})}}class g extends m{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class y extends m{}class v extends g{}v.kind="else";class _ extends g{constructor(e,t){super(t),this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);return this.else&&(t+="else "+this.else.render(e)),t}optimizeNodes(){super.optimizeNodes();const e=this.condition;if(!0===e)return this.nodes;let t=this.else;if(t){const e=t.optimizeNodes();t=this.else=Array.isArray(e)?new v(e):e}return t?!1===e?t instanceof _?t:t.nodes:this.nodes.length?this:new _(I(e),t instanceof _?[t]:t.nodes):!1!==e&&this.nodes.length?this:void 0}optimizeNames(e,t){var r;if(this.else=null===(r=this.else)||void 0===r?void 0:r.optimizeNames(e,t),super.optimizeNames(e,t)||this.else)return this.condition=k(this.condition,e,t),this}get names(){const e=super.names;return j(e,this.condition),this.else&&R(e,this.else.names),e}}_.kind="if";class $ extends g{}$.kind="for";class w extends ${constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iteration=k(this.iteration,e,t),this}get names(){return R(super.names,this.iteration.names)}}class E extends ${constructor(e,t,r,s){super(),this.varKind=e,this.name=t,this.from=r,this.to=s}render(e){const t=e.es5?n.varKinds.var:this.varKind,{name:r,from:s,to:o}=this;return`for(${t} ${r}=${s}; ${r}<${o}; ${r}++)`+super.render(e)}get names(){const e=j(super.names,this.from);return j(e,this.to)}}class b extends ${constructor(e,t,r,s){super(),this.loop=e,this.varKind=t,this.name=r,this.iterable=s}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iterable=k(this.iterable,e,t),this}get names(){return R(super.names,this.iterable.names)}}class S extends g{constructor(e,t,r){super(),this.name=e,this.args=t,this.async=r}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}}S.kind="func";class P extends m{render(e){return"return "+super.render(e)}}P.kind="return";class C extends g{render(e){let t="try"+super.render(e);return this.catch&&(t+=this.catch.render(e)),this.finally&&(t+=this.finally.render(e)),t}optimizeNodes(){var e,t;return super.optimizeNodes(),null===(e=this.catch)||void 0===e||e.optimizeNodes(),null===(t=this.finally)||void 0===t||t.optimizeNodes(),this}optimizeNames(e,t){var r,s;return super.optimizeNames(e,t),null===(r=this.catch)||void 0===r||r.optimizeNames(e,t),null===(s=this.finally)||void 0===s||s.optimizeNames(e,t),this}get names(){const e=super.names;return this.catch&&R(e,this.catch.names),this.finally&&R(e,this.finally.names),e}}class N extends g{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}N.kind="catch";class O extends g{render(e){return"finally"+super.render(e)}}function R(e,t){for(const r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function j(e,t){return t instanceof s._CodeOrName?R(e,t.names):e}function k(e,t,r){return e instanceof s.Name?o(e):(n=e)instanceof s._Code&&n._items.some((e=>e instanceof s.Name&&1===t[e.str]&&void 0!==r[e.str]))?new s._Code(e._items.reduce(((e,t)=>(t instanceof s.Name&&(t=o(t)),t instanceof s._Code?e.push(...t._items):e.push(t),e)),[])):e;var n;function o(e){const s=r[e.str];return void 0===s||1!==t[e.str]?e:(delete t[e.str],s)}}function T(e,t){for(const r in t)e[r]=(e[r]||0)-(t[r]||0)}function I(e){return"boolean"==typeof e||"number"==typeof e||null===e?!e:s._`!${M(e)}`}O.kind="finally",t.CodeGen=class{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?"\n":""},this._extScope=e,this._scope=new n.Scope({parent:e}),this._nodes=[new y]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,t){const r=this._extScope.value(e,t);return(this._values[r.prefix]||(this._values[r.prefix]=new Set)).add(r),r}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,r,s){const n=this._scope.toName(t);return void 0!==r&&s&&(this._constants[n.str]=r),this._leafNode(new c(e,n,r)),n}const(e,t,r){return this._def(n.varKinds.const,e,t,r)}let(e,t,r){return this._def(n.varKinds.let,e,t,r)}var(e,t,r){return this._def(n.varKinds.var,e,t,r)}assign(e,t,r){return this._leafNode(new l(e,t,r))}add(e,r){return this._leafNode(new u(e,t.operators.ADD,r))}code(e){return"function"==typeof e?e():e!==s.nil&&this._leafNode(new p(e)),this}object(...e){const t=["{"];for(const[r,n]of e)t.length>1&&t.push(","),t.push(r),(r!==n||this.opts.es5)&&(t.push(":"),(0,s.addCodeArg)(t,n));return t.push("}"),new s._Code(t)}if(e,t,r){if(this._blockNode(new _(e)),t&&r)this.code(t).else().code(r).endIf();else if(t)this.code(t).endIf();else if(r)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new _(e))}else(){return this._elseNode(new v)}endIf(){return this._endBlockNode(_,v)}_for(e,t){return this._blockNode(e),t&&this.code(t).endFor(),this}for(e,t){return this._for(new w(e),t)}forRange(e,t,r,s,o=(this.opts.es5?n.varKinds.var:n.varKinds.let)){const a=this._scope.toName(e);return this._for(new E(o,a,t,r),(()=>s(a)))}forOf(e,t,r,o=n.varKinds.const){const a=this._scope.toName(e);if(this.opts.es5){const e=t instanceof s.Name?t:this.var("_arr",t);return this.forRange("_i",0,s._`${e}.length`,(t=>{this.var(a,s._`${e}[${t}]`),r(a)}))}return this._for(new b("of",o,a,t),(()=>r(a)))}forIn(e,t,r,o=(this.opts.es5?n.varKinds.var:n.varKinds.const)){if(this.opts.ownProperties)return this.forOf(e,s._`Object.keys(${t})`,r);const a=this._scope.toName(e);return this._for(new b("in",o,a,t),(()=>r(a)))}endFor(){return this._endBlockNode($)}label(e){return this._leafNode(new d(e))}break(e){return this._leafNode(new f(e))}return(e){const t=new P;if(this._blockNode(t),this.code(e),1!==t.nodes.length)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(P)}try(e,t,r){if(!t&&!r)throw new Error('CodeGen: "try" without "catch" and "finally"');const s=new C;if(this._blockNode(s),this.code(e),t){const e=this.name("e");this._currNode=s.catch=new N(e),t(e)}return r&&(this._currNode=s.finally=new O,this.code(r)),this._endBlockNode(N,O)}throw(e){return this._leafNode(new h(e))}block(e,t){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(t),this}endBlock(e){const t=this._blockStarts.pop();if(void 0===t)throw new Error("CodeGen: not in self-balancing block");const r=this._nodes.length-t;if(r<0||void 0!==e&&r!==e)throw new Error(`CodeGen: wrong number of nodes: ${r} vs ${e} expected`);return this._nodes.length=t,this}func(e,t=s.nil,r,n){return this._blockNode(new S(e,t,r)),n&&this.code(n).endFunc(),this}endFunc(){return this._endBlockNode(S)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,t){const r=this._currNode;if(r instanceof e||t&&r instanceof t)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){const t=this._currNode;if(!(t instanceof _))throw new Error('CodeGen: "else" without "if"');return this._currNode=t.else=e,this}get _root(){return this._nodes[0]}get _currNode(){const e=this._nodes;return e[e.length-1]}set _currNode(e){const t=this._nodes;t[t.length-1]=e}},t.not=I;const A=x(t.operators.AND);t.and=function(...e){return e.reduce(A)};const D=x(t.operators.OR);function x(e){return(t,r)=>t===s.nil?r:r===s.nil?t:s._`${M(t)} ${e} ${M(r)}`}function M(e){return e instanceof s.Name?e:s._`(${e})`}t.or=function(...e){return e.reduce(D)}},941:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ValueScope=t.ValueScopeName=t.Scope=t.varKinds=t.UsedValueState=void 0;const s=r(6114);class n extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}}var o;!function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"}(o=t.UsedValueState||(t.UsedValueState={})),t.varKinds={const:new s.Name("const"),let:new s.Name("let"),var:new s.Name("var")};class a{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof s.Name?e:this.name(e)}name(e){return new s.Name(this._newName(e))}_newName(e){return`${e}${(this._names[e]||this._nameGroup(e)).index++}`}_nameGroup(e){var t,r;if((null===(r=null===(t=this._parent)||void 0===t?void 0:t._prefixes)||void 0===r?void 0:r.has(e))||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}}t.Scope=a;class i extends s.Name{constructor(e,t){super(t),this.prefix=e}setValue(e,{property:t,itemIndex:r}){this.value=e,this.scopePath=s._`.${new s.Name(t)}[${r}]`}}t.ValueScopeName=i;const c=s._`\n`;t.ValueScope=class extends a{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?c:s.nil}}get(){return this._scope}name(e){return new i(e,this._newName(e))}value(e,t){var r;if(void 0===t.ref)throw new Error("CodeGen: ref must be passed in value");const s=this.toName(e),{prefix:n}=s,o=null!==(r=t.key)&&void 0!==r?r:t.ref;let a=this._values[n];if(a){const e=a.get(o);if(e)return e}else a=this._values[n]=new Map;a.set(o,s);const i=this._scope[n]||(this._scope[n]=[]),c=i.length;return i[c]=t.ref,s.setValue(t,{property:n,itemIndex:c}),s}getValue(e,t){const r=this._values[e];if(r)return r.get(t)}scopeRefs(e,t=this._values){return this._reduceValues(t,(t=>{if(void 0===t.scopePath)throw new Error(`CodeGen: name "${t}" has no value`);return s._`${e}${t.scopePath}`}))}scopeCode(e=this._values,t,r){return this._reduceValues(e,(e=>{if(void 0===e.value)throw new Error(`CodeGen: name "${e}" has no value`);return e.value.code}),t,r)}_reduceValues(e,r,a={},i){let c=s.nil;for(const l in e){const u=e[l];if(!u)continue;const d=a[l]=a[l]||new Map;u.forEach((e=>{if(d.has(e))return;d.set(e,o.Started);let a=r(e);if(a){const r=this.opts.es5?t.varKinds.var:t.varKinds.const;c=s._`${c}${r} ${e} = ${a};${this.opts._n}`}else{if(!(a=null==i?void 0:i(e)))throw new n(e);c=s._`${c}${a}${this.opts._n}`}d.set(e,o.Completed)}))}return c}}},6782:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.extendErrors=t.resetErrorsCount=t.reportExtraError=t.reportError=t.keyword$DataError=t.keywordError=void 0;const s=r(9411),n=r(2390),o=r(6579);function a(e,t){const r=e.const("err",t);e.if(s._`${o.default.vErrors} === null`,(()=>e.assign(o.default.vErrors,s._`[${r}]`)),s._`${o.default.vErrors}.push(${r})`),e.code(s._`${o.default.errors}++`)}function i(e,t){const{gen:r,validateName:n,schemaEnv:o}=e;o.$async?r.throw(s._`new ${e.ValidationError}(${t})`):(r.assign(s._`${n}.errors`,t),r.return(!1))}t.keywordError={message:({keyword:e})=>s.str`must pass "${e}" keyword validation`},t.keyword$DataError={message:({keyword:e,schemaType:t})=>t?s.str`"${e}" keyword must be ${t} ($data)`:s.str`"${e}" keyword is invalid ($data)`},t.reportError=function(e,r=t.keywordError,n,o){const{it:c}=e,{gen:u,compositeRule:d,allErrors:f}=c,h=l(e,r,n);(null!=o?o:d||f)?a(u,h):i(c,s._`[${h}]`)},t.reportExtraError=function(e,r=t.keywordError,s){const{it:n}=e,{gen:c,compositeRule:u,allErrors:d}=n;a(c,l(e,r,s)),u||d||i(n,o.default.vErrors)},t.resetErrorsCount=function(e,t){e.assign(o.default.errors,t),e.if(s._`${o.default.vErrors} !== null`,(()=>e.if(t,(()=>e.assign(s._`${o.default.vErrors}.length`,t)),(()=>e.assign(o.default.vErrors,null)))))},t.extendErrors=function({gen:e,keyword:t,schemaValue:r,data:n,errsCount:a,it:i}){if(void 0===a)throw new Error("ajv implementation error");const c=e.name("err");e.forRange("i",a,o.default.errors,(a=>{e.const(c,s._`${o.default.vErrors}[${a}]`),e.if(s._`${c}.instancePath === undefined`,(()=>e.assign(s._`${c}.instancePath`,(0,s.strConcat)(o.default.instancePath,i.errorPath)))),e.assign(s._`${c}.schemaPath`,s.str`${i.errSchemaPath}/${t}`),i.opts.verbose&&(e.assign(s._`${c}.schema`,r),e.assign(s._`${c}.data`,n))}))};const c={keyword:new s.Name("keyword"),schemaPath:new s.Name("schemaPath"),params:new s.Name("params"),propertyName:new s.Name("propertyName"),message:new s.Name("message"),schema:new s.Name("schema"),parentSchema:new s.Name("parentSchema")};function l(e,t,r){const{createErrors:n}=e.it;return!1===n?s._`{}`:function(e,t,r={}){const{gen:n,it:a}=e,i=[u(a,r),d(e,r)];return function(e,{params:t,message:r},n){const{keyword:a,data:i,schemaValue:l,it:u}=e,{opts:d,propertyName:f,topSchemaRef:h,schemaPath:p}=u;n.push([c.keyword,a],[c.params,"function"==typeof t?t(e):t||s._`{}`]),d.messages&&n.push([c.message,"function"==typeof r?r(e):r]),d.verbose&&n.push([c.schema,l],[c.parentSchema,s._`${h}${p}`],[o.default.data,i]),f&&n.push([c.propertyName,f])}(e,t,i),n.object(...i)}(e,t,r)}function u({errorPath:e},{instancePath:t}){const r=t?s.str`${e}${(0,n.getErrorPath)(t,n.Type.Str)}`:e;return[o.default.instancePath,(0,s.strConcat)(o.default.instancePath,r)]}function d({keyword:e,it:{errSchemaPath:t}},{schemaPath:r,parentSchema:o}){let a=o?t:s.str`${t}/${e}`;return r&&(a=s.str`${a}${(0,n.getErrorPath)(r,n.Type.Str)}`),[c.schemaPath,a]}},3584:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resolveSchema=t.getCompilingSchema=t.resolveRef=t.compileSchema=t.SchemaEnv=void 0;const s=r(9411),n=r(1205),o=r(6579),a=r(4209),i=r(2390),c=r(9509);class l{constructor(e){var t;let r;this.refs={},this.dynamicAnchors={},"object"==typeof e.schema&&(r=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=null!==(t=e.baseId)&&void 0!==t?t:(0,a.normalizeId)(null==r?void 0:r[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=null==r?void 0:r.$async,this.refs={}}}function u(e){const t=f.call(this,e);if(t)return t;const r=(0,a.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:i,lines:l}=this.opts.code,{ownProperties:u}=this.opts,d=new s.CodeGen(this.scope,{es5:i,lines:l,ownProperties:u});let h;e.$async&&(h=d.scopeValue("Error",{ref:n.default,code:s._`require("ajv/dist/runtime/validation_error").default`}));const p=d.scopeName("validate");e.validateName=p;const m={gen:d,allErrors:this.opts.allErrors,data:o.default.data,parentData:o.default.parentData,parentDataProperty:o.default.parentDataProperty,dataNames:[o.default.data],dataPathArr:[s.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:d.scopeValue("schema",!0===this.opts.code.source?{ref:e.schema,code:(0,s.stringify)(e.schema)}:{ref:e.schema}),validateName:p,ValidationError:h,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:s.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:s._`""`,opts:this.opts,self:this};let g;try{this._compilations.add(e),(0,c.validateFunctionCode)(m),d.optimize(this.opts.code.optimize);const t=d.toString();g=`${d.scopeRefs(o.default.scope)}return ${t}`,this.opts.code.process&&(g=this.opts.code.process(g,e));const r=new Function(`${o.default.self}`,`${o.default.scope}`,g)(this,this.scope.get());if(this.scope.value(p,{ref:r}),r.errors=null,r.schema=e.schema,r.schemaEnv=e,e.$async&&(r.$async=!0),!0===this.opts.code.source&&(r.source={validateName:p,validateCode:t,scopeValues:d._values}),this.opts.unevaluated){const{props:e,items:t}=m;r.evaluated={props:e instanceof s.Name?void 0:e,items:t instanceof s.Name?void 0:t,dynamicProps:e instanceof s.Name,dynamicItems:t instanceof s.Name},r.source&&(r.source.evaluated=(0,s.stringify)(r.evaluated))}return e.validate=r,e}catch(t){throw delete e.validate,delete e.validateName,g&&this.logger.error("Error compiling schema, function code:",g),t}finally{this._compilations.delete(e)}}function d(e){return(0,a.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:u.call(this,e)}function f(e){for(const s of this._compilations)if(r=e,(t=s).schema===r.schema&&t.root===r.root&&t.baseId===r.baseId)return s;var t,r}function h(e,t){let r;for(;"string"==typeof(r=this.refs[t]);)t=r;return r||this.schemas[t]||p.call(this,e,t)}function p(e,t){const r=this.opts.uriResolver.parse(t),s=(0,a._getFullPath)(this.opts.uriResolver,r);let n=(0,a.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&s===n)return g.call(this,r,e);const o=(0,a.normalizeId)(s),i=this.refs[o]||this.schemas[o];if("string"==typeof i){const t=p.call(this,e,i);if("object"!=typeof(null==t?void 0:t.schema))return;return g.call(this,r,t)}if("object"==typeof(null==i?void 0:i.schema)){if(i.validate||u.call(this,i),o===(0,a.normalizeId)(t)){const{schema:t}=i,{schemaId:r}=this.opts,s=t[r];return s&&(n=(0,a.resolveUrl)(this.opts.uriResolver,n,s)),new l({schema:t,schemaId:r,root:e,baseId:n})}return g.call(this,r,i)}}t.SchemaEnv=l,t.compileSchema=u,t.resolveRef=function(e,t,r){var s;r=(0,a.resolveUrl)(this.opts.uriResolver,t,r);const n=e.refs[r];if(n)return n;let o=h.call(this,e,r);if(void 0===o){const n=null===(s=e.localRefs)||void 0===s?void 0:s[r],{schemaId:a}=this.opts;n&&(o=new l({schema:n,schemaId:a,root:e,baseId:t}))}return void 0!==o?e.refs[r]=d.call(this,o):void 0},t.getCompilingSchema=f,t.resolveSchema=p;const m=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function g(e,{baseId:t,schema:r,root:s}){var n;if("/"!==(null===(n=e.fragment)||void 0===n?void 0:n[0]))return;for(const s of e.fragment.slice(1).split("/")){if("boolean"==typeof r)return;const e=r[(0,i.unescapeFragment)(s)];if(void 0===e)return;const n="object"==typeof(r=e)&&r[this.opts.schemaId];!m.has(s)&&n&&(t=(0,a.resolveUrl)(this.opts.uriResolver,t,n))}let o;if("boolean"!=typeof r&&r.$ref&&!(0,i.schemaHasRulesButRef)(r,this.RULES)){const e=(0,a.resolveUrl)(this.opts.uriResolver,t,r.$ref);o=p.call(this,s,e)}const{schemaId:c}=this.opts;return o=o||new l({schema:r,schemaId:c,root:s,baseId:t}),o.schema!==o.root.schema?o:void 0}},9378:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=r(2105),n=r(3584),o=r(9411),a=r(3003),i=r(6579),c=r(2309),l=r(1837),u=r(4394),d=r(3561),f=r(2390),h=r(6596),p={elements:function(e){const{gen:t,schema:r,data:s}=e;k(e,"[");const n=t.let("i",0);t.assign(s,o._`[]`),_(e,"]",(()=>{const a=t.let("el");y({...e,schema:r.elements,data:a}),t.assign(o._`${s}[${n}++]`,a)}))},values:function(e){const{gen:t,schema:r,data:s}=e;k(e,"{"),t.assign(s,o._`{}`),_(e,"}",(()=>function(e,t){const{gen:r}=e,s=r.let("key");P({...e,data:s}),k(e,":"),S(e,s,t)}(e,r.values)))},discriminator:function(e){const{gen:t,data:r,schema:s}=e,{discriminator:n,mapping:a}=s;k(e,"{"),t.assign(r,o._`{}`);const c=t.const("pos",i.default.jsonPos),l=t.let("value"),u=t.let("tag");$(e,"}",(()=>{const s=t.let("key");P({...e,data:s}),k(e,":"),t.if(o._`${s} === ${n}`,(()=>{P({...e,data:u}),t.assign(o._`${r}[${s}]`,u),t.break()}),(()=>O({...e,data:l})))})),t.assign(i.default.jsonPos,c),t.if(o._`${u} === undefined`),x(e,o.str`discriminator tag not found`);for(const r in a)t.elseIf(o._`${u} === ${r}`),E({...e,schema:a[r]},n);t.else(),x(e,o.str`discriminator value not in schema`),t.endIf()},properties:w,optionalProperties:w,enum:function(e){const{gen:t,data:r,schema:s}=e,n=s.enum;k(e,'"'),t.if(!1);for(const e of n){const s=JSON.stringify(e).slice(1);t.elseIf(o._`${A(s.length)} === ${s}`),t.assign(r,o.str`${e}`),t.add(i.default.jsonPos,s.length)}t.else(),D(e),t.endIf()},type:function(e){const{gen:t,schema:r,data:s,self:n}=e;switch(r.type){case"boolean":v(e);break;case"string":P(e);break;case"timestamp":{P(e);const r=(0,f.useFunc)(t,h.default),{allowDate:a,parseDate:i}=n.opts,c=a?o._`!${r}(${s}, true)`:o._`!${r}(${s})`,l=i?(0,o.or)(c,o._`(${s} = new Date(${s}), false)`,o._`isNaN(${s}.valueOf())`):c;t.if(l,(()=>x(e,o.str`invalid timestamp`)));break}case"float32":case"float64":C(e);break;default:{const a=r.type;if(n.opts.int32range||"int32"!==a&&"uint32"!==a){const[r,n,i]=u.intRange[a];C(e,i),t.if(o._`${s} < ${r} || ${s} > ${n}`,(()=>x(e,o.str`integer out of range`)))}else C(e,16),"uint32"===a&&t.if(o._`${s} < 0`,(()=>x(e,o.str`integer out of range`)))}}},ref:function(e){const{gen:t,self:r,definitions:s,schema:i,schemaEnv:c}=e,{ref:u}=i,d=s[u];if(!d)throw new a.default(r.opts.uriResolver,"",u,`No definition ${u}`);if(!(0,l.hasRef)(d))return y({...e,schema:d});const{root:f}=c;j(e,function(e,t){return t.parse?e.scopeValue("parse",{ref:t.parse}):o._`${e.scopeValue("wrapper",{ref:t})}.parse`}(t,m.call(r,new n.SchemaEnv({schema:d,root:f}),s)),!0)}};function m(e,t){const r=n.getCompilingSchema.call(this,e);if(r)return r;const{es5:s,lines:a}=this.opts.code,{ownProperties:c}=this.opts,l=new o.CodeGen(this.scope,{es5:s,lines:a,ownProperties:c}),u=l.scopeName("parse"),d={self:this,gen:l,schema:e.schema,schemaEnv:e,definitions:t,data:i.default.data,parseName:u,char:l.name("c")};let f;try{this._compilations.add(e),e.parseName=u,function(e){const{gen:t,parseName:r,char:s}=e;t.func(r,o._`${i.default.json}, ${i.default.jsonPos}, ${i.default.jsonPart}`,!1,(()=>{t.let(i.default.data),t.let(s),t.assign(o._`${r}.message`,g),t.assign(o._`${r}.position`,g),t.assign(i.default.jsonPos,o._`${i.default.jsonPos} || 0`),t.const(i.default.jsonLen,o._`${i.default.json}.length`),y(e),I(e),t.if(i.default.jsonPart,(()=>{t.assign(o._`${r}.position`,i.default.jsonPos),t.return(i.default.data)})),t.if(o._`${i.default.jsonPos} === ${i.default.jsonLen}`,(()=>t.return(i.default.data))),D(e)}))}(d),l.optimize(this.opts.code.optimize);const t=l.toString();f=`${l.scopeRefs(i.default.scope)}return ${t}`;const r=new Function(`${i.default.scope}`,f)(this.scope.get());this.scope.value(u,{ref:r}),e.parse=r}catch(t){throw f&&this.logger.error("Error compiling parser, function code:",f),delete e.parse,delete e.parseName,t}finally{this._compilations.delete(e)}return e}t.default=m;const g=o._`undefined`;function y(e){let t;for(const r of s.jtdForms)if(r in e.schema){t=r;break}t?function(e,t){const{gen:r,schema:s,data:n}=e;if(!s.nullable)return t(e);T(e,"null",t,(()=>r.assign(n,null)))}(e,p[t]):O(e)}const v=N(!0,N(!1,D));function _(e,t,r){$(e,t,r),k(e,t)}function $(e,t,r){const{gen:s}=e;function n(){T(e,t,(()=>{}),D)}s.for(o._`;${i.default.jsonPos}<${i.default.jsonLen} && ${A(1)}!==${t};`,(()=>{r(),T(e,",",(()=>s.break()),n)}))}function w(e){const{gen:t,data:r}=e;k(e,"{"),t.assign(r,o._`{}`),E(e)}function E(e,t){const{gen:r,schema:s,data:n}=e,{properties:a,optionalProperties:i,additionalProperties:l}=s;if(_(e,"}",(()=>{const s=r.let("key");if(P({...e,data:s}),k(e,":"),r.if(!1),b(e,s,a),b(e,s,i),t){r.elseIf(o._`${s} === ${t}`);const n=r.let("tag");P({...e,data:n})}r.else(),l?O({...e,data:o._`${n}[${s}]`}):x(e,o.str`property ${s} not allowed`),r.endIf()})),a){const t=(0,c.hasPropFunc)(r),s=(0,o.and)(...Object.keys(a).map((e=>o._`${t}.call(${n}, ${e})`)));r.if((0,o.not)(s),(()=>x(e,o.str`missing required properties`)))}}function b(e,t,r={}){const{gen:s}=e;for(const n in r)s.elseIf(o._`${t} === ${n}`),S(e,t,r[n])}function S(e,t,r){y({...e,schema:r,data:o._`${e.data}[${t}]`})}function P(e){k(e,'"'),R(e,d.parseJsonString)}function C(e,t){const{gen:r}=e;I(e),r.if(o._`"-0123456789".indexOf(${A(1)}) < 0`,(()=>D(e)),(()=>R(e,d.parseJsonNumber,t)))}function N(e,t){return r=>{const{gen:s,data:n}=r;T(r,`${e}`,(()=>t(r)),(()=>s.assign(n,e)))}}function O(e){R(e,d.parseJson)}function R(e,t,r){j(e,(0,f.useFunc)(e.gen,t),r)}function j(e,t,r){const{gen:s,data:n}=e;s.assign(n,o._`${t}(${i.default.json}, ${i.default.jsonPos}${r?o._`, ${r}`:o.nil})`),s.assign(i.default.jsonPos,o._`${t}.position`),s.if(o._`${n} === undefined`,(()=>x(e,o._`${t}.message`)))}function k(e,t){T(e,t,D)}function T(e,t,r,s){const{gen:n}=e,a=t.length;I(e),n.if(o._`${A(a)} === ${t}`,(()=>{n.add(i.default.jsonPos,a),null==s||s(e)}),(()=>r(e)))}function I({gen:e,char:t}){e.code(o._`while((${t}=${i.default.json}[${i.default.jsonPos}],${t}===" "||${t}==="\\n"||${t}==="\\r"||${t}==="\\t"))${i.default.jsonPos}++;`)}function A(e){return 1===e?o._`${i.default.json}[${i.default.jsonPos}]`:o._`${i.default.json}.slice(${i.default.jsonPos}, ${i.default.jsonPos}+${e})`}function D(e){x(e,o._`"unexpected token " + ${i.default.json}[${i.default.jsonPos}]`)}function x({gen:e,parseName:t},r){e.assign(o._`${t}.message`,r),e.assign(o._`${t}.position`,i.default.jsonPos),e.return(g)}},1509:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=r(2105),n=r(3584),o=r(9411),a=r(3003),i=r(6579),c=r(2309),l=r(1837),u=r(2390),d=r(3456),f={elements:function(e){const{gen:t,schema:r,data:s}=e;t.add(i.default.json,o.str`[`);const n=t.let("first",!0);t.forOf("el",s,(t=>{$(e,n),p({...e,schema:r.elements,data:t})})),t.add(i.default.json,o.str`]`)},values:function(e){const{gen:t,schema:r,data:s}=e;t.add(i.default.json,o.str`{`);const n=t.let("first",!0);t.forIn("key",s,(t=>m(e,t,r.values,n))),t.add(i.default.json,o.str`}`)},discriminator:function(e){const{gen:t,schema:r,data:s}=e,{discriminator:n}=r;t.add(i.default.json,o.str`{${JSON.stringify(n)}:`);const a=t.const("tag",o._`${s}${(0,o.getProperty)(n)}`);v({...e,data:a}),t.if(!1);for(const s in r.mapping){t.elseIf(o._`${a} === ${s}`);const i=r.mapping[s];y({...e,schema:i},n)}t.endIf(),t.add(i.default.json,o.str`}`)},properties:g,optionalProperties:g,enum:v,type:function(e){const{gen:t,schema:r,data:s}=e;switch(r.type){case"boolean":t.add(i.default.json,o._`${s} ? "true" : "false"`);break;case"string":v(e);break;case"timestamp":t.if(o._`${s} instanceof Date`,(()=>t.add(i.default.json,o._`'"' + ${s}.toISOString() + '"'`)),(()=>v(e)));break;default:!function({gen:e,data:t}){e.add(i.default.json,o._`"" + ${t}`)}(e)}},ref:function(e){const{gen:t,self:r,data:s,definitions:c,schema:u,schemaEnv:d}=e,{ref:f}=u,m=c[f];if(!m)throw new a.default(r.opts.uriResolver,"",f,`No definition ${f}`);if(!(0,l.hasRef)(m))return p({...e,schema:m});const{root:g}=d,y=h.call(r,new n.SchemaEnv({schema:m,root:g}),c);t.add(i.default.json,o._`${function(e,t){return t.serialize?e.scopeValue("serialize",{ref:t.serialize}):o._`${e.scopeValue("wrapper",{ref:t})}.serialize`}(t,y)}(${s})`)}};function h(e,t){const r=n.getCompilingSchema.call(this,e);if(r)return r;const{es5:s,lines:a}=this.opts.code,{ownProperties:c}=this.opts,l=new o.CodeGen(this.scope,{es5:s,lines:a,ownProperties:c}),u=l.scopeName("serialize"),d={self:this,gen:l,schema:e.schema,schemaEnv:e,definitions:t,data:i.default.data};let f;try{this._compilations.add(e),e.serializeName=u,l.func(u,i.default.data,!1,(()=>{l.let(i.default.json,o.str``),p(d),l.return(i.default.json)})),l.optimize(this.opts.code.optimize);const t=l.toString();f=`${l.scopeRefs(i.default.scope)}return ${t}`;const r=new Function(`${i.default.scope}`,f)(this.scope.get());this.scope.value(u,{ref:r}),e.serialize=r}catch(t){throw f&&this.logger.error("Error compiling serializer, function code:",f),delete e.serialize,delete e.serializeName,t}finally{this._compilations.delete(e)}return e}function p(e){let t;for(const r of s.jtdForms)if(r in e.schema){t=r;break}!function(e,t){const{gen:r,schema:s,data:n}=e;if(!s.nullable)return t(e);r.if(o._`${n} === undefined || ${n} === null`,(()=>r.add(i.default.json,o._`"null"`)),(()=>t(e)))}(e,t?f[t]:_)}function m(e,t,r,s){const{gen:n,data:a}=e;$(e,s),v({...e,data:t}),n.add(i.default.json,o.str`:`);const c=n.const("value",o._`${a}${(0,o.getProperty)(t)}`);p({...e,schema:r,data:c})}function g(e){const{gen:t}=e;t.add(i.default.json,o.str`{`),y(e),t.add(i.default.json,o.str`}`)}function y(e,t){const{gen:r,schema:s,data:n}=e,{properties:a,optionalProperties:l}=s,u=g(a),d=g(l),f=function(e){if(t&&e.push(t),new Set(e).size!==e.length)throw new Error("JTD: properties/optionalProperties/disciminator overlap");return e}(u.concat(d));let h=!t;for(const e of u)v(e,a[e],y(e));for(const e of d){const t=y(e);r.if((0,o.and)(o._`${t} !== undefined`,(0,c.isOwnProperty)(r,n,e)),(()=>v(e,l[e],t)))}function g(e){return e?Object.keys(e):[]}function y(e){return r.const("value",o._`${n}${(0,o.getProperty)(e)}`)}function v(t,s,n){h?h=!1:r.add(i.default.json,o.str`,`),r.add(i.default.json,o.str`${JSON.stringify(t)}:`),p({...e,schema:s,data:n})}s.additionalProperties&&r.forIn("key",n,(t=>r.if(function(e,t){return!t.length||(0,o.and)(...t.map((t=>o._`${e} !== ${t}`)))}(t,f),(()=>m(e,t,{},r.let("first",h))))))}function v({gen:e,data:t}){e.add(i.default.json,o._`${(0,u.useFunc)(e,d.default)}(${t})`)}function _({gen:e,data:t}){e.add(i.default.json,o._`JSON.stringify(${t})`)}function $({gen:e},t){e.if(t,(()=>e.assign(t,!1)),(()=>e.add(i.default.json,o.str`,`)))}t.default=h},2105:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.jtdForms=void 0,t.jtdForms=["elements","values","discriminator","properties","optionalProperties","enum","type","ref"]},6579:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=r(9411),n={data:new s.Name("data"),valCxt:new s.Name("valCxt"),instancePath:new s.Name("instancePath"),parentData:new s.Name("parentData"),parentDataProperty:new s.Name("parentDataProperty"),rootData:new s.Name("rootData"),dynamicAnchors:new s.Name("dynamicAnchors"),vErrors:new s.Name("vErrors"),errors:new s.Name("errors"),this:new s.Name("this"),self:new s.Name("self"),scope:new s.Name("scope"),json:new s.Name("json"),jsonPos:new s.Name("jsonPos"),jsonLen:new s.Name("jsonLen"),jsonPart:new s.Name("jsonPart")};t.default=n},3003:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=r(4209);class n extends Error{constructor(e,t,r,n){super(n||`can't resolve reference ${r} from id ${t}`),this.missingRef=(0,s.resolveUrl)(e,t,r),this.missingSchema=(0,s.normalizeId)((0,s.getFullPath)(e,this.missingRef))}}t.default=n},4209:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getSchemaRefs=t.resolveUrl=t.normalizeId=t._getFullPath=t.getFullPath=t.inlineRef=void 0;const s=r(2390),n=r(4063),o=r(2125),a=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);t.inlineRef=function(e,t=!0){return"boolean"==typeof e||(!0===t?!c(e):!!t&&l(e)<=t)};const i=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function c(e){for(const t in e){if(i.has(t))return!0;const r=e[t];if(Array.isArray(r)&&r.some(c))return!0;if("object"==typeof r&&c(r))return!0}return!1}function l(e){let t=0;for(const r in e){if("$ref"===r)return 1/0;if(t++,!a.has(r)&&("object"==typeof e[r]&&(0,s.eachItem)(e[r],(e=>t+=l(e))),t===1/0))return 1/0}return t}function u(e,t="",r){!1!==r&&(t=h(t));const s=e.parse(t);return d(e,s)}function d(e,t){return e.serialize(t).split("#")[0]+"#"}t.getFullPath=u,t._getFullPath=d;const f=/#\/?$/;function h(e){return e?e.replace(f,""):""}t.normalizeId=h,t.resolveUrl=function(e,t,r){return r=h(r),e.resolve(t,r)};const p=/^[a-z_][-a-z0-9._]*$/i;t.getSchemaRefs=function(e,t){if("boolean"==typeof e)return{};const{schemaId:r,uriResolver:s}=this.opts,a=h(e[r]||t),i={"":a},c=u(s,a,!1),l={},d=new Set;return o(e,{allKeys:!0},((e,t,s,n)=>{if(void 0===n)return;const o=c+t;let a=i[n];function u(t){const r=this.opts.uriResolver.resolve;if(t=h(a?r(a,t):t),d.has(t))throw m(t);d.add(t);let s=this.refs[t];return"string"==typeof s&&(s=this.refs[s]),"object"==typeof s?f(e,s.schema,t):t!==h(o)&&("#"===t[0]?(f(e,l[t],t),l[t]=e):this.refs[t]=o),t}function g(e){if("string"==typeof e){if(!p.test(e))throw new Error(`invalid anchor "${e}"`);u.call(this,`#${e}`)}}"string"==typeof e[r]&&(a=u.call(this,e[r])),g.call(this,e.$anchor),g.call(this,e.$dynamicAnchor),i[t]=a})),l;function f(e,t,r){if(void 0!==t&&!n(e,t))throw m(r)}function m(e){return new Error(`reference "${e}" resolves to more than one schema`)}}},1819:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getRules=t.isJSONType=void 0;const r=new Set(["string","number","integer","boolean","null","object","array"]);t.isJSONType=function(e){return"string"==typeof e&&r.has(e)},t.getRules=function(){const e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}},2390:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.checkStrictMode=t.getErrorPath=t.Type=t.useFunc=t.setEvaluated=t.evaluatedPropsToName=t.mergeEvaluated=t.eachItem=t.unescapeJsonPointer=t.escapeJsonPointer=t.escapeFragment=t.unescapeFragment=t.schemaRefOrVal=t.schemaHasRulesButRef=t.schemaHasRules=t.checkUnknownRules=t.alwaysValidSchema=t.toHash=void 0;const s=r(9411),n=r(6114);function o(e,t=e.schema){const{opts:r,self:s}=e;if(!r.strictSchema)return;if("boolean"==typeof t)return;const n=s.RULES.keywords;for(const r in t)n[r]||p(e,`unknown keyword: "${r}"`)}function a(e,t){if("boolean"==typeof e)return!e;for(const r in e)if(t[r])return!0;return!1}function i(e){return"number"==typeof e?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}function c(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function l({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:n}){return(o,a,i,c)=>{const l=void 0===i?a:i instanceof s.Name?(a instanceof s.Name?e(o,a,i):t(o,a,i),i):a instanceof s.Name?(t(o,i,a),a):r(a,i);return c!==s.Name||l instanceof s.Name?l:n(o,l)}}function u(e,t){if(!0===t)return e.var("props",!0);const r=e.var("props",s._`{}`);return void 0!==t&&d(e,r,t),r}function d(e,t,r){Object.keys(r).forEach((r=>e.assign(s._`${t}${(0,s.getProperty)(r)}`,!0)))}t.toHash=function(e){const t={};for(const r of e)t[r]=!0;return t},t.alwaysValidSchema=function(e,t){return"boolean"==typeof t?t:0===Object.keys(t).length||(o(e,t),!a(t,e.self.RULES.all))},t.checkUnknownRules=o,t.schemaHasRules=a,t.schemaHasRulesButRef=function(e,t){if("boolean"==typeof e)return!e;for(const r in e)if("$ref"!==r&&t.all[r])return!0;return!1},t.schemaRefOrVal=function({topSchemaRef:e,schemaPath:t},r,n,o){if(!o){if("number"==typeof r||"boolean"==typeof r)return r;if("string"==typeof r)return s._`${r}`}return s._`${e}${t}${(0,s.getProperty)(n)}`},t.unescapeFragment=function(e){return c(decodeURIComponent(e))},t.escapeFragment=function(e){return encodeURIComponent(i(e))},t.escapeJsonPointer=i,t.unescapeJsonPointer=c,t.eachItem=function(e,t){if(Array.isArray(e))for(const r of e)t(r);else t(e)},t.mergeEvaluated={props:l({mergeNames:(e,t,r)=>e.if(s._`${r} !== true && ${t} !== undefined`,(()=>{e.if(s._`${t} === true`,(()=>e.assign(r,!0)),(()=>e.assign(r,s._`${r} || {}`).code(s._`Object.assign(${r}, ${t})`)))})),mergeToName:(e,t,r)=>e.if(s._`${r} !== true`,(()=>{!0===t?e.assign(r,!0):(e.assign(r,s._`${r} || {}`),d(e,r,t))})),mergeValues:(e,t)=>!0===e||{...e,...t},resultToName:u}),items:l({mergeNames:(e,t,r)=>e.if(s._`${r} !== true && ${t} !== undefined`,(()=>e.assign(r,s._`${t} === true ? true : ${r} > ${t} ? ${r} : ${t}`))),mergeToName:(e,t,r)=>e.if(s._`${r} !== true`,(()=>e.assign(r,!0===t||s._`${r} > ${t} ? ${r} : ${t}`))),mergeValues:(e,t)=>!0===e||Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})},t.evaluatedPropsToName=u,t.setEvaluated=d;const f={};var h;function p(e,t,r=e.opts.strictSchema){if(r){if(t=`strict mode: ${t}`,!0===r)throw new Error(t);e.self.logger.warn(t)}}t.useFunc=function(e,t){return e.scopeValue("func",{ref:t,code:f[t.code]||(f[t.code]=new n._Code(t.code))})},function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"}(h=t.Type||(t.Type={})),t.getErrorPath=function(e,t,r){if(e instanceof s.Name){const n=t===h.Num;return r?n?s._`"[" + ${e} + "]"`:s._`"['" + ${e} + "']"`:n?s._`"/" + ${e}`:s._`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,s.getProperty)(e).toString():"/"+i(e)},t.checkStrictMode=p},2411:(e,t)=>{"use strict";function r(e,t){return t.rules.some((t=>s(e,t)))}function s(e,t){var r;return void 0!==e[t.keyword]||(null===(r=t.definition.implements)||void 0===r?void 0:r.some((t=>void 0!==e[t])))}Object.defineProperty(t,"__esModule",{value:!0}),t.shouldUseRule=t.shouldUseGroup=t.schemaHasRulesForType=void 0,t.schemaHasRulesForType=function({schema:e,self:t},s){const n=t.RULES.types[s];return n&&!0!==n&&r(e,n)},t.shouldUseGroup=r,t.shouldUseRule=s},3343:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.boolOrEmptySchema=t.topBoolOrEmptySchema=void 0;const s=r(6782),n=r(9411),o=r(6579),a={message:"boolean schema is false"};function i(e,t){const{gen:r,data:n}=e,o={gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,s.reportError)(o,a,void 0,t)}t.topBoolOrEmptySchema=function(e){const{gen:t,schema:r,validateName:s}=e;!1===r?i(e,!1):"object"==typeof r&&!0===r.$async?t.return(o.default.data):(t.assign(n._`${s}.errors`,null),t.return(!0))},t.boolOrEmptySchema=function(e,t){const{gen:r,schema:s}=e;!1===s?(r.var(t,!1),i(e)):r.var(t,!0)}},1312:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.reportTypeError=t.checkDataTypes=t.checkDataType=t.coerceAndCheckDataType=t.getJSONTypes=t.getSchemaTypes=t.DataType=void 0;const s=r(1819),n=r(2411),o=r(6782),a=r(9411),i=r(2390);var c;function l(e){const t=Array.isArray(e)?e:e?[e]:[];if(t.every(s.isJSONType))return t;throw new Error("type must be JSONType or JSONType[]: "+t.join(","))}!function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"}(c=t.DataType||(t.DataType={})),t.getSchemaTypes=function(e){const t=l(e.type);if(t.includes("null")){if(!1===e.nullable)throw new Error("type: null contradicts nullable: false")}else{if(!t.length&&void 0!==e.nullable)throw new Error('"nullable" cannot be used without "type"');!0===e.nullable&&t.push("null")}return t},t.getJSONTypes=l,t.coerceAndCheckDataType=function(e,t){const{gen:r,data:s,opts:o}=e,i=function(e,t){return t?e.filter((e=>u.has(e)||"array"===t&&"array"===e)):[]}(t,o.coerceTypes),l=t.length>0&&!(0===i.length&&1===t.length&&(0,n.schemaHasRulesForType)(e,t[0]));if(l){const n=f(t,s,o.strictNumbers,c.Wrong);r.if(n,(()=>{i.length?function(e,t,r){const{gen:s,data:n,opts:o}=e,i=s.let("dataType",a._`typeof ${n}`),c=s.let("coerced",a._`undefined`);"array"===o.coerceTypes&&s.if(a._`${i} == 'object' && Array.isArray(${n}) && ${n}.length == 1`,(()=>s.assign(n,a._`${n}[0]`).assign(i,a._`typeof ${n}`).if(f(t,n,o.strictNumbers),(()=>s.assign(c,n))))),s.if(a._`${c} !== undefined`);for(const e of r)(u.has(e)||"array"===e&&"array"===o.coerceTypes)&&l(e);function l(e){switch(e){case"string":return void s.elseIf(a._`${i} == "number" || ${i} == "boolean"`).assign(c,a._`"" + ${n}`).elseIf(a._`${n} === null`).assign(c,a._`""`);case"number":return void s.elseIf(a._`${i} == "boolean" || ${n} === null
|
|
3
3
|
|| (${i} == "string" && ${n} && ${n} == +${n})`).assign(c,a._`+${n}`);case"integer":return void s.elseIf(a._`${i} === "boolean" || ${n} === null
|
|
4
4
|
|| (${i} === "string" && ${n} && ${n} == +${n} && !(${n} % 1))`).assign(c,a._`+${n}`);case"boolean":return void s.elseIf(a._`${n} === "false" || ${n} === 0 || ${n} === null`).assign(c,!1).elseIf(a._`${n} === "true" || ${n} === 1`).assign(c,!0);case"null":return s.elseIf(a._`${n} === "" || ${n} === 0 || ${n} === false`),void s.assign(c,null);case"array":s.elseIf(a._`${i} === "string" || ${i} === "number"
|
|
5
|
-
|| ${i} === "boolean" || ${n} === null`).assign(c,a._`[${n}]`)}}s.else(),p(e),s.endIf(),s.if(a._`${c} !== undefined`,(()=>{s.assign(n,c),function({gen:e,parentData:t,parentDataProperty:r},s){e.if(a._`${t} !== undefined`,(()=>e.assign(a._`${t}[${r}]`,s)))}(e,c)}))}(e,t,i):p(e)}))}return l};const u=new Set(["string","number","integer","boolean","null"]);function d(e,t,r,s=c.Correct){const n=s===c.Correct?a.operators.EQ:a.operators.NEQ;let o;switch(e){case"null":return a._`${t} ${n} null`;case"array":o=a._`Array.isArray(${t})`;break;case"object":o=a._`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":o=i(a._`!(${t} % 1) && !isNaN(${t})`);break;case"number":o=i();break;default:return a._`typeof ${t} ${n} ${e}`}return s===c.Correct?o:(0,a.not)(o);function i(e=a.nil){return(0,a.and)(a._`typeof ${t} == "number"`,e,r?a._`isFinite(${t})`:a.nil)}}function f(e,t,r,s){if(1===e.length)return d(e[0],t,r,s);let n;const o=(0,i.toHash)(e);if(o.array&&o.object){const e=a._`typeof ${t} != "object"`;n=o.null?e:a._`!${t} || ${e}`,delete o.null,delete o.array,delete o.object}else n=a.nil;o.number&&delete o.integer;for(const e in o)n=(0,a.and)(n,d(e,t,r,s));return n}t.checkDataType=d,t.checkDataTypes=f;const h={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>"string"==typeof e?a._`{type: ${e}}`:a._`{type: ${t}}`};function p(e){const t=function(e){const{gen:t,data:r,schema:s}=e,n=(0,i.schemaRefOrVal)(e,s,"type");return{gen:t,keyword:"type",data:r,schema:s.type,schemaCode:n,schemaValue:n,parentSchema:s,params:{},it:e}}(e);(0,o.reportError)(t,h)}t.reportTypeError=p},906:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.assignDefaults=void 0;const s=r(9411),n=r(2390);function o(e,t,r){const{gen:o,compositeRule:a,data:i,opts:c}=e;if(void 0===r)return;const l=s._`${i}${(0,s.getProperty)(t)}`;if(a)return void(0,n.checkStrictMode)(e,`default is ignored for: ${l}`);let u=s._`${l} === undefined`;"empty"===c.useDefaults&&(u=s._`${u} || ${l} === null || ${l} === ""`),o.if(u,s._`${l} = ${(0,s.stringify)(r)}`)}t.assignDefaults=function(e,t){const{properties:r,items:s}=e.schema;if("object"===t&&r)for(const t in r)o(e,t,r[t].default);else"array"===t&&Array.isArray(s)&&s.forEach(((t,r)=>o(e,r,t.default)))}},9509:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getData=t.KeywordCxt=t.validateFunctionCode=void 0;const s=r(3343),n=r(1312),o=r(2411),a=r(1312),i=r(906),c=r(125),l=r(5379),u=r(9411),d=r(6579),f=r(4209),h=r(2390),p=r(6782);function m({gen:e,validateName:t,schema:r,schemaEnv:s,opts:n},o){n.code.es5?e.func(t,u._`${d.default.data}, ${d.default.valCxt}`,s.$async,(()=>{e.code(u._`"use strict"; ${g(r,n)}`),function(e,t){e.if(d.default.valCxt,(()=>{e.var(d.default.instancePath,u._`${d.default.valCxt}.${d.default.instancePath}`),e.var(d.default.parentData,u._`${d.default.valCxt}.${d.default.parentData}`),e.var(d.default.parentDataProperty,u._`${d.default.valCxt}.${d.default.parentDataProperty}`),e.var(d.default.rootData,u._`${d.default.valCxt}.${d.default.rootData}`),t.dynamicRef&&e.var(d.default.dynamicAnchors,u._`${d.default.valCxt}.${d.default.dynamicAnchors}`)}),(()=>{e.var(d.default.instancePath,u._`""`),e.var(d.default.parentData,u._`undefined`),e.var(d.default.parentDataProperty,u._`undefined`),e.var(d.default.rootData,d.default.data),t.dynamicRef&&e.var(d.default.dynamicAnchors,u._`{}`)}))}(e,n),e.code(o)})):e.func(t,u._`${d.default.data}, ${function(e){return u._`{${d.default.instancePath}="", ${d.default.parentData}, ${d.default.parentDataProperty}, ${d.default.rootData}=${d.default.data}${e.dynamicRef?u._`, ${d.default.dynamicAnchors}={}`:u.nil}}={}`}(n)}`,s.$async,(()=>e.code(g(r,n)).code(o)))}function g(e,t){const r="object"==typeof e&&e[t.schemaId];return r&&(t.code.source||t.code.process)?u._`/*# sourceURL=${r} */`:u.nil}function y({schema:e,self:t}){if("boolean"==typeof e)return!e;for(const r in e)if(t.RULES.all[r])return!0;return!1}function v(e){return"boolean"!=typeof e.schema}function _(e){(0,h.checkUnknownRules)(e),function(e){const{schema:t,errSchemaPath:r,opts:s,self:n}=e;t.$ref&&s.ignoreKeywordsWithRef&&(0,h.schemaHasRulesButRef)(t,n.RULES)&&n.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}(e)}function $(e,t){if(e.opts.jtd)return E(e,[],!1,t);const r=(0,n.getSchemaTypes)(e.schema);E(e,r,!(0,n.coerceAndCheckDataType)(e,r),t)}function w({gen:e,schemaEnv:t,schema:r,errSchemaPath:s,opts:n}){const o=r.$comment;if(!0===n.$comment)e.code(u._`${d.default.self}.logger.log(${o})`);else if("function"==typeof n.$comment){const r=u.str`${s}/$comment`,n=e.scopeValue("root",{ref:t.root});e.code(u._`${d.default.self}.opts.$comment(${o}, ${r}, ${n}.schema)`)}}function E(e,t,r,s){const{gen:n,schema:i,data:c,allErrors:l,opts:f,self:p}=e,{RULES:m}=p;function g(h){(0,o.shouldUseGroup)(i,h)&&(h.type?(n.if((0,a.checkDataType)(h.type,c,f.strictNumbers)),b(e,h),1===t.length&&t[0]===h.type&&r&&(n.else(),(0,a.reportTypeError)(e)),n.endIf()):b(e,h),l||n.if(u._`${d.default.errors} === ${s||0}`))}!i.$ref||!f.ignoreKeywordsWithRef&&(0,h.schemaHasRulesButRef)(i,m)?(f.jtd||function(e,t){!e.schemaEnv.meta&&e.opts.strictTypes&&(function(e,t){t.length&&(e.dataTypes.length?(t.forEach((t=>{S(e.dataTypes,t)||P(e,`type "${t}" not allowed by context "${e.dataTypes.join(",")}"`)})),e.dataTypes=e.dataTypes.filter((e=>S(t,e)))):e.dataTypes=t)}(e,t),e.opts.allowUnionTypes||function(e,t){t.length>1&&(2!==t.length||!t.includes("null"))&&P(e,"use allowUnionTypes to allow union type keyword")}(e,t),function(e,t){const r=e.self.RULES.all;for(const s in r){const n=r[s];if("object"==typeof n&&(0,o.shouldUseRule)(e.schema,n)){const{type:r}=n.definition;r.length&&!r.some((e=>{return s=e,(r=t).includes(s)||"number"===s&&r.includes("integer");var r,s}))&&P(e,`missing type "${r.join(",")}" for keyword "${s}"`)}}}(e,e.dataTypes))}(e,t),n.block((()=>{for(const e of m.rules)g(e);g(m.post)}))):n.block((()=>N(e,"$ref",m.all.$ref.definition)))}function b(e,t){const{gen:r,schema:s,opts:{useDefaults:n}}=e;n&&(0,i.assignDefaults)(e,t.type),r.block((()=>{for(const r of t.rules)(0,o.shouldUseRule)(s,r)&&N(e,r.keyword,r.definition,t.type)}))}function S(e,t){return e.includes(t)||"integer"===t&&e.includes("number")}function P(e,t){t+=` at "${e.schemaEnv.baseId+e.errSchemaPath}" (strictTypes)`,(0,h.checkStrictMode)(e,t,e.opts.strictTypes)}t.validateFunctionCode=function(e){v(e)&&(_(e),y(e))?function(e){const{schema:t,opts:r,gen:s}=e;m(e,(()=>{r.$comment&&t.$comment&&w(e),function(e){const{schema:t,opts:r}=e;void 0!==t.default&&r.useDefaults&&r.strictSchema&&(0,h.checkStrictMode)(e,"default is ignored in the schema root")}(e),s.let(d.default.vErrors,null),s.let(d.default.errors,0),r.unevaluated&&function(e){const{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",u._`${r}.evaluated`),t.if(u._`${e.evaluated}.dynamicProps`,(()=>t.assign(u._`${e.evaluated}.props`,u._`undefined`))),t.if(u._`${e.evaluated}.dynamicItems`,(()=>t.assign(u._`${e.evaluated}.items`,u._`undefined`)))}(e),$(e),function(e){const{gen:t,schemaEnv:r,validateName:s,ValidationError:n,opts:o}=e;r.$async?t.if(u._`${d.default.errors} === 0`,(()=>t.return(d.default.data)),(()=>t.throw(u._`new ${n}(${d.default.vErrors})`))):(t.assign(u._`${s}.errors`,d.default.vErrors),o.unevaluated&&function({gen:e,evaluated:t,props:r,items:s}){r instanceof u.Name&&e.assign(u._`${t}.props`,r),s instanceof u.Name&&e.assign(u._`${t}.items`,s)}(e),t.return(u._`${d.default.errors} === 0`))}(e)}))}(e):m(e,(()=>(0,s.topBoolOrEmptySchema)(e)))};class C{constructor(e,t,r){if((0,c.validateKeywordUsage)(e,t,r),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=r,this.data=e.data,this.schema=e.schema[r],this.$data=t.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,h.schemaRefOrVal)(e,this.schema,r,this.$data),this.schemaType=t.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=t,this.$data)this.schemaCode=e.gen.const("vSchema",j(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,c.validSchemaType)(this.schema,t.schemaType,t.allowUndefined))throw new Error(`${r} value must be ${JSON.stringify(t.schemaType)}`);("code"in t?t.trackErrors:!1!==t.errors)&&(this.errsCount=e.gen.const("_errs",d.default.errors))}result(e,t,r){this.failResult((0,u.not)(e),t,r)}failResult(e,t,r){this.gen.if(e),r?r():this.error(),t?(this.gen.else(),t(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,t){this.failResult((0,u.not)(e),void 0,t)}fail(e){if(void 0===e)return this.error(),void(this.allErrors||this.gen.if(!1));this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);const{schemaCode:t}=this;this.fail(u._`${t} !== undefined && (${(0,u.or)(this.invalid$data(),e)})`)}error(e,t,r){if(t)return this.setParams(t),this._error(e,r),void this.setParams({});this._error(e,r)}_error(e,t){(e?p.reportExtraError:p.reportError)(this,this.def.error,t)}$dataError(){(0,p.reportError)(this,this.def.$dataError||p.keyword$DataError)}reset(){if(void 0===this.errsCount)throw new Error('add "trackErrors" to keyword definition');(0,p.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,t){t?Object.assign(this.params,e):this.params=e}block$data(e,t,r=u.nil){this.gen.block((()=>{this.check$data(e,r),t()}))}check$data(e=u.nil,t=u.nil){if(!this.$data)return;const{gen:r,schemaCode:s,schemaType:n,def:o}=this;r.if((0,u.or)(u._`${s} === undefined`,t)),e!==u.nil&&r.assign(e,!0),(n.length||o.validateSchema)&&(r.elseIf(this.invalid$data()),this.$dataError(),e!==u.nil&&r.assign(e,!1)),r.else()}invalid$data(){const{gen:e,schemaCode:t,schemaType:r,def:s,it:n}=this;return(0,u.or)(function(){if(r.length){if(!(t instanceof u.Name))throw new Error("ajv implementation error");const e=Array.isArray(r)?r:[r];return u._`${(0,a.checkDataTypes)(e,t,n.opts.strictNumbers,a.DataType.Wrong)}`}return u.nil}(),function(){if(s.validateSchema){const r=e.scopeValue("validate$data",{ref:s.validateSchema});return u._`!${r}(${t})`}return u.nil}())}subschema(e,t){const r=(0,l.getSubschema)(this.it,e);(0,l.extendSubschemaData)(r,this.it,e),(0,l.extendSubschemaMode)(r,e);const n={...this.it,...r,items:void 0,props:void 0};return function(e,t){v(e)&&(_(e),y(e))?function(e,t){const{schema:r,gen:s,opts:n}=e;n.$comment&&r.$comment&&w(e),function(e){const t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,f.resolveUrl)(e.opts.uriResolver,e.baseId,t))}(e),function(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}(e);const o=s.const("_errs",d.default.errors);$(e,o),s.var(t,u._`${o} === ${d.default.errors}`)}(e,t):(0,s.boolOrEmptySchema)(e,t)}(n,t),n}mergeEvaluated(e,t){const{it:r,gen:s}=this;r.opts.unevaluated&&(!0!==r.props&&void 0!==e.props&&(r.props=h.mergeEvaluated.props(s,e.props,r.props,t)),!0!==r.items&&void 0!==e.items&&(r.items=h.mergeEvaluated.items(s,e.items,r.items,t)))}mergeValidEvaluated(e,t){const{it:r,gen:s}=this;if(r.opts.unevaluated&&(!0!==r.props||!0!==r.items))return s.if(t,(()=>this.mergeEvaluated(e,u.Name))),!0}}function N(e,t,r,s){const n=new C(e,r,t);"code"in r?r.code(n,s):n.$data&&r.validate?(0,c.funcKeywordCode)(n,r):"macro"in r?(0,c.macroKeywordCode)(n,r):(r.compile||r.validate)&&(0,c.funcKeywordCode)(n,r)}t.KeywordCxt=C;const O=/^\/(?:[^~]|~0|~1)*$/,R=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function j(e,{dataLevel:t,dataNames:r,dataPathArr:s}){let n,o;if(""===e)return d.default.rootData;if("/"===e[0]){if(!O.test(e))throw new Error(`Invalid JSON-pointer: ${e}`);n=e,o=d.default.rootData}else{const a=R.exec(e);if(!a)throw new Error(`Invalid JSON-pointer: ${e}`);const i=+a[1];if(n=a[2],"#"===n){if(i>=t)throw new Error(c("property/index",i));return s[t-i]}if(i>t)throw new Error(c("data",i));if(o=r[t-i],!n)return o}let a=o;const i=n.split("/");for(const e of i)e&&(o=u._`${o}${(0,u.getProperty)((0,h.unescapeJsonPointer)(e))}`,a=u._`${a} && ${o}`);return a;function c(e,r){return`Cannot access ${e} ${r} levels up, current level is ${t}`}}t.getData=j},125:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateKeywordUsage=t.validSchemaType=t.funcKeywordCode=t.macroKeywordCode=void 0;const s=r(9411),n=r(6579),o=r(2309),a=r(6782);function i(e){const{gen:t,data:r,it:n}=e;t.if(n.parentData,(()=>t.assign(r,s._`${n.parentData}[${n.parentDataProperty}]`)))}function c(e,t,r){if(void 0===r)throw new Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword","function"==typeof r?{ref:r}:{ref:r,code:(0,s.stringify)(r)})}t.macroKeywordCode=function(e,t){const{gen:r,keyword:n,schema:o,parentSchema:a,it:i}=e,l=t.macro.call(i.self,o,a,i),u=c(r,n,l);!1!==i.opts.validateSchema&&i.self.validateSchema(l,!0);const d=r.name("valid");e.subschema({schema:l,schemaPath:s.nil,errSchemaPath:`${i.errSchemaPath}/${n}`,topSchemaRef:u,compositeRule:!0},d),e.pass(d,(()=>e.error(!0)))},t.funcKeywordCode=function(e,t){var r;const{gen:l,keyword:u,schema:d,parentSchema:f,$data:h,it:p}=e;!function({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}(p,t);const m=!h&&t.compile?t.compile.call(p.self,d,f,p):t.validate,g=c(l,u,m),y=l.let("valid");function v(r=(t.async?s._`await `:s.nil)){const a=p.opts.passContext?n.default.this:n.default.self,i=!("compile"in t&&!h||!1===t.schema);l.assign(y,s._`${r}${(0,o.callValidateCode)(e,g,a,i)}`,t.modifying)}function _(e){var r;l.if((0,s.not)(null!==(r=t.valid)&&void 0!==r?r:y),e)}e.block$data(y,(function(){if(!1===t.errors)v(),t.modifying&&i(e),_((()=>e.error()));else{const r=t.async?function(){const e=l.let("ruleErrs",null);return l.try((()=>v(s._`await `)),(t=>l.assign(y,!1).if(s._`${t} instanceof ${p.ValidationError}`,(()=>l.assign(e,s._`${t}.errors`)),(()=>l.throw(t))))),e}():function(){const e=s._`${g}.errors`;return l.assign(e,null),v(s.nil),e}();t.modifying&&i(e),_((()=>function(e,t){const{gen:r}=e;r.if(s._`Array.isArray(${t})`,(()=>{r.assign(n.default.vErrors,s._`${n.default.vErrors} === null ? ${t} : ${n.default.vErrors}.concat(${t})`).assign(n.default.errors,s._`${n.default.vErrors}.length`),(0,a.extendErrors)(e)}),(()=>e.error()))}(e,r)))}})),e.ok(null!==(r=t.valid)&&void 0!==r?r:y)},t.validSchemaType=function(e,t,r=!1){return!t.length||t.some((t=>"array"===t?Array.isArray(e):"object"===t?e&&"object"==typeof e&&!Array.isArray(e):typeof e==t||r&&void 0===e))},t.validateKeywordUsage=function({schema:e,opts:t,self:r,errSchemaPath:s},n,o){if(Array.isArray(n.keyword)?!n.keyword.includes(o):n.keyword!==o)throw new Error("ajv implementation error");const a=n.dependencies;if(null==a?void 0:a.some((t=>!Object.prototype.hasOwnProperty.call(e,t))))throw new Error(`parent schema must have dependencies of ${o}: ${a.join(",")}`);if(n.validateSchema&&!n.validateSchema(e[o])){const e=`keyword "${o}" value is invalid at path "${s}": `+r.errorsText(n.validateSchema.errors);if("log"!==t.validateSchema)throw new Error(e);r.logger.error(e)}}},5379:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.extendSubschemaMode=t.extendSubschemaData=t.getSubschema=void 0;const s=r(9411),n=r(2390);t.getSubschema=function(e,{keyword:t,schemaProp:r,schema:o,schemaPath:a,errSchemaPath:i,topSchemaRef:c}){if(void 0!==t&&void 0!==o)throw new Error('both "keyword" and "schema" passed, only one allowed');if(void 0!==t){const o=e.schema[t];return void 0===r?{schema:o,schemaPath:s._`${e.schemaPath}${(0,s.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:o[r],schemaPath:s._`${e.schemaPath}${(0,s.getProperty)(t)}${(0,s.getProperty)(r)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,n.escapeFragment)(r)}`}}if(void 0!==o){if(void 0===a||void 0===i||void 0===c)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:o,schemaPath:a,topSchemaRef:c,errSchemaPath:i}}throw new Error('either "keyword" or "schema" must be passed')},t.extendSubschemaData=function(e,t,{dataProp:r,dataPropType:o,data:a,dataTypes:i,propertyName:c}){if(void 0!==a&&void 0!==r)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:l}=t;if(void 0!==r){const{errorPath:a,dataPathArr:i,opts:c}=t;u(l.let("data",s._`${t.data}${(0,s.getProperty)(r)}`,!0)),e.errorPath=s.str`${a}${(0,n.getErrorPath)(r,o,c.jsPropertySyntax)}`,e.parentDataProperty=s._`${r}`,e.dataPathArr=[...i,e.parentDataProperty]}function u(r){e.data=r,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,r]}void 0!==a&&(u(a instanceof s.Name?a:l.let("data",a,!0)),void 0!==c&&(e.propertyName=c)),i&&(e.dataTypes=i)},t.extendSubschemaMode=function(e,{jtdDiscriminator:t,jtdMetadata:r,compositeRule:s,createErrors:n,allErrors:o}){void 0!==s&&(e.compositeRule=s),void 0!==n&&(e.createErrors=n),void 0!==o&&(e.allErrors=o),e.jtdDiscriminator=t,e.jtdMetadata=r}},1030:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=void 0;var s=r(9509);Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return s.KeywordCxt}});var n=r(9411);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return n._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return n.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return n.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return n.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return n.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return n.CodeGen}});const o=r(1205),a=r(3003),i=r(1819),c=r(3584),l=r(9411),u=r(4209),d=r(1312),f=r(2390),h=r(9863),p=r(1603),m=(e,t)=>new RegExp(e,t);m.code="new RegExp";const g=["removeAdditional","useDefaults","coerceTypes"],y=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),v={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.'};function $(e){var t,r,s,n,o,a,i,c,l,u,d,f,h,g,y,v,_,$,w,E,b,S,P,C,N;const O=e.strict,R=null===(t=e.code)||void 0===t?void 0:t.optimize,j=!0===R||void 0===R?1:R||0,k=null!==(s=null===(r=e.code)||void 0===r?void 0:r.regExp)&&void 0!==s?s:m,T=null!==(n=e.uriResolver)&&void 0!==n?n:p.default;return{strictSchema:null===(a=null!==(o=e.strictSchema)&&void 0!==o?o:O)||void 0===a||a,strictNumbers:null===(c=null!==(i=e.strictNumbers)&&void 0!==i?i:O)||void 0===c||c,strictTypes:null!==(u=null!==(l=e.strictTypes)&&void 0!==l?l:O)&&void 0!==u?u:"log",strictTuples:null!==(f=null!==(d=e.strictTuples)&&void 0!==d?d:O)&&void 0!==f?f:"log",strictRequired:null!==(g=null!==(h=e.strictRequired)&&void 0!==h?h:O)&&void 0!==g&&g,code:e.code?{...e.code,optimize:j,regExp:k}:{optimize:j,regExp:k},loopRequired:null!==(y=e.loopRequired)&&void 0!==y?y:200,loopEnum:null!==(v=e.loopEnum)&&void 0!==v?v:200,meta:null===(_=e.meta)||void 0===_||_,messages:null===($=e.messages)||void 0===$||$,inlineRefs:null===(w=e.inlineRefs)||void 0===w||w,schemaId:null!==(E=e.schemaId)&&void 0!==E?E:"$id",addUsedSchema:null===(b=e.addUsedSchema)||void 0===b||b,validateSchema:null===(S=e.validateSchema)||void 0===S||S,validateFormats:null===(P=e.validateFormats)||void 0===P||P,unicodeRegExp:null===(C=e.unicodeRegExp)||void 0===C||C,int32range:null===(N=e.int32range)||void 0===N||N,uriResolver:T}}class w{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...$(e)};const{es5:t,lines:r}=this.opts.code;this.scope=new l.ValueScope({scope:{},prefixes:y,es5:t,lines:r}),this.logger=function(e){if(!1===e)return O;if(void 0===e)return console;if(e.log&&e.warn&&e.error)return e;throw new Error("logger must implement log, warn and error methods")}(e.logger);const s=e.validateFormats;e.validateFormats=!1,this.RULES=(0,i.getRules)(),E.call(this,v,e,"NOT SUPPORTED"),E.call(this,_,e,"DEPRECATED","warn"),this._metaOpts=N.call(this),e.formats&&P.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&C.call(this,e.keywords),"object"==typeof e.meta&&this.addMetaSchema(e.meta),S.call(this),e.validateFormats=s}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:e,meta:t,schemaId:r}=this.opts;let s=h;"id"===r&&(s={...h},s.id=s.$id,delete s.$id),t&&e&&this.addMetaSchema(s,s[r],!1)}defaultMeta(){const{meta:e,schemaId:t}=this.opts;return this.opts.defaultMeta="object"==typeof e?e[t]||e:void 0}validate(e,t){let r;if("string"==typeof e){if(r=this.getSchema(e),!r)throw new Error(`no schema with key or ref "${e}"`)}else r=this.compile(e);const s=r(t);return"$async"in r||(this.errors=r.errors),s}compile(e,t){const r=this._addSchema(e,t);return r.validate||this._compileSchemaEnv(r)}compileAsync(e,t){if("function"!=typeof this.opts.loadSchema)throw new Error("options.loadSchema should be a function");const{loadSchema:r}=this.opts;return s.call(this,e,t);async function s(e,t){await n.call(this,e.$schema);const r=this._addSchema(e,t);return r.validate||o.call(this,r)}async function n(e){e&&!this.getSchema(e)&&await s.call(this,{$ref:e},!0)}async function o(e){try{return this._compileSchemaEnv(e)}catch(t){if(!(t instanceof a.default))throw t;return i.call(this,t),await c.call(this,t.missingSchema),o.call(this,e)}}function i({missingSchema:e,missingRef:t}){if(this.refs[e])throw new Error(`AnySchema ${e} is loaded but ${t} cannot be resolved`)}async function c(e){const r=await l.call(this,e);this.refs[e]||await n.call(this,r.$schema),this.refs[e]||this.addSchema(r,e,t)}async function l(e){const t=this._loading[e];if(t)return t;try{return await(this._loading[e]=r(e))}finally{delete this._loading[e]}}}addSchema(e,t,r,s=this.opts.validateSchema){if(Array.isArray(e)){for(const t of e)this.addSchema(t,void 0,r,s);return this}let n;if("object"==typeof e){const{schemaId:t}=this.opts;if(n=e[t],void 0!==n&&"string"!=typeof n)throw new Error(`schema ${t} must be string`)}return t=(0,u.normalizeId)(t||n),this._checkUnique(t),this.schemas[t]=this._addSchema(e,r,t,s,!0),this}addMetaSchema(e,t,r=this.opts.validateSchema){return this.addSchema(e,t,!0,r),this}validateSchema(e,t){if("boolean"==typeof e)return!0;let r;if(r=e.$schema,void 0!==r&&"string"!=typeof r)throw new Error("$schema must be a string");if(r=r||this.opts.defaultMeta||this.defaultMeta(),!r)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const s=this.validate(r,e);if(!s&&t){const e="schema is invalid: "+this.errorsText();if("log"!==this.opts.validateSchema)throw new Error(e);this.logger.error(e)}return s}getSchema(e){let t;for(;"string"==typeof(t=b.call(this,e));)e=t;if(void 0===t){const{schemaId:r}=this.opts,s=new c.SchemaEnv({schema:{},schemaId:r});if(t=c.resolveSchema.call(this,s,e),!t)return;this.refs[e]=t}return t.validate||this._compileSchemaEnv(t)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const t=b.call(this,e);return"object"==typeof t&&this._cache.delete(t.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{const t=e;this._cache.delete(t);let r=e[this.opts.schemaId];return r&&(r=(0,u.normalizeId)(r),delete this.schemas[r],delete this.refs[r]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(const t of e)this.addKeyword(t);return this}addKeyword(e,t){let r;if("string"==typeof e)r=e,"object"==typeof t&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),t.keyword=r);else{if("object"!=typeof e||void 0!==t)throw new Error("invalid addKeywords parameters");if(r=(t=e).keyword,Array.isArray(r)&&!r.length)throw new Error("addKeywords: keyword must be string or non-empty array")}if(j.call(this,r,t),!t)return(0,f.eachItem)(r,(e=>k.call(this,e))),this;I.call(this,t);const s={...t,type:(0,d.getJSONTypes)(t.type),schemaType:(0,d.getJSONTypes)(t.schemaType)};return(0,f.eachItem)(r,0===s.type.length?e=>k.call(this,e,s):e=>s.type.forEach((t=>k.call(this,e,s,t)))),this}getKeyword(e){const t=this.RULES.all[e];return"object"==typeof t?t.definition:!!t}removeKeyword(e){const{RULES:t}=this;delete t.keywords[e],delete t.all[e];for(const r of t.rules){const t=r.rules.findIndex((t=>t.keyword===e));t>=0&&r.rules.splice(t,1)}return this}addFormat(e,t){return"string"==typeof t&&(t=new RegExp(t)),this.formats[e]=t,this}errorsText(e=this.errors,{separator:t=", ",dataVar:r="data"}={}){return e&&0!==e.length?e.map((e=>`${r}${e.instancePath} ${e.message}`)).reduce(((e,r)=>e+t+r)):"No errors"}$dataMetaSchema(e,t){const r=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(const s of t){const t=s.split("/").slice(1);let n=e;for(const e of t)n=n[e];for(const e in r){const t=r[e];if("object"!=typeof t)continue;const{$data:s}=t.definition,o=n[e];s&&o&&(n[e]=D(o))}}return e}_removeAllSchemas(e,t){for(const r in e){const s=e[r];t&&!t.test(r)||("string"==typeof s?delete e[r]:s&&!s.meta&&(this._cache.delete(s.schema),delete e[r]))}}_addSchema(e,t,r,s=this.opts.validateSchema,n=this.opts.addUsedSchema){let o;const{schemaId:a}=this.opts;if("object"==typeof e)o=e[a];else{if(this.opts.jtd)throw new Error("schema must be object");if("boolean"!=typeof e)throw new Error("schema must be object or boolean")}let i=this._cache.get(e);if(void 0!==i)return i;r=(0,u.normalizeId)(o||r);const l=u.getSchemaRefs.call(this,e,r);return i=new c.SchemaEnv({schema:e,schemaId:a,meta:t,baseId:r,localRefs:l}),this._cache.set(i.schema,i),n&&!r.startsWith("#")&&(r&&this._checkUnique(r),this.refs[r]=i),s&&this.validateSchema(e,!0),i}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):c.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){const t=this.opts;this.opts=this._metaOpts;try{c.compileSchema.call(this,e)}finally{this.opts=t}}}function E(e,t,r,s="error"){for(const n in e){const o=n;o in t&&this.logger[s](`${r}: option ${n}. ${e[o]}`)}}function b(e){return e=(0,u.normalizeId)(e),this.schemas[e]||this.refs[e]}function S(){const e=this.opts.schemas;if(e)if(Array.isArray(e))this.addSchema(e);else for(const t in e)this.addSchema(e[t],t)}function P(){for(const e in this.opts.formats){const t=this.opts.formats[e];t&&this.addFormat(e,t)}}function C(e){if(Array.isArray(e))this.addVocabulary(e);else{this.logger.warn("keywords option as map is deprecated, pass array");for(const t in e){const r=e[t];r.keyword||(r.keyword=t),this.addKeyword(r)}}}function N(){const e={...this.opts};for(const t of g)delete e[t];return e}t.default=w,w.ValidationError=o.default,w.MissingRefError=a.default;const O={log(){},warn(){},error(){}},R=/^[a-z_$][a-z0-9_$:-]*$/i;function j(e,t){const{RULES:r}=this;if((0,f.eachItem)(e,(e=>{if(r.keywords[e])throw new Error(`Keyword ${e} is already defined`);if(!R.test(e))throw new Error(`Keyword ${e} has invalid name`)})),t&&t.$data&&!("code"in t)&&!("validate"in t))throw new Error('$data keyword must have "code" or "validate" function')}function k(e,t,r){var s;const n=null==t?void 0:t.post;if(r&&n)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:o}=this;let a=n?o.post:o.rules.find((({type:e})=>e===r));if(a||(a={type:r,rules:[]},o.rules.push(a)),o.keywords[e]=!0,!t)return;const i={keyword:e,definition:{...t,type:(0,d.getJSONTypes)(t.type),schemaType:(0,d.getJSONTypes)(t.schemaType)}};t.before?T.call(this,a,i,t.before):a.rules.push(i),o.all[e]=i,null===(s=t.implements)||void 0===s||s.forEach((e=>this.addKeyword(e)))}function T(e,t,r){const s=e.rules.findIndex((e=>e.keyword===r));s>=0?e.rules.splice(s,0,t):(e.rules.push(t),this.logger.warn(`rule ${r} is not defined`))}function I(e){let{metaSchema:t}=e;void 0!==t&&(e.$data&&this.opts.$data&&(t=D(t)),e.validateSchema=this.compile(t,!0))}const A={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function D(e){return{anyOf:[e,A]}}},4179:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=void 0;const s=r(1030),n=r(5735),o=r(1361),a=r(1509),i=r(9378),c="JTD-meta-schema";class l extends s.default{constructor(e={}){super({...e,jtd:!0})}_addVocabularies(){super._addVocabularies(),this.addVocabulary(n.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema(),this.opts.meta&&this.addMetaSchema(o.default,c,!1)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(c)?c: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(i.default.call(this,e,e.schema.definitions||{}),!e.parse)throw new Error("ajv implementation error");return e.parse}}e.exports=t=l,Object.defineProperty(t,"__esModule",{value:!0}),t.default=l;var u=r(9509);Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return u.KeywordCxt}});var d=r(9411);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return d._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return d.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return d.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return d.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return d.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return d.CodeGen}})},1361:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=e=>{const t={nullable:{type:"boolean"},metadata:{optionalProperties:{union:{elements:{ref:"schema"}}},additionalProperties:!0}};return e&&(t.definitions={values:{ref:"schema"}}),t},s=e=>({optionalProperties:r(e)}),n=e=>({properties:{ref:{type:"string"}},optionalProperties:r(e)}),o=e=>({properties:{type:{enum:["boolean","timestamp","string","float32","float64","int8","uint8","int16","uint16","int32","uint32"]}},optionalProperties:r(e)}),a=e=>({properties:{enum:{elements:{type:"string"}}},optionalProperties:r(e)}),i=e=>({properties:{elements:{ref:"schema"}},optionalProperties:r(e)}),c=e=>({properties:{properties:{values:{ref:"schema"}}},optionalProperties:{optionalProperties:{values:{ref:"schema"}},additionalProperties:{type:"boolean"},...r(e)}}),l=e=>({properties:{optionalProperties:{values:{ref:"schema"}}},optionalProperties:{additionalProperties:{type:"boolean"},...r(e)}}),u=e=>({properties:{discriminator:{type:"string"},mapping:{values:{metadata:{union:[c(!1),l(!1)]}}}},optionalProperties:r(e)}),d=e=>({properties:{values:{ref:"schema"}},optionalProperties:r(e)}),f=e=>({metadata:{union:[s,n,o,a,i,c,l,u,d].map((t=>t(e)))}}),h={definitions:{schema:f(!1)},...f(!0)};t.default=h},3561:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseJsonString=t.parseJsonNumber=t.parseJson=void 0;const r=/position\s(\d+)$/;function s(e,t){let n,o;s.message=void 0,t&&(e=e.slice(t));try{return s.position=t+e.length,JSON.parse(e)}catch(a){if(o=r.exec(a.message),!o)return void(s.message="unexpected end");n=+o[1];const i=e[n];e=e.slice(0,n),s.position=t+n;try{return JSON.parse(e)}catch(e){return void(s.message=`unexpected token ${i}`)}}}function n(e,t,r){let s,o="";if(n.message=void 0,"-"===e[t]&&(o+="-",t++),"0"===e[t])o+="0",t++;else if(!a(r))return void i();if(r)return n.position=t,+o;if("."!==e[t]||(o+=".",t++,a())){if(s=e[t],"e"!==s&&"E"!==s||(o+="e",t++,s=e[t],("+"===s||"-"===s)&&(o+=s,t++),a()))return n.position=t,+o;i()}else i();function a(r){let n=!1;for(;s=e[t],s>="0"&&s<="9"&&(void 0===r||r-- >0);)n=!0,o+=s,t++;return n}function i(){n.position=t,n.message=t<e.length?`unexpected token ${e[t]}`:"unexpected end"}}t.parseJson=s,s.message=void 0,s.position=0,s.code='require("ajv/dist/runtime/parseJson").parseJson',t.parseJsonNumber=n,n.message=void 0,n.position=0,n.code='require("ajv/dist/runtime/parseJson").parseJsonNumber';const o={b:"\b",f:"\f",n:"\n",r:"\r",t:"\t",'"':'"',"/":"/","\\":"\\"},a="a".charCodeAt(0),i="0".charCodeAt(0);function c(e,t){let r,s="";for(c.message=void 0;r=e[t++],'"'!==r;)if("\\"===r)if(r=e[t],r in o)s+=o[r],t++;else{if("u"!==r)return void n(`unexpected token ${r}`);{t++;let o=4,c=0;for(;o--;){if(c<<=4,r=e[t],void 0===r)return void n("unexpected end");if(r=r.toLowerCase(),r>="a"&&r<="f")c+=r.charCodeAt(0)-a+10;else{if(!(r>="0"&&r<="9"))return void n(`unexpected token ${r}`);c+=r.charCodeAt(0)-i}t++}s+=String.fromCharCode(c)}}else{if(void 0===r)return void n("unexpected end");if(!(r.charCodeAt(0)>=32))return void n(`unexpected token ${r}`);s+=r}return c.position=t,s;function n(e){c.position=t,c.message=e}}t.parseJsonString=c,c.message=void 0,c.position=0,c.code='require("ajv/dist/runtime/parseJson").parseJsonString'},3456:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=/[\\"\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,s={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};function n(e){return r.lastIndex=0,'"'+(r.test(e)?e.replace(r,(e=>{const t=s[e];return"string"==typeof t?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})):e)+'"'}t.default=n,n.code='require("ajv/dist/runtime/quote").default'},6596:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=/t|\s/i,s=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,n=/^(\d\d):(\d\d):(\d\d)(?:\.\d+)?(?:z|([+-]\d\d)(?::?(\d\d))?)$/i,o=[0,31,28,31,30,31,30,31,31,30,31,30,31];function a(e,t){const s=e.split(r);return 2===s.length&&i(s[0])&&function(e){const t=n.exec(e);if(!t)return!1;const r=+t[1],s=+t[2],o=+t[3],a=+(t[4]||0),i=+(t[5]||0);return r<=23&&s<=59&&o<=59||r-a==23&&s-i==59&&60===o}(s[1])||t&&1===s.length&&i(s[0])}function i(e){const t=s.exec(e);if(!t)return!1;const r=+t[1],n=+t[2],a=+t[3];return n>=1&&n<=12&&a>=1&&(a<=o[n]||2===n&&29===a&&(r%100==0?r%400==0:r%4==0))}t.default=a,a.code='require("ajv/dist/runtime/timestamp").default'},1603:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=r(540);s.code='require("ajv/dist/runtime/uri").default',t.default=s},1205:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});class r extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}}t.default=r},2309:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateUnion=t.validateArray=t.usePattern=t.callValidateCode=t.schemaProperties=t.allSchemaProperties=t.noPropertyInData=t.propertyInData=t.isOwnProperty=t.hasPropFunc=t.reportMissingProp=t.checkMissingProp=t.checkReportMissingProp=void 0;const s=r(9411),n=r(2390),o=r(6579),a=r(2390);function i(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:s._`Object.prototype.hasOwnProperty`})}function c(e,t,r){return s._`${i(e)}.call(${t}, ${r})`}function l(e,t,r,n){const o=s._`${t}${(0,s.getProperty)(r)} === undefined`;return n?(0,s.or)(o,(0,s.not)(c(e,t,r))):o}function u(e){return e?Object.keys(e).filter((e=>"__proto__"!==e)):[]}t.checkReportMissingProp=function(e,t){const{gen:r,data:n,it:o}=e;r.if(l(r,n,t,o.opts.ownProperties),(()=>{e.setParams({missingProperty:s._`${t}`},!0),e.error()}))},t.checkMissingProp=function({gen:e,data:t,it:{opts:r}},n,o){return(0,s.or)(...n.map((n=>(0,s.and)(l(e,t,n,r.ownProperties),s._`${o} = ${n}`))))},t.reportMissingProp=function(e,t){e.setParams({missingProperty:t},!0),e.error()},t.hasPropFunc=i,t.isOwnProperty=c,t.propertyInData=function(e,t,r,n){const o=s._`${t}${(0,s.getProperty)(r)} !== undefined`;return n?s._`${o} && ${c(e,t,r)}`:o},t.noPropertyInData=l,t.allSchemaProperties=u,t.schemaProperties=function(e,t){return u(t).filter((r=>!(0,n.alwaysValidSchema)(e,t[r])))},t.callValidateCode=function({schemaCode:e,data:t,it:{gen:r,topSchemaRef:n,schemaPath:a,errorPath:i},it:c},l,u,d){const f=d?s._`${e}, ${t}, ${n}${a}`:t,h=[[o.default.instancePath,(0,s.strConcat)(o.default.instancePath,i)],[o.default.parentData,c.parentData],[o.default.parentDataProperty,c.parentDataProperty],[o.default.rootData,o.default.rootData]];c.opts.dynamicRef&&h.push([o.default.dynamicAnchors,o.default.dynamicAnchors]);const p=s._`${f}, ${r.object(...h)}`;return u!==s.nil?s._`${l}.call(${u}, ${p})`:s._`${l}(${p})`};const d=s._`new RegExp`;t.usePattern=function({gen:e,it:{opts:t}},r){const n=t.unicodeRegExp?"u":"",{regExp:o}=t.code,i=o(r,n);return e.scopeValue("pattern",{key:i.toString(),ref:i,code:s._`${"new RegExp"===o.code?d:(0,a.useFunc)(e,o)}(${r}, ${n})`})},t.validateArray=function(e){const{gen:t,data:r,keyword:o,it:a}=e,i=t.name("valid");if(a.allErrors){const e=t.let("valid",!0);return c((()=>t.assign(e,!1))),e}return t.var(i,!0),c((()=>t.break())),i;function c(a){const c=t.const("len",s._`${r}.length`);t.forRange("i",0,c,(r=>{e.subschema({keyword:o,dataProp:r,dataPropType:n.Type.Num},i),t.if((0,s.not)(i),a)}))}},t.validateUnion=function(e){const{gen:t,schema:r,keyword:o,it:a}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some((e=>(0,n.alwaysValidSchema)(a,e)))&&!a.opts.unevaluated)return;const i=t.let("valid",!1),c=t.name("_valid");t.block((()=>r.forEach(((r,n)=>{const a=e.subschema({keyword:o,schemaProp:n,compositeRule:!0},c);t.assign(i,s._`${i} || ${c}`),e.mergeValidEvaluated(a,c)||t.if((0,s.not)(i))})))),e.result(i,(()=>e.reset()),(()=>e.error(!0)))}},8697:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.callRef=t.getValidate=void 0;const s=r(3003),n=r(2309),o=r(9411),a=r(6579),i=r(3584),c=r(2390),l={keyword:"$ref",schemaType:"string",code(e){const{gen:t,schema:r,it:n}=e,{baseId:a,schemaEnv:c,validateName:l,opts:f,self:h}=n,{root:p}=c;if(("#"===r||"#/"===r)&&a===p.baseId)return function(){if(c===p)return d(e,l,c,c.$async);const r=t.scopeValue("root",{ref:p});return d(e,o._`${r}.validate`,p,p.$async)}();const m=i.resolveRef.call(h,p,a,r);if(void 0===m)throw new s.default(n.opts.uriResolver,a,r);return m instanceof i.SchemaEnv?function(t){const r=u(e,t);d(e,r,t,t.$async)}(m):function(s){const n=t.scopeValue("schema",!0===f.code.source?{ref:s,code:(0,o.stringify)(s)}:{ref:s}),a=t.name("valid"),i=e.subschema({schema:s,dataTypes:[],schemaPath:o.nil,topSchemaRef:n,errSchemaPath:r},a);e.mergeEvaluated(i),e.ok(a)}(m)}};function u(e,t){const{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):o._`${r.scopeValue("wrapper",{ref:t})}.validate`}function d(e,t,r,s){const{gen:i,it:l}=e,{allErrors:u,schemaEnv:d,opts:f}=l,h=f.passContext?a.default.this:o.nil;function p(e){const t=o._`${e}.errors`;i.assign(a.default.vErrors,o._`${a.default.vErrors} === null ? ${t} : ${a.default.vErrors}.concat(${t})`),i.assign(a.default.errors,o._`${a.default.vErrors}.length`)}function m(e){var t;if(!l.opts.unevaluated)return;const s=null===(t=null==r?void 0:r.validate)||void 0===t?void 0:t.evaluated;if(!0!==l.props)if(s&&!s.dynamicProps)void 0!==s.props&&(l.props=c.mergeEvaluated.props(i,s.props,l.props));else{const t=i.var("props",o._`${e}.evaluated.props`);l.props=c.mergeEvaluated.props(i,t,l.props,o.Name)}if(!0!==l.items)if(s&&!s.dynamicItems)void 0!==s.items&&(l.items=c.mergeEvaluated.items(i,s.items,l.items));else{const t=i.var("items",o._`${e}.evaluated.items`);l.items=c.mergeEvaluated.items(i,t,l.items,o.Name)}}s?function(){if(!d.$async)throw new Error("async schema referenced by sync schema");const r=i.let("valid");i.try((()=>{i.code(o._`await ${(0,n.callValidateCode)(e,t,h)}`),m(t),u||i.assign(r,!0)}),(e=>{i.if(o._`!(${e} instanceof ${l.ValidationError})`,(()=>i.throw(e))),p(e),u||i.assign(r,!1)})),e.ok(r)}():e.result((0,n.callValidateCode)(e,t,h),(()=>m(t)),(()=>p(t)))}t.getValidate=u,t.callRef=d,t.default=l},7218:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.DiscrError=void 0,(r=t.DiscrError||(t.DiscrError={})).Tag="tag",r.Mapping="mapping"},5838:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=r(9411),n=r(5327),o=r(7741),a=r(6901),i=r(7218),c={keyword:"discriminator",schemaType:"string",implements:["mapping"],error:{message:e=>{const{schema:t,params:r}=e;return r.discrError?r.discrError===i.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in mapping`:(0,a.typeErrorMessage)(e,"object")},params:e=>{const{schema:t,params:r}=e;return r.discrError?s._`{error: ${r.discrError}, tag: ${t}, tagValue: ${r.tag}}`:(0,a.typeErrorParams)(e,"object")}},code(e){(0,n.checkMetadata)(e);const{gen:t,data:r,schema:a,parentSchema:c}=e,[l,u]=(0,o.checkNullableObject)(e,r);function d(r){const s=t.name("valid");return e.subschema({keyword:"mapping",schemaProp:r,jtdDiscriminator:a},s),s}t.if(u),function(){const n=t.const("tag",s._`${r}${(0,s.getProperty)(a)}`);t.if(s._`${n} === undefined`),e.error(!1,{discrError:i.DiscrError.Tag,tag:n}),t.elseIf(s._`typeof ${n} == "string"`),function(r){t.if(!1);for(const e in c.mapping)t.elseIf(s._`${r} === ${e}`),t.assign(l,d(e));t.else(),e.error(!1,{discrError:i.DiscrError.Mapping,tag:r},{instancePath:a,schemaPath:"mapping",parentSchema:!0}),t.endIf()}(n),t.else(),e.error(!1,{discrError:i.DiscrError.Tag,tag:n},{instancePath:a}),t.endIf()}(),t.elseIf((0,s.not)(l)),e.error(),t.endIf(),e.ok(l)}};t.default=c},5983:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=r(2390),n=r(2309),o=r(9411),a=r(5327),i=r(7741),c={keyword:"elements",schemaType:"object",error:(0,r(6901).typeError)("array"),code(e){(0,a.checkMetadata)(e);const{gen:t,data:r,schema:c,it:l}=e;if((0,s.alwaysValidSchema)(l,c))return;const[u]=(0,i.checkNullable)(e);t.if((0,o.not)(u),(()=>t.if(o._`Array.isArray(${r})`,(()=>t.assign(u,(0,n.validateArray)(e))),(()=>e.error())))),e.ok(u)}};t.default=c},6583:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=r(9411),n=r(5327),o=r(7741),a={keyword:"enum",schemaType:"array",error:{message:"must be equal to one of the allowed values",params:({schemaCode:e})=>s._`{allowedValues: ${e}}`},code(e){(0,n.checkMetadata)(e);const{gen:t,data:r,schema:a,schemaValue:i,parentSchema:c,it:l}=e;if(0===a.length)throw new Error("enum must have non-empty array");if(a.length!==new Set(a).size)throw new Error("enum items must be unique");let u;const d=s._`typeof ${r} == "string"`;if(a.length>=l.opts.loopEnum){let n;[u,n]=(0,o.checkNullable)(e,d),t.if(n,(function(){t.forOf("v",i,(e=>t.if(s._`${u} = ${r} === ${e}`,(()=>t.break()))))}))}else{if(!Array.isArray(a))throw new Error("ajv implementation error");u=(0,s.and)(d,(0,s.or)(...a.map((e=>s._`${r} === ${e}`)))),c.nullable&&(u=(0,s.or)(s._`${r} === null`,u))}e.pass(u)}};t.default=a},6901:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.typeErrorParams=t.typeErrorMessage=t.typeError=void 0;const s=r(9411);function n({parentSchema:e},t){return(null==e?void 0:e.nullable)?`must be ${t} or null`:`must be ${t}`}function o({parentSchema:e},t){return s._`{type: ${t}, nullable: ${!!(null==e?void 0:e.nullable)}}`}t.typeError=function(e){return{message:t=>n(t,e),params:t=>o(t,e)}},t.typeErrorMessage=n,t.typeErrorParams=o},5735:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=r(1837),n=r(4394),o=r(6583),a=r(5983),i=r(840),c=r(7679),l=r(5838),u=r(9933),d=r(2350),f=r(5327),h=["definitions",s.default,n.default,o.default,a.default,i.default,c.default,l.default,u.default,d.default,f.default,{keyword:"additionalProperties",schemaType:"boolean"},{keyword:"nullable",schemaType:"boolean"}];t.default=h},5327:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.checkMetadata=void 0;const s=r(2390),n={keyword:"metadata",schemaType:"object",code(e){o(e);const{gen:t,schema:r,it:n}=e;if((0,s.alwaysValidSchema)(n,r))return;const a=t.name("valid");e.subschema({keyword:"metadata",jtdMetadata:!0},a),e.ok(a)}};function o({it:e,keyword:t},r){if(e.jtdMetadata!==r)throw new Error(`JTD: "${t}" cannot be used in this schema location`)}t.checkMetadata=o,t.default=n},7741:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.checkNullableObject=t.checkNullable=void 0;const s=r(9411);function n({gen:e,data:t,parentSchema:r},n=s.nil){const o=e.name("valid");return r.nullable?(e.let(o,s._`${t} === null`),n=(0,s.not)(o)):e.let(o,!1),[o,n]}t.checkNullable=n,t.checkNullableObject=function(e,t){const[r,o]=n(e,t);return[r,s._`${o} && typeof ${e.data} == "object" && !Array.isArray(${e.data})`]}},7679:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=r(840),n={keyword:"optionalProperties",schemaType:"object",error:s.error,code(e){e.parentSchema.properties||(0,s.validateProperties)(e)}};t.default=n},840:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateProperties=t.error=void 0;const s=r(2309),n=r(2390),o=r(9411),a=r(5327),i=r(7741),c=r(6901);var l;!function(e){e.Additional="additional",e.Missing="missing"}(l||(l={})),t.error={message:e=>{const{params:t}=e;return t.propError?t.propError===l.Additional?"must NOT have additional properties":`must have property '${t.missingProperty}'`:(0,c.typeErrorMessage)(e,"object")},params:e=>{const{params:t}=e;return t.propError?t.propError===l.Additional?o._`{error: ${t.propError}, additionalProperty: ${t.additionalProperty}}`:o._`{error: ${t.propError}, missingProperty: ${t.missingProperty}}`:(0,c.typeErrorParams)(e,"object")}};const u={keyword:"properties",schemaType:"object",error:t.error,code:d};function d(e){(0,a.checkMetadata)(e);const{gen:t,data:r,parentSchema:c,it:u}=e,{additionalProperties:d,nullable:f}=c;if(u.jtdDiscriminator&&f)throw new Error("JTD: nullable inside discriminator mapping");if(function(){const e=c.properties,t=c.optionalProperties;if(!e||!t)return!1;for(const r in e)if(Object.prototype.hasOwnProperty.call(t,r))return!0;return!1}())throw new Error("JTD: properties and optionalProperties have common members");const[h,p]=_("properties"),[m,g]=_("optionalProperties");if(0===p.length&&0===g.length&&d)return;const[y,v]=void 0===u.jtdDiscriminator?(0,i.checkNullableObject)(e,r):[t.let("valid",!1),!0];function _(e){const t=c[e],r=t?(0,s.allSchemaProperties)(t):[];if(u.jtdDiscriminator&&r.some((e=>e===u.jtdDiscriminator)))throw new Error(`JTD: discriminator tag used in ${e}`);const o=r.filter((e=>!(0,n.alwaysValidSchema)(u,t[e])));return[r,o]}function $(n,o,a){const i=t.var("valid");for(const a of n)t.if((0,s.propertyInData)(t,r,a,u.opts.ownProperties),(()=>w(a,o,i)),(()=>c(a))),e.ok(i);function c(r){a?(t.assign(i,!1),e.error(!1,{propError:l.Missing,missingProperty:r},{schemaPath:r})):t.assign(i,!0)}}function w(t,r,s){e.subschema({keyword:r,schemaProp:t,dataProp:t},s)}function E(e,r,a){let i;if(r.length>8){const r=(0,n.schemaRefOrVal)(u,c[a],a);i=(0,o.not)((0,s.isOwnProperty)(t,r,e))}else i=!r.length||(0,o.and)(...r.map((t=>o._`${e} !== ${t}`)));return i}t.if(v,(()=>t.assign(y,!0).block((()=>{$(p,"properties",!0),$(g,"optionalProperties"),d||t.forIn("key",r,(s=>{const n=void 0===u.jtdDiscriminator?h:[u.jtdDiscriminator].concat(h),a=E(s,n,"properties"),i=E(s,m,"optionalProperties"),c=!0===a?i:!0===i?a:(0,o.and)(a,i);t.if(c,(()=>{u.opts.removeAdditional?t.code(o._`delete ${r}[${s}]`):(e.error(!1,{propError:l.Additional,additionalProperty:s},{instancePath:s,parentSchema:!0}),u.opts.allErrors||t.break())}))}))})))),e.pass(y)}t.validateProperties=d,t.default=u},1837:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hasRef=void 0;const s=r(3584),n=r(9411),o=r(3003),a=r(6579),i=r(8697),c=r(5327),l={keyword:"ref",schemaType:"string",code(e){(0,c.checkMetadata)(e);const{gen:t,data:r,schema:l,parentSchema:d,it:f}=e,{schemaEnv:{root:h}}=f,p=t.name("valid");function m(){var r;const c=null===(r=h.schema.definitions)||void 0===r?void 0:r[l];if(!c)throw new o.default(f.opts.uriResolver,"",l,`No definition ${l}`);u(c)||!f.opts.inlineRefs?function(r){const o=s.compileSchema.call(f.self,new s.SchemaEnv({schema:r,root:h,schemaPath:`/definitions/${l}`})),c=(0,i.getValidate)(e,o),u=t.const("_errs",a.default.errors);(0,i.callRef)(e,c,o,o.$async),t.assign(p,n._`${u} === ${a.default.errors}`)}(c):function(r){const s=t.scopeValue("schema",!0===f.opts.code.source?{ref:r,code:(0,n.stringify)(r)}:{ref:r});e.subschema({schema:r,dataTypes:[],schemaPath:n.nil,topSchemaRef:s,errSchemaPath:`/definitions/${l}`},p)}(c)}d.nullable?(t.var(p,n._`${r} === null`),t.if((0,n.not)(p),m)):(t.var(p,!1),m()),e.ok(p)}};function u(e){for(const t in e){let r;if("ref"===t||"object"==typeof(r=e[t])&&u(r))return!0}return!1}t.hasRef=u,t.default=l},4394:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.intRange=void 0;const s=r(9411),n=r(6596),o=r(2390),a=r(5327),i=r(6901);t.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 c={keyword:"type",schemaType:"string",error:{message:e=>(0,i.typeErrorMessage)(e,e.schema),params:e=>(0,i.typeErrorParams)(e,e.schema)},code(e){(0,a.checkMetadata)(e);const{data:r,schema:i,parentSchema:c,it:l}=e;let u;switch(i){case"boolean":case"string":u=s._`typeof ${r} == ${i}`;break;case"timestamp":u=function(e){const{gen:t,data:r,it:a}=e,{timestamp:i,allowDate:c}=a.opts;if("date"===i)return s._`${r} instanceof Date `;const l=(0,o.useFunc)(t,n.default),u=c?s._`, true`:s.nil,d=s._`typeof ${r} == "string" && ${l}(${r}${u})`;return"string"===i?d:(0,s.or)(s._`${r} instanceof Date`,d)}(e);break;case"float32":case"float64":u=s._`typeof ${r} == "number"`;break;default:{const e=i;if(u=s._`typeof ${r} == "number" && isFinite(${r}) && !(${r} % 1)`,l.opts.int32range||"int32"!==e&&"uint32"!==e){const[n,o]=t.intRange[e];u=s._`${u} && ${r} >= ${n} && ${r} <= ${o}`}else"uint32"===e&&(u=s._`${u} && ${r} >= 0`)}}e.pass(c.nullable?(0,s.or)(s._`${r} === null`,u):u)}};t.default=c},2350:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s={keyword:"union",schemaType:"array",trackErrors:!0,code:r(2309).validateUnion,error:{message:"must match a schema in union"}};t.default=s},9933:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=r(2390),n=r(9411),o=r(5327),a=r(7741),i={keyword:"values",schemaType:"object",error:(0,r(6901).typeError)("object"),code(e){(0,o.checkMetadata)(e);const{gen:t,data:r,schema:i,it:c}=e;if((0,s.alwaysValidSchema)(c,i))return;const[l,u]=(0,a.checkNullableObject)(e,r);t.if(u),t.assign(l,function(){const o=t.name("valid");if(c.allErrors){const e=t.let("valid",!0);return a((()=>t.assign(e,!1))),e}return t.var(o,!0),a((()=>t.break())),o;function a(a){t.forIn("key",r,(r=>{e.subschema({keyword:"values",dataProp:r,dataPropType:s.Type.Str},o),t.if((0,n.not)(o),a)}))}}()),t.elseIf((0,n.not)(l)),e.error(),t.endIf(),e.ok(l)}};t.default=i},2125:e=>{"use strict";var t=e.exports=function(e,t,s){"function"==typeof t&&(s=t,t={}),r(t,"function"==typeof(s=t.cb||s)?s:s.pre||function(){},s.post||function(){},e,"",e)};function r(e,s,n,o,a,i,c,l,u,d){if(o&&"object"==typeof o&&!Array.isArray(o)){for(var f in s(o,a,i,c,l,u,d),o){var h=o[f];if(Array.isArray(h)){if(f in t.arrayKeywords)for(var p=0;p<h.length;p++)r(e,s,n,h[p],a+"/"+f+"/"+p,i,a,f,o,p)}else if(f in t.propsKeywords){if(h&&"object"==typeof h)for(var m in h)r(e,s,n,h[m],a+"/"+f+"/"+m.replace(/~/g,"~0").replace(/\//g,"~1"),i,a,f,o,m)}else(f in t.keywords||e.allKeys&&!(f in t.skipKeywords))&&r(e,s,n,h,a+"/"+f,i,a,f,o)}n(o,a,i,c,l,u,d)}}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}},1227:(e,t,r)=>{t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const r="color: "+this.color;t.splice(1,0,r,"color: inherit");let s=0,n=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(s++,"%c"===e&&(n=s))})),t.splice(n,0,r)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e},t.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!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"],t.log=console.debug||console.log||(()=>{}),e.exports=r(2447)(t);const{formatters:s}=e.exports;s.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},2447:(e,t,r)=>{e.exports=function(e){function t(e){let r,n,o,a=null;function i(...e){if(!i.enabled)return;const s=i,n=Number(new Date),o=n-(r||n);s.diff=o,s.prev=r,s.curr=n,r=n,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let a=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((r,n)=>{if("%%"===r)return"%";a++;const o=t.formatters[n];if("function"==typeof o){const t=e[a];r=o.call(s,t),e.splice(a,1),a--}return r})),t.formatArgs.call(s,e),(s.log||t.log).apply(s,e)}return i.namespace=e,i.useColors=t.useColors(),i.color=t.selectColor(e),i.extend=s,i.destroy=t.destroy,Object.defineProperty(i,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==a?a:(n!==t.namespaces&&(n=t.namespaces,o=t.enabled(e)),o),set:e=>{a=e}}),"function"==typeof t.init&&t.init(i),i}function s(e,r){const s=t(this.namespace+(void 0===r?":":r)+e);return s.log=this.log,s}function n(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){const e=[...t.names.map(n),...t.skips.map(n).map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){let r;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const s=("string"==typeof e?e:"").split(/[\s,]+/),n=s.length;for(r=0;r<n;r++)s[r]&&("-"===(e=s[r].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.slice(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){if("*"===e[e.length-1])return!0;let r,s;for(r=0,s=t.skips.length;r<s;r++)if(t.skips[r].test(e))return!1;for(r=0,s=t.names.length;r<s;r++)if(t.names[r].test(e))return!0;return!1},t.humanize=r(7824),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach((r=>{t[r]=e[r]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let r=0;for(let t=0;t<e.length;t++)r=(r<<5)-r+e.charCodeAt(t),r|=0;return t.colors[Math.abs(r)%t.colors.length]},t.enable(t.load()),t}},6378:function(e,t){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,r=1,s=arguments.length;r<s;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},r.apply(this,arguments)};function s(e,t){if(!t)return"";var r="; "+e;return!0===t?r:r+"="+t}function n(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)+function(e){if("number"==typeof e.expires){var t=new Date;t.setMilliseconds(t.getMilliseconds()+864e5*e.expires),e.expires=t}return s("Expires",e.expires?e.expires.toUTCString():"")+s("Domain",e.domain)+s("Path",e.path)+s("Secure",e.secure)+s("SameSite",e.sameSite)}(r)}function o(e){for(var t={},r=e?e.split("; "):[],s=/(%[\dA-F]{2})+/gi,n=0;n<r.length;n++){var o=r[n].split("="),a=o.slice(1).join("=");'"'===a.charAt(0)&&(a=a.slice(1,-1));try{t[o[0].replace(s,decodeURIComponent)]=a.replace(s,decodeURIComponent)}catch(e){}}return t}function a(){return o(document.cookie)}function i(e,t,s){document.cookie=n(e,t,r({path:"/"},s))}t.__esModule=!0,t.encode=n,t.parse=o,t.getAll=a,t.get=function(e){return a()[e]},t.set=i,t.remove=function(e,t){i(e,"",r(r({},t),{expires:-1}))}},4063:e=>{"use strict";e.exports=function e(t,r){if(t===r)return!0;if(t&&r&&"object"==typeof t&&"object"==typeof r){if(t.constructor!==r.constructor)return!1;var s,n,o;if(Array.isArray(t)){if((s=t.length)!=r.length)return!1;for(n=s;0!=n--;)if(!e(t[n],r[n]))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((s=(o=Object.keys(t)).length)!==Object.keys(r).length)return!1;for(n=s;0!=n--;)if(!Object.prototype.hasOwnProperty.call(r,o[n]))return!1;for(n=s;0!=n--;){var a=o[n];if(!e(t[a],r[a]))return!1}return!0}return t!=t&&r!=r}},7824:e=>{var t=1e3,r=60*t,s=60*r,n=24*s;function o(e,t,r,s){var n=t>=1.5*r;return Math.round(e/r)+" "+s+(n?"s":"")}e.exports=function(e,a){a=a||{};var i,c,l=typeof e;if("string"===l&&e.length>0)return function(e){if(!((e=String(e)).length>100)){var o=/^(-?(?:\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(o){var a=parseFloat(o[1]);switch((o[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*a;case"weeks":case"week":case"w":return 6048e5*a;case"days":case"day":case"d":return a*n;case"hours":case"hour":case"hrs":case"hr":case"h":return a*s;case"minutes":case"minute":case"mins":case"min":case"m":return a*r;case"seconds":case"second":case"secs":case"sec":case"s":return a*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return a;default:return}}}}(e);if("number"===l&&isFinite(e))return a.long?(i=e,(c=Math.abs(i))>=n?o(i,c,n,"day"):c>=s?o(i,c,s,"hour"):c>=r?o(i,c,r,"minute"):c>=t?o(i,c,t,"second"):i+" ms"):function(e){var o=Math.abs(e);return o>=n?Math.round(e/n)+"d":o>=s?Math.round(e/s)+"h":o>=r?Math.round(e/r)+"m":o>=t?Math.round(e/t)+"s":e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},540:function(e,t){!function(e){"use strict";function t(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];if(t.length>1){t[0]=t[0].slice(0,-1);for(var s=t.length-1,n=1;n<s;++n)t[n]=t[n].slice(1,-1);return t[s]=t[s].slice(1),t.join("")}return t[0]}function r(e){return"(?:"+e+")"}function s(e){return void 0===e?"undefined":null===e?"null":Object.prototype.toString.call(e).split(" ").pop().split("]").shift().toLowerCase()}function n(e){return e.toUpperCase()}function o(e){var s="[A-Za-z]",n="[0-9]",o=t(n,"[A-Fa-f]"),a=r(r("%[EFef]"+o+"%"+o+o+"%"+o+o)+"|"+r("%[89A-Fa-f]"+o+"%"+o+o)+"|"+r("%"+o+o)),i="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",c=t("[\\:\\/\\?\\#\\[\\]\\@]",i),l=e?"[\\uE000-\\uF8FF]":"[]",u=t(s,n,"[\\-\\.\\_\\~]",e?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]"),d=r(s+t(s,n,"[\\+\\-\\.]")+"*"),f=r(r(a+"|"+t(u,i,"[\\:]"))+"*"),h=(r(r("25[0-5]")+"|"+r("2[0-4][0-9]")+"|"+r("1[0-9][0-9]")+"|"+r("[1-9][0-9]")+"|"+n),r(r("25[0-5]")+"|"+r("2[0-4][0-9]")+"|"+r("1[0-9][0-9]")+"|"+r("0?[1-9][0-9]")+"|0?0?"+n)),p=r(h+"\\."+h+"\\."+h+"\\."+h),m=r(o+"{1,4}"),g=r(r(m+"\\:"+m)+"|"+p),y=r(r(m+"\\:")+"{6}"+g),v=r("\\:\\:"+r(m+"\\:")+"{5}"+g),_=r(r(m)+"?\\:\\:"+r(m+"\\:")+"{4}"+g),$=r(r(r(m+"\\:")+"{0,1}"+m)+"?\\:\\:"+r(m+"\\:")+"{3}"+g),w=r(r(r(m+"\\:")+"{0,2}"+m)+"?\\:\\:"+r(m+"\\:")+"{2}"+g),E=r(r(r(m+"\\:")+"{0,3}"+m)+"?\\:\\:"+m+"\\:"+g),b=r(r(r(m+"\\:")+"{0,4}"+m)+"?\\:\\:"+g),S=r(r(r(m+"\\:")+"{0,5}"+m)+"?\\:\\:"+m),P=r(r(r(m+"\\:")+"{0,6}"+m)+"?\\:\\:"),C=r([y,v,_,$,w,E,b,S,P].join("|")),N=r(r(u+"|"+a)+"+"),O=(r(C+"\\%25"+N),r(C+r("\\%25|\\%(?!"+o+"{2})")+N)),R=r("[vV]"+o+"+\\."+t(u,i,"[\\:]")+"+"),j=r("\\["+r(O+"|"+C+"|"+R)+"\\]"),k=r(r(a+"|"+t(u,i))+"*"),T=r(j+"|"+p+"(?!"+k+")|"+k),I=r("[0-9]*"),A=r(r(f+"@")+"?"+T+r("\\:"+I)+"?"),D=r(a+"|"+t(u,i,"[\\:\\@]")),x=r(D+"*"),M=r(D+"+"),F=r(r(a+"|"+t(u,i,"[\\@]"))+"+"),U=r(r("\\/"+x)+"*"),z=r("\\/"+r(M+U)+"?"),V=r(F+U),L=r(M+U),K="(?!"+D+")",J=(r(U+"|"+z+"|"+V+"|"+L+"|"+K),r(r(D+"|"+t("[\\/\\?]",l))+"*")),H=r(r(D+"|[\\/\\?]")+"*"),G=r(r("\\/\\/"+A+U)+"|"+z+"|"+L+"|"+K),q=r(d+"\\:"+G+r("\\?"+J)+"?"+r("\\#"+H)+"?"),W=r(r("\\/\\/"+A+U)+"|"+z+"|"+V+"|"+K),B=r(W+r("\\?"+J)+"?"+r("\\#"+H)+"?");return r(q+"|"+B),r(d+"\\:"+G+r("\\?"+J)+"?"),r(r("\\/\\/("+r("("+f+")@")+"?("+T+")"+r("\\:("+I+")")+"?)")+"?("+U+"|"+z+"|"+L+"|"+K+")"),r("\\?("+J+")"),r("\\#("+H+")"),r(r("\\/\\/("+r("("+f+")@")+"?("+T+")"+r("\\:("+I+")")+"?)")+"?("+U+"|"+z+"|"+V+"|"+K+")"),r("\\?("+J+")"),r("\\#("+H+")"),r(r("\\/\\/("+r("("+f+")@")+"?("+T+")"+r("\\:("+I+")")+"?)")+"?("+U+"|"+z+"|"+L+"|"+K+")"),r("\\?("+J+")"),r("\\#("+H+")"),r("("+f+")@"),r("\\:("+I+")"),{NOT_SCHEME:new RegExp(t("[^]",s,n,"[\\+\\-\\.]"),"g"),NOT_USERINFO:new RegExp(t("[^\\%\\:]",u,i),"g"),NOT_HOST:new RegExp(t("[^\\%\\[\\]\\:]",u,i),"g"),NOT_PATH:new RegExp(t("[^\\%\\/\\:\\@]",u,i),"g"),NOT_PATH_NOSCHEME:new RegExp(t("[^\\%\\/\\@]",u,i),"g"),NOT_QUERY:new RegExp(t("[^\\%]",u,i,"[\\:\\@\\/\\?]",l),"g"),NOT_FRAGMENT:new RegExp(t("[^\\%]",u,i,"[\\:\\@\\/\\?]"),"g"),ESCAPE:new RegExp(t("[^]",u,i),"g"),UNRESERVED:new RegExp(u,"g"),OTHER_CHARS:new RegExp(t("[^\\%]",u,c),"g"),PCT_ENCODED:new RegExp(a,"g"),IPV4ADDRESS:new RegExp("^("+p+")$"),IPV6ADDRESS:new RegExp("^\\[?("+C+")"+r(r("\\%25|\\%(?!"+o+"{2})")+"("+N+")")+"?\\]?$")}}var a=o(!1),i=o(!0),c=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var r=[],s=!0,n=!1,o=void 0;try{for(var a,i=e[Symbol.iterator]();!(s=(a=i.next()).done)&&(r.push(a.value),!t||r.length!==t);s=!0);}catch(e){n=!0,o=e}finally{try{!s&&i.return&&i.return()}finally{if(n)throw o}}return r}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},l=2147483647,u=36,d=/^xn--/,f=/[^\0-\x7E]/,h=/[\x2E\u3002\uFF0E\uFF61]/g,p={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},m=Math.floor,g=String.fromCharCode;function y(e){throw new RangeError(p[e])}function v(e,t){var r=e.split("@"),s="";return r.length>1&&(s=r[0]+"@",e=r[1]),s+function(e,t){for(var r=[],s=e.length;s--;)r[s]=t(e[s]);return r}((e=e.replace(h,".")).split("."),t).join(".")}function _(e){for(var t=[],r=0,s=e.length;r<s;){var n=e.charCodeAt(r++);if(n>=55296&&n<=56319&&r<s){var o=e.charCodeAt(r++);56320==(64512&o)?t.push(((1023&n)<<10)+(1023&o)+65536):(t.push(n),r--)}else t.push(n)}return t}var $=function(e,t){return e+22+75*(e<26)-((0!=t)<<5)},w=function(e,t,r){var s=0;for(e=r?m(e/700):e>>1,e+=m(e/t);e>455;s+=u)e=m(e/35);return m(s+36*e/(e+38))},E=function(e){var t,r=[],s=e.length,n=0,o=128,a=72,i=e.lastIndexOf("-");i<0&&(i=0);for(var c=0;c<i;++c)e.charCodeAt(c)>=128&&y("not-basic"),r.push(e.charCodeAt(c));for(var d=i>0?i+1:0;d<s;){for(var f=n,h=1,p=u;;p+=u){d>=s&&y("invalid-input");var g=(t=e.charCodeAt(d++))-48<10?t-22:t-65<26?t-65:t-97<26?t-97:u;(g>=u||g>m((l-n)/h))&&y("overflow"),n+=g*h;var v=p<=a?1:p>=a+26?26:p-a;if(g<v)break;var _=u-v;h>m(l/_)&&y("overflow"),h*=_}var $=r.length+1;a=w(n-f,$,0==f),m(n/$)>l-o&&y("overflow"),o+=m(n/$),n%=$,r.splice(n++,0,o)}return String.fromCodePoint.apply(String,r)},b=function(e){var t=[],r=(e=_(e)).length,s=128,n=0,o=72,a=!0,i=!1,c=void 0;try{for(var d,f=e[Symbol.iterator]();!(a=(d=f.next()).done);a=!0){var h=d.value;h<128&&t.push(g(h))}}catch(e){i=!0,c=e}finally{try{!a&&f.return&&f.return()}finally{if(i)throw c}}var p=t.length,v=p;for(p&&t.push("-");v<r;){var E=l,b=!0,S=!1,P=void 0;try{for(var C,N=e[Symbol.iterator]();!(b=(C=N.next()).done);b=!0){var O=C.value;O>=s&&O<E&&(E=O)}}catch(e){S=!0,P=e}finally{try{!b&&N.return&&N.return()}finally{if(S)throw P}}var R=v+1;E-s>m((l-n)/R)&&y("overflow"),n+=(E-s)*R,s=E;var j=!0,k=!1,T=void 0;try{for(var I,A=e[Symbol.iterator]();!(j=(I=A.next()).done);j=!0){var D=I.value;if(D<s&&++n>l&&y("overflow"),D==s){for(var x=n,M=u;;M+=u){var F=M<=o?1:M>=o+26?26:M-o;if(x<F)break;var U=x-F,z=u-F;t.push(g($(F+U%z,0))),x=m(U/z)}t.push(g($(x,0))),o=w(n,R,v==p),n=0,++v}}}catch(e){k=!0,T=e}finally{try{!j&&A.return&&A.return()}finally{if(k)throw T}}++n,++s}return t.join("")},S=function(e){return v(e,(function(e){return f.test(e)?"xn--"+b(e):e}))},P=function(e){return v(e,(function(e){return d.test(e)?E(e.slice(4).toLowerCase()):e}))},C={};function N(e){var t=e.charCodeAt(0);return t<16?"%0"+t.toString(16).toUpperCase():t<128?"%"+t.toString(16).toUpperCase():t<2048?"%"+(t>>6|192).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase():"%"+(t>>12|224).toString(16).toUpperCase()+"%"+(t>>6&63|128).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase()}function O(e){for(var t="",r=0,s=e.length;r<s;){var n=parseInt(e.substr(r+1,2),16);if(n<128)t+=String.fromCharCode(n),r+=3;else if(n>=194&&n<224){if(s-r>=6){var o=parseInt(e.substr(r+4,2),16);t+=String.fromCharCode((31&n)<<6|63&o)}else t+=e.substr(r,6);r+=6}else if(n>=224){if(s-r>=9){var a=parseInt(e.substr(r+4,2),16),i=parseInt(e.substr(r+7,2),16);t+=String.fromCharCode((15&n)<<12|(63&a)<<6|63&i)}else t+=e.substr(r,9);r+=9}else t+=e.substr(r,3),r+=3}return t}function R(e,t){function r(e){var r=O(e);return r.match(t.UNRESERVED)?r:e}return e.scheme&&(e.scheme=String(e.scheme).replace(t.PCT_ENCODED,r).toLowerCase().replace(t.NOT_SCHEME,"")),void 0!==e.userinfo&&(e.userinfo=String(e.userinfo).replace(t.PCT_ENCODED,r).replace(t.NOT_USERINFO,N).replace(t.PCT_ENCODED,n)),void 0!==e.host&&(e.host=String(e.host).replace(t.PCT_ENCODED,r).toLowerCase().replace(t.NOT_HOST,N).replace(t.PCT_ENCODED,n)),void 0!==e.path&&(e.path=String(e.path).replace(t.PCT_ENCODED,r).replace(e.scheme?t.NOT_PATH:t.NOT_PATH_NOSCHEME,N).replace(t.PCT_ENCODED,n)),void 0!==e.query&&(e.query=String(e.query).replace(t.PCT_ENCODED,r).replace(t.NOT_QUERY,N).replace(t.PCT_ENCODED,n)),void 0!==e.fragment&&(e.fragment=String(e.fragment).replace(t.PCT_ENCODED,r).replace(t.NOT_FRAGMENT,N).replace(t.PCT_ENCODED,n)),e}function j(e){return e.replace(/^0*(.*)/,"$1")||"0"}function k(e,t){var r=e.match(t.IPV4ADDRESS)||[],s=c(r,2)[1];return s?s.split(".").map(j).join("."):e}function T(e,t){var r=e.match(t.IPV6ADDRESS)||[],s=c(r,3),n=s[1],o=s[2];if(n){for(var a=n.toLowerCase().split("::").reverse(),i=c(a,2),l=i[0],u=i[1],d=u?u.split(":").map(j):[],f=l.split(":").map(j),h=t.IPV4ADDRESS.test(f[f.length-1]),p=h?7:8,m=f.length-p,g=Array(p),y=0;y<p;++y)g[y]=d[y]||f[m+y]||"";h&&(g[p-1]=k(g[p-1],t));var v=g.reduce((function(e,t,r){if(!t||"0"===t){var s=e[e.length-1];s&&s.index+s.length===r?s.length++:e.push({index:r,length:1})}return e}),[]).sort((function(e,t){return t.length-e.length}))[0],_=void 0;if(v&&v.length>1){var $=g.slice(0,v.index),w=g.slice(v.index+v.length);_=$.join(":")+"::"+w.join(":")}else _=g.join(":");return o&&(_+="%"+o),_}return e}var I=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,A=void 0==="".match(/(){0}/)[1];function D(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={},s=!1!==t.iri?i:a;"suffix"===t.reference&&(e=(t.scheme?t.scheme+":":"")+"//"+e);var n=e.match(I);if(n){A?(r.scheme=n[1],r.userinfo=n[3],r.host=n[4],r.port=parseInt(n[5],10),r.path=n[6]||"",r.query=n[7],r.fragment=n[8],isNaN(r.port)&&(r.port=n[5])):(r.scheme=n[1]||void 0,r.userinfo=-1!==e.indexOf("@")?n[3]:void 0,r.host=-1!==e.indexOf("//")?n[4]:void 0,r.port=parseInt(n[5],10),r.path=n[6]||"",r.query=-1!==e.indexOf("?")?n[7]:void 0,r.fragment=-1!==e.indexOf("#")?n[8]:void 0,isNaN(r.port)&&(r.port=e.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?n[4]:void 0)),r.host&&(r.host=T(k(r.host,s),s)),void 0!==r.scheme||void 0!==r.userinfo||void 0!==r.host||void 0!==r.port||r.path||void 0!==r.query?void 0===r.scheme?r.reference="relative":void 0===r.fragment?r.reference="absolute":r.reference="uri":r.reference="same-document",t.reference&&"suffix"!==t.reference&&t.reference!==r.reference&&(r.error=r.error||"URI is not a "+t.reference+" reference.");var o=C[(t.scheme||r.scheme||"").toLowerCase()];if(t.unicodeSupport||o&&o.unicodeSupport)R(r,s);else{if(r.host&&(t.domainHost||o&&o.domainHost))try{r.host=S(r.host.replace(s.PCT_ENCODED,O).toLowerCase())}catch(e){r.error=r.error||"Host's domain name can not be converted to ASCII via punycode: "+e}R(r,a)}o&&o.parse&&o.parse(r,t)}else r.error=r.error||"URI can not be parsed.";return r}function x(e,t){var r=!1!==t.iri?i:a,s=[];return void 0!==e.userinfo&&(s.push(e.userinfo),s.push("@")),void 0!==e.host&&s.push(T(k(String(e.host),r),r).replace(r.IPV6ADDRESS,(function(e,t,r){return"["+t+(r?"%25"+r:"")+"]"}))),"number"!=typeof e.port&&"string"!=typeof e.port||(s.push(":"),s.push(String(e.port))),s.length?s.join(""):void 0}var M=/^\.\.?\//,F=/^\/\.(\/|$)/,U=/^\/\.\.(\/|$)/,z=/^\/?(?:.|\n)*?(?=\/|$)/;function V(e){for(var t=[];e.length;)if(e.match(M))e=e.replace(M,"");else if(e.match(F))e=e.replace(F,"/");else if(e.match(U))e=e.replace(U,"/"),t.pop();else if("."===e||".."===e)e="";else{var r=e.match(z);if(!r)throw new Error("Unexpected dot segment condition");var s=r[0];e=e.slice(s.length),t.push(s)}return t.join("")}function L(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.iri?i:a,s=[],n=C[(t.scheme||e.scheme||"").toLowerCase()];if(n&&n.serialize&&n.serialize(e,t),e.host)if(r.IPV6ADDRESS.test(e.host));else if(t.domainHost||n&&n.domainHost)try{e.host=t.iri?P(e.host):S(e.host.replace(r.PCT_ENCODED,O).toLowerCase())}catch(r){e.error=e.error||"Host's domain name can not be converted to "+(t.iri?"Unicode":"ASCII")+" via punycode: "+r}R(e,r),"suffix"!==t.reference&&e.scheme&&(s.push(e.scheme),s.push(":"));var o=x(e,t);if(void 0!==o&&("suffix"!==t.reference&&s.push("//"),s.push(o),e.path&&"/"!==e.path.charAt(0)&&s.push("/")),void 0!==e.path){var c=e.path;t.absolutePath||n&&n.absolutePath||(c=V(c)),void 0===o&&(c=c.replace(/^\/\//,"/%2F")),s.push(c)}return void 0!==e.query&&(s.push("?"),s.push(e.query)),void 0!==e.fragment&&(s.push("#"),s.push(e.fragment)),s.join("")}function K(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s={};return arguments[3]||(e=D(L(e,r),r),t=D(L(t,r),r)),!(r=r||{}).tolerant&&t.scheme?(s.scheme=t.scheme,s.userinfo=t.userinfo,s.host=t.host,s.port=t.port,s.path=V(t.path||""),s.query=t.query):(void 0!==t.userinfo||void 0!==t.host||void 0!==t.port?(s.userinfo=t.userinfo,s.host=t.host,s.port=t.port,s.path=V(t.path||""),s.query=t.query):(t.path?("/"===t.path.charAt(0)?s.path=V(t.path):(void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?s.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:s.path=t.path:s.path="/"+t.path,s.path=V(s.path)),s.query=t.query):(s.path=e.path,void 0!==t.query?s.query=t.query:s.query=e.query),s.userinfo=e.userinfo,s.host=e.host,s.port=e.port),s.scheme=e.scheme),s.fragment=t.fragment,s}function J(e,t){return e&&e.toString().replace(t&&t.iri?i.PCT_ENCODED:a.PCT_ENCODED,O)}var H={scheme:"http",domainHost:!0,parse:function(e,t){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e},serialize:function(e,t){var r="https"===String(e.scheme).toLowerCase();return e.port!==(r?443:80)&&""!==e.port||(e.port=void 0),e.path||(e.path="/"),e}},G={scheme:"https",domainHost:H.domainHost,parse:H.parse,serialize:H.serialize};function q(e){return"boolean"==typeof e.secure?e.secure:"wss"===String(e.scheme).toLowerCase()}var W={scheme:"ws",domainHost:!0,parse:function(e,t){var r=e;return r.secure=q(r),r.resourceName=(r.path||"/")+(r.query?"?"+r.query:""),r.path=void 0,r.query=void 0,r},serialize:function(e,t){if(e.port!==(q(e)?443:80)&&""!==e.port||(e.port=void 0),"boolean"==typeof e.secure&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){var r=e.resourceName.split("?"),s=c(r,2),n=s[0],o=s[1];e.path=n&&"/"!==n?n:void 0,e.query=o,e.resourceName=void 0}return e.fragment=void 0,e}},B={scheme:"wss",domainHost:W.domainHost,parse:W.parse,serialize:W.serialize},Q={},Y="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",Z="[0-9A-Fa-f]",X=r(r("%[EFef][0-9A-Fa-f]%"+Z+Z+"%"+Z+Z)+"|"+r("%[89A-Fa-f][0-9A-Fa-f]%"+Z+Z)+"|"+r("%"+Z+Z)),ee=t("[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",'[\\"\\\\]'),te=new RegExp(Y,"g"),re=new RegExp(X,"g"),se=new RegExp(t("[^]","[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]","[\\.]",'[\\"]',ee),"g"),ne=new RegExp(t("[^]",Y,"[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]"),"g"),oe=ne;function ae(e){var t=O(e);return t.match(te)?t:e}var ie={scheme:"mailto",parse:function(e,t){var r=e,s=r.to=r.path?r.path.split(","):[];if(r.path=void 0,r.query){for(var n=!1,o={},a=r.query.split("&"),i=0,c=a.length;i<c;++i){var l=a[i].split("=");switch(l[0]){case"to":for(var u=l[1].split(","),d=0,f=u.length;d<f;++d)s.push(u[d]);break;case"subject":r.subject=J(l[1],t);break;case"body":r.body=J(l[1],t);break;default:n=!0,o[J(l[0],t)]=J(l[1],t)}}n&&(r.headers=o)}r.query=void 0;for(var h=0,p=s.length;h<p;++h){var m=s[h].split("@");if(m[0]=J(m[0]),t.unicodeSupport)m[1]=J(m[1],t).toLowerCase();else try{m[1]=S(J(m[1],t).toLowerCase())}catch(e){r.error=r.error||"Email address's domain name can not be converted to ASCII via punycode: "+e}s[h]=m.join("@")}return r},serialize:function(e,t){var r,s=e,o=null!=(r=e.to)?r instanceof Array?r:"number"!=typeof r.length||r.split||r.setInterval||r.call?[r]:Array.prototype.slice.call(r):[];if(o){for(var a=0,i=o.length;a<i;++a){var c=String(o[a]),l=c.lastIndexOf("@"),u=c.slice(0,l).replace(re,ae).replace(re,n).replace(se,N),d=c.slice(l+1);try{d=t.iri?P(d):S(J(d,t).toLowerCase())}catch(e){s.error=s.error||"Email address's domain name can not be converted to "+(t.iri?"Unicode":"ASCII")+" via punycode: "+e}o[a]=u+"@"+d}s.path=o.join(",")}var f=e.headers=e.headers||{};e.subject&&(f.subject=e.subject),e.body&&(f.body=e.body);var h=[];for(var p in f)f[p]!==Q[p]&&h.push(p.replace(re,ae).replace(re,n).replace(ne,N)+"="+f[p].replace(re,ae).replace(re,n).replace(oe,N));return h.length&&(s.query=h.join("&")),s}},ce=/^([^\:]+)\:(.*)/,le={scheme:"urn",parse:function(e,t){var r=e.path&&e.path.match(ce),s=e;if(r){var n=t.scheme||s.scheme||"urn",o=r[1].toLowerCase(),a=r[2],i=n+":"+(t.nid||o),c=C[i];s.nid=o,s.nss=a,s.path=void 0,c&&(s=c.parse(s,t))}else s.error=s.error||"URN can not be parsed.";return s},serialize:function(e,t){var r=t.scheme||e.scheme||"urn",s=e.nid,n=r+":"+(t.nid||s),o=C[n];o&&(e=o.serialize(e,t));var a=e,i=e.nss;return a.path=(s||t.nid)+":"+i,a}},ue=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/,de={scheme:"urn:uuid",parse:function(e,t){var r=e;return r.uuid=r.nss,r.nss=void 0,t.tolerant||r.uuid&&r.uuid.match(ue)||(r.error=r.error||"UUID is not valid."),r},serialize:function(e,t){var r=e;return r.nss=(e.uuid||"").toLowerCase(),r}};C[H.scheme]=H,C[G.scheme]=G,C[W.scheme]=W,C[B.scheme]=B,C[ie.scheme]=ie,C[le.scheme]=le,C[de.scheme]=de,e.SCHEMES=C,e.pctEncChar=N,e.pctDecChars=O,e.parse=D,e.removeDotSegments=V,e.serialize=L,e.resolveComponents=K,e.resolve=function(e,t,r){var s=function(e,t){var r=e;if(t)for(var s in t)r[s]=t[s];return r}({scheme:"null"},r);return L(K(D(e,s),D(t,s),s,!0),s)},e.normalize=function(e,t){return"string"==typeof e?e=L(D(e,t),t):"object"===s(e)&&(e=D(L(e,t),t)),e},e.equal=function(e,t,r){return"string"==typeof e?e=L(D(e,r),r):"object"===s(e)&&(e=L(e,r)),"string"==typeof t?t=L(D(t,r),r):"object"===s(t)&&(t=L(t,r)),e===t},e.escapeComponent=function(e,t){return e&&e.toString().replace(t&&t.iri?i.ESCAPE:a.ESCAPE,N)},e.unescapeComponent=J,Object.defineProperty(e,"__esModule",{value:!0})}(t)},9863:e=>{"use strict";e.exports=JSON.parse('{"$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":false}')}},t={};function r(s){var n=t[s];if(void 0!==n)return n.exports;var o=t[s]={exports:{}};return e[s].call(o.exports,o,o.exports,r),o.exports}r.m=e,r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var s in t)r.o(t,s)&&!r.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},r.u=e=>e+".index.js",r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;r.g.importScripts&&(e=r.g.location+"");var t=r.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var s=t.getElementsByTagName("script");s.length&&(e=s[s.length-1].src)}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),r.p=e})(),r.b=document.baseURI||self.location.href;var s={};(()=>{"use strict";r.r(s),r.d(s,{AuthorizeOptionsResponseMode:()=>a,AuthorizeOptionsResponseType:()=>o,IOauth2ListenerCommand:()=>c,OAuthGrantTypes:()=>i,STSOAuth2Manager:()=>Q,default:()=>Y});var e=r(1227),t=r.n(e),n=r(7557);var o,a,i,c;!function(e){e.CODE="code",e.ID_TOKEN="id_token",e.TOKEN="token"}(o||(o={})),function(e){e.QUERY="query",e.FRAGMENT="fragment",e.FORM_POST="form_post"}(a||(a={})),function(e){e.CLIENT_CREDENTIALS="client_credentials",e.AUTHORIZATION_CODE="authorization_code",e.REFRESH_TOKEN="refresh_token"}(i||(i={})),function(e){e.RESTORE_SESSION="RestoreSession",e.AUTHORIZE="Authorize",e.HANDLE_REDIRECT="HandleRedirect",e.LOGOUT="Logout",e.AUTHENTICATE_EVENT="AuthenticateEvent",e.ERROR="Error"}(c||(c={}));var l,u,d=r(6378),f=function(e,t,r,s){if("a"===r&&!s)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?s:"a"===r?s.call(e):s?s.value:t.get(e)},h=function(e,t,r,s,n){if("m"===s)throw new TypeError("Private method is not writable");if("a"===s&&!n)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===s?n.call(e,r):n?n.value=r:t.set(e,r),r};const p=t()(`proc:${process.pid}:storage.ts`);var m;!function(e){e.LOCAL_STORAGE="LocalStorage",e.SESSION_STORAGE="SessionStorage",e.COOKIE_STORAGE="CookieStorage",e.MEMORY_STORAGE="MemoryStorage"}(m||(m={}));class g{constructor(){this.get=e=>{const t=d.get(e);return t?JSON.parse(t):null},this.set=(e,t,r={})=>{let s={};"https:"===window.location.protocol&&(s={secure:!0,sameSite:"none"}),r&&r.daysUntilExpire?s.expires=r.daysUntilExpire:s.expires=1,p(`CookieStorage.set: key: ${e}, value: [${t}]`),d.set(e,JSON.stringify(t),s)},this.remove=e=>{d.remove(e)}}}class y{constructor(){this.get=e=>{const t=sessionStorage.getItem(e);return null==t?null:JSON.parse(t)},this.set=(e,t)=>{p(`SessionStorage.set: key: ${e}, value: [${t}]`),sessionStorage.setItem(e,JSON.stringify(t))},this.remove=e=>{sessionStorage.removeItem(e)}}}class v{constructor(){this.get=e=>{const t=localStorage.getItem(e);return null==t?null:JSON.parse(t)},this.set=(e,t)=>{p(`LocalStorage.set: key: ${e}, value: [${t}]`),localStorage.setItem(e,JSON.stringify(t))},this.remove=e=>{localStorage.removeItem(e)}}}class _{constructor(){l.set(this,{}),this.get=e=>{const t=f(this,l,"f")[e];return null==t?null:t},this.set=(e,t)=>{p(`MemoryStorage.set: key: ${e}, value: [${t}]`),f(this,l,"f")[e]=t},this.remove=e=>{delete f(this,l,"f")[e]}}}l=new WeakMap;class ${constructor(e){switch(u.set(this,null),e.clientStorageType){case m.SESSION_STORAGE:h(this,u,new y,"f");break;case m.LOCAL_STORAGE:h(this,u,new v,"f");break;case m.COOKIE_STORAGE:h(this,u,new g,"f");break;case m.MEMORY_STORAGE:h(this,u,new _,"f");break;default:throw new Error(`Unknown [${e.clientStorageType}] storage type.`)}}GetStorage(){return f(this,u,"f")}}function w(e){this.message=e}u=new WeakMap,w.prototype=new Error,w.prototype.name="InvalidCharacterError";var E="undefined"!=typeof window&&window.atob&&window.atob.bind(window)||function(e){var t=String(e).replace(/=+$/,"");if(t.length%4==1)throw new w("'atob' failed: The string to be decoded is not correctly encoded.");for(var r,s,n=0,o=0,a="";s=t.charAt(o++);~s&&(r=n%4?64*r+s:s,n++%4)?a+=String.fromCharCode(255&r>>(-2*n&6)):0)s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(s);return a};function b(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(e){return decodeURIComponent(E(e).replace(/(.)/g,(function(e,t){var r=t.charCodeAt(0).toString(16).toUpperCase();return r.length<2&&(r="0"+r),"%"+r})))}(t)}catch(e){return E(t)}}function S(e){this.message=e}S.prototype=new Error,S.prototype.name="InvalidTokenError";var P,C,N,O,R,j,k,T,I,A,D,x,M,F,U,z,V,L,K,J,H,G,q=function(e,t,r,s,n){if("m"===s)throw new TypeError("Private method is not writable");if("a"===s&&!n)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===s?n.call(e,r):n?n.value=r:t.set(e,r),r},W=function(e,t,r,s){if("a"===r&&!s)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?s:"a"===r?s.call(e):s?s.value:t.get(e)};const B=t()(`proc:${process.pid}:stsoauth2manager.ts`);class Q{constructor(e,t){P.set(this,null),C.set(this,null),N.set(this,null),O.set(this,new class{constructor(){this.DigestMessage=async function(e){const t=(new TextEncoder).encode(e),r=await crypto.subtle.digest("SHA-256",t),s=Array.from(new Uint8Array(r));return btoa(String.fromCharCode(...s))},this.CreateRandomString=(e=43)=>{const t=Array.from(crypto.getRandomValues(new Uint8Array(e)));return btoa(String.fromCharCode(...t))},this.CreateRandomStringEx=()=>{const e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_~.";let t="";return Array.from(crypto.getRandomValues(new Uint8Array(43))).forEach((r=>t+=e[r%e.length])),t}}}),R.set(this,new class{constructor(){this.DecodeQueryParams=e=>{const t={};return Object.keys(e).filter((t=>void 0!==e[t])).map((r=>{t[decodeURIComponent(r)]=decodeURIComponent(e[r])})),t},this.CreateQueryParams=e=>Object.keys(e).filter((t=>void 0!==e[t])).map((t=>Array.isArray(e[t])?encodeURIComponent(t)+"="+encodeURIComponent(e[t].join(" ")):encodeURIComponent(t)+"="+encodeURIComponent(e[t]))).join("&"),this._GetQueryParams=e=>{let t={};const r=e.split("?");if(2==r.length){const e=r[1].split("&"),s={};let n="";e.forEach((function(e){n=e.split("="),2==n.length&&(s[n[0]]=n[1])})),t=this.DecodeQueryParams(s)}return t},this.GetQueryParams=()=>this._GetQueryParams(window.location.href)}}),j.set(this,"authorize_options.stsmda.com.au"),k.set(this,"session.stsmda.com.au"),T.set(this,null),I.set(this,null),A.set(this,{}),D.set(this,void 0),x.set(this,0),M.set(this,{}),F.set(this,1e3),U.set(this,null),z.set(this,null),V.set(this,(e=>{const t=e.data;if(-1===t.messageId)switch(t.command){case c.AUTHENTICATE_EVENT:W(this,J,"f").call(this,t.payload);break;case c.ERROR:W(this,K,"f").call(this,t.payload);break;default:throw new Error(`ProcessMessageResponse command [${t.command}] not valid.`)}else{const e=W(this,M,"f")[t.messageId];if(!e)throw new Error(`Message: [${t.messageId}] does not exists in callBacks.`);e(t)}})),L.set(this,(e=>{var t,r;return e.messageId=(q(this,x,(r=W(this,x,"f"),t=r++,r),"f"),t),new Promise(((t,r)=>{const s=setTimeout((()=>{delete W(this,M,"f")[e.messageId],r(`Message: [${e.messageId}] timeout error after: [${W(this,F,"f")}] ms.`)}),W(this,F,"f"));W(this,M,"f")[e.messageId]=r=>{clearTimeout(s),delete W(this,M,"f")[e.messageId],t(r)},W(this,D,"f").postMessage(e)}))})),K.set(this,(e=>{W(this,N,"f").commit("AuthorizeError",{message:e}),setTimeout((()=>{W(this,C,"f").replace("/error")}),0)})),J.set(this,(e=>{W(this,I,"f").authenticateEvent&&W(this,I,"f").authenticateEvent(e),W(this,N,"f").commit("stsOAuth2SDK/SessionData",e)})),H.set(this,((e,t)=>{t.beforeEach((async(r,s)=>{const o=e.config.globalProperties.$store,a=e.config.globalProperties.$sts;if(B(`beforeEach: from: [${s.path}], to: [${r.path}]`),!1===o.getters["stsOAuth2SDK/LoggedIn"]){if(console.log("Not logged in"),0===r.path.localeCompare("/authorize"))return console.log("to = /authorize"),!0;if(0===r.path.localeCompare("/consent")&&void 0!==o.getters.Session.sessionId)return!0;if(0===r.path.localeCompare("/logout"))return!0;if(0===r.path.localeCompare("/error"))return!0;if(0===r.path.localeCompare("/logout"))return!0;const e=r.query;if(e[n.OAuth2ParameterType.CODE]||e[n.OAuth2ParameterType.ERROR])return console.log(`#SetupRout:str = [${e}]`),await a.om.HandleRedirect(e)?(setTimeout((()=>{window.history.replaceState({},document.title,window.location.origin+"/")}),0),!0):(W(this,C,"f").replace("/error"),!1);const t=await a.om.RestoreSession();return console.log(`#SetupRoute:sessionRestored [${t}]`),!0!==t?(console.log("Session not restored - Need to Authorize"),a.om.Authorize(),!1):"/"}return 0===r.path.localeCompare("/consent")?"/":0===r.path.localeCompare("/authorize")?(t.replace({path:"/"}),!1):0!==r.path.localeCompare("/logout")||(t.replace({path:"/"}),!1)}))})),G.set(this,(()=>{W(this,N,"f").registerModule("stsOAuth2SDK",{namespaced:!0,state:()=>({sessionData:{}}),getters:{SessionData:e=>e.sessionData,LoggedIn:e=>void 0!==e.sessionData&&null!==e.sessionData,UserDetails(e){if(e.sessionData){return function(e,t){if("string"!=typeof e)throw new S("Invalid token specified");var r=!0===(t=t||{}).header?0:1;try{return JSON.parse(b(e.split(".")[r]))}catch(e){throw new S("Invalid token specified: "+e.message)}}(e.sessionData)}return null}},mutations:{SessionData(e,t){e.sessionData=t,console.log(`commit [sessionData]: ${JSON.stringify(t)}`)}}},{preserveState:!0})})),this.RestoreSession=async()=>{try{return(await W(this,L,"f").call(this,{command:c.RESTORE_SESSION})).payload}catch(e){return console.log(`RestoreSession Error: ${e}`),!1}},this.Authorize=async()=>{try{const e=await W(this,L,"f").call(this,{command:c.AUTHORIZE});W(this,z,"f").set(W(this,j,"f"),e.payload.authorizeOptions);const t=e.payload.url;window.location.replace(t)}catch(e){console.log(`Authorize Error: ${e}`)}},this.HandleRedirect=async e=>{try{let t=null;if(e[n.OAuth2ParameterType.CODE]){const r=W(this,z,"f").get(W(this,j,"f"));W(this,z,"f").remove(W(this,j,"f")),t=await W(this,L,"f").call(this,{command:c.HANDLE_REDIRECT,payload:{queryVars:e,authorizeOptions:r}})}else t=await W(this,L,"f").call(this,{command:c.HANDLE_REDIRECT,payload:e});return t.payload}catch(e){return console.log(`HandleRedirect Error: ${e}`),!1}},this.Logout=async()=>{try{return(await W(this,L,"f").call(this,{command:c.LOGOUT})).payload}catch(e){return console.log(`Logout Error: ${e}`),!1}},q(this,I,t,"f"),q(this,P,e.config.globalProperties.$sts.storage,"f"),q(this,N,e.config.globalProperties.$store,"f"),q(this,T,e.config.globalProperties.$sts.aic.PrimaryPublishInstrumentController,"f"),q(this,C,e.config.globalProperties.$router,"f"),q(this,z,new $({clientStorageType:m.SESSION_STORAGE}).GetStorage(),"f"),q(this,U,new Worker(new URL(r.p+r.u(384),r.b),{type:void 0}),"f"),W(this,U,"f").onmessage=e=>{console.log(`this.#worker.onmessage = [${e}]`)},W(this,U,"f").onerror=function(e){console.log(`this.#worker.onerror = [${e}]`)};const{port1:s,port2:o}=new MessageChannel;q(this,D,s,"f"),W(this,U,"f").postMessage(o,[o]),W(this,D,"f").onmessage=e=>{W(this,V,"f").call(this,e)},W(this,G,"f").call(this),W(this,H,"f").call(this,e,t.router)}}P=new WeakMap,C=new WeakMap,N=new WeakMap,O=new WeakMap,R=new WeakMap,j=new WeakMap,k=new WeakMap,T=new WeakMap,I=new WeakMap,A=new WeakMap,D=new WeakMap,x=new WeakMap,M=new WeakMap,F=new WeakMap,U=new WeakMap,z=new WeakMap,V=new WeakMap,L=new WeakMap,K=new WeakMap,J=new WeakMap,H=new WeakMap,G=new WeakMap;const Y={install:(e,t)=>{const r=new Q(e,t);e.config.globalProperties.$sts.om=r}}})(),stsoauth2plugin=s})();
|
|
5
|
+
|| ${i} === "boolean" || ${n} === null`).assign(c,a._`[${n}]`)}}s.else(),p(e),s.endIf(),s.if(a._`${c} !== undefined`,(()=>{s.assign(n,c),function({gen:e,parentData:t,parentDataProperty:r},s){e.if(a._`${t} !== undefined`,(()=>e.assign(a._`${t}[${r}]`,s)))}(e,c)}))}(e,t,i):p(e)}))}return l};const u=new Set(["string","number","integer","boolean","null"]);function d(e,t,r,s=c.Correct){const n=s===c.Correct?a.operators.EQ:a.operators.NEQ;let o;switch(e){case"null":return a._`${t} ${n} null`;case"array":o=a._`Array.isArray(${t})`;break;case"object":o=a._`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":o=i(a._`!(${t} % 1) && !isNaN(${t})`);break;case"number":o=i();break;default:return a._`typeof ${t} ${n} ${e}`}return s===c.Correct?o:(0,a.not)(o);function i(e=a.nil){return(0,a.and)(a._`typeof ${t} == "number"`,e,r?a._`isFinite(${t})`:a.nil)}}function f(e,t,r,s){if(1===e.length)return d(e[0],t,r,s);let n;const o=(0,i.toHash)(e);if(o.array&&o.object){const e=a._`typeof ${t} != "object"`;n=o.null?e:a._`!${t} || ${e}`,delete o.null,delete o.array,delete o.object}else n=a.nil;o.number&&delete o.integer;for(const e in o)n=(0,a.and)(n,d(e,t,r,s));return n}t.checkDataType=d,t.checkDataTypes=f;const h={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>"string"==typeof e?a._`{type: ${e}}`:a._`{type: ${t}}`};function p(e){const t=function(e){const{gen:t,data:r,schema:s}=e,n=(0,i.schemaRefOrVal)(e,s,"type");return{gen:t,keyword:"type",data:r,schema:s.type,schemaCode:n,schemaValue:n,parentSchema:s,params:{},it:e}}(e);(0,o.reportError)(t,h)}t.reportTypeError=p},906:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.assignDefaults=void 0;const s=r(9411),n=r(2390);function o(e,t,r){const{gen:o,compositeRule:a,data:i,opts:c}=e;if(void 0===r)return;const l=s._`${i}${(0,s.getProperty)(t)}`;if(a)return void(0,n.checkStrictMode)(e,`default is ignored for: ${l}`);let u=s._`${l} === undefined`;"empty"===c.useDefaults&&(u=s._`${u} || ${l} === null || ${l} === ""`),o.if(u,s._`${l} = ${(0,s.stringify)(r)}`)}t.assignDefaults=function(e,t){const{properties:r,items:s}=e.schema;if("object"===t&&r)for(const t in r)o(e,t,r[t].default);else"array"===t&&Array.isArray(s)&&s.forEach(((t,r)=>o(e,r,t.default)))}},9509:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getData=t.KeywordCxt=t.validateFunctionCode=void 0;const s=r(3343),n=r(1312),o=r(2411),a=r(1312),i=r(906),c=r(125),l=r(5379),u=r(9411),d=r(6579),f=r(4209),h=r(2390),p=r(6782);function m({gen:e,validateName:t,schema:r,schemaEnv:s,opts:n},o){n.code.es5?e.func(t,u._`${d.default.data}, ${d.default.valCxt}`,s.$async,(()=>{e.code(u._`"use strict"; ${g(r,n)}`),function(e,t){e.if(d.default.valCxt,(()=>{e.var(d.default.instancePath,u._`${d.default.valCxt}.${d.default.instancePath}`),e.var(d.default.parentData,u._`${d.default.valCxt}.${d.default.parentData}`),e.var(d.default.parentDataProperty,u._`${d.default.valCxt}.${d.default.parentDataProperty}`),e.var(d.default.rootData,u._`${d.default.valCxt}.${d.default.rootData}`),t.dynamicRef&&e.var(d.default.dynamicAnchors,u._`${d.default.valCxt}.${d.default.dynamicAnchors}`)}),(()=>{e.var(d.default.instancePath,u._`""`),e.var(d.default.parentData,u._`undefined`),e.var(d.default.parentDataProperty,u._`undefined`),e.var(d.default.rootData,d.default.data),t.dynamicRef&&e.var(d.default.dynamicAnchors,u._`{}`)}))}(e,n),e.code(o)})):e.func(t,u._`${d.default.data}, ${function(e){return u._`{${d.default.instancePath}="", ${d.default.parentData}, ${d.default.parentDataProperty}, ${d.default.rootData}=${d.default.data}${e.dynamicRef?u._`, ${d.default.dynamicAnchors}={}`:u.nil}}={}`}(n)}`,s.$async,(()=>e.code(g(r,n)).code(o)))}function g(e,t){const r="object"==typeof e&&e[t.schemaId];return r&&(t.code.source||t.code.process)?u._`/*# sourceURL=${r} */`:u.nil}function y({schema:e,self:t}){if("boolean"==typeof e)return!e;for(const r in e)if(t.RULES.all[r])return!0;return!1}function v(e){return"boolean"!=typeof e.schema}function _(e){(0,h.checkUnknownRules)(e),function(e){const{schema:t,errSchemaPath:r,opts:s,self:n}=e;t.$ref&&s.ignoreKeywordsWithRef&&(0,h.schemaHasRulesButRef)(t,n.RULES)&&n.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}(e)}function $(e,t){if(e.opts.jtd)return E(e,[],!1,t);const r=(0,n.getSchemaTypes)(e.schema);E(e,r,!(0,n.coerceAndCheckDataType)(e,r),t)}function w({gen:e,schemaEnv:t,schema:r,errSchemaPath:s,opts:n}){const o=r.$comment;if(!0===n.$comment)e.code(u._`${d.default.self}.logger.log(${o})`);else if("function"==typeof n.$comment){const r=u.str`${s}/$comment`,n=e.scopeValue("root",{ref:t.root});e.code(u._`${d.default.self}.opts.$comment(${o}, ${r}, ${n}.schema)`)}}function E(e,t,r,s){const{gen:n,schema:i,data:c,allErrors:l,opts:f,self:p}=e,{RULES:m}=p;function g(h){(0,o.shouldUseGroup)(i,h)&&(h.type?(n.if((0,a.checkDataType)(h.type,c,f.strictNumbers)),b(e,h),1===t.length&&t[0]===h.type&&r&&(n.else(),(0,a.reportTypeError)(e)),n.endIf()):b(e,h),l||n.if(u._`${d.default.errors} === ${s||0}`))}!i.$ref||!f.ignoreKeywordsWithRef&&(0,h.schemaHasRulesButRef)(i,m)?(f.jtd||function(e,t){!e.schemaEnv.meta&&e.opts.strictTypes&&(function(e,t){t.length&&(e.dataTypes.length?(t.forEach((t=>{S(e.dataTypes,t)||P(e,`type "${t}" not allowed by context "${e.dataTypes.join(",")}"`)})),e.dataTypes=e.dataTypes.filter((e=>S(t,e)))):e.dataTypes=t)}(e,t),e.opts.allowUnionTypes||function(e,t){t.length>1&&(2!==t.length||!t.includes("null"))&&P(e,"use allowUnionTypes to allow union type keyword")}(e,t),function(e,t){const r=e.self.RULES.all;for(const s in r){const n=r[s];if("object"==typeof n&&(0,o.shouldUseRule)(e.schema,n)){const{type:r}=n.definition;r.length&&!r.some((e=>{return s=e,(r=t).includes(s)||"number"===s&&r.includes("integer");var r,s}))&&P(e,`missing type "${r.join(",")}" for keyword "${s}"`)}}}(e,e.dataTypes))}(e,t),n.block((()=>{for(const e of m.rules)g(e);g(m.post)}))):n.block((()=>N(e,"$ref",m.all.$ref.definition)))}function b(e,t){const{gen:r,schema:s,opts:{useDefaults:n}}=e;n&&(0,i.assignDefaults)(e,t.type),r.block((()=>{for(const r of t.rules)(0,o.shouldUseRule)(s,r)&&N(e,r.keyword,r.definition,t.type)}))}function S(e,t){return e.includes(t)||"integer"===t&&e.includes("number")}function P(e,t){t+=` at "${e.schemaEnv.baseId+e.errSchemaPath}" (strictTypes)`,(0,h.checkStrictMode)(e,t,e.opts.strictTypes)}t.validateFunctionCode=function(e){v(e)&&(_(e),y(e))?function(e){const{schema:t,opts:r,gen:s}=e;m(e,(()=>{r.$comment&&t.$comment&&w(e),function(e){const{schema:t,opts:r}=e;void 0!==t.default&&r.useDefaults&&r.strictSchema&&(0,h.checkStrictMode)(e,"default is ignored in the schema root")}(e),s.let(d.default.vErrors,null),s.let(d.default.errors,0),r.unevaluated&&function(e){const{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",u._`${r}.evaluated`),t.if(u._`${e.evaluated}.dynamicProps`,(()=>t.assign(u._`${e.evaluated}.props`,u._`undefined`))),t.if(u._`${e.evaluated}.dynamicItems`,(()=>t.assign(u._`${e.evaluated}.items`,u._`undefined`)))}(e),$(e),function(e){const{gen:t,schemaEnv:r,validateName:s,ValidationError:n,opts:o}=e;r.$async?t.if(u._`${d.default.errors} === 0`,(()=>t.return(d.default.data)),(()=>t.throw(u._`new ${n}(${d.default.vErrors})`))):(t.assign(u._`${s}.errors`,d.default.vErrors),o.unevaluated&&function({gen:e,evaluated:t,props:r,items:s}){r instanceof u.Name&&e.assign(u._`${t}.props`,r),s instanceof u.Name&&e.assign(u._`${t}.items`,s)}(e),t.return(u._`${d.default.errors} === 0`))}(e)}))}(e):m(e,(()=>(0,s.topBoolOrEmptySchema)(e)))};class C{constructor(e,t,r){if((0,c.validateKeywordUsage)(e,t,r),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=r,this.data=e.data,this.schema=e.schema[r],this.$data=t.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,h.schemaRefOrVal)(e,this.schema,r,this.$data),this.schemaType=t.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=t,this.$data)this.schemaCode=e.gen.const("vSchema",j(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,c.validSchemaType)(this.schema,t.schemaType,t.allowUndefined))throw new Error(`${r} value must be ${JSON.stringify(t.schemaType)}`);("code"in t?t.trackErrors:!1!==t.errors)&&(this.errsCount=e.gen.const("_errs",d.default.errors))}result(e,t,r){this.failResult((0,u.not)(e),t,r)}failResult(e,t,r){this.gen.if(e),r?r():this.error(),t?(this.gen.else(),t(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,t){this.failResult((0,u.not)(e),void 0,t)}fail(e){if(void 0===e)return this.error(),void(this.allErrors||this.gen.if(!1));this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);const{schemaCode:t}=this;this.fail(u._`${t} !== undefined && (${(0,u.or)(this.invalid$data(),e)})`)}error(e,t,r){if(t)return this.setParams(t),this._error(e,r),void this.setParams({});this._error(e,r)}_error(e,t){(e?p.reportExtraError:p.reportError)(this,this.def.error,t)}$dataError(){(0,p.reportError)(this,this.def.$dataError||p.keyword$DataError)}reset(){if(void 0===this.errsCount)throw new Error('add "trackErrors" to keyword definition');(0,p.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,t){t?Object.assign(this.params,e):this.params=e}block$data(e,t,r=u.nil){this.gen.block((()=>{this.check$data(e,r),t()}))}check$data(e=u.nil,t=u.nil){if(!this.$data)return;const{gen:r,schemaCode:s,schemaType:n,def:o}=this;r.if((0,u.or)(u._`${s} === undefined`,t)),e!==u.nil&&r.assign(e,!0),(n.length||o.validateSchema)&&(r.elseIf(this.invalid$data()),this.$dataError(),e!==u.nil&&r.assign(e,!1)),r.else()}invalid$data(){const{gen:e,schemaCode:t,schemaType:r,def:s,it:n}=this;return(0,u.or)(function(){if(r.length){if(!(t instanceof u.Name))throw new Error("ajv implementation error");const e=Array.isArray(r)?r:[r];return u._`${(0,a.checkDataTypes)(e,t,n.opts.strictNumbers,a.DataType.Wrong)}`}return u.nil}(),function(){if(s.validateSchema){const r=e.scopeValue("validate$data",{ref:s.validateSchema});return u._`!${r}(${t})`}return u.nil}())}subschema(e,t){const r=(0,l.getSubschema)(this.it,e);(0,l.extendSubschemaData)(r,this.it,e),(0,l.extendSubschemaMode)(r,e);const n={...this.it,...r,items:void 0,props:void 0};return function(e,t){v(e)&&(_(e),y(e))?function(e,t){const{schema:r,gen:s,opts:n}=e;n.$comment&&r.$comment&&w(e),function(e){const t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,f.resolveUrl)(e.opts.uriResolver,e.baseId,t))}(e),function(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}(e);const o=s.const("_errs",d.default.errors);$(e,o),s.var(t,u._`${o} === ${d.default.errors}`)}(e,t):(0,s.boolOrEmptySchema)(e,t)}(n,t),n}mergeEvaluated(e,t){const{it:r,gen:s}=this;r.opts.unevaluated&&(!0!==r.props&&void 0!==e.props&&(r.props=h.mergeEvaluated.props(s,e.props,r.props,t)),!0!==r.items&&void 0!==e.items&&(r.items=h.mergeEvaluated.items(s,e.items,r.items,t)))}mergeValidEvaluated(e,t){const{it:r,gen:s}=this;if(r.opts.unevaluated&&(!0!==r.props||!0!==r.items))return s.if(t,(()=>this.mergeEvaluated(e,u.Name))),!0}}function N(e,t,r,s){const n=new C(e,r,t);"code"in r?r.code(n,s):n.$data&&r.validate?(0,c.funcKeywordCode)(n,r):"macro"in r?(0,c.macroKeywordCode)(n,r):(r.compile||r.validate)&&(0,c.funcKeywordCode)(n,r)}t.KeywordCxt=C;const O=/^\/(?:[^~]|~0|~1)*$/,R=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function j(e,{dataLevel:t,dataNames:r,dataPathArr:s}){let n,o;if(""===e)return d.default.rootData;if("/"===e[0]){if(!O.test(e))throw new Error(`Invalid JSON-pointer: ${e}`);n=e,o=d.default.rootData}else{const a=R.exec(e);if(!a)throw new Error(`Invalid JSON-pointer: ${e}`);const i=+a[1];if(n=a[2],"#"===n){if(i>=t)throw new Error(c("property/index",i));return s[t-i]}if(i>t)throw new Error(c("data",i));if(o=r[t-i],!n)return o}let a=o;const i=n.split("/");for(const e of i)e&&(o=u._`${o}${(0,u.getProperty)((0,h.unescapeJsonPointer)(e))}`,a=u._`${a} && ${o}`);return a;function c(e,r){return`Cannot access ${e} ${r} levels up, current level is ${t}`}}t.getData=j},125:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateKeywordUsage=t.validSchemaType=t.funcKeywordCode=t.macroKeywordCode=void 0;const s=r(9411),n=r(6579),o=r(2309),a=r(6782);function i(e){const{gen:t,data:r,it:n}=e;t.if(n.parentData,(()=>t.assign(r,s._`${n.parentData}[${n.parentDataProperty}]`)))}function c(e,t,r){if(void 0===r)throw new Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword","function"==typeof r?{ref:r}:{ref:r,code:(0,s.stringify)(r)})}t.macroKeywordCode=function(e,t){const{gen:r,keyword:n,schema:o,parentSchema:a,it:i}=e,l=t.macro.call(i.self,o,a,i),u=c(r,n,l);!1!==i.opts.validateSchema&&i.self.validateSchema(l,!0);const d=r.name("valid");e.subschema({schema:l,schemaPath:s.nil,errSchemaPath:`${i.errSchemaPath}/${n}`,topSchemaRef:u,compositeRule:!0},d),e.pass(d,(()=>e.error(!0)))},t.funcKeywordCode=function(e,t){var r;const{gen:l,keyword:u,schema:d,parentSchema:f,$data:h,it:p}=e;!function({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}(p,t);const m=!h&&t.compile?t.compile.call(p.self,d,f,p):t.validate,g=c(l,u,m),y=l.let("valid");function v(r=(t.async?s._`await `:s.nil)){const a=p.opts.passContext?n.default.this:n.default.self,i=!("compile"in t&&!h||!1===t.schema);l.assign(y,s._`${r}${(0,o.callValidateCode)(e,g,a,i)}`,t.modifying)}function _(e){var r;l.if((0,s.not)(null!==(r=t.valid)&&void 0!==r?r:y),e)}e.block$data(y,(function(){if(!1===t.errors)v(),t.modifying&&i(e),_((()=>e.error()));else{const r=t.async?function(){const e=l.let("ruleErrs",null);return l.try((()=>v(s._`await `)),(t=>l.assign(y,!1).if(s._`${t} instanceof ${p.ValidationError}`,(()=>l.assign(e,s._`${t}.errors`)),(()=>l.throw(t))))),e}():function(){const e=s._`${g}.errors`;return l.assign(e,null),v(s.nil),e}();t.modifying&&i(e),_((()=>function(e,t){const{gen:r}=e;r.if(s._`Array.isArray(${t})`,(()=>{r.assign(n.default.vErrors,s._`${n.default.vErrors} === null ? ${t} : ${n.default.vErrors}.concat(${t})`).assign(n.default.errors,s._`${n.default.vErrors}.length`),(0,a.extendErrors)(e)}),(()=>e.error()))}(e,r)))}})),e.ok(null!==(r=t.valid)&&void 0!==r?r:y)},t.validSchemaType=function(e,t,r=!1){return!t.length||t.some((t=>"array"===t?Array.isArray(e):"object"===t?e&&"object"==typeof e&&!Array.isArray(e):typeof e==t||r&&void 0===e))},t.validateKeywordUsage=function({schema:e,opts:t,self:r,errSchemaPath:s},n,o){if(Array.isArray(n.keyword)?!n.keyword.includes(o):n.keyword!==o)throw new Error("ajv implementation error");const a=n.dependencies;if(null==a?void 0:a.some((t=>!Object.prototype.hasOwnProperty.call(e,t))))throw new Error(`parent schema must have dependencies of ${o}: ${a.join(",")}`);if(n.validateSchema&&!n.validateSchema(e[o])){const e=`keyword "${o}" value is invalid at path "${s}": `+r.errorsText(n.validateSchema.errors);if("log"!==t.validateSchema)throw new Error(e);r.logger.error(e)}}},5379:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.extendSubschemaMode=t.extendSubschemaData=t.getSubschema=void 0;const s=r(9411),n=r(2390);t.getSubschema=function(e,{keyword:t,schemaProp:r,schema:o,schemaPath:a,errSchemaPath:i,topSchemaRef:c}){if(void 0!==t&&void 0!==o)throw new Error('both "keyword" and "schema" passed, only one allowed');if(void 0!==t){const o=e.schema[t];return void 0===r?{schema:o,schemaPath:s._`${e.schemaPath}${(0,s.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:o[r],schemaPath:s._`${e.schemaPath}${(0,s.getProperty)(t)}${(0,s.getProperty)(r)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,n.escapeFragment)(r)}`}}if(void 0!==o){if(void 0===a||void 0===i||void 0===c)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:o,schemaPath:a,topSchemaRef:c,errSchemaPath:i}}throw new Error('either "keyword" or "schema" must be passed')},t.extendSubschemaData=function(e,t,{dataProp:r,dataPropType:o,data:a,dataTypes:i,propertyName:c}){if(void 0!==a&&void 0!==r)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:l}=t;if(void 0!==r){const{errorPath:a,dataPathArr:i,opts:c}=t;u(l.let("data",s._`${t.data}${(0,s.getProperty)(r)}`,!0)),e.errorPath=s.str`${a}${(0,n.getErrorPath)(r,o,c.jsPropertySyntax)}`,e.parentDataProperty=s._`${r}`,e.dataPathArr=[...i,e.parentDataProperty]}function u(r){e.data=r,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,r]}void 0!==a&&(u(a instanceof s.Name?a:l.let("data",a,!0)),void 0!==c&&(e.propertyName=c)),i&&(e.dataTypes=i)},t.extendSubschemaMode=function(e,{jtdDiscriminator:t,jtdMetadata:r,compositeRule:s,createErrors:n,allErrors:o}){void 0!==s&&(e.compositeRule=s),void 0!==n&&(e.createErrors=n),void 0!==o&&(e.allErrors=o),e.jtdDiscriminator=t,e.jtdMetadata=r}},1030:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=void 0;var s=r(9509);Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return s.KeywordCxt}});var n=r(9411);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return n._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return n.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return n.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return n.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return n.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return n.CodeGen}});const o=r(1205),a=r(3003),i=r(1819),c=r(3584),l=r(9411),u=r(4209),d=r(1312),f=r(2390),h=r(9863),p=r(1603),m=(e,t)=>new RegExp(e,t);m.code="new RegExp";const g=["removeAdditional","useDefaults","coerceTypes"],y=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),v={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.'};function $(e){var t,r,s,n,o,a,i,c,l,u,d,f,h,g,y,v,_,$,w,E,b,S,P,C,N;const O=e.strict,R=null===(t=e.code)||void 0===t?void 0:t.optimize,j=!0===R||void 0===R?1:R||0,k=null!==(s=null===(r=e.code)||void 0===r?void 0:r.regExp)&&void 0!==s?s:m,T=null!==(n=e.uriResolver)&&void 0!==n?n:p.default;return{strictSchema:null===(a=null!==(o=e.strictSchema)&&void 0!==o?o:O)||void 0===a||a,strictNumbers:null===(c=null!==(i=e.strictNumbers)&&void 0!==i?i:O)||void 0===c||c,strictTypes:null!==(u=null!==(l=e.strictTypes)&&void 0!==l?l:O)&&void 0!==u?u:"log",strictTuples:null!==(f=null!==(d=e.strictTuples)&&void 0!==d?d:O)&&void 0!==f?f:"log",strictRequired:null!==(g=null!==(h=e.strictRequired)&&void 0!==h?h:O)&&void 0!==g&&g,code:e.code?{...e.code,optimize:j,regExp:k}:{optimize:j,regExp:k},loopRequired:null!==(y=e.loopRequired)&&void 0!==y?y:200,loopEnum:null!==(v=e.loopEnum)&&void 0!==v?v:200,meta:null===(_=e.meta)||void 0===_||_,messages:null===($=e.messages)||void 0===$||$,inlineRefs:null===(w=e.inlineRefs)||void 0===w||w,schemaId:null!==(E=e.schemaId)&&void 0!==E?E:"$id",addUsedSchema:null===(b=e.addUsedSchema)||void 0===b||b,validateSchema:null===(S=e.validateSchema)||void 0===S||S,validateFormats:null===(P=e.validateFormats)||void 0===P||P,unicodeRegExp:null===(C=e.unicodeRegExp)||void 0===C||C,int32range:null===(N=e.int32range)||void 0===N||N,uriResolver:T}}class w{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...$(e)};const{es5:t,lines:r}=this.opts.code;this.scope=new l.ValueScope({scope:{},prefixes:y,es5:t,lines:r}),this.logger=function(e){if(!1===e)return O;if(void 0===e)return console;if(e.log&&e.warn&&e.error)return e;throw new Error("logger must implement log, warn and error methods")}(e.logger);const s=e.validateFormats;e.validateFormats=!1,this.RULES=(0,i.getRules)(),E.call(this,v,e,"NOT SUPPORTED"),E.call(this,_,e,"DEPRECATED","warn"),this._metaOpts=N.call(this),e.formats&&P.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&C.call(this,e.keywords),"object"==typeof e.meta&&this.addMetaSchema(e.meta),S.call(this),e.validateFormats=s}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:e,meta:t,schemaId:r}=this.opts;let s=h;"id"===r&&(s={...h},s.id=s.$id,delete s.$id),t&&e&&this.addMetaSchema(s,s[r],!1)}defaultMeta(){const{meta:e,schemaId:t}=this.opts;return this.opts.defaultMeta="object"==typeof e?e[t]||e:void 0}validate(e,t){let r;if("string"==typeof e){if(r=this.getSchema(e),!r)throw new Error(`no schema with key or ref "${e}"`)}else r=this.compile(e);const s=r(t);return"$async"in r||(this.errors=r.errors),s}compile(e,t){const r=this._addSchema(e,t);return r.validate||this._compileSchemaEnv(r)}compileAsync(e,t){if("function"!=typeof this.opts.loadSchema)throw new Error("options.loadSchema should be a function");const{loadSchema:r}=this.opts;return s.call(this,e,t);async function s(e,t){await n.call(this,e.$schema);const r=this._addSchema(e,t);return r.validate||o.call(this,r)}async function n(e){e&&!this.getSchema(e)&&await s.call(this,{$ref:e},!0)}async function o(e){try{return this._compileSchemaEnv(e)}catch(t){if(!(t instanceof a.default))throw t;return i.call(this,t),await c.call(this,t.missingSchema),o.call(this,e)}}function i({missingSchema:e,missingRef:t}){if(this.refs[e])throw new Error(`AnySchema ${e} is loaded but ${t} cannot be resolved`)}async function c(e){const r=await l.call(this,e);this.refs[e]||await n.call(this,r.$schema),this.refs[e]||this.addSchema(r,e,t)}async function l(e){const t=this._loading[e];if(t)return t;try{return await(this._loading[e]=r(e))}finally{delete this._loading[e]}}}addSchema(e,t,r,s=this.opts.validateSchema){if(Array.isArray(e)){for(const t of e)this.addSchema(t,void 0,r,s);return this}let n;if("object"==typeof e){const{schemaId:t}=this.opts;if(n=e[t],void 0!==n&&"string"!=typeof n)throw new Error(`schema ${t} must be string`)}return t=(0,u.normalizeId)(t||n),this._checkUnique(t),this.schemas[t]=this._addSchema(e,r,t,s,!0),this}addMetaSchema(e,t,r=this.opts.validateSchema){return this.addSchema(e,t,!0,r),this}validateSchema(e,t){if("boolean"==typeof e)return!0;let r;if(r=e.$schema,void 0!==r&&"string"!=typeof r)throw new Error("$schema must be a string");if(r=r||this.opts.defaultMeta||this.defaultMeta(),!r)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const s=this.validate(r,e);if(!s&&t){const e="schema is invalid: "+this.errorsText();if("log"!==this.opts.validateSchema)throw new Error(e);this.logger.error(e)}return s}getSchema(e){let t;for(;"string"==typeof(t=b.call(this,e));)e=t;if(void 0===t){const{schemaId:r}=this.opts,s=new c.SchemaEnv({schema:{},schemaId:r});if(t=c.resolveSchema.call(this,s,e),!t)return;this.refs[e]=t}return t.validate||this._compileSchemaEnv(t)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const t=b.call(this,e);return"object"==typeof t&&this._cache.delete(t.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{const t=e;this._cache.delete(t);let r=e[this.opts.schemaId];return r&&(r=(0,u.normalizeId)(r),delete this.schemas[r],delete this.refs[r]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(const t of e)this.addKeyword(t);return this}addKeyword(e,t){let r;if("string"==typeof e)r=e,"object"==typeof t&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),t.keyword=r);else{if("object"!=typeof e||void 0!==t)throw new Error("invalid addKeywords parameters");if(r=(t=e).keyword,Array.isArray(r)&&!r.length)throw new Error("addKeywords: keyword must be string or non-empty array")}if(j.call(this,r,t),!t)return(0,f.eachItem)(r,(e=>k.call(this,e))),this;I.call(this,t);const s={...t,type:(0,d.getJSONTypes)(t.type),schemaType:(0,d.getJSONTypes)(t.schemaType)};return(0,f.eachItem)(r,0===s.type.length?e=>k.call(this,e,s):e=>s.type.forEach((t=>k.call(this,e,s,t)))),this}getKeyword(e){const t=this.RULES.all[e];return"object"==typeof t?t.definition:!!t}removeKeyword(e){const{RULES:t}=this;delete t.keywords[e],delete t.all[e];for(const r of t.rules){const t=r.rules.findIndex((t=>t.keyword===e));t>=0&&r.rules.splice(t,1)}return this}addFormat(e,t){return"string"==typeof t&&(t=new RegExp(t)),this.formats[e]=t,this}errorsText(e=this.errors,{separator:t=", ",dataVar:r="data"}={}){return e&&0!==e.length?e.map((e=>`${r}${e.instancePath} ${e.message}`)).reduce(((e,r)=>e+t+r)):"No errors"}$dataMetaSchema(e,t){const r=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(const s of t){const t=s.split("/").slice(1);let n=e;for(const e of t)n=n[e];for(const e in r){const t=r[e];if("object"!=typeof t)continue;const{$data:s}=t.definition,o=n[e];s&&o&&(n[e]=D(o))}}return e}_removeAllSchemas(e,t){for(const r in e){const s=e[r];t&&!t.test(r)||("string"==typeof s?delete e[r]:s&&!s.meta&&(this._cache.delete(s.schema),delete e[r]))}}_addSchema(e,t,r,s=this.opts.validateSchema,n=this.opts.addUsedSchema){let o;const{schemaId:a}=this.opts;if("object"==typeof e)o=e[a];else{if(this.opts.jtd)throw new Error("schema must be object");if("boolean"!=typeof e)throw new Error("schema must be object or boolean")}let i=this._cache.get(e);if(void 0!==i)return i;r=(0,u.normalizeId)(o||r);const l=u.getSchemaRefs.call(this,e,r);return i=new c.SchemaEnv({schema:e,schemaId:a,meta:t,baseId:r,localRefs:l}),this._cache.set(i.schema,i),n&&!r.startsWith("#")&&(r&&this._checkUnique(r),this.refs[r]=i),s&&this.validateSchema(e,!0),i}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):c.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){const t=this.opts;this.opts=this._metaOpts;try{c.compileSchema.call(this,e)}finally{this.opts=t}}}function E(e,t,r,s="error"){for(const n in e){const o=n;o in t&&this.logger[s](`${r}: option ${n}. ${e[o]}`)}}function b(e){return e=(0,u.normalizeId)(e),this.schemas[e]||this.refs[e]}function S(){const e=this.opts.schemas;if(e)if(Array.isArray(e))this.addSchema(e);else for(const t in e)this.addSchema(e[t],t)}function P(){for(const e in this.opts.formats){const t=this.opts.formats[e];t&&this.addFormat(e,t)}}function C(e){if(Array.isArray(e))this.addVocabulary(e);else{this.logger.warn("keywords option as map is deprecated, pass array");for(const t in e){const r=e[t];r.keyword||(r.keyword=t),this.addKeyword(r)}}}function N(){const e={...this.opts};for(const t of g)delete e[t];return e}t.default=w,w.ValidationError=o.default,w.MissingRefError=a.default;const O={log(){},warn(){},error(){}},R=/^[a-z_$][a-z0-9_$:-]*$/i;function j(e,t){const{RULES:r}=this;if((0,f.eachItem)(e,(e=>{if(r.keywords[e])throw new Error(`Keyword ${e} is already defined`);if(!R.test(e))throw new Error(`Keyword ${e} has invalid name`)})),t&&t.$data&&!("code"in t)&&!("validate"in t))throw new Error('$data keyword must have "code" or "validate" function')}function k(e,t,r){var s;const n=null==t?void 0:t.post;if(r&&n)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:o}=this;let a=n?o.post:o.rules.find((({type:e})=>e===r));if(a||(a={type:r,rules:[]},o.rules.push(a)),o.keywords[e]=!0,!t)return;const i={keyword:e,definition:{...t,type:(0,d.getJSONTypes)(t.type),schemaType:(0,d.getJSONTypes)(t.schemaType)}};t.before?T.call(this,a,i,t.before):a.rules.push(i),o.all[e]=i,null===(s=t.implements)||void 0===s||s.forEach((e=>this.addKeyword(e)))}function T(e,t,r){const s=e.rules.findIndex((e=>e.keyword===r));s>=0?e.rules.splice(s,0,t):(e.rules.push(t),this.logger.warn(`rule ${r} is not defined`))}function I(e){let{metaSchema:t}=e;void 0!==t&&(e.$data&&this.opts.$data&&(t=D(t)),e.validateSchema=this.compile(t,!0))}const A={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function D(e){return{anyOf:[e,A]}}},4179:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=void 0;const s=r(1030),n=r(5735),o=r(1361),a=r(1509),i=r(9378),c="JTD-meta-schema";class l extends s.default{constructor(e={}){super({...e,jtd:!0})}_addVocabularies(){super._addVocabularies(),this.addVocabulary(n.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema(),this.opts.meta&&this.addMetaSchema(o.default,c,!1)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(c)?c: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(i.default.call(this,e,e.schema.definitions||{}),!e.parse)throw new Error("ajv implementation error");return e.parse}}e.exports=t=l,Object.defineProperty(t,"__esModule",{value:!0}),t.default=l;var u=r(9509);Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return u.KeywordCxt}});var d=r(9411);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return d._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return d.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return d.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return d.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return d.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return d.CodeGen}})},1361:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=e=>{const t={nullable:{type:"boolean"},metadata:{optionalProperties:{union:{elements:{ref:"schema"}}},additionalProperties:!0}};return e&&(t.definitions={values:{ref:"schema"}}),t},s=e=>({optionalProperties:r(e)}),n=e=>({properties:{ref:{type:"string"}},optionalProperties:r(e)}),o=e=>({properties:{type:{enum:["boolean","timestamp","string","float32","float64","int8","uint8","int16","uint16","int32","uint32"]}},optionalProperties:r(e)}),a=e=>({properties:{enum:{elements:{type:"string"}}},optionalProperties:r(e)}),i=e=>({properties:{elements:{ref:"schema"}},optionalProperties:r(e)}),c=e=>({properties:{properties:{values:{ref:"schema"}}},optionalProperties:{optionalProperties:{values:{ref:"schema"}},additionalProperties:{type:"boolean"},...r(e)}}),l=e=>({properties:{optionalProperties:{values:{ref:"schema"}}},optionalProperties:{additionalProperties:{type:"boolean"},...r(e)}}),u=e=>({properties:{discriminator:{type:"string"},mapping:{values:{metadata:{union:[c(!1),l(!1)]}}}},optionalProperties:r(e)}),d=e=>({properties:{values:{ref:"schema"}},optionalProperties:r(e)}),f=e=>({metadata:{union:[s,n,o,a,i,c,l,u,d].map((t=>t(e)))}}),h={definitions:{schema:f(!1)},...f(!0)};t.default=h},3561:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseJsonString=t.parseJsonNumber=t.parseJson=void 0;const r=/position\s(\d+)$/;function s(e,t){let n,o;s.message=void 0,t&&(e=e.slice(t));try{return s.position=t+e.length,JSON.parse(e)}catch(a){if(o=r.exec(a.message),!o)return void(s.message="unexpected end");n=+o[1];const i=e[n];e=e.slice(0,n),s.position=t+n;try{return JSON.parse(e)}catch(e){return void(s.message=`unexpected token ${i}`)}}}function n(e,t,r){let s,o="";if(n.message=void 0,"-"===e[t]&&(o+="-",t++),"0"===e[t])o+="0",t++;else if(!a(r))return void i();if(r)return n.position=t,+o;if("."!==e[t]||(o+=".",t++,a())){if(s=e[t],"e"!==s&&"E"!==s||(o+="e",t++,s=e[t],("+"===s||"-"===s)&&(o+=s,t++),a()))return n.position=t,+o;i()}else i();function a(r){let n=!1;for(;s=e[t],s>="0"&&s<="9"&&(void 0===r||r-- >0);)n=!0,o+=s,t++;return n}function i(){n.position=t,n.message=t<e.length?`unexpected token ${e[t]}`:"unexpected end"}}t.parseJson=s,s.message=void 0,s.position=0,s.code='require("ajv/dist/runtime/parseJson").parseJson',t.parseJsonNumber=n,n.message=void 0,n.position=0,n.code='require("ajv/dist/runtime/parseJson").parseJsonNumber';const o={b:"\b",f:"\f",n:"\n",r:"\r",t:"\t",'"':'"',"/":"/","\\":"\\"},a="a".charCodeAt(0),i="0".charCodeAt(0);function c(e,t){let r,s="";for(c.message=void 0;r=e[t++],'"'!==r;)if("\\"===r)if(r=e[t],r in o)s+=o[r],t++;else{if("u"!==r)return void n(`unexpected token ${r}`);{t++;let o=4,c=0;for(;o--;){if(c<<=4,r=e[t],void 0===r)return void n("unexpected end");if(r=r.toLowerCase(),r>="a"&&r<="f")c+=r.charCodeAt(0)-a+10;else{if(!(r>="0"&&r<="9"))return void n(`unexpected token ${r}`);c+=r.charCodeAt(0)-i}t++}s+=String.fromCharCode(c)}}else{if(void 0===r)return void n("unexpected end");if(!(r.charCodeAt(0)>=32))return void n(`unexpected token ${r}`);s+=r}return c.position=t,s;function n(e){c.position=t,c.message=e}}t.parseJsonString=c,c.message=void 0,c.position=0,c.code='require("ajv/dist/runtime/parseJson").parseJsonString'},3456:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=/[\\"\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,s={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};function n(e){return r.lastIndex=0,'"'+(r.test(e)?e.replace(r,(e=>{const t=s[e];return"string"==typeof t?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})):e)+'"'}t.default=n,n.code='require("ajv/dist/runtime/quote").default'},6596:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=/t|\s/i,s=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,n=/^(\d\d):(\d\d):(\d\d)(?:\.\d+)?(?:z|([+-]\d\d)(?::?(\d\d))?)$/i,o=[0,31,28,31,30,31,30,31,31,30,31,30,31];function a(e,t){const s=e.split(r);return 2===s.length&&i(s[0])&&function(e){const t=n.exec(e);if(!t)return!1;const r=+t[1],s=+t[2],o=+t[3],a=+(t[4]||0),i=+(t[5]||0);return r<=23&&s<=59&&o<=59||r-a==23&&s-i==59&&60===o}(s[1])||t&&1===s.length&&i(s[0])}function i(e){const t=s.exec(e);if(!t)return!1;const r=+t[1],n=+t[2],a=+t[3];return n>=1&&n<=12&&a>=1&&(a<=o[n]||2===n&&29===a&&(r%100==0?r%400==0:r%4==0))}t.default=a,a.code='require("ajv/dist/runtime/timestamp").default'},1603:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=r(540);s.code='require("ajv/dist/runtime/uri").default',t.default=s},1205:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});class r extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}}t.default=r},2309:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateUnion=t.validateArray=t.usePattern=t.callValidateCode=t.schemaProperties=t.allSchemaProperties=t.noPropertyInData=t.propertyInData=t.isOwnProperty=t.hasPropFunc=t.reportMissingProp=t.checkMissingProp=t.checkReportMissingProp=void 0;const s=r(9411),n=r(2390),o=r(6579),a=r(2390);function i(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:s._`Object.prototype.hasOwnProperty`})}function c(e,t,r){return s._`${i(e)}.call(${t}, ${r})`}function l(e,t,r,n){const o=s._`${t}${(0,s.getProperty)(r)} === undefined`;return n?(0,s.or)(o,(0,s.not)(c(e,t,r))):o}function u(e){return e?Object.keys(e).filter((e=>"__proto__"!==e)):[]}t.checkReportMissingProp=function(e,t){const{gen:r,data:n,it:o}=e;r.if(l(r,n,t,o.opts.ownProperties),(()=>{e.setParams({missingProperty:s._`${t}`},!0),e.error()}))},t.checkMissingProp=function({gen:e,data:t,it:{opts:r}},n,o){return(0,s.or)(...n.map((n=>(0,s.and)(l(e,t,n,r.ownProperties),s._`${o} = ${n}`))))},t.reportMissingProp=function(e,t){e.setParams({missingProperty:t},!0),e.error()},t.hasPropFunc=i,t.isOwnProperty=c,t.propertyInData=function(e,t,r,n){const o=s._`${t}${(0,s.getProperty)(r)} !== undefined`;return n?s._`${o} && ${c(e,t,r)}`:o},t.noPropertyInData=l,t.allSchemaProperties=u,t.schemaProperties=function(e,t){return u(t).filter((r=>!(0,n.alwaysValidSchema)(e,t[r])))},t.callValidateCode=function({schemaCode:e,data:t,it:{gen:r,topSchemaRef:n,schemaPath:a,errorPath:i},it:c},l,u,d){const f=d?s._`${e}, ${t}, ${n}${a}`:t,h=[[o.default.instancePath,(0,s.strConcat)(o.default.instancePath,i)],[o.default.parentData,c.parentData],[o.default.parentDataProperty,c.parentDataProperty],[o.default.rootData,o.default.rootData]];c.opts.dynamicRef&&h.push([o.default.dynamicAnchors,o.default.dynamicAnchors]);const p=s._`${f}, ${r.object(...h)}`;return u!==s.nil?s._`${l}.call(${u}, ${p})`:s._`${l}(${p})`};const d=s._`new RegExp`;t.usePattern=function({gen:e,it:{opts:t}},r){const n=t.unicodeRegExp?"u":"",{regExp:o}=t.code,i=o(r,n);return e.scopeValue("pattern",{key:i.toString(),ref:i,code:s._`${"new RegExp"===o.code?d:(0,a.useFunc)(e,o)}(${r}, ${n})`})},t.validateArray=function(e){const{gen:t,data:r,keyword:o,it:a}=e,i=t.name("valid");if(a.allErrors){const e=t.let("valid",!0);return c((()=>t.assign(e,!1))),e}return t.var(i,!0),c((()=>t.break())),i;function c(a){const c=t.const("len",s._`${r}.length`);t.forRange("i",0,c,(r=>{e.subschema({keyword:o,dataProp:r,dataPropType:n.Type.Num},i),t.if((0,s.not)(i),a)}))}},t.validateUnion=function(e){const{gen:t,schema:r,keyword:o,it:a}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some((e=>(0,n.alwaysValidSchema)(a,e)))&&!a.opts.unevaluated)return;const i=t.let("valid",!1),c=t.name("_valid");t.block((()=>r.forEach(((r,n)=>{const a=e.subschema({keyword:o,schemaProp:n,compositeRule:!0},c);t.assign(i,s._`${i} || ${c}`),e.mergeValidEvaluated(a,c)||t.if((0,s.not)(i))})))),e.result(i,(()=>e.reset()),(()=>e.error(!0)))}},8697:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.callRef=t.getValidate=void 0;const s=r(3003),n=r(2309),o=r(9411),a=r(6579),i=r(3584),c=r(2390),l={keyword:"$ref",schemaType:"string",code(e){const{gen:t,schema:r,it:n}=e,{baseId:a,schemaEnv:c,validateName:l,opts:f,self:h}=n,{root:p}=c;if(("#"===r||"#/"===r)&&a===p.baseId)return function(){if(c===p)return d(e,l,c,c.$async);const r=t.scopeValue("root",{ref:p});return d(e,o._`${r}.validate`,p,p.$async)}();const m=i.resolveRef.call(h,p,a,r);if(void 0===m)throw new s.default(n.opts.uriResolver,a,r);return m instanceof i.SchemaEnv?function(t){const r=u(e,t);d(e,r,t,t.$async)}(m):function(s){const n=t.scopeValue("schema",!0===f.code.source?{ref:s,code:(0,o.stringify)(s)}:{ref:s}),a=t.name("valid"),i=e.subschema({schema:s,dataTypes:[],schemaPath:o.nil,topSchemaRef:n,errSchemaPath:r},a);e.mergeEvaluated(i),e.ok(a)}(m)}};function u(e,t){const{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):o._`${r.scopeValue("wrapper",{ref:t})}.validate`}function d(e,t,r,s){const{gen:i,it:l}=e,{allErrors:u,schemaEnv:d,opts:f}=l,h=f.passContext?a.default.this:o.nil;function p(e){const t=o._`${e}.errors`;i.assign(a.default.vErrors,o._`${a.default.vErrors} === null ? ${t} : ${a.default.vErrors}.concat(${t})`),i.assign(a.default.errors,o._`${a.default.vErrors}.length`)}function m(e){var t;if(!l.opts.unevaluated)return;const s=null===(t=null==r?void 0:r.validate)||void 0===t?void 0:t.evaluated;if(!0!==l.props)if(s&&!s.dynamicProps)void 0!==s.props&&(l.props=c.mergeEvaluated.props(i,s.props,l.props));else{const t=i.var("props",o._`${e}.evaluated.props`);l.props=c.mergeEvaluated.props(i,t,l.props,o.Name)}if(!0!==l.items)if(s&&!s.dynamicItems)void 0!==s.items&&(l.items=c.mergeEvaluated.items(i,s.items,l.items));else{const t=i.var("items",o._`${e}.evaluated.items`);l.items=c.mergeEvaluated.items(i,t,l.items,o.Name)}}s?function(){if(!d.$async)throw new Error("async schema referenced by sync schema");const r=i.let("valid");i.try((()=>{i.code(o._`await ${(0,n.callValidateCode)(e,t,h)}`),m(t),u||i.assign(r,!0)}),(e=>{i.if(o._`!(${e} instanceof ${l.ValidationError})`,(()=>i.throw(e))),p(e),u||i.assign(r,!1)})),e.ok(r)}():e.result((0,n.callValidateCode)(e,t,h),(()=>m(t)),(()=>p(t)))}t.getValidate=u,t.callRef=d,t.default=l},7218:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.DiscrError=void 0,(r=t.DiscrError||(t.DiscrError={})).Tag="tag",r.Mapping="mapping"},5838:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=r(9411),n=r(5327),o=r(7741),a=r(6901),i=r(7218),c={keyword:"discriminator",schemaType:"string",implements:["mapping"],error:{message:e=>{const{schema:t,params:r}=e;return r.discrError?r.discrError===i.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in mapping`:(0,a.typeErrorMessage)(e,"object")},params:e=>{const{schema:t,params:r}=e;return r.discrError?s._`{error: ${r.discrError}, tag: ${t}, tagValue: ${r.tag}}`:(0,a.typeErrorParams)(e,"object")}},code(e){(0,n.checkMetadata)(e);const{gen:t,data:r,schema:a,parentSchema:c}=e,[l,u]=(0,o.checkNullableObject)(e,r);function d(r){const s=t.name("valid");return e.subschema({keyword:"mapping",schemaProp:r,jtdDiscriminator:a},s),s}t.if(u),function(){const n=t.const("tag",s._`${r}${(0,s.getProperty)(a)}`);t.if(s._`${n} === undefined`),e.error(!1,{discrError:i.DiscrError.Tag,tag:n}),t.elseIf(s._`typeof ${n} == "string"`),function(r){t.if(!1);for(const e in c.mapping)t.elseIf(s._`${r} === ${e}`),t.assign(l,d(e));t.else(),e.error(!1,{discrError:i.DiscrError.Mapping,tag:r},{instancePath:a,schemaPath:"mapping",parentSchema:!0}),t.endIf()}(n),t.else(),e.error(!1,{discrError:i.DiscrError.Tag,tag:n},{instancePath:a}),t.endIf()}(),t.elseIf((0,s.not)(l)),e.error(),t.endIf(),e.ok(l)}};t.default=c},5983:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=r(2390),n=r(2309),o=r(9411),a=r(5327),i=r(7741),c={keyword:"elements",schemaType:"object",error:(0,r(6901).typeError)("array"),code(e){(0,a.checkMetadata)(e);const{gen:t,data:r,schema:c,it:l}=e;if((0,s.alwaysValidSchema)(l,c))return;const[u]=(0,i.checkNullable)(e);t.if((0,o.not)(u),(()=>t.if(o._`Array.isArray(${r})`,(()=>t.assign(u,(0,n.validateArray)(e))),(()=>e.error())))),e.ok(u)}};t.default=c},6583:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=r(9411),n=r(5327),o=r(7741),a={keyword:"enum",schemaType:"array",error:{message:"must be equal to one of the allowed values",params:({schemaCode:e})=>s._`{allowedValues: ${e}}`},code(e){(0,n.checkMetadata)(e);const{gen:t,data:r,schema:a,schemaValue:i,parentSchema:c,it:l}=e;if(0===a.length)throw new Error("enum must have non-empty array");if(a.length!==new Set(a).size)throw new Error("enum items must be unique");let u;const d=s._`typeof ${r} == "string"`;if(a.length>=l.opts.loopEnum){let n;[u,n]=(0,o.checkNullable)(e,d),t.if(n,(function(){t.forOf("v",i,(e=>t.if(s._`${u} = ${r} === ${e}`,(()=>t.break()))))}))}else{if(!Array.isArray(a))throw new Error("ajv implementation error");u=(0,s.and)(d,(0,s.or)(...a.map((e=>s._`${r} === ${e}`)))),c.nullable&&(u=(0,s.or)(s._`${r} === null`,u))}e.pass(u)}};t.default=a},6901:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.typeErrorParams=t.typeErrorMessage=t.typeError=void 0;const s=r(9411);function n({parentSchema:e},t){return(null==e?void 0:e.nullable)?`must be ${t} or null`:`must be ${t}`}function o({parentSchema:e},t){return s._`{type: ${t}, nullable: ${!!(null==e?void 0:e.nullable)}}`}t.typeError=function(e){return{message:t=>n(t,e),params:t=>o(t,e)}},t.typeErrorMessage=n,t.typeErrorParams=o},5735:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=r(1837),n=r(4394),o=r(6583),a=r(5983),i=r(840),c=r(7679),l=r(5838),u=r(9933),d=r(2350),f=r(5327),h=["definitions",s.default,n.default,o.default,a.default,i.default,c.default,l.default,u.default,d.default,f.default,{keyword:"additionalProperties",schemaType:"boolean"},{keyword:"nullable",schemaType:"boolean"}];t.default=h},5327:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.checkMetadata=void 0;const s=r(2390),n={keyword:"metadata",schemaType:"object",code(e){o(e);const{gen:t,schema:r,it:n}=e;if((0,s.alwaysValidSchema)(n,r))return;const a=t.name("valid");e.subschema({keyword:"metadata",jtdMetadata:!0},a),e.ok(a)}};function o({it:e,keyword:t},r){if(e.jtdMetadata!==r)throw new Error(`JTD: "${t}" cannot be used in this schema location`)}t.checkMetadata=o,t.default=n},7741:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.checkNullableObject=t.checkNullable=void 0;const s=r(9411);function n({gen:e,data:t,parentSchema:r},n=s.nil){const o=e.name("valid");return r.nullable?(e.let(o,s._`${t} === null`),n=(0,s.not)(o)):e.let(o,!1),[o,n]}t.checkNullable=n,t.checkNullableObject=function(e,t){const[r,o]=n(e,t);return[r,s._`${o} && typeof ${e.data} == "object" && !Array.isArray(${e.data})`]}},7679:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=r(840),n={keyword:"optionalProperties",schemaType:"object",error:s.error,code(e){e.parentSchema.properties||(0,s.validateProperties)(e)}};t.default=n},840:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateProperties=t.error=void 0;const s=r(2309),n=r(2390),o=r(9411),a=r(5327),i=r(7741),c=r(6901);var l;!function(e){e.Additional="additional",e.Missing="missing"}(l||(l={})),t.error={message:e=>{const{params:t}=e;return t.propError?t.propError===l.Additional?"must NOT have additional properties":`must have property '${t.missingProperty}'`:(0,c.typeErrorMessage)(e,"object")},params:e=>{const{params:t}=e;return t.propError?t.propError===l.Additional?o._`{error: ${t.propError}, additionalProperty: ${t.additionalProperty}}`:o._`{error: ${t.propError}, missingProperty: ${t.missingProperty}}`:(0,c.typeErrorParams)(e,"object")}};const u={keyword:"properties",schemaType:"object",error:t.error,code:d};function d(e){(0,a.checkMetadata)(e);const{gen:t,data:r,parentSchema:c,it:u}=e,{additionalProperties:d,nullable:f}=c;if(u.jtdDiscriminator&&f)throw new Error("JTD: nullable inside discriminator mapping");if(function(){const e=c.properties,t=c.optionalProperties;if(!e||!t)return!1;for(const r in e)if(Object.prototype.hasOwnProperty.call(t,r))return!0;return!1}())throw new Error("JTD: properties and optionalProperties have common members");const[h,p]=_("properties"),[m,g]=_("optionalProperties");if(0===p.length&&0===g.length&&d)return;const[y,v]=void 0===u.jtdDiscriminator?(0,i.checkNullableObject)(e,r):[t.let("valid",!1),!0];function _(e){const t=c[e],r=t?(0,s.allSchemaProperties)(t):[];if(u.jtdDiscriminator&&r.some((e=>e===u.jtdDiscriminator)))throw new Error(`JTD: discriminator tag used in ${e}`);const o=r.filter((e=>!(0,n.alwaysValidSchema)(u,t[e])));return[r,o]}function $(n,o,a){const i=t.var("valid");for(const a of n)t.if((0,s.propertyInData)(t,r,a,u.opts.ownProperties),(()=>w(a,o,i)),(()=>c(a))),e.ok(i);function c(r){a?(t.assign(i,!1),e.error(!1,{propError:l.Missing,missingProperty:r},{schemaPath:r})):t.assign(i,!0)}}function w(t,r,s){e.subschema({keyword:r,schemaProp:t,dataProp:t},s)}function E(e,r,a){let i;if(r.length>8){const r=(0,n.schemaRefOrVal)(u,c[a],a);i=(0,o.not)((0,s.isOwnProperty)(t,r,e))}else i=!r.length||(0,o.and)(...r.map((t=>o._`${e} !== ${t}`)));return i}t.if(v,(()=>t.assign(y,!0).block((()=>{$(p,"properties",!0),$(g,"optionalProperties"),d||t.forIn("key",r,(s=>{const n=void 0===u.jtdDiscriminator?h:[u.jtdDiscriminator].concat(h),a=E(s,n,"properties"),i=E(s,m,"optionalProperties"),c=!0===a?i:!0===i?a:(0,o.and)(a,i);t.if(c,(()=>{u.opts.removeAdditional?t.code(o._`delete ${r}[${s}]`):(e.error(!1,{propError:l.Additional,additionalProperty:s},{instancePath:s,parentSchema:!0}),u.opts.allErrors||t.break())}))}))})))),e.pass(y)}t.validateProperties=d,t.default=u},1837:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hasRef=void 0;const s=r(3584),n=r(9411),o=r(3003),a=r(6579),i=r(8697),c=r(5327),l={keyword:"ref",schemaType:"string",code(e){(0,c.checkMetadata)(e);const{gen:t,data:r,schema:l,parentSchema:d,it:f}=e,{schemaEnv:{root:h}}=f,p=t.name("valid");function m(){var r;const c=null===(r=h.schema.definitions)||void 0===r?void 0:r[l];if(!c)throw new o.default(f.opts.uriResolver,"",l,`No definition ${l}`);u(c)||!f.opts.inlineRefs?function(r){const o=s.compileSchema.call(f.self,new s.SchemaEnv({schema:r,root:h,schemaPath:`/definitions/${l}`})),c=(0,i.getValidate)(e,o),u=t.const("_errs",a.default.errors);(0,i.callRef)(e,c,o,o.$async),t.assign(p,n._`${u} === ${a.default.errors}`)}(c):function(r){const s=t.scopeValue("schema",!0===f.opts.code.source?{ref:r,code:(0,n.stringify)(r)}:{ref:r});e.subschema({schema:r,dataTypes:[],schemaPath:n.nil,topSchemaRef:s,errSchemaPath:`/definitions/${l}`},p)}(c)}d.nullable?(t.var(p,n._`${r} === null`),t.if((0,n.not)(p),m)):(t.var(p,!1),m()),e.ok(p)}};function u(e){for(const t in e){let r;if("ref"===t||"object"==typeof(r=e[t])&&u(r))return!0}return!1}t.hasRef=u,t.default=l},4394:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.intRange=void 0;const s=r(9411),n=r(6596),o=r(2390),a=r(5327),i=r(6901);t.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 c={keyword:"type",schemaType:"string",error:{message:e=>(0,i.typeErrorMessage)(e,e.schema),params:e=>(0,i.typeErrorParams)(e,e.schema)},code(e){(0,a.checkMetadata)(e);const{data:r,schema:i,parentSchema:c,it:l}=e;let u;switch(i){case"boolean":case"string":u=s._`typeof ${r} == ${i}`;break;case"timestamp":u=function(e){const{gen:t,data:r,it:a}=e,{timestamp:i,allowDate:c}=a.opts;if("date"===i)return s._`${r} instanceof Date `;const l=(0,o.useFunc)(t,n.default),u=c?s._`, true`:s.nil,d=s._`typeof ${r} == "string" && ${l}(${r}${u})`;return"string"===i?d:(0,s.or)(s._`${r} instanceof Date`,d)}(e);break;case"float32":case"float64":u=s._`typeof ${r} == "number"`;break;default:{const e=i;if(u=s._`typeof ${r} == "number" && isFinite(${r}) && !(${r} % 1)`,l.opts.int32range||"int32"!==e&&"uint32"!==e){const[n,o]=t.intRange[e];u=s._`${u} && ${r} >= ${n} && ${r} <= ${o}`}else"uint32"===e&&(u=s._`${u} && ${r} >= 0`)}}e.pass(c.nullable?(0,s.or)(s._`${r} === null`,u):u)}};t.default=c},2350:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s={keyword:"union",schemaType:"array",trackErrors:!0,code:r(2309).validateUnion,error:{message:"must match a schema in union"}};t.default=s},9933:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=r(2390),n=r(9411),o=r(5327),a=r(7741),i={keyword:"values",schemaType:"object",error:(0,r(6901).typeError)("object"),code(e){(0,o.checkMetadata)(e);const{gen:t,data:r,schema:i,it:c}=e;if((0,s.alwaysValidSchema)(c,i))return;const[l,u]=(0,a.checkNullableObject)(e,r);t.if(u),t.assign(l,function(){const o=t.name("valid");if(c.allErrors){const e=t.let("valid",!0);return a((()=>t.assign(e,!1))),e}return t.var(o,!0),a((()=>t.break())),o;function a(a){t.forIn("key",r,(r=>{e.subschema({keyword:"values",dataProp:r,dataPropType:s.Type.Str},o),t.if((0,n.not)(o),a)}))}}()),t.elseIf((0,n.not)(l)),e.error(),t.endIf(),e.ok(l)}};t.default=i},2125:e=>{"use strict";var t=e.exports=function(e,t,s){"function"==typeof t&&(s=t,t={}),r(t,"function"==typeof(s=t.cb||s)?s:s.pre||function(){},s.post||function(){},e,"",e)};function r(e,s,n,o,a,i,c,l,u,d){if(o&&"object"==typeof o&&!Array.isArray(o)){for(var f in s(o,a,i,c,l,u,d),o){var h=o[f];if(Array.isArray(h)){if(f in t.arrayKeywords)for(var p=0;p<h.length;p++)r(e,s,n,h[p],a+"/"+f+"/"+p,i,a,f,o,p)}else if(f in t.propsKeywords){if(h&&"object"==typeof h)for(var m in h)r(e,s,n,h[m],a+"/"+f+"/"+m.replace(/~/g,"~0").replace(/\//g,"~1"),i,a,f,o,m)}else(f in t.keywords||e.allKeys&&!(f in t.skipKeywords))&&r(e,s,n,h,a+"/"+f,i,a,f,o)}n(o,a,i,c,l,u,d)}}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}},1227:(e,t,r)=>{t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const r="color: "+this.color;t.splice(1,0,r,"color: inherit");let s=0,n=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(s++,"%c"===e&&(n=s))})),t.splice(n,0,r)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e},t.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!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"],t.log=console.debug||console.log||(()=>{}),e.exports=r(2447)(t);const{formatters:s}=e.exports;s.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},2447:(e,t,r)=>{e.exports=function(e){function t(e){let r,n,o,a=null;function i(...e){if(!i.enabled)return;const s=i,n=Number(new Date),o=n-(r||n);s.diff=o,s.prev=r,s.curr=n,r=n,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let a=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((r,n)=>{if("%%"===r)return"%";a++;const o=t.formatters[n];if("function"==typeof o){const t=e[a];r=o.call(s,t),e.splice(a,1),a--}return r})),t.formatArgs.call(s,e),(s.log||t.log).apply(s,e)}return i.namespace=e,i.useColors=t.useColors(),i.color=t.selectColor(e),i.extend=s,i.destroy=t.destroy,Object.defineProperty(i,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==a?a:(n!==t.namespaces&&(n=t.namespaces,o=t.enabled(e)),o),set:e=>{a=e}}),"function"==typeof t.init&&t.init(i),i}function s(e,r){const s=t(this.namespace+(void 0===r?":":r)+e);return s.log=this.log,s}function n(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){const e=[...t.names.map(n),...t.skips.map(n).map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){let r;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const s=("string"==typeof e?e:"").split(/[\s,]+/),n=s.length;for(r=0;r<n;r++)s[r]&&("-"===(e=s[r].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.slice(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){if("*"===e[e.length-1])return!0;let r,s;for(r=0,s=t.skips.length;r<s;r++)if(t.skips[r].test(e))return!1;for(r=0,s=t.names.length;r<s;r++)if(t.names[r].test(e))return!0;return!1},t.humanize=r(7824),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach((r=>{t[r]=e[r]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let r=0;for(let t=0;t<e.length;t++)r=(r<<5)-r+e.charCodeAt(t),r|=0;return t.colors[Math.abs(r)%t.colors.length]},t.enable(t.load()),t}},6378:function(e,t){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,r=1,s=arguments.length;r<s;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},r.apply(this,arguments)};function s(e,t){if(!t)return"";var r="; "+e;return!0===t?r:r+"="+t}function n(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)+function(e){if("number"==typeof e.expires){var t=new Date;t.setMilliseconds(t.getMilliseconds()+864e5*e.expires),e.expires=t}return s("Expires",e.expires?e.expires.toUTCString():"")+s("Domain",e.domain)+s("Path",e.path)+s("Secure",e.secure)+s("SameSite",e.sameSite)}(r)}function o(e){for(var t={},r=e?e.split("; "):[],s=/(%[\dA-F]{2})+/gi,n=0;n<r.length;n++){var o=r[n].split("="),a=o.slice(1).join("=");'"'===a.charAt(0)&&(a=a.slice(1,-1));try{t[o[0].replace(s,decodeURIComponent)]=a.replace(s,decodeURIComponent)}catch(e){}}return t}function a(){return o(document.cookie)}function i(e,t,s){document.cookie=n(e,t,r({path:"/"},s))}t.__esModule=!0,t.encode=n,t.parse=o,t.getAll=a,t.get=function(e){return a()[e]},t.set=i,t.remove=function(e,t){i(e,"",r(r({},t),{expires:-1}))}},4063:e=>{"use strict";e.exports=function e(t,r){if(t===r)return!0;if(t&&r&&"object"==typeof t&&"object"==typeof r){if(t.constructor!==r.constructor)return!1;var s,n,o;if(Array.isArray(t)){if((s=t.length)!=r.length)return!1;for(n=s;0!=n--;)if(!e(t[n],r[n]))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((s=(o=Object.keys(t)).length)!==Object.keys(r).length)return!1;for(n=s;0!=n--;)if(!Object.prototype.hasOwnProperty.call(r,o[n]))return!1;for(n=s;0!=n--;){var a=o[n];if(!e(t[a],r[a]))return!1}return!0}return t!=t&&r!=r}},7824:e=>{var t=1e3,r=60*t,s=60*r,n=24*s;function o(e,t,r,s){var n=t>=1.5*r;return Math.round(e/r)+" "+s+(n?"s":"")}e.exports=function(e,a){a=a||{};var i,c,l=typeof e;if("string"===l&&e.length>0)return function(e){if(!((e=String(e)).length>100)){var o=/^(-?(?:\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(o){var a=parseFloat(o[1]);switch((o[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*a;case"weeks":case"week":case"w":return 6048e5*a;case"days":case"day":case"d":return a*n;case"hours":case"hour":case"hrs":case"hr":case"h":return a*s;case"minutes":case"minute":case"mins":case"min":case"m":return a*r;case"seconds":case"second":case"secs":case"sec":case"s":return a*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return a;default:return}}}}(e);if("number"===l&&isFinite(e))return a.long?(i=e,(c=Math.abs(i))>=n?o(i,c,n,"day"):c>=s?o(i,c,s,"hour"):c>=r?o(i,c,r,"minute"):c>=t?o(i,c,t,"second"):i+" ms"):function(e){var o=Math.abs(e);return o>=n?Math.round(e/n)+"d":o>=s?Math.round(e/s)+"h":o>=r?Math.round(e/r)+"m":o>=t?Math.round(e/t)+"s":e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},540:function(e,t){!function(e){"use strict";function t(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];if(t.length>1){t[0]=t[0].slice(0,-1);for(var s=t.length-1,n=1;n<s;++n)t[n]=t[n].slice(1,-1);return t[s]=t[s].slice(1),t.join("")}return t[0]}function r(e){return"(?:"+e+")"}function s(e){return void 0===e?"undefined":null===e?"null":Object.prototype.toString.call(e).split(" ").pop().split("]").shift().toLowerCase()}function n(e){return e.toUpperCase()}function o(e){var s="[A-Za-z]",n="[0-9]",o=t(n,"[A-Fa-f]"),a=r(r("%[EFef]"+o+"%"+o+o+"%"+o+o)+"|"+r("%[89A-Fa-f]"+o+"%"+o+o)+"|"+r("%"+o+o)),i="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",c=t("[\\:\\/\\?\\#\\[\\]\\@]",i),l=e?"[\\uE000-\\uF8FF]":"[]",u=t(s,n,"[\\-\\.\\_\\~]",e?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]"),d=r(s+t(s,n,"[\\+\\-\\.]")+"*"),f=r(r(a+"|"+t(u,i,"[\\:]"))+"*"),h=(r(r("25[0-5]")+"|"+r("2[0-4][0-9]")+"|"+r("1[0-9][0-9]")+"|"+r("[1-9][0-9]")+"|"+n),r(r("25[0-5]")+"|"+r("2[0-4][0-9]")+"|"+r("1[0-9][0-9]")+"|"+r("0?[1-9][0-9]")+"|0?0?"+n)),p=r(h+"\\."+h+"\\."+h+"\\."+h),m=r(o+"{1,4}"),g=r(r(m+"\\:"+m)+"|"+p),y=r(r(m+"\\:")+"{6}"+g),v=r("\\:\\:"+r(m+"\\:")+"{5}"+g),_=r(r(m)+"?\\:\\:"+r(m+"\\:")+"{4}"+g),$=r(r(r(m+"\\:")+"{0,1}"+m)+"?\\:\\:"+r(m+"\\:")+"{3}"+g),w=r(r(r(m+"\\:")+"{0,2}"+m)+"?\\:\\:"+r(m+"\\:")+"{2}"+g),E=r(r(r(m+"\\:")+"{0,3}"+m)+"?\\:\\:"+m+"\\:"+g),b=r(r(r(m+"\\:")+"{0,4}"+m)+"?\\:\\:"+g),S=r(r(r(m+"\\:")+"{0,5}"+m)+"?\\:\\:"+m),P=r(r(r(m+"\\:")+"{0,6}"+m)+"?\\:\\:"),C=r([y,v,_,$,w,E,b,S,P].join("|")),N=r(r(u+"|"+a)+"+"),O=(r(C+"\\%25"+N),r(C+r("\\%25|\\%(?!"+o+"{2})")+N)),R=r("[vV]"+o+"+\\."+t(u,i,"[\\:]")+"+"),j=r("\\["+r(O+"|"+C+"|"+R)+"\\]"),k=r(r(a+"|"+t(u,i))+"*"),T=r(j+"|"+p+"(?!"+k+")|"+k),I=r("[0-9]*"),A=r(r(f+"@")+"?"+T+r("\\:"+I)+"?"),D=r(a+"|"+t(u,i,"[\\:\\@]")),x=r(D+"*"),M=r(D+"+"),F=r(r(a+"|"+t(u,i,"[\\@]"))+"+"),U=r(r("\\/"+x)+"*"),z=r("\\/"+r(M+U)+"?"),V=r(F+U),L=r(M+U),K="(?!"+D+")",J=(r(U+"|"+z+"|"+V+"|"+L+"|"+K),r(r(D+"|"+t("[\\/\\?]",l))+"*")),H=r(r(D+"|[\\/\\?]")+"*"),G=r(r("\\/\\/"+A+U)+"|"+z+"|"+L+"|"+K),q=r(d+"\\:"+G+r("\\?"+J)+"?"+r("\\#"+H)+"?"),W=r(r("\\/\\/"+A+U)+"|"+z+"|"+V+"|"+K),B=r(W+r("\\?"+J)+"?"+r("\\#"+H)+"?");return r(q+"|"+B),r(d+"\\:"+G+r("\\?"+J)+"?"),r(r("\\/\\/("+r("("+f+")@")+"?("+T+")"+r("\\:("+I+")")+"?)")+"?("+U+"|"+z+"|"+L+"|"+K+")"),r("\\?("+J+")"),r("\\#("+H+")"),r(r("\\/\\/("+r("("+f+")@")+"?("+T+")"+r("\\:("+I+")")+"?)")+"?("+U+"|"+z+"|"+V+"|"+K+")"),r("\\?("+J+")"),r("\\#("+H+")"),r(r("\\/\\/("+r("("+f+")@")+"?("+T+")"+r("\\:("+I+")")+"?)")+"?("+U+"|"+z+"|"+L+"|"+K+")"),r("\\?("+J+")"),r("\\#("+H+")"),r("("+f+")@"),r("\\:("+I+")"),{NOT_SCHEME:new RegExp(t("[^]",s,n,"[\\+\\-\\.]"),"g"),NOT_USERINFO:new RegExp(t("[^\\%\\:]",u,i),"g"),NOT_HOST:new RegExp(t("[^\\%\\[\\]\\:]",u,i),"g"),NOT_PATH:new RegExp(t("[^\\%\\/\\:\\@]",u,i),"g"),NOT_PATH_NOSCHEME:new RegExp(t("[^\\%\\/\\@]",u,i),"g"),NOT_QUERY:new RegExp(t("[^\\%]",u,i,"[\\:\\@\\/\\?]",l),"g"),NOT_FRAGMENT:new RegExp(t("[^\\%]",u,i,"[\\:\\@\\/\\?]"),"g"),ESCAPE:new RegExp(t("[^]",u,i),"g"),UNRESERVED:new RegExp(u,"g"),OTHER_CHARS:new RegExp(t("[^\\%]",u,c),"g"),PCT_ENCODED:new RegExp(a,"g"),IPV4ADDRESS:new RegExp("^("+p+")$"),IPV6ADDRESS:new RegExp("^\\[?("+C+")"+r(r("\\%25|\\%(?!"+o+"{2})")+"("+N+")")+"?\\]?$")}}var a=o(!1),i=o(!0),c=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var r=[],s=!0,n=!1,o=void 0;try{for(var a,i=e[Symbol.iterator]();!(s=(a=i.next()).done)&&(r.push(a.value),!t||r.length!==t);s=!0);}catch(e){n=!0,o=e}finally{try{!s&&i.return&&i.return()}finally{if(n)throw o}}return r}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},l=2147483647,u=36,d=/^xn--/,f=/[^\0-\x7E]/,h=/[\x2E\u3002\uFF0E\uFF61]/g,p={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},m=Math.floor,g=String.fromCharCode;function y(e){throw new RangeError(p[e])}function v(e,t){var r=e.split("@"),s="";return r.length>1&&(s=r[0]+"@",e=r[1]),s+function(e,t){for(var r=[],s=e.length;s--;)r[s]=t(e[s]);return r}((e=e.replace(h,".")).split("."),t).join(".")}function _(e){for(var t=[],r=0,s=e.length;r<s;){var n=e.charCodeAt(r++);if(n>=55296&&n<=56319&&r<s){var o=e.charCodeAt(r++);56320==(64512&o)?t.push(((1023&n)<<10)+(1023&o)+65536):(t.push(n),r--)}else t.push(n)}return t}var $=function(e,t){return e+22+75*(e<26)-((0!=t)<<5)},w=function(e,t,r){var s=0;for(e=r?m(e/700):e>>1,e+=m(e/t);e>455;s+=u)e=m(e/35);return m(s+36*e/(e+38))},E=function(e){var t,r=[],s=e.length,n=0,o=128,a=72,i=e.lastIndexOf("-");i<0&&(i=0);for(var c=0;c<i;++c)e.charCodeAt(c)>=128&&y("not-basic"),r.push(e.charCodeAt(c));for(var d=i>0?i+1:0;d<s;){for(var f=n,h=1,p=u;;p+=u){d>=s&&y("invalid-input");var g=(t=e.charCodeAt(d++))-48<10?t-22:t-65<26?t-65:t-97<26?t-97:u;(g>=u||g>m((l-n)/h))&&y("overflow"),n+=g*h;var v=p<=a?1:p>=a+26?26:p-a;if(g<v)break;var _=u-v;h>m(l/_)&&y("overflow"),h*=_}var $=r.length+1;a=w(n-f,$,0==f),m(n/$)>l-o&&y("overflow"),o+=m(n/$),n%=$,r.splice(n++,0,o)}return String.fromCodePoint.apply(String,r)},b=function(e){var t=[],r=(e=_(e)).length,s=128,n=0,o=72,a=!0,i=!1,c=void 0;try{for(var d,f=e[Symbol.iterator]();!(a=(d=f.next()).done);a=!0){var h=d.value;h<128&&t.push(g(h))}}catch(e){i=!0,c=e}finally{try{!a&&f.return&&f.return()}finally{if(i)throw c}}var p=t.length,v=p;for(p&&t.push("-");v<r;){var E=l,b=!0,S=!1,P=void 0;try{for(var C,N=e[Symbol.iterator]();!(b=(C=N.next()).done);b=!0){var O=C.value;O>=s&&O<E&&(E=O)}}catch(e){S=!0,P=e}finally{try{!b&&N.return&&N.return()}finally{if(S)throw P}}var R=v+1;E-s>m((l-n)/R)&&y("overflow"),n+=(E-s)*R,s=E;var j=!0,k=!1,T=void 0;try{for(var I,A=e[Symbol.iterator]();!(j=(I=A.next()).done);j=!0){var D=I.value;if(D<s&&++n>l&&y("overflow"),D==s){for(var x=n,M=u;;M+=u){var F=M<=o?1:M>=o+26?26:M-o;if(x<F)break;var U=x-F,z=u-F;t.push(g($(F+U%z,0))),x=m(U/z)}t.push(g($(x,0))),o=w(n,R,v==p),n=0,++v}}}catch(e){k=!0,T=e}finally{try{!j&&A.return&&A.return()}finally{if(k)throw T}}++n,++s}return t.join("")},S=function(e){return v(e,(function(e){return f.test(e)?"xn--"+b(e):e}))},P=function(e){return v(e,(function(e){return d.test(e)?E(e.slice(4).toLowerCase()):e}))},C={};function N(e){var t=e.charCodeAt(0);return t<16?"%0"+t.toString(16).toUpperCase():t<128?"%"+t.toString(16).toUpperCase():t<2048?"%"+(t>>6|192).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase():"%"+(t>>12|224).toString(16).toUpperCase()+"%"+(t>>6&63|128).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase()}function O(e){for(var t="",r=0,s=e.length;r<s;){var n=parseInt(e.substr(r+1,2),16);if(n<128)t+=String.fromCharCode(n),r+=3;else if(n>=194&&n<224){if(s-r>=6){var o=parseInt(e.substr(r+4,2),16);t+=String.fromCharCode((31&n)<<6|63&o)}else t+=e.substr(r,6);r+=6}else if(n>=224){if(s-r>=9){var a=parseInt(e.substr(r+4,2),16),i=parseInt(e.substr(r+7,2),16);t+=String.fromCharCode((15&n)<<12|(63&a)<<6|63&i)}else t+=e.substr(r,9);r+=9}else t+=e.substr(r,3),r+=3}return t}function R(e,t){function r(e){var r=O(e);return r.match(t.UNRESERVED)?r:e}return e.scheme&&(e.scheme=String(e.scheme).replace(t.PCT_ENCODED,r).toLowerCase().replace(t.NOT_SCHEME,"")),void 0!==e.userinfo&&(e.userinfo=String(e.userinfo).replace(t.PCT_ENCODED,r).replace(t.NOT_USERINFO,N).replace(t.PCT_ENCODED,n)),void 0!==e.host&&(e.host=String(e.host).replace(t.PCT_ENCODED,r).toLowerCase().replace(t.NOT_HOST,N).replace(t.PCT_ENCODED,n)),void 0!==e.path&&(e.path=String(e.path).replace(t.PCT_ENCODED,r).replace(e.scheme?t.NOT_PATH:t.NOT_PATH_NOSCHEME,N).replace(t.PCT_ENCODED,n)),void 0!==e.query&&(e.query=String(e.query).replace(t.PCT_ENCODED,r).replace(t.NOT_QUERY,N).replace(t.PCT_ENCODED,n)),void 0!==e.fragment&&(e.fragment=String(e.fragment).replace(t.PCT_ENCODED,r).replace(t.NOT_FRAGMENT,N).replace(t.PCT_ENCODED,n)),e}function j(e){return e.replace(/^0*(.*)/,"$1")||"0"}function k(e,t){var r=e.match(t.IPV4ADDRESS)||[],s=c(r,2)[1];return s?s.split(".").map(j).join("."):e}function T(e,t){var r=e.match(t.IPV6ADDRESS)||[],s=c(r,3),n=s[1],o=s[2];if(n){for(var a=n.toLowerCase().split("::").reverse(),i=c(a,2),l=i[0],u=i[1],d=u?u.split(":").map(j):[],f=l.split(":").map(j),h=t.IPV4ADDRESS.test(f[f.length-1]),p=h?7:8,m=f.length-p,g=Array(p),y=0;y<p;++y)g[y]=d[y]||f[m+y]||"";h&&(g[p-1]=k(g[p-1],t));var v=g.reduce((function(e,t,r){if(!t||"0"===t){var s=e[e.length-1];s&&s.index+s.length===r?s.length++:e.push({index:r,length:1})}return e}),[]).sort((function(e,t){return t.length-e.length}))[0],_=void 0;if(v&&v.length>1){var $=g.slice(0,v.index),w=g.slice(v.index+v.length);_=$.join(":")+"::"+w.join(":")}else _=g.join(":");return o&&(_+="%"+o),_}return e}var I=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,A=void 0==="".match(/(){0}/)[1];function D(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={},s=!1!==t.iri?i:a;"suffix"===t.reference&&(e=(t.scheme?t.scheme+":":"")+"//"+e);var n=e.match(I);if(n){A?(r.scheme=n[1],r.userinfo=n[3],r.host=n[4],r.port=parseInt(n[5],10),r.path=n[6]||"",r.query=n[7],r.fragment=n[8],isNaN(r.port)&&(r.port=n[5])):(r.scheme=n[1]||void 0,r.userinfo=-1!==e.indexOf("@")?n[3]:void 0,r.host=-1!==e.indexOf("//")?n[4]:void 0,r.port=parseInt(n[5],10),r.path=n[6]||"",r.query=-1!==e.indexOf("?")?n[7]:void 0,r.fragment=-1!==e.indexOf("#")?n[8]:void 0,isNaN(r.port)&&(r.port=e.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?n[4]:void 0)),r.host&&(r.host=T(k(r.host,s),s)),void 0!==r.scheme||void 0!==r.userinfo||void 0!==r.host||void 0!==r.port||r.path||void 0!==r.query?void 0===r.scheme?r.reference="relative":void 0===r.fragment?r.reference="absolute":r.reference="uri":r.reference="same-document",t.reference&&"suffix"!==t.reference&&t.reference!==r.reference&&(r.error=r.error||"URI is not a "+t.reference+" reference.");var o=C[(t.scheme||r.scheme||"").toLowerCase()];if(t.unicodeSupport||o&&o.unicodeSupport)R(r,s);else{if(r.host&&(t.domainHost||o&&o.domainHost))try{r.host=S(r.host.replace(s.PCT_ENCODED,O).toLowerCase())}catch(e){r.error=r.error||"Host's domain name can not be converted to ASCII via punycode: "+e}R(r,a)}o&&o.parse&&o.parse(r,t)}else r.error=r.error||"URI can not be parsed.";return r}function x(e,t){var r=!1!==t.iri?i:a,s=[];return void 0!==e.userinfo&&(s.push(e.userinfo),s.push("@")),void 0!==e.host&&s.push(T(k(String(e.host),r),r).replace(r.IPV6ADDRESS,(function(e,t,r){return"["+t+(r?"%25"+r:"")+"]"}))),"number"!=typeof e.port&&"string"!=typeof e.port||(s.push(":"),s.push(String(e.port))),s.length?s.join(""):void 0}var M=/^\.\.?\//,F=/^\/\.(\/|$)/,U=/^\/\.\.(\/|$)/,z=/^\/?(?:.|\n)*?(?=\/|$)/;function V(e){for(var t=[];e.length;)if(e.match(M))e=e.replace(M,"");else if(e.match(F))e=e.replace(F,"/");else if(e.match(U))e=e.replace(U,"/"),t.pop();else if("."===e||".."===e)e="";else{var r=e.match(z);if(!r)throw new Error("Unexpected dot segment condition");var s=r[0];e=e.slice(s.length),t.push(s)}return t.join("")}function L(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.iri?i:a,s=[],n=C[(t.scheme||e.scheme||"").toLowerCase()];if(n&&n.serialize&&n.serialize(e,t),e.host)if(r.IPV6ADDRESS.test(e.host));else if(t.domainHost||n&&n.domainHost)try{e.host=t.iri?P(e.host):S(e.host.replace(r.PCT_ENCODED,O).toLowerCase())}catch(r){e.error=e.error||"Host's domain name can not be converted to "+(t.iri?"Unicode":"ASCII")+" via punycode: "+r}R(e,r),"suffix"!==t.reference&&e.scheme&&(s.push(e.scheme),s.push(":"));var o=x(e,t);if(void 0!==o&&("suffix"!==t.reference&&s.push("//"),s.push(o),e.path&&"/"!==e.path.charAt(0)&&s.push("/")),void 0!==e.path){var c=e.path;t.absolutePath||n&&n.absolutePath||(c=V(c)),void 0===o&&(c=c.replace(/^\/\//,"/%2F")),s.push(c)}return void 0!==e.query&&(s.push("?"),s.push(e.query)),void 0!==e.fragment&&(s.push("#"),s.push(e.fragment)),s.join("")}function K(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s={};return arguments[3]||(e=D(L(e,r),r),t=D(L(t,r),r)),!(r=r||{}).tolerant&&t.scheme?(s.scheme=t.scheme,s.userinfo=t.userinfo,s.host=t.host,s.port=t.port,s.path=V(t.path||""),s.query=t.query):(void 0!==t.userinfo||void 0!==t.host||void 0!==t.port?(s.userinfo=t.userinfo,s.host=t.host,s.port=t.port,s.path=V(t.path||""),s.query=t.query):(t.path?("/"===t.path.charAt(0)?s.path=V(t.path):(void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?s.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:s.path=t.path:s.path="/"+t.path,s.path=V(s.path)),s.query=t.query):(s.path=e.path,void 0!==t.query?s.query=t.query:s.query=e.query),s.userinfo=e.userinfo,s.host=e.host,s.port=e.port),s.scheme=e.scheme),s.fragment=t.fragment,s}function J(e,t){return e&&e.toString().replace(t&&t.iri?i.PCT_ENCODED:a.PCT_ENCODED,O)}var H={scheme:"http",domainHost:!0,parse:function(e,t){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e},serialize:function(e,t){var r="https"===String(e.scheme).toLowerCase();return e.port!==(r?443:80)&&""!==e.port||(e.port=void 0),e.path||(e.path="/"),e}},G={scheme:"https",domainHost:H.domainHost,parse:H.parse,serialize:H.serialize};function q(e){return"boolean"==typeof e.secure?e.secure:"wss"===String(e.scheme).toLowerCase()}var W={scheme:"ws",domainHost:!0,parse:function(e,t){var r=e;return r.secure=q(r),r.resourceName=(r.path||"/")+(r.query?"?"+r.query:""),r.path=void 0,r.query=void 0,r},serialize:function(e,t){if(e.port!==(q(e)?443:80)&&""!==e.port||(e.port=void 0),"boolean"==typeof e.secure&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){var r=e.resourceName.split("?"),s=c(r,2),n=s[0],o=s[1];e.path=n&&"/"!==n?n:void 0,e.query=o,e.resourceName=void 0}return e.fragment=void 0,e}},B={scheme:"wss",domainHost:W.domainHost,parse:W.parse,serialize:W.serialize},Q={},Y="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",Z="[0-9A-Fa-f]",X=r(r("%[EFef][0-9A-Fa-f]%"+Z+Z+"%"+Z+Z)+"|"+r("%[89A-Fa-f][0-9A-Fa-f]%"+Z+Z)+"|"+r("%"+Z+Z)),ee=t("[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",'[\\"\\\\]'),te=new RegExp(Y,"g"),re=new RegExp(X,"g"),se=new RegExp(t("[^]","[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]","[\\.]",'[\\"]',ee),"g"),ne=new RegExp(t("[^]",Y,"[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]"),"g"),oe=ne;function ae(e){var t=O(e);return t.match(te)?t:e}var ie={scheme:"mailto",parse:function(e,t){var r=e,s=r.to=r.path?r.path.split(","):[];if(r.path=void 0,r.query){for(var n=!1,o={},a=r.query.split("&"),i=0,c=a.length;i<c;++i){var l=a[i].split("=");switch(l[0]){case"to":for(var u=l[1].split(","),d=0,f=u.length;d<f;++d)s.push(u[d]);break;case"subject":r.subject=J(l[1],t);break;case"body":r.body=J(l[1],t);break;default:n=!0,o[J(l[0],t)]=J(l[1],t)}}n&&(r.headers=o)}r.query=void 0;for(var h=0,p=s.length;h<p;++h){var m=s[h].split("@");if(m[0]=J(m[0]),t.unicodeSupport)m[1]=J(m[1],t).toLowerCase();else try{m[1]=S(J(m[1],t).toLowerCase())}catch(e){r.error=r.error||"Email address's domain name can not be converted to ASCII via punycode: "+e}s[h]=m.join("@")}return r},serialize:function(e,t){var r,s=e,o=null!=(r=e.to)?r instanceof Array?r:"number"!=typeof r.length||r.split||r.setInterval||r.call?[r]:Array.prototype.slice.call(r):[];if(o){for(var a=0,i=o.length;a<i;++a){var c=String(o[a]),l=c.lastIndexOf("@"),u=c.slice(0,l).replace(re,ae).replace(re,n).replace(se,N),d=c.slice(l+1);try{d=t.iri?P(d):S(J(d,t).toLowerCase())}catch(e){s.error=s.error||"Email address's domain name can not be converted to "+(t.iri?"Unicode":"ASCII")+" via punycode: "+e}o[a]=u+"@"+d}s.path=o.join(",")}var f=e.headers=e.headers||{};e.subject&&(f.subject=e.subject),e.body&&(f.body=e.body);var h=[];for(var p in f)f[p]!==Q[p]&&h.push(p.replace(re,ae).replace(re,n).replace(ne,N)+"="+f[p].replace(re,ae).replace(re,n).replace(oe,N));return h.length&&(s.query=h.join("&")),s}},ce=/^([^\:]+)\:(.*)/,le={scheme:"urn",parse:function(e,t){var r=e.path&&e.path.match(ce),s=e;if(r){var n=t.scheme||s.scheme||"urn",o=r[1].toLowerCase(),a=r[2],i=n+":"+(t.nid||o),c=C[i];s.nid=o,s.nss=a,s.path=void 0,c&&(s=c.parse(s,t))}else s.error=s.error||"URN can not be parsed.";return s},serialize:function(e,t){var r=t.scheme||e.scheme||"urn",s=e.nid,n=r+":"+(t.nid||s),o=C[n];o&&(e=o.serialize(e,t));var a=e,i=e.nss;return a.path=(s||t.nid)+":"+i,a}},ue=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/,de={scheme:"urn:uuid",parse:function(e,t){var r=e;return r.uuid=r.nss,r.nss=void 0,t.tolerant||r.uuid&&r.uuid.match(ue)||(r.error=r.error||"UUID is not valid."),r},serialize:function(e,t){var r=e;return r.nss=(e.uuid||"").toLowerCase(),r}};C[H.scheme]=H,C[G.scheme]=G,C[W.scheme]=W,C[B.scheme]=B,C[ie.scheme]=ie,C[le.scheme]=le,C[de.scheme]=de,e.SCHEMES=C,e.pctEncChar=N,e.pctDecChars=O,e.parse=D,e.removeDotSegments=V,e.serialize=L,e.resolveComponents=K,e.resolve=function(e,t,r){var s=function(e,t){var r=e;if(t)for(var s in t)r[s]=t[s];return r}({scheme:"null"},r);return L(K(D(e,s),D(t,s),s,!0),s)},e.normalize=function(e,t){return"string"==typeof e?e=L(D(e,t),t):"object"===s(e)&&(e=D(L(e,t),t)),e},e.equal=function(e,t,r){return"string"==typeof e?e=L(D(e,r),r):"object"===s(e)&&(e=L(e,r)),"string"==typeof t?t=L(D(t,r),r):"object"===s(t)&&(t=L(t,r)),e===t},e.escapeComponent=function(e,t){return e&&e.toString().replace(t&&t.iri?i.ESCAPE:a.ESCAPE,N)},e.unescapeComponent=J,Object.defineProperty(e,"__esModule",{value:!0})}(t)},9863:e=>{"use strict";e.exports=JSON.parse('{"$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":false}')}},t={};function r(s){var n=t[s];if(void 0!==n)return n.exports;var o=t[s]={exports:{}};return e[s].call(o.exports,o,o.exports,r),o.exports}r.m=e,r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var s in t)r.o(t,s)&&!r.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},r.u=e=>e+".index.js",r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;r.g.importScripts&&(e=r.g.location+"");var t=r.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var s=t.getElementsByTagName("script");s.length&&(e=s[s.length-1].src)}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),r.p=e})(),r.b=document.baseURI||self.location.href;var s={};return(()=>{"use strict";r.r(s),r.d(s,{AuthorizeOptionsResponseMode:()=>a,AuthorizeOptionsResponseType:()=>o,IOauth2ListenerCommand:()=>c,OAuthGrantTypes:()=>i,STSOAuth2Manager:()=>Q,default:()=>Y});var e=r(1227),t=r.n(e),n=r(7557);var o,a,i,c;!function(e){e.CODE="code",e.ID_TOKEN="id_token",e.TOKEN="token"}(o||(o={})),function(e){e.QUERY="query",e.FRAGMENT="fragment",e.FORM_POST="form_post"}(a||(a={})),function(e){e.CLIENT_CREDENTIALS="client_credentials",e.AUTHORIZATION_CODE="authorization_code",e.REFRESH_TOKEN="refresh_token"}(i||(i={})),function(e){e.RESTORE_SESSION="RestoreSession",e.AUTHORIZE="Authorize",e.HANDLE_REDIRECT="HandleRedirect",e.LOGOUT="Logout",e.AUTHENTICATE_EVENT="AuthenticateEvent",e.ERROR="Error"}(c||(c={}));var l,u,d=r(6378),f=function(e,t,r,s){if("a"===r&&!s)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?s:"a"===r?s.call(e):s?s.value:t.get(e)},h=function(e,t,r,s,n){if("m"===s)throw new TypeError("Private method is not writable");if("a"===s&&!n)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===s?n.call(e,r):n?n.value=r:t.set(e,r),r};const p=t()(`proc:${process.pid}:storage.ts`);var m;!function(e){e.LOCAL_STORAGE="LocalStorage",e.SESSION_STORAGE="SessionStorage",e.COOKIE_STORAGE="CookieStorage",e.MEMORY_STORAGE="MemoryStorage"}(m||(m={}));class g{constructor(){this.get=e=>{const t=d.get(e);return t?JSON.parse(t):null},this.set=(e,t,r={})=>{let s={};"https:"===window.location.protocol&&(s={secure:!0,sameSite:"none"}),r&&r.daysUntilExpire?s.expires=r.daysUntilExpire:s.expires=1,p(`CookieStorage.set: key: ${e}, value: [${t}]`),d.set(e,JSON.stringify(t),s)},this.remove=e=>{d.remove(e)}}}class y{constructor(){this.get=e=>{const t=sessionStorage.getItem(e);return null==t?null:JSON.parse(t)},this.set=(e,t)=>{p(`SessionStorage.set: key: ${e}, value: [${t}]`),sessionStorage.setItem(e,JSON.stringify(t))},this.remove=e=>{sessionStorage.removeItem(e)}}}class v{constructor(){this.get=e=>{const t=localStorage.getItem(e);return null==t?null:JSON.parse(t)},this.set=(e,t)=>{p(`LocalStorage.set: key: ${e}, value: [${t}]`),localStorage.setItem(e,JSON.stringify(t))},this.remove=e=>{localStorage.removeItem(e)}}}class _{constructor(){l.set(this,{}),this.get=e=>{const t=f(this,l,"f")[e];return null==t?null:t},this.set=(e,t)=>{p(`MemoryStorage.set: key: ${e}, value: [${t}]`),f(this,l,"f")[e]=t},this.remove=e=>{delete f(this,l,"f")[e]}}}l=new WeakMap;class ${constructor(e){switch(u.set(this,null),e.clientStorageType){case m.SESSION_STORAGE:h(this,u,new y,"f");break;case m.LOCAL_STORAGE:h(this,u,new v,"f");break;case m.COOKIE_STORAGE:h(this,u,new g,"f");break;case m.MEMORY_STORAGE:h(this,u,new _,"f");break;default:throw new Error(`Unknown [${e.clientStorageType}] storage type.`)}}GetStorage(){return f(this,u,"f")}}function w(e){this.message=e}u=new WeakMap,w.prototype=new Error,w.prototype.name="InvalidCharacterError";var E="undefined"!=typeof window&&window.atob&&window.atob.bind(window)||function(e){var t=String(e).replace(/=+$/,"");if(t.length%4==1)throw new w("'atob' failed: The string to be decoded is not correctly encoded.");for(var r,s,n=0,o=0,a="";s=t.charAt(o++);~s&&(r=n%4?64*r+s:s,n++%4)?a+=String.fromCharCode(255&r>>(-2*n&6)):0)s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(s);return a};function b(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(e){return decodeURIComponent(E(e).replace(/(.)/g,(function(e,t){var r=t.charCodeAt(0).toString(16).toUpperCase();return r.length<2&&(r="0"+r),"%"+r})))}(t)}catch(e){return E(t)}}function S(e){this.message=e}S.prototype=new Error,S.prototype.name="InvalidTokenError";var P,C,N,O,R,j,k,T,I,A,D,x,M,F,U,z,V,L,K,J,H,G,q=function(e,t,r,s,n){if("m"===s)throw new TypeError("Private method is not writable");if("a"===s&&!n)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===s?n.call(e,r):n?n.value=r:t.set(e,r),r},W=function(e,t,r,s){if("a"===r&&!s)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?s:"a"===r?s.call(e):s?s.value:t.get(e)};const B=t()(`proc:${process.pid}:stsoauth2manager.ts`);class Q{constructor(e,t){P.set(this,null),C.set(this,null),N.set(this,null),O.set(this,new class{constructor(){this.DigestMessage=async function(e){const t=(new TextEncoder).encode(e),r=await crypto.subtle.digest("SHA-256",t),s=Array.from(new Uint8Array(r));return btoa(String.fromCharCode(...s))},this.CreateRandomString=(e=43)=>{const t=Array.from(crypto.getRandomValues(new Uint8Array(e)));return btoa(String.fromCharCode(...t))},this.CreateRandomStringEx=()=>{const e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_~.";let t="";return Array.from(crypto.getRandomValues(new Uint8Array(43))).forEach((r=>t+=e[r%e.length])),t}}}),R.set(this,new class{constructor(){this.DecodeQueryParams=e=>{const t={};return Object.keys(e).filter((t=>void 0!==e[t])).map((r=>{t[decodeURIComponent(r)]=decodeURIComponent(e[r])})),t},this.CreateQueryParams=e=>Object.keys(e).filter((t=>void 0!==e[t])).map((t=>Array.isArray(e[t])?encodeURIComponent(t)+"="+encodeURIComponent(e[t].join(" ")):encodeURIComponent(t)+"="+encodeURIComponent(e[t]))).join("&"),this._GetQueryParams=e=>{let t={};const r=e.split("?");if(2==r.length){const e=r[1].split("&"),s={};let n="";e.forEach((function(e){n=e.split("="),2==n.length&&(s[n[0]]=n[1])})),t=this.DecodeQueryParams(s)}return t},this.GetQueryParams=()=>this._GetQueryParams(window.location.href)}}),j.set(this,"authorize_options.stsmda.com.au"),k.set(this,"session.stsmda.com.au"),T.set(this,null),I.set(this,null),A.set(this,{}),D.set(this,void 0),x.set(this,0),M.set(this,{}),F.set(this,1e3),U.set(this,null),z.set(this,null),V.set(this,(e=>{const t=e.data;if(-1===t.messageId)switch(t.command){case c.AUTHENTICATE_EVENT:W(this,J,"f").call(this,t.payload);break;case c.ERROR:W(this,K,"f").call(this,t.payload);break;default:throw new Error(`ProcessMessageResponse command [${t.command}] not valid.`)}else{const e=W(this,M,"f")[t.messageId];if(!e)throw new Error(`Message: [${t.messageId}] does not exists in callBacks.`);e(t)}})),L.set(this,(e=>{var t,r;return e.messageId=(q(this,x,(r=W(this,x,"f"),t=r++,r),"f"),t),new Promise(((t,r)=>{const s=setTimeout((()=>{delete W(this,M,"f")[e.messageId],r(`Message: [${e.messageId}] timeout error after: [${W(this,F,"f")}] ms.`)}),W(this,F,"f"));W(this,M,"f")[e.messageId]=r=>{clearTimeout(s),delete W(this,M,"f")[e.messageId],t(r)},W(this,D,"f").postMessage(e)}))})),K.set(this,(e=>{W(this,N,"f").commit("AuthorizeError",{message:e}),setTimeout((()=>{W(this,C,"f").replace("/error")}),0)})),J.set(this,(e=>{W(this,I,"f").authenticateEvent&&W(this,I,"f").authenticateEvent(e),W(this,N,"f").commit("stsOAuth2SDK/SessionData",e)})),H.set(this,((e,t)=>{t.beforeEach((async(r,s)=>{const o=e.config.globalProperties.$store,a=e.config.globalProperties.$sts;if(B(`beforeEach: from: [${s.path}], to: [${r.path}]`),!1===o.getters["stsOAuth2SDK/LoggedIn"]){if(console.log("Not logged in"),0===r.path.localeCompare("/authorize"))return console.log("to = /authorize"),!0;if(0===r.path.localeCompare("/consent")&&void 0!==o.getters.Session.sessionId)return!0;if(0===r.path.localeCompare("/logout"))return!0;if(0===r.path.localeCompare("/error"))return!0;if(0===r.path.localeCompare("/logout"))return!0;const e=r.query;if(e[n.OAuth2ParameterType.CODE]||e[n.OAuth2ParameterType.ERROR])return console.log(`#SetupRout:str = [${e}]`),await a.om.HandleRedirect(e)?(setTimeout((()=>{window.history.replaceState({},document.title,window.location.origin+"/")}),0),!0):(W(this,C,"f").replace("/error"),!1);const t=await a.om.RestoreSession();return console.log(`#SetupRoute:sessionRestored [${t}]`),!0!==t?(console.log("Session not restored - Need to Authorize"),a.om.Authorize(),!1):"/"}return 0===r.path.localeCompare("/consent")?"/":0===r.path.localeCompare("/authorize")?(t.replace({path:"/"}),!1):0!==r.path.localeCompare("/logout")||(t.replace({path:"/"}),!1)}))})),G.set(this,(()=>{W(this,N,"f").registerModule("stsOAuth2SDK",{namespaced:!0,state:()=>({sessionData:{}}),getters:{SessionData:e=>e.sessionData,LoggedIn:e=>void 0!==e.sessionData&&null!==e.sessionData,UserDetails(e){if(e.sessionData){return function(e,t){if("string"!=typeof e)throw new S("Invalid token specified");var r=!0===(t=t||{}).header?0:1;try{return JSON.parse(b(e.split(".")[r]))}catch(e){throw new S("Invalid token specified: "+e.message)}}(e.sessionData)}return null}},mutations:{SessionData(e,t){e.sessionData=t,console.log(`commit [sessionData]: ${JSON.stringify(t)}`)}}},{preserveState:!0})})),this.RestoreSession=async()=>{try{return(await W(this,L,"f").call(this,{command:c.RESTORE_SESSION})).payload}catch(e){return console.log(`RestoreSession Error: ${e}`),!1}},this.Authorize=async()=>{try{const e=await W(this,L,"f").call(this,{command:c.AUTHORIZE});W(this,z,"f").set(W(this,j,"f"),e.payload.authorizeOptions);const t=e.payload.url;window.location.replace(t)}catch(e){console.log(`Authorize Error: ${e}`)}},this.HandleRedirect=async e=>{try{let t=null;if(e[n.OAuth2ParameterType.CODE]){const r=W(this,z,"f").get(W(this,j,"f"));W(this,z,"f").remove(W(this,j,"f")),t=await W(this,L,"f").call(this,{command:c.HANDLE_REDIRECT,payload:{queryVars:e,authorizeOptions:r}})}else t=await W(this,L,"f").call(this,{command:c.HANDLE_REDIRECT,payload:e});return t.payload}catch(e){return console.log(`HandleRedirect Error: ${e}`),!1}},this.Logout=async()=>{try{return(await W(this,L,"f").call(this,{command:c.LOGOUT})).payload}catch(e){return console.log(`Logout Error: ${e}`),!1}},q(this,I,t,"f"),q(this,P,e.config.globalProperties.$sts.storage,"f"),q(this,N,e.config.globalProperties.$store,"f"),q(this,T,e.config.globalProperties.$sts.aic.PrimaryPublishInstrumentController,"f"),q(this,C,e.config.globalProperties.$router,"f"),q(this,z,new $({clientStorageType:m.SESSION_STORAGE}).GetStorage(),"f"),q(this,U,new Worker(new URL(r.p+r.u(384),r.b),{type:void 0}),"f"),W(this,U,"f").onmessage=e=>{console.log(`this.#worker.onmessage = [${e}]`)},W(this,U,"f").onerror=function(e){console.log(`this.#worker.onerror = [${e}]`)};const{port1:s,port2:o}=new MessageChannel;q(this,D,s,"f"),W(this,U,"f").postMessage(o,[o]),W(this,D,"f").onmessage=e=>{W(this,V,"f").call(this,e)},W(this,G,"f").call(this),W(this,H,"f").call(this,e,t.router)}}P=new WeakMap,C=new WeakMap,N=new WeakMap,O=new WeakMap,R=new WeakMap,j=new WeakMap,k=new WeakMap,T=new WeakMap,I=new WeakMap,A=new WeakMap,D=new WeakMap,x=new WeakMap,M=new WeakMap,F=new WeakMap,U=new WeakMap,z=new WeakMap,V=new WeakMap,L=new WeakMap,K=new WeakMap,J=new WeakMap,H=new WeakMap,G=new WeakMap;const Y={install:(e,t)=>{const r=new Q(e,t);e.config.globalProperties.$sts.om=r}}})(),s})()));
|
package/package.json
CHANGED