UNPKG

@chakrajs/framework

Version:

Modular JavaScript framework for building decentralized apps

3 lines 125 kB
var ChakrajsFramework=function(e){var r={};function t(a){if(r[a])return r[a].exports;var s=r[a]={i:a,l:!1,exports:{}};return e[a].call(s.exports,s,s.exports,t),s.l=!0,s.exports}return t.m=e,t.c=r,t.d=function(e,r,a){t.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:a})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,r){if(1&r&&(e=t(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var a=Object.create(null);if(t.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var s in e)t.d(a,s,function(r){return e[r]}.bind(null,s));return a},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},t.p="",t(t.s=12)}([function(e,r,t){"use strict";function a(e,r,t){var a=t?" !== ":" === ",s=t?" || ":" && ",o=t?"!":"",i=t?"":"!";switch(e){case"null":return r+a+"null";case"array":return o+"Array.isArray("+r+")";case"object":return"("+o+r+s+"typeof "+r+a+'"object"'+s+i+"Array.isArray("+r+"))";case"integer":return"(typeof "+r+a+'"number"'+s+i+"("+r+" % 1)"+s+r+a+r+")";default:return"typeof "+r+a+'"'+e+'"'}}e.exports={copy:function(e,r){for(var t in r=r||{},e)r[t]=e[t];return r},checkDataType:a,checkDataTypes:function(e,r){switch(e.length){case 1:return a(e[0],r,!0);default:var t="",s=o(e);for(var i in s.array&&s.object&&(t=s.null?"(":"(!"+r+" || ",t+="typeof "+r+' !== "object")',delete s.null,delete s.array,delete s.object),s.number&&delete s.integer,s)t+=(t?" && ":"")+a(i,r,!0);return t}},coerceToTypes:function(e,r){if(Array.isArray(r)){for(var t=[],a=0;a<r.length;a++){var o=r[a];s[o]?t[t.length]=o:"array"===e&&"array"===o&&(t[t.length]=o)}if(t.length)return t}else{if(s[r])return[r];if("array"===e&&"array"===r)return["array"]}},toHash:o,getProperty:l,escapeQuotes:u,equal:t(2),ucs2length:t(24),varOccurences:function(e,r){r+="[^0-9]";var t=e.match(new RegExp(r,"g"));return t?t.length:0},varReplace:function(e,r,t){return r+="([^0-9])",t=t.replace(/\$/g,"$$$$"),e.replace(new RegExp(r,"g"),t+"$1")},cleanUpCode:function(e){return e.replace(c,"").replace(h,"").replace(d,"if (!($1))")},finalCleanUpCode:function(e,r){var t=e.match(f);t&&2==t.length&&(e=r?e.replace(m,"").replace(y,P):e.replace(p,"").replace(v,g));return(t=e.match(E))&&3===t.length?e.replace(w,""):e},schemaHasRules:function(e,r){if("boolean"==typeof e)return!e;for(var t in e)if(r[t])return!0},schemaHasRulesExcept:function(e,r,t){if("boolean"==typeof e)return!e&&"not"!=t;for(var a in e)if(a!=t&&r[a])return!0},toQuotedString:b,getPathExpr:function(e,r,t,a){return x(e,t?"'/' + "+r+(a?"":".replace(/~/g, '~0').replace(/\\//g, '~1')"):a?"'[' + "+r+" + ']'":"'[\\'' + "+r+" + '\\']'")},getPath:function(e,r,t){var a=b(t?"/"+F(r):l(r));return x(e,a)},getData:function(e,r,t){var a,s,o,i;if(""===e)return"rootData";if("/"==e[0]){if(!S.test(e))throw new Error("Invalid JSON-pointer: "+e);s=e,o="rootData"}else{if(!(i=e.match(_)))throw new Error("Invalid JSON-pointer: "+e);if(a=+i[1],"#"==(s=i[2])){if(a>=r)throw new Error("Cannot access property/index "+a+" levels up, current level is "+r);return t[r-a]}if(a>r)throw new Error("Cannot access data "+a+" levels up, current level is "+r);if(o="data"+(r-a||""),!s)return o}for(var n=o,u=s.split("/"),c=0;c<u.length;c++){var h=u[c];h&&(o+=l(R(h)),n+=" && "+o)}return n},unescapeFragment:function(e){return R(decodeURIComponent(e))},unescapeJsonPointer:R,escapeFragment:function(e){return encodeURIComponent(F(e))},escapeJsonPointer:F};var s=o(["string","number","integer","boolean","null"]);function o(e){for(var r={},t=0;t<e.length;t++)r[e[t]]=!0;return r}var i=/^[a-z$_][a-z$_0-9]*$/i,n=/'|\\/g;function l(e){return"number"==typeof e?"["+e+"]":i.test(e)?"."+e:"['"+u(e)+"']"}function u(e){return e.replace(n,"\\$&").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\f/g,"\\f").replace(/\t/g,"\\t")}var c=/else\s*{\s*}/g,h=/if\s*\([^)]+\)\s*\{\s*\}(?!\s*else)/g,d=/if\s*\(([^)]+)\)\s*\{\s*\}\s*else(?!\s*if)/g;var f=/[^v.]errors/g,p=/var errors = 0;|var vErrors = null;|validate.errors = vErrors;/g,m=/var errors = 0;|var vErrors = null;/g,v="return errors === 0;",g="validate.errors = null; return true;",y=/if \(errors === 0\) return data;\s*else throw new ValidationError\(vErrors\);/,P="return data;",E=/[^A-Za-z_$]rootData[^A-Za-z0-9_$]/g,w=/if \(rootData === undefined\) rootData = data;/;function b(e){return"'"+u(e)+"'"}var S=/^\/(?:[^~]|~0|~1)*$/,_=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function x(e,r){return'""'==e?r:(e+" + "+r).replace(/' \+ '/g,"")}function F(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function R(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}},function(e,r,t){"use strict";var a=t(23),s=t(2),o=t(0),i=t(4),n=t(25);function l(e,r,t){var a=this._refs[t];if("string"==typeof a){if(!this._refs[a])return l.call(this,e,r,a);a=this._refs[a]}if((a=a||this._schemas[t])instanceof i)return f(a.schema,this._opts.inlineRefs)?a.schema:a.validate||this._compile(a);var s,o,n,c=u.call(this,r,t);return c&&(s=c.schema,r=c.root,n=c.baseId),s instanceof i?o=s.validate||e.call(this,s.schema,r,void 0,n):void 0!==s&&(o=f(s,this._opts.inlineRefs)?s:e.call(this,s,r,void 0,n)),o}function u(e,r){var t=a.parse(r),s=m(t),o=p(this._getId(e.schema));if(0===Object.keys(e.schema).length||s!==o){var n=g(s),l=this._refs[n];if("string"==typeof l)return function(e,r,t){var a=u.call(this,e,r);if(a){var s=a.schema,o=a.baseId;e=a.root;var i=this._getId(s);return i&&(o=y(o,i)),h.call(this,t,o,s,e)}}.call(this,e,l,t);if(l instanceof i)l.validate||this._compile(l),e=l;else{if(!((l=this._schemas[n])instanceof i))return;if(l.validate||this._compile(l),n==g(r))return{schema:l,root:e,baseId:o};e=l}if(!e.schema)return;o=p(this._getId(e.schema))}return h.call(this,t,o,e.schema,e)}e.exports=l,l.normalizeId=g,l.fullPath=p,l.url=y,l.ids=function(e){var r=g(this._getId(e)),t={"":r},i={"":p(r,!1)},l={},u=this;return n(e,{allKeys:!0},function(e,r,n,c,h,d,f){if(""!==r){var p=u._getId(e),m=t[c],v=i[c]+"/"+h;if(void 0!==f&&(v+="/"+("number"==typeof f?f:o.escapeFragment(f))),"string"==typeof p){p=m=g(m?a.resolve(m,p):p);var y=u._refs[p];if("string"==typeof y&&(y=u._refs[y]),y&&y.schema){if(!s(e,y.schema))throw new Error('id "'+p+'" resolves to more than one schema')}else if(p!=g(v))if("#"==p[0]){if(l[p]&&!s(e,l[p]))throw new Error('id "'+p+'" resolves to more than one schema');l[p]=e}else u._refs[p]=v}t[r]=m,i[r]=v}}),l},l.inlineRef=f,l.schema=u;var c=o.toHash(["properties","patternProperties","enum","dependencies","definitions"]);function h(e,r,t,a){if(e.fragment=e.fragment||"","/"==e.fragment.slice(0,1)){for(var s=e.fragment.split("/"),i=1;i<s.length;i++){var n=s[i];if(n){if(void 0===(t=t[n=o.unescapeFragment(n)]))break;var l;if(!c[n]&&((l=this._getId(t))&&(r=y(r,l)),t.$ref)){var h=y(r,t.$ref),d=u.call(this,a,h);d&&(t=d.schema,a=d.root,r=d.baseId)}}}return void 0!==t&&t!==a.schema?{schema:t,root:a,baseId:r}:void 0}}var d=o.toHash(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum"]);function f(e,r){return!1!==r&&(void 0===r||!0===r?function e(r){var t;if(Array.isArray(r)){for(var a=0;a<r.length;a++)if("object"==typeof(t=r[a])&&!e(t))return!1}else for(var s in r){if("$ref"==s)return!1;if("object"==typeof(t=r[s])&&!e(t))return!1}return!0}(e):r?function e(r){var t,a=0;if(Array.isArray(r)){for(var s=0;s<r.length;s++)if("object"==typeof(t=r[s])&&(a+=e(t)),a==1/0)return 1/0}else for(var o in r){if("$ref"==o)return 1/0;if(d[o])a++;else if("object"==typeof(t=r[o])&&(a+=e(t)+1),a==1/0)return 1/0}return a}(e)<=r:void 0)}function p(e,r){return!1!==r&&(e=g(e)),m(a.parse(e))}function m(e){return a.serialize(e).split("#")[0]+"#"}var v=/#\/?$/;function g(e){return e?e.replace(v,""):""}function y(e,r){return r=g(r),a.resolve(e,r)}},function(e,r,t){"use strict";var a=Array.isArray,s=Object.keys,o=Object.prototype.hasOwnProperty;e.exports=function e(r,t){if(r===t)return!0;if(r&&t&&"object"==typeof r&&"object"==typeof t){var i,n,l,u=a(r),c=a(t);if(u&&c){if((n=r.length)!=t.length)return!1;for(i=n;0!=i--;)if(!e(r[i],t[i]))return!1;return!0}if(u!=c)return!1;var h=r instanceof Date,d=t instanceof Date;if(h!=d)return!1;if(h&&d)return r.getTime()==t.getTime();var f=r instanceof RegExp,p=t instanceof RegExp;if(f!=p)return!1;if(f&&p)return r.toString()==t.toString();var m=s(r);if((n=m.length)!==s(t).length)return!1;for(i=n;0!=i--;)if(!o.call(t,m[i]))return!1;for(i=n;0!=i--;)if(!e(r[l=m[i]],t[l]))return!1;return!0}return r!=r&&t!=t}},function(e,r,t){"use strict";var a=t(1);function s(e,r,t){this.message=t||s.message(e,r),this.missingRef=a.url(e,r),this.missingSchema=a.normalizeId(a.fullPath(this.missingRef))}function o(e){return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e}e.exports={Validation:o(function(e){this.message="validation failed",this.errors=e,this.ajv=this.validation=!0}),MissingRef:o(s)},s.message=function(e,r){return"can't resolve reference "+r+" from id "+e}},function(e,r,t){"use strict";var a=t(0);e.exports=function(e){a.copy(e,this)}},function(e,r,t){"use strict";e.exports=function(e,r){r||(r={}),"function"==typeof r&&(r={cmp:r});var t="boolean"==typeof r.cycles&&r.cycles,a=r.cmp&&function(e){return function(r){return function(t,a){var s={key:t,value:r[t]},o={key:a,value:r[a]};return e(s,o)}}}(r.cmp),s=[];return function e(r){if(r&&r.toJSON&&"function"==typeof r.toJSON&&(r=r.toJSON()),void 0!==r){if("number"==typeof r)return isFinite(r)?""+r:"null";if("object"!=typeof r)return JSON.stringify(r);var o,i;if(Array.isArray(r)){for(i="[",o=0;o<r.length;o++)o&&(i+=","),i+=e(r[o])||"null";return i+"]"}if(null===r)return"null";if(-1!==s.indexOf(r)){if(t)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var n=s.push(r)-1,l=Object.keys(r).sort(a&&a(r));for(i="",o=0;o<l.length;o++){var u=l[o],c=e(r[u]);c&&(i&&(i+=","),i+=JSON.stringify(u)+":"+c)}return s.splice(n,1),"{"+i+"}"}}(e)}},function(e,r,t){"use strict";e.exports=function(e,r,t){var a="",s=!0===e.schema.$async,o=e.util.schemaHasRulesExcept(e.schema,e.RULES.all,"$ref"),i=e.self._getId(e.schema);if(e.isTop&&(a+=" var validate = ",s&&(e.async=!0,a+="async "),a+="function(data, dataPath, parentData, parentDataProperty, rootData) { 'use strict'; ",i&&(e.opts.sourceCode||e.opts.processCode)&&(a+=" /*# sourceURL="+i+" */ ")),"boolean"==typeof e.schema||!o&&!e.schema.$ref){var n=e.level,l=e.dataLevel,u=e.schema["false schema"],c=e.schemaPath+e.util.getProperty("false schema"),h=e.errSchemaPath+"/false schema",d=!e.opts.allErrors,f="data"+(l||""),p="valid"+n;if(!1===e.schema){e.isTop?d=!0:a+=" var "+p+" = false; ",(G=G||[]).push(a),a="",!1!==e.createErrors?(a+=" { keyword: '"+(g||"false schema")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(h)+" , params: {} ",!1!==e.opts.messages&&(a+=" , message: 'boolean schema is false' "),e.opts.verbose&&(a+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),a+=" } "):a+=" {} ";var m=a;a=G.pop(),!e.compositeRule&&d?e.async?a+=" throw new ValidationError(["+m+"]); ":a+=" validate.errors = ["+m+"]; return false; ":a+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}else e.isTop?a+=s?" return data; ":" validate.errors = null; return true; ":a+=" var "+p+" = true; ";return e.isTop&&(a+=" }; return validate; "),a}if(e.isTop){var v=e.isTop;n=e.level=0,l=e.dataLevel=0,f="data";e.rootId=e.resolve.fullPath(e.self._getId(e.root.schema)),e.baseId=e.baseId||e.rootId,delete e.isTop,e.dataPathArr=[void 0],a+=" var vErrors = null; ",a+=" var errors = 0; ",a+=" if (rootData === undefined) rootData = data; "}else{n=e.level,f="data"+((l=e.dataLevel)||"");if(i&&(e.baseId=e.resolve.url(e.baseId,i)),s&&!e.async)throw new Error("async schema in sync schema");a+=" var errs_"+n+" = errors;"}p="valid"+n,d=!e.opts.allErrors;var g,y="",P="",E=e.schema.type,w=Array.isArray(E);if(w&&1==E.length&&(E=E[0],w=!1),e.schema.$ref&&o){if("fail"==e.opts.extendRefs)throw new Error('$ref: validation keywords used in schema at path "'+e.errSchemaPath+'" (see option extendRefs)');!0!==e.opts.extendRefs&&(o=!1,e.logger.warn('$ref: keywords ignored in schema at path "'+e.errSchemaPath+'"'))}if(e.schema.$comment&&e.opts.$comment&&(a+=" "+e.RULES.all.$comment.code(e,"$comment")),E){if(e.opts.coerceTypes)var b=e.util.coerceToTypes(e.opts.coerceTypes,E);var S=e.RULES.types[E];if(b||w||!0===S||S&&!Y(S)){c=e.schemaPath+".type",h=e.errSchemaPath+"/type",c=e.schemaPath+".type",h=e.errSchemaPath+"/type";var _=w?"checkDataTypes":"checkDataType";if(a+=" if ("+e.util[_](E,f,!0)+") { ",b){var x="dataType"+n,F="coerced"+n;a+=" var "+x+" = typeof "+f+"; ","array"==e.opts.coerceTypes&&(a+=" if ("+x+" == 'object' && Array.isArray("+f+")) "+x+" = 'array'; "),a+=" var "+F+" = undefined; ";var R="",$=b;if($)for(var D,O=-1,I=$.length-1;O<I;)D=$[O+=1],O&&(a+=" if ("+F+" === undefined) { ",R+="}"),"array"==e.opts.coerceTypes&&"array"!=D&&(a+=" if ("+x+" == 'array' && "+f+".length == 1) { "+F+" = "+f+" = "+f+"[0]; "+x+" = typeof "+f+"; } "),"string"==D?a+=" if ("+x+" == 'number' || "+x+" == 'boolean') "+F+" = '' + "+f+"; else if ("+f+" === null) "+F+" = ''; ":"number"==D||"integer"==D?(a+=" if ("+x+" == 'boolean' || "+f+" === null || ("+x+" == 'string' && "+f+" && "+f+" == +"+f+" ","integer"==D&&(a+=" && !("+f+" % 1)"),a+=")) "+F+" = +"+f+"; "):"boolean"==D?a+=" if ("+f+" === 'false' || "+f+" === 0 || "+f+" === null) "+F+" = false; else if ("+f+" === 'true' || "+f+" === 1) "+F+" = true; ":"null"==D?a+=" if ("+f+" === '' || "+f+" === 0 || "+f+" === false) "+F+" = null; ":"array"==e.opts.coerceTypes&&"array"==D&&(a+=" if ("+x+" == 'string' || "+x+" == 'number' || "+x+" == 'boolean' || "+f+" == null) "+F+" = ["+f+"]; ");a+=" "+R+" if ("+F+" === undefined) { ",(G=G||[]).push(a),a="",!1!==e.createErrors?(a+=" { keyword: '"+(g||"type")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(h)+" , params: { type: '",a+=w?""+E.join(","):""+E,a+="' } ",!1!==e.opts.messages&&(a+=" , message: 'should be ",a+=w?""+E.join(","):""+E,a+="' "),e.opts.verbose&&(a+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),a+=" } "):a+=" {} ";m=a;a=G.pop(),!e.compositeRule&&d?e.async?a+=" throw new ValidationError(["+m+"]); ":a+=" validate.errors = ["+m+"]; return false; ":a+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } else { ";var A=l?"data"+(l-1||""):"parentData",j=l?e.dataPathArr[l]:"parentDataProperty";a+=" "+f+" = "+F+"; ",l||(a+="if ("+A+" !== undefined)"),a+=" "+A+"["+j+"] = "+F+"; } "}else{(G=G||[]).push(a),a="",!1!==e.createErrors?(a+=" { keyword: '"+(g||"type")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(h)+" , params: { type: '",a+=w?""+E.join(","):""+E,a+="' } ",!1!==e.opts.messages&&(a+=" , message: 'should be ",a+=w?""+E.join(","):""+E,a+="' "),e.opts.verbose&&(a+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),a+=" } "):a+=" {} ";m=a;a=G.pop(),!e.compositeRule&&d?e.async?a+=" throw new ValidationError(["+m+"]); ":a+=" validate.errors = ["+m+"]; return false; ":a+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}a+=" } "}}if(e.schema.$ref&&!o)a+=" "+e.RULES.all.$ref.code(e,"$ref")+" ",d&&(a+=" } if (errors === ",a+=v?"0":"errs_"+n,a+=") { ",P+="}");else{var C=e.RULES;if(C)for(var k=-1,z=C.length-1;k<z;)if(Y(S=C[k+=1])){if(S.type&&(a+=" if ("+e.util.checkDataType(S.type,f)+") { "),e.opts.useDefaults&&!e.compositeRule)if("object"==S.type&&e.schema.properties){u=e.schema.properties;var T=Object.keys(u);if(T)for(var N,L=-1,Q=T.length-1;L<Q;){if(void 0!==(V=u[N=T[L+=1]]).default)a+=" if ("+(M=f+e.util.getProperty(N))+" === undefined) "+M+" = ","shared"==e.opts.useDefaults?a+=" "+e.useDefault(V.default)+" ":a+=" "+JSON.stringify(V.default)+" ",a+="; "}}else if("array"==S.type&&Array.isArray(e.schema.items)){var U=e.schema.items;if(U){O=-1;for(var V,q=U.length-1;O<q;){var M;if(void 0!==(V=U[O+=1]).default)a+=" if ("+(M=f+"["+O+"]")+" === undefined) "+M+" = ","shared"==e.opts.useDefaults?a+=" "+e.useDefault(V.default)+" ":a+=" "+JSON.stringify(V.default)+" ",a+="; "}}}var H=S.rules;if(H)for(var B,K=-1,J=H.length-1;K<J;)if(W(B=H[K+=1])){var Z=B.code(e,B.keyword,S.type);Z&&(a+=" "+Z+" ",d&&(y+="}"))}if(d&&(a+=" "+y+" ",y=""),S.type&&(a+=" } ",E&&E===S.type&&!b)){a+=" else { ";var G;c=e.schemaPath+".type",h=e.errSchemaPath+"/type";(G=G||[]).push(a),a="",!1!==e.createErrors?(a+=" { keyword: '"+(g||"type")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(h)+" , params: { type: '",a+=w?""+E.join(","):""+E,a+="' } ",!1!==e.opts.messages&&(a+=" , message: 'should be ",a+=w?""+E.join(","):""+E,a+="' "),e.opts.verbose&&(a+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),a+=" } "):a+=" {} ";m=a;a=G.pop(),!e.compositeRule&&d?e.async?a+=" throw new ValidationError(["+m+"]); ":a+=" validate.errors = ["+m+"]; return false; ":a+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } "}d&&(a+=" if (errors === ",a+=v?"0":"errs_"+n,a+=") { ",P+="}")}}function Y(e){for(var r=e.rules,t=0;t<r.length;t++)if(W(r[t]))return!0}function W(r){return void 0!==e.schema[r.keyword]||r.implements&&function(r){for(var t=r.implements,a=0;a<t.length;a++)if(void 0!==e.schema[t[a]])return!0}(r)}return d&&(a+=" "+P+" "),v?(s?(a+=" if (errors === 0) return data; ",a+=" else throw new ValidationError(vErrors); "):(a+=" validate.errors = vErrors; ",a+=" return errors === 0; "),a+=" }; return validate;"):a+=" var "+p+" = errors === errs_"+n+";",a=e.util.cleanUpCode(a),v&&(a=e.util.finalCleanUpCode(a,s)),a}},function(e,r,t){"use strict";e.exports=function(e,r,t){var a,s=" ",o=e.level,i=e.dataLevel,n=e.schema[r],l=e.schemaPath+e.util.getProperty(r),u=e.errSchemaPath+"/"+r,c=!e.opts.allErrors,h="data"+(i||""),d=e.opts.$data&&n&&n.$data;d?(s+=" var schema"+o+" = "+e.util.getData(n.$data,i,e.dataPathArr)+"; ",a="schema"+o):a=n;var f="maximum"==r,p=f?"exclusiveMaximum":"exclusiveMinimum",m=e.schema[p],v=e.opts.$data&&m&&m.$data,g=f?"<":">",y=f?">":"<",P=void 0;if(v){var E=e.util.getData(m.$data,i,e.dataPathArr),w="exclusive"+o,b="exclType"+o,S="exclIsNumber"+o,_="' + "+(R="op"+o)+" + '";s+=" var schemaExcl"+o+" = "+E+"; ",s+=" var "+w+"; var "+b+" = typeof "+(E="schemaExcl"+o)+"; if ("+b+" != 'boolean' && "+b+" != 'undefined' && "+b+" != 'number') { ";var x;P=p;(x=x||[]).push(s),s="",!1!==e.createErrors?(s+=" { keyword: '"+(P||"_exclusiveLimit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: {} ",!1!==e.opts.messages&&(s+=" , message: '"+p+" should be boolean' "),e.opts.verbose&&(s+=" , schema: validate.schema"+l+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),s+=" } "):s+=" {} ";var F=s;s=x.pop(),!e.compositeRule&&c?e.async?s+=" throw new ValidationError(["+F+"]); ":s+=" validate.errors = ["+F+"]; return false; ":s+=" var err = "+F+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+=" } else if ( ",d&&(s+=" ("+a+" !== undefined && typeof "+a+" != 'number') || "),s+=" "+b+" == 'number' ? ( ("+w+" = "+a+" === undefined || "+E+" "+g+"= "+a+") ? "+h+" "+y+"= "+E+" : "+h+" "+y+" "+a+" ) : ( ("+w+" = "+E+" === true) ? "+h+" "+y+"= "+a+" : "+h+" "+y+" "+a+" ) || "+h+" !== "+h+") { var op"+o+" = "+w+" ? '"+g+"' : '"+g+"='; ",void 0===n&&(P=p,u=e.errSchemaPath+"/"+p,a=E,d=v)}else{_=g;if((S="number"==typeof m)&&d){var R="'"+_+"'";s+=" if ( ",d&&(s+=" ("+a+" !== undefined && typeof "+a+" != 'number') || "),s+=" ( "+a+" === undefined || "+m+" "+g+"= "+a+" ? "+h+" "+y+"= "+m+" : "+h+" "+y+" "+a+" ) || "+h+" !== "+h+") { "}else{S&&void 0===n?(w=!0,P=p,u=e.errSchemaPath+"/"+p,a=m,y+="="):(S&&(a=Math[f?"min":"max"](m,n)),m===(!S||a)?(w=!0,P=p,u=e.errSchemaPath+"/"+p,y+="="):(w=!1,_+="="));R="'"+_+"'";s+=" if ( ",d&&(s+=" ("+a+" !== undefined && typeof "+a+" != 'number') || "),s+=" "+h+" "+y+" "+a+" || "+h+" !== "+h+") { "}}P=P||r,(x=x||[]).push(s),s="",!1!==e.createErrors?(s+=" { keyword: '"+(P||"_limit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { comparison: "+R+", limit: "+a+", exclusive: "+w+" } ",!1!==e.opts.messages&&(s+=" , message: 'should be "+_+" ",s+=d?"' + "+a:a+"'"),e.opts.verbose&&(s+=" , schema: ",s+=d?"validate.schema"+l:""+n,s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),s+=" } "):s+=" {} ";F=s;return s=x.pop(),!e.compositeRule&&c?e.async?s+=" throw new ValidationError(["+F+"]); ":s+=" validate.errors = ["+F+"]; return false; ":s+=" var err = "+F+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+=" } ",c&&(s+=" else { "),s}},function(e,r,t){"use strict";e.exports=function(e,r,t){var a,s=" ",o=e.level,i=e.dataLevel,n=e.schema[r],l=e.schemaPath+e.util.getProperty(r),u=e.errSchemaPath+"/"+r,c=!e.opts.allErrors,h="data"+(i||""),d=e.opts.$data&&n&&n.$data;d?(s+=" var schema"+o+" = "+e.util.getData(n.$data,i,e.dataPathArr)+"; ",a="schema"+o):a=n,s+="if ( ",d&&(s+=" ("+a+" !== undefined && typeof "+a+" != 'number') || "),s+=" "+h+".length "+("maxItems"==r?">":"<")+" "+a+") { ";var f=r,p=p||[];p.push(s),s="",!1!==e.createErrors?(s+=" { keyword: '"+(f||"_limitItems")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+a+" } ",!1!==e.opts.messages&&(s+=" , message: 'should NOT have ",s+="maxItems"==r?"more":"less",s+=" than ",s+=d?"' + "+a+" + '":""+n,s+=" items' "),e.opts.verbose&&(s+=" , schema: ",s+=d?"validate.schema"+l:""+n,s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),s+=" } "):s+=" {} ";var m=s;return s=p.pop(),!e.compositeRule&&c?e.async?s+=" throw new ValidationError(["+m+"]); ":s+=" validate.errors = ["+m+"]; return false; ":s+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+="} ",c&&(s+=" else { "),s}},function(e,r,t){"use strict";e.exports=function(e,r,t){var a,s=" ",o=e.level,i=e.dataLevel,n=e.schema[r],l=e.schemaPath+e.util.getProperty(r),u=e.errSchemaPath+"/"+r,c=!e.opts.allErrors,h="data"+(i||""),d=e.opts.$data&&n&&n.$data;d?(s+=" var schema"+o+" = "+e.util.getData(n.$data,i,e.dataPathArr)+"; ",a="schema"+o):a=n;var f="maxLength"==r?">":"<";s+="if ( ",d&&(s+=" ("+a+" !== undefined && typeof "+a+" != 'number') || "),!1===e.opts.unicode?s+=" "+h+".length ":s+=" ucs2length("+h+") ",s+=" "+f+" "+a+") { ";var p=r,m=m||[];m.push(s),s="",!1!==e.createErrors?(s+=" { keyword: '"+(p||"_limitLength")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+a+" } ",!1!==e.opts.messages&&(s+=" , message: 'should NOT be ",s+="maxLength"==r?"longer":"shorter",s+=" than ",s+=d?"' + "+a+" + '":""+n,s+=" characters' "),e.opts.verbose&&(s+=" , schema: ",s+=d?"validate.schema"+l:""+n,s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),s+=" } "):s+=" {} ";var v=s;return s=m.pop(),!e.compositeRule&&c?e.async?s+=" throw new ValidationError(["+v+"]); ":s+=" validate.errors = ["+v+"]; return false; ":s+=" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+="} ",c&&(s+=" else { "),s}},function(e,r,t){"use strict";e.exports=function(e,r,t){var a,s=" ",o=e.level,i=e.dataLevel,n=e.schema[r],l=e.schemaPath+e.util.getProperty(r),u=e.errSchemaPath+"/"+r,c=!e.opts.allErrors,h="data"+(i||""),d=e.opts.$data&&n&&n.$data;d?(s+=" var schema"+o+" = "+e.util.getData(n.$data,i,e.dataPathArr)+"; ",a="schema"+o):a=n,s+="if ( ",d&&(s+=" ("+a+" !== undefined && typeof "+a+" != 'number') || "),s+=" Object.keys("+h+").length "+("maxProperties"==r?">":"<")+" "+a+") { ";var f=r,p=p||[];p.push(s),s="",!1!==e.createErrors?(s+=" { keyword: '"+(f||"_limitProperties")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+a+" } ",!1!==e.opts.messages&&(s+=" , message: 'should NOT have ",s+="maxProperties"==r?"more":"less",s+=" than ",s+=d?"' + "+a+" + '":""+n,s+=" properties' "),e.opts.verbose&&(s+=" , schema: ",s+=d?"validate.schema"+l:""+n,s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),s+=" } "):s+=" {} ";var m=s;return s=p.pop(),!e.compositeRule&&c?e.async?s+=" throw new ValidationError(["+m+"]); ":s+=" validate.errors = ["+m+"]; return false; ":s+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+="} ",c&&(s+=" else { "),s}},function(e,r,t){e.exports=function(){"use strict";var e=function(){function e(e,r){for(var t=0;t<r.length;t++){var a=r[t];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(r,t,a){return t&&e(r.prototype,t),a&&e(r,a),r}}();return function(){function r(){!function(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}(this,r),this.name="plugin",this.actions=new Map,this.subscriptions=new Set,this.publish=null}return e(r,[{key:"start",value:function(){}},{key:"handleMessage",value:function(e,r){}}]),r}()}()},function(e,r,t){e.exports=t(13)},function(e,r,t){"use strict";const a=t(14);e.exports=a},function(e,r,t){"use strict";const a=t(15),s=t(11),o=t(55);e.exports=class{constructor(e={}){this.config=e,this._eventBus=new a,this._plugins=new Map,this._internalPlugins={status:new o},this.plug(this._internalPlugins.status)}plug(...e){for(const r of e){if(!(r instanceof s))throw new Error("Invalid plugin");for(const[e,t]of r.actions.entries())this._eventBus.register(r.name,e,t);for(const e of r.subscriptions)this._eventBus.subscribe(...e.split(".",2),r.handleMessage);this._plugins.set(r.name,r)}}start(){for(const e of this._plugins.values())e.publish=((r,t)=>this._eventBus.publish(e.name,r,t)),e.start();this._internalPlugins.status.publishStartedMessage({name:this.config.name,version:this.config.version})}}},function(e,r,t){"use strict";const a=t(16),s=t(18),o=t(19),i=t(20);e.exports=class{constructor(){this._pubsub=a,this.registry=new i}register(e,r,t){const a=new o(e,r);this.registry.register(a,t)}subscribe(e,r,t){const a=new o(e,r);if(!this.registry.isRegistered(a))throw new Error("Topic not found.");return this._pubsub.subscribe(a.getName(),t)}publish(e,r,t){const a=new o(e,r);if(!this.registry.isRegistered(a))throw new Error("Topic not found");const i=new s(a,t);if(!this.registry.validate(i))throw new Error("Message invalid");this._pubsub.publish(i.topic.getName(),i.content)}unsubscribe(e){this._pubsub.unsubscribe(e)}}},function(e,r,t){(function(e){!function(t,a){"use strict";var s={};t.PubSub=s;var o=t.define;!function(e){var r={},t=-1;function a(e){var r;for(r in e)if(e.hasOwnProperty(r))return!0;return!1}function s(e,r,t){try{e(r,t)}catch(e){setTimeout(function(e){return function(){throw e}}(e),0)}}function o(e,r,t){e(r,t)}function i(e,t,a,i){var n,l=r[t],u=i?o:s;if(r.hasOwnProperty(t))for(n in l)l.hasOwnProperty(n)&&u(l[n],e,a)}function n(e,t,s,o){var n=function(e,r,t){return function(){var a=String(e),s=a.lastIndexOf(".");for(i(e,e,r,t);-1!==s;)a=a.substr(0,s),s=a.lastIndexOf("."),i(e,a,r,t)}}(e,t,o),l=function(e){var t=String(e),s=Boolean(r.hasOwnProperty(t)&&a(r[t])),o=t.lastIndexOf(".");for(;!s&&-1!==o;)t=t.substr(0,o),o=t.lastIndexOf("."),s=Boolean(r.hasOwnProperty(t)&&a(r[t]));return s}(e);return!!l&&(!0===s?n():setTimeout(n,0),!0)}e.publish=function(r,t){return n(r,t,!1,e.immediateExceptions)},e.publishSync=function(r,t){return n(r,t,!0,e.immediateExceptions)},e.subscribe=function(e,a){if("function"!=typeof a)return!1;r.hasOwnProperty(e)||(r[e]={});var s="uid_"+String(++t);return r[e][s]=a,s},e.subscribeOnce=function(r,t){var a=e.subscribe(r,function(){e.unsubscribe(a),t.apply(this,arguments)});return e},e.clearAllSubscriptions=function(){r={}},e.clearSubscriptions=function(e){var t;for(t in r)r.hasOwnProperty(t)&&0===t.indexOf(e)&&delete r[t]},e.unsubscribe=function(t){var a,s,o,i="string"==typeof t&&(r.hasOwnProperty(t)||function(e){var t;for(t in r)if(r.hasOwnProperty(t)&&0===t.indexOf(e))return!0;return!1}(t)),n=!i&&"string"==typeof t,l="function"==typeof t,u=!1;if(!i){for(a in r)if(r.hasOwnProperty(a)){if(s=r[a],n&&s[t]){delete s[t],u=t;break}if(l)for(o in s)s.hasOwnProperty(o)&&s[o]===t&&(delete s[o],u=!0)}return u}e.clearSubscriptions(t)}}(s),"function"==typeof o&&o.amd?o(function(){return s}):(void 0!==e&&e.exports&&(r=e.exports=s),r.PubSub=s,e.exports=r=s)}("object"==typeof window&&window||this)}).call(this,t(17)(e))},function(e,r){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,r,t){"use strict";e.exports=class{constructor(e,r){this.topic=e,this.content=r}}},function(e,r,t){"use strict";e.exports=class{constructor(e,r){this.entity=e,this.action=r}getName(){return this.action?this.entity+"."+this.action:this.entity}}},function(e,r,t){"use strict";const a=t(21);e.exports=class{constructor(){this.schemas=new Map,this.validator=new a}register(e,r){if(this.schemas.has(e.getName()))throw new Error("Topic already exists.");this.schemas.set(e.getName(),r)}isRegistered(e){return this.schemas.has(e.getName())}getSchema(e){const r=this.schemas.get(e.getName());if(r)return r;throw new Error("Topic not found.")}validate(e){return!!this.isRegistered(e.topic)&&Boolean(this.validator.validate(this.getSchema(e.topic),e.content))}}},function(e,r,t){"use strict";var a=t(22),s=t(1),o=t(26),i=t(4),n=t(5),l=t(27),u=t(28),c=t(49),h=t(0);e.exports=g,g.prototype.validate=function(e,r){var t;if("string"==typeof e){if(!(t=this.getSchema(e)))throw new Error('no schema with key or ref "'+e+'"')}else{var a=this._addSchema(e);t=a.validate||this._compile(a)}var s=t(r);!0!==t.$async&&(this.errors=t.errors);return s},g.prototype.compile=function(e,r){var t=this._addSchema(e,void 0,r);return t.validate||this._compile(t)},g.prototype.addSchema=function(e,r,t,a){if(Array.isArray(e)){for(var o=0;o<e.length;o++)this.addSchema(e[o],void 0,t,a);return this}var i=this._getId(e);if(void 0!==i&&"string"!=typeof i)throw new Error("schema id must be string");return S(this,r=s.normalizeId(r||i)),this._schemas[r]=this._addSchema(e,t,a,!0),this},g.prototype.addMetaSchema=function(e,r,t){return this.addSchema(e,r,t,!0),this},g.prototype.validateSchema=function(e,r){var t=e.$schema;if(void 0!==t&&"string"!=typeof t)throw new Error("$schema must be a string");if(!(t=t||this._opts.defaultMeta||function(e){var r=e._opts.meta;return e._opts.defaultMeta="object"==typeof r?e._getId(r)||r:e.getSchema(p)?p:void 0,e._opts.defaultMeta}(this)))return this.logger.warn("meta-schema not available"),this.errors=null,!0;var a,s=this._formats.uri;this._formats.uri="function"==typeof s?this._schemaUriFormatFunc:this._schemaUriFormat;try{a=this.validate(t,e)}finally{this._formats.uri=s}if(!a&&r){var o="schema is invalid: "+this.errorsText();if("log"!=this._opts.validateSchema)throw new Error(o);this.logger.error(o)}return a},g.prototype.getSchema=function(e){var r=y(this,e);switch(typeof r){case"object":return r.validate||this._compile(r);case"string":return this.getSchema(r);case"undefined":return function(e,r){var t=s.schema.call(e,{schema:{}},r);if(t){var o=t.schema,n=t.root,l=t.baseId,u=a.call(e,o,n,void 0,l);return e._fragments[r]=new i({ref:r,fragment:!0,schema:o,root:n,baseId:l,validate:u}),u}}(this,e)}},g.prototype.removeSchema=function(e){if(e instanceof RegExp)return P(this,this._schemas,e),P(this,this._refs,e),this;switch(typeof e){case"undefined":return P(this,this._schemas),P(this,this._refs),this._cache.clear(),this;case"string":var r=y(this,e);return r&&this._cache.del(r.cacheKey),delete this._schemas[e],delete this._refs[e],this;case"object":var t=this._opts.serialize,a=t?t(e):e;this._cache.del(a);var o=this._getId(e);o&&(o=s.normalizeId(o),delete this._schemas[o],delete this._refs[o])}return this},g.prototype.addFormat=function(e,r){"string"==typeof r&&(r=new RegExp(r));return this._formats[e]=r,this},g.prototype.errorsText=function(e,r){if(!(e=e||this.errors))return"No errors";for(var t=void 0===(r=r||{}).separator?", ":r.separator,a=void 0===r.dataVar?"data":r.dataVar,s="",o=0;o<e.length;o++){var i=e[o];i&&(s+=a+i.dataPath+" "+i.message+t)}return s.slice(0,-t.length)},g.prototype._addSchema=function(e,r,t,a){if("object"!=typeof e&&"boolean"!=typeof e)throw new Error("schema should be object or boolean");var o=this._opts.serialize,n=o?o(e):e,l=this._cache.get(n);if(l)return l;a=a||!1!==this._opts.addUsedSchema;var u=s.normalizeId(this._getId(e));u&&a&&S(this,u);var c,h=!1!==this._opts.validateSchema&&!r;h&&!(c=u&&u==s.normalizeId(e.$schema))&&this.validateSchema(e,!0);var d=s.ids.call(this,e),f=new i({id:u,schema:e,localRefs:d,cacheKey:n,meta:t});"#"!=u[0]&&a&&(this._refs[u]=f);this._cache.put(n,f),h&&c&&this.validateSchema(e,!0);return f},g.prototype._compile=function(e,r){if(e.compiling)return e.validate=o,o.schema=e.schema,o.errors=null,o.root=r||o,!0===e.schema.$async&&(o.$async=!0),o;var t,s;e.compiling=!0,e.meta&&(t=this._opts,this._opts=this._metaOpts);try{s=a.call(this,e.schema,r,e.localRefs)}catch(r){throw delete e.validate,r}finally{e.compiling=!1,e.meta&&(this._opts=t)}return e.validate=s,e.refs=s.refs,e.refVal=s.refVal,e.root=s.root,s;function o(){var r=e.validate,t=r.apply(this,arguments);return o.errors=r.errors,t}},g.prototype.compileAsync=t(50);var d=t(51);g.prototype.addKeyword=d.add,g.prototype.getKeyword=d.get,g.prototype.removeKeyword=d.remove;var f=t(3);g.ValidationError=f.Validation,g.MissingRefError=f.MissingRef,g.$dataMetaSchema=c;var p="http://json-schema.org/draft-07/schema",m=["removeAdditional","useDefaults","coerceTypes"],v=["/properties"];function g(e){if(!(this instanceof g))return new g(e);e=this._opts=h.copy(e)||{},function(e){var r=e._opts.logger;if(!1===r)e.logger={log:_,warn:_,error:_};else{if(void 0===r&&(r=console),!("object"==typeof r&&r.log&&r.warn&&r.error))throw new Error("logger must implement log, warn and error methods");e.logger=r}}(this),this._schemas={},this._refs={},this._fragments={},this._formats=l(e.format);var r=this._schemaUriFormat=this._formats["uri-reference"];this._schemaUriFormatFunc=function(e){return r.test(e)},this._cache=e.cache||new o,this._loadingSchemas={},this._compilations=[],this.RULES=u(),this._getId=function(e){switch(e.schemaId){case"auto":return b;case"id":return E;default:return w}}(e),e.loopRequired=e.loopRequired||1/0,"property"==e.errorDataPath&&(e._errorDataPathProperty=!0),void 0===e.serialize&&(e.serialize=n),this._metaOpts=function(e){for(var r=h.copy(e._opts),t=0;t<m.length;t++)delete r[m[t]];return r}(this),e.formats&&function(e){for(var r in e._opts.formats){var t=e._opts.formats[r];e.addFormat(r,t)}}(this),function(e){var r;e._opts.$data&&(r=t(53),e.addMetaSchema(r,r.$id,!0));if(!1===e._opts.meta)return;var a=t(54);e._opts.$data&&(a=c(a,v));e.addMetaSchema(a,p,!0),e._refs["http://json-schema.org/schema"]=p}(this),"object"==typeof e.meta&&this.addMetaSchema(e.meta),function(e){var r=e._opts.schemas;if(!r)return;if(Array.isArray(r))e.addSchema(r);else for(var t in r)e.addSchema(r[t],t)}(this)}function y(e,r){return r=s.normalizeId(r),e._schemas[r]||e._refs[r]||e._fragments[r]}function P(e,r,t){for(var a in r){var s=r[a];s.meta||t&&!t.test(a)||(e._cache.del(s.cacheKey),delete r[a])}}function E(e){return e.$id&&this.logger.warn("schema $id ignored",e.$id),e.id}function w(e){return e.id&&this.logger.warn("schema id ignored",e.id),e.$id}function b(e){if(e.$id&&e.id&&e.$id!=e.id)throw new Error("schema $id is different from id");return e.$id||e.id}function S(e,r){if(e._schemas[r]||e._refs[r])throw new Error('schema with key or id "'+r+'" already exists')}function _(){}},function(e,r,t){"use strict";var a=t(1),s=t(0),o=t(3),i=t(5),n=t(6),l=s.ucs2length,u=t(2),c=o.Validation;function h(e,r,t){for(var a=0;a<this._compilations.length;a++){var s=this._compilations[a];if(s.schema==e&&s.root==r&&s.baseId==t)return a}return-1}function d(e,r){return"var pattern"+e+" = new RegExp("+s.toQuotedString(r[e])+");"}function f(e){return"var default"+e+" = defaults["+e+"];"}function p(e,r){return void 0===r[e]?"":"var refVal"+e+" = refVal["+e+"];"}function m(e){return"var customRule"+e+" = customRules["+e+"];"}function v(e,r){if(!e.length)return"";for(var t="",a=0;a<e.length;a++)t+=r(a,e);return t}e.exports=function e(r,t,g,y){var P=this,E=this._opts,w=[void 0],b={},S=[],_={},x=[],F={},R=[];t=t||{schema:r,refVal:w,refs:b};var $=function(e,r,t){var a=h.call(this,e,r,t);return a>=0?{index:a,compiling:!0}:(a=this._compilations.length,this._compilations[a]={schema:e,root:r,baseId:t},{index:a,compiling:!1})}.call(this,r,t,y);var D=this._compilations[$.index];if($.compiling)return D.callValidate=function e(){var r=D.validate;var t=r.apply(this,arguments);e.errors=r.errors;return t};var O=this._formats;var I=this.RULES;try{var A=C(r,t,g,y);D.validate=A;var j=D.callValidate;return j&&(j.schema=A.schema,j.errors=null,j.refs=A.refs,j.refVal=A.refVal,j.root=A.root,j.$async=A.$async,E.sourceCode&&(j.source=A.source)),A}finally{(function(e,r,t){var a=h.call(this,e,r,t);a>=0&&this._compilations.splice(a,1)}).call(this,r,t,y)}function C(r,i,h,g){var y=!i||i&&i.schema==r;if(i.schema!=t.schema)return e.call(P,r,i,h,g);var _,F=!0===r.$async,$=n({isTop:!0,schema:r,isRoot:y,baseId:g,root:i,schemaPath:"",errSchemaPath:"#",errorPath:'""',MissingRefError:o.MissingRef,RULES:I,validate:n,util:s,resolve:a,resolveRef:k,usePattern:N,useDefault:L,useCustomRule:Q,opts:E,formats:O,logger:P.logger,self:P});$=v(w,p)+v(S,d)+v(x,f)+v(R,m)+$,E.processCode&&($=E.processCode($));try{var D=new Function("self","RULES","formats","root","refVal","defaults","customRules","equal","ucs2length","ValidationError",$);_=D(P,I,O,t,w,x,R,u,l,c),w[0]=_}catch(e){throw P.logger.error("Error compiling schema, function code:",$),e}return _.schema=r,_.errors=null,_.refs=b,_.refVal=w,_.root=y?_:i,F&&(_.$async=!0),!0===E.sourceCode&&(_.source={code:$,patterns:S,defaults:x}),_}function k(r,s,o){s=a.url(r,s);var i,n,l=b[s];if(void 0!==l)return T(i=w[l],n="refVal["+l+"]");if(!o&&t.refs){var u=t.refs[s];if(void 0!==u)return i=t.refVal[u],n=z(s,i),T(i,n)}n=z(s);var c=a.call(P,C,t,s);if(void 0===c){var h=g&&g[s];h&&(c=a.inlineRef(h,E.inlineRefs)?h:e.call(P,h,t,g,r))}if(void 0!==c)return function(e,r){var t=b[e];w[t]=r}(s,c),T(c,n);!function(e){delete b[e]}(s)}function z(e,r){var t=w.length;return w[t]=r,b[e]=t,"refVal"+t}function T(e,r){return"object"==typeof e||"boolean"==typeof e?{code:r,schema:e,inline:!0}:{code:r,$async:e&&!!e.$async}}function N(e){var r=_[e];return void 0===r&&(r=_[e]=S.length,S[r]=e),"pattern"+r}function L(e){switch(typeof e){case"boolean":case"number":return""+e;case"string":return s.toQuotedString(e);case"object":if(null===e)return"null";var r=i(e),t=F[r];return void 0===t&&(t=F[r]=x.length,x[t]=e),"default"+t}}function Q(e,r,t,a){var s=e.definition.validateSchema;if(s&&!1!==P._opts.validateSchema){var o=s(r);if(!o){var i="keyword schema is invalid: "+P.errorsText(s.errors);if("log"!=P._opts.validateSchema)throw new Error(i);P.logger.error(i)}}var n,l=e.definition.compile,u=e.definition.inline,c=e.definition.macro;if(l)n=l.call(P,r,t,a);else if(c)n=c.call(P,r,t,a),!1!==E.validateSchema&&P.validateSchema(n,!0);else if(u)n=u.call(P,a,e.keyword,r,t);else if(!(n=e.definition.validate))return;if(void 0===n)throw new Error('custom keyword "'+e.keyword+'"failed to compile');var h=R.length;return R[h]=n,{code:"customRule"+h,validate:n}}}},function(e,r,t){ /** @license URI.js v4.2.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */ !function(e){"use strict";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 a=r.length-1,s=1;s<a;++s)r[s]=r[s].slice(1,-1);return r[a]=r[a].slice(1),r.join("")}return r[0]}function t(e){return"(?:"+e+")"}function a(e){return void 0===e?"undefined":null===e?"null":Object.prototype.toString.call(e).split(" ").pop().split("]").shift().toLowerCase()}function s(e){return e.toUpperCase()}function o(e){var a=r("[0-9]","[A-Fa-f]"),s=t(t("%[EFef]"+a+"%"+a+a+"%"+a+a)+"|"+t("%[89A-Fa-f]"+a+"%"+a+a)+"|"+t("%"+a+a)),o="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",i=r("[\\:\\/\\?\\#\\[\\]\\@]",o),n=e?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]",l=e?"[\\uE000-\\uF8FF]":"[]",u=r("[A-Za-z]","[0-9]","[\\-\\.\\_\\~]",n),c=t("[A-Za-z]"+r("[A-Za-z]","[0-9]","[\\+\\-\\.]")+"*"),h=t(t(s+"|"+r(u,o,"[\\:]"))+"*"),d=(t(t("25[0-5]")+"|"+t("2[0-4][0-9]")+"|"+t("1[0-9][0-9]")+"|"+t("[1-9][0-9]")+"|[0-9]"),t(t("25[0-5]")+"|"+t("2[0-4][0-9]")+"|"+t("1[0-9][0-9]")+"|"+t("0?[1-9][0-9]")+"|0?0?[0-9]")),f=t(d+"\\."+d+"\\."+d+"\\."+d),p=t(a+"{1,4}"),m=t(t(p+"\\:"+p)+"|"+f),v=t(t(p+"\\:")+"{6}"+m),g=t("\\:\\:"+t(p+"\\:")+"{5}"+m),y=t(t(p)+"?\\:\\:"+t(p+"\\:")+"{4}"+m),P=t(t(t(p+"\\:")+"{0,1}"+p)+"?\\:\\:"+t(p+"\\:")+"{3}"+m),E=t(t(t(p+"\\:")+"{0,2}"+p)+"?\\:\\:"+t(p+"\\:")+"{2}"+m),w=t(t(t(p+"\\:")+"{0,3}"+p)+"?\\:\\:"+p+"\\:"+m),b=t(t(t(p+"\\:")+"{0,4}"+p)+"?\\:\\:"+m),S=t(t(t(p+"\\:")+"{0,5}"+p)+"?\\:\\:"+p),_=t(t(t(p+"\\:")+"{0,6}"+p)+"?\\:\\:"),x=t([v,g,y,P,E,w,b,S,_].join("|")),F=t(t(u+"|"+s)+"+"),R=(t(x+"\\%25"+F),t(x+t("\\%25|\\%(?!"+a+"{2})")+F)),$=t("[vV]"+a+"+\\."+r(u,o,"[\\:]")+"+"),D=t("\\["+t(R+"|"+x+"|"+$)+"\\]"),O=t(t(s+"|"+r(u,o))+"*"),I=t(D+"|"+f+"(?!"+O+")|"+O),A=t("[0-9]*"),j=t(t(h+"@")+"?"+I+t("\\:"+A)+"?"),C=t(s+"|"+r(u,o,"[\\:\\@]")),k=t(C+"*"),z=t(C+"+"),T=t(t(s+"|"+r(u,o,"[\\@]"))+"+"),N=t(t("\\/"+k)+"*"),L=t("\\/"+t(z+N)+"?"),Q=t(T+N),U=t(z+N),V="(?!"+C+")",q=(t(N+"|"+L+"|"+Q+"|"+U+"|"+V),t(t(C+"|"+r("[\\/\\?]",l))+"*")),M=t(t(C+"|[\\/\\?]")+"*"),H=t(t("\\/\\/"+j+N)+"|"+L+"|"+U+"|"+V),B=t(c+"\\:"+H+t("\\?"+q)+"?"+t("\\#"+M)+"?"),K=t(t("\\/\\/"+j+N)+"|"+L+"|"+Q+"|"+V),J=t(K+t("\\?"+q)+"?"+t("\\#"+M)+"?");return t(B+"|"+J),t(c+"\\:"+H+t("\\?"+q)+"?"),t(t("\\/\\/("+t("("+h+")@")+"?("+I+")"+t("\\:("+A+")")+"?)")+"?("+N+"|"+L+"|"+U+"|"+V+")"),t("\\?("+q+")"),t("\\#("+M+")"),t(t("\\/\\/("+t("("+h+")@")+"?("+I+")"+t("\\:("+A+")")+"?)")+"?("+N+"|"+L+"|"+Q+"|"+V+")"),t("\\?("+q+")"),t("\\#("+M+")"),t(t("\\/\\/("+t("("+h+")@")+"?("+I+")"+t("\\:("+A+")")+"?)")+"?("+N+"|"+L+"|"+U+"|"+V+")"),t("\\?("+q+")"),t("\\#("+M+")"),t("("+h+")@"),t("\\:("+A+")"),{NOT_SCHEME:new RegExp(r("[^]","[A-Za-z]","[0-9]","[\\+\\-\\.]"),"g"),NOT_USERINFO:new RegExp(r("[^\\%\\:]",u,o),"g"),NOT_HOST:new RegExp(r("[^\\%\\[\\]\\:]",u,o),"g"),NOT_PATH:new RegExp(r("[^\\%\\/\\:\\@]",u,o),"g"),NOT_PATH_NOSCHEME:new RegExp(r("[^\\%\\/\\@]",u,o),"g"),NOT_QUERY:new RegExp(r("[^\\%]",u,o,"[\\:\\@\\/\\?]",l),"g"),NOT_FRAGMENT:new RegExp(r("[^\\%]",u,o,"[\\:\\@\\/\\?]"),"g"),ESCAPE:new RegExp(r("[^]",u,o),"g"),UNRESERVED:new RegExp(u,"g"),OTHER_CHARS:new RegExp(r("[^\\%]",u,i),"g"),PCT_ENCODED:new RegExp(s,"g"),IPV4ADDRESS:new RegExp("^("+f+")$"),IPV6ADDRESS:new RegExp("^\\[?("+x+")"+t(t("\\%25|\\%(?!"+a+"{2})")+"("+F+")")+"?\\]?$")}}var i=o(!1),n=o(!0),l=function(e,r){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,r){var t=[],a=!0,s=!1,o=void 0;try{for(var i,n=e[Symbol.iterator]();!(a=(i=n.next()).done)&&(t.push(i.value),!r||t.length!==r);a=!0);}catch(e){s=!0,o=e}finally{try{!a&&n.return&&n.return()}finally{if(s)throw o}}return t}(e,r);throw new TypeError("Invalid attempt to destructure non-iterable instance")},u=2147483647,c=/^xn--/,h=/[^\0-\x7E]/,d=/[\x2E\u3002\uFF0E\uFF61]/g,f={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},p=Math.floor,m=String.fromCharCode;function v(e){throw new RangeError(f[e])}function g(e,r){var t=e.split("@"),a="";t.length>1&&(a=t[0]+"@",e=t[1]);var s=(e=e.replace(d,".")).split("."),o=function(e,r){for(var t=[],a=e.length;a--;)t[a]=r(e[a]);return t}(s,r).join(".");return a+o}function y(e){for(var r=[],t=0,a=e.length;t<a;){var s=e.charCodeAt(t++);if(s>=55296&&s<=56319&&t<a){var o=e.charCodeAt(t++);56320==(64512&o)?r.push(((1023&s)<<10)+(1023&o)+65536):(r.push(s),t--)}else r.push(s)}return r}var P=function(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:36},E=function(e,r){return e+22+75*(e<26)-((0!=r)<<5)},w=function(e,r,t){var a=0;for(e=t?p(e/700):e>>1,e+=p(e/r);e>455;a+=36)e=p(e/35);return p(a+36*e/(e+38))},b=function(e){var r=[],t=e.length,a=0,s=128,o=72,i=e.lastIndexOf("-");i<0&&(i=0);for(var n=0;n<i;++n)e.charCodeAt(n)>=128&&v("not-basic"),r.push(e.charCodeAt(n));for(var l=i>0?i+1:0;l<t;){for(var c=a,h=1,d=36;;d+=36){l>=t&&v("invalid-input");var f=P(e.charCodeAt(l++));(f>=36||f>p((u-a)/h))&&v("overflow"),a+=f*h;var m=d<=o?1:d>=o+26?26:d-o;if(f<m)break;var g=36-m;h>p(u/g)&&v("overflow"),h*=g}var y=r.length+1;o=w(a-c,y,0==c),p(a/y)>u-s&&v("overflow"),s+=p(a/y),a%=y,r.splice(a++,0,s)}return String.fromCodePoint.apply(String,r)},S=function(e){var r=[],t=(e=y(e)).length,a=128,s=0,o=72,i=!0,n=!1,l=void 0;try{for(var c,h=e[Symbol.iterator]();!(i=(c=h.next()).done);i=!0){var d=c.value;d<128&&r.push(m(d))}}catch(e){n=!0,l=e}finally{try{!i&&h.return&&h.return()}finally{if(n)throw l}}var f=r.length,g=f;for(f&&r.push("-");g<t;){var P=u,b=!0,S=!1,_=void 0;try{for(var x,F=e[Symbol.iterator]();!(b=(x=F.next()).done);b=!0){var R=x.value;R>=a&&R<P&&(P=R)}}catch(e){S=!0,_=e}finally{try{!b&&F.return&&F.return()}finally{if(S)throw _}}var $=g+1;P-a>p((u-s)/$)&&v("overflow"),s+=(P-a)*$,a=P;var D=!0,O=!1,I=void 0;try{for(var A,j=e[Symbol.iterator]();!(D=(A=j.next()).done);D=!0){var C=A.value;if(C<a&&++s>u&&v("overflow"),C==a){for(var k=s,z=36;;z+=36){var T=z<=o?1:z>=o+26?26:z-o;if(k<T)break;var N=k-T,L=36-T;r.push(m(E(T+N%L,0))),k=p(N/L)}r.push(m(E(k,0))),o=w(s,$,g==f),s=0,++g}}}catch(e){O=!0,I=e}finally{try{!D&&j.return&&j.return()}finally{if(O)throw I}}++s,++a}return r.join("")},_={version:"2.1.0",ucs2:{decode:y,encode:function(e){return String.fromCodePoint.apply(String,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)}(e))}},decode:b,encode:S,toASCII:function(e){return g(e,function(e){return h.test(e)?"xn--"+S(e):e})},toUnicode:function(e){return g(e,function(e){return c.test(e)?b(e.slice(4).toLowerCase()):e})}},x={};function F(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 R(e){for(var r="",t=0,a=e.length;t<a;){var s=parseInt(e.substr(t+1,2),16);if(s<128)r+=String.fromCharCode(s),t+=3;else if(s>=194&&s<224){if(a-t>=6){var o=parseInt(e.substr(t+4,2),16);r+=String.fromCharCode((31&s)<<6|63&o)}else r+=e.substr(t,6);t+=6}else if(s>=224){if(a-t>=9){var i=parseInt(e.substr(t+4,2),16),n=parseInt(e.substr(t+7,2),16);r+=String.fromCharCode((15&s)<<12|(63&i)<<6|63&n)}else r+=e.substr(t,9);t+=9}else r+=e.substr(t,3),t+=3}return r}function $(e,r){function t(e){var t=R(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,F).replace(r.PCT_ENCODED,s)),void 0!==e.host&&(e.host=String(e.host).replace(r.PCT_ENCODED,t).toLowerCase().replace(r.NOT_HOST,F).replace(r.PCT_ENCODED,s)),void 0!==e.path&&(e.path=String(e.path).replace(r.PCT_ENCODED,t).replace(e.scheme?r.NOT_PATH:r.NOT_PATH_NOSCHEME,F).replace(r.PCT_ENCODED,s)),void 0!==e.query&&(e.query=String(e.query).replace(r.PCT_ENCODED,t).replace(r.NOT_QUERY,F).replace(r.PCT_ENCODED,s)),void 0!==e.fragment&&(e.fragment=String(e.fragment).replace(r.PCT_ENCODED,t).replace(r.NOT_FRAGMENT,F).replace(r.PCT_ENCODED,s)),e}function D(e){return e.replace(/^0*(.*)/,"$1")||"0"}function O(e,r){var t=e.match(r.IPV4ADDRESS)||[],a=l(t,2),s=a[1];return s?s.split(".").map(D).join("."):e}function I(e,r){var t=e.match(r.IPV6ADDRESS)||[],a=l(t,3),s=a[1],o=a[2];if(s){for(var i=s.toLowerCase().split("::").reverse(),n=l(i,2),u=n[0],c=n[1],h=c?c.split(":").map(D):[],d=u.split(":").map(D),f=r.IPV4ADDRESS.test(d[d.length-1]),p=f?7:8,m=d.length-p,v=Array(p),g=0;g<p;++g)v[g]=h[g]||d[m+g]||"";f&&(v[p-1]=O(v[p-1],r));var y=v.reduce(function(e,r,t){if(!r||"0"===r){var a=e[e.length-1];a&&a.index+a.length===t?a.length++:e.push({index:t,length:1})}return e},[]),P=y.sort(function(e,r){return r.length-e.length})[0],E=void 0;if(P&&P.length>1){var w=v.slice(0,P.index),b=v.slice(P.index+P.length);E=w.join(":")+"::"+b.join(":")}else E=v.join(":");return o&&(E+="%"+o),E}return e}var A=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,j=void 0==="".match(/(){0}/)[1];function C(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t={},a=!1!==r.iri?n:i;"suffix"===r.reference&&(e=(r.scheme?r.scheme+":":"")+"//"+e);var s=e.match(A);if(s){j?(t.scheme=s[1],t.userinfo=s[3],t.host=s[4],t.port=parseInt(s[5],10),t.path=s[6]||"",t.query=s[7],t.fragment=s[8],isNaN(t.port)&&(t.port=s[5])):(t.scheme=s[1]||void 0,t.userinfo=-1!==e.ind