New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@hyperjump/json-schema-core

Package Overview
Dependencies
Maintainers
1
Versions
66
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hyperjump/json-schema-core - npm Package Compare versions

Comparing version 0.23.7 to 0.24.0

4

dist/json-schema-core-amd.min.js

@@ -1,2 +0,4 @@

define(["exports"],(function(e){"use strict";var t=function(e,t){return function r(){null==t&&(t=e.length);var n=[].slice.call(arguments);return n.length>=t?e.apply(this,n):function(){return r.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:{};var n,o,a=(n=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 t={},r=-1,n="*";function o(e){var t;for(t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!0;return!1}function a(e){return function(){throw e}}function i(e,t,r){try{e(t,r)}catch(e){setTimeout(a(e),0)}}function s(e,t,r){e(t,r)}function c(e,r,n,o){var a,c=t[r],l=o?s:i;if(Object.prototype.hasOwnProperty.call(t,r))for(a in c)Object.prototype.hasOwnProperty.call(c,a)&&l(c[a],e,n)}function l(e,t,r){return function(){var o=String(e),a=o.lastIndexOf(".");for(c(e,e,t,r);-1!==a;)a=(o=o.substr(0,a)).lastIndexOf("."),c(e,o,t,r);c(e,n,t,r)}}function u(e){var r=String(e);return Boolean(Object.prototype.hasOwnProperty.call(t,r)&&o(t[r]))}function f(e){for(var t=String(e),r=u(t)||u(n),o=t.lastIndexOf(".");!r&&-1!==o;)o=(t=t.substr(0,o)).lastIndexOf("."),r=u(t);return r}function d(e,t,r,n){var o=l(e="symbol"==typeof e?e.toString():e,t,n);return!!f(e)&&(!0===r?o():setTimeout(o,0),!0)}e.publish=function(t,r){return d(t,r,!1,e.immediateExceptions)},e.publishSync=function(t,r){return d(t,r,!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(t,e)||(t[e]={});var o="uid_"+String(++r);return t[e][o]=n,o},e.subscribeAll=function(t){return e.subscribe(n,t)},e.subscribeOnce=function(t,r){var n=e.subscribe(t,(function(){e.unsubscribe(n),r.apply(this,arguments)}));return e},e.clearAllSubscriptions=function(){t={}},e.clearSubscriptions=function(e){var r;for(r in t)Object.prototype.hasOwnProperty.call(t,r)&&0===r.indexOf(e)&&delete t[r]},e.countSubscriptions=function(e){var r,n,o=0;for(r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&0===r.indexOf(e)){for(n in t[r])o++;break}return o},e.getSubscriptions=function(e){var r,n=[];for(r in t)Object.prototype.hasOwnProperty.call(t,r)&&0===r.indexOf(e)&&n.push(r);return n},e.unsubscribe=function(r){var n,o,a,i=function(e){var r;for(r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&0===r.indexOf(e))return!0;return!1},s="string"==typeof r&&(Object.prototype.hasOwnProperty.call(t,r)||i(r)),c=!s&&"string"==typeof r,l="function"==typeof r,u=!1;if(!s){for(n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(o=t[n],c&&o[r]){delete o[r],u=r;break}if(l)for(a in o)Object.prototype.hasOwnProperty.call(o,a)&&o[a]===r&&(delete o[a],u=!0)}return u}e.clearSubscriptions(r)}}(o)),void 0!==e&&e.exports&&(t=e.exports=o),t.PubSub=o,e.exports=t=o},n(o={exports:{}},o.exports),o.exports);a.PubSub;var i=function(e,t){if(e=e.trim(),(t=t.trim()).startsWith("about:"))return t;const r=function(e){const t={host:"",path:"",query:"",protocol:""};let r=e,n=e.indexOf("//");t.protocol=r.substring(0,n),n+=2;const o=e.indexOf("/",n),a=e.indexOf("?"),i=e.indexOf("#");-1!==i&&(r=r.substring(0,i));if(-1!==a){const e=r.substring(a);t.query=e,r=r.substring(0,a)}if(-1!==o){const e=r.substring(0,o);t.host=e,r=r.substring(o),t.path=r}else t.host=r;return t}(e),n=function(e){const t={href:e,hash:"",query:"",netPath:!1,absolutePath:!1,relativePath:!1};if(l.test(e))return t.netPath=!0,t;"/"===e[0]?t.absolutePath=!0:""!==e&&(t.relativePath=!0);let r=e;const n=e.indexOf("?"),o=e.indexOf("#");if(-1!==o){const e=r.substring(o);t.hash=e,r=r.substring(0,o)}if(-1!==n){const e=r.substring(n);t.query=e,r=r.substring(0,n)}return t.path=r,t}(t);if(!r.protocol&&!n.netPath)throw new Error("Error, protocol is not specified");if(n.netPath)return n.href.startsWith("//")&&(n.href=r.protocol+n.href),function(e){const t=e.indexOf("//")+2,r=!e.includes("/",t),n=!e.includes("?",t),o=!e.includes("#",t);return r&&n&&o}(n.href)?s(n.href):n.href;if(n.absolutePath){const{path:e,query:t,hash:o}=n;return r.host+c(e)+t+o}if(n.relativePath){const{path:e,query:t,hash:o}=n;let a,i=r.path,s=r.host;return 0===e.length?a=i:(i=i.substring(0,i.lastIndexOf("/")),a=c(i+"/"+e)),s+=""!==a||t||o?a+t+o:"/",s}{const{host:e,path:t,query:o}=r;return t||o?e+t+o+n.hash:s(e)}};function s(e){return e+("/"===e[e.length-1]?"":"/")}function c(e){let t=e.split("/");""===t[0]&&(t=t.slice(1));let r=[];return t.forEach(((e,n)=>{"."!==e&&(".."===e?r.pop():""===e&&n!==t.length-1||r.push(e))})),"/"+r.join("/")}const l=new RegExp("^([a-z][a-z0-9+.-]*:)?//","i");const u={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},f=e=>{const t=e.indexOf("#"),r=-1===t?e.length:t,n=e.slice(0,r),o=e.slice(r+1);return[decodeURI(n),decodeURI(o)]},d=e=>{const t=RegExp(/^(.+):\/\//).exec(e);return t?t[1]:""};var p={jsonTypeOf:(e,t)=>u[t](e),splitUrl:f,safeResolveUrl:(e,t)=>{const r=i(e,t),n=f(e)[0];if(n&&"file"===d(r)&&"file"!==d(n))throw Error(`Can't access file '${r}' resource from network context '${e}'`);return r},pathRelative:(e,t)=>{if(e===t)return"";let r=1;const n=e.length-1,o=t.length-r,a=n<o?n:o;let i=-1,s=0;for(;s<a;s++){const n=e.charCodeAt(s+1);if(n!==t.charCodeAt(r+s))break;47===n&&(i=s)}if(o>a){if(47===t.charCodeAt(r+s))return t.slice(r+s+1);if(0===s)return t.slice(r+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 r+=i,c.length>0?`${c}${t.slice(r,t.length)}`:(47===t.charCodeAt(r)&&++r,t.slice(r,t.length))}};const h=e=>{if(e.length>0&&"/"!==e[0])throw Error("Invalid JSON Pointer");return e.split("/").slice(1).map(O)},y=(e,t,r,n)=>{if(0===e.length)return r;if(e.length>1){const o=e.shift();return{...t,[o]:y(e,j(t,o,n),r,g(o,n))}}if(Array.isArray(t)){const n=[...t];return n[E(t,e[0])]=r,n}return"object"==typeof t&&null!==t?{...t,[e[0]]:r}:j(t,e[0],n)},b=(e,t,r,n)=>{if(0!==e.length)if(1!==e.length||$(t)){const o=e.shift();b(e,j(t,o,n),r,g(o,n))}else{t[E(t,e[0])]=r}},m=(e,t,r)=>{if(0!=e.length){if(e.length>1){const n=e.shift(),o=j(t,n,r);return{...t,[n]:m(e,o,g(n,r))}}if(Array.isArray(t))return t.filter(((t,r)=>r!=e[0]));if("object"==typeof t&&null!==t){const{[e[0]]:r,...n}=t;return n}return j(t,e[0],r)}},v=(e,t,r)=>{if(0!==e.length)if(e.length>1){const n=e.shift(),o=j(t,n,r);v(e,o,g(n,r))}else Array.isArray(t)?t.splice(e[0],1):"object"==typeof t&&null!==t?delete t[e[0]]:j(t,e[0],r)},g=t(((e,t)=>t+"/"+w(e))),w=e=>e.toString().replace(/~/g,"~0").replace(/\//g,"~1"),O=e=>e.toString().replace(/~1/g,"/").replace(/~0/g,"~"),E=(e,t)=>Array.isArray(e)&&"-"===t?e.length:t,j=(e,t,r="")=>{if(void 0===e)throw TypeError(`Value at '${r}' is undefined and does not have property '${t}'`);if(null===e)throw TypeError(`Value at '${r}' is null and does not have property '${t}'`);if($(e))throw TypeError(`Value at '${r}' is a ${typeof e} and does not have property '${t}'`);return e[E(e,t)]},$=e=>null===e||"object"!=typeof e;var S={nil:"",append:g,get:(e,t)=>{const r=h(e),n=e=>r.reduce((([e,t],r)=>[j(e,r,t),g(r,t)]),[e,""])[0];return void 0===t?n:n(t)},set:(e,r,n)=>{const o=h(e),a=t(((e,t)=>y(o,e,t,"")));return void 0===r?a:a(r,n)},assign:(e,r,n)=>{const o=h(e),a=t(((e,t)=>b(o,e,t,"")));return void 0===r?a:a(r,n)},unset:(e,t)=>{const r=h(e),n=e=>m(r,e,"");return void 0===t?n:n(t)},remove:(e,t)=>{const r=h(e),n=e=>v(r,e,"");return void 0===t?n:n(t)}};S.nil,S.append,S.get,S.set,S.assign,S.unset,S.remove;const A=Symbol("$__value"),P=Symbol("$__href");var x={cons:(e,t)=>Object.freeze({[P]:e,[A]:t}),isReference:e=>e&&void 0!==e[P],href:e=>e[P],value:e=>e[A]};const{jsonTypeOf:I}=p,T=Object.freeze({id:"",pointer:"",instance:void 0,value:void 0}),k=e=>x.isReference(e.value)?x.value(e.value):e.value,V=t(((e,t)=>I(k(e),t))),R=(e,t)=>Object.freeze({...t,pointer:S.append(e,t.pointer),value:k(t)[e]}),C=t(((e,t)=>k(t).map(((r,n,o,a)=>e(R(n,t),n,o,a))))),U=t(((e,t)=>k(t).map(((e,r,n,o)=>R(r,t))).filter(((t,r,n,o)=>e(t,r,n,o))))),z=t(((e,t,r)=>k(r).reduce(((t,n,o)=>e(t,R(o,r),o)),t))),K=t(((e,t)=>k(t).every(((r,n,o,a)=>e(R(n,t),n,o,a))))),L=t(((e,t)=>k(t).some(((r,n,o,a)=>e(R(n,t),n,o,a)))));var q={nil:T,cons:(e,t="")=>Object.freeze({...T,id:t,instance:e,value:e}),uri:e=>`${e.id}#${encodeURI(e.pointer)}`,value:k,has:(e,t)=>e in k(t),typeOf:V,step:R,entries:e=>Object.keys(k(e)).map((t=>[t,R(t,e)])),keys:e=>Object.keys(k(e)),map:C,filter:U,reduce:z,every:K,some:L,length:e=>k(e).length},_=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,D=/^[\u000b\u0020-\u007e\u0080-\u00ff]+$/,N=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,B=/\\([\u000b\u0020-\u00ff])/g,F=/([\\"])/g,J=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,W=function(e){if(!e)throw new TypeError("argument string is required");var t="object"==typeof e?function(e){var t;"function"==typeof e.getHeader?t=e.getHeader("content-type"):"object"==typeof e.headers&&(t=e.headers&&e.headers["content-type"]);if("string"!=typeof t)throw new TypeError("content-type header is missing from object");return t}(e):e;if("string"!=typeof t)throw new TypeError("argument string is required to be a string");var r=t.indexOf(";"),n=-1!==r?t.substr(0,r).trim():t.trim();if(!J.test(n))throw new TypeError("invalid media type");var o=new M(n.toLowerCase());if(-1!==r){var a,i,s;for(_.lastIndex=r;i=_.exec(t);){if(i.index!==r)throw new TypeError("invalid parameter format");r+=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(r!==t.length)throw new TypeError("invalid parameter format")}return o};function Z(e){var t=String(e);if(N.test(t))return t;if(t.length>0&&!D.test(t))throw new TypeError("invalid parameter value");return'"'+t.replace(F,"\\$1")+'"'}function M(e){this.parameters=Object.create(null),this.type=e}var G={format:function(e){if(!e||"object"!=typeof e)throw new TypeError("argument obj is required");var t=e.parameters,r=e.type;if(!r||!J.test(r))throw new TypeError("invalid type");var n=r;if(t&&"object"==typeof t)for(var o,a=Object.keys(t).sort(),i=0;i<a.length;i++){if(o=a[i],!N.test(o))throw new TypeError("invalid parameter name");n+="; "+o+"="+Z(t[o])}return n},parse:W},H=async e=>Object.entries(await e),Q=t((async(e,t)=>(await t).map(e))),X=t((async(e,t,r)=>(await r).reduce((async(t,r)=>e(await t,r)),t))),Y=t((async(e,t,r={})=>X((async(t,r)=>await e(r)?t.concat([r]):t),[],t,r))),ee=t((async(e,t)=>{const r=await Q(e,t);return(await Promise.all(r)).some((e=>e))})),te=t((async(e,t)=>{const r=await Q(e,t);return(await Promise.all(r)).every((e=>e))})),re=t(((e,t)=>e.reduce((async(e,t)=>t(await e)),t))),ne={entries:H,map:Q,filter:Y,reduce:X,some:ee,every:te,pipeline:re,all:e=>Promise.all(e),allValues:e=>re([H,X((async(e,[t,r])=>(e[t]=await r,e)),{})],e)};ne.entries,ne.map,ne.filter,ne.reduce,ne.some,ne.every,ne.pipeline,ne.all,ne.allValues;var oe=fetch;const{jsonTypeOf:ae,splitUrl:ie,safeResolveUrl:se,pathRelative:ce}=p,le={},ue={},fe=(e,t)=>{const r=e in ue?ue[e]:e;if(r in le)return le[r][t]},de={},pe={},he=(e,t="",r="")=>{e=JSON.parse(JSON.stringify(e));const n=ie(e.$schema||r)[0];if(!n)throw Error("Couldn't determine schema version");delete e.$schema;const o=fe(n,"baseToken"),a=fe(n,"anchorToken"),i=ie(t)[0];if(!i&&!ie(e[o]||"")[0])throw Error("Couldn't determine an identifier for the schema");const s=se(i,e[o]||""),[c,l]=ie(s);delete e[o],l&&o===a&&(e[a]=a!==o?encodeURI(l):`#${encodeURI(l)}`),i&&(pe[i]=c);const u={},f=fe(n,"recursiveAnchorToken");let d;!0===e[f]&&(u[""]=`${c}#`,e[a]="",delete e[f]);const p=fe(n,"vocabularyToken");ae(e[p],"object")?(ue[c]=n,d=e[p],delete e[p]):(ue[c]=n,d={[n]:!0});const h={"":""};return de[c]={id:c,schemaVersion:n,schema:ye(e,c,n,S.nil,h,u),anchors:h,dynamicAnchors:u,vocabulary:d,validated:!1},c},ye=(e,t,r,n,o,a)=>{if(ae(e,"object")){const i="string"==typeof e.$schema?ie(e.$schema)[0]:r,s=fe(i,"embeddedToken"),c=fe(i,"anchorToken");if("string"==typeof e[s]&&(s!==c||"#"!==e[s][0])){const n=se(t,e[s]);return e[s]=n,he(e,n,r),x.cons(e[s],e)}const l=fe(r,"anchorToken"),u=fe(r,"dynamicAnchorToken");"string"==typeof e[u]&&(a[e[u]]=`${t}#${encodeURI(n)}`,o[e[u]]=n,delete e[u]);const f=fe(r,"embeddedToken");if("string"==typeof e[l]){const t=l!==f?e[l]:e[l].slice(1);o[t]=n,delete e[l]}const d=fe(r,"jrefToken");if("string"==typeof e[d])return x.cons(e[d],e);for(const i in e)e[i]=ye(e[i],t,r,S.append(i,n),o,a);return e}return Array.isArray(e)?e.map(((e,i)=>ye(e,t,r,S.append(i,n),o,a))):e},be=e=>de[pe[e]]||de[e],me=Object.freeze({id:"",schemaVersion:void 0,vocabulary:{},pointer:S.nil,schema:void 0,value:void 0,anchors:{},dynamicAnchors:{},validated:!0}),ve=async(e,t=me)=>{const r=se(Oe(t),e),[n,o]=ie(r);if(!(e=>e in de||e in pe)(n)){const e=await oe(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 t=G.parse(e.headers.get("content-type")).type;if("application/schema+json"!==t)throw Error(`${n} is not a schema. Found a document with media type: ${t}`)}he(await e.json(),n)}const a=be(n),i="/"!==o[0]?we(a,o):o,s=Object.freeze({...a,pointer:i,value:S.get(i,a.schema)});return ge(s)},ge=e=>x.isReference(e.value)?ve(x.href(e.value),e):e,we=(e,t)=>{if(!(t in e.anchors))throw Error(`No such anchor '${encodeURI(e.id)}#${encodeURI(t)}'`);return e.anchors[t]},Oe=e=>`${e.id}#${encodeURI(e.pointer)}`,Ee=e=>x.isReference(e.value)?x.value(e.value):e.value,je=(e,t)=>{const r=be(t.id),n=Object.freeze({...t,pointer:S.append(e,t.pointer),value:Ee(t)[e],validated:r.validated});return ge(n)},$e=t(((e,t)=>ne.pipeline([Ee,ne.map((async(r,n)=>e(await je(n,t),n))),ne.all],t))),Se={parentId:"",parentDialect:"",includeEmbedded:!0},Ae=(e,t)=>{if(t.startsWith("file://")){const r=e.slice(7,e.lastIndexOf("/"));return""===e?"":ce(r,t.slice(7))}return t};var Pe={setConfig:(e,t,r)=>{le[e]||(le[e]={}),le[e][t]=r},getConfig:fe,add:he,get:ve,markValidated:e=>{de[e].validated=!0},uri:Oe,value:Ee,getAnchorPointer:we,typeOf:(e,t)=>ae(Ee(e),t),has:(e,t)=>e in Ee(t),step:je,keys:e=>Object.keys(Ee(e)),entries:e=>ne.pipeline([Ee,Object.keys,ne.map((async t=>[t,await je(t,e)])),ne.all],e),map:$e,length:e=>Ee(e).length,toSchema:(e,t={})=>{const r={...Se,...t},n=JSON.parse(JSON.stringify(e.schema,((t,n)=>{if(!x.isReference(n))return n;const o=x.value(n),a=o.$schema||e.schemaVersion,i=fe(a,"embeddedToken");return!r.includeEmbedded&&i in o?void 0:x.value(n)}))),o=fe(e.schemaVersion,"dynamicAnchorToken");Object.entries(e.dynamicAnchors).forEach((([e,t])=>{const r=ie(t)[1];S.assign(r,n,{[o]:e,...S.get(r,n)})}));const a=fe(e.schemaVersion,"anchorToken");Object.entries(e.anchors).filter((([e])=>""!==e)).forEach((([e,t])=>{S.assign(t,n,{[a]:e,...S.get(t,n)})}));const i=fe(e.schemaVersion,"baseToken"),s=Ae(r.parentId,e.id),c=r.parentDialect===e.schemaVersion?"":e.schemaVersion;return{...s&&{[i]:s},...c&&{$schema:c},...n}}};Pe.setConfig,Pe.getConfig,Pe.add,Pe.get,Pe.markValidated,Pe.uri,Pe.value,Pe.getAnchorPointer,Pe.typeOf,Pe.has,Pe.step,Pe.keys,Pe.entries,Pe.map,Pe.length,Pe.toSchema;class xe extends Error{constructor(e){super("Invalid Schema"),this.name=this.constructor.name,this.output=e}}var Ie=xe;const{splitUrl:Te}=p,ke="FLAG",Ve="BASIC",Re="DETAILED",Ce="VERBOSE";let Ue=Re,ze=!0;const Ke=async e=>{const t={metaData:{}};return{ast:t,schemaUri:await Je(e,t)}},Le=t((({ast:e,schemaUri:t},r,n=ke)=>{if(![ke,Ve,Re,Ce].includes(n))throw Error(`The '${n}' error format is not supported`);const o=[],i=a.subscribe("result",qe(n,o));return Ze(t,r,e,{}),a.unsubscribe(i),o[0]})),qe=(e,t)=>{const r=[];return(n,o)=>{if("result"===n){const{keyword:e,absoluteKeywordLocation:t,instanceLocation:n,valid:a}=o,i={keyword:e,absoluteKeywordLocation:t,instanceLocation:n,valid:a,errors:[]};r.push(i)}else if("result.start"===n)r.push(n);else if("result.end"===n){const n=r.pop();for(;"result.start"!==r[r.length-1];){const t=r.pop(),o=[t];e===Ve&&(o.push(...t.errors),delete t.errors),(e===Ce||e!==ke&&!t.valid)&&n.errors.unshift(...o)}r[r.length-1]=n,t[0]=n}}},_e={},De=e=>_e[e],Ne=e=>e in _e,Be={},Fe={},Je=async(e,t)=>{if(e=await We(e),!Ne(`${e.schemaVersion}#validate`)){const t=await Pe.get(e.schemaVersion);(Pe.getConfig(t.id,"mandatoryVocabularies")||[]).forEach((e=>{if(!t.vocabulary[e])throw Error(`Vocabulary '${e}' must be explicitly declared and required`)})),Object.entries(t.vocabulary).forEach((([e,r])=>{if(e in Be)Object.entries(Be[e]).forEach((([e,r])=>{((e,t)=>{_e[e]={collectEvaluatedItems:(e,r,n,o,a)=>t.interpret(e,r,n,o,a)&&new Set,collectEvaluatedProperties:(e,r,n,o,a)=>t.interpret(e,r,n,o,a)&&[],...t}})(`${t.id}#${e}`,r)}));else if(r)throw Error(`Missing required vocabulary: ${e}`)}))}if(ze&&!e.validated){if(Pe.markValidated(e.id),!(e.schemaVersion in Fe)){const t=await Pe.get(e.schemaVersion),r=await Ke(t);Fe[t.id]=Le(r)}const t=q.cons(e.schema,e.id),r=Fe[e.schemaVersion](t,Ue);if(!r.valid)throw new Ie(r)}return e.id in t.metaData||(t.metaData[e.id]={id:e.id,dynamicAnchors:e.dynamicAnchors,anchors:e.anchors}),De(`${e.schemaVersion}#validate`).compile(e,t)},We=async e=>Pe.typeOf(e,"string")?We(await Pe.get(Pe.value(e),e)):e,Ze=(e,t,r,n)=>{const o=Me(e,r),a=Te(e)[0];return De(o).interpret(e,t,r,{...r.metaData[a].dynamicAnchors,...n})},Me=(e,t)=>{if(!(e in t))throw Error(`No schema found at ${e}`);return t[e][0]};var Ge={validate:async(e,t,r)=>{const n=await Ke(e),o=(e,t)=>Le(n,q.cons(e),t);return void 0===t?o:o(t,r)},compile:Ke,interpret:Le,setMetaOutputFormat:e=>{Ue=e},setShouldMetaValidate:e=>{ze=e},FLAG:ke,BASIC:Ve,DETAILED:Re,VERBOSE:Ce,add:(e,t="",r="")=>{const n=Pe.add(e,t,r);delete Fe[n]},getKeyword:De,hasKeyword:Ne,defineVocabulary:(e,t)=>{Be[e]=t},compileSchema:Je,interpretSchema:Ze,collectEvaluatedProperties:(e,t,r,n,o)=>{const a=Me(e,r);return De(a).collectEvaluatedProperties(e,t,r,n,o)},collectEvaluatedItems:(e,t,r,n,o)=>{const a=Me(e,r);return De(a).collectEvaluatedItems(e,t,r,n,o)}};var He={compile:e=>Pe.value(e),interpret:()=>!0};var Qe={compile:async(e,t)=>{const r=Pe.uri(e);if(!(r in t)){t[r]=!1;const n=Pe.value(e);if(!["object","boolean"].includes(typeof n))throw Error(`No schema found at '${Pe.uri(e)}'`);t[r]=[`${e.schemaVersion}#validate`,Pe.uri(e),"boolean"==typeof n?n:await ne.pipeline([Pe.entries,ne.map((([t,r])=>[`${e.schemaVersion}#${t}`,r])),ne.filter((([t])=>Ge.hasKeyword(t)&&t!==`${e.schemaVersion}#validate`)),ne.map((async([r,n])=>{const o=await Ge.getKeyword(r).compile(n,t,e);return[r,Pe.uri(n),o]})),ne.all],e)]}return r},interpret:(e,t,r,n)=>{const[o,i,s]=r[e];a.publishSync("result.start");const c="boolean"==typeof s?s:s.every((([e,o,i])=>{a.publishSync("result.start");const s=Ge.getKeyword(e).interpret(i,t,r,n);return a.publishSync("result",{keyword:e,absoluteKeywordLocation:o,instanceLocation:q.uri(t),valid:s,ast:i}),a.publishSync("result.end"),s}));return a.publishSync("result",{keyword:o,absoluteKeywordLocation:i,instanceLocation:q.uri(t),valid:c,ast:e}),a.publishSync("result.end"),c},collectEvaluatedProperties:(e,t,r,n,o=!1)=>{const a=r[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,t,r,n);return!1!==i&&[...e,...i]}),[])},collectEvaluatedItems:(e,t,r,n,o=!1)=>{const a=r[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,t,r,n);return!1!==i&&new Set([...e,...i])}),new Set)}},Xe={metaData:He,validate:Qe},Ye={Core:Ge,Schema:Pe,Instance:q,Reference:x,Keywords:Xe,InvalidSchemaError:Ie},et=Ye.Core,tt=Ye.Schema,rt=Ye.Instance,nt=Ye.Reference,ot=Ye.Keywords,at=Ye.InvalidSchemaError;e.Core=et,e.Instance=rt,e.InvalidSchemaError=at,e.Keywords=ot,e.Reference=nt,e.Schema=tt,e.default=Ye,Object.defineProperty(e,"__esModule",{value:!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),h=t(a+"{1,4}"),d=t(t(h+"\\:"+h)+"|"+f),v=t(t(h+"\\:")+"{6}"+d),y=t("\\:\\:"+t(h+"\\:")+"{5}"+d),m=t(t(h)+"?\\:\\:"+t(h+"\\:")+"{4}"+d),g=t(t(t(h+"\\:")+"{0,1}"+h)+"?\\:\\:"+t(h+"\\:")+"{3}"+d),b=t(t(t(h+"\\:")+"{0,2}"+h)+"?\\:\\:"+t(h+"\\:")+"{2}"+d),w=t(t(t(h+"\\:")+"{0,3}"+h)+"?\\:\\:"+h+"\\:"+d),E=t(t(t(h+"\\:")+"{0,4}"+h)+"?\\:\\:"+d),S=t(t(t(h+"\\:")+"{0,5}"+h)+"?\\:\\:"+h),C=t(t(t(h+"\\:")+"{0,6}"+h)+"?\\:\\:"),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 j=t(i+"|"+r(l,s,"[\\:\\@]"));return t(t(i+"|"+r(l,s,"[\\@]"))+"+"),t(t(j+"|"+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,h=36,d=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=h-d,j=Math.floor,T=String.fromCharCode;function I(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 D(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 P(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 $=function(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:h},R=function(e,r){return e+22+75*(e<26)-((0!=r)<<5)},N=function(e,r,t){var n=0;for(e=t?j(e/m):e>>1,e+=j(e/r);e>A*v>>1;n+=h)e=j(e/A);return j(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&&I("not-basic"),r.push(e.charCodeAt(s));for(var c=i>0?i+1:0;c<t;){for(var u=n,l=1,p=h;;p+=h){c>=t&&I("invalid-input");var y=$(e.charCodeAt(c++));(y>=h||y>j((f-n)/l))&&I("overflow"),n+=y*l;var m=p<=a?d:p>=a+v?v:p-a;if(y<m)break;var E=h-m;l>j(f/E)&&I("overflow"),l*=E}var S=r.length+1;a=N(n-u,S,0==u),j(n/S)>f-o&&I("overflow"),o+=j(n/S),n%=S,r.splice(n++,0,o)}return String.fromCodePoint.apply(String,r)},F=function(e){var r=[],t=(e=P(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 D=A.value;D>=n&&D<E&&(E=D)}}catch(e){C=!0,O=e}finally{try{!S&&x.return&&x.return()}finally{if(C)throw O}}var $=m+1;E-n>j((f-o)/$)&&I("overflow"),o+=(E-n)*$,n=E;var _=!0,F=!1,V=void 0;try{for(var U,k=e[Symbol.iterator]();!(_=(U=k.next()).done);_=!0){var q=U.value;if(q<n&&++o>f&&I("overflow"),q==n){for(var L=o,z=h;;z+=h){var H=z<=a?d:z>=a+v?v:z-a;if(L<H)break;var K=L-H,M=h-H;r.push(T(R(H+K%M,0))),L=j(K/M)}r.push(T(R(L,0))),a=N(o,$,m==y),o=0,++m}}}catch(e){F=!0,V=e}finally{try{!_&&k.return&&k.return()}finally{if(F)throw V}}++o,++n}return r.join("")},V=function(e){return D(e,(function(e){return E.test(e)?_(e.slice(4).toLowerCase()):e}))},U=function(e){return D(e,(function(e){return S.test(e)?"xn--"+F(e):e}))},k={version:"2.1.0",ucs2:{decode:P,encode:function(e){return String.fromCodePoint.apply(String,p(e))}},decode:_,encode:F,toASCII:U,toUnicode:V},q={};function L(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 z(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 H(e,r){function t(e){var t=z(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,L).replace(r.PCT_ENCODED,o)),void 0!==e.host&&(e.host=String(e.host).replace(r.PCT_ENCODED,t).toLowerCase().replace(r.NOT_HOST,L).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,L).replace(r.PCT_ENCODED,o)),void 0!==e.query&&(e.query=String(e.query).replace(r.PCT_ENCODED,t).replace(r.NOT_QUERY,L).replace(r.PCT_ENCODED,o)),void 0!==e.fragment&&(e.fragment=String(e.fragment).replace(r.PCT_ENCODED,t).replace(r.NOT_FRAGMENT,L).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),h=r.IPV4ADDRESS.test(f[f.length-1]),d=h?7:8,v=f.length-d,y=Array(d),m=0;m<d;++m)y[m]=p[m]||f[v+m]||"";h&&(y[d-1]=M(y[d-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 B=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,J=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(B);if(o){J?(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=q[(r.scheme||t.scheme||"").toLowerCase()];if(r.unicodeSupport||a&&a.unicodeSupport)H(t,n);else{if(t.host&&(r.domainHost||a&&a.domainHost))try{t.host=k.toASCII(t.host.replace(n.PCT_ENCODED,z).toLowerCase())}catch(e){t.error=t.error||"Host's domain name can not be converted to ASCII via punycode: "+e}H(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=q[(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?k.toUnicode(e.host):k.toASCII(e.host.replace(t.PCT_ENCODED,z).toLowerCase())}catch(t){e.error=e.error||"Host's domain name can not be converted to "+(r.iri?"Unicode":"ASCII")+" via punycode: "+t}H(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,L)}function ce(e,r){return e&&e.toString().replace(r&&r.iri?u.PCT_ENCODED:c.PCT_ENCODED,z)}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}},he={scheme:"wss",domainHost:fe.domainHost,parse:fe.parse,serialize:fe.serialize},de={},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 je(e){var r=z(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 h=0,d=n.length;h<d;++h){var v=n[h].split("@");if(v[0]=ce(v[0]),r.unicodeSupport)v[1]=ce(v[1],r).toLowerCase();else try{v[1]=k.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[h]=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,je).replace(Se,o).replace(Ce,L),p=c.slice(u+1);try{p=r.iri?k.toUnicode(p):k.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 h=[];for(var d in f)f[d]!==de[d]&&h.push(d.replace(Se,je).replace(Se,o).replace(Oe,L)+"="+f[d].replace(Se,je).replace(Se,o).replace(Ae,L));return h.length&&(t.query=h.join("&")),t}},Ie=/^([^\:]+)\:(.*)/,xe={scheme:"urn",parse:function(e,r){var t=e.path&&e.path.match(Ie),n=e;if(t){var o=r.scheme||n.scheme||"urn",a=t[1].toLowerCase(),i=t[2],s=o+":"+(r.nid||a),c=q[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=q[o];a&&(e=a.serialize(e,r));var i=e,s=e.nss;return i.path=(n||r.nid)+":"+s,i}},De=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/,Pe={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(De)||(t.error=t.error||"UUID is not valid."),t},serialize:function(e,r){var t=e;return t.nss=(e.uuid||"").toLowerCase(),t}};q[ue.scheme]=ue,q[le.scheme]=le,q[fe.scheme]=fe,q[he.scheme]=he,q[Te.scheme]=Te,q[xe.scheme]=xe,q[Pe.scheme]=Pe,e.SCHEMES=q,e.pctEncChar=L,e.pctDecChars=z,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,d(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,d(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,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 g(r,e[0],t)}},h=(e,r,t)=>{if(0!==e.length)if(e.length>1){const n=e.shift(),o=g(r,n,t);h(e,o,d(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)},d=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:d,get:(e,r)=>{const t=u(e),n=e=>t.reduce((([e,r],t)=>[g(e,t,r),d(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=>h(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,j=Object.freeze({id:"",pointer:"",instance:void 0,value:void 0}),T=e=>C.isReference(e.value)?C.value(e.value):e.value,I=r(((e,r)=>A(T(e),r))),x=(e,r)=>Object.freeze({...r,pointer:w.append(e,r.pointer),value:T(r)[e]}),D=r(((e,r)=>T(r).map(((t,n,o,a)=>e(x(n,r),n,o,a))))),P=r(((e,r)=>T(r).map(((e,t,n,o)=>x(t,r))).filter(((r,t,n,o)=>e(r,t,n,o))))),$=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:j,cons:(e,r="")=>Object.freeze({...j,id:O(r,""),instance:e,value:e}),uri:e=>`${e.id}#${encodeURI(e.pointer)}`,value:T,has:(e,r)=>e in T(r),typeOf:I,step:x,entries:e=>Object.keys(T(e)).map((r=>[r,x(r,e)])),keys:e=>Object.keys(T(e)),map:D,filter:P,reduce:$,every:R,some:N,length:e=>T(e).length},F=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,V=/^[\u000b\u0020-\u007e\u0080-\u00ff]+$/,U=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,k=/\\([\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 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(k,"$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(U.test(r))return r;if(r.length>0&&!V.test(r))throw new TypeError("invalid parameter value");return'"'+r.replace(q,"\\$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||!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],!U.test(o))throw new TypeError("invalid parameter name");n+="; "+o+"="+H(r[o])}return n},parse:z},Z=async e=>Object.entries(await e),B=r((async(e,r)=>(await r).map(e))),J=r((async(e,r,t)=>(await t).reduce((async(r,t)=>e(await r,t)),r))),G=r((async(e,r,t={})=>J((async(r,t)=>await e(t)?r.concat([t]):r),[],r,t))),W=r((async(e,r)=>{const t=await B(e,r);return(await Promise.all(t)).some((e=>e))})),Q=r((async(e,r)=>{const t=await B(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:B,filter:G,reduce:J,some:W,every:Q,pipeline:Y,all:e=>Promise.all(e),allValues:e=>Y([Z,J((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={},ie={},se=(e,r)=>{const t=e in ie?ie[e]:e;if(t in ae)return ae[t][r]},ce={},ue={},le=(e,r="",t="")=>{e=JSON.parse(JSON.stringify(e));const n=te(e.$schema||t,"");if(!n)throw Error("Couldn't determine schema version");delete e.$schema;const o=se(n,"baseToken"),a=se(n,"anchorToken"),i=te(r,"");if(!i&&!te(e[o]||"",""))throw Error("Couldn't determine an identifier for the schema");const s=te(i,e[o]||""),c=te(s,""),u=ne(s);delete e[o],u&&o===a&&(e[a]=a!==o?encodeURI(u):`#${encodeURI(u)}`),i&&(ue[i]=c);const l={},p=se(n,"recursiveAnchorToken");let f;!0===e[p]&&(l[""]=`${c}#`,e[a]="",delete e[p]);const h=se(n,"vocabularyToken");re(e[h],"object")?(ie[c]=n,f=e[h],delete e[h]):(ie[c]=n,f={[n]:!0});const d={"":""};return ce[c]={id:c,schemaVersion:n,schema:pe(e,c,n,w.nil,d,l),anchors:d,dynamicAnchors:l,vocabulary:f,validated:!1},c},pe=(e,r,t,n,o,a)=>{if(re(e,"object")){const i="string"==typeof e.$schema?te(e.$schema,""):t,s=se(i,"embeddedToken"),c=se(i,"anchorToken");if("string"==typeof e[s]&&(s!==c||"#"!==e[s][0])){const n=te(r,e[s]);return e[s]=n,le(e,n,t),C.cons(e[s],e)}const u=se(t,"anchorToken"),l=se(t,"dynamicAnchorToken");"string"==typeof e[l]&&(a[e[l]]=`${r}#${encodeURI(n)}`,o[e[l]]=n,delete e[l]);const p=se(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=se(t,"jrefToken");if("string"==typeof e[f])return C.cons(e[f],e);for(const i in e)e[i]=pe(e[i],r,t,w.append(i,n),o,a);return e}return Array.isArray(e)?e.map(((e,i)=>pe(e,r,t,w.append(i,n),o,a))):e},fe=e=>ce[ue[e]]||ce[e],he=Object.freeze({id:"",schemaVersion:void 0,vocabulary:{},pointer:w.nil,schema:void 0,value:void 0,anchors:{},dynamicAnchors:{},validated:!0}),de=async(e,r=he)=>{const t=te(me(r),e),n=te(t,""),o=ne(t);if(!(e=>e in ce||e in ue)(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}`)}le(await e.json(),n)}const a=fe(n),i="/"!==o[0]?ye(a,o):o,s=Object.freeze({...a,pointer:i,value:w.get(i,a.schema)});return ve(s)},ve=e=>C.isReference(e.value)?de(C.href(e.value),e):e,ye=(e,r)=>{if(!(r in e.anchors))throw Error(`No such anchor '${encodeURI(e.id)}#${encodeURI(r)}'`);return e.anchors[r]},me=e=>`${e.id}#${encodeURI(e.pointer)}`,ge=e=>C.isReference(e.value)?C.value(e.value):e.value,be=(e,r)=>{const t=fe(r.id),n=Object.freeze({...r,pointer:w.append(e,r.pointer),value:ge(r)[e],validated:t.validated});return ve(n)},we=r(((e,r)=>X.pipeline([ge,X.map((async(t,n)=>e(await be(n,r),n))),X.all],r))),Ee={parentId:"",parentDialect:"",includeEmbedded:!0},Se=(e,r)=>{if(r.startsWith("file://")){const t=e.slice(7,e.lastIndexOf("/"));return""===e?"":oe(t,r.slice(7))}return r};var Ce={setConfig:(e,r,t)=>{ae[e]||(ae[e]={}),ae[e][r]=t},getConfig:se,add:le,get:de,markValidated:e=>{ce[e].validated=!0},uri:me,value:ge,getAnchorPointer:ye,typeOf:(e,r)=>re(ge(e),r),has:(e,r)=>e in ge(r),step:be,keys:e=>Object.keys(ge(e)),entries:e=>X.pipeline([ge,Object.keys,X.map((async r=>[r,await be(r,e)])),X.all],e),map:we,length:e=>ge(e).length,toSchema:(e,r={})=>{const t={...Ee,...r},n=JSON.parse(JSON.stringify(e.schema,((r,n)=>{if(!C.isReference(n))return n;const o=C.value(n),a=o.$schema||e.schemaVersion,i=se(a,"embeddedToken");return!t.includeEmbedded&&i in o?void 0:C.value(n)}))),o=se(e.schemaVersion,"dynamicAnchorToken");Object.entries(e.dynamicAnchors).forEach((([e,r])=>{const t=ne(r);w.assign(t,n,{[o]:e,...w.get(t,n)})}));const a=se(e.schemaVersion,"anchorToken");Object.entries(e.anchors).filter((([e])=>""!==e)).forEach((([e,r])=>{w.assign(r,n,{[a]:e,...w.get(r,n)})}));const i=se(e.schemaVersion,"baseToken"),s=Se(t.parentId,e.id),c=t.parentDialect===e.schemaVersion?"":e.schemaVersion;return{...s&&{[i]:s},...c&&{$schema:c},...n}}};Ce.setConfig,Ce.getConfig,Ce.add,Ce.get,Ce.markValidated,Ce.uri,Ce.value,Ce.getAnchorPointer,Ce.typeOf,Ce.has,Ce.step,Ce.keys,Ce.entries,Ce.map,Ce.length,Ce.toSchema;class Oe extends Error{constructor(e){super("Invalid Schema"),this.name=this.constructor.name,this.output=e}}var Ae=Oe;const{resolveUrl:je}=c,Te="FLAG",Ie="BASIC",xe="DETAILED",De="VERBOSE";let Pe=xe,$e=!0;const Re=async e=>{const r={metaData:{}};return{ast:r,schemaUri:await Le(e,r)}},Ne=r((({ast:e,schemaUri:r},t,n=Te)=>{if(![Te,Ie,xe,De].includes(n))throw Error(`The '${n}' error format is not supported`);const a=[],i=o.subscribe("result",_e(n,a));return He(r,t,e,{}),o.unsubscribe(i),a[0]})),_e=(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===Ie&&(o.push(...r.errors),delete r.errors),(e===De||e!==Te&&!r.valid)&&n.errors.unshift(...o)}t[t.length-1]=n,r[0]=n}}},Fe={},Ve=e=>Fe[e],Ue=e=>e in Fe,ke={},qe={},Le=async(e,r)=>{if(e=await ze(e),!Ue(`${e.schemaVersion}#validate`)){const r=await Ce.get(e.schemaVersion);(Ce.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)=>{Fe[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(Ce.markValidated(e.id),!(e.schemaVersion in qe)){const r=await Ce.get(e.schemaVersion),t=await Re(r);qe[r.id]=Ne(t)}const r=_.cons(e.schema,e.id),t=qe[e.schemaVersion](r,Pe);if(!t.valid)throw new Ae(t)}return e.id in r.metaData||(r.metaData[e.id]={id:e.id,dynamicAnchors:e.dynamicAnchors,anchors:e.anchors}),Ve(`${e.schemaVersion}#validate`).compile(e,r)},ze=async e=>Ce.typeOf(e,"string")?ze(await Ce.get(Ce.value(e),e)):e,He=(e,r,t,n)=>{const o=Ke(e,t),a=je(e,"");return Ve(o).interpret(e,r,t,{...t.metaData[a].dynamicAnchors,...n})},Ke=(e,r)=>{if(!(e in r))throw Error(`No schema found at ${e}`);return r[e][0]};var Me={validate:async(e,r,t)=>{const n=await Re(e),o=(e,r)=>Ne(n,_.cons(e),r);return void 0===r?o:o(r,t)},compile:Re,interpret:Ne,setMetaOutputFormat:e=>{Pe=e},setShouldMetaValidate:e=>{$e=e},FLAG:Te,BASIC:Ie,DETAILED:xe,VERBOSE:De,add:(e,r="",t="")=>{const n=Ce.add(e,r,t);delete qe[n]},getKeyword:Ve,hasKeyword:Ue,defineVocabulary:(e,r)=>{ke[e]=r},compileSchema:Le,interpretSchema:He,collectEvaluatedProperties:(e,r,t,n,o)=>{const a=Ke(e,t);return Ve(a).collectEvaluatedProperties(e,r,t,n,o)},collectEvaluatedItems:(e,r,t,n,o)=>{const a=Ke(e,t);return Ve(a).collectEvaluatedItems(e,r,t,n,o)}};var Ze={compile:e=>Ce.value(e),interpret:()=>!0};var Be={compile:async(e,r)=>{const t=Ce.uri(e);if(!(t in r)){r[t]=!1;const n=Ce.value(e);if(!["object","boolean"].includes(typeof n))throw Error(`No schema found at '${Ce.uri(e)}'`);r[t]=[`${e.schemaVersion}#validate`,Ce.uri(e),"boolean"==typeof n?n:await X.pipeline([Ce.entries,X.map((([r,t])=>[`${e.schemaVersion}#${r}`,t])),X.filter((([r])=>Me.hasKeyword(r)&&r!==`${e.schemaVersion}#validate`)),X.map((async([t,n])=>{const o=await Me.getKeyword(t).compile(n,r,e);return[t,Ce.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=Me.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&&Me.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&&Me.getKeyword(o).collectEvaluatedItems(a,r,t,n);return!1!==i&&new Set([...e,...i])}),new Set)}},Je={metaData:Ze,validate:Be},Ge={Core:Me,Schema:Ce,Instance:_,Reference:C,Keywords:Je,InvalidSchemaError:Ae},We=Ge.Core,Qe=Ge.Schema,Ye=Ge.Instance,Xe=Ge.Reference,er=Ge.Keywords,rr=Ge.InvalidSchemaError;e.Core=We,e.Instance=Ye,e.InvalidSchemaError=rr,e.Keywords=er,e.Reference=Xe,e.Schema=Qe,e.default=Ge,Object.defineProperty(e,"__esModule",{value:!0})}));
//# sourceMappingURL=json-schema-core-amd.min.js.map

@@ -1,2 +0,4 @@

"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=function(e,t){return function r(){null==t&&(t=e.length);var n=[].slice.call(arguments);return n.length>=t?e.apply(this,n):function(){return r.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:{};var r,n,o=(r=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 t={},r=-1,n="*";function o(e){var t;for(t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!0;return!1}function a(e){return function(){throw e}}function i(e,t,r){try{e(t,r)}catch(e){setTimeout(a(e),0)}}function s(e,t,r){e(t,r)}function c(e,r,n,o){var a,c=t[r],l=o?s:i;if(Object.prototype.hasOwnProperty.call(t,r))for(a in c)Object.prototype.hasOwnProperty.call(c,a)&&l(c[a],e,n)}function l(e,t,r){return function(){var o=String(e),a=o.lastIndexOf(".");for(c(e,e,t,r);-1!==a;)a=(o=o.substr(0,a)).lastIndexOf("."),c(e,o,t,r);c(e,n,t,r)}}function u(e){var r=String(e);return Boolean(Object.prototype.hasOwnProperty.call(t,r)&&o(t[r]))}function f(e){for(var t=String(e),r=u(t)||u(n),o=t.lastIndexOf(".");!r&&-1!==o;)o=(t=t.substr(0,o)).lastIndexOf("."),r=u(t);return r}function d(e,t,r,n){var o=l(e="symbol"==typeof e?e.toString():e,t,n);return!!f(e)&&(!0===r?o():setTimeout(o,0),!0)}e.publish=function(t,r){return d(t,r,!1,e.immediateExceptions)},e.publishSync=function(t,r){return d(t,r,!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(t,e)||(t[e]={});var o="uid_"+String(++r);return t[e][o]=n,o},e.subscribeAll=function(t){return e.subscribe(n,t)},e.subscribeOnce=function(t,r){var n=e.subscribe(t,(function(){e.unsubscribe(n),r.apply(this,arguments)}));return e},e.clearAllSubscriptions=function(){t={}},e.clearSubscriptions=function(e){var r;for(r in t)Object.prototype.hasOwnProperty.call(t,r)&&0===r.indexOf(e)&&delete t[r]},e.countSubscriptions=function(e){var r,n,o=0;for(r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&0===r.indexOf(e)){for(n in t[r])o++;break}return o},e.getSubscriptions=function(e){var r,n=[];for(r in t)Object.prototype.hasOwnProperty.call(t,r)&&0===r.indexOf(e)&&n.push(r);return n},e.unsubscribe=function(r){var n,o,a,i=function(e){var r;for(r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&0===r.indexOf(e))return!0;return!1},s="string"==typeof r&&(Object.prototype.hasOwnProperty.call(t,r)||i(r)),c=!s&&"string"==typeof r,l="function"==typeof r,u=!1;if(!s){for(n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(o=t[n],c&&o[r]){delete o[r],u=r;break}if(l)for(a in o)Object.prototype.hasOwnProperty.call(o,a)&&o[a]===r&&(delete o[a],u=!0)}return u}e.clearSubscriptions(r)}}(o)),void 0!==e&&e.exports&&(r=e.exports=o),r.PubSub=o,e.exports=r=o},r(n={exports:{}},n.exports),n.exports);o.PubSub;var a=function(e,t){if(e=e.trim(),(t=t.trim()).startsWith("about:"))return t;const r=function(e){const t={host:"",path:"",query:"",protocol:""};let r=e,n=e.indexOf("//");t.protocol=r.substring(0,n),n+=2;const o=e.indexOf("/",n),a=e.indexOf("?"),i=e.indexOf("#");-1!==i&&(r=r.substring(0,i));if(-1!==a){const e=r.substring(a);t.query=e,r=r.substring(0,a)}if(-1!==o){const e=r.substring(0,o);t.host=e,r=r.substring(o),t.path=r}else t.host=r;return t}(e),n=function(e){const t={href:e,hash:"",query:"",netPath:!1,absolutePath:!1,relativePath:!1};if(c.test(e))return t.netPath=!0,t;"/"===e[0]?t.absolutePath=!0:""!==e&&(t.relativePath=!0);let r=e;const n=e.indexOf("?"),o=e.indexOf("#");if(-1!==o){const e=r.substring(o);t.hash=e,r=r.substring(0,o)}if(-1!==n){const e=r.substring(n);t.query=e,r=r.substring(0,n)}return t.path=r,t}(t);if(!r.protocol&&!n.netPath)throw new Error("Error, protocol is not specified");if(n.netPath)return n.href.startsWith("//")&&(n.href=r.protocol+n.href),function(e){const t=e.indexOf("//")+2,r=!e.includes("/",t),n=!e.includes("?",t),o=!e.includes("#",t);return r&&n&&o}(n.href)?i(n.href):n.href;if(n.absolutePath){const{path:e,query:t,hash:o}=n;return r.host+s(e)+t+o}if(n.relativePath){const{path:e,query:t,hash:o}=n;let a,i=r.path,c=r.host;return 0===e.length?a=i:(i=i.substring(0,i.lastIndexOf("/")),a=s(i+"/"+e)),c+=""!==a||t||o?a+t+o:"/",c}{const{host:e,path:t,query:o}=r;return t||o?e+t+o+n.hash:i(e)}};function i(e){return e+("/"===e[e.length-1]?"":"/")}function s(e){let t=e.split("/");""===t[0]&&(t=t.slice(1));let r=[];return t.forEach(((e,n)=>{"."!==e&&(".."===e?r.pop():""===e&&n!==t.length-1||r.push(e))})),"/"+r.join("/")}const c=new RegExp("^([a-z][a-z0-9+.-]*:)?//","i");const l={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},u=e=>{const t=e.indexOf("#"),r=-1===t?e.length:t,n=e.slice(0,r),o=e.slice(r+1);return[decodeURI(n),decodeURI(o)]},f=e=>{const t=RegExp(/^(.+):\/\//).exec(e);return t?t[1]:""};var d={jsonTypeOf:(e,t)=>l[t](e),splitUrl:u,safeResolveUrl:(e,t)=>{const r=a(e,t),n=u(e)[0];if(n&&"file"===f(r)&&"file"!==f(n))throw Error(`Can't access file '${r}' resource from network context '${e}'`);return r},pathRelative:(e,t)=>{if(e===t)return"";let r=1;const n=e.length-1,o=t.length-r,a=n<o?n:o;let i=-1,s=0;for(;s<a;s++){const n=e.charCodeAt(s+1);if(n!==t.charCodeAt(r+s))break;47===n&&(i=s)}if(o>a){if(47===t.charCodeAt(r+s))return t.slice(r+s+1);if(0===s)return t.slice(r+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 r+=i,c.length>0?`${c}${t.slice(r,t.length)}`:(47===t.charCodeAt(r)&&++r,t.slice(r,t.length))}};const p=e=>{if(e.length>0&&"/"!==e[0])throw Error("Invalid JSON Pointer");return e.split("/").slice(1).map(w)},h=(e,t,r,n)=>{if(0===e.length)return r;if(e.length>1){const o=e.shift();return{...t,[o]:h(e,E(t,o,n),r,v(o,n))}}if(Array.isArray(t)){const n=[...t];return n[O(t,e[0])]=r,n}return"object"==typeof t&&null!==t?{...t,[e[0]]:r}:E(t,e[0],n)},y=(e,t,r,n)=>{if(0!==e.length)if(1!==e.length||j(t)){const o=e.shift();y(e,E(t,o,n),r,v(o,n))}else{t[O(t,e[0])]=r}},b=(e,t,r)=>{if(0!=e.length){if(e.length>1){const n=e.shift(),o=E(t,n,r);return{...t,[n]:b(e,o,v(n,r))}}if(Array.isArray(t))return t.filter(((t,r)=>r!=e[0]));if("object"==typeof t&&null!==t){const{[e[0]]:r,...n}=t;return n}return E(t,e[0],r)}},m=(e,t,r)=>{if(0!==e.length)if(e.length>1){const n=e.shift(),o=E(t,n,r);m(e,o,v(n,r))}else Array.isArray(t)?t.splice(e[0],1):"object"==typeof t&&null!==t?delete t[e[0]]:E(t,e[0],r)},v=e(((e,t)=>t+"/"+g(e))),g=e=>e.toString().replace(/~/g,"~0").replace(/\//g,"~1"),w=e=>e.toString().replace(/~1/g,"/").replace(/~0/g,"~"),O=(e,t)=>Array.isArray(e)&&"-"===t?e.length:t,E=(e,t,r="")=>{if(void 0===e)throw TypeError(`Value at '${r}' is undefined and does not have property '${t}'`);if(null===e)throw TypeError(`Value at '${r}' is null and does not have property '${t}'`);if(j(e))throw TypeError(`Value at '${r}' is a ${typeof e} and does not have property '${t}'`);return e[O(e,t)]},j=e=>null===e||"object"!=typeof e;var $={nil:"",append:v,get:(e,t)=>{const r=p(e),n=e=>r.reduce((([e,t],r)=>[E(e,r,t),v(r,t)]),[e,""])[0];return void 0===t?n:n(t)},set:(t,r,n)=>{const o=p(t),a=e(((e,t)=>h(o,e,t,"")));return void 0===r?a:a(r,n)},assign:(t,r,n)=>{const o=p(t),a=e(((e,t)=>y(o,e,t,"")));return void 0===r?a:a(r,n)},unset:(e,t)=>{const r=p(e),n=e=>b(r,e,"");return void 0===t?n:n(t)},remove:(e,t)=>{const r=p(e),n=e=>m(r,e,"");return void 0===t?n:n(t)}};$.nil,$.append,$.get,$.set,$.assign,$.unset,$.remove;const S=Symbol("$__value"),x=Symbol("$__href");var A={cons:(e,t)=>Object.freeze({[x]:e,[S]:t}),isReference:e=>e&&void 0!==e[x],href:e=>e[x],value:e=>e[S]};const{jsonTypeOf:P}=d,I=Object.freeze({id:"",pointer:"",instance:void 0,value:void 0}),T=e=>A.isReference(e.value)?A.value(e.value):e.value,k=e(((e,t)=>P(T(e),t))),V=(e,t)=>Object.freeze({...t,pointer:$.append(e,t.pointer),value:T(t)[e]}),R=e(((e,t)=>T(t).map(((r,n,o,a)=>e(V(n,t),n,o,a))))),C=e(((e,t)=>T(t).map(((e,r,n,o)=>V(r,t))).filter(((t,r,n,o)=>e(t,r,n,o))))),U=e(((e,t,r)=>T(r).reduce(((t,n,o)=>e(t,V(o,r),o)),t))),z=e(((e,t)=>T(t).every(((r,n,o,a)=>e(V(n,t),n,o,a))))),K=e(((e,t)=>T(t).some(((r,n,o,a)=>e(V(n,t),n,o,a)))));var L={nil:I,cons:(e,t="")=>Object.freeze({...I,id:t,instance:e,value:e}),uri:e=>`${e.id}#${encodeURI(e.pointer)}`,value:T,has:(e,t)=>e in T(t),typeOf:k,step:V,entries:e=>Object.keys(T(e)).map((t=>[t,V(t,e)])),keys:e=>Object.keys(T(e)),map:R,filter:C,reduce:U,every:z,some:K,length:e=>T(e).length},q=/; *([!#$%&'*+.^_`|~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]+$/,D=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,N=/\\([\u000b\u0020-\u00ff])/g,B=/([\\"])/g,F=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,J=function(e){if(!e)throw new TypeError("argument string is required");var t="object"==typeof e?function(e){var t;"function"==typeof e.getHeader?t=e.getHeader("content-type"):"object"==typeof e.headers&&(t=e.headers&&e.headers["content-type"]);if("string"!=typeof t)throw new TypeError("content-type header is missing from object");return t}(e):e;if("string"!=typeof t)throw new TypeError("argument string is required to be a string");var r=t.indexOf(";"),n=-1!==r?t.substr(0,r).trim():t.trim();if(!F.test(n))throw new TypeError("invalid media type");var o=new Z(n.toLowerCase());if(-1!==r){var a,i,s;for(q.lastIndex=r;i=q.exec(t);){if(i.index!==r)throw new TypeError("invalid parameter format");r+=i[0].length,a=i[1].toLowerCase(),'"'===(s=i[2])[0]&&(s=s.substr(1,s.length-2).replace(N,"$1")),o.parameters[a]=s}if(r!==t.length)throw new TypeError("invalid parameter format")}return o};function W(e){var t=String(e);if(D.test(t))return t;if(t.length>0&&!_.test(t))throw new TypeError("invalid parameter value");return'"'+t.replace(B,"\\$1")+'"'}function Z(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 t=e.parameters,r=e.type;if(!r||!F.test(r))throw new TypeError("invalid type");var n=r;if(t&&"object"==typeof t)for(var o,a=Object.keys(t).sort(),i=0;i<a.length;i++){if(o=a[i],!D.test(o))throw new TypeError("invalid parameter name");n+="; "+o+"="+W(t[o])}return n},parse:J},G=async e=>Object.entries(await e),H=e((async(e,t)=>(await t).map(e))),Q=e((async(e,t,r)=>(await r).reduce((async(t,r)=>e(await t,r)),t))),X=e((async(e,t,r={})=>Q((async(t,r)=>await e(r)?t.concat([r]):t),[],t,r))),Y=e((async(e,t)=>{const r=await H(e,t);return(await Promise.all(r)).some((e=>e))})),ee=e((async(e,t)=>{const r=await H(e,t);return(await Promise.all(r)).every((e=>e))})),te=e(((e,t)=>e.reduce((async(e,t)=>t(await e)),t))),re={entries:G,map:H,filter:X,reduce:Q,some:Y,every:ee,pipeline:te,all:e=>Promise.all(e),allValues:e=>te([G,Q((async(e,[t,r])=>(e[t]=await r,e)),{})],e)};re.entries,re.map,re.filter,re.reduce,re.some,re.every,re.pipeline,re.all,re.allValues;var ne=fetch;const{jsonTypeOf:oe,splitUrl:ae,safeResolveUrl:ie,pathRelative:se}=d,ce={},le={},ue=(e,t)=>{const r=e in le?le[e]:e;if(r in ce)return ce[r][t]},fe={},de={},pe=(e,t="",r="")=>{e=JSON.parse(JSON.stringify(e));const n=ae(e.$schema||r)[0];if(!n)throw Error("Couldn't determine schema version");delete e.$schema;const o=ue(n,"baseToken"),a=ue(n,"anchorToken"),i=ae(t)[0];if(!i&&!ae(e[o]||"")[0])throw Error("Couldn't determine an identifier for the schema");const s=ie(i,e[o]||""),[c,l]=ae(s);delete e[o],l&&o===a&&(e[a]=a!==o?encodeURI(l):`#${encodeURI(l)}`),i&&(de[i]=c);const u={},f=ue(n,"recursiveAnchorToken");let d;!0===e[f]&&(u[""]=`${c}#`,e[a]="",delete e[f]);const p=ue(n,"vocabularyToken");oe(e[p],"object")?(le[c]=n,d=e[p],delete e[p]):(le[c]=n,d={[n]:!0});const h={"":""};return fe[c]={id:c,schemaVersion:n,schema:he(e,c,n,$.nil,h,u),anchors:h,dynamicAnchors:u,vocabulary:d,validated:!1},c},he=(e,t,r,n,o,a)=>{if(oe(e,"object")){const i="string"==typeof e.$schema?ae(e.$schema)[0]:r,s=ue(i,"embeddedToken"),c=ue(i,"anchorToken");if("string"==typeof e[s]&&(s!==c||"#"!==e[s][0])){const n=ie(t,e[s]);return e[s]=n,pe(e,n,r),A.cons(e[s],e)}const l=ue(r,"anchorToken"),u=ue(r,"dynamicAnchorToken");"string"==typeof e[u]&&(a[e[u]]=`${t}#${encodeURI(n)}`,o[e[u]]=n,delete e[u]);const f=ue(r,"embeddedToken");if("string"==typeof e[l]){const t=l!==f?e[l]:e[l].slice(1);o[t]=n,delete e[l]}const d=ue(r,"jrefToken");if("string"==typeof e[d])return A.cons(e[d],e);for(const i in e)e[i]=he(e[i],t,r,$.append(i,n),o,a);return e}return Array.isArray(e)?e.map(((e,i)=>he(e,t,r,$.append(i,n),o,a))):e},ye=e=>fe[de[e]]||fe[e],be=Object.freeze({id:"",schemaVersion:void 0,vocabulary:{},pointer:$.nil,schema:void 0,value:void 0,anchors:{},dynamicAnchors:{},validated:!0}),me=async(e,t=be)=>{const r=ie(we(t),e),[n,o]=ae(r);if(!(e=>e in fe||e in de)(n)){const e=await ne(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 t=M.parse(e.headers.get("content-type")).type;if("application/schema+json"!==t)throw Error(`${n} is not a schema. Found a document with media type: ${t}`)}pe(await e.json(),n)}const a=ye(n),i="/"!==o[0]?ge(a,o):o,s=Object.freeze({...a,pointer:i,value:$.get(i,a.schema)});return ve(s)},ve=e=>A.isReference(e.value)?me(A.href(e.value),e):e,ge=(e,t)=>{if(!(t in e.anchors))throw Error(`No such anchor '${encodeURI(e.id)}#${encodeURI(t)}'`);return e.anchors[t]},we=e=>`${e.id}#${encodeURI(e.pointer)}`,Oe=e=>A.isReference(e.value)?A.value(e.value):e.value,Ee=(e,t)=>{const r=ye(t.id),n=Object.freeze({...t,pointer:$.append(e,t.pointer),value:Oe(t)[e],validated:r.validated});return ve(n)},je=e(((e,t)=>re.pipeline([Oe,re.map((async(r,n)=>e(await Ee(n,t),n))),re.all],t))),$e={parentId:"",parentDialect:"",includeEmbedded:!0},Se=(e,t)=>{if(t.startsWith("file://")){const r=e.slice(7,e.lastIndexOf("/"));return""===e?"":se(r,t.slice(7))}return t};var xe={setConfig:(e,t,r)=>{ce[e]||(ce[e]={}),ce[e][t]=r},getConfig:ue,add:pe,get:me,markValidated:e=>{fe[e].validated=!0},uri:we,value:Oe,getAnchorPointer:ge,typeOf:(e,t)=>oe(Oe(e),t),has:(e,t)=>e in Oe(t),step:Ee,keys:e=>Object.keys(Oe(e)),entries:e=>re.pipeline([Oe,Object.keys,re.map((async t=>[t,await Ee(t,e)])),re.all],e),map:je,length:e=>Oe(e).length,toSchema:(e,t={})=>{const r={...$e,...t},n=JSON.parse(JSON.stringify(e.schema,((t,n)=>{if(!A.isReference(n))return n;const o=A.value(n),a=o.$schema||e.schemaVersion,i=ue(a,"embeddedToken");return!r.includeEmbedded&&i in o?void 0:A.value(n)}))),o=ue(e.schemaVersion,"dynamicAnchorToken");Object.entries(e.dynamicAnchors).forEach((([e,t])=>{const r=ae(t)[1];$.assign(r,n,{[o]:e,...$.get(r,n)})}));const a=ue(e.schemaVersion,"anchorToken");Object.entries(e.anchors).filter((([e])=>""!==e)).forEach((([e,t])=>{$.assign(t,n,{[a]:e,...$.get(t,n)})}));const i=ue(e.schemaVersion,"baseToken"),s=Se(r.parentId,e.id),c=r.parentDialect===e.schemaVersion?"":e.schemaVersion;return{...s&&{[i]:s},...c&&{$schema:c},...n}}};xe.setConfig,xe.getConfig,xe.add,xe.get,xe.markValidated,xe.uri,xe.value,xe.getAnchorPointer,xe.typeOf,xe.has,xe.step,xe.keys,xe.entries,xe.map,xe.length,xe.toSchema;class Ae extends Error{constructor(e){super("Invalid Schema"),this.name=this.constructor.name,this.output=e}}var Pe=Ae;const{splitUrl:Ie}=d,Te="FLAG",ke="BASIC",Ve="DETAILED",Re="VERBOSE";let Ce=Ve,Ue=!0;const ze=async e=>{const t={metaData:{}};return{ast:t,schemaUri:await Fe(e,t)}},Ke=e((({ast:e,schemaUri:t},r,n=Te)=>{if(![Te,ke,Ve,Re].includes(n))throw Error(`The '${n}' error format is not supported`);const a=[],i=o.subscribe("result",Le(n,a));return We(t,r,e,{}),o.unsubscribe(i),a[0]})),Le=(e,t)=>{const r=[];return(n,o)=>{if("result"===n){const{keyword:e,absoluteKeywordLocation:t,instanceLocation:n,valid:a}=o,i={keyword:e,absoluteKeywordLocation:t,instanceLocation:n,valid:a,errors:[]};r.push(i)}else if("result.start"===n)r.push(n);else if("result.end"===n){const n=r.pop();for(;"result.start"!==r[r.length-1];){const t=r.pop(),o=[t];e===ke&&(o.push(...t.errors),delete t.errors),(e===Re||e!==Te&&!t.valid)&&n.errors.unshift(...o)}r[r.length-1]=n,t[0]=n}}},qe={},_e=e=>qe[e],De=e=>e in qe,Ne={},Be={},Fe=async(e,t)=>{if(e=await Je(e),!De(`${e.schemaVersion}#validate`)){const t=await xe.get(e.schemaVersion);(xe.getConfig(t.id,"mandatoryVocabularies")||[]).forEach((e=>{if(!t.vocabulary[e])throw Error(`Vocabulary '${e}' must be explicitly declared and required`)})),Object.entries(t.vocabulary).forEach((([e,r])=>{if(e in Ne)Object.entries(Ne[e]).forEach((([e,r])=>{((e,t)=>{qe[e]={collectEvaluatedItems:(e,r,n,o,a)=>t.interpret(e,r,n,o,a)&&new Set,collectEvaluatedProperties:(e,r,n,o,a)=>t.interpret(e,r,n,o,a)&&[],...t}})(`${t.id}#${e}`,r)}));else if(r)throw Error(`Missing required vocabulary: ${e}`)}))}if(Ue&&!e.validated){if(xe.markValidated(e.id),!(e.schemaVersion in Be)){const t=await xe.get(e.schemaVersion),r=await ze(t);Be[t.id]=Ke(r)}const t=L.cons(e.schema,e.id),r=Be[e.schemaVersion](t,Ce);if(!r.valid)throw new Pe(r)}return e.id in t.metaData||(t.metaData[e.id]={id:e.id,dynamicAnchors:e.dynamicAnchors,anchors:e.anchors}),_e(`${e.schemaVersion}#validate`).compile(e,t)},Je=async e=>xe.typeOf(e,"string")?Je(await xe.get(xe.value(e),e)):e,We=(e,t,r,n)=>{const o=Ze(e,r),a=Ie(e)[0];return _e(o).interpret(e,t,r,{...r.metaData[a].dynamicAnchors,...n})},Ze=(e,t)=>{if(!(e in t))throw Error(`No schema found at ${e}`);return t[e][0]};var Me={validate:async(e,t,r)=>{const n=await ze(e),o=(e,t)=>Ke(n,L.cons(e),t);return void 0===t?o:o(t,r)},compile:ze,interpret:Ke,setMetaOutputFormat:e=>{Ce=e},setShouldMetaValidate:e=>{Ue=e},FLAG:Te,BASIC:ke,DETAILED:Ve,VERBOSE:Re,add:(e,t="",r="")=>{const n=xe.add(e,t,r);delete Be[n]},getKeyword:_e,hasKeyword:De,defineVocabulary:(e,t)=>{Ne[e]=t},compileSchema:Fe,interpretSchema:We,collectEvaluatedProperties:(e,t,r,n,o)=>{const a=Ze(e,r);return _e(a).collectEvaluatedProperties(e,t,r,n,o)},collectEvaluatedItems:(e,t,r,n,o)=>{const a=Ze(e,r);return _e(a).collectEvaluatedItems(e,t,r,n,o)}};var Ge={compile:e=>xe.value(e),interpret:()=>!0};var He={compile:async(e,t)=>{const r=xe.uri(e);if(!(r in t)){t[r]=!1;const n=xe.value(e);if(!["object","boolean"].includes(typeof n))throw Error(`No schema found at '${xe.uri(e)}'`);t[r]=[`${e.schemaVersion}#validate`,xe.uri(e),"boolean"==typeof n?n:await re.pipeline([xe.entries,re.map((([t,r])=>[`${e.schemaVersion}#${t}`,r])),re.filter((([t])=>Me.hasKeyword(t)&&t!==`${e.schemaVersion}#validate`)),re.map((async([r,n])=>{const o=await Me.getKeyword(r).compile(n,t,e);return[r,xe.uri(n),o]})),re.all],e)]}return r},interpret:(e,t,r,n)=>{const[a,i,s]=r[e];o.publishSync("result.start");const c="boolean"==typeof s?s:s.every((([e,a,i])=>{o.publishSync("result.start");const s=Me.getKeyword(e).interpret(i,t,r,n);return o.publishSync("result",{keyword:e,absoluteKeywordLocation:a,instanceLocation:L.uri(t),valid:s,ast:i}),o.publishSync("result.end"),s}));return o.publishSync("result",{keyword:a,absoluteKeywordLocation:i,instanceLocation:L.uri(t),valid:c,ast:e}),o.publishSync("result.end"),c},collectEvaluatedProperties:(e,t,r,n,o=!1)=>{const a=r[e][2];return"boolean"==typeof a?!!a&&[]:a.filter((([e])=>!o||!e.endsWith("#unevaluatedProperties"))).reduce(((e,[o,,a])=>{const i=e&&Me.getKeyword(o).collectEvaluatedProperties(a,t,r,n);return!1!==i&&[...e,...i]}),[])},collectEvaluatedItems:(e,t,r,n,o=!1)=>{const a=r[e][2];return"boolean"==typeof a?!!a&&new Set:a.filter((([e])=>!o||!e.endsWith("#unevaluatedItems"))).reduce(((e,[o,,a])=>{const i=!1!==e&&Me.getKeyword(o).collectEvaluatedItems(a,t,r,n);return!1!==i&&new Set([...e,...i])}),new Set)}},Qe={metaData:Ge,validate:He},Xe={Core:Me,Schema:xe,Instance:L,Reference:A,Keywords:Qe,InvalidSchemaError:Pe},Ye=Xe.Core,et=Xe.Schema,tt=Xe.Instance,rt=Xe.Reference,nt=Xe.Keywords,ot=Xe.InvalidSchemaError;exports.Core=Ye,exports.Instance=tt,exports.InvalidSchemaError=ot,exports.Keywords=nt,exports.Reference=rt,exports.Schema=et,exports.default=Xe;
"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),h=t(a+"{1,4}"),d=t(t(h+"\\:"+h)+"|"+f),v=t(t(h+"\\:")+"{6}"+d),y=t("\\:\\:"+t(h+"\\:")+"{5}"+d),m=t(t(h)+"?\\:\\:"+t(h+"\\:")+"{4}"+d),g=t(t(t(h+"\\:")+"{0,1}"+h)+"?\\:\\:"+t(h+"\\:")+"{3}"+d),b=t(t(t(h+"\\:")+"{0,2}"+h)+"?\\:\\:"+t(h+"\\:")+"{2}"+d),w=t(t(t(h+"\\:")+"{0,3}"+h)+"?\\:\\:"+h+"\\:"+d),E=t(t(t(h+"\\:")+"{0,4}"+h)+"?\\:\\:"+d),S=t(t(t(h+"\\:")+"{0,5}"+h)+"?\\:\\:"+h),C=t(t(t(h+"\\:")+"{0,6}"+h)+"?\\:\\:"),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 j=t(i+"|"+r(l,s,"[\\:\\@]"));return t(t(i+"|"+r(l,s,"[\\@]"))+"+"),t(t(j+"|"+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,h=36,d=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=h-d,j=Math.floor,x=String.fromCharCode;function T(e){throw new RangeError(O[e])}function I(e,r){for(var t=[],n=e.length;n--;)t[n]=r(e[n]);return t}function D(e,r){var t=e.split("@"),n="";return t.length>1&&(n=t[0]+"@",e=t[1]),n+I((e=e.replace(C,".")).split("."),r).join(".")}function P(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 $=function(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:h},R=function(e,r){return e+22+75*(e<26)-((0!=r)<<5)},N=function(e,r,t){var n=0;for(e=t?j(e/m):e>>1,e+=j(e/r);e>A*v>>1;n+=h)e=j(e/A);return j(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=h;;p+=h){c>=t&&T("invalid-input");var y=$(e.charCodeAt(c++));(y>=h||y>j((f-n)/l))&&T("overflow"),n+=y*l;var m=p<=a?d:p>=a+v?v:p-a;if(y<m)break;var E=h-m;l>j(f/E)&&T("overflow"),l*=E}var S=r.length+1;a=N(n-u,S,0==u),j(n/S)>f-o&&T("overflow"),o+=j(n/S),n%=S,r.splice(n++,0,o)}return String.fromCodePoint.apply(String,r)},F=function(e){var r=[],t=(e=P(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(x(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,I=e[Symbol.iterator]();!(S=(A=I.next()).done);S=!0){var D=A.value;D>=n&&D<E&&(E=D)}}catch(e){C=!0,O=e}finally{try{!S&&I.return&&I.return()}finally{if(C)throw O}}var $=m+1;E-n>j((f-o)/$)&&T("overflow"),o+=(E-n)*$,n=E;var _=!0,F=!1,V=void 0;try{for(var U,k=e[Symbol.iterator]();!(_=(U=k.next()).done);_=!0){var q=U.value;if(q<n&&++o>f&&T("overflow"),q==n){for(var L=o,z=h;;z+=h){var H=z<=a?d:z>=a+v?v:z-a;if(L<H)break;var K=L-H,M=h-H;r.push(x(R(H+K%M,0))),L=j(K/M)}r.push(x(R(L,0))),a=N(o,$,m==y),o=0,++m}}}catch(e){F=!0,V=e}finally{try{!_&&k.return&&k.return()}finally{if(F)throw V}}++o,++n}return r.join("")},V=function(e){return D(e,(function(e){return E.test(e)?_(e.slice(4).toLowerCase()):e}))},U=function(e){return D(e,(function(e){return S.test(e)?"xn--"+F(e):e}))},k={version:"2.1.0",ucs2:{decode:P,encode:function(e){return String.fromCodePoint.apply(String,p(e))}},decode:_,encode:F,toASCII:U,toUnicode:V},q={};function L(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 z(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 H(e,r){function t(e){var t=z(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,L).replace(r.PCT_ENCODED,o)),void 0!==e.host&&(e.host=String(e.host).replace(r.PCT_ENCODED,t).toLowerCase().replace(r.NOT_HOST,L).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,L).replace(r.PCT_ENCODED,o)),void 0!==e.query&&(e.query=String(e.query).replace(r.PCT_ENCODED,t).replace(r.NOT_QUERY,L).replace(r.PCT_ENCODED,o)),void 0!==e.fragment&&(e.fragment=String(e.fragment).replace(r.PCT_ENCODED,t).replace(r.NOT_FRAGMENT,L).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),h=r.IPV4ADDRESS.test(f[f.length-1]),d=h?7:8,v=f.length-d,y=Array(d),m=0;m<d;++m)y[m]=p[m]||f[v+m]||"";h&&(y[d-1]=M(y[d-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 B=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,J=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(B);if(o){J?(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=q[(r.scheme||t.scheme||"").toLowerCase()];if(r.unicodeSupport||a&&a.unicodeSupport)H(t,n);else{if(t.host&&(r.domainHost||a&&a.domainHost))try{t.host=k.toASCII(t.host.replace(n.PCT_ENCODED,z).toLowerCase())}catch(e){t.error=t.error||"Host's domain name can not be converted to ASCII via punycode: "+e}H(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=q[(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?k.toUnicode(e.host):k.toASCII(e.host.replace(t.PCT_ENCODED,z).toLowerCase())}catch(t){e.error=e.error||"Host's domain name can not be converted to "+(r.iri?"Unicode":"ASCII")+" via punycode: "+t}H(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,L)}function ce(e,r){return e&&e.toString().replace(r&&r.iri?u.PCT_ENCODED:c.PCT_ENCODED,z)}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}},he={scheme:"wss",domainHost:fe.domainHost,parse:fe.parse,serialize:fe.serialize},de={},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 je(e){var r=z(e);return r.match(Ee)?r:e}var xe={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 h=0,d=n.length;h<d;++h){var v=n[h].split("@");if(v[0]=ce(v[0]),r.unicodeSupport)v[1]=ce(v[1],r).toLowerCase();else try{v[1]=k.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[h]=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,je).replace(Se,o).replace(Ce,L),p=c.slice(u+1);try{p=r.iri?k.toUnicode(p):k.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 h=[];for(var d in f)f[d]!==de[d]&&h.push(d.replace(Se,je).replace(Se,o).replace(Oe,L)+"="+f[d].replace(Se,je).replace(Se,o).replace(Ae,L));return h.length&&(t.query=h.join("&")),t}},Te=/^([^\:]+)\:(.*)/,Ie={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=q[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=q[o];a&&(e=a.serialize(e,r));var i=e,s=e.nss;return i.path=(n||r.nid)+":"+s,i}},De=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/,Pe={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(De)||(t.error=t.error||"UUID is not valid."),t},serialize:function(e,r){var t=e;return t.nss=(e.uuid||"").toLowerCase(),t}};q[ue.scheme]=ue,q[le.scheme]=le,q[fe.scheme]=fe,q[he.scheme]=he,q[xe.scheme]=xe,q[Ie.scheme]=Ie,q[Pe.scheme]=Pe,e.SCHEMES=q,e.pctEncChar=L,e.pctDecChars=z,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,h(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,h(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,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 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,h(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)},h=e(((e,r)=>r+"/"+d(e))),d=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:h,get:(e,r)=>{const t=c(e),n=e=>t.reduce((([e,r],t)=>[m(e,t,r),h(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}),j=e=>S.isReference(e.value)?S.value(e.value):e.value,x=e(((e,r)=>O(j(e),r))),T=(e,r)=>Object.freeze({...r,pointer:b.append(e,r.pointer),value:j(r)[e]}),I=e(((e,r)=>j(r).map(((t,n,o,a)=>e(T(n,r),n,o,a))))),D=e(((e,r)=>j(r).map(((e,t,n,o)=>T(t,r))).filter(((r,t,n,o)=>e(r,t,n,o))))),P=e(((e,r,t)=>j(t).reduce(((r,n,o)=>e(r,T(o,t),o)),r))),$=e(((e,r)=>j(r).every(((t,n,o,a)=>e(T(n,r),n,o,a))))),R=e(((e,r)=>j(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:j,has:(e,r)=>e in j(r),typeOf:x,step:T,entries:e=>Object.keys(j(e)).map((r=>[r,T(r,e)])),keys:e=>Object.keys(j(e)),map:I,filter:D,reduce:P,every:$,some:R,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,F=/^[\u000b\u0020-\u007e\u0080-\u00ff]+$/,V=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,U=/\\([\u000b\u0020-\u00ff])/g,k=/([\\"])/g,q=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,L=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(!q.test(n))throw new TypeError("invalid media type");var o=new H(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 z(e){var r=String(e);if(V.test(r))return r;if(r.length>0&&!F.test(r))throw new TypeError("invalid parameter value");return'"'+r.replace(k,"\\$1")+'"'}function H(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||!q.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],!V.test(o))throw new TypeError("invalid parameter name");n+="; "+o+"="+z(r[o])}return n},parse:L},M=async e=>Object.entries(await e),Z=e((async(e,r)=>(await r).map(e))),B=e((async(e,r,t)=>(await t).reduce((async(r,t)=>e(await r,t)),r))),J=e((async(e,r,t={})=>B((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:J,reduce:B,some:G,every:W,pipeline:Q,all:e=>Promise.all(e),allValues:e=>Q([M,B((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={},ae={},ie=(e,r)=>{const t=e in ae?ae[e]:e;if(t in oe)return oe[t][r]},se={},ce={},ue=(e,r="",t="")=>{e=JSON.parse(JSON.stringify(e));const n=re(e.$schema||t,"");if(!n)throw Error("Couldn't determine schema version");delete e.$schema;const o=ie(n,"baseToken"),a=ie(n,"anchorToken"),i=re(r,"");if(!i&&!re(e[o]||"",""))throw Error("Couldn't determine an identifier for the schema");const s=re(i,e[o]||""),c=re(s,""),u=te(s);delete e[o],u&&o===a&&(e[a]=a!==o?encodeURI(u):`#${encodeURI(u)}`),i&&(ce[i]=c);const l={},p=ie(n,"recursiveAnchorToken");let f;!0===e[p]&&(l[""]=`${c}#`,e[a]="",delete e[p]);const h=ie(n,"vocabularyToken");ee(e[h],"object")?(ae[c]=n,f=e[h],delete e[h]):(ae[c]=n,f={[n]:!0});const d={"":""};return se[c]={id:c,schemaVersion:n,schema:le(e,c,n,b.nil,d,l),anchors:d,dynamicAnchors:l,vocabulary:f,validated:!1},c},le=(e,r,t,n,o,a)=>{if(ee(e,"object")){const i="string"==typeof e.$schema?re(e.$schema,""):t,s=ie(i,"embeddedToken"),c=ie(i,"anchorToken");if("string"==typeof e[s]&&(s!==c||"#"!==e[s][0])){const n=re(r,e[s]);return e[s]=n,ue(e,n,t),S.cons(e[s],e)}const u=ie(t,"anchorToken"),l=ie(t,"dynamicAnchorToken");"string"==typeof e[l]&&(a[e[l]]=`${r}#${encodeURI(n)}`,o[e[l]]=n,delete e[l]);const p=ie(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=ie(t,"jrefToken");if("string"==typeof e[f])return S.cons(e[f],e);for(const i in e)e[i]=le(e[i],r,t,b.append(i,n),o,a);return e}return Array.isArray(e)?e.map(((e,i)=>le(e,r,t,b.append(i,n),o,a))):e},pe=e=>se[ce[e]]||se[e],fe=Object.freeze({id:"",schemaVersion:void 0,vocabulary:{},pointer:b.nil,schema:void 0,value:void 0,anchors:{},dynamicAnchors:{},validated:!0}),he=async(e,r=fe)=>{const t=re(ye(r),e),n=re(t,""),o=te(t);if(!(e=>e in se||e in ce)(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}`)}ue(await e.json(),n)}const a=pe(n),i="/"!==o[0]?ve(a,o):o,s=Object.freeze({...a,pointer:i,value:b.get(i,a.schema)});return de(s)},de=e=>S.isReference(e.value)?he(S.href(e.value),e):e,ve=(e,r)=>{if(!(r in e.anchors))throw Error(`No such anchor '${encodeURI(e.id)}#${encodeURI(r)}'`);return e.anchors[r]},ye=e=>`${e.id}#${encodeURI(e.pointer)}`,me=e=>S.isReference(e.value)?S.value(e.value):e.value,ge=(e,r)=>{const t=pe(r.id),n=Object.freeze({...r,pointer:b.append(e,r.pointer),value:me(r)[e],validated:t.validated});return de(n)},be=e(((e,r)=>Y.pipeline([me,Y.map((async(t,n)=>e(await ge(n,r),n))),Y.all],r))),we={parentId:"",parentDialect:"",includeEmbedded:!0},Ee=(e,r)=>{if(r.startsWith("file://")){const t=e.slice(7,e.lastIndexOf("/"));return""===e?"":ne(t,r.slice(7))}return r};var Se={setConfig:(e,r,t)=>{oe[e]||(oe[e]={}),oe[e][r]=t},getConfig:ie,add:ue,get:he,markValidated:e=>{se[e].validated=!0},uri:ye,value:me,getAnchorPointer:ve,typeOf:(e,r)=>ee(me(e),r),has:(e,r)=>e in me(r),step:ge,keys:e=>Object.keys(me(e)),entries:e=>Y.pipeline([me,Object.keys,Y.map((async r=>[r,await ge(r,e)])),Y.all],e),map:be,length:e=>me(e).length,toSchema:(e,r={})=>{const t={...we,...r},n=JSON.parse(JSON.stringify(e.schema,((r,n)=>{if(!S.isReference(n))return n;const o=S.value(n),a=o.$schema||e.schemaVersion,i=ie(a,"embeddedToken");return!t.includeEmbedded&&i in o?void 0:S.value(n)}))),o=ie(e.schemaVersion,"dynamicAnchorToken");Object.entries(e.dynamicAnchors).forEach((([e,r])=>{const t=te(r);b.assign(t,n,{[o]:e,...b.get(t,n)})}));const a=ie(e.schemaVersion,"anchorToken");Object.entries(e.anchors).filter((([e])=>""!==e)).forEach((([e,r])=>{b.assign(r,n,{[a]:e,...b.get(r,n)})}));const i=ie(e.schemaVersion,"baseToken"),s=Ee(t.parentId,e.id),c=t.parentDialect===e.schemaVersion?"":e.schemaVersion;return{...s&&{[i]:s},...c&&{$schema:c},...n}}};Se.setConfig,Se.getConfig,Se.add,Se.get,Se.markValidated,Se.uri,Se.value,Se.getAnchorPointer,Se.typeOf,Se.has,Se.step,Se.keys,Se.entries,Se.map,Se.length,Se.toSchema;class Ce extends Error{constructor(e){super("Invalid Schema"),this.name=this.constructor.name,this.output=e}}var Oe=Ce;const{resolveUrl:Ae}=s,je="FLAG",xe="BASIC",Te="DETAILED",Ie="VERBOSE";let De=Te,Pe=!0;const $e=async e=>{const r={metaData:{}};return{ast:r,schemaUri:await qe(e,r)}},Re=e((({ast:e,schemaUri:r},t,o=je)=>{if(![je,xe,Te,Ie].includes(o))throw Error(`The '${o}' error format is not supported`);const a=[],i=n.subscribe("result",Ne(o,a));return ze(r,t,e,{}),n.unsubscribe(i),a[0]})),Ne=(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===xe&&(o.push(...r.errors),delete r.errors),(e===Ie||e!==je&&!r.valid)&&n.errors.unshift(...o)}t[t.length-1]=n,r[0]=n}}},_e={},Fe=e=>_e[e],Ve=e=>e in _e,Ue={},ke={},qe=async(e,r)=>{if(e=await Le(e),!Ve(`${e.schemaVersion}#validate`)){const r=await Se.get(e.schemaVersion);(Se.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 Ue)Object.entries(Ue[e]).forEach((([e,t])=>{((e,r)=>{_e[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(Pe&&!e.validated){if(Se.markValidated(e.id),!(e.schemaVersion in ke)){const r=await Se.get(e.schemaVersion),t=await $e(r);ke[r.id]=Re(t)}const r=N.cons(e.schema,e.id),t=ke[e.schemaVersion](r,De);if(!t.valid)throw new Oe(t)}return e.id in r.metaData||(r.metaData[e.id]={id:e.id,dynamicAnchors:e.dynamicAnchors,anchors:e.anchors}),Fe(`${e.schemaVersion}#validate`).compile(e,r)},Le=async e=>Se.typeOf(e,"string")?Le(await Se.get(Se.value(e),e)):e,ze=(e,r,t,n)=>{const o=He(e,t),a=Ae(e,"");return Fe(o).interpret(e,r,t,{...t.metaData[a].dynamicAnchors,...n})},He=(e,r)=>{if(!(e in r))throw Error(`No schema found at ${e}`);return r[e][0]};var Ke={validate:async(e,r,t)=>{const n=await $e(e),o=(e,r)=>Re(n,N.cons(e),r);return void 0===r?o:o(r,t)},compile:$e,interpret:Re,setMetaOutputFormat:e=>{De=e},setShouldMetaValidate:e=>{Pe=e},FLAG:je,BASIC:xe,DETAILED:Te,VERBOSE:Ie,add:(e,r="",t="")=>{const n=Se.add(e,r,t);delete ke[n]},getKeyword:Fe,hasKeyword:Ve,defineVocabulary:(e,r)=>{Ue[e]=r},compileSchema:qe,interpretSchema:ze,collectEvaluatedProperties:(e,r,t,n,o)=>{const a=He(e,t);return Fe(a).collectEvaluatedProperties(e,r,t,n,o)},collectEvaluatedItems:(e,r,t,n,o)=>{const a=He(e,t);return Fe(a).collectEvaluatedItems(e,r,t,n,o)}};var Me={compile:e=>Se.value(e),interpret:()=>!0};var Ze={compile:async(e,r)=>{const t=Se.uri(e);if(!(t in r)){r[t]=!1;const n=Se.value(e);if(!["object","boolean"].includes(typeof n))throw Error(`No schema found at '${Se.uri(e)}'`);r[t]=[`${e.schemaVersion}#validate`,Se.uri(e),"boolean"==typeof n?n:await Y.pipeline([Se.entries,Y.map((([r,t])=>[`${e.schemaVersion}#${r}`,t])),Y.filter((([r])=>Ke.hasKeyword(r)&&r!==`${e.schemaVersion}#validate`)),Y.map((async([t,n])=>{const o=await Ke.getKeyword(t).compile(n,r,e);return[t,Se.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=Ke.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&&Ke.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&&Ke.getKeyword(o).collectEvaluatedItems(a,r,t,n);return!1!==i&&new Set([...e,...i])}),new Set)}},Be={metaData:Me,validate:Ze},Je={Core:Ke,Schema:Se,Instance:N,Reference:S,Keywords:Be,InvalidSchemaError:Oe},Ge=Je.Core,We=Je.Schema,Qe=Je.Instance,Ye=Je.Reference,Xe=Je.Keywords,er=Je.InvalidSchemaError;exports.Core=Ge,exports.Instance=Qe,exports.InvalidSchemaError=er,exports.Keywords=Xe,exports.Reference=Ye,exports.Schema=We,exports.default=Je;
//# sourceMappingURL=json-schema-core-cjs.min.js.map

@@ -1,2 +0,4 @@

var e=function(e,t){return function r(){null==t&&(t=e.length);var n=[].slice.call(arguments);return n.length>=t?e.apply(this,n):function(){return r.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:{};var r,n,o=(r=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 t={},r=-1,n="*";function o(e){var t;for(t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!0;return!1}function a(e){return function(){throw e}}function i(e,t,r){try{e(t,r)}catch(e){setTimeout(a(e),0)}}function s(e,t,r){e(t,r)}function c(e,r,n,o){var a,c=t[r],l=o?s:i;if(Object.prototype.hasOwnProperty.call(t,r))for(a in c)Object.prototype.hasOwnProperty.call(c,a)&&l(c[a],e,n)}function l(e,t,r){return function(){var o=String(e),a=o.lastIndexOf(".");for(c(e,e,t,r);-1!==a;)a=(o=o.substr(0,a)).lastIndexOf("."),c(e,o,t,r);c(e,n,t,r)}}function u(e){var r=String(e);return Boolean(Object.prototype.hasOwnProperty.call(t,r)&&o(t[r]))}function f(e){for(var t=String(e),r=u(t)||u(n),o=t.lastIndexOf(".");!r&&-1!==o;)o=(t=t.substr(0,o)).lastIndexOf("."),r=u(t);return r}function d(e,t,r,n){var o=l(e="symbol"==typeof e?e.toString():e,t,n);return!!f(e)&&(!0===r?o():setTimeout(o,0),!0)}e.publish=function(t,r){return d(t,r,!1,e.immediateExceptions)},e.publishSync=function(t,r){return d(t,r,!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(t,e)||(t[e]={});var o="uid_"+String(++r);return t[e][o]=n,o},e.subscribeAll=function(t){return e.subscribe(n,t)},e.subscribeOnce=function(t,r){var n=e.subscribe(t,(function(){e.unsubscribe(n),r.apply(this,arguments)}));return e},e.clearAllSubscriptions=function(){t={}},e.clearSubscriptions=function(e){var r;for(r in t)Object.prototype.hasOwnProperty.call(t,r)&&0===r.indexOf(e)&&delete t[r]},e.countSubscriptions=function(e){var r,n,o=0;for(r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&0===r.indexOf(e)){for(n in t[r])o++;break}return o},e.getSubscriptions=function(e){var r,n=[];for(r in t)Object.prototype.hasOwnProperty.call(t,r)&&0===r.indexOf(e)&&n.push(r);return n},e.unsubscribe=function(r){var n,o,a,i=function(e){var r;for(r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&0===r.indexOf(e))return!0;return!1},s="string"==typeof r&&(Object.prototype.hasOwnProperty.call(t,r)||i(r)),c=!s&&"string"==typeof r,l="function"==typeof r,u=!1;if(!s){for(n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(o=t[n],c&&o[r]){delete o[r],u=r;break}if(l)for(a in o)Object.prototype.hasOwnProperty.call(o,a)&&o[a]===r&&(delete o[a],u=!0)}return u}e.clearSubscriptions(r)}}(o)),void 0!==e&&e.exports&&(r=e.exports=o),r.PubSub=o,e.exports=r=o},r(n={exports:{}},n.exports),n.exports);o.PubSub;var a=function(e,t){if(e=e.trim(),(t=t.trim()).startsWith("about:"))return t;const r=function(e){const t={host:"",path:"",query:"",protocol:""};let r=e,n=e.indexOf("//");t.protocol=r.substring(0,n),n+=2;const o=e.indexOf("/",n),a=e.indexOf("?"),i=e.indexOf("#");-1!==i&&(r=r.substring(0,i));if(-1!==a){const e=r.substring(a);t.query=e,r=r.substring(0,a)}if(-1!==o){const e=r.substring(0,o);t.host=e,r=r.substring(o),t.path=r}else t.host=r;return t}(e),n=function(e){const t={href:e,hash:"",query:"",netPath:!1,absolutePath:!1,relativePath:!1};if(c.test(e))return t.netPath=!0,t;"/"===e[0]?t.absolutePath=!0:""!==e&&(t.relativePath=!0);let r=e;const n=e.indexOf("?"),o=e.indexOf("#");if(-1!==o){const e=r.substring(o);t.hash=e,r=r.substring(0,o)}if(-1!==n){const e=r.substring(n);t.query=e,r=r.substring(0,n)}return t.path=r,t}(t);if(!r.protocol&&!n.netPath)throw new Error("Error, protocol is not specified");if(n.netPath)return n.href.startsWith("//")&&(n.href=r.protocol+n.href),function(e){const t=e.indexOf("//")+2,r=!e.includes("/",t),n=!e.includes("?",t),o=!e.includes("#",t);return r&&n&&o}(n.href)?i(n.href):n.href;if(n.absolutePath){const{path:e,query:t,hash:o}=n;return r.host+s(e)+t+o}if(n.relativePath){const{path:e,query:t,hash:o}=n;let a,i=r.path,c=r.host;return 0===e.length?a=i:(i=i.substring(0,i.lastIndexOf("/")),a=s(i+"/"+e)),c+=""!==a||t||o?a+t+o:"/",c}{const{host:e,path:t,query:o}=r;return t||o?e+t+o+n.hash:i(e)}};function i(e){return e+("/"===e[e.length-1]?"":"/")}function s(e){let t=e.split("/");""===t[0]&&(t=t.slice(1));let r=[];return t.forEach(((e,n)=>{"."!==e&&(".."===e?r.pop():""===e&&n!==t.length-1||r.push(e))})),"/"+r.join("/")}const c=new RegExp("^([a-z][a-z0-9+.-]*:)?//","i");const l={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},u=e=>{const t=e.indexOf("#"),r=-1===t?e.length:t,n=e.slice(0,r),o=e.slice(r+1);return[decodeURI(n),decodeURI(o)]},f=e=>{const t=RegExp(/^(.+):\/\//).exec(e);return t?t[1]:""};var d={jsonTypeOf:(e,t)=>l[t](e),splitUrl:u,safeResolveUrl:(e,t)=>{const r=a(e,t),n=u(e)[0];if(n&&"file"===f(r)&&"file"!==f(n))throw Error(`Can't access file '${r}' resource from network context '${e}'`);return r},pathRelative:(e,t)=>{if(e===t)return"";let r=1;const n=e.length-1,o=t.length-r,a=n<o?n:o;let i=-1,s=0;for(;s<a;s++){const n=e.charCodeAt(s+1);if(n!==t.charCodeAt(r+s))break;47===n&&(i=s)}if(o>a){if(47===t.charCodeAt(r+s))return t.slice(r+s+1);if(0===s)return t.slice(r+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 r+=i,c.length>0?`${c}${t.slice(r,t.length)}`:(47===t.charCodeAt(r)&&++r,t.slice(r,t.length))}};const p=e=>{if(e.length>0&&"/"!==e[0])throw Error("Invalid JSON Pointer");return e.split("/").slice(1).map(w)},h=(e,t,r,n)=>{if(0===e.length)return r;if(e.length>1){const o=e.shift();return{...t,[o]:h(e,E(t,o,n),r,v(o,n))}}if(Array.isArray(t)){const n=[...t];return n[O(t,e[0])]=r,n}return"object"==typeof t&&null!==t?{...t,[e[0]]:r}:E(t,e[0],n)},y=(e,t,r,n)=>{if(0!==e.length)if(1!==e.length||$(t)){const o=e.shift();y(e,E(t,o,n),r,v(o,n))}else{t[O(t,e[0])]=r}},b=(e,t,r)=>{if(0!=e.length){if(e.length>1){const n=e.shift(),o=E(t,n,r);return{...t,[n]:b(e,o,v(n,r))}}if(Array.isArray(t))return t.filter(((t,r)=>r!=e[0]));if("object"==typeof t&&null!==t){const{[e[0]]:r,...n}=t;return n}return E(t,e[0],r)}},m=(e,t,r)=>{if(0!==e.length)if(e.length>1){const n=e.shift(),o=E(t,n,r);m(e,o,v(n,r))}else Array.isArray(t)?t.splice(e[0],1):"object"==typeof t&&null!==t?delete t[e[0]]:E(t,e[0],r)},v=e(((e,t)=>t+"/"+g(e))),g=e=>e.toString().replace(/~/g,"~0").replace(/\//g,"~1"),w=e=>e.toString().replace(/~1/g,"/").replace(/~0/g,"~"),O=(e,t)=>Array.isArray(e)&&"-"===t?e.length:t,E=(e,t,r="")=>{if(void 0===e)throw TypeError(`Value at '${r}' is undefined and does not have property '${t}'`);if(null===e)throw TypeError(`Value at '${r}' is null and does not have property '${t}'`);if($(e))throw TypeError(`Value at '${r}' is a ${typeof e} and does not have property '${t}'`);return e[O(e,t)]},$=e=>null===e||"object"!=typeof e;var j={nil:"",append:v,get:(e,t)=>{const r=p(e),n=e=>r.reduce((([e,t],r)=>[E(e,r,t),v(r,t)]),[e,""])[0];return void 0===t?n:n(t)},set:(t,r,n)=>{const o=p(t),a=e(((e,t)=>h(o,e,t,"")));return void 0===r?a:a(r,n)},assign:(t,r,n)=>{const o=p(t),a=e(((e,t)=>y(o,e,t,"")));return void 0===r?a:a(r,n)},unset:(e,t)=>{const r=p(e),n=e=>b(r,e,"");return void 0===t?n:n(t)},remove:(e,t)=>{const r=p(e),n=e=>m(r,e,"");return void 0===t?n:n(t)}};j.nil,j.append,j.get,j.set,j.assign,j.unset,j.remove;const S=Symbol("$__value"),A=Symbol("$__href");var P={cons:(e,t)=>Object.freeze({[A]:e,[S]:t}),isReference:e=>e&&void 0!==e[A],href:e=>e[A],value:e=>e[S]};const{jsonTypeOf:x}=d,I=Object.freeze({id:"",pointer:"",instance:void 0,value:void 0}),T=e=>P.isReference(e.value)?P.value(e.value):e.value,k=e(((e,t)=>x(T(e),t))),V=(e,t)=>Object.freeze({...t,pointer:j.append(e,t.pointer),value:T(t)[e]}),R=e(((e,t)=>T(t).map(((r,n,o,a)=>e(V(n,t),n,o,a))))),C=e(((e,t)=>T(t).map(((e,r,n,o)=>V(r,t))).filter(((t,r,n,o)=>e(t,r,n,o))))),U=e(((e,t,r)=>T(r).reduce(((t,n,o)=>e(t,V(o,r),o)),t))),z=e(((e,t)=>T(t).every(((r,n,o,a)=>e(V(n,t),n,o,a))))),K=e(((e,t)=>T(t).some(((r,n,o,a)=>e(V(n,t),n,o,a)))));var L={nil:I,cons:(e,t="")=>Object.freeze({...I,id:t,instance:e,value:e}),uri:e=>`${e.id}#${encodeURI(e.pointer)}`,value:T,has:(e,t)=>e in T(t),typeOf:k,step:V,entries:e=>Object.keys(T(e)).map((t=>[t,V(t,e)])),keys:e=>Object.keys(T(e)),map:R,filter:C,reduce:U,every:z,some:K,length:e=>T(e).length},q=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,D=/^[\u000b\u0020-\u007e\u0080-\u00ff]+$/,_=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,N=/\\([\u000b\u0020-\u00ff])/g,B=/([\\"])/g,F=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,J=function(e){if(!e)throw new TypeError("argument string is required");var t="object"==typeof e?function(e){var t;"function"==typeof e.getHeader?t=e.getHeader("content-type"):"object"==typeof e.headers&&(t=e.headers&&e.headers["content-type"]);if("string"!=typeof t)throw new TypeError("content-type header is missing from object");return t}(e):e;if("string"!=typeof t)throw new TypeError("argument string is required to be a string");var r=t.indexOf(";"),n=-1!==r?t.substr(0,r).trim():t.trim();if(!F.test(n))throw new TypeError("invalid media type");var o=new Z(n.toLowerCase());if(-1!==r){var a,i,s;for(q.lastIndex=r;i=q.exec(t);){if(i.index!==r)throw new TypeError("invalid parameter format");r+=i[0].length,a=i[1].toLowerCase(),'"'===(s=i[2])[0]&&(s=s.substr(1,s.length-2).replace(N,"$1")),o.parameters[a]=s}if(r!==t.length)throw new TypeError("invalid parameter format")}return o};function W(e){var t=String(e);if(_.test(t))return t;if(t.length>0&&!D.test(t))throw new TypeError("invalid parameter value");return'"'+t.replace(B,"\\$1")+'"'}function Z(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 t=e.parameters,r=e.type;if(!r||!F.test(r))throw new TypeError("invalid type");var n=r;if(t&&"object"==typeof t)for(var o,a=Object.keys(t).sort(),i=0;i<a.length;i++){if(o=a[i],!_.test(o))throw new TypeError("invalid parameter name");n+="; "+o+"="+W(t[o])}return n},parse:J},G=async e=>Object.entries(await e),H=e((async(e,t)=>(await t).map(e))),Q=e((async(e,t,r)=>(await r).reduce((async(t,r)=>e(await t,r)),t))),X=e((async(e,t,r={})=>Q((async(t,r)=>await e(r)?t.concat([r]):t),[],t,r))),Y=e((async(e,t)=>{const r=await H(e,t);return(await Promise.all(r)).some((e=>e))})),ee=e((async(e,t)=>{const r=await H(e,t);return(await Promise.all(r)).every((e=>e))})),te=e(((e,t)=>e.reduce((async(e,t)=>t(await e)),t))),re={entries:G,map:H,filter:X,reduce:Q,some:Y,every:ee,pipeline:te,all:e=>Promise.all(e),allValues:e=>te([G,Q((async(e,[t,r])=>(e[t]=await r,e)),{})],e)};re.entries,re.map,re.filter,re.reduce,re.some,re.every,re.pipeline,re.all,re.allValues;var ne=fetch;const{jsonTypeOf:oe,splitUrl:ae,safeResolveUrl:ie,pathRelative:se}=d,ce={},le={},ue=(e,t)=>{const r=e in le?le[e]:e;if(r in ce)return ce[r][t]},fe={},de={},pe=(e,t="",r="")=>{e=JSON.parse(JSON.stringify(e));const n=ae(e.$schema||r)[0];if(!n)throw Error("Couldn't determine schema version");delete e.$schema;const o=ue(n,"baseToken"),a=ue(n,"anchorToken"),i=ae(t)[0];if(!i&&!ae(e[o]||"")[0])throw Error("Couldn't determine an identifier for the schema");const s=ie(i,e[o]||""),[c,l]=ae(s);delete e[o],l&&o===a&&(e[a]=a!==o?encodeURI(l):`#${encodeURI(l)}`),i&&(de[i]=c);const u={},f=ue(n,"recursiveAnchorToken");let d;!0===e[f]&&(u[""]=`${c}#`,e[a]="",delete e[f]);const p=ue(n,"vocabularyToken");oe(e[p],"object")?(le[c]=n,d=e[p],delete e[p]):(le[c]=n,d={[n]:!0});const h={"":""};return fe[c]={id:c,schemaVersion:n,schema:he(e,c,n,j.nil,h,u),anchors:h,dynamicAnchors:u,vocabulary:d,validated:!1},c},he=(e,t,r,n,o,a)=>{if(oe(e,"object")){const i="string"==typeof e.$schema?ae(e.$schema)[0]:r,s=ue(i,"embeddedToken"),c=ue(i,"anchorToken");if("string"==typeof e[s]&&(s!==c||"#"!==e[s][0])){const n=ie(t,e[s]);return e[s]=n,pe(e,n,r),P.cons(e[s],e)}const l=ue(r,"anchorToken"),u=ue(r,"dynamicAnchorToken");"string"==typeof e[u]&&(a[e[u]]=`${t}#${encodeURI(n)}`,o[e[u]]=n,delete e[u]);const f=ue(r,"embeddedToken");if("string"==typeof e[l]){const t=l!==f?e[l]:e[l].slice(1);o[t]=n,delete e[l]}const d=ue(r,"jrefToken");if("string"==typeof e[d])return P.cons(e[d],e);for(const i in e)e[i]=he(e[i],t,r,j.append(i,n),o,a);return e}return Array.isArray(e)?e.map(((e,i)=>he(e,t,r,j.append(i,n),o,a))):e},ye=e=>fe[de[e]]||fe[e],be=Object.freeze({id:"",schemaVersion:void 0,vocabulary:{},pointer:j.nil,schema:void 0,value:void 0,anchors:{},dynamicAnchors:{},validated:!0}),me=async(e,t=be)=>{const r=ie(we(t),e),[n,o]=ae(r);if(!(e=>e in fe||e in de)(n)){const e=await ne(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 t=M.parse(e.headers.get("content-type")).type;if("application/schema+json"!==t)throw Error(`${n} is not a schema. Found a document with media type: ${t}`)}pe(await e.json(),n)}const a=ye(n),i="/"!==o[0]?ge(a,o):o,s=Object.freeze({...a,pointer:i,value:j.get(i,a.schema)});return ve(s)},ve=e=>P.isReference(e.value)?me(P.href(e.value),e):e,ge=(e,t)=>{if(!(t in e.anchors))throw Error(`No such anchor '${encodeURI(e.id)}#${encodeURI(t)}'`);return e.anchors[t]},we=e=>`${e.id}#${encodeURI(e.pointer)}`,Oe=e=>P.isReference(e.value)?P.value(e.value):e.value,Ee=(e,t)=>{const r=ye(t.id),n=Object.freeze({...t,pointer:j.append(e,t.pointer),value:Oe(t)[e],validated:r.validated});return ve(n)},$e=e(((e,t)=>re.pipeline([Oe,re.map((async(r,n)=>e(await Ee(n,t),n))),re.all],t))),je={parentId:"",parentDialect:"",includeEmbedded:!0},Se=(e,t)=>{if(t.startsWith("file://")){const r=e.slice(7,e.lastIndexOf("/"));return""===e?"":se(r,t.slice(7))}return t};var Ae={setConfig:(e,t,r)=>{ce[e]||(ce[e]={}),ce[e][t]=r},getConfig:ue,add:pe,get:me,markValidated:e=>{fe[e].validated=!0},uri:we,value:Oe,getAnchorPointer:ge,typeOf:(e,t)=>oe(Oe(e),t),has:(e,t)=>e in Oe(t),step:Ee,keys:e=>Object.keys(Oe(e)),entries:e=>re.pipeline([Oe,Object.keys,re.map((async t=>[t,await Ee(t,e)])),re.all],e),map:$e,length:e=>Oe(e).length,toSchema:(e,t={})=>{const r={...je,...t},n=JSON.parse(JSON.stringify(e.schema,((t,n)=>{if(!P.isReference(n))return n;const o=P.value(n),a=o.$schema||e.schemaVersion,i=ue(a,"embeddedToken");return!r.includeEmbedded&&i in o?void 0:P.value(n)}))),o=ue(e.schemaVersion,"dynamicAnchorToken");Object.entries(e.dynamicAnchors).forEach((([e,t])=>{const r=ae(t)[1];j.assign(r,n,{[o]:e,...j.get(r,n)})}));const a=ue(e.schemaVersion,"anchorToken");Object.entries(e.anchors).filter((([e])=>""!==e)).forEach((([e,t])=>{j.assign(t,n,{[a]:e,...j.get(t,n)})}));const i=ue(e.schemaVersion,"baseToken"),s=Se(r.parentId,e.id),c=r.parentDialect===e.schemaVersion?"":e.schemaVersion;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 Pe extends Error{constructor(e){super("Invalid Schema"),this.name=this.constructor.name,this.output=e}}var xe=Pe;const{splitUrl:Ie}=d,Te="FLAG",ke="BASIC",Ve="DETAILED",Re="VERBOSE";let Ce=Ve,Ue=!0;const ze=async e=>{const t={metaData:{}};return{ast:t,schemaUri:await Fe(e,t)}},Ke=e((({ast:e,schemaUri:t},r,n=Te)=>{if(![Te,ke,Ve,Re].includes(n))throw Error(`The '${n}' error format is not supported`);const a=[],i=o.subscribe("result",Le(n,a));return We(t,r,e,{}),o.unsubscribe(i),a[0]})),Le=(e,t)=>{const r=[];return(n,o)=>{if("result"===n){const{keyword:e,absoluteKeywordLocation:t,instanceLocation:n,valid:a}=o,i={keyword:e,absoluteKeywordLocation:t,instanceLocation:n,valid:a,errors:[]};r.push(i)}else if("result.start"===n)r.push(n);else if("result.end"===n){const n=r.pop();for(;"result.start"!==r[r.length-1];){const t=r.pop(),o=[t];e===ke&&(o.push(...t.errors),delete t.errors),(e===Re||e!==Te&&!t.valid)&&n.errors.unshift(...o)}r[r.length-1]=n,t[0]=n}}},qe={},De=e=>qe[e],_e=e=>e in qe,Ne={},Be={},Fe=async(e,t)=>{if(e=await Je(e),!_e(`${e.schemaVersion}#validate`)){const t=await Ae.get(e.schemaVersion);(Ae.getConfig(t.id,"mandatoryVocabularies")||[]).forEach((e=>{if(!t.vocabulary[e])throw Error(`Vocabulary '${e}' must be explicitly declared and required`)})),Object.entries(t.vocabulary).forEach((([e,r])=>{if(e in Ne)Object.entries(Ne[e]).forEach((([e,r])=>{((e,t)=>{qe[e]={collectEvaluatedItems:(e,r,n,o,a)=>t.interpret(e,r,n,o,a)&&new Set,collectEvaluatedProperties:(e,r,n,o,a)=>t.interpret(e,r,n,o,a)&&[],...t}})(`${t.id}#${e}`,r)}));else if(r)throw Error(`Missing required vocabulary: ${e}`)}))}if(Ue&&!e.validated){if(Ae.markValidated(e.id),!(e.schemaVersion in Be)){const t=await Ae.get(e.schemaVersion),r=await ze(t);Be[t.id]=Ke(r)}const t=L.cons(e.schema,e.id),r=Be[e.schemaVersion](t,Ce);if(!r.valid)throw new xe(r)}return e.id in t.metaData||(t.metaData[e.id]={id:e.id,dynamicAnchors:e.dynamicAnchors,anchors:e.anchors}),De(`${e.schemaVersion}#validate`).compile(e,t)},Je=async e=>Ae.typeOf(e,"string")?Je(await Ae.get(Ae.value(e),e)):e,We=(e,t,r,n)=>{const o=Ze(e,r),a=Ie(e)[0];return De(o).interpret(e,t,r,{...r.metaData[a].dynamicAnchors,...n})},Ze=(e,t)=>{if(!(e in t))throw Error(`No schema found at ${e}`);return t[e][0]};var Me={validate:async(e,t,r)=>{const n=await ze(e),o=(e,t)=>Ke(n,L.cons(e),t);return void 0===t?o:o(t,r)},compile:ze,interpret:Ke,setMetaOutputFormat:e=>{Ce=e},setShouldMetaValidate:e=>{Ue=e},FLAG:Te,BASIC:ke,DETAILED:Ve,VERBOSE:Re,add:(e,t="",r="")=>{const n=Ae.add(e,t,r);delete Be[n]},getKeyword:De,hasKeyword:_e,defineVocabulary:(e,t)=>{Ne[e]=t},compileSchema:Fe,interpretSchema:We,collectEvaluatedProperties:(e,t,r,n,o)=>{const a=Ze(e,r);return De(a).collectEvaluatedProperties(e,t,r,n,o)},collectEvaluatedItems:(e,t,r,n,o)=>{const a=Ze(e,r);return De(a).collectEvaluatedItems(e,t,r,n,o)}};var Ge={compile:e=>Ae.value(e),interpret:()=>!0};var He={compile:async(e,t)=>{const r=Ae.uri(e);if(!(r in t)){t[r]=!1;const n=Ae.value(e);if(!["object","boolean"].includes(typeof n))throw Error(`No schema found at '${Ae.uri(e)}'`);t[r]=[`${e.schemaVersion}#validate`,Ae.uri(e),"boolean"==typeof n?n:await re.pipeline([Ae.entries,re.map((([t,r])=>[`${e.schemaVersion}#${t}`,r])),re.filter((([t])=>Me.hasKeyword(t)&&t!==`${e.schemaVersion}#validate`)),re.map((async([r,n])=>{const o=await Me.getKeyword(r).compile(n,t,e);return[r,Ae.uri(n),o]})),re.all],e)]}return r},interpret:(e,t,r,n)=>{const[a,i,s]=r[e];o.publishSync("result.start");const c="boolean"==typeof s?s:s.every((([e,a,i])=>{o.publishSync("result.start");const s=Me.getKeyword(e).interpret(i,t,r,n);return o.publishSync("result",{keyword:e,absoluteKeywordLocation:a,instanceLocation:L.uri(t),valid:s,ast:i}),o.publishSync("result.end"),s}));return o.publishSync("result",{keyword:a,absoluteKeywordLocation:i,instanceLocation:L.uri(t),valid:c,ast:e}),o.publishSync("result.end"),c},collectEvaluatedProperties:(e,t,r,n,o=!1)=>{const a=r[e][2];return"boolean"==typeof a?!!a&&[]:a.filter((([e])=>!o||!e.endsWith("#unevaluatedProperties"))).reduce(((e,[o,,a])=>{const i=e&&Me.getKeyword(o).collectEvaluatedProperties(a,t,r,n);return!1!==i&&[...e,...i]}),[])},collectEvaluatedItems:(e,t,r,n,o=!1)=>{const a=r[e][2];return"boolean"==typeof a?!!a&&new Set:a.filter((([e])=>!o||!e.endsWith("#unevaluatedItems"))).reduce(((e,[o,,a])=>{const i=!1!==e&&Me.getKeyword(o).collectEvaluatedItems(a,t,r,n);return!1!==i&&new Set([...e,...i])}),new Set)}},Qe={metaData:Ge,validate:He},Xe={Core:Me,Schema:Ae,Instance:L,Reference:P,Keywords:Qe,InvalidSchemaError:xe},Ye=Xe.Core,et=Xe.Schema,tt=Xe.Instance,rt=Xe.Reference,nt=Xe.Keywords,ot=Xe.InvalidSchemaError;export{Ye as Core,tt as Instance,ot as InvalidSchemaError,nt as Keywords,rt as Reference,et as Schema,Xe as default};
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),h=t(a+"{1,4}"),d=t(t(h+"\\:"+h)+"|"+f),v=t(t(h+"\\:")+"{6}"+d),y=t("\\:\\:"+t(h+"\\:")+"{5}"+d),m=t(t(h)+"?\\:\\:"+t(h+"\\:")+"{4}"+d),g=t(t(t(h+"\\:")+"{0,1}"+h)+"?\\:\\:"+t(h+"\\:")+"{3}"+d),b=t(t(t(h+"\\:")+"{0,2}"+h)+"?\\:\\:"+t(h+"\\:")+"{2}"+d),w=t(t(t(h+"\\:")+"{0,3}"+h)+"?\\:\\:"+h+"\\:"+d),E=t(t(t(h+"\\:")+"{0,4}"+h)+"?\\:\\:"+d),S=t(t(t(h+"\\:")+"{0,5}"+h)+"?\\:\\:"+h),C=t(t(t(h+"\\:")+"{0,6}"+h)+"?\\:\\:"),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 j=t(i+"|"+r(l,s,"[\\:\\@]"));return t(t(i+"|"+r(l,s,"[\\@]"))+"+"),t(t(j+"|"+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,h=36,d=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=h-d,j=Math.floor,T=String.fromCharCode;function I(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 D(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 P(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 $=function(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:h},R=function(e,r){return e+22+75*(e<26)-((0!=r)<<5)},N=function(e,r,t){var n=0;for(e=t?j(e/m):e>>1,e+=j(e/r);e>A*v>>1;n+=h)e=j(e/A);return j(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&&I("not-basic"),r.push(e.charCodeAt(s));for(var c=i>0?i+1:0;c<t;){for(var u=n,l=1,p=h;;p+=h){c>=t&&I("invalid-input");var y=$(e.charCodeAt(c++));(y>=h||y>j((f-n)/l))&&I("overflow"),n+=y*l;var m=p<=a?d:p>=a+v?v:p-a;if(y<m)break;var E=h-m;l>j(f/E)&&I("overflow"),l*=E}var S=r.length+1;a=N(n-u,S,0==u),j(n/S)>f-o&&I("overflow"),o+=j(n/S),n%=S,r.splice(n++,0,o)}return String.fromCodePoint.apply(String,r)},_=function(e){var r=[],t=(e=P(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 D=A.value;D>=n&&D<E&&(E=D)}}catch(e){C=!0,O=e}finally{try{!S&&x.return&&x.return()}finally{if(C)throw O}}var $=m+1;E-n>j((f-o)/$)&&I("overflow"),o+=(E-n)*$,n=E;var F=!0,_=!1,V=void 0;try{for(var U,k=e[Symbol.iterator]();!(F=(U=k.next()).done);F=!0){var q=U.value;if(q<n&&++o>f&&I("overflow"),q==n){for(var L=o,z=h;;z+=h){var H=z<=a?d:z>=a+v?v:z-a;if(L<H)break;var K=L-H,M=h-H;r.push(T(R(H+K%M,0))),L=j(K/M)}r.push(T(R(L,0))),a=N(o,$,m==y),o=0,++m}}}catch(e){_=!0,V=e}finally{try{!F&&k.return&&k.return()}finally{if(_)throw V}}++o,++n}return r.join("")},V=function(e){return D(e,(function(e){return E.test(e)?F(e.slice(4).toLowerCase()):e}))},U=function(e){return D(e,(function(e){return S.test(e)?"xn--"+_(e):e}))},k={version:"2.1.0",ucs2:{decode:P,encode:function(e){return String.fromCodePoint.apply(String,p(e))}},decode:F,encode:_,toASCII:U,toUnicode:V},q={};function L(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 z(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 H(e,r){function t(e){var t=z(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,L).replace(r.PCT_ENCODED,o)),void 0!==e.host&&(e.host=String(e.host).replace(r.PCT_ENCODED,t).toLowerCase().replace(r.NOT_HOST,L).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,L).replace(r.PCT_ENCODED,o)),void 0!==e.query&&(e.query=String(e.query).replace(r.PCT_ENCODED,t).replace(r.NOT_QUERY,L).replace(r.PCT_ENCODED,o)),void 0!==e.fragment&&(e.fragment=String(e.fragment).replace(r.PCT_ENCODED,t).replace(r.NOT_FRAGMENT,L).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),h=r.IPV4ADDRESS.test(f[f.length-1]),d=h?7:8,v=f.length-d,y=Array(d),m=0;m<d;++m)y[m]=p[m]||f[v+m]||"";h&&(y[d-1]=M(y[d-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 B=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,J=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(B);if(o){J?(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=q[(r.scheme||t.scheme||"").toLowerCase()];if(r.unicodeSupport||a&&a.unicodeSupport)H(t,n);else{if(t.host&&(r.domainHost||a&&a.domainHost))try{t.host=k.toASCII(t.host.replace(n.PCT_ENCODED,z).toLowerCase())}catch(e){t.error=t.error||"Host's domain name can not be converted to ASCII via punycode: "+e}H(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=q[(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?k.toUnicode(e.host):k.toASCII(e.host.replace(t.PCT_ENCODED,z).toLowerCase())}catch(t){e.error=e.error||"Host's domain name can not be converted to "+(r.iri?"Unicode":"ASCII")+" via punycode: "+t}H(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,L)}function ce(e,r){return e&&e.toString().replace(r&&r.iri?u.PCT_ENCODED:c.PCT_ENCODED,z)}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}},he={scheme:"wss",domainHost:fe.domainHost,parse:fe.parse,serialize:fe.serialize},de={},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 je(e){var r=z(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 h=0,d=n.length;h<d;++h){var v=n[h].split("@");if(v[0]=ce(v[0]),r.unicodeSupport)v[1]=ce(v[1],r).toLowerCase();else try{v[1]=k.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[h]=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,je).replace(Se,o).replace(Ce,L),p=c.slice(u+1);try{p=r.iri?k.toUnicode(p):k.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 h=[];for(var d in f)f[d]!==de[d]&&h.push(d.replace(Se,je).replace(Se,o).replace(Oe,L)+"="+f[d].replace(Se,je).replace(Se,o).replace(Ae,L));return h.length&&(t.query=h.join("&")),t}},Ie=/^([^\:]+)\:(.*)/,xe={scheme:"urn",parse:function(e,r){var t=e.path&&e.path.match(Ie),n=e;if(t){var o=r.scheme||n.scheme||"urn",a=t[1].toLowerCase(),i=t[2],s=o+":"+(r.nid||a),c=q[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=q[o];a&&(e=a.serialize(e,r));var i=e,s=e.nss;return i.path=(n||r.nid)+":"+s,i}},De=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/,Pe={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(De)||(t.error=t.error||"UUID is not valid."),t},serialize:function(e,r){var t=e;return t.nss=(e.uuid||"").toLowerCase(),t}};q[ue.scheme]=ue,q[le.scheme]=le,q[fe.scheme]=fe,q[he.scheme]=he,q[Te.scheme]=Te,q[xe.scheme]=xe,q[Pe.scheme]=Pe,e.SCHEMES=q,e.pctEncChar=L,e.pctDecChars=z,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,h(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,h(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,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 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,h(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)},h=e(((e,r)=>r+"/"+d(e))),d=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:h,get:(e,r)=>{const t=c(e),n=e=>t.reduce((([e,r],t)=>[m(e,t,r),h(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}),j=e=>S.isReference(e.value)?S.value(e.value):e.value,T=e(((e,r)=>O(j(e),r))),I=(e,r)=>Object.freeze({...r,pointer:b.append(e,r.pointer),value:j(r)[e]}),x=e(((e,r)=>j(r).map(((t,n,o,a)=>e(I(n,r),n,o,a))))),D=e(((e,r)=>j(r).map(((e,t,n,o)=>I(t,r))).filter(((r,t,n,o)=>e(r,t,n,o))))),P=e(((e,r,t)=>j(t).reduce(((r,n,o)=>e(r,I(o,t),o)),r))),$=e(((e,r)=>j(r).every(((t,n,o,a)=>e(I(n,r),n,o,a))))),R=e(((e,r)=>j(r).some(((t,n,o,a)=>e(I(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:j,has:(e,r)=>e in j(r),typeOf:T,step:I,entries:e=>Object.keys(j(e)).map((r=>[r,I(r,e)])),keys:e=>Object.keys(j(e)),map:x,filter:D,reduce:P,every:$,some:R,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,_=/^[\u000b\u0020-\u007e\u0080-\u00ff]+$/,V=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,U=/\\([\u000b\u0020-\u00ff])/g,k=/([\\"])/g,q=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,L=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(!q.test(n))throw new TypeError("invalid media type");var o=new H(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 z(e){var r=String(e);if(V.test(r))return r;if(r.length>0&&!_.test(r))throw new TypeError("invalid parameter value");return'"'+r.replace(k,"\\$1")+'"'}function H(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||!q.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],!V.test(o))throw new TypeError("invalid parameter name");n+="; "+o+"="+z(r[o])}return n},parse:L},M=async e=>Object.entries(await e),Z=e((async(e,r)=>(await r).map(e))),B=e((async(e,r,t)=>(await t).reduce((async(r,t)=>e(await r,t)),r))),J=e((async(e,r,t={})=>B((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:J,reduce:B,some:G,every:W,pipeline:Q,all:e=>Promise.all(e),allValues:e=>Q([M,B((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={},ae={},ie=(e,r)=>{const t=e in ae?ae[e]:e;if(t in oe)return oe[t][r]},se={},ce={},ue=(e,r="",t="")=>{e=JSON.parse(JSON.stringify(e));const n=re(e.$schema||t,"");if(!n)throw Error("Couldn't determine schema version");delete e.$schema;const o=ie(n,"baseToken"),a=ie(n,"anchorToken"),i=re(r,"");if(!i&&!re(e[o]||"",""))throw Error("Couldn't determine an identifier for the schema");const s=re(i,e[o]||""),c=re(s,""),u=te(s);delete e[o],u&&o===a&&(e[a]=a!==o?encodeURI(u):`#${encodeURI(u)}`),i&&(ce[i]=c);const l={},p=ie(n,"recursiveAnchorToken");let f;!0===e[p]&&(l[""]=`${c}#`,e[a]="",delete e[p]);const h=ie(n,"vocabularyToken");ee(e[h],"object")?(ae[c]=n,f=e[h],delete e[h]):(ae[c]=n,f={[n]:!0});const d={"":""};return se[c]={id:c,schemaVersion:n,schema:le(e,c,n,b.nil,d,l),anchors:d,dynamicAnchors:l,vocabulary:f,validated:!1},c},le=(e,r,t,n,o,a)=>{if(ee(e,"object")){const i="string"==typeof e.$schema?re(e.$schema,""):t,s=ie(i,"embeddedToken"),c=ie(i,"anchorToken");if("string"==typeof e[s]&&(s!==c||"#"!==e[s][0])){const n=re(r,e[s]);return e[s]=n,ue(e,n,t),S.cons(e[s],e)}const u=ie(t,"anchorToken"),l=ie(t,"dynamicAnchorToken");"string"==typeof e[l]&&(a[e[l]]=`${r}#${encodeURI(n)}`,o[e[l]]=n,delete e[l]);const p=ie(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=ie(t,"jrefToken");if("string"==typeof e[f])return S.cons(e[f],e);for(const i in e)e[i]=le(e[i],r,t,b.append(i,n),o,a);return e}return Array.isArray(e)?e.map(((e,i)=>le(e,r,t,b.append(i,n),o,a))):e},pe=e=>se[ce[e]]||se[e],fe=Object.freeze({id:"",schemaVersion:void 0,vocabulary:{},pointer:b.nil,schema:void 0,value:void 0,anchors:{},dynamicAnchors:{},validated:!0}),he=async(e,r=fe)=>{const t=re(ye(r),e),n=re(t,""),o=te(t);if(!(e=>e in se||e in ce)(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}`)}ue(await e.json(),n)}const a=pe(n),i="/"!==o[0]?ve(a,o):o,s=Object.freeze({...a,pointer:i,value:b.get(i,a.schema)});return de(s)},de=e=>S.isReference(e.value)?he(S.href(e.value),e):e,ve=(e,r)=>{if(!(r in e.anchors))throw Error(`No such anchor '${encodeURI(e.id)}#${encodeURI(r)}'`);return e.anchors[r]},ye=e=>`${e.id}#${encodeURI(e.pointer)}`,me=e=>S.isReference(e.value)?S.value(e.value):e.value,ge=(e,r)=>{const t=pe(r.id),n=Object.freeze({...r,pointer:b.append(e,r.pointer),value:me(r)[e],validated:t.validated});return de(n)},be=e(((e,r)=>Y.pipeline([me,Y.map((async(t,n)=>e(await ge(n,r),n))),Y.all],r))),we={parentId:"",parentDialect:"",includeEmbedded:!0},Ee=(e,r)=>{if(r.startsWith("file://")){const t=e.slice(7,e.lastIndexOf("/"));return""===e?"":ne(t,r.slice(7))}return r};var Se={setConfig:(e,r,t)=>{oe[e]||(oe[e]={}),oe[e][r]=t},getConfig:ie,add:ue,get:he,markValidated:e=>{se[e].validated=!0},uri:ye,value:me,getAnchorPointer:ve,typeOf:(e,r)=>ee(me(e),r),has:(e,r)=>e in me(r),step:ge,keys:e=>Object.keys(me(e)),entries:e=>Y.pipeline([me,Object.keys,Y.map((async r=>[r,await ge(r,e)])),Y.all],e),map:be,length:e=>me(e).length,toSchema:(e,r={})=>{const t={...we,...r},n=JSON.parse(JSON.stringify(e.schema,((r,n)=>{if(!S.isReference(n))return n;const o=S.value(n),a=o.$schema||e.schemaVersion,i=ie(a,"embeddedToken");return!t.includeEmbedded&&i in o?void 0:S.value(n)}))),o=ie(e.schemaVersion,"dynamicAnchorToken");Object.entries(e.dynamicAnchors).forEach((([e,r])=>{const t=te(r);b.assign(t,n,{[o]:e,...b.get(t,n)})}));const a=ie(e.schemaVersion,"anchorToken");Object.entries(e.anchors).filter((([e])=>""!==e)).forEach((([e,r])=>{b.assign(r,n,{[a]:e,...b.get(r,n)})}));const i=ie(e.schemaVersion,"baseToken"),s=Ee(t.parentId,e.id),c=t.parentDialect===e.schemaVersion?"":e.schemaVersion;return{...s&&{[i]:s},...c&&{$schema:c},...n}}};Se.setConfig,Se.getConfig,Se.add,Se.get,Se.markValidated,Se.uri,Se.value,Se.getAnchorPointer,Se.typeOf,Se.has,Se.step,Se.keys,Se.entries,Se.map,Se.length,Se.toSchema;class Ce extends Error{constructor(e){super("Invalid Schema"),this.name=this.constructor.name,this.output=e}}var Oe=Ce;const{resolveUrl:Ae}=s,je="FLAG",Te="BASIC",Ie="DETAILED",xe="VERBOSE";let De=Ie,Pe=!0;const $e=async e=>{const r={metaData:{}};return{ast:r,schemaUri:await qe(e,r)}},Re=e((({ast:e,schemaUri:r},t,o=je)=>{if(![je,Te,Ie,xe].includes(o))throw Error(`The '${o}' error format is not supported`);const a=[],i=n.subscribe("result",Ne(o,a));return ze(r,t,e,{}),n.unsubscribe(i),a[0]})),Ne=(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===Te&&(o.push(...r.errors),delete r.errors),(e===xe||e!==je&&!r.valid)&&n.errors.unshift(...o)}t[t.length-1]=n,r[0]=n}}},Fe={},_e=e=>Fe[e],Ve=e=>e in Fe,Ue={},ke={},qe=async(e,r)=>{if(e=await Le(e),!Ve(`${e.schemaVersion}#validate`)){const r=await Se.get(e.schemaVersion);(Se.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 Ue)Object.entries(Ue[e]).forEach((([e,t])=>{((e,r)=>{Fe[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(Pe&&!e.validated){if(Se.markValidated(e.id),!(e.schemaVersion in ke)){const r=await Se.get(e.schemaVersion),t=await $e(r);ke[r.id]=Re(t)}const r=N.cons(e.schema,e.id),t=ke[e.schemaVersion](r,De);if(!t.valid)throw new Oe(t)}return e.id in r.metaData||(r.metaData[e.id]={id:e.id,dynamicAnchors:e.dynamicAnchors,anchors:e.anchors}),_e(`${e.schemaVersion}#validate`).compile(e,r)},Le=async e=>Se.typeOf(e,"string")?Le(await Se.get(Se.value(e),e)):e,ze=(e,r,t,n)=>{const o=He(e,t),a=Ae(e,"");return _e(o).interpret(e,r,t,{...t.metaData[a].dynamicAnchors,...n})},He=(e,r)=>{if(!(e in r))throw Error(`No schema found at ${e}`);return r[e][0]};var Ke={validate:async(e,r,t)=>{const n=await $e(e),o=(e,r)=>Re(n,N.cons(e),r);return void 0===r?o:o(r,t)},compile:$e,interpret:Re,setMetaOutputFormat:e=>{De=e},setShouldMetaValidate:e=>{Pe=e},FLAG:je,BASIC:Te,DETAILED:Ie,VERBOSE:xe,add:(e,r="",t="")=>{const n=Se.add(e,r,t);delete ke[n]},getKeyword:_e,hasKeyword:Ve,defineVocabulary:(e,r)=>{Ue[e]=r},compileSchema:qe,interpretSchema:ze,collectEvaluatedProperties:(e,r,t,n,o)=>{const a=He(e,t);return _e(a).collectEvaluatedProperties(e,r,t,n,o)},collectEvaluatedItems:(e,r,t,n,o)=>{const a=He(e,t);return _e(a).collectEvaluatedItems(e,r,t,n,o)}};var Me={compile:e=>Se.value(e),interpret:()=>!0};var Ze={compile:async(e,r)=>{const t=Se.uri(e);if(!(t in r)){r[t]=!1;const n=Se.value(e);if(!["object","boolean"].includes(typeof n))throw Error(`No schema found at '${Se.uri(e)}'`);r[t]=[`${e.schemaVersion}#validate`,Se.uri(e),"boolean"==typeof n?n:await Y.pipeline([Se.entries,Y.map((([r,t])=>[`${e.schemaVersion}#${r}`,t])),Y.filter((([r])=>Ke.hasKeyword(r)&&r!==`${e.schemaVersion}#validate`)),Y.map((async([t,n])=>{const o=await Ke.getKeyword(t).compile(n,r,e);return[t,Se.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=Ke.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&&Ke.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&&Ke.getKeyword(o).collectEvaluatedItems(a,r,t,n);return!1!==i&&new Set([...e,...i])}),new Set)}},Be={metaData:Me,validate:Ze},Je={Core:Ke,Schema:Se,Instance:N,Reference:S,Keywords:Be,InvalidSchemaError:Oe},Ge=Je.Core,We=Je.Schema,Qe=Je.Instance,Ye=Je.Reference,Xe=Je.Keywords,er=Je.InvalidSchemaError;export{Ge as Core,Qe as Instance,er as InvalidSchemaError,Xe as Keywords,Ye as Reference,We as Schema,Je as default};
//# sourceMappingURL=json-schema-core-esm.min.js.map

@@ -1,2 +0,4 @@

var JSC=function(e){"use strict";var t=function(e,t){return function r(){null==t&&(t=e.length);var n=[].slice.call(arguments);return n.length>=t?e.apply(this,n):function(){return r.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:{};var n,o,a=(n=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 t={},r=-1,n="*";function o(e){var t;for(t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!0;return!1}function a(e){return function(){throw e}}function i(e,t,r){try{e(t,r)}catch(e){setTimeout(a(e),0)}}function s(e,t,r){e(t,r)}function c(e,r,n,o){var a,c=t[r],l=o?s:i;if(Object.prototype.hasOwnProperty.call(t,r))for(a in c)Object.prototype.hasOwnProperty.call(c,a)&&l(c[a],e,n)}function l(e,t,r){return function(){var o=String(e),a=o.lastIndexOf(".");for(c(e,e,t,r);-1!==a;)a=(o=o.substr(0,a)).lastIndexOf("."),c(e,o,t,r);c(e,n,t,r)}}function u(e){var r=String(e);return Boolean(Object.prototype.hasOwnProperty.call(t,r)&&o(t[r]))}function f(e){for(var t=String(e),r=u(t)||u(n),o=t.lastIndexOf(".");!r&&-1!==o;)o=(t=t.substr(0,o)).lastIndexOf("."),r=u(t);return r}function d(e,t,r,n){var o=l(e="symbol"==typeof e?e.toString():e,t,n);return!!f(e)&&(!0===r?o():setTimeout(o,0),!0)}e.publish=function(t,r){return d(t,r,!1,e.immediateExceptions)},e.publishSync=function(t,r){return d(t,r,!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(t,e)||(t[e]={});var o="uid_"+String(++r);return t[e][o]=n,o},e.subscribeAll=function(t){return e.subscribe(n,t)},e.subscribeOnce=function(t,r){var n=e.subscribe(t,(function(){e.unsubscribe(n),r.apply(this,arguments)}));return e},e.clearAllSubscriptions=function(){t={}},e.clearSubscriptions=function(e){var r;for(r in t)Object.prototype.hasOwnProperty.call(t,r)&&0===r.indexOf(e)&&delete t[r]},e.countSubscriptions=function(e){var r,n,o=0;for(r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&0===r.indexOf(e)){for(n in t[r])o++;break}return o},e.getSubscriptions=function(e){var r,n=[];for(r in t)Object.prototype.hasOwnProperty.call(t,r)&&0===r.indexOf(e)&&n.push(r);return n},e.unsubscribe=function(r){var n,o,a,i=function(e){var r;for(r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&0===r.indexOf(e))return!0;return!1},s="string"==typeof r&&(Object.prototype.hasOwnProperty.call(t,r)||i(r)),c=!s&&"string"==typeof r,l="function"==typeof r,u=!1;if(!s){for(n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(o=t[n],c&&o[r]){delete o[r],u=r;break}if(l)for(a in o)Object.prototype.hasOwnProperty.call(o,a)&&o[a]===r&&(delete o[a],u=!0)}return u}e.clearSubscriptions(r)}}(o)),void 0!==e&&e.exports&&(t=e.exports=o),t.PubSub=o,e.exports=t=o},n(o={exports:{}},o.exports),o.exports);a.PubSub;var i=function(e,t){if(e=e.trim(),(t=t.trim()).startsWith("about:"))return t;const r=function(e){const t={host:"",path:"",query:"",protocol:""};let r=e,n=e.indexOf("//");t.protocol=r.substring(0,n),n+=2;const o=e.indexOf("/",n),a=e.indexOf("?"),i=e.indexOf("#");-1!==i&&(r=r.substring(0,i));if(-1!==a){const e=r.substring(a);t.query=e,r=r.substring(0,a)}if(-1!==o){const e=r.substring(0,o);t.host=e,r=r.substring(o),t.path=r}else t.host=r;return t}(e),n=function(e){const t={href:e,hash:"",query:"",netPath:!1,absolutePath:!1,relativePath:!1};if(l.test(e))return t.netPath=!0,t;"/"===e[0]?t.absolutePath=!0:""!==e&&(t.relativePath=!0);let r=e;const n=e.indexOf("?"),o=e.indexOf("#");if(-1!==o){const e=r.substring(o);t.hash=e,r=r.substring(0,o)}if(-1!==n){const e=r.substring(n);t.query=e,r=r.substring(0,n)}return t.path=r,t}(t);if(!r.protocol&&!n.netPath)throw new Error("Error, protocol is not specified");if(n.netPath)return n.href.startsWith("//")&&(n.href=r.protocol+n.href),function(e){const t=e.indexOf("//")+2,r=!e.includes("/",t),n=!e.includes("?",t),o=!e.includes("#",t);return r&&n&&o}(n.href)?s(n.href):n.href;if(n.absolutePath){const{path:e,query:t,hash:o}=n;return r.host+c(e)+t+o}if(n.relativePath){const{path:e,query:t,hash:o}=n;let a,i=r.path,s=r.host;return 0===e.length?a=i:(i=i.substring(0,i.lastIndexOf("/")),a=c(i+"/"+e)),s+=""!==a||t||o?a+t+o:"/",s}{const{host:e,path:t,query:o}=r;return t||o?e+t+o+n.hash:s(e)}};function s(e){return e+("/"===e[e.length-1]?"":"/")}function c(e){let t=e.split("/");""===t[0]&&(t=t.slice(1));let r=[];return t.forEach(((e,n)=>{"."!==e&&(".."===e?r.pop():""===e&&n!==t.length-1||r.push(e))})),"/"+r.join("/")}const l=new RegExp("^([a-z][a-z0-9+.-]*:)?//","i");const u={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},f=e=>{const t=e.indexOf("#"),r=-1===t?e.length:t,n=e.slice(0,r),o=e.slice(r+1);return[decodeURI(n),decodeURI(o)]},d=e=>{const t=RegExp(/^(.+):\/\//).exec(e);return t?t[1]:""};var p={jsonTypeOf:(e,t)=>u[t](e),splitUrl:f,safeResolveUrl:(e,t)=>{const r=i(e,t),n=f(e)[0];if(n&&"file"===d(r)&&"file"!==d(n))throw Error(`Can't access file '${r}' resource from network context '${e}'`);return r},pathRelative:(e,t)=>{if(e===t)return"";let r=1;const n=e.length-1,o=t.length-r,a=n<o?n:o;let i=-1,s=0;for(;s<a;s++){const n=e.charCodeAt(s+1);if(n!==t.charCodeAt(r+s))break;47===n&&(i=s)}if(o>a){if(47===t.charCodeAt(r+s))return t.slice(r+s+1);if(0===s)return t.slice(r+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 r+=i,c.length>0?`${c}${t.slice(r,t.length)}`:(47===t.charCodeAt(r)&&++r,t.slice(r,t.length))}};const h=e=>{if(e.length>0&&"/"!==e[0])throw Error("Invalid JSON Pointer");return e.split("/").slice(1).map(O)},y=(e,t,r,n)=>{if(0===e.length)return r;if(e.length>1){const o=e.shift();return{...t,[o]:y(e,j(t,o,n),r,g(o,n))}}if(Array.isArray(t)){const n=[...t];return n[E(t,e[0])]=r,n}return"object"==typeof t&&null!==t?{...t,[e[0]]:r}:j(t,e[0],n)},b=(e,t,r,n)=>{if(0!==e.length)if(1!==e.length||S(t)){const o=e.shift();b(e,j(t,o,n),r,g(o,n))}else{t[E(t,e[0])]=r}},v=(e,t,r)=>{if(0!=e.length){if(e.length>1){const n=e.shift(),o=j(t,n,r);return{...t,[n]:v(e,o,g(n,r))}}if(Array.isArray(t))return t.filter(((t,r)=>r!=e[0]));if("object"==typeof t&&null!==t){const{[e[0]]:r,...n}=t;return n}return j(t,e[0],r)}},m=(e,t,r)=>{if(0!==e.length)if(e.length>1){const n=e.shift(),o=j(t,n,r);m(e,o,g(n,r))}else Array.isArray(t)?t.splice(e[0],1):"object"==typeof t&&null!==t?delete t[e[0]]:j(t,e[0],r)},g=t(((e,t)=>t+"/"+w(e))),w=e=>e.toString().replace(/~/g,"~0").replace(/\//g,"~1"),O=e=>e.toString().replace(/~1/g,"/").replace(/~0/g,"~"),E=(e,t)=>Array.isArray(e)&&"-"===t?e.length:t,j=(e,t,r="")=>{if(void 0===e)throw TypeError(`Value at '${r}' is undefined and does not have property '${t}'`);if(null===e)throw TypeError(`Value at '${r}' is null and does not have property '${t}'`);if(S(e))throw TypeError(`Value at '${r}' is a ${typeof e} and does not have property '${t}'`);return e[E(e,t)]},S=e=>null===e||"object"!=typeof e;var $={nil:"",append:g,get:(e,t)=>{const r=h(e),n=e=>r.reduce((([e,t],r)=>[j(e,r,t),g(r,t)]),[e,""])[0];return void 0===t?n:n(t)},set:(e,r,n)=>{const o=h(e),a=t(((e,t)=>y(o,e,t,"")));return void 0===r?a:a(r,n)},assign:(e,r,n)=>{const o=h(e),a=t(((e,t)=>b(o,e,t,"")));return void 0===r?a:a(r,n)},unset:(e,t)=>{const r=h(e),n=e=>v(r,e,"");return void 0===t?n:n(t)},remove:(e,t)=>{const r=h(e),n=e=>m(r,e,"");return void 0===t?n:n(t)}};$.nil,$.append,$.get,$.set,$.assign,$.unset,$.remove;const A=Symbol("$__value"),P=Symbol("$__href");var x={cons:(e,t)=>Object.freeze({[P]:e,[A]:t}),isReference:e=>e&&void 0!==e[P],href:e=>e[P],value:e=>e[A]};const{jsonTypeOf:I}=p,T=Object.freeze({id:"",pointer:"",instance:void 0,value:void 0}),k=e=>x.isReference(e.value)?x.value(e.value):e.value,V=t(((e,t)=>I(k(e),t))),R=(e,t)=>Object.freeze({...t,pointer:$.append(e,t.pointer),value:k(t)[e]}),C=t(((e,t)=>k(t).map(((r,n,o,a)=>e(R(n,t),n,o,a))))),U=t(((e,t)=>k(t).map(((e,r,n,o)=>R(r,t))).filter(((t,r,n,o)=>e(t,r,n,o))))),z=t(((e,t,r)=>k(r).reduce(((t,n,o)=>e(t,R(o,r),o)),t))),K=t(((e,t)=>k(t).every(((r,n,o,a)=>e(R(n,t),n,o,a))))),L=t(((e,t)=>k(t).some(((r,n,o,a)=>e(R(n,t),n,o,a)))));var q={nil:T,cons:(e,t="")=>Object.freeze({...T,id:t,instance:e,value:e}),uri:e=>`${e.id}#${encodeURI(e.pointer)}`,value:k,has:(e,t)=>e in k(t),typeOf:V,step:R,entries:e=>Object.keys(k(e)).map((t=>[t,R(t,e)])),keys:e=>Object.keys(k(e)),map:C,filter:U,reduce:z,every:K,some:L,length:e=>k(e).length},_=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,D=/^[\u000b\u0020-\u007e\u0080-\u00ff]+$/,N=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,J=/\\([\u000b\u0020-\u00ff])/g,B=/([\\"])/g,F=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,W=function(e){if(!e)throw new TypeError("argument string is required");var t="object"==typeof e?function(e){var t;"function"==typeof e.getHeader?t=e.getHeader("content-type"):"object"==typeof e.headers&&(t=e.headers&&e.headers["content-type"]);if("string"!=typeof t)throw new TypeError("content-type header is missing from object");return t}(e):e;if("string"!=typeof t)throw new TypeError("argument string is required to be a string");var r=t.indexOf(";"),n=-1!==r?t.substr(0,r).trim():t.trim();if(!F.test(n))throw new TypeError("invalid media type");var o=new M(n.toLowerCase());if(-1!==r){var a,i,s;for(_.lastIndex=r;i=_.exec(t);){if(i.index!==r)throw new TypeError("invalid parameter format");r+=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(r!==t.length)throw new TypeError("invalid parameter format")}return o};function Z(e){var t=String(e);if(N.test(t))return t;if(t.length>0&&!D.test(t))throw new TypeError("invalid parameter value");return'"'+t.replace(B,"\\$1")+'"'}function M(e){this.parameters=Object.create(null),this.type=e}var G={format:function(e){if(!e||"object"!=typeof e)throw new TypeError("argument obj is required");var t=e.parameters,r=e.type;if(!r||!F.test(r))throw new TypeError("invalid type");var n=r;if(t&&"object"==typeof t)for(var o,a=Object.keys(t).sort(),i=0;i<a.length;i++){if(o=a[i],!N.test(o))throw new TypeError("invalid parameter name");n+="; "+o+"="+Z(t[o])}return n},parse:W},H=async e=>Object.entries(await e),Q=t((async(e,t)=>(await t).map(e))),X=t((async(e,t,r)=>(await r).reduce((async(t,r)=>e(await t,r)),t))),Y=t((async(e,t,r={})=>X((async(t,r)=>await e(r)?t.concat([r]):t),[],t,r))),ee=t((async(e,t)=>{const r=await Q(e,t);return(await Promise.all(r)).some((e=>e))})),te=t((async(e,t)=>{const r=await Q(e,t);return(await Promise.all(r)).every((e=>e))})),re=t(((e,t)=>e.reduce((async(e,t)=>t(await e)),t))),ne={entries:H,map:Q,filter:Y,reduce:X,some:ee,every:te,pipeline:re,all:e=>Promise.all(e),allValues:e=>re([H,X((async(e,[t,r])=>(e[t]=await r,e)),{})],e)};ne.entries,ne.map,ne.filter,ne.reduce,ne.some,ne.every,ne.pipeline,ne.all,ne.allValues;var oe=fetch;const{jsonTypeOf:ae,splitUrl:ie,safeResolveUrl:se,pathRelative:ce}=p,le={},ue={},fe=(e,t)=>{const r=e in ue?ue[e]:e;if(r in le)return le[r][t]},de={},pe={},he=(e,t="",r="")=>{e=JSON.parse(JSON.stringify(e));const n=ie(e.$schema||r)[0];if(!n)throw Error("Couldn't determine schema version");delete e.$schema;const o=fe(n,"baseToken"),a=fe(n,"anchorToken"),i=ie(t)[0];if(!i&&!ie(e[o]||"")[0])throw Error("Couldn't determine an identifier for the schema");const s=se(i,e[o]||""),[c,l]=ie(s);delete e[o],l&&o===a&&(e[a]=a!==o?encodeURI(l):`#${encodeURI(l)}`),i&&(pe[i]=c);const u={},f=fe(n,"recursiveAnchorToken");let d;!0===e[f]&&(u[""]=`${c}#`,e[a]="",delete e[f]);const p=fe(n,"vocabularyToken");ae(e[p],"object")?(ue[c]=n,d=e[p],delete e[p]):(ue[c]=n,d={[n]:!0});const h={"":""};return de[c]={id:c,schemaVersion:n,schema:ye(e,c,n,$.nil,h,u),anchors:h,dynamicAnchors:u,vocabulary:d,validated:!1},c},ye=(e,t,r,n,o,a)=>{if(ae(e,"object")){const i="string"==typeof e.$schema?ie(e.$schema)[0]:r,s=fe(i,"embeddedToken"),c=fe(i,"anchorToken");if("string"==typeof e[s]&&(s!==c||"#"!==e[s][0])){const n=se(t,e[s]);return e[s]=n,he(e,n,r),x.cons(e[s],e)}const l=fe(r,"anchorToken"),u=fe(r,"dynamicAnchorToken");"string"==typeof e[u]&&(a[e[u]]=`${t}#${encodeURI(n)}`,o[e[u]]=n,delete e[u]);const f=fe(r,"embeddedToken");if("string"==typeof e[l]){const t=l!==f?e[l]:e[l].slice(1);o[t]=n,delete e[l]}const d=fe(r,"jrefToken");if("string"==typeof e[d])return x.cons(e[d],e);for(const i in e)e[i]=ye(e[i],t,r,$.append(i,n),o,a);return e}return Array.isArray(e)?e.map(((e,i)=>ye(e,t,r,$.append(i,n),o,a))):e},be=e=>de[pe[e]]||de[e],ve=Object.freeze({id:"",schemaVersion:void 0,vocabulary:{},pointer:$.nil,schema:void 0,value:void 0,anchors:{},dynamicAnchors:{},validated:!0}),me=async(e,t=ve)=>{const r=se(Oe(t),e),[n,o]=ie(r);if(!(e=>e in de||e in pe)(n)){const e=await oe(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 t=G.parse(e.headers.get("content-type")).type;if("application/schema+json"!==t)throw Error(`${n} is not a schema. Found a document with media type: ${t}`)}he(await e.json(),n)}const a=be(n),i="/"!==o[0]?we(a,o):o,s=Object.freeze({...a,pointer:i,value:$.get(i,a.schema)});return ge(s)},ge=e=>x.isReference(e.value)?me(x.href(e.value),e):e,we=(e,t)=>{if(!(t in e.anchors))throw Error(`No such anchor '${encodeURI(e.id)}#${encodeURI(t)}'`);return e.anchors[t]},Oe=e=>`${e.id}#${encodeURI(e.pointer)}`,Ee=e=>x.isReference(e.value)?x.value(e.value):e.value,je=(e,t)=>{const r=be(t.id),n=Object.freeze({...t,pointer:$.append(e,t.pointer),value:Ee(t)[e],validated:r.validated});return ge(n)},Se=t(((e,t)=>ne.pipeline([Ee,ne.map((async(r,n)=>e(await je(n,t),n))),ne.all],t))),$e={parentId:"",parentDialect:"",includeEmbedded:!0},Ae=(e,t)=>{if(t.startsWith("file://")){const r=e.slice(7,e.lastIndexOf("/"));return""===e?"":ce(r,t.slice(7))}return t};var Pe={setConfig:(e,t,r)=>{le[e]||(le[e]={}),le[e][t]=r},getConfig:fe,add:he,get:me,markValidated:e=>{de[e].validated=!0},uri:Oe,value:Ee,getAnchorPointer:we,typeOf:(e,t)=>ae(Ee(e),t),has:(e,t)=>e in Ee(t),step:je,keys:e=>Object.keys(Ee(e)),entries:e=>ne.pipeline([Ee,Object.keys,ne.map((async t=>[t,await je(t,e)])),ne.all],e),map:Se,length:e=>Ee(e).length,toSchema:(e,t={})=>{const r={...$e,...t},n=JSON.parse(JSON.stringify(e.schema,((t,n)=>{if(!x.isReference(n))return n;const o=x.value(n),a=o.$schema||e.schemaVersion,i=fe(a,"embeddedToken");return!r.includeEmbedded&&i in o?void 0:x.value(n)}))),o=fe(e.schemaVersion,"dynamicAnchorToken");Object.entries(e.dynamicAnchors).forEach((([e,t])=>{const r=ie(t)[1];$.assign(r,n,{[o]:e,...$.get(r,n)})}));const a=fe(e.schemaVersion,"anchorToken");Object.entries(e.anchors).filter((([e])=>""!==e)).forEach((([e,t])=>{$.assign(t,n,{[a]:e,...$.get(t,n)})}));const i=fe(e.schemaVersion,"baseToken"),s=Ae(r.parentId,e.id),c=r.parentDialect===e.schemaVersion?"":e.schemaVersion;return{...s&&{[i]:s},...c&&{$schema:c},...n}}};Pe.setConfig,Pe.getConfig,Pe.add,Pe.get,Pe.markValidated,Pe.uri,Pe.value,Pe.getAnchorPointer,Pe.typeOf,Pe.has,Pe.step,Pe.keys,Pe.entries,Pe.map,Pe.length,Pe.toSchema;class xe extends Error{constructor(e){super("Invalid Schema"),this.name=this.constructor.name,this.output=e}}var Ie=xe;const{splitUrl:Te}=p,ke="FLAG",Ve="BASIC",Re="DETAILED",Ce="VERBOSE";let Ue=Re,ze=!0;const Ke=async e=>{const t={metaData:{}};return{ast:t,schemaUri:await Fe(e,t)}},Le=t((({ast:e,schemaUri:t},r,n=ke)=>{if(![ke,Ve,Re,Ce].includes(n))throw Error(`The '${n}' error format is not supported`);const o=[],i=a.subscribe("result",qe(n,o));return Ze(t,r,e,{}),a.unsubscribe(i),o[0]})),qe=(e,t)=>{const r=[];return(n,o)=>{if("result"===n){const{keyword:e,absoluteKeywordLocation:t,instanceLocation:n,valid:a}=o,i={keyword:e,absoluteKeywordLocation:t,instanceLocation:n,valid:a,errors:[]};r.push(i)}else if("result.start"===n)r.push(n);else if("result.end"===n){const n=r.pop();for(;"result.start"!==r[r.length-1];){const t=r.pop(),o=[t];e===Ve&&(o.push(...t.errors),delete t.errors),(e===Ce||e!==ke&&!t.valid)&&n.errors.unshift(...o)}r[r.length-1]=n,t[0]=n}}},_e={},De=e=>_e[e],Ne=e=>e in _e,Je={},Be={},Fe=async(e,t)=>{if(e=await We(e),!Ne(`${e.schemaVersion}#validate`)){const t=await Pe.get(e.schemaVersion);(Pe.getConfig(t.id,"mandatoryVocabularies")||[]).forEach((e=>{if(!t.vocabulary[e])throw Error(`Vocabulary '${e}' must be explicitly declared and required`)})),Object.entries(t.vocabulary).forEach((([e,r])=>{if(e in Je)Object.entries(Je[e]).forEach((([e,r])=>{((e,t)=>{_e[e]={collectEvaluatedItems:(e,r,n,o,a)=>t.interpret(e,r,n,o,a)&&new Set,collectEvaluatedProperties:(e,r,n,o,a)=>t.interpret(e,r,n,o,a)&&[],...t}})(`${t.id}#${e}`,r)}));else if(r)throw Error(`Missing required vocabulary: ${e}`)}))}if(ze&&!e.validated){if(Pe.markValidated(e.id),!(e.schemaVersion in Be)){const t=await Pe.get(e.schemaVersion),r=await Ke(t);Be[t.id]=Le(r)}const t=q.cons(e.schema,e.id),r=Be[e.schemaVersion](t,Ue);if(!r.valid)throw new Ie(r)}return e.id in t.metaData||(t.metaData[e.id]={id:e.id,dynamicAnchors:e.dynamicAnchors,anchors:e.anchors}),De(`${e.schemaVersion}#validate`).compile(e,t)},We=async e=>Pe.typeOf(e,"string")?We(await Pe.get(Pe.value(e),e)):e,Ze=(e,t,r,n)=>{const o=Me(e,r),a=Te(e)[0];return De(o).interpret(e,t,r,{...r.metaData[a].dynamicAnchors,...n})},Me=(e,t)=>{if(!(e in t))throw Error(`No schema found at ${e}`);return t[e][0]};var Ge={validate:async(e,t,r)=>{const n=await Ke(e),o=(e,t)=>Le(n,q.cons(e),t);return void 0===t?o:o(t,r)},compile:Ke,interpret:Le,setMetaOutputFormat:e=>{Ue=e},setShouldMetaValidate:e=>{ze=e},FLAG:ke,BASIC:Ve,DETAILED:Re,VERBOSE:Ce,add:(e,t="",r="")=>{const n=Pe.add(e,t,r);delete Be[n]},getKeyword:De,hasKeyword:Ne,defineVocabulary:(e,t)=>{Je[e]=t},compileSchema:Fe,interpretSchema:Ze,collectEvaluatedProperties:(e,t,r,n,o)=>{const a=Me(e,r);return De(a).collectEvaluatedProperties(e,t,r,n,o)},collectEvaluatedItems:(e,t,r,n,o)=>{const a=Me(e,r);return De(a).collectEvaluatedItems(e,t,r,n,o)}};var He={compile:e=>Pe.value(e),interpret:()=>!0};var Qe={compile:async(e,t)=>{const r=Pe.uri(e);if(!(r in t)){t[r]=!1;const n=Pe.value(e);if(!["object","boolean"].includes(typeof n))throw Error(`No schema found at '${Pe.uri(e)}'`);t[r]=[`${e.schemaVersion}#validate`,Pe.uri(e),"boolean"==typeof n?n:await ne.pipeline([Pe.entries,ne.map((([t,r])=>[`${e.schemaVersion}#${t}`,r])),ne.filter((([t])=>Ge.hasKeyword(t)&&t!==`${e.schemaVersion}#validate`)),ne.map((async([r,n])=>{const o=await Ge.getKeyword(r).compile(n,t,e);return[r,Pe.uri(n),o]})),ne.all],e)]}return r},interpret:(e,t,r,n)=>{const[o,i,s]=r[e];a.publishSync("result.start");const c="boolean"==typeof s?s:s.every((([e,o,i])=>{a.publishSync("result.start");const s=Ge.getKeyword(e).interpret(i,t,r,n);return a.publishSync("result",{keyword:e,absoluteKeywordLocation:o,instanceLocation:q.uri(t),valid:s,ast:i}),a.publishSync("result.end"),s}));return a.publishSync("result",{keyword:o,absoluteKeywordLocation:i,instanceLocation:q.uri(t),valid:c,ast:e}),a.publishSync("result.end"),c},collectEvaluatedProperties:(e,t,r,n,o=!1)=>{const a=r[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,t,r,n);return!1!==i&&[...e,...i]}),[])},collectEvaluatedItems:(e,t,r,n,o=!1)=>{const a=r[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,t,r,n);return!1!==i&&new Set([...e,...i])}),new Set)}},Xe={metaData:He,validate:Qe},Ye={Core:Ge,Schema:Pe,Instance:q,Reference:x,Keywords:Xe,InvalidSchemaError:Ie},et=Ye.Core,tt=Ye.Schema,rt=Ye.Instance,nt=Ye.Reference,ot=Ye.Keywords,at=Ye.InvalidSchemaError;return e.Core=et,e.Instance=rt,e.InvalidSchemaError=at,e.Keywords=ot,e.Reference=nt,e.Schema=tt,e.default=Ye,Object.defineProperty(e,"__esModule",{value:!0}),e}({});
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),h=t(a+"{1,4}"),d=t(t(h+"\\:"+h)+"|"+f),v=t(t(h+"\\:")+"{6}"+d),y=t("\\:\\:"+t(h+"\\:")+"{5}"+d),m=t(t(h)+"?\\:\\:"+t(h+"\\:")+"{4}"+d),g=t(t(t(h+"\\:")+"{0,1}"+h)+"?\\:\\:"+t(h+"\\:")+"{3}"+d),b=t(t(t(h+"\\:")+"{0,2}"+h)+"?\\:\\:"+t(h+"\\:")+"{2}"+d),w=t(t(t(h+"\\:")+"{0,3}"+h)+"?\\:\\:"+h+"\\:"+d),E=t(t(t(h+"\\:")+"{0,4}"+h)+"?\\:\\:"+d),S=t(t(t(h+"\\:")+"{0,5}"+h)+"?\\:\\:"+h),C=t(t(t(h+"\\:")+"{0,6}"+h)+"?\\:\\:"),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 j=t(i+"|"+r(l,s,"[\\:\\@]"));return t(t(i+"|"+r(l,s,"[\\@]"))+"+"),t(t(j+"|"+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,h=36,d=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=h-d,j=Math.floor,T=String.fromCharCode;function I(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 D(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 P(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 $=function(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:h},R=function(e,r){return e+22+75*(e<26)-((0!=r)<<5)},N=function(e,r,t){var n=0;for(e=t?j(e/m):e>>1,e+=j(e/r);e>A*v>>1;n+=h)e=j(e/A);return j(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&&I("not-basic"),r.push(e.charCodeAt(s));for(var c=i>0?i+1:0;c<t;){for(var u=n,l=1,p=h;;p+=h){c>=t&&I("invalid-input");var y=$(e.charCodeAt(c++));(y>=h||y>j((f-n)/l))&&I("overflow"),n+=y*l;var m=p<=a?d:p>=a+v?v:p-a;if(y<m)break;var E=h-m;l>j(f/E)&&I("overflow"),l*=E}var S=r.length+1;a=N(n-u,S,0==u),j(n/S)>f-o&&I("overflow"),o+=j(n/S),n%=S,r.splice(n++,0,o)}return String.fromCodePoint.apply(String,r)},F=function(e){var r=[],t=(e=P(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 D=A.value;D>=n&&D<E&&(E=D)}}catch(e){C=!0,O=e}finally{try{!S&&x.return&&x.return()}finally{if(C)throw O}}var $=m+1;E-n>j((f-o)/$)&&I("overflow"),o+=(E-n)*$,n=E;var _=!0,F=!1,V=void 0;try{for(var U,k=e[Symbol.iterator]();!(_=(U=k.next()).done);_=!0){var q=U.value;if(q<n&&++o>f&&I("overflow"),q==n){for(var L=o,z=h;;z+=h){var H=z<=a?d:z>=a+v?v:z-a;if(L<H)break;var K=L-H,M=h-H;r.push(T(R(H+K%M,0))),L=j(K/M)}r.push(T(R(L,0))),a=N(o,$,m==y),o=0,++m}}}catch(e){F=!0,V=e}finally{try{!_&&k.return&&k.return()}finally{if(F)throw V}}++o,++n}return r.join("")},V=function(e){return D(e,(function(e){return E.test(e)?_(e.slice(4).toLowerCase()):e}))},U=function(e){return D(e,(function(e){return S.test(e)?"xn--"+F(e):e}))},k={version:"2.1.0",ucs2:{decode:P,encode:function(e){return String.fromCodePoint.apply(String,p(e))}},decode:_,encode:F,toASCII:U,toUnicode:V},q={};function L(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 z(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 H(e,r){function t(e){var t=z(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,L).replace(r.PCT_ENCODED,o)),void 0!==e.host&&(e.host=String(e.host).replace(r.PCT_ENCODED,t).toLowerCase().replace(r.NOT_HOST,L).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,L).replace(r.PCT_ENCODED,o)),void 0!==e.query&&(e.query=String(e.query).replace(r.PCT_ENCODED,t).replace(r.NOT_QUERY,L).replace(r.PCT_ENCODED,o)),void 0!==e.fragment&&(e.fragment=String(e.fragment).replace(r.PCT_ENCODED,t).replace(r.NOT_FRAGMENT,L).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),h=r.IPV4ADDRESS.test(f[f.length-1]),d=h?7:8,v=f.length-d,y=Array(d),m=0;m<d;++m)y[m]=p[m]||f[v+m]||"";h&&(y[d-1]=M(y[d-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=q[(r.scheme||t.scheme||"").toLowerCase()];if(r.unicodeSupport||a&&a.unicodeSupport)H(t,n);else{if(t.host&&(r.domainHost||a&&a.domainHost))try{t.host=k.toASCII(t.host.replace(n.PCT_ENCODED,z).toLowerCase())}catch(e){t.error=t.error||"Host's domain name can not be converted to ASCII via punycode: "+e}H(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=q[(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?k.toUnicode(e.host):k.toASCII(e.host.replace(t.PCT_ENCODED,z).toLowerCase())}catch(t){e.error=e.error||"Host's domain name can not be converted to "+(r.iri?"Unicode":"ASCII")+" via punycode: "+t}H(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,L)}function ce(e,r){return e&&e.toString().replace(r&&r.iri?u.PCT_ENCODED:c.PCT_ENCODED,z)}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}},he={scheme:"wss",domainHost:fe.domainHost,parse:fe.parse,serialize:fe.serialize},de={},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 je(e){var r=z(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 h=0,d=n.length;h<d;++h){var v=n[h].split("@");if(v[0]=ce(v[0]),r.unicodeSupport)v[1]=ce(v[1],r).toLowerCase();else try{v[1]=k.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[h]=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,je).replace(Se,o).replace(Ce,L),p=c.slice(u+1);try{p=r.iri?k.toUnicode(p):k.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 h=[];for(var d in f)f[d]!==de[d]&&h.push(d.replace(Se,je).replace(Se,o).replace(Oe,L)+"="+f[d].replace(Se,je).replace(Se,o).replace(Ae,L));return h.length&&(t.query=h.join("&")),t}},Ie=/^([^\:]+)\:(.*)/,xe={scheme:"urn",parse:function(e,r){var t=e.path&&e.path.match(Ie),n=e;if(t){var o=r.scheme||n.scheme||"urn",a=t[1].toLowerCase(),i=t[2],s=o+":"+(r.nid||a),c=q[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=q[o];a&&(e=a.serialize(e,r));var i=e,s=e.nss;return i.path=(n||r.nid)+":"+s,i}},De=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/,Pe={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(De)||(t.error=t.error||"UUID is not valid."),t},serialize:function(e,r){var t=e;return t.nss=(e.uuid||"").toLowerCase(),t}};q[ue.scheme]=ue,q[le.scheme]=le,q[fe.scheme]=fe,q[he.scheme]=he,q[Te.scheme]=Te,q[xe.scheme]=xe,q[Pe.scheme]=Pe,e.SCHEMES=q,e.pctEncChar=L,e.pctDecChars=z,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,d(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,d(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,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 g(r,e[0],t)}},h=(e,r,t)=>{if(0!==e.length)if(e.length>1){const n=e.shift(),o=g(r,n,t);h(e,o,d(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)},d=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:d,get:(e,r)=>{const t=u(e),n=e=>t.reduce((([e,r],t)=>[g(e,t,r),d(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=>h(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,j=Object.freeze({id:"",pointer:"",instance:void 0,value:void 0}),T=e=>C.isReference(e.value)?C.value(e.value):e.value,I=r(((e,r)=>A(T(e),r))),x=(e,r)=>Object.freeze({...r,pointer:w.append(e,r.pointer),value:T(r)[e]}),D=r(((e,r)=>T(r).map(((t,n,o,a)=>e(x(n,r),n,o,a))))),P=r(((e,r)=>T(r).map(((e,t,n,o)=>x(t,r))).filter(((r,t,n,o)=>e(r,t,n,o))))),$=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:j,cons:(e,r="")=>Object.freeze({...j,id:O(r,""),instance:e,value:e}),uri:e=>`${e.id}#${encodeURI(e.pointer)}`,value:T,has:(e,r)=>e in T(r),typeOf:I,step:x,entries:e=>Object.keys(T(e)).map((r=>[r,x(r,e)])),keys:e=>Object.keys(T(e)),map:D,filter:P,reduce:$,every:R,some:N,length:e=>T(e).length},F=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,V=/^[\u000b\u0020-\u007e\u0080-\u00ff]+$/,U=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,k=/\\([\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 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(k,"$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(U.test(r))return r;if(r.length>0&&!V.test(r))throw new TypeError("invalid parameter value");return'"'+r.replace(q,"\\$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||!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],!U.test(o))throw new TypeError("invalid parameter name");n+="; "+o+"="+H(r[o])}return n},parse:z},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={},ie={},se=(e,r)=>{const t=e in ie?ie[e]:e;if(t in ae)return ae[t][r]},ce={},ue={},le=(e,r="",t="")=>{e=JSON.parse(JSON.stringify(e));const n=te(e.$schema||t,"");if(!n)throw Error("Couldn't determine schema version");delete e.$schema;const o=se(n,"baseToken"),a=se(n,"anchorToken"),i=te(r,"");if(!i&&!te(e[o]||"",""))throw Error("Couldn't determine an identifier for the schema");const s=te(i,e[o]||""),c=te(s,""),u=ne(s);delete e[o],u&&o===a&&(e[a]=a!==o?encodeURI(u):`#${encodeURI(u)}`),i&&(ue[i]=c);const l={},p=se(n,"recursiveAnchorToken");let f;!0===e[p]&&(l[""]=`${c}#`,e[a]="",delete e[p]);const h=se(n,"vocabularyToken");re(e[h],"object")?(ie[c]=n,f=e[h],delete e[h]):(ie[c]=n,f={[n]:!0});const d={"":""};return ce[c]={id:c,schemaVersion:n,schema:pe(e,c,n,w.nil,d,l),anchors:d,dynamicAnchors:l,vocabulary:f,validated:!1},c},pe=(e,r,t,n,o,a)=>{if(re(e,"object")){const i="string"==typeof e.$schema?te(e.$schema,""):t,s=se(i,"embeddedToken"),c=se(i,"anchorToken");if("string"==typeof e[s]&&(s!==c||"#"!==e[s][0])){const n=te(r,e[s]);return e[s]=n,le(e,n,t),C.cons(e[s],e)}const u=se(t,"anchorToken"),l=se(t,"dynamicAnchorToken");"string"==typeof e[l]&&(a[e[l]]=`${r}#${encodeURI(n)}`,o[e[l]]=n,delete e[l]);const p=se(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=se(t,"jrefToken");if("string"==typeof e[f])return C.cons(e[f],e);for(const i in e)e[i]=pe(e[i],r,t,w.append(i,n),o,a);return e}return Array.isArray(e)?e.map(((e,i)=>pe(e,r,t,w.append(i,n),o,a))):e},fe=e=>ce[ue[e]]||ce[e],he=Object.freeze({id:"",schemaVersion:void 0,vocabulary:{},pointer:w.nil,schema:void 0,value:void 0,anchors:{},dynamicAnchors:{},validated:!0}),de=async(e,r=he)=>{const t=te(me(r),e),n=te(t,""),o=ne(t);if(!(e=>e in ce||e in ue)(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}`)}le(await e.json(),n)}const a=fe(n),i="/"!==o[0]?ye(a,o):o,s=Object.freeze({...a,pointer:i,value:w.get(i,a.schema)});return ve(s)},ve=e=>C.isReference(e.value)?de(C.href(e.value),e):e,ye=(e,r)=>{if(!(r in e.anchors))throw Error(`No such anchor '${encodeURI(e.id)}#${encodeURI(r)}'`);return e.anchors[r]},me=e=>`${e.id}#${encodeURI(e.pointer)}`,ge=e=>C.isReference(e.value)?C.value(e.value):e.value,be=(e,r)=>{const t=fe(r.id),n=Object.freeze({...r,pointer:w.append(e,r.pointer),value:ge(r)[e],validated:t.validated});return ve(n)},we=r(((e,r)=>X.pipeline([ge,X.map((async(t,n)=>e(await be(n,r),n))),X.all],r))),Ee={parentId:"",parentDialect:"",includeEmbedded:!0},Se=(e,r)=>{if(r.startsWith("file://")){const t=e.slice(7,e.lastIndexOf("/"));return""===e?"":oe(t,r.slice(7))}return r};var Ce={setConfig:(e,r,t)=>{ae[e]||(ae[e]={}),ae[e][r]=t},getConfig:se,add:le,get:de,markValidated:e=>{ce[e].validated=!0},uri:me,value:ge,getAnchorPointer:ye,typeOf:(e,r)=>re(ge(e),r),has:(e,r)=>e in ge(r),step:be,keys:e=>Object.keys(ge(e)),entries:e=>X.pipeline([ge,Object.keys,X.map((async r=>[r,await be(r,e)])),X.all],e),map:we,length:e=>ge(e).length,toSchema:(e,r={})=>{const t={...Ee,...r},n=JSON.parse(JSON.stringify(e.schema,((r,n)=>{if(!C.isReference(n))return n;const o=C.value(n),a=o.$schema||e.schemaVersion,i=se(a,"embeddedToken");return!t.includeEmbedded&&i in o?void 0:C.value(n)}))),o=se(e.schemaVersion,"dynamicAnchorToken");Object.entries(e.dynamicAnchors).forEach((([e,r])=>{const t=ne(r);w.assign(t,n,{[o]:e,...w.get(t,n)})}));const a=se(e.schemaVersion,"anchorToken");Object.entries(e.anchors).filter((([e])=>""!==e)).forEach((([e,r])=>{w.assign(r,n,{[a]:e,...w.get(r,n)})}));const i=se(e.schemaVersion,"baseToken"),s=Se(t.parentId,e.id),c=t.parentDialect===e.schemaVersion?"":e.schemaVersion;return{...s&&{[i]:s},...c&&{$schema:c},...n}}};Ce.setConfig,Ce.getConfig,Ce.add,Ce.get,Ce.markValidated,Ce.uri,Ce.value,Ce.getAnchorPointer,Ce.typeOf,Ce.has,Ce.step,Ce.keys,Ce.entries,Ce.map,Ce.length,Ce.toSchema;class Oe extends Error{constructor(e){super("Invalid Schema"),this.name=this.constructor.name,this.output=e}}var Ae=Oe;const{resolveUrl:je}=c,Te="FLAG",Ie="BASIC",xe="DETAILED",De="VERBOSE";let Pe=xe,$e=!0;const Re=async e=>{const r={metaData:{}};return{ast:r,schemaUri:await Le(e,r)}},Ne=r((({ast:e,schemaUri:r},t,n=Te)=>{if(![Te,Ie,xe,De].includes(n))throw Error(`The '${n}' error format is not supported`);const a=[],i=o.subscribe("result",_e(n,a));return He(r,t,e,{}),o.unsubscribe(i),a[0]})),_e=(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===Ie&&(o.push(...r.errors),delete r.errors),(e===De||e!==Te&&!r.valid)&&n.errors.unshift(...o)}t[t.length-1]=n,r[0]=n}}},Fe={},Ve=e=>Fe[e],Ue=e=>e in Fe,ke={},qe={},Le=async(e,r)=>{if(e=await ze(e),!Ue(`${e.schemaVersion}#validate`)){const r=await Ce.get(e.schemaVersion);(Ce.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)=>{Fe[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(Ce.markValidated(e.id),!(e.schemaVersion in qe)){const r=await Ce.get(e.schemaVersion),t=await Re(r);qe[r.id]=Ne(t)}const r=_.cons(e.schema,e.id),t=qe[e.schemaVersion](r,Pe);if(!t.valid)throw new Ae(t)}return e.id in r.metaData||(r.metaData[e.id]={id:e.id,dynamicAnchors:e.dynamicAnchors,anchors:e.anchors}),Ve(`${e.schemaVersion}#validate`).compile(e,r)},ze=async e=>Ce.typeOf(e,"string")?ze(await Ce.get(Ce.value(e),e)):e,He=(e,r,t,n)=>{const o=Ke(e,t),a=je(e,"");return Ve(o).interpret(e,r,t,{...t.metaData[a].dynamicAnchors,...n})},Ke=(e,r)=>{if(!(e in r))throw Error(`No schema found at ${e}`);return r[e][0]};var Me={validate:async(e,r,t)=>{const n=await Re(e),o=(e,r)=>Ne(n,_.cons(e),r);return void 0===r?o:o(r,t)},compile:Re,interpret:Ne,setMetaOutputFormat:e=>{Pe=e},setShouldMetaValidate:e=>{$e=e},FLAG:Te,BASIC:Ie,DETAILED:xe,VERBOSE:De,add:(e,r="",t="")=>{const n=Ce.add(e,r,t);delete qe[n]},getKeyword:Ve,hasKeyword:Ue,defineVocabulary:(e,r)=>{ke[e]=r},compileSchema:Le,interpretSchema:He,collectEvaluatedProperties:(e,r,t,n,o)=>{const a=Ke(e,t);return Ve(a).collectEvaluatedProperties(e,r,t,n,o)},collectEvaluatedItems:(e,r,t,n,o)=>{const a=Ke(e,t);return Ve(a).collectEvaluatedItems(e,r,t,n,o)}};var Ze={compile:e=>Ce.value(e),interpret:()=>!0};var Je={compile:async(e,r)=>{const t=Ce.uri(e);if(!(t in r)){r[t]=!1;const n=Ce.value(e);if(!["object","boolean"].includes(typeof n))throw Error(`No schema found at '${Ce.uri(e)}'`);r[t]=[`${e.schemaVersion}#validate`,Ce.uri(e),"boolean"==typeof n?n:await X.pipeline([Ce.entries,X.map((([r,t])=>[`${e.schemaVersion}#${r}`,t])),X.filter((([r])=>Me.hasKeyword(r)&&r!==`${e.schemaVersion}#validate`)),X.map((async([t,n])=>{const o=await Me.getKeyword(t).compile(n,r,e);return[t,Ce.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=Me.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&&Me.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&&Me.getKeyword(o).collectEvaluatedItems(a,r,t,n);return!1!==i&&new Set([...e,...i])}),new Set)}},Be={metaData:Ze,validate:Je},Ge={Core:Me,Schema:Ce,Instance:_,Reference:C,Keywords:Be,InvalidSchemaError:Ae},We=Ge.Core,Qe=Ge.Schema,Ye=Ge.Instance,Xe=Ge.Reference,er=Ge.Keywords,rr=Ge.InvalidSchemaError;return e.Core=We,e.Instance=Ye,e.InvalidSchemaError=rr,e.Keywords=er,e.Reference=Xe,e.Schema=Qe,e.default=Ge,Object.defineProperty(e,"__esModule",{value:!0}),e}({});
//# sourceMappingURL=json-schema-core-iife.min.js.map

@@ -1,2 +0,4 @@

System.register("JSC",[],(function(e){"use strict";return{execute:function(){var t=function(e,t){return function r(){null==t&&(t=e.length);var n=[].slice.call(arguments);return n.length>=t?e.apply(this,n):function(){return r.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:{};var n,o,a=(n=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 t={},r=-1,n="*";function o(e){var t;for(t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!0;return!1}function a(e){return function(){throw e}}function i(e,t,r){try{e(t,r)}catch(e){setTimeout(a(e),0)}}function s(e,t,r){e(t,r)}function c(e,r,n,o){var a,c=t[r],l=o?s:i;if(Object.prototype.hasOwnProperty.call(t,r))for(a in c)Object.prototype.hasOwnProperty.call(c,a)&&l(c[a],e,n)}function l(e,t,r){return function(){var o=String(e),a=o.lastIndexOf(".");for(c(e,e,t,r);-1!==a;)a=(o=o.substr(0,a)).lastIndexOf("."),c(e,o,t,r);c(e,n,t,r)}}function u(e){var r=String(e);return Boolean(Object.prototype.hasOwnProperty.call(t,r)&&o(t[r]))}function f(e){for(var t=String(e),r=u(t)||u(n),o=t.lastIndexOf(".");!r&&-1!==o;)o=(t=t.substr(0,o)).lastIndexOf("."),r=u(t);return r}function d(e,t,r,n){var o=l(e="symbol"==typeof e?e.toString():e,t,n);return!!f(e)&&(!0===r?o():setTimeout(o,0),!0)}e.publish=function(t,r){return d(t,r,!1,e.immediateExceptions)},e.publishSync=function(t,r){return d(t,r,!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(t,e)||(t[e]={});var o="uid_"+String(++r);return t[e][o]=n,o},e.subscribeAll=function(t){return e.subscribe(n,t)},e.subscribeOnce=function(t,r){var n=e.subscribe(t,(function(){e.unsubscribe(n),r.apply(this,arguments)}));return e},e.clearAllSubscriptions=function(){t={}},e.clearSubscriptions=function(e){var r;for(r in t)Object.prototype.hasOwnProperty.call(t,r)&&0===r.indexOf(e)&&delete t[r]},e.countSubscriptions=function(e){var r,n,o=0;for(r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&0===r.indexOf(e)){for(n in t[r])o++;break}return o},e.getSubscriptions=function(e){var r,n=[];for(r in t)Object.prototype.hasOwnProperty.call(t,r)&&0===r.indexOf(e)&&n.push(r);return n},e.unsubscribe=function(r){var n,o,a,i=function(e){var r;for(r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&0===r.indexOf(e))return!0;return!1},s="string"==typeof r&&(Object.prototype.hasOwnProperty.call(t,r)||i(r)),c=!s&&"string"==typeof r,l="function"==typeof r,u=!1;if(!s){for(n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(o=t[n],c&&o[r]){delete o[r],u=r;break}if(l)for(a in o)Object.prototype.hasOwnProperty.call(o,a)&&o[a]===r&&(delete o[a],u=!0)}return u}e.clearSubscriptions(r)}}(o)),void 0!==e&&e.exports&&(t=e.exports=o),t.PubSub=o,e.exports=t=o},n(o={exports:{}},o.exports),o.exports);a.PubSub;var i=function(e,t){if(e=e.trim(),(t=t.trim()).startsWith("about:"))return t;const r=function(e){const t={host:"",path:"",query:"",protocol:""};let r=e,n=e.indexOf("//");t.protocol=r.substring(0,n),n+=2;const o=e.indexOf("/",n),a=e.indexOf("?"),i=e.indexOf("#");-1!==i&&(r=r.substring(0,i));if(-1!==a){const e=r.substring(a);t.query=e,r=r.substring(0,a)}if(-1!==o){const e=r.substring(0,o);t.host=e,r=r.substring(o),t.path=r}else t.host=r;return t}(e),n=function(e){const t={href:e,hash:"",query:"",netPath:!1,absolutePath:!1,relativePath:!1};if(l.test(e))return t.netPath=!0,t;"/"===e[0]?t.absolutePath=!0:""!==e&&(t.relativePath=!0);let r=e;const n=e.indexOf("?"),o=e.indexOf("#");if(-1!==o){const e=r.substring(o);t.hash=e,r=r.substring(0,o)}if(-1!==n){const e=r.substring(n);t.query=e,r=r.substring(0,n)}return t.path=r,t}(t);if(!r.protocol&&!n.netPath)throw new Error("Error, protocol is not specified");if(n.netPath)return n.href.startsWith("//")&&(n.href=r.protocol+n.href),function(e){const t=e.indexOf("//")+2,r=!e.includes("/",t),n=!e.includes("?",t),o=!e.includes("#",t);return r&&n&&o}(n.href)?s(n.href):n.href;if(n.absolutePath){const{path:e,query:t,hash:o}=n;return r.host+c(e)+t+o}if(n.relativePath){const{path:e,query:t,hash:o}=n;let a,i=r.path,s=r.host;return 0===e.length?a=i:(i=i.substring(0,i.lastIndexOf("/")),a=c(i+"/"+e)),s+=""!==a||t||o?a+t+o:"/",s}{const{host:e,path:t,query:o}=r;return t||o?e+t+o+n.hash:s(e)}};function s(e){return e+("/"===e[e.length-1]?"":"/")}function c(e){let t=e.split("/");""===t[0]&&(t=t.slice(1));let r=[];return t.forEach(((e,n)=>{"."!==e&&(".."===e?r.pop():""===e&&n!==t.length-1||r.push(e))})),"/"+r.join("/")}const l=new RegExp("^([a-z][a-z0-9+.-]*:)?//","i");const u={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},f=e=>{const t=e.indexOf("#"),r=-1===t?e.length:t,n=e.slice(0,r),o=e.slice(r+1);return[decodeURI(n),decodeURI(o)]},d=e=>{const t=RegExp(/^(.+):\/\//).exec(e);return t?t[1]:""};var p={jsonTypeOf:(e,t)=>u[t](e),splitUrl:f,safeResolveUrl:(e,t)=>{const r=i(e,t),n=f(e)[0];if(n&&"file"===d(r)&&"file"!==d(n))throw Error(`Can't access file '${r}' resource from network context '${e}'`);return r},pathRelative:(e,t)=>{if(e===t)return"";let r=1;const n=e.length-1,o=t.length-r,a=n<o?n:o;let i=-1,s=0;for(;s<a;s++){const n=e.charCodeAt(s+1);if(n!==t.charCodeAt(r+s))break;47===n&&(i=s)}if(o>a){if(47===t.charCodeAt(r+s))return t.slice(r+s+1);if(0===s)return t.slice(r+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 r+=i,c.length>0?`${c}${t.slice(r,t.length)}`:(47===t.charCodeAt(r)&&++r,t.slice(r,t.length))}};const h=e=>{if(e.length>0&&"/"!==e[0])throw Error("Invalid JSON Pointer");return e.split("/").slice(1).map(O)},y=(e,t,r,n)=>{if(0===e.length)return r;if(e.length>1){const o=e.shift();return{...t,[o]:y(e,S(t,o,n),r,g(o,n))}}if(Array.isArray(t)){const n=[...t];return n[E(t,e[0])]=r,n}return"object"==typeof t&&null!==t?{...t,[e[0]]:r}:S(t,e[0],n)},b=(e,t,r,n)=>{if(0!==e.length)if(1!==e.length||$(t)){const o=e.shift();b(e,S(t,o,n),r,g(o,n))}else{t[E(t,e[0])]=r}},m=(e,t,r)=>{if(0!=e.length){if(e.length>1){const n=e.shift(),o=S(t,n,r);return{...t,[n]:m(e,o,g(n,r))}}if(Array.isArray(t))return t.filter(((t,r)=>r!=e[0]));if("object"==typeof t&&null!==t){const{[e[0]]:r,...n}=t;return n}return S(t,e[0],r)}},v=(e,t,r)=>{if(0!==e.length)if(e.length>1){const n=e.shift(),o=S(t,n,r);v(e,o,g(n,r))}else Array.isArray(t)?t.splice(e[0],1):"object"==typeof t&&null!==t?delete t[e[0]]:S(t,e[0],r)},g=t(((e,t)=>t+"/"+w(e))),w=e=>e.toString().replace(/~/g,"~0").replace(/\//g,"~1"),O=e=>e.toString().replace(/~1/g,"/").replace(/~0/g,"~"),E=(e,t)=>Array.isArray(e)&&"-"===t?e.length:t,S=(e,t,r="")=>{if(void 0===e)throw TypeError(`Value at '${r}' is undefined and does not have property '${t}'`);if(null===e)throw TypeError(`Value at '${r}' is null and does not have property '${t}'`);if($(e))throw TypeError(`Value at '${r}' is a ${typeof e} and does not have property '${t}'`);return e[E(e,t)]},$=e=>null===e||"object"!=typeof e;var j={nil:"",append:g,get:(e,t)=>{const r=h(e),n=e=>r.reduce((([e,t],r)=>[S(e,r,t),g(r,t)]),[e,""])[0];return void 0===t?n:n(t)},set:(e,r,n)=>{const o=h(e),a=t(((e,t)=>y(o,e,t,"")));return void 0===r?a:a(r,n)},assign:(e,r,n)=>{const o=h(e),a=t(((e,t)=>b(o,e,t,"")));return void 0===r?a:a(r,n)},unset:(e,t)=>{const r=h(e),n=e=>m(r,e,"");return void 0===t?n:n(t)},remove:(e,t)=>{const r=h(e),n=e=>v(r,e,"");return void 0===t?n:n(t)}};j.nil,j.append,j.get,j.set,j.assign,j.unset,j.remove;const A=Symbol("$__value"),P=Symbol("$__href");var x={cons:(e,t)=>Object.freeze({[P]:e,[A]:t}),isReference:e=>e&&void 0!==e[P],href:e=>e[P],value:e=>e[A]};const{jsonTypeOf:I}=p,T=Object.freeze({id:"",pointer:"",instance:void 0,value:void 0}),k=e=>x.isReference(e.value)?x.value(e.value):e.value,V=t(((e,t)=>I(k(e),t))),R=(e,t)=>Object.freeze({...t,pointer:j.append(e,t.pointer),value:k(t)[e]}),C=t(((e,t)=>k(t).map(((r,n,o,a)=>e(R(n,t),n,o,a))))),U=t(((e,t)=>k(t).map(((e,r,n,o)=>R(r,t))).filter(((t,r,n,o)=>e(t,r,n,o))))),z=t(((e,t,r)=>k(r).reduce(((t,n,o)=>e(t,R(o,r),o)),t))),K=t(((e,t)=>k(t).every(((r,n,o,a)=>e(R(n,t),n,o,a))))),L=t(((e,t)=>k(t).some(((r,n,o,a)=>e(R(n,t),n,o,a)))));var q={nil:T,cons:(e,t="")=>Object.freeze({...T,id:t,instance:e,value:e}),uri:e=>`${e.id}#${encodeURI(e.pointer)}`,value:k,has:(e,t)=>e in k(t),typeOf:V,step:R,entries:e=>Object.keys(k(e)).map((t=>[t,R(t,e)])),keys:e=>Object.keys(k(e)),map:C,filter:U,reduce:z,every:K,some:L,length:e=>k(e).length},D=/; *([!#$%&'*+.^_`|~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]+$/,N=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,J=/\\([\u000b\u0020-\u00ff])/g,B=/([\\"])/g,F=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,W=function(e){if(!e)throw new TypeError("argument string is required");var t="object"==typeof e?function(e){var t;"function"==typeof e.getHeader?t=e.getHeader("content-type"):"object"==typeof e.headers&&(t=e.headers&&e.headers["content-type"]);if("string"!=typeof t)throw new TypeError("content-type header is missing from object");return t}(e):e;if("string"!=typeof t)throw new TypeError("argument string is required to be a string");var r=t.indexOf(";"),n=-1!==r?t.substr(0,r).trim():t.trim();if(!F.test(n))throw new TypeError("invalid media type");var o=new M(n.toLowerCase());if(-1!==r){var a,i,s;for(D.lastIndex=r;i=D.exec(t);){if(i.index!==r)throw new TypeError("invalid parameter format");r+=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(r!==t.length)throw new TypeError("invalid parameter format")}return o};function Z(e){var t=String(e);if(N.test(t))return t;if(t.length>0&&!_.test(t))throw new TypeError("invalid parameter value");return'"'+t.replace(B,"\\$1")+'"'}function M(e){this.parameters=Object.create(null),this.type=e}var G={format:function(e){if(!e||"object"!=typeof e)throw new TypeError("argument obj is required");var t=e.parameters,r=e.type;if(!r||!F.test(r))throw new TypeError("invalid type");var n=r;if(t&&"object"==typeof t)for(var o,a=Object.keys(t).sort(),i=0;i<a.length;i++){if(o=a[i],!N.test(o))throw new TypeError("invalid parameter name");n+="; "+o+"="+Z(t[o])}return n},parse:W},H=async e=>Object.entries(await e),Q=t((async(e,t)=>(await t).map(e))),X=t((async(e,t,r)=>(await r).reduce((async(t,r)=>e(await t,r)),t))),Y=t((async(e,t,r={})=>X((async(t,r)=>await e(r)?t.concat([r]):t),[],t,r))),ee=t((async(e,t)=>{const r=await Q(e,t);return(await Promise.all(r)).some((e=>e))})),te=t((async(e,t)=>{const r=await Q(e,t);return(await Promise.all(r)).every((e=>e))})),re=t(((e,t)=>e.reduce((async(e,t)=>t(await e)),t))),ne={entries:H,map:Q,filter:Y,reduce:X,some:ee,every:te,pipeline:re,all:e=>Promise.all(e),allValues:e=>re([H,X((async(e,[t,r])=>(e[t]=await r,e)),{})],e)};ne.entries,ne.map,ne.filter,ne.reduce,ne.some,ne.every,ne.pipeline,ne.all,ne.allValues;var oe=fetch;const{jsonTypeOf:ae,splitUrl:ie,safeResolveUrl:se,pathRelative:ce}=p,le={},ue={},fe=(e,t)=>{const r=e in ue?ue[e]:e;if(r in le)return le[r][t]},de={},pe={},he=(e,t="",r="")=>{e=JSON.parse(JSON.stringify(e));const n=ie(e.$schema||r)[0];if(!n)throw Error("Couldn't determine schema version");delete e.$schema;const o=fe(n,"baseToken"),a=fe(n,"anchorToken"),i=ie(t)[0];if(!i&&!ie(e[o]||"")[0])throw Error("Couldn't determine an identifier for the schema");const s=se(i,e[o]||""),[c,l]=ie(s);delete e[o],l&&o===a&&(e[a]=a!==o?encodeURI(l):`#${encodeURI(l)}`),i&&(pe[i]=c);const u={},f=fe(n,"recursiveAnchorToken");let d;!0===e[f]&&(u[""]=`${c}#`,e[a]="",delete e[f]);const p=fe(n,"vocabularyToken");ae(e[p],"object")?(ue[c]=n,d=e[p],delete e[p]):(ue[c]=n,d={[n]:!0});const h={"":""};return de[c]={id:c,schemaVersion:n,schema:ye(e,c,n,j.nil,h,u),anchors:h,dynamicAnchors:u,vocabulary:d,validated:!1},c},ye=(e,t,r,n,o,a)=>{if(ae(e,"object")){const i="string"==typeof e.$schema?ie(e.$schema)[0]:r,s=fe(i,"embeddedToken"),c=fe(i,"anchorToken");if("string"==typeof e[s]&&(s!==c||"#"!==e[s][0])){const n=se(t,e[s]);return e[s]=n,he(e,n,r),x.cons(e[s],e)}const l=fe(r,"anchorToken"),u=fe(r,"dynamicAnchorToken");"string"==typeof e[u]&&(a[e[u]]=`${t}#${encodeURI(n)}`,o[e[u]]=n,delete e[u]);const f=fe(r,"embeddedToken");if("string"==typeof e[l]){const t=l!==f?e[l]:e[l].slice(1);o[t]=n,delete e[l]}const d=fe(r,"jrefToken");if("string"==typeof e[d])return x.cons(e[d],e);for(const i in e)e[i]=ye(e[i],t,r,j.append(i,n),o,a);return e}return Array.isArray(e)?e.map(((e,i)=>ye(e,t,r,j.append(i,n),o,a))):e},be=e=>de[pe[e]]||de[e],me=Object.freeze({id:"",schemaVersion:void 0,vocabulary:{},pointer:j.nil,schema:void 0,value:void 0,anchors:{},dynamicAnchors:{},validated:!0}),ve=async(e,t=me)=>{const r=se(Oe(t),e),[n,o]=ie(r);if(!(e=>e in de||e in pe)(n)){const e=await oe(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 t=G.parse(e.headers.get("content-type")).type;if("application/schema+json"!==t)throw Error(`${n} is not a schema. Found a document with media type: ${t}`)}he(await e.json(),n)}const a=be(n),i="/"!==o[0]?we(a,o):o,s=Object.freeze({...a,pointer:i,value:j.get(i,a.schema)});return ge(s)},ge=e=>x.isReference(e.value)?ve(x.href(e.value),e):e,we=(e,t)=>{if(!(t in e.anchors))throw Error(`No such anchor '${encodeURI(e.id)}#${encodeURI(t)}'`);return e.anchors[t]},Oe=e=>`${e.id}#${encodeURI(e.pointer)}`,Ee=e=>x.isReference(e.value)?x.value(e.value):e.value,Se=(e,t)=>{const r=be(t.id),n=Object.freeze({...t,pointer:j.append(e,t.pointer),value:Ee(t)[e],validated:r.validated});return ge(n)},$e=t(((e,t)=>ne.pipeline([Ee,ne.map((async(r,n)=>e(await Se(n,t),n))),ne.all],t))),je={parentId:"",parentDialect:"",includeEmbedded:!0},Ae=(e,t)=>{if(t.startsWith("file://")){const r=e.slice(7,e.lastIndexOf("/"));return""===e?"":ce(r,t.slice(7))}return t};var Pe={setConfig:(e,t,r)=>{le[e]||(le[e]={}),le[e][t]=r},getConfig:fe,add:he,get:ve,markValidated:e=>{de[e].validated=!0},uri:Oe,value:Ee,getAnchorPointer:we,typeOf:(e,t)=>ae(Ee(e),t),has:(e,t)=>e in Ee(t),step:Se,keys:e=>Object.keys(Ee(e)),entries:e=>ne.pipeline([Ee,Object.keys,ne.map((async t=>[t,await Se(t,e)])),ne.all],e),map:$e,length:e=>Ee(e).length,toSchema:(e,t={})=>{const r={...je,...t},n=JSON.parse(JSON.stringify(e.schema,((t,n)=>{if(!x.isReference(n))return n;const o=x.value(n),a=o.$schema||e.schemaVersion,i=fe(a,"embeddedToken");return!r.includeEmbedded&&i in o?void 0:x.value(n)}))),o=fe(e.schemaVersion,"dynamicAnchorToken");Object.entries(e.dynamicAnchors).forEach((([e,t])=>{const r=ie(t)[1];j.assign(r,n,{[o]:e,...j.get(r,n)})}));const a=fe(e.schemaVersion,"anchorToken");Object.entries(e.anchors).filter((([e])=>""!==e)).forEach((([e,t])=>{j.assign(t,n,{[a]:e,...j.get(t,n)})}));const i=fe(e.schemaVersion,"baseToken"),s=Ae(r.parentId,e.id),c=r.parentDialect===e.schemaVersion?"":e.schemaVersion;return{...s&&{[i]:s},...c&&{$schema:c},...n}}};Pe.setConfig,Pe.getConfig,Pe.add,Pe.get,Pe.markValidated,Pe.uri,Pe.value,Pe.getAnchorPointer,Pe.typeOf,Pe.has,Pe.step,Pe.keys,Pe.entries,Pe.map,Pe.length,Pe.toSchema;class xe extends Error{constructor(e){super("Invalid Schema"),this.name=this.constructor.name,this.output=e}}var Ie=xe;const{splitUrl:Te}=p,ke="FLAG",Ve="BASIC",Re="DETAILED",Ce="VERBOSE";let Ue=Re,ze=!0;const Ke=async e=>{const t={metaData:{}};return{ast:t,schemaUri:await Fe(e,t)}},Le=t((({ast:e,schemaUri:t},r,n=ke)=>{if(![ke,Ve,Re,Ce].includes(n))throw Error(`The '${n}' error format is not supported`);const o=[],i=a.subscribe("result",qe(n,o));return Ze(t,r,e,{}),a.unsubscribe(i),o[0]})),qe=(e,t)=>{const r=[];return(n,o)=>{if("result"===n){const{keyword:e,absoluteKeywordLocation:t,instanceLocation:n,valid:a}=o,i={keyword:e,absoluteKeywordLocation:t,instanceLocation:n,valid:a,errors:[]};r.push(i)}else if("result.start"===n)r.push(n);else if("result.end"===n){const n=r.pop();for(;"result.start"!==r[r.length-1];){const t=r.pop(),o=[t];e===Ve&&(o.push(...t.errors),delete t.errors),(e===Ce||e!==ke&&!t.valid)&&n.errors.unshift(...o)}r[r.length-1]=n,t[0]=n}}},De={},_e=e=>De[e],Ne=e=>e in De,Je={},Be={},Fe=async(e,t)=>{if(e=await We(e),!Ne(`${e.schemaVersion}#validate`)){const t=await Pe.get(e.schemaVersion);(Pe.getConfig(t.id,"mandatoryVocabularies")||[]).forEach((e=>{if(!t.vocabulary[e])throw Error(`Vocabulary '${e}' must be explicitly declared and required`)})),Object.entries(t.vocabulary).forEach((([e,r])=>{if(e in Je)Object.entries(Je[e]).forEach((([e,r])=>{((e,t)=>{De[e]={collectEvaluatedItems:(e,r,n,o,a)=>t.interpret(e,r,n,o,a)&&new Set,collectEvaluatedProperties:(e,r,n,o,a)=>t.interpret(e,r,n,o,a)&&[],...t}})(`${t.id}#${e}`,r)}));else if(r)throw Error(`Missing required vocabulary: ${e}`)}))}if(ze&&!e.validated){if(Pe.markValidated(e.id),!(e.schemaVersion in Be)){const t=await Pe.get(e.schemaVersion),r=await Ke(t);Be[t.id]=Le(r)}const t=q.cons(e.schema,e.id),r=Be[e.schemaVersion](t,Ue);if(!r.valid)throw new Ie(r)}return e.id in t.metaData||(t.metaData[e.id]={id:e.id,dynamicAnchors:e.dynamicAnchors,anchors:e.anchors}),_e(`${e.schemaVersion}#validate`).compile(e,t)},We=async e=>Pe.typeOf(e,"string")?We(await Pe.get(Pe.value(e),e)):e,Ze=(e,t,r,n)=>{const o=Me(e,r),a=Te(e)[0];return _e(o).interpret(e,t,r,{...r.metaData[a].dynamicAnchors,...n})},Me=(e,t)=>{if(!(e in t))throw Error(`No schema found at ${e}`);return t[e][0]};var Ge={validate:async(e,t,r)=>{const n=await Ke(e),o=(e,t)=>Le(n,q.cons(e),t);return void 0===t?o:o(t,r)},compile:Ke,interpret:Le,setMetaOutputFormat:e=>{Ue=e},setShouldMetaValidate:e=>{ze=e},FLAG:ke,BASIC:Ve,DETAILED:Re,VERBOSE:Ce,add:(e,t="",r="")=>{const n=Pe.add(e,t,r);delete Be[n]},getKeyword:_e,hasKeyword:Ne,defineVocabulary:(e,t)=>{Je[e]=t},compileSchema:Fe,interpretSchema:Ze,collectEvaluatedProperties:(e,t,r,n,o)=>{const a=Me(e,r);return _e(a).collectEvaluatedProperties(e,t,r,n,o)},collectEvaluatedItems:(e,t,r,n,o)=>{const a=Me(e,r);return _e(a).collectEvaluatedItems(e,t,r,n,o)}};var He={compile:e=>Pe.value(e),interpret:()=>!0};var Qe={compile:async(e,t)=>{const r=Pe.uri(e);if(!(r in t)){t[r]=!1;const n=Pe.value(e);if(!["object","boolean"].includes(typeof n))throw Error(`No schema found at '${Pe.uri(e)}'`);t[r]=[`${e.schemaVersion}#validate`,Pe.uri(e),"boolean"==typeof n?n:await ne.pipeline([Pe.entries,ne.map((([t,r])=>[`${e.schemaVersion}#${t}`,r])),ne.filter((([t])=>Ge.hasKeyword(t)&&t!==`${e.schemaVersion}#validate`)),ne.map((async([r,n])=>{const o=await Ge.getKeyword(r).compile(n,t,e);return[r,Pe.uri(n),o]})),ne.all],e)]}return r},interpret:(e,t,r,n)=>{const[o,i,s]=r[e];a.publishSync("result.start");const c="boolean"==typeof s?s:s.every((([e,o,i])=>{a.publishSync("result.start");const s=Ge.getKeyword(e).interpret(i,t,r,n);return a.publishSync("result",{keyword:e,absoluteKeywordLocation:o,instanceLocation:q.uri(t),valid:s,ast:i}),a.publishSync("result.end"),s}));return a.publishSync("result",{keyword:o,absoluteKeywordLocation:i,instanceLocation:q.uri(t),valid:c,ast:e}),a.publishSync("result.end"),c},collectEvaluatedProperties:(e,t,r,n,o=!1)=>{const a=r[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,t,r,n);return!1!==i&&[...e,...i]}),[])},collectEvaluatedItems:(e,t,r,n,o=!1)=>{const a=r[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,t,r,n);return!1!==i&&new Set([...e,...i])}),new Set)}},Xe={metaData:He,validate:Qe},Ye=e("default",{Core:Ge,Schema:Pe,Instance:q,Reference:x,Keywords:Xe,InvalidSchemaError:Ie});e("Core",Ye.Core),e("Schema",Ye.Schema),e("Instance",Ye.Instance),e("Reference",Ye.Reference),e("Keywords",Ye.Keywords),e("InvalidSchemaError",Ye.InvalidSchemaError)}}}));
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),h=t(a+"{1,4}"),d=t(t(h+"\\:"+h)+"|"+f),v=t(t(h+"\\:")+"{6}"+d),y=t("\\:\\:"+t(h+"\\:")+"{5}"+d),m=t(t(h)+"?\\:\\:"+t(h+"\\:")+"{4}"+d),g=t(t(t(h+"\\:")+"{0,1}"+h)+"?\\:\\:"+t(h+"\\:")+"{3}"+d),b=t(t(t(h+"\\:")+"{0,2}"+h)+"?\\:\\:"+t(h+"\\:")+"{2}"+d),w=t(t(t(h+"\\:")+"{0,3}"+h)+"?\\:\\:"+h+"\\:"+d),E=t(t(t(h+"\\:")+"{0,4}"+h)+"?\\:\\:"+d),S=t(t(t(h+"\\:")+"{0,5}"+h)+"?\\:\\:"+h),C=t(t(t(h+"\\:")+"{0,6}"+h)+"?\\:\\:"),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 j=t(i+"|"+r(l,s,"[\\:\\@]"));return t(t(i+"|"+r(l,s,"[\\@]"))+"+"),t(t(j+"|"+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,h=36,d=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=h-d,j=Math.floor,T=String.fromCharCode;function I(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 D(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 P(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 $=function(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:h},R=function(e,r){return e+22+75*(e<26)-((0!=r)<<5)},N=function(e,r,t){var n=0;for(e=t?j(e/m):e>>1,e+=j(e/r);e>A*v>>1;n+=h)e=j(e/A);return j(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&&I("not-basic"),r.push(e.charCodeAt(s));for(var c=i>0?i+1:0;c<t;){for(var u=n,l=1,p=h;;p+=h){c>=t&&I("invalid-input");var y=$(e.charCodeAt(c++));(y>=h||y>j((f-n)/l))&&I("overflow"),n+=y*l;var m=p<=a?d:p>=a+v?v:p-a;if(y<m)break;var E=h-m;l>j(f/E)&&I("overflow"),l*=E}var S=r.length+1;a=N(n-u,S,0==u),j(n/S)>f-o&&I("overflow"),o+=j(n/S),n%=S,r.splice(n++,0,o)}return String.fromCodePoint.apply(String,r)},_=function(e){var r=[],t=(e=P(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 D=A.value;D>=n&&D<E&&(E=D)}}catch(e){C=!0,O=e}finally{try{!S&&x.return&&x.return()}finally{if(C)throw O}}var $=m+1;E-n>j((f-o)/$)&&I("overflow"),o+=(E-n)*$,n=E;var F=!0,_=!1,V=void 0;try{for(var U,k=e[Symbol.iterator]();!(F=(U=k.next()).done);F=!0){var q=U.value;if(q<n&&++o>f&&I("overflow"),q==n){for(var L=o,z=h;;z+=h){var H=z<=a?d:z>=a+v?v:z-a;if(L<H)break;var K=L-H,M=h-H;r.push(T(R(H+K%M,0))),L=j(K/M)}r.push(T(R(L,0))),a=N(o,$,m==y),o=0,++m}}}catch(e){_=!0,V=e}finally{try{!F&&k.return&&k.return()}finally{if(_)throw V}}++o,++n}return r.join("")},V=function(e){return D(e,(function(e){return E.test(e)?F(e.slice(4).toLowerCase()):e}))},U=function(e){return D(e,(function(e){return S.test(e)?"xn--"+_(e):e}))},k={version:"2.1.0",ucs2:{decode:P,encode:function(e){return String.fromCodePoint.apply(String,p(e))}},decode:F,encode:_,toASCII:U,toUnicode:V},q={};function L(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 z(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 H(e,r){function t(e){var t=z(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,L).replace(r.PCT_ENCODED,o)),void 0!==e.host&&(e.host=String(e.host).replace(r.PCT_ENCODED,t).toLowerCase().replace(r.NOT_HOST,L).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,L).replace(r.PCT_ENCODED,o)),void 0!==e.query&&(e.query=String(e.query).replace(r.PCT_ENCODED,t).replace(r.NOT_QUERY,L).replace(r.PCT_ENCODED,o)),void 0!==e.fragment&&(e.fragment=String(e.fragment).replace(r.PCT_ENCODED,t).replace(r.NOT_FRAGMENT,L).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),h=r.IPV4ADDRESS.test(f[f.length-1]),d=h?7:8,v=f.length-d,y=Array(d),m=0;m<d;++m)y[m]=p[m]||f[v+m]||"";h&&(y[d-1]=M(y[d-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=q[(r.scheme||t.scheme||"").toLowerCase()];if(r.unicodeSupport||a&&a.unicodeSupport)H(t,n);else{if(t.host&&(r.domainHost||a&&a.domainHost))try{t.host=k.toASCII(t.host.replace(n.PCT_ENCODED,z).toLowerCase())}catch(e){t.error=t.error||"Host's domain name can not be converted to ASCII via punycode: "+e}H(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=q[(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?k.toUnicode(e.host):k.toASCII(e.host.replace(t.PCT_ENCODED,z).toLowerCase())}catch(t){e.error=e.error||"Host's domain name can not be converted to "+(r.iri?"Unicode":"ASCII")+" via punycode: "+t}H(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,L)}function ce(e,r){return e&&e.toString().replace(r&&r.iri?u.PCT_ENCODED:c.PCT_ENCODED,z)}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}},he={scheme:"wss",domainHost:fe.domainHost,parse:fe.parse,serialize:fe.serialize},de={},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 je(e){var r=z(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 h=0,d=n.length;h<d;++h){var v=n[h].split("@");if(v[0]=ce(v[0]),r.unicodeSupport)v[1]=ce(v[1],r).toLowerCase();else try{v[1]=k.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[h]=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,je).replace(Se,o).replace(Ce,L),p=c.slice(u+1);try{p=r.iri?k.toUnicode(p):k.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 h=[];for(var d in f)f[d]!==de[d]&&h.push(d.replace(Se,je).replace(Se,o).replace(Oe,L)+"="+f[d].replace(Se,je).replace(Se,o).replace(Ae,L));return h.length&&(t.query=h.join("&")),t}},Ie=/^([^\:]+)\:(.*)/,xe={scheme:"urn",parse:function(e,r){var t=e.path&&e.path.match(Ie),n=e;if(t){var o=r.scheme||n.scheme||"urn",a=t[1].toLowerCase(),i=t[2],s=o+":"+(r.nid||a),c=q[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=q[o];a&&(e=a.serialize(e,r));var i=e,s=e.nss;return i.path=(n||r.nid)+":"+s,i}},De=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/,Pe={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(De)||(t.error=t.error||"UUID is not valid."),t},serialize:function(e,r){var t=e;return t.nss=(e.uuid||"").toLowerCase(),t}};q[ue.scheme]=ue,q[le.scheme]=le,q[fe.scheme]=fe,q[he.scheme]=he,q[Te.scheme]=Te,q[xe.scheme]=xe,q[Pe.scheme]=Pe,e.SCHEMES=q,e.pctEncChar=L,e.pctDecChars=z,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,d(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,d(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,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 g(r,e[0],t)}},h=(e,r,t)=>{if(0!==e.length)if(e.length>1){const n=e.shift(),o=g(r,n,t);h(e,o,d(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)},d=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:d,get:(e,r)=>{const t=u(e),n=e=>t.reduce((([e,r],t)=>[g(e,t,r),d(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=>h(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,j=Object.freeze({id:"",pointer:"",instance:void 0,value:void 0}),T=e=>C.isReference(e.value)?C.value(e.value):e.value,I=r(((e,r)=>A(T(e),r))),x=(e,r)=>Object.freeze({...r,pointer:w.append(e,r.pointer),value:T(r)[e]}),D=r(((e,r)=>T(r).map(((t,n,o,a)=>e(x(n,r),n,o,a))))),P=r(((e,r)=>T(r).map(((e,t,n,o)=>x(t,r))).filter(((r,t,n,o)=>e(r,t,n,o))))),$=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:j,cons:(e,r="")=>Object.freeze({...j,id:O(r,""),instance:e,value:e}),uri:e=>`${e.id}#${encodeURI(e.pointer)}`,value:T,has:(e,r)=>e in T(r),typeOf:I,step:x,entries:e=>Object.keys(T(e)).map((r=>[r,x(r,e)])),keys:e=>Object.keys(T(e)),map:D,filter:P,reduce:$,every:R,some:N,length:e=>T(e).length},_=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,V=/^[\u000b\u0020-\u007e\u0080-\u00ff]+$/,U=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,k=/\\([\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 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(k,"$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(U.test(r))return r;if(r.length>0&&!V.test(r))throw new TypeError("invalid parameter value");return'"'+r.replace(q,"\\$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||!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],!U.test(o))throw new TypeError("invalid parameter name");n+="; "+o+"="+H(r[o])}return n},parse:z},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={},ie={},se=(e,r)=>{const t=e in ie?ie[e]:e;if(t in ae)return ae[t][r]},ce={},ue={},le=(e,r="",t="")=>{e=JSON.parse(JSON.stringify(e));const n=te(e.$schema||t,"");if(!n)throw Error("Couldn't determine schema version");delete e.$schema;const o=se(n,"baseToken"),a=se(n,"anchorToken"),i=te(r,"");if(!i&&!te(e[o]||"",""))throw Error("Couldn't determine an identifier for the schema");const s=te(i,e[o]||""),c=te(s,""),u=ne(s);delete e[o],u&&o===a&&(e[a]=a!==o?encodeURI(u):`#${encodeURI(u)}`),i&&(ue[i]=c);const l={},p=se(n,"recursiveAnchorToken");let f;!0===e[p]&&(l[""]=`${c}#`,e[a]="",delete e[p]);const h=se(n,"vocabularyToken");re(e[h],"object")?(ie[c]=n,f=e[h],delete e[h]):(ie[c]=n,f={[n]:!0});const d={"":""};return ce[c]={id:c,schemaVersion:n,schema:pe(e,c,n,w.nil,d,l),anchors:d,dynamicAnchors:l,vocabulary:f,validated:!1},c},pe=(e,r,t,n,o,a)=>{if(re(e,"object")){const i="string"==typeof e.$schema?te(e.$schema,""):t,s=se(i,"embeddedToken"),c=se(i,"anchorToken");if("string"==typeof e[s]&&(s!==c||"#"!==e[s][0])){const n=te(r,e[s]);return e[s]=n,le(e,n,t),C.cons(e[s],e)}const u=se(t,"anchorToken"),l=se(t,"dynamicAnchorToken");"string"==typeof e[l]&&(a[e[l]]=`${r}#${encodeURI(n)}`,o[e[l]]=n,delete e[l]);const p=se(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=se(t,"jrefToken");if("string"==typeof e[f])return C.cons(e[f],e);for(const i in e)e[i]=pe(e[i],r,t,w.append(i,n),o,a);return e}return Array.isArray(e)?e.map(((e,i)=>pe(e,r,t,w.append(i,n),o,a))):e},fe=e=>ce[ue[e]]||ce[e],he=Object.freeze({id:"",schemaVersion:void 0,vocabulary:{},pointer:w.nil,schema:void 0,value:void 0,anchors:{},dynamicAnchors:{},validated:!0}),de=async(e,r=he)=>{const t=te(me(r),e),n=te(t,""),o=ne(t);if(!(e=>e in ce||e in ue)(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}`)}le(await e.json(),n)}const a=fe(n),i="/"!==o[0]?ye(a,o):o,s=Object.freeze({...a,pointer:i,value:w.get(i,a.schema)});return ve(s)},ve=e=>C.isReference(e.value)?de(C.href(e.value),e):e,ye=(e,r)=>{if(!(r in e.anchors))throw Error(`No such anchor '${encodeURI(e.id)}#${encodeURI(r)}'`);return e.anchors[r]},me=e=>`${e.id}#${encodeURI(e.pointer)}`,ge=e=>C.isReference(e.value)?C.value(e.value):e.value,be=(e,r)=>{const t=fe(r.id),n=Object.freeze({...r,pointer:w.append(e,r.pointer),value:ge(r)[e],validated:t.validated});return ve(n)},we=r(((e,r)=>X.pipeline([ge,X.map((async(t,n)=>e(await be(n,r),n))),X.all],r))),Ee={parentId:"",parentDialect:"",includeEmbedded:!0},Se=(e,r)=>{if(r.startsWith("file://")){const t=e.slice(7,e.lastIndexOf("/"));return""===e?"":oe(t,r.slice(7))}return r};var Ce={setConfig:(e,r,t)=>{ae[e]||(ae[e]={}),ae[e][r]=t},getConfig:se,add:le,get:de,markValidated:e=>{ce[e].validated=!0},uri:me,value:ge,getAnchorPointer:ye,typeOf:(e,r)=>re(ge(e),r),has:(e,r)=>e in ge(r),step:be,keys:e=>Object.keys(ge(e)),entries:e=>X.pipeline([ge,Object.keys,X.map((async r=>[r,await be(r,e)])),X.all],e),map:we,length:e=>ge(e).length,toSchema:(e,r={})=>{const t={...Ee,...r},n=JSON.parse(JSON.stringify(e.schema,((r,n)=>{if(!C.isReference(n))return n;const o=C.value(n),a=o.$schema||e.schemaVersion,i=se(a,"embeddedToken");return!t.includeEmbedded&&i in o?void 0:C.value(n)}))),o=se(e.schemaVersion,"dynamicAnchorToken");Object.entries(e.dynamicAnchors).forEach((([e,r])=>{const t=ne(r);w.assign(t,n,{[o]:e,...w.get(t,n)})}));const a=se(e.schemaVersion,"anchorToken");Object.entries(e.anchors).filter((([e])=>""!==e)).forEach((([e,r])=>{w.assign(r,n,{[a]:e,...w.get(r,n)})}));const i=se(e.schemaVersion,"baseToken"),s=Se(t.parentId,e.id),c=t.parentDialect===e.schemaVersion?"":e.schemaVersion;return{...s&&{[i]:s},...c&&{$schema:c},...n}}};Ce.setConfig,Ce.getConfig,Ce.add,Ce.get,Ce.markValidated,Ce.uri,Ce.value,Ce.getAnchorPointer,Ce.typeOf,Ce.has,Ce.step,Ce.keys,Ce.entries,Ce.map,Ce.length,Ce.toSchema;class Oe extends Error{constructor(e){super("Invalid Schema"),this.name=this.constructor.name,this.output=e}}var Ae=Oe;const{resolveUrl:je}=c,Te="FLAG",Ie="BASIC",xe="DETAILED",De="VERBOSE";let Pe=xe,$e=!0;const Re=async e=>{const r={metaData:{}};return{ast:r,schemaUri:await Le(e,r)}},Ne=r((({ast:e,schemaUri:r},t,n=Te)=>{if(![Te,Ie,xe,De].includes(n))throw Error(`The '${n}' error format is not supported`);const a=[],i=o.subscribe("result",Fe(n,a));return He(r,t,e,{}),o.unsubscribe(i),a[0]})),Fe=(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===Ie&&(o.push(...r.errors),delete r.errors),(e===De||e!==Te&&!r.valid)&&n.errors.unshift(...o)}t[t.length-1]=n,r[0]=n}}},_e={},Ve=e=>_e[e],Ue=e=>e in _e,ke={},qe={},Le=async(e,r)=>{if(e=await ze(e),!Ue(`${e.schemaVersion}#validate`)){const r=await Ce.get(e.schemaVersion);(Ce.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)=>{_e[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(Ce.markValidated(e.id),!(e.schemaVersion in qe)){const r=await Ce.get(e.schemaVersion),t=await Re(r);qe[r.id]=Ne(t)}const r=F.cons(e.schema,e.id),t=qe[e.schemaVersion](r,Pe);if(!t.valid)throw new Ae(t)}return e.id in r.metaData||(r.metaData[e.id]={id:e.id,dynamicAnchors:e.dynamicAnchors,anchors:e.anchors}),Ve(`${e.schemaVersion}#validate`).compile(e,r)},ze=async e=>Ce.typeOf(e,"string")?ze(await Ce.get(Ce.value(e),e)):e,He=(e,r,t,n)=>{const o=Ke(e,t),a=je(e,"");return Ve(o).interpret(e,r,t,{...t.metaData[a].dynamicAnchors,...n})},Ke=(e,r)=>{if(!(e in r))throw Error(`No schema found at ${e}`);return r[e][0]};var Me={validate:async(e,r,t)=>{const n=await Re(e),o=(e,r)=>Ne(n,F.cons(e),r);return void 0===r?o:o(r,t)},compile:Re,interpret:Ne,setMetaOutputFormat:e=>{Pe=e},setShouldMetaValidate:e=>{$e=e},FLAG:Te,BASIC:Ie,DETAILED:xe,VERBOSE:De,add:(e,r="",t="")=>{const n=Ce.add(e,r,t);delete qe[n]},getKeyword:Ve,hasKeyword:Ue,defineVocabulary:(e,r)=>{ke[e]=r},compileSchema:Le,interpretSchema:He,collectEvaluatedProperties:(e,r,t,n,o)=>{const a=Ke(e,t);return Ve(a).collectEvaluatedProperties(e,r,t,n,o)},collectEvaluatedItems:(e,r,t,n,o)=>{const a=Ke(e,t);return Ve(a).collectEvaluatedItems(e,r,t,n,o)}};var Ze={compile:e=>Ce.value(e),interpret:()=>!0};var Je={compile:async(e,r)=>{const t=Ce.uri(e);if(!(t in r)){r[t]=!1;const n=Ce.value(e);if(!["object","boolean"].includes(typeof n))throw Error(`No schema found at '${Ce.uri(e)}'`);r[t]=[`${e.schemaVersion}#validate`,Ce.uri(e),"boolean"==typeof n?n:await X.pipeline([Ce.entries,X.map((([r,t])=>[`${e.schemaVersion}#${r}`,t])),X.filter((([r])=>Me.hasKeyword(r)&&r!==`${e.schemaVersion}#validate`)),X.map((async([t,n])=>{const o=await Me.getKeyword(t).compile(n,r,e);return[t,Ce.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=Me.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&&Me.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&&Me.getKeyword(o).collectEvaluatedItems(a,r,t,n);return!1!==i&&new Set([...e,...i])}),new Set)}},Be={metaData:Ze,validate:Je},Ge=e("default",{Core:Me,Schema:Ce,Instance:F,Reference:C,Keywords:Be,InvalidSchemaError:Ae});e("Core",Ge.Core),e("Schema",Ge.Schema),e("Instance",Ge.Instance),e("Reference",Ge.Reference),e("Keywords",Ge.Keywords),e("InvalidSchemaError",Ge.InvalidSchemaError)}}}));
//# sourceMappingURL=json-schema-core-system.min.js.map

@@ -1,2 +0,4 @@

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).JSC={})}(this,(function(e){"use strict";var t=function(e,t){return function r(){null==t&&(t=e.length);var n=[].slice.call(arguments);return n.length>=t?e.apply(this,n):function(){return r.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:{};var n=function(e,t){return e(t={exports:{}},t.exports),t.exports}((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 t={},r=-1,n="*";function o(e){var t;for(t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!0;return!1}function a(e){return function(){throw e}}function i(e,t,r){try{e(t,r)}catch(e){setTimeout(a(e),0)}}function s(e,t,r){e(t,r)}function c(e,r,n,o){var a,c=t[r],l=o?s:i;if(Object.prototype.hasOwnProperty.call(t,r))for(a in c)Object.prototype.hasOwnProperty.call(c,a)&&l(c[a],e,n)}function l(e,t,r){return function(){var o=String(e),a=o.lastIndexOf(".");for(c(e,e,t,r);-1!==a;)a=(o=o.substr(0,a)).lastIndexOf("."),c(e,o,t,r);c(e,n,t,r)}}function u(e){var r=String(e);return Boolean(Object.prototype.hasOwnProperty.call(t,r)&&o(t[r]))}function f(e){for(var t=String(e),r=u(t)||u(n),o=t.lastIndexOf(".");!r&&-1!==o;)o=(t=t.substr(0,o)).lastIndexOf("."),r=u(t);return r}function d(e,t,r,n){var o=l(e="symbol"==typeof e?e.toString():e,t,n);return!!f(e)&&(!0===r?o():setTimeout(o,0),!0)}e.publish=function(t,r){return d(t,r,!1,e.immediateExceptions)},e.publishSync=function(t,r){return d(t,r,!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(t,e)||(t[e]={});var o="uid_"+String(++r);return t[e][o]=n,o},e.subscribeAll=function(t){return e.subscribe(n,t)},e.subscribeOnce=function(t,r){var n=e.subscribe(t,(function(){e.unsubscribe(n),r.apply(this,arguments)}));return e},e.clearAllSubscriptions=function(){t={}},e.clearSubscriptions=function(e){var r;for(r in t)Object.prototype.hasOwnProperty.call(t,r)&&0===r.indexOf(e)&&delete t[r]},e.countSubscriptions=function(e){var r,n,o=0;for(r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&0===r.indexOf(e)){for(n in t[r])o++;break}return o},e.getSubscriptions=function(e){var r,n=[];for(r in t)Object.prototype.hasOwnProperty.call(t,r)&&0===r.indexOf(e)&&n.push(r);return n},e.unsubscribe=function(r){var n,o,a,i=function(e){var r;for(r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&0===r.indexOf(e))return!0;return!1},s="string"==typeof r&&(Object.prototype.hasOwnProperty.call(t,r)||i(r)),c=!s&&"string"==typeof r,l="function"==typeof r,u=!1;if(!s){for(n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(o=t[n],c&&o[r]){delete o[r],u=r;break}if(l)for(a in o)Object.prototype.hasOwnProperty.call(o,a)&&o[a]===r&&(delete o[a],u=!0)}return u}e.clearSubscriptions(r)}}(o)),void 0!==e&&e.exports&&(t=e.exports=o),t.PubSub=o,e.exports=t=o}));n.PubSub;var o=function(e,t){if(e=e.trim(),(t=t.trim()).startsWith("about:"))return t;const r=function(e){const t={host:"",path:"",query:"",protocol:""};let r=e,n=e.indexOf("//");t.protocol=r.substring(0,n),n+=2;const o=e.indexOf("/",n),a=e.indexOf("?"),i=e.indexOf("#");-1!==i&&(r=r.substring(0,i));if(-1!==a){const e=r.substring(a);t.query=e,r=r.substring(0,a)}if(-1!==o){const e=r.substring(0,o);t.host=e,r=r.substring(o),t.path=r}else t.host=r;return t}(e),n=function(e){const t={href:e,hash:"",query:"",netPath:!1,absolutePath:!1,relativePath:!1};if(s.test(e))return t.netPath=!0,t;"/"===e[0]?t.absolutePath=!0:""!==e&&(t.relativePath=!0);let r=e;const n=e.indexOf("?"),o=e.indexOf("#");if(-1!==o){const e=r.substring(o);t.hash=e,r=r.substring(0,o)}if(-1!==n){const e=r.substring(n);t.query=e,r=r.substring(0,n)}return t.path=r,t}(t);if(!r.protocol&&!n.netPath)throw new Error("Error, protocol is not specified");if(n.netPath)return n.href.startsWith("//")&&(n.href=r.protocol+n.href),function(e){const t=e.indexOf("//")+2,r=!e.includes("/",t),n=!e.includes("?",t),o=!e.includes("#",t);return r&&n&&o}(n.href)?a(n.href):n.href;if(n.absolutePath){const{path:e,query:t,hash:o}=n;return r.host+i(e)+t+o}if(n.relativePath){const{path:e,query:t,hash:o}=n;let a,s=r.path,c=r.host;return 0===e.length?a=s:(s=s.substring(0,s.lastIndexOf("/")),a=i(s+"/"+e)),c+=""!==a||t||o?a+t+o:"/",c}{const{host:e,path:t,query:o}=r;return t||o?e+t+o+n.hash:a(e)}};function a(e){return e+("/"===e[e.length-1]?"":"/")}function i(e){let t=e.split("/");""===t[0]&&(t=t.slice(1));let r=[];return t.forEach(((e,n)=>{"."!==e&&(".."===e?r.pop():""===e&&n!==t.length-1||r.push(e))})),"/"+r.join("/")}const s=new RegExp("^([a-z][a-z0-9+.-]*:)?//","i");const c={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},l=e=>{const t=e.indexOf("#"),r=-1===t?e.length:t,n=e.slice(0,r),o=e.slice(r+1);return[decodeURI(n),decodeURI(o)]},u=e=>{const t=RegExp(/^(.+):\/\//).exec(e);return t?t[1]:""};var f={jsonTypeOf:(e,t)=>c[t](e),splitUrl:l,safeResolveUrl:(e,t)=>{const r=o(e,t),n=l(e)[0];if(n&&"file"===u(r)&&"file"!==u(n))throw Error(`Can't access file '${r}' resource from network context '${e}'`);return r},pathRelative:(e,t)=>{if(e===t)return"";let r=1;const n=e.length-1,o=t.length-r,a=n<o?n:o;let i=-1,s=0;for(;s<a;s++){const n=e.charCodeAt(s+1);if(n!==t.charCodeAt(r+s))break;47===n&&(i=s)}if(o>a){if(47===t.charCodeAt(r+s))return t.slice(r+s+1);if(0===s)return t.slice(r+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 r+=i,c.length>0?`${c}${t.slice(r,t.length)}`:(47===t.charCodeAt(r)&&++r,t.slice(r,t.length))}};const d=e=>{if(e.length>0&&"/"!==e[0])throw Error("Invalid JSON Pointer");return e.split("/").slice(1).map(g)},p=(e,t,r,n)=>{if(0===e.length)return r;if(e.length>1){const o=e.shift();return{...t,[o]:p(e,O(t,o,n),r,m(o,n))}}if(Array.isArray(t)){const n=[...t];return n[w(t,e[0])]=r,n}return"object"==typeof t&&null!==t?{...t,[e[0]]:r}:O(t,e[0],n)},h=(e,t,r,n)=>{if(0!==e.length)if(1!==e.length||E(t)){const o=e.shift();h(e,O(t,o,n),r,m(o,n))}else{t[w(t,e[0])]=r}},y=(e,t,r)=>{if(0!=e.length){if(e.length>1){const n=e.shift(),o=O(t,n,r);return{...t,[n]:y(e,o,m(n,r))}}if(Array.isArray(t))return t.filter(((t,r)=>r!=e[0]));if("object"==typeof t&&null!==t){const{[e[0]]:r,...n}=t;return n}return O(t,e[0],r)}},b=(e,t,r)=>{if(0!==e.length)if(e.length>1){const n=e.shift(),o=O(t,n,r);b(e,o,m(n,r))}else Array.isArray(t)?t.splice(e[0],1):"object"==typeof t&&null!==t?delete t[e[0]]:O(t,e[0],r)},m=t(((e,t)=>t+"/"+v(e))),v=e=>e.toString().replace(/~/g,"~0").replace(/\//g,"~1"),g=e=>e.toString().replace(/~1/g,"/").replace(/~0/g,"~"),w=(e,t)=>Array.isArray(e)&&"-"===t?e.length:t,O=(e,t,r="")=>{if(void 0===e)throw TypeError(`Value at '${r}' is undefined and does not have property '${t}'`);if(null===e)throw TypeError(`Value at '${r}' is null and does not have property '${t}'`);if(E(e))throw TypeError(`Value at '${r}' is a ${typeof e} and does not have property '${t}'`);return e[w(e,t)]},E=e=>null===e||"object"!=typeof e;var j={nil:"",append:m,get:(e,t)=>{const r=d(e),n=e=>r.reduce((([e,t],r)=>[O(e,r,t),m(r,t)]),[e,""])[0];return void 0===t?n:n(t)},set:(e,r,n)=>{const o=d(e),a=t(((e,t)=>p(o,e,t,"")));return void 0===r?a:a(r,n)},assign:(e,r,n)=>{const o=d(e),a=t(((e,t)=>h(o,e,t,"")));return void 0===r?a:a(r,n)},unset:(e,t)=>{const r=d(e),n=e=>y(r,e,"");return void 0===t?n:n(t)},remove:(e,t)=>{const r=d(e),n=e=>b(r,e,"");return void 0===t?n:n(t)}};j.nil,j.append,j.get,j.set,j.assign,j.unset,j.remove;const S=Symbol("$__value"),$=Symbol("$__href");var A={cons:(e,t)=>Object.freeze({[$]:e,[S]:t}),isReference:e=>e&&void 0!==e[$],href:e=>e[$],value:e=>e[S]};const{jsonTypeOf:x}=f,P=Object.freeze({id:"",pointer:"",instance:void 0,value:void 0}),T=e=>A.isReference(e.value)?A.value(e.value):e.value,I=t(((e,t)=>x(T(e),t))),k=(e,t)=>Object.freeze({...t,pointer:j.append(e,t.pointer),value:T(t)[e]}),V=t(((e,t)=>T(t).map(((r,n,o,a)=>e(k(n,t),n,o,a))))),R=t(((e,t)=>T(t).map(((e,r,n,o)=>k(r,t))).filter(((t,r,n,o)=>e(t,r,n,o))))),C=t(((e,t,r)=>T(r).reduce(((t,n,o)=>e(t,k(o,r),o)),t))),U=t(((e,t)=>T(t).every(((r,n,o,a)=>e(k(n,t),n,o,a))))),z=t(((e,t)=>T(t).some(((r,n,o,a)=>e(k(n,t),n,o,a)))));var K={nil:P,cons:(e,t="")=>Object.freeze({...P,id:t,instance:e,value:e}),uri:e=>`${e.id}#${encodeURI(e.pointer)}`,value:T,has:(e,t)=>e in T(t),typeOf:I,step:k,entries:e=>Object.keys(T(e)).map((t=>[t,k(t,e)])),keys:e=>Object.keys(T(e)),map:V,filter:R,reduce:C,every:U,some:z,length:e=>T(e).length},L=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,q=/^[\u000b\u0020-\u007e\u0080-\u00ff]+$/,_=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,D=/\\([\u000b\u0020-\u00ff])/g,N=/([\\"])/g,J=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,B=function(e){if(!e)throw new TypeError("argument string is required");var t="object"==typeof e?function(e){var t;"function"==typeof e.getHeader?t=e.getHeader("content-type"):"object"==typeof e.headers&&(t=e.headers&&e.headers["content-type"]);if("string"!=typeof t)throw new TypeError("content-type header is missing from object");return t}(e):e;if("string"!=typeof t)throw new TypeError("argument string is required to be a string");var r=t.indexOf(";"),n=-1!==r?t.substr(0,r).trim():t.trim();if(!J.test(n))throw new TypeError("invalid media type");var o=new W(n.toLowerCase());if(-1!==r){var a,i,s;for(L.lastIndex=r;i=L.exec(t);){if(i.index!==r)throw new TypeError("invalid parameter format");r+=i[0].length,a=i[1].toLowerCase(),'"'===(s=i[2])[0]&&(s=s.substr(1,s.length-2).replace(D,"$1")),o.parameters[a]=s}if(r!==t.length)throw new TypeError("invalid parameter format")}return o};function F(e){var t=String(e);if(_.test(t))return t;if(t.length>0&&!q.test(t))throw new TypeError("invalid parameter value");return'"'+t.replace(N,"\\$1")+'"'}function W(e){this.parameters=Object.create(null),this.type=e}var Z={format:function(e){if(!e||"object"!=typeof e)throw new TypeError("argument obj is required");var t=e.parameters,r=e.type;if(!r||!J.test(r))throw new TypeError("invalid type");var n=r;if(t&&"object"==typeof t)for(var o,a=Object.keys(t).sort(),i=0;i<a.length;i++){if(o=a[i],!_.test(o))throw new TypeError("invalid parameter name");n+="; "+o+"="+F(t[o])}return n},parse:B},M=async e=>Object.entries(await e),G=t((async(e,t)=>(await t).map(e))),H=t((async(e,t,r)=>(await r).reduce((async(t,r)=>e(await t,r)),t))),Q=t((async(e,t,r={})=>H((async(t,r)=>await e(r)?t.concat([r]):t),[],t,r))),X=t((async(e,t)=>{const r=await G(e,t);return(await Promise.all(r)).some((e=>e))})),Y=t((async(e,t)=>{const r=await G(e,t);return(await Promise.all(r)).every((e=>e))})),ee=t(((e,t)=>e.reduce((async(e,t)=>t(await e)),t))),te={entries:M,map:G,filter:Q,reduce:H,some:X,every:Y,pipeline:ee,all:e=>Promise.all(e),allValues:e=>ee([M,H((async(e,[t,r])=>(e[t]=await r,e)),{})],e)};te.entries,te.map,te.filter,te.reduce,te.some,te.every,te.pipeline,te.all,te.allValues;var re=fetch;const{jsonTypeOf:ne,splitUrl:oe,safeResolveUrl:ae,pathRelative:ie}=f,se={},ce={},le=(e,t)=>{const r=e in ce?ce[e]:e;if(r in se)return se[r][t]},ue={},fe={},de=(e,t="",r="")=>{e=JSON.parse(JSON.stringify(e));const n=oe(e.$schema||r)[0];if(!n)throw Error("Couldn't determine schema version");delete e.$schema;const o=le(n,"baseToken"),a=le(n,"anchorToken"),i=oe(t)[0];if(!i&&!oe(e[o]||"")[0])throw Error("Couldn't determine an identifier for the schema");const s=ae(i,e[o]||""),[c,l]=oe(s);delete e[o],l&&o===a&&(e[a]=a!==o?encodeURI(l):`#${encodeURI(l)}`),i&&(fe[i]=c);const u={},f=le(n,"recursiveAnchorToken");let d;!0===e[f]&&(u[""]=`${c}#`,e[a]="",delete e[f]);const p=le(n,"vocabularyToken");ne(e[p],"object")?(ce[c]=n,d=e[p],delete e[p]):(ce[c]=n,d={[n]:!0});const h={"":""};return ue[c]={id:c,schemaVersion:n,schema:pe(e,c,n,j.nil,h,u),anchors:h,dynamicAnchors:u,vocabulary:d,validated:!1},c},pe=(e,t,r,n,o,a)=>{if(ne(e,"object")){const i="string"==typeof e.$schema?oe(e.$schema)[0]:r,s=le(i,"embeddedToken"),c=le(i,"anchorToken");if("string"==typeof e[s]&&(s!==c||"#"!==e[s][0])){const n=ae(t,e[s]);return e[s]=n,de(e,n,r),A.cons(e[s],e)}const l=le(r,"anchorToken"),u=le(r,"dynamicAnchorToken");"string"==typeof e[u]&&(a[e[u]]=`${t}#${encodeURI(n)}`,o[e[u]]=n,delete e[u]);const f=le(r,"embeddedToken");if("string"==typeof e[l]){const t=l!==f?e[l]:e[l].slice(1);o[t]=n,delete e[l]}const d=le(r,"jrefToken");if("string"==typeof e[d])return A.cons(e[d],e);for(const i in e)e[i]=pe(e[i],t,r,j.append(i,n),o,a);return e}return Array.isArray(e)?e.map(((e,i)=>pe(e,t,r,j.append(i,n),o,a))):e},he=e=>ue[fe[e]]||ue[e],ye=Object.freeze({id:"",schemaVersion:void 0,vocabulary:{},pointer:j.nil,schema:void 0,value:void 0,anchors:{},dynamicAnchors:{},validated:!0}),be=async(e,t=ye)=>{const r=ae(ge(t),e),[n,o]=oe(r);if(!(e=>e in ue||e in fe)(n)){const e=await re(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 t=Z.parse(e.headers.get("content-type")).type;if("application/schema+json"!==t)throw Error(`${n} is not a schema. Found a document with media type: ${t}`)}de(await e.json(),n)}const a=he(n),i="/"!==o[0]?ve(a,o):o,s=Object.freeze({...a,pointer:i,value:j.get(i,a.schema)});return me(s)},me=e=>A.isReference(e.value)?be(A.href(e.value),e):e,ve=(e,t)=>{if(!(t in e.anchors))throw Error(`No such anchor '${encodeURI(e.id)}#${encodeURI(t)}'`);return e.anchors[t]},ge=e=>`${e.id}#${encodeURI(e.pointer)}`,we=e=>A.isReference(e.value)?A.value(e.value):e.value,Oe=(e,t)=>{const r=he(t.id),n=Object.freeze({...t,pointer:j.append(e,t.pointer),value:we(t)[e],validated:r.validated});return me(n)},Ee=t(((e,t)=>te.pipeline([we,te.map((async(r,n)=>e(await Oe(n,t),n))),te.all],t))),je={parentId:"",parentDialect:"",includeEmbedded:!0},Se=(e,t)=>{if(t.startsWith("file://")){const r=e.slice(7,e.lastIndexOf("/"));return""===e?"":ie(r,t.slice(7))}return t};var $e={setConfig:(e,t,r)=>{se[e]||(se[e]={}),se[e][t]=r},getConfig:le,add:de,get:be,markValidated:e=>{ue[e].validated=!0},uri:ge,value:we,getAnchorPointer:ve,typeOf:(e,t)=>ne(we(e),t),has:(e,t)=>e in we(t),step:Oe,keys:e=>Object.keys(we(e)),entries:e=>te.pipeline([we,Object.keys,te.map((async t=>[t,await Oe(t,e)])),te.all],e),map:Ee,length:e=>we(e).length,toSchema:(e,t={})=>{const r={...je,...t},n=JSON.parse(JSON.stringify(e.schema,((t,n)=>{if(!A.isReference(n))return n;const o=A.value(n),a=o.$schema||e.schemaVersion,i=le(a,"embeddedToken");return!r.includeEmbedded&&i in o?void 0:A.value(n)}))),o=le(e.schemaVersion,"dynamicAnchorToken");Object.entries(e.dynamicAnchors).forEach((([e,t])=>{const r=oe(t)[1];j.assign(r,n,{[o]:e,...j.get(r,n)})}));const a=le(e.schemaVersion,"anchorToken");Object.entries(e.anchors).filter((([e])=>""!==e)).forEach((([e,t])=>{j.assign(t,n,{[a]:e,...j.get(t,n)})}));const i=le(e.schemaVersion,"baseToken"),s=Se(r.parentId,e.id),c=r.parentDialect===e.schemaVersion?"":e.schemaVersion;return{...s&&{[i]:s},...c&&{$schema:c},...n}}};$e.setConfig,$e.getConfig,$e.add,$e.get,$e.markValidated,$e.uri,$e.value,$e.getAnchorPointer,$e.typeOf,$e.has,$e.step,$e.keys,$e.entries,$e.map,$e.length,$e.toSchema;class Ae extends Error{constructor(e){super("Invalid Schema"),this.name=this.constructor.name,this.output=e}}var xe=Ae;const{splitUrl:Pe}=f,Te="FLAG",Ie="BASIC",ke="DETAILED",Ve="VERBOSE";let Re=ke,Ce=!0;const Ue=async e=>{const t={metaData:{}};return{ast:t,schemaUri:await Je(e,t)}},ze=t((({ast:e,schemaUri:t},r,o=Te)=>{if(![Te,Ie,ke,Ve].includes(o))throw Error(`The '${o}' error format is not supported`);const a=[],i=n.subscribe("result",Ke(o,a));return Fe(t,r,e,{}),n.unsubscribe(i),a[0]})),Ke=(e,t)=>{const r=[];return(n,o)=>{if("result"===n){const{keyword:e,absoluteKeywordLocation:t,instanceLocation:n,valid:a}=o,i={keyword:e,absoluteKeywordLocation:t,instanceLocation:n,valid:a,errors:[]};r.push(i)}else if("result.start"===n)r.push(n);else if("result.end"===n){const n=r.pop();for(;"result.start"!==r[r.length-1];){const t=r.pop(),o=[t];e===Ie&&(o.push(...t.errors),delete t.errors),(e===Ve||e!==Te&&!t.valid)&&n.errors.unshift(...o)}r[r.length-1]=n,t[0]=n}}},Le={},qe=e=>Le[e],_e=e=>e in Le,De={},Ne={},Je=async(e,t)=>{if(e=await Be(e),!_e(`${e.schemaVersion}#validate`)){const t=await $e.get(e.schemaVersion);($e.getConfig(t.id,"mandatoryVocabularies")||[]).forEach((e=>{if(!t.vocabulary[e])throw Error(`Vocabulary '${e}' must be explicitly declared and required`)})),Object.entries(t.vocabulary).forEach((([e,r])=>{if(e in De)Object.entries(De[e]).forEach((([e,r])=>{((e,t)=>{Le[e]={collectEvaluatedItems:(e,r,n,o,a)=>t.interpret(e,r,n,o,a)&&new Set,collectEvaluatedProperties:(e,r,n,o,a)=>t.interpret(e,r,n,o,a)&&[],...t}})(`${t.id}#${e}`,r)}));else if(r)throw Error(`Missing required vocabulary: ${e}`)}))}if(Ce&&!e.validated){if($e.markValidated(e.id),!(e.schemaVersion in Ne)){const t=await $e.get(e.schemaVersion),r=await Ue(t);Ne[t.id]=ze(r)}const t=K.cons(e.schema,e.id),r=Ne[e.schemaVersion](t,Re);if(!r.valid)throw new xe(r)}return e.id in t.metaData||(t.metaData[e.id]={id:e.id,dynamicAnchors:e.dynamicAnchors,anchors:e.anchors}),qe(`${e.schemaVersion}#validate`).compile(e,t)},Be=async e=>$e.typeOf(e,"string")?Be(await $e.get($e.value(e),e)):e,Fe=(e,t,r,n)=>{const o=We(e,r),a=Pe(e)[0];return qe(o).interpret(e,t,r,{...r.metaData[a].dynamicAnchors,...n})},We=(e,t)=>{if(!(e in t))throw Error(`No schema found at ${e}`);return t[e][0]};var Ze={validate:async(e,t,r)=>{const n=await Ue(e),o=(e,t)=>ze(n,K.cons(e),t);return void 0===t?o:o(t,r)},compile:Ue,interpret:ze,setMetaOutputFormat:e=>{Re=e},setShouldMetaValidate:e=>{Ce=e},FLAG:Te,BASIC:Ie,DETAILED:ke,VERBOSE:Ve,add:(e,t="",r="")=>{const n=$e.add(e,t,r);delete Ne[n]},getKeyword:qe,hasKeyword:_e,defineVocabulary:(e,t)=>{De[e]=t},compileSchema:Je,interpretSchema:Fe,collectEvaluatedProperties:(e,t,r,n,o)=>{const a=We(e,r);return qe(a).collectEvaluatedProperties(e,t,r,n,o)},collectEvaluatedItems:(e,t,r,n,o)=>{const a=We(e,r);return qe(a).collectEvaluatedItems(e,t,r,n,o)}};var Me={compile:e=>$e.value(e),interpret:()=>!0};var Ge={compile:async(e,t)=>{const r=$e.uri(e);if(!(r in t)){t[r]=!1;const n=$e.value(e);if(!["object","boolean"].includes(typeof n))throw Error(`No schema found at '${$e.uri(e)}'`);t[r]=[`${e.schemaVersion}#validate`,$e.uri(e),"boolean"==typeof n?n:await te.pipeline([$e.entries,te.map((([t,r])=>[`${e.schemaVersion}#${t}`,r])),te.filter((([t])=>Ze.hasKeyword(t)&&t!==`${e.schemaVersion}#validate`)),te.map((async([r,n])=>{const o=await Ze.getKeyword(r).compile(n,t,e);return[r,$e.uri(n),o]})),te.all],e)]}return r},interpret:(e,t,r,o)=>{const[a,i,s]=r[e];n.publishSync("result.start");const c="boolean"==typeof s?s:s.every((([e,a,i])=>{n.publishSync("result.start");const s=Ze.getKeyword(e).interpret(i,t,r,o);return n.publishSync("result",{keyword:e,absoluteKeywordLocation:a,instanceLocation:K.uri(t),valid:s,ast:i}),n.publishSync("result.end"),s}));return n.publishSync("result",{keyword:a,absoluteKeywordLocation:i,instanceLocation:K.uri(t),valid:c,ast:e}),n.publishSync("result.end"),c},collectEvaluatedProperties:(e,t,r,n,o=!1)=>{const a=r[e][2];return"boolean"==typeof a?!!a&&[]:a.filter((([e])=>!o||!e.endsWith("#unevaluatedProperties"))).reduce(((e,[o,,a])=>{const i=e&&Ze.getKeyword(o).collectEvaluatedProperties(a,t,r,n);return!1!==i&&[...e,...i]}),[])},collectEvaluatedItems:(e,t,r,n,o=!1)=>{const a=r[e][2];return"boolean"==typeof a?!!a&&new Set:a.filter((([e])=>!o||!e.endsWith("#unevaluatedItems"))).reduce(((e,[o,,a])=>{const i=!1!==e&&Ze.getKeyword(o).collectEvaluatedItems(a,t,r,n);return!1!==i&&new Set([...e,...i])}),new Set)}},He={metaData:Me,validate:Ge},Qe={Core:Ze,Schema:$e,Instance:K,Reference:A,Keywords:He,InvalidSchemaError:xe},Xe=Qe.Core,Ye=Qe.Schema,et=Qe.Instance,tt=Qe.Reference,rt=Qe.Keywords,nt=Qe.InvalidSchemaError;e.Core=Xe,e.Instance=et,e.InvalidSchemaError=nt,e.Keywords=rt,e.Reference=tt,e.Schema=Ye,e.default=Qe,Object.defineProperty(e,"__esModule",{value:!0})}));
!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),h=t(a+"{1,4}"),d=t(t(h+"\\:"+h)+"|"+f),v=t(t(h+"\\:")+"{6}"+d),y=t("\\:\\:"+t(h+"\\:")+"{5}"+d),m=t(t(h)+"?\\:\\:"+t(h+"\\:")+"{4}"+d),g=t(t(t(h+"\\:")+"{0,1}"+h)+"?\\:\\:"+t(h+"\\:")+"{3}"+d),b=t(t(t(h+"\\:")+"{0,2}"+h)+"?\\:\\:"+t(h+"\\:")+"{2}"+d),w=t(t(t(h+"\\:")+"{0,3}"+h)+"?\\:\\:"+h+"\\:"+d),E=t(t(t(h+"\\:")+"{0,4}"+h)+"?\\:\\:"+d),S=t(t(t(h+"\\:")+"{0,5}"+h)+"?\\:\\:"+h),C=t(t(t(h+"\\:")+"{0,6}"+h)+"?\\:\\:"),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 j=t(i+"|"+r(l,s,"[\\:\\@]"));return t(t(i+"|"+r(l,s,"[\\@]"))+"+"),t(t(j+"|"+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,h=36,d=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=h-d,j=Math.floor,T=String.fromCharCode;function I(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 D(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 P(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 $=function(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:h},R=function(e,r){return e+22+75*(e<26)-((0!=r)<<5)},N=function(e,r,t){var n=0;for(e=t?j(e/m):e>>1,e+=j(e/r);e>A*v>>1;n+=h)e=j(e/A);return j(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&&I("not-basic"),r.push(e.charCodeAt(s));for(var c=i>0?i+1:0;c<t;){for(var u=n,l=1,p=h;;p+=h){c>=t&&I("invalid-input");var y=$(e.charCodeAt(c++));(y>=h||y>j((f-n)/l))&&I("overflow"),n+=y*l;var m=p<=a?d:p>=a+v?v:p-a;if(y<m)break;var E=h-m;l>j(f/E)&&I("overflow"),l*=E}var S=r.length+1;a=N(n-u,S,0==u),j(n/S)>f-o&&I("overflow"),o+=j(n/S),n%=S,r.splice(n++,0,o)}return String.fromCodePoint.apply(String,r)},F=function(e){var r=[],t=(e=P(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 D=A.value;D>=n&&D<E&&(E=D)}}catch(e){C=!0,O=e}finally{try{!S&&x.return&&x.return()}finally{if(C)throw O}}var $=m+1;E-n>j((f-o)/$)&&I("overflow"),o+=(E-n)*$,n=E;var _=!0,F=!1,V=void 0;try{for(var U,k=e[Symbol.iterator]();!(_=(U=k.next()).done);_=!0){var q=U.value;if(q<n&&++o>f&&I("overflow"),q==n){for(var L=o,z=h;;z+=h){var H=z<=a?d:z>=a+v?v:z-a;if(L<H)break;var K=L-H,M=h-H;r.push(T(R(H+K%M,0))),L=j(K/M)}r.push(T(R(L,0))),a=N(o,$,m==y),o=0,++m}}}catch(e){F=!0,V=e}finally{try{!_&&k.return&&k.return()}finally{if(F)throw V}}++o,++n}return r.join("")},V=function(e){return D(e,(function(e){return E.test(e)?_(e.slice(4).toLowerCase()):e}))},U=function(e){return D(e,(function(e){return S.test(e)?"xn--"+F(e):e}))},k={version:"2.1.0",ucs2:{decode:P,encode:function(e){return String.fromCodePoint.apply(String,p(e))}},decode:_,encode:F,toASCII:U,toUnicode:V},q={};function L(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 z(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 H(e,r){function t(e){var t=z(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,L).replace(r.PCT_ENCODED,o)),void 0!==e.host&&(e.host=String(e.host).replace(r.PCT_ENCODED,t).toLowerCase().replace(r.NOT_HOST,L).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,L).replace(r.PCT_ENCODED,o)),void 0!==e.query&&(e.query=String(e.query).replace(r.PCT_ENCODED,t).replace(r.NOT_QUERY,L).replace(r.PCT_ENCODED,o)),void 0!==e.fragment&&(e.fragment=String(e.fragment).replace(r.PCT_ENCODED,t).replace(r.NOT_FRAGMENT,L).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),h=r.IPV4ADDRESS.test(f[f.length-1]),d=h?7:8,v=f.length-d,y=Array(d),m=0;m<d;++m)y[m]=p[m]||f[v+m]||"";h&&(y[d-1]=M(y[d-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=q[(r.scheme||t.scheme||"").toLowerCase()];if(r.unicodeSupport||a&&a.unicodeSupport)H(t,n);else{if(t.host&&(r.domainHost||a&&a.domainHost))try{t.host=k.toASCII(t.host.replace(n.PCT_ENCODED,z).toLowerCase())}catch(e){t.error=t.error||"Host's domain name can not be converted to ASCII via punycode: "+e}H(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=q[(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?k.toUnicode(e.host):k.toASCII(e.host.replace(t.PCT_ENCODED,z).toLowerCase())}catch(t){e.error=e.error||"Host's domain name can not be converted to "+(r.iri?"Unicode":"ASCII")+" via punycode: "+t}H(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,L)}function ce(e,r){return e&&e.toString().replace(r&&r.iri?u.PCT_ENCODED:c.PCT_ENCODED,z)}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}},he={scheme:"wss",domainHost:fe.domainHost,parse:fe.parse,serialize:fe.serialize},de={},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 je(e){var r=z(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 h=0,d=n.length;h<d;++h){var v=n[h].split("@");if(v[0]=ce(v[0]),r.unicodeSupport)v[1]=ce(v[1],r).toLowerCase();else try{v[1]=k.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[h]=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,je).replace(Se,o).replace(Ce,L),p=c.slice(u+1);try{p=r.iri?k.toUnicode(p):k.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 h=[];for(var d in f)f[d]!==de[d]&&h.push(d.replace(Se,je).replace(Se,o).replace(Oe,L)+"="+f[d].replace(Se,je).replace(Se,o).replace(Ae,L));return h.length&&(t.query=h.join("&")),t}},Ie=/^([^\:]+)\:(.*)/,xe={scheme:"urn",parse:function(e,r){var t=e.path&&e.path.match(Ie),n=e;if(t){var o=r.scheme||n.scheme||"urn",a=t[1].toLowerCase(),i=t[2],s=o+":"+(r.nid||a),c=q[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=q[o];a&&(e=a.serialize(e,r));var i=e,s=e.nss;return i.path=(n||r.nid)+":"+s,i}},De=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/,Pe={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(De)||(t.error=t.error||"UUID is not valid."),t},serialize:function(e,r){var t=e;return t.nss=(e.uuid||"").toLowerCase(),t}};q[ue.scheme]=ue,q[le.scheme]=le,q[fe.scheme]=fe,q[he.scheme]=he,q[Te.scheme]=Te,q[xe.scheme]=xe,q[Pe.scheme]=Pe,e.SCHEMES=q,e.pctEncChar=L,e.pctDecChars=z,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,d(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,d(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,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 g(r,e[0],t)}},h=(e,r,t)=>{if(0!==e.length)if(e.length>1){const n=e.shift(),o=g(r,n,t);h(e,o,d(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)},d=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:d,get:(e,r)=>{const t=u(e),n=e=>t.reduce((([e,r],t)=>[g(e,t,r),d(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=>h(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,j=Object.freeze({id:"",pointer:"",instance:void 0,value:void 0}),T=e=>C.isReference(e.value)?C.value(e.value):e.value,I=r(((e,r)=>A(T(e),r))),x=(e,r)=>Object.freeze({...r,pointer:w.append(e,r.pointer),value:T(r)[e]}),D=r(((e,r)=>T(r).map(((t,n,o,a)=>e(x(n,r),n,o,a))))),P=r(((e,r)=>T(r).map(((e,t,n,o)=>x(t,r))).filter(((r,t,n,o)=>e(r,t,n,o))))),$=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:j,cons:(e,r="")=>Object.freeze({...j,id:O(r,""),instance:e,value:e}),uri:e=>`${e.id}#${encodeURI(e.pointer)}`,value:T,has:(e,r)=>e in T(r),typeOf:I,step:x,entries:e=>Object.keys(T(e)).map((r=>[r,x(r,e)])),keys:e=>Object.keys(T(e)),map:D,filter:P,reduce:$,every:R,some:N,length:e=>T(e).length},F=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,V=/^[\u000b\u0020-\u007e\u0080-\u00ff]+$/,U=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,k=/\\([\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 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(k,"$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(U.test(r))return r;if(r.length>0&&!V.test(r))throw new TypeError("invalid parameter value");return'"'+r.replace(q,"\\$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||!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],!U.test(o))throw new TypeError("invalid parameter name");n+="; "+o+"="+H(r[o])}return n},parse:z},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={},ie={},se=(e,r)=>{const t=e in ie?ie[e]:e;if(t in ae)return ae[t][r]},ce={},ue={},le=(e,r="",t="")=>{e=JSON.parse(JSON.stringify(e));const n=te(e.$schema||t,"");if(!n)throw Error("Couldn't determine schema version");delete e.$schema;const o=se(n,"baseToken"),a=se(n,"anchorToken"),i=te(r,"");if(!i&&!te(e[o]||"",""))throw Error("Couldn't determine an identifier for the schema");const s=te(i,e[o]||""),c=te(s,""),u=ne(s);delete e[o],u&&o===a&&(e[a]=a!==o?encodeURI(u):`#${encodeURI(u)}`),i&&(ue[i]=c);const l={},p=se(n,"recursiveAnchorToken");let f;!0===e[p]&&(l[""]=`${c}#`,e[a]="",delete e[p]);const h=se(n,"vocabularyToken");re(e[h],"object")?(ie[c]=n,f=e[h],delete e[h]):(ie[c]=n,f={[n]:!0});const d={"":""};return ce[c]={id:c,schemaVersion:n,schema:pe(e,c,n,w.nil,d,l),anchors:d,dynamicAnchors:l,vocabulary:f,validated:!1},c},pe=(e,r,t,n,o,a)=>{if(re(e,"object")){const i="string"==typeof e.$schema?te(e.$schema,""):t,s=se(i,"embeddedToken"),c=se(i,"anchorToken");if("string"==typeof e[s]&&(s!==c||"#"!==e[s][0])){const n=te(r,e[s]);return e[s]=n,le(e,n,t),C.cons(e[s],e)}const u=se(t,"anchorToken"),l=se(t,"dynamicAnchorToken");"string"==typeof e[l]&&(a[e[l]]=`${r}#${encodeURI(n)}`,o[e[l]]=n,delete e[l]);const p=se(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=se(t,"jrefToken");if("string"==typeof e[f])return C.cons(e[f],e);for(const i in e)e[i]=pe(e[i],r,t,w.append(i,n),o,a);return e}return Array.isArray(e)?e.map(((e,i)=>pe(e,r,t,w.append(i,n),o,a))):e},fe=e=>ce[ue[e]]||ce[e],he=Object.freeze({id:"",schemaVersion:void 0,vocabulary:{},pointer:w.nil,schema:void 0,value:void 0,anchors:{},dynamicAnchors:{},validated:!0}),de=async(e,r=he)=>{const t=te(me(r),e),n=te(t,""),o=ne(t);if(!(e=>e in ce||e in ue)(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}`)}le(await e.json(),n)}const a=fe(n),i="/"!==o[0]?ye(a,o):o,s=Object.freeze({...a,pointer:i,value:w.get(i,a.schema)});return ve(s)},ve=e=>C.isReference(e.value)?de(C.href(e.value),e):e,ye=(e,r)=>{if(!(r in e.anchors))throw Error(`No such anchor '${encodeURI(e.id)}#${encodeURI(r)}'`);return e.anchors[r]},me=e=>`${e.id}#${encodeURI(e.pointer)}`,ge=e=>C.isReference(e.value)?C.value(e.value):e.value,be=(e,r)=>{const t=fe(r.id),n=Object.freeze({...r,pointer:w.append(e,r.pointer),value:ge(r)[e],validated:t.validated});return ve(n)},we=r(((e,r)=>X.pipeline([ge,X.map((async(t,n)=>e(await be(n,r),n))),X.all],r))),Ee={parentId:"",parentDialect:"",includeEmbedded:!0},Se=(e,r)=>{if(r.startsWith("file://")){const t=e.slice(7,e.lastIndexOf("/"));return""===e?"":oe(t,r.slice(7))}return r};var Ce={setConfig:(e,r,t)=>{ae[e]||(ae[e]={}),ae[e][r]=t},getConfig:se,add:le,get:de,markValidated:e=>{ce[e].validated=!0},uri:me,value:ge,getAnchorPointer:ye,typeOf:(e,r)=>re(ge(e),r),has:(e,r)=>e in ge(r),step:be,keys:e=>Object.keys(ge(e)),entries:e=>X.pipeline([ge,Object.keys,X.map((async r=>[r,await be(r,e)])),X.all],e),map:we,length:e=>ge(e).length,toSchema:(e,r={})=>{const t={...Ee,...r},n=JSON.parse(JSON.stringify(e.schema,((r,n)=>{if(!C.isReference(n))return n;const o=C.value(n),a=o.$schema||e.schemaVersion,i=se(a,"embeddedToken");return!t.includeEmbedded&&i in o?void 0:C.value(n)}))),o=se(e.schemaVersion,"dynamicAnchorToken");Object.entries(e.dynamicAnchors).forEach((([e,r])=>{const t=ne(r);w.assign(t,n,{[o]:e,...w.get(t,n)})}));const a=se(e.schemaVersion,"anchorToken");Object.entries(e.anchors).filter((([e])=>""!==e)).forEach((([e,r])=>{w.assign(r,n,{[a]:e,...w.get(r,n)})}));const i=se(e.schemaVersion,"baseToken"),s=Se(t.parentId,e.id),c=t.parentDialect===e.schemaVersion?"":e.schemaVersion;return{...s&&{[i]:s},...c&&{$schema:c},...n}}};Ce.setConfig,Ce.getConfig,Ce.add,Ce.get,Ce.markValidated,Ce.uri,Ce.value,Ce.getAnchorPointer,Ce.typeOf,Ce.has,Ce.step,Ce.keys,Ce.entries,Ce.map,Ce.length,Ce.toSchema;class Oe extends Error{constructor(e){super("Invalid Schema"),this.name=this.constructor.name,this.output=e}}var Ae=Oe;const{resolveUrl:je}=c,Te="FLAG",Ie="BASIC",xe="DETAILED",De="VERBOSE";let Pe=xe,$e=!0;const Re=async e=>{const r={metaData:{}};return{ast:r,schemaUri:await Le(e,r)}},Ne=r((({ast:e,schemaUri:r},t,n=Te)=>{if(![Te,Ie,xe,De].includes(n))throw Error(`The '${n}' error format is not supported`);const a=[],i=o.subscribe("result",_e(n,a));return He(r,t,e,{}),o.unsubscribe(i),a[0]})),_e=(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===Ie&&(o.push(...r.errors),delete r.errors),(e===De||e!==Te&&!r.valid)&&n.errors.unshift(...o)}t[t.length-1]=n,r[0]=n}}},Fe={},Ve=e=>Fe[e],Ue=e=>e in Fe,ke={},qe={},Le=async(e,r)=>{if(e=await ze(e),!Ue(`${e.schemaVersion}#validate`)){const r=await Ce.get(e.schemaVersion);(Ce.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)=>{Fe[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(Ce.markValidated(e.id),!(e.schemaVersion in qe)){const r=await Ce.get(e.schemaVersion),t=await Re(r);qe[r.id]=Ne(t)}const r=_.cons(e.schema,e.id),t=qe[e.schemaVersion](r,Pe);if(!t.valid)throw new Ae(t)}return e.id in r.metaData||(r.metaData[e.id]={id:e.id,dynamicAnchors:e.dynamicAnchors,anchors:e.anchors}),Ve(`${e.schemaVersion}#validate`).compile(e,r)},ze=async e=>Ce.typeOf(e,"string")?ze(await Ce.get(Ce.value(e),e)):e,He=(e,r,t,n)=>{const o=Ke(e,t),a=je(e,"");return Ve(o).interpret(e,r,t,{...t.metaData[a].dynamicAnchors,...n})},Ke=(e,r)=>{if(!(e in r))throw Error(`No schema found at ${e}`);return r[e][0]};var Me={validate:async(e,r,t)=>{const n=await Re(e),o=(e,r)=>Ne(n,_.cons(e),r);return void 0===r?o:o(r,t)},compile:Re,interpret:Ne,setMetaOutputFormat:e=>{Pe=e},setShouldMetaValidate:e=>{$e=e},FLAG:Te,BASIC:Ie,DETAILED:xe,VERBOSE:De,add:(e,r="",t="")=>{const n=Ce.add(e,r,t);delete qe[n]},getKeyword:Ve,hasKeyword:Ue,defineVocabulary:(e,r)=>{ke[e]=r},compileSchema:Le,interpretSchema:He,collectEvaluatedProperties:(e,r,t,n,o)=>{const a=Ke(e,t);return Ve(a).collectEvaluatedProperties(e,r,t,n,o)},collectEvaluatedItems:(e,r,t,n,o)=>{const a=Ke(e,t);return Ve(a).collectEvaluatedItems(e,r,t,n,o)}};var Ze={compile:e=>Ce.value(e),interpret:()=>!0};var Je={compile:async(e,r)=>{const t=Ce.uri(e);if(!(t in r)){r[t]=!1;const n=Ce.value(e);if(!["object","boolean"].includes(typeof n))throw Error(`No schema found at '${Ce.uri(e)}'`);r[t]=[`${e.schemaVersion}#validate`,Ce.uri(e),"boolean"==typeof n?n:await X.pipeline([Ce.entries,X.map((([r,t])=>[`${e.schemaVersion}#${r}`,t])),X.filter((([r])=>Me.hasKeyword(r)&&r!==`${e.schemaVersion}#validate`)),X.map((async([t,n])=>{const o=await Me.getKeyword(t).compile(n,r,e);return[t,Ce.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=Me.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&&Me.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&&Me.getKeyword(o).collectEvaluatedItems(a,r,t,n);return!1!==i&&new Set([...e,...i])}),new Set)}},Be={metaData:Ze,validate:Je},Ge={Core:Me,Schema:Ce,Instance:_,Reference:C,Keywords:Be,InvalidSchemaError:Ae},We=Ge.Core,Qe=Ge.Schema,Ye=Ge.Instance,Xe=Ge.Reference,er=Ge.Keywords,rr=Ge.InvalidSchemaError;e.Core=We,e.Instance=Ye,e.InvalidSchemaError=rr,e.Keywords=er,e.Reference=Xe,e.Schema=Qe,e.default=Ge,Object.defineProperty(e,"__esModule",{value:!0})}));
//# sourceMappingURL=json-schema-core-umd.min.js.map

@@ -1,2 +0,2 @@

const resolveUrl = require("url-resolve-browser");
const URI = require("uri-js");

@@ -16,20 +16,6 @@

const splitUrl = (url) => {
const indexOfHash = url.indexOf("#");
const ndx = indexOfHash === -1 ? url.length : indexOfHash;
const urlReference = url.slice(0, ndx);
const urlFragment = url.slice(ndx + 1);
return [decodeURI(urlReference), decodeURI(urlFragment)];
};
const getScheme = (url) => {
const matches = RegExp(/^(.+):\/\//).exec(url);
return matches ? matches[1] : "";
};
const safeResolveUrl = (contextUrl, url) => {
const resolvedUrl = resolveUrl(contextUrl, url);
const contextId = splitUrl(contextUrl)[0];
if (contextId && getScheme(resolvedUrl) === "file" && getScheme(contextId) !== "file") {
const resolveUrl = (contextUrl, url) => {
const resolvedUrl = URI.resolve(contextUrl, url, { iri: true });
const contextId = URI.resolve(contextUrl, "", { iri: true });
if (contextId && URI.parse(resolvedUrl).scheme === "file" && URI.parse(contextUrl).scheme !== "file") {
throw Error(`Can't access file '${resolvedUrl}' resource from network context '${contextUrl}'`);

@@ -40,2 +26,4 @@ }

const urlFragment = (uri) => URI.unescapeComponent(URI.parse(uri).fragment) || "";
const CHAR_BACKWARD_SLASH = 47;

@@ -104,2 +92,2 @@

module.exports = { jsonTypeOf, splitUrl, safeResolveUrl, pathRelative };
module.exports = { jsonTypeOf, resolveUrl, urlFragment, pathRelative };
const curry = require("just-curry-it");
const PubSub = require("pubsub-js");
const { splitUrl } = require("./common");
const { resolveUrl } = require("./common");
const Instance = require("./instance");

@@ -162,3 +162,3 @@ const Schema = require("./schema");

const keywordId = getKeywordId(schemaUri, ast);
const id = splitUrl(schemaUri)[0];
const id = resolveUrl(schemaUri, "");
return getKeyword(keywordId).interpret(schemaUri, instance, ast, { ...ast.metaData[id].dynamicAnchors, ...dynamicAnchors });

@@ -165,0 +165,0 @@ };

const JsonPointer = require("@hyperjump/json-pointer");
const curry = require("just-curry-it");
const { jsonTypeOf } = require("./common");
const { resolveUrl, jsonTypeOf } = require("./common");
const Reference = require("./reference");

@@ -8,3 +8,3 @@

const nil = Object.freeze({ id: "", pointer: "", instance: undefined, value: undefined });
const cons = (instance, id = "") => Object.freeze({ ...nil, id, instance, value: instance });
const cons = (instance, id = "") => Object.freeze({ ...nil, id: resolveUrl(id, ""), instance, value: instance });
const uri = (doc) => `${doc.id}#${encodeURI(doc.pointer)}`;

@@ -11,0 +11,0 @@ const value = (doc) => Reference.isReference(doc.value) ? Reference.value(doc.value) : doc.value;

@@ -5,3 +5,3 @@ const contentTypeParser = require("content-type");

const JsonPointer = require("@hyperjump/json-pointer");
const { jsonTypeOf, splitUrl, safeResolveUrl, pathRelative } = require("./common");
const { jsonTypeOf, resolveUrl, urlFragment, pathRelative } = require("./common");
const fetch = require("./fetch");

@@ -37,3 +37,3 @@ const Reference = require("./reference");

// Schema Version
const schemaVersion = splitUrl(schema["$schema"] || defaultSchemaVersion)[0];
const schemaVersion = resolveUrl(schema["$schema"] || defaultSchemaVersion, "");
if (!schemaVersion) {

@@ -47,8 +47,9 @@ throw Error("Couldn't determine schema version");

const anchorToken = getConfig(schemaVersion, "anchorToken");
const externalId = splitUrl(url)[0];
if (!externalId && !splitUrl(schema[baseToken] || "")[0]) {
const externalId = resolveUrl(url, "");
if (!externalId && !resolveUrl(schema[baseToken] || "", "")) {
throw Error("Couldn't determine an identifier for the schema");
}
const internalUrl = safeResolveUrl(externalId, schema[baseToken] || "");
const [id, fragment] = splitUrl(internalUrl);
const internalUrl = resolveUrl(externalId, schema[baseToken] || "");
const id = resolveUrl(internalUrl, "");
const fragment = urlFragment(internalUrl);
delete schema[baseToken];

@@ -100,7 +101,7 @@ if (fragment && baseToken === anchorToken) {

if (jsonTypeOf(subject, "object")) {
const embeddedSchemaVersion = typeof subject["$schema"] === "string" ? splitUrl(subject["$schema"])[0] : schemaVersion;
const embeddedSchemaVersion = typeof subject["$schema"] === "string" ? resolveUrl(subject["$schema"], "") : schemaVersion;
const embeddedEmbeddedToken = getConfig(embeddedSchemaVersion, "embeddedToken");
const embeddedAnchorToken = getConfig(embeddedSchemaVersion, "anchorToken");
if (typeof subject[embeddedEmbeddedToken] === "string" && (embeddedEmbeddedToken !== embeddedAnchorToken || subject[embeddedEmbeddedToken][0] !== "#")) {
const ref = safeResolveUrl(id, subject[embeddedEmbeddedToken]);
const ref = resolveUrl(id, subject[embeddedEmbeddedToken]);
subject[embeddedEmbeddedToken] = ref;

@@ -164,4 +165,5 @@ add(subject, ref, schemaVersion);

const get = async (url, contextDoc = nil) => {
const resolvedUrl = safeResolveUrl(uri(contextDoc), url);
const [id, fragment] = splitUrl(resolvedUrl);
const resolvedUrl = resolveUrl(uri(contextDoc), url);
const id = resolveUrl(resolvedUrl, "");
const fragment = urlFragment(resolvedUrl);

@@ -266,3 +268,3 @@ if (!hasStoredSchema(id)) {

.forEach(([anchor, uri]) => {
const pointer = splitUrl(uri)[1];
const pointer = urlFragment(uri);
JsonPointer.assign(pointer, schema, {

@@ -269,0 +271,0 @@ [dynamicAnchorToken]: anchor,

{
"name": "@hyperjump/json-schema-core",
"version": "0.23.7",
"version": "0.24.0",
"description": "A framework for building JSON Schema tools",

@@ -58,9 +58,9 @@ "main": "lib/index.js",

"dependencies": {
"@hyperjump/json-pointer": "^0.9.1",
"@hyperjump/pact": "^0.2.0",
"@hyperjump/json-pointer": "^0.9.4",
"@hyperjump/pact": "^0.2.3",
"content-type": "^1.0.4",
"node-fetch": "^2.6.5",
"pubsub-js": "^1.9.1",
"url-resolve-browser": "^1.2.0"
"uri-js": "^4.4.1"
}
}

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc