UNPKG

jsoneditor

Version:

A web-based tool to view, edit, format, and validate JSON

30 lines 789 kB
/*! * jsoneditor.js * * @brief * JSONEditor is a web-based tool to view, edit, format, and validate JSON. * It has various modes such as a tree editor, a code editor, and a plain text * editor. * * Supported browsers: Chrome, Firefox, Safari, Opera, Internet Explorer 8+ * * @license * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy * of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations under * the License. * * Copyright (c) 2011-2019 Jos de Jong, http://jsoneditoronline.org * * @author Jos de Jong, <wjosdejong@gmail.com> * @version 5.32.5 * @date 2019-04-27 */ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.JSONEditor=t():e.JSONEditor=t()}(this,function(){return function(e){function t(n){if(i[n])return i[n].exports;var r=i[n]={exports:{},id:n,loaded:!1};return e[n].call(r.exports,r,r.exports,t),r.loaded=!0,r.exports}var i={};return t.m=e,t.c=i,t.p="",t(0)}([function(e,t,i){"use strict";function n(e,t,i){if(!(this instanceof n))throw new Error('JSONEditor constructor called without "new".');var r=c.getInternetExplorerVersion();if(-1!=r&&r<9)throw new Error("Unsupported browser, IE9 or newer required. Please install the newest version of your browser.");t&&(t.error&&(console.warn('Option "error" has been renamed to "onError"'),t.onError=t.error,delete t.error),t.change&&(console.warn('Option "change" has been renamed to "onChange"'),t.onChange=t.change,delete t.change),t.editable&&(console.warn('Option "editable" has been renamed to "onEditable"'),t.onEditable=t.editable,delete t.editable),t.onChangeJSON&&("text"===t.mode||"code"===t.mode||t.modes&&(-1!==t.modes.indexOf("text")||-1!==t.modes.indexOf("code")))&&console.warn('Option "onChangeJSON" is not applicable to modes "text" and "code". Use "onChangeText" or "onChange" instead.'),t&&Object.keys(t).forEach(function(e){-1===n.VALID_OPTIONS.indexOf(e)&&console.warn('Unknown option "'+e+'". This option will be ignored')})),arguments.length&&this._create(e,t,i)}var r;try{r=i(1)}catch(e){}var o=i(51),s=i(57),a=i(59),l=i(82),c=i(62);"undefined"==typeof Promise&&console.error("Promise undefined. Please load a Promise polyfill in the browser in order to use JSONEditor"),n.modes={},n.prototype.DEBOUNCE_INTERVAL=150,n.VALID_OPTIONS=["ajv","schema","schemaRefs","templates","ace","theme","autocomplete","onChange","onChangeJSON","onChangeText","onEditable","onError","onEvent","onModeChange","onNodeName","onValidate","onCreateMenu","onSelectionChange","onTextSelectionChange","onClassName","colorPicker","onColorPicker","timestampTag","escapeUnicode","history","search","mode","modes","name","indentation","sortObjectKeys","navigationBar","statusBar","mainMenuBar","languages","language","enableSort","enableTransform","maxVisibleChilds"],n.prototype._create=function(e,t,i){this.container=e,this.options=t||{},this.json=i||{};var n=this.options.mode||this.options.modes&&this.options.modes[0]||"tree";this.setMode(n)},n.prototype.destroy=function(){},n.prototype.set=function(e){this.json=e},n.prototype.get=function(){return this.json},n.prototype.setText=function(e){this.json=c.parse(e)},n.prototype.getText=function(){return JSON.stringify(this.json)},n.prototype.setName=function(e){this.options||(this.options={}),this.options.name=e},n.prototype.getName=function(){return this.options&&this.options.name},n.prototype.setMode=function(e){if(e!==this.options.mode||!this.create){var t,i,r=this.container,o=c.extend({},this.options),s=o.mode;o.mode=e;var a=n.modes[e];if(!a)throw new Error('Unknown mode "'+o.mode+'"');try{var l="text"==a.data;if(i=this.getName(),t=this[l?"getText":"get"](),this.destroy(),c.clear(this),c.extend(this,a.mixin),this.create(r,o),this.setName(i),this[l?"setText":"set"](t),"function"==typeof a.load)try{a.load.call(this)}catch(e){console.error(e)}if("function"==typeof o.onModeChange&&e!==s)try{o.onModeChange(e,s)}catch(e){console.error(e)}}catch(e){this._onError(e)}}},n.prototype.getMode=function(){return this.options.mode},n.prototype._onError=function(e){if(!this.options||"function"!=typeof this.options.onError)throw e;this.options.onError(e)},n.prototype.setSchema=function(e,t){if(e){var i;try{i=this.options.ajv||r({allErrors:!0,verbose:!0})}catch(e){console.warn("Failed to create an instance of Ajv, JSON Schema validation is not available. Please use a JSONEditor bundle including Ajv, or pass an instance of Ajv as via the configuration option `ajv`.")}if(i){if(t){for(var n in t)i.removeSchema(n),t[n]&&i.addSchema(t[n],n);this.options.schemaRefs=t}this.validateSchema=i.compile(e),this.options.schema=e,this.validate()}this.refresh()}else this.validateSchema=null,this.options.schema=null,this.options.schemaRefs=null,this.validate(),this.refresh()},n.prototype.validate=function(){},n.prototype.refresh=function(){},n.registerMode=function(e){var t,i;if(c.isArray(e))for(t=0;t<e.length;t++)n.registerMode(e[t]);else{if(!("mode"in e))throw new Error('Property "mode" missing');if(!("mixin"in e))throw new Error('Property "mixin" missing');if(!("data"in e))throw new Error('Property "data" missing');var r=e.mode;if(r in n.modes)throw new Error('Mode "'+r+'" already registered');if("function"!=typeof e.mixin.create)throw new Error('Required function "create" missing on mixin');var o=["setMode","registerMode","modes"];for(t=0;t<o.length;t++)if((i=o[t])in e.mixin)throw new Error('Reserved property "'+i+'" not allowed in mixin');n.modes[r]=e}},n.registerMode(a),n.registerMode(l),n.ace=o,n.Ajv=r,n.VanillaPicker=s,n.default=n,e.exports=n},function(e,t,i){"use strict";function n(e){if(!(this instanceof n))return new n(e);e=this._opts=N.copy(e)||{},k(this),this._schemas={},this._refs={},this._fragments={},this._formats=P(e.format);var t=this._schemaUriFormat=this._formats["uri-reference"];this._schemaUriFormatFunc=function(e){return t.test(e)},this._cache=e.cache||new L,this._loadingSchemas={},this._compilations=[],this.RULES=M(),this._getId=v(e),e.loopRequired=e.loopRequired||1/0,"property"==e.errorDataPath&&(e._errorDataPathProperty=!0),void 0===e.serialize&&(e.serialize=R),this._metaOpts=_(this),e.formats&&x(this),A(this),"object"==typeof e.meta&&this.addMetaSchema(e.meta),F(this),e.patternGroups&&I(this)}function r(e,t){var i;if("string"==typeof e){if(!(i=this.getSchema(e)))throw new Error('no schema with key or ref "'+e+'"')}else{var n=this._addSchema(e);i=n.validate||this._compile(n)}var r=i(t);return!0===i.$async?"*"==this._opts.async?j(r):r:(this.errors=i.errors,r)}function o(e,t){var i=this._addSchema(e,void 0,t);return i.validate||this._compile(i)}function s(e,t,i,n){if(Array.isArray(e)){for(var r=0;r<e.length;r++)this.addSchema(e[r],void 0,i,n);return this}var o=this._getId(e);if(void 0!==o&&"string"!=typeof o)throw new Error("schema id must be string");return t=B.normalizeId(t||o),S(this,t),this._schemas[t]=this._addSchema(e,i,n,!0),this}function a(e,t,i){return this.addSchema(e,t,i,!0),this}function l(e,t){var i=e.$schema;if(void 0!==i&&"string"!=typeof i)throw new Error("$schema must be a string");if(!(i=i||this._opts.defaultMeta||c(this)))return this.logger.warn("meta-schema not available"),this.errors=null,!0;var n=this._formats.uri;this._formats.uri="function"==typeof n?this._schemaUriFormatFunc:this._schemaUriFormat;var r;try{r=this.validate(i,e)}finally{this._formats.uri=n}if(!r&&t){var o="schema is invalid: "+this.errorsText();if("log"!=this._opts.validateSchema)throw new Error(o);this.logger.error(o)}return r}function c(e){var t=e._opts.meta;return e._opts.defaultMeta="object"==typeof t?e._getId(t)||t:e.getSchema(W)?W:void 0,e._opts.defaultMeta}function h(e){var t=u(this,e);switch(typeof t){case"object":return t.validate||this._compile(t);case"string":return this.getSchema(t);case"undefined":return d(this,e)}}function d(e,t){var i=B.schema.call(e,{schema:{}},t);if(i){var n=i.schema,r=i.root,o=i.baseId,s=$.call(e,n,r,void 0,o);return e._fragments[t]=new T({ref:t,fragment:!0,schema:n,root:r,baseId:o,validate:s}),s}}function u(e,t){return t=B.normalizeId(t),e._schemas[t]||e._refs[t]||e._fragments[t]}function p(e){if(e instanceof RegExp)return f(this,this._schemas,e),f(this,this._refs,e),this;switch(typeof e){case"undefined":return f(this,this._schemas),f(this,this._refs),this._cache.clear(),this;case"string":var t=u(this,e);return t&&this._cache.del(t.cacheKey),delete this._schemas[e],delete this._refs[e],this;case"object":var i=this._opts.serialize,n=i?i(e):e;this._cache.del(n);var r=this._getId(e);r&&(r=B.normalizeId(r),delete this._schemas[r],delete this._refs[r])}return this}function f(e,t,i){for(var n in t){var r=t[n];r.meta||i&&!i.test(n)||(e._cache.del(r.cacheKey),delete t[n])}}function m(e,t,i,n){if("object"!=typeof e&&"boolean"!=typeof e)throw new Error("schema should be object or boolean");var r=this._opts.serialize,o=r?r(e):e,s=this._cache.get(o);if(s)return s;n=n||!1!==this._opts.addUsedSchema;var a=B.normalizeId(this._getId(e));a&&n&&S(this,a);var l,c=!1!==this._opts.validateSchema&&!t;c&&!(l=a&&a==B.normalizeId(e.$schema))&&this.validateSchema(e,!0);var h=B.ids.call(this,e),d=new T({id:a,schema:e,localRefs:h,cacheKey:o,meta:i});return"#"!=a[0]&&n&&(this._refs[a]=d),this._cache.put(o,d),c&&l&&this.validateSchema(e,!0),d}function g(e,t){function i(){var t=e.validate,n=t.apply(null,arguments);return i.errors=t.errors,n}if(e.compiling)return e.validate=i,i.schema=e.schema,i.errors=null,i.root=t||i,!0===e.schema.$async&&(i.$async=!0),i;e.compiling=!0;var n;e.meta&&(n=this._opts,this._opts=this._metaOpts);var r;try{r=$.call(this,e.schema,t,e.localRefs)}finally{e.compiling=!1,e.meta&&(this._opts=n)}return e.validate=r,e.refs=r.refs,e.refVal=r.refVal,e.root=r.root,r}function v(e){switch(e.schemaId){case"$id":return w;case"id":return y;default:return b}}function y(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 C(e,t){if(!(e=e||this.errors))return"No errors";t=t||{};for(var i=void 0===t.separator?", ":t.separator,n=void 0===t.dataVar?"data":t.dataVar,r="",o=0;o<e.length;o++){var s=e[o];s&&(r+=n+s.dataPath+" "+s.message+i)}return r.slice(0,-i.length)}function E(e,t){return"string"==typeof t&&(t=new RegExp(t)),this._formats[e]=t,this}function A(e){var t;if(e._opts.$data&&(t=i(49),e.addMetaSchema(t,t.$id,!0)),!1!==e._opts.meta){var n=i(50);e._opts.$data&&(n=O(n,U)),e.addMetaSchema(n,W,!0),e._refs["http://json-schema.org/schema"]=W}}function F(e){var t=e._opts.schemas;if(t)if(Array.isArray(t))e.addSchema(t);else for(var i in t)e.addSchema(t[i],i)}function x(e){for(var t in e._opts.formats){var i=e._opts.formats[t];e.addFormat(t,i)}}function S(e,t){if(e._schemas[t]||e._refs[t])throw new Error('schema with key or id "'+t+'" already exists')}function _(e){for(var t=N.copy(e._opts),i=0;i<z.length;i++)delete t[z[i]];return t}function k(e){var t=e._opts.logger;if(!1===t)e.logger={log:D,warn:D,error:D};else{if(void 0===t&&(t=console),!("object"==typeof t&&t.log&&t.warn&&t.error))throw new Error("logger must implement log, warn and error methods");e.logger=t}}function D(){}var $=i(2),B=i(3),L=i(19),T=i(13),R=i(16),P=i(20),M=i(21),O=i(44),I=i(45),N=i(11),j=i(18);e.exports=n,n.prototype.validate=r,n.prototype.compile=o,n.prototype.addSchema=s,n.prototype.addMetaSchema=a,n.prototype.validateSchema=l,n.prototype.getSchema=h,n.prototype.removeSchema=p,n.prototype.addFormat=E,n.prototype.errorsText=C,n.prototype._addSchema=m,n.prototype._compile=g,n.prototype.compileAsync=i(46);var H=i(47);n.prototype.addKeyword=H.add,n.prototype.getKeyword=H.get,n.prototype.removeKeyword=H.remove;var V=i(15);n.ValidationError=V.Validation,n.MissingRefError=V.MissingRef,n.$dataMetaSchema=O;var W="http://json-schema.org/draft-06/schema",z=["removeAdditional","useDefaults","coerceTypes"],U=["/properties"]},function(e,t,i){"use strict";function n(e,t,i,s){function C(){var e=H.validate,t=e.apply(null,arguments);return C.errors=e.errors,t}function E(e,i,r,o){var s=!i||i&&i.schema==e;if(i.schema!=t.schema)return n.call(B,e,i,r,o);var m=!0===e.$async,C=g({isTop:!0,schema:e,isRoot:s,baseId:o,root:i,schemaPath:"",errSchemaPath:"#",errorPath:'""',MissingRefError:f.MissingRef,RULES:W,validate:g,util:p,resolve:u,resolveRef:A,usePattern:k,useDefault:D,useCustomRule:$,opts:L,formats:V,logger:B.logger,self:B});C=d(T,c)+d(P,a)+d(O,l)+d(N,h)+C,L.processCode&&(C=L.processCode(C));var E;try{E=new Function("self","RULES","formats","root","refVal","defaults","customRules","co","equal","ucs2length","ValidationError",C)(B,W,V,t,T,O,N,v,w,y,b),T[0]=E}catch(e){throw B.logger.error("Error compiling schema, function code:",C),e}return E.schema=e,E.errors=null,E.refs=R,E.refVal=T,E.root=s?E:i,m&&(E.$async=!0),!0===L.sourceCode&&(E.source={code:C,patterns:P,defaults:O}),E}function A(e,r,o){r=u.url(e,r);var s,a,l=R[r];if(void 0!==l)return s=T[l],a="refVal["+l+"]",_(s,a);if(!o&&t.refs){var c=t.refs[r];if(void 0!==c)return s=t.refVal[c],a=F(r,s),_(s,a)}a=F(r);var h=u.call(B,E,t,r);if(void 0===h){var d=i&&i[r];d&&(h=u.inlineRef(d,L.inlineRefs)?d:n.call(B,d,t,i,e))}if(void 0!==h)return S(r,h),_(h,a);x(r)}function F(e,t){var i=T.length;return T[i]=t,R[e]=i,"refVal"+i}function x(e){delete R[e]}function S(e,t){var i=R[e];T[i]=t}function _(e,t){return"object"==typeof e||"boolean"==typeof e?{code:t,schema:e,inline:!0}:{code:t,$async:e&&e.$async}}function k(e){var t=M[e];return void 0===t&&(t=M[e]=P.length,P[t]=e),"pattern"+t}function D(e){switch(typeof e){case"boolean":case"number":return""+e;case"string":return p.toQuotedString(e);case"object":if(null===e)return"null";var t=m(e),i=I[t];return void 0===i&&(i=I[t]=O.length,O[i]=e),"default"+i}}function $(e,t,i,n){var r=e.definition.validateSchema;if(r&&!1!==B._opts.validateSchema){if(!r(t)){var o="keyword schema is invalid: "+B.errorsText(r.errors);if("log"!=B._opts.validateSchema)throw new Error(o);B.logger.error(o)}}var s,a=e.definition.compile,l=e.definition.inline,c=e.definition.macro;if(a)s=a.call(B,t,i,n);else if(c)s=c.call(B,t,i,n),!1!==L.validateSchema&&B.validateSchema(s,!0);else if(l)s=l.call(B,n,e.keyword,t,i);else if(!(s=e.definition.validate))return;if(void 0===s)throw new Error('custom keyword "'+e.keyword+'"failed to compile');var h=N.length;return N[h]=s,{code:"customRule"+h,validate:s}}var B=this,L=this._opts,T=[void 0],R={},P=[],M={},O=[],I={},N=[];t=t||{schema:e,refVal:T,refs:R};var j=r.call(this,e,t,s),H=this._compilations[j.index];if(j.compiling)return H.callValidate=C;var V=this._formats,W=this.RULES;try{var z=E(e,t,i,s);H.validate=z;var U=H.callValidate;return U&&(U.schema=z.schema,U.errors=null,U.refs=z.refs,U.refVal=z.refVal,U.root=z.root,U.$async=z.$async,L.sourceCode&&(U.source=z.source)),z}finally{o.call(this,e,t,s)}}function r(e,t,i){var n=s.call(this,e,t,i);return n>=0?{index:n,compiling:!0}:(n=this._compilations.length,this._compilations[n]={schema:e,root:t,baseId:i},{index:n,compiling:!1})}function o(e,t,i){var n=s.call(this,e,t,i);n>=0&&this._compilations.splice(n,1)}function s(e,t,i){for(var n=0;n<this._compilations.length;n++){var r=this._compilations[n];if(r.schema==e&&r.root==t&&r.baseId==i)return n}return-1}function a(e,t){return"var pattern"+e+" = new RegExp("+p.toQuotedString(t[e])+");"}function l(e){return"var default"+e+" = defaults["+e+"];"}function c(e,t){return void 0===t[e]?"":"var refVal"+e+" = refVal["+e+"];"}function h(e){return"var customRule"+e+" = customRules["+e+"];"}function d(e,t){if(!e.length)return"";for(var i="",n=0;n<e.length;n++)i+=t(n,e);return i}var u=i(3),p=i(11),f=i(15),m=i(16),g=i(17),v=i(18),y=p.ucs2length,w=i(10),b=f.Validation;e.exports=n},function(e,t,i){"use strict";function n(e,t,i){var o=this._refs[i];if("string"==typeof o){if(!this._refs[o])return n.call(this,e,t,o);o=this._refs[o]}if((o=o||this._schemas[i])instanceof y)return a(o.schema,this._opts.inlineRefs)?o.schema:o.validate||this._compile(o);var s,l,c,h=r.call(this,t,i);return h&&(s=h.schema,t=h.root,c=h.baseId),s instanceof y?l=s.validate||e.call(this,s.schema,t,void 0,c):void 0!==s&&(l=a(s,this._opts.inlineRefs)?s:e.call(this,s,t,void 0,c)),l}function r(e,t){var i=m.parse(t,!1,!0),n=d(i),r=h(this._getId(e.schema));if(n!==r){var a=u(n),l=this._refs[a];if("string"==typeof l)return o.call(this,e,l,i);if(l instanceof y)l.validate||this._compile(l),e=l;else{if(!((l=this._schemas[a])instanceof y))return;if(l.validate||this._compile(l),a==u(t))return{schema:l,root:e,baseId:r};e=l}if(!e.schema)return;r=h(this._getId(e.schema))}return s.call(this,i,r,e.schema,e)}function o(e,t,i){var n=r.call(this,e,t);if(n){var o=n.schema,a=n.baseId;e=n.root;var l=this._getId(o);return l&&(a=p(a,l)),s.call(this,i,a,o,e)}}function s(e,t,i,n){if(e.hash=e.hash||"","#/"==e.hash.slice(0,2)){for(var o=e.hash.split("/"),s=1;s<o.length;s++){var a=o[s];if(a){if(a=v.unescapeFragment(a),void 0===(i=i[a]))break;var l;if(!b[a]&&(l=this._getId(i),l&&(t=p(t,l)),i.$ref)){var c=p(t,i.$ref),h=r.call(this,n,c);h&&(i=h.schema,n=h.root,t=h.baseId)}}}return void 0!==i&&i!==n.schema?{schema:i,root:n,baseId:t}:void 0}}function a(e,t){return!1!==t&&(void 0===t||!0===t?l(e):t?c(e)<=t:void 0)}function l(e){var t;if(Array.isArray(e)){for(var i=0;i<e.length;i++)if("object"==typeof(t=e[i])&&!l(t))return!1}else for(var n in e){if("$ref"==n)return!1;if("object"==typeof(t=e[n])&&!l(t))return!1}return!0}function c(e){var t,i=0;if(Array.isArray(e)){for(var n=0;n<e.length;n++)if(t=e[n],"object"==typeof t&&(i+=c(t)),i==1/0)return 1/0}else for(var r in e){if("$ref"==r)return 1/0;if(C[r])i++;else if(t=e[r],"object"==typeof t&&(i+=c(t)+1),i==1/0)return 1/0}return i}function h(e,t){return!1!==t&&(e=u(e)),d(m.parse(e,!1,!0))}function d(e){var t=e.protocol||"//"==e.href.slice(0,2)?"//":"";return(e.protocol||"")+t+(e.host||"")+(e.path||"")+"#"}function u(e){return e?e.replace(E,""):""}function p(e,t){return t=u(t),m.resolve(e,t)}function f(e){var t=u(this._getId(e)),i={"":t},n={"":h(t,!1)},r={},o=this;return w(e,{allKeys:!0},function(e,t,s,a,l,c,h){if(""!==t){var d=o._getId(e),p=i[a],f=n[a]+"/"+l;if(void 0!==h&&(f+="/"+("number"==typeof h?h:v.escapeFragment(h))),"string"==typeof d){d=p=u(p?m.resolve(p,d):d);var y=o._refs[d];if("string"==typeof y&&(y=o._refs[y]),y&&y.schema){if(!g(e,y.schema))throw new Error('id "'+d+'" resolves to more than one schema')}else if(d!=u(f))if("#"==d[0]){if(r[d]&&!g(e,r[d]))throw new Error('id "'+d+'" resolves to more than one schema');r[d]=e}else o._refs[d]=f}i[t]=p,n[t]=f}}),r}var m=i(4),g=i(10),v=i(11),y=i(13),w=i(14);e.exports=n,n.normalizeId=u,n.fullPath=h,n.url=p,n.ids=f,n.inlineRef=a,n.schema=r;var b=v.toHash(["properties","patternProperties","enum","dependencies","definitions"]),C=v.toHash(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum"]),E=/#\/?$/},function(e,t,i){function n(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}function r(e,t,i){if(e&&c(e)&&e instanceof n)return e;var r=new n;return r.parse(e,t,i),r}function o(e){return l(e)&&(e=r(e)),e instanceof n?e.format():n.prototype.format.call(e)}function s(e,t){return r(e,!1,!0).resolve(t)}function a(e,t){return e?r(e,!1,!0).resolveObject(t):t}function l(e){return"string"==typeof e}function c(e){return"object"==typeof e&&null!==e}function h(e){return null===e}function d(e){return null==e}var u=i(5);t.parse=r,t.resolve=s,t.resolveObject=a,t.format=o,t.Url=n;var p=/^([a-z0-9.+-]+:)/i,f=/:[0-9]*$/,m=["<",">",'"',"`"," ","\r","\n","\t"],g=["{","}","|","\\","^","`"].concat(m),v=["'"].concat(g),y=["%","/","?",";","#"].concat(v),w=["/","?","#"],b={javascript:!0,"javascript:":!0},C={javascript:!0,"javascript:":!0},E={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},A=i(7);n.prototype.parse=function(e,t,i){if(!l(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var n=e;n=n.trim();var r=p.exec(n);if(r){r=r[0];var o=r.toLowerCase();this.protocol=o,n=n.substr(r.length)}if(i||r||n.match(/^\/\/[^@\/]+@[^@\/]+/)){var s="//"===n.substr(0,2);!s||r&&C[r]||(n=n.substr(2),this.slashes=!0)}if(!C[r]&&(s||r&&!E[r])){for(var a=-1,c=0;c<w.length;c++){var h=n.indexOf(w[c]);-1!==h&&(-1===a||h<a)&&(a=h)}var d,f;f=-1===a?n.lastIndexOf("@"):n.lastIndexOf("@",a),-1!==f&&(d=n.slice(0,f),n=n.slice(f+1),this.auth=decodeURIComponent(d)),a=-1;for(var c=0;c<y.length;c++){var h=n.indexOf(y[c]);-1!==h&&(-1===a||h<a)&&(a=h)}-1===a&&(a=n.length),this.host=n.slice(0,a),n=n.slice(a),this.parseHost(),this.hostname=this.hostname||"";var m="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!m)for(var g=this.hostname.split(/\./),c=0,F=g.length;c<F;c++){var x=g[c];if(x&&!x.match(/^[a-z0-9A-Z_-]{0,63}$/)){for(var S="",_=0,k=x.length;_<k;_++)x.charCodeAt(_)>127?S+="x":S+=x[_];if(!S.match(/^[a-z0-9A-Z_-]{0,63}$/)){var D=g.slice(0,c),$=g.slice(c+1),B=x.match(/^([a-z0-9A-Z_-]{0,63})(.*)$/);B&&(D.push(B[1]),$.unshift(B[2])),$.length&&(n="/"+$.join(".")+n),this.hostname=D.join(".");break}}}if(this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),!m){for(var L=this.hostname.split("."),T=[],c=0;c<L.length;++c){var R=L[c];T.push(R.match(/[^A-Za-z0-9_-]/)?"xn--"+u.encode(R):R)}this.hostname=T.join(".")}var P=this.port?":"+this.port:"",M=this.hostname||"";this.host=M+P,this.href+=this.host,m&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==n[0]&&(n="/"+n))}if(!b[o])for(var c=0,F=v.length;c<F;c++){var O=v[c],I=encodeURIComponent(O);I===O&&(I=escape(O)),n=n.split(O).join(I)}var N=n.indexOf("#");-1!==N&&(this.hash=n.substr(N),n=n.slice(0,N));var j=n.indexOf("?");if(-1!==j?(this.search=n.substr(j),this.query=n.substr(j+1),t&&(this.query=A.parse(this.query)),n=n.slice(0,j)):t&&(this.search="",this.query={}),n&&(this.pathname=n),E[o]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var P=this.pathname||"",R=this.search||"";this.path=P+R}return this.href=this.format(),this},n.prototype.format=function(){var e=this.auth||"";e&&(e=encodeURIComponent(e),e=e.replace(/%3A/i,":"),e+="@");var t=this.protocol||"",i=this.pathname||"",n=this.hash||"",r=!1,o="";this.host?r=e+this.host:this.hostname&&(r=e+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(r+=":"+this.port)),this.query&&c(this.query)&&Object.keys(this.query).length&&(o=A.stringify(this.query));var s=this.search||o&&"?"+o||"";return t&&":"!==t.substr(-1)&&(t+=":"),this.slashes||(!t||E[t])&&!1!==r?(r="//"+(r||""),i&&"/"!==i.charAt(0)&&(i="/"+i)):r||(r=""),n&&"#"!==n.charAt(0)&&(n="#"+n),s&&"?"!==s.charAt(0)&&(s="?"+s),i=i.replace(/[?#]/g,function(e){return encodeURIComponent(e)}),s=s.replace("#","%23"),t+r+i+s+n},n.prototype.resolve=function(e){return this.resolveObject(r(e,!1,!0)).format()},n.prototype.resolveObject=function(e){if(l(e)){var t=new n;t.parse(e,!1,!0),e=t}var i=new n;if(Object.keys(this).forEach(function(e){i[e]=this[e]},this),i.hash=e.hash,""===e.href)return i.href=i.format(),i;if(e.slashes&&!e.protocol)return Object.keys(e).forEach(function(t){"protocol"!==t&&(i[t]=e[t])}),E[i.protocol]&&i.hostname&&!i.pathname&&(i.path=i.pathname="/"),i.href=i.format(),i;if(e.protocol&&e.protocol!==i.protocol){if(!E[e.protocol])return Object.keys(e).forEach(function(t){i[t]=e[t]}),i.href=i.format(),i;if(i.protocol=e.protocol,e.host||C[e.protocol])i.pathname=e.pathname;else{for(var r=(e.pathname||"").split("/");r.length&&!(e.host=r.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),""!==r[0]&&r.unshift(""),r.length<2&&r.unshift(""),i.pathname=r.join("/")}if(i.search=e.search,i.query=e.query,i.host=e.host||"",i.auth=e.auth,i.hostname=e.hostname||e.host,i.port=e.port,i.pathname||i.search){var o=i.pathname||"",s=i.search||"";i.path=o+s}return i.slashes=i.slashes||e.slashes,i.href=i.format(),i}var a=i.pathname&&"/"===i.pathname.charAt(0),c=e.host||e.pathname&&"/"===e.pathname.charAt(0),u=c||a||i.host&&e.pathname,p=u,f=i.pathname&&i.pathname.split("/")||[],r=e.pathname&&e.pathname.split("/")||[],m=i.protocol&&!E[i.protocol];if(m&&(i.hostname="",i.port=null,i.host&&(""===f[0]?f[0]=i.host:f.unshift(i.host)),i.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(""===r[0]?r[0]=e.host:r.unshift(e.host)),e.host=null),u=u&&(""===r[0]||""===f[0])),c)i.host=e.host||""===e.host?e.host:i.host,i.hostname=e.hostname||""===e.hostname?e.hostname:i.hostname,i.search=e.search,i.query=e.query,f=r;else if(r.length)f||(f=[]),f.pop(),f=f.concat(r),i.search=e.search,i.query=e.query;else if(!d(e.search)){if(m){i.hostname=i.host=f.shift();var g=!!(i.host&&i.host.indexOf("@")>0)&&i.host.split("@");g&&(i.auth=g.shift(),i.host=i.hostname=g.shift())}return i.search=e.search,i.query=e.query,h(i.pathname)&&h(i.search)||(i.path=(i.pathname?i.pathname:"")+(i.search?i.search:"")),i.href=i.format(),i}if(!f.length)return i.pathname=null,i.search?i.path="/"+i.search:i.path=null,i.href=i.format(),i;for(var v=f.slice(-1)[0],y=(i.host||e.host)&&("."===v||".."===v)||""===v,w=0,b=f.length;b>=0;b--)v=f[b],"."==v?f.splice(b,1):".."===v?(f.splice(b,1),w++):w&&(f.splice(b,1),w--);if(!u&&!p)for(;w--;w)f.unshift("..");!u||""===f[0]||f[0]&&"/"===f[0].charAt(0)||f.unshift(""),y&&"/"!==f.join("/").substr(-1)&&f.push("");var A=""===f[0]||f[0]&&"/"===f[0].charAt(0);if(m){i.hostname=i.host=A?"":f.length?f.shift():"";var g=!!(i.host&&i.host.indexOf("@")>0)&&i.host.split("@");g&&(i.auth=g.shift(),i.host=i.hostname=g.shift())}return u=u||i.host&&f.length,u&&!A&&f.unshift(""),f.length?i.pathname=f.join("/"):(i.pathname=null,i.path=null),h(i.pathname)&&h(i.search)||(i.path=(i.pathname?i.pathname:"")+(i.search?i.search:"")),i.auth=e.auth||i.auth,i.slashes=i.slashes||e.slashes,i.href=i.format(),i},n.prototype.parseHost=function(){var e=this.host,t=f.exec(e);t&&(t=t[0],":"!==t&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},function(e,t,i){var n;(function(e,r){!function(o){function s(e){throw RangeError(L[e])}function a(e,t){for(var i=e.length,n=[];i--;)n[i]=t(e[i]);return n}function l(e,t){var i=e.split("@"),n="";return i.length>1&&(n=i[0]+"@",e=i[1]),e=e.replace(B,"."),n+a(e.split("."),t).join(".")}function c(e){for(var t,i,n=[],r=0,o=e.length;r<o;)t=e.charCodeAt(r++),t>=55296&&t<=56319&&r<o?(i=e.charCodeAt(r++),56320==(64512&i)?n.push(((1023&t)<<10)+(1023&i)+65536):(n.push(t),r--)):n.push(t);return n}function h(e){return a(e,function(e){var t="";return e>65535&&(e-=65536,t+=P(e>>>10&1023|55296),e=56320|1023&e),t+=P(e)}).join("")}function d(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:C}function u(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function p(e,t,i){var n=0;for(e=i?R(e/x):e>>1,e+=R(e/t);e>T*A>>1;n+=C)e=R(e/T);return R(n+(T+1)*e/(e+F))}function f(e){var t,i,n,r,o,a,l,c,u,f,m=[],g=e.length,v=0,y=_,w=S;for(i=e.lastIndexOf(k),i<0&&(i=0),n=0;n<i;++n)e.charCodeAt(n)>=128&&s("not-basic"),m.push(e.charCodeAt(n));for(r=i>0?i+1:0;r<g;){for(o=v,a=1,l=C;r>=g&&s("invalid-input"),c=d(e.charCodeAt(r++)),(c>=C||c>R((b-v)/a))&&s("overflow"),v+=c*a,u=l<=w?E:l>=w+A?A:l-w,!(c<u);l+=C)f=C-u,a>R(b/f)&&s("overflow"),a*=f;t=m.length+1,w=p(v-o,t,0==o),R(v/t)>b-y&&s("overflow"),y+=R(v/t),v%=t,m.splice(v++,0,y)}return h(m)}function m(e){var t,i,n,r,o,a,l,h,d,f,m,g,v,y,w,F=[];for(e=c(e),g=e.length,t=_,i=0,o=S,a=0;a<g;++a)(m=e[a])<128&&F.push(P(m));for(n=r=F.length,r&&F.push(k);n<g;){for(l=b,a=0;a<g;++a)(m=e[a])>=t&&m<l&&(l=m);for(v=n+1,l-t>R((b-i)/v)&&s("overflow"),i+=(l-t)*v,t=l,a=0;a<g;++a)if(m=e[a],m<t&&++i>b&&s("overflow"),m==t){for(h=i,d=C;f=d<=o?E:d>=o+A?A:d-o,!(h<f);d+=C)w=h-f,y=C-f,F.push(P(u(f+w%y,0))),h=R(w/y);F.push(P(u(h,0))),o=p(i,v,n==r),i=0,++n}++i,++t}return F.join("")}function g(e){return l(e,function(e){return D.test(e)?f(e.slice(4).toLowerCase()):e})}function v(e){return l(e,function(e){return $.test(e)?"xn--"+m(e):e})}var y=("object"==typeof t&&t&&t.nodeType,"object"==typeof e&&e&&e.nodeType,"object"==typeof r&&r);var w,b=2147483647,C=36,E=1,A=26,F=38,x=700,S=72,_=128,k="-",D=/^xn--/,$=/[^\x20-\x7E]/,B=/[\x2E\u3002\uFF0E\uFF61]/g,L={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},T=C-E,R=Math.floor,P=String.fromCharCode;w={version:"1.3.2",ucs2:{decode:c,encode:h},decode:f,encode:m,toASCII:v,toUnicode:g},void 0!==(n=function(){return w}.call(t,i,t,e))&&(e.exports=n)}()}).call(t,i(6)(e),function(){return this}())},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children=[],e.webpackPolyfill=1),e}},function(e,t,i){"use strict";t.decode=t.parse=i(8),t.encode=t.stringify=i(9)},function(e,t){"use strict";function i(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.exports=function(e,t,n,r){t=t||"&",n=n||"=";var o={};if("string"!=typeof e||0===e.length)return o;e=e.split(t);var s=1e3;r&&"number"==typeof r.maxKeys&&(s=r.maxKeys);var a=e.length;s>0&&a>s&&(a=s);for(var l=0;l<a;++l){var c,h,d,u,p=e[l].replace(/\+/g,"%20"),f=p.indexOf(n);f>=0?(c=p.substr(0,f),h=p.substr(f+1)):(c=p,h=""),d=decodeURIComponent(c),u=decodeURIComponent(h),i(o,d)?Array.isArray(o[d])?o[d].push(u):o[d]=[o[d],u]:o[d]=u}return o}},function(e,t){"use strict";var i=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};e.exports=function(e,t,n,r){return t=t||"&",n=n||"=",null===e&&(e=void 0),"object"==typeof e?Object.keys(e).map(function(r){var o=encodeURIComponent(i(r))+n;return Array.isArray(e[r])?e[r].map(function(e){return o+encodeURIComponent(i(e))}).join(t):o+encodeURIComponent(i(e[r]))}).join(t):r?encodeURIComponent(i(r))+n+encodeURIComponent(i(e)):""}},function(e,t){"use strict";var i=Array.isArray,n=Object.keys,r=Object.prototype.hasOwnProperty;e.exports=function e(t,o){if(t===o)return!0;var s,a,l,c=i(t),h=i(o);if(c&&h){if((a=t.length)!=o.length)return!1;for(s=0;s<a;s++)if(!e(t[s],o[s]))return!1;return!0}if(c!=h)return!1;var d=t instanceof Date,u=o instanceof Date;if(d!=u)return!1;if(d&&u)return t.getTime()==o.getTime();var p=t instanceof RegExp,f=o instanceof RegExp;if(p!=f)return!1;if(p&&f)return t.toString()==o.toString();if(t instanceof Object&&o instanceof Object){var m=n(t);if((a=m.length)!==n(o).length)return!1;for(s=0;s<a;s++)if(!r.call(o,m[s]))return!1;for(s=0;s<a;s++)if(l=m[s],!e(t[l],o[l]))return!1;return!0}return!1}},function(e,t,i){"use strict";function n(e,t){t=t||{};for(var i in e)t[i]=e[i];return t}function r(e,t,i){var n=i?" !== ":" === ",r=i?" || ":" && ",o=i?"!":"",s=i?"":"!";switch(e){case"null":return t+n+"null";case"array":return o+"Array.isArray("+t+")";case"object":return"("+o+t+r+"typeof "+t+n+'"object"'+r+s+"Array.isArray("+t+"))";case"integer":return"(typeof "+t+n+'"number"'+r+s+"("+t+" % 1)"+r+t+n+t+")";default:return"typeof "+t+n+'"'+e+'"'}}function o(e,t){switch(e.length){case 1:return r(e[0],t,!0);default:var i="",n=a(e);n.array&&n.object&&(i=n.null?"(":"(!"+t+" || ",i+="typeof "+t+' !== "object")',delete n.null,delete n.array,delete n.object),n.number&&delete n.integer;for(var o in n)i+=(i?" && ":"")+r(o,t,!0);return i}}function s(e,t){if(Array.isArray(t)){for(var i=[],n=0;n<t.length;n++){var r=t[n];x[r]?i[i.length]=r:"array"===e&&"array"===r&&(i[i.length]=r)}if(i.length)return i}else{if(x[t])return[t];if("array"===e&&"array"===t)return["array"]}}function a(e){for(var t={},i=0;i<e.length;i++)t[e[i]]=!0;return t}function l(e){return"number"==typeof e?"["+e+"]":S.test(e)?"."+e:"['"+c(e)+"']"}function c(e){return e.replace(_,"\\$&").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\f/g,"\\f").replace(/\t/g,"\\t")}function h(e,t){t+="[^0-9]";var i=e.match(new RegExp(t,"g"));return i?i.length:0}function d(e,t,i){return t+="([^0-9])",i=i.replace(/\$/g,"$$$$"),e.replace(new RegExp(t,"g"),i+"$1")}function u(e){return e.replace(k,"").replace(D,"").replace($,"if (!($1))")}function p(e,t){var i=e.match(B);return i&&2==i.length&&(e=t?e.replace(T,"").replace(M,O):e.replace(L,"").replace(R,P)),i=e.match(I),i&&3===i.length?e.replace(N,""):e}function f(e,t){if("boolean"==typeof e)return!e;for(var i in e)if(t[i])return!0}function m(e,t,i){if("boolean"==typeof e)return!e&&"not"!=i;for(var n in e)if(n!=i&&t[n])return!0}function g(e){return"'"+c(e)+"'"}function v(e,t,i,n){return b(e,i?"'/' + "+t+(n?"":".replace(/~/g, '~0').replace(/\\//g, '~1')"):n?"'[' + "+t+" + ']'":"'[\\'' + "+t+" + '\\']'")}function y(e,t,i){return b(e,g(i?"/"+A(t):l(t)))}function w(e,t,i){var n,r,o,s;if(""===e)return"rootData";if("/"==e[0]){if(!j.test(e))throw new Error("Invalid JSON-pointer: "+e);r=e,o="rootData"}else{if(!(s=e.match(H)))throw new Error("Invalid JSON-pointer: "+e);if(n=+s[1],"#"==(r=s[2])){if(n>=t)throw new Error("Cannot access property/index "+n+" levels up, current level is "+t);return i[t-n]}if(n>t)throw new Error("Cannot access data "+n+" levels up, current level is "+t);if(o="data"+(t-n||""),!r)return o}for(var a=o,c=r.split("/"),h=0;h<c.length;h++){var d=c[h];d&&(o+=l(F(d)),a+=" && "+o)}return a}function b(e,t){return'""'==e?t:(e+" + "+t).replace(/' \+ '/g,"")}function C(e){return F(decodeURIComponent(e))}function E(e){return encodeURIComponent(A(e))}function A(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function F(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}e.exports={copy:n,checkDataType:r,checkDataTypes:o,coerceToTypes:s,toHash:a,getProperty:l,escapeQuotes:c,equal:i(10),ucs2length:i(12),varOccurences:h,varReplace:d,cleanUpCode:u,finalCleanUpCode:p,schemaHasRules:f,schemaHasRulesExcept:m,toQuotedString:g,getPathExpr:v,getPath:y,getData:w,unescapeFragment:C,unescapeJsonPointer:F,escapeFragment:E,escapeJsonPointer:A};var x=a(["string","number","integer","boolean","null"]),S=/^[a-z$_][a-z$_0-9]*$/i,_=/'|\\/g,k=/else\s*{\s*}/g,D=/if\s*\([^)]+\)\s*\{\s*\}(?!\s*else)/g,$=/if\s*\(([^)]+)\)\s*\{\s*\}\s*else(?!\s*if)/g,B=/[^v.]errors/g,L=/var errors = 0;|var vErrors = null;|validate.errors = vErrors;/g,T=/var errors = 0;|var vErrors = null;/g,R="return errors === 0;",P="validate.errors = null; return true;",M=/if \(errors === 0\) return data;\s*else throw new ValidationError\(vErrors\);/,O="return data;",I=/[^A-Za-z_$]rootData[^A-Za-z0-9_$]/g,N=/if \(rootData === undefined\) rootData = data;/,j=/^\/(?:[^~]|~0|~1)*$/,H=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/},function(e,t){"use strict";e.exports=function(e){for(var t,i=0,n=e.length,r=0;r<n;)i++,(t=e.charCodeAt(r++))>=55296&&t<=56319&&r<n&&56320==(64512&(t=e.charCodeAt(r)))&&r++;return i}},function(e,t,i){"use strict";function n(e){r.copy(e,this)}var r=i(11);e.exports=n},function(e,t){"use strict";function i(e,t,o,s,a,l,c,h,d){if(o&&"object"==typeof o&&!Array.isArray(o)){t(o,s,a,l,c,h,d);for(var u in o){var p=o[u];if(Array.isArray(p)){if(u in r.arrayKeywords)for(var f=0;f<p.length;f++)i(e,t,p[f],s+"/"+u+"/"+f,a,s,u,o,f)}else if(u in r.propsKeywords){if(p&&"object"==typeof p)for(var m in p)i(e,t,p[m],s+"/"+u+"/"+n(m),a,s,u,o,m)}else(u in r.keywords||e.allKeys&&!(u in r.skipKeywords))&&i(e,t,p,s+"/"+u,a,s,u,o)}}}function n(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}var r=e.exports=function(e,t,n){"function"==typeof t&&(n=t,t={}),i(t,n,e,"",e)};r.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0},r.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},r.propsKeywords={definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},r.skipKeywords={enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0}},function(e,t,i){"use strict";function n(e){this.message="validation failed",this.errors=e,this.ajv=this.validation=!0}function r(e,t,i){this.message=i||r.message(e,t),this.missingRef=s.url(e,t),this.missingSchema=s.normalizeId(s.fullPath(this.missingRef))}function o(e){return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e}var s=i(3);e.exports={Validation:o(n),MissingRef:o(r)},r.message=function(e,t){return"can't resolve reference "+t+" from id "+e}},function(e,t){"use strict";e.exports=function(e,t){t||(t={}),"function"==typeof t&&(t={cmp:t});var i="boolean"==typeof t.cycles&&t.cycles,n=t.cmp&&function(e){return function(t){return function(i,n){var r={key:i,value:t[i]},o={key:n,value:t[n]};return e(r,o)}}}(t.cmp),r=[];return function e(t){if(t&&t.toJSON&&"function"==typeof t.toJSON&&(t=t.toJSON()),void 0!==t){if("number"==typeof t)return isFinite(t)?""+t:"null";if("object"!=typeof t)return JSON.stringify(t);var o,s;if(Array.isArray(t)){for(s="[",o=0;o<t.length;o++)o&&(s+=","),s+=e(t[o])||"null";return s+"]"}if(null===t)return"null";if(-1!==r.indexOf(t)){if(i)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var a=r.push(t)-1,l=Object.keys(t).sort(n&&n(t));for(s="",o=0;o<l.length;o++){var c=l[o],h=e(t[c]);h&&(s&&(s+=","),s+=JSON.stringify(c)+":"+h)}return r.splice(a,1),"{"+s+"}"}}(e)}},function(e,t){"use strict";e.exports=function(e,t,i){function n(e){for(var t=e.rules,i=0;i<t.length;i++)if(r(t[i]))return!0}function r(t){return void 0!==e.schema[t.keyword]||t.implements&&o(t)}function o(t){for(var i=t.implements,n=0;n<i.length;n++)if(void 0!==e.schema[i[n]])return!0}var s="",a=!0===e.schema.$async,l=e.util.schemaHasRulesExcept(e.schema,e.RULES.all,"$ref"),c=e.self._getId(e.schema);if(e.isTop){if(a){e.async=!0;var h="es7"==e.opts.async;e.yieldAwait=h?"await":"yield"}s+=" var validate = ",a?h?s+=" (async function ":("*"!=e.opts.async&&(s+="co.wrap"),s+="(function* "):s+=" (function ",s+=" (data, dataPath, parentData, parentDataProperty, rootData) { 'use strict'; ",c&&(e.opts.sourceCode||e.opts.processCode)&&(s+=" /*# sourceURL="+c+" */ ")}if("boolean"==typeof e.schema||!l&&!e.schema.$ref){var d,u=e.level,p=e.dataLevel,f=e.schema["false schema"],m=e.schemaPath+e.util.getProperty("false schema"),g=e.errSchemaPath+"/false schema",v=!e.opts.allErrors,y="data"+(p||""),w="valid"+u;if(!1===e.schema){e.isTop?v=!0:s+=" var "+w+" = false; ";var b=b||[];b.push(s),s="",!1!==e.createErrors?(s+=" { keyword: '"+(d||"false schema")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(g)+" , params: {} ",!1!==e.opts.messages&&(s+=" , message: 'boolean schema is false' "),e.opts.verbose&&(s+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+y+" "),s+=" } "):s+=" {} ";var C=s;s=b.pop(),!e.compositeRule&&v?e.async?s+=" throw new ValidationError(["+C+"]); ":s+=" validate.errors = ["+C+"]; return false; ":s+=" var err = "+C+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}else e.isTop?s+=a?" return data; ":" validate.errors = null; return true; ":s+=" var "+w+" = true; ";return e.isTop&&(s+=" }); return validate; "),s}if(e.isTop){var E=e.isTop,u=e.level=0,p=e.dataLevel=0,y="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],s+=" var vErrors = null; ",s+=" var errors = 0; ",s+=" if (rootData === undefined) rootData = data; "}else{var u=e.level,p=e.dataLevel,y="data"+(p||"");if(c&&(e.baseId=e.resolve.url(e.baseId,c)),a&&!e.async)throw new Error("async schema in sync schema");s+=" var errs_"+u+" = errors;"}var d,w="valid"+u,v=!e.opts.allErrors,A="",F="",x=e.schema.type,S=Array.isArray(x);if(S&&1==x.length&&(x=x[0],S=!1),e.schema.$ref&&l){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&&(l=!1,e.logger.warn('$ref: keywords ignored in schema at path "'+e.errSchemaPath+'"'))}if(x){if(e.opts.coerceTypes)var _=e.util.coerceToTypes(e.opts.coerceTypes,x);var k=e.RULES.types[x];if(_||S||!0===k||k&&!n(k)){var m=e.schemaPath+".type",g=e.errSchemaPath+"/type",m=e.schemaPath+".type",g=e.errSchemaPath+"/type",D=S?"checkDataTypes":"checkDataType";if(s+=" if ("+e.util[D](x,y,!0)+") { ",_){var $="dataType"+u,B="coerced"+u;s+=" var "+$+" = typeof "+y+"; ","array"==e.opts.coerceTypes&&(s+=" if ("+$+" == 'object' && Array.isArray("+y+")) "+$+" = 'array'; "),s+=" var "+B+" = undefined; ";var L="",T=_;if(T)for(var R,P=-1,M=T.length-1;P<M;)R=T[P+=1],P&&(s+=" if ("+B+" === undefined) { ",L+="}"),"array"==e.opts.coerceTypes&&"array"!=R&&(s+=" if ("+$+" == 'array' && "+y+".length == 1) { "+B+" = "+y+" = "+y+"[0]; "+$+" = typeof "+y+"; } "),"string"==R?s+=" if ("+$+" == 'number' || "+$+" == 'boolean') "+B+" = '' + "+y+"; else if ("+y+" === null) "+B+" = ''; ":"number"==R||"integer"==R?(s+=" if ("+$+" == 'boolean' || "+y+" === null || ("+$+" == 'string' && "+y+" && "+y+" == +"+y+" ","integer"==R&&(s+=" && !("+y+" % 1)"),s+=")) "+B+" = +"+y+"; "):"boolean"==R?s+=" if ("+y+" === 'false' || "+y+" === 0 || "+y+" === null) "+B+" = false; else if ("+y+" === 'true' || "+y+" === 1) "+B+" = true; ":"null"==R?s+=" if ("+y+" === '' || "+y+" === 0 || "+y+" === false) "+B+" = null; ":"array"==e.opts.coerceTypes&&"array"==R&&(s+=" if ("+$+" == 'string' || "+$+" == 'number' || "+$+" == 'boolean' || "+y+" == null) "+B+" = ["+y+"]; ");s+=" "+L+" if ("+B+" === undefined) { ";var b=b||[];b.push(s),s="",!1!==e.createErrors?(s+=" { keyword: '"+(d||"type")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(g)+" , params: { type: '",s+=S?""+x.join(","):""+x,s+="' } ",!1!==e.opts.messages&&(s+=" , message: 'should be ",s+=S?""+x.join(","):""+x,s+="' "),e.opts.verbose&&(s+=" , schema: validate.schema"+m+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+y+" "),s+=" } "):s+=" {} ";var C=s;s=b.pop(),!e.compositeRule&&v?e.async?s+=" throw new ValidationError(["+C+"]); ":s+=" validate.errors = ["+C+"]; return false; ":s+=" var err = "+C+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+=" } else { ";var O=p?"data"+(p-1||""):"parentData",I=p?e.dataPathArr[p]:"parentDataProperty";s+=" "+y+" = "+B+"; ",p||(s+="if ("+O+" !== undefined)"),s+=" "+O+"["+I+"] = "+B+"; } "}else{var b=b||[];b.push(s),s="",!1!==e.createErrors?(s+=" { keyword: '"+(d||"type")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(g)+" , params: { type: '",s+=S?""+x.join(","):""+x,s+="' } ",!1!==e.opts.messages&&(s+=" , message: 'should be ",s+=S?""+x.join(","):""+x,s+="' "),e.opts.verbose&&(s+=" , schema: validate.schema"+m+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+y+" "),s+=" } "):s+=" {} ";var C=s;s=b.pop(),!e.compositeRule&&v?e.async?s+=" throw new ValidationError(["+C+"]); ":s+=" validate.errors = ["+C+"]; return false; ":s+=" var err = "+C+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}s+=" } "}}if(e.schema.$ref&&!l)s+=" "+e.RULES.all.$ref.code(e,"$ref")+" ",v&&(s+=" } if (errors === ",s+=E?"0":"errs_"+u,s+=") { ",F+="}");else{e.opts.v5&&e.schema.patternGroups&&e.logger.warn('keyword "patternGroups" is deprecated and disabled. Use option patternGroups: true to enable.');var N=e.RULES;if(N)for(var k,j=-1,H=N.length-1;j<H;)if(k=N[j+=1],n(k)){if(k.type&&(s+=" if ("+e.util.checkDataType(k.type,y)+") { "),e.opts.useDefaults&&!e.compositeRule)if("object"==k.type&&e.schema.properties){var f=e.schema.properties,V=Object.keys(f),W=V;if(W)for(var z,U=-1,K=W.length-1;U<K;){z=W[U+=1];var q=f[z];if(void 0!==q.default){var G=y+e.util.getProperty(z);s+=" if ("+G+" === undefined) "+G+" = ","shared"==e.opts.useDefaults?s+=" "+e.useDefault(q.default)+" ":s+=" "+JSON.stringify(q.default)+" ",s+="; "}}}else if("array"==k.type&&Array.isArray(e.schema.items)){var Q=e.schema.items;if(Q)for(var q,P=-1,J=Q.length-1;P<J;)if(q=Q[P+=1],void 0!==q.default){var G=y+"["+P+"]";s+=" if ("+G+" === undefined) "+G+" = ","shared"==e.opts.useDefaults?s+=" "+e.useDefault(q.default)+" ":s+=" "+JSON.stringify(q.default)+" ",s+="; "}}var Y=k.rules;if(Y)for(var X,Z=-1,ee=Y.length-1;Z<ee;)if(X=Y[Z+=1],r(X)){var te=X.code(e,X.keyword,k.type);te&&(s+=" "+te+" ",v&&(A+="}"))}if(v&&(s+=" "+A+" ",A=""),k.type&&(s+=" } ",x&&x===k.type&&!_)){s+=" else { ";var m=e.schemaPath+".type",g=e.errSchemaPath+"/type",b=b||[];b.push(s),s="",!1!==e.createErrors?(s+=" { keyword: '"+(d||"type")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(g)+" , params: { type: '",s+=S?""+x.join(","):""+x,s+="' } ",!1!==e.opts.messages&&(s+=" , message: 'should be ",s+=S?""+x.join(","):""+x,s+="' "),e.opts.verbose&&(s+=" , schema: validate.schema"+m+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+y+" "),s+=" } "):s+=" {} ";var C=s;s=b.pop(),!e.compositeRule&&v?e.async?s+=" throw new ValidationError(["+C+"]); ":s+=" validate.errors = ["+C+"]; return false; ":s+=" var err = "+C+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+=" } "}v&&(s+=" if (errors === ",s+=E?"0":"errs_"+u,s+=") { ",F+="}")}}return v&&(s+=" "+F+" "),E?(a?(s+=" if (errors === 0) return data; ",s+=" else throw new ValidationError(vErrors); "):(s+=" validate.errors = vErrors; ",s+=" return errors === 0; "),s+=" }); return validate;"):s+=" var "+w+" = errors === errs_"+u+";",s=e.util.cleanUpCode(s),E&&(s=e.util.finalCleanUpCode(s,a)),s}},function(e,t){function i(e){var t=this,i=d.call(arguments,1);return new Promise(function(r,o){function s(t){var i;try{i=e.next(t)}catch(e){return o(e)}c(i)}function l(t){var i;try{i=e.throw(t)}catch(e){return o(e)}c(i)}function c(e){if(e.done)return r(e.value);var i=n.call(t,e.value);return i&&a(i)?i.then(s,l):l(new TypeError('You may only yield a function, promise, generator, array, or object, but the following object was passed: "'+String(e.value)+'"'))}if("function"==typeof e&&(e=e.apply(t,i)),!e||"function"!=typeof e.next)return r(e);s()})}function n(e){return e?a(e)?e:c(e)||l(e)?i.call(this,e):"function"==typeof e?r.call(this,e):Array.isArray(e)?o.call(this,e):h(e)?s.call(this,e):e:e}function r(e){var t=this;return new Promise(function(i,n){e.call(t,function(e,t){if(e)return n(e);arguments.length>2&&(t=d.call(arguments,1)),i(t)})})}function o(e){return Promise.all(e.map(n,this))}function s(e){for(var t=new e.constructor,i=Object.keys(e),r=[],o=0;o<i.length;o++){var s=i[o],l=n.call(this,e[s]);l&&a(l)?function(e,i){t[i]=void 0,r.push(e.then(function(e){t[i]=e}))}(l,s):t[s]=e[s]}return Promise.all(r).then(function(){return t})}function a(e){return"function"==typeof e.then}function l(e){return"function"==typeof e.next&&"function"==typeof e.throw}function c(e){var t=e.constructor;return!!t&&("GeneratorFunction"===t.name||"GeneratorFunction"===t.displayName||l(t.prototype))}function h(e){return Object==e.constructor}var d=Array.prototype.slice;e.exports=i.default=i.co=i,i.wrap=function(e){function t(){return i.call(this,e.apply(this,arguments))}return t.__generatorFunction__=e,t}},function(e,t){"use strict";var i=e.exports=function(){this._cache={}};i.prototype.put=function(e,t){this._cache[e]=t},i.prototype.get=function(e){return this._cache[e]},i.prototype.del=function(e){delete this._cache[e]},i.prototype.clear=function(){this._cache={}}},function(e,t,i){"use strict";function n(e){return e="full"==e?"full":"fast",h.copy(n[e])}function r(e){var t=e.match(d);if(!t)return!1;var i=+t[1],n=+t[2];return i>=1&&i<=12&&n>=1&&n<=u[i]}function o(e,t){var i=e.match(p);if(!i)return!1;var n=i[1],r=i[2],o=i[3],s=i[5];return n<=23&&r<=59&&o<=59&&(!t||s)}function s(e){var t=e.split(b);return 2==t.length&&r(t[0])&&o(t[1],!0)}function a(e){return e.length<=255&&f.test(e)}function l(e){return C.test(e)&&m.test(e)}function c(e){if(E.test(e))return!1;try{return new RegExp(e),!0}catch(e){return!1}}var h=i(11),d=/^\d\d\d\d-(\d\d)-(\d\d)$/,u=[0,31,29,31,30,31,30,31,31,30,31,30,31],p=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d:\d\d)?$/i,f=/^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*$/i,m=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@\/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@\/?]|%[0-9a-f]{2})*)?$/i,g=/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#.\/;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,v=/^(?: