@hyperjump/json-schema-core
Advanced tools
Comparing version 0.25.1 to 0.26.0
define(["exports"],(function(e){"use strict";var r=function(e,r){return function t(){null==r&&(r=e.length);var n=[].slice.call(arguments);return n.length>=r?e.apply(this,n):function(){return t.apply(this,n.concat([].slice.call(arguments)))}}};var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function n(e,r){return e(r={exports:{}},r.exports),r.exports}var o=n((function(e,r){var n,o;n="object"==typeof window&&window||t,o={},n.PubSub?(o=n.PubSub,console.warn("PubSub already loaded, using existing version")):(n.PubSub=o,function(e){var r={},t=-1,n="*";function o(e){var r;for(r in e)if(Object.prototype.hasOwnProperty.call(e,r))return!0;return!1}function a(e){return function(){throw e}}function i(e,r,t){try{e(r,t)}catch(e){setTimeout(a(e),0)}}function s(e,r,t){e(r,t)}function c(e,t,n,o){var a,c=r[t],u=o?s:i;if(Object.prototype.hasOwnProperty.call(r,t))for(a in c)Object.prototype.hasOwnProperty.call(c,a)&&u(c[a],e,n)}function u(e,r,t){return function(){var o=String(e),a=o.lastIndexOf(".");for(c(e,e,r,t);-1!==a;)a=(o=o.substr(0,a)).lastIndexOf("."),c(e,o,r,t);c(e,n,r,t)}}function l(e){var t=String(e);return Boolean(Object.prototype.hasOwnProperty.call(r,t)&&o(r[t]))}function p(e){for(var r=String(e),t=l(r)||l(n),o=r.lastIndexOf(".");!t&&-1!==o;)o=(r=r.substr(0,o)).lastIndexOf("."),t=l(r);return t}function f(e,r,t,n){var o=u(e="symbol"==typeof e?e.toString():e,r,n);return!!p(e)&&(!0===t?o():setTimeout(o,0),!0)}e.publish=function(r,t){return f(r,t,!1,e.immediateExceptions)},e.publishSync=function(r,t){return f(r,t,!0,e.immediateExceptions)},e.subscribe=function(e,n){if("function"!=typeof n)return!1;e="symbol"==typeof e?e.toString():e,Object.prototype.hasOwnProperty.call(r,e)||(r[e]={});var o="uid_"+String(++t);return r[e][o]=n,o},e.subscribeAll=function(r){return e.subscribe(n,r)},e.subscribeOnce=function(r,t){var n=e.subscribe(r,(function(){e.unsubscribe(n),t.apply(this,arguments)}));return e},e.clearAllSubscriptions=function(){r={}},e.clearSubscriptions=function(e){var t;for(t in r)Object.prototype.hasOwnProperty.call(r,t)&&0===t.indexOf(e)&&delete r[t]},e.countSubscriptions=function(e){var t,n,o=0;for(t in r)if(Object.prototype.hasOwnProperty.call(r,t)&&0===t.indexOf(e)){for(n in r[t])o++;break}return o},e.getSubscriptions=function(e){var t,n=[];for(t in r)Object.prototype.hasOwnProperty.call(r,t)&&0===t.indexOf(e)&&n.push(t);return n},e.unsubscribe=function(t){var n,o,a,i=function(e){var t;for(t in r)if(Object.prototype.hasOwnProperty.call(r,t)&&0===t.indexOf(e))return!0;return!1},s="string"==typeof t&&(Object.prototype.hasOwnProperty.call(r,t)||i(t)),c=!s&&"string"==typeof t,u="function"==typeof t,l=!1;if(!s){for(n in r)if(Object.prototype.hasOwnProperty.call(r,n)){if(o=r[n],c&&o[t]){delete o[t],l=t;break}if(u)for(a in o)Object.prototype.hasOwnProperty.call(o,a)&&o[a]===t&&(delete o[a],l=!0)}return l}e.clearSubscriptions(t)}}(o)),void 0!==e&&e.exports&&(r=e.exports=o),r.PubSub=o,e.exports=r=o}));o.PubSub;var a,i=n((function(e,r){ | ||
/** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */ | ||
!function(e){function r(){for(var e=arguments.length,r=Array(e),t=0;t<e;t++)r[t]=arguments[t];if(r.length>1){r[0]=r[0].slice(0,-1);for(var n=r.length-1,o=1;o<n;++o)r[o]=r[o].slice(1,-1);return r[n]=r[n].slice(1),r.join("")}return r[0]}function t(e){return"(?:"+e+")"}function n(e){return void 0===e?"undefined":null===e?"null":Object.prototype.toString.call(e).split(" ").pop().split("]").shift().toLowerCase()}function o(e){return e.toUpperCase()}function a(e){return null!=e?e instanceof Array?e:"number"!=typeof e.length||e.split||e.setInterval||e.call?[e]:Array.prototype.slice.call(e):[]}function i(e,r){var t=e;if(r)for(var n in r)t[n]=r[n];return t}function s(e){var n="[A-Za-z]",o="[0-9]",a=r(o,"[A-Fa-f]"),i=t(t("%[EFef]"+a+"%"+a+a+"%"+a+a)+"|"+t("%[89A-Fa-f]"+a+"%"+a+a)+"|"+t("%"+a+a)),s="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",c=r("[\\:\\/\\?\\#\\[\\]\\@]",s),u=e?"[\\uE000-\\uF8FF]":"[]",l=r(n,o,"[\\-\\.\\_\\~]",e?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]");t(n+r(n,o,"[\\+\\-\\.]")+"*"),t(t(i+"|"+r(l,s,"[\\:]"))+"*");var p=t(t("25[0-5]")+"|"+t("2[0-4]"+o)+"|"+t("1"+o+o)+"|"+t("0?[1-9]"+o)+"|0?0?"+o),f=t(p+"\\."+p+"\\."+p+"\\."+p),d=t(a+"{1,4}"),h=t(t(d+"\\:"+d)+"|"+f),v=t(t(d+"\\:")+"{6}"+h),y=t("\\:\\:"+t(d+"\\:")+"{5}"+h),m=t(t(d)+"?\\:\\:"+t(d+"\\:")+"{4}"+h),g=t(t(t(d+"\\:")+"{0,1}"+d)+"?\\:\\:"+t(d+"\\:")+"{3}"+h),b=t(t(t(d+"\\:")+"{0,2}"+d)+"?\\:\\:"+t(d+"\\:")+"{2}"+h),w=t(t(t(d+"\\:")+"{0,3}"+d)+"?\\:\\:"+d+"\\:"+h),E=t(t(t(d+"\\:")+"{0,4}"+d)+"?\\:\\:"+h),S=t(t(t(d+"\\:")+"{0,5}"+d)+"?\\:\\:"+d),C=t(t(t(d+"\\:")+"{0,6}"+d)+"?\\:\\:"),O=t([v,y,m,g,b,w,E,S,C].join("|")),A=t(t(l+"|"+i)+"+");t("[vV]"+a+"+\\."+r(l,s,"[\\:]")+"+"),t(t(i+"|"+r(l,s))+"*");var I=t(i+"|"+r(l,s,"[\\:\\@]"));return t(t(i+"|"+r(l,s,"[\\@]"))+"+"),t(t(I+"|"+r("[\\/\\?]",u))+"*"),{NOT_SCHEME:new RegExp(r("[^]",n,o,"[\\+\\-\\.]"),"g"),NOT_USERINFO:new RegExp(r("[^\\%\\:]",l,s),"g"),NOT_HOST:new RegExp(r("[^\\%\\[\\]\\:]",l,s),"g"),NOT_PATH:new RegExp(r("[^\\%\\/\\:\\@]",l,s),"g"),NOT_PATH_NOSCHEME:new RegExp(r("[^\\%\\/\\@]",l,s),"g"),NOT_QUERY:new RegExp(r("[^\\%]",l,s,"[\\:\\@\\/\\?]",u),"g"),NOT_FRAGMENT:new RegExp(r("[^\\%]",l,s,"[\\:\\@\\/\\?]"),"g"),ESCAPE:new RegExp(r("[^]",l,s),"g"),UNRESERVED:new RegExp(l,"g"),OTHER_CHARS:new RegExp(r("[^\\%]",l,c),"g"),PCT_ENCODED:new RegExp(i,"g"),IPV4ADDRESS:new RegExp("^("+f+")$"),IPV6ADDRESS:new RegExp("^\\[?("+O+")"+t(t("\\%25|\\%(?!"+a+"{2})")+"("+A+")")+"?\\]?$")}}var c=s(!1),u=s(!0),l=function(){function e(e,r){var t=[],n=!0,o=!1,a=void 0;try{for(var i,s=e[Symbol.iterator]();!(n=(i=s.next()).done)&&(t.push(i.value),!r||t.length!==r);n=!0);}catch(e){o=!0,a=e}finally{try{!n&&s.return&&s.return()}finally{if(o)throw a}}return t}return function(r,t){if(Array.isArray(r))return r;if(Symbol.iterator in Object(r))return e(r,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),p=function(e){if(Array.isArray(e)){for(var r=0,t=Array(e.length);r<e.length;r++)t[r]=e[r];return t}return Array.from(e)},f=2147483647,d=36,h=1,v=26,y=38,m=700,g=72,b=128,w="-",E=/^xn--/,S=/[^\0-\x7E]/,C=/[\x2E\u3002\uFF0E\uFF61]/g,O={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},A=d-h,I=Math.floor,j=String.fromCharCode;function T(e){throw new RangeError(O[e])}function x(e,r){for(var t=[],n=e.length;n--;)t[n]=r(e[n]);return t}function $(e,r){var t=e.split("@"),n="";return t.length>1&&(n=t[0]+"@",e=t[1]),n+x((e=e.replace(C,".")).split("."),r).join(".")}function D(e){for(var r=[],t=0,n=e.length;t<n;){var o=e.charCodeAt(t++);if(o>=55296&&o<=56319&&t<n){var a=e.charCodeAt(t++);56320==(64512&a)?r.push(((1023&o)<<10)+(1023&a)+65536):(r.push(o),t--)}else r.push(o)}return r}var P=function(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:d},R=function(e,r){return e+22+75*(e<26)-((0!=r)<<5)},N=function(e,r,t){var n=0;for(e=t?I(e/m):e>>1,e+=I(e/r);e>A*v>>1;n+=d)e=I(e/A);return I(n+(A+1)*e/(e+y))},_=function(e){var r=[],t=e.length,n=0,o=b,a=g,i=e.lastIndexOf(w);i<0&&(i=0);for(var s=0;s<i;++s)e.charCodeAt(s)>=128&&T("not-basic"),r.push(e.charCodeAt(s));for(var c=i>0?i+1:0;c<t;){for(var u=n,l=1,p=d;;p+=d){c>=t&&T("invalid-input");var y=P(e.charCodeAt(c++));(y>=d||y>I((f-n)/l))&&T("overflow"),n+=y*l;var m=p<=a?h:p>=a+v?v:p-a;if(y<m)break;var E=d-m;l>I(f/E)&&T("overflow"),l*=E}var S=r.length+1;a=N(n-u,S,0==u),I(n/S)>f-o&&T("overflow"),o+=I(n/S),n%=S,r.splice(n++,0,o)}return String.fromCodePoint.apply(String,r)},F=function(e){var r=[],t=(e=D(e)).length,n=b,o=0,a=g,i=!0,s=!1,c=void 0;try{for(var u,l=e[Symbol.iterator]();!(i=(u=l.next()).done);i=!0){var p=u.value;p<128&&r.push(j(p))}}catch(e){s=!0,c=e}finally{try{!i&&l.return&&l.return()}finally{if(s)throw c}}var y=r.length,m=y;for(y&&r.push(w);m<t;){var E=f,S=!0,C=!1,O=void 0;try{for(var A,x=e[Symbol.iterator]();!(S=(A=x.next()).done);S=!0){var $=A.value;$>=n&&$<E&&(E=$)}}catch(e){C=!0,O=e}finally{try{!S&&x.return&&x.return()}finally{if(C)throw O}}var P=m+1;E-n>I((f-o)/P)&&T("overflow"),o+=(E-n)*P,n=E;var _=!0,F=!1,k=void 0;try{for(var U,q=e[Symbol.iterator]();!(_=(U=q.next()).done);_=!0){var L=U.value;if(L<n&&++o>f&&T("overflow"),L==n){for(var z=o,H=d;;H+=d){var V=H<=a?h:H>=a+v?v:H-a;if(z<V)break;var K=z-V,M=d-V;r.push(j(R(V+K%M,0))),z=I(K/M)}r.push(j(R(z,0))),a=N(o,P,m==y),o=0,++m}}}catch(e){F=!0,k=e}finally{try{!_&&q.return&&q.return()}finally{if(F)throw k}}++o,++n}return r.join("")},k=function(e){return $(e,(function(e){return E.test(e)?_(e.slice(4).toLowerCase()):e}))},U=function(e){return $(e,(function(e){return S.test(e)?"xn--"+F(e):e}))},q={version:"2.1.0",ucs2:{decode:D,encode:function(e){return String.fromCodePoint.apply(String,p(e))}},decode:_,encode:F,toASCII:U,toUnicode:k},L={};function z(e){var r=e.charCodeAt(0);return r<16?"%0"+r.toString(16).toUpperCase():r<128?"%"+r.toString(16).toUpperCase():r<2048?"%"+(r>>6|192).toString(16).toUpperCase()+"%"+(63&r|128).toString(16).toUpperCase():"%"+(r>>12|224).toString(16).toUpperCase()+"%"+(r>>6&63|128).toString(16).toUpperCase()+"%"+(63&r|128).toString(16).toUpperCase()}function H(e){for(var r="",t=0,n=e.length;t<n;){var o=parseInt(e.substr(t+1,2),16);if(o<128)r+=String.fromCharCode(o),t+=3;else if(o>=194&&o<224){if(n-t>=6){var a=parseInt(e.substr(t+4,2),16);r+=String.fromCharCode((31&o)<<6|63&a)}else r+=e.substr(t,6);t+=6}else if(o>=224){if(n-t>=9){var i=parseInt(e.substr(t+4,2),16),s=parseInt(e.substr(t+7,2),16);r+=String.fromCharCode((15&o)<<12|(63&i)<<6|63&s)}else r+=e.substr(t,9);t+=9}else r+=e.substr(t,3),t+=3}return r}function V(e,r){function t(e){var t=H(e);return t.match(r.UNRESERVED)?t:e}return e.scheme&&(e.scheme=String(e.scheme).replace(r.PCT_ENCODED,t).toLowerCase().replace(r.NOT_SCHEME,"")),void 0!==e.userinfo&&(e.userinfo=String(e.userinfo).replace(r.PCT_ENCODED,t).replace(r.NOT_USERINFO,z).replace(r.PCT_ENCODED,o)),void 0!==e.host&&(e.host=String(e.host).replace(r.PCT_ENCODED,t).toLowerCase().replace(r.NOT_HOST,z).replace(r.PCT_ENCODED,o)),void 0!==e.path&&(e.path=String(e.path).replace(r.PCT_ENCODED,t).replace(e.scheme?r.NOT_PATH:r.NOT_PATH_NOSCHEME,z).replace(r.PCT_ENCODED,o)),void 0!==e.query&&(e.query=String(e.query).replace(r.PCT_ENCODED,t).replace(r.NOT_QUERY,z).replace(r.PCT_ENCODED,o)),void 0!==e.fragment&&(e.fragment=String(e.fragment).replace(r.PCT_ENCODED,t).replace(r.NOT_FRAGMENT,z).replace(r.PCT_ENCODED,o)),e}function K(e){return e.replace(/^0*(.*)/,"$1")||"0"}function M(e,r){var t=e.match(r.IPV4ADDRESS)||[],n=l(t,2)[1];return n?n.split(".").map(K).join("."):e}function Z(e,r){var t=e.match(r.IPV6ADDRESS)||[],n=l(t,3),o=n[1],a=n[2];if(o){for(var i=o.toLowerCase().split("::").reverse(),s=l(i,2),c=s[0],u=s[1],p=u?u.split(":").map(K):[],f=c.split(":").map(K),d=r.IPV4ADDRESS.test(f[f.length-1]),h=d?7:8,v=f.length-h,y=Array(h),m=0;m<h;++m)y[m]=p[m]||f[v+m]||"";d&&(y[h-1]=M(y[h-1],r));var g=y.reduce((function(e,r,t){if(!r||"0"===r){var n=e[e.length-1];n&&n.index+n.length===t?n.length++:e.push({index:t,length:1})}return e}),[]).sort((function(e,r){return r.length-e.length}))[0],b=void 0;if(g&&g.length>1){var w=y.slice(0,g.index),E=y.slice(g.index+g.length);b=w.join(":")+"::"+E.join(":")}else b=y.join(":");return a&&(b+="%"+a),b}return e}var J=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,B=void 0==="".match(/(){0}/)[1];function G(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t={},n=!1!==r.iri?u:c;"suffix"===r.reference&&(e=(r.scheme?r.scheme+":":"")+"//"+e);var o=e.match(J);if(o){B?(t.scheme=o[1],t.userinfo=o[3],t.host=o[4],t.port=parseInt(o[5],10),t.path=o[6]||"",t.query=o[7],t.fragment=o[8],isNaN(t.port)&&(t.port=o[5])):(t.scheme=o[1]||void 0,t.userinfo=-1!==e.indexOf("@")?o[3]:void 0,t.host=-1!==e.indexOf("//")?o[4]:void 0,t.port=parseInt(o[5],10),t.path=o[6]||"",t.query=-1!==e.indexOf("?")?o[7]:void 0,t.fragment=-1!==e.indexOf("#")?o[8]:void 0,isNaN(t.port)&&(t.port=e.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?o[4]:void 0)),t.host&&(t.host=Z(M(t.host,n),n)),void 0!==t.scheme||void 0!==t.userinfo||void 0!==t.host||void 0!==t.port||t.path||void 0!==t.query?void 0===t.scheme?t.reference="relative":void 0===t.fragment?t.reference="absolute":t.reference="uri":t.reference="same-document",r.reference&&"suffix"!==r.reference&&r.reference!==t.reference&&(t.error=t.error||"URI is not a "+r.reference+" reference.");var a=L[(r.scheme||t.scheme||"").toLowerCase()];if(r.unicodeSupport||a&&a.unicodeSupport)V(t,n);else{if(t.host&&(r.domainHost||a&&a.domainHost))try{t.host=q.toASCII(t.host.replace(n.PCT_ENCODED,H).toLowerCase())}catch(e){t.error=t.error||"Host's domain name can not be converted to ASCII via punycode: "+e}V(t,c)}a&&a.parse&&a.parse(t,r)}else t.error=t.error||"URI can not be parsed.";return t}function W(e,r){var t=!1!==r.iri?u:c,n=[];return void 0!==e.userinfo&&(n.push(e.userinfo),n.push("@")),void 0!==e.host&&n.push(Z(M(String(e.host),t),t).replace(t.IPV6ADDRESS,(function(e,r,t){return"["+r+(t?"%25"+t:"")+"]"}))),"number"!=typeof e.port&&"string"!=typeof e.port||(n.push(":"),n.push(String(e.port))),n.length?n.join(""):void 0}var Q=/^\.\.?\//,Y=/^\/\.(\/|$)/,X=/^\/\.\.(\/|$)/,ee=/^\/?(?:.|\n)*?(?=\/|$)/;function re(e){for(var r=[];e.length;)if(e.match(Q))e=e.replace(Q,"");else if(e.match(Y))e=e.replace(Y,"/");else if(e.match(X))e=e.replace(X,"/"),r.pop();else if("."===e||".."===e)e="";else{var t=e.match(ee);if(!t)throw new Error("Unexpected dot segment condition");var n=t[0];e=e.slice(n.length),r.push(n)}return r.join("")}function te(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=r.iri?u:c,n=[],o=L[(r.scheme||e.scheme||"").toLowerCase()];if(o&&o.serialize&&o.serialize(e,r),e.host)if(t.IPV6ADDRESS.test(e.host));else if(r.domainHost||o&&o.domainHost)try{e.host=r.iri?q.toUnicode(e.host):q.toASCII(e.host.replace(t.PCT_ENCODED,H).toLowerCase())}catch(t){e.error=e.error||"Host's domain name can not be converted to "+(r.iri?"Unicode":"ASCII")+" via punycode: "+t}V(e,t),"suffix"!==r.reference&&e.scheme&&(n.push(e.scheme),n.push(":"));var a=W(e,r);if(void 0!==a&&("suffix"!==r.reference&&n.push("//"),n.push(a),e.path&&"/"!==e.path.charAt(0)&&n.push("/")),void 0!==e.path){var i=e.path;r.absolutePath||o&&o.absolutePath||(i=re(i)),void 0===a&&(i=i.replace(/^\/\//,"/%2F")),n.push(i)}return void 0!==e.query&&(n.push("?"),n.push(e.query)),void 0!==e.fragment&&(n.push("#"),n.push(e.fragment)),n.join("")}function ne(e,r){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n={};return arguments[3]||(e=G(te(e,t),t),r=G(te(r,t),t)),!(t=t||{}).tolerant&&r.scheme?(n.scheme=r.scheme,n.userinfo=r.userinfo,n.host=r.host,n.port=r.port,n.path=re(r.path||""),n.query=r.query):(void 0!==r.userinfo||void 0!==r.host||void 0!==r.port?(n.userinfo=r.userinfo,n.host=r.host,n.port=r.port,n.path=re(r.path||""),n.query=r.query):(r.path?("/"===r.path.charAt(0)?n.path=re(r.path):(void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?n.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+r.path:n.path=r.path:n.path="/"+r.path,n.path=re(n.path)),n.query=r.query):(n.path=e.path,void 0!==r.query?n.query=r.query:n.query=e.query),n.userinfo=e.userinfo,n.host=e.host,n.port=e.port),n.scheme=e.scheme),n.fragment=r.fragment,n}function oe(e,r,t){var n=i({scheme:"null"},t);return te(ne(G(e,n),G(r,n),n,!0),n)}function ae(e,r){return"string"==typeof e?e=te(G(e,r),r):"object"===n(e)&&(e=G(te(e,r),r)),e}function ie(e,r,t){return"string"==typeof e?e=te(G(e,t),t):"object"===n(e)&&(e=te(e,t)),"string"==typeof r?r=te(G(r,t),t):"object"===n(r)&&(r=te(r,t)),e===r}function se(e,r){return e&&e.toString().replace(r&&r.iri?u.ESCAPE:c.ESCAPE,z)}function ce(e,r){return e&&e.toString().replace(r&&r.iri?u.PCT_ENCODED:c.PCT_ENCODED,H)}var ue={scheme:"http",domainHost:!0,parse:function(e,r){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e},serialize:function(e,r){var t="https"===String(e.scheme).toLowerCase();return e.port!==(t?443:80)&&""!==e.port||(e.port=void 0),e.path||(e.path="/"),e}},le={scheme:"https",domainHost:ue.domainHost,parse:ue.parse,serialize:ue.serialize};function pe(e){return"boolean"==typeof e.secure?e.secure:"wss"===String(e.scheme).toLowerCase()}var fe={scheme:"ws",domainHost:!0,parse:function(e,r){var t=e;return t.secure=pe(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t},serialize:function(e,r){if(e.port!==(pe(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 t=e.resourceName.split("?"),n=l(t,2),o=n[0],a=n[1];e.path=o&&"/"!==o?o:void 0,e.query=a,e.resourceName=void 0}return e.fragment=void 0,e}},de={scheme:"wss",domainHost:fe.domainHost,parse:fe.parse,serialize:fe.serialize},he={},ve="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",ye="[0-9A-Fa-f]",me=t(t("%[EFef]"+ye+"%"+ye+ye+"%"+ye+ye)+"|"+t("%[89A-Fa-f]"+ye+"%"+ye+ye)+"|"+t("%"+ye+ye)),ge="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]",be=r("[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",'[\\"\\\\]'),we="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]",Ee=new RegExp(ve,"g"),Se=new RegExp(me,"g"),Ce=new RegExp(r("[^]",ge,"[\\.]",'[\\"]',be),"g"),Oe=new RegExp(r("[^]",ve,we),"g"),Ae=Oe;function Ie(e){var r=H(e);return r.match(Ee)?r:e}var je={scheme:"mailto",parse:function(e,r){var t=e,n=t.to=t.path?t.path.split(","):[];if(t.path=void 0,t.query){for(var o=!1,a={},i=t.query.split("&"),s=0,c=i.length;s<c;++s){var u=i[s].split("=");switch(u[0]){case"to":for(var l=u[1].split(","),p=0,f=l.length;p<f;++p)n.push(l[p]);break;case"subject":t.subject=ce(u[1],r);break;case"body":t.body=ce(u[1],r);break;default:o=!0,a[ce(u[0],r)]=ce(u[1],r)}}o&&(t.headers=a)}t.query=void 0;for(var d=0,h=n.length;d<h;++d){var v=n[d].split("@");if(v[0]=ce(v[0]),r.unicodeSupport)v[1]=ce(v[1],r).toLowerCase();else try{v[1]=q.toASCII(ce(v[1],r).toLowerCase())}catch(e){t.error=t.error||"Email address's domain name can not be converted to ASCII via punycode: "+e}n[d]=v.join("@")}return t},serialize:function(e,r){var t=e,n=a(e.to);if(n){for(var i=0,s=n.length;i<s;++i){var c=String(n[i]),u=c.lastIndexOf("@"),l=c.slice(0,u).replace(Se,Ie).replace(Se,o).replace(Ce,z),p=c.slice(u+1);try{p=r.iri?q.toUnicode(p):q.toASCII(ce(p,r).toLowerCase())}catch(e){t.error=t.error||"Email address's domain name can not be converted to "+(r.iri?"Unicode":"ASCII")+" via punycode: "+e}n[i]=l+"@"+p}t.path=n.join(",")}var f=e.headers=e.headers||{};e.subject&&(f.subject=e.subject),e.body&&(f.body=e.body);var d=[];for(var h in f)f[h]!==he[h]&&d.push(h.replace(Se,Ie).replace(Se,o).replace(Oe,z)+"="+f[h].replace(Se,Ie).replace(Se,o).replace(Ae,z));return d.length&&(t.query=d.join("&")),t}},Te=/^([^\:]+)\:(.*)/,xe={scheme:"urn",parse:function(e,r){var t=e.path&&e.path.match(Te),n=e;if(t){var o=r.scheme||n.scheme||"urn",a=t[1].toLowerCase(),i=t[2],s=o+":"+(r.nid||a),c=L[s];n.nid=a,n.nss=i,n.path=void 0,c&&(n=c.parse(n,r))}else n.error=n.error||"URN can not be parsed.";return n},serialize:function(e,r){var t=r.scheme||e.scheme||"urn",n=e.nid,o=t+":"+(r.nid||n),a=L[o];a&&(e=a.serialize(e,r));var i=e,s=e.nss;return i.path=(n||r.nid)+":"+s,i}},$e=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/,De={scheme:"urn:uuid",parse:function(e,r){var t=e;return t.uuid=t.nss,t.nss=void 0,r.tolerant||t.uuid&&t.uuid.match($e)||(t.error=t.error||"UUID is not valid."),t},serialize:function(e,r){var t=e;return t.nss=(e.uuid||"").toLowerCase(),t}};L[ue.scheme]=ue,L[le.scheme]=le,L[fe.scheme]=fe,L[de.scheme]=de,L[je.scheme]=je,L[xe.scheme]=xe,L[De.scheme]=De,e.SCHEMES=L,e.pctEncChar=z,e.pctDecChars=H,e.parse=G,e.removeDotSegments=re,e.serialize=te,e.resolveComponents=ne,e.resolve=oe,e.normalize=ae,e.equal=ie,e.escapeComponent=se,e.unescapeComponent=ce,Object.defineProperty(e,"__esModule",{value:!0})}(r)}));(a=i)&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")&&a.default;const s={null:e=>null===e,boolean:e=>"boolean"==typeof e,object:e=>"object"==typeof e&&!Array.isArray(e)&&null!==e,array:e=>Array.isArray(e),number:e=>"number"==typeof e,integer:e=>Number.isInteger(e),string:e=>"string"==typeof e};var c={jsonTypeOf:(e,r)=>s[r](e),resolveUrl:(e,r)=>{const t=i.resolve(e,r,{iri:!0});if(i.resolve(e,"",{iri:!0})&&"file"===i.parse(t).scheme&&"file"!==i.parse(e).scheme)throw Error(`Can't access file '${t}' resource from network context '${e}'`);return t},urlFragment:e=>i.unescapeComponent(i.parse(e).fragment)||"",pathRelative:(e,r)=>{if(e===r)return"";let t=1;const n=e.length-1,o=r.length-t,a=n<o?n:o;let i=-1,s=0;for(;s<a;s++){const n=e.charCodeAt(s+1);if(n!==r.charCodeAt(t+s))break;47===n&&(i=s)}if(o>a){if(47===r.charCodeAt(t+s))return r.slice(t+s+1);if(0===s)return r.slice(t+s)}n>a&&(47===e.charCodeAt(s+1)?i=s:0===a&&(i=0));let c="";for(s=i+2;s<=e.length;++s)s!==e.length&&47!==e.charCodeAt(s)||(c+=0===c.length?"..":"/..");return t+=i,c.length>0?`${c}${r.slice(t,r.length)}`:(47===r.charCodeAt(t)&&++t,r.slice(t,r.length))}};const u=e=>{if(e.length>0&&"/"!==e[0])throw Error("Invalid JSON Pointer");return e.split("/").slice(1).map(y)},l=(e,r,t,n)=>{if(0===e.length)return t;if(e.length>1){const o=e.shift();return{...r,[o]:l(e,g(r,o,n),t,h(o,n))}}if(Array.isArray(r)){const n=[...r];return n[m(r,e[0])]=t,n}return"object"==typeof r&&null!==r?{...r,[e[0]]:t}:g(r,e[0],n)},p=(e,r,t,n)=>{if(0!==e.length)if(1!==e.length||b(r)){const o=e.shift();p(e,g(r,o,n),t,h(o,n))}else{r[m(r,e[0])]=t}},f=(e,r,t)=>{if(0!=e.length){if(e.length>1){const n=e.shift(),o=g(r,n,t);return{...r,[n]:f(e,o,h(n,t))}}if(Array.isArray(r))return r.filter(((r,t)=>t!=e[0]));if("object"==typeof r&&null!==r){const{[e[0]]:t,...n}=r;return n}return g(r,e[0],t)}},d=(e,r,t)=>{if(0!==e.length)if(e.length>1){const n=e.shift(),o=g(r,n,t);d(e,o,h(n,t))}else Array.isArray(r)?r.splice(e[0],1):"object"==typeof r&&null!==r?delete r[e[0]]:g(r,e[0],t)},h=r(((e,r)=>r+"/"+v(e))),v=e=>e.toString().replace(/~/g,"~0").replace(/\//g,"~1"),y=e=>e.toString().replace(/~1/g,"/").replace(/~0/g,"~"),m=(e,r)=>Array.isArray(e)&&"-"===r?e.length:r,g=(e,r,t="")=>{if(void 0===e)throw TypeError(`Value at '${t}' is undefined and does not have property '${r}'`);if(null===e)throw TypeError(`Value at '${t}' is null and does not have property '${r}'`);if(b(e))throw TypeError(`Value at '${t}' is a ${typeof e} and does not have property '${r}'`);return e[m(e,r)]},b=e=>null===e||"object"!=typeof e;var w={nil:"",append:h,get:(e,r)=>{const t=u(e),n=e=>t.reduce((([e,r],t)=>[g(e,t,r),h(t,r)]),[e,""])[0];return void 0===r?n:n(r)},set:(e,t,n)=>{const o=u(e),a=r(((e,r)=>l(o,e,r,"")));return void 0===t?a:a(t,n)},assign:(e,t,n)=>{const o=u(e),a=r(((e,r)=>p(o,e,r,"")));return void 0===t?a:a(t,n)},unset:(e,r)=>{const t=u(e),n=e=>f(t,e,"");return void 0===r?n:n(r)},remove:(e,r)=>{const t=u(e),n=e=>d(t,e,"");return void 0===r?n:n(r)}};w.nil,w.append,w.get,w.set,w.assign,w.unset,w.remove;const E=Symbol("$__value"),S=Symbol("$__href");var C={cons:(e,r)=>Object.freeze({[S]:e,[E]:r}),isReference:e=>e&&void 0!==e[S],href:e=>e[S],value:e=>e[E]};const{resolveUrl:O,jsonTypeOf:A}=c,I=Object.freeze({id:"",pointer:"",instance:void 0,value:void 0}),j=e=>C.isReference(e.value)?C.value(e.value):e.value,T=r(((e,r)=>A(j(e),r))),x=(e,r)=>Object.freeze({...r,pointer:w.append(e,r.pointer),value:j(r)[e]}),$=r(((e,r)=>j(r).map(((t,n,o,a)=>e(x(n,r),n,o,a))))),D=r(((e,r)=>j(r).map(((e,t,n,o)=>x(t,r))).filter(((r,t,n,o)=>e(r,t,n,o))))),P=r(((e,r,t)=>j(t).reduce(((r,n,o)=>e(r,x(o,t),o)),r))),R=r(((e,r)=>j(r).every(((t,n,o,a)=>e(x(n,r),n,o,a))))),N=r(((e,r)=>j(r).some(((t,n,o,a)=>e(x(n,r),n,o,a)))));var _={nil:I,cons:(e,r="")=>Object.freeze({...I,id:O(r,""),instance:e,value:e}),uri:e=>`${e.id}#${encodeURI(e.pointer)}`,value:j,has:(e,r)=>e in j(r),typeOf:T,step:x,entries:e=>Object.keys(j(e)).map((r=>[r,x(r,e)])),keys:e=>Object.keys(j(e)),map:$,filter:D,reduce:P,every:R,some:N,length:e=>j(e).length},F=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,k=/^[\u000b\u0020-\u007e\u0080-\u00ff]+$/,U=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,q=/\\([\u000b\u0020-\u00ff])/g,L=/([\\"])/g,z=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,H=function(e){if(!e)throw new TypeError("argument string is required");var r="object"==typeof e?function(e){var r;"function"==typeof e.getHeader?r=e.getHeader("content-type"):"object"==typeof e.headers&&(r=e.headers&&e.headers["content-type"]);if("string"!=typeof r)throw new TypeError("content-type header is missing from object");return r}(e):e;if("string"!=typeof r)throw new TypeError("argument string is required to be a string");var t=r.indexOf(";"),n=-1!==t?r.substr(0,t).trim():r.trim();if(!z.test(n))throw new TypeError("invalid media type");var o=new K(n.toLowerCase());if(-1!==t){var a,i,s;for(F.lastIndex=t;i=F.exec(r);){if(i.index!==t)throw new TypeError("invalid parameter format");t+=i[0].length,a=i[1].toLowerCase(),'"'===(s=i[2])[0]&&(s=s.substr(1,s.length-2).replace(q,"$1")),o.parameters[a]=s}if(t!==r.length)throw new TypeError("invalid parameter format")}return o};function V(e){var r=String(e);if(U.test(r))return r;if(r.length>0&&!k.test(r))throw new TypeError("invalid parameter value");return'"'+r.replace(L,"\\$1")+'"'}function K(e){this.parameters=Object.create(null),this.type=e}var M={format:function(e){if(!e||"object"!=typeof e)throw new TypeError("argument obj is required");var r=e.parameters,t=e.type;if(!t||!z.test(t))throw new TypeError("invalid type");var n=t;if(r&&"object"==typeof r)for(var o,a=Object.keys(r).sort(),i=0;i<a.length;i++){if(o=a[i],!U.test(o))throw new TypeError("invalid parameter name");n+="; "+o+"="+V(r[o])}return n},parse:H},Z=async e=>Object.entries(await e),J=r((async(e,r)=>(await r).map(e))),B=r((async(e,r,t)=>(await t).reduce((async(r,t)=>e(await r,t)),r))),G=r((async(e,r,t={})=>B((async(r,t)=>await e(t)?r.concat([t]):r),[],r,t))),W=r((async(e,r)=>{const t=await J(e,r);return(await Promise.all(t)).some((e=>e))})),Q=r((async(e,r)=>{const t=await J(e,r);return(await Promise.all(t)).every((e=>e))})),Y=r(((e,r)=>e.reduce((async(e,r)=>r(await e)),r))),X={entries:Z,map:J,filter:G,reduce:B,some:W,every:Q,pipeline:Y,all:e=>Promise.all(e),allValues:e=>Y([Z,B((async(e,[r,t])=>(e[r]=await t,e)),{})],e)};X.entries,X.map,X.filter,X.reduce,X.some,X.every,X.pipeline,X.all,X.allValues;var ee=fetch;const{jsonTypeOf:re,resolveUrl:te,urlFragment:ne,pathRelative:oe}=c,ae="https://json-schema.org/draft/2019-09/vocab/core",ie="https://json-schema.org/draft/2020-12/vocab/core",se={},ce={},ue=(e,r)=>{const t=ce[e];return se[t]?.[r]},le={},pe={},fe=(e,r="",t="")=>{e=JSON.parse(JSON.stringify(e));const n=te(r,""),o=te(e.$schema||t,"");if(!o)throw Error("Couldn't determine schema dialect");if(delete e.$schema,!(o in ce))if(!0===e?.$vocabulary?.[ae]&&o===de(e,n,ae)[0])ce[o]=ae;else if(!0===e?.$vocabulary?.[ie]&&o===de(e,n,ie)[0])ce[o]=ie;else if(o===de(e,n,o)[0])ce[o]=o;else{if(!(o in le))throw Error(`Couldn't determine JSON Schema version for dialect: '${o}'`);{const e=le[o];!0===e.vocabulary[ae]?ce[o]=ae:!0===e.vocabulary[ie]?ce[o]=ie:ce[o]=ce[e.dialectId]}}const[a,i]=de(e,n,ce[o]);if(!a)throw Error("Couldn't determine an identifier for the schema");const s=ue(o,"baseToken");delete e[s],n&&(pe[n]=a);const c=ue(o,"anchorToken");i&&s===c&&(e[c]=c!==s?encodeURI(i):`#${encodeURI(i)}`);const u={},l=ue(o,"recursiveAnchorToken");let p;!0===e[l]&&(u[""]=`${a}#`,e[c]="",delete e[l]);const f=ue(o,"vocabularyToken");re(e[f],"object")?(p=e[f],delete e[f]):p={[ce[o]]:!0};const d={"":""};return le[a]={id:a,dialectId:o,schema:he(e,a,o,w.nil,d,u),anchors:d,dynamicAnchors:u,vocabulary:p,validated:!1},a},de=(e,r,t)=>{const n=se[t]?.baseToken,o=te(r,e[n]||"");return[te(o,""),ne(o)]},he=(e,r,t,n,o,a)=>{if(re(e,"object")){const i="string"==typeof e.$schema?te(e.$schema,""):t,s=ue(i,"embeddedToken"),c=ue(i,"anchorToken");if("string"==typeof e[s]&&(s!==c||"#"!==e[s][0])){const n=te(r,e[s]);return e[ue(i,"baseToken")]=n,fe(e,n,t),C.cons(e[s],e)}const u=ue(t,"anchorToken"),l=ue(t,"dynamicAnchorToken");"string"==typeof e[l]&&(a[e[l]]=`${r}#${encodeURI(n)}`,o[e[l]]=n,delete e[l]);const p=ue(t,"embeddedToken");if("string"==typeof e[u]){const r=u!==p?e[u]:e[u].slice(1);o[r]=n,delete e[u]}const f=ue(t,"jrefToken");if("string"==typeof e[f])return C.cons(e[f],e);for(const i in e)e[i]=he(e[i],r,t,w.append(i,n),o,a);return e}return Array.isArray(e)?e.map(((e,i)=>he(e,r,t,w.append(i,n),o,a))):e},ve=e=>le[pe[e]]||le[e],ye=Object.freeze({id:"",dialectId:void 0,vocabulary:{},pointer:w.nil,schema:void 0,value:void 0,anchors:{},dynamicAnchors:{},validated:!0}),me=async(e,r=ye)=>{const t=te(we(r),e),n=te(t,""),o=ne(t);if(!(e=>e in le||e in pe)(n)){const e=await ee(n,{headers:{Accept:"application/schema+json"}});if(e.status>=400)throw await e.text(),Error(`Failed to retrieve schema with id: ${n}`);if(e.headers.has("content-type")){const r=M.parse(e.headers.get("content-type")).type;if("application/schema+json"!==r)throw Error(`${n} is not a schema. Found a document with media type: ${r}`)}fe(await e.json(),n)}const a=ve(n),i="/"!==o[0]?be(a,o):o,s=Object.freeze({...a,pointer:i,value:w.get(i,a.schema)});return ge(s)},ge=e=>C.isReference(e.value)?me(C.href(e.value),e):e,be=(e,r)=>{if(!(r in e.anchors))throw Error(`No such anchor '${encodeURI(e.id)}#${encodeURI(r)}'`);return e.anchors[r]},we=e=>`${e.id}#${encodeURI(e.pointer)}`,Ee=e=>C.isReference(e.value)?C.value(e.value):e.value,Se=(e,r)=>{const t=ve(r.id),n=Object.freeze({...r,pointer:w.append(e,r.pointer),value:Ee(r)[e],validated:t.validated});return ge(n)},Ce=r(((e,r)=>X.pipeline([Ee,X.map((async(t,n)=>e(await Se(n,r),n))),X.all],r))),Oe={parentId:"",parentDialect:"",includeEmbedded:!0},Ae=(e,r)=>{if(r.startsWith("file://")){const t=e.slice(7,e.lastIndexOf("/"));return""===e?"":oe(t,r.slice(7))}return r};var Ie={setConfig:(e,r,t)=>{se[e]||(se[e]={}),se[e][r]=t},getConfig:ue,add:fe,get:me,markValidated:e=>{le[e].validated=!0},uri:we,value:Ee,getAnchorPointer:be,typeOf:(e,r)=>re(Ee(e),r),has:(e,r)=>e in Ee(r),step:Se,keys:e=>Object.keys(Ee(e)),entries:e=>X.pipeline([Ee,Object.keys,X.map((async r=>[r,await Se(r,e)])),X.all],e),map:Ce,length:e=>Ee(e).length,toSchema:(e,r={})=>{const t={...Oe,...r},n=JSON.parse(JSON.stringify(e.schema,((r,n)=>{if(!C.isReference(n))return n;const o=C.value(n),a="string"==typeof o.$schema?te(o.$schema,""):e.dialectId,i=ue(a,"embeddedToken");return!t.includeEmbedded&&i in o?void 0:C.value(n)}))),o=ue(e.dialectId,"dynamicAnchorToken");Object.entries(e.dynamicAnchors).forEach((([e,r])=>{const t=ne(r);w.assign(t,n,{[o]:e,...w.get(t,n)})}));const a=ue(e.dialectId,"anchorToken");Object.entries(e.anchors).filter((([e])=>""!==e)).forEach((([e,r])=>{w.assign(r,n,{[a]:e,...w.get(r,n)})}));const i=ue(e.dialectId,"baseToken"),s=Ae(t.parentId,e.id),c=t.parentDialect===e.dialectId?"":e.dialectId;return{...s&&{[i]:s},...c&&{$schema:c},...n}}};Ie.setConfig,Ie.getConfig,Ie.add,Ie.get,Ie.markValidated,Ie.uri,Ie.value,Ie.getAnchorPointer,Ie.typeOf,Ie.has,Ie.step,Ie.keys,Ie.entries,Ie.map,Ie.length,Ie.toSchema;class je extends Error{constructor(e){super("Invalid Schema"),this.name=this.constructor.name,this.output=e}}var Te=je;const{resolveUrl:xe}=c,$e="FLAG",De="BASIC",Pe="DETAILED",Re="VERBOSE";let Ne=Pe,_e=!0;const Fe=async e=>{const r={metaData:{}};return{ast:r,schemaUri:await Ke(e,r)}},ke=r((({ast:e,schemaUri:r},t,n=$e)=>{if(![$e,De,Pe,Re].includes(n))throw Error(`The '${n}' error format is not supported`);const a=[],i=o.subscribe("result",Ue(n,a));return Ze(r,t,e,{}),o.unsubscribe(i),a[0]})),Ue=(e,r)=>{const t=[];return(n,o)=>{if("result"===n){const{keyword:e,absoluteKeywordLocation:r,instanceLocation:n,valid:a}=o,i={keyword:e,absoluteKeywordLocation:r,instanceLocation:n,valid:a,errors:[]};t.push(i)}else if("result.start"===n)t.push(n);else if("result.end"===n){const n=t.pop();for(;"result.start"!==t[t.length-1];){const r=t.pop(),o=[r];e===De&&(o.push(...r.errors),delete r.errors),(e===Re||e!==$e&&!r.valid)&&n.errors.unshift(...o)}t[t.length-1]=n,r[0]=n}}},qe={},Le=e=>qe[e],ze=e=>e in qe,He={},Ve={},Ke=async(e,r)=>{if(e=await Me(e),!ze(`${e.dialectId}#validate`)){const r=await Ie.get(e.dialectId);(Ie.getConfig(r.id,"mandatoryVocabularies")||[]).forEach((e=>{if(!r.vocabulary[e])throw Error(`Vocabulary '${e}' must be explicitly declared and required`)})),Object.entries(r.vocabulary).forEach((([e,t])=>{if(e in He)Object.entries(He[e]).forEach((([e,t])=>{((e,r)=>{qe[e]={collectEvaluatedItems:(e,t,n,o,a)=>r.interpret(e,t,n,o,a)&&new Set,collectEvaluatedProperties:(e,t,n,o,a)=>r.interpret(e,t,n,o,a)&&[],...r}})(`${r.id}#${e}`,t)}));else if(t)throw Error(`Missing required vocabulary: ${e}`)}))}if(_e&&!e.validated){if(Ie.markValidated(e.id),!(e.dialectId in Ve)){const r=await Ie.get(e.dialectId),t=await Fe(r);Ve[r.id]=ke(t)}const r=_.cons(e.schema,e.id),t=Ve[e.dialectId](r,Ne);if(!t.valid)throw new Te(t)}return e.id in r.metaData||(r.metaData[e.id]={id:e.id,dynamicAnchors:e.dynamicAnchors,anchors:e.anchors}),Le(`${e.dialectId}#validate`).compile(e,r)},Me=async e=>Ie.typeOf(e,"string")?Me(await Ie.get(Ie.value(e),e)):e,Ze=(e,r,t,n)=>{const o=Je(e,t),a=xe(e,"");return Le(o).interpret(e,r,t,{...t.metaData[a].dynamicAnchors,...n})},Je=(e,r)=>{if(!(e in r))throw Error(`No schema found at ${e}`);return r[e][0]};var Be={validate:async(e,r,t)=>{const n=await Fe(e),o=(e,r)=>ke(n,_.cons(e),r);return void 0===r?o:o(r,t)},compile:Fe,interpret:ke,setMetaOutputFormat:e=>{Ne=e},setShouldMetaValidate:e=>{_e=e},FLAG:$e,BASIC:De,DETAILED:Pe,VERBOSE:Re,add:(e,r="",t="")=>{const n=Ie.add(e,r,t);delete Ve[n]},getKeyword:Le,hasKeyword:ze,defineVocabulary:(e,r)=>{He[e]=r},compileSchema:Ke,interpretSchema:Ze,collectEvaluatedProperties:(e,r,t,n,o)=>{const a=Je(e,t);return Le(a).collectEvaluatedProperties(e,r,t,n,o)},collectEvaluatedItems:(e,r,t,n,o)=>{const a=Je(e,t);return Le(a).collectEvaluatedItems(e,r,t,n,o)}};var Ge={compile:e=>Ie.value(e),interpret:()=>!0};var We={compile:async(e,r)=>{const t=Ie.uri(e);if(!(t in r)){r[t]=!1;const n=Ie.value(e);if(!["object","boolean"].includes(typeof n))throw Error(`No schema found at '${Ie.uri(e)}'`);r[t]=[`${e.dialectId}#validate`,Ie.uri(e),"boolean"==typeof n?n:await X.pipeline([Ie.entries,X.map((([r,t])=>[`${e.dialectId}#${r}`,t])),X.filter((([r])=>Be.hasKeyword(r)&&r!==`${e.dialectId}#validate`)),X.map((async([t,n])=>{const o=await Be.getKeyword(t).compile(n,r,e);return[t,Ie.uri(n),o]})),X.all],e)]}return t},interpret:(e,r,t,n)=>{const[a,i,s]=t[e];o.publishSync("result.start");const c="boolean"==typeof s?s:s.every((([e,a,i])=>{o.publishSync("result.start");const s=Be.getKeyword(e).interpret(i,r,t,n);return o.publishSync("result",{keyword:e,absoluteKeywordLocation:a,instanceLocation:_.uri(r),valid:s,ast:i}),o.publishSync("result.end"),s}));return o.publishSync("result",{keyword:a,absoluteKeywordLocation:i,instanceLocation:_.uri(r),valid:c,ast:e}),o.publishSync("result.end"),c},collectEvaluatedProperties:(e,r,t,n,o=!1)=>{const a=t[e][2];return"boolean"==typeof a?!!a&&[]:a.filter((([e])=>!o||!e.endsWith("#unevaluatedProperties"))).reduce(((e,[o,,a])=>{const i=e&&Be.getKeyword(o).collectEvaluatedProperties(a,r,t,n);return!1!==i&&[...e,...i]}),[])},collectEvaluatedItems:(e,r,t,n,o=!1)=>{const a=t[e][2];return"boolean"==typeof a?!!a&&new Set:a.filter((([e])=>!o||!e.endsWith("#unevaluatedItems"))).reduce(((e,[o,,a])=>{const i=!1!==e&&Be.getKeyword(o).collectEvaluatedItems(a,r,t,n);return!1!==i&&new Set([...e,...i])}),new Set)}},Qe={metaData:Ge,validate:We},Ye={Core:Be,Schema:Ie,Instance:_,Reference:C,Keywords:Qe,InvalidSchemaError:Te},Xe=Ye.Core,er=Ye.Schema,rr=Ye.Instance,tr=Ye.Reference,nr=Ye.Keywords,or=Ye.InvalidSchemaError;e.Core=Xe,e.Instance=rr,e.InvalidSchemaError=or,e.Keywords=nr,e.Reference=tr,e.Schema=er,e.default=Ye,Object.defineProperty(e,"__esModule",{value:!0})})); | ||
!function(e){function r(){for(var e=arguments.length,r=Array(e),t=0;t<e;t++)r[t]=arguments[t];if(r.length>1){r[0]=r[0].slice(0,-1);for(var n=r.length-1,o=1;o<n;++o)r[o]=r[o].slice(1,-1);return r[n]=r[n].slice(1),r.join("")}return r[0]}function t(e){return"(?:"+e+")"}function n(e){return void 0===e?"undefined":null===e?"null":Object.prototype.toString.call(e).split(" ").pop().split("]").shift().toLowerCase()}function o(e){return e.toUpperCase()}function a(e){return null!=e?e instanceof Array?e:"number"!=typeof e.length||e.split||e.setInterval||e.call?[e]:Array.prototype.slice.call(e):[]}function i(e,r){var t=e;if(r)for(var n in r)t[n]=r[n];return t}function s(e){var n="[A-Za-z]",o="[0-9]",a=r(o,"[A-Fa-f]"),i=t(t("%[EFef]"+a+"%"+a+a+"%"+a+a)+"|"+t("%[89A-Fa-f]"+a+"%"+a+a)+"|"+t("%"+a+a)),s="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",c=r("[\\:\\/\\?\\#\\[\\]\\@]",s),u=e?"[\\uE000-\\uF8FF]":"[]",l=r(n,o,"[\\-\\.\\_\\~]",e?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]");t(n+r(n,o,"[\\+\\-\\.]")+"*"),t(t(i+"|"+r(l,s,"[\\:]"))+"*");var p=t(t("25[0-5]")+"|"+t("2[0-4]"+o)+"|"+t("1"+o+o)+"|"+t("0?[1-9]"+o)+"|0?0?"+o),f=t(p+"\\."+p+"\\."+p+"\\."+p),d=t(a+"{1,4}"),h=t(t(d+"\\:"+d)+"|"+f),v=t(t(d+"\\:")+"{6}"+h),y=t("\\:\\:"+t(d+"\\:")+"{5}"+h),m=t(t(d)+"?\\:\\:"+t(d+"\\:")+"{4}"+h),g=t(t(t(d+"\\:")+"{0,1}"+d)+"?\\:\\:"+t(d+"\\:")+"{3}"+h),b=t(t(t(d+"\\:")+"{0,2}"+d)+"?\\:\\:"+t(d+"\\:")+"{2}"+h),w=t(t(t(d+"\\:")+"{0,3}"+d)+"?\\:\\:"+d+"\\:"+h),E=t(t(t(d+"\\:")+"{0,4}"+d)+"?\\:\\:"+h),S=t(t(t(d+"\\:")+"{0,5}"+d)+"?\\:\\:"+d),C=t(t(t(d+"\\:")+"{0,6}"+d)+"?\\:\\:"),O=t([v,y,m,g,b,w,E,S,C].join("|")),A=t(t(l+"|"+i)+"+");t("[vV]"+a+"+\\."+r(l,s,"[\\:]")+"+"),t(t(i+"|"+r(l,s))+"*");var I=t(i+"|"+r(l,s,"[\\:\\@]"));return t(t(i+"|"+r(l,s,"[\\@]"))+"+"),t(t(I+"|"+r("[\\/\\?]",u))+"*"),{NOT_SCHEME:new RegExp(r("[^]",n,o,"[\\+\\-\\.]"),"g"),NOT_USERINFO:new RegExp(r("[^\\%\\:]",l,s),"g"),NOT_HOST:new RegExp(r("[^\\%\\[\\]\\:]",l,s),"g"),NOT_PATH:new RegExp(r("[^\\%\\/\\:\\@]",l,s),"g"),NOT_PATH_NOSCHEME:new RegExp(r("[^\\%\\/\\@]",l,s),"g"),NOT_QUERY:new RegExp(r("[^\\%]",l,s,"[\\:\\@\\/\\?]",u),"g"),NOT_FRAGMENT:new RegExp(r("[^\\%]",l,s,"[\\:\\@\\/\\?]"),"g"),ESCAPE:new RegExp(r("[^]",l,s),"g"),UNRESERVED:new RegExp(l,"g"),OTHER_CHARS:new RegExp(r("[^\\%]",l,c),"g"),PCT_ENCODED:new RegExp(i,"g"),IPV4ADDRESS:new RegExp("^("+f+")$"),IPV6ADDRESS:new RegExp("^\\[?("+O+")"+t(t("\\%25|\\%(?!"+a+"{2})")+"("+A+")")+"?\\]?$")}}var c=s(!1),u=s(!0),l=function(){function e(e,r){var t=[],n=!0,o=!1,a=void 0;try{for(var i,s=e[Symbol.iterator]();!(n=(i=s.next()).done)&&(t.push(i.value),!r||t.length!==r);n=!0);}catch(e){o=!0,a=e}finally{try{!n&&s.return&&s.return()}finally{if(o)throw a}}return t}return function(r,t){if(Array.isArray(r))return r;if(Symbol.iterator in Object(r))return e(r,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),p=function(e){if(Array.isArray(e)){for(var r=0,t=Array(e.length);r<e.length;r++)t[r]=e[r];return t}return Array.from(e)},f=2147483647,d=36,h=1,v=26,y=38,m=700,g=72,b=128,w="-",E=/^xn--/,S=/[^\0-\x7E]/,C=/[\x2E\u3002\uFF0E\uFF61]/g,O={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},A=d-h,I=Math.floor,j=String.fromCharCode;function T(e){throw new RangeError(O[e])}function x(e,r){for(var t=[],n=e.length;n--;)t[n]=r(e[n]);return t}function P(e,r){var t=e.split("@"),n="";return t.length>1&&(n=t[0]+"@",e=t[1]),n+x((e=e.replace(C,".")).split("."),r).join(".")}function $(e){for(var r=[],t=0,n=e.length;t<n;){var o=e.charCodeAt(t++);if(o>=55296&&o<=56319&&t<n){var a=e.charCodeAt(t++);56320==(64512&a)?r.push(((1023&o)<<10)+(1023&a)+65536):(r.push(o),t--)}else r.push(o)}return r}var D=function(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:d},R=function(e,r){return e+22+75*(e<26)-((0!=r)<<5)},N=function(e,r,t){var n=0;for(e=t?I(e/m):e>>1,e+=I(e/r);e>A*v>>1;n+=d)e=I(e/A);return I(n+(A+1)*e/(e+y))},_=function(e){var r=[],t=e.length,n=0,o=b,a=g,i=e.lastIndexOf(w);i<0&&(i=0);for(var s=0;s<i;++s)e.charCodeAt(s)>=128&&T("not-basic"),r.push(e.charCodeAt(s));for(var c=i>0?i+1:0;c<t;){for(var u=n,l=1,p=d;;p+=d){c>=t&&T("invalid-input");var y=D(e.charCodeAt(c++));(y>=d||y>I((f-n)/l))&&T("overflow"),n+=y*l;var m=p<=a?h:p>=a+v?v:p-a;if(y<m)break;var E=d-m;l>I(f/E)&&T("overflow"),l*=E}var S=r.length+1;a=N(n-u,S,0==u),I(n/S)>f-o&&T("overflow"),o+=I(n/S),n%=S,r.splice(n++,0,o)}return String.fromCodePoint.apply(String,r)},F=function(e){var r=[],t=(e=$(e)).length,n=b,o=0,a=g,i=!0,s=!1,c=void 0;try{for(var u,l=e[Symbol.iterator]();!(i=(u=l.next()).done);i=!0){var p=u.value;p<128&&r.push(j(p))}}catch(e){s=!0,c=e}finally{try{!i&&l.return&&l.return()}finally{if(s)throw c}}var y=r.length,m=y;for(y&&r.push(w);m<t;){var E=f,S=!0,C=!1,O=void 0;try{for(var A,x=e[Symbol.iterator]();!(S=(A=x.next()).done);S=!0){var P=A.value;P>=n&&P<E&&(E=P)}}catch(e){C=!0,O=e}finally{try{!S&&x.return&&x.return()}finally{if(C)throw O}}var D=m+1;E-n>I((f-o)/D)&&T("overflow"),o+=(E-n)*D,n=E;var _=!0,F=!1,k=void 0;try{for(var U,q=e[Symbol.iterator]();!(_=(U=q.next()).done);_=!0){var L=U.value;if(L<n&&++o>f&&T("overflow"),L==n){for(var z=o,H=d;;H+=d){var V=H<=a?h:H>=a+v?v:H-a;if(z<V)break;var M=z-V,K=d-V;r.push(j(R(V+M%K,0))),z=I(M/K)}r.push(j(R(z,0))),a=N(o,D,m==y),o=0,++m}}}catch(e){F=!0,k=e}finally{try{!_&&q.return&&q.return()}finally{if(F)throw k}}++o,++n}return r.join("")},k=function(e){return P(e,(function(e){return E.test(e)?_(e.slice(4).toLowerCase()):e}))},U=function(e){return P(e,(function(e){return S.test(e)?"xn--"+F(e):e}))},q={version:"2.1.0",ucs2:{decode:$,encode:function(e){return String.fromCodePoint.apply(String,p(e))}},decode:_,encode:F,toASCII:U,toUnicode:k},L={};function z(e){var r=e.charCodeAt(0);return r<16?"%0"+r.toString(16).toUpperCase():r<128?"%"+r.toString(16).toUpperCase():r<2048?"%"+(r>>6|192).toString(16).toUpperCase()+"%"+(63&r|128).toString(16).toUpperCase():"%"+(r>>12|224).toString(16).toUpperCase()+"%"+(r>>6&63|128).toString(16).toUpperCase()+"%"+(63&r|128).toString(16).toUpperCase()}function H(e){for(var r="",t=0,n=e.length;t<n;){var o=parseInt(e.substr(t+1,2),16);if(o<128)r+=String.fromCharCode(o),t+=3;else if(o>=194&&o<224){if(n-t>=6){var a=parseInt(e.substr(t+4,2),16);r+=String.fromCharCode((31&o)<<6|63&a)}else r+=e.substr(t,6);t+=6}else if(o>=224){if(n-t>=9){var i=parseInt(e.substr(t+4,2),16),s=parseInt(e.substr(t+7,2),16);r+=String.fromCharCode((15&o)<<12|(63&i)<<6|63&s)}else r+=e.substr(t,9);t+=9}else r+=e.substr(t,3),t+=3}return r}function V(e,r){function t(e){var t=H(e);return t.match(r.UNRESERVED)?t:e}return e.scheme&&(e.scheme=String(e.scheme).replace(r.PCT_ENCODED,t).toLowerCase().replace(r.NOT_SCHEME,"")),void 0!==e.userinfo&&(e.userinfo=String(e.userinfo).replace(r.PCT_ENCODED,t).replace(r.NOT_USERINFO,z).replace(r.PCT_ENCODED,o)),void 0!==e.host&&(e.host=String(e.host).replace(r.PCT_ENCODED,t).toLowerCase().replace(r.NOT_HOST,z).replace(r.PCT_ENCODED,o)),void 0!==e.path&&(e.path=String(e.path).replace(r.PCT_ENCODED,t).replace(e.scheme?r.NOT_PATH:r.NOT_PATH_NOSCHEME,z).replace(r.PCT_ENCODED,o)),void 0!==e.query&&(e.query=String(e.query).replace(r.PCT_ENCODED,t).replace(r.NOT_QUERY,z).replace(r.PCT_ENCODED,o)),void 0!==e.fragment&&(e.fragment=String(e.fragment).replace(r.PCT_ENCODED,t).replace(r.NOT_FRAGMENT,z).replace(r.PCT_ENCODED,o)),e}function M(e){return e.replace(/^0*(.*)/,"$1")||"0"}function K(e,r){var t=e.match(r.IPV4ADDRESS)||[],n=l(t,2)[1];return n?n.split(".").map(M).join("."):e}function Z(e,r){var t=e.match(r.IPV6ADDRESS)||[],n=l(t,3),o=n[1],a=n[2];if(o){for(var i=o.toLowerCase().split("::").reverse(),s=l(i,2),c=s[0],u=s[1],p=u?u.split(":").map(M):[],f=c.split(":").map(M),d=r.IPV4ADDRESS.test(f[f.length-1]),h=d?7:8,v=f.length-h,y=Array(h),m=0;m<h;++m)y[m]=p[m]||f[v+m]||"";d&&(y[h-1]=K(y[h-1],r));var g=y.reduce((function(e,r,t){if(!r||"0"===r){var n=e[e.length-1];n&&n.index+n.length===t?n.length++:e.push({index:t,length:1})}return e}),[]).sort((function(e,r){return r.length-e.length}))[0],b=void 0;if(g&&g.length>1){var w=y.slice(0,g.index),E=y.slice(g.index+g.length);b=w.join(":")+"::"+E.join(":")}else b=y.join(":");return a&&(b+="%"+a),b}return e}var J=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,B=void 0==="".match(/(){0}/)[1];function G(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t={},n=!1!==r.iri?u:c;"suffix"===r.reference&&(e=(r.scheme?r.scheme+":":"")+"//"+e);var o=e.match(J);if(o){B?(t.scheme=o[1],t.userinfo=o[3],t.host=o[4],t.port=parseInt(o[5],10),t.path=o[6]||"",t.query=o[7],t.fragment=o[8],isNaN(t.port)&&(t.port=o[5])):(t.scheme=o[1]||void 0,t.userinfo=-1!==e.indexOf("@")?o[3]:void 0,t.host=-1!==e.indexOf("//")?o[4]:void 0,t.port=parseInt(o[5],10),t.path=o[6]||"",t.query=-1!==e.indexOf("?")?o[7]:void 0,t.fragment=-1!==e.indexOf("#")?o[8]:void 0,isNaN(t.port)&&(t.port=e.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?o[4]:void 0)),t.host&&(t.host=Z(K(t.host,n),n)),void 0!==t.scheme||void 0!==t.userinfo||void 0!==t.host||void 0!==t.port||t.path||void 0!==t.query?void 0===t.scheme?t.reference="relative":void 0===t.fragment?t.reference="absolute":t.reference="uri":t.reference="same-document",r.reference&&"suffix"!==r.reference&&r.reference!==t.reference&&(t.error=t.error||"URI is not a "+r.reference+" reference.");var a=L[(r.scheme||t.scheme||"").toLowerCase()];if(r.unicodeSupport||a&&a.unicodeSupport)V(t,n);else{if(t.host&&(r.domainHost||a&&a.domainHost))try{t.host=q.toASCII(t.host.replace(n.PCT_ENCODED,H).toLowerCase())}catch(e){t.error=t.error||"Host's domain name can not be converted to ASCII via punycode: "+e}V(t,c)}a&&a.parse&&a.parse(t,r)}else t.error=t.error||"URI can not be parsed.";return t}function W(e,r){var t=!1!==r.iri?u:c,n=[];return void 0!==e.userinfo&&(n.push(e.userinfo),n.push("@")),void 0!==e.host&&n.push(Z(K(String(e.host),t),t).replace(t.IPV6ADDRESS,(function(e,r,t){return"["+r+(t?"%25"+t:"")+"]"}))),"number"!=typeof e.port&&"string"!=typeof e.port||(n.push(":"),n.push(String(e.port))),n.length?n.join(""):void 0}var Q=/^\.\.?\//,Y=/^\/\.(\/|$)/,X=/^\/\.\.(\/|$)/,ee=/^\/?(?:.|\n)*?(?=\/|$)/;function re(e){for(var r=[];e.length;)if(e.match(Q))e=e.replace(Q,"");else if(e.match(Y))e=e.replace(Y,"/");else if(e.match(X))e=e.replace(X,"/"),r.pop();else if("."===e||".."===e)e="";else{var t=e.match(ee);if(!t)throw new Error("Unexpected dot segment condition");var n=t[0];e=e.slice(n.length),r.push(n)}return r.join("")}function te(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=r.iri?u:c,n=[],o=L[(r.scheme||e.scheme||"").toLowerCase()];if(o&&o.serialize&&o.serialize(e,r),e.host)if(t.IPV6ADDRESS.test(e.host));else if(r.domainHost||o&&o.domainHost)try{e.host=r.iri?q.toUnicode(e.host):q.toASCII(e.host.replace(t.PCT_ENCODED,H).toLowerCase())}catch(t){e.error=e.error||"Host's domain name can not be converted to "+(r.iri?"Unicode":"ASCII")+" via punycode: "+t}V(e,t),"suffix"!==r.reference&&e.scheme&&(n.push(e.scheme),n.push(":"));var a=W(e,r);if(void 0!==a&&("suffix"!==r.reference&&n.push("//"),n.push(a),e.path&&"/"!==e.path.charAt(0)&&n.push("/")),void 0!==e.path){var i=e.path;r.absolutePath||o&&o.absolutePath||(i=re(i)),void 0===a&&(i=i.replace(/^\/\//,"/%2F")),n.push(i)}return void 0!==e.query&&(n.push("?"),n.push(e.query)),void 0!==e.fragment&&(n.push("#"),n.push(e.fragment)),n.join("")}function ne(e,r){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n={};return arguments[3]||(e=G(te(e,t),t),r=G(te(r,t),t)),!(t=t||{}).tolerant&&r.scheme?(n.scheme=r.scheme,n.userinfo=r.userinfo,n.host=r.host,n.port=r.port,n.path=re(r.path||""),n.query=r.query):(void 0!==r.userinfo||void 0!==r.host||void 0!==r.port?(n.userinfo=r.userinfo,n.host=r.host,n.port=r.port,n.path=re(r.path||""),n.query=r.query):(r.path?("/"===r.path.charAt(0)?n.path=re(r.path):(void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?n.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+r.path:n.path=r.path:n.path="/"+r.path,n.path=re(n.path)),n.query=r.query):(n.path=e.path,void 0!==r.query?n.query=r.query:n.query=e.query),n.userinfo=e.userinfo,n.host=e.host,n.port=e.port),n.scheme=e.scheme),n.fragment=r.fragment,n}function oe(e,r,t){var n=i({scheme:"null"},t);return te(ne(G(e,n),G(r,n),n,!0),n)}function ae(e,r){return"string"==typeof e?e=te(G(e,r),r):"object"===n(e)&&(e=G(te(e,r),r)),e}function ie(e,r,t){return"string"==typeof e?e=te(G(e,t),t):"object"===n(e)&&(e=te(e,t)),"string"==typeof r?r=te(G(r,t),t):"object"===n(r)&&(r=te(r,t)),e===r}function se(e,r){return e&&e.toString().replace(r&&r.iri?u.ESCAPE:c.ESCAPE,z)}function ce(e,r){return e&&e.toString().replace(r&&r.iri?u.PCT_ENCODED:c.PCT_ENCODED,H)}var ue={scheme:"http",domainHost:!0,parse:function(e,r){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e},serialize:function(e,r){var t="https"===String(e.scheme).toLowerCase();return e.port!==(t?443:80)&&""!==e.port||(e.port=void 0),e.path||(e.path="/"),e}},le={scheme:"https",domainHost:ue.domainHost,parse:ue.parse,serialize:ue.serialize};function pe(e){return"boolean"==typeof e.secure?e.secure:"wss"===String(e.scheme).toLowerCase()}var fe={scheme:"ws",domainHost:!0,parse:function(e,r){var t=e;return t.secure=pe(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t},serialize:function(e,r){if(e.port!==(pe(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 t=e.resourceName.split("?"),n=l(t,2),o=n[0],a=n[1];e.path=o&&"/"!==o?o:void 0,e.query=a,e.resourceName=void 0}return e.fragment=void 0,e}},de={scheme:"wss",domainHost:fe.domainHost,parse:fe.parse,serialize:fe.serialize},he={},ve="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",ye="[0-9A-Fa-f]",me=t(t("%[EFef]"+ye+"%"+ye+ye+"%"+ye+ye)+"|"+t("%[89A-Fa-f]"+ye+"%"+ye+ye)+"|"+t("%"+ye+ye)),ge="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]",be=r("[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",'[\\"\\\\]'),we="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]",Ee=new RegExp(ve,"g"),Se=new RegExp(me,"g"),Ce=new RegExp(r("[^]",ge,"[\\.]",'[\\"]',be),"g"),Oe=new RegExp(r("[^]",ve,we),"g"),Ae=Oe;function Ie(e){var r=H(e);return r.match(Ee)?r:e}var je={scheme:"mailto",parse:function(e,r){var t=e,n=t.to=t.path?t.path.split(","):[];if(t.path=void 0,t.query){for(var o=!1,a={},i=t.query.split("&"),s=0,c=i.length;s<c;++s){var u=i[s].split("=");switch(u[0]){case"to":for(var l=u[1].split(","),p=0,f=l.length;p<f;++p)n.push(l[p]);break;case"subject":t.subject=ce(u[1],r);break;case"body":t.body=ce(u[1],r);break;default:o=!0,a[ce(u[0],r)]=ce(u[1],r)}}o&&(t.headers=a)}t.query=void 0;for(var d=0,h=n.length;d<h;++d){var v=n[d].split("@");if(v[0]=ce(v[0]),r.unicodeSupport)v[1]=ce(v[1],r).toLowerCase();else try{v[1]=q.toASCII(ce(v[1],r).toLowerCase())}catch(e){t.error=t.error||"Email address's domain name can not be converted to ASCII via punycode: "+e}n[d]=v.join("@")}return t},serialize:function(e,r){var t=e,n=a(e.to);if(n){for(var i=0,s=n.length;i<s;++i){var c=String(n[i]),u=c.lastIndexOf("@"),l=c.slice(0,u).replace(Se,Ie).replace(Se,o).replace(Ce,z),p=c.slice(u+1);try{p=r.iri?q.toUnicode(p):q.toASCII(ce(p,r).toLowerCase())}catch(e){t.error=t.error||"Email address's domain name can not be converted to "+(r.iri?"Unicode":"ASCII")+" via punycode: "+e}n[i]=l+"@"+p}t.path=n.join(",")}var f=e.headers=e.headers||{};e.subject&&(f.subject=e.subject),e.body&&(f.body=e.body);var d=[];for(var h in f)f[h]!==he[h]&&d.push(h.replace(Se,Ie).replace(Se,o).replace(Oe,z)+"="+f[h].replace(Se,Ie).replace(Se,o).replace(Ae,z));return d.length&&(t.query=d.join("&")),t}},Te=/^([^\:]+)\:(.*)/,xe={scheme:"urn",parse:function(e,r){var t=e.path&&e.path.match(Te),n=e;if(t){var o=r.scheme||n.scheme||"urn",a=t[1].toLowerCase(),i=t[2],s=o+":"+(r.nid||a),c=L[s];n.nid=a,n.nss=i,n.path=void 0,c&&(n=c.parse(n,r))}else n.error=n.error||"URN can not be parsed.";return n},serialize:function(e,r){var t=r.scheme||e.scheme||"urn",n=e.nid,o=t+":"+(r.nid||n),a=L[o];a&&(e=a.serialize(e,r));var i=e,s=e.nss;return i.path=(n||r.nid)+":"+s,i}},Pe=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/,$e={scheme:"urn:uuid",parse:function(e,r){var t=e;return t.uuid=t.nss,t.nss=void 0,r.tolerant||t.uuid&&t.uuid.match(Pe)||(t.error=t.error||"UUID is not valid."),t},serialize:function(e,r){var t=e;return t.nss=(e.uuid||"").toLowerCase(),t}};L[ue.scheme]=ue,L[le.scheme]=le,L[fe.scheme]=fe,L[de.scheme]=de,L[je.scheme]=je,L[xe.scheme]=xe,L[$e.scheme]=$e,e.SCHEMES=L,e.pctEncChar=z,e.pctDecChars=H,e.parse=G,e.removeDotSegments=re,e.serialize=te,e.resolveComponents=ne,e.resolve=oe,e.normalize=ae,e.equal=ie,e.escapeComponent=se,e.unescapeComponent=ce,Object.defineProperty(e,"__esModule",{value:!0})}(r)}));(a=i)&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")&&a.default;const s={null:e=>null===e,boolean:e=>"boolean"==typeof e,object:e=>"object"==typeof e&&!Array.isArray(e)&&null!==e,array:e=>Array.isArray(e),number:e=>"number"==typeof e,integer:e=>Number.isInteger(e),string:e=>"string"==typeof e};var c={jsonTypeOf:(e,r)=>s[r](e),resolveUrl:(e,r)=>{const t=i.resolve(e,r,{iri:!0});if(i.resolve(e,"",{iri:!0})&&"file"===i.parse(t).scheme&&"file"!==i.parse(e).scheme)throw Error(`Can't access file '${t}' resource from network context '${e}'`);return t},urlFragment:e=>i.unescapeComponent(i.parse(e).fragment)||"",pathRelative:(e,r)=>{if(e===r)return"";let t=1;const n=e.length-1,o=r.length-t,a=n<o?n:o;let i=-1,s=0;for(;s<a;s++){const n=e.charCodeAt(s+1);if(n!==r.charCodeAt(t+s))break;47===n&&(i=s)}if(o>a){if(47===r.charCodeAt(t+s))return r.slice(t+s+1);if(0===s)return r.slice(t+s)}n>a&&(47===e.charCodeAt(s+1)?i=s:0===a&&(i=0));let c="";for(s=i+2;s<=e.length;++s)s!==e.length&&47!==e.charCodeAt(s)||(c+=0===c.length?"..":"/..");return t+=i,c.length>0?`${c}${r.slice(t,r.length)}`:(47===r.charCodeAt(t)&&++t,r.slice(t,r.length))}};const u=e=>{if(e.length>0&&"/"!==e[0])throw Error("Invalid JSON Pointer");return e.split("/").slice(1).map(y)},l=(e,r,t,n)=>{if(0===e.length)return t;if(e.length>1){const o=e.shift();return{...r,[o]:l(e,g(r,o,n),t,h(o,n))}}if(Array.isArray(r)){const n=[...r];return n[m(r,e[0])]=t,n}return"object"==typeof r&&null!==r?{...r,[e[0]]:t}:g(r,e[0],n)},p=(e,r,t,n)=>{if(0!==e.length)if(1!==e.length||b(r)){const o=e.shift();p(e,g(r,o,n),t,h(o,n))}else{r[m(r,e[0])]=t}},f=(e,r,t)=>{if(0!=e.length){if(e.length>1){const n=e.shift(),o=g(r,n,t);return{...r,[n]:f(e,o,h(n,t))}}if(Array.isArray(r))return r.filter(((r,t)=>t!=e[0]));if("object"==typeof r&&null!==r){const{[e[0]]:t,...n}=r;return n}return g(r,e[0],t)}},d=(e,r,t)=>{if(0!==e.length)if(e.length>1){const n=e.shift(),o=g(r,n,t);d(e,o,h(n,t))}else Array.isArray(r)?r.splice(e[0],1):"object"==typeof r&&null!==r?delete r[e[0]]:g(r,e[0],t)},h=r(((e,r)=>r+"/"+v(e))),v=e=>e.toString().replace(/~/g,"~0").replace(/\//g,"~1"),y=e=>e.toString().replace(/~1/g,"/").replace(/~0/g,"~"),m=(e,r)=>Array.isArray(e)&&"-"===r?e.length:r,g=(e,r,t="")=>{if(void 0===e)throw TypeError(`Value at '${t}' is undefined and does not have property '${r}'`);if(null===e)throw TypeError(`Value at '${t}' is null and does not have property '${r}'`);if(b(e))throw TypeError(`Value at '${t}' is a ${typeof e} and does not have property '${r}'`);return e[m(e,r)]},b=e=>null===e||"object"!=typeof e;var w={nil:"",append:h,get:(e,r)=>{const t=u(e),n=e=>t.reduce((([e,r],t)=>[g(e,t,r),h(t,r)]),[e,""])[0];return void 0===r?n:n(r)},set:(e,t,n)=>{const o=u(e),a=r(((e,r)=>l(o,e,r,"")));return void 0===t?a:a(t,n)},assign:(e,t,n)=>{const o=u(e),a=r(((e,r)=>p(o,e,r,"")));return void 0===t?a:a(t,n)},unset:(e,r)=>{const t=u(e),n=e=>f(t,e,"");return void 0===r?n:n(r)},remove:(e,r)=>{const t=u(e),n=e=>d(t,e,"");return void 0===r?n:n(r)}};w.nil,w.append,w.get,w.set,w.assign,w.unset,w.remove;const E=Symbol("$__value"),S=Symbol("$__href");var C={cons:(e,r)=>Object.freeze({[S]:e,[E]:r}),isReference:e=>e&&void 0!==e[S],href:e=>e[S],value:e=>e[E]};const{resolveUrl:O,jsonTypeOf:A}=c,I=Object.freeze({id:"",pointer:"",instance:void 0,value:void 0}),j=e=>C.isReference(e.value)?C.value(e.value):e.value,T=r(((e,r)=>A(j(e),r))),x=(e,r)=>Object.freeze({...r,pointer:w.append(e,r.pointer),value:j(r)[e]}),P=r(((e,r)=>j(r).map(((t,n,o,a)=>e(x(n,r),n,o,a))))),$=r(((e,r)=>j(r).map(((e,t,n,o)=>x(t,r))).filter(((r,t,n,o)=>e(r,t,n,o))))),D=r(((e,r,t)=>j(t).reduce(((r,n,o)=>e(r,x(o,t),o)),r))),R=r(((e,r)=>j(r).every(((t,n,o,a)=>e(x(n,r),n,o,a))))),N=r(((e,r)=>j(r).some(((t,n,o,a)=>e(x(n,r),n,o,a)))));var _={nil:I,cons:(e,r="")=>Object.freeze({...I,id:O(r,""),instance:e,value:e}),uri:e=>`${e.id}#${encodeURI(e.pointer)}`,value:j,has:(e,r)=>e in j(r),typeOf:T,step:x,entries:e=>Object.keys(j(e)).map((r=>[r,x(r,e)])),keys:e=>Object.keys(j(e)),map:P,filter:$,reduce:D,every:R,some:N,length:e=>j(e).length},F=async e=>Object.entries(await e),k=r((async(e,r)=>(await r).map(e))),U=r((async(e,r,t)=>(await t).reduce((async(r,t)=>e(await r,t)),r))),q=r((async(e,r,t={})=>U((async(r,t)=>await e(t)?r.concat([t]):r),[],r,t))),L=r((async(e,r)=>{const t=await k(e,r);return(await Promise.all(t)).some((e=>e))})),z=r((async(e,r)=>{const t=await k(e,r);return(await Promise.all(t)).every((e=>e))})),H=r(((e,r)=>e.reduce((async(e,r)=>r(await e)),r))),V={entries:F,map:k,filter:q,reduce:U,some:L,every:z,pipeline:H,all:e=>Promise.all(e),allValues:e=>H([F,U((async(e,[r,t])=>(e[r]=await t,e)),{})],e)};V.entries,V.map,V.filter,V.reduce,V.some,V.every,V.pipeline,V.all,V.allValues;var M=fetch,K=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,Z=/^[\u000b\u0020-\u007e\u0080-\u00ff]+$/,J=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,B=/\\([\u000b\u0020-\u00ff])/g,G=/([\\"])/g,W=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,Q=function(e){if(!e)throw new TypeError("argument string is required");var r="object"==typeof e?function(e){var r;"function"==typeof e.getHeader?r=e.getHeader("content-type"):"object"==typeof e.headers&&(r=e.headers&&e.headers["content-type"]);if("string"!=typeof r)throw new TypeError("content-type header is missing from object");return r}(e):e;if("string"!=typeof r)throw new TypeError("argument string is required to be a string");var t=r.indexOf(";"),n=-1!==t?r.substr(0,t).trim():r.trim();if(!W.test(n))throw new TypeError("invalid media type");var o=new X(n.toLowerCase());if(-1!==t){var a,i,s;for(K.lastIndex=t;i=K.exec(r);){if(i.index!==t)throw new TypeError("invalid parameter format");t+=i[0].length,a=i[1].toLowerCase(),'"'===(s=i[2])[0]&&(s=s.substr(1,s.length-2).replace(B,"$1")),o.parameters[a]=s}if(t!==r.length)throw new TypeError("invalid parameter format")}return o}; | ||
/*! | ||
* content-type | ||
* Copyright(c) 2015 Douglas Christopher Wilson | ||
* MIT Licensed | ||
*/function Y(e){var r=String(e);if(J.test(r))return r;if(r.length>0&&!Z.test(r))throw new TypeError("invalid parameter value");return'"'+r.replace(G,"\\$1")+'"'}function X(e){this.parameters=Object.create(null),this.type=e}var ee={format:function(e){if(!e||"object"!=typeof e)throw new TypeError("argument obj is required");var r=e.parameters,t=e.type;if(!t||!W.test(t))throw new TypeError("invalid type");var n=t;if(r&&"object"==typeof r)for(var o,a=Object.keys(r).sort(),i=0;i<a.length;i++){if(o=a[i],!J.test(o))throw new TypeError("invalid parameter name");n+="; "+o+"="+Y(r[o])}return n},parse:Q};const re={};var te={addPlugin:(e,r)=>{re[e]=r},parse:e=>{const r=ee.parse(e.headers.get("content-type")).type;if(!(r in re))throw Error(`${e.url} is not a schema. Found a document with media type: ${r}`);return re[r].parse(e)},getContentType:e=>{for(const r in re)if(re[r].matcher(e))return r;return"application/octet-stream"}};const{jsonTypeOf:ne,resolveUrl:oe,urlFragment:ae,pathRelative:ie}=c,se="https://json-schema.org/draft/2019-09/vocab/core",ce="https://json-schema.org/draft/2020-12/vocab/core",ue={},le={},pe=(e,r)=>{const t=le[e];return ue[t]?.[r]},fe={},de={},he=(e,r="",t="")=>{e=JSON.parse(JSON.stringify(e));const n=oe(r,""),o=oe(e.$schema||t,"");if(!o)throw Error("Couldn't determine schema dialect");if(delete e.$schema,!(o in le))if(!0===e?.$vocabulary?.[se]&&o===ve(e,n,se)[0])le[o]=se;else if(!0===e?.$vocabulary?.[ce]&&o===ve(e,n,ce)[0])le[o]=ce;else if(o===ve(e,n,o)[0])le[o]=o;else{if(!(o in fe))throw Error(`Couldn't determine JSON Schema version for dialect: '${o}'`);{const e=fe[o];!0===e.vocabulary[se]?le[o]=se:!0===e.vocabulary[ce]?le[o]=ce:le[o]=le[e.dialectId]}}const[a,i]=ve(e,n,le[o]);if(!a)throw Error("Couldn't determine an identifier for the schema");const s=pe(o,"baseToken");delete e[s],n&&(de[n]=a);const c=pe(o,"anchorToken");i&&s===c&&(e[c]=c!==s?encodeURI(i):`#${encodeURI(i)}`);const u={},l=pe(o,"recursiveAnchorToken");let p;!0===e[l]&&(u[""]=`${a}#`,e[c]="",delete e[l]);const f=pe(o,"vocabularyToken");ne(e[f],"object")?(p=e[f],delete e[f]):p={[le[o]]:!0};const d={"":""};return fe[a]={id:a,dialectId:o,schema:ye(e,a,o,w.nil,d,u),anchors:d,dynamicAnchors:u,vocabulary:p,validated:!1},a},ve=(e,r,t)=>{const n=ue[t]?.baseToken,o=oe(r,e[n]||"");return[oe(o,""),ae(o)]},ye=(e,r,t,n,o,a)=>{if(ne(e,"object")){const i="string"==typeof e.$schema?oe(e.$schema,""):t,s=pe(i,"embeddedToken"),c=pe(i,"anchorToken");if("string"==typeof e[s]&&(s!==c||"#"!==e[s][0])){const n=oe(r,e[s]);return e[pe(i,"baseToken")]=n,he(e,n,t),C.cons(e[s],e)}const u=pe(t,"anchorToken"),l=pe(t,"dynamicAnchorToken");"string"==typeof e[l]&&(a[e[l]]=`${r}#${encodeURI(n)}`,o[e[l]]=n,delete e[l]);const p=pe(t,"embeddedToken");if("string"==typeof e[u]){const r=u!==p?e[u]:e[u].slice(1);o[r]=n,delete e[u]}const f=pe(t,"jrefToken");if("string"==typeof e[f])return C.cons(e[f],e);for(const i in e)e[i]=ye(e[i],r,t,w.append(i,n),o,a);return e}return Array.isArray(e)?e.map(((e,i)=>ye(e,r,t,w.append(i,n),o,a))):e},me=e=>fe[de[e]]||fe[e],ge=Object.freeze({id:"",dialectId:void 0,vocabulary:{},pointer:w.nil,schema:void 0,value:void 0,anchors:{},dynamicAnchors:{},validated:!0}),be=async(e,r=ge)=>{const t=oe(Se(r),e),n=oe(t,""),o=ae(t);if(!(e=>e in fe||e in de)(n)){const e=await M(n,{headers:{Accept:"application/schema+json"}});if(e.status>=400)throw await e.text(),Error(`Failed to retrieve schema with id: ${n}`);he(await te.parse(e),n)}const a=me(n),i="/"!==o[0]?Ee(a,o):o,s=Object.freeze({...a,pointer:i,value:w.get(i,a.schema)});return we(s)},we=e=>C.isReference(e.value)?be(C.href(e.value),e):e,Ee=(e,r)=>{if(!(r in e.anchors))throw Error(`No such anchor '${encodeURI(e.id)}#${encodeURI(r)}'`);return e.anchors[r]},Se=e=>`${e.id}#${encodeURI(e.pointer)}`,Ce=e=>C.isReference(e.value)?C.value(e.value):e.value,Oe=(e,r)=>{const t=me(r.id),n=Object.freeze({...r,pointer:w.append(e,r.pointer),value:Ce(r)[e],validated:t.validated});return we(n)},Ae=r(((e,r)=>V.pipeline([Ce,V.map((async(t,n)=>e(await Oe(n,r),n))),V.all],r))),Ie={parentId:"",parentDialect:"",includeEmbedded:!0},je=(e,r)=>{if(r.startsWith("file://")){const t=e.slice(7,e.lastIndexOf("/"));return""===e?"":ie(t,r.slice(7))}return r};var Te={setConfig:(e,r,t)=>{ue[e]||(ue[e]={}),ue[e][r]=t},getConfig:pe,add:he,get:be,markValidated:e=>{fe[e].validated=!0},uri:Se,value:Ce,getAnchorPointer:Ee,typeOf:(e,r)=>ne(Ce(e),r),has:(e,r)=>e in Ce(r),step:Oe,keys:e=>Object.keys(Ce(e)),entries:e=>V.pipeline([Ce,Object.keys,V.map((async r=>[r,await Oe(r,e)])),V.all],e),map:Ae,length:e=>Ce(e).length,toSchema:(e,r={})=>{const t={...Ie,...r},n=JSON.parse(JSON.stringify(e.schema,((r,n)=>{if(!C.isReference(n))return n;const o=C.value(n),a="string"==typeof o.$schema?oe(o.$schema,""):e.dialectId,i=pe(a,"embeddedToken");return!t.includeEmbedded&&i in o?void 0:C.value(n)}))),o=pe(e.dialectId,"dynamicAnchorToken");Object.entries(e.dynamicAnchors).forEach((([e,r])=>{const t=ae(r);w.assign(t,n,{[o]:e,...w.get(t,n)})}));const a=pe(e.dialectId,"anchorToken");Object.entries(e.anchors).filter((([e])=>""!==e)).forEach((([e,r])=>{w.assign(r,n,{[a]:e,...w.get(r,n)})}));const i=pe(e.dialectId,"baseToken"),s=je(t.parentId,e.id),c=t.parentDialect===e.dialectId?"":e.dialectId;return{...s&&{[i]:s},...c&&{$schema:c},...n}}};Te.setConfig,Te.getConfig,Te.add,Te.get,Te.markValidated,Te.uri,Te.value,Te.getAnchorPointer,Te.typeOf,Te.has,Te.step,Te.keys,Te.entries,Te.map,Te.length,Te.toSchema;class xe extends Error{constructor(e){super("Invalid Schema"),this.name=this.constructor.name,this.output=e}}var Pe=xe;const{resolveUrl:$e}=c,De="FLAG",Re="BASIC",Ne="DETAILED",_e="VERBOSE";let Fe=Ne,ke=!0;te.addPlugin("application/schema+json",{parse:async e=>await e.json(),matcher:e=>e.endsWith(".schema.json")});const Ue=async e=>{const r={metaData:{}};return{ast:r,schemaUri:await Ze(e,r)}},qe=r((({ast:e,schemaUri:r},t,n=De)=>{if(![De,Re,Ne,_e].includes(n))throw Error(`The '${n}' error format is not supported`);const a=[],i=o.subscribe("result",Le(n,a));return Be(r,t,e,{}),o.unsubscribe(i),a[0]})),Le=(e,r)=>{const t=[];return(n,o)=>{if("result"===n){const{keyword:e,absoluteKeywordLocation:r,instanceLocation:n,valid:a}=o,i={keyword:e,absoluteKeywordLocation:r,instanceLocation:n,valid:a,errors:[]};t.push(i)}else if("result.start"===n)t.push(n);else if("result.end"===n){const n=t.pop();for(;"result.start"!==t[t.length-1];){const r=t.pop(),o=[r];e===Re&&(o.push(...r.errors),delete r.errors),(e===_e||e!==De&&!r.valid)&&n.errors.unshift(...o)}t[t.length-1]=n,r[0]=n}}},ze={},He=e=>ze[e],Ve=e=>e in ze,Me={},Ke={},Ze=async(e,r)=>{if(e=await Je(e),!Ve(`${e.dialectId}#validate`)){const r=await Te.get(e.dialectId);(Te.getConfig(r.id,"mandatoryVocabularies")||[]).forEach((e=>{if(!r.vocabulary[e])throw Error(`Vocabulary '${e}' must be explicitly declared and required`)})),Object.entries(r.vocabulary).forEach((([e,t])=>{if(e in Me)Object.entries(Me[e]).forEach((([e,t])=>{((e,r)=>{ze[e]={collectEvaluatedItems:(e,t,n,o,a)=>r.interpret(e,t,n,o,a)&&new Set,collectEvaluatedProperties:(e,t,n,o,a)=>r.interpret(e,t,n,o,a)&&[],...r}})(`${r.id}#${e}`,t)}));else if(t)throw Error(`Missing required vocabulary: ${e}`)}))}if(ke&&!e.validated){if(Te.markValidated(e.id),!(e.dialectId in Ke)){const r=await Te.get(e.dialectId),t=await Ue(r);Ke[r.id]=qe(t)}const r=_.cons(e.schema,e.id),t=Ke[e.dialectId](r,Fe);if(!t.valid)throw new Pe(t)}return e.id in r.metaData||(r.metaData[e.id]={id:e.id,dynamicAnchors:e.dynamicAnchors,anchors:e.anchors}),He(`${e.dialectId}#validate`).compile(e,r)},Je=async e=>Te.typeOf(e,"string")?Je(await Te.get(Te.value(e),e)):e,Be=(e,r,t,n)=>{const o=Ge(e,t),a=$e(e,"");return He(o).interpret(e,r,t,{...t.metaData[a].dynamicAnchors,...n})},Ge=(e,r)=>{if(!(e in r))throw Error(`No schema found at ${e}`);return r[e][0]};var We={validate:async(e,r,t)=>{const n=await Ue(e),o=(e,r)=>qe(n,_.cons(e),r);return void 0===r?o:o(r,t)},compile:Ue,interpret:qe,setMetaOutputFormat:e=>{Fe=e},setShouldMetaValidate:e=>{ke=e},FLAG:De,BASIC:Re,DETAILED:Ne,VERBOSE:_e,add:(e,r="",t="")=>{const n=Te.add(e,r,t);delete Ke[n]},getKeyword:He,hasKeyword:Ve,defineVocabulary:(e,r)=>{Me[e]=r},compileSchema:Ze,interpretSchema:Be,collectEvaluatedProperties:(e,r,t,n,o)=>{const a=Ge(e,t);return He(a).collectEvaluatedProperties(e,r,t,n,o)},collectEvaluatedItems:(e,r,t,n,o)=>{const a=Ge(e,t);return He(a).collectEvaluatedItems(e,r,t,n,o)},addMediaTypePlugin:te.addPlugin};var Qe={compile:e=>Te.value(e),interpret:()=>!0};var Ye={compile:async(e,r)=>{const t=Te.uri(e);if(!(t in r)){r[t]=!1;const n=Te.value(e);if(!["object","boolean"].includes(typeof n))throw Error(`No schema found at '${Te.uri(e)}'`);r[t]=[`${e.dialectId}#validate`,Te.uri(e),"boolean"==typeof n?n:await V.pipeline([Te.entries,V.map((([r,t])=>[`${e.dialectId}#${r}`,t])),V.filter((([r])=>We.hasKeyword(r)&&r!==`${e.dialectId}#validate`)),V.map((async([t,n])=>{const o=await We.getKeyword(t).compile(n,r,e);return[t,Te.uri(n),o]})),V.all],e)]}return t},interpret:(e,r,t,n)=>{const[a,i,s]=t[e];o.publishSync("result.start");const c="boolean"==typeof s?s:s.every((([e,a,i])=>{o.publishSync("result.start");const s=We.getKeyword(e).interpret(i,r,t,n);return o.publishSync("result",{keyword:e,absoluteKeywordLocation:a,instanceLocation:_.uri(r),valid:s,ast:i}),o.publishSync("result.end"),s}));return o.publishSync("result",{keyword:a,absoluteKeywordLocation:i,instanceLocation:_.uri(r),valid:c,ast:e}),o.publishSync("result.end"),c},collectEvaluatedProperties:(e,r,t,n,o=!1)=>{const a=t[e][2];return"boolean"==typeof a?!!a&&[]:a.filter((([e])=>!o||!e.endsWith("#unevaluatedProperties"))).reduce(((e,[o,,a])=>{const i=e&&We.getKeyword(o).collectEvaluatedProperties(a,r,t,n);return!1!==i&&[...e,...i]}),[])},collectEvaluatedItems:(e,r,t,n,o=!1)=>{const a=t[e][2];return"boolean"==typeof a?!!a&&new Set:a.filter((([e])=>!o||!e.endsWith("#unevaluatedItems"))).reduce(((e,[o,,a])=>{const i=!1!==e&&We.getKeyword(o).collectEvaluatedItems(a,r,t,n);return!1!==i&&new Set([...e,...i])}),new Set)}},Xe={metaData:Qe,validate:Ye},er={Core:We,Schema:Te,Instance:_,Reference:C,Keywords:Xe,InvalidSchemaError:Pe},rr=er.Core,tr=er.Schema,nr=er.Instance,or=er.Reference,ar=er.Keywords,ir=er.InvalidSchemaError;e.Core=rr,e.Instance=nr,e.InvalidSchemaError=ir,e.Keywords=ar,e.Reference=or,e.Schema=tr,e.default=er,Object.defineProperty(e,"__esModule",{value:!0})})); | ||
//# sourceMappingURL=json-schema-core-amd.min.js.map |
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=function(e,r){return function t(){null==r&&(r=e.length);var n=[].slice.call(arguments);return n.length>=r?e.apply(this,n):function(){return t.apply(this,n.concat([].slice.call(arguments)))}}};var r="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function t(e,r){return e(r={exports:{}},r.exports),r.exports}var n=t((function(e,t){var n,o;n="object"==typeof window&&window||r,o={},n.PubSub?(o=n.PubSub,console.warn("PubSub already loaded, using existing version")):(n.PubSub=o,function(e){var r={},t=-1,n="*";function o(e){var r;for(r in e)if(Object.prototype.hasOwnProperty.call(e,r))return!0;return!1}function a(e){return function(){throw e}}function i(e,r,t){try{e(r,t)}catch(e){setTimeout(a(e),0)}}function s(e,r,t){e(r,t)}function c(e,t,n,o){var a,c=r[t],u=o?s:i;if(Object.prototype.hasOwnProperty.call(r,t))for(a in c)Object.prototype.hasOwnProperty.call(c,a)&&u(c[a],e,n)}function u(e,r,t){return function(){var o=String(e),a=o.lastIndexOf(".");for(c(e,e,r,t);-1!==a;)a=(o=o.substr(0,a)).lastIndexOf("."),c(e,o,r,t);c(e,n,r,t)}}function l(e){var t=String(e);return Boolean(Object.prototype.hasOwnProperty.call(r,t)&&o(r[t]))}function p(e){for(var r=String(e),t=l(r)||l(n),o=r.lastIndexOf(".");!t&&-1!==o;)o=(r=r.substr(0,o)).lastIndexOf("."),t=l(r);return t}function f(e,r,t,n){var o=u(e="symbol"==typeof e?e.toString():e,r,n);return!!p(e)&&(!0===t?o():setTimeout(o,0),!0)}e.publish=function(r,t){return f(r,t,!1,e.immediateExceptions)},e.publishSync=function(r,t){return f(r,t,!0,e.immediateExceptions)},e.subscribe=function(e,n){if("function"!=typeof n)return!1;e="symbol"==typeof e?e.toString():e,Object.prototype.hasOwnProperty.call(r,e)||(r[e]={});var o="uid_"+String(++t);return r[e][o]=n,o},e.subscribeAll=function(r){return e.subscribe(n,r)},e.subscribeOnce=function(r,t){var n=e.subscribe(r,(function(){e.unsubscribe(n),t.apply(this,arguments)}));return e},e.clearAllSubscriptions=function(){r={}},e.clearSubscriptions=function(e){var t;for(t in r)Object.prototype.hasOwnProperty.call(r,t)&&0===t.indexOf(e)&&delete r[t]},e.countSubscriptions=function(e){var t,n,o=0;for(t in r)if(Object.prototype.hasOwnProperty.call(r,t)&&0===t.indexOf(e)){for(n in r[t])o++;break}return o},e.getSubscriptions=function(e){var t,n=[];for(t in r)Object.prototype.hasOwnProperty.call(r,t)&&0===t.indexOf(e)&&n.push(t);return n},e.unsubscribe=function(t){var n,o,a,i=function(e){var t;for(t in r)if(Object.prototype.hasOwnProperty.call(r,t)&&0===t.indexOf(e))return!0;return!1},s="string"==typeof t&&(Object.prototype.hasOwnProperty.call(r,t)||i(t)),c=!s&&"string"==typeof t,u="function"==typeof t,l=!1;if(!s){for(n in r)if(Object.prototype.hasOwnProperty.call(r,n)){if(o=r[n],c&&o[t]){delete o[t],l=t;break}if(u)for(a in o)Object.prototype.hasOwnProperty.call(o,a)&&o[a]===t&&(delete o[a],l=!0)}return l}e.clearSubscriptions(t)}}(o)),void 0!==e&&e.exports&&(t=e.exports=o),t.PubSub=o,e.exports=t=o}));n.PubSub;var o,a=t((function(e,r){ | ||
/** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */ | ||
!function(e){function r(){for(var e=arguments.length,r=Array(e),t=0;t<e;t++)r[t]=arguments[t];if(r.length>1){r[0]=r[0].slice(0,-1);for(var n=r.length-1,o=1;o<n;++o)r[o]=r[o].slice(1,-1);return r[n]=r[n].slice(1),r.join("")}return r[0]}function t(e){return"(?:"+e+")"}function n(e){return void 0===e?"undefined":null===e?"null":Object.prototype.toString.call(e).split(" ").pop().split("]").shift().toLowerCase()}function o(e){return e.toUpperCase()}function a(e){return null!=e?e instanceof Array?e:"number"!=typeof e.length||e.split||e.setInterval||e.call?[e]:Array.prototype.slice.call(e):[]}function i(e,r){var t=e;if(r)for(var n in r)t[n]=r[n];return t}function s(e){var n="[A-Za-z]",o="[0-9]",a=r(o,"[A-Fa-f]"),i=t(t("%[EFef]"+a+"%"+a+a+"%"+a+a)+"|"+t("%[89A-Fa-f]"+a+"%"+a+a)+"|"+t("%"+a+a)),s="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",c=r("[\\:\\/\\?\\#\\[\\]\\@]",s),u=e?"[\\uE000-\\uF8FF]":"[]",l=r(n,o,"[\\-\\.\\_\\~]",e?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]");t(n+r(n,o,"[\\+\\-\\.]")+"*"),t(t(i+"|"+r(l,s,"[\\:]"))+"*");var p=t(t("25[0-5]")+"|"+t("2[0-4]"+o)+"|"+t("1"+o+o)+"|"+t("0?[1-9]"+o)+"|0?0?"+o),f=t(p+"\\."+p+"\\."+p+"\\."+p),d=t(a+"{1,4}"),h=t(t(d+"\\:"+d)+"|"+f),v=t(t(d+"\\:")+"{6}"+h),y=t("\\:\\:"+t(d+"\\:")+"{5}"+h),m=t(t(d)+"?\\:\\:"+t(d+"\\:")+"{4}"+h),g=t(t(t(d+"\\:")+"{0,1}"+d)+"?\\:\\:"+t(d+"\\:")+"{3}"+h),b=t(t(t(d+"\\:")+"{0,2}"+d)+"?\\:\\:"+t(d+"\\:")+"{2}"+h),w=t(t(t(d+"\\:")+"{0,3}"+d)+"?\\:\\:"+d+"\\:"+h),E=t(t(t(d+"\\:")+"{0,4}"+d)+"?\\:\\:"+h),S=t(t(t(d+"\\:")+"{0,5}"+d)+"?\\:\\:"+d),C=t(t(t(d+"\\:")+"{0,6}"+d)+"?\\:\\:"),O=t([v,y,m,g,b,w,E,S,C].join("|")),A=t(t(l+"|"+i)+"+");t("[vV]"+a+"+\\."+r(l,s,"[\\:]")+"+"),t(t(i+"|"+r(l,s))+"*");var I=t(i+"|"+r(l,s,"[\\:\\@]"));return t(t(i+"|"+r(l,s,"[\\@]"))+"+"),t(t(I+"|"+r("[\\/\\?]",u))+"*"),{NOT_SCHEME:new RegExp(r("[^]",n,o,"[\\+\\-\\.]"),"g"),NOT_USERINFO:new RegExp(r("[^\\%\\:]",l,s),"g"),NOT_HOST:new RegExp(r("[^\\%\\[\\]\\:]",l,s),"g"),NOT_PATH:new RegExp(r("[^\\%\\/\\:\\@]",l,s),"g"),NOT_PATH_NOSCHEME:new RegExp(r("[^\\%\\/\\@]",l,s),"g"),NOT_QUERY:new RegExp(r("[^\\%]",l,s,"[\\:\\@\\/\\?]",u),"g"),NOT_FRAGMENT:new RegExp(r("[^\\%]",l,s,"[\\:\\@\\/\\?]"),"g"),ESCAPE:new RegExp(r("[^]",l,s),"g"),UNRESERVED:new RegExp(l,"g"),OTHER_CHARS:new RegExp(r("[^\\%]",l,c),"g"),PCT_ENCODED:new RegExp(i,"g"),IPV4ADDRESS:new RegExp("^("+f+")$"),IPV6ADDRESS:new RegExp("^\\[?("+O+")"+t(t("\\%25|\\%(?!"+a+"{2})")+"("+A+")")+"?\\]?$")}}var c=s(!1),u=s(!0),l=function(){function e(e,r){var t=[],n=!0,o=!1,a=void 0;try{for(var i,s=e[Symbol.iterator]();!(n=(i=s.next()).done)&&(t.push(i.value),!r||t.length!==r);n=!0);}catch(e){o=!0,a=e}finally{try{!n&&s.return&&s.return()}finally{if(o)throw a}}return t}return function(r,t){if(Array.isArray(r))return r;if(Symbol.iterator in Object(r))return e(r,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),p=function(e){if(Array.isArray(e)){for(var r=0,t=Array(e.length);r<e.length;r++)t[r]=e[r];return t}return Array.from(e)},f=2147483647,d=36,h=1,v=26,y=38,m=700,g=72,b=128,w="-",E=/^xn--/,S=/[^\0-\x7E]/,C=/[\x2E\u3002\uFF0E\uFF61]/g,O={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},A=d-h,I=Math.floor,j=String.fromCharCode;function T(e){throw new RangeError(O[e])}function x(e,r){for(var t=[],n=e.length;n--;)t[n]=r(e[n]);return t}function $(e,r){var t=e.split("@"),n="";return t.length>1&&(n=t[0]+"@",e=t[1]),n+x((e=e.replace(C,".")).split("."),r).join(".")}function D(e){for(var r=[],t=0,n=e.length;t<n;){var o=e.charCodeAt(t++);if(o>=55296&&o<=56319&&t<n){var a=e.charCodeAt(t++);56320==(64512&a)?r.push(((1023&o)<<10)+(1023&a)+65536):(r.push(o),t--)}else r.push(o)}return r}var P=function(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:d},R=function(e,r){return e+22+75*(e<26)-((0!=r)<<5)},N=function(e,r,t){var n=0;for(e=t?I(e/m):e>>1,e+=I(e/r);e>A*v>>1;n+=d)e=I(e/A);return I(n+(A+1)*e/(e+y))},_=function(e){var r=[],t=e.length,n=0,o=b,a=g,i=e.lastIndexOf(w);i<0&&(i=0);for(var s=0;s<i;++s)e.charCodeAt(s)>=128&&T("not-basic"),r.push(e.charCodeAt(s));for(var c=i>0?i+1:0;c<t;){for(var u=n,l=1,p=d;;p+=d){c>=t&&T("invalid-input");var y=P(e.charCodeAt(c++));(y>=d||y>I((f-n)/l))&&T("overflow"),n+=y*l;var m=p<=a?h:p>=a+v?v:p-a;if(y<m)break;var E=d-m;l>I(f/E)&&T("overflow"),l*=E}var S=r.length+1;a=N(n-u,S,0==u),I(n/S)>f-o&&T("overflow"),o+=I(n/S),n%=S,r.splice(n++,0,o)}return String.fromCodePoint.apply(String,r)},F=function(e){var r=[],t=(e=D(e)).length,n=b,o=0,a=g,i=!0,s=!1,c=void 0;try{for(var u,l=e[Symbol.iterator]();!(i=(u=l.next()).done);i=!0){var p=u.value;p<128&&r.push(j(p))}}catch(e){s=!0,c=e}finally{try{!i&&l.return&&l.return()}finally{if(s)throw c}}var y=r.length,m=y;for(y&&r.push(w);m<t;){var E=f,S=!0,C=!1,O=void 0;try{for(var A,x=e[Symbol.iterator]();!(S=(A=x.next()).done);S=!0){var $=A.value;$>=n&&$<E&&(E=$)}}catch(e){C=!0,O=e}finally{try{!S&&x.return&&x.return()}finally{if(C)throw O}}var P=m+1;E-n>I((f-o)/P)&&T("overflow"),o+=(E-n)*P,n=E;var _=!0,F=!1,k=void 0;try{for(var U,q=e[Symbol.iterator]();!(_=(U=q.next()).done);_=!0){var L=U.value;if(L<n&&++o>f&&T("overflow"),L==n){for(var z=o,H=d;;H+=d){var V=H<=a?h:H>=a+v?v:H-a;if(z<V)break;var K=z-V,M=d-V;r.push(j(R(V+K%M,0))),z=I(K/M)}r.push(j(R(z,0))),a=N(o,P,m==y),o=0,++m}}}catch(e){F=!0,k=e}finally{try{!_&&q.return&&q.return()}finally{if(F)throw k}}++o,++n}return r.join("")},k=function(e){return $(e,(function(e){return E.test(e)?_(e.slice(4).toLowerCase()):e}))},U=function(e){return $(e,(function(e){return S.test(e)?"xn--"+F(e):e}))},q={version:"2.1.0",ucs2:{decode:D,encode:function(e){return String.fromCodePoint.apply(String,p(e))}},decode:_,encode:F,toASCII:U,toUnicode:k},L={};function z(e){var r=e.charCodeAt(0);return r<16?"%0"+r.toString(16).toUpperCase():r<128?"%"+r.toString(16).toUpperCase():r<2048?"%"+(r>>6|192).toString(16).toUpperCase()+"%"+(63&r|128).toString(16).toUpperCase():"%"+(r>>12|224).toString(16).toUpperCase()+"%"+(r>>6&63|128).toString(16).toUpperCase()+"%"+(63&r|128).toString(16).toUpperCase()}function H(e){for(var r="",t=0,n=e.length;t<n;){var o=parseInt(e.substr(t+1,2),16);if(o<128)r+=String.fromCharCode(o),t+=3;else if(o>=194&&o<224){if(n-t>=6){var a=parseInt(e.substr(t+4,2),16);r+=String.fromCharCode((31&o)<<6|63&a)}else r+=e.substr(t,6);t+=6}else if(o>=224){if(n-t>=9){var i=parseInt(e.substr(t+4,2),16),s=parseInt(e.substr(t+7,2),16);r+=String.fromCharCode((15&o)<<12|(63&i)<<6|63&s)}else r+=e.substr(t,9);t+=9}else r+=e.substr(t,3),t+=3}return r}function V(e,r){function t(e){var t=H(e);return t.match(r.UNRESERVED)?t:e}return e.scheme&&(e.scheme=String(e.scheme).replace(r.PCT_ENCODED,t).toLowerCase().replace(r.NOT_SCHEME,"")),void 0!==e.userinfo&&(e.userinfo=String(e.userinfo).replace(r.PCT_ENCODED,t).replace(r.NOT_USERINFO,z).replace(r.PCT_ENCODED,o)),void 0!==e.host&&(e.host=String(e.host).replace(r.PCT_ENCODED,t).toLowerCase().replace(r.NOT_HOST,z).replace(r.PCT_ENCODED,o)),void 0!==e.path&&(e.path=String(e.path).replace(r.PCT_ENCODED,t).replace(e.scheme?r.NOT_PATH:r.NOT_PATH_NOSCHEME,z).replace(r.PCT_ENCODED,o)),void 0!==e.query&&(e.query=String(e.query).replace(r.PCT_ENCODED,t).replace(r.NOT_QUERY,z).replace(r.PCT_ENCODED,o)),void 0!==e.fragment&&(e.fragment=String(e.fragment).replace(r.PCT_ENCODED,t).replace(r.NOT_FRAGMENT,z).replace(r.PCT_ENCODED,o)),e}function K(e){return e.replace(/^0*(.*)/,"$1")||"0"}function M(e,r){var t=e.match(r.IPV4ADDRESS)||[],n=l(t,2)[1];return n?n.split(".").map(K).join("."):e}function Z(e,r){var t=e.match(r.IPV6ADDRESS)||[],n=l(t,3),o=n[1],a=n[2];if(o){for(var i=o.toLowerCase().split("::").reverse(),s=l(i,2),c=s[0],u=s[1],p=u?u.split(":").map(K):[],f=c.split(":").map(K),d=r.IPV4ADDRESS.test(f[f.length-1]),h=d?7:8,v=f.length-h,y=Array(h),m=0;m<h;++m)y[m]=p[m]||f[v+m]||"";d&&(y[h-1]=M(y[h-1],r));var g=y.reduce((function(e,r,t){if(!r||"0"===r){var n=e[e.length-1];n&&n.index+n.length===t?n.length++:e.push({index:t,length:1})}return e}),[]).sort((function(e,r){return r.length-e.length}))[0],b=void 0;if(g&&g.length>1){var w=y.slice(0,g.index),E=y.slice(g.index+g.length);b=w.join(":")+"::"+E.join(":")}else b=y.join(":");return a&&(b+="%"+a),b}return e}var J=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,B=void 0==="".match(/(){0}/)[1];function G(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t={},n=!1!==r.iri?u:c;"suffix"===r.reference&&(e=(r.scheme?r.scheme+":":"")+"//"+e);var o=e.match(J);if(o){B?(t.scheme=o[1],t.userinfo=o[3],t.host=o[4],t.port=parseInt(o[5],10),t.path=o[6]||"",t.query=o[7],t.fragment=o[8],isNaN(t.port)&&(t.port=o[5])):(t.scheme=o[1]||void 0,t.userinfo=-1!==e.indexOf("@")?o[3]:void 0,t.host=-1!==e.indexOf("//")?o[4]:void 0,t.port=parseInt(o[5],10),t.path=o[6]||"",t.query=-1!==e.indexOf("?")?o[7]:void 0,t.fragment=-1!==e.indexOf("#")?o[8]:void 0,isNaN(t.port)&&(t.port=e.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?o[4]:void 0)),t.host&&(t.host=Z(M(t.host,n),n)),void 0!==t.scheme||void 0!==t.userinfo||void 0!==t.host||void 0!==t.port||t.path||void 0!==t.query?void 0===t.scheme?t.reference="relative":void 0===t.fragment?t.reference="absolute":t.reference="uri":t.reference="same-document",r.reference&&"suffix"!==r.reference&&r.reference!==t.reference&&(t.error=t.error||"URI is not a "+r.reference+" reference.");var a=L[(r.scheme||t.scheme||"").toLowerCase()];if(r.unicodeSupport||a&&a.unicodeSupport)V(t,n);else{if(t.host&&(r.domainHost||a&&a.domainHost))try{t.host=q.toASCII(t.host.replace(n.PCT_ENCODED,H).toLowerCase())}catch(e){t.error=t.error||"Host's domain name can not be converted to ASCII via punycode: "+e}V(t,c)}a&&a.parse&&a.parse(t,r)}else t.error=t.error||"URI can not be parsed.";return t}function W(e,r){var t=!1!==r.iri?u:c,n=[];return void 0!==e.userinfo&&(n.push(e.userinfo),n.push("@")),void 0!==e.host&&n.push(Z(M(String(e.host),t),t).replace(t.IPV6ADDRESS,(function(e,r,t){return"["+r+(t?"%25"+t:"")+"]"}))),"number"!=typeof e.port&&"string"!=typeof e.port||(n.push(":"),n.push(String(e.port))),n.length?n.join(""):void 0}var Q=/^\.\.?\//,Y=/^\/\.(\/|$)/,X=/^\/\.\.(\/|$)/,ee=/^\/?(?:.|\n)*?(?=\/|$)/;function re(e){for(var r=[];e.length;)if(e.match(Q))e=e.replace(Q,"");else if(e.match(Y))e=e.replace(Y,"/");else if(e.match(X))e=e.replace(X,"/"),r.pop();else if("."===e||".."===e)e="";else{var t=e.match(ee);if(!t)throw new Error("Unexpected dot segment condition");var n=t[0];e=e.slice(n.length),r.push(n)}return r.join("")}function te(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=r.iri?u:c,n=[],o=L[(r.scheme||e.scheme||"").toLowerCase()];if(o&&o.serialize&&o.serialize(e,r),e.host)if(t.IPV6ADDRESS.test(e.host));else if(r.domainHost||o&&o.domainHost)try{e.host=r.iri?q.toUnicode(e.host):q.toASCII(e.host.replace(t.PCT_ENCODED,H).toLowerCase())}catch(t){e.error=e.error||"Host's domain name can not be converted to "+(r.iri?"Unicode":"ASCII")+" via punycode: "+t}V(e,t),"suffix"!==r.reference&&e.scheme&&(n.push(e.scheme),n.push(":"));var a=W(e,r);if(void 0!==a&&("suffix"!==r.reference&&n.push("//"),n.push(a),e.path&&"/"!==e.path.charAt(0)&&n.push("/")),void 0!==e.path){var i=e.path;r.absolutePath||o&&o.absolutePath||(i=re(i)),void 0===a&&(i=i.replace(/^\/\//,"/%2F")),n.push(i)}return void 0!==e.query&&(n.push("?"),n.push(e.query)),void 0!==e.fragment&&(n.push("#"),n.push(e.fragment)),n.join("")}function ne(e,r){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n={};return arguments[3]||(e=G(te(e,t),t),r=G(te(r,t),t)),!(t=t||{}).tolerant&&r.scheme?(n.scheme=r.scheme,n.userinfo=r.userinfo,n.host=r.host,n.port=r.port,n.path=re(r.path||""),n.query=r.query):(void 0!==r.userinfo||void 0!==r.host||void 0!==r.port?(n.userinfo=r.userinfo,n.host=r.host,n.port=r.port,n.path=re(r.path||""),n.query=r.query):(r.path?("/"===r.path.charAt(0)?n.path=re(r.path):(void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?n.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+r.path:n.path=r.path:n.path="/"+r.path,n.path=re(n.path)),n.query=r.query):(n.path=e.path,void 0!==r.query?n.query=r.query:n.query=e.query),n.userinfo=e.userinfo,n.host=e.host,n.port=e.port),n.scheme=e.scheme),n.fragment=r.fragment,n}function oe(e,r,t){var n=i({scheme:"null"},t);return te(ne(G(e,n),G(r,n),n,!0),n)}function ae(e,r){return"string"==typeof e?e=te(G(e,r),r):"object"===n(e)&&(e=G(te(e,r),r)),e}function ie(e,r,t){return"string"==typeof e?e=te(G(e,t),t):"object"===n(e)&&(e=te(e,t)),"string"==typeof r?r=te(G(r,t),t):"object"===n(r)&&(r=te(r,t)),e===r}function se(e,r){return e&&e.toString().replace(r&&r.iri?u.ESCAPE:c.ESCAPE,z)}function ce(e,r){return e&&e.toString().replace(r&&r.iri?u.PCT_ENCODED:c.PCT_ENCODED,H)}var ue={scheme:"http",domainHost:!0,parse:function(e,r){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e},serialize:function(e,r){var t="https"===String(e.scheme).toLowerCase();return e.port!==(t?443:80)&&""!==e.port||(e.port=void 0),e.path||(e.path="/"),e}},le={scheme:"https",domainHost:ue.domainHost,parse:ue.parse,serialize:ue.serialize};function pe(e){return"boolean"==typeof e.secure?e.secure:"wss"===String(e.scheme).toLowerCase()}var fe={scheme:"ws",domainHost:!0,parse:function(e,r){var t=e;return t.secure=pe(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t},serialize:function(e,r){if(e.port!==(pe(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 t=e.resourceName.split("?"),n=l(t,2),o=n[0],a=n[1];e.path=o&&"/"!==o?o:void 0,e.query=a,e.resourceName=void 0}return e.fragment=void 0,e}},de={scheme:"wss",domainHost:fe.domainHost,parse:fe.parse,serialize:fe.serialize},he={},ve="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",ye="[0-9A-Fa-f]",me=t(t("%[EFef]"+ye+"%"+ye+ye+"%"+ye+ye)+"|"+t("%[89A-Fa-f]"+ye+"%"+ye+ye)+"|"+t("%"+ye+ye)),ge="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]",be=r("[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",'[\\"\\\\]'),we="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]",Ee=new RegExp(ve,"g"),Se=new RegExp(me,"g"),Ce=new RegExp(r("[^]",ge,"[\\.]",'[\\"]',be),"g"),Oe=new RegExp(r("[^]",ve,we),"g"),Ae=Oe;function Ie(e){var r=H(e);return r.match(Ee)?r:e}var je={scheme:"mailto",parse:function(e,r){var t=e,n=t.to=t.path?t.path.split(","):[];if(t.path=void 0,t.query){for(var o=!1,a={},i=t.query.split("&"),s=0,c=i.length;s<c;++s){var u=i[s].split("=");switch(u[0]){case"to":for(var l=u[1].split(","),p=0,f=l.length;p<f;++p)n.push(l[p]);break;case"subject":t.subject=ce(u[1],r);break;case"body":t.body=ce(u[1],r);break;default:o=!0,a[ce(u[0],r)]=ce(u[1],r)}}o&&(t.headers=a)}t.query=void 0;for(var d=0,h=n.length;d<h;++d){var v=n[d].split("@");if(v[0]=ce(v[0]),r.unicodeSupport)v[1]=ce(v[1],r).toLowerCase();else try{v[1]=q.toASCII(ce(v[1],r).toLowerCase())}catch(e){t.error=t.error||"Email address's domain name can not be converted to ASCII via punycode: "+e}n[d]=v.join("@")}return t},serialize:function(e,r){var t=e,n=a(e.to);if(n){for(var i=0,s=n.length;i<s;++i){var c=String(n[i]),u=c.lastIndexOf("@"),l=c.slice(0,u).replace(Se,Ie).replace(Se,o).replace(Ce,z),p=c.slice(u+1);try{p=r.iri?q.toUnicode(p):q.toASCII(ce(p,r).toLowerCase())}catch(e){t.error=t.error||"Email address's domain name can not be converted to "+(r.iri?"Unicode":"ASCII")+" via punycode: "+e}n[i]=l+"@"+p}t.path=n.join(",")}var f=e.headers=e.headers||{};e.subject&&(f.subject=e.subject),e.body&&(f.body=e.body);var d=[];for(var h in f)f[h]!==he[h]&&d.push(h.replace(Se,Ie).replace(Se,o).replace(Oe,z)+"="+f[h].replace(Se,Ie).replace(Se,o).replace(Ae,z));return d.length&&(t.query=d.join("&")),t}},Te=/^([^\:]+)\:(.*)/,xe={scheme:"urn",parse:function(e,r){var t=e.path&&e.path.match(Te),n=e;if(t){var o=r.scheme||n.scheme||"urn",a=t[1].toLowerCase(),i=t[2],s=o+":"+(r.nid||a),c=L[s];n.nid=a,n.nss=i,n.path=void 0,c&&(n=c.parse(n,r))}else n.error=n.error||"URN can not be parsed.";return n},serialize:function(e,r){var t=r.scheme||e.scheme||"urn",n=e.nid,o=t+":"+(r.nid||n),a=L[o];a&&(e=a.serialize(e,r));var i=e,s=e.nss;return i.path=(n||r.nid)+":"+s,i}},$e=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/,De={scheme:"urn:uuid",parse:function(e,r){var t=e;return t.uuid=t.nss,t.nss=void 0,r.tolerant||t.uuid&&t.uuid.match($e)||(t.error=t.error||"UUID is not valid."),t},serialize:function(e,r){var t=e;return t.nss=(e.uuid||"").toLowerCase(),t}};L[ue.scheme]=ue,L[le.scheme]=le,L[fe.scheme]=fe,L[de.scheme]=de,L[je.scheme]=je,L[xe.scheme]=xe,L[De.scheme]=De,e.SCHEMES=L,e.pctEncChar=z,e.pctDecChars=H,e.parse=G,e.removeDotSegments=re,e.serialize=te,e.resolveComponents=ne,e.resolve=oe,e.normalize=ae,e.equal=ie,e.escapeComponent=se,e.unescapeComponent=ce,Object.defineProperty(e,"__esModule",{value:!0})}(r)}));(o=a)&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")&&o.default;const i={null:e=>null===e,boolean:e=>"boolean"==typeof e,object:e=>"object"==typeof e&&!Array.isArray(e)&&null!==e,array:e=>Array.isArray(e),number:e=>"number"==typeof e,integer:e=>Number.isInteger(e),string:e=>"string"==typeof e};var s={jsonTypeOf:(e,r)=>i[r](e),resolveUrl:(e,r)=>{const t=a.resolve(e,r,{iri:!0});if(a.resolve(e,"",{iri:!0})&&"file"===a.parse(t).scheme&&"file"!==a.parse(e).scheme)throw Error(`Can't access file '${t}' resource from network context '${e}'`);return t},urlFragment:e=>a.unescapeComponent(a.parse(e).fragment)||"",pathRelative:(e,r)=>{if(e===r)return"";let t=1;const n=e.length-1,o=r.length-t,a=n<o?n:o;let i=-1,s=0;for(;s<a;s++){const n=e.charCodeAt(s+1);if(n!==r.charCodeAt(t+s))break;47===n&&(i=s)}if(o>a){if(47===r.charCodeAt(t+s))return r.slice(t+s+1);if(0===s)return r.slice(t+s)}n>a&&(47===e.charCodeAt(s+1)?i=s:0===a&&(i=0));let c="";for(s=i+2;s<=e.length;++s)s!==e.length&&47!==e.charCodeAt(s)||(c+=0===c.length?"..":"/..");return t+=i,c.length>0?`${c}${r.slice(t,r.length)}`:(47===r.charCodeAt(t)&&++t,r.slice(t,r.length))}};const c=e=>{if(e.length>0&&"/"!==e[0])throw Error("Invalid JSON Pointer");return e.split("/").slice(1).map(v)},u=(e,r,t,n)=>{if(0===e.length)return t;if(e.length>1){const o=e.shift();return{...r,[o]:u(e,m(r,o,n),t,d(o,n))}}if(Array.isArray(r)){const n=[...r];return n[y(r,e[0])]=t,n}return"object"==typeof r&&null!==r?{...r,[e[0]]:t}:m(r,e[0],n)},l=(e,r,t,n)=>{if(0!==e.length)if(1!==e.length||g(r)){const o=e.shift();l(e,m(r,o,n),t,d(o,n))}else{r[y(r,e[0])]=t}},p=(e,r,t)=>{if(0!=e.length){if(e.length>1){const n=e.shift(),o=m(r,n,t);return{...r,[n]:p(e,o,d(n,t))}}if(Array.isArray(r))return r.filter(((r,t)=>t!=e[0]));if("object"==typeof r&&null!==r){const{[e[0]]:t,...n}=r;return n}return m(r,e[0],t)}},f=(e,r,t)=>{if(0!==e.length)if(e.length>1){const n=e.shift(),o=m(r,n,t);f(e,o,d(n,t))}else Array.isArray(r)?r.splice(e[0],1):"object"==typeof r&&null!==r?delete r[e[0]]:m(r,e[0],t)},d=e(((e,r)=>r+"/"+h(e))),h=e=>e.toString().replace(/~/g,"~0").replace(/\//g,"~1"),v=e=>e.toString().replace(/~1/g,"/").replace(/~0/g,"~"),y=(e,r)=>Array.isArray(e)&&"-"===r?e.length:r,m=(e,r,t="")=>{if(void 0===e)throw TypeError(`Value at '${t}' is undefined and does not have property '${r}'`);if(null===e)throw TypeError(`Value at '${t}' is null and does not have property '${r}'`);if(g(e))throw TypeError(`Value at '${t}' is a ${typeof e} and does not have property '${r}'`);return e[y(e,r)]},g=e=>null===e||"object"!=typeof e;var b={nil:"",append:d,get:(e,r)=>{const t=c(e),n=e=>t.reduce((([e,r],t)=>[m(e,t,r),d(t,r)]),[e,""])[0];return void 0===r?n:n(r)},set:(r,t,n)=>{const o=c(r),a=e(((e,r)=>u(o,e,r,"")));return void 0===t?a:a(t,n)},assign:(r,t,n)=>{const o=c(r),a=e(((e,r)=>l(o,e,r,"")));return void 0===t?a:a(t,n)},unset:(e,r)=>{const t=c(e),n=e=>p(t,e,"");return void 0===r?n:n(r)},remove:(e,r)=>{const t=c(e),n=e=>f(t,e,"");return void 0===r?n:n(r)}};b.nil,b.append,b.get,b.set,b.assign,b.unset,b.remove;const w=Symbol("$__value"),E=Symbol("$__href");var S={cons:(e,r)=>Object.freeze({[E]:e,[w]:r}),isReference:e=>e&&void 0!==e[E],href:e=>e[E],value:e=>e[w]};const{resolveUrl:C,jsonTypeOf:O}=s,A=Object.freeze({id:"",pointer:"",instance:void 0,value:void 0}),I=e=>S.isReference(e.value)?S.value(e.value):e.value,j=e(((e,r)=>O(I(e),r))),T=(e,r)=>Object.freeze({...r,pointer:b.append(e,r.pointer),value:I(r)[e]}),x=e(((e,r)=>I(r).map(((t,n,o,a)=>e(T(n,r),n,o,a))))),$=e(((e,r)=>I(r).map(((e,t,n,o)=>T(t,r))).filter(((r,t,n,o)=>e(r,t,n,o))))),D=e(((e,r,t)=>I(t).reduce(((r,n,o)=>e(r,T(o,t),o)),r))),P=e(((e,r)=>I(r).every(((t,n,o,a)=>e(T(n,r),n,o,a))))),R=e(((e,r)=>I(r).some(((t,n,o,a)=>e(T(n,r),n,o,a)))));var N={nil:A,cons:(e,r="")=>Object.freeze({...A,id:C(r,""),instance:e,value:e}),uri:e=>`${e.id}#${encodeURI(e.pointer)}`,value:I,has:(e,r)=>e in I(r),typeOf:j,step:T,entries:e=>Object.keys(I(e)).map((r=>[r,T(r,e)])),keys:e=>Object.keys(I(e)),map:x,filter:$,reduce:D,every:P,some:R,length:e=>I(e).length},_=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,F=/^[\u000b\u0020-\u007e\u0080-\u00ff]+$/,k=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,U=/\\([\u000b\u0020-\u00ff])/g,q=/([\\"])/g,L=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,z=function(e){if(!e)throw new TypeError("argument string is required");var r="object"==typeof e?function(e){var r;"function"==typeof e.getHeader?r=e.getHeader("content-type"):"object"==typeof e.headers&&(r=e.headers&&e.headers["content-type"]);if("string"!=typeof r)throw new TypeError("content-type header is missing from object");return r}(e):e;if("string"!=typeof r)throw new TypeError("argument string is required to be a string");var t=r.indexOf(";"),n=-1!==t?r.substr(0,t).trim():r.trim();if(!L.test(n))throw new TypeError("invalid media type");var o=new V(n.toLowerCase());if(-1!==t){var a,i,s;for(_.lastIndex=t;i=_.exec(r);){if(i.index!==t)throw new TypeError("invalid parameter format");t+=i[0].length,a=i[1].toLowerCase(),'"'===(s=i[2])[0]&&(s=s.substr(1,s.length-2).replace(U,"$1")),o.parameters[a]=s}if(t!==r.length)throw new TypeError("invalid parameter format")}return o};function H(e){var r=String(e);if(k.test(r))return r;if(r.length>0&&!F.test(r))throw new TypeError("invalid parameter value");return'"'+r.replace(q,"\\$1")+'"'}function V(e){this.parameters=Object.create(null),this.type=e}var K={format:function(e){if(!e||"object"!=typeof e)throw new TypeError("argument obj is required");var r=e.parameters,t=e.type;if(!t||!L.test(t))throw new TypeError("invalid type");var n=t;if(r&&"object"==typeof r)for(var o,a=Object.keys(r).sort(),i=0;i<a.length;i++){if(o=a[i],!k.test(o))throw new TypeError("invalid parameter name");n+="; "+o+"="+H(r[o])}return n},parse:z},M=async e=>Object.entries(await e),Z=e((async(e,r)=>(await r).map(e))),J=e((async(e,r,t)=>(await t).reduce((async(r,t)=>e(await r,t)),r))),B=e((async(e,r,t={})=>J((async(r,t)=>await e(t)?r.concat([t]):r),[],r,t))),G=e((async(e,r)=>{const t=await Z(e,r);return(await Promise.all(t)).some((e=>e))})),W=e((async(e,r)=>{const t=await Z(e,r);return(await Promise.all(t)).every((e=>e))})),Q=e(((e,r)=>e.reduce((async(e,r)=>r(await e)),r))),Y={entries:M,map:Z,filter:B,reduce:J,some:G,every:W,pipeline:Q,all:e=>Promise.all(e),allValues:e=>Q([M,J((async(e,[r,t])=>(e[r]=await t,e)),{})],e)};Y.entries,Y.map,Y.filter,Y.reduce,Y.some,Y.every,Y.pipeline,Y.all,Y.allValues;var X=fetch;const{jsonTypeOf:ee,resolveUrl:re,urlFragment:te,pathRelative:ne}=s,oe="https://json-schema.org/draft/2019-09/vocab/core",ae="https://json-schema.org/draft/2020-12/vocab/core",ie={},se={},ce=(e,r)=>{const t=se[e];return ie[t]?.[r]},ue={},le={},pe=(e,r="",t="")=>{e=JSON.parse(JSON.stringify(e));const n=re(r,""),o=re(e.$schema||t,"");if(!o)throw Error("Couldn't determine schema dialect");if(delete e.$schema,!(o in se))if(!0===e?.$vocabulary?.[oe]&&o===fe(e,n,oe)[0])se[o]=oe;else if(!0===e?.$vocabulary?.[ae]&&o===fe(e,n,ae)[0])se[o]=ae;else if(o===fe(e,n,o)[0])se[o]=o;else{if(!(o in ue))throw Error(`Couldn't determine JSON Schema version for dialect: '${o}'`);{const e=ue[o];!0===e.vocabulary[oe]?se[o]=oe:!0===e.vocabulary[ae]?se[o]=ae:se[o]=se[e.dialectId]}}const[a,i]=fe(e,n,se[o]);if(!a)throw Error("Couldn't determine an identifier for the schema");const s=ce(o,"baseToken");delete e[s],n&&(le[n]=a);const c=ce(o,"anchorToken");i&&s===c&&(e[c]=c!==s?encodeURI(i):`#${encodeURI(i)}`);const u={},l=ce(o,"recursiveAnchorToken");let p;!0===e[l]&&(u[""]=`${a}#`,e[c]="",delete e[l]);const f=ce(o,"vocabularyToken");ee(e[f],"object")?(p=e[f],delete e[f]):p={[se[o]]:!0};const d={"":""};return ue[a]={id:a,dialectId:o,schema:de(e,a,o,b.nil,d,u),anchors:d,dynamicAnchors:u,vocabulary:p,validated:!1},a},fe=(e,r,t)=>{const n=ie[t]?.baseToken,o=re(r,e[n]||"");return[re(o,""),te(o)]},de=(e,r,t,n,o,a)=>{if(ee(e,"object")){const i="string"==typeof e.$schema?re(e.$schema,""):t,s=ce(i,"embeddedToken"),c=ce(i,"anchorToken");if("string"==typeof e[s]&&(s!==c||"#"!==e[s][0])){const n=re(r,e[s]);return e[ce(i,"baseToken")]=n,pe(e,n,t),S.cons(e[s],e)}const u=ce(t,"anchorToken"),l=ce(t,"dynamicAnchorToken");"string"==typeof e[l]&&(a[e[l]]=`${r}#${encodeURI(n)}`,o[e[l]]=n,delete e[l]);const p=ce(t,"embeddedToken");if("string"==typeof e[u]){const r=u!==p?e[u]:e[u].slice(1);o[r]=n,delete e[u]}const f=ce(t,"jrefToken");if("string"==typeof e[f])return S.cons(e[f],e);for(const i in e)e[i]=de(e[i],r,t,b.append(i,n),o,a);return e}return Array.isArray(e)?e.map(((e,i)=>de(e,r,t,b.append(i,n),o,a))):e},he=e=>ue[le[e]]||ue[e],ve=Object.freeze({id:"",dialectId:void 0,vocabulary:{},pointer:b.nil,schema:void 0,value:void 0,anchors:{},dynamicAnchors:{},validated:!0}),ye=async(e,r=ve)=>{const t=re(be(r),e),n=re(t,""),o=te(t);if(!(e=>e in ue||e in le)(n)){const e=await X(n,{headers:{Accept:"application/schema+json"}});if(e.status>=400)throw await e.text(),Error(`Failed to retrieve schema with id: ${n}`);if(e.headers.has("content-type")){const r=K.parse(e.headers.get("content-type")).type;if("application/schema+json"!==r)throw Error(`${n} is not a schema. Found a document with media type: ${r}`)}pe(await e.json(),n)}const a=he(n),i="/"!==o[0]?ge(a,o):o,s=Object.freeze({...a,pointer:i,value:b.get(i,a.schema)});return me(s)},me=e=>S.isReference(e.value)?ye(S.href(e.value),e):e,ge=(e,r)=>{if(!(r in e.anchors))throw Error(`No such anchor '${encodeURI(e.id)}#${encodeURI(r)}'`);return e.anchors[r]},be=e=>`${e.id}#${encodeURI(e.pointer)}`,we=e=>S.isReference(e.value)?S.value(e.value):e.value,Ee=(e,r)=>{const t=he(r.id),n=Object.freeze({...r,pointer:b.append(e,r.pointer),value:we(r)[e],validated:t.validated});return me(n)},Se=e(((e,r)=>Y.pipeline([we,Y.map((async(t,n)=>e(await Ee(n,r),n))),Y.all],r))),Ce={parentId:"",parentDialect:"",includeEmbedded:!0},Oe=(e,r)=>{if(r.startsWith("file://")){const t=e.slice(7,e.lastIndexOf("/"));return""===e?"":ne(t,r.slice(7))}return r};var Ae={setConfig:(e,r,t)=>{ie[e]||(ie[e]={}),ie[e][r]=t},getConfig:ce,add:pe,get:ye,markValidated:e=>{ue[e].validated=!0},uri:be,value:we,getAnchorPointer:ge,typeOf:(e,r)=>ee(we(e),r),has:(e,r)=>e in we(r),step:Ee,keys:e=>Object.keys(we(e)),entries:e=>Y.pipeline([we,Object.keys,Y.map((async r=>[r,await Ee(r,e)])),Y.all],e),map:Se,length:e=>we(e).length,toSchema:(e,r={})=>{const t={...Ce,...r},n=JSON.parse(JSON.stringify(e.schema,((r,n)=>{if(!S.isReference(n))return n;const o=S.value(n),a="string"==typeof o.$schema?re(o.$schema,""):e.dialectId,i=ce(a,"embeddedToken");return!t.includeEmbedded&&i in o?void 0:S.value(n)}))),o=ce(e.dialectId,"dynamicAnchorToken");Object.entries(e.dynamicAnchors).forEach((([e,r])=>{const t=te(r);b.assign(t,n,{[o]:e,...b.get(t,n)})}));const a=ce(e.dialectId,"anchorToken");Object.entries(e.anchors).filter((([e])=>""!==e)).forEach((([e,r])=>{b.assign(r,n,{[a]:e,...b.get(r,n)})}));const i=ce(e.dialectId,"baseToken"),s=Oe(t.parentId,e.id),c=t.parentDialect===e.dialectId?"":e.dialectId;return{...s&&{[i]:s},...c&&{$schema:c},...n}}};Ae.setConfig,Ae.getConfig,Ae.add,Ae.get,Ae.markValidated,Ae.uri,Ae.value,Ae.getAnchorPointer,Ae.typeOf,Ae.has,Ae.step,Ae.keys,Ae.entries,Ae.map,Ae.length,Ae.toSchema;class Ie extends Error{constructor(e){super("Invalid Schema"),this.name=this.constructor.name,this.output=e}}var je=Ie;const{resolveUrl:Te}=s,xe="FLAG",$e="BASIC",De="DETAILED",Pe="VERBOSE";let Re=De,Ne=!0;const _e=async e=>{const r={metaData:{}};return{ast:r,schemaUri:await Ve(e,r)}},Fe=e((({ast:e,schemaUri:r},t,o=xe)=>{if(![xe,$e,De,Pe].includes(o))throw Error(`The '${o}' error format is not supported`);const a=[],i=n.subscribe("result",ke(o,a));return Me(r,t,e,{}),n.unsubscribe(i),a[0]})),ke=(e,r)=>{const t=[];return(n,o)=>{if("result"===n){const{keyword:e,absoluteKeywordLocation:r,instanceLocation:n,valid:a}=o,i={keyword:e,absoluteKeywordLocation:r,instanceLocation:n,valid:a,errors:[]};t.push(i)}else if("result.start"===n)t.push(n);else if("result.end"===n){const n=t.pop();for(;"result.start"!==t[t.length-1];){const r=t.pop(),o=[r];e===$e&&(o.push(...r.errors),delete r.errors),(e===Pe||e!==xe&&!r.valid)&&n.errors.unshift(...o)}t[t.length-1]=n,r[0]=n}}},Ue={},qe=e=>Ue[e],Le=e=>e in Ue,ze={},He={},Ve=async(e,r)=>{if(e=await Ke(e),!Le(`${e.dialectId}#validate`)){const r=await Ae.get(e.dialectId);(Ae.getConfig(r.id,"mandatoryVocabularies")||[]).forEach((e=>{if(!r.vocabulary[e])throw Error(`Vocabulary '${e}' must be explicitly declared and required`)})),Object.entries(r.vocabulary).forEach((([e,t])=>{if(e in ze)Object.entries(ze[e]).forEach((([e,t])=>{((e,r)=>{Ue[e]={collectEvaluatedItems:(e,t,n,o,a)=>r.interpret(e,t,n,o,a)&&new Set,collectEvaluatedProperties:(e,t,n,o,a)=>r.interpret(e,t,n,o,a)&&[],...r}})(`${r.id}#${e}`,t)}));else if(t)throw Error(`Missing required vocabulary: ${e}`)}))}if(Ne&&!e.validated){if(Ae.markValidated(e.id),!(e.dialectId in He)){const r=await Ae.get(e.dialectId),t=await _e(r);He[r.id]=Fe(t)}const r=N.cons(e.schema,e.id),t=He[e.dialectId](r,Re);if(!t.valid)throw new je(t)}return e.id in r.metaData||(r.metaData[e.id]={id:e.id,dynamicAnchors:e.dynamicAnchors,anchors:e.anchors}),qe(`${e.dialectId}#validate`).compile(e,r)},Ke=async e=>Ae.typeOf(e,"string")?Ke(await Ae.get(Ae.value(e),e)):e,Me=(e,r,t,n)=>{const o=Ze(e,t),a=Te(e,"");return qe(o).interpret(e,r,t,{...t.metaData[a].dynamicAnchors,...n})},Ze=(e,r)=>{if(!(e in r))throw Error(`No schema found at ${e}`);return r[e][0]};var Je={validate:async(e,r,t)=>{const n=await _e(e),o=(e,r)=>Fe(n,N.cons(e),r);return void 0===r?o:o(r,t)},compile:_e,interpret:Fe,setMetaOutputFormat:e=>{Re=e},setShouldMetaValidate:e=>{Ne=e},FLAG:xe,BASIC:$e,DETAILED:De,VERBOSE:Pe,add:(e,r="",t="")=>{const n=Ae.add(e,r,t);delete He[n]},getKeyword:qe,hasKeyword:Le,defineVocabulary:(e,r)=>{ze[e]=r},compileSchema:Ve,interpretSchema:Me,collectEvaluatedProperties:(e,r,t,n,o)=>{const a=Ze(e,t);return qe(a).collectEvaluatedProperties(e,r,t,n,o)},collectEvaluatedItems:(e,r,t,n,o)=>{const a=Ze(e,t);return qe(a).collectEvaluatedItems(e,r,t,n,o)}};var Be={compile:e=>Ae.value(e),interpret:()=>!0};var Ge={compile:async(e,r)=>{const t=Ae.uri(e);if(!(t in r)){r[t]=!1;const n=Ae.value(e);if(!["object","boolean"].includes(typeof n))throw Error(`No schema found at '${Ae.uri(e)}'`);r[t]=[`${e.dialectId}#validate`,Ae.uri(e),"boolean"==typeof n?n:await Y.pipeline([Ae.entries,Y.map((([r,t])=>[`${e.dialectId}#${r}`,t])),Y.filter((([r])=>Je.hasKeyword(r)&&r!==`${e.dialectId}#validate`)),Y.map((async([t,n])=>{const o=await Je.getKeyword(t).compile(n,r,e);return[t,Ae.uri(n),o]})),Y.all],e)]}return t},interpret:(e,r,t,o)=>{const[a,i,s]=t[e];n.publishSync("result.start");const c="boolean"==typeof s?s:s.every((([e,a,i])=>{n.publishSync("result.start");const s=Je.getKeyword(e).interpret(i,r,t,o);return n.publishSync("result",{keyword:e,absoluteKeywordLocation:a,instanceLocation:N.uri(r),valid:s,ast:i}),n.publishSync("result.end"),s}));return n.publishSync("result",{keyword:a,absoluteKeywordLocation:i,instanceLocation:N.uri(r),valid:c,ast:e}),n.publishSync("result.end"),c},collectEvaluatedProperties:(e,r,t,n,o=!1)=>{const a=t[e][2];return"boolean"==typeof a?!!a&&[]:a.filter((([e])=>!o||!e.endsWith("#unevaluatedProperties"))).reduce(((e,[o,,a])=>{const i=e&&Je.getKeyword(o).collectEvaluatedProperties(a,r,t,n);return!1!==i&&[...e,...i]}),[])},collectEvaluatedItems:(e,r,t,n,o=!1)=>{const a=t[e][2];return"boolean"==typeof a?!!a&&new Set:a.filter((([e])=>!o||!e.endsWith("#unevaluatedItems"))).reduce(((e,[o,,a])=>{const i=!1!==e&&Je.getKeyword(o).collectEvaluatedItems(a,r,t,n);return!1!==i&&new Set([...e,...i])}),new Set)}},We={metaData:Be,validate:Ge},Qe={Core:Je,Schema:Ae,Instance:N,Reference:S,Keywords:We,InvalidSchemaError:je},Ye=Qe.Core,Xe=Qe.Schema,er=Qe.Instance,rr=Qe.Reference,tr=Qe.Keywords,nr=Qe.InvalidSchemaError;exports.Core=Ye,exports.Instance=er,exports.InvalidSchemaError=nr,exports.Keywords=tr,exports.Reference=rr,exports.Schema=Xe,exports.default=Qe; | ||
!function(e){function r(){for(var e=arguments.length,r=Array(e),t=0;t<e;t++)r[t]=arguments[t];if(r.length>1){r[0]=r[0].slice(0,-1);for(var n=r.length-1,o=1;o<n;++o)r[o]=r[o].slice(1,-1);return r[n]=r[n].slice(1),r.join("")}return r[0]}function t(e){return"(?:"+e+")"}function n(e){return void 0===e?"undefined":null===e?"null":Object.prototype.toString.call(e).split(" ").pop().split("]").shift().toLowerCase()}function o(e){return e.toUpperCase()}function a(e){return null!=e?e instanceof Array?e:"number"!=typeof e.length||e.split||e.setInterval||e.call?[e]:Array.prototype.slice.call(e):[]}function i(e,r){var t=e;if(r)for(var n in r)t[n]=r[n];return t}function s(e){var n="[A-Za-z]",o="[0-9]",a=r(o,"[A-Fa-f]"),i=t(t("%[EFef]"+a+"%"+a+a+"%"+a+a)+"|"+t("%[89A-Fa-f]"+a+"%"+a+a)+"|"+t("%"+a+a)),s="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",c=r("[\\:\\/\\?\\#\\[\\]\\@]",s),u=e?"[\\uE000-\\uF8FF]":"[]",l=r(n,o,"[\\-\\.\\_\\~]",e?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]");t(n+r(n,o,"[\\+\\-\\.]")+"*"),t(t(i+"|"+r(l,s,"[\\:]"))+"*");var p=t(t("25[0-5]")+"|"+t("2[0-4]"+o)+"|"+t("1"+o+o)+"|"+t("0?[1-9]"+o)+"|0?0?"+o),f=t(p+"\\."+p+"\\."+p+"\\."+p),d=t(a+"{1,4}"),h=t(t(d+"\\:"+d)+"|"+f),v=t(t(d+"\\:")+"{6}"+h),y=t("\\:\\:"+t(d+"\\:")+"{5}"+h),m=t(t(d)+"?\\:\\:"+t(d+"\\:")+"{4}"+h),g=t(t(t(d+"\\:")+"{0,1}"+d)+"?\\:\\:"+t(d+"\\:")+"{3}"+h),b=t(t(t(d+"\\:")+"{0,2}"+d)+"?\\:\\:"+t(d+"\\:")+"{2}"+h),w=t(t(t(d+"\\:")+"{0,3}"+d)+"?\\:\\:"+d+"\\:"+h),E=t(t(t(d+"\\:")+"{0,4}"+d)+"?\\:\\:"+h),S=t(t(t(d+"\\:")+"{0,5}"+d)+"?\\:\\:"+d),C=t(t(t(d+"\\:")+"{0,6}"+d)+"?\\:\\:"),O=t([v,y,m,g,b,w,E,S,C].join("|")),A=t(t(l+"|"+i)+"+");t("[vV]"+a+"+\\."+r(l,s,"[\\:]")+"+"),t(t(i+"|"+r(l,s))+"*");var I=t(i+"|"+r(l,s,"[\\:\\@]"));return t(t(i+"|"+r(l,s,"[\\@]"))+"+"),t(t(I+"|"+r("[\\/\\?]",u))+"*"),{NOT_SCHEME:new RegExp(r("[^]",n,o,"[\\+\\-\\.]"),"g"),NOT_USERINFO:new RegExp(r("[^\\%\\:]",l,s),"g"),NOT_HOST:new RegExp(r("[^\\%\\[\\]\\:]",l,s),"g"),NOT_PATH:new RegExp(r("[^\\%\\/\\:\\@]",l,s),"g"),NOT_PATH_NOSCHEME:new RegExp(r("[^\\%\\/\\@]",l,s),"g"),NOT_QUERY:new RegExp(r("[^\\%]",l,s,"[\\:\\@\\/\\?]",u),"g"),NOT_FRAGMENT:new RegExp(r("[^\\%]",l,s,"[\\:\\@\\/\\?]"),"g"),ESCAPE:new RegExp(r("[^]",l,s),"g"),UNRESERVED:new RegExp(l,"g"),OTHER_CHARS:new RegExp(r("[^\\%]",l,c),"g"),PCT_ENCODED:new RegExp(i,"g"),IPV4ADDRESS:new RegExp("^("+f+")$"),IPV6ADDRESS:new RegExp("^\\[?("+O+")"+t(t("\\%25|\\%(?!"+a+"{2})")+"("+A+")")+"?\\]?$")}}var c=s(!1),u=s(!0),l=function(){function e(e,r){var t=[],n=!0,o=!1,a=void 0;try{for(var i,s=e[Symbol.iterator]();!(n=(i=s.next()).done)&&(t.push(i.value),!r||t.length!==r);n=!0);}catch(e){o=!0,a=e}finally{try{!n&&s.return&&s.return()}finally{if(o)throw a}}return t}return function(r,t){if(Array.isArray(r))return r;if(Symbol.iterator in Object(r))return e(r,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),p=function(e){if(Array.isArray(e)){for(var r=0,t=Array(e.length);r<e.length;r++)t[r]=e[r];return t}return Array.from(e)},f=2147483647,d=36,h=1,v=26,y=38,m=700,g=72,b=128,w="-",E=/^xn--/,S=/[^\0-\x7E]/,C=/[\x2E\u3002\uFF0E\uFF61]/g,O={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},A=d-h,I=Math.floor,j=String.fromCharCode;function T(e){throw new RangeError(O[e])}function x(e,r){for(var t=[],n=e.length;n--;)t[n]=r(e[n]);return t}function P(e,r){var t=e.split("@"),n="";return t.length>1&&(n=t[0]+"@",e=t[1]),n+x((e=e.replace(C,".")).split("."),r).join(".")}function $(e){for(var r=[],t=0,n=e.length;t<n;){var o=e.charCodeAt(t++);if(o>=55296&&o<=56319&&t<n){var a=e.charCodeAt(t++);56320==(64512&a)?r.push(((1023&o)<<10)+(1023&a)+65536):(r.push(o),t--)}else r.push(o)}return r}var D=function(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:d},R=function(e,r){return e+22+75*(e<26)-((0!=r)<<5)},N=function(e,r,t){var n=0;for(e=t?I(e/m):e>>1,e+=I(e/r);e>A*v>>1;n+=d)e=I(e/A);return I(n+(A+1)*e/(e+y))},_=function(e){var r=[],t=e.length,n=0,o=b,a=g,i=e.lastIndexOf(w);i<0&&(i=0);for(var s=0;s<i;++s)e.charCodeAt(s)>=128&&T("not-basic"),r.push(e.charCodeAt(s));for(var c=i>0?i+1:0;c<t;){for(var u=n,l=1,p=d;;p+=d){c>=t&&T("invalid-input");var y=D(e.charCodeAt(c++));(y>=d||y>I((f-n)/l))&&T("overflow"),n+=y*l;var m=p<=a?h:p>=a+v?v:p-a;if(y<m)break;var E=d-m;l>I(f/E)&&T("overflow"),l*=E}var S=r.length+1;a=N(n-u,S,0==u),I(n/S)>f-o&&T("overflow"),o+=I(n/S),n%=S,r.splice(n++,0,o)}return String.fromCodePoint.apply(String,r)},F=function(e){var r=[],t=(e=$(e)).length,n=b,o=0,a=g,i=!0,s=!1,c=void 0;try{for(var u,l=e[Symbol.iterator]();!(i=(u=l.next()).done);i=!0){var p=u.value;p<128&&r.push(j(p))}}catch(e){s=!0,c=e}finally{try{!i&&l.return&&l.return()}finally{if(s)throw c}}var y=r.length,m=y;for(y&&r.push(w);m<t;){var E=f,S=!0,C=!1,O=void 0;try{for(var A,x=e[Symbol.iterator]();!(S=(A=x.next()).done);S=!0){var P=A.value;P>=n&&P<E&&(E=P)}}catch(e){C=!0,O=e}finally{try{!S&&x.return&&x.return()}finally{if(C)throw O}}var D=m+1;E-n>I((f-o)/D)&&T("overflow"),o+=(E-n)*D,n=E;var _=!0,F=!1,k=void 0;try{for(var U,q=e[Symbol.iterator]();!(_=(U=q.next()).done);_=!0){var L=U.value;if(L<n&&++o>f&&T("overflow"),L==n){for(var z=o,H=d;;H+=d){var V=H<=a?h:H>=a+v?v:H-a;if(z<V)break;var M=z-V,K=d-V;r.push(j(R(V+M%K,0))),z=I(M/K)}r.push(j(R(z,0))),a=N(o,D,m==y),o=0,++m}}}catch(e){F=!0,k=e}finally{try{!_&&q.return&&q.return()}finally{if(F)throw k}}++o,++n}return r.join("")},k=function(e){return P(e,(function(e){return E.test(e)?_(e.slice(4).toLowerCase()):e}))},U=function(e){return P(e,(function(e){return S.test(e)?"xn--"+F(e):e}))},q={version:"2.1.0",ucs2:{decode:$,encode:function(e){return String.fromCodePoint.apply(String,p(e))}},decode:_,encode:F,toASCII:U,toUnicode:k},L={};function z(e){var r=e.charCodeAt(0);return r<16?"%0"+r.toString(16).toUpperCase():r<128?"%"+r.toString(16).toUpperCase():r<2048?"%"+(r>>6|192).toString(16).toUpperCase()+"%"+(63&r|128).toString(16).toUpperCase():"%"+(r>>12|224).toString(16).toUpperCase()+"%"+(r>>6&63|128).toString(16).toUpperCase()+"%"+(63&r|128).toString(16).toUpperCase()}function H(e){for(var r="",t=0,n=e.length;t<n;){var o=parseInt(e.substr(t+1,2),16);if(o<128)r+=String.fromCharCode(o),t+=3;else if(o>=194&&o<224){if(n-t>=6){var a=parseInt(e.substr(t+4,2),16);r+=String.fromCharCode((31&o)<<6|63&a)}else r+=e.substr(t,6);t+=6}else if(o>=224){if(n-t>=9){var i=parseInt(e.substr(t+4,2),16),s=parseInt(e.substr(t+7,2),16);r+=String.fromCharCode((15&o)<<12|(63&i)<<6|63&s)}else r+=e.substr(t,9);t+=9}else r+=e.substr(t,3),t+=3}return r}function V(e,r){function t(e){var t=H(e);return t.match(r.UNRESERVED)?t:e}return e.scheme&&(e.scheme=String(e.scheme).replace(r.PCT_ENCODED,t).toLowerCase().replace(r.NOT_SCHEME,"")),void 0!==e.userinfo&&(e.userinfo=String(e.userinfo).replace(r.PCT_ENCODED,t).replace(r.NOT_USERINFO,z).replace(r.PCT_ENCODED,o)),void 0!==e.host&&(e.host=String(e.host).replace(r.PCT_ENCODED,t).toLowerCase().replace(r.NOT_HOST,z).replace(r.PCT_ENCODED,o)),void 0!==e.path&&(e.path=String(e.path).replace(r.PCT_ENCODED,t).replace(e.scheme?r.NOT_PATH:r.NOT_PATH_NOSCHEME,z).replace(r.PCT_ENCODED,o)),void 0!==e.query&&(e.query=String(e.query).replace(r.PCT_ENCODED,t).replace(r.NOT_QUERY,z).replace(r.PCT_ENCODED,o)),void 0!==e.fragment&&(e.fragment=String(e.fragment).replace(r.PCT_ENCODED,t).replace(r.NOT_FRAGMENT,z).replace(r.PCT_ENCODED,o)),e}function M(e){return e.replace(/^0*(.*)/,"$1")||"0"}function K(e,r){var t=e.match(r.IPV4ADDRESS)||[],n=l(t,2)[1];return n?n.split(".").map(M).join("."):e}function Z(e,r){var t=e.match(r.IPV6ADDRESS)||[],n=l(t,3),o=n[1],a=n[2];if(o){for(var i=o.toLowerCase().split("::").reverse(),s=l(i,2),c=s[0],u=s[1],p=u?u.split(":").map(M):[],f=c.split(":").map(M),d=r.IPV4ADDRESS.test(f[f.length-1]),h=d?7:8,v=f.length-h,y=Array(h),m=0;m<h;++m)y[m]=p[m]||f[v+m]||"";d&&(y[h-1]=K(y[h-1],r));var g=y.reduce((function(e,r,t){if(!r||"0"===r){var n=e[e.length-1];n&&n.index+n.length===t?n.length++:e.push({index:t,length:1})}return e}),[]).sort((function(e,r){return r.length-e.length}))[0],b=void 0;if(g&&g.length>1){var w=y.slice(0,g.index),E=y.slice(g.index+g.length);b=w.join(":")+"::"+E.join(":")}else b=y.join(":");return a&&(b+="%"+a),b}return e}var J=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,B=void 0==="".match(/(){0}/)[1];function G(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t={},n=!1!==r.iri?u:c;"suffix"===r.reference&&(e=(r.scheme?r.scheme+":":"")+"//"+e);var o=e.match(J);if(o){B?(t.scheme=o[1],t.userinfo=o[3],t.host=o[4],t.port=parseInt(o[5],10),t.path=o[6]||"",t.query=o[7],t.fragment=o[8],isNaN(t.port)&&(t.port=o[5])):(t.scheme=o[1]||void 0,t.userinfo=-1!==e.indexOf("@")?o[3]:void 0,t.host=-1!==e.indexOf("//")?o[4]:void 0,t.port=parseInt(o[5],10),t.path=o[6]||"",t.query=-1!==e.indexOf("?")?o[7]:void 0,t.fragment=-1!==e.indexOf("#")?o[8]:void 0,isNaN(t.port)&&(t.port=e.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?o[4]:void 0)),t.host&&(t.host=Z(K(t.host,n),n)),void 0!==t.scheme||void 0!==t.userinfo||void 0!==t.host||void 0!==t.port||t.path||void 0!==t.query?void 0===t.scheme?t.reference="relative":void 0===t.fragment?t.reference="absolute":t.reference="uri":t.reference="same-document",r.reference&&"suffix"!==r.reference&&r.reference!==t.reference&&(t.error=t.error||"URI is not a "+r.reference+" reference.");var a=L[(r.scheme||t.scheme||"").toLowerCase()];if(r.unicodeSupport||a&&a.unicodeSupport)V(t,n);else{if(t.host&&(r.domainHost||a&&a.domainHost))try{t.host=q.toASCII(t.host.replace(n.PCT_ENCODED,H).toLowerCase())}catch(e){t.error=t.error||"Host's domain name can not be converted to ASCII via punycode: "+e}V(t,c)}a&&a.parse&&a.parse(t,r)}else t.error=t.error||"URI can not be parsed.";return t}function W(e,r){var t=!1!==r.iri?u:c,n=[];return void 0!==e.userinfo&&(n.push(e.userinfo),n.push("@")),void 0!==e.host&&n.push(Z(K(String(e.host),t),t).replace(t.IPV6ADDRESS,(function(e,r,t){return"["+r+(t?"%25"+t:"")+"]"}))),"number"!=typeof e.port&&"string"!=typeof e.port||(n.push(":"),n.push(String(e.port))),n.length?n.join(""):void 0}var Q=/^\.\.?\//,Y=/^\/\.(\/|$)/,X=/^\/\.\.(\/|$)/,ee=/^\/?(?:.|\n)*?(?=\/|$)/;function re(e){for(var r=[];e.length;)if(e.match(Q))e=e.replace(Q,"");else if(e.match(Y))e=e.replace(Y,"/");else if(e.match(X))e=e.replace(X,"/"),r.pop();else if("."===e||".."===e)e="";else{var t=e.match(ee);if(!t)throw new Error("Unexpected dot segment condition");var n=t[0];e=e.slice(n.length),r.push(n)}return r.join("")}function te(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=r.iri?u:c,n=[],o=L[(r.scheme||e.scheme||"").toLowerCase()];if(o&&o.serialize&&o.serialize(e,r),e.host)if(t.IPV6ADDRESS.test(e.host));else if(r.domainHost||o&&o.domainHost)try{e.host=r.iri?q.toUnicode(e.host):q.toASCII(e.host.replace(t.PCT_ENCODED,H).toLowerCase())}catch(t){e.error=e.error||"Host's domain name can not be converted to "+(r.iri?"Unicode":"ASCII")+" via punycode: "+t}V(e,t),"suffix"!==r.reference&&e.scheme&&(n.push(e.scheme),n.push(":"));var a=W(e,r);if(void 0!==a&&("suffix"!==r.reference&&n.push("//"),n.push(a),e.path&&"/"!==e.path.charAt(0)&&n.push("/")),void 0!==e.path){var i=e.path;r.absolutePath||o&&o.absolutePath||(i=re(i)),void 0===a&&(i=i.replace(/^\/\//,"/%2F")),n.push(i)}return void 0!==e.query&&(n.push("?"),n.push(e.query)),void 0!==e.fragment&&(n.push("#"),n.push(e.fragment)),n.join("")}function ne(e,r){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n={};return arguments[3]||(e=G(te(e,t),t),r=G(te(r,t),t)),!(t=t||{}).tolerant&&r.scheme?(n.scheme=r.scheme,n.userinfo=r.userinfo,n.host=r.host,n.port=r.port,n.path=re(r.path||""),n.query=r.query):(void 0!==r.userinfo||void 0!==r.host||void 0!==r.port?(n.userinfo=r.userinfo,n.host=r.host,n.port=r.port,n.path=re(r.path||""),n.query=r.query):(r.path?("/"===r.path.charAt(0)?n.path=re(r.path):(void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?n.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+r.path:n.path=r.path:n.path="/"+r.path,n.path=re(n.path)),n.query=r.query):(n.path=e.path,void 0!==r.query?n.query=r.query:n.query=e.query),n.userinfo=e.userinfo,n.host=e.host,n.port=e.port),n.scheme=e.scheme),n.fragment=r.fragment,n}function oe(e,r,t){var n=i({scheme:"null"},t);return te(ne(G(e,n),G(r,n),n,!0),n)}function ae(e,r){return"string"==typeof e?e=te(G(e,r),r):"object"===n(e)&&(e=G(te(e,r),r)),e}function ie(e,r,t){return"string"==typeof e?e=te(G(e,t),t):"object"===n(e)&&(e=te(e,t)),"string"==typeof r?r=te(G(r,t),t):"object"===n(r)&&(r=te(r,t)),e===r}function se(e,r){return e&&e.toString().replace(r&&r.iri?u.ESCAPE:c.ESCAPE,z)}function ce(e,r){return e&&e.toString().replace(r&&r.iri?u.PCT_ENCODED:c.PCT_ENCODED,H)}var ue={scheme:"http",domainHost:!0,parse:function(e,r){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e},serialize:function(e,r){var t="https"===String(e.scheme).toLowerCase();return e.port!==(t?443:80)&&""!==e.port||(e.port=void 0),e.path||(e.path="/"),e}},le={scheme:"https",domainHost:ue.domainHost,parse:ue.parse,serialize:ue.serialize};function pe(e){return"boolean"==typeof e.secure?e.secure:"wss"===String(e.scheme).toLowerCase()}var fe={scheme:"ws",domainHost:!0,parse:function(e,r){var t=e;return t.secure=pe(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t},serialize:function(e,r){if(e.port!==(pe(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 t=e.resourceName.split("?"),n=l(t,2),o=n[0],a=n[1];e.path=o&&"/"!==o?o:void 0,e.query=a,e.resourceName=void 0}return e.fragment=void 0,e}},de={scheme:"wss",domainHost:fe.domainHost,parse:fe.parse,serialize:fe.serialize},he={},ve="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",ye="[0-9A-Fa-f]",me=t(t("%[EFef]"+ye+"%"+ye+ye+"%"+ye+ye)+"|"+t("%[89A-Fa-f]"+ye+"%"+ye+ye)+"|"+t("%"+ye+ye)),ge="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]",be=r("[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",'[\\"\\\\]'),we="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]",Ee=new RegExp(ve,"g"),Se=new RegExp(me,"g"),Ce=new RegExp(r("[^]",ge,"[\\.]",'[\\"]',be),"g"),Oe=new RegExp(r("[^]",ve,we),"g"),Ae=Oe;function Ie(e){var r=H(e);return r.match(Ee)?r:e}var je={scheme:"mailto",parse:function(e,r){var t=e,n=t.to=t.path?t.path.split(","):[];if(t.path=void 0,t.query){for(var o=!1,a={},i=t.query.split("&"),s=0,c=i.length;s<c;++s){var u=i[s].split("=");switch(u[0]){case"to":for(var l=u[1].split(","),p=0,f=l.length;p<f;++p)n.push(l[p]);break;case"subject":t.subject=ce(u[1],r);break;case"body":t.body=ce(u[1],r);break;default:o=!0,a[ce(u[0],r)]=ce(u[1],r)}}o&&(t.headers=a)}t.query=void 0;for(var d=0,h=n.length;d<h;++d){var v=n[d].split("@");if(v[0]=ce(v[0]),r.unicodeSupport)v[1]=ce(v[1],r).toLowerCase();else try{v[1]=q.toASCII(ce(v[1],r).toLowerCase())}catch(e){t.error=t.error||"Email address's domain name can not be converted to ASCII via punycode: "+e}n[d]=v.join("@")}return t},serialize:function(e,r){var t=e,n=a(e.to);if(n){for(var i=0,s=n.length;i<s;++i){var c=String(n[i]),u=c.lastIndexOf("@"),l=c.slice(0,u).replace(Se,Ie).replace(Se,o).replace(Ce,z),p=c.slice(u+1);try{p=r.iri?q.toUnicode(p):q.toASCII(ce(p,r).toLowerCase())}catch(e){t.error=t.error||"Email address's domain name can not be converted to "+(r.iri?"Unicode":"ASCII")+" via punycode: "+e}n[i]=l+"@"+p}t.path=n.join(",")}var f=e.headers=e.headers||{};e.subject&&(f.subject=e.subject),e.body&&(f.body=e.body);var d=[];for(var h in f)f[h]!==he[h]&&d.push(h.replace(Se,Ie).replace(Se,o).replace(Oe,z)+"="+f[h].replace(Se,Ie).replace(Se,o).replace(Ae,z));return d.length&&(t.query=d.join("&")),t}},Te=/^([^\:]+)\:(.*)/,xe={scheme:"urn",parse:function(e,r){var t=e.path&&e.path.match(Te),n=e;if(t){var o=r.scheme||n.scheme||"urn",a=t[1].toLowerCase(),i=t[2],s=o+":"+(r.nid||a),c=L[s];n.nid=a,n.nss=i,n.path=void 0,c&&(n=c.parse(n,r))}else n.error=n.error||"URN can not be parsed.";return n},serialize:function(e,r){var t=r.scheme||e.scheme||"urn",n=e.nid,o=t+":"+(r.nid||n),a=L[o];a&&(e=a.serialize(e,r));var i=e,s=e.nss;return i.path=(n||r.nid)+":"+s,i}},Pe=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/,$e={scheme:"urn:uuid",parse:function(e,r){var t=e;return t.uuid=t.nss,t.nss=void 0,r.tolerant||t.uuid&&t.uuid.match(Pe)||(t.error=t.error||"UUID is not valid."),t},serialize:function(e,r){var t=e;return t.nss=(e.uuid||"").toLowerCase(),t}};L[ue.scheme]=ue,L[le.scheme]=le,L[fe.scheme]=fe,L[de.scheme]=de,L[je.scheme]=je,L[xe.scheme]=xe,L[$e.scheme]=$e,e.SCHEMES=L,e.pctEncChar=z,e.pctDecChars=H,e.parse=G,e.removeDotSegments=re,e.serialize=te,e.resolveComponents=ne,e.resolve=oe,e.normalize=ae,e.equal=ie,e.escapeComponent=se,e.unescapeComponent=ce,Object.defineProperty(e,"__esModule",{value:!0})}(r)}));(o=a)&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")&&o.default;const i={null:e=>null===e,boolean:e=>"boolean"==typeof e,object:e=>"object"==typeof e&&!Array.isArray(e)&&null!==e,array:e=>Array.isArray(e),number:e=>"number"==typeof e,integer:e=>Number.isInteger(e),string:e=>"string"==typeof e};var s={jsonTypeOf:(e,r)=>i[r](e),resolveUrl:(e,r)=>{const t=a.resolve(e,r,{iri:!0});if(a.resolve(e,"",{iri:!0})&&"file"===a.parse(t).scheme&&"file"!==a.parse(e).scheme)throw Error(`Can't access file '${t}' resource from network context '${e}'`);return t},urlFragment:e=>a.unescapeComponent(a.parse(e).fragment)||"",pathRelative:(e,r)=>{if(e===r)return"";let t=1;const n=e.length-1,o=r.length-t,a=n<o?n:o;let i=-1,s=0;for(;s<a;s++){const n=e.charCodeAt(s+1);if(n!==r.charCodeAt(t+s))break;47===n&&(i=s)}if(o>a){if(47===r.charCodeAt(t+s))return r.slice(t+s+1);if(0===s)return r.slice(t+s)}n>a&&(47===e.charCodeAt(s+1)?i=s:0===a&&(i=0));let c="";for(s=i+2;s<=e.length;++s)s!==e.length&&47!==e.charCodeAt(s)||(c+=0===c.length?"..":"/..");return t+=i,c.length>0?`${c}${r.slice(t,r.length)}`:(47===r.charCodeAt(t)&&++t,r.slice(t,r.length))}};const c=e=>{if(e.length>0&&"/"!==e[0])throw Error("Invalid JSON Pointer");return e.split("/").slice(1).map(v)},u=(e,r,t,n)=>{if(0===e.length)return t;if(e.length>1){const o=e.shift();return{...r,[o]:u(e,m(r,o,n),t,d(o,n))}}if(Array.isArray(r)){const n=[...r];return n[y(r,e[0])]=t,n}return"object"==typeof r&&null!==r?{...r,[e[0]]:t}:m(r,e[0],n)},l=(e,r,t,n)=>{if(0!==e.length)if(1!==e.length||g(r)){const o=e.shift();l(e,m(r,o,n),t,d(o,n))}else{r[y(r,e[0])]=t}},p=(e,r,t)=>{if(0!=e.length){if(e.length>1){const n=e.shift(),o=m(r,n,t);return{...r,[n]:p(e,o,d(n,t))}}if(Array.isArray(r))return r.filter(((r,t)=>t!=e[0]));if("object"==typeof r&&null!==r){const{[e[0]]:t,...n}=r;return n}return m(r,e[0],t)}},f=(e,r,t)=>{if(0!==e.length)if(e.length>1){const n=e.shift(),o=m(r,n,t);f(e,o,d(n,t))}else Array.isArray(r)?r.splice(e[0],1):"object"==typeof r&&null!==r?delete r[e[0]]:m(r,e[0],t)},d=e(((e,r)=>r+"/"+h(e))),h=e=>e.toString().replace(/~/g,"~0").replace(/\//g,"~1"),v=e=>e.toString().replace(/~1/g,"/").replace(/~0/g,"~"),y=(e,r)=>Array.isArray(e)&&"-"===r?e.length:r,m=(e,r,t="")=>{if(void 0===e)throw TypeError(`Value at '${t}' is undefined and does not have property '${r}'`);if(null===e)throw TypeError(`Value at '${t}' is null and does not have property '${r}'`);if(g(e))throw TypeError(`Value at '${t}' is a ${typeof e} and does not have property '${r}'`);return e[y(e,r)]},g=e=>null===e||"object"!=typeof e;var b={nil:"",append:d,get:(e,r)=>{const t=c(e),n=e=>t.reduce((([e,r],t)=>[m(e,t,r),d(t,r)]),[e,""])[0];return void 0===r?n:n(r)},set:(r,t,n)=>{const o=c(r),a=e(((e,r)=>u(o,e,r,"")));return void 0===t?a:a(t,n)},assign:(r,t,n)=>{const o=c(r),a=e(((e,r)=>l(o,e,r,"")));return void 0===t?a:a(t,n)},unset:(e,r)=>{const t=c(e),n=e=>p(t,e,"");return void 0===r?n:n(r)},remove:(e,r)=>{const t=c(e),n=e=>f(t,e,"");return void 0===r?n:n(r)}};b.nil,b.append,b.get,b.set,b.assign,b.unset,b.remove;const w=Symbol("$__value"),E=Symbol("$__href");var S={cons:(e,r)=>Object.freeze({[E]:e,[w]:r}),isReference:e=>e&&void 0!==e[E],href:e=>e[E],value:e=>e[w]};const{resolveUrl:C,jsonTypeOf:O}=s,A=Object.freeze({id:"",pointer:"",instance:void 0,value:void 0}),I=e=>S.isReference(e.value)?S.value(e.value):e.value,j=e(((e,r)=>O(I(e),r))),T=(e,r)=>Object.freeze({...r,pointer:b.append(e,r.pointer),value:I(r)[e]}),x=e(((e,r)=>I(r).map(((t,n,o,a)=>e(T(n,r),n,o,a))))),P=e(((e,r)=>I(r).map(((e,t,n,o)=>T(t,r))).filter(((r,t,n,o)=>e(r,t,n,o))))),$=e(((e,r,t)=>I(t).reduce(((r,n,o)=>e(r,T(o,t),o)),r))),D=e(((e,r)=>I(r).every(((t,n,o,a)=>e(T(n,r),n,o,a))))),R=e(((e,r)=>I(r).some(((t,n,o,a)=>e(T(n,r),n,o,a)))));var N={nil:A,cons:(e,r="")=>Object.freeze({...A,id:C(r,""),instance:e,value:e}),uri:e=>`${e.id}#${encodeURI(e.pointer)}`,value:I,has:(e,r)=>e in I(r),typeOf:j,step:T,entries:e=>Object.keys(I(e)).map((r=>[r,T(r,e)])),keys:e=>Object.keys(I(e)),map:x,filter:P,reduce:$,every:D,some:R,length:e=>I(e).length},_=async e=>Object.entries(await e),F=e((async(e,r)=>(await r).map(e))),k=e((async(e,r,t)=>(await t).reduce((async(r,t)=>e(await r,t)),r))),U=e((async(e,r,t={})=>k((async(r,t)=>await e(t)?r.concat([t]):r),[],r,t))),q=e((async(e,r)=>{const t=await F(e,r);return(await Promise.all(t)).some((e=>e))})),L=e((async(e,r)=>{const t=await F(e,r);return(await Promise.all(t)).every((e=>e))})),z=e(((e,r)=>e.reduce((async(e,r)=>r(await e)),r))),H={entries:_,map:F,filter:U,reduce:k,some:q,every:L,pipeline:z,all:e=>Promise.all(e),allValues:e=>z([_,k((async(e,[r,t])=>(e[r]=await t,e)),{})],e)};H.entries,H.map,H.filter,H.reduce,H.some,H.every,H.pipeline,H.all,H.allValues;var V=fetch,M=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,K=/^[\u000b\u0020-\u007e\u0080-\u00ff]+$/,Z=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,J=/\\([\u000b\u0020-\u00ff])/g,B=/([\\"])/g,G=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,W=function(e){if(!e)throw new TypeError("argument string is required");var r="object"==typeof e?function(e){var r;"function"==typeof e.getHeader?r=e.getHeader("content-type"):"object"==typeof e.headers&&(r=e.headers&&e.headers["content-type"]);if("string"!=typeof r)throw new TypeError("content-type header is missing from object");return r}(e):e;if("string"!=typeof r)throw new TypeError("argument string is required to be a string");var t=r.indexOf(";"),n=-1!==t?r.substr(0,t).trim():r.trim();if(!G.test(n))throw new TypeError("invalid media type");var o=new Y(n.toLowerCase());if(-1!==t){var a,i,s;for(M.lastIndex=t;i=M.exec(r);){if(i.index!==t)throw new TypeError("invalid parameter format");t+=i[0].length,a=i[1].toLowerCase(),'"'===(s=i[2])[0]&&(s=s.substr(1,s.length-2).replace(J,"$1")),o.parameters[a]=s}if(t!==r.length)throw new TypeError("invalid parameter format")}return o}; | ||
/*! | ||
* content-type | ||
* Copyright(c) 2015 Douglas Christopher Wilson | ||
* MIT Licensed | ||
*/function Q(e){var r=String(e);if(Z.test(r))return r;if(r.length>0&&!K.test(r))throw new TypeError("invalid parameter value");return'"'+r.replace(B,"\\$1")+'"'}function Y(e){this.parameters=Object.create(null),this.type=e}var X={format:function(e){if(!e||"object"!=typeof e)throw new TypeError("argument obj is required");var r=e.parameters,t=e.type;if(!t||!G.test(t))throw new TypeError("invalid type");var n=t;if(r&&"object"==typeof r)for(var o,a=Object.keys(r).sort(),i=0;i<a.length;i++){if(o=a[i],!Z.test(o))throw new TypeError("invalid parameter name");n+="; "+o+"="+Q(r[o])}return n},parse:W};const ee={};var re={addPlugin:(e,r)=>{ee[e]=r},parse:e=>{const r=X.parse(e.headers.get("content-type")).type;if(!(r in ee))throw Error(`${e.url} is not a schema. Found a document with media type: ${r}`);return ee[r].parse(e)},getContentType:e=>{for(const r in ee)if(ee[r].matcher(e))return r;return"application/octet-stream"}};const{jsonTypeOf:te,resolveUrl:ne,urlFragment:oe,pathRelative:ae}=s,ie="https://json-schema.org/draft/2019-09/vocab/core",se="https://json-schema.org/draft/2020-12/vocab/core",ce={},ue={},le=(e,r)=>{const t=ue[e];return ce[t]?.[r]},pe={},fe={},de=(e,r="",t="")=>{e=JSON.parse(JSON.stringify(e));const n=ne(r,""),o=ne(e.$schema||t,"");if(!o)throw Error("Couldn't determine schema dialect");if(delete e.$schema,!(o in ue))if(!0===e?.$vocabulary?.[ie]&&o===he(e,n,ie)[0])ue[o]=ie;else if(!0===e?.$vocabulary?.[se]&&o===he(e,n,se)[0])ue[o]=se;else if(o===he(e,n,o)[0])ue[o]=o;else{if(!(o in pe))throw Error(`Couldn't determine JSON Schema version for dialect: '${o}'`);{const e=pe[o];!0===e.vocabulary[ie]?ue[o]=ie:!0===e.vocabulary[se]?ue[o]=se:ue[o]=ue[e.dialectId]}}const[a,i]=he(e,n,ue[o]);if(!a)throw Error("Couldn't determine an identifier for the schema");const s=le(o,"baseToken");delete e[s],n&&(fe[n]=a);const c=le(o,"anchorToken");i&&s===c&&(e[c]=c!==s?encodeURI(i):`#${encodeURI(i)}`);const u={},l=le(o,"recursiveAnchorToken");let p;!0===e[l]&&(u[""]=`${a}#`,e[c]="",delete e[l]);const f=le(o,"vocabularyToken");te(e[f],"object")?(p=e[f],delete e[f]):p={[ue[o]]:!0};const d={"":""};return pe[a]={id:a,dialectId:o,schema:ve(e,a,o,b.nil,d,u),anchors:d,dynamicAnchors:u,vocabulary:p,validated:!1},a},he=(e,r,t)=>{const n=ce[t]?.baseToken,o=ne(r,e[n]||"");return[ne(o,""),oe(o)]},ve=(e,r,t,n,o,a)=>{if(te(e,"object")){const i="string"==typeof e.$schema?ne(e.$schema,""):t,s=le(i,"embeddedToken"),c=le(i,"anchorToken");if("string"==typeof e[s]&&(s!==c||"#"!==e[s][0])){const n=ne(r,e[s]);return e[le(i,"baseToken")]=n,de(e,n,t),S.cons(e[s],e)}const u=le(t,"anchorToken"),l=le(t,"dynamicAnchorToken");"string"==typeof e[l]&&(a[e[l]]=`${r}#${encodeURI(n)}`,o[e[l]]=n,delete e[l]);const p=le(t,"embeddedToken");if("string"==typeof e[u]){const r=u!==p?e[u]:e[u].slice(1);o[r]=n,delete e[u]}const f=le(t,"jrefToken");if("string"==typeof e[f])return S.cons(e[f],e);for(const i in e)e[i]=ve(e[i],r,t,b.append(i,n),o,a);return e}return Array.isArray(e)?e.map(((e,i)=>ve(e,r,t,b.append(i,n),o,a))):e},ye=e=>pe[fe[e]]||pe[e],me=Object.freeze({id:"",dialectId:void 0,vocabulary:{},pointer:b.nil,schema:void 0,value:void 0,anchors:{},dynamicAnchors:{},validated:!0}),ge=async(e,r=me)=>{const t=ne(Ee(r),e),n=ne(t,""),o=oe(t);if(!(e=>e in pe||e in fe)(n)){const e=await V(n,{headers:{Accept:"application/schema+json"}});if(e.status>=400)throw await e.text(),Error(`Failed to retrieve schema with id: ${n}`);de(await re.parse(e),n)}const a=ye(n),i="/"!==o[0]?we(a,o):o,s=Object.freeze({...a,pointer:i,value:b.get(i,a.schema)});return be(s)},be=e=>S.isReference(e.value)?ge(S.href(e.value),e):e,we=(e,r)=>{if(!(r in e.anchors))throw Error(`No such anchor '${encodeURI(e.id)}#${encodeURI(r)}'`);return e.anchors[r]},Ee=e=>`${e.id}#${encodeURI(e.pointer)}`,Se=e=>S.isReference(e.value)?S.value(e.value):e.value,Ce=(e,r)=>{const t=ye(r.id),n=Object.freeze({...r,pointer:b.append(e,r.pointer),value:Se(r)[e],validated:t.validated});return be(n)},Oe=e(((e,r)=>H.pipeline([Se,H.map((async(t,n)=>e(await Ce(n,r),n))),H.all],r))),Ae={parentId:"",parentDialect:"",includeEmbedded:!0},Ie=(e,r)=>{if(r.startsWith("file://")){const t=e.slice(7,e.lastIndexOf("/"));return""===e?"":ae(t,r.slice(7))}return r};var je={setConfig:(e,r,t)=>{ce[e]||(ce[e]={}),ce[e][r]=t},getConfig:le,add:de,get:ge,markValidated:e=>{pe[e].validated=!0},uri:Ee,value:Se,getAnchorPointer:we,typeOf:(e,r)=>te(Se(e),r),has:(e,r)=>e in Se(r),step:Ce,keys:e=>Object.keys(Se(e)),entries:e=>H.pipeline([Se,Object.keys,H.map((async r=>[r,await Ce(r,e)])),H.all],e),map:Oe,length:e=>Se(e).length,toSchema:(e,r={})=>{const t={...Ae,...r},n=JSON.parse(JSON.stringify(e.schema,((r,n)=>{if(!S.isReference(n))return n;const o=S.value(n),a="string"==typeof o.$schema?ne(o.$schema,""):e.dialectId,i=le(a,"embeddedToken");return!t.includeEmbedded&&i in o?void 0:S.value(n)}))),o=le(e.dialectId,"dynamicAnchorToken");Object.entries(e.dynamicAnchors).forEach((([e,r])=>{const t=oe(r);b.assign(t,n,{[o]:e,...b.get(t,n)})}));const a=le(e.dialectId,"anchorToken");Object.entries(e.anchors).filter((([e])=>""!==e)).forEach((([e,r])=>{b.assign(r,n,{[a]:e,...b.get(r,n)})}));const i=le(e.dialectId,"baseToken"),s=Ie(t.parentId,e.id),c=t.parentDialect===e.dialectId?"":e.dialectId;return{...s&&{[i]:s},...c&&{$schema:c},...n}}};je.setConfig,je.getConfig,je.add,je.get,je.markValidated,je.uri,je.value,je.getAnchorPointer,je.typeOf,je.has,je.step,je.keys,je.entries,je.map,je.length,je.toSchema;class Te extends Error{constructor(e){super("Invalid Schema"),this.name=this.constructor.name,this.output=e}}var xe=Te;const{resolveUrl:Pe}=s,$e="FLAG",De="BASIC",Re="DETAILED",Ne="VERBOSE";let _e=Re,Fe=!0;re.addPlugin("application/schema+json",{parse:async e=>await e.json(),matcher:e=>e.endsWith(".schema.json")});const ke=async e=>{const r={metaData:{}};return{ast:r,schemaUri:await Ke(e,r)}},Ue=e((({ast:e,schemaUri:r},t,o=$e)=>{if(![$e,De,Re,Ne].includes(o))throw Error(`The '${o}' error format is not supported`);const a=[],i=n.subscribe("result",qe(o,a));return Je(r,t,e,{}),n.unsubscribe(i),a[0]})),qe=(e,r)=>{const t=[];return(n,o)=>{if("result"===n){const{keyword:e,absoluteKeywordLocation:r,instanceLocation:n,valid:a}=o,i={keyword:e,absoluteKeywordLocation:r,instanceLocation:n,valid:a,errors:[]};t.push(i)}else if("result.start"===n)t.push(n);else if("result.end"===n){const n=t.pop();for(;"result.start"!==t[t.length-1];){const r=t.pop(),o=[r];e===De&&(o.push(...r.errors),delete r.errors),(e===Ne||e!==$e&&!r.valid)&&n.errors.unshift(...o)}t[t.length-1]=n,r[0]=n}}},Le={},ze=e=>Le[e],He=e=>e in Le,Ve={},Me={},Ke=async(e,r)=>{if(e=await Ze(e),!He(`${e.dialectId}#validate`)){const r=await je.get(e.dialectId);(je.getConfig(r.id,"mandatoryVocabularies")||[]).forEach((e=>{if(!r.vocabulary[e])throw Error(`Vocabulary '${e}' must be explicitly declared and required`)})),Object.entries(r.vocabulary).forEach((([e,t])=>{if(e in Ve)Object.entries(Ve[e]).forEach((([e,t])=>{((e,r)=>{Le[e]={collectEvaluatedItems:(e,t,n,o,a)=>r.interpret(e,t,n,o,a)&&new Set,collectEvaluatedProperties:(e,t,n,o,a)=>r.interpret(e,t,n,o,a)&&[],...r}})(`${r.id}#${e}`,t)}));else if(t)throw Error(`Missing required vocabulary: ${e}`)}))}if(Fe&&!e.validated){if(je.markValidated(e.id),!(e.dialectId in Me)){const r=await je.get(e.dialectId),t=await ke(r);Me[r.id]=Ue(t)}const r=N.cons(e.schema,e.id),t=Me[e.dialectId](r,_e);if(!t.valid)throw new xe(t)}return e.id in r.metaData||(r.metaData[e.id]={id:e.id,dynamicAnchors:e.dynamicAnchors,anchors:e.anchors}),ze(`${e.dialectId}#validate`).compile(e,r)},Ze=async e=>je.typeOf(e,"string")?Ze(await je.get(je.value(e),e)):e,Je=(e,r,t,n)=>{const o=Be(e,t),a=Pe(e,"");return ze(o).interpret(e,r,t,{...t.metaData[a].dynamicAnchors,...n})},Be=(e,r)=>{if(!(e in r))throw Error(`No schema found at ${e}`);return r[e][0]};var Ge={validate:async(e,r,t)=>{const n=await ke(e),o=(e,r)=>Ue(n,N.cons(e),r);return void 0===r?o:o(r,t)},compile:ke,interpret:Ue,setMetaOutputFormat:e=>{_e=e},setShouldMetaValidate:e=>{Fe=e},FLAG:$e,BASIC:De,DETAILED:Re,VERBOSE:Ne,add:(e,r="",t="")=>{const n=je.add(e,r,t);delete Me[n]},getKeyword:ze,hasKeyword:He,defineVocabulary:(e,r)=>{Ve[e]=r},compileSchema:Ke,interpretSchema:Je,collectEvaluatedProperties:(e,r,t,n,o)=>{const a=Be(e,t);return ze(a).collectEvaluatedProperties(e,r,t,n,o)},collectEvaluatedItems:(e,r,t,n,o)=>{const a=Be(e,t);return ze(a).collectEvaluatedItems(e,r,t,n,o)},addMediaTypePlugin:re.addPlugin};var We={compile:e=>je.value(e),interpret:()=>!0};var Qe={compile:async(e,r)=>{const t=je.uri(e);if(!(t in r)){r[t]=!1;const n=je.value(e);if(!["object","boolean"].includes(typeof n))throw Error(`No schema found at '${je.uri(e)}'`);r[t]=[`${e.dialectId}#validate`,je.uri(e),"boolean"==typeof n?n:await H.pipeline([je.entries,H.map((([r,t])=>[`${e.dialectId}#${r}`,t])),H.filter((([r])=>Ge.hasKeyword(r)&&r!==`${e.dialectId}#validate`)),H.map((async([t,n])=>{const o=await Ge.getKeyword(t).compile(n,r,e);return[t,je.uri(n),o]})),H.all],e)]}return t},interpret:(e,r,t,o)=>{const[a,i,s]=t[e];n.publishSync("result.start");const c="boolean"==typeof s?s:s.every((([e,a,i])=>{n.publishSync("result.start");const s=Ge.getKeyword(e).interpret(i,r,t,o);return n.publishSync("result",{keyword:e,absoluteKeywordLocation:a,instanceLocation:N.uri(r),valid:s,ast:i}),n.publishSync("result.end"),s}));return n.publishSync("result",{keyword:a,absoluteKeywordLocation:i,instanceLocation:N.uri(r),valid:c,ast:e}),n.publishSync("result.end"),c},collectEvaluatedProperties:(e,r,t,n,o=!1)=>{const a=t[e][2];return"boolean"==typeof a?!!a&&[]:a.filter((([e])=>!o||!e.endsWith("#unevaluatedProperties"))).reduce(((e,[o,,a])=>{const i=e&&Ge.getKeyword(o).collectEvaluatedProperties(a,r,t,n);return!1!==i&&[...e,...i]}),[])},collectEvaluatedItems:(e,r,t,n,o=!1)=>{const a=t[e][2];return"boolean"==typeof a?!!a&&new Set:a.filter((([e])=>!o||!e.endsWith("#unevaluatedItems"))).reduce(((e,[o,,a])=>{const i=!1!==e&&Ge.getKeyword(o).collectEvaluatedItems(a,r,t,n);return!1!==i&&new Set([...e,...i])}),new Set)}},Ye={metaData:We,validate:Qe},Xe={Core:Ge,Schema:je,Instance:N,Reference:S,Keywords:Ye,InvalidSchemaError:xe},er=Xe.Core,rr=Xe.Schema,tr=Xe.Instance,nr=Xe.Reference,or=Xe.Keywords,ar=Xe.InvalidSchemaError;exports.Core=er,exports.Instance=tr,exports.InvalidSchemaError=ar,exports.Keywords=or,exports.Reference=nr,exports.Schema=rr,exports.default=Xe; | ||
//# sourceMappingURL=json-schema-core-cjs.min.js.map |
var e=function(e,r){return function t(){null==r&&(r=e.length);var n=[].slice.call(arguments);return n.length>=r?e.apply(this,n):function(){return t.apply(this,n.concat([].slice.call(arguments)))}}};var r="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function t(e,r){return e(r={exports:{}},r.exports),r.exports}var n=t((function(e,t){var n,o;n="object"==typeof window&&window||r,o={},n.PubSub?(o=n.PubSub,console.warn("PubSub already loaded, using existing version")):(n.PubSub=o,function(e){var r={},t=-1,n="*";function o(e){var r;for(r in e)if(Object.prototype.hasOwnProperty.call(e,r))return!0;return!1}function a(e){return function(){throw e}}function i(e,r,t){try{e(r,t)}catch(e){setTimeout(a(e),0)}}function s(e,r,t){e(r,t)}function c(e,t,n,o){var a,c=r[t],u=o?s:i;if(Object.prototype.hasOwnProperty.call(r,t))for(a in c)Object.prototype.hasOwnProperty.call(c,a)&&u(c[a],e,n)}function u(e,r,t){return function(){var o=String(e),a=o.lastIndexOf(".");for(c(e,e,r,t);-1!==a;)a=(o=o.substr(0,a)).lastIndexOf("."),c(e,o,r,t);c(e,n,r,t)}}function l(e){var t=String(e);return Boolean(Object.prototype.hasOwnProperty.call(r,t)&&o(r[t]))}function p(e){for(var r=String(e),t=l(r)||l(n),o=r.lastIndexOf(".");!t&&-1!==o;)o=(r=r.substr(0,o)).lastIndexOf("."),t=l(r);return t}function f(e,r,t,n){var o=u(e="symbol"==typeof e?e.toString():e,r,n);return!!p(e)&&(!0===t?o():setTimeout(o,0),!0)}e.publish=function(r,t){return f(r,t,!1,e.immediateExceptions)},e.publishSync=function(r,t){return f(r,t,!0,e.immediateExceptions)},e.subscribe=function(e,n){if("function"!=typeof n)return!1;e="symbol"==typeof e?e.toString():e,Object.prototype.hasOwnProperty.call(r,e)||(r[e]={});var o="uid_"+String(++t);return r[e][o]=n,o},e.subscribeAll=function(r){return e.subscribe(n,r)},e.subscribeOnce=function(r,t){var n=e.subscribe(r,(function(){e.unsubscribe(n),t.apply(this,arguments)}));return e},e.clearAllSubscriptions=function(){r={}},e.clearSubscriptions=function(e){var t;for(t in r)Object.prototype.hasOwnProperty.call(r,t)&&0===t.indexOf(e)&&delete r[t]},e.countSubscriptions=function(e){var t,n,o=0;for(t in r)if(Object.prototype.hasOwnProperty.call(r,t)&&0===t.indexOf(e)){for(n in r[t])o++;break}return o},e.getSubscriptions=function(e){var t,n=[];for(t in r)Object.prototype.hasOwnProperty.call(r,t)&&0===t.indexOf(e)&&n.push(t);return n},e.unsubscribe=function(t){var n,o,a,i=function(e){var t;for(t in r)if(Object.prototype.hasOwnProperty.call(r,t)&&0===t.indexOf(e))return!0;return!1},s="string"==typeof t&&(Object.prototype.hasOwnProperty.call(r,t)||i(t)),c=!s&&"string"==typeof t,u="function"==typeof t,l=!1;if(!s){for(n in r)if(Object.prototype.hasOwnProperty.call(r,n)){if(o=r[n],c&&o[t]){delete o[t],l=t;break}if(u)for(a in o)Object.prototype.hasOwnProperty.call(o,a)&&o[a]===t&&(delete o[a],l=!0)}return l}e.clearSubscriptions(t)}}(o)),void 0!==e&&e.exports&&(t=e.exports=o),t.PubSub=o,e.exports=t=o}));n.PubSub;var o,a=t((function(e,r){ | ||
/** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */ | ||
!function(e){function r(){for(var e=arguments.length,r=Array(e),t=0;t<e;t++)r[t]=arguments[t];if(r.length>1){r[0]=r[0].slice(0,-1);for(var n=r.length-1,o=1;o<n;++o)r[o]=r[o].slice(1,-1);return r[n]=r[n].slice(1),r.join("")}return r[0]}function t(e){return"(?:"+e+")"}function n(e){return void 0===e?"undefined":null===e?"null":Object.prototype.toString.call(e).split(" ").pop().split("]").shift().toLowerCase()}function o(e){return e.toUpperCase()}function a(e){return null!=e?e instanceof Array?e:"number"!=typeof e.length||e.split||e.setInterval||e.call?[e]:Array.prototype.slice.call(e):[]}function i(e,r){var t=e;if(r)for(var n in r)t[n]=r[n];return t}function s(e){var n="[A-Za-z]",o="[0-9]",a=r(o,"[A-Fa-f]"),i=t(t("%[EFef]"+a+"%"+a+a+"%"+a+a)+"|"+t("%[89A-Fa-f]"+a+"%"+a+a)+"|"+t("%"+a+a)),s="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",c=r("[\\:\\/\\?\\#\\[\\]\\@]",s),u=e?"[\\uE000-\\uF8FF]":"[]",l=r(n,o,"[\\-\\.\\_\\~]",e?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]");t(n+r(n,o,"[\\+\\-\\.]")+"*"),t(t(i+"|"+r(l,s,"[\\:]"))+"*");var p=t(t("25[0-5]")+"|"+t("2[0-4]"+o)+"|"+t("1"+o+o)+"|"+t("0?[1-9]"+o)+"|0?0?"+o),f=t(p+"\\."+p+"\\."+p+"\\."+p),d=t(a+"{1,4}"),h=t(t(d+"\\:"+d)+"|"+f),v=t(t(d+"\\:")+"{6}"+h),y=t("\\:\\:"+t(d+"\\:")+"{5}"+h),m=t(t(d)+"?\\:\\:"+t(d+"\\:")+"{4}"+h),g=t(t(t(d+"\\:")+"{0,1}"+d)+"?\\:\\:"+t(d+"\\:")+"{3}"+h),b=t(t(t(d+"\\:")+"{0,2}"+d)+"?\\:\\:"+t(d+"\\:")+"{2}"+h),w=t(t(t(d+"\\:")+"{0,3}"+d)+"?\\:\\:"+d+"\\:"+h),E=t(t(t(d+"\\:")+"{0,4}"+d)+"?\\:\\:"+h),S=t(t(t(d+"\\:")+"{0,5}"+d)+"?\\:\\:"+d),C=t(t(t(d+"\\:")+"{0,6}"+d)+"?\\:\\:"),O=t([v,y,m,g,b,w,E,S,C].join("|")),A=t(t(l+"|"+i)+"+");t("[vV]"+a+"+\\."+r(l,s,"[\\:]")+"+"),t(t(i+"|"+r(l,s))+"*");var I=t(i+"|"+r(l,s,"[\\:\\@]"));return t(t(i+"|"+r(l,s,"[\\@]"))+"+"),t(t(I+"|"+r("[\\/\\?]",u))+"*"),{NOT_SCHEME:new RegExp(r("[^]",n,o,"[\\+\\-\\.]"),"g"),NOT_USERINFO:new RegExp(r("[^\\%\\:]",l,s),"g"),NOT_HOST:new RegExp(r("[^\\%\\[\\]\\:]",l,s),"g"),NOT_PATH:new RegExp(r("[^\\%\\/\\:\\@]",l,s),"g"),NOT_PATH_NOSCHEME:new RegExp(r("[^\\%\\/\\@]",l,s),"g"),NOT_QUERY:new RegExp(r("[^\\%]",l,s,"[\\:\\@\\/\\?]",u),"g"),NOT_FRAGMENT:new RegExp(r("[^\\%]",l,s,"[\\:\\@\\/\\?]"),"g"),ESCAPE:new RegExp(r("[^]",l,s),"g"),UNRESERVED:new RegExp(l,"g"),OTHER_CHARS:new RegExp(r("[^\\%]",l,c),"g"),PCT_ENCODED:new RegExp(i,"g"),IPV4ADDRESS:new RegExp("^("+f+")$"),IPV6ADDRESS:new RegExp("^\\[?("+O+")"+t(t("\\%25|\\%(?!"+a+"{2})")+"("+A+")")+"?\\]?$")}}var c=s(!1),u=s(!0),l=function(){function e(e,r){var t=[],n=!0,o=!1,a=void 0;try{for(var i,s=e[Symbol.iterator]();!(n=(i=s.next()).done)&&(t.push(i.value),!r||t.length!==r);n=!0);}catch(e){o=!0,a=e}finally{try{!n&&s.return&&s.return()}finally{if(o)throw a}}return t}return function(r,t){if(Array.isArray(r))return r;if(Symbol.iterator in Object(r))return e(r,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),p=function(e){if(Array.isArray(e)){for(var r=0,t=Array(e.length);r<e.length;r++)t[r]=e[r];return t}return Array.from(e)},f=2147483647,d=36,h=1,v=26,y=38,m=700,g=72,b=128,w="-",E=/^xn--/,S=/[^\0-\x7E]/,C=/[\x2E\u3002\uFF0E\uFF61]/g,O={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},A=d-h,I=Math.floor,j=String.fromCharCode;function T(e){throw new RangeError(O[e])}function x(e,r){for(var t=[],n=e.length;n--;)t[n]=r(e[n]);return t}function $(e,r){var t=e.split("@"),n="";return t.length>1&&(n=t[0]+"@",e=t[1]),n+x((e=e.replace(C,".")).split("."),r).join(".")}function D(e){for(var r=[],t=0,n=e.length;t<n;){var o=e.charCodeAt(t++);if(o>=55296&&o<=56319&&t<n){var a=e.charCodeAt(t++);56320==(64512&a)?r.push(((1023&o)<<10)+(1023&a)+65536):(r.push(o),t--)}else r.push(o)}return r}var P=function(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:d},R=function(e,r){return e+22+75*(e<26)-((0!=r)<<5)},N=function(e,r,t){var n=0;for(e=t?I(e/m):e>>1,e+=I(e/r);e>A*v>>1;n+=d)e=I(e/A);return I(n+(A+1)*e/(e+y))},F=function(e){var r=[],t=e.length,n=0,o=b,a=g,i=e.lastIndexOf(w);i<0&&(i=0);for(var s=0;s<i;++s)e.charCodeAt(s)>=128&&T("not-basic"),r.push(e.charCodeAt(s));for(var c=i>0?i+1:0;c<t;){for(var u=n,l=1,p=d;;p+=d){c>=t&&T("invalid-input");var y=P(e.charCodeAt(c++));(y>=d||y>I((f-n)/l))&&T("overflow"),n+=y*l;var m=p<=a?h:p>=a+v?v:p-a;if(y<m)break;var E=d-m;l>I(f/E)&&T("overflow"),l*=E}var S=r.length+1;a=N(n-u,S,0==u),I(n/S)>f-o&&T("overflow"),o+=I(n/S),n%=S,r.splice(n++,0,o)}return String.fromCodePoint.apply(String,r)},_=function(e){var r=[],t=(e=D(e)).length,n=b,o=0,a=g,i=!0,s=!1,c=void 0;try{for(var u,l=e[Symbol.iterator]();!(i=(u=l.next()).done);i=!0){var p=u.value;p<128&&r.push(j(p))}}catch(e){s=!0,c=e}finally{try{!i&&l.return&&l.return()}finally{if(s)throw c}}var y=r.length,m=y;for(y&&r.push(w);m<t;){var E=f,S=!0,C=!1,O=void 0;try{for(var A,x=e[Symbol.iterator]();!(S=(A=x.next()).done);S=!0){var $=A.value;$>=n&&$<E&&(E=$)}}catch(e){C=!0,O=e}finally{try{!S&&x.return&&x.return()}finally{if(C)throw O}}var P=m+1;E-n>I((f-o)/P)&&T("overflow"),o+=(E-n)*P,n=E;var F=!0,_=!1,k=void 0;try{for(var U,q=e[Symbol.iterator]();!(F=(U=q.next()).done);F=!0){var L=U.value;if(L<n&&++o>f&&T("overflow"),L==n){for(var z=o,H=d;;H+=d){var V=H<=a?h:H>=a+v?v:H-a;if(z<V)break;var K=z-V,M=d-V;r.push(j(R(V+K%M,0))),z=I(K/M)}r.push(j(R(z,0))),a=N(o,P,m==y),o=0,++m}}}catch(e){_=!0,k=e}finally{try{!F&&q.return&&q.return()}finally{if(_)throw k}}++o,++n}return r.join("")},k=function(e){return $(e,(function(e){return E.test(e)?F(e.slice(4).toLowerCase()):e}))},U=function(e){return $(e,(function(e){return S.test(e)?"xn--"+_(e):e}))},q={version:"2.1.0",ucs2:{decode:D,encode:function(e){return String.fromCodePoint.apply(String,p(e))}},decode:F,encode:_,toASCII:U,toUnicode:k},L={};function z(e){var r=e.charCodeAt(0);return r<16?"%0"+r.toString(16).toUpperCase():r<128?"%"+r.toString(16).toUpperCase():r<2048?"%"+(r>>6|192).toString(16).toUpperCase()+"%"+(63&r|128).toString(16).toUpperCase():"%"+(r>>12|224).toString(16).toUpperCase()+"%"+(r>>6&63|128).toString(16).toUpperCase()+"%"+(63&r|128).toString(16).toUpperCase()}function H(e){for(var r="",t=0,n=e.length;t<n;){var o=parseInt(e.substr(t+1,2),16);if(o<128)r+=String.fromCharCode(o),t+=3;else if(o>=194&&o<224){if(n-t>=6){var a=parseInt(e.substr(t+4,2),16);r+=String.fromCharCode((31&o)<<6|63&a)}else r+=e.substr(t,6);t+=6}else if(o>=224){if(n-t>=9){var i=parseInt(e.substr(t+4,2),16),s=parseInt(e.substr(t+7,2),16);r+=String.fromCharCode((15&o)<<12|(63&i)<<6|63&s)}else r+=e.substr(t,9);t+=9}else r+=e.substr(t,3),t+=3}return r}function V(e,r){function t(e){var t=H(e);return t.match(r.UNRESERVED)?t:e}return e.scheme&&(e.scheme=String(e.scheme).replace(r.PCT_ENCODED,t).toLowerCase().replace(r.NOT_SCHEME,"")),void 0!==e.userinfo&&(e.userinfo=String(e.userinfo).replace(r.PCT_ENCODED,t).replace(r.NOT_USERINFO,z).replace(r.PCT_ENCODED,o)),void 0!==e.host&&(e.host=String(e.host).replace(r.PCT_ENCODED,t).toLowerCase().replace(r.NOT_HOST,z).replace(r.PCT_ENCODED,o)),void 0!==e.path&&(e.path=String(e.path).replace(r.PCT_ENCODED,t).replace(e.scheme?r.NOT_PATH:r.NOT_PATH_NOSCHEME,z).replace(r.PCT_ENCODED,o)),void 0!==e.query&&(e.query=String(e.query).replace(r.PCT_ENCODED,t).replace(r.NOT_QUERY,z).replace(r.PCT_ENCODED,o)),void 0!==e.fragment&&(e.fragment=String(e.fragment).replace(r.PCT_ENCODED,t).replace(r.NOT_FRAGMENT,z).replace(r.PCT_ENCODED,o)),e}function K(e){return e.replace(/^0*(.*)/,"$1")||"0"}function M(e,r){var t=e.match(r.IPV4ADDRESS)||[],n=l(t,2)[1];return n?n.split(".").map(K).join("."):e}function Z(e,r){var t=e.match(r.IPV6ADDRESS)||[],n=l(t,3),o=n[1],a=n[2];if(o){for(var i=o.toLowerCase().split("::").reverse(),s=l(i,2),c=s[0],u=s[1],p=u?u.split(":").map(K):[],f=c.split(":").map(K),d=r.IPV4ADDRESS.test(f[f.length-1]),h=d?7:8,v=f.length-h,y=Array(h),m=0;m<h;++m)y[m]=p[m]||f[v+m]||"";d&&(y[h-1]=M(y[h-1],r));var g=y.reduce((function(e,r,t){if(!r||"0"===r){var n=e[e.length-1];n&&n.index+n.length===t?n.length++:e.push({index:t,length:1})}return e}),[]).sort((function(e,r){return r.length-e.length}))[0],b=void 0;if(g&&g.length>1){var w=y.slice(0,g.index),E=y.slice(g.index+g.length);b=w.join(":")+"::"+E.join(":")}else b=y.join(":");return a&&(b+="%"+a),b}return e}var J=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,B=void 0==="".match(/(){0}/)[1];function G(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t={},n=!1!==r.iri?u:c;"suffix"===r.reference&&(e=(r.scheme?r.scheme+":":"")+"//"+e);var o=e.match(J);if(o){B?(t.scheme=o[1],t.userinfo=o[3],t.host=o[4],t.port=parseInt(o[5],10),t.path=o[6]||"",t.query=o[7],t.fragment=o[8],isNaN(t.port)&&(t.port=o[5])):(t.scheme=o[1]||void 0,t.userinfo=-1!==e.indexOf("@")?o[3]:void 0,t.host=-1!==e.indexOf("//")?o[4]:void 0,t.port=parseInt(o[5],10),t.path=o[6]||"",t.query=-1!==e.indexOf("?")?o[7]:void 0,t.fragment=-1!==e.indexOf("#")?o[8]:void 0,isNaN(t.port)&&(t.port=e.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?o[4]:void 0)),t.host&&(t.host=Z(M(t.host,n),n)),void 0!==t.scheme||void 0!==t.userinfo||void 0!==t.host||void 0!==t.port||t.path||void 0!==t.query?void 0===t.scheme?t.reference="relative":void 0===t.fragment?t.reference="absolute":t.reference="uri":t.reference="same-document",r.reference&&"suffix"!==r.reference&&r.reference!==t.reference&&(t.error=t.error||"URI is not a "+r.reference+" reference.");var a=L[(r.scheme||t.scheme||"").toLowerCase()];if(r.unicodeSupport||a&&a.unicodeSupport)V(t,n);else{if(t.host&&(r.domainHost||a&&a.domainHost))try{t.host=q.toASCII(t.host.replace(n.PCT_ENCODED,H).toLowerCase())}catch(e){t.error=t.error||"Host's domain name can not be converted to ASCII via punycode: "+e}V(t,c)}a&&a.parse&&a.parse(t,r)}else t.error=t.error||"URI can not be parsed.";return t}function W(e,r){var t=!1!==r.iri?u:c,n=[];return void 0!==e.userinfo&&(n.push(e.userinfo),n.push("@")),void 0!==e.host&&n.push(Z(M(String(e.host),t),t).replace(t.IPV6ADDRESS,(function(e,r,t){return"["+r+(t?"%25"+t:"")+"]"}))),"number"!=typeof e.port&&"string"!=typeof e.port||(n.push(":"),n.push(String(e.port))),n.length?n.join(""):void 0}var Q=/^\.\.?\//,Y=/^\/\.(\/|$)/,X=/^\/\.\.(\/|$)/,ee=/^\/?(?:.|\n)*?(?=\/|$)/;function re(e){for(var r=[];e.length;)if(e.match(Q))e=e.replace(Q,"");else if(e.match(Y))e=e.replace(Y,"/");else if(e.match(X))e=e.replace(X,"/"),r.pop();else if("."===e||".."===e)e="";else{var t=e.match(ee);if(!t)throw new Error("Unexpected dot segment condition");var n=t[0];e=e.slice(n.length),r.push(n)}return r.join("")}function te(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=r.iri?u:c,n=[],o=L[(r.scheme||e.scheme||"").toLowerCase()];if(o&&o.serialize&&o.serialize(e,r),e.host)if(t.IPV6ADDRESS.test(e.host));else if(r.domainHost||o&&o.domainHost)try{e.host=r.iri?q.toUnicode(e.host):q.toASCII(e.host.replace(t.PCT_ENCODED,H).toLowerCase())}catch(t){e.error=e.error||"Host's domain name can not be converted to "+(r.iri?"Unicode":"ASCII")+" via punycode: "+t}V(e,t),"suffix"!==r.reference&&e.scheme&&(n.push(e.scheme),n.push(":"));var a=W(e,r);if(void 0!==a&&("suffix"!==r.reference&&n.push("//"),n.push(a),e.path&&"/"!==e.path.charAt(0)&&n.push("/")),void 0!==e.path){var i=e.path;r.absolutePath||o&&o.absolutePath||(i=re(i)),void 0===a&&(i=i.replace(/^\/\//,"/%2F")),n.push(i)}return void 0!==e.query&&(n.push("?"),n.push(e.query)),void 0!==e.fragment&&(n.push("#"),n.push(e.fragment)),n.join("")}function ne(e,r){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n={};return arguments[3]||(e=G(te(e,t),t),r=G(te(r,t),t)),!(t=t||{}).tolerant&&r.scheme?(n.scheme=r.scheme,n.userinfo=r.userinfo,n.host=r.host,n.port=r.port,n.path=re(r.path||""),n.query=r.query):(void 0!==r.userinfo||void 0!==r.host||void 0!==r.port?(n.userinfo=r.userinfo,n.host=r.host,n.port=r.port,n.path=re(r.path||""),n.query=r.query):(r.path?("/"===r.path.charAt(0)?n.path=re(r.path):(void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?n.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+r.path:n.path=r.path:n.path="/"+r.path,n.path=re(n.path)),n.query=r.query):(n.path=e.path,void 0!==r.query?n.query=r.query:n.query=e.query),n.userinfo=e.userinfo,n.host=e.host,n.port=e.port),n.scheme=e.scheme),n.fragment=r.fragment,n}function oe(e,r,t){var n=i({scheme:"null"},t);return te(ne(G(e,n),G(r,n),n,!0),n)}function ae(e,r){return"string"==typeof e?e=te(G(e,r),r):"object"===n(e)&&(e=G(te(e,r),r)),e}function ie(e,r,t){return"string"==typeof e?e=te(G(e,t),t):"object"===n(e)&&(e=te(e,t)),"string"==typeof r?r=te(G(r,t),t):"object"===n(r)&&(r=te(r,t)),e===r}function se(e,r){return e&&e.toString().replace(r&&r.iri?u.ESCAPE:c.ESCAPE,z)}function ce(e,r){return e&&e.toString().replace(r&&r.iri?u.PCT_ENCODED:c.PCT_ENCODED,H)}var ue={scheme:"http",domainHost:!0,parse:function(e,r){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e},serialize:function(e,r){var t="https"===String(e.scheme).toLowerCase();return e.port!==(t?443:80)&&""!==e.port||(e.port=void 0),e.path||(e.path="/"),e}},le={scheme:"https",domainHost:ue.domainHost,parse:ue.parse,serialize:ue.serialize};function pe(e){return"boolean"==typeof e.secure?e.secure:"wss"===String(e.scheme).toLowerCase()}var fe={scheme:"ws",domainHost:!0,parse:function(e,r){var t=e;return t.secure=pe(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t},serialize:function(e,r){if(e.port!==(pe(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 t=e.resourceName.split("?"),n=l(t,2),o=n[0],a=n[1];e.path=o&&"/"!==o?o:void 0,e.query=a,e.resourceName=void 0}return e.fragment=void 0,e}},de={scheme:"wss",domainHost:fe.domainHost,parse:fe.parse,serialize:fe.serialize},he={},ve="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",ye="[0-9A-Fa-f]",me=t(t("%[EFef]"+ye+"%"+ye+ye+"%"+ye+ye)+"|"+t("%[89A-Fa-f]"+ye+"%"+ye+ye)+"|"+t("%"+ye+ye)),ge="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]",be=r("[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",'[\\"\\\\]'),we="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]",Ee=new RegExp(ve,"g"),Se=new RegExp(me,"g"),Ce=new RegExp(r("[^]",ge,"[\\.]",'[\\"]',be),"g"),Oe=new RegExp(r("[^]",ve,we),"g"),Ae=Oe;function Ie(e){var r=H(e);return r.match(Ee)?r:e}var je={scheme:"mailto",parse:function(e,r){var t=e,n=t.to=t.path?t.path.split(","):[];if(t.path=void 0,t.query){for(var o=!1,a={},i=t.query.split("&"),s=0,c=i.length;s<c;++s){var u=i[s].split("=");switch(u[0]){case"to":for(var l=u[1].split(","),p=0,f=l.length;p<f;++p)n.push(l[p]);break;case"subject":t.subject=ce(u[1],r);break;case"body":t.body=ce(u[1],r);break;default:o=!0,a[ce(u[0],r)]=ce(u[1],r)}}o&&(t.headers=a)}t.query=void 0;for(var d=0,h=n.length;d<h;++d){var v=n[d].split("@");if(v[0]=ce(v[0]),r.unicodeSupport)v[1]=ce(v[1],r).toLowerCase();else try{v[1]=q.toASCII(ce(v[1],r).toLowerCase())}catch(e){t.error=t.error||"Email address's domain name can not be converted to ASCII via punycode: "+e}n[d]=v.join("@")}return t},serialize:function(e,r){var t=e,n=a(e.to);if(n){for(var i=0,s=n.length;i<s;++i){var c=String(n[i]),u=c.lastIndexOf("@"),l=c.slice(0,u).replace(Se,Ie).replace(Se,o).replace(Ce,z),p=c.slice(u+1);try{p=r.iri?q.toUnicode(p):q.toASCII(ce(p,r).toLowerCase())}catch(e){t.error=t.error||"Email address's domain name can not be converted to "+(r.iri?"Unicode":"ASCII")+" via punycode: "+e}n[i]=l+"@"+p}t.path=n.join(",")}var f=e.headers=e.headers||{};e.subject&&(f.subject=e.subject),e.body&&(f.body=e.body);var d=[];for(var h in f)f[h]!==he[h]&&d.push(h.replace(Se,Ie).replace(Se,o).replace(Oe,z)+"="+f[h].replace(Se,Ie).replace(Se,o).replace(Ae,z));return d.length&&(t.query=d.join("&")),t}},Te=/^([^\:]+)\:(.*)/,xe={scheme:"urn",parse:function(e,r){var t=e.path&&e.path.match(Te),n=e;if(t){var o=r.scheme||n.scheme||"urn",a=t[1].toLowerCase(),i=t[2],s=o+":"+(r.nid||a),c=L[s];n.nid=a,n.nss=i,n.path=void 0,c&&(n=c.parse(n,r))}else n.error=n.error||"URN can not be parsed.";return n},serialize:function(e,r){var t=r.scheme||e.scheme||"urn",n=e.nid,o=t+":"+(r.nid||n),a=L[o];a&&(e=a.serialize(e,r));var i=e,s=e.nss;return i.path=(n||r.nid)+":"+s,i}},$e=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/,De={scheme:"urn:uuid",parse:function(e,r){var t=e;return t.uuid=t.nss,t.nss=void 0,r.tolerant||t.uuid&&t.uuid.match($e)||(t.error=t.error||"UUID is not valid."),t},serialize:function(e,r){var t=e;return t.nss=(e.uuid||"").toLowerCase(),t}};L[ue.scheme]=ue,L[le.scheme]=le,L[fe.scheme]=fe,L[de.scheme]=de,L[je.scheme]=je,L[xe.scheme]=xe,L[De.scheme]=De,e.SCHEMES=L,e.pctEncChar=z,e.pctDecChars=H,e.parse=G,e.removeDotSegments=re,e.serialize=te,e.resolveComponents=ne,e.resolve=oe,e.normalize=ae,e.equal=ie,e.escapeComponent=se,e.unescapeComponent=ce,Object.defineProperty(e,"__esModule",{value:!0})}(r)}));(o=a)&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")&&o.default;const i={null:e=>null===e,boolean:e=>"boolean"==typeof e,object:e=>"object"==typeof e&&!Array.isArray(e)&&null!==e,array:e=>Array.isArray(e),number:e=>"number"==typeof e,integer:e=>Number.isInteger(e),string:e=>"string"==typeof e};var s={jsonTypeOf:(e,r)=>i[r](e),resolveUrl:(e,r)=>{const t=a.resolve(e,r,{iri:!0});if(a.resolve(e,"",{iri:!0})&&"file"===a.parse(t).scheme&&"file"!==a.parse(e).scheme)throw Error(`Can't access file '${t}' resource from network context '${e}'`);return t},urlFragment:e=>a.unescapeComponent(a.parse(e).fragment)||"",pathRelative:(e,r)=>{if(e===r)return"";let t=1;const n=e.length-1,o=r.length-t,a=n<o?n:o;let i=-1,s=0;for(;s<a;s++){const n=e.charCodeAt(s+1);if(n!==r.charCodeAt(t+s))break;47===n&&(i=s)}if(o>a){if(47===r.charCodeAt(t+s))return r.slice(t+s+1);if(0===s)return r.slice(t+s)}n>a&&(47===e.charCodeAt(s+1)?i=s:0===a&&(i=0));let c="";for(s=i+2;s<=e.length;++s)s!==e.length&&47!==e.charCodeAt(s)||(c+=0===c.length?"..":"/..");return t+=i,c.length>0?`${c}${r.slice(t,r.length)}`:(47===r.charCodeAt(t)&&++t,r.slice(t,r.length))}};const c=e=>{if(e.length>0&&"/"!==e[0])throw Error("Invalid JSON Pointer");return e.split("/").slice(1).map(v)},u=(e,r,t,n)=>{if(0===e.length)return t;if(e.length>1){const o=e.shift();return{...r,[o]:u(e,m(r,o,n),t,d(o,n))}}if(Array.isArray(r)){const n=[...r];return n[y(r,e[0])]=t,n}return"object"==typeof r&&null!==r?{...r,[e[0]]:t}:m(r,e[0],n)},l=(e,r,t,n)=>{if(0!==e.length)if(1!==e.length||g(r)){const o=e.shift();l(e,m(r,o,n),t,d(o,n))}else{r[y(r,e[0])]=t}},p=(e,r,t)=>{if(0!=e.length){if(e.length>1){const n=e.shift(),o=m(r,n,t);return{...r,[n]:p(e,o,d(n,t))}}if(Array.isArray(r))return r.filter(((r,t)=>t!=e[0]));if("object"==typeof r&&null!==r){const{[e[0]]:t,...n}=r;return n}return m(r,e[0],t)}},f=(e,r,t)=>{if(0!==e.length)if(e.length>1){const n=e.shift(),o=m(r,n,t);f(e,o,d(n,t))}else Array.isArray(r)?r.splice(e[0],1):"object"==typeof r&&null!==r?delete r[e[0]]:m(r,e[0],t)},d=e(((e,r)=>r+"/"+h(e))),h=e=>e.toString().replace(/~/g,"~0").replace(/\//g,"~1"),v=e=>e.toString().replace(/~1/g,"/").replace(/~0/g,"~"),y=(e,r)=>Array.isArray(e)&&"-"===r?e.length:r,m=(e,r,t="")=>{if(void 0===e)throw TypeError(`Value at '${t}' is undefined and does not have property '${r}'`);if(null===e)throw TypeError(`Value at '${t}' is null and does not have property '${r}'`);if(g(e))throw TypeError(`Value at '${t}' is a ${typeof e} and does not have property '${r}'`);return e[y(e,r)]},g=e=>null===e||"object"!=typeof e;var b={nil:"",append:d,get:(e,r)=>{const t=c(e),n=e=>t.reduce((([e,r],t)=>[m(e,t,r),d(t,r)]),[e,""])[0];return void 0===r?n:n(r)},set:(r,t,n)=>{const o=c(r),a=e(((e,r)=>u(o,e,r,"")));return void 0===t?a:a(t,n)},assign:(r,t,n)=>{const o=c(r),a=e(((e,r)=>l(o,e,r,"")));return void 0===t?a:a(t,n)},unset:(e,r)=>{const t=c(e),n=e=>p(t,e,"");return void 0===r?n:n(r)},remove:(e,r)=>{const t=c(e),n=e=>f(t,e,"");return void 0===r?n:n(r)}};b.nil,b.append,b.get,b.set,b.assign,b.unset,b.remove;const w=Symbol("$__value"),E=Symbol("$__href");var S={cons:(e,r)=>Object.freeze({[E]:e,[w]:r}),isReference:e=>e&&void 0!==e[E],href:e=>e[E],value:e=>e[w]};const{resolveUrl:C,jsonTypeOf:O}=s,A=Object.freeze({id:"",pointer:"",instance:void 0,value:void 0}),I=e=>S.isReference(e.value)?S.value(e.value):e.value,j=e(((e,r)=>O(I(e),r))),T=(e,r)=>Object.freeze({...r,pointer:b.append(e,r.pointer),value:I(r)[e]}),x=e(((e,r)=>I(r).map(((t,n,o,a)=>e(T(n,r),n,o,a))))),$=e(((e,r)=>I(r).map(((e,t,n,o)=>T(t,r))).filter(((r,t,n,o)=>e(r,t,n,o))))),D=e(((e,r,t)=>I(t).reduce(((r,n,o)=>e(r,T(o,t),o)),r))),P=e(((e,r)=>I(r).every(((t,n,o,a)=>e(T(n,r),n,o,a))))),R=e(((e,r)=>I(r).some(((t,n,o,a)=>e(T(n,r),n,o,a)))));var N={nil:A,cons:(e,r="")=>Object.freeze({...A,id:C(r,""),instance:e,value:e}),uri:e=>`${e.id}#${encodeURI(e.pointer)}`,value:I,has:(e,r)=>e in I(r),typeOf:j,step:T,entries:e=>Object.keys(I(e)).map((r=>[r,T(r,e)])),keys:e=>Object.keys(I(e)),map:x,filter:$,reduce:D,every:P,some:R,length:e=>I(e).length},F=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,_=/^[\u000b\u0020-\u007e\u0080-\u00ff]+$/,k=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,U=/\\([\u000b\u0020-\u00ff])/g,q=/([\\"])/g,L=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,z=function(e){if(!e)throw new TypeError("argument string is required");var r="object"==typeof e?function(e){var r;"function"==typeof e.getHeader?r=e.getHeader("content-type"):"object"==typeof e.headers&&(r=e.headers&&e.headers["content-type"]);if("string"!=typeof r)throw new TypeError("content-type header is missing from object");return r}(e):e;if("string"!=typeof r)throw new TypeError("argument string is required to be a string");var t=r.indexOf(";"),n=-1!==t?r.substr(0,t).trim():r.trim();if(!L.test(n))throw new TypeError("invalid media type");var o=new V(n.toLowerCase());if(-1!==t){var a,i,s;for(F.lastIndex=t;i=F.exec(r);){if(i.index!==t)throw new TypeError("invalid parameter format");t+=i[0].length,a=i[1].toLowerCase(),'"'===(s=i[2])[0]&&(s=s.substr(1,s.length-2).replace(U,"$1")),o.parameters[a]=s}if(t!==r.length)throw new TypeError("invalid parameter format")}return o};function H(e){var r=String(e);if(k.test(r))return r;if(r.length>0&&!_.test(r))throw new TypeError("invalid parameter value");return'"'+r.replace(q,"\\$1")+'"'}function V(e){this.parameters=Object.create(null),this.type=e}var K={format:function(e){if(!e||"object"!=typeof e)throw new TypeError("argument obj is required");var r=e.parameters,t=e.type;if(!t||!L.test(t))throw new TypeError("invalid type");var n=t;if(r&&"object"==typeof r)for(var o,a=Object.keys(r).sort(),i=0;i<a.length;i++){if(o=a[i],!k.test(o))throw new TypeError("invalid parameter name");n+="; "+o+"="+H(r[o])}return n},parse:z},M=async e=>Object.entries(await e),Z=e((async(e,r)=>(await r).map(e))),J=e((async(e,r,t)=>(await t).reduce((async(r,t)=>e(await r,t)),r))),B=e((async(e,r,t={})=>J((async(r,t)=>await e(t)?r.concat([t]):r),[],r,t))),G=e((async(e,r)=>{const t=await Z(e,r);return(await Promise.all(t)).some((e=>e))})),W=e((async(e,r)=>{const t=await Z(e,r);return(await Promise.all(t)).every((e=>e))})),Q=e(((e,r)=>e.reduce((async(e,r)=>r(await e)),r))),Y={entries:M,map:Z,filter:B,reduce:J,some:G,every:W,pipeline:Q,all:e=>Promise.all(e),allValues:e=>Q([M,J((async(e,[r,t])=>(e[r]=await t,e)),{})],e)};Y.entries,Y.map,Y.filter,Y.reduce,Y.some,Y.every,Y.pipeline,Y.all,Y.allValues;var X=fetch;const{jsonTypeOf:ee,resolveUrl:re,urlFragment:te,pathRelative:ne}=s,oe="https://json-schema.org/draft/2019-09/vocab/core",ae="https://json-schema.org/draft/2020-12/vocab/core",ie={},se={},ce=(e,r)=>{const t=se[e];return ie[t]?.[r]},ue={},le={},pe=(e,r="",t="")=>{e=JSON.parse(JSON.stringify(e));const n=re(r,""),o=re(e.$schema||t,"");if(!o)throw Error("Couldn't determine schema dialect");if(delete e.$schema,!(o in se))if(!0===e?.$vocabulary?.[oe]&&o===fe(e,n,oe)[0])se[o]=oe;else if(!0===e?.$vocabulary?.[ae]&&o===fe(e,n,ae)[0])se[o]=ae;else if(o===fe(e,n,o)[0])se[o]=o;else{if(!(o in ue))throw Error(`Couldn't determine JSON Schema version for dialect: '${o}'`);{const e=ue[o];!0===e.vocabulary[oe]?se[o]=oe:!0===e.vocabulary[ae]?se[o]=ae:se[o]=se[e.dialectId]}}const[a,i]=fe(e,n,se[o]);if(!a)throw Error("Couldn't determine an identifier for the schema");const s=ce(o,"baseToken");delete e[s],n&&(le[n]=a);const c=ce(o,"anchorToken");i&&s===c&&(e[c]=c!==s?encodeURI(i):`#${encodeURI(i)}`);const u={},l=ce(o,"recursiveAnchorToken");let p;!0===e[l]&&(u[""]=`${a}#`,e[c]="",delete e[l]);const f=ce(o,"vocabularyToken");ee(e[f],"object")?(p=e[f],delete e[f]):p={[se[o]]:!0};const d={"":""};return ue[a]={id:a,dialectId:o,schema:de(e,a,o,b.nil,d,u),anchors:d,dynamicAnchors:u,vocabulary:p,validated:!1},a},fe=(e,r,t)=>{const n=ie[t]?.baseToken,o=re(r,e[n]||"");return[re(o,""),te(o)]},de=(e,r,t,n,o,a)=>{if(ee(e,"object")){const i="string"==typeof e.$schema?re(e.$schema,""):t,s=ce(i,"embeddedToken"),c=ce(i,"anchorToken");if("string"==typeof e[s]&&(s!==c||"#"!==e[s][0])){const n=re(r,e[s]);return e[ce(i,"baseToken")]=n,pe(e,n,t),S.cons(e[s],e)}const u=ce(t,"anchorToken"),l=ce(t,"dynamicAnchorToken");"string"==typeof e[l]&&(a[e[l]]=`${r}#${encodeURI(n)}`,o[e[l]]=n,delete e[l]);const p=ce(t,"embeddedToken");if("string"==typeof e[u]){const r=u!==p?e[u]:e[u].slice(1);o[r]=n,delete e[u]}const f=ce(t,"jrefToken");if("string"==typeof e[f])return S.cons(e[f],e);for(const i in e)e[i]=de(e[i],r,t,b.append(i,n),o,a);return e}return Array.isArray(e)?e.map(((e,i)=>de(e,r,t,b.append(i,n),o,a))):e},he=e=>ue[le[e]]||ue[e],ve=Object.freeze({id:"",dialectId:void 0,vocabulary:{},pointer:b.nil,schema:void 0,value:void 0,anchors:{},dynamicAnchors:{},validated:!0}),ye=async(e,r=ve)=>{const t=re(be(r),e),n=re(t,""),o=te(t);if(!(e=>e in ue||e in le)(n)){const e=await X(n,{headers:{Accept:"application/schema+json"}});if(e.status>=400)throw await e.text(),Error(`Failed to retrieve schema with id: ${n}`);if(e.headers.has("content-type")){const r=K.parse(e.headers.get("content-type")).type;if("application/schema+json"!==r)throw Error(`${n} is not a schema. Found a document with media type: ${r}`)}pe(await e.json(),n)}const a=he(n),i="/"!==o[0]?ge(a,o):o,s=Object.freeze({...a,pointer:i,value:b.get(i,a.schema)});return me(s)},me=e=>S.isReference(e.value)?ye(S.href(e.value),e):e,ge=(e,r)=>{if(!(r in e.anchors))throw Error(`No such anchor '${encodeURI(e.id)}#${encodeURI(r)}'`);return e.anchors[r]},be=e=>`${e.id}#${encodeURI(e.pointer)}`,we=e=>S.isReference(e.value)?S.value(e.value):e.value,Ee=(e,r)=>{const t=he(r.id),n=Object.freeze({...r,pointer:b.append(e,r.pointer),value:we(r)[e],validated:t.validated});return me(n)},Se=e(((e,r)=>Y.pipeline([we,Y.map((async(t,n)=>e(await Ee(n,r),n))),Y.all],r))),Ce={parentId:"",parentDialect:"",includeEmbedded:!0},Oe=(e,r)=>{if(r.startsWith("file://")){const t=e.slice(7,e.lastIndexOf("/"));return""===e?"":ne(t,r.slice(7))}return r};var Ae={setConfig:(e,r,t)=>{ie[e]||(ie[e]={}),ie[e][r]=t},getConfig:ce,add:pe,get:ye,markValidated:e=>{ue[e].validated=!0},uri:be,value:we,getAnchorPointer:ge,typeOf:(e,r)=>ee(we(e),r),has:(e,r)=>e in we(r),step:Ee,keys:e=>Object.keys(we(e)),entries:e=>Y.pipeline([we,Object.keys,Y.map((async r=>[r,await Ee(r,e)])),Y.all],e),map:Se,length:e=>we(e).length,toSchema:(e,r={})=>{const t={...Ce,...r},n=JSON.parse(JSON.stringify(e.schema,((r,n)=>{if(!S.isReference(n))return n;const o=S.value(n),a="string"==typeof o.$schema?re(o.$schema,""):e.dialectId,i=ce(a,"embeddedToken");return!t.includeEmbedded&&i in o?void 0:S.value(n)}))),o=ce(e.dialectId,"dynamicAnchorToken");Object.entries(e.dynamicAnchors).forEach((([e,r])=>{const t=te(r);b.assign(t,n,{[o]:e,...b.get(t,n)})}));const a=ce(e.dialectId,"anchorToken");Object.entries(e.anchors).filter((([e])=>""!==e)).forEach((([e,r])=>{b.assign(r,n,{[a]:e,...b.get(r,n)})}));const i=ce(e.dialectId,"baseToken"),s=Oe(t.parentId,e.id),c=t.parentDialect===e.dialectId?"":e.dialectId;return{...s&&{[i]:s},...c&&{$schema:c},...n}}};Ae.setConfig,Ae.getConfig,Ae.add,Ae.get,Ae.markValidated,Ae.uri,Ae.value,Ae.getAnchorPointer,Ae.typeOf,Ae.has,Ae.step,Ae.keys,Ae.entries,Ae.map,Ae.length,Ae.toSchema;class Ie extends Error{constructor(e){super("Invalid Schema"),this.name=this.constructor.name,this.output=e}}var je=Ie;const{resolveUrl:Te}=s,xe="FLAG",$e="BASIC",De="DETAILED",Pe="VERBOSE";let Re=De,Ne=!0;const Fe=async e=>{const r={metaData:{}};return{ast:r,schemaUri:await Ve(e,r)}},_e=e((({ast:e,schemaUri:r},t,o=xe)=>{if(![xe,$e,De,Pe].includes(o))throw Error(`The '${o}' error format is not supported`);const a=[],i=n.subscribe("result",ke(o,a));return Me(r,t,e,{}),n.unsubscribe(i),a[0]})),ke=(e,r)=>{const t=[];return(n,o)=>{if("result"===n){const{keyword:e,absoluteKeywordLocation:r,instanceLocation:n,valid:a}=o,i={keyword:e,absoluteKeywordLocation:r,instanceLocation:n,valid:a,errors:[]};t.push(i)}else if("result.start"===n)t.push(n);else if("result.end"===n){const n=t.pop();for(;"result.start"!==t[t.length-1];){const r=t.pop(),o=[r];e===$e&&(o.push(...r.errors),delete r.errors),(e===Pe||e!==xe&&!r.valid)&&n.errors.unshift(...o)}t[t.length-1]=n,r[0]=n}}},Ue={},qe=e=>Ue[e],Le=e=>e in Ue,ze={},He={},Ve=async(e,r)=>{if(e=await Ke(e),!Le(`${e.dialectId}#validate`)){const r=await Ae.get(e.dialectId);(Ae.getConfig(r.id,"mandatoryVocabularies")||[]).forEach((e=>{if(!r.vocabulary[e])throw Error(`Vocabulary '${e}' must be explicitly declared and required`)})),Object.entries(r.vocabulary).forEach((([e,t])=>{if(e in ze)Object.entries(ze[e]).forEach((([e,t])=>{((e,r)=>{Ue[e]={collectEvaluatedItems:(e,t,n,o,a)=>r.interpret(e,t,n,o,a)&&new Set,collectEvaluatedProperties:(e,t,n,o,a)=>r.interpret(e,t,n,o,a)&&[],...r}})(`${r.id}#${e}`,t)}));else if(t)throw Error(`Missing required vocabulary: ${e}`)}))}if(Ne&&!e.validated){if(Ae.markValidated(e.id),!(e.dialectId in He)){const r=await Ae.get(e.dialectId),t=await Fe(r);He[r.id]=_e(t)}const r=N.cons(e.schema,e.id),t=He[e.dialectId](r,Re);if(!t.valid)throw new je(t)}return e.id in r.metaData||(r.metaData[e.id]={id:e.id,dynamicAnchors:e.dynamicAnchors,anchors:e.anchors}),qe(`${e.dialectId}#validate`).compile(e,r)},Ke=async e=>Ae.typeOf(e,"string")?Ke(await Ae.get(Ae.value(e),e)):e,Me=(e,r,t,n)=>{const o=Ze(e,t),a=Te(e,"");return qe(o).interpret(e,r,t,{...t.metaData[a].dynamicAnchors,...n})},Ze=(e,r)=>{if(!(e in r))throw Error(`No schema found at ${e}`);return r[e][0]};var Je={validate:async(e,r,t)=>{const n=await Fe(e),o=(e,r)=>_e(n,N.cons(e),r);return void 0===r?o:o(r,t)},compile:Fe,interpret:_e,setMetaOutputFormat:e=>{Re=e},setShouldMetaValidate:e=>{Ne=e},FLAG:xe,BASIC:$e,DETAILED:De,VERBOSE:Pe,add:(e,r="",t="")=>{const n=Ae.add(e,r,t);delete He[n]},getKeyword:qe,hasKeyword:Le,defineVocabulary:(e,r)=>{ze[e]=r},compileSchema:Ve,interpretSchema:Me,collectEvaluatedProperties:(e,r,t,n,o)=>{const a=Ze(e,t);return qe(a).collectEvaluatedProperties(e,r,t,n,o)},collectEvaluatedItems:(e,r,t,n,o)=>{const a=Ze(e,t);return qe(a).collectEvaluatedItems(e,r,t,n,o)}};var Be={compile:e=>Ae.value(e),interpret:()=>!0};var Ge={compile:async(e,r)=>{const t=Ae.uri(e);if(!(t in r)){r[t]=!1;const n=Ae.value(e);if(!["object","boolean"].includes(typeof n))throw Error(`No schema found at '${Ae.uri(e)}'`);r[t]=[`${e.dialectId}#validate`,Ae.uri(e),"boolean"==typeof n?n:await Y.pipeline([Ae.entries,Y.map((([r,t])=>[`${e.dialectId}#${r}`,t])),Y.filter((([r])=>Je.hasKeyword(r)&&r!==`${e.dialectId}#validate`)),Y.map((async([t,n])=>{const o=await Je.getKeyword(t).compile(n,r,e);return[t,Ae.uri(n),o]})),Y.all],e)]}return t},interpret:(e,r,t,o)=>{const[a,i,s]=t[e];n.publishSync("result.start");const c="boolean"==typeof s?s:s.every((([e,a,i])=>{n.publishSync("result.start");const s=Je.getKeyword(e).interpret(i,r,t,o);return n.publishSync("result",{keyword:e,absoluteKeywordLocation:a,instanceLocation:N.uri(r),valid:s,ast:i}),n.publishSync("result.end"),s}));return n.publishSync("result",{keyword:a,absoluteKeywordLocation:i,instanceLocation:N.uri(r),valid:c,ast:e}),n.publishSync("result.end"),c},collectEvaluatedProperties:(e,r,t,n,o=!1)=>{const a=t[e][2];return"boolean"==typeof a?!!a&&[]:a.filter((([e])=>!o||!e.endsWith("#unevaluatedProperties"))).reduce(((e,[o,,a])=>{const i=e&&Je.getKeyword(o).collectEvaluatedProperties(a,r,t,n);return!1!==i&&[...e,...i]}),[])},collectEvaluatedItems:(e,r,t,n,o=!1)=>{const a=t[e][2];return"boolean"==typeof a?!!a&&new Set:a.filter((([e])=>!o||!e.endsWith("#unevaluatedItems"))).reduce(((e,[o,,a])=>{const i=!1!==e&&Je.getKeyword(o).collectEvaluatedItems(a,r,t,n);return!1!==i&&new Set([...e,...i])}),new Set)}},We={metaData:Be,validate:Ge},Qe={Core:Je,Schema:Ae,Instance:N,Reference:S,Keywords:We,InvalidSchemaError:je},Ye=Qe.Core,Xe=Qe.Schema,er=Qe.Instance,rr=Qe.Reference,tr=Qe.Keywords,nr=Qe.InvalidSchemaError;export{Ye as Core,er as Instance,nr as InvalidSchemaError,tr as Keywords,rr as Reference,Xe as Schema,Qe as default}; | ||
!function(e){function r(){for(var e=arguments.length,r=Array(e),t=0;t<e;t++)r[t]=arguments[t];if(r.length>1){r[0]=r[0].slice(0,-1);for(var n=r.length-1,o=1;o<n;++o)r[o]=r[o].slice(1,-1);return r[n]=r[n].slice(1),r.join("")}return r[0]}function t(e){return"(?:"+e+")"}function n(e){return void 0===e?"undefined":null===e?"null":Object.prototype.toString.call(e).split(" ").pop().split("]").shift().toLowerCase()}function o(e){return e.toUpperCase()}function a(e){return null!=e?e instanceof Array?e:"number"!=typeof e.length||e.split||e.setInterval||e.call?[e]:Array.prototype.slice.call(e):[]}function i(e,r){var t=e;if(r)for(var n in r)t[n]=r[n];return t}function s(e){var n="[A-Za-z]",o="[0-9]",a=r(o,"[A-Fa-f]"),i=t(t("%[EFef]"+a+"%"+a+a+"%"+a+a)+"|"+t("%[89A-Fa-f]"+a+"%"+a+a)+"|"+t("%"+a+a)),s="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",c=r("[\\:\\/\\?\\#\\[\\]\\@]",s),u=e?"[\\uE000-\\uF8FF]":"[]",l=r(n,o,"[\\-\\.\\_\\~]",e?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]");t(n+r(n,o,"[\\+\\-\\.]")+"*"),t(t(i+"|"+r(l,s,"[\\:]"))+"*");var p=t(t("25[0-5]")+"|"+t("2[0-4]"+o)+"|"+t("1"+o+o)+"|"+t("0?[1-9]"+o)+"|0?0?"+o),f=t(p+"\\."+p+"\\."+p+"\\."+p),d=t(a+"{1,4}"),h=t(t(d+"\\:"+d)+"|"+f),v=t(t(d+"\\:")+"{6}"+h),y=t("\\:\\:"+t(d+"\\:")+"{5}"+h),m=t(t(d)+"?\\:\\:"+t(d+"\\:")+"{4}"+h),g=t(t(t(d+"\\:")+"{0,1}"+d)+"?\\:\\:"+t(d+"\\:")+"{3}"+h),b=t(t(t(d+"\\:")+"{0,2}"+d)+"?\\:\\:"+t(d+"\\:")+"{2}"+h),w=t(t(t(d+"\\:")+"{0,3}"+d)+"?\\:\\:"+d+"\\:"+h),E=t(t(t(d+"\\:")+"{0,4}"+d)+"?\\:\\:"+h),S=t(t(t(d+"\\:")+"{0,5}"+d)+"?\\:\\:"+d),C=t(t(t(d+"\\:")+"{0,6}"+d)+"?\\:\\:"),O=t([v,y,m,g,b,w,E,S,C].join("|")),A=t(t(l+"|"+i)+"+");t("[vV]"+a+"+\\."+r(l,s,"[\\:]")+"+"),t(t(i+"|"+r(l,s))+"*");var I=t(i+"|"+r(l,s,"[\\:\\@]"));return t(t(i+"|"+r(l,s,"[\\@]"))+"+"),t(t(I+"|"+r("[\\/\\?]",u))+"*"),{NOT_SCHEME:new RegExp(r("[^]",n,o,"[\\+\\-\\.]"),"g"),NOT_USERINFO:new RegExp(r("[^\\%\\:]",l,s),"g"),NOT_HOST:new RegExp(r("[^\\%\\[\\]\\:]",l,s),"g"),NOT_PATH:new RegExp(r("[^\\%\\/\\:\\@]",l,s),"g"),NOT_PATH_NOSCHEME:new RegExp(r("[^\\%\\/\\@]",l,s),"g"),NOT_QUERY:new RegExp(r("[^\\%]",l,s,"[\\:\\@\\/\\?]",u),"g"),NOT_FRAGMENT:new RegExp(r("[^\\%]",l,s,"[\\:\\@\\/\\?]"),"g"),ESCAPE:new RegExp(r("[^]",l,s),"g"),UNRESERVED:new RegExp(l,"g"),OTHER_CHARS:new RegExp(r("[^\\%]",l,c),"g"),PCT_ENCODED:new RegExp(i,"g"),IPV4ADDRESS:new RegExp("^("+f+")$"),IPV6ADDRESS:new RegExp("^\\[?("+O+")"+t(t("\\%25|\\%(?!"+a+"{2})")+"("+A+")")+"?\\]?$")}}var c=s(!1),u=s(!0),l=function(){function e(e,r){var t=[],n=!0,o=!1,a=void 0;try{for(var i,s=e[Symbol.iterator]();!(n=(i=s.next()).done)&&(t.push(i.value),!r||t.length!==r);n=!0);}catch(e){o=!0,a=e}finally{try{!n&&s.return&&s.return()}finally{if(o)throw a}}return t}return function(r,t){if(Array.isArray(r))return r;if(Symbol.iterator in Object(r))return e(r,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),p=function(e){if(Array.isArray(e)){for(var r=0,t=Array(e.length);r<e.length;r++)t[r]=e[r];return t}return Array.from(e)},f=2147483647,d=36,h=1,v=26,y=38,m=700,g=72,b=128,w="-",E=/^xn--/,S=/[^\0-\x7E]/,C=/[\x2E\u3002\uFF0E\uFF61]/g,O={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},A=d-h,I=Math.floor,T=String.fromCharCode;function j(e){throw new RangeError(O[e])}function x(e,r){for(var t=[],n=e.length;n--;)t[n]=r(e[n]);return t}function P(e,r){var t=e.split("@"),n="";return t.length>1&&(n=t[0]+"@",e=t[1]),n+x((e=e.replace(C,".")).split("."),r).join(".")}function $(e){for(var r=[],t=0,n=e.length;t<n;){var o=e.charCodeAt(t++);if(o>=55296&&o<=56319&&t<n){var a=e.charCodeAt(t++);56320==(64512&a)?r.push(((1023&o)<<10)+(1023&a)+65536):(r.push(o),t--)}else r.push(o)}return r}var D=function(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:d},R=function(e,r){return e+22+75*(e<26)-((0!=r)<<5)},N=function(e,r,t){var n=0;for(e=t?I(e/m):e>>1,e+=I(e/r);e>A*v>>1;n+=d)e=I(e/A);return I(n+(A+1)*e/(e+y))},F=function(e){var r=[],t=e.length,n=0,o=b,a=g,i=e.lastIndexOf(w);i<0&&(i=0);for(var s=0;s<i;++s)e.charCodeAt(s)>=128&&j("not-basic"),r.push(e.charCodeAt(s));for(var c=i>0?i+1:0;c<t;){for(var u=n,l=1,p=d;;p+=d){c>=t&&j("invalid-input");var y=D(e.charCodeAt(c++));(y>=d||y>I((f-n)/l))&&j("overflow"),n+=y*l;var m=p<=a?h:p>=a+v?v:p-a;if(y<m)break;var E=d-m;l>I(f/E)&&j("overflow"),l*=E}var S=r.length+1;a=N(n-u,S,0==u),I(n/S)>f-o&&j("overflow"),o+=I(n/S),n%=S,r.splice(n++,0,o)}return String.fromCodePoint.apply(String,r)},_=function(e){var r=[],t=(e=$(e)).length,n=b,o=0,a=g,i=!0,s=!1,c=void 0;try{for(var u,l=e[Symbol.iterator]();!(i=(u=l.next()).done);i=!0){var p=u.value;p<128&&r.push(T(p))}}catch(e){s=!0,c=e}finally{try{!i&&l.return&&l.return()}finally{if(s)throw c}}var y=r.length,m=y;for(y&&r.push(w);m<t;){var E=f,S=!0,C=!1,O=void 0;try{for(var A,x=e[Symbol.iterator]();!(S=(A=x.next()).done);S=!0){var P=A.value;P>=n&&P<E&&(E=P)}}catch(e){C=!0,O=e}finally{try{!S&&x.return&&x.return()}finally{if(C)throw O}}var D=m+1;E-n>I((f-o)/D)&&j("overflow"),o+=(E-n)*D,n=E;var F=!0,_=!1,k=void 0;try{for(var U,q=e[Symbol.iterator]();!(F=(U=q.next()).done);F=!0){var L=U.value;if(L<n&&++o>f&&j("overflow"),L==n){for(var z=o,H=d;;H+=d){var V=H<=a?h:H>=a+v?v:H-a;if(z<V)break;var K=z-V,M=d-V;r.push(T(R(V+K%M,0))),z=I(K/M)}r.push(T(R(z,0))),a=N(o,D,m==y),o=0,++m}}}catch(e){_=!0,k=e}finally{try{!F&&q.return&&q.return()}finally{if(_)throw k}}++o,++n}return r.join("")},k=function(e){return P(e,(function(e){return E.test(e)?F(e.slice(4).toLowerCase()):e}))},U=function(e){return P(e,(function(e){return S.test(e)?"xn--"+_(e):e}))},q={version:"2.1.0",ucs2:{decode:$,encode:function(e){return String.fromCodePoint.apply(String,p(e))}},decode:F,encode:_,toASCII:U,toUnicode:k},L={};function z(e){var r=e.charCodeAt(0);return r<16?"%0"+r.toString(16).toUpperCase():r<128?"%"+r.toString(16).toUpperCase():r<2048?"%"+(r>>6|192).toString(16).toUpperCase()+"%"+(63&r|128).toString(16).toUpperCase():"%"+(r>>12|224).toString(16).toUpperCase()+"%"+(r>>6&63|128).toString(16).toUpperCase()+"%"+(63&r|128).toString(16).toUpperCase()}function H(e){for(var r="",t=0,n=e.length;t<n;){var o=parseInt(e.substr(t+1,2),16);if(o<128)r+=String.fromCharCode(o),t+=3;else if(o>=194&&o<224){if(n-t>=6){var a=parseInt(e.substr(t+4,2),16);r+=String.fromCharCode((31&o)<<6|63&a)}else r+=e.substr(t,6);t+=6}else if(o>=224){if(n-t>=9){var i=parseInt(e.substr(t+4,2),16),s=parseInt(e.substr(t+7,2),16);r+=String.fromCharCode((15&o)<<12|(63&i)<<6|63&s)}else r+=e.substr(t,9);t+=9}else r+=e.substr(t,3),t+=3}return r}function V(e,r){function t(e){var t=H(e);return t.match(r.UNRESERVED)?t:e}return e.scheme&&(e.scheme=String(e.scheme).replace(r.PCT_ENCODED,t).toLowerCase().replace(r.NOT_SCHEME,"")),void 0!==e.userinfo&&(e.userinfo=String(e.userinfo).replace(r.PCT_ENCODED,t).replace(r.NOT_USERINFO,z).replace(r.PCT_ENCODED,o)),void 0!==e.host&&(e.host=String(e.host).replace(r.PCT_ENCODED,t).toLowerCase().replace(r.NOT_HOST,z).replace(r.PCT_ENCODED,o)),void 0!==e.path&&(e.path=String(e.path).replace(r.PCT_ENCODED,t).replace(e.scheme?r.NOT_PATH:r.NOT_PATH_NOSCHEME,z).replace(r.PCT_ENCODED,o)),void 0!==e.query&&(e.query=String(e.query).replace(r.PCT_ENCODED,t).replace(r.NOT_QUERY,z).replace(r.PCT_ENCODED,o)),void 0!==e.fragment&&(e.fragment=String(e.fragment).replace(r.PCT_ENCODED,t).replace(r.NOT_FRAGMENT,z).replace(r.PCT_ENCODED,o)),e}function K(e){return e.replace(/^0*(.*)/,"$1")||"0"}function M(e,r){var t=e.match(r.IPV4ADDRESS)||[],n=l(t,2)[1];return n?n.split(".").map(K).join("."):e}function Z(e,r){var t=e.match(r.IPV6ADDRESS)||[],n=l(t,3),o=n[1],a=n[2];if(o){for(var i=o.toLowerCase().split("::").reverse(),s=l(i,2),c=s[0],u=s[1],p=u?u.split(":").map(K):[],f=c.split(":").map(K),d=r.IPV4ADDRESS.test(f[f.length-1]),h=d?7:8,v=f.length-h,y=Array(h),m=0;m<h;++m)y[m]=p[m]||f[v+m]||"";d&&(y[h-1]=M(y[h-1],r));var g=y.reduce((function(e,r,t){if(!r||"0"===r){var n=e[e.length-1];n&&n.index+n.length===t?n.length++:e.push({index:t,length:1})}return e}),[]).sort((function(e,r){return r.length-e.length}))[0],b=void 0;if(g&&g.length>1){var w=y.slice(0,g.index),E=y.slice(g.index+g.length);b=w.join(":")+"::"+E.join(":")}else b=y.join(":");return a&&(b+="%"+a),b}return e}var J=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,B=void 0==="".match(/(){0}/)[1];function G(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t={},n=!1!==r.iri?u:c;"suffix"===r.reference&&(e=(r.scheme?r.scheme+":":"")+"//"+e);var o=e.match(J);if(o){B?(t.scheme=o[1],t.userinfo=o[3],t.host=o[4],t.port=parseInt(o[5],10),t.path=o[6]||"",t.query=o[7],t.fragment=o[8],isNaN(t.port)&&(t.port=o[5])):(t.scheme=o[1]||void 0,t.userinfo=-1!==e.indexOf("@")?o[3]:void 0,t.host=-1!==e.indexOf("//")?o[4]:void 0,t.port=parseInt(o[5],10),t.path=o[6]||"",t.query=-1!==e.indexOf("?")?o[7]:void 0,t.fragment=-1!==e.indexOf("#")?o[8]:void 0,isNaN(t.port)&&(t.port=e.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?o[4]:void 0)),t.host&&(t.host=Z(M(t.host,n),n)),void 0!==t.scheme||void 0!==t.userinfo||void 0!==t.host||void 0!==t.port||t.path||void 0!==t.query?void 0===t.scheme?t.reference="relative":void 0===t.fragment?t.reference="absolute":t.reference="uri":t.reference="same-document",r.reference&&"suffix"!==r.reference&&r.reference!==t.reference&&(t.error=t.error||"URI is not a "+r.reference+" reference.");var a=L[(r.scheme||t.scheme||"").toLowerCase()];if(r.unicodeSupport||a&&a.unicodeSupport)V(t,n);else{if(t.host&&(r.domainHost||a&&a.domainHost))try{t.host=q.toASCII(t.host.replace(n.PCT_ENCODED,H).toLowerCase())}catch(e){t.error=t.error||"Host's domain name can not be converted to ASCII via punycode: "+e}V(t,c)}a&&a.parse&&a.parse(t,r)}else t.error=t.error||"URI can not be parsed.";return t}function W(e,r){var t=!1!==r.iri?u:c,n=[];return void 0!==e.userinfo&&(n.push(e.userinfo),n.push("@")),void 0!==e.host&&n.push(Z(M(String(e.host),t),t).replace(t.IPV6ADDRESS,(function(e,r,t){return"["+r+(t?"%25"+t:"")+"]"}))),"number"!=typeof e.port&&"string"!=typeof e.port||(n.push(":"),n.push(String(e.port))),n.length?n.join(""):void 0}var Q=/^\.\.?\//,Y=/^\/\.(\/|$)/,X=/^\/\.\.(\/|$)/,ee=/^\/?(?:.|\n)*?(?=\/|$)/;function re(e){for(var r=[];e.length;)if(e.match(Q))e=e.replace(Q,"");else if(e.match(Y))e=e.replace(Y,"/");else if(e.match(X))e=e.replace(X,"/"),r.pop();else if("."===e||".."===e)e="";else{var t=e.match(ee);if(!t)throw new Error("Unexpected dot segment condition");var n=t[0];e=e.slice(n.length),r.push(n)}return r.join("")}function te(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=r.iri?u:c,n=[],o=L[(r.scheme||e.scheme||"").toLowerCase()];if(o&&o.serialize&&o.serialize(e,r),e.host)if(t.IPV6ADDRESS.test(e.host));else if(r.domainHost||o&&o.domainHost)try{e.host=r.iri?q.toUnicode(e.host):q.toASCII(e.host.replace(t.PCT_ENCODED,H).toLowerCase())}catch(t){e.error=e.error||"Host's domain name can not be converted to "+(r.iri?"Unicode":"ASCII")+" via punycode: "+t}V(e,t),"suffix"!==r.reference&&e.scheme&&(n.push(e.scheme),n.push(":"));var a=W(e,r);if(void 0!==a&&("suffix"!==r.reference&&n.push("//"),n.push(a),e.path&&"/"!==e.path.charAt(0)&&n.push("/")),void 0!==e.path){var i=e.path;r.absolutePath||o&&o.absolutePath||(i=re(i)),void 0===a&&(i=i.replace(/^\/\//,"/%2F")),n.push(i)}return void 0!==e.query&&(n.push("?"),n.push(e.query)),void 0!==e.fragment&&(n.push("#"),n.push(e.fragment)),n.join("")}function ne(e,r){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n={};return arguments[3]||(e=G(te(e,t),t),r=G(te(r,t),t)),!(t=t||{}).tolerant&&r.scheme?(n.scheme=r.scheme,n.userinfo=r.userinfo,n.host=r.host,n.port=r.port,n.path=re(r.path||""),n.query=r.query):(void 0!==r.userinfo||void 0!==r.host||void 0!==r.port?(n.userinfo=r.userinfo,n.host=r.host,n.port=r.port,n.path=re(r.path||""),n.query=r.query):(r.path?("/"===r.path.charAt(0)?n.path=re(r.path):(void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?n.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+r.path:n.path=r.path:n.path="/"+r.path,n.path=re(n.path)),n.query=r.query):(n.path=e.path,void 0!==r.query?n.query=r.query:n.query=e.query),n.userinfo=e.userinfo,n.host=e.host,n.port=e.port),n.scheme=e.scheme),n.fragment=r.fragment,n}function oe(e,r,t){var n=i({scheme:"null"},t);return te(ne(G(e,n),G(r,n),n,!0),n)}function ae(e,r){return"string"==typeof e?e=te(G(e,r),r):"object"===n(e)&&(e=G(te(e,r),r)),e}function ie(e,r,t){return"string"==typeof e?e=te(G(e,t),t):"object"===n(e)&&(e=te(e,t)),"string"==typeof r?r=te(G(r,t),t):"object"===n(r)&&(r=te(r,t)),e===r}function se(e,r){return e&&e.toString().replace(r&&r.iri?u.ESCAPE:c.ESCAPE,z)}function ce(e,r){return e&&e.toString().replace(r&&r.iri?u.PCT_ENCODED:c.PCT_ENCODED,H)}var ue={scheme:"http",domainHost:!0,parse:function(e,r){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e},serialize:function(e,r){var t="https"===String(e.scheme).toLowerCase();return e.port!==(t?443:80)&&""!==e.port||(e.port=void 0),e.path||(e.path="/"),e}},le={scheme:"https",domainHost:ue.domainHost,parse:ue.parse,serialize:ue.serialize};function pe(e){return"boolean"==typeof e.secure?e.secure:"wss"===String(e.scheme).toLowerCase()}var fe={scheme:"ws",domainHost:!0,parse:function(e,r){var t=e;return t.secure=pe(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t},serialize:function(e,r){if(e.port!==(pe(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 t=e.resourceName.split("?"),n=l(t,2),o=n[0],a=n[1];e.path=o&&"/"!==o?o:void 0,e.query=a,e.resourceName=void 0}return e.fragment=void 0,e}},de={scheme:"wss",domainHost:fe.domainHost,parse:fe.parse,serialize:fe.serialize},he={},ve="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",ye="[0-9A-Fa-f]",me=t(t("%[EFef]"+ye+"%"+ye+ye+"%"+ye+ye)+"|"+t("%[89A-Fa-f]"+ye+"%"+ye+ye)+"|"+t("%"+ye+ye)),ge="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]",be=r("[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",'[\\"\\\\]'),we="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]",Ee=new RegExp(ve,"g"),Se=new RegExp(me,"g"),Ce=new RegExp(r("[^]",ge,"[\\.]",'[\\"]',be),"g"),Oe=new RegExp(r("[^]",ve,we),"g"),Ae=Oe;function Ie(e){var r=H(e);return r.match(Ee)?r:e}var Te={scheme:"mailto",parse:function(e,r){var t=e,n=t.to=t.path?t.path.split(","):[];if(t.path=void 0,t.query){for(var o=!1,a={},i=t.query.split("&"),s=0,c=i.length;s<c;++s){var u=i[s].split("=");switch(u[0]){case"to":for(var l=u[1].split(","),p=0,f=l.length;p<f;++p)n.push(l[p]);break;case"subject":t.subject=ce(u[1],r);break;case"body":t.body=ce(u[1],r);break;default:o=!0,a[ce(u[0],r)]=ce(u[1],r)}}o&&(t.headers=a)}t.query=void 0;for(var d=0,h=n.length;d<h;++d){var v=n[d].split("@");if(v[0]=ce(v[0]),r.unicodeSupport)v[1]=ce(v[1],r).toLowerCase();else try{v[1]=q.toASCII(ce(v[1],r).toLowerCase())}catch(e){t.error=t.error||"Email address's domain name can not be converted to ASCII via punycode: "+e}n[d]=v.join("@")}return t},serialize:function(e,r){var t=e,n=a(e.to);if(n){for(var i=0,s=n.length;i<s;++i){var c=String(n[i]),u=c.lastIndexOf("@"),l=c.slice(0,u).replace(Se,Ie).replace(Se,o).replace(Ce,z),p=c.slice(u+1);try{p=r.iri?q.toUnicode(p):q.toASCII(ce(p,r).toLowerCase())}catch(e){t.error=t.error||"Email address's domain name can not be converted to "+(r.iri?"Unicode":"ASCII")+" via punycode: "+e}n[i]=l+"@"+p}t.path=n.join(",")}var f=e.headers=e.headers||{};e.subject&&(f.subject=e.subject),e.body&&(f.body=e.body);var d=[];for(var h in f)f[h]!==he[h]&&d.push(h.replace(Se,Ie).replace(Se,o).replace(Oe,z)+"="+f[h].replace(Se,Ie).replace(Se,o).replace(Ae,z));return d.length&&(t.query=d.join("&")),t}},je=/^([^\:]+)\:(.*)/,xe={scheme:"urn",parse:function(e,r){var t=e.path&&e.path.match(je),n=e;if(t){var o=r.scheme||n.scheme||"urn",a=t[1].toLowerCase(),i=t[2],s=o+":"+(r.nid||a),c=L[s];n.nid=a,n.nss=i,n.path=void 0,c&&(n=c.parse(n,r))}else n.error=n.error||"URN can not be parsed.";return n},serialize:function(e,r){var t=r.scheme||e.scheme||"urn",n=e.nid,o=t+":"+(r.nid||n),a=L[o];a&&(e=a.serialize(e,r));var i=e,s=e.nss;return i.path=(n||r.nid)+":"+s,i}},Pe=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/,$e={scheme:"urn:uuid",parse:function(e,r){var t=e;return t.uuid=t.nss,t.nss=void 0,r.tolerant||t.uuid&&t.uuid.match(Pe)||(t.error=t.error||"UUID is not valid."),t},serialize:function(e,r){var t=e;return t.nss=(e.uuid||"").toLowerCase(),t}};L[ue.scheme]=ue,L[le.scheme]=le,L[fe.scheme]=fe,L[de.scheme]=de,L[Te.scheme]=Te,L[xe.scheme]=xe,L[$e.scheme]=$e,e.SCHEMES=L,e.pctEncChar=z,e.pctDecChars=H,e.parse=G,e.removeDotSegments=re,e.serialize=te,e.resolveComponents=ne,e.resolve=oe,e.normalize=ae,e.equal=ie,e.escapeComponent=se,e.unescapeComponent=ce,Object.defineProperty(e,"__esModule",{value:!0})}(r)}));(o=a)&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")&&o.default;const i={null:e=>null===e,boolean:e=>"boolean"==typeof e,object:e=>"object"==typeof e&&!Array.isArray(e)&&null!==e,array:e=>Array.isArray(e),number:e=>"number"==typeof e,integer:e=>Number.isInteger(e),string:e=>"string"==typeof e};var s={jsonTypeOf:(e,r)=>i[r](e),resolveUrl:(e,r)=>{const t=a.resolve(e,r,{iri:!0});if(a.resolve(e,"",{iri:!0})&&"file"===a.parse(t).scheme&&"file"!==a.parse(e).scheme)throw Error(`Can't access file '${t}' resource from network context '${e}'`);return t},urlFragment:e=>a.unescapeComponent(a.parse(e).fragment)||"",pathRelative:(e,r)=>{if(e===r)return"";let t=1;const n=e.length-1,o=r.length-t,a=n<o?n:o;let i=-1,s=0;for(;s<a;s++){const n=e.charCodeAt(s+1);if(n!==r.charCodeAt(t+s))break;47===n&&(i=s)}if(o>a){if(47===r.charCodeAt(t+s))return r.slice(t+s+1);if(0===s)return r.slice(t+s)}n>a&&(47===e.charCodeAt(s+1)?i=s:0===a&&(i=0));let c="";for(s=i+2;s<=e.length;++s)s!==e.length&&47!==e.charCodeAt(s)||(c+=0===c.length?"..":"/..");return t+=i,c.length>0?`${c}${r.slice(t,r.length)}`:(47===r.charCodeAt(t)&&++t,r.slice(t,r.length))}};const c=e=>{if(e.length>0&&"/"!==e[0])throw Error("Invalid JSON Pointer");return e.split("/").slice(1).map(v)},u=(e,r,t,n)=>{if(0===e.length)return t;if(e.length>1){const o=e.shift();return{...r,[o]:u(e,m(r,o,n),t,d(o,n))}}if(Array.isArray(r)){const n=[...r];return n[y(r,e[0])]=t,n}return"object"==typeof r&&null!==r?{...r,[e[0]]:t}:m(r,e[0],n)},l=(e,r,t,n)=>{if(0!==e.length)if(1!==e.length||g(r)){const o=e.shift();l(e,m(r,o,n),t,d(o,n))}else{r[y(r,e[0])]=t}},p=(e,r,t)=>{if(0!=e.length){if(e.length>1){const n=e.shift(),o=m(r,n,t);return{...r,[n]:p(e,o,d(n,t))}}if(Array.isArray(r))return r.filter(((r,t)=>t!=e[0]));if("object"==typeof r&&null!==r){const{[e[0]]:t,...n}=r;return n}return m(r,e[0],t)}},f=(e,r,t)=>{if(0!==e.length)if(e.length>1){const n=e.shift(),o=m(r,n,t);f(e,o,d(n,t))}else Array.isArray(r)?r.splice(e[0],1):"object"==typeof r&&null!==r?delete r[e[0]]:m(r,e[0],t)},d=e(((e,r)=>r+"/"+h(e))),h=e=>e.toString().replace(/~/g,"~0").replace(/\//g,"~1"),v=e=>e.toString().replace(/~1/g,"/").replace(/~0/g,"~"),y=(e,r)=>Array.isArray(e)&&"-"===r?e.length:r,m=(e,r,t="")=>{if(void 0===e)throw TypeError(`Value at '${t}' is undefined and does not have property '${r}'`);if(null===e)throw TypeError(`Value at '${t}' is null and does not have property '${r}'`);if(g(e))throw TypeError(`Value at '${t}' is a ${typeof e} and does not have property '${r}'`);return e[y(e,r)]},g=e=>null===e||"object"!=typeof e;var b={nil:"",append:d,get:(e,r)=>{const t=c(e),n=e=>t.reduce((([e,r],t)=>[m(e,t,r),d(t,r)]),[e,""])[0];return void 0===r?n:n(r)},set:(r,t,n)=>{const o=c(r),a=e(((e,r)=>u(o,e,r,"")));return void 0===t?a:a(t,n)},assign:(r,t,n)=>{const o=c(r),a=e(((e,r)=>l(o,e,r,"")));return void 0===t?a:a(t,n)},unset:(e,r)=>{const t=c(e),n=e=>p(t,e,"");return void 0===r?n:n(r)},remove:(e,r)=>{const t=c(e),n=e=>f(t,e,"");return void 0===r?n:n(r)}};b.nil,b.append,b.get,b.set,b.assign,b.unset,b.remove;const w=Symbol("$__value"),E=Symbol("$__href");var S={cons:(e,r)=>Object.freeze({[E]:e,[w]:r}),isReference:e=>e&&void 0!==e[E],href:e=>e[E],value:e=>e[w]};const{resolveUrl:C,jsonTypeOf:O}=s,A=Object.freeze({id:"",pointer:"",instance:void 0,value:void 0}),I=e=>S.isReference(e.value)?S.value(e.value):e.value,T=e(((e,r)=>O(I(e),r))),j=(e,r)=>Object.freeze({...r,pointer:b.append(e,r.pointer),value:I(r)[e]}),x=e(((e,r)=>I(r).map(((t,n,o,a)=>e(j(n,r),n,o,a))))),P=e(((e,r)=>I(r).map(((e,t,n,o)=>j(t,r))).filter(((r,t,n,o)=>e(r,t,n,o))))),$=e(((e,r,t)=>I(t).reduce(((r,n,o)=>e(r,j(o,t),o)),r))),D=e(((e,r)=>I(r).every(((t,n,o,a)=>e(j(n,r),n,o,a))))),R=e(((e,r)=>I(r).some(((t,n,o,a)=>e(j(n,r),n,o,a)))));var N={nil:A,cons:(e,r="")=>Object.freeze({...A,id:C(r,""),instance:e,value:e}),uri:e=>`${e.id}#${encodeURI(e.pointer)}`,value:I,has:(e,r)=>e in I(r),typeOf:T,step:j,entries:e=>Object.keys(I(e)).map((r=>[r,j(r,e)])),keys:e=>Object.keys(I(e)),map:x,filter:P,reduce:$,every:D,some:R,length:e=>I(e).length},F=async e=>Object.entries(await e),_=e((async(e,r)=>(await r).map(e))),k=e((async(e,r,t)=>(await t).reduce((async(r,t)=>e(await r,t)),r))),U=e((async(e,r,t={})=>k((async(r,t)=>await e(t)?r.concat([t]):r),[],r,t))),q=e((async(e,r)=>{const t=await _(e,r);return(await Promise.all(t)).some((e=>e))})),L=e((async(e,r)=>{const t=await _(e,r);return(await Promise.all(t)).every((e=>e))})),z=e(((e,r)=>e.reduce((async(e,r)=>r(await e)),r))),H={entries:F,map:_,filter:U,reduce:k,some:q,every:L,pipeline:z,all:e=>Promise.all(e),allValues:e=>z([F,k((async(e,[r,t])=>(e[r]=await t,e)),{})],e)};H.entries,H.map,H.filter,H.reduce,H.some,H.every,H.pipeline,H.all,H.allValues;var V=fetch,K=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,M=/^[\u000b\u0020-\u007e\u0080-\u00ff]+$/,Z=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,J=/\\([\u000b\u0020-\u00ff])/g,B=/([\\"])/g,G=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,W=function(e){if(!e)throw new TypeError("argument string is required");var r="object"==typeof e?function(e){var r;"function"==typeof e.getHeader?r=e.getHeader("content-type"):"object"==typeof e.headers&&(r=e.headers&&e.headers["content-type"]);if("string"!=typeof r)throw new TypeError("content-type header is missing from object");return r}(e):e;if("string"!=typeof r)throw new TypeError("argument string is required to be a string");var t=r.indexOf(";"),n=-1!==t?r.substr(0,t).trim():r.trim();if(!G.test(n))throw new TypeError("invalid media type");var o=new Y(n.toLowerCase());if(-1!==t){var a,i,s;for(K.lastIndex=t;i=K.exec(r);){if(i.index!==t)throw new TypeError("invalid parameter format");t+=i[0].length,a=i[1].toLowerCase(),'"'===(s=i[2])[0]&&(s=s.substr(1,s.length-2).replace(J,"$1")),o.parameters[a]=s}if(t!==r.length)throw new TypeError("invalid parameter format")}return o}; | ||
/*! | ||
* content-type | ||
* Copyright(c) 2015 Douglas Christopher Wilson | ||
* MIT Licensed | ||
*/function Q(e){var r=String(e);if(Z.test(r))return r;if(r.length>0&&!M.test(r))throw new TypeError("invalid parameter value");return'"'+r.replace(B,"\\$1")+'"'}function Y(e){this.parameters=Object.create(null),this.type=e}var X={format:function(e){if(!e||"object"!=typeof e)throw new TypeError("argument obj is required");var r=e.parameters,t=e.type;if(!t||!G.test(t))throw new TypeError("invalid type");var n=t;if(r&&"object"==typeof r)for(var o,a=Object.keys(r).sort(),i=0;i<a.length;i++){if(o=a[i],!Z.test(o))throw new TypeError("invalid parameter name");n+="; "+o+"="+Q(r[o])}return n},parse:W};const ee={};var re={addPlugin:(e,r)=>{ee[e]=r},parse:e=>{const r=X.parse(e.headers.get("content-type")).type;if(!(r in ee))throw Error(`${e.url} is not a schema. Found a document with media type: ${r}`);return ee[r].parse(e)},getContentType:e=>{for(const r in ee)if(ee[r].matcher(e))return r;return"application/octet-stream"}};const{jsonTypeOf:te,resolveUrl:ne,urlFragment:oe,pathRelative:ae}=s,ie="https://json-schema.org/draft/2019-09/vocab/core",se="https://json-schema.org/draft/2020-12/vocab/core",ce={},ue={},le=(e,r)=>{const t=ue[e];return ce[t]?.[r]},pe={},fe={},de=(e,r="",t="")=>{e=JSON.parse(JSON.stringify(e));const n=ne(r,""),o=ne(e.$schema||t,"");if(!o)throw Error("Couldn't determine schema dialect");if(delete e.$schema,!(o in ue))if(!0===e?.$vocabulary?.[ie]&&o===he(e,n,ie)[0])ue[o]=ie;else if(!0===e?.$vocabulary?.[se]&&o===he(e,n,se)[0])ue[o]=se;else if(o===he(e,n,o)[0])ue[o]=o;else{if(!(o in pe))throw Error(`Couldn't determine JSON Schema version for dialect: '${o}'`);{const e=pe[o];!0===e.vocabulary[ie]?ue[o]=ie:!0===e.vocabulary[se]?ue[o]=se:ue[o]=ue[e.dialectId]}}const[a,i]=he(e,n,ue[o]);if(!a)throw Error("Couldn't determine an identifier for the schema");const s=le(o,"baseToken");delete e[s],n&&(fe[n]=a);const c=le(o,"anchorToken");i&&s===c&&(e[c]=c!==s?encodeURI(i):`#${encodeURI(i)}`);const u={},l=le(o,"recursiveAnchorToken");let p;!0===e[l]&&(u[""]=`${a}#`,e[c]="",delete e[l]);const f=le(o,"vocabularyToken");te(e[f],"object")?(p=e[f],delete e[f]):p={[ue[o]]:!0};const d={"":""};return pe[a]={id:a,dialectId:o,schema:ve(e,a,o,b.nil,d,u),anchors:d,dynamicAnchors:u,vocabulary:p,validated:!1},a},he=(e,r,t)=>{const n=ce[t]?.baseToken,o=ne(r,e[n]||"");return[ne(o,""),oe(o)]},ve=(e,r,t,n,o,a)=>{if(te(e,"object")){const i="string"==typeof e.$schema?ne(e.$schema,""):t,s=le(i,"embeddedToken"),c=le(i,"anchorToken");if("string"==typeof e[s]&&(s!==c||"#"!==e[s][0])){const n=ne(r,e[s]);return e[le(i,"baseToken")]=n,de(e,n,t),S.cons(e[s],e)}const u=le(t,"anchorToken"),l=le(t,"dynamicAnchorToken");"string"==typeof e[l]&&(a[e[l]]=`${r}#${encodeURI(n)}`,o[e[l]]=n,delete e[l]);const p=le(t,"embeddedToken");if("string"==typeof e[u]){const r=u!==p?e[u]:e[u].slice(1);o[r]=n,delete e[u]}const f=le(t,"jrefToken");if("string"==typeof e[f])return S.cons(e[f],e);for(const i in e)e[i]=ve(e[i],r,t,b.append(i,n),o,a);return e}return Array.isArray(e)?e.map(((e,i)=>ve(e,r,t,b.append(i,n),o,a))):e},ye=e=>pe[fe[e]]||pe[e],me=Object.freeze({id:"",dialectId:void 0,vocabulary:{},pointer:b.nil,schema:void 0,value:void 0,anchors:{},dynamicAnchors:{},validated:!0}),ge=async(e,r=me)=>{const t=ne(Ee(r),e),n=ne(t,""),o=oe(t);if(!(e=>e in pe||e in fe)(n)){const e=await V(n,{headers:{Accept:"application/schema+json"}});if(e.status>=400)throw await e.text(),Error(`Failed to retrieve schema with id: ${n}`);de(await re.parse(e),n)}const a=ye(n),i="/"!==o[0]?we(a,o):o,s=Object.freeze({...a,pointer:i,value:b.get(i,a.schema)});return be(s)},be=e=>S.isReference(e.value)?ge(S.href(e.value),e):e,we=(e,r)=>{if(!(r in e.anchors))throw Error(`No such anchor '${encodeURI(e.id)}#${encodeURI(r)}'`);return e.anchors[r]},Ee=e=>`${e.id}#${encodeURI(e.pointer)}`,Se=e=>S.isReference(e.value)?S.value(e.value):e.value,Ce=(e,r)=>{const t=ye(r.id),n=Object.freeze({...r,pointer:b.append(e,r.pointer),value:Se(r)[e],validated:t.validated});return be(n)},Oe=e(((e,r)=>H.pipeline([Se,H.map((async(t,n)=>e(await Ce(n,r),n))),H.all],r))),Ae={parentId:"",parentDialect:"",includeEmbedded:!0},Ie=(e,r)=>{if(r.startsWith("file://")){const t=e.slice(7,e.lastIndexOf("/"));return""===e?"":ae(t,r.slice(7))}return r};var Te={setConfig:(e,r,t)=>{ce[e]||(ce[e]={}),ce[e][r]=t},getConfig:le,add:de,get:ge,markValidated:e=>{pe[e].validated=!0},uri:Ee,value:Se,getAnchorPointer:we,typeOf:(e,r)=>te(Se(e),r),has:(e,r)=>e in Se(r),step:Ce,keys:e=>Object.keys(Se(e)),entries:e=>H.pipeline([Se,Object.keys,H.map((async r=>[r,await Ce(r,e)])),H.all],e),map:Oe,length:e=>Se(e).length,toSchema:(e,r={})=>{const t={...Ae,...r},n=JSON.parse(JSON.stringify(e.schema,((r,n)=>{if(!S.isReference(n))return n;const o=S.value(n),a="string"==typeof o.$schema?ne(o.$schema,""):e.dialectId,i=le(a,"embeddedToken");return!t.includeEmbedded&&i in o?void 0:S.value(n)}))),o=le(e.dialectId,"dynamicAnchorToken");Object.entries(e.dynamicAnchors).forEach((([e,r])=>{const t=oe(r);b.assign(t,n,{[o]:e,...b.get(t,n)})}));const a=le(e.dialectId,"anchorToken");Object.entries(e.anchors).filter((([e])=>""!==e)).forEach((([e,r])=>{b.assign(r,n,{[a]:e,...b.get(r,n)})}));const i=le(e.dialectId,"baseToken"),s=Ie(t.parentId,e.id),c=t.parentDialect===e.dialectId?"":e.dialectId;return{...s&&{[i]:s},...c&&{$schema:c},...n}}};Te.setConfig,Te.getConfig,Te.add,Te.get,Te.markValidated,Te.uri,Te.value,Te.getAnchorPointer,Te.typeOf,Te.has,Te.step,Te.keys,Te.entries,Te.map,Te.length,Te.toSchema;class je extends Error{constructor(e){super("Invalid Schema"),this.name=this.constructor.name,this.output=e}}var xe=je;const{resolveUrl:Pe}=s,$e="FLAG",De="BASIC",Re="DETAILED",Ne="VERBOSE";let Fe=Re,_e=!0;re.addPlugin("application/schema+json",{parse:async e=>await e.json(),matcher:e=>e.endsWith(".schema.json")});const ke=async e=>{const r={metaData:{}};return{ast:r,schemaUri:await Me(e,r)}},Ue=e((({ast:e,schemaUri:r},t,o=$e)=>{if(![$e,De,Re,Ne].includes(o))throw Error(`The '${o}' error format is not supported`);const a=[],i=n.subscribe("result",qe(o,a));return Je(r,t,e,{}),n.unsubscribe(i),a[0]})),qe=(e,r)=>{const t=[];return(n,o)=>{if("result"===n){const{keyword:e,absoluteKeywordLocation:r,instanceLocation:n,valid:a}=o,i={keyword:e,absoluteKeywordLocation:r,instanceLocation:n,valid:a,errors:[]};t.push(i)}else if("result.start"===n)t.push(n);else if("result.end"===n){const n=t.pop();for(;"result.start"!==t[t.length-1];){const r=t.pop(),o=[r];e===De&&(o.push(...r.errors),delete r.errors),(e===Ne||e!==$e&&!r.valid)&&n.errors.unshift(...o)}t[t.length-1]=n,r[0]=n}}},Le={},ze=e=>Le[e],He=e=>e in Le,Ve={},Ke={},Me=async(e,r)=>{if(e=await Ze(e),!He(`${e.dialectId}#validate`)){const r=await Te.get(e.dialectId);(Te.getConfig(r.id,"mandatoryVocabularies")||[]).forEach((e=>{if(!r.vocabulary[e])throw Error(`Vocabulary '${e}' must be explicitly declared and required`)})),Object.entries(r.vocabulary).forEach((([e,t])=>{if(e in Ve)Object.entries(Ve[e]).forEach((([e,t])=>{((e,r)=>{Le[e]={collectEvaluatedItems:(e,t,n,o,a)=>r.interpret(e,t,n,o,a)&&new Set,collectEvaluatedProperties:(e,t,n,o,a)=>r.interpret(e,t,n,o,a)&&[],...r}})(`${r.id}#${e}`,t)}));else if(t)throw Error(`Missing required vocabulary: ${e}`)}))}if(_e&&!e.validated){if(Te.markValidated(e.id),!(e.dialectId in Ke)){const r=await Te.get(e.dialectId),t=await ke(r);Ke[r.id]=Ue(t)}const r=N.cons(e.schema,e.id),t=Ke[e.dialectId](r,Fe);if(!t.valid)throw new xe(t)}return e.id in r.metaData||(r.metaData[e.id]={id:e.id,dynamicAnchors:e.dynamicAnchors,anchors:e.anchors}),ze(`${e.dialectId}#validate`).compile(e,r)},Ze=async e=>Te.typeOf(e,"string")?Ze(await Te.get(Te.value(e),e)):e,Je=(e,r,t,n)=>{const o=Be(e,t),a=Pe(e,"");return ze(o).interpret(e,r,t,{...t.metaData[a].dynamicAnchors,...n})},Be=(e,r)=>{if(!(e in r))throw Error(`No schema found at ${e}`);return r[e][0]};var Ge={validate:async(e,r,t)=>{const n=await ke(e),o=(e,r)=>Ue(n,N.cons(e),r);return void 0===r?o:o(r,t)},compile:ke,interpret:Ue,setMetaOutputFormat:e=>{Fe=e},setShouldMetaValidate:e=>{_e=e},FLAG:$e,BASIC:De,DETAILED:Re,VERBOSE:Ne,add:(e,r="",t="")=>{const n=Te.add(e,r,t);delete Ke[n]},getKeyword:ze,hasKeyword:He,defineVocabulary:(e,r)=>{Ve[e]=r},compileSchema:Me,interpretSchema:Je,collectEvaluatedProperties:(e,r,t,n,o)=>{const a=Be(e,t);return ze(a).collectEvaluatedProperties(e,r,t,n,o)},collectEvaluatedItems:(e,r,t,n,o)=>{const a=Be(e,t);return ze(a).collectEvaluatedItems(e,r,t,n,o)},addMediaTypePlugin:re.addPlugin};var We={compile:e=>Te.value(e),interpret:()=>!0};var Qe={compile:async(e,r)=>{const t=Te.uri(e);if(!(t in r)){r[t]=!1;const n=Te.value(e);if(!["object","boolean"].includes(typeof n))throw Error(`No schema found at '${Te.uri(e)}'`);r[t]=[`${e.dialectId}#validate`,Te.uri(e),"boolean"==typeof n?n:await H.pipeline([Te.entries,H.map((([r,t])=>[`${e.dialectId}#${r}`,t])),H.filter((([r])=>Ge.hasKeyword(r)&&r!==`${e.dialectId}#validate`)),H.map((async([t,n])=>{const o=await Ge.getKeyword(t).compile(n,r,e);return[t,Te.uri(n),o]})),H.all],e)]}return t},interpret:(e,r,t,o)=>{const[a,i,s]=t[e];n.publishSync("result.start");const c="boolean"==typeof s?s:s.every((([e,a,i])=>{n.publishSync("result.start");const s=Ge.getKeyword(e).interpret(i,r,t,o);return n.publishSync("result",{keyword:e,absoluteKeywordLocation:a,instanceLocation:N.uri(r),valid:s,ast:i}),n.publishSync("result.end"),s}));return n.publishSync("result",{keyword:a,absoluteKeywordLocation:i,instanceLocation:N.uri(r),valid:c,ast:e}),n.publishSync("result.end"),c},collectEvaluatedProperties:(e,r,t,n,o=!1)=>{const a=t[e][2];return"boolean"==typeof a?!!a&&[]:a.filter((([e])=>!o||!e.endsWith("#unevaluatedProperties"))).reduce(((e,[o,,a])=>{const i=e&&Ge.getKeyword(o).collectEvaluatedProperties(a,r,t,n);return!1!==i&&[...e,...i]}),[])},collectEvaluatedItems:(e,r,t,n,o=!1)=>{const a=t[e][2];return"boolean"==typeof a?!!a&&new Set:a.filter((([e])=>!o||!e.endsWith("#unevaluatedItems"))).reduce(((e,[o,,a])=>{const i=!1!==e&&Ge.getKeyword(o).collectEvaluatedItems(a,r,t,n);return!1!==i&&new Set([...e,...i])}),new Set)}},Ye={metaData:We,validate:Qe},Xe={Core:Ge,Schema:Te,Instance:N,Reference:S,Keywords:Ye,InvalidSchemaError:xe},er=Xe.Core,rr=Xe.Schema,tr=Xe.Instance,nr=Xe.Reference,or=Xe.Keywords,ar=Xe.InvalidSchemaError;export{er as Core,tr as Instance,ar as InvalidSchemaError,or as Keywords,nr as Reference,rr as Schema,Xe as default}; | ||
//# sourceMappingURL=json-schema-core-esm.min.js.map |
var JSC=function(e){"use strict";var r=function(e,r){return function t(){null==r&&(r=e.length);var n=[].slice.call(arguments);return n.length>=r?e.apply(this,n):function(){return t.apply(this,n.concat([].slice.call(arguments)))}}};var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function n(e,r){return e(r={exports:{}},r.exports),r.exports}var o=n((function(e,r){var n,o;n="object"==typeof window&&window||t,o={},n.PubSub?(o=n.PubSub,console.warn("PubSub already loaded, using existing version")):(n.PubSub=o,function(e){var r={},t=-1,n="*";function o(e){var r;for(r in e)if(Object.prototype.hasOwnProperty.call(e,r))return!0;return!1}function a(e){return function(){throw e}}function i(e,r,t){try{e(r,t)}catch(e){setTimeout(a(e),0)}}function s(e,r,t){e(r,t)}function c(e,t,n,o){var a,c=r[t],u=o?s:i;if(Object.prototype.hasOwnProperty.call(r,t))for(a in c)Object.prototype.hasOwnProperty.call(c,a)&&u(c[a],e,n)}function u(e,r,t){return function(){var o=String(e),a=o.lastIndexOf(".");for(c(e,e,r,t);-1!==a;)a=(o=o.substr(0,a)).lastIndexOf("."),c(e,o,r,t);c(e,n,r,t)}}function l(e){var t=String(e);return Boolean(Object.prototype.hasOwnProperty.call(r,t)&&o(r[t]))}function p(e){for(var r=String(e),t=l(r)||l(n),o=r.lastIndexOf(".");!t&&-1!==o;)o=(r=r.substr(0,o)).lastIndexOf("."),t=l(r);return t}function f(e,r,t,n){var o=u(e="symbol"==typeof e?e.toString():e,r,n);return!!p(e)&&(!0===t?o():setTimeout(o,0),!0)}e.publish=function(r,t){return f(r,t,!1,e.immediateExceptions)},e.publishSync=function(r,t){return f(r,t,!0,e.immediateExceptions)},e.subscribe=function(e,n){if("function"!=typeof n)return!1;e="symbol"==typeof e?e.toString():e,Object.prototype.hasOwnProperty.call(r,e)||(r[e]={});var o="uid_"+String(++t);return r[e][o]=n,o},e.subscribeAll=function(r){return e.subscribe(n,r)},e.subscribeOnce=function(r,t){var n=e.subscribe(r,(function(){e.unsubscribe(n),t.apply(this,arguments)}));return e},e.clearAllSubscriptions=function(){r={}},e.clearSubscriptions=function(e){var t;for(t in r)Object.prototype.hasOwnProperty.call(r,t)&&0===t.indexOf(e)&&delete r[t]},e.countSubscriptions=function(e){var t,n,o=0;for(t in r)if(Object.prototype.hasOwnProperty.call(r,t)&&0===t.indexOf(e)){for(n in r[t])o++;break}return o},e.getSubscriptions=function(e){var t,n=[];for(t in r)Object.prototype.hasOwnProperty.call(r,t)&&0===t.indexOf(e)&&n.push(t);return n},e.unsubscribe=function(t){var n,o,a,i=function(e){var t;for(t in r)if(Object.prototype.hasOwnProperty.call(r,t)&&0===t.indexOf(e))return!0;return!1},s="string"==typeof t&&(Object.prototype.hasOwnProperty.call(r,t)||i(t)),c=!s&&"string"==typeof t,u="function"==typeof t,l=!1;if(!s){for(n in r)if(Object.prototype.hasOwnProperty.call(r,n)){if(o=r[n],c&&o[t]){delete o[t],l=t;break}if(u)for(a in o)Object.prototype.hasOwnProperty.call(o,a)&&o[a]===t&&(delete o[a],l=!0)}return l}e.clearSubscriptions(t)}}(o)),void 0!==e&&e.exports&&(r=e.exports=o),r.PubSub=o,e.exports=r=o}));o.PubSub;var a,i=n((function(e,r){ | ||
/** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */ | ||
!function(e){function r(){for(var e=arguments.length,r=Array(e),t=0;t<e;t++)r[t]=arguments[t];if(r.length>1){r[0]=r[0].slice(0,-1);for(var n=r.length-1,o=1;o<n;++o)r[o]=r[o].slice(1,-1);return r[n]=r[n].slice(1),r.join("")}return r[0]}function t(e){return"(?:"+e+")"}function n(e){return void 0===e?"undefined":null===e?"null":Object.prototype.toString.call(e).split(" ").pop().split("]").shift().toLowerCase()}function o(e){return e.toUpperCase()}function a(e){return null!=e?e instanceof Array?e:"number"!=typeof e.length||e.split||e.setInterval||e.call?[e]:Array.prototype.slice.call(e):[]}function i(e,r){var t=e;if(r)for(var n in r)t[n]=r[n];return t}function s(e){var n="[A-Za-z]",o="[0-9]",a=r(o,"[A-Fa-f]"),i=t(t("%[EFef]"+a+"%"+a+a+"%"+a+a)+"|"+t("%[89A-Fa-f]"+a+"%"+a+a)+"|"+t("%"+a+a)),s="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",c=r("[\\:\\/\\?\\#\\[\\]\\@]",s),u=e?"[\\uE000-\\uF8FF]":"[]",l=r(n,o,"[\\-\\.\\_\\~]",e?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]");t(n+r(n,o,"[\\+\\-\\.]")+"*"),t(t(i+"|"+r(l,s,"[\\:]"))+"*");var p=t(t("25[0-5]")+"|"+t("2[0-4]"+o)+"|"+t("1"+o+o)+"|"+t("0?[1-9]"+o)+"|0?0?"+o),f=t(p+"\\."+p+"\\."+p+"\\."+p),d=t(a+"{1,4}"),h=t(t(d+"\\:"+d)+"|"+f),v=t(t(d+"\\:")+"{6}"+h),y=t("\\:\\:"+t(d+"\\:")+"{5}"+h),m=t(t(d)+"?\\:\\:"+t(d+"\\:")+"{4}"+h),g=t(t(t(d+"\\:")+"{0,1}"+d)+"?\\:\\:"+t(d+"\\:")+"{3}"+h),b=t(t(t(d+"\\:")+"{0,2}"+d)+"?\\:\\:"+t(d+"\\:")+"{2}"+h),w=t(t(t(d+"\\:")+"{0,3}"+d)+"?\\:\\:"+d+"\\:"+h),E=t(t(t(d+"\\:")+"{0,4}"+d)+"?\\:\\:"+h),S=t(t(t(d+"\\:")+"{0,5}"+d)+"?\\:\\:"+d),C=t(t(t(d+"\\:")+"{0,6}"+d)+"?\\:\\:"),O=t([v,y,m,g,b,w,E,S,C].join("|")),A=t(t(l+"|"+i)+"+");t("[vV]"+a+"+\\."+r(l,s,"[\\:]")+"+"),t(t(i+"|"+r(l,s))+"*");var I=t(i+"|"+r(l,s,"[\\:\\@]"));return t(t(i+"|"+r(l,s,"[\\@]"))+"+"),t(t(I+"|"+r("[\\/\\?]",u))+"*"),{NOT_SCHEME:new RegExp(r("[^]",n,o,"[\\+\\-\\.]"),"g"),NOT_USERINFO:new RegExp(r("[^\\%\\:]",l,s),"g"),NOT_HOST:new RegExp(r("[^\\%\\[\\]\\:]",l,s),"g"),NOT_PATH:new RegExp(r("[^\\%\\/\\:\\@]",l,s),"g"),NOT_PATH_NOSCHEME:new RegExp(r("[^\\%\\/\\@]",l,s),"g"),NOT_QUERY:new RegExp(r("[^\\%]",l,s,"[\\:\\@\\/\\?]",u),"g"),NOT_FRAGMENT:new RegExp(r("[^\\%]",l,s,"[\\:\\@\\/\\?]"),"g"),ESCAPE:new RegExp(r("[^]",l,s),"g"),UNRESERVED:new RegExp(l,"g"),OTHER_CHARS:new RegExp(r("[^\\%]",l,c),"g"),PCT_ENCODED:new RegExp(i,"g"),IPV4ADDRESS:new RegExp("^("+f+")$"),IPV6ADDRESS:new RegExp("^\\[?("+O+")"+t(t("\\%25|\\%(?!"+a+"{2})")+"("+A+")")+"?\\]?$")}}var c=s(!1),u=s(!0),l=function(){function e(e,r){var t=[],n=!0,o=!1,a=void 0;try{for(var i,s=e[Symbol.iterator]();!(n=(i=s.next()).done)&&(t.push(i.value),!r||t.length!==r);n=!0);}catch(e){o=!0,a=e}finally{try{!n&&s.return&&s.return()}finally{if(o)throw a}}return t}return function(r,t){if(Array.isArray(r))return r;if(Symbol.iterator in Object(r))return e(r,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),p=function(e){if(Array.isArray(e)){for(var r=0,t=Array(e.length);r<e.length;r++)t[r]=e[r];return t}return Array.from(e)},f=2147483647,d=36,h=1,v=26,y=38,m=700,g=72,b=128,w="-",E=/^xn--/,S=/[^\0-\x7E]/,C=/[\x2E\u3002\uFF0E\uFF61]/g,O={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},A=d-h,I=Math.floor,j=String.fromCharCode;function T(e){throw new RangeError(O[e])}function x(e,r){for(var t=[],n=e.length;n--;)t[n]=r(e[n]);return t}function $(e,r){var t=e.split("@"),n="";return t.length>1&&(n=t[0]+"@",e=t[1]),n+x((e=e.replace(C,".")).split("."),r).join(".")}function D(e){for(var r=[],t=0,n=e.length;t<n;){var o=e.charCodeAt(t++);if(o>=55296&&o<=56319&&t<n){var a=e.charCodeAt(t++);56320==(64512&a)?r.push(((1023&o)<<10)+(1023&a)+65536):(r.push(o),t--)}else r.push(o)}return r}var P=function(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:d},R=function(e,r){return e+22+75*(e<26)-((0!=r)<<5)},N=function(e,r,t){var n=0;for(e=t?I(e/m):e>>1,e+=I(e/r);e>A*v>>1;n+=d)e=I(e/A);return I(n+(A+1)*e/(e+y))},_=function(e){var r=[],t=e.length,n=0,o=b,a=g,i=e.lastIndexOf(w);i<0&&(i=0);for(var s=0;s<i;++s)e.charCodeAt(s)>=128&&T("not-basic"),r.push(e.charCodeAt(s));for(var c=i>0?i+1:0;c<t;){for(var u=n,l=1,p=d;;p+=d){c>=t&&T("invalid-input");var y=P(e.charCodeAt(c++));(y>=d||y>I((f-n)/l))&&T("overflow"),n+=y*l;var m=p<=a?h:p>=a+v?v:p-a;if(y<m)break;var E=d-m;l>I(f/E)&&T("overflow"),l*=E}var S=r.length+1;a=N(n-u,S,0==u),I(n/S)>f-o&&T("overflow"),o+=I(n/S),n%=S,r.splice(n++,0,o)}return String.fromCodePoint.apply(String,r)},F=function(e){var r=[],t=(e=D(e)).length,n=b,o=0,a=g,i=!0,s=!1,c=void 0;try{for(var u,l=e[Symbol.iterator]();!(i=(u=l.next()).done);i=!0){var p=u.value;p<128&&r.push(j(p))}}catch(e){s=!0,c=e}finally{try{!i&&l.return&&l.return()}finally{if(s)throw c}}var y=r.length,m=y;for(y&&r.push(w);m<t;){var E=f,S=!0,C=!1,O=void 0;try{for(var A,x=e[Symbol.iterator]();!(S=(A=x.next()).done);S=!0){var $=A.value;$>=n&&$<E&&(E=$)}}catch(e){C=!0,O=e}finally{try{!S&&x.return&&x.return()}finally{if(C)throw O}}var P=m+1;E-n>I((f-o)/P)&&T("overflow"),o+=(E-n)*P,n=E;var _=!0,F=!1,k=void 0;try{for(var U,q=e[Symbol.iterator]();!(_=(U=q.next()).done);_=!0){var L=U.value;if(L<n&&++o>f&&T("overflow"),L==n){for(var z=o,H=d;;H+=d){var V=H<=a?h:H>=a+v?v:H-a;if(z<V)break;var K=z-V,M=d-V;r.push(j(R(V+K%M,0))),z=I(K/M)}r.push(j(R(z,0))),a=N(o,P,m==y),o=0,++m}}}catch(e){F=!0,k=e}finally{try{!_&&q.return&&q.return()}finally{if(F)throw k}}++o,++n}return r.join("")},k=function(e){return $(e,(function(e){return E.test(e)?_(e.slice(4).toLowerCase()):e}))},U=function(e){return $(e,(function(e){return S.test(e)?"xn--"+F(e):e}))},q={version:"2.1.0",ucs2:{decode:D,encode:function(e){return String.fromCodePoint.apply(String,p(e))}},decode:_,encode:F,toASCII:U,toUnicode:k},L={};function z(e){var r=e.charCodeAt(0);return r<16?"%0"+r.toString(16).toUpperCase():r<128?"%"+r.toString(16).toUpperCase():r<2048?"%"+(r>>6|192).toString(16).toUpperCase()+"%"+(63&r|128).toString(16).toUpperCase():"%"+(r>>12|224).toString(16).toUpperCase()+"%"+(r>>6&63|128).toString(16).toUpperCase()+"%"+(63&r|128).toString(16).toUpperCase()}function H(e){for(var r="",t=0,n=e.length;t<n;){var o=parseInt(e.substr(t+1,2),16);if(o<128)r+=String.fromCharCode(o),t+=3;else if(o>=194&&o<224){if(n-t>=6){var a=parseInt(e.substr(t+4,2),16);r+=String.fromCharCode((31&o)<<6|63&a)}else r+=e.substr(t,6);t+=6}else if(o>=224){if(n-t>=9){var i=parseInt(e.substr(t+4,2),16),s=parseInt(e.substr(t+7,2),16);r+=String.fromCharCode((15&o)<<12|(63&i)<<6|63&s)}else r+=e.substr(t,9);t+=9}else r+=e.substr(t,3),t+=3}return r}function V(e,r){function t(e){var t=H(e);return t.match(r.UNRESERVED)?t:e}return e.scheme&&(e.scheme=String(e.scheme).replace(r.PCT_ENCODED,t).toLowerCase().replace(r.NOT_SCHEME,"")),void 0!==e.userinfo&&(e.userinfo=String(e.userinfo).replace(r.PCT_ENCODED,t).replace(r.NOT_USERINFO,z).replace(r.PCT_ENCODED,o)),void 0!==e.host&&(e.host=String(e.host).replace(r.PCT_ENCODED,t).toLowerCase().replace(r.NOT_HOST,z).replace(r.PCT_ENCODED,o)),void 0!==e.path&&(e.path=String(e.path).replace(r.PCT_ENCODED,t).replace(e.scheme?r.NOT_PATH:r.NOT_PATH_NOSCHEME,z).replace(r.PCT_ENCODED,o)),void 0!==e.query&&(e.query=String(e.query).replace(r.PCT_ENCODED,t).replace(r.NOT_QUERY,z).replace(r.PCT_ENCODED,o)),void 0!==e.fragment&&(e.fragment=String(e.fragment).replace(r.PCT_ENCODED,t).replace(r.NOT_FRAGMENT,z).replace(r.PCT_ENCODED,o)),e}function K(e){return e.replace(/^0*(.*)/,"$1")||"0"}function M(e,r){var t=e.match(r.IPV4ADDRESS)||[],n=l(t,2)[1];return n?n.split(".").map(K).join("."):e}function Z(e,r){var t=e.match(r.IPV6ADDRESS)||[],n=l(t,3),o=n[1],a=n[2];if(o){for(var i=o.toLowerCase().split("::").reverse(),s=l(i,2),c=s[0],u=s[1],p=u?u.split(":").map(K):[],f=c.split(":").map(K),d=r.IPV4ADDRESS.test(f[f.length-1]),h=d?7:8,v=f.length-h,y=Array(h),m=0;m<h;++m)y[m]=p[m]||f[v+m]||"";d&&(y[h-1]=M(y[h-1],r));var g=y.reduce((function(e,r,t){if(!r||"0"===r){var n=e[e.length-1];n&&n.index+n.length===t?n.length++:e.push({index:t,length:1})}return e}),[]).sort((function(e,r){return r.length-e.length}))[0],b=void 0;if(g&&g.length>1){var w=y.slice(0,g.index),E=y.slice(g.index+g.length);b=w.join(":")+"::"+E.join(":")}else b=y.join(":");return a&&(b+="%"+a),b}return e}var J=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,B=void 0==="".match(/(){0}/)[1];function G(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t={},n=!1!==r.iri?u:c;"suffix"===r.reference&&(e=(r.scheme?r.scheme+":":"")+"//"+e);var o=e.match(J);if(o){B?(t.scheme=o[1],t.userinfo=o[3],t.host=o[4],t.port=parseInt(o[5],10),t.path=o[6]||"",t.query=o[7],t.fragment=o[8],isNaN(t.port)&&(t.port=o[5])):(t.scheme=o[1]||void 0,t.userinfo=-1!==e.indexOf("@")?o[3]:void 0,t.host=-1!==e.indexOf("//")?o[4]:void 0,t.port=parseInt(o[5],10),t.path=o[6]||"",t.query=-1!==e.indexOf("?")?o[7]:void 0,t.fragment=-1!==e.indexOf("#")?o[8]:void 0,isNaN(t.port)&&(t.port=e.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?o[4]:void 0)),t.host&&(t.host=Z(M(t.host,n),n)),void 0!==t.scheme||void 0!==t.userinfo||void 0!==t.host||void 0!==t.port||t.path||void 0!==t.query?void 0===t.scheme?t.reference="relative":void 0===t.fragment?t.reference="absolute":t.reference="uri":t.reference="same-document",r.reference&&"suffix"!==r.reference&&r.reference!==t.reference&&(t.error=t.error||"URI is not a "+r.reference+" reference.");var a=L[(r.scheme||t.scheme||"").toLowerCase()];if(r.unicodeSupport||a&&a.unicodeSupport)V(t,n);else{if(t.host&&(r.domainHost||a&&a.domainHost))try{t.host=q.toASCII(t.host.replace(n.PCT_ENCODED,H).toLowerCase())}catch(e){t.error=t.error||"Host's domain name can not be converted to ASCII via punycode: "+e}V(t,c)}a&&a.parse&&a.parse(t,r)}else t.error=t.error||"URI can not be parsed.";return t}function W(e,r){var t=!1!==r.iri?u:c,n=[];return void 0!==e.userinfo&&(n.push(e.userinfo),n.push("@")),void 0!==e.host&&n.push(Z(M(String(e.host),t),t).replace(t.IPV6ADDRESS,(function(e,r,t){return"["+r+(t?"%25"+t:"")+"]"}))),"number"!=typeof e.port&&"string"!=typeof e.port||(n.push(":"),n.push(String(e.port))),n.length?n.join(""):void 0}var Q=/^\.\.?\//,Y=/^\/\.(\/|$)/,X=/^\/\.\.(\/|$)/,ee=/^\/?(?:.|\n)*?(?=\/|$)/;function re(e){for(var r=[];e.length;)if(e.match(Q))e=e.replace(Q,"");else if(e.match(Y))e=e.replace(Y,"/");else if(e.match(X))e=e.replace(X,"/"),r.pop();else if("."===e||".."===e)e="";else{var t=e.match(ee);if(!t)throw new Error("Unexpected dot segment condition");var n=t[0];e=e.slice(n.length),r.push(n)}return r.join("")}function te(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=r.iri?u:c,n=[],o=L[(r.scheme||e.scheme||"").toLowerCase()];if(o&&o.serialize&&o.serialize(e,r),e.host)if(t.IPV6ADDRESS.test(e.host));else if(r.domainHost||o&&o.domainHost)try{e.host=r.iri?q.toUnicode(e.host):q.toASCII(e.host.replace(t.PCT_ENCODED,H).toLowerCase())}catch(t){e.error=e.error||"Host's domain name can not be converted to "+(r.iri?"Unicode":"ASCII")+" via punycode: "+t}V(e,t),"suffix"!==r.reference&&e.scheme&&(n.push(e.scheme),n.push(":"));var a=W(e,r);if(void 0!==a&&("suffix"!==r.reference&&n.push("//"),n.push(a),e.path&&"/"!==e.path.charAt(0)&&n.push("/")),void 0!==e.path){var i=e.path;r.absolutePath||o&&o.absolutePath||(i=re(i)),void 0===a&&(i=i.replace(/^\/\//,"/%2F")),n.push(i)}return void 0!==e.query&&(n.push("?"),n.push(e.query)),void 0!==e.fragment&&(n.push("#"),n.push(e.fragment)),n.join("")}function ne(e,r){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n={};return arguments[3]||(e=G(te(e,t),t),r=G(te(r,t),t)),!(t=t||{}).tolerant&&r.scheme?(n.scheme=r.scheme,n.userinfo=r.userinfo,n.host=r.host,n.port=r.port,n.path=re(r.path||""),n.query=r.query):(void 0!==r.userinfo||void 0!==r.host||void 0!==r.port?(n.userinfo=r.userinfo,n.host=r.host,n.port=r.port,n.path=re(r.path||""),n.query=r.query):(r.path?("/"===r.path.charAt(0)?n.path=re(r.path):(void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?n.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+r.path:n.path=r.path:n.path="/"+r.path,n.path=re(n.path)),n.query=r.query):(n.path=e.path,void 0!==r.query?n.query=r.query:n.query=e.query),n.userinfo=e.userinfo,n.host=e.host,n.port=e.port),n.scheme=e.scheme),n.fragment=r.fragment,n}function oe(e,r,t){var n=i({scheme:"null"},t);return te(ne(G(e,n),G(r,n),n,!0),n)}function ae(e,r){return"string"==typeof e?e=te(G(e,r),r):"object"===n(e)&&(e=G(te(e,r),r)),e}function ie(e,r,t){return"string"==typeof e?e=te(G(e,t),t):"object"===n(e)&&(e=te(e,t)),"string"==typeof r?r=te(G(r,t),t):"object"===n(r)&&(r=te(r,t)),e===r}function se(e,r){return e&&e.toString().replace(r&&r.iri?u.ESCAPE:c.ESCAPE,z)}function ce(e,r){return e&&e.toString().replace(r&&r.iri?u.PCT_ENCODED:c.PCT_ENCODED,H)}var ue={scheme:"http",domainHost:!0,parse:function(e,r){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e},serialize:function(e,r){var t="https"===String(e.scheme).toLowerCase();return e.port!==(t?443:80)&&""!==e.port||(e.port=void 0),e.path||(e.path="/"),e}},le={scheme:"https",domainHost:ue.domainHost,parse:ue.parse,serialize:ue.serialize};function pe(e){return"boolean"==typeof e.secure?e.secure:"wss"===String(e.scheme).toLowerCase()}var fe={scheme:"ws",domainHost:!0,parse:function(e,r){var t=e;return t.secure=pe(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t},serialize:function(e,r){if(e.port!==(pe(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 t=e.resourceName.split("?"),n=l(t,2),o=n[0],a=n[1];e.path=o&&"/"!==o?o:void 0,e.query=a,e.resourceName=void 0}return e.fragment=void 0,e}},de={scheme:"wss",domainHost:fe.domainHost,parse:fe.parse,serialize:fe.serialize},he={},ve="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",ye="[0-9A-Fa-f]",me=t(t("%[EFef]"+ye+"%"+ye+ye+"%"+ye+ye)+"|"+t("%[89A-Fa-f]"+ye+"%"+ye+ye)+"|"+t("%"+ye+ye)),ge="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]",be=r("[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",'[\\"\\\\]'),we="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]",Ee=new RegExp(ve,"g"),Se=new RegExp(me,"g"),Ce=new RegExp(r("[^]",ge,"[\\.]",'[\\"]',be),"g"),Oe=new RegExp(r("[^]",ve,we),"g"),Ae=Oe;function Ie(e){var r=H(e);return r.match(Ee)?r:e}var je={scheme:"mailto",parse:function(e,r){var t=e,n=t.to=t.path?t.path.split(","):[];if(t.path=void 0,t.query){for(var o=!1,a={},i=t.query.split("&"),s=0,c=i.length;s<c;++s){var u=i[s].split("=");switch(u[0]){case"to":for(var l=u[1].split(","),p=0,f=l.length;p<f;++p)n.push(l[p]);break;case"subject":t.subject=ce(u[1],r);break;case"body":t.body=ce(u[1],r);break;default:o=!0,a[ce(u[0],r)]=ce(u[1],r)}}o&&(t.headers=a)}t.query=void 0;for(var d=0,h=n.length;d<h;++d){var v=n[d].split("@");if(v[0]=ce(v[0]),r.unicodeSupport)v[1]=ce(v[1],r).toLowerCase();else try{v[1]=q.toASCII(ce(v[1],r).toLowerCase())}catch(e){t.error=t.error||"Email address's domain name can not be converted to ASCII via punycode: "+e}n[d]=v.join("@")}return t},serialize:function(e,r){var t=e,n=a(e.to);if(n){for(var i=0,s=n.length;i<s;++i){var c=String(n[i]),u=c.lastIndexOf("@"),l=c.slice(0,u).replace(Se,Ie).replace(Se,o).replace(Ce,z),p=c.slice(u+1);try{p=r.iri?q.toUnicode(p):q.toASCII(ce(p,r).toLowerCase())}catch(e){t.error=t.error||"Email address's domain name can not be converted to "+(r.iri?"Unicode":"ASCII")+" via punycode: "+e}n[i]=l+"@"+p}t.path=n.join(",")}var f=e.headers=e.headers||{};e.subject&&(f.subject=e.subject),e.body&&(f.body=e.body);var d=[];for(var h in f)f[h]!==he[h]&&d.push(h.replace(Se,Ie).replace(Se,o).replace(Oe,z)+"="+f[h].replace(Se,Ie).replace(Se,o).replace(Ae,z));return d.length&&(t.query=d.join("&")),t}},Te=/^([^\:]+)\:(.*)/,xe={scheme:"urn",parse:function(e,r){var t=e.path&&e.path.match(Te),n=e;if(t){var o=r.scheme||n.scheme||"urn",a=t[1].toLowerCase(),i=t[2],s=o+":"+(r.nid||a),c=L[s];n.nid=a,n.nss=i,n.path=void 0,c&&(n=c.parse(n,r))}else n.error=n.error||"URN can not be parsed.";return n},serialize:function(e,r){var t=r.scheme||e.scheme||"urn",n=e.nid,o=t+":"+(r.nid||n),a=L[o];a&&(e=a.serialize(e,r));var i=e,s=e.nss;return i.path=(n||r.nid)+":"+s,i}},$e=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/,De={scheme:"urn:uuid",parse:function(e,r){var t=e;return t.uuid=t.nss,t.nss=void 0,r.tolerant||t.uuid&&t.uuid.match($e)||(t.error=t.error||"UUID is not valid."),t},serialize:function(e,r){var t=e;return t.nss=(e.uuid||"").toLowerCase(),t}};L[ue.scheme]=ue,L[le.scheme]=le,L[fe.scheme]=fe,L[de.scheme]=de,L[je.scheme]=je,L[xe.scheme]=xe,L[De.scheme]=De,e.SCHEMES=L,e.pctEncChar=z,e.pctDecChars=H,e.parse=G,e.removeDotSegments=re,e.serialize=te,e.resolveComponents=ne,e.resolve=oe,e.normalize=ae,e.equal=ie,e.escapeComponent=se,e.unescapeComponent=ce,Object.defineProperty(e,"__esModule",{value:!0})}(r)}));(a=i)&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")&&a.default;const s={null:e=>null===e,boolean:e=>"boolean"==typeof e,object:e=>"object"==typeof e&&!Array.isArray(e)&&null!==e,array:e=>Array.isArray(e),number:e=>"number"==typeof e,integer:e=>Number.isInteger(e),string:e=>"string"==typeof e};var c={jsonTypeOf:(e,r)=>s[r](e),resolveUrl:(e,r)=>{const t=i.resolve(e,r,{iri:!0});if(i.resolve(e,"",{iri:!0})&&"file"===i.parse(t).scheme&&"file"!==i.parse(e).scheme)throw Error(`Can't access file '${t}' resource from network context '${e}'`);return t},urlFragment:e=>i.unescapeComponent(i.parse(e).fragment)||"",pathRelative:(e,r)=>{if(e===r)return"";let t=1;const n=e.length-1,o=r.length-t,a=n<o?n:o;let i=-1,s=0;for(;s<a;s++){const n=e.charCodeAt(s+1);if(n!==r.charCodeAt(t+s))break;47===n&&(i=s)}if(o>a){if(47===r.charCodeAt(t+s))return r.slice(t+s+1);if(0===s)return r.slice(t+s)}n>a&&(47===e.charCodeAt(s+1)?i=s:0===a&&(i=0));let c="";for(s=i+2;s<=e.length;++s)s!==e.length&&47!==e.charCodeAt(s)||(c+=0===c.length?"..":"/..");return t+=i,c.length>0?`${c}${r.slice(t,r.length)}`:(47===r.charCodeAt(t)&&++t,r.slice(t,r.length))}};const u=e=>{if(e.length>0&&"/"!==e[0])throw Error("Invalid JSON Pointer");return e.split("/").slice(1).map(y)},l=(e,r,t,n)=>{if(0===e.length)return t;if(e.length>1){const o=e.shift();return{...r,[o]:l(e,g(r,o,n),t,h(o,n))}}if(Array.isArray(r)){const n=[...r];return n[m(r,e[0])]=t,n}return"object"==typeof r&&null!==r?{...r,[e[0]]:t}:g(r,e[0],n)},p=(e,r,t,n)=>{if(0!==e.length)if(1!==e.length||b(r)){const o=e.shift();p(e,g(r,o,n),t,h(o,n))}else{r[m(r,e[0])]=t}},f=(e,r,t)=>{if(0!=e.length){if(e.length>1){const n=e.shift(),o=g(r,n,t);return{...r,[n]:f(e,o,h(n,t))}}if(Array.isArray(r))return r.filter(((r,t)=>t!=e[0]));if("object"==typeof r&&null!==r){const{[e[0]]:t,...n}=r;return n}return g(r,e[0],t)}},d=(e,r,t)=>{if(0!==e.length)if(e.length>1){const n=e.shift(),o=g(r,n,t);d(e,o,h(n,t))}else Array.isArray(r)?r.splice(e[0],1):"object"==typeof r&&null!==r?delete r[e[0]]:g(r,e[0],t)},h=r(((e,r)=>r+"/"+v(e))),v=e=>e.toString().replace(/~/g,"~0").replace(/\//g,"~1"),y=e=>e.toString().replace(/~1/g,"/").replace(/~0/g,"~"),m=(e,r)=>Array.isArray(e)&&"-"===r?e.length:r,g=(e,r,t="")=>{if(void 0===e)throw TypeError(`Value at '${t}' is undefined and does not have property '${r}'`);if(null===e)throw TypeError(`Value at '${t}' is null and does not have property '${r}'`);if(b(e))throw TypeError(`Value at '${t}' is a ${typeof e} and does not have property '${r}'`);return e[m(e,r)]},b=e=>null===e||"object"!=typeof e;var w={nil:"",append:h,get:(e,r)=>{const t=u(e),n=e=>t.reduce((([e,r],t)=>[g(e,t,r),h(t,r)]),[e,""])[0];return void 0===r?n:n(r)},set:(e,t,n)=>{const o=u(e),a=r(((e,r)=>l(o,e,r,"")));return void 0===t?a:a(t,n)},assign:(e,t,n)=>{const o=u(e),a=r(((e,r)=>p(o,e,r,"")));return void 0===t?a:a(t,n)},unset:(e,r)=>{const t=u(e),n=e=>f(t,e,"");return void 0===r?n:n(r)},remove:(e,r)=>{const t=u(e),n=e=>d(t,e,"");return void 0===r?n:n(r)}};w.nil,w.append,w.get,w.set,w.assign,w.unset,w.remove;const E=Symbol("$__value"),S=Symbol("$__href");var C={cons:(e,r)=>Object.freeze({[S]:e,[E]:r}),isReference:e=>e&&void 0!==e[S],href:e=>e[S],value:e=>e[E]};const{resolveUrl:O,jsonTypeOf:A}=c,I=Object.freeze({id:"",pointer:"",instance:void 0,value:void 0}),j=e=>C.isReference(e.value)?C.value(e.value):e.value,T=r(((e,r)=>A(j(e),r))),x=(e,r)=>Object.freeze({...r,pointer:w.append(e,r.pointer),value:j(r)[e]}),$=r(((e,r)=>j(r).map(((t,n,o,a)=>e(x(n,r),n,o,a))))),D=r(((e,r)=>j(r).map(((e,t,n,o)=>x(t,r))).filter(((r,t,n,o)=>e(r,t,n,o))))),P=r(((e,r,t)=>j(t).reduce(((r,n,o)=>e(r,x(o,t),o)),r))),R=r(((e,r)=>j(r).every(((t,n,o,a)=>e(x(n,r),n,o,a))))),N=r(((e,r)=>j(r).some(((t,n,o,a)=>e(x(n,r),n,o,a)))));var _={nil:I,cons:(e,r="")=>Object.freeze({...I,id:O(r,""),instance:e,value:e}),uri:e=>`${e.id}#${encodeURI(e.pointer)}`,value:j,has:(e,r)=>e in j(r),typeOf:T,step:x,entries:e=>Object.keys(j(e)).map((r=>[r,x(r,e)])),keys:e=>Object.keys(j(e)),map:$,filter:D,reduce:P,every:R,some:N,length:e=>j(e).length},F=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,k=/^[\u000b\u0020-\u007e\u0080-\u00ff]+$/,U=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,q=/\\([\u000b\u0020-\u00ff])/g,L=/([\\"])/g,z=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,H=function(e){if(!e)throw new TypeError("argument string is required");var r="object"==typeof e?function(e){var r;"function"==typeof e.getHeader?r=e.getHeader("content-type"):"object"==typeof e.headers&&(r=e.headers&&e.headers["content-type"]);if("string"!=typeof r)throw new TypeError("content-type header is missing from object");return r}(e):e;if("string"!=typeof r)throw new TypeError("argument string is required to be a string");var t=r.indexOf(";"),n=-1!==t?r.substr(0,t).trim():r.trim();if(!z.test(n))throw new TypeError("invalid media type");var o=new K(n.toLowerCase());if(-1!==t){var a,i,s;for(F.lastIndex=t;i=F.exec(r);){if(i.index!==t)throw new TypeError("invalid parameter format");t+=i[0].length,a=i[1].toLowerCase(),'"'===(s=i[2])[0]&&(s=s.substr(1,s.length-2).replace(q,"$1")),o.parameters[a]=s}if(t!==r.length)throw new TypeError("invalid parameter format")}return o};function V(e){var r=String(e);if(U.test(r))return r;if(r.length>0&&!k.test(r))throw new TypeError("invalid parameter value");return'"'+r.replace(L,"\\$1")+'"'}function K(e){this.parameters=Object.create(null),this.type=e}var M={format:function(e){if(!e||"object"!=typeof e)throw new TypeError("argument obj is required");var r=e.parameters,t=e.type;if(!t||!z.test(t))throw new TypeError("invalid type");var n=t;if(r&&"object"==typeof r)for(var o,a=Object.keys(r).sort(),i=0;i<a.length;i++){if(o=a[i],!U.test(o))throw new TypeError("invalid parameter name");n+="; "+o+"="+V(r[o])}return n},parse:H},Z=async e=>Object.entries(await e),J=r((async(e,r)=>(await r).map(e))),B=r((async(e,r,t)=>(await t).reduce((async(r,t)=>e(await r,t)),r))),G=r((async(e,r,t={})=>B((async(r,t)=>await e(t)?r.concat([t]):r),[],r,t))),W=r((async(e,r)=>{const t=await J(e,r);return(await Promise.all(t)).some((e=>e))})),Q=r((async(e,r)=>{const t=await J(e,r);return(await Promise.all(t)).every((e=>e))})),Y=r(((e,r)=>e.reduce((async(e,r)=>r(await e)),r))),X={entries:Z,map:J,filter:G,reduce:B,some:W,every:Q,pipeline:Y,all:e=>Promise.all(e),allValues:e=>Y([Z,B((async(e,[r,t])=>(e[r]=await t,e)),{})],e)};X.entries,X.map,X.filter,X.reduce,X.some,X.every,X.pipeline,X.all,X.allValues;var ee=fetch;const{jsonTypeOf:re,resolveUrl:te,urlFragment:ne,pathRelative:oe}=c,ae="https://json-schema.org/draft/2019-09/vocab/core",ie="https://json-schema.org/draft/2020-12/vocab/core",se={},ce={},ue=(e,r)=>{const t=ce[e];return se[t]?.[r]},le={},pe={},fe=(e,r="",t="")=>{e=JSON.parse(JSON.stringify(e));const n=te(r,""),o=te(e.$schema||t,"");if(!o)throw Error("Couldn't determine schema dialect");if(delete e.$schema,!(o in ce))if(!0===e?.$vocabulary?.[ae]&&o===de(e,n,ae)[0])ce[o]=ae;else if(!0===e?.$vocabulary?.[ie]&&o===de(e,n,ie)[0])ce[o]=ie;else if(o===de(e,n,o)[0])ce[o]=o;else{if(!(o in le))throw Error(`Couldn't determine JSON Schema version for dialect: '${o}'`);{const e=le[o];!0===e.vocabulary[ae]?ce[o]=ae:!0===e.vocabulary[ie]?ce[o]=ie:ce[o]=ce[e.dialectId]}}const[a,i]=de(e,n,ce[o]);if(!a)throw Error("Couldn't determine an identifier for the schema");const s=ue(o,"baseToken");delete e[s],n&&(pe[n]=a);const c=ue(o,"anchorToken");i&&s===c&&(e[c]=c!==s?encodeURI(i):`#${encodeURI(i)}`);const u={},l=ue(o,"recursiveAnchorToken");let p;!0===e[l]&&(u[""]=`${a}#`,e[c]="",delete e[l]);const f=ue(o,"vocabularyToken");re(e[f],"object")?(p=e[f],delete e[f]):p={[ce[o]]:!0};const d={"":""};return le[a]={id:a,dialectId:o,schema:he(e,a,o,w.nil,d,u),anchors:d,dynamicAnchors:u,vocabulary:p,validated:!1},a},de=(e,r,t)=>{const n=se[t]?.baseToken,o=te(r,e[n]||"");return[te(o,""),ne(o)]},he=(e,r,t,n,o,a)=>{if(re(e,"object")){const i="string"==typeof e.$schema?te(e.$schema,""):t,s=ue(i,"embeddedToken"),c=ue(i,"anchorToken");if("string"==typeof e[s]&&(s!==c||"#"!==e[s][0])){const n=te(r,e[s]);return e[ue(i,"baseToken")]=n,fe(e,n,t),C.cons(e[s],e)}const u=ue(t,"anchorToken"),l=ue(t,"dynamicAnchorToken");"string"==typeof e[l]&&(a[e[l]]=`${r}#${encodeURI(n)}`,o[e[l]]=n,delete e[l]);const p=ue(t,"embeddedToken");if("string"==typeof e[u]){const r=u!==p?e[u]:e[u].slice(1);o[r]=n,delete e[u]}const f=ue(t,"jrefToken");if("string"==typeof e[f])return C.cons(e[f],e);for(const i in e)e[i]=he(e[i],r,t,w.append(i,n),o,a);return e}return Array.isArray(e)?e.map(((e,i)=>he(e,r,t,w.append(i,n),o,a))):e},ve=e=>le[pe[e]]||le[e],ye=Object.freeze({id:"",dialectId:void 0,vocabulary:{},pointer:w.nil,schema:void 0,value:void 0,anchors:{},dynamicAnchors:{},validated:!0}),me=async(e,r=ye)=>{const t=te(we(r),e),n=te(t,""),o=ne(t);if(!(e=>e in le||e in pe)(n)){const e=await ee(n,{headers:{Accept:"application/schema+json"}});if(e.status>=400)throw await e.text(),Error(`Failed to retrieve schema with id: ${n}`);if(e.headers.has("content-type")){const r=M.parse(e.headers.get("content-type")).type;if("application/schema+json"!==r)throw Error(`${n} is not a schema. Found a document with media type: ${r}`)}fe(await e.json(),n)}const a=ve(n),i="/"!==o[0]?be(a,o):o,s=Object.freeze({...a,pointer:i,value:w.get(i,a.schema)});return ge(s)},ge=e=>C.isReference(e.value)?me(C.href(e.value),e):e,be=(e,r)=>{if(!(r in e.anchors))throw Error(`No such anchor '${encodeURI(e.id)}#${encodeURI(r)}'`);return e.anchors[r]},we=e=>`${e.id}#${encodeURI(e.pointer)}`,Ee=e=>C.isReference(e.value)?C.value(e.value):e.value,Se=(e,r)=>{const t=ve(r.id),n=Object.freeze({...r,pointer:w.append(e,r.pointer),value:Ee(r)[e],validated:t.validated});return ge(n)},Ce=r(((e,r)=>X.pipeline([Ee,X.map((async(t,n)=>e(await Se(n,r),n))),X.all],r))),Oe={parentId:"",parentDialect:"",includeEmbedded:!0},Ae=(e,r)=>{if(r.startsWith("file://")){const t=e.slice(7,e.lastIndexOf("/"));return""===e?"":oe(t,r.slice(7))}return r};var Ie={setConfig:(e,r,t)=>{se[e]||(se[e]={}),se[e][r]=t},getConfig:ue,add:fe,get:me,markValidated:e=>{le[e].validated=!0},uri:we,value:Ee,getAnchorPointer:be,typeOf:(e,r)=>re(Ee(e),r),has:(e,r)=>e in Ee(r),step:Se,keys:e=>Object.keys(Ee(e)),entries:e=>X.pipeline([Ee,Object.keys,X.map((async r=>[r,await Se(r,e)])),X.all],e),map:Ce,length:e=>Ee(e).length,toSchema:(e,r={})=>{const t={...Oe,...r},n=JSON.parse(JSON.stringify(e.schema,((r,n)=>{if(!C.isReference(n))return n;const o=C.value(n),a="string"==typeof o.$schema?te(o.$schema,""):e.dialectId,i=ue(a,"embeddedToken");return!t.includeEmbedded&&i in o?void 0:C.value(n)}))),o=ue(e.dialectId,"dynamicAnchorToken");Object.entries(e.dynamicAnchors).forEach((([e,r])=>{const t=ne(r);w.assign(t,n,{[o]:e,...w.get(t,n)})}));const a=ue(e.dialectId,"anchorToken");Object.entries(e.anchors).filter((([e])=>""!==e)).forEach((([e,r])=>{w.assign(r,n,{[a]:e,...w.get(r,n)})}));const i=ue(e.dialectId,"baseToken"),s=Ae(t.parentId,e.id),c=t.parentDialect===e.dialectId?"":e.dialectId;return{...s&&{[i]:s},...c&&{$schema:c},...n}}};Ie.setConfig,Ie.getConfig,Ie.add,Ie.get,Ie.markValidated,Ie.uri,Ie.value,Ie.getAnchorPointer,Ie.typeOf,Ie.has,Ie.step,Ie.keys,Ie.entries,Ie.map,Ie.length,Ie.toSchema;class je extends Error{constructor(e){super("Invalid Schema"),this.name=this.constructor.name,this.output=e}}var Te=je;const{resolveUrl:xe}=c,$e="FLAG",De="BASIC",Pe="DETAILED",Re="VERBOSE";let Ne=Pe,_e=!0;const Fe=async e=>{const r={metaData:{}};return{ast:r,schemaUri:await Ke(e,r)}},ke=r((({ast:e,schemaUri:r},t,n=$e)=>{if(![$e,De,Pe,Re].includes(n))throw Error(`The '${n}' error format is not supported`);const a=[],i=o.subscribe("result",Ue(n,a));return Ze(r,t,e,{}),o.unsubscribe(i),a[0]})),Ue=(e,r)=>{const t=[];return(n,o)=>{if("result"===n){const{keyword:e,absoluteKeywordLocation:r,instanceLocation:n,valid:a}=o,i={keyword:e,absoluteKeywordLocation:r,instanceLocation:n,valid:a,errors:[]};t.push(i)}else if("result.start"===n)t.push(n);else if("result.end"===n){const n=t.pop();for(;"result.start"!==t[t.length-1];){const r=t.pop(),o=[r];e===De&&(o.push(...r.errors),delete r.errors),(e===Re||e!==$e&&!r.valid)&&n.errors.unshift(...o)}t[t.length-1]=n,r[0]=n}}},qe={},Le=e=>qe[e],ze=e=>e in qe,He={},Ve={},Ke=async(e,r)=>{if(e=await Me(e),!ze(`${e.dialectId}#validate`)){const r=await Ie.get(e.dialectId);(Ie.getConfig(r.id,"mandatoryVocabularies")||[]).forEach((e=>{if(!r.vocabulary[e])throw Error(`Vocabulary '${e}' must be explicitly declared and required`)})),Object.entries(r.vocabulary).forEach((([e,t])=>{if(e in He)Object.entries(He[e]).forEach((([e,t])=>{((e,r)=>{qe[e]={collectEvaluatedItems:(e,t,n,o,a)=>r.interpret(e,t,n,o,a)&&new Set,collectEvaluatedProperties:(e,t,n,o,a)=>r.interpret(e,t,n,o,a)&&[],...r}})(`${r.id}#${e}`,t)}));else if(t)throw Error(`Missing required vocabulary: ${e}`)}))}if(_e&&!e.validated){if(Ie.markValidated(e.id),!(e.dialectId in Ve)){const r=await Ie.get(e.dialectId),t=await Fe(r);Ve[r.id]=ke(t)}const r=_.cons(e.schema,e.id),t=Ve[e.dialectId](r,Ne);if(!t.valid)throw new Te(t)}return e.id in r.metaData||(r.metaData[e.id]={id:e.id,dynamicAnchors:e.dynamicAnchors,anchors:e.anchors}),Le(`${e.dialectId}#validate`).compile(e,r)},Me=async e=>Ie.typeOf(e,"string")?Me(await Ie.get(Ie.value(e),e)):e,Ze=(e,r,t,n)=>{const o=Je(e,t),a=xe(e,"");return Le(o).interpret(e,r,t,{...t.metaData[a].dynamicAnchors,...n})},Je=(e,r)=>{if(!(e in r))throw Error(`No schema found at ${e}`);return r[e][0]};var Be={validate:async(e,r,t)=>{const n=await Fe(e),o=(e,r)=>ke(n,_.cons(e),r);return void 0===r?o:o(r,t)},compile:Fe,interpret:ke,setMetaOutputFormat:e=>{Ne=e},setShouldMetaValidate:e=>{_e=e},FLAG:$e,BASIC:De,DETAILED:Pe,VERBOSE:Re,add:(e,r="",t="")=>{const n=Ie.add(e,r,t);delete Ve[n]},getKeyword:Le,hasKeyword:ze,defineVocabulary:(e,r)=>{He[e]=r},compileSchema:Ke,interpretSchema:Ze,collectEvaluatedProperties:(e,r,t,n,o)=>{const a=Je(e,t);return Le(a).collectEvaluatedProperties(e,r,t,n,o)},collectEvaluatedItems:(e,r,t,n,o)=>{const a=Je(e,t);return Le(a).collectEvaluatedItems(e,r,t,n,o)}};var Ge={compile:e=>Ie.value(e),interpret:()=>!0};var We={compile:async(e,r)=>{const t=Ie.uri(e);if(!(t in r)){r[t]=!1;const n=Ie.value(e);if(!["object","boolean"].includes(typeof n))throw Error(`No schema found at '${Ie.uri(e)}'`);r[t]=[`${e.dialectId}#validate`,Ie.uri(e),"boolean"==typeof n?n:await X.pipeline([Ie.entries,X.map((([r,t])=>[`${e.dialectId}#${r}`,t])),X.filter((([r])=>Be.hasKeyword(r)&&r!==`${e.dialectId}#validate`)),X.map((async([t,n])=>{const o=await Be.getKeyword(t).compile(n,r,e);return[t,Ie.uri(n),o]})),X.all],e)]}return t},interpret:(e,r,t,n)=>{const[a,i,s]=t[e];o.publishSync("result.start");const c="boolean"==typeof s?s:s.every((([e,a,i])=>{o.publishSync("result.start");const s=Be.getKeyword(e).interpret(i,r,t,n);return o.publishSync("result",{keyword:e,absoluteKeywordLocation:a,instanceLocation:_.uri(r),valid:s,ast:i}),o.publishSync("result.end"),s}));return o.publishSync("result",{keyword:a,absoluteKeywordLocation:i,instanceLocation:_.uri(r),valid:c,ast:e}),o.publishSync("result.end"),c},collectEvaluatedProperties:(e,r,t,n,o=!1)=>{const a=t[e][2];return"boolean"==typeof a?!!a&&[]:a.filter((([e])=>!o||!e.endsWith("#unevaluatedProperties"))).reduce(((e,[o,,a])=>{const i=e&&Be.getKeyword(o).collectEvaluatedProperties(a,r,t,n);return!1!==i&&[...e,...i]}),[])},collectEvaluatedItems:(e,r,t,n,o=!1)=>{const a=t[e][2];return"boolean"==typeof a?!!a&&new Set:a.filter((([e])=>!o||!e.endsWith("#unevaluatedItems"))).reduce(((e,[o,,a])=>{const i=!1!==e&&Be.getKeyword(o).collectEvaluatedItems(a,r,t,n);return!1!==i&&new Set([...e,...i])}),new Set)}},Qe={metaData:Ge,validate:We},Ye={Core:Be,Schema:Ie,Instance:_,Reference:C,Keywords:Qe,InvalidSchemaError:Te},Xe=Ye.Core,er=Ye.Schema,rr=Ye.Instance,tr=Ye.Reference,nr=Ye.Keywords,or=Ye.InvalidSchemaError;return e.Core=Xe,e.Instance=rr,e.InvalidSchemaError=or,e.Keywords=nr,e.Reference=tr,e.Schema=er,e.default=Ye,Object.defineProperty(e,"__esModule",{value:!0}),e}({}); | ||
!function(e){function r(){for(var e=arguments.length,r=Array(e),t=0;t<e;t++)r[t]=arguments[t];if(r.length>1){r[0]=r[0].slice(0,-1);for(var n=r.length-1,o=1;o<n;++o)r[o]=r[o].slice(1,-1);return r[n]=r[n].slice(1),r.join("")}return r[0]}function t(e){return"(?:"+e+")"}function n(e){return void 0===e?"undefined":null===e?"null":Object.prototype.toString.call(e).split(" ").pop().split("]").shift().toLowerCase()}function o(e){return e.toUpperCase()}function a(e){return null!=e?e instanceof Array?e:"number"!=typeof e.length||e.split||e.setInterval||e.call?[e]:Array.prototype.slice.call(e):[]}function i(e,r){var t=e;if(r)for(var n in r)t[n]=r[n];return t}function s(e){var n="[A-Za-z]",o="[0-9]",a=r(o,"[A-Fa-f]"),i=t(t("%[EFef]"+a+"%"+a+a+"%"+a+a)+"|"+t("%[89A-Fa-f]"+a+"%"+a+a)+"|"+t("%"+a+a)),s="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",c=r("[\\:\\/\\?\\#\\[\\]\\@]",s),u=e?"[\\uE000-\\uF8FF]":"[]",l=r(n,o,"[\\-\\.\\_\\~]",e?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]");t(n+r(n,o,"[\\+\\-\\.]")+"*"),t(t(i+"|"+r(l,s,"[\\:]"))+"*");var p=t(t("25[0-5]")+"|"+t("2[0-4]"+o)+"|"+t("1"+o+o)+"|"+t("0?[1-9]"+o)+"|0?0?"+o),f=t(p+"\\."+p+"\\."+p+"\\."+p),d=t(a+"{1,4}"),h=t(t(d+"\\:"+d)+"|"+f),v=t(t(d+"\\:")+"{6}"+h),y=t("\\:\\:"+t(d+"\\:")+"{5}"+h),m=t(t(d)+"?\\:\\:"+t(d+"\\:")+"{4}"+h),g=t(t(t(d+"\\:")+"{0,1}"+d)+"?\\:\\:"+t(d+"\\:")+"{3}"+h),b=t(t(t(d+"\\:")+"{0,2}"+d)+"?\\:\\:"+t(d+"\\:")+"{2}"+h),w=t(t(t(d+"\\:")+"{0,3}"+d)+"?\\:\\:"+d+"\\:"+h),E=t(t(t(d+"\\:")+"{0,4}"+d)+"?\\:\\:"+h),S=t(t(t(d+"\\:")+"{0,5}"+d)+"?\\:\\:"+d),C=t(t(t(d+"\\:")+"{0,6}"+d)+"?\\:\\:"),O=t([v,y,m,g,b,w,E,S,C].join("|")),A=t(t(l+"|"+i)+"+");t("[vV]"+a+"+\\."+r(l,s,"[\\:]")+"+"),t(t(i+"|"+r(l,s))+"*");var I=t(i+"|"+r(l,s,"[\\:\\@]"));return t(t(i+"|"+r(l,s,"[\\@]"))+"+"),t(t(I+"|"+r("[\\/\\?]",u))+"*"),{NOT_SCHEME:new RegExp(r("[^]",n,o,"[\\+\\-\\.]"),"g"),NOT_USERINFO:new RegExp(r("[^\\%\\:]",l,s),"g"),NOT_HOST:new RegExp(r("[^\\%\\[\\]\\:]",l,s),"g"),NOT_PATH:new RegExp(r("[^\\%\\/\\:\\@]",l,s),"g"),NOT_PATH_NOSCHEME:new RegExp(r("[^\\%\\/\\@]",l,s),"g"),NOT_QUERY:new RegExp(r("[^\\%]",l,s,"[\\:\\@\\/\\?]",u),"g"),NOT_FRAGMENT:new RegExp(r("[^\\%]",l,s,"[\\:\\@\\/\\?]"),"g"),ESCAPE:new RegExp(r("[^]",l,s),"g"),UNRESERVED:new RegExp(l,"g"),OTHER_CHARS:new RegExp(r("[^\\%]",l,c),"g"),PCT_ENCODED:new RegExp(i,"g"),IPV4ADDRESS:new RegExp("^("+f+")$"),IPV6ADDRESS:new RegExp("^\\[?("+O+")"+t(t("\\%25|\\%(?!"+a+"{2})")+"("+A+")")+"?\\]?$")}}var c=s(!1),u=s(!0),l=function(){function e(e,r){var t=[],n=!0,o=!1,a=void 0;try{for(var i,s=e[Symbol.iterator]();!(n=(i=s.next()).done)&&(t.push(i.value),!r||t.length!==r);n=!0);}catch(e){o=!0,a=e}finally{try{!n&&s.return&&s.return()}finally{if(o)throw a}}return t}return function(r,t){if(Array.isArray(r))return r;if(Symbol.iterator in Object(r))return e(r,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),p=function(e){if(Array.isArray(e)){for(var r=0,t=Array(e.length);r<e.length;r++)t[r]=e[r];return t}return Array.from(e)},f=2147483647,d=36,h=1,v=26,y=38,m=700,g=72,b=128,w="-",E=/^xn--/,S=/[^\0-\x7E]/,C=/[\x2E\u3002\uFF0E\uFF61]/g,O={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},A=d-h,I=Math.floor,j=String.fromCharCode;function T(e){throw new RangeError(O[e])}function x(e,r){for(var t=[],n=e.length;n--;)t[n]=r(e[n]);return t}function P(e,r){var t=e.split("@"),n="";return t.length>1&&(n=t[0]+"@",e=t[1]),n+x((e=e.replace(C,".")).split("."),r).join(".")}function $(e){for(var r=[],t=0,n=e.length;t<n;){var o=e.charCodeAt(t++);if(o>=55296&&o<=56319&&t<n){var a=e.charCodeAt(t++);56320==(64512&a)?r.push(((1023&o)<<10)+(1023&a)+65536):(r.push(o),t--)}else r.push(o)}return r}var D=function(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:d},R=function(e,r){return e+22+75*(e<26)-((0!=r)<<5)},N=function(e,r,t){var n=0;for(e=t?I(e/m):e>>1,e+=I(e/r);e>A*v>>1;n+=d)e=I(e/A);return I(n+(A+1)*e/(e+y))},_=function(e){var r=[],t=e.length,n=0,o=b,a=g,i=e.lastIndexOf(w);i<0&&(i=0);for(var s=0;s<i;++s)e.charCodeAt(s)>=128&&T("not-basic"),r.push(e.charCodeAt(s));for(var c=i>0?i+1:0;c<t;){for(var u=n,l=1,p=d;;p+=d){c>=t&&T("invalid-input");var y=D(e.charCodeAt(c++));(y>=d||y>I((f-n)/l))&&T("overflow"),n+=y*l;var m=p<=a?h:p>=a+v?v:p-a;if(y<m)break;var E=d-m;l>I(f/E)&&T("overflow"),l*=E}var S=r.length+1;a=N(n-u,S,0==u),I(n/S)>f-o&&T("overflow"),o+=I(n/S),n%=S,r.splice(n++,0,o)}return String.fromCodePoint.apply(String,r)},F=function(e){var r=[],t=(e=$(e)).length,n=b,o=0,a=g,i=!0,s=!1,c=void 0;try{for(var u,l=e[Symbol.iterator]();!(i=(u=l.next()).done);i=!0){var p=u.value;p<128&&r.push(j(p))}}catch(e){s=!0,c=e}finally{try{!i&&l.return&&l.return()}finally{if(s)throw c}}var y=r.length,m=y;for(y&&r.push(w);m<t;){var E=f,S=!0,C=!1,O=void 0;try{for(var A,x=e[Symbol.iterator]();!(S=(A=x.next()).done);S=!0){var P=A.value;P>=n&&P<E&&(E=P)}}catch(e){C=!0,O=e}finally{try{!S&&x.return&&x.return()}finally{if(C)throw O}}var D=m+1;E-n>I((f-o)/D)&&T("overflow"),o+=(E-n)*D,n=E;var _=!0,F=!1,k=void 0;try{for(var U,q=e[Symbol.iterator]();!(_=(U=q.next()).done);_=!0){var L=U.value;if(L<n&&++o>f&&T("overflow"),L==n){for(var z=o,H=d;;H+=d){var V=H<=a?h:H>=a+v?v:H-a;if(z<V)break;var M=z-V,K=d-V;r.push(j(R(V+M%K,0))),z=I(M/K)}r.push(j(R(z,0))),a=N(o,D,m==y),o=0,++m}}}catch(e){F=!0,k=e}finally{try{!_&&q.return&&q.return()}finally{if(F)throw k}}++o,++n}return r.join("")},k=function(e){return P(e,(function(e){return E.test(e)?_(e.slice(4).toLowerCase()):e}))},U=function(e){return P(e,(function(e){return S.test(e)?"xn--"+F(e):e}))},q={version:"2.1.0",ucs2:{decode:$,encode:function(e){return String.fromCodePoint.apply(String,p(e))}},decode:_,encode:F,toASCII:U,toUnicode:k},L={};function z(e){var r=e.charCodeAt(0);return r<16?"%0"+r.toString(16).toUpperCase():r<128?"%"+r.toString(16).toUpperCase():r<2048?"%"+(r>>6|192).toString(16).toUpperCase()+"%"+(63&r|128).toString(16).toUpperCase():"%"+(r>>12|224).toString(16).toUpperCase()+"%"+(r>>6&63|128).toString(16).toUpperCase()+"%"+(63&r|128).toString(16).toUpperCase()}function H(e){for(var r="",t=0,n=e.length;t<n;){var o=parseInt(e.substr(t+1,2),16);if(o<128)r+=String.fromCharCode(o),t+=3;else if(o>=194&&o<224){if(n-t>=6){var a=parseInt(e.substr(t+4,2),16);r+=String.fromCharCode((31&o)<<6|63&a)}else r+=e.substr(t,6);t+=6}else if(o>=224){if(n-t>=9){var i=parseInt(e.substr(t+4,2),16),s=parseInt(e.substr(t+7,2),16);r+=String.fromCharCode((15&o)<<12|(63&i)<<6|63&s)}else r+=e.substr(t,9);t+=9}else r+=e.substr(t,3),t+=3}return r}function V(e,r){function t(e){var t=H(e);return t.match(r.UNRESERVED)?t:e}return e.scheme&&(e.scheme=String(e.scheme).replace(r.PCT_ENCODED,t).toLowerCase().replace(r.NOT_SCHEME,"")),void 0!==e.userinfo&&(e.userinfo=String(e.userinfo).replace(r.PCT_ENCODED,t).replace(r.NOT_USERINFO,z).replace(r.PCT_ENCODED,o)),void 0!==e.host&&(e.host=String(e.host).replace(r.PCT_ENCODED,t).toLowerCase().replace(r.NOT_HOST,z).replace(r.PCT_ENCODED,o)),void 0!==e.path&&(e.path=String(e.path).replace(r.PCT_ENCODED,t).replace(e.scheme?r.NOT_PATH:r.NOT_PATH_NOSCHEME,z).replace(r.PCT_ENCODED,o)),void 0!==e.query&&(e.query=String(e.query).replace(r.PCT_ENCODED,t).replace(r.NOT_QUERY,z).replace(r.PCT_ENCODED,o)),void 0!==e.fragment&&(e.fragment=String(e.fragment).replace(r.PCT_ENCODED,t).replace(r.NOT_FRAGMENT,z).replace(r.PCT_ENCODED,o)),e}function M(e){return e.replace(/^0*(.*)/,"$1")||"0"}function K(e,r){var t=e.match(r.IPV4ADDRESS)||[],n=l(t,2)[1];return n?n.split(".").map(M).join("."):e}function Z(e,r){var t=e.match(r.IPV6ADDRESS)||[],n=l(t,3),o=n[1],a=n[2];if(o){for(var i=o.toLowerCase().split("::").reverse(),s=l(i,2),c=s[0],u=s[1],p=u?u.split(":").map(M):[],f=c.split(":").map(M),d=r.IPV4ADDRESS.test(f[f.length-1]),h=d?7:8,v=f.length-h,y=Array(h),m=0;m<h;++m)y[m]=p[m]||f[v+m]||"";d&&(y[h-1]=K(y[h-1],r));var g=y.reduce((function(e,r,t){if(!r||"0"===r){var n=e[e.length-1];n&&n.index+n.length===t?n.length++:e.push({index:t,length:1})}return e}),[]).sort((function(e,r){return r.length-e.length}))[0],b=void 0;if(g&&g.length>1){var w=y.slice(0,g.index),E=y.slice(g.index+g.length);b=w.join(":")+"::"+E.join(":")}else b=y.join(":");return a&&(b+="%"+a),b}return e}var J=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,B=void 0==="".match(/(){0}/)[1];function G(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t={},n=!1!==r.iri?u:c;"suffix"===r.reference&&(e=(r.scheme?r.scheme+":":"")+"//"+e);var o=e.match(J);if(o){B?(t.scheme=o[1],t.userinfo=o[3],t.host=o[4],t.port=parseInt(o[5],10),t.path=o[6]||"",t.query=o[7],t.fragment=o[8],isNaN(t.port)&&(t.port=o[5])):(t.scheme=o[1]||void 0,t.userinfo=-1!==e.indexOf("@")?o[3]:void 0,t.host=-1!==e.indexOf("//")?o[4]:void 0,t.port=parseInt(o[5],10),t.path=o[6]||"",t.query=-1!==e.indexOf("?")?o[7]:void 0,t.fragment=-1!==e.indexOf("#")?o[8]:void 0,isNaN(t.port)&&(t.port=e.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?o[4]:void 0)),t.host&&(t.host=Z(K(t.host,n),n)),void 0!==t.scheme||void 0!==t.userinfo||void 0!==t.host||void 0!==t.port||t.path||void 0!==t.query?void 0===t.scheme?t.reference="relative":void 0===t.fragment?t.reference="absolute":t.reference="uri":t.reference="same-document",r.reference&&"suffix"!==r.reference&&r.reference!==t.reference&&(t.error=t.error||"URI is not a "+r.reference+" reference.");var a=L[(r.scheme||t.scheme||"").toLowerCase()];if(r.unicodeSupport||a&&a.unicodeSupport)V(t,n);else{if(t.host&&(r.domainHost||a&&a.domainHost))try{t.host=q.toASCII(t.host.replace(n.PCT_ENCODED,H).toLowerCase())}catch(e){t.error=t.error||"Host's domain name can not be converted to ASCII via punycode: "+e}V(t,c)}a&&a.parse&&a.parse(t,r)}else t.error=t.error||"URI can not be parsed.";return t}function W(e,r){var t=!1!==r.iri?u:c,n=[];return void 0!==e.userinfo&&(n.push(e.userinfo),n.push("@")),void 0!==e.host&&n.push(Z(K(String(e.host),t),t).replace(t.IPV6ADDRESS,(function(e,r,t){return"["+r+(t?"%25"+t:"")+"]"}))),"number"!=typeof e.port&&"string"!=typeof e.port||(n.push(":"),n.push(String(e.port))),n.length?n.join(""):void 0}var Q=/^\.\.?\//,Y=/^\/\.(\/|$)/,X=/^\/\.\.(\/|$)/,ee=/^\/?(?:.|\n)*?(?=\/|$)/;function re(e){for(var r=[];e.length;)if(e.match(Q))e=e.replace(Q,"");else if(e.match(Y))e=e.replace(Y,"/");else if(e.match(X))e=e.replace(X,"/"),r.pop();else if("."===e||".."===e)e="";else{var t=e.match(ee);if(!t)throw new Error("Unexpected dot segment condition");var n=t[0];e=e.slice(n.length),r.push(n)}return r.join("")}function te(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=r.iri?u:c,n=[],o=L[(r.scheme||e.scheme||"").toLowerCase()];if(o&&o.serialize&&o.serialize(e,r),e.host)if(t.IPV6ADDRESS.test(e.host));else if(r.domainHost||o&&o.domainHost)try{e.host=r.iri?q.toUnicode(e.host):q.toASCII(e.host.replace(t.PCT_ENCODED,H).toLowerCase())}catch(t){e.error=e.error||"Host's domain name can not be converted to "+(r.iri?"Unicode":"ASCII")+" via punycode: "+t}V(e,t),"suffix"!==r.reference&&e.scheme&&(n.push(e.scheme),n.push(":"));var a=W(e,r);if(void 0!==a&&("suffix"!==r.reference&&n.push("//"),n.push(a),e.path&&"/"!==e.path.charAt(0)&&n.push("/")),void 0!==e.path){var i=e.path;r.absolutePath||o&&o.absolutePath||(i=re(i)),void 0===a&&(i=i.replace(/^\/\//,"/%2F")),n.push(i)}return void 0!==e.query&&(n.push("?"),n.push(e.query)),void 0!==e.fragment&&(n.push("#"),n.push(e.fragment)),n.join("")}function ne(e,r){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n={};return arguments[3]||(e=G(te(e,t),t),r=G(te(r,t),t)),!(t=t||{}).tolerant&&r.scheme?(n.scheme=r.scheme,n.userinfo=r.userinfo,n.host=r.host,n.port=r.port,n.path=re(r.path||""),n.query=r.query):(void 0!==r.userinfo||void 0!==r.host||void 0!==r.port?(n.userinfo=r.userinfo,n.host=r.host,n.port=r.port,n.path=re(r.path||""),n.query=r.query):(r.path?("/"===r.path.charAt(0)?n.path=re(r.path):(void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?n.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+r.path:n.path=r.path:n.path="/"+r.path,n.path=re(n.path)),n.query=r.query):(n.path=e.path,void 0!==r.query?n.query=r.query:n.query=e.query),n.userinfo=e.userinfo,n.host=e.host,n.port=e.port),n.scheme=e.scheme),n.fragment=r.fragment,n}function oe(e,r,t){var n=i({scheme:"null"},t);return te(ne(G(e,n),G(r,n),n,!0),n)}function ae(e,r){return"string"==typeof e?e=te(G(e,r),r):"object"===n(e)&&(e=G(te(e,r),r)),e}function ie(e,r,t){return"string"==typeof e?e=te(G(e,t),t):"object"===n(e)&&(e=te(e,t)),"string"==typeof r?r=te(G(r,t),t):"object"===n(r)&&(r=te(r,t)),e===r}function se(e,r){return e&&e.toString().replace(r&&r.iri?u.ESCAPE:c.ESCAPE,z)}function ce(e,r){return e&&e.toString().replace(r&&r.iri?u.PCT_ENCODED:c.PCT_ENCODED,H)}var ue={scheme:"http",domainHost:!0,parse:function(e,r){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e},serialize:function(e,r){var t="https"===String(e.scheme).toLowerCase();return e.port!==(t?443:80)&&""!==e.port||(e.port=void 0),e.path||(e.path="/"),e}},le={scheme:"https",domainHost:ue.domainHost,parse:ue.parse,serialize:ue.serialize};function pe(e){return"boolean"==typeof e.secure?e.secure:"wss"===String(e.scheme).toLowerCase()}var fe={scheme:"ws",domainHost:!0,parse:function(e,r){var t=e;return t.secure=pe(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t},serialize:function(e,r){if(e.port!==(pe(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 t=e.resourceName.split("?"),n=l(t,2),o=n[0],a=n[1];e.path=o&&"/"!==o?o:void 0,e.query=a,e.resourceName=void 0}return e.fragment=void 0,e}},de={scheme:"wss",domainHost:fe.domainHost,parse:fe.parse,serialize:fe.serialize},he={},ve="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",ye="[0-9A-Fa-f]",me=t(t("%[EFef]"+ye+"%"+ye+ye+"%"+ye+ye)+"|"+t("%[89A-Fa-f]"+ye+"%"+ye+ye)+"|"+t("%"+ye+ye)),ge="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]",be=r("[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",'[\\"\\\\]'),we="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]",Ee=new RegExp(ve,"g"),Se=new RegExp(me,"g"),Ce=new RegExp(r("[^]",ge,"[\\.]",'[\\"]',be),"g"),Oe=new RegExp(r("[^]",ve,we),"g"),Ae=Oe;function Ie(e){var r=H(e);return r.match(Ee)?r:e}var je={scheme:"mailto",parse:function(e,r){var t=e,n=t.to=t.path?t.path.split(","):[];if(t.path=void 0,t.query){for(var o=!1,a={},i=t.query.split("&"),s=0,c=i.length;s<c;++s){var u=i[s].split("=");switch(u[0]){case"to":for(var l=u[1].split(","),p=0,f=l.length;p<f;++p)n.push(l[p]);break;case"subject":t.subject=ce(u[1],r);break;case"body":t.body=ce(u[1],r);break;default:o=!0,a[ce(u[0],r)]=ce(u[1],r)}}o&&(t.headers=a)}t.query=void 0;for(var d=0,h=n.length;d<h;++d){var v=n[d].split("@");if(v[0]=ce(v[0]),r.unicodeSupport)v[1]=ce(v[1],r).toLowerCase();else try{v[1]=q.toASCII(ce(v[1],r).toLowerCase())}catch(e){t.error=t.error||"Email address's domain name can not be converted to ASCII via punycode: "+e}n[d]=v.join("@")}return t},serialize:function(e,r){var t=e,n=a(e.to);if(n){for(var i=0,s=n.length;i<s;++i){var c=String(n[i]),u=c.lastIndexOf("@"),l=c.slice(0,u).replace(Se,Ie).replace(Se,o).replace(Ce,z),p=c.slice(u+1);try{p=r.iri?q.toUnicode(p):q.toASCII(ce(p,r).toLowerCase())}catch(e){t.error=t.error||"Email address's domain name can not be converted to "+(r.iri?"Unicode":"ASCII")+" via punycode: "+e}n[i]=l+"@"+p}t.path=n.join(",")}var f=e.headers=e.headers||{};e.subject&&(f.subject=e.subject),e.body&&(f.body=e.body);var d=[];for(var h in f)f[h]!==he[h]&&d.push(h.replace(Se,Ie).replace(Se,o).replace(Oe,z)+"="+f[h].replace(Se,Ie).replace(Se,o).replace(Ae,z));return d.length&&(t.query=d.join("&")),t}},Te=/^([^\:]+)\:(.*)/,xe={scheme:"urn",parse:function(e,r){var t=e.path&&e.path.match(Te),n=e;if(t){var o=r.scheme||n.scheme||"urn",a=t[1].toLowerCase(),i=t[2],s=o+":"+(r.nid||a),c=L[s];n.nid=a,n.nss=i,n.path=void 0,c&&(n=c.parse(n,r))}else n.error=n.error||"URN can not be parsed.";return n},serialize:function(e,r){var t=r.scheme||e.scheme||"urn",n=e.nid,o=t+":"+(r.nid||n),a=L[o];a&&(e=a.serialize(e,r));var i=e,s=e.nss;return i.path=(n||r.nid)+":"+s,i}},Pe=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/,$e={scheme:"urn:uuid",parse:function(e,r){var t=e;return t.uuid=t.nss,t.nss=void 0,r.tolerant||t.uuid&&t.uuid.match(Pe)||(t.error=t.error||"UUID is not valid."),t},serialize:function(e,r){var t=e;return t.nss=(e.uuid||"").toLowerCase(),t}};L[ue.scheme]=ue,L[le.scheme]=le,L[fe.scheme]=fe,L[de.scheme]=de,L[je.scheme]=je,L[xe.scheme]=xe,L[$e.scheme]=$e,e.SCHEMES=L,e.pctEncChar=z,e.pctDecChars=H,e.parse=G,e.removeDotSegments=re,e.serialize=te,e.resolveComponents=ne,e.resolve=oe,e.normalize=ae,e.equal=ie,e.escapeComponent=se,e.unescapeComponent=ce,Object.defineProperty(e,"__esModule",{value:!0})}(r)}));(a=i)&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")&&a.default;const s={null:e=>null===e,boolean:e=>"boolean"==typeof e,object:e=>"object"==typeof e&&!Array.isArray(e)&&null!==e,array:e=>Array.isArray(e),number:e=>"number"==typeof e,integer:e=>Number.isInteger(e),string:e=>"string"==typeof e};var c={jsonTypeOf:(e,r)=>s[r](e),resolveUrl:(e,r)=>{const t=i.resolve(e,r,{iri:!0});if(i.resolve(e,"",{iri:!0})&&"file"===i.parse(t).scheme&&"file"!==i.parse(e).scheme)throw Error(`Can't access file '${t}' resource from network context '${e}'`);return t},urlFragment:e=>i.unescapeComponent(i.parse(e).fragment)||"",pathRelative:(e,r)=>{if(e===r)return"";let t=1;const n=e.length-1,o=r.length-t,a=n<o?n:o;let i=-1,s=0;for(;s<a;s++){const n=e.charCodeAt(s+1);if(n!==r.charCodeAt(t+s))break;47===n&&(i=s)}if(o>a){if(47===r.charCodeAt(t+s))return r.slice(t+s+1);if(0===s)return r.slice(t+s)}n>a&&(47===e.charCodeAt(s+1)?i=s:0===a&&(i=0));let c="";for(s=i+2;s<=e.length;++s)s!==e.length&&47!==e.charCodeAt(s)||(c+=0===c.length?"..":"/..");return t+=i,c.length>0?`${c}${r.slice(t,r.length)}`:(47===r.charCodeAt(t)&&++t,r.slice(t,r.length))}};const u=e=>{if(e.length>0&&"/"!==e[0])throw Error("Invalid JSON Pointer");return e.split("/").slice(1).map(y)},l=(e,r,t,n)=>{if(0===e.length)return t;if(e.length>1){const o=e.shift();return{...r,[o]:l(e,g(r,o,n),t,h(o,n))}}if(Array.isArray(r)){const n=[...r];return n[m(r,e[0])]=t,n}return"object"==typeof r&&null!==r?{...r,[e[0]]:t}:g(r,e[0],n)},p=(e,r,t,n)=>{if(0!==e.length)if(1!==e.length||b(r)){const o=e.shift();p(e,g(r,o,n),t,h(o,n))}else{r[m(r,e[0])]=t}},f=(e,r,t)=>{if(0!=e.length){if(e.length>1){const n=e.shift(),o=g(r,n,t);return{...r,[n]:f(e,o,h(n,t))}}if(Array.isArray(r))return r.filter(((r,t)=>t!=e[0]));if("object"==typeof r&&null!==r){const{[e[0]]:t,...n}=r;return n}return g(r,e[0],t)}},d=(e,r,t)=>{if(0!==e.length)if(e.length>1){const n=e.shift(),o=g(r,n,t);d(e,o,h(n,t))}else Array.isArray(r)?r.splice(e[0],1):"object"==typeof r&&null!==r?delete r[e[0]]:g(r,e[0],t)},h=r(((e,r)=>r+"/"+v(e))),v=e=>e.toString().replace(/~/g,"~0").replace(/\//g,"~1"),y=e=>e.toString().replace(/~1/g,"/").replace(/~0/g,"~"),m=(e,r)=>Array.isArray(e)&&"-"===r?e.length:r,g=(e,r,t="")=>{if(void 0===e)throw TypeError(`Value at '${t}' is undefined and does not have property '${r}'`);if(null===e)throw TypeError(`Value at '${t}' is null and does not have property '${r}'`);if(b(e))throw TypeError(`Value at '${t}' is a ${typeof e} and does not have property '${r}'`);return e[m(e,r)]},b=e=>null===e||"object"!=typeof e;var w={nil:"",append:h,get:(e,r)=>{const t=u(e),n=e=>t.reduce((([e,r],t)=>[g(e,t,r),h(t,r)]),[e,""])[0];return void 0===r?n:n(r)},set:(e,t,n)=>{const o=u(e),a=r(((e,r)=>l(o,e,r,"")));return void 0===t?a:a(t,n)},assign:(e,t,n)=>{const o=u(e),a=r(((e,r)=>p(o,e,r,"")));return void 0===t?a:a(t,n)},unset:(e,r)=>{const t=u(e),n=e=>f(t,e,"");return void 0===r?n:n(r)},remove:(e,r)=>{const t=u(e),n=e=>d(t,e,"");return void 0===r?n:n(r)}};w.nil,w.append,w.get,w.set,w.assign,w.unset,w.remove;const E=Symbol("$__value"),S=Symbol("$__href");var C={cons:(e,r)=>Object.freeze({[S]:e,[E]:r}),isReference:e=>e&&void 0!==e[S],href:e=>e[S],value:e=>e[E]};const{resolveUrl:O,jsonTypeOf:A}=c,I=Object.freeze({id:"",pointer:"",instance:void 0,value:void 0}),j=e=>C.isReference(e.value)?C.value(e.value):e.value,T=r(((e,r)=>A(j(e),r))),x=(e,r)=>Object.freeze({...r,pointer:w.append(e,r.pointer),value:j(r)[e]}),P=r(((e,r)=>j(r).map(((t,n,o,a)=>e(x(n,r),n,o,a))))),$=r(((e,r)=>j(r).map(((e,t,n,o)=>x(t,r))).filter(((r,t,n,o)=>e(r,t,n,o))))),D=r(((e,r,t)=>j(t).reduce(((r,n,o)=>e(r,x(o,t),o)),r))),R=r(((e,r)=>j(r).every(((t,n,o,a)=>e(x(n,r),n,o,a))))),N=r(((e,r)=>j(r).some(((t,n,o,a)=>e(x(n,r),n,o,a)))));var _={nil:I,cons:(e,r="")=>Object.freeze({...I,id:O(r,""),instance:e,value:e}),uri:e=>`${e.id}#${encodeURI(e.pointer)}`,value:j,has:(e,r)=>e in j(r),typeOf:T,step:x,entries:e=>Object.keys(j(e)).map((r=>[r,x(r,e)])),keys:e=>Object.keys(j(e)),map:P,filter:$,reduce:D,every:R,some:N,length:e=>j(e).length},F=async e=>Object.entries(await e),k=r((async(e,r)=>(await r).map(e))),U=r((async(e,r,t)=>(await t).reduce((async(r,t)=>e(await r,t)),r))),q=r((async(e,r,t={})=>U((async(r,t)=>await e(t)?r.concat([t]):r),[],r,t))),L=r((async(e,r)=>{const t=await k(e,r);return(await Promise.all(t)).some((e=>e))})),z=r((async(e,r)=>{const t=await k(e,r);return(await Promise.all(t)).every((e=>e))})),H=r(((e,r)=>e.reduce((async(e,r)=>r(await e)),r))),V={entries:F,map:k,filter:q,reduce:U,some:L,every:z,pipeline:H,all:e=>Promise.all(e),allValues:e=>H([F,U((async(e,[r,t])=>(e[r]=await t,e)),{})],e)};V.entries,V.map,V.filter,V.reduce,V.some,V.every,V.pipeline,V.all,V.allValues;var M=fetch,K=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,Z=/^[\u000b\u0020-\u007e\u0080-\u00ff]+$/,J=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,B=/\\([\u000b\u0020-\u00ff])/g,G=/([\\"])/g,W=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,Q=function(e){if(!e)throw new TypeError("argument string is required");var r="object"==typeof e?function(e){var r;"function"==typeof e.getHeader?r=e.getHeader("content-type"):"object"==typeof e.headers&&(r=e.headers&&e.headers["content-type"]);if("string"!=typeof r)throw new TypeError("content-type header is missing from object");return r}(e):e;if("string"!=typeof r)throw new TypeError("argument string is required to be a string");var t=r.indexOf(";"),n=-1!==t?r.substr(0,t).trim():r.trim();if(!W.test(n))throw new TypeError("invalid media type");var o=new X(n.toLowerCase());if(-1!==t){var a,i,s;for(K.lastIndex=t;i=K.exec(r);){if(i.index!==t)throw new TypeError("invalid parameter format");t+=i[0].length,a=i[1].toLowerCase(),'"'===(s=i[2])[0]&&(s=s.substr(1,s.length-2).replace(B,"$1")),o.parameters[a]=s}if(t!==r.length)throw new TypeError("invalid parameter format")}return o}; | ||
/*! | ||
* content-type | ||
* Copyright(c) 2015 Douglas Christopher Wilson | ||
* MIT Licensed | ||
*/function Y(e){var r=String(e);if(J.test(r))return r;if(r.length>0&&!Z.test(r))throw new TypeError("invalid parameter value");return'"'+r.replace(G,"\\$1")+'"'}function X(e){this.parameters=Object.create(null),this.type=e}var ee={format:function(e){if(!e||"object"!=typeof e)throw new TypeError("argument obj is required");var r=e.parameters,t=e.type;if(!t||!W.test(t))throw new TypeError("invalid type");var n=t;if(r&&"object"==typeof r)for(var o,a=Object.keys(r).sort(),i=0;i<a.length;i++){if(o=a[i],!J.test(o))throw new TypeError("invalid parameter name");n+="; "+o+"="+Y(r[o])}return n},parse:Q};const re={};var te={addPlugin:(e,r)=>{re[e]=r},parse:e=>{const r=ee.parse(e.headers.get("content-type")).type;if(!(r in re))throw Error(`${e.url} is not a schema. Found a document with media type: ${r}`);return re[r].parse(e)},getContentType:e=>{for(const r in re)if(re[r].matcher(e))return r;return"application/octet-stream"}};const{jsonTypeOf:ne,resolveUrl:oe,urlFragment:ae,pathRelative:ie}=c,se="https://json-schema.org/draft/2019-09/vocab/core",ce="https://json-schema.org/draft/2020-12/vocab/core",ue={},le={},pe=(e,r)=>{const t=le[e];return ue[t]?.[r]},fe={},de={},he=(e,r="",t="")=>{e=JSON.parse(JSON.stringify(e));const n=oe(r,""),o=oe(e.$schema||t,"");if(!o)throw Error("Couldn't determine schema dialect");if(delete e.$schema,!(o in le))if(!0===e?.$vocabulary?.[se]&&o===ve(e,n,se)[0])le[o]=se;else if(!0===e?.$vocabulary?.[ce]&&o===ve(e,n,ce)[0])le[o]=ce;else if(o===ve(e,n,o)[0])le[o]=o;else{if(!(o in fe))throw Error(`Couldn't determine JSON Schema version for dialect: '${o}'`);{const e=fe[o];!0===e.vocabulary[se]?le[o]=se:!0===e.vocabulary[ce]?le[o]=ce:le[o]=le[e.dialectId]}}const[a,i]=ve(e,n,le[o]);if(!a)throw Error("Couldn't determine an identifier for the schema");const s=pe(o,"baseToken");delete e[s],n&&(de[n]=a);const c=pe(o,"anchorToken");i&&s===c&&(e[c]=c!==s?encodeURI(i):`#${encodeURI(i)}`);const u={},l=pe(o,"recursiveAnchorToken");let p;!0===e[l]&&(u[""]=`${a}#`,e[c]="",delete e[l]);const f=pe(o,"vocabularyToken");ne(e[f],"object")?(p=e[f],delete e[f]):p={[le[o]]:!0};const d={"":""};return fe[a]={id:a,dialectId:o,schema:ye(e,a,o,w.nil,d,u),anchors:d,dynamicAnchors:u,vocabulary:p,validated:!1},a},ve=(e,r,t)=>{const n=ue[t]?.baseToken,o=oe(r,e[n]||"");return[oe(o,""),ae(o)]},ye=(e,r,t,n,o,a)=>{if(ne(e,"object")){const i="string"==typeof e.$schema?oe(e.$schema,""):t,s=pe(i,"embeddedToken"),c=pe(i,"anchorToken");if("string"==typeof e[s]&&(s!==c||"#"!==e[s][0])){const n=oe(r,e[s]);return e[pe(i,"baseToken")]=n,he(e,n,t),C.cons(e[s],e)}const u=pe(t,"anchorToken"),l=pe(t,"dynamicAnchorToken");"string"==typeof e[l]&&(a[e[l]]=`${r}#${encodeURI(n)}`,o[e[l]]=n,delete e[l]);const p=pe(t,"embeddedToken");if("string"==typeof e[u]){const r=u!==p?e[u]:e[u].slice(1);o[r]=n,delete e[u]}const f=pe(t,"jrefToken");if("string"==typeof e[f])return C.cons(e[f],e);for(const i in e)e[i]=ye(e[i],r,t,w.append(i,n),o,a);return e}return Array.isArray(e)?e.map(((e,i)=>ye(e,r,t,w.append(i,n),o,a))):e},me=e=>fe[de[e]]||fe[e],ge=Object.freeze({id:"",dialectId:void 0,vocabulary:{},pointer:w.nil,schema:void 0,value:void 0,anchors:{},dynamicAnchors:{},validated:!0}),be=async(e,r=ge)=>{const t=oe(Se(r),e),n=oe(t,""),o=ae(t);if(!(e=>e in fe||e in de)(n)){const e=await M(n,{headers:{Accept:"application/schema+json"}});if(e.status>=400)throw await e.text(),Error(`Failed to retrieve schema with id: ${n}`);he(await te.parse(e),n)}const a=me(n),i="/"!==o[0]?Ee(a,o):o,s=Object.freeze({...a,pointer:i,value:w.get(i,a.schema)});return we(s)},we=e=>C.isReference(e.value)?be(C.href(e.value),e):e,Ee=(e,r)=>{if(!(r in e.anchors))throw Error(`No such anchor '${encodeURI(e.id)}#${encodeURI(r)}'`);return e.anchors[r]},Se=e=>`${e.id}#${encodeURI(e.pointer)}`,Ce=e=>C.isReference(e.value)?C.value(e.value):e.value,Oe=(e,r)=>{const t=me(r.id),n=Object.freeze({...r,pointer:w.append(e,r.pointer),value:Ce(r)[e],validated:t.validated});return we(n)},Ae=r(((e,r)=>V.pipeline([Ce,V.map((async(t,n)=>e(await Oe(n,r),n))),V.all],r))),Ie={parentId:"",parentDialect:"",includeEmbedded:!0},je=(e,r)=>{if(r.startsWith("file://")){const t=e.slice(7,e.lastIndexOf("/"));return""===e?"":ie(t,r.slice(7))}return r};var Te={setConfig:(e,r,t)=>{ue[e]||(ue[e]={}),ue[e][r]=t},getConfig:pe,add:he,get:be,markValidated:e=>{fe[e].validated=!0},uri:Se,value:Ce,getAnchorPointer:Ee,typeOf:(e,r)=>ne(Ce(e),r),has:(e,r)=>e in Ce(r),step:Oe,keys:e=>Object.keys(Ce(e)),entries:e=>V.pipeline([Ce,Object.keys,V.map((async r=>[r,await Oe(r,e)])),V.all],e),map:Ae,length:e=>Ce(e).length,toSchema:(e,r={})=>{const t={...Ie,...r},n=JSON.parse(JSON.stringify(e.schema,((r,n)=>{if(!C.isReference(n))return n;const o=C.value(n),a="string"==typeof o.$schema?oe(o.$schema,""):e.dialectId,i=pe(a,"embeddedToken");return!t.includeEmbedded&&i in o?void 0:C.value(n)}))),o=pe(e.dialectId,"dynamicAnchorToken");Object.entries(e.dynamicAnchors).forEach((([e,r])=>{const t=ae(r);w.assign(t,n,{[o]:e,...w.get(t,n)})}));const a=pe(e.dialectId,"anchorToken");Object.entries(e.anchors).filter((([e])=>""!==e)).forEach((([e,r])=>{w.assign(r,n,{[a]:e,...w.get(r,n)})}));const i=pe(e.dialectId,"baseToken"),s=je(t.parentId,e.id),c=t.parentDialect===e.dialectId?"":e.dialectId;return{...s&&{[i]:s},...c&&{$schema:c},...n}}};Te.setConfig,Te.getConfig,Te.add,Te.get,Te.markValidated,Te.uri,Te.value,Te.getAnchorPointer,Te.typeOf,Te.has,Te.step,Te.keys,Te.entries,Te.map,Te.length,Te.toSchema;class xe extends Error{constructor(e){super("Invalid Schema"),this.name=this.constructor.name,this.output=e}}var Pe=xe;const{resolveUrl:$e}=c,De="FLAG",Re="BASIC",Ne="DETAILED",_e="VERBOSE";let Fe=Ne,ke=!0;te.addPlugin("application/schema+json",{parse:async e=>await e.json(),matcher:e=>e.endsWith(".schema.json")});const Ue=async e=>{const r={metaData:{}};return{ast:r,schemaUri:await Ze(e,r)}},qe=r((({ast:e,schemaUri:r},t,n=De)=>{if(![De,Re,Ne,_e].includes(n))throw Error(`The '${n}' error format is not supported`);const a=[],i=o.subscribe("result",Le(n,a));return Be(r,t,e,{}),o.unsubscribe(i),a[0]})),Le=(e,r)=>{const t=[];return(n,o)=>{if("result"===n){const{keyword:e,absoluteKeywordLocation:r,instanceLocation:n,valid:a}=o,i={keyword:e,absoluteKeywordLocation:r,instanceLocation:n,valid:a,errors:[]};t.push(i)}else if("result.start"===n)t.push(n);else if("result.end"===n){const n=t.pop();for(;"result.start"!==t[t.length-1];){const r=t.pop(),o=[r];e===Re&&(o.push(...r.errors),delete r.errors),(e===_e||e!==De&&!r.valid)&&n.errors.unshift(...o)}t[t.length-1]=n,r[0]=n}}},ze={},He=e=>ze[e],Ve=e=>e in ze,Me={},Ke={},Ze=async(e,r)=>{if(e=await Je(e),!Ve(`${e.dialectId}#validate`)){const r=await Te.get(e.dialectId);(Te.getConfig(r.id,"mandatoryVocabularies")||[]).forEach((e=>{if(!r.vocabulary[e])throw Error(`Vocabulary '${e}' must be explicitly declared and required`)})),Object.entries(r.vocabulary).forEach((([e,t])=>{if(e in Me)Object.entries(Me[e]).forEach((([e,t])=>{((e,r)=>{ze[e]={collectEvaluatedItems:(e,t,n,o,a)=>r.interpret(e,t,n,o,a)&&new Set,collectEvaluatedProperties:(e,t,n,o,a)=>r.interpret(e,t,n,o,a)&&[],...r}})(`${r.id}#${e}`,t)}));else if(t)throw Error(`Missing required vocabulary: ${e}`)}))}if(ke&&!e.validated){if(Te.markValidated(e.id),!(e.dialectId in Ke)){const r=await Te.get(e.dialectId),t=await Ue(r);Ke[r.id]=qe(t)}const r=_.cons(e.schema,e.id),t=Ke[e.dialectId](r,Fe);if(!t.valid)throw new Pe(t)}return e.id in r.metaData||(r.metaData[e.id]={id:e.id,dynamicAnchors:e.dynamicAnchors,anchors:e.anchors}),He(`${e.dialectId}#validate`).compile(e,r)},Je=async e=>Te.typeOf(e,"string")?Je(await Te.get(Te.value(e),e)):e,Be=(e,r,t,n)=>{const o=Ge(e,t),a=$e(e,"");return He(o).interpret(e,r,t,{...t.metaData[a].dynamicAnchors,...n})},Ge=(e,r)=>{if(!(e in r))throw Error(`No schema found at ${e}`);return r[e][0]};var We={validate:async(e,r,t)=>{const n=await Ue(e),o=(e,r)=>qe(n,_.cons(e),r);return void 0===r?o:o(r,t)},compile:Ue,interpret:qe,setMetaOutputFormat:e=>{Fe=e},setShouldMetaValidate:e=>{ke=e},FLAG:De,BASIC:Re,DETAILED:Ne,VERBOSE:_e,add:(e,r="",t="")=>{const n=Te.add(e,r,t);delete Ke[n]},getKeyword:He,hasKeyword:Ve,defineVocabulary:(e,r)=>{Me[e]=r},compileSchema:Ze,interpretSchema:Be,collectEvaluatedProperties:(e,r,t,n,o)=>{const a=Ge(e,t);return He(a).collectEvaluatedProperties(e,r,t,n,o)},collectEvaluatedItems:(e,r,t,n,o)=>{const a=Ge(e,t);return He(a).collectEvaluatedItems(e,r,t,n,o)},addMediaTypePlugin:te.addPlugin};var Qe={compile:e=>Te.value(e),interpret:()=>!0};var Ye={compile:async(e,r)=>{const t=Te.uri(e);if(!(t in r)){r[t]=!1;const n=Te.value(e);if(!["object","boolean"].includes(typeof n))throw Error(`No schema found at '${Te.uri(e)}'`);r[t]=[`${e.dialectId}#validate`,Te.uri(e),"boolean"==typeof n?n:await V.pipeline([Te.entries,V.map((([r,t])=>[`${e.dialectId}#${r}`,t])),V.filter((([r])=>We.hasKeyword(r)&&r!==`${e.dialectId}#validate`)),V.map((async([t,n])=>{const o=await We.getKeyword(t).compile(n,r,e);return[t,Te.uri(n),o]})),V.all],e)]}return t},interpret:(e,r,t,n)=>{const[a,i,s]=t[e];o.publishSync("result.start");const c="boolean"==typeof s?s:s.every((([e,a,i])=>{o.publishSync("result.start");const s=We.getKeyword(e).interpret(i,r,t,n);return o.publishSync("result",{keyword:e,absoluteKeywordLocation:a,instanceLocation:_.uri(r),valid:s,ast:i}),o.publishSync("result.end"),s}));return o.publishSync("result",{keyword:a,absoluteKeywordLocation:i,instanceLocation:_.uri(r),valid:c,ast:e}),o.publishSync("result.end"),c},collectEvaluatedProperties:(e,r,t,n,o=!1)=>{const a=t[e][2];return"boolean"==typeof a?!!a&&[]:a.filter((([e])=>!o||!e.endsWith("#unevaluatedProperties"))).reduce(((e,[o,,a])=>{const i=e&&We.getKeyword(o).collectEvaluatedProperties(a,r,t,n);return!1!==i&&[...e,...i]}),[])},collectEvaluatedItems:(e,r,t,n,o=!1)=>{const a=t[e][2];return"boolean"==typeof a?!!a&&new Set:a.filter((([e])=>!o||!e.endsWith("#unevaluatedItems"))).reduce(((e,[o,,a])=>{const i=!1!==e&&We.getKeyword(o).collectEvaluatedItems(a,r,t,n);return!1!==i&&new Set([...e,...i])}),new Set)}},Xe={metaData:Qe,validate:Ye},er={Core:We,Schema:Te,Instance:_,Reference:C,Keywords:Xe,InvalidSchemaError:Pe},rr=er.Core,tr=er.Schema,nr=er.Instance,or=er.Reference,ar=er.Keywords,ir=er.InvalidSchemaError;return e.Core=rr,e.Instance=nr,e.InvalidSchemaError=ir,e.Keywords=ar,e.Reference=or,e.Schema=tr,e.default=er,Object.defineProperty(e,"__esModule",{value:!0}),e}({}); | ||
//# sourceMappingURL=json-schema-core-iife.min.js.map |
System.register("JSC",[],(function(e){"use strict";return{execute:function(){var r=function(e,r){return function t(){null==r&&(r=e.length);var n=[].slice.call(arguments);return n.length>=r?e.apply(this,n):function(){return t.apply(this,n.concat([].slice.call(arguments)))}}};var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function n(e,r){return e(r={exports:{}},r.exports),r.exports}var o=n((function(e,r){var n,o;n="object"==typeof window&&window||t,o={},n.PubSub?(o=n.PubSub,console.warn("PubSub already loaded, using existing version")):(n.PubSub=o,function(e){var r={},t=-1,n="*";function o(e){var r;for(r in e)if(Object.prototype.hasOwnProperty.call(e,r))return!0;return!1}function a(e){return function(){throw e}}function i(e,r,t){try{e(r,t)}catch(e){setTimeout(a(e),0)}}function s(e,r,t){e(r,t)}function c(e,t,n,o){var a,c=r[t],u=o?s:i;if(Object.prototype.hasOwnProperty.call(r,t))for(a in c)Object.prototype.hasOwnProperty.call(c,a)&&u(c[a],e,n)}function u(e,r,t){return function(){var o=String(e),a=o.lastIndexOf(".");for(c(e,e,r,t);-1!==a;)a=(o=o.substr(0,a)).lastIndexOf("."),c(e,o,r,t);c(e,n,r,t)}}function l(e){var t=String(e);return Boolean(Object.prototype.hasOwnProperty.call(r,t)&&o(r[t]))}function p(e){for(var r=String(e),t=l(r)||l(n),o=r.lastIndexOf(".");!t&&-1!==o;)o=(r=r.substr(0,o)).lastIndexOf("."),t=l(r);return t}function f(e,r,t,n){var o=u(e="symbol"==typeof e?e.toString():e,r,n);return!!p(e)&&(!0===t?o():setTimeout(o,0),!0)}e.publish=function(r,t){return f(r,t,!1,e.immediateExceptions)},e.publishSync=function(r,t){return f(r,t,!0,e.immediateExceptions)},e.subscribe=function(e,n){if("function"!=typeof n)return!1;e="symbol"==typeof e?e.toString():e,Object.prototype.hasOwnProperty.call(r,e)||(r[e]={});var o="uid_"+String(++t);return r[e][o]=n,o},e.subscribeAll=function(r){return e.subscribe(n,r)},e.subscribeOnce=function(r,t){var n=e.subscribe(r,(function(){e.unsubscribe(n),t.apply(this,arguments)}));return e},e.clearAllSubscriptions=function(){r={}},e.clearSubscriptions=function(e){var t;for(t in r)Object.prototype.hasOwnProperty.call(r,t)&&0===t.indexOf(e)&&delete r[t]},e.countSubscriptions=function(e){var t,n,o=0;for(t in r)if(Object.prototype.hasOwnProperty.call(r,t)&&0===t.indexOf(e)){for(n in r[t])o++;break}return o},e.getSubscriptions=function(e){var t,n=[];for(t in r)Object.prototype.hasOwnProperty.call(r,t)&&0===t.indexOf(e)&&n.push(t);return n},e.unsubscribe=function(t){var n,o,a,i=function(e){var t;for(t in r)if(Object.prototype.hasOwnProperty.call(r,t)&&0===t.indexOf(e))return!0;return!1},s="string"==typeof t&&(Object.prototype.hasOwnProperty.call(r,t)||i(t)),c=!s&&"string"==typeof t,u="function"==typeof t,l=!1;if(!s){for(n in r)if(Object.prototype.hasOwnProperty.call(r,n)){if(o=r[n],c&&o[t]){delete o[t],l=t;break}if(u)for(a in o)Object.prototype.hasOwnProperty.call(o,a)&&o[a]===t&&(delete o[a],l=!0)}return l}e.clearSubscriptions(t)}}(o)),void 0!==e&&e.exports&&(r=e.exports=o),r.PubSub=o,e.exports=r=o}));o.PubSub;var a,i=n((function(e,r){ | ||
/** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */ | ||
!function(e){function r(){for(var e=arguments.length,r=Array(e),t=0;t<e;t++)r[t]=arguments[t];if(r.length>1){r[0]=r[0].slice(0,-1);for(var n=r.length-1,o=1;o<n;++o)r[o]=r[o].slice(1,-1);return r[n]=r[n].slice(1),r.join("")}return r[0]}function t(e){return"(?:"+e+")"}function n(e){return void 0===e?"undefined":null===e?"null":Object.prototype.toString.call(e).split(" ").pop().split("]").shift().toLowerCase()}function o(e){return e.toUpperCase()}function a(e){return null!=e?e instanceof Array?e:"number"!=typeof e.length||e.split||e.setInterval||e.call?[e]:Array.prototype.slice.call(e):[]}function i(e,r){var t=e;if(r)for(var n in r)t[n]=r[n];return t}function s(e){var n="[A-Za-z]",o="[0-9]",a=r(o,"[A-Fa-f]"),i=t(t("%[EFef]"+a+"%"+a+a+"%"+a+a)+"|"+t("%[89A-Fa-f]"+a+"%"+a+a)+"|"+t("%"+a+a)),s="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",c=r("[\\:\\/\\?\\#\\[\\]\\@]",s),u=e?"[\\uE000-\\uF8FF]":"[]",l=r(n,o,"[\\-\\.\\_\\~]",e?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]");t(n+r(n,o,"[\\+\\-\\.]")+"*"),t(t(i+"|"+r(l,s,"[\\:]"))+"*");var p=t(t("25[0-5]")+"|"+t("2[0-4]"+o)+"|"+t("1"+o+o)+"|"+t("0?[1-9]"+o)+"|0?0?"+o),f=t(p+"\\."+p+"\\."+p+"\\."+p),d=t(a+"{1,4}"),h=t(t(d+"\\:"+d)+"|"+f),v=t(t(d+"\\:")+"{6}"+h),y=t("\\:\\:"+t(d+"\\:")+"{5}"+h),m=t(t(d)+"?\\:\\:"+t(d+"\\:")+"{4}"+h),g=t(t(t(d+"\\:")+"{0,1}"+d)+"?\\:\\:"+t(d+"\\:")+"{3}"+h),b=t(t(t(d+"\\:")+"{0,2}"+d)+"?\\:\\:"+t(d+"\\:")+"{2}"+h),w=t(t(t(d+"\\:")+"{0,3}"+d)+"?\\:\\:"+d+"\\:"+h),E=t(t(t(d+"\\:")+"{0,4}"+d)+"?\\:\\:"+h),S=t(t(t(d+"\\:")+"{0,5}"+d)+"?\\:\\:"+d),C=t(t(t(d+"\\:")+"{0,6}"+d)+"?\\:\\:"),O=t([v,y,m,g,b,w,E,S,C].join("|")),A=t(t(l+"|"+i)+"+");t("[vV]"+a+"+\\."+r(l,s,"[\\:]")+"+"),t(t(i+"|"+r(l,s))+"*");var I=t(i+"|"+r(l,s,"[\\:\\@]"));return t(t(i+"|"+r(l,s,"[\\@]"))+"+"),t(t(I+"|"+r("[\\/\\?]",u))+"*"),{NOT_SCHEME:new RegExp(r("[^]",n,o,"[\\+\\-\\.]"),"g"),NOT_USERINFO:new RegExp(r("[^\\%\\:]",l,s),"g"),NOT_HOST:new RegExp(r("[^\\%\\[\\]\\:]",l,s),"g"),NOT_PATH:new RegExp(r("[^\\%\\/\\:\\@]",l,s),"g"),NOT_PATH_NOSCHEME:new RegExp(r("[^\\%\\/\\@]",l,s),"g"),NOT_QUERY:new RegExp(r("[^\\%]",l,s,"[\\:\\@\\/\\?]",u),"g"),NOT_FRAGMENT:new RegExp(r("[^\\%]",l,s,"[\\:\\@\\/\\?]"),"g"),ESCAPE:new RegExp(r("[^]",l,s),"g"),UNRESERVED:new RegExp(l,"g"),OTHER_CHARS:new RegExp(r("[^\\%]",l,c),"g"),PCT_ENCODED:new RegExp(i,"g"),IPV4ADDRESS:new RegExp("^("+f+")$"),IPV6ADDRESS:new RegExp("^\\[?("+O+")"+t(t("\\%25|\\%(?!"+a+"{2})")+"("+A+")")+"?\\]?$")}}var c=s(!1),u=s(!0),l=function(){function e(e,r){var t=[],n=!0,o=!1,a=void 0;try{for(var i,s=e[Symbol.iterator]();!(n=(i=s.next()).done)&&(t.push(i.value),!r||t.length!==r);n=!0);}catch(e){o=!0,a=e}finally{try{!n&&s.return&&s.return()}finally{if(o)throw a}}return t}return function(r,t){if(Array.isArray(r))return r;if(Symbol.iterator in Object(r))return e(r,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),p=function(e){if(Array.isArray(e)){for(var r=0,t=Array(e.length);r<e.length;r++)t[r]=e[r];return t}return Array.from(e)},f=2147483647,d=36,h=1,v=26,y=38,m=700,g=72,b=128,w="-",E=/^xn--/,S=/[^\0-\x7E]/,C=/[\x2E\u3002\uFF0E\uFF61]/g,O={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},A=d-h,I=Math.floor,j=String.fromCharCode;function T(e){throw new RangeError(O[e])}function x(e,r){for(var t=[],n=e.length;n--;)t[n]=r(e[n]);return t}function $(e,r){var t=e.split("@"),n="";return t.length>1&&(n=t[0]+"@",e=t[1]),n+x((e=e.replace(C,".")).split("."),r).join(".")}function D(e){for(var r=[],t=0,n=e.length;t<n;){var o=e.charCodeAt(t++);if(o>=55296&&o<=56319&&t<n){var a=e.charCodeAt(t++);56320==(64512&a)?r.push(((1023&o)<<10)+(1023&a)+65536):(r.push(o),t--)}else r.push(o)}return r}var P=function(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:d},R=function(e,r){return e+22+75*(e<26)-((0!=r)<<5)},N=function(e,r,t){var n=0;for(e=t?I(e/m):e>>1,e+=I(e/r);e>A*v>>1;n+=d)e=I(e/A);return I(n+(A+1)*e/(e+y))},F=function(e){var r=[],t=e.length,n=0,o=b,a=g,i=e.lastIndexOf(w);i<0&&(i=0);for(var s=0;s<i;++s)e.charCodeAt(s)>=128&&T("not-basic"),r.push(e.charCodeAt(s));for(var c=i>0?i+1:0;c<t;){for(var u=n,l=1,p=d;;p+=d){c>=t&&T("invalid-input");var y=P(e.charCodeAt(c++));(y>=d||y>I((f-n)/l))&&T("overflow"),n+=y*l;var m=p<=a?h:p>=a+v?v:p-a;if(y<m)break;var E=d-m;l>I(f/E)&&T("overflow"),l*=E}var S=r.length+1;a=N(n-u,S,0==u),I(n/S)>f-o&&T("overflow"),o+=I(n/S),n%=S,r.splice(n++,0,o)}return String.fromCodePoint.apply(String,r)},_=function(e){var r=[],t=(e=D(e)).length,n=b,o=0,a=g,i=!0,s=!1,c=void 0;try{for(var u,l=e[Symbol.iterator]();!(i=(u=l.next()).done);i=!0){var p=u.value;p<128&&r.push(j(p))}}catch(e){s=!0,c=e}finally{try{!i&&l.return&&l.return()}finally{if(s)throw c}}var y=r.length,m=y;for(y&&r.push(w);m<t;){var E=f,S=!0,C=!1,O=void 0;try{for(var A,x=e[Symbol.iterator]();!(S=(A=x.next()).done);S=!0){var $=A.value;$>=n&&$<E&&(E=$)}}catch(e){C=!0,O=e}finally{try{!S&&x.return&&x.return()}finally{if(C)throw O}}var P=m+1;E-n>I((f-o)/P)&&T("overflow"),o+=(E-n)*P,n=E;var F=!0,_=!1,k=void 0;try{for(var U,q=e[Symbol.iterator]();!(F=(U=q.next()).done);F=!0){var L=U.value;if(L<n&&++o>f&&T("overflow"),L==n){for(var z=o,H=d;;H+=d){var V=H<=a?h:H>=a+v?v:H-a;if(z<V)break;var K=z-V,M=d-V;r.push(j(R(V+K%M,0))),z=I(K/M)}r.push(j(R(z,0))),a=N(o,P,m==y),o=0,++m}}}catch(e){_=!0,k=e}finally{try{!F&&q.return&&q.return()}finally{if(_)throw k}}++o,++n}return r.join("")},k=function(e){return $(e,(function(e){return E.test(e)?F(e.slice(4).toLowerCase()):e}))},U=function(e){return $(e,(function(e){return S.test(e)?"xn--"+_(e):e}))},q={version:"2.1.0",ucs2:{decode:D,encode:function(e){return String.fromCodePoint.apply(String,p(e))}},decode:F,encode:_,toASCII:U,toUnicode:k},L={};function z(e){var r=e.charCodeAt(0);return r<16?"%0"+r.toString(16).toUpperCase():r<128?"%"+r.toString(16).toUpperCase():r<2048?"%"+(r>>6|192).toString(16).toUpperCase()+"%"+(63&r|128).toString(16).toUpperCase():"%"+(r>>12|224).toString(16).toUpperCase()+"%"+(r>>6&63|128).toString(16).toUpperCase()+"%"+(63&r|128).toString(16).toUpperCase()}function H(e){for(var r="",t=0,n=e.length;t<n;){var o=parseInt(e.substr(t+1,2),16);if(o<128)r+=String.fromCharCode(o),t+=3;else if(o>=194&&o<224){if(n-t>=6){var a=parseInt(e.substr(t+4,2),16);r+=String.fromCharCode((31&o)<<6|63&a)}else r+=e.substr(t,6);t+=6}else if(o>=224){if(n-t>=9){var i=parseInt(e.substr(t+4,2),16),s=parseInt(e.substr(t+7,2),16);r+=String.fromCharCode((15&o)<<12|(63&i)<<6|63&s)}else r+=e.substr(t,9);t+=9}else r+=e.substr(t,3),t+=3}return r}function V(e,r){function t(e){var t=H(e);return t.match(r.UNRESERVED)?t:e}return e.scheme&&(e.scheme=String(e.scheme).replace(r.PCT_ENCODED,t).toLowerCase().replace(r.NOT_SCHEME,"")),void 0!==e.userinfo&&(e.userinfo=String(e.userinfo).replace(r.PCT_ENCODED,t).replace(r.NOT_USERINFO,z).replace(r.PCT_ENCODED,o)),void 0!==e.host&&(e.host=String(e.host).replace(r.PCT_ENCODED,t).toLowerCase().replace(r.NOT_HOST,z).replace(r.PCT_ENCODED,o)),void 0!==e.path&&(e.path=String(e.path).replace(r.PCT_ENCODED,t).replace(e.scheme?r.NOT_PATH:r.NOT_PATH_NOSCHEME,z).replace(r.PCT_ENCODED,o)),void 0!==e.query&&(e.query=String(e.query).replace(r.PCT_ENCODED,t).replace(r.NOT_QUERY,z).replace(r.PCT_ENCODED,o)),void 0!==e.fragment&&(e.fragment=String(e.fragment).replace(r.PCT_ENCODED,t).replace(r.NOT_FRAGMENT,z).replace(r.PCT_ENCODED,o)),e}function K(e){return e.replace(/^0*(.*)/,"$1")||"0"}function M(e,r){var t=e.match(r.IPV4ADDRESS)||[],n=l(t,2)[1];return n?n.split(".").map(K).join("."):e}function Z(e,r){var t=e.match(r.IPV6ADDRESS)||[],n=l(t,3),o=n[1],a=n[2];if(o){for(var i=o.toLowerCase().split("::").reverse(),s=l(i,2),c=s[0],u=s[1],p=u?u.split(":").map(K):[],f=c.split(":").map(K),d=r.IPV4ADDRESS.test(f[f.length-1]),h=d?7:8,v=f.length-h,y=Array(h),m=0;m<h;++m)y[m]=p[m]||f[v+m]||"";d&&(y[h-1]=M(y[h-1],r));var g=y.reduce((function(e,r,t){if(!r||"0"===r){var n=e[e.length-1];n&&n.index+n.length===t?n.length++:e.push({index:t,length:1})}return e}),[]).sort((function(e,r){return r.length-e.length}))[0],b=void 0;if(g&&g.length>1){var w=y.slice(0,g.index),E=y.slice(g.index+g.length);b=w.join(":")+"::"+E.join(":")}else b=y.join(":");return a&&(b+="%"+a),b}return e}var J=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,B=void 0==="".match(/(){0}/)[1];function G(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t={},n=!1!==r.iri?u:c;"suffix"===r.reference&&(e=(r.scheme?r.scheme+":":"")+"//"+e);var o=e.match(J);if(o){B?(t.scheme=o[1],t.userinfo=o[3],t.host=o[4],t.port=parseInt(o[5],10),t.path=o[6]||"",t.query=o[7],t.fragment=o[8],isNaN(t.port)&&(t.port=o[5])):(t.scheme=o[1]||void 0,t.userinfo=-1!==e.indexOf("@")?o[3]:void 0,t.host=-1!==e.indexOf("//")?o[4]:void 0,t.port=parseInt(o[5],10),t.path=o[6]||"",t.query=-1!==e.indexOf("?")?o[7]:void 0,t.fragment=-1!==e.indexOf("#")?o[8]:void 0,isNaN(t.port)&&(t.port=e.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?o[4]:void 0)),t.host&&(t.host=Z(M(t.host,n),n)),void 0!==t.scheme||void 0!==t.userinfo||void 0!==t.host||void 0!==t.port||t.path||void 0!==t.query?void 0===t.scheme?t.reference="relative":void 0===t.fragment?t.reference="absolute":t.reference="uri":t.reference="same-document",r.reference&&"suffix"!==r.reference&&r.reference!==t.reference&&(t.error=t.error||"URI is not a "+r.reference+" reference.");var a=L[(r.scheme||t.scheme||"").toLowerCase()];if(r.unicodeSupport||a&&a.unicodeSupport)V(t,n);else{if(t.host&&(r.domainHost||a&&a.domainHost))try{t.host=q.toASCII(t.host.replace(n.PCT_ENCODED,H).toLowerCase())}catch(e){t.error=t.error||"Host's domain name can not be converted to ASCII via punycode: "+e}V(t,c)}a&&a.parse&&a.parse(t,r)}else t.error=t.error||"URI can not be parsed.";return t}function W(e,r){var t=!1!==r.iri?u:c,n=[];return void 0!==e.userinfo&&(n.push(e.userinfo),n.push("@")),void 0!==e.host&&n.push(Z(M(String(e.host),t),t).replace(t.IPV6ADDRESS,(function(e,r,t){return"["+r+(t?"%25"+t:"")+"]"}))),"number"!=typeof e.port&&"string"!=typeof e.port||(n.push(":"),n.push(String(e.port))),n.length?n.join(""):void 0}var Q=/^\.\.?\//,Y=/^\/\.(\/|$)/,X=/^\/\.\.(\/|$)/,ee=/^\/?(?:.|\n)*?(?=\/|$)/;function re(e){for(var r=[];e.length;)if(e.match(Q))e=e.replace(Q,"");else if(e.match(Y))e=e.replace(Y,"/");else if(e.match(X))e=e.replace(X,"/"),r.pop();else if("."===e||".."===e)e="";else{var t=e.match(ee);if(!t)throw new Error("Unexpected dot segment condition");var n=t[0];e=e.slice(n.length),r.push(n)}return r.join("")}function te(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=r.iri?u:c,n=[],o=L[(r.scheme||e.scheme||"").toLowerCase()];if(o&&o.serialize&&o.serialize(e,r),e.host)if(t.IPV6ADDRESS.test(e.host));else if(r.domainHost||o&&o.domainHost)try{e.host=r.iri?q.toUnicode(e.host):q.toASCII(e.host.replace(t.PCT_ENCODED,H).toLowerCase())}catch(t){e.error=e.error||"Host's domain name can not be converted to "+(r.iri?"Unicode":"ASCII")+" via punycode: "+t}V(e,t),"suffix"!==r.reference&&e.scheme&&(n.push(e.scheme),n.push(":"));var a=W(e,r);if(void 0!==a&&("suffix"!==r.reference&&n.push("//"),n.push(a),e.path&&"/"!==e.path.charAt(0)&&n.push("/")),void 0!==e.path){var i=e.path;r.absolutePath||o&&o.absolutePath||(i=re(i)),void 0===a&&(i=i.replace(/^\/\//,"/%2F")),n.push(i)}return void 0!==e.query&&(n.push("?"),n.push(e.query)),void 0!==e.fragment&&(n.push("#"),n.push(e.fragment)),n.join("")}function ne(e,r){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n={};return arguments[3]||(e=G(te(e,t),t),r=G(te(r,t),t)),!(t=t||{}).tolerant&&r.scheme?(n.scheme=r.scheme,n.userinfo=r.userinfo,n.host=r.host,n.port=r.port,n.path=re(r.path||""),n.query=r.query):(void 0!==r.userinfo||void 0!==r.host||void 0!==r.port?(n.userinfo=r.userinfo,n.host=r.host,n.port=r.port,n.path=re(r.path||""),n.query=r.query):(r.path?("/"===r.path.charAt(0)?n.path=re(r.path):(void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?n.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+r.path:n.path=r.path:n.path="/"+r.path,n.path=re(n.path)),n.query=r.query):(n.path=e.path,void 0!==r.query?n.query=r.query:n.query=e.query),n.userinfo=e.userinfo,n.host=e.host,n.port=e.port),n.scheme=e.scheme),n.fragment=r.fragment,n}function oe(e,r,t){var n=i({scheme:"null"},t);return te(ne(G(e,n),G(r,n),n,!0),n)}function ae(e,r){return"string"==typeof e?e=te(G(e,r),r):"object"===n(e)&&(e=G(te(e,r),r)),e}function ie(e,r,t){return"string"==typeof e?e=te(G(e,t),t):"object"===n(e)&&(e=te(e,t)),"string"==typeof r?r=te(G(r,t),t):"object"===n(r)&&(r=te(r,t)),e===r}function se(e,r){return e&&e.toString().replace(r&&r.iri?u.ESCAPE:c.ESCAPE,z)}function ce(e,r){return e&&e.toString().replace(r&&r.iri?u.PCT_ENCODED:c.PCT_ENCODED,H)}var ue={scheme:"http",domainHost:!0,parse:function(e,r){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e},serialize:function(e,r){var t="https"===String(e.scheme).toLowerCase();return e.port!==(t?443:80)&&""!==e.port||(e.port=void 0),e.path||(e.path="/"),e}},le={scheme:"https",domainHost:ue.domainHost,parse:ue.parse,serialize:ue.serialize};function pe(e){return"boolean"==typeof e.secure?e.secure:"wss"===String(e.scheme).toLowerCase()}var fe={scheme:"ws",domainHost:!0,parse:function(e,r){var t=e;return t.secure=pe(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t},serialize:function(e,r){if(e.port!==(pe(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 t=e.resourceName.split("?"),n=l(t,2),o=n[0],a=n[1];e.path=o&&"/"!==o?o:void 0,e.query=a,e.resourceName=void 0}return e.fragment=void 0,e}},de={scheme:"wss",domainHost:fe.domainHost,parse:fe.parse,serialize:fe.serialize},he={},ve="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",ye="[0-9A-Fa-f]",me=t(t("%[EFef]"+ye+"%"+ye+ye+"%"+ye+ye)+"|"+t("%[89A-Fa-f]"+ye+"%"+ye+ye)+"|"+t("%"+ye+ye)),ge="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]",be=r("[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",'[\\"\\\\]'),we="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]",Ee=new RegExp(ve,"g"),Se=new RegExp(me,"g"),Ce=new RegExp(r("[^]",ge,"[\\.]",'[\\"]',be),"g"),Oe=new RegExp(r("[^]",ve,we),"g"),Ae=Oe;function Ie(e){var r=H(e);return r.match(Ee)?r:e}var je={scheme:"mailto",parse:function(e,r){var t=e,n=t.to=t.path?t.path.split(","):[];if(t.path=void 0,t.query){for(var o=!1,a={},i=t.query.split("&"),s=0,c=i.length;s<c;++s){var u=i[s].split("=");switch(u[0]){case"to":for(var l=u[1].split(","),p=0,f=l.length;p<f;++p)n.push(l[p]);break;case"subject":t.subject=ce(u[1],r);break;case"body":t.body=ce(u[1],r);break;default:o=!0,a[ce(u[0],r)]=ce(u[1],r)}}o&&(t.headers=a)}t.query=void 0;for(var d=0,h=n.length;d<h;++d){var v=n[d].split("@");if(v[0]=ce(v[0]),r.unicodeSupport)v[1]=ce(v[1],r).toLowerCase();else try{v[1]=q.toASCII(ce(v[1],r).toLowerCase())}catch(e){t.error=t.error||"Email address's domain name can not be converted to ASCII via punycode: "+e}n[d]=v.join("@")}return t},serialize:function(e,r){var t=e,n=a(e.to);if(n){for(var i=0,s=n.length;i<s;++i){var c=String(n[i]),u=c.lastIndexOf("@"),l=c.slice(0,u).replace(Se,Ie).replace(Se,o).replace(Ce,z),p=c.slice(u+1);try{p=r.iri?q.toUnicode(p):q.toASCII(ce(p,r).toLowerCase())}catch(e){t.error=t.error||"Email address's domain name can not be converted to "+(r.iri?"Unicode":"ASCII")+" via punycode: "+e}n[i]=l+"@"+p}t.path=n.join(",")}var f=e.headers=e.headers||{};e.subject&&(f.subject=e.subject),e.body&&(f.body=e.body);var d=[];for(var h in f)f[h]!==he[h]&&d.push(h.replace(Se,Ie).replace(Se,o).replace(Oe,z)+"="+f[h].replace(Se,Ie).replace(Se,o).replace(Ae,z));return d.length&&(t.query=d.join("&")),t}},Te=/^([^\:]+)\:(.*)/,xe={scheme:"urn",parse:function(e,r){var t=e.path&&e.path.match(Te),n=e;if(t){var o=r.scheme||n.scheme||"urn",a=t[1].toLowerCase(),i=t[2],s=o+":"+(r.nid||a),c=L[s];n.nid=a,n.nss=i,n.path=void 0,c&&(n=c.parse(n,r))}else n.error=n.error||"URN can not be parsed.";return n},serialize:function(e,r){var t=r.scheme||e.scheme||"urn",n=e.nid,o=t+":"+(r.nid||n),a=L[o];a&&(e=a.serialize(e,r));var i=e,s=e.nss;return i.path=(n||r.nid)+":"+s,i}},$e=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/,De={scheme:"urn:uuid",parse:function(e,r){var t=e;return t.uuid=t.nss,t.nss=void 0,r.tolerant||t.uuid&&t.uuid.match($e)||(t.error=t.error||"UUID is not valid."),t},serialize:function(e,r){var t=e;return t.nss=(e.uuid||"").toLowerCase(),t}};L[ue.scheme]=ue,L[le.scheme]=le,L[fe.scheme]=fe,L[de.scheme]=de,L[je.scheme]=je,L[xe.scheme]=xe,L[De.scheme]=De,e.SCHEMES=L,e.pctEncChar=z,e.pctDecChars=H,e.parse=G,e.removeDotSegments=re,e.serialize=te,e.resolveComponents=ne,e.resolve=oe,e.normalize=ae,e.equal=ie,e.escapeComponent=se,e.unescapeComponent=ce,Object.defineProperty(e,"__esModule",{value:!0})}(r)}));(a=i)&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")&&a.default;const s={null:e=>null===e,boolean:e=>"boolean"==typeof e,object:e=>"object"==typeof e&&!Array.isArray(e)&&null!==e,array:e=>Array.isArray(e),number:e=>"number"==typeof e,integer:e=>Number.isInteger(e),string:e=>"string"==typeof e};var c={jsonTypeOf:(e,r)=>s[r](e),resolveUrl:(e,r)=>{const t=i.resolve(e,r,{iri:!0});if(i.resolve(e,"",{iri:!0})&&"file"===i.parse(t).scheme&&"file"!==i.parse(e).scheme)throw Error(`Can't access file '${t}' resource from network context '${e}'`);return t},urlFragment:e=>i.unescapeComponent(i.parse(e).fragment)||"",pathRelative:(e,r)=>{if(e===r)return"";let t=1;const n=e.length-1,o=r.length-t,a=n<o?n:o;let i=-1,s=0;for(;s<a;s++){const n=e.charCodeAt(s+1);if(n!==r.charCodeAt(t+s))break;47===n&&(i=s)}if(o>a){if(47===r.charCodeAt(t+s))return r.slice(t+s+1);if(0===s)return r.slice(t+s)}n>a&&(47===e.charCodeAt(s+1)?i=s:0===a&&(i=0));let c="";for(s=i+2;s<=e.length;++s)s!==e.length&&47!==e.charCodeAt(s)||(c+=0===c.length?"..":"/..");return t+=i,c.length>0?`${c}${r.slice(t,r.length)}`:(47===r.charCodeAt(t)&&++t,r.slice(t,r.length))}};const u=e=>{if(e.length>0&&"/"!==e[0])throw Error("Invalid JSON Pointer");return e.split("/").slice(1).map(y)},l=(e,r,t,n)=>{if(0===e.length)return t;if(e.length>1){const o=e.shift();return{...r,[o]:l(e,g(r,o,n),t,h(o,n))}}if(Array.isArray(r)){const n=[...r];return n[m(r,e[0])]=t,n}return"object"==typeof r&&null!==r?{...r,[e[0]]:t}:g(r,e[0],n)},p=(e,r,t,n)=>{if(0!==e.length)if(1!==e.length||b(r)){const o=e.shift();p(e,g(r,o,n),t,h(o,n))}else{r[m(r,e[0])]=t}},f=(e,r,t)=>{if(0!=e.length){if(e.length>1){const n=e.shift(),o=g(r,n,t);return{...r,[n]:f(e,o,h(n,t))}}if(Array.isArray(r))return r.filter(((r,t)=>t!=e[0]));if("object"==typeof r&&null!==r){const{[e[0]]:t,...n}=r;return n}return g(r,e[0],t)}},d=(e,r,t)=>{if(0!==e.length)if(e.length>1){const n=e.shift(),o=g(r,n,t);d(e,o,h(n,t))}else Array.isArray(r)?r.splice(e[0],1):"object"==typeof r&&null!==r?delete r[e[0]]:g(r,e[0],t)},h=r(((e,r)=>r+"/"+v(e))),v=e=>e.toString().replace(/~/g,"~0").replace(/\//g,"~1"),y=e=>e.toString().replace(/~1/g,"/").replace(/~0/g,"~"),m=(e,r)=>Array.isArray(e)&&"-"===r?e.length:r,g=(e,r,t="")=>{if(void 0===e)throw TypeError(`Value at '${t}' is undefined and does not have property '${r}'`);if(null===e)throw TypeError(`Value at '${t}' is null and does not have property '${r}'`);if(b(e))throw TypeError(`Value at '${t}' is a ${typeof e} and does not have property '${r}'`);return e[m(e,r)]},b=e=>null===e||"object"!=typeof e;var w={nil:"",append:h,get:(e,r)=>{const t=u(e),n=e=>t.reduce((([e,r],t)=>[g(e,t,r),h(t,r)]),[e,""])[0];return void 0===r?n:n(r)},set:(e,t,n)=>{const o=u(e),a=r(((e,r)=>l(o,e,r,"")));return void 0===t?a:a(t,n)},assign:(e,t,n)=>{const o=u(e),a=r(((e,r)=>p(o,e,r,"")));return void 0===t?a:a(t,n)},unset:(e,r)=>{const t=u(e),n=e=>f(t,e,"");return void 0===r?n:n(r)},remove:(e,r)=>{const t=u(e),n=e=>d(t,e,"");return void 0===r?n:n(r)}};w.nil,w.append,w.get,w.set,w.assign,w.unset,w.remove;const E=Symbol("$__value"),S=Symbol("$__href");var C={cons:(e,r)=>Object.freeze({[S]:e,[E]:r}),isReference:e=>e&&void 0!==e[S],href:e=>e[S],value:e=>e[E]};const{resolveUrl:O,jsonTypeOf:A}=c,I=Object.freeze({id:"",pointer:"",instance:void 0,value:void 0}),j=e=>C.isReference(e.value)?C.value(e.value):e.value,T=r(((e,r)=>A(j(e),r))),x=(e,r)=>Object.freeze({...r,pointer:w.append(e,r.pointer),value:j(r)[e]}),$=r(((e,r)=>j(r).map(((t,n,o,a)=>e(x(n,r),n,o,a))))),D=r(((e,r)=>j(r).map(((e,t,n,o)=>x(t,r))).filter(((r,t,n,o)=>e(r,t,n,o))))),P=r(((e,r,t)=>j(t).reduce(((r,n,o)=>e(r,x(o,t),o)),r))),R=r(((e,r)=>j(r).every(((t,n,o,a)=>e(x(n,r),n,o,a))))),N=r(((e,r)=>j(r).some(((t,n,o,a)=>e(x(n,r),n,o,a)))));var F={nil:I,cons:(e,r="")=>Object.freeze({...I,id:O(r,""),instance:e,value:e}),uri:e=>`${e.id}#${encodeURI(e.pointer)}`,value:j,has:(e,r)=>e in j(r),typeOf:T,step:x,entries:e=>Object.keys(j(e)).map((r=>[r,x(r,e)])),keys:e=>Object.keys(j(e)),map:$,filter:D,reduce:P,every:R,some:N,length:e=>j(e).length},_=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,k=/^[\u000b\u0020-\u007e\u0080-\u00ff]+$/,U=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,q=/\\([\u000b\u0020-\u00ff])/g,L=/([\\"])/g,z=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,H=function(e){if(!e)throw new TypeError("argument string is required");var r="object"==typeof e?function(e){var r;"function"==typeof e.getHeader?r=e.getHeader("content-type"):"object"==typeof e.headers&&(r=e.headers&&e.headers["content-type"]);if("string"!=typeof r)throw new TypeError("content-type header is missing from object");return r}(e):e;if("string"!=typeof r)throw new TypeError("argument string is required to be a string");var t=r.indexOf(";"),n=-1!==t?r.substr(0,t).trim():r.trim();if(!z.test(n))throw new TypeError("invalid media type");var o=new K(n.toLowerCase());if(-1!==t){var a,i,s;for(_.lastIndex=t;i=_.exec(r);){if(i.index!==t)throw new TypeError("invalid parameter format");t+=i[0].length,a=i[1].toLowerCase(),'"'===(s=i[2])[0]&&(s=s.substr(1,s.length-2).replace(q,"$1")),o.parameters[a]=s}if(t!==r.length)throw new TypeError("invalid parameter format")}return o};function V(e){var r=String(e);if(U.test(r))return r;if(r.length>0&&!k.test(r))throw new TypeError("invalid parameter value");return'"'+r.replace(L,"\\$1")+'"'}function K(e){this.parameters=Object.create(null),this.type=e}var M={format:function(e){if(!e||"object"!=typeof e)throw new TypeError("argument obj is required");var r=e.parameters,t=e.type;if(!t||!z.test(t))throw new TypeError("invalid type");var n=t;if(r&&"object"==typeof r)for(var o,a=Object.keys(r).sort(),i=0;i<a.length;i++){if(o=a[i],!U.test(o))throw new TypeError("invalid parameter name");n+="; "+o+"="+V(r[o])}return n},parse:H},Z=async e=>Object.entries(await e),J=r((async(e,r)=>(await r).map(e))),B=r((async(e,r,t)=>(await t).reduce((async(r,t)=>e(await r,t)),r))),G=r((async(e,r,t={})=>B((async(r,t)=>await e(t)?r.concat([t]):r),[],r,t))),W=r((async(e,r)=>{const t=await J(e,r);return(await Promise.all(t)).some((e=>e))})),Q=r((async(e,r)=>{const t=await J(e,r);return(await Promise.all(t)).every((e=>e))})),Y=r(((e,r)=>e.reduce((async(e,r)=>r(await e)),r))),X={entries:Z,map:J,filter:G,reduce:B,some:W,every:Q,pipeline:Y,all:e=>Promise.all(e),allValues:e=>Y([Z,B((async(e,[r,t])=>(e[r]=await t,e)),{})],e)};X.entries,X.map,X.filter,X.reduce,X.some,X.every,X.pipeline,X.all,X.allValues;var ee=fetch;const{jsonTypeOf:re,resolveUrl:te,urlFragment:ne,pathRelative:oe}=c,ae="https://json-schema.org/draft/2019-09/vocab/core",ie="https://json-schema.org/draft/2020-12/vocab/core",se={},ce={},ue=(e,r)=>{const t=ce[e];return se[t]?.[r]},le={},pe={},fe=(e,r="",t="")=>{e=JSON.parse(JSON.stringify(e));const n=te(r,""),o=te(e.$schema||t,"");if(!o)throw Error("Couldn't determine schema dialect");if(delete e.$schema,!(o in ce))if(!0===e?.$vocabulary?.[ae]&&o===de(e,n,ae)[0])ce[o]=ae;else if(!0===e?.$vocabulary?.[ie]&&o===de(e,n,ie)[0])ce[o]=ie;else if(o===de(e,n,o)[0])ce[o]=o;else{if(!(o in le))throw Error(`Couldn't determine JSON Schema version for dialect: '${o}'`);{const e=le[o];!0===e.vocabulary[ae]?ce[o]=ae:!0===e.vocabulary[ie]?ce[o]=ie:ce[o]=ce[e.dialectId]}}const[a,i]=de(e,n,ce[o]);if(!a)throw Error("Couldn't determine an identifier for the schema");const s=ue(o,"baseToken");delete e[s],n&&(pe[n]=a);const c=ue(o,"anchorToken");i&&s===c&&(e[c]=c!==s?encodeURI(i):`#${encodeURI(i)}`);const u={},l=ue(o,"recursiveAnchorToken");let p;!0===e[l]&&(u[""]=`${a}#`,e[c]="",delete e[l]);const f=ue(o,"vocabularyToken");re(e[f],"object")?(p=e[f],delete e[f]):p={[ce[o]]:!0};const d={"":""};return le[a]={id:a,dialectId:o,schema:he(e,a,o,w.nil,d,u),anchors:d,dynamicAnchors:u,vocabulary:p,validated:!1},a},de=(e,r,t)=>{const n=se[t]?.baseToken,o=te(r,e[n]||"");return[te(o,""),ne(o)]},he=(e,r,t,n,o,a)=>{if(re(e,"object")){const i="string"==typeof e.$schema?te(e.$schema,""):t,s=ue(i,"embeddedToken"),c=ue(i,"anchorToken");if("string"==typeof e[s]&&(s!==c||"#"!==e[s][0])){const n=te(r,e[s]);return e[ue(i,"baseToken")]=n,fe(e,n,t),C.cons(e[s],e)}const u=ue(t,"anchorToken"),l=ue(t,"dynamicAnchorToken");"string"==typeof e[l]&&(a[e[l]]=`${r}#${encodeURI(n)}`,o[e[l]]=n,delete e[l]);const p=ue(t,"embeddedToken");if("string"==typeof e[u]){const r=u!==p?e[u]:e[u].slice(1);o[r]=n,delete e[u]}const f=ue(t,"jrefToken");if("string"==typeof e[f])return C.cons(e[f],e);for(const i in e)e[i]=he(e[i],r,t,w.append(i,n),o,a);return e}return Array.isArray(e)?e.map(((e,i)=>he(e,r,t,w.append(i,n),o,a))):e},ve=e=>le[pe[e]]||le[e],ye=Object.freeze({id:"",dialectId:void 0,vocabulary:{},pointer:w.nil,schema:void 0,value:void 0,anchors:{},dynamicAnchors:{},validated:!0}),me=async(e,r=ye)=>{const t=te(we(r),e),n=te(t,""),o=ne(t);if(!(e=>e in le||e in pe)(n)){const e=await ee(n,{headers:{Accept:"application/schema+json"}});if(e.status>=400)throw await e.text(),Error(`Failed to retrieve schema with id: ${n}`);if(e.headers.has("content-type")){const r=M.parse(e.headers.get("content-type")).type;if("application/schema+json"!==r)throw Error(`${n} is not a schema. Found a document with media type: ${r}`)}fe(await e.json(),n)}const a=ve(n),i="/"!==o[0]?be(a,o):o,s=Object.freeze({...a,pointer:i,value:w.get(i,a.schema)});return ge(s)},ge=e=>C.isReference(e.value)?me(C.href(e.value),e):e,be=(e,r)=>{if(!(r in e.anchors))throw Error(`No such anchor '${encodeURI(e.id)}#${encodeURI(r)}'`);return e.anchors[r]},we=e=>`${e.id}#${encodeURI(e.pointer)}`,Ee=e=>C.isReference(e.value)?C.value(e.value):e.value,Se=(e,r)=>{const t=ve(r.id),n=Object.freeze({...r,pointer:w.append(e,r.pointer),value:Ee(r)[e],validated:t.validated});return ge(n)},Ce=r(((e,r)=>X.pipeline([Ee,X.map((async(t,n)=>e(await Se(n,r),n))),X.all],r))),Oe={parentId:"",parentDialect:"",includeEmbedded:!0},Ae=(e,r)=>{if(r.startsWith("file://")){const t=e.slice(7,e.lastIndexOf("/"));return""===e?"":oe(t,r.slice(7))}return r};var Ie={setConfig:(e,r,t)=>{se[e]||(se[e]={}),se[e][r]=t},getConfig:ue,add:fe,get:me,markValidated:e=>{le[e].validated=!0},uri:we,value:Ee,getAnchorPointer:be,typeOf:(e,r)=>re(Ee(e),r),has:(e,r)=>e in Ee(r),step:Se,keys:e=>Object.keys(Ee(e)),entries:e=>X.pipeline([Ee,Object.keys,X.map((async r=>[r,await Se(r,e)])),X.all],e),map:Ce,length:e=>Ee(e).length,toSchema:(e,r={})=>{const t={...Oe,...r},n=JSON.parse(JSON.stringify(e.schema,((r,n)=>{if(!C.isReference(n))return n;const o=C.value(n),a="string"==typeof o.$schema?te(o.$schema,""):e.dialectId,i=ue(a,"embeddedToken");return!t.includeEmbedded&&i in o?void 0:C.value(n)}))),o=ue(e.dialectId,"dynamicAnchorToken");Object.entries(e.dynamicAnchors).forEach((([e,r])=>{const t=ne(r);w.assign(t,n,{[o]:e,...w.get(t,n)})}));const a=ue(e.dialectId,"anchorToken");Object.entries(e.anchors).filter((([e])=>""!==e)).forEach((([e,r])=>{w.assign(r,n,{[a]:e,...w.get(r,n)})}));const i=ue(e.dialectId,"baseToken"),s=Ae(t.parentId,e.id),c=t.parentDialect===e.dialectId?"":e.dialectId;return{...s&&{[i]:s},...c&&{$schema:c},...n}}};Ie.setConfig,Ie.getConfig,Ie.add,Ie.get,Ie.markValidated,Ie.uri,Ie.value,Ie.getAnchorPointer,Ie.typeOf,Ie.has,Ie.step,Ie.keys,Ie.entries,Ie.map,Ie.length,Ie.toSchema;class je extends Error{constructor(e){super("Invalid Schema"),this.name=this.constructor.name,this.output=e}}var Te=je;const{resolveUrl:xe}=c,$e="FLAG",De="BASIC",Pe="DETAILED",Re="VERBOSE";let Ne=Pe,Fe=!0;const _e=async e=>{const r={metaData:{}};return{ast:r,schemaUri:await Ke(e,r)}},ke=r((({ast:e,schemaUri:r},t,n=$e)=>{if(![$e,De,Pe,Re].includes(n))throw Error(`The '${n}' error format is not supported`);const a=[],i=o.subscribe("result",Ue(n,a));return Ze(r,t,e,{}),o.unsubscribe(i),a[0]})),Ue=(e,r)=>{const t=[];return(n,o)=>{if("result"===n){const{keyword:e,absoluteKeywordLocation:r,instanceLocation:n,valid:a}=o,i={keyword:e,absoluteKeywordLocation:r,instanceLocation:n,valid:a,errors:[]};t.push(i)}else if("result.start"===n)t.push(n);else if("result.end"===n){const n=t.pop();for(;"result.start"!==t[t.length-1];){const r=t.pop(),o=[r];e===De&&(o.push(...r.errors),delete r.errors),(e===Re||e!==$e&&!r.valid)&&n.errors.unshift(...o)}t[t.length-1]=n,r[0]=n}}},qe={},Le=e=>qe[e],ze=e=>e in qe,He={},Ve={},Ke=async(e,r)=>{if(e=await Me(e),!ze(`${e.dialectId}#validate`)){const r=await Ie.get(e.dialectId);(Ie.getConfig(r.id,"mandatoryVocabularies")||[]).forEach((e=>{if(!r.vocabulary[e])throw Error(`Vocabulary '${e}' must be explicitly declared and required`)})),Object.entries(r.vocabulary).forEach((([e,t])=>{if(e in He)Object.entries(He[e]).forEach((([e,t])=>{((e,r)=>{qe[e]={collectEvaluatedItems:(e,t,n,o,a)=>r.interpret(e,t,n,o,a)&&new Set,collectEvaluatedProperties:(e,t,n,o,a)=>r.interpret(e,t,n,o,a)&&[],...r}})(`${r.id}#${e}`,t)}));else if(t)throw Error(`Missing required vocabulary: ${e}`)}))}if(Fe&&!e.validated){if(Ie.markValidated(e.id),!(e.dialectId in Ve)){const r=await Ie.get(e.dialectId),t=await _e(r);Ve[r.id]=ke(t)}const r=F.cons(e.schema,e.id),t=Ve[e.dialectId](r,Ne);if(!t.valid)throw new Te(t)}return e.id in r.metaData||(r.metaData[e.id]={id:e.id,dynamicAnchors:e.dynamicAnchors,anchors:e.anchors}),Le(`${e.dialectId}#validate`).compile(e,r)},Me=async e=>Ie.typeOf(e,"string")?Me(await Ie.get(Ie.value(e),e)):e,Ze=(e,r,t,n)=>{const o=Je(e,t),a=xe(e,"");return Le(o).interpret(e,r,t,{...t.metaData[a].dynamicAnchors,...n})},Je=(e,r)=>{if(!(e in r))throw Error(`No schema found at ${e}`);return r[e][0]};var Be={validate:async(e,r,t)=>{const n=await _e(e),o=(e,r)=>ke(n,F.cons(e),r);return void 0===r?o:o(r,t)},compile:_e,interpret:ke,setMetaOutputFormat:e=>{Ne=e},setShouldMetaValidate:e=>{Fe=e},FLAG:$e,BASIC:De,DETAILED:Pe,VERBOSE:Re,add:(e,r="",t="")=>{const n=Ie.add(e,r,t);delete Ve[n]},getKeyword:Le,hasKeyword:ze,defineVocabulary:(e,r)=>{He[e]=r},compileSchema:Ke,interpretSchema:Ze,collectEvaluatedProperties:(e,r,t,n,o)=>{const a=Je(e,t);return Le(a).collectEvaluatedProperties(e,r,t,n,o)},collectEvaluatedItems:(e,r,t,n,o)=>{const a=Je(e,t);return Le(a).collectEvaluatedItems(e,r,t,n,o)}};var Ge={compile:e=>Ie.value(e),interpret:()=>!0};var We={compile:async(e,r)=>{const t=Ie.uri(e);if(!(t in r)){r[t]=!1;const n=Ie.value(e);if(!["object","boolean"].includes(typeof n))throw Error(`No schema found at '${Ie.uri(e)}'`);r[t]=[`${e.dialectId}#validate`,Ie.uri(e),"boolean"==typeof n?n:await X.pipeline([Ie.entries,X.map((([r,t])=>[`${e.dialectId}#${r}`,t])),X.filter((([r])=>Be.hasKeyword(r)&&r!==`${e.dialectId}#validate`)),X.map((async([t,n])=>{const o=await Be.getKeyword(t).compile(n,r,e);return[t,Ie.uri(n),o]})),X.all],e)]}return t},interpret:(e,r,t,n)=>{const[a,i,s]=t[e];o.publishSync("result.start");const c="boolean"==typeof s?s:s.every((([e,a,i])=>{o.publishSync("result.start");const s=Be.getKeyword(e).interpret(i,r,t,n);return o.publishSync("result",{keyword:e,absoluteKeywordLocation:a,instanceLocation:F.uri(r),valid:s,ast:i}),o.publishSync("result.end"),s}));return o.publishSync("result",{keyword:a,absoluteKeywordLocation:i,instanceLocation:F.uri(r),valid:c,ast:e}),o.publishSync("result.end"),c},collectEvaluatedProperties:(e,r,t,n,o=!1)=>{const a=t[e][2];return"boolean"==typeof a?!!a&&[]:a.filter((([e])=>!o||!e.endsWith("#unevaluatedProperties"))).reduce(((e,[o,,a])=>{const i=e&&Be.getKeyword(o).collectEvaluatedProperties(a,r,t,n);return!1!==i&&[...e,...i]}),[])},collectEvaluatedItems:(e,r,t,n,o=!1)=>{const a=t[e][2];return"boolean"==typeof a?!!a&&new Set:a.filter((([e])=>!o||!e.endsWith("#unevaluatedItems"))).reduce(((e,[o,,a])=>{const i=!1!==e&&Be.getKeyword(o).collectEvaluatedItems(a,r,t,n);return!1!==i&&new Set([...e,...i])}),new Set)}},Qe={metaData:Ge,validate:We},Ye=e("default",{Core:Be,Schema:Ie,Instance:F,Reference:C,Keywords:Qe,InvalidSchemaError:Te});e("Core",Ye.Core),e("Schema",Ye.Schema),e("Instance",Ye.Instance),e("Reference",Ye.Reference),e("Keywords",Ye.Keywords),e("InvalidSchemaError",Ye.InvalidSchemaError)}}})); | ||
!function(e){function r(){for(var e=arguments.length,r=Array(e),t=0;t<e;t++)r[t]=arguments[t];if(r.length>1){r[0]=r[0].slice(0,-1);for(var n=r.length-1,o=1;o<n;++o)r[o]=r[o].slice(1,-1);return r[n]=r[n].slice(1),r.join("")}return r[0]}function t(e){return"(?:"+e+")"}function n(e){return void 0===e?"undefined":null===e?"null":Object.prototype.toString.call(e).split(" ").pop().split("]").shift().toLowerCase()}function o(e){return e.toUpperCase()}function a(e){return null!=e?e instanceof Array?e:"number"!=typeof e.length||e.split||e.setInterval||e.call?[e]:Array.prototype.slice.call(e):[]}function i(e,r){var t=e;if(r)for(var n in r)t[n]=r[n];return t}function s(e){var n="[A-Za-z]",o="[0-9]",a=r(o,"[A-Fa-f]"),i=t(t("%[EFef]"+a+"%"+a+a+"%"+a+a)+"|"+t("%[89A-Fa-f]"+a+"%"+a+a)+"|"+t("%"+a+a)),s="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",c=r("[\\:\\/\\?\\#\\[\\]\\@]",s),u=e?"[\\uE000-\\uF8FF]":"[]",l=r(n,o,"[\\-\\.\\_\\~]",e?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]");t(n+r(n,o,"[\\+\\-\\.]")+"*"),t(t(i+"|"+r(l,s,"[\\:]"))+"*");var p=t(t("25[0-5]")+"|"+t("2[0-4]"+o)+"|"+t("1"+o+o)+"|"+t("0?[1-9]"+o)+"|0?0?"+o),f=t(p+"\\."+p+"\\."+p+"\\."+p),d=t(a+"{1,4}"),h=t(t(d+"\\:"+d)+"|"+f),v=t(t(d+"\\:")+"{6}"+h),y=t("\\:\\:"+t(d+"\\:")+"{5}"+h),m=t(t(d)+"?\\:\\:"+t(d+"\\:")+"{4}"+h),g=t(t(t(d+"\\:")+"{0,1}"+d)+"?\\:\\:"+t(d+"\\:")+"{3}"+h),b=t(t(t(d+"\\:")+"{0,2}"+d)+"?\\:\\:"+t(d+"\\:")+"{2}"+h),w=t(t(t(d+"\\:")+"{0,3}"+d)+"?\\:\\:"+d+"\\:"+h),E=t(t(t(d+"\\:")+"{0,4}"+d)+"?\\:\\:"+h),S=t(t(t(d+"\\:")+"{0,5}"+d)+"?\\:\\:"+d),C=t(t(t(d+"\\:")+"{0,6}"+d)+"?\\:\\:"),O=t([v,y,m,g,b,w,E,S,C].join("|")),A=t(t(l+"|"+i)+"+");t("[vV]"+a+"+\\."+r(l,s,"[\\:]")+"+"),t(t(i+"|"+r(l,s))+"*");var I=t(i+"|"+r(l,s,"[\\:\\@]"));return t(t(i+"|"+r(l,s,"[\\@]"))+"+"),t(t(I+"|"+r("[\\/\\?]",u))+"*"),{NOT_SCHEME:new RegExp(r("[^]",n,o,"[\\+\\-\\.]"),"g"),NOT_USERINFO:new RegExp(r("[^\\%\\:]",l,s),"g"),NOT_HOST:new RegExp(r("[^\\%\\[\\]\\:]",l,s),"g"),NOT_PATH:new RegExp(r("[^\\%\\/\\:\\@]",l,s),"g"),NOT_PATH_NOSCHEME:new RegExp(r("[^\\%\\/\\@]",l,s),"g"),NOT_QUERY:new RegExp(r("[^\\%]",l,s,"[\\:\\@\\/\\?]",u),"g"),NOT_FRAGMENT:new RegExp(r("[^\\%]",l,s,"[\\:\\@\\/\\?]"),"g"),ESCAPE:new RegExp(r("[^]",l,s),"g"),UNRESERVED:new RegExp(l,"g"),OTHER_CHARS:new RegExp(r("[^\\%]",l,c),"g"),PCT_ENCODED:new RegExp(i,"g"),IPV4ADDRESS:new RegExp("^("+f+")$"),IPV6ADDRESS:new RegExp("^\\[?("+O+")"+t(t("\\%25|\\%(?!"+a+"{2})")+"("+A+")")+"?\\]?$")}}var c=s(!1),u=s(!0),l=function(){function e(e,r){var t=[],n=!0,o=!1,a=void 0;try{for(var i,s=e[Symbol.iterator]();!(n=(i=s.next()).done)&&(t.push(i.value),!r||t.length!==r);n=!0);}catch(e){o=!0,a=e}finally{try{!n&&s.return&&s.return()}finally{if(o)throw a}}return t}return function(r,t){if(Array.isArray(r))return r;if(Symbol.iterator in Object(r))return e(r,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),p=function(e){if(Array.isArray(e)){for(var r=0,t=Array(e.length);r<e.length;r++)t[r]=e[r];return t}return Array.from(e)},f=2147483647,d=36,h=1,v=26,y=38,m=700,g=72,b=128,w="-",E=/^xn--/,S=/[^\0-\x7E]/,C=/[\x2E\u3002\uFF0E\uFF61]/g,O={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},A=d-h,I=Math.floor,T=String.fromCharCode;function j(e){throw new RangeError(O[e])}function x(e,r){for(var t=[],n=e.length;n--;)t[n]=r(e[n]);return t}function P(e,r){var t=e.split("@"),n="";return t.length>1&&(n=t[0]+"@",e=t[1]),n+x((e=e.replace(C,".")).split("."),r).join(".")}function $(e){for(var r=[],t=0,n=e.length;t<n;){var o=e.charCodeAt(t++);if(o>=55296&&o<=56319&&t<n){var a=e.charCodeAt(t++);56320==(64512&a)?r.push(((1023&o)<<10)+(1023&a)+65536):(r.push(o),t--)}else r.push(o)}return r}var D=function(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:d},R=function(e,r){return e+22+75*(e<26)-((0!=r)<<5)},N=function(e,r,t){var n=0;for(e=t?I(e/m):e>>1,e+=I(e/r);e>A*v>>1;n+=d)e=I(e/A);return I(n+(A+1)*e/(e+y))},F=function(e){var r=[],t=e.length,n=0,o=b,a=g,i=e.lastIndexOf(w);i<0&&(i=0);for(var s=0;s<i;++s)e.charCodeAt(s)>=128&&j("not-basic"),r.push(e.charCodeAt(s));for(var c=i>0?i+1:0;c<t;){for(var u=n,l=1,p=d;;p+=d){c>=t&&j("invalid-input");var y=D(e.charCodeAt(c++));(y>=d||y>I((f-n)/l))&&j("overflow"),n+=y*l;var m=p<=a?h:p>=a+v?v:p-a;if(y<m)break;var E=d-m;l>I(f/E)&&j("overflow"),l*=E}var S=r.length+1;a=N(n-u,S,0==u),I(n/S)>f-o&&j("overflow"),o+=I(n/S),n%=S,r.splice(n++,0,o)}return String.fromCodePoint.apply(String,r)},_=function(e){var r=[],t=(e=$(e)).length,n=b,o=0,a=g,i=!0,s=!1,c=void 0;try{for(var u,l=e[Symbol.iterator]();!(i=(u=l.next()).done);i=!0){var p=u.value;p<128&&r.push(T(p))}}catch(e){s=!0,c=e}finally{try{!i&&l.return&&l.return()}finally{if(s)throw c}}var y=r.length,m=y;for(y&&r.push(w);m<t;){var E=f,S=!0,C=!1,O=void 0;try{for(var A,x=e[Symbol.iterator]();!(S=(A=x.next()).done);S=!0){var P=A.value;P>=n&&P<E&&(E=P)}}catch(e){C=!0,O=e}finally{try{!S&&x.return&&x.return()}finally{if(C)throw O}}var D=m+1;E-n>I((f-o)/D)&&j("overflow"),o+=(E-n)*D,n=E;var F=!0,_=!1,k=void 0;try{for(var U,q=e[Symbol.iterator]();!(F=(U=q.next()).done);F=!0){var L=U.value;if(L<n&&++o>f&&j("overflow"),L==n){for(var z=o,H=d;;H+=d){var V=H<=a?h:H>=a+v?v:H-a;if(z<V)break;var K=z-V,M=d-V;r.push(T(R(V+K%M,0))),z=I(K/M)}r.push(T(R(z,0))),a=N(o,D,m==y),o=0,++m}}}catch(e){_=!0,k=e}finally{try{!F&&q.return&&q.return()}finally{if(_)throw k}}++o,++n}return r.join("")},k=function(e){return P(e,(function(e){return E.test(e)?F(e.slice(4).toLowerCase()):e}))},U=function(e){return P(e,(function(e){return S.test(e)?"xn--"+_(e):e}))},q={version:"2.1.0",ucs2:{decode:$,encode:function(e){return String.fromCodePoint.apply(String,p(e))}},decode:F,encode:_,toASCII:U,toUnicode:k},L={};function z(e){var r=e.charCodeAt(0);return r<16?"%0"+r.toString(16).toUpperCase():r<128?"%"+r.toString(16).toUpperCase():r<2048?"%"+(r>>6|192).toString(16).toUpperCase()+"%"+(63&r|128).toString(16).toUpperCase():"%"+(r>>12|224).toString(16).toUpperCase()+"%"+(r>>6&63|128).toString(16).toUpperCase()+"%"+(63&r|128).toString(16).toUpperCase()}function H(e){for(var r="",t=0,n=e.length;t<n;){var o=parseInt(e.substr(t+1,2),16);if(o<128)r+=String.fromCharCode(o),t+=3;else if(o>=194&&o<224){if(n-t>=6){var a=parseInt(e.substr(t+4,2),16);r+=String.fromCharCode((31&o)<<6|63&a)}else r+=e.substr(t,6);t+=6}else if(o>=224){if(n-t>=9){var i=parseInt(e.substr(t+4,2),16),s=parseInt(e.substr(t+7,2),16);r+=String.fromCharCode((15&o)<<12|(63&i)<<6|63&s)}else r+=e.substr(t,9);t+=9}else r+=e.substr(t,3),t+=3}return r}function V(e,r){function t(e){var t=H(e);return t.match(r.UNRESERVED)?t:e}return e.scheme&&(e.scheme=String(e.scheme).replace(r.PCT_ENCODED,t).toLowerCase().replace(r.NOT_SCHEME,"")),void 0!==e.userinfo&&(e.userinfo=String(e.userinfo).replace(r.PCT_ENCODED,t).replace(r.NOT_USERINFO,z).replace(r.PCT_ENCODED,o)),void 0!==e.host&&(e.host=String(e.host).replace(r.PCT_ENCODED,t).toLowerCase().replace(r.NOT_HOST,z).replace(r.PCT_ENCODED,o)),void 0!==e.path&&(e.path=String(e.path).replace(r.PCT_ENCODED,t).replace(e.scheme?r.NOT_PATH:r.NOT_PATH_NOSCHEME,z).replace(r.PCT_ENCODED,o)),void 0!==e.query&&(e.query=String(e.query).replace(r.PCT_ENCODED,t).replace(r.NOT_QUERY,z).replace(r.PCT_ENCODED,o)),void 0!==e.fragment&&(e.fragment=String(e.fragment).replace(r.PCT_ENCODED,t).replace(r.NOT_FRAGMENT,z).replace(r.PCT_ENCODED,o)),e}function K(e){return e.replace(/^0*(.*)/,"$1")||"0"}function M(e,r){var t=e.match(r.IPV4ADDRESS)||[],n=l(t,2)[1];return n?n.split(".").map(K).join("."):e}function Z(e,r){var t=e.match(r.IPV6ADDRESS)||[],n=l(t,3),o=n[1],a=n[2];if(o){for(var i=o.toLowerCase().split("::").reverse(),s=l(i,2),c=s[0],u=s[1],p=u?u.split(":").map(K):[],f=c.split(":").map(K),d=r.IPV4ADDRESS.test(f[f.length-1]),h=d?7:8,v=f.length-h,y=Array(h),m=0;m<h;++m)y[m]=p[m]||f[v+m]||"";d&&(y[h-1]=M(y[h-1],r));var g=y.reduce((function(e,r,t){if(!r||"0"===r){var n=e[e.length-1];n&&n.index+n.length===t?n.length++:e.push({index:t,length:1})}return e}),[]).sort((function(e,r){return r.length-e.length}))[0],b=void 0;if(g&&g.length>1){var w=y.slice(0,g.index),E=y.slice(g.index+g.length);b=w.join(":")+"::"+E.join(":")}else b=y.join(":");return a&&(b+="%"+a),b}return e}var J=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,B=void 0==="".match(/(){0}/)[1];function G(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t={},n=!1!==r.iri?u:c;"suffix"===r.reference&&(e=(r.scheme?r.scheme+":":"")+"//"+e);var o=e.match(J);if(o){B?(t.scheme=o[1],t.userinfo=o[3],t.host=o[4],t.port=parseInt(o[5],10),t.path=o[6]||"",t.query=o[7],t.fragment=o[8],isNaN(t.port)&&(t.port=o[5])):(t.scheme=o[1]||void 0,t.userinfo=-1!==e.indexOf("@")?o[3]:void 0,t.host=-1!==e.indexOf("//")?o[4]:void 0,t.port=parseInt(o[5],10),t.path=o[6]||"",t.query=-1!==e.indexOf("?")?o[7]:void 0,t.fragment=-1!==e.indexOf("#")?o[8]:void 0,isNaN(t.port)&&(t.port=e.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?o[4]:void 0)),t.host&&(t.host=Z(M(t.host,n),n)),void 0!==t.scheme||void 0!==t.userinfo||void 0!==t.host||void 0!==t.port||t.path||void 0!==t.query?void 0===t.scheme?t.reference="relative":void 0===t.fragment?t.reference="absolute":t.reference="uri":t.reference="same-document",r.reference&&"suffix"!==r.reference&&r.reference!==t.reference&&(t.error=t.error||"URI is not a "+r.reference+" reference.");var a=L[(r.scheme||t.scheme||"").toLowerCase()];if(r.unicodeSupport||a&&a.unicodeSupport)V(t,n);else{if(t.host&&(r.domainHost||a&&a.domainHost))try{t.host=q.toASCII(t.host.replace(n.PCT_ENCODED,H).toLowerCase())}catch(e){t.error=t.error||"Host's domain name can not be converted to ASCII via punycode: "+e}V(t,c)}a&&a.parse&&a.parse(t,r)}else t.error=t.error||"URI can not be parsed.";return t}function W(e,r){var t=!1!==r.iri?u:c,n=[];return void 0!==e.userinfo&&(n.push(e.userinfo),n.push("@")),void 0!==e.host&&n.push(Z(M(String(e.host),t),t).replace(t.IPV6ADDRESS,(function(e,r,t){return"["+r+(t?"%25"+t:"")+"]"}))),"number"!=typeof e.port&&"string"!=typeof e.port||(n.push(":"),n.push(String(e.port))),n.length?n.join(""):void 0}var Q=/^\.\.?\//,Y=/^\/\.(\/|$)/,X=/^\/\.\.(\/|$)/,ee=/^\/?(?:.|\n)*?(?=\/|$)/;function re(e){for(var r=[];e.length;)if(e.match(Q))e=e.replace(Q,"");else if(e.match(Y))e=e.replace(Y,"/");else if(e.match(X))e=e.replace(X,"/"),r.pop();else if("."===e||".."===e)e="";else{var t=e.match(ee);if(!t)throw new Error("Unexpected dot segment condition");var n=t[0];e=e.slice(n.length),r.push(n)}return r.join("")}function te(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=r.iri?u:c,n=[],o=L[(r.scheme||e.scheme||"").toLowerCase()];if(o&&o.serialize&&o.serialize(e,r),e.host)if(t.IPV6ADDRESS.test(e.host));else if(r.domainHost||o&&o.domainHost)try{e.host=r.iri?q.toUnicode(e.host):q.toASCII(e.host.replace(t.PCT_ENCODED,H).toLowerCase())}catch(t){e.error=e.error||"Host's domain name can not be converted to "+(r.iri?"Unicode":"ASCII")+" via punycode: "+t}V(e,t),"suffix"!==r.reference&&e.scheme&&(n.push(e.scheme),n.push(":"));var a=W(e,r);if(void 0!==a&&("suffix"!==r.reference&&n.push("//"),n.push(a),e.path&&"/"!==e.path.charAt(0)&&n.push("/")),void 0!==e.path){var i=e.path;r.absolutePath||o&&o.absolutePath||(i=re(i)),void 0===a&&(i=i.replace(/^\/\//,"/%2F")),n.push(i)}return void 0!==e.query&&(n.push("?"),n.push(e.query)),void 0!==e.fragment&&(n.push("#"),n.push(e.fragment)),n.join("")}function ne(e,r){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n={};return arguments[3]||(e=G(te(e,t),t),r=G(te(r,t),t)),!(t=t||{}).tolerant&&r.scheme?(n.scheme=r.scheme,n.userinfo=r.userinfo,n.host=r.host,n.port=r.port,n.path=re(r.path||""),n.query=r.query):(void 0!==r.userinfo||void 0!==r.host||void 0!==r.port?(n.userinfo=r.userinfo,n.host=r.host,n.port=r.port,n.path=re(r.path||""),n.query=r.query):(r.path?("/"===r.path.charAt(0)?n.path=re(r.path):(void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?n.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+r.path:n.path=r.path:n.path="/"+r.path,n.path=re(n.path)),n.query=r.query):(n.path=e.path,void 0!==r.query?n.query=r.query:n.query=e.query),n.userinfo=e.userinfo,n.host=e.host,n.port=e.port),n.scheme=e.scheme),n.fragment=r.fragment,n}function oe(e,r,t){var n=i({scheme:"null"},t);return te(ne(G(e,n),G(r,n),n,!0),n)}function ae(e,r){return"string"==typeof e?e=te(G(e,r),r):"object"===n(e)&&(e=G(te(e,r),r)),e}function ie(e,r,t){return"string"==typeof e?e=te(G(e,t),t):"object"===n(e)&&(e=te(e,t)),"string"==typeof r?r=te(G(r,t),t):"object"===n(r)&&(r=te(r,t)),e===r}function se(e,r){return e&&e.toString().replace(r&&r.iri?u.ESCAPE:c.ESCAPE,z)}function ce(e,r){return e&&e.toString().replace(r&&r.iri?u.PCT_ENCODED:c.PCT_ENCODED,H)}var ue={scheme:"http",domainHost:!0,parse:function(e,r){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e},serialize:function(e,r){var t="https"===String(e.scheme).toLowerCase();return e.port!==(t?443:80)&&""!==e.port||(e.port=void 0),e.path||(e.path="/"),e}},le={scheme:"https",domainHost:ue.domainHost,parse:ue.parse,serialize:ue.serialize};function pe(e){return"boolean"==typeof e.secure?e.secure:"wss"===String(e.scheme).toLowerCase()}var fe={scheme:"ws",domainHost:!0,parse:function(e,r){var t=e;return t.secure=pe(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t},serialize:function(e,r){if(e.port!==(pe(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 t=e.resourceName.split("?"),n=l(t,2),o=n[0],a=n[1];e.path=o&&"/"!==o?o:void 0,e.query=a,e.resourceName=void 0}return e.fragment=void 0,e}},de={scheme:"wss",domainHost:fe.domainHost,parse:fe.parse,serialize:fe.serialize},he={},ve="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",ye="[0-9A-Fa-f]",me=t(t("%[EFef]"+ye+"%"+ye+ye+"%"+ye+ye)+"|"+t("%[89A-Fa-f]"+ye+"%"+ye+ye)+"|"+t("%"+ye+ye)),ge="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]",be=r("[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",'[\\"\\\\]'),we="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]",Ee=new RegExp(ve,"g"),Se=new RegExp(me,"g"),Ce=new RegExp(r("[^]",ge,"[\\.]",'[\\"]',be),"g"),Oe=new RegExp(r("[^]",ve,we),"g"),Ae=Oe;function Ie(e){var r=H(e);return r.match(Ee)?r:e}var Te={scheme:"mailto",parse:function(e,r){var t=e,n=t.to=t.path?t.path.split(","):[];if(t.path=void 0,t.query){for(var o=!1,a={},i=t.query.split("&"),s=0,c=i.length;s<c;++s){var u=i[s].split("=");switch(u[0]){case"to":for(var l=u[1].split(","),p=0,f=l.length;p<f;++p)n.push(l[p]);break;case"subject":t.subject=ce(u[1],r);break;case"body":t.body=ce(u[1],r);break;default:o=!0,a[ce(u[0],r)]=ce(u[1],r)}}o&&(t.headers=a)}t.query=void 0;for(var d=0,h=n.length;d<h;++d){var v=n[d].split("@");if(v[0]=ce(v[0]),r.unicodeSupport)v[1]=ce(v[1],r).toLowerCase();else try{v[1]=q.toASCII(ce(v[1],r).toLowerCase())}catch(e){t.error=t.error||"Email address's domain name can not be converted to ASCII via punycode: "+e}n[d]=v.join("@")}return t},serialize:function(e,r){var t=e,n=a(e.to);if(n){for(var i=0,s=n.length;i<s;++i){var c=String(n[i]),u=c.lastIndexOf("@"),l=c.slice(0,u).replace(Se,Ie).replace(Se,o).replace(Ce,z),p=c.slice(u+1);try{p=r.iri?q.toUnicode(p):q.toASCII(ce(p,r).toLowerCase())}catch(e){t.error=t.error||"Email address's domain name can not be converted to "+(r.iri?"Unicode":"ASCII")+" via punycode: "+e}n[i]=l+"@"+p}t.path=n.join(",")}var f=e.headers=e.headers||{};e.subject&&(f.subject=e.subject),e.body&&(f.body=e.body);var d=[];for(var h in f)f[h]!==he[h]&&d.push(h.replace(Se,Ie).replace(Se,o).replace(Oe,z)+"="+f[h].replace(Se,Ie).replace(Se,o).replace(Ae,z));return d.length&&(t.query=d.join("&")),t}},je=/^([^\:]+)\:(.*)/,xe={scheme:"urn",parse:function(e,r){var t=e.path&&e.path.match(je),n=e;if(t){var o=r.scheme||n.scheme||"urn",a=t[1].toLowerCase(),i=t[2],s=o+":"+(r.nid||a),c=L[s];n.nid=a,n.nss=i,n.path=void 0,c&&(n=c.parse(n,r))}else n.error=n.error||"URN can not be parsed.";return n},serialize:function(e,r){var t=r.scheme||e.scheme||"urn",n=e.nid,o=t+":"+(r.nid||n),a=L[o];a&&(e=a.serialize(e,r));var i=e,s=e.nss;return i.path=(n||r.nid)+":"+s,i}},Pe=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/,$e={scheme:"urn:uuid",parse:function(e,r){var t=e;return t.uuid=t.nss,t.nss=void 0,r.tolerant||t.uuid&&t.uuid.match(Pe)||(t.error=t.error||"UUID is not valid."),t},serialize:function(e,r){var t=e;return t.nss=(e.uuid||"").toLowerCase(),t}};L[ue.scheme]=ue,L[le.scheme]=le,L[fe.scheme]=fe,L[de.scheme]=de,L[Te.scheme]=Te,L[xe.scheme]=xe,L[$e.scheme]=$e,e.SCHEMES=L,e.pctEncChar=z,e.pctDecChars=H,e.parse=G,e.removeDotSegments=re,e.serialize=te,e.resolveComponents=ne,e.resolve=oe,e.normalize=ae,e.equal=ie,e.escapeComponent=se,e.unescapeComponent=ce,Object.defineProperty(e,"__esModule",{value:!0})}(r)}));(a=i)&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")&&a.default;const s={null:e=>null===e,boolean:e=>"boolean"==typeof e,object:e=>"object"==typeof e&&!Array.isArray(e)&&null!==e,array:e=>Array.isArray(e),number:e=>"number"==typeof e,integer:e=>Number.isInteger(e),string:e=>"string"==typeof e};var c={jsonTypeOf:(e,r)=>s[r](e),resolveUrl:(e,r)=>{const t=i.resolve(e,r,{iri:!0});if(i.resolve(e,"",{iri:!0})&&"file"===i.parse(t).scheme&&"file"!==i.parse(e).scheme)throw Error(`Can't access file '${t}' resource from network context '${e}'`);return t},urlFragment:e=>i.unescapeComponent(i.parse(e).fragment)||"",pathRelative:(e,r)=>{if(e===r)return"";let t=1;const n=e.length-1,o=r.length-t,a=n<o?n:o;let i=-1,s=0;for(;s<a;s++){const n=e.charCodeAt(s+1);if(n!==r.charCodeAt(t+s))break;47===n&&(i=s)}if(o>a){if(47===r.charCodeAt(t+s))return r.slice(t+s+1);if(0===s)return r.slice(t+s)}n>a&&(47===e.charCodeAt(s+1)?i=s:0===a&&(i=0));let c="";for(s=i+2;s<=e.length;++s)s!==e.length&&47!==e.charCodeAt(s)||(c+=0===c.length?"..":"/..");return t+=i,c.length>0?`${c}${r.slice(t,r.length)}`:(47===r.charCodeAt(t)&&++t,r.slice(t,r.length))}};const u=e=>{if(e.length>0&&"/"!==e[0])throw Error("Invalid JSON Pointer");return e.split("/").slice(1).map(y)},l=(e,r,t,n)=>{if(0===e.length)return t;if(e.length>1){const o=e.shift();return{...r,[o]:l(e,g(r,o,n),t,h(o,n))}}if(Array.isArray(r)){const n=[...r];return n[m(r,e[0])]=t,n}return"object"==typeof r&&null!==r?{...r,[e[0]]:t}:g(r,e[0],n)},p=(e,r,t,n)=>{if(0!==e.length)if(1!==e.length||b(r)){const o=e.shift();p(e,g(r,o,n),t,h(o,n))}else{r[m(r,e[0])]=t}},f=(e,r,t)=>{if(0!=e.length){if(e.length>1){const n=e.shift(),o=g(r,n,t);return{...r,[n]:f(e,o,h(n,t))}}if(Array.isArray(r))return r.filter(((r,t)=>t!=e[0]));if("object"==typeof r&&null!==r){const{[e[0]]:t,...n}=r;return n}return g(r,e[0],t)}},d=(e,r,t)=>{if(0!==e.length)if(e.length>1){const n=e.shift(),o=g(r,n,t);d(e,o,h(n,t))}else Array.isArray(r)?r.splice(e[0],1):"object"==typeof r&&null!==r?delete r[e[0]]:g(r,e[0],t)},h=r(((e,r)=>r+"/"+v(e))),v=e=>e.toString().replace(/~/g,"~0").replace(/\//g,"~1"),y=e=>e.toString().replace(/~1/g,"/").replace(/~0/g,"~"),m=(e,r)=>Array.isArray(e)&&"-"===r?e.length:r,g=(e,r,t="")=>{if(void 0===e)throw TypeError(`Value at '${t}' is undefined and does not have property '${r}'`);if(null===e)throw TypeError(`Value at '${t}' is null and does not have property '${r}'`);if(b(e))throw TypeError(`Value at '${t}' is a ${typeof e} and does not have property '${r}'`);return e[m(e,r)]},b=e=>null===e||"object"!=typeof e;var w={nil:"",append:h,get:(e,r)=>{const t=u(e),n=e=>t.reduce((([e,r],t)=>[g(e,t,r),h(t,r)]),[e,""])[0];return void 0===r?n:n(r)},set:(e,t,n)=>{const o=u(e),a=r(((e,r)=>l(o,e,r,"")));return void 0===t?a:a(t,n)},assign:(e,t,n)=>{const o=u(e),a=r(((e,r)=>p(o,e,r,"")));return void 0===t?a:a(t,n)},unset:(e,r)=>{const t=u(e),n=e=>f(t,e,"");return void 0===r?n:n(r)},remove:(e,r)=>{const t=u(e),n=e=>d(t,e,"");return void 0===r?n:n(r)}};w.nil,w.append,w.get,w.set,w.assign,w.unset,w.remove;const E=Symbol("$__value"),S=Symbol("$__href");var C={cons:(e,r)=>Object.freeze({[S]:e,[E]:r}),isReference:e=>e&&void 0!==e[S],href:e=>e[S],value:e=>e[E]};const{resolveUrl:O,jsonTypeOf:A}=c,I=Object.freeze({id:"",pointer:"",instance:void 0,value:void 0}),T=e=>C.isReference(e.value)?C.value(e.value):e.value,j=r(((e,r)=>A(T(e),r))),x=(e,r)=>Object.freeze({...r,pointer:w.append(e,r.pointer),value:T(r)[e]}),P=r(((e,r)=>T(r).map(((t,n,o,a)=>e(x(n,r),n,o,a))))),$=r(((e,r)=>T(r).map(((e,t,n,o)=>x(t,r))).filter(((r,t,n,o)=>e(r,t,n,o))))),D=r(((e,r,t)=>T(t).reduce(((r,n,o)=>e(r,x(o,t),o)),r))),R=r(((e,r)=>T(r).every(((t,n,o,a)=>e(x(n,r),n,o,a))))),N=r(((e,r)=>T(r).some(((t,n,o,a)=>e(x(n,r),n,o,a)))));var F={nil:I,cons:(e,r="")=>Object.freeze({...I,id:O(r,""),instance:e,value:e}),uri:e=>`${e.id}#${encodeURI(e.pointer)}`,value:T,has:(e,r)=>e in T(r),typeOf:j,step:x,entries:e=>Object.keys(T(e)).map((r=>[r,x(r,e)])),keys:e=>Object.keys(T(e)),map:P,filter:$,reduce:D,every:R,some:N,length:e=>T(e).length},_=async e=>Object.entries(await e),k=r((async(e,r)=>(await r).map(e))),U=r((async(e,r,t)=>(await t).reduce((async(r,t)=>e(await r,t)),r))),q=r((async(e,r,t={})=>U((async(r,t)=>await e(t)?r.concat([t]):r),[],r,t))),L=r((async(e,r)=>{const t=await k(e,r);return(await Promise.all(t)).some((e=>e))})),z=r((async(e,r)=>{const t=await k(e,r);return(await Promise.all(t)).every((e=>e))})),H=r(((e,r)=>e.reduce((async(e,r)=>r(await e)),r))),V={entries:_,map:k,filter:q,reduce:U,some:L,every:z,pipeline:H,all:e=>Promise.all(e),allValues:e=>H([_,U((async(e,[r,t])=>(e[r]=await t,e)),{})],e)};V.entries,V.map,V.filter,V.reduce,V.some,V.every,V.pipeline,V.all,V.allValues;var K=fetch,M=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,Z=/^[\u000b\u0020-\u007e\u0080-\u00ff]+$/,J=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,B=/\\([\u000b\u0020-\u00ff])/g,G=/([\\"])/g,W=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,Q=function(e){if(!e)throw new TypeError("argument string is required");var r="object"==typeof e?function(e){var r;"function"==typeof e.getHeader?r=e.getHeader("content-type"):"object"==typeof e.headers&&(r=e.headers&&e.headers["content-type"]);if("string"!=typeof r)throw new TypeError("content-type header is missing from object");return r}(e):e;if("string"!=typeof r)throw new TypeError("argument string is required to be a string");var t=r.indexOf(";"),n=-1!==t?r.substr(0,t).trim():r.trim();if(!W.test(n))throw new TypeError("invalid media type");var o=new X(n.toLowerCase());if(-1!==t){var a,i,s;for(M.lastIndex=t;i=M.exec(r);){if(i.index!==t)throw new TypeError("invalid parameter format");t+=i[0].length,a=i[1].toLowerCase(),'"'===(s=i[2])[0]&&(s=s.substr(1,s.length-2).replace(B,"$1")),o.parameters[a]=s}if(t!==r.length)throw new TypeError("invalid parameter format")}return o}; | ||
/*! | ||
* content-type | ||
* Copyright(c) 2015 Douglas Christopher Wilson | ||
* MIT Licensed | ||
*/function Y(e){var r=String(e);if(J.test(r))return r;if(r.length>0&&!Z.test(r))throw new TypeError("invalid parameter value");return'"'+r.replace(G,"\\$1")+'"'}function X(e){this.parameters=Object.create(null),this.type=e}var ee={format:function(e){if(!e||"object"!=typeof e)throw new TypeError("argument obj is required");var r=e.parameters,t=e.type;if(!t||!W.test(t))throw new TypeError("invalid type");var n=t;if(r&&"object"==typeof r)for(var o,a=Object.keys(r).sort(),i=0;i<a.length;i++){if(o=a[i],!J.test(o))throw new TypeError("invalid parameter name");n+="; "+o+"="+Y(r[o])}return n},parse:Q};const re={};var te={addPlugin:(e,r)=>{re[e]=r},parse:e=>{const r=ee.parse(e.headers.get("content-type")).type;if(!(r in re))throw Error(`${e.url} is not a schema. Found a document with media type: ${r}`);return re[r].parse(e)},getContentType:e=>{for(const r in re)if(re[r].matcher(e))return r;return"application/octet-stream"}};const{jsonTypeOf:ne,resolveUrl:oe,urlFragment:ae,pathRelative:ie}=c,se="https://json-schema.org/draft/2019-09/vocab/core",ce="https://json-schema.org/draft/2020-12/vocab/core",ue={},le={},pe=(e,r)=>{const t=le[e];return ue[t]?.[r]},fe={},de={},he=(e,r="",t="")=>{e=JSON.parse(JSON.stringify(e));const n=oe(r,""),o=oe(e.$schema||t,"");if(!o)throw Error("Couldn't determine schema dialect");if(delete e.$schema,!(o in le))if(!0===e?.$vocabulary?.[se]&&o===ve(e,n,se)[0])le[o]=se;else if(!0===e?.$vocabulary?.[ce]&&o===ve(e,n,ce)[0])le[o]=ce;else if(o===ve(e,n,o)[0])le[o]=o;else{if(!(o in fe))throw Error(`Couldn't determine JSON Schema version for dialect: '${o}'`);{const e=fe[o];!0===e.vocabulary[se]?le[o]=se:!0===e.vocabulary[ce]?le[o]=ce:le[o]=le[e.dialectId]}}const[a,i]=ve(e,n,le[o]);if(!a)throw Error("Couldn't determine an identifier for the schema");const s=pe(o,"baseToken");delete e[s],n&&(de[n]=a);const c=pe(o,"anchorToken");i&&s===c&&(e[c]=c!==s?encodeURI(i):`#${encodeURI(i)}`);const u={},l=pe(o,"recursiveAnchorToken");let p;!0===e[l]&&(u[""]=`${a}#`,e[c]="",delete e[l]);const f=pe(o,"vocabularyToken");ne(e[f],"object")?(p=e[f],delete e[f]):p={[le[o]]:!0};const d={"":""};return fe[a]={id:a,dialectId:o,schema:ye(e,a,o,w.nil,d,u),anchors:d,dynamicAnchors:u,vocabulary:p,validated:!1},a},ve=(e,r,t)=>{const n=ue[t]?.baseToken,o=oe(r,e[n]||"");return[oe(o,""),ae(o)]},ye=(e,r,t,n,o,a)=>{if(ne(e,"object")){const i="string"==typeof e.$schema?oe(e.$schema,""):t,s=pe(i,"embeddedToken"),c=pe(i,"anchorToken");if("string"==typeof e[s]&&(s!==c||"#"!==e[s][0])){const n=oe(r,e[s]);return e[pe(i,"baseToken")]=n,he(e,n,t),C.cons(e[s],e)}const u=pe(t,"anchorToken"),l=pe(t,"dynamicAnchorToken");"string"==typeof e[l]&&(a[e[l]]=`${r}#${encodeURI(n)}`,o[e[l]]=n,delete e[l]);const p=pe(t,"embeddedToken");if("string"==typeof e[u]){const r=u!==p?e[u]:e[u].slice(1);o[r]=n,delete e[u]}const f=pe(t,"jrefToken");if("string"==typeof e[f])return C.cons(e[f],e);for(const i in e)e[i]=ye(e[i],r,t,w.append(i,n),o,a);return e}return Array.isArray(e)?e.map(((e,i)=>ye(e,r,t,w.append(i,n),o,a))):e},me=e=>fe[de[e]]||fe[e],ge=Object.freeze({id:"",dialectId:void 0,vocabulary:{},pointer:w.nil,schema:void 0,value:void 0,anchors:{},dynamicAnchors:{},validated:!0}),be=async(e,r=ge)=>{const t=oe(Se(r),e),n=oe(t,""),o=ae(t);if(!(e=>e in fe||e in de)(n)){const e=await K(n,{headers:{Accept:"application/schema+json"}});if(e.status>=400)throw await e.text(),Error(`Failed to retrieve schema with id: ${n}`);he(await te.parse(e),n)}const a=me(n),i="/"!==o[0]?Ee(a,o):o,s=Object.freeze({...a,pointer:i,value:w.get(i,a.schema)});return we(s)},we=e=>C.isReference(e.value)?be(C.href(e.value),e):e,Ee=(e,r)=>{if(!(r in e.anchors))throw Error(`No such anchor '${encodeURI(e.id)}#${encodeURI(r)}'`);return e.anchors[r]},Se=e=>`${e.id}#${encodeURI(e.pointer)}`,Ce=e=>C.isReference(e.value)?C.value(e.value):e.value,Oe=(e,r)=>{const t=me(r.id),n=Object.freeze({...r,pointer:w.append(e,r.pointer),value:Ce(r)[e],validated:t.validated});return we(n)},Ae=r(((e,r)=>V.pipeline([Ce,V.map((async(t,n)=>e(await Oe(n,r),n))),V.all],r))),Ie={parentId:"",parentDialect:"",includeEmbedded:!0},Te=(e,r)=>{if(r.startsWith("file://")){const t=e.slice(7,e.lastIndexOf("/"));return""===e?"":ie(t,r.slice(7))}return r};var je={setConfig:(e,r,t)=>{ue[e]||(ue[e]={}),ue[e][r]=t},getConfig:pe,add:he,get:be,markValidated:e=>{fe[e].validated=!0},uri:Se,value:Ce,getAnchorPointer:Ee,typeOf:(e,r)=>ne(Ce(e),r),has:(e,r)=>e in Ce(r),step:Oe,keys:e=>Object.keys(Ce(e)),entries:e=>V.pipeline([Ce,Object.keys,V.map((async r=>[r,await Oe(r,e)])),V.all],e),map:Ae,length:e=>Ce(e).length,toSchema:(e,r={})=>{const t={...Ie,...r},n=JSON.parse(JSON.stringify(e.schema,((r,n)=>{if(!C.isReference(n))return n;const o=C.value(n),a="string"==typeof o.$schema?oe(o.$schema,""):e.dialectId,i=pe(a,"embeddedToken");return!t.includeEmbedded&&i in o?void 0:C.value(n)}))),o=pe(e.dialectId,"dynamicAnchorToken");Object.entries(e.dynamicAnchors).forEach((([e,r])=>{const t=ae(r);w.assign(t,n,{[o]:e,...w.get(t,n)})}));const a=pe(e.dialectId,"anchorToken");Object.entries(e.anchors).filter((([e])=>""!==e)).forEach((([e,r])=>{w.assign(r,n,{[a]:e,...w.get(r,n)})}));const i=pe(e.dialectId,"baseToken"),s=Te(t.parentId,e.id),c=t.parentDialect===e.dialectId?"":e.dialectId;return{...s&&{[i]:s},...c&&{$schema:c},...n}}};je.setConfig,je.getConfig,je.add,je.get,je.markValidated,je.uri,je.value,je.getAnchorPointer,je.typeOf,je.has,je.step,je.keys,je.entries,je.map,je.length,je.toSchema;class xe extends Error{constructor(e){super("Invalid Schema"),this.name=this.constructor.name,this.output=e}}var Pe=xe;const{resolveUrl:$e}=c,De="FLAG",Re="BASIC",Ne="DETAILED",Fe="VERBOSE";let _e=Ne,ke=!0;te.addPlugin("application/schema+json",{parse:async e=>await e.json(),matcher:e=>e.endsWith(".schema.json")});const Ue=async e=>{const r={metaData:{}};return{ast:r,schemaUri:await Ze(e,r)}},qe=r((({ast:e,schemaUri:r},t,n=De)=>{if(![De,Re,Ne,Fe].includes(n))throw Error(`The '${n}' error format is not supported`);const a=[],i=o.subscribe("result",Le(n,a));return Be(r,t,e,{}),o.unsubscribe(i),a[0]})),Le=(e,r)=>{const t=[];return(n,o)=>{if("result"===n){const{keyword:e,absoluteKeywordLocation:r,instanceLocation:n,valid:a}=o,i={keyword:e,absoluteKeywordLocation:r,instanceLocation:n,valid:a,errors:[]};t.push(i)}else if("result.start"===n)t.push(n);else if("result.end"===n){const n=t.pop();for(;"result.start"!==t[t.length-1];){const r=t.pop(),o=[r];e===Re&&(o.push(...r.errors),delete r.errors),(e===Fe||e!==De&&!r.valid)&&n.errors.unshift(...o)}t[t.length-1]=n,r[0]=n}}},ze={},He=e=>ze[e],Ve=e=>e in ze,Ke={},Me={},Ze=async(e,r)=>{if(e=await Je(e),!Ve(`${e.dialectId}#validate`)){const r=await je.get(e.dialectId);(je.getConfig(r.id,"mandatoryVocabularies")||[]).forEach((e=>{if(!r.vocabulary[e])throw Error(`Vocabulary '${e}' must be explicitly declared and required`)})),Object.entries(r.vocabulary).forEach((([e,t])=>{if(e in Ke)Object.entries(Ke[e]).forEach((([e,t])=>{((e,r)=>{ze[e]={collectEvaluatedItems:(e,t,n,o,a)=>r.interpret(e,t,n,o,a)&&new Set,collectEvaluatedProperties:(e,t,n,o,a)=>r.interpret(e,t,n,o,a)&&[],...r}})(`${r.id}#${e}`,t)}));else if(t)throw Error(`Missing required vocabulary: ${e}`)}))}if(ke&&!e.validated){if(je.markValidated(e.id),!(e.dialectId in Me)){const r=await je.get(e.dialectId),t=await Ue(r);Me[r.id]=qe(t)}const r=F.cons(e.schema,e.id),t=Me[e.dialectId](r,_e);if(!t.valid)throw new Pe(t)}return e.id in r.metaData||(r.metaData[e.id]={id:e.id,dynamicAnchors:e.dynamicAnchors,anchors:e.anchors}),He(`${e.dialectId}#validate`).compile(e,r)},Je=async e=>je.typeOf(e,"string")?Je(await je.get(je.value(e),e)):e,Be=(e,r,t,n)=>{const o=Ge(e,t),a=$e(e,"");return He(o).interpret(e,r,t,{...t.metaData[a].dynamicAnchors,...n})},Ge=(e,r)=>{if(!(e in r))throw Error(`No schema found at ${e}`);return r[e][0]};var We={validate:async(e,r,t)=>{const n=await Ue(e),o=(e,r)=>qe(n,F.cons(e),r);return void 0===r?o:o(r,t)},compile:Ue,interpret:qe,setMetaOutputFormat:e=>{_e=e},setShouldMetaValidate:e=>{ke=e},FLAG:De,BASIC:Re,DETAILED:Ne,VERBOSE:Fe,add:(e,r="",t="")=>{const n=je.add(e,r,t);delete Me[n]},getKeyword:He,hasKeyword:Ve,defineVocabulary:(e,r)=>{Ke[e]=r},compileSchema:Ze,interpretSchema:Be,collectEvaluatedProperties:(e,r,t,n,o)=>{const a=Ge(e,t);return He(a).collectEvaluatedProperties(e,r,t,n,o)},collectEvaluatedItems:(e,r,t,n,o)=>{const a=Ge(e,t);return He(a).collectEvaluatedItems(e,r,t,n,o)},addMediaTypePlugin:te.addPlugin};var Qe={compile:e=>je.value(e),interpret:()=>!0};var Ye={compile:async(e,r)=>{const t=je.uri(e);if(!(t in r)){r[t]=!1;const n=je.value(e);if(!["object","boolean"].includes(typeof n))throw Error(`No schema found at '${je.uri(e)}'`);r[t]=[`${e.dialectId}#validate`,je.uri(e),"boolean"==typeof n?n:await V.pipeline([je.entries,V.map((([r,t])=>[`${e.dialectId}#${r}`,t])),V.filter((([r])=>We.hasKeyword(r)&&r!==`${e.dialectId}#validate`)),V.map((async([t,n])=>{const o=await We.getKeyword(t).compile(n,r,e);return[t,je.uri(n),o]})),V.all],e)]}return t},interpret:(e,r,t,n)=>{const[a,i,s]=t[e];o.publishSync("result.start");const c="boolean"==typeof s?s:s.every((([e,a,i])=>{o.publishSync("result.start");const s=We.getKeyword(e).interpret(i,r,t,n);return o.publishSync("result",{keyword:e,absoluteKeywordLocation:a,instanceLocation:F.uri(r),valid:s,ast:i}),o.publishSync("result.end"),s}));return o.publishSync("result",{keyword:a,absoluteKeywordLocation:i,instanceLocation:F.uri(r),valid:c,ast:e}),o.publishSync("result.end"),c},collectEvaluatedProperties:(e,r,t,n,o=!1)=>{const a=t[e][2];return"boolean"==typeof a?!!a&&[]:a.filter((([e])=>!o||!e.endsWith("#unevaluatedProperties"))).reduce(((e,[o,,a])=>{const i=e&&We.getKeyword(o).collectEvaluatedProperties(a,r,t,n);return!1!==i&&[...e,...i]}),[])},collectEvaluatedItems:(e,r,t,n,o=!1)=>{const a=t[e][2];return"boolean"==typeof a?!!a&&new Set:a.filter((([e])=>!o||!e.endsWith("#unevaluatedItems"))).reduce(((e,[o,,a])=>{const i=!1!==e&&We.getKeyword(o).collectEvaluatedItems(a,r,t,n);return!1!==i&&new Set([...e,...i])}),new Set)}},Xe={metaData:Qe,validate:Ye},er=e("default",{Core:We,Schema:je,Instance:F,Reference:C,Keywords:Xe,InvalidSchemaError:Pe});e("Core",er.Core),e("Schema",er.Schema),e("Instance",er.Instance),e("Reference",er.Reference),e("Keywords",er.Keywords),e("InvalidSchemaError",er.InvalidSchemaError)}}})); | ||
//# sourceMappingURL=json-schema-core-system.min.js.map |
!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define(["exports"],r):r((e="undefined"!=typeof globalThis?globalThis:e||self).JSC={})}(this,(function(e){"use strict";var r=function(e,r){return function t(){null==r&&(r=e.length);var n=[].slice.call(arguments);return n.length>=r?e.apply(this,n):function(){return t.apply(this,n.concat([].slice.call(arguments)))}}};var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function n(e,r){return e(r={exports:{}},r.exports),r.exports}var o=n((function(e,r){var n,o;n="object"==typeof window&&window||t,o={},n.PubSub?(o=n.PubSub,console.warn("PubSub already loaded, using existing version")):(n.PubSub=o,function(e){var r={},t=-1,n="*";function o(e){var r;for(r in e)if(Object.prototype.hasOwnProperty.call(e,r))return!0;return!1}function a(e){return function(){throw e}}function i(e,r,t){try{e(r,t)}catch(e){setTimeout(a(e),0)}}function s(e,r,t){e(r,t)}function c(e,t,n,o){var a,c=r[t],u=o?s:i;if(Object.prototype.hasOwnProperty.call(r,t))for(a in c)Object.prototype.hasOwnProperty.call(c,a)&&u(c[a],e,n)}function u(e,r,t){return function(){var o=String(e),a=o.lastIndexOf(".");for(c(e,e,r,t);-1!==a;)a=(o=o.substr(0,a)).lastIndexOf("."),c(e,o,r,t);c(e,n,r,t)}}function l(e){var t=String(e);return Boolean(Object.prototype.hasOwnProperty.call(r,t)&&o(r[t]))}function p(e){for(var r=String(e),t=l(r)||l(n),o=r.lastIndexOf(".");!t&&-1!==o;)o=(r=r.substr(0,o)).lastIndexOf("."),t=l(r);return t}function f(e,r,t,n){var o=u(e="symbol"==typeof e?e.toString():e,r,n);return!!p(e)&&(!0===t?o():setTimeout(o,0),!0)}e.publish=function(r,t){return f(r,t,!1,e.immediateExceptions)},e.publishSync=function(r,t){return f(r,t,!0,e.immediateExceptions)},e.subscribe=function(e,n){if("function"!=typeof n)return!1;e="symbol"==typeof e?e.toString():e,Object.prototype.hasOwnProperty.call(r,e)||(r[e]={});var o="uid_"+String(++t);return r[e][o]=n,o},e.subscribeAll=function(r){return e.subscribe(n,r)},e.subscribeOnce=function(r,t){var n=e.subscribe(r,(function(){e.unsubscribe(n),t.apply(this,arguments)}));return e},e.clearAllSubscriptions=function(){r={}},e.clearSubscriptions=function(e){var t;for(t in r)Object.prototype.hasOwnProperty.call(r,t)&&0===t.indexOf(e)&&delete r[t]},e.countSubscriptions=function(e){var t,n,o=0;for(t in r)if(Object.prototype.hasOwnProperty.call(r,t)&&0===t.indexOf(e)){for(n in r[t])o++;break}return o},e.getSubscriptions=function(e){var t,n=[];for(t in r)Object.prototype.hasOwnProperty.call(r,t)&&0===t.indexOf(e)&&n.push(t);return n},e.unsubscribe=function(t){var n,o,a,i=function(e){var t;for(t in r)if(Object.prototype.hasOwnProperty.call(r,t)&&0===t.indexOf(e))return!0;return!1},s="string"==typeof t&&(Object.prototype.hasOwnProperty.call(r,t)||i(t)),c=!s&&"string"==typeof t,u="function"==typeof t,l=!1;if(!s){for(n in r)if(Object.prototype.hasOwnProperty.call(r,n)){if(o=r[n],c&&o[t]){delete o[t],l=t;break}if(u)for(a in o)Object.prototype.hasOwnProperty.call(o,a)&&o[a]===t&&(delete o[a],l=!0)}return l}e.clearSubscriptions(t)}}(o)),void 0!==e&&e.exports&&(r=e.exports=o),r.PubSub=o,e.exports=r=o}));o.PubSub;var a,i=n((function(e,r){ | ||
/** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */ | ||
!function(e){function r(){for(var e=arguments.length,r=Array(e),t=0;t<e;t++)r[t]=arguments[t];if(r.length>1){r[0]=r[0].slice(0,-1);for(var n=r.length-1,o=1;o<n;++o)r[o]=r[o].slice(1,-1);return r[n]=r[n].slice(1),r.join("")}return r[0]}function t(e){return"(?:"+e+")"}function n(e){return void 0===e?"undefined":null===e?"null":Object.prototype.toString.call(e).split(" ").pop().split("]").shift().toLowerCase()}function o(e){return e.toUpperCase()}function a(e){return null!=e?e instanceof Array?e:"number"!=typeof e.length||e.split||e.setInterval||e.call?[e]:Array.prototype.slice.call(e):[]}function i(e,r){var t=e;if(r)for(var n in r)t[n]=r[n];return t}function s(e){var n="[A-Za-z]",o="[0-9]",a=r(o,"[A-Fa-f]"),i=t(t("%[EFef]"+a+"%"+a+a+"%"+a+a)+"|"+t("%[89A-Fa-f]"+a+"%"+a+a)+"|"+t("%"+a+a)),s="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",c=r("[\\:\\/\\?\\#\\[\\]\\@]",s),u=e?"[\\uE000-\\uF8FF]":"[]",l=r(n,o,"[\\-\\.\\_\\~]",e?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]");t(n+r(n,o,"[\\+\\-\\.]")+"*"),t(t(i+"|"+r(l,s,"[\\:]"))+"*");var p=t(t("25[0-5]")+"|"+t("2[0-4]"+o)+"|"+t("1"+o+o)+"|"+t("0?[1-9]"+o)+"|0?0?"+o),f=t(p+"\\."+p+"\\."+p+"\\."+p),d=t(a+"{1,4}"),h=t(t(d+"\\:"+d)+"|"+f),v=t(t(d+"\\:")+"{6}"+h),y=t("\\:\\:"+t(d+"\\:")+"{5}"+h),m=t(t(d)+"?\\:\\:"+t(d+"\\:")+"{4}"+h),g=t(t(t(d+"\\:")+"{0,1}"+d)+"?\\:\\:"+t(d+"\\:")+"{3}"+h),b=t(t(t(d+"\\:")+"{0,2}"+d)+"?\\:\\:"+t(d+"\\:")+"{2}"+h),w=t(t(t(d+"\\:")+"{0,3}"+d)+"?\\:\\:"+d+"\\:"+h),E=t(t(t(d+"\\:")+"{0,4}"+d)+"?\\:\\:"+h),S=t(t(t(d+"\\:")+"{0,5}"+d)+"?\\:\\:"+d),C=t(t(t(d+"\\:")+"{0,6}"+d)+"?\\:\\:"),O=t([v,y,m,g,b,w,E,S,C].join("|")),A=t(t(l+"|"+i)+"+");t("[vV]"+a+"+\\."+r(l,s,"[\\:]")+"+"),t(t(i+"|"+r(l,s))+"*");var I=t(i+"|"+r(l,s,"[\\:\\@]"));return t(t(i+"|"+r(l,s,"[\\@]"))+"+"),t(t(I+"|"+r("[\\/\\?]",u))+"*"),{NOT_SCHEME:new RegExp(r("[^]",n,o,"[\\+\\-\\.]"),"g"),NOT_USERINFO:new RegExp(r("[^\\%\\:]",l,s),"g"),NOT_HOST:new RegExp(r("[^\\%\\[\\]\\:]",l,s),"g"),NOT_PATH:new RegExp(r("[^\\%\\/\\:\\@]",l,s),"g"),NOT_PATH_NOSCHEME:new RegExp(r("[^\\%\\/\\@]",l,s),"g"),NOT_QUERY:new RegExp(r("[^\\%]",l,s,"[\\:\\@\\/\\?]",u),"g"),NOT_FRAGMENT:new RegExp(r("[^\\%]",l,s,"[\\:\\@\\/\\?]"),"g"),ESCAPE:new RegExp(r("[^]",l,s),"g"),UNRESERVED:new RegExp(l,"g"),OTHER_CHARS:new RegExp(r("[^\\%]",l,c),"g"),PCT_ENCODED:new RegExp(i,"g"),IPV4ADDRESS:new RegExp("^("+f+")$"),IPV6ADDRESS:new RegExp("^\\[?("+O+")"+t(t("\\%25|\\%(?!"+a+"{2})")+"("+A+")")+"?\\]?$")}}var c=s(!1),u=s(!0),l=function(){function e(e,r){var t=[],n=!0,o=!1,a=void 0;try{for(var i,s=e[Symbol.iterator]();!(n=(i=s.next()).done)&&(t.push(i.value),!r||t.length!==r);n=!0);}catch(e){o=!0,a=e}finally{try{!n&&s.return&&s.return()}finally{if(o)throw a}}return t}return function(r,t){if(Array.isArray(r))return r;if(Symbol.iterator in Object(r))return e(r,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),p=function(e){if(Array.isArray(e)){for(var r=0,t=Array(e.length);r<e.length;r++)t[r]=e[r];return t}return Array.from(e)},f=2147483647,d=36,h=1,v=26,y=38,m=700,g=72,b=128,w="-",E=/^xn--/,S=/[^\0-\x7E]/,C=/[\x2E\u3002\uFF0E\uFF61]/g,O={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},A=d-h,I=Math.floor,j=String.fromCharCode;function T(e){throw new RangeError(O[e])}function x(e,r){for(var t=[],n=e.length;n--;)t[n]=r(e[n]);return t}function $(e,r){var t=e.split("@"),n="";return t.length>1&&(n=t[0]+"@",e=t[1]),n+x((e=e.replace(C,".")).split("."),r).join(".")}function D(e){for(var r=[],t=0,n=e.length;t<n;){var o=e.charCodeAt(t++);if(o>=55296&&o<=56319&&t<n){var a=e.charCodeAt(t++);56320==(64512&a)?r.push(((1023&o)<<10)+(1023&a)+65536):(r.push(o),t--)}else r.push(o)}return r}var P=function(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:d},R=function(e,r){return e+22+75*(e<26)-((0!=r)<<5)},N=function(e,r,t){var n=0;for(e=t?I(e/m):e>>1,e+=I(e/r);e>A*v>>1;n+=d)e=I(e/A);return I(n+(A+1)*e/(e+y))},_=function(e){var r=[],t=e.length,n=0,o=b,a=g,i=e.lastIndexOf(w);i<0&&(i=0);for(var s=0;s<i;++s)e.charCodeAt(s)>=128&&T("not-basic"),r.push(e.charCodeAt(s));for(var c=i>0?i+1:0;c<t;){for(var u=n,l=1,p=d;;p+=d){c>=t&&T("invalid-input");var y=P(e.charCodeAt(c++));(y>=d||y>I((f-n)/l))&&T("overflow"),n+=y*l;var m=p<=a?h:p>=a+v?v:p-a;if(y<m)break;var E=d-m;l>I(f/E)&&T("overflow"),l*=E}var S=r.length+1;a=N(n-u,S,0==u),I(n/S)>f-o&&T("overflow"),o+=I(n/S),n%=S,r.splice(n++,0,o)}return String.fromCodePoint.apply(String,r)},F=function(e){var r=[],t=(e=D(e)).length,n=b,o=0,a=g,i=!0,s=!1,c=void 0;try{for(var u,l=e[Symbol.iterator]();!(i=(u=l.next()).done);i=!0){var p=u.value;p<128&&r.push(j(p))}}catch(e){s=!0,c=e}finally{try{!i&&l.return&&l.return()}finally{if(s)throw c}}var y=r.length,m=y;for(y&&r.push(w);m<t;){var E=f,S=!0,C=!1,O=void 0;try{for(var A,x=e[Symbol.iterator]();!(S=(A=x.next()).done);S=!0){var $=A.value;$>=n&&$<E&&(E=$)}}catch(e){C=!0,O=e}finally{try{!S&&x.return&&x.return()}finally{if(C)throw O}}var P=m+1;E-n>I((f-o)/P)&&T("overflow"),o+=(E-n)*P,n=E;var _=!0,F=!1,k=void 0;try{for(var U,q=e[Symbol.iterator]();!(_=(U=q.next()).done);_=!0){var L=U.value;if(L<n&&++o>f&&T("overflow"),L==n){for(var z=o,H=d;;H+=d){var V=H<=a?h:H>=a+v?v:H-a;if(z<V)break;var K=z-V,M=d-V;r.push(j(R(V+K%M,0))),z=I(K/M)}r.push(j(R(z,0))),a=N(o,P,m==y),o=0,++m}}}catch(e){F=!0,k=e}finally{try{!_&&q.return&&q.return()}finally{if(F)throw k}}++o,++n}return r.join("")},k=function(e){return $(e,(function(e){return E.test(e)?_(e.slice(4).toLowerCase()):e}))},U=function(e){return $(e,(function(e){return S.test(e)?"xn--"+F(e):e}))},q={version:"2.1.0",ucs2:{decode:D,encode:function(e){return String.fromCodePoint.apply(String,p(e))}},decode:_,encode:F,toASCII:U,toUnicode:k},L={};function z(e){var r=e.charCodeAt(0);return r<16?"%0"+r.toString(16).toUpperCase():r<128?"%"+r.toString(16).toUpperCase():r<2048?"%"+(r>>6|192).toString(16).toUpperCase()+"%"+(63&r|128).toString(16).toUpperCase():"%"+(r>>12|224).toString(16).toUpperCase()+"%"+(r>>6&63|128).toString(16).toUpperCase()+"%"+(63&r|128).toString(16).toUpperCase()}function H(e){for(var r="",t=0,n=e.length;t<n;){var o=parseInt(e.substr(t+1,2),16);if(o<128)r+=String.fromCharCode(o),t+=3;else if(o>=194&&o<224){if(n-t>=6){var a=parseInt(e.substr(t+4,2),16);r+=String.fromCharCode((31&o)<<6|63&a)}else r+=e.substr(t,6);t+=6}else if(o>=224){if(n-t>=9){var i=parseInt(e.substr(t+4,2),16),s=parseInt(e.substr(t+7,2),16);r+=String.fromCharCode((15&o)<<12|(63&i)<<6|63&s)}else r+=e.substr(t,9);t+=9}else r+=e.substr(t,3),t+=3}return r}function V(e,r){function t(e){var t=H(e);return t.match(r.UNRESERVED)?t:e}return e.scheme&&(e.scheme=String(e.scheme).replace(r.PCT_ENCODED,t).toLowerCase().replace(r.NOT_SCHEME,"")),void 0!==e.userinfo&&(e.userinfo=String(e.userinfo).replace(r.PCT_ENCODED,t).replace(r.NOT_USERINFO,z).replace(r.PCT_ENCODED,o)),void 0!==e.host&&(e.host=String(e.host).replace(r.PCT_ENCODED,t).toLowerCase().replace(r.NOT_HOST,z).replace(r.PCT_ENCODED,o)),void 0!==e.path&&(e.path=String(e.path).replace(r.PCT_ENCODED,t).replace(e.scheme?r.NOT_PATH:r.NOT_PATH_NOSCHEME,z).replace(r.PCT_ENCODED,o)),void 0!==e.query&&(e.query=String(e.query).replace(r.PCT_ENCODED,t).replace(r.NOT_QUERY,z).replace(r.PCT_ENCODED,o)),void 0!==e.fragment&&(e.fragment=String(e.fragment).replace(r.PCT_ENCODED,t).replace(r.NOT_FRAGMENT,z).replace(r.PCT_ENCODED,o)),e}function K(e){return e.replace(/^0*(.*)/,"$1")||"0"}function M(e,r){var t=e.match(r.IPV4ADDRESS)||[],n=l(t,2)[1];return n?n.split(".").map(K).join("."):e}function Z(e,r){var t=e.match(r.IPV6ADDRESS)||[],n=l(t,3),o=n[1],a=n[2];if(o){for(var i=o.toLowerCase().split("::").reverse(),s=l(i,2),c=s[0],u=s[1],p=u?u.split(":").map(K):[],f=c.split(":").map(K),d=r.IPV4ADDRESS.test(f[f.length-1]),h=d?7:8,v=f.length-h,y=Array(h),m=0;m<h;++m)y[m]=p[m]||f[v+m]||"";d&&(y[h-1]=M(y[h-1],r));var g=y.reduce((function(e,r,t){if(!r||"0"===r){var n=e[e.length-1];n&&n.index+n.length===t?n.length++:e.push({index:t,length:1})}return e}),[]).sort((function(e,r){return r.length-e.length}))[0],b=void 0;if(g&&g.length>1){var w=y.slice(0,g.index),E=y.slice(g.index+g.length);b=w.join(":")+"::"+E.join(":")}else b=y.join(":");return a&&(b+="%"+a),b}return e}var J=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,B=void 0==="".match(/(){0}/)[1];function G(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t={},n=!1!==r.iri?u:c;"suffix"===r.reference&&(e=(r.scheme?r.scheme+":":"")+"//"+e);var o=e.match(J);if(o){B?(t.scheme=o[1],t.userinfo=o[3],t.host=o[4],t.port=parseInt(o[5],10),t.path=o[6]||"",t.query=o[7],t.fragment=o[8],isNaN(t.port)&&(t.port=o[5])):(t.scheme=o[1]||void 0,t.userinfo=-1!==e.indexOf("@")?o[3]:void 0,t.host=-1!==e.indexOf("//")?o[4]:void 0,t.port=parseInt(o[5],10),t.path=o[6]||"",t.query=-1!==e.indexOf("?")?o[7]:void 0,t.fragment=-1!==e.indexOf("#")?o[8]:void 0,isNaN(t.port)&&(t.port=e.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?o[4]:void 0)),t.host&&(t.host=Z(M(t.host,n),n)),void 0!==t.scheme||void 0!==t.userinfo||void 0!==t.host||void 0!==t.port||t.path||void 0!==t.query?void 0===t.scheme?t.reference="relative":void 0===t.fragment?t.reference="absolute":t.reference="uri":t.reference="same-document",r.reference&&"suffix"!==r.reference&&r.reference!==t.reference&&(t.error=t.error||"URI is not a "+r.reference+" reference.");var a=L[(r.scheme||t.scheme||"").toLowerCase()];if(r.unicodeSupport||a&&a.unicodeSupport)V(t,n);else{if(t.host&&(r.domainHost||a&&a.domainHost))try{t.host=q.toASCII(t.host.replace(n.PCT_ENCODED,H).toLowerCase())}catch(e){t.error=t.error||"Host's domain name can not be converted to ASCII via punycode: "+e}V(t,c)}a&&a.parse&&a.parse(t,r)}else t.error=t.error||"URI can not be parsed.";return t}function W(e,r){var t=!1!==r.iri?u:c,n=[];return void 0!==e.userinfo&&(n.push(e.userinfo),n.push("@")),void 0!==e.host&&n.push(Z(M(String(e.host),t),t).replace(t.IPV6ADDRESS,(function(e,r,t){return"["+r+(t?"%25"+t:"")+"]"}))),"number"!=typeof e.port&&"string"!=typeof e.port||(n.push(":"),n.push(String(e.port))),n.length?n.join(""):void 0}var Q=/^\.\.?\//,Y=/^\/\.(\/|$)/,X=/^\/\.\.(\/|$)/,ee=/^\/?(?:.|\n)*?(?=\/|$)/;function re(e){for(var r=[];e.length;)if(e.match(Q))e=e.replace(Q,"");else if(e.match(Y))e=e.replace(Y,"/");else if(e.match(X))e=e.replace(X,"/"),r.pop();else if("."===e||".."===e)e="";else{var t=e.match(ee);if(!t)throw new Error("Unexpected dot segment condition");var n=t[0];e=e.slice(n.length),r.push(n)}return r.join("")}function te(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=r.iri?u:c,n=[],o=L[(r.scheme||e.scheme||"").toLowerCase()];if(o&&o.serialize&&o.serialize(e,r),e.host)if(t.IPV6ADDRESS.test(e.host));else if(r.domainHost||o&&o.domainHost)try{e.host=r.iri?q.toUnicode(e.host):q.toASCII(e.host.replace(t.PCT_ENCODED,H).toLowerCase())}catch(t){e.error=e.error||"Host's domain name can not be converted to "+(r.iri?"Unicode":"ASCII")+" via punycode: "+t}V(e,t),"suffix"!==r.reference&&e.scheme&&(n.push(e.scheme),n.push(":"));var a=W(e,r);if(void 0!==a&&("suffix"!==r.reference&&n.push("//"),n.push(a),e.path&&"/"!==e.path.charAt(0)&&n.push("/")),void 0!==e.path){var i=e.path;r.absolutePath||o&&o.absolutePath||(i=re(i)),void 0===a&&(i=i.replace(/^\/\//,"/%2F")),n.push(i)}return void 0!==e.query&&(n.push("?"),n.push(e.query)),void 0!==e.fragment&&(n.push("#"),n.push(e.fragment)),n.join("")}function ne(e,r){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n={};return arguments[3]||(e=G(te(e,t),t),r=G(te(r,t),t)),!(t=t||{}).tolerant&&r.scheme?(n.scheme=r.scheme,n.userinfo=r.userinfo,n.host=r.host,n.port=r.port,n.path=re(r.path||""),n.query=r.query):(void 0!==r.userinfo||void 0!==r.host||void 0!==r.port?(n.userinfo=r.userinfo,n.host=r.host,n.port=r.port,n.path=re(r.path||""),n.query=r.query):(r.path?("/"===r.path.charAt(0)?n.path=re(r.path):(void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?n.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+r.path:n.path=r.path:n.path="/"+r.path,n.path=re(n.path)),n.query=r.query):(n.path=e.path,void 0!==r.query?n.query=r.query:n.query=e.query),n.userinfo=e.userinfo,n.host=e.host,n.port=e.port),n.scheme=e.scheme),n.fragment=r.fragment,n}function oe(e,r,t){var n=i({scheme:"null"},t);return te(ne(G(e,n),G(r,n),n,!0),n)}function ae(e,r){return"string"==typeof e?e=te(G(e,r),r):"object"===n(e)&&(e=G(te(e,r),r)),e}function ie(e,r,t){return"string"==typeof e?e=te(G(e,t),t):"object"===n(e)&&(e=te(e,t)),"string"==typeof r?r=te(G(r,t),t):"object"===n(r)&&(r=te(r,t)),e===r}function se(e,r){return e&&e.toString().replace(r&&r.iri?u.ESCAPE:c.ESCAPE,z)}function ce(e,r){return e&&e.toString().replace(r&&r.iri?u.PCT_ENCODED:c.PCT_ENCODED,H)}var ue={scheme:"http",domainHost:!0,parse:function(e,r){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e},serialize:function(e,r){var t="https"===String(e.scheme).toLowerCase();return e.port!==(t?443:80)&&""!==e.port||(e.port=void 0),e.path||(e.path="/"),e}},le={scheme:"https",domainHost:ue.domainHost,parse:ue.parse,serialize:ue.serialize};function pe(e){return"boolean"==typeof e.secure?e.secure:"wss"===String(e.scheme).toLowerCase()}var fe={scheme:"ws",domainHost:!0,parse:function(e,r){var t=e;return t.secure=pe(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t},serialize:function(e,r){if(e.port!==(pe(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 t=e.resourceName.split("?"),n=l(t,2),o=n[0],a=n[1];e.path=o&&"/"!==o?o:void 0,e.query=a,e.resourceName=void 0}return e.fragment=void 0,e}},de={scheme:"wss",domainHost:fe.domainHost,parse:fe.parse,serialize:fe.serialize},he={},ve="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",ye="[0-9A-Fa-f]",me=t(t("%[EFef]"+ye+"%"+ye+ye+"%"+ye+ye)+"|"+t("%[89A-Fa-f]"+ye+"%"+ye+ye)+"|"+t("%"+ye+ye)),ge="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]",be=r("[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",'[\\"\\\\]'),we="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]",Ee=new RegExp(ve,"g"),Se=new RegExp(me,"g"),Ce=new RegExp(r("[^]",ge,"[\\.]",'[\\"]',be),"g"),Oe=new RegExp(r("[^]",ve,we),"g"),Ae=Oe;function Ie(e){var r=H(e);return r.match(Ee)?r:e}var je={scheme:"mailto",parse:function(e,r){var t=e,n=t.to=t.path?t.path.split(","):[];if(t.path=void 0,t.query){for(var o=!1,a={},i=t.query.split("&"),s=0,c=i.length;s<c;++s){var u=i[s].split("=");switch(u[0]){case"to":for(var l=u[1].split(","),p=0,f=l.length;p<f;++p)n.push(l[p]);break;case"subject":t.subject=ce(u[1],r);break;case"body":t.body=ce(u[1],r);break;default:o=!0,a[ce(u[0],r)]=ce(u[1],r)}}o&&(t.headers=a)}t.query=void 0;for(var d=0,h=n.length;d<h;++d){var v=n[d].split("@");if(v[0]=ce(v[0]),r.unicodeSupport)v[1]=ce(v[1],r).toLowerCase();else try{v[1]=q.toASCII(ce(v[1],r).toLowerCase())}catch(e){t.error=t.error||"Email address's domain name can not be converted to ASCII via punycode: "+e}n[d]=v.join("@")}return t},serialize:function(e,r){var t=e,n=a(e.to);if(n){for(var i=0,s=n.length;i<s;++i){var c=String(n[i]),u=c.lastIndexOf("@"),l=c.slice(0,u).replace(Se,Ie).replace(Se,o).replace(Ce,z),p=c.slice(u+1);try{p=r.iri?q.toUnicode(p):q.toASCII(ce(p,r).toLowerCase())}catch(e){t.error=t.error||"Email address's domain name can not be converted to "+(r.iri?"Unicode":"ASCII")+" via punycode: "+e}n[i]=l+"@"+p}t.path=n.join(",")}var f=e.headers=e.headers||{};e.subject&&(f.subject=e.subject),e.body&&(f.body=e.body);var d=[];for(var h in f)f[h]!==he[h]&&d.push(h.replace(Se,Ie).replace(Se,o).replace(Oe,z)+"="+f[h].replace(Se,Ie).replace(Se,o).replace(Ae,z));return d.length&&(t.query=d.join("&")),t}},Te=/^([^\:]+)\:(.*)/,xe={scheme:"urn",parse:function(e,r){var t=e.path&&e.path.match(Te),n=e;if(t){var o=r.scheme||n.scheme||"urn",a=t[1].toLowerCase(),i=t[2],s=o+":"+(r.nid||a),c=L[s];n.nid=a,n.nss=i,n.path=void 0,c&&(n=c.parse(n,r))}else n.error=n.error||"URN can not be parsed.";return n},serialize:function(e,r){var t=r.scheme||e.scheme||"urn",n=e.nid,o=t+":"+(r.nid||n),a=L[o];a&&(e=a.serialize(e,r));var i=e,s=e.nss;return i.path=(n||r.nid)+":"+s,i}},$e=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/,De={scheme:"urn:uuid",parse:function(e,r){var t=e;return t.uuid=t.nss,t.nss=void 0,r.tolerant||t.uuid&&t.uuid.match($e)||(t.error=t.error||"UUID is not valid."),t},serialize:function(e,r){var t=e;return t.nss=(e.uuid||"").toLowerCase(),t}};L[ue.scheme]=ue,L[le.scheme]=le,L[fe.scheme]=fe,L[de.scheme]=de,L[je.scheme]=je,L[xe.scheme]=xe,L[De.scheme]=De,e.SCHEMES=L,e.pctEncChar=z,e.pctDecChars=H,e.parse=G,e.removeDotSegments=re,e.serialize=te,e.resolveComponents=ne,e.resolve=oe,e.normalize=ae,e.equal=ie,e.escapeComponent=se,e.unescapeComponent=ce,Object.defineProperty(e,"__esModule",{value:!0})}(r)}));(a=i)&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")&&a.default;const s={null:e=>null===e,boolean:e=>"boolean"==typeof e,object:e=>"object"==typeof e&&!Array.isArray(e)&&null!==e,array:e=>Array.isArray(e),number:e=>"number"==typeof e,integer:e=>Number.isInteger(e),string:e=>"string"==typeof e};var c={jsonTypeOf:(e,r)=>s[r](e),resolveUrl:(e,r)=>{const t=i.resolve(e,r,{iri:!0});if(i.resolve(e,"",{iri:!0})&&"file"===i.parse(t).scheme&&"file"!==i.parse(e).scheme)throw Error(`Can't access file '${t}' resource from network context '${e}'`);return t},urlFragment:e=>i.unescapeComponent(i.parse(e).fragment)||"",pathRelative:(e,r)=>{if(e===r)return"";let t=1;const n=e.length-1,o=r.length-t,a=n<o?n:o;let i=-1,s=0;for(;s<a;s++){const n=e.charCodeAt(s+1);if(n!==r.charCodeAt(t+s))break;47===n&&(i=s)}if(o>a){if(47===r.charCodeAt(t+s))return r.slice(t+s+1);if(0===s)return r.slice(t+s)}n>a&&(47===e.charCodeAt(s+1)?i=s:0===a&&(i=0));let c="";for(s=i+2;s<=e.length;++s)s!==e.length&&47!==e.charCodeAt(s)||(c+=0===c.length?"..":"/..");return t+=i,c.length>0?`${c}${r.slice(t,r.length)}`:(47===r.charCodeAt(t)&&++t,r.slice(t,r.length))}};const u=e=>{if(e.length>0&&"/"!==e[0])throw Error("Invalid JSON Pointer");return e.split("/").slice(1).map(y)},l=(e,r,t,n)=>{if(0===e.length)return t;if(e.length>1){const o=e.shift();return{...r,[o]:l(e,g(r,o,n),t,h(o,n))}}if(Array.isArray(r)){const n=[...r];return n[m(r,e[0])]=t,n}return"object"==typeof r&&null!==r?{...r,[e[0]]:t}:g(r,e[0],n)},p=(e,r,t,n)=>{if(0!==e.length)if(1!==e.length||b(r)){const o=e.shift();p(e,g(r,o,n),t,h(o,n))}else{r[m(r,e[0])]=t}},f=(e,r,t)=>{if(0!=e.length){if(e.length>1){const n=e.shift(),o=g(r,n,t);return{...r,[n]:f(e,o,h(n,t))}}if(Array.isArray(r))return r.filter(((r,t)=>t!=e[0]));if("object"==typeof r&&null!==r){const{[e[0]]:t,...n}=r;return n}return g(r,e[0],t)}},d=(e,r,t)=>{if(0!==e.length)if(e.length>1){const n=e.shift(),o=g(r,n,t);d(e,o,h(n,t))}else Array.isArray(r)?r.splice(e[0],1):"object"==typeof r&&null!==r?delete r[e[0]]:g(r,e[0],t)},h=r(((e,r)=>r+"/"+v(e))),v=e=>e.toString().replace(/~/g,"~0").replace(/\//g,"~1"),y=e=>e.toString().replace(/~1/g,"/").replace(/~0/g,"~"),m=(e,r)=>Array.isArray(e)&&"-"===r?e.length:r,g=(e,r,t="")=>{if(void 0===e)throw TypeError(`Value at '${t}' is undefined and does not have property '${r}'`);if(null===e)throw TypeError(`Value at '${t}' is null and does not have property '${r}'`);if(b(e))throw TypeError(`Value at '${t}' is a ${typeof e} and does not have property '${r}'`);return e[m(e,r)]},b=e=>null===e||"object"!=typeof e;var w={nil:"",append:h,get:(e,r)=>{const t=u(e),n=e=>t.reduce((([e,r],t)=>[g(e,t,r),h(t,r)]),[e,""])[0];return void 0===r?n:n(r)},set:(e,t,n)=>{const o=u(e),a=r(((e,r)=>l(o,e,r,"")));return void 0===t?a:a(t,n)},assign:(e,t,n)=>{const o=u(e),a=r(((e,r)=>p(o,e,r,"")));return void 0===t?a:a(t,n)},unset:(e,r)=>{const t=u(e),n=e=>f(t,e,"");return void 0===r?n:n(r)},remove:(e,r)=>{const t=u(e),n=e=>d(t,e,"");return void 0===r?n:n(r)}};w.nil,w.append,w.get,w.set,w.assign,w.unset,w.remove;const E=Symbol("$__value"),S=Symbol("$__href");var C={cons:(e,r)=>Object.freeze({[S]:e,[E]:r}),isReference:e=>e&&void 0!==e[S],href:e=>e[S],value:e=>e[E]};const{resolveUrl:O,jsonTypeOf:A}=c,I=Object.freeze({id:"",pointer:"",instance:void 0,value:void 0}),j=e=>C.isReference(e.value)?C.value(e.value):e.value,T=r(((e,r)=>A(j(e),r))),x=(e,r)=>Object.freeze({...r,pointer:w.append(e,r.pointer),value:j(r)[e]}),$=r(((e,r)=>j(r).map(((t,n,o,a)=>e(x(n,r),n,o,a))))),D=r(((e,r)=>j(r).map(((e,t,n,o)=>x(t,r))).filter(((r,t,n,o)=>e(r,t,n,o))))),P=r(((e,r,t)=>j(t).reduce(((r,n,o)=>e(r,x(o,t),o)),r))),R=r(((e,r)=>j(r).every(((t,n,o,a)=>e(x(n,r),n,o,a))))),N=r(((e,r)=>j(r).some(((t,n,o,a)=>e(x(n,r),n,o,a)))));var _={nil:I,cons:(e,r="")=>Object.freeze({...I,id:O(r,""),instance:e,value:e}),uri:e=>`${e.id}#${encodeURI(e.pointer)}`,value:j,has:(e,r)=>e in j(r),typeOf:T,step:x,entries:e=>Object.keys(j(e)).map((r=>[r,x(r,e)])),keys:e=>Object.keys(j(e)),map:$,filter:D,reduce:P,every:R,some:N,length:e=>j(e).length},F=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,k=/^[\u000b\u0020-\u007e\u0080-\u00ff]+$/,U=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,q=/\\([\u000b\u0020-\u00ff])/g,L=/([\\"])/g,z=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,H=function(e){if(!e)throw new TypeError("argument string is required");var r="object"==typeof e?function(e){var r;"function"==typeof e.getHeader?r=e.getHeader("content-type"):"object"==typeof e.headers&&(r=e.headers&&e.headers["content-type"]);if("string"!=typeof r)throw new TypeError("content-type header is missing from object");return r}(e):e;if("string"!=typeof r)throw new TypeError("argument string is required to be a string");var t=r.indexOf(";"),n=-1!==t?r.substr(0,t).trim():r.trim();if(!z.test(n))throw new TypeError("invalid media type");var o=new K(n.toLowerCase());if(-1!==t){var a,i,s;for(F.lastIndex=t;i=F.exec(r);){if(i.index!==t)throw new TypeError("invalid parameter format");t+=i[0].length,a=i[1].toLowerCase(),'"'===(s=i[2])[0]&&(s=s.substr(1,s.length-2).replace(q,"$1")),o.parameters[a]=s}if(t!==r.length)throw new TypeError("invalid parameter format")}return o};function V(e){var r=String(e);if(U.test(r))return r;if(r.length>0&&!k.test(r))throw new TypeError("invalid parameter value");return'"'+r.replace(L,"\\$1")+'"'}function K(e){this.parameters=Object.create(null),this.type=e}var M={format:function(e){if(!e||"object"!=typeof e)throw new TypeError("argument obj is required");var r=e.parameters,t=e.type;if(!t||!z.test(t))throw new TypeError("invalid type");var n=t;if(r&&"object"==typeof r)for(var o,a=Object.keys(r).sort(),i=0;i<a.length;i++){if(o=a[i],!U.test(o))throw new TypeError("invalid parameter name");n+="; "+o+"="+V(r[o])}return n},parse:H},Z=async e=>Object.entries(await e),J=r((async(e,r)=>(await r).map(e))),B=r((async(e,r,t)=>(await t).reduce((async(r,t)=>e(await r,t)),r))),G=r((async(e,r,t={})=>B((async(r,t)=>await e(t)?r.concat([t]):r),[],r,t))),W=r((async(e,r)=>{const t=await J(e,r);return(await Promise.all(t)).some((e=>e))})),Q=r((async(e,r)=>{const t=await J(e,r);return(await Promise.all(t)).every((e=>e))})),Y=r(((e,r)=>e.reduce((async(e,r)=>r(await e)),r))),X={entries:Z,map:J,filter:G,reduce:B,some:W,every:Q,pipeline:Y,all:e=>Promise.all(e),allValues:e=>Y([Z,B((async(e,[r,t])=>(e[r]=await t,e)),{})],e)};X.entries,X.map,X.filter,X.reduce,X.some,X.every,X.pipeline,X.all,X.allValues;var ee=fetch;const{jsonTypeOf:re,resolveUrl:te,urlFragment:ne,pathRelative:oe}=c,ae="https://json-schema.org/draft/2019-09/vocab/core",ie="https://json-schema.org/draft/2020-12/vocab/core",se={},ce={},ue=(e,r)=>{const t=ce[e];return se[t]?.[r]},le={},pe={},fe=(e,r="",t="")=>{e=JSON.parse(JSON.stringify(e));const n=te(r,""),o=te(e.$schema||t,"");if(!o)throw Error("Couldn't determine schema dialect");if(delete e.$schema,!(o in ce))if(!0===e?.$vocabulary?.[ae]&&o===de(e,n,ae)[0])ce[o]=ae;else if(!0===e?.$vocabulary?.[ie]&&o===de(e,n,ie)[0])ce[o]=ie;else if(o===de(e,n,o)[0])ce[o]=o;else{if(!(o in le))throw Error(`Couldn't determine JSON Schema version for dialect: '${o}'`);{const e=le[o];!0===e.vocabulary[ae]?ce[o]=ae:!0===e.vocabulary[ie]?ce[o]=ie:ce[o]=ce[e.dialectId]}}const[a,i]=de(e,n,ce[o]);if(!a)throw Error("Couldn't determine an identifier for the schema");const s=ue(o,"baseToken");delete e[s],n&&(pe[n]=a);const c=ue(o,"anchorToken");i&&s===c&&(e[c]=c!==s?encodeURI(i):`#${encodeURI(i)}`);const u={},l=ue(o,"recursiveAnchorToken");let p;!0===e[l]&&(u[""]=`${a}#`,e[c]="",delete e[l]);const f=ue(o,"vocabularyToken");re(e[f],"object")?(p=e[f],delete e[f]):p={[ce[o]]:!0};const d={"":""};return le[a]={id:a,dialectId:o,schema:he(e,a,o,w.nil,d,u),anchors:d,dynamicAnchors:u,vocabulary:p,validated:!1},a},de=(e,r,t)=>{const n=se[t]?.baseToken,o=te(r,e[n]||"");return[te(o,""),ne(o)]},he=(e,r,t,n,o,a)=>{if(re(e,"object")){const i="string"==typeof e.$schema?te(e.$schema,""):t,s=ue(i,"embeddedToken"),c=ue(i,"anchorToken");if("string"==typeof e[s]&&(s!==c||"#"!==e[s][0])){const n=te(r,e[s]);return e[ue(i,"baseToken")]=n,fe(e,n,t),C.cons(e[s],e)}const u=ue(t,"anchorToken"),l=ue(t,"dynamicAnchorToken");"string"==typeof e[l]&&(a[e[l]]=`${r}#${encodeURI(n)}`,o[e[l]]=n,delete e[l]);const p=ue(t,"embeddedToken");if("string"==typeof e[u]){const r=u!==p?e[u]:e[u].slice(1);o[r]=n,delete e[u]}const f=ue(t,"jrefToken");if("string"==typeof e[f])return C.cons(e[f],e);for(const i in e)e[i]=he(e[i],r,t,w.append(i,n),o,a);return e}return Array.isArray(e)?e.map(((e,i)=>he(e,r,t,w.append(i,n),o,a))):e},ve=e=>le[pe[e]]||le[e],ye=Object.freeze({id:"",dialectId:void 0,vocabulary:{},pointer:w.nil,schema:void 0,value:void 0,anchors:{},dynamicAnchors:{},validated:!0}),me=async(e,r=ye)=>{const t=te(we(r),e),n=te(t,""),o=ne(t);if(!(e=>e in le||e in pe)(n)){const e=await ee(n,{headers:{Accept:"application/schema+json"}});if(e.status>=400)throw await e.text(),Error(`Failed to retrieve schema with id: ${n}`);if(e.headers.has("content-type")){const r=M.parse(e.headers.get("content-type")).type;if("application/schema+json"!==r)throw Error(`${n} is not a schema. Found a document with media type: ${r}`)}fe(await e.json(),n)}const a=ve(n),i="/"!==o[0]?be(a,o):o,s=Object.freeze({...a,pointer:i,value:w.get(i,a.schema)});return ge(s)},ge=e=>C.isReference(e.value)?me(C.href(e.value),e):e,be=(e,r)=>{if(!(r in e.anchors))throw Error(`No such anchor '${encodeURI(e.id)}#${encodeURI(r)}'`);return e.anchors[r]},we=e=>`${e.id}#${encodeURI(e.pointer)}`,Ee=e=>C.isReference(e.value)?C.value(e.value):e.value,Se=(e,r)=>{const t=ve(r.id),n=Object.freeze({...r,pointer:w.append(e,r.pointer),value:Ee(r)[e],validated:t.validated});return ge(n)},Ce=r(((e,r)=>X.pipeline([Ee,X.map((async(t,n)=>e(await Se(n,r),n))),X.all],r))),Oe={parentId:"",parentDialect:"",includeEmbedded:!0},Ae=(e,r)=>{if(r.startsWith("file://")){const t=e.slice(7,e.lastIndexOf("/"));return""===e?"":oe(t,r.slice(7))}return r};var Ie={setConfig:(e,r,t)=>{se[e]||(se[e]={}),se[e][r]=t},getConfig:ue,add:fe,get:me,markValidated:e=>{le[e].validated=!0},uri:we,value:Ee,getAnchorPointer:be,typeOf:(e,r)=>re(Ee(e),r),has:(e,r)=>e in Ee(r),step:Se,keys:e=>Object.keys(Ee(e)),entries:e=>X.pipeline([Ee,Object.keys,X.map((async r=>[r,await Se(r,e)])),X.all],e),map:Ce,length:e=>Ee(e).length,toSchema:(e,r={})=>{const t={...Oe,...r},n=JSON.parse(JSON.stringify(e.schema,((r,n)=>{if(!C.isReference(n))return n;const o=C.value(n),a="string"==typeof o.$schema?te(o.$schema,""):e.dialectId,i=ue(a,"embeddedToken");return!t.includeEmbedded&&i in o?void 0:C.value(n)}))),o=ue(e.dialectId,"dynamicAnchorToken");Object.entries(e.dynamicAnchors).forEach((([e,r])=>{const t=ne(r);w.assign(t,n,{[o]:e,...w.get(t,n)})}));const a=ue(e.dialectId,"anchorToken");Object.entries(e.anchors).filter((([e])=>""!==e)).forEach((([e,r])=>{w.assign(r,n,{[a]:e,...w.get(r,n)})}));const i=ue(e.dialectId,"baseToken"),s=Ae(t.parentId,e.id),c=t.parentDialect===e.dialectId?"":e.dialectId;return{...s&&{[i]:s},...c&&{$schema:c},...n}}};Ie.setConfig,Ie.getConfig,Ie.add,Ie.get,Ie.markValidated,Ie.uri,Ie.value,Ie.getAnchorPointer,Ie.typeOf,Ie.has,Ie.step,Ie.keys,Ie.entries,Ie.map,Ie.length,Ie.toSchema;class je extends Error{constructor(e){super("Invalid Schema"),this.name=this.constructor.name,this.output=e}}var Te=je;const{resolveUrl:xe}=c,$e="FLAG",De="BASIC",Pe="DETAILED",Re="VERBOSE";let Ne=Pe,_e=!0;const Fe=async e=>{const r={metaData:{}};return{ast:r,schemaUri:await Ke(e,r)}},ke=r((({ast:e,schemaUri:r},t,n=$e)=>{if(![$e,De,Pe,Re].includes(n))throw Error(`The '${n}' error format is not supported`);const a=[],i=o.subscribe("result",Ue(n,a));return Ze(r,t,e,{}),o.unsubscribe(i),a[0]})),Ue=(e,r)=>{const t=[];return(n,o)=>{if("result"===n){const{keyword:e,absoluteKeywordLocation:r,instanceLocation:n,valid:a}=o,i={keyword:e,absoluteKeywordLocation:r,instanceLocation:n,valid:a,errors:[]};t.push(i)}else if("result.start"===n)t.push(n);else if("result.end"===n){const n=t.pop();for(;"result.start"!==t[t.length-1];){const r=t.pop(),o=[r];e===De&&(o.push(...r.errors),delete r.errors),(e===Re||e!==$e&&!r.valid)&&n.errors.unshift(...o)}t[t.length-1]=n,r[0]=n}}},qe={},Le=e=>qe[e],ze=e=>e in qe,He={},Ve={},Ke=async(e,r)=>{if(e=await Me(e),!ze(`${e.dialectId}#validate`)){const r=await Ie.get(e.dialectId);(Ie.getConfig(r.id,"mandatoryVocabularies")||[]).forEach((e=>{if(!r.vocabulary[e])throw Error(`Vocabulary '${e}' must be explicitly declared and required`)})),Object.entries(r.vocabulary).forEach((([e,t])=>{if(e in He)Object.entries(He[e]).forEach((([e,t])=>{((e,r)=>{qe[e]={collectEvaluatedItems:(e,t,n,o,a)=>r.interpret(e,t,n,o,a)&&new Set,collectEvaluatedProperties:(e,t,n,o,a)=>r.interpret(e,t,n,o,a)&&[],...r}})(`${r.id}#${e}`,t)}));else if(t)throw Error(`Missing required vocabulary: ${e}`)}))}if(_e&&!e.validated){if(Ie.markValidated(e.id),!(e.dialectId in Ve)){const r=await Ie.get(e.dialectId),t=await Fe(r);Ve[r.id]=ke(t)}const r=_.cons(e.schema,e.id),t=Ve[e.dialectId](r,Ne);if(!t.valid)throw new Te(t)}return e.id in r.metaData||(r.metaData[e.id]={id:e.id,dynamicAnchors:e.dynamicAnchors,anchors:e.anchors}),Le(`${e.dialectId}#validate`).compile(e,r)},Me=async e=>Ie.typeOf(e,"string")?Me(await Ie.get(Ie.value(e),e)):e,Ze=(e,r,t,n)=>{const o=Je(e,t),a=xe(e,"");return Le(o).interpret(e,r,t,{...t.metaData[a].dynamicAnchors,...n})},Je=(e,r)=>{if(!(e in r))throw Error(`No schema found at ${e}`);return r[e][0]};var Be={validate:async(e,r,t)=>{const n=await Fe(e),o=(e,r)=>ke(n,_.cons(e),r);return void 0===r?o:o(r,t)},compile:Fe,interpret:ke,setMetaOutputFormat:e=>{Ne=e},setShouldMetaValidate:e=>{_e=e},FLAG:$e,BASIC:De,DETAILED:Pe,VERBOSE:Re,add:(e,r="",t="")=>{const n=Ie.add(e,r,t);delete Ve[n]},getKeyword:Le,hasKeyword:ze,defineVocabulary:(e,r)=>{He[e]=r},compileSchema:Ke,interpretSchema:Ze,collectEvaluatedProperties:(e,r,t,n,o)=>{const a=Je(e,t);return Le(a).collectEvaluatedProperties(e,r,t,n,o)},collectEvaluatedItems:(e,r,t,n,o)=>{const a=Je(e,t);return Le(a).collectEvaluatedItems(e,r,t,n,o)}};var Ge={compile:e=>Ie.value(e),interpret:()=>!0};var We={compile:async(e,r)=>{const t=Ie.uri(e);if(!(t in r)){r[t]=!1;const n=Ie.value(e);if(!["object","boolean"].includes(typeof n))throw Error(`No schema found at '${Ie.uri(e)}'`);r[t]=[`${e.dialectId}#validate`,Ie.uri(e),"boolean"==typeof n?n:await X.pipeline([Ie.entries,X.map((([r,t])=>[`${e.dialectId}#${r}`,t])),X.filter((([r])=>Be.hasKeyword(r)&&r!==`${e.dialectId}#validate`)),X.map((async([t,n])=>{const o=await Be.getKeyword(t).compile(n,r,e);return[t,Ie.uri(n),o]})),X.all],e)]}return t},interpret:(e,r,t,n)=>{const[a,i,s]=t[e];o.publishSync("result.start");const c="boolean"==typeof s?s:s.every((([e,a,i])=>{o.publishSync("result.start");const s=Be.getKeyword(e).interpret(i,r,t,n);return o.publishSync("result",{keyword:e,absoluteKeywordLocation:a,instanceLocation:_.uri(r),valid:s,ast:i}),o.publishSync("result.end"),s}));return o.publishSync("result",{keyword:a,absoluteKeywordLocation:i,instanceLocation:_.uri(r),valid:c,ast:e}),o.publishSync("result.end"),c},collectEvaluatedProperties:(e,r,t,n,o=!1)=>{const a=t[e][2];return"boolean"==typeof a?!!a&&[]:a.filter((([e])=>!o||!e.endsWith("#unevaluatedProperties"))).reduce(((e,[o,,a])=>{const i=e&&Be.getKeyword(o).collectEvaluatedProperties(a,r,t,n);return!1!==i&&[...e,...i]}),[])},collectEvaluatedItems:(e,r,t,n,o=!1)=>{const a=t[e][2];return"boolean"==typeof a?!!a&&new Set:a.filter((([e])=>!o||!e.endsWith("#unevaluatedItems"))).reduce(((e,[o,,a])=>{const i=!1!==e&&Be.getKeyword(o).collectEvaluatedItems(a,r,t,n);return!1!==i&&new Set([...e,...i])}),new Set)}},Qe={metaData:Ge,validate:We},Ye={Core:Be,Schema:Ie,Instance:_,Reference:C,Keywords:Qe,InvalidSchemaError:Te},Xe=Ye.Core,er=Ye.Schema,rr=Ye.Instance,tr=Ye.Reference,nr=Ye.Keywords,or=Ye.InvalidSchemaError;e.Core=Xe,e.Instance=rr,e.InvalidSchemaError=or,e.Keywords=nr,e.Reference=tr,e.Schema=er,e.default=Ye,Object.defineProperty(e,"__esModule",{value:!0})})); | ||
!function(e){function r(){for(var e=arguments.length,r=Array(e),t=0;t<e;t++)r[t]=arguments[t];if(r.length>1){r[0]=r[0].slice(0,-1);for(var n=r.length-1,o=1;o<n;++o)r[o]=r[o].slice(1,-1);return r[n]=r[n].slice(1),r.join("")}return r[0]}function t(e){return"(?:"+e+")"}function n(e){return void 0===e?"undefined":null===e?"null":Object.prototype.toString.call(e).split(" ").pop().split("]").shift().toLowerCase()}function o(e){return e.toUpperCase()}function a(e){return null!=e?e instanceof Array?e:"number"!=typeof e.length||e.split||e.setInterval||e.call?[e]:Array.prototype.slice.call(e):[]}function i(e,r){var t=e;if(r)for(var n in r)t[n]=r[n];return t}function s(e){var n="[A-Za-z]",o="[0-9]",a=r(o,"[A-Fa-f]"),i=t(t("%[EFef]"+a+"%"+a+a+"%"+a+a)+"|"+t("%[89A-Fa-f]"+a+"%"+a+a)+"|"+t("%"+a+a)),s="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",c=r("[\\:\\/\\?\\#\\[\\]\\@]",s),u=e?"[\\uE000-\\uF8FF]":"[]",l=r(n,o,"[\\-\\.\\_\\~]",e?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]");t(n+r(n,o,"[\\+\\-\\.]")+"*"),t(t(i+"|"+r(l,s,"[\\:]"))+"*");var p=t(t("25[0-5]")+"|"+t("2[0-4]"+o)+"|"+t("1"+o+o)+"|"+t("0?[1-9]"+o)+"|0?0?"+o),f=t(p+"\\."+p+"\\."+p+"\\."+p),d=t(a+"{1,4}"),h=t(t(d+"\\:"+d)+"|"+f),v=t(t(d+"\\:")+"{6}"+h),y=t("\\:\\:"+t(d+"\\:")+"{5}"+h),m=t(t(d)+"?\\:\\:"+t(d+"\\:")+"{4}"+h),g=t(t(t(d+"\\:")+"{0,1}"+d)+"?\\:\\:"+t(d+"\\:")+"{3}"+h),b=t(t(t(d+"\\:")+"{0,2}"+d)+"?\\:\\:"+t(d+"\\:")+"{2}"+h),w=t(t(t(d+"\\:")+"{0,3}"+d)+"?\\:\\:"+d+"\\:"+h),E=t(t(t(d+"\\:")+"{0,4}"+d)+"?\\:\\:"+h),S=t(t(t(d+"\\:")+"{0,5}"+d)+"?\\:\\:"+d),C=t(t(t(d+"\\:")+"{0,6}"+d)+"?\\:\\:"),O=t([v,y,m,g,b,w,E,S,C].join("|")),A=t(t(l+"|"+i)+"+");t("[vV]"+a+"+\\."+r(l,s,"[\\:]")+"+"),t(t(i+"|"+r(l,s))+"*");var I=t(i+"|"+r(l,s,"[\\:\\@]"));return t(t(i+"|"+r(l,s,"[\\@]"))+"+"),t(t(I+"|"+r("[\\/\\?]",u))+"*"),{NOT_SCHEME:new RegExp(r("[^]",n,o,"[\\+\\-\\.]"),"g"),NOT_USERINFO:new RegExp(r("[^\\%\\:]",l,s),"g"),NOT_HOST:new RegExp(r("[^\\%\\[\\]\\:]",l,s),"g"),NOT_PATH:new RegExp(r("[^\\%\\/\\:\\@]",l,s),"g"),NOT_PATH_NOSCHEME:new RegExp(r("[^\\%\\/\\@]",l,s),"g"),NOT_QUERY:new RegExp(r("[^\\%]",l,s,"[\\:\\@\\/\\?]",u),"g"),NOT_FRAGMENT:new RegExp(r("[^\\%]",l,s,"[\\:\\@\\/\\?]"),"g"),ESCAPE:new RegExp(r("[^]",l,s),"g"),UNRESERVED:new RegExp(l,"g"),OTHER_CHARS:new RegExp(r("[^\\%]",l,c),"g"),PCT_ENCODED:new RegExp(i,"g"),IPV4ADDRESS:new RegExp("^("+f+")$"),IPV6ADDRESS:new RegExp("^\\[?("+O+")"+t(t("\\%25|\\%(?!"+a+"{2})")+"("+A+")")+"?\\]?$")}}var c=s(!1),u=s(!0),l=function(){function e(e,r){var t=[],n=!0,o=!1,a=void 0;try{for(var i,s=e[Symbol.iterator]();!(n=(i=s.next()).done)&&(t.push(i.value),!r||t.length!==r);n=!0);}catch(e){o=!0,a=e}finally{try{!n&&s.return&&s.return()}finally{if(o)throw a}}return t}return function(r,t){if(Array.isArray(r))return r;if(Symbol.iterator in Object(r))return e(r,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),p=function(e){if(Array.isArray(e)){for(var r=0,t=Array(e.length);r<e.length;r++)t[r]=e[r];return t}return Array.from(e)},f=2147483647,d=36,h=1,v=26,y=38,m=700,g=72,b=128,w="-",E=/^xn--/,S=/[^\0-\x7E]/,C=/[\x2E\u3002\uFF0E\uFF61]/g,O={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},A=d-h,I=Math.floor,T=String.fromCharCode;function j(e){throw new RangeError(O[e])}function x(e,r){for(var t=[],n=e.length;n--;)t[n]=r(e[n]);return t}function P(e,r){var t=e.split("@"),n="";return t.length>1&&(n=t[0]+"@",e=t[1]),n+x((e=e.replace(C,".")).split("."),r).join(".")}function $(e){for(var r=[],t=0,n=e.length;t<n;){var o=e.charCodeAt(t++);if(o>=55296&&o<=56319&&t<n){var a=e.charCodeAt(t++);56320==(64512&a)?r.push(((1023&o)<<10)+(1023&a)+65536):(r.push(o),t--)}else r.push(o)}return r}var D=function(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:d},R=function(e,r){return e+22+75*(e<26)-((0!=r)<<5)},N=function(e,r,t){var n=0;for(e=t?I(e/m):e>>1,e+=I(e/r);e>A*v>>1;n+=d)e=I(e/A);return I(n+(A+1)*e/(e+y))},_=function(e){var r=[],t=e.length,n=0,o=b,a=g,i=e.lastIndexOf(w);i<0&&(i=0);for(var s=0;s<i;++s)e.charCodeAt(s)>=128&&j("not-basic"),r.push(e.charCodeAt(s));for(var c=i>0?i+1:0;c<t;){for(var u=n,l=1,p=d;;p+=d){c>=t&&j("invalid-input");var y=D(e.charCodeAt(c++));(y>=d||y>I((f-n)/l))&&j("overflow"),n+=y*l;var m=p<=a?h:p>=a+v?v:p-a;if(y<m)break;var E=d-m;l>I(f/E)&&j("overflow"),l*=E}var S=r.length+1;a=N(n-u,S,0==u),I(n/S)>f-o&&j("overflow"),o+=I(n/S),n%=S,r.splice(n++,0,o)}return String.fromCodePoint.apply(String,r)},F=function(e){var r=[],t=(e=$(e)).length,n=b,o=0,a=g,i=!0,s=!1,c=void 0;try{for(var u,l=e[Symbol.iterator]();!(i=(u=l.next()).done);i=!0){var p=u.value;p<128&&r.push(T(p))}}catch(e){s=!0,c=e}finally{try{!i&&l.return&&l.return()}finally{if(s)throw c}}var y=r.length,m=y;for(y&&r.push(w);m<t;){var E=f,S=!0,C=!1,O=void 0;try{for(var A,x=e[Symbol.iterator]();!(S=(A=x.next()).done);S=!0){var P=A.value;P>=n&&P<E&&(E=P)}}catch(e){C=!0,O=e}finally{try{!S&&x.return&&x.return()}finally{if(C)throw O}}var D=m+1;E-n>I((f-o)/D)&&j("overflow"),o+=(E-n)*D,n=E;var _=!0,F=!1,k=void 0;try{for(var U,q=e[Symbol.iterator]();!(_=(U=q.next()).done);_=!0){var L=U.value;if(L<n&&++o>f&&j("overflow"),L==n){for(var z=o,H=d;;H+=d){var V=H<=a?h:H>=a+v?v:H-a;if(z<V)break;var M=z-V,K=d-V;r.push(T(R(V+M%K,0))),z=I(M/K)}r.push(T(R(z,0))),a=N(o,D,m==y),o=0,++m}}}catch(e){F=!0,k=e}finally{try{!_&&q.return&&q.return()}finally{if(F)throw k}}++o,++n}return r.join("")},k=function(e){return P(e,(function(e){return E.test(e)?_(e.slice(4).toLowerCase()):e}))},U=function(e){return P(e,(function(e){return S.test(e)?"xn--"+F(e):e}))},q={version:"2.1.0",ucs2:{decode:$,encode:function(e){return String.fromCodePoint.apply(String,p(e))}},decode:_,encode:F,toASCII:U,toUnicode:k},L={};function z(e){var r=e.charCodeAt(0);return r<16?"%0"+r.toString(16).toUpperCase():r<128?"%"+r.toString(16).toUpperCase():r<2048?"%"+(r>>6|192).toString(16).toUpperCase()+"%"+(63&r|128).toString(16).toUpperCase():"%"+(r>>12|224).toString(16).toUpperCase()+"%"+(r>>6&63|128).toString(16).toUpperCase()+"%"+(63&r|128).toString(16).toUpperCase()}function H(e){for(var r="",t=0,n=e.length;t<n;){var o=parseInt(e.substr(t+1,2),16);if(o<128)r+=String.fromCharCode(o),t+=3;else if(o>=194&&o<224){if(n-t>=6){var a=parseInt(e.substr(t+4,2),16);r+=String.fromCharCode((31&o)<<6|63&a)}else r+=e.substr(t,6);t+=6}else if(o>=224){if(n-t>=9){var i=parseInt(e.substr(t+4,2),16),s=parseInt(e.substr(t+7,2),16);r+=String.fromCharCode((15&o)<<12|(63&i)<<6|63&s)}else r+=e.substr(t,9);t+=9}else r+=e.substr(t,3),t+=3}return r}function V(e,r){function t(e){var t=H(e);return t.match(r.UNRESERVED)?t:e}return e.scheme&&(e.scheme=String(e.scheme).replace(r.PCT_ENCODED,t).toLowerCase().replace(r.NOT_SCHEME,"")),void 0!==e.userinfo&&(e.userinfo=String(e.userinfo).replace(r.PCT_ENCODED,t).replace(r.NOT_USERINFO,z).replace(r.PCT_ENCODED,o)),void 0!==e.host&&(e.host=String(e.host).replace(r.PCT_ENCODED,t).toLowerCase().replace(r.NOT_HOST,z).replace(r.PCT_ENCODED,o)),void 0!==e.path&&(e.path=String(e.path).replace(r.PCT_ENCODED,t).replace(e.scheme?r.NOT_PATH:r.NOT_PATH_NOSCHEME,z).replace(r.PCT_ENCODED,o)),void 0!==e.query&&(e.query=String(e.query).replace(r.PCT_ENCODED,t).replace(r.NOT_QUERY,z).replace(r.PCT_ENCODED,o)),void 0!==e.fragment&&(e.fragment=String(e.fragment).replace(r.PCT_ENCODED,t).replace(r.NOT_FRAGMENT,z).replace(r.PCT_ENCODED,o)),e}function M(e){return e.replace(/^0*(.*)/,"$1")||"0"}function K(e,r){var t=e.match(r.IPV4ADDRESS)||[],n=l(t,2)[1];return n?n.split(".").map(M).join("."):e}function Z(e,r){var t=e.match(r.IPV6ADDRESS)||[],n=l(t,3),o=n[1],a=n[2];if(o){for(var i=o.toLowerCase().split("::").reverse(),s=l(i,2),c=s[0],u=s[1],p=u?u.split(":").map(M):[],f=c.split(":").map(M),d=r.IPV4ADDRESS.test(f[f.length-1]),h=d?7:8,v=f.length-h,y=Array(h),m=0;m<h;++m)y[m]=p[m]||f[v+m]||"";d&&(y[h-1]=K(y[h-1],r));var g=y.reduce((function(e,r,t){if(!r||"0"===r){var n=e[e.length-1];n&&n.index+n.length===t?n.length++:e.push({index:t,length:1})}return e}),[]).sort((function(e,r){return r.length-e.length}))[0],b=void 0;if(g&&g.length>1){var w=y.slice(0,g.index),E=y.slice(g.index+g.length);b=w.join(":")+"::"+E.join(":")}else b=y.join(":");return a&&(b+="%"+a),b}return e}var J=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,B=void 0==="".match(/(){0}/)[1];function G(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t={},n=!1!==r.iri?u:c;"suffix"===r.reference&&(e=(r.scheme?r.scheme+":":"")+"//"+e);var o=e.match(J);if(o){B?(t.scheme=o[1],t.userinfo=o[3],t.host=o[4],t.port=parseInt(o[5],10),t.path=o[6]||"",t.query=o[7],t.fragment=o[8],isNaN(t.port)&&(t.port=o[5])):(t.scheme=o[1]||void 0,t.userinfo=-1!==e.indexOf("@")?o[3]:void 0,t.host=-1!==e.indexOf("//")?o[4]:void 0,t.port=parseInt(o[5],10),t.path=o[6]||"",t.query=-1!==e.indexOf("?")?o[7]:void 0,t.fragment=-1!==e.indexOf("#")?o[8]:void 0,isNaN(t.port)&&(t.port=e.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?o[4]:void 0)),t.host&&(t.host=Z(K(t.host,n),n)),void 0!==t.scheme||void 0!==t.userinfo||void 0!==t.host||void 0!==t.port||t.path||void 0!==t.query?void 0===t.scheme?t.reference="relative":void 0===t.fragment?t.reference="absolute":t.reference="uri":t.reference="same-document",r.reference&&"suffix"!==r.reference&&r.reference!==t.reference&&(t.error=t.error||"URI is not a "+r.reference+" reference.");var a=L[(r.scheme||t.scheme||"").toLowerCase()];if(r.unicodeSupport||a&&a.unicodeSupport)V(t,n);else{if(t.host&&(r.domainHost||a&&a.domainHost))try{t.host=q.toASCII(t.host.replace(n.PCT_ENCODED,H).toLowerCase())}catch(e){t.error=t.error||"Host's domain name can not be converted to ASCII via punycode: "+e}V(t,c)}a&&a.parse&&a.parse(t,r)}else t.error=t.error||"URI can not be parsed.";return t}function W(e,r){var t=!1!==r.iri?u:c,n=[];return void 0!==e.userinfo&&(n.push(e.userinfo),n.push("@")),void 0!==e.host&&n.push(Z(K(String(e.host),t),t).replace(t.IPV6ADDRESS,(function(e,r,t){return"["+r+(t?"%25"+t:"")+"]"}))),"number"!=typeof e.port&&"string"!=typeof e.port||(n.push(":"),n.push(String(e.port))),n.length?n.join(""):void 0}var Q=/^\.\.?\//,Y=/^\/\.(\/|$)/,X=/^\/\.\.(\/|$)/,ee=/^\/?(?:.|\n)*?(?=\/|$)/;function re(e){for(var r=[];e.length;)if(e.match(Q))e=e.replace(Q,"");else if(e.match(Y))e=e.replace(Y,"/");else if(e.match(X))e=e.replace(X,"/"),r.pop();else if("."===e||".."===e)e="";else{var t=e.match(ee);if(!t)throw new Error("Unexpected dot segment condition");var n=t[0];e=e.slice(n.length),r.push(n)}return r.join("")}function te(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=r.iri?u:c,n=[],o=L[(r.scheme||e.scheme||"").toLowerCase()];if(o&&o.serialize&&o.serialize(e,r),e.host)if(t.IPV6ADDRESS.test(e.host));else if(r.domainHost||o&&o.domainHost)try{e.host=r.iri?q.toUnicode(e.host):q.toASCII(e.host.replace(t.PCT_ENCODED,H).toLowerCase())}catch(t){e.error=e.error||"Host's domain name can not be converted to "+(r.iri?"Unicode":"ASCII")+" via punycode: "+t}V(e,t),"suffix"!==r.reference&&e.scheme&&(n.push(e.scheme),n.push(":"));var a=W(e,r);if(void 0!==a&&("suffix"!==r.reference&&n.push("//"),n.push(a),e.path&&"/"!==e.path.charAt(0)&&n.push("/")),void 0!==e.path){var i=e.path;r.absolutePath||o&&o.absolutePath||(i=re(i)),void 0===a&&(i=i.replace(/^\/\//,"/%2F")),n.push(i)}return void 0!==e.query&&(n.push("?"),n.push(e.query)),void 0!==e.fragment&&(n.push("#"),n.push(e.fragment)),n.join("")}function ne(e,r){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n={};return arguments[3]||(e=G(te(e,t),t),r=G(te(r,t),t)),!(t=t||{}).tolerant&&r.scheme?(n.scheme=r.scheme,n.userinfo=r.userinfo,n.host=r.host,n.port=r.port,n.path=re(r.path||""),n.query=r.query):(void 0!==r.userinfo||void 0!==r.host||void 0!==r.port?(n.userinfo=r.userinfo,n.host=r.host,n.port=r.port,n.path=re(r.path||""),n.query=r.query):(r.path?("/"===r.path.charAt(0)?n.path=re(r.path):(void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?n.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+r.path:n.path=r.path:n.path="/"+r.path,n.path=re(n.path)),n.query=r.query):(n.path=e.path,void 0!==r.query?n.query=r.query:n.query=e.query),n.userinfo=e.userinfo,n.host=e.host,n.port=e.port),n.scheme=e.scheme),n.fragment=r.fragment,n}function oe(e,r,t){var n=i({scheme:"null"},t);return te(ne(G(e,n),G(r,n),n,!0),n)}function ae(e,r){return"string"==typeof e?e=te(G(e,r),r):"object"===n(e)&&(e=G(te(e,r),r)),e}function ie(e,r,t){return"string"==typeof e?e=te(G(e,t),t):"object"===n(e)&&(e=te(e,t)),"string"==typeof r?r=te(G(r,t),t):"object"===n(r)&&(r=te(r,t)),e===r}function se(e,r){return e&&e.toString().replace(r&&r.iri?u.ESCAPE:c.ESCAPE,z)}function ce(e,r){return e&&e.toString().replace(r&&r.iri?u.PCT_ENCODED:c.PCT_ENCODED,H)}var ue={scheme:"http",domainHost:!0,parse:function(e,r){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e},serialize:function(e,r){var t="https"===String(e.scheme).toLowerCase();return e.port!==(t?443:80)&&""!==e.port||(e.port=void 0),e.path||(e.path="/"),e}},le={scheme:"https",domainHost:ue.domainHost,parse:ue.parse,serialize:ue.serialize};function pe(e){return"boolean"==typeof e.secure?e.secure:"wss"===String(e.scheme).toLowerCase()}var fe={scheme:"ws",domainHost:!0,parse:function(e,r){var t=e;return t.secure=pe(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t},serialize:function(e,r){if(e.port!==(pe(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 t=e.resourceName.split("?"),n=l(t,2),o=n[0],a=n[1];e.path=o&&"/"!==o?o:void 0,e.query=a,e.resourceName=void 0}return e.fragment=void 0,e}},de={scheme:"wss",domainHost:fe.domainHost,parse:fe.parse,serialize:fe.serialize},he={},ve="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",ye="[0-9A-Fa-f]",me=t(t("%[EFef]"+ye+"%"+ye+ye+"%"+ye+ye)+"|"+t("%[89A-Fa-f]"+ye+"%"+ye+ye)+"|"+t("%"+ye+ye)),ge="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]",be=r("[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",'[\\"\\\\]'),we="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]",Ee=new RegExp(ve,"g"),Se=new RegExp(me,"g"),Ce=new RegExp(r("[^]",ge,"[\\.]",'[\\"]',be),"g"),Oe=new RegExp(r("[^]",ve,we),"g"),Ae=Oe;function Ie(e){var r=H(e);return r.match(Ee)?r:e}var Te={scheme:"mailto",parse:function(e,r){var t=e,n=t.to=t.path?t.path.split(","):[];if(t.path=void 0,t.query){for(var o=!1,a={},i=t.query.split("&"),s=0,c=i.length;s<c;++s){var u=i[s].split("=");switch(u[0]){case"to":for(var l=u[1].split(","),p=0,f=l.length;p<f;++p)n.push(l[p]);break;case"subject":t.subject=ce(u[1],r);break;case"body":t.body=ce(u[1],r);break;default:o=!0,a[ce(u[0],r)]=ce(u[1],r)}}o&&(t.headers=a)}t.query=void 0;for(var d=0,h=n.length;d<h;++d){var v=n[d].split("@");if(v[0]=ce(v[0]),r.unicodeSupport)v[1]=ce(v[1],r).toLowerCase();else try{v[1]=q.toASCII(ce(v[1],r).toLowerCase())}catch(e){t.error=t.error||"Email address's domain name can not be converted to ASCII via punycode: "+e}n[d]=v.join("@")}return t},serialize:function(e,r){var t=e,n=a(e.to);if(n){for(var i=0,s=n.length;i<s;++i){var c=String(n[i]),u=c.lastIndexOf("@"),l=c.slice(0,u).replace(Se,Ie).replace(Se,o).replace(Ce,z),p=c.slice(u+1);try{p=r.iri?q.toUnicode(p):q.toASCII(ce(p,r).toLowerCase())}catch(e){t.error=t.error||"Email address's domain name can not be converted to "+(r.iri?"Unicode":"ASCII")+" via punycode: "+e}n[i]=l+"@"+p}t.path=n.join(",")}var f=e.headers=e.headers||{};e.subject&&(f.subject=e.subject),e.body&&(f.body=e.body);var d=[];for(var h in f)f[h]!==he[h]&&d.push(h.replace(Se,Ie).replace(Se,o).replace(Oe,z)+"="+f[h].replace(Se,Ie).replace(Se,o).replace(Ae,z));return d.length&&(t.query=d.join("&")),t}},je=/^([^\:]+)\:(.*)/,xe={scheme:"urn",parse:function(e,r){var t=e.path&&e.path.match(je),n=e;if(t){var o=r.scheme||n.scheme||"urn",a=t[1].toLowerCase(),i=t[2],s=o+":"+(r.nid||a),c=L[s];n.nid=a,n.nss=i,n.path=void 0,c&&(n=c.parse(n,r))}else n.error=n.error||"URN can not be parsed.";return n},serialize:function(e,r){var t=r.scheme||e.scheme||"urn",n=e.nid,o=t+":"+(r.nid||n),a=L[o];a&&(e=a.serialize(e,r));var i=e,s=e.nss;return i.path=(n||r.nid)+":"+s,i}},Pe=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/,$e={scheme:"urn:uuid",parse:function(e,r){var t=e;return t.uuid=t.nss,t.nss=void 0,r.tolerant||t.uuid&&t.uuid.match(Pe)||(t.error=t.error||"UUID is not valid."),t},serialize:function(e,r){var t=e;return t.nss=(e.uuid||"").toLowerCase(),t}};L[ue.scheme]=ue,L[le.scheme]=le,L[fe.scheme]=fe,L[de.scheme]=de,L[Te.scheme]=Te,L[xe.scheme]=xe,L[$e.scheme]=$e,e.SCHEMES=L,e.pctEncChar=z,e.pctDecChars=H,e.parse=G,e.removeDotSegments=re,e.serialize=te,e.resolveComponents=ne,e.resolve=oe,e.normalize=ae,e.equal=ie,e.escapeComponent=se,e.unescapeComponent=ce,Object.defineProperty(e,"__esModule",{value:!0})}(r)}));(a=i)&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")&&a.default;const s={null:e=>null===e,boolean:e=>"boolean"==typeof e,object:e=>"object"==typeof e&&!Array.isArray(e)&&null!==e,array:e=>Array.isArray(e),number:e=>"number"==typeof e,integer:e=>Number.isInteger(e),string:e=>"string"==typeof e};var c={jsonTypeOf:(e,r)=>s[r](e),resolveUrl:(e,r)=>{const t=i.resolve(e,r,{iri:!0});if(i.resolve(e,"",{iri:!0})&&"file"===i.parse(t).scheme&&"file"!==i.parse(e).scheme)throw Error(`Can't access file '${t}' resource from network context '${e}'`);return t},urlFragment:e=>i.unescapeComponent(i.parse(e).fragment)||"",pathRelative:(e,r)=>{if(e===r)return"";let t=1;const n=e.length-1,o=r.length-t,a=n<o?n:o;let i=-1,s=0;for(;s<a;s++){const n=e.charCodeAt(s+1);if(n!==r.charCodeAt(t+s))break;47===n&&(i=s)}if(o>a){if(47===r.charCodeAt(t+s))return r.slice(t+s+1);if(0===s)return r.slice(t+s)}n>a&&(47===e.charCodeAt(s+1)?i=s:0===a&&(i=0));let c="";for(s=i+2;s<=e.length;++s)s!==e.length&&47!==e.charCodeAt(s)||(c+=0===c.length?"..":"/..");return t+=i,c.length>0?`${c}${r.slice(t,r.length)}`:(47===r.charCodeAt(t)&&++t,r.slice(t,r.length))}};const u=e=>{if(e.length>0&&"/"!==e[0])throw Error("Invalid JSON Pointer");return e.split("/").slice(1).map(y)},l=(e,r,t,n)=>{if(0===e.length)return t;if(e.length>1){const o=e.shift();return{...r,[o]:l(e,g(r,o,n),t,h(o,n))}}if(Array.isArray(r)){const n=[...r];return n[m(r,e[0])]=t,n}return"object"==typeof r&&null!==r?{...r,[e[0]]:t}:g(r,e[0],n)},p=(e,r,t,n)=>{if(0!==e.length)if(1!==e.length||b(r)){const o=e.shift();p(e,g(r,o,n),t,h(o,n))}else{r[m(r,e[0])]=t}},f=(e,r,t)=>{if(0!=e.length){if(e.length>1){const n=e.shift(),o=g(r,n,t);return{...r,[n]:f(e,o,h(n,t))}}if(Array.isArray(r))return r.filter(((r,t)=>t!=e[0]));if("object"==typeof r&&null!==r){const{[e[0]]:t,...n}=r;return n}return g(r,e[0],t)}},d=(e,r,t)=>{if(0!==e.length)if(e.length>1){const n=e.shift(),o=g(r,n,t);d(e,o,h(n,t))}else Array.isArray(r)?r.splice(e[0],1):"object"==typeof r&&null!==r?delete r[e[0]]:g(r,e[0],t)},h=r(((e,r)=>r+"/"+v(e))),v=e=>e.toString().replace(/~/g,"~0").replace(/\//g,"~1"),y=e=>e.toString().replace(/~1/g,"/").replace(/~0/g,"~"),m=(e,r)=>Array.isArray(e)&&"-"===r?e.length:r,g=(e,r,t="")=>{if(void 0===e)throw TypeError(`Value at '${t}' is undefined and does not have property '${r}'`);if(null===e)throw TypeError(`Value at '${t}' is null and does not have property '${r}'`);if(b(e))throw TypeError(`Value at '${t}' is a ${typeof e} and does not have property '${r}'`);return e[m(e,r)]},b=e=>null===e||"object"!=typeof e;var w={nil:"",append:h,get:(e,r)=>{const t=u(e),n=e=>t.reduce((([e,r],t)=>[g(e,t,r),h(t,r)]),[e,""])[0];return void 0===r?n:n(r)},set:(e,t,n)=>{const o=u(e),a=r(((e,r)=>l(o,e,r,"")));return void 0===t?a:a(t,n)},assign:(e,t,n)=>{const o=u(e),a=r(((e,r)=>p(o,e,r,"")));return void 0===t?a:a(t,n)},unset:(e,r)=>{const t=u(e),n=e=>f(t,e,"");return void 0===r?n:n(r)},remove:(e,r)=>{const t=u(e),n=e=>d(t,e,"");return void 0===r?n:n(r)}};w.nil,w.append,w.get,w.set,w.assign,w.unset,w.remove;const E=Symbol("$__value"),S=Symbol("$__href");var C={cons:(e,r)=>Object.freeze({[S]:e,[E]:r}),isReference:e=>e&&void 0!==e[S],href:e=>e[S],value:e=>e[E]};const{resolveUrl:O,jsonTypeOf:A}=c,I=Object.freeze({id:"",pointer:"",instance:void 0,value:void 0}),T=e=>C.isReference(e.value)?C.value(e.value):e.value,j=r(((e,r)=>A(T(e),r))),x=(e,r)=>Object.freeze({...r,pointer:w.append(e,r.pointer),value:T(r)[e]}),P=r(((e,r)=>T(r).map(((t,n,o,a)=>e(x(n,r),n,o,a))))),$=r(((e,r)=>T(r).map(((e,t,n,o)=>x(t,r))).filter(((r,t,n,o)=>e(r,t,n,o))))),D=r(((e,r,t)=>T(t).reduce(((r,n,o)=>e(r,x(o,t),o)),r))),R=r(((e,r)=>T(r).every(((t,n,o,a)=>e(x(n,r),n,o,a))))),N=r(((e,r)=>T(r).some(((t,n,o,a)=>e(x(n,r),n,o,a)))));var _={nil:I,cons:(e,r="")=>Object.freeze({...I,id:O(r,""),instance:e,value:e}),uri:e=>`${e.id}#${encodeURI(e.pointer)}`,value:T,has:(e,r)=>e in T(r),typeOf:j,step:x,entries:e=>Object.keys(T(e)).map((r=>[r,x(r,e)])),keys:e=>Object.keys(T(e)),map:P,filter:$,reduce:D,every:R,some:N,length:e=>T(e).length},F=async e=>Object.entries(await e),k=r((async(e,r)=>(await r).map(e))),U=r((async(e,r,t)=>(await t).reduce((async(r,t)=>e(await r,t)),r))),q=r((async(e,r,t={})=>U((async(r,t)=>await e(t)?r.concat([t]):r),[],r,t))),L=r((async(e,r)=>{const t=await k(e,r);return(await Promise.all(t)).some((e=>e))})),z=r((async(e,r)=>{const t=await k(e,r);return(await Promise.all(t)).every((e=>e))})),H=r(((e,r)=>e.reduce((async(e,r)=>r(await e)),r))),V={entries:F,map:k,filter:q,reduce:U,some:L,every:z,pipeline:H,all:e=>Promise.all(e),allValues:e=>H([F,U((async(e,[r,t])=>(e[r]=await t,e)),{})],e)};V.entries,V.map,V.filter,V.reduce,V.some,V.every,V.pipeline,V.all,V.allValues;var M=fetch,K=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,Z=/^[\u000b\u0020-\u007e\u0080-\u00ff]+$/,J=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,B=/\\([\u000b\u0020-\u00ff])/g,G=/([\\"])/g,W=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,Q=function(e){if(!e)throw new TypeError("argument string is required");var r="object"==typeof e?function(e){var r;"function"==typeof e.getHeader?r=e.getHeader("content-type"):"object"==typeof e.headers&&(r=e.headers&&e.headers["content-type"]);if("string"!=typeof r)throw new TypeError("content-type header is missing from object");return r}(e):e;if("string"!=typeof r)throw new TypeError("argument string is required to be a string");var t=r.indexOf(";"),n=-1!==t?r.substr(0,t).trim():r.trim();if(!W.test(n))throw new TypeError("invalid media type");var o=new X(n.toLowerCase());if(-1!==t){var a,i,s;for(K.lastIndex=t;i=K.exec(r);){if(i.index!==t)throw new TypeError("invalid parameter format");t+=i[0].length,a=i[1].toLowerCase(),'"'===(s=i[2])[0]&&(s=s.substr(1,s.length-2).replace(B,"$1")),o.parameters[a]=s}if(t!==r.length)throw new TypeError("invalid parameter format")}return o}; | ||
/*! | ||
* content-type | ||
* Copyright(c) 2015 Douglas Christopher Wilson | ||
* MIT Licensed | ||
*/function Y(e){var r=String(e);if(J.test(r))return r;if(r.length>0&&!Z.test(r))throw new TypeError("invalid parameter value");return'"'+r.replace(G,"\\$1")+'"'}function X(e){this.parameters=Object.create(null),this.type=e}var ee={format:function(e){if(!e||"object"!=typeof e)throw new TypeError("argument obj is required");var r=e.parameters,t=e.type;if(!t||!W.test(t))throw new TypeError("invalid type");var n=t;if(r&&"object"==typeof r)for(var o,a=Object.keys(r).sort(),i=0;i<a.length;i++){if(o=a[i],!J.test(o))throw new TypeError("invalid parameter name");n+="; "+o+"="+Y(r[o])}return n},parse:Q};const re={};var te={addPlugin:(e,r)=>{re[e]=r},parse:e=>{const r=ee.parse(e.headers.get("content-type")).type;if(!(r in re))throw Error(`${e.url} is not a schema. Found a document with media type: ${r}`);return re[r].parse(e)},getContentType:e=>{for(const r in re)if(re[r].matcher(e))return r;return"application/octet-stream"}};const{jsonTypeOf:ne,resolveUrl:oe,urlFragment:ae,pathRelative:ie}=c,se="https://json-schema.org/draft/2019-09/vocab/core",ce="https://json-schema.org/draft/2020-12/vocab/core",ue={},le={},pe=(e,r)=>{const t=le[e];return ue[t]?.[r]},fe={},de={},he=(e,r="",t="")=>{e=JSON.parse(JSON.stringify(e));const n=oe(r,""),o=oe(e.$schema||t,"");if(!o)throw Error("Couldn't determine schema dialect");if(delete e.$schema,!(o in le))if(!0===e?.$vocabulary?.[se]&&o===ve(e,n,se)[0])le[o]=se;else if(!0===e?.$vocabulary?.[ce]&&o===ve(e,n,ce)[0])le[o]=ce;else if(o===ve(e,n,o)[0])le[o]=o;else{if(!(o in fe))throw Error(`Couldn't determine JSON Schema version for dialect: '${o}'`);{const e=fe[o];!0===e.vocabulary[se]?le[o]=se:!0===e.vocabulary[ce]?le[o]=ce:le[o]=le[e.dialectId]}}const[a,i]=ve(e,n,le[o]);if(!a)throw Error("Couldn't determine an identifier for the schema");const s=pe(o,"baseToken");delete e[s],n&&(de[n]=a);const c=pe(o,"anchorToken");i&&s===c&&(e[c]=c!==s?encodeURI(i):`#${encodeURI(i)}`);const u={},l=pe(o,"recursiveAnchorToken");let p;!0===e[l]&&(u[""]=`${a}#`,e[c]="",delete e[l]);const f=pe(o,"vocabularyToken");ne(e[f],"object")?(p=e[f],delete e[f]):p={[le[o]]:!0};const d={"":""};return fe[a]={id:a,dialectId:o,schema:ye(e,a,o,w.nil,d,u),anchors:d,dynamicAnchors:u,vocabulary:p,validated:!1},a},ve=(e,r,t)=>{const n=ue[t]?.baseToken,o=oe(r,e[n]||"");return[oe(o,""),ae(o)]},ye=(e,r,t,n,o,a)=>{if(ne(e,"object")){const i="string"==typeof e.$schema?oe(e.$schema,""):t,s=pe(i,"embeddedToken"),c=pe(i,"anchorToken");if("string"==typeof e[s]&&(s!==c||"#"!==e[s][0])){const n=oe(r,e[s]);return e[pe(i,"baseToken")]=n,he(e,n,t),C.cons(e[s],e)}const u=pe(t,"anchorToken"),l=pe(t,"dynamicAnchorToken");"string"==typeof e[l]&&(a[e[l]]=`${r}#${encodeURI(n)}`,o[e[l]]=n,delete e[l]);const p=pe(t,"embeddedToken");if("string"==typeof e[u]){const r=u!==p?e[u]:e[u].slice(1);o[r]=n,delete e[u]}const f=pe(t,"jrefToken");if("string"==typeof e[f])return C.cons(e[f],e);for(const i in e)e[i]=ye(e[i],r,t,w.append(i,n),o,a);return e}return Array.isArray(e)?e.map(((e,i)=>ye(e,r,t,w.append(i,n),o,a))):e},me=e=>fe[de[e]]||fe[e],ge=Object.freeze({id:"",dialectId:void 0,vocabulary:{},pointer:w.nil,schema:void 0,value:void 0,anchors:{},dynamicAnchors:{},validated:!0}),be=async(e,r=ge)=>{const t=oe(Se(r),e),n=oe(t,""),o=ae(t);if(!(e=>e in fe||e in de)(n)){const e=await M(n,{headers:{Accept:"application/schema+json"}});if(e.status>=400)throw await e.text(),Error(`Failed to retrieve schema with id: ${n}`);he(await te.parse(e),n)}const a=me(n),i="/"!==o[0]?Ee(a,o):o,s=Object.freeze({...a,pointer:i,value:w.get(i,a.schema)});return we(s)},we=e=>C.isReference(e.value)?be(C.href(e.value),e):e,Ee=(e,r)=>{if(!(r in e.anchors))throw Error(`No such anchor '${encodeURI(e.id)}#${encodeURI(r)}'`);return e.anchors[r]},Se=e=>`${e.id}#${encodeURI(e.pointer)}`,Ce=e=>C.isReference(e.value)?C.value(e.value):e.value,Oe=(e,r)=>{const t=me(r.id),n=Object.freeze({...r,pointer:w.append(e,r.pointer),value:Ce(r)[e],validated:t.validated});return we(n)},Ae=r(((e,r)=>V.pipeline([Ce,V.map((async(t,n)=>e(await Oe(n,r),n))),V.all],r))),Ie={parentId:"",parentDialect:"",includeEmbedded:!0},Te=(e,r)=>{if(r.startsWith("file://")){const t=e.slice(7,e.lastIndexOf("/"));return""===e?"":ie(t,r.slice(7))}return r};var je={setConfig:(e,r,t)=>{ue[e]||(ue[e]={}),ue[e][r]=t},getConfig:pe,add:he,get:be,markValidated:e=>{fe[e].validated=!0},uri:Se,value:Ce,getAnchorPointer:Ee,typeOf:(e,r)=>ne(Ce(e),r),has:(e,r)=>e in Ce(r),step:Oe,keys:e=>Object.keys(Ce(e)),entries:e=>V.pipeline([Ce,Object.keys,V.map((async r=>[r,await Oe(r,e)])),V.all],e),map:Ae,length:e=>Ce(e).length,toSchema:(e,r={})=>{const t={...Ie,...r},n=JSON.parse(JSON.stringify(e.schema,((r,n)=>{if(!C.isReference(n))return n;const o=C.value(n),a="string"==typeof o.$schema?oe(o.$schema,""):e.dialectId,i=pe(a,"embeddedToken");return!t.includeEmbedded&&i in o?void 0:C.value(n)}))),o=pe(e.dialectId,"dynamicAnchorToken");Object.entries(e.dynamicAnchors).forEach((([e,r])=>{const t=ae(r);w.assign(t,n,{[o]:e,...w.get(t,n)})}));const a=pe(e.dialectId,"anchorToken");Object.entries(e.anchors).filter((([e])=>""!==e)).forEach((([e,r])=>{w.assign(r,n,{[a]:e,...w.get(r,n)})}));const i=pe(e.dialectId,"baseToken"),s=Te(t.parentId,e.id),c=t.parentDialect===e.dialectId?"":e.dialectId;return{...s&&{[i]:s},...c&&{$schema:c},...n}}};je.setConfig,je.getConfig,je.add,je.get,je.markValidated,je.uri,je.value,je.getAnchorPointer,je.typeOf,je.has,je.step,je.keys,je.entries,je.map,je.length,je.toSchema;class xe extends Error{constructor(e){super("Invalid Schema"),this.name=this.constructor.name,this.output=e}}var Pe=xe;const{resolveUrl:$e}=c,De="FLAG",Re="BASIC",Ne="DETAILED",_e="VERBOSE";let Fe=Ne,ke=!0;te.addPlugin("application/schema+json",{parse:async e=>await e.json(),matcher:e=>e.endsWith(".schema.json")});const Ue=async e=>{const r={metaData:{}};return{ast:r,schemaUri:await Ze(e,r)}},qe=r((({ast:e,schemaUri:r},t,n=De)=>{if(![De,Re,Ne,_e].includes(n))throw Error(`The '${n}' error format is not supported`);const a=[],i=o.subscribe("result",Le(n,a));return Be(r,t,e,{}),o.unsubscribe(i),a[0]})),Le=(e,r)=>{const t=[];return(n,o)=>{if("result"===n){const{keyword:e,absoluteKeywordLocation:r,instanceLocation:n,valid:a}=o,i={keyword:e,absoluteKeywordLocation:r,instanceLocation:n,valid:a,errors:[]};t.push(i)}else if("result.start"===n)t.push(n);else if("result.end"===n){const n=t.pop();for(;"result.start"!==t[t.length-1];){const r=t.pop(),o=[r];e===Re&&(o.push(...r.errors),delete r.errors),(e===_e||e!==De&&!r.valid)&&n.errors.unshift(...o)}t[t.length-1]=n,r[0]=n}}},ze={},He=e=>ze[e],Ve=e=>e in ze,Me={},Ke={},Ze=async(e,r)=>{if(e=await Je(e),!Ve(`${e.dialectId}#validate`)){const r=await je.get(e.dialectId);(je.getConfig(r.id,"mandatoryVocabularies")||[]).forEach((e=>{if(!r.vocabulary[e])throw Error(`Vocabulary '${e}' must be explicitly declared and required`)})),Object.entries(r.vocabulary).forEach((([e,t])=>{if(e in Me)Object.entries(Me[e]).forEach((([e,t])=>{((e,r)=>{ze[e]={collectEvaluatedItems:(e,t,n,o,a)=>r.interpret(e,t,n,o,a)&&new Set,collectEvaluatedProperties:(e,t,n,o,a)=>r.interpret(e,t,n,o,a)&&[],...r}})(`${r.id}#${e}`,t)}));else if(t)throw Error(`Missing required vocabulary: ${e}`)}))}if(ke&&!e.validated){if(je.markValidated(e.id),!(e.dialectId in Ke)){const r=await je.get(e.dialectId),t=await Ue(r);Ke[r.id]=qe(t)}const r=_.cons(e.schema,e.id),t=Ke[e.dialectId](r,Fe);if(!t.valid)throw new Pe(t)}return e.id in r.metaData||(r.metaData[e.id]={id:e.id,dynamicAnchors:e.dynamicAnchors,anchors:e.anchors}),He(`${e.dialectId}#validate`).compile(e,r)},Je=async e=>je.typeOf(e,"string")?Je(await je.get(je.value(e),e)):e,Be=(e,r,t,n)=>{const o=Ge(e,t),a=$e(e,"");return He(o).interpret(e,r,t,{...t.metaData[a].dynamicAnchors,...n})},Ge=(e,r)=>{if(!(e in r))throw Error(`No schema found at ${e}`);return r[e][0]};var We={validate:async(e,r,t)=>{const n=await Ue(e),o=(e,r)=>qe(n,_.cons(e),r);return void 0===r?o:o(r,t)},compile:Ue,interpret:qe,setMetaOutputFormat:e=>{Fe=e},setShouldMetaValidate:e=>{ke=e},FLAG:De,BASIC:Re,DETAILED:Ne,VERBOSE:_e,add:(e,r="",t="")=>{const n=je.add(e,r,t);delete Ke[n]},getKeyword:He,hasKeyword:Ve,defineVocabulary:(e,r)=>{Me[e]=r},compileSchema:Ze,interpretSchema:Be,collectEvaluatedProperties:(e,r,t,n,o)=>{const a=Ge(e,t);return He(a).collectEvaluatedProperties(e,r,t,n,o)},collectEvaluatedItems:(e,r,t,n,o)=>{const a=Ge(e,t);return He(a).collectEvaluatedItems(e,r,t,n,o)},addMediaTypePlugin:te.addPlugin};var Qe={compile:e=>je.value(e),interpret:()=>!0};var Ye={compile:async(e,r)=>{const t=je.uri(e);if(!(t in r)){r[t]=!1;const n=je.value(e);if(!["object","boolean"].includes(typeof n))throw Error(`No schema found at '${je.uri(e)}'`);r[t]=[`${e.dialectId}#validate`,je.uri(e),"boolean"==typeof n?n:await V.pipeline([je.entries,V.map((([r,t])=>[`${e.dialectId}#${r}`,t])),V.filter((([r])=>We.hasKeyword(r)&&r!==`${e.dialectId}#validate`)),V.map((async([t,n])=>{const o=await We.getKeyword(t).compile(n,r,e);return[t,je.uri(n),o]})),V.all],e)]}return t},interpret:(e,r,t,n)=>{const[a,i,s]=t[e];o.publishSync("result.start");const c="boolean"==typeof s?s:s.every((([e,a,i])=>{o.publishSync("result.start");const s=We.getKeyword(e).interpret(i,r,t,n);return o.publishSync("result",{keyword:e,absoluteKeywordLocation:a,instanceLocation:_.uri(r),valid:s,ast:i}),o.publishSync("result.end"),s}));return o.publishSync("result",{keyword:a,absoluteKeywordLocation:i,instanceLocation:_.uri(r),valid:c,ast:e}),o.publishSync("result.end"),c},collectEvaluatedProperties:(e,r,t,n,o=!1)=>{const a=t[e][2];return"boolean"==typeof a?!!a&&[]:a.filter((([e])=>!o||!e.endsWith("#unevaluatedProperties"))).reduce(((e,[o,,a])=>{const i=e&&We.getKeyword(o).collectEvaluatedProperties(a,r,t,n);return!1!==i&&[...e,...i]}),[])},collectEvaluatedItems:(e,r,t,n,o=!1)=>{const a=t[e][2];return"boolean"==typeof a?!!a&&new Set:a.filter((([e])=>!o||!e.endsWith("#unevaluatedItems"))).reduce(((e,[o,,a])=>{const i=!1!==e&&We.getKeyword(o).collectEvaluatedItems(a,r,t,n);return!1!==i&&new Set([...e,...i])}),new Set)}},Xe={metaData:Qe,validate:Ye},er={Core:We,Schema:je,Instance:_,Reference:C,Keywords:Xe,InvalidSchemaError:Pe},rr=er.Core,tr=er.Schema,nr=er.Instance,or=er.Reference,ar=er.Keywords,ir=er.InvalidSchemaError;e.Core=rr,e.Instance=nr,e.InvalidSchemaError=ir,e.Keywords=ar,e.Reference=or,e.Schema=tr,e.default=er,Object.defineProperty(e,"__esModule",{value:!0})})); | ||
//# sourceMappingURL=json-schema-core-umd.min.js.map |
@@ -19,2 +19,3 @@ import type { Schema, SchemaDocument, SchemaObject, Anchors } from "./schema"; | ||
setShouldMetaValidate: (isEnabled: boolean) => void; | ||
addMediaTypePlugin: (contentType: string, plugin: MediaTypePlugin) => void; | ||
FLAG: "FLAG"; | ||
@@ -68,3 +69,8 @@ BASIC: "BASIC"; | ||
export type MediaTypePlugin = { | ||
parse: (response: Response) => Promise<SchemaDocument>; | ||
matcher: (path: string) => boolean; | ||
}; | ||
declare const core: Core; | ||
export default core; |
@@ -7,2 +7,3 @@ const curry = require("just-curry-it"); | ||
const InvalidSchemaError = require("./invalid-schema-error"); | ||
const MediaTypes = require("./media-types"); | ||
@@ -15,2 +16,7 @@ | ||
MediaTypes.addPlugin("application/schema+json", { | ||
parse: async (response) => await response.json(), | ||
matcher: (path) => path.endsWith(".schema.json") | ||
}); | ||
const validate = async (schema, value = undefined, outputFormat = undefined) => { | ||
@@ -195,3 +201,4 @@ const compiled = await compile(schema); | ||
add, getKeyword, hasKeyword, defineVocabulary, | ||
compileSchema, interpretSchema, collectEvaluatedProperties, collectEvaluatedItems | ||
compileSchema, interpretSchema, collectEvaluatedProperties, collectEvaluatedItems, | ||
addMediaTypePlugin: MediaTypes.addPlugin | ||
}; |
@@ -1,11 +0,16 @@ | ||
const fs = require("fs"); | ||
const fs = require("fs/promises"); | ||
const fetch = require("node-fetch"); | ||
const Url = require("url"); | ||
const MediaTypes = require("./media-types"); | ||
module.exports = (url, options) => { | ||
module.exports = async (url, options) => { | ||
if (url.startsWith("file://")) { | ||
const path = Url.fileURLToPath(url); | ||
const stream = fs.createReadStream(path); | ||
return new fetch.Response(stream); | ||
const filePath = Url.fileURLToPath(url); | ||
const fd = await fs.open(filePath); | ||
const stream = fd.createReadStream(); | ||
return new fetch.Response(stream, { | ||
url: url, | ||
headers: { "Content-Type": MediaTypes.getContentType(filePath) } | ||
}); | ||
} else { | ||
@@ -12,0 +17,0 @@ return fetch(url, options); |
@@ -14,3 +14,2 @@ import type { Core as CoreType } from "./core"; | ||
export * from "./common"; | ||
export * from "./core"; | ||
@@ -17,0 +16,0 @@ export * from "./schema"; |
@@ -1,2 +0,1 @@ | ||
const contentTypeParser = require("content-type"); | ||
const curry = require("just-curry-it"); | ||
@@ -8,2 +7,3 @@ const Pact = require("@hyperjump/pact"); | ||
const Reference = require("./reference"); | ||
const MediaTypes = require("./media-types"); | ||
@@ -200,10 +200,3 @@ | ||
if (response.headers.has("content-type")) { | ||
const contentType = contentTypeParser.parse(response.headers.get("content-type")).type; | ||
if (contentType !== "application/schema+json") { | ||
throw Error(`${id} is not a schema. Found a document with media type: ${contentType}`); | ||
} | ||
} | ||
add(await response.json(), id); | ||
add(await MediaTypes.parse(response), id); | ||
} | ||
@@ -210,0 +203,0 @@ |
{ | ||
"name": "@hyperjump/json-schema-core", | ||
"version": "0.25.1", | ||
"version": "0.26.0", | ||
"description": "A framework for building JSON Schema tools", | ||
@@ -55,3 +55,4 @@ "main": "lib/index.js", | ||
"ts-node": "^10.2.1", | ||
"typescript": "^4.4.3" | ||
"typescript": "^4.4.3", | ||
"yaml": "^2.1.1" | ||
}, | ||
@@ -58,0 +59,0 @@ "dependencies": { |
@@ -196,2 +196,38 @@ # Hyperjump - JSON Schema Core | ||
### Media Type Support | ||
JSC can read schema from the file system or the web, but by default will only | ||
accept these schemas if they have the proper media type. That's `Content-Type: | ||
application/schema+json` for web requests and the `.schema.json` file extension | ||
for files. That behavior can be modified or added to using MediaType plugins. | ||
* **Core.addMediaTypePlugin**: (contentType: string, plugin: MediaTypePlugin) => void | ||
Add a custom media type handler to support things like YAML or to change the | ||
way JSON is supported. | ||
* **MediaTypePlugin**: object | ||
* parse: (response: Response) => string -- Given a fetch Response object, | ||
parse the body of the request | ||
* matcher: (path) => boolean -- Given a filesystem path, return whether or | ||
not the file should be considered a member of this media type | ||
```javascript | ||
Core.addMediaTypePlugin("application/schema+yaml", { | ||
parse: async (response) => Yaml.parse(await response.text()), | ||
matcher: (path) => path.endsWith(".schema.yaml") | ||
}); | ||
// Given the following schema at http://example.com/schemas/foo | ||
// $schema: 'https://json-schema.org/draft/2020-12/schema' | ||
// type: string | ||
const schema = await Schema.get("http://example.com/schemas/string"); | ||
// Given the following schema at /path/to/my/schemas/string.schema.yaml | ||
// $schema: 'https://json-schema.org/draft/2020-12/schema' | ||
// type: string | ||
const schema = await Schema.get("file:///path/to/my/schemas/string.schema.yaml"); | ||
``` | ||
### $schema | ||
@@ -198,0 +234,0 @@ JSC is designed to support multiple drafts of JSON Schema and it makes no |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
3344279
52
18209
790
20