UNPKG

ember-z-schema

Version:
3 lines 44.4 kB
!function(a){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=a();else if("function"==typeof define&&define.amd)define([],a);else{var b;b="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,b.ZSchema=a()}}(function(){return function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g<d.length;g++)e(d[g]);return e}({1:[function(a,b,c){function d(){throw new Error("setTimeout has not been defined")}function e(){throw new Error("clearTimeout has not been defined")}function f(a){if(l===setTimeout)return setTimeout(a,0);if((l===d||!l)&&setTimeout)return l=setTimeout,setTimeout(a,0);try{return l(a,0)}catch(b){try{return l.call(null,a,0)}catch(b){return l.call(this,a,0)}}}function g(a){if(m===clearTimeout)return clearTimeout(a);if((m===e||!m)&&clearTimeout)return m=clearTimeout,clearTimeout(a);try{return m(a)}catch(b){try{return m.call(null,a)}catch(b){return m.call(this,a)}}}function h(){q&&o&&(q=!1,o.length?p=o.concat(p):r=-1,p.length&&i())}function i(){if(!q){var a=f(h);q=!0;for(var b=p.length;b;){for(o=p,p=[];++r<b;)o&&o[r].run();r=-1,b=p.length}o=null,q=!1,g(a)}}function j(a,b){this.fun=a,this.array=b}function k(){}var l,m,n=b.exports={};!function(){try{l="function"==typeof setTimeout?setTimeout:d}catch(a){l=d}try{m="function"==typeof clearTimeout?clearTimeout:e}catch(a){m=e}}();var o,p=[],q=!1,r=-1;n.nextTick=function(a){var b=new Array(arguments.length-1);if(arguments.length>1)for(var c=1;c<arguments.length;c++)b[c-1]=arguments[c];p.push(new j(a,b)),1!==p.length||q||f(i)},j.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=k,n.addListener=k,n.once=k,n.off=k,n.removeListener=k,n.removeAllListeners=k,n.emit=k,n.binding=function(a){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(a){throw new Error("process.chdir is not supported")},n.umask=function(){return 0}},{}],2:[function(a,b,c){"use strict";b.exports={INVALID_TYPE:"Expected type {0} but found type {1}",INVALID_FORMAT:"Object didn't pass validation for format {0}: {1}",ENUM_MISMATCH:"No enum match for: {0}",ANY_OF_MISSING:"Data does not match any schemas from 'anyOf'",ONE_OF_MISSING:"Data does not match any schemas from 'oneOf'",ONE_OF_MULTIPLE:"Data is valid against more than one schema from 'oneOf'",NOT_PASSED:"Data matches schema from 'not'",ARRAY_LENGTH_SHORT:"Array is too short ({0}), minimum {1}",ARRAY_LENGTH_LONG:"Array is too long ({0}), maximum {1}",ARRAY_UNIQUE:"Array items are not unique (indexes {0} and {1})",ARRAY_ADDITIONAL_ITEMS:"Additional items not allowed",MULTIPLE_OF:"Value {0} is not a multiple of {1}",MINIMUM:"Value {0} is less than minimum {1}",MINIMUM_EXCLUSIVE:"Value {0} is equal or less than exclusive minimum {1}",MAXIMUM:"Value {0} is greater than maximum {1}",MAXIMUM_EXCLUSIVE:"Value {0} is equal or greater than exclusive maximum {1}",OBJECT_PROPERTIES_MINIMUM:"Too few properties defined ({0}), minimum {1}",OBJECT_PROPERTIES_MAXIMUM:"Too many properties defined ({0}), maximum {1}",OBJECT_MISSING_REQUIRED_PROPERTY:"Missing required property: {0}",OBJECT_ADDITIONAL_PROPERTIES:"Additional properties not allowed: {0}",OBJECT_DEPENDENCY_KEY:"Dependency failed - key must exist: {0} (due to key: {1})",MIN_LENGTH:"String is too short ({0} chars), minimum {1}",MAX_LENGTH:"String is too long ({0} chars), maximum {1}",PATTERN:"String does not match pattern {0}: {1}",KEYWORD_TYPE_EXPECTED:"Keyword '{0}' is expected to be of type '{1}'",KEYWORD_UNDEFINED_STRICT:"Keyword '{0}' must be defined in strict mode",KEYWORD_UNEXPECTED:"Keyword '{0}' is not expected to appear in the schema",KEYWORD_MUST_BE:"Keyword '{0}' must be {1}",KEYWORD_DEPENDENCY:"Keyword '{0}' requires keyword '{1}'",KEYWORD_PATTERN:"Keyword '{0}' is not a valid RegExp pattern: {1}",KEYWORD_VALUE_TYPE:"Each element of keyword '{0}' array must be a '{1}'",UNKNOWN_FORMAT:"There is no validation function for format '{0}'",CUSTOM_MODE_FORCE_PROPERTIES:"{0} must define at least one property if present",REF_UNRESOLVED:"Reference has not been resolved during compilation: {0}",UNRESOLVABLE_REFERENCE:"Reference could not be resolved: {0}",SCHEMA_NOT_REACHABLE:"Validator was not able to read schema with uri: {0}",SCHEMA_TYPE_EXPECTED:"Schema is expected to be of type 'object'",SCHEMA_NOT_AN_OBJECT:"Schema is not an object: {0}",ASYNC_TIMEOUT:"{0} asynchronous task(s) have timed out after {1} ms",PARENT_SCHEMA_VALIDATION_FAILED:"Schema failed to validate against its parent schema, see inner errors for details.",REMOTE_NOT_VALID:"Remote reference didn't compile successfully: {0}"}},{}],3:[function(a,b,c){var d=window.validator,e={date:function(a){if("string"!=typeof a)return!0;var b=/^([0-9]{4})-([0-9]{2})-([0-9]{2})$/.exec(a);return null!==b&&!(b[2]<"01"||b[2]>"12"||b[3]<"01"||b[3]>"31")},"date-time":function(a){if("string"!=typeof a)return!0;var b=a.toLowerCase().split("t");if(!e.date(b[0]))return!1;var c=/^([0-9]{2}):([0-9]{2}):([0-9]{2})(.[0-9]+)?(z|([+-][0-9]{2}:[0-9]{2}))$/.exec(b[1]);return null!==c&&!(c[1]>"23"||c[2]>"59"||c[3]>"59")},email:function(a){return"string"!=typeof a||d.isEmail(a,{require_tld:!0})},hostname:function(a){if("string"!=typeof a)return!0;var b=/^[a-zA-Z](([-0-9a-zA-Z]+)?[0-9a-zA-Z])?(\.[a-zA-Z](([-0-9a-zA-Z]+)?[0-9a-zA-Z])?)*$/.test(a);if(b){if(a.length>255)return!1;for(var c=a.split("."),d=0;d<c.length;d++)if(c[d].length>63)return!1}return b},"host-name":function(a){return e.hostname.call(this,a)},ipv4:function(a){return"string"!=typeof a||d.isIP(a,4)},ipv6:function(a){return"string"!=typeof a||d.isIP(a,6)},regex:function(a){try{return RegExp(a),!0}catch(a){return!1}},uri:function(a){return this.options.strictUris?e["strict-uri"].apply(this,arguments):"string"!=typeof a||RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?").test(a)},"strict-uri":function(a){return"string"!=typeof a||d.isURL(a)}};b.exports=e},{}],4:[function(a,b,c){"use strict";var d=a("./FormatValidators"),e=a("./Report"),f=a("./Utils"),g={multipleOf:function(a,b,c){"number"==typeof c&&"integer"!==f.whatIs(c/b.multipleOf)&&a.addError("MULTIPLE_OF",[c,b.multipleOf],null,b.description)},maximum:function(a,b,c){"number"==typeof c&&(b.exclusiveMaximum!==!0?c>b.maximum&&a.addError("MAXIMUM",[c,b.maximum],null,b.description):c>=b.maximum&&a.addError("MAXIMUM_EXCLUSIVE",[c,b.maximum],null,b.description))},exclusiveMaximum:function(){},minimum:function(a,b,c){"number"==typeof c&&(b.exclusiveMinimum!==!0?c<b.minimum&&a.addError("MINIMUM",[c,b.minimum],null,b.description):c<=b.minimum&&a.addError("MINIMUM_EXCLUSIVE",[c,b.minimum],null,b.description))},exclusiveMinimum:function(){},maxLength:function(a,b,c){"string"==typeof c&&f.ucs2decode(c).length>b.maxLength&&a.addError("MAX_LENGTH",[c.length,b.maxLength],null,b.description)},minLength:function(a,b,c){"string"==typeof c&&f.ucs2decode(c).length<b.minLength&&a.addError("MIN_LENGTH",[c.length,b.minLength],null,b.description)},pattern:function(a,b,c){"string"==typeof c&&RegExp(b.pattern).test(c)===!1&&a.addError("PATTERN",[b.pattern,c],null,b.description)},additionalItems:function(a,b,c){Array.isArray(c)&&b.additionalItems===!1&&Array.isArray(b.items)&&c.length>b.items.length&&a.addError("ARRAY_ADDITIONAL_ITEMS",null,null,b.description)},items:function(){},maxItems:function(a,b,c){Array.isArray(c)&&c.length>b.maxItems&&a.addError("ARRAY_LENGTH_LONG",[c.length,b.maxItems],null,b.description)},minItems:function(a,b,c){Array.isArray(c)&&c.length<b.minItems&&a.addError("ARRAY_LENGTH_SHORT",[c.length,b.minItems],null,b.description)},uniqueItems:function(a,b,c){if(Array.isArray(c)&&b.uniqueItems===!0){var d=[];f.isUniqueArray(c,d)===!1&&a.addError("ARRAY_UNIQUE",d,null,b.description)}},maxProperties:function(a,b,c){if("object"===f.whatIs(c)){var d=Object.keys(c).length;d>b.maxProperties&&a.addError("OBJECT_PROPERTIES_MAXIMUM",[d,b.maxProperties],null,b.description)}},minProperties:function(a,b,c){if("object"===f.whatIs(c)){var d=Object.keys(c).length;d<b.minProperties&&a.addError("OBJECT_PROPERTIES_MINIMUM",[d,b.minProperties],null,b.description)}},required:function(a,b,c){if("object"===f.whatIs(c))for(var d=b.required.length;d--;){var e=b.required[d];void 0===c[e]&&a.addError("OBJECT_MISSING_REQUIRED_PROPERTY",[e],null,b.description)}},additionalProperties:function(a,b,c){if(void 0===b.properties&&void 0===b.patternProperties)return g.properties.call(this,a,b,c)},patternProperties:function(a,b,c){if(void 0===b.properties)return g.properties.call(this,a,b,c)},properties:function(a,b,c){if("object"===f.whatIs(c)){var d=void 0!==b.properties?b.properties:{},e=void 0!==b.patternProperties?b.patternProperties:{};if(b.additionalProperties===!1){var g=Object.keys(c),h=Object.keys(d),i=Object.keys(e);g=f.difference(g,h);for(var j=i.length;j--;)for(var k=RegExp(i[j]),l=g.length;l--;)k.test(g[l])===!0&&g.splice(l,1);if(g.length>0){var m=this.options.assumeAdditional.length;if(m)for(;m--;){var n=g.indexOf(this.options.assumeAdditional[m]);n!==-1&&g.splice(n,1)}g.length>0&&a.addError("OBJECT_ADDITIONAL_PROPERTIES",[g],null,b.description)}}}},dependencies:function(a,b,d){if("object"===f.whatIs(d))for(var e=Object.keys(b.dependencies),g=e.length;g--;){var h=e[g];if(d[h]){var i=b.dependencies[h];if("object"===f.whatIs(i))c.validate.call(this,a,i,d);else for(var j=i.length;j--;){var k=i[j];void 0===d[k]&&a.addError("OBJECT_DEPENDENCY_KEY",[k,h],null,b.description)}}}},enum:function(a,b,c){for(var d=!1,e=b.enum.length;e--;)if(f.areEqual(c,b.enum[e])){d=!0;break}d===!1&&a.addError("ENUM_MISMATCH",[c],null,b.description)},allOf:function(a,b,d){for(var e=b.allOf.length;e--;){var f=c.validate.call(this,a,b.allOf[e],d);if(this.options.breakOnFirstError&&f===!1)break}},anyOf:function(a,b,d){for(var f=[],g=!1,h=b.anyOf.length;h--&&g===!1;){var i=new e(a);f.push(i),g=c.validate.call(this,i,b.anyOf[h],d)}g===!1&&a.addError("ANY_OF_MISSING",void 0,f,b.description)},oneOf:function(a,b,d){for(var f=0,g=[],h=b.oneOf.length;h--;){var i=new e(a,{maxErrors:1});g.push(i),c.validate.call(this,i,b.oneOf[h],d)===!0&&f++}0===f?a.addError("ONE_OF_MISSING",void 0,g,b.description):f>1&&a.addError("ONE_OF_MULTIPLE",null,null,b.description)},not:function(a,b,d){var f=new e(a);c.validate.call(this,f,b.not,d)===!0&&a.addError("NOT_PASSED",null,null,b.description)},definitions:function(){},format:function(a,b,c){var e=d[b.format];"function"==typeof e?2===e.length?a.addAsyncTask(e,[c],function(d){d!==!0&&a.addError("INVALID_FORMAT",[b.format,c],null,b.description)}):e.call(this,c)!==!0&&a.addError("INVALID_FORMAT",[b.format,c],null,b.description):this.options.ignoreUnknownFormats!==!0&&a.addError("UNKNOWN_FORMAT",[b.format],null,b.description)}},h=function(a,b,d){var e=d.length;if(Array.isArray(b.items))for(;e--;)e<b.items.length?(a.path.push(e.toString()),c.validate.call(this,a,b.items[e],d[e]),a.path.pop()):"object"==typeof b.additionalItems&&(a.path.push(e.toString()),c.validate.call(this,a,b.additionalItems,d[e]),a.path.pop());else if("object"==typeof b.items)for(;e--;)a.path.push(e.toString()),c.validate.call(this,a,b.items,d[e]),a.path.pop()},i=function(a,b,d){var e=b.additionalProperties;e!==!0&&void 0!==e||(e={});for(var f=b.properties?Object.keys(b.properties):[],g=b.patternProperties?Object.keys(b.patternProperties):[],h=Object.keys(d),i=h.length;i--;){var j=h[i],k=d[j],l=[];f.indexOf(j)!==-1&&l.push(b.properties[j]);for(var m=g.length;m--;){var n=g[m];RegExp(n).test(j)===!0&&l.push(b.patternProperties[n])}for(0===l.length&&e!==!1&&l.push(e),m=l.length;m--;)a.path.push(j),c.validate.call(this,a,l[m],k),a.path.pop()}};c.validate=function(a,b,c){a.commonErrorMessage="JSON_OBJECT_VALIDATION_FAILED";var d=f.whatIs(b);if("object"!==d)return a.addError("SCHEMA_NOT_AN_OBJECT",[d],null,b.description),!1;var e=Object.keys(b);if(0===e.length)return!0;var j=!1;if(a.rootSchema||(a.rootSchema=b,j=!0),void 0!==b.$ref){for(var k=99;b.$ref&&k>0;){if(!b.__$refResolved){a.addError("REF_UNRESOLVED",[b.$ref],null,b.description);break}if(b.__$refResolved===b)break;b=b.__$refResolved,e=Object.keys(b),k--}if(0===k)throw new Error("Circular dependency by $ref references!")}var l=f.whatIs(c);if(b.type)if("string"==typeof b.type){if(l!==b.type&&("integer"!==l||"number"!==b.type)&&(a.addError("INVALID_TYPE",[b.type,l],null,b.description),this.options.breakOnFirstError))return!1}else if(b.type.indexOf(l)===-1&&("integer"!==l||b.type.indexOf("number")===-1)&&(a.addError("INVALID_TYPE",[b.type,l],null,b.description),this.options.breakOnFirstError))return!1;for(var m=e.length;m--&&!(g[e[m]]&&(g[e[m]].call(this,a,b,c),a.errors.length&&this.options.breakOnFirstError)););return 0!==a.errors.length&&this.options.breakOnFirstError!==!1||("array"===l?h.call(this,a,b,c):"object"===l&&i.call(this,a,b,c)),"function"==typeof this.options.customValidator&&this.options.customValidator(a,b,c),j&&(a.rootSchema=void 0),0===a.errors.length}},{"./FormatValidators":3,"./Report":6,"./Utils":10}],5:[function(a,b,c){"function"!=typeof Number.isFinite&&(Number.isFinite=function(a){return"number"==typeof a&&(a===a&&a!==1/0&&a!==-(1/0))})},{}],6:[function(a,b,c){(function(c){"use strict";function d(a,b){this.parentReport=a instanceof d?a:void 0,this.options=a instanceof d?a.options:a||{},this.reportOptions=b||{},this.errors=[],this.path=[],this.asyncTasks=[]}var e=_.get,f=a("./Errors"),g=a("./Utils");d.prototype.isValid=function(){if(this.asyncTasks.length>0)throw new Error("Async tasks pending, can't answer isValid");return 0===this.errors.length},d.prototype.addAsyncTask=function(a,b,c){this.asyncTasks.push([a,b,c])},d.prototype.processAsyncTasks=function(a,b){function d(){c.nextTick(function(){var a=0===i.errors.length;b(a?void 0:i.errors,a)})}var e=a||2e3,f=this.asyncTasks.length,g=f,h=!1,i=this;if(0===f||this.errors.length>0)return void d();for(;g--;){var j=this.asyncTasks[g];j[0].apply(null,j[1].concat(function(a){return function(b){h||(a(b),0==--f&&d())}}(j[2])))}setTimeout(function(){f>0&&(h=!0,i.addError("ASYNC_TIMEOUT",[f,e]),b(i.errors,!1))},e)},d.prototype.getPath=function(a){var b=[];return this.parentReport&&(b=b.concat(this.parentReport.path)),b=b.concat(this.path),a!==!0&&(b="#/"+b.map(function(a){return g.isAbsoluteUri(a)?"uri("+a+")":a.replace(/\~/g,"~0").replace(/\//g,"~1")}).join("/")),b},d.prototype.getSchemaId=function(){if(!this.rootSchema)return null;var a=[];for(this.parentReport&&(a=a.concat(this.parentReport.path)),a=a.concat(this.path);a.length>0;){var b=e(this.rootSchema,a);if(b&&b.id)return b.id;a.pop()}return this.rootSchema.id},d.prototype.hasError=function(a,b){for(var c=this.errors.length;c--;)if(this.errors[c].code===a){for(var d=!0,e=this.errors[c].params.length;e--;)this.errors[c].params[e]!==b[e]&&(d=!1);if(d)return d}return!1},d.prototype.addError=function(a,b,c,d){if(!a)throw new Error("No errorCode passed into addError()");this.addCustomError(a,f[a],b,c,d)},d.prototype.addCustomError=function(a,b,c,d,e){if(!(this.errors.length>=this.reportOptions.maxErrors)){if(!b)throw new Error("No errorMessage known for code "+a);c=c||[];for(var f=c.length;f--;){var h=g.whatIs(c[f]),i="object"===h||"null"===h?JSON.stringify(c[f]):c[f];b=b.replace("{"+f+"}",i)}var j={code:a,params:c,message:b,path:this.getPath(this.options.reportPathAsArray),schemaId:this.getSchemaId()};if(e&&(j.description=e),null!=d){for(Array.isArray(d)||(d=[d]),j.inner=[],f=d.length;f--;)for(var k=d[f],l=k.errors.length;l--;)j.inner.push(k.errors[l]);0===j.inner.length&&(j.inner=void 0)}this.errors.push(j)}},b.exports=d}).call(this,a("_process"))},{"./Errors":2,"./Utils":10,_process:1}],7:[function(a,b,c){"use strict";function d(a){return decodeURIComponent(a).replace(/~[0-1]/g,function(a){return"~1"===a?"/":"~"})}function e(a){var b=a.indexOf("#");return b===-1?a:a.slice(0,b)}function f(a){var b=a.indexOf("#");return b===-1?void 0:a.slice(b+1)}function g(a,b){if("object"==typeof a&&null!==a){if(!b)return a;if(a.id&&(a.id===b||"#"===a.id[0]&&a.id.substring(1)===b))return a;var c,d;if(Array.isArray(a)){for(c=a.length;c--;)if(d=g(a[c],b))return d}else{var e=Object.keys(a);for(c=e.length;c--;){var f=e[c];if(0!==f.indexOf("__$")&&(d=g(a[f],b)))return d}}}}var h=_.isEqual,i=a("./Report"),j=a("./SchemaCompilation"),k=a("./SchemaValidation"),l=a("./Utils");c.cacheSchemaByUri=function(a,b){var c=e(a);c&&(this.cache[c]=b)},c.removeFromCacheByUri=function(a){var b=e(a);b&&delete this.cache[b]},c.checkCacheForUri=function(a){var b=e(a);return!!b&&null!=this.cache[b]},c.getSchema=function(a,b){return"object"==typeof b&&(b=c.getSchemaByReference.call(this,a,b)),"string"==typeof b&&(b=c.getSchemaByUri.call(this,a,b)),b},c.getSchemaByReference=function(a,b){for(var c=this.referenceCache.length;c--;)if(h(this.referenceCache[c][0],b))return this.referenceCache[c][1];var d=l.cloneDeep(b);return this.referenceCache.push([b,d]),d},c.getSchemaByUri=function(a,b,c){var h=e(b),l=f(b),m=h?this.cache[h]:c;if(m&&h){if(m!==c){a.path.push(h);var n=new i(a);j.compileSchema.call(this,n,m)&&k.validateSchema.call(this,n,m);var o=n.isValid();if(o||a.addError("REMOTE_NOT_VALID",[b],n),a.path.pop(),!o)return}}if(m&&l)for(var p=l.split("/"),q=0,r=p.length;m&&q<r;q++){var s=d(p[q]);m=0===q?g(m,s):m[s]}return m},c.getRemotePath=e},{"./Report":6,"./SchemaCompilation":8,"./SchemaValidation":9,"./Utils":10}],8:[function(a,b,c){"use strict";function d(a,b){if(i.isAbsoluteUri(b))return b;var c,d=a.join(""),e=i.isAbsoluteUri(d),f=i.isRelativeUri(d),g=i.isRelativeUri(b);e&&g?(c=d.match(/\/[^\/]*$/))&&(d=d.slice(0,c.index+1)):f&&g?d="":(c=d.match(/[^#\/]+$/))&&(d=d.slice(0,c.index));var h=d+b;return h=h.replace(/##/,"#")}function e(a,b,c,f){if(b=b||[],c=c||[],f=f||[],"object"!=typeof a||null===a)return b;"string"==typeof a.id&&c.push(a.id),"string"==typeof a.$ref&&void 0===a.__$refResolved&&b.push({ref:d(c,a.$ref),key:"$ref",obj:a,path:f.slice(0)}),"string"==typeof a.$schema&&void 0===a.__$schemaResolved&&b.push({ref:d(c,a.$schema),key:"$schema",obj:a,path:f.slice(0)});var g;if(Array.isArray(a))for(g=a.length;g--;)f.push(g.toString()),e(a[g],b,c,f),f.pop();else{var h=Object.keys(a);for(g=h.length;g--;)0!==h[g].indexOf("__$")&&(f.push(h[g]),e(a[h[g]],b,c,f),f.pop())}return"string"==typeof a.id&&c.pop(),b}function f(a,b){for(var c=a.length;c--;)if(a[c].id===b)return a[c];return null}var g=a("./Report"),h=a("./SchemaCache"),i=a("./Utils"),j=function(a,b){for(var d=b.length,e=0;d--;){var f=new g(a);c.compileSchema.call(this,f,b[d])&&e++,a.errors=a.errors.concat(f.errors)}return e},k=function(a,b){var c,d=0;do{for(var e=a.errors.length;e--;)"UNRESOLVABLE_REFERENCE"===a.errors[e].code&&a.errors.splice(e,1);for(c=d,d=j.call(this,a,b),e=b.length;e--;){var g=b[e];if(g.__$missingReferences){for(var h=g.__$missingReferences.length;h--;){var i=g.__$missingReferences[h],k=f(b,i.ref);k&&(i.obj["__"+i.key+"Resolved"]=k,g.__$missingReferences.splice(h,1))}0===g.__$missingReferences.length&&delete g.__$missingReferences}}}while(d!==b.length&&d!==c);return a.isValid()};c.compileSchema=function(a,b){if(a.commonErrorMessage="SCHEMA_COMPILATION_FAILED","string"==typeof b){var d=h.getSchemaByUri.call(this,a,b);if(!d)return a.addError("SCHEMA_NOT_REACHABLE",[b]),!1;b=d}if(Array.isArray(b))return k.call(this,a,b);if(b.__$compiled&&b.id&&h.checkCacheForUri.call(this,b.id)===!1&&(b.__$compiled=void 0),b.__$compiled)return!0;b.id&&"string"==typeof b.id&&h.cacheSchemaByUri.call(this,b.id,b);var f=!1;a.rootSchema||(a.rootSchema=b,f=!0);var j=a.isValid();delete b.__$missingReferences;for(var l=e.call(this,b),m=l.length;m--;){var n=l[m],o=h.getSchemaByUri.call(this,a,n.ref,b);if(!o){var p=this.getSchemaReader();if(p){var q=p(n.ref);if(q){q.id=n.ref;var r=new g(a);c.compileSchema.call(this,r,q)?o=h.getSchemaByUri.call(this,a,n.ref,b):a.errors=a.errors.concat(r.errors)}}}if(!o){var s=a.hasError("REMOTE_NOT_VALID",[n.ref]),t=i.isAbsoluteUri(n.ref),u=!1,v=this.options.ignoreUnresolvableReferences===!0;t&&(u=h.checkCacheForUri.call(this,n.ref)),s||v&&t||u||(Array.prototype.push.apply(a.path,n.path),a.addError("UNRESOLVABLE_REFERENCE",[n.ref]),a.path=a.path.slice(0,-n.path.length),j&&(b.__$missingReferences=b.__$missingReferences||[],b.__$missingReferences.push(n)))}n.obj["__"+n.key+"Resolved"]=o}var w=a.isValid();return w?b.__$compiled=!0:b.id&&"string"==typeof b.id&&h.removeFromCacheByUri.call(this,b.id),f&&(a.rootSchema=void 0),w}},{"./Report":6,"./SchemaCache":7,"./Utils":10}],9:[function(a,b,c){"use strict";var d=a("./FormatValidators"),e=a("./JsonValidation"),f=a("./Report"),g=a("./Utils"),h={$ref:function(a,b){"string"!=typeof b.$ref&&a.addError("KEYWORD_TYPE_EXPECTED",["$ref","string"])},$schema:function(a,b){"string"!=typeof b.$schema&&a.addError("KEYWORD_TYPE_EXPECTED",["$schema","string"])},multipleOf:function(a,b){"number"!=typeof b.multipleOf?a.addError("KEYWORD_TYPE_EXPECTED",["multipleOf","number"]):b.multipleOf<=0&&a.addError("KEYWORD_MUST_BE",["multipleOf","strictly greater than 0"])},maximum:function(a,b){"number"!=typeof b.maximum&&a.addError("KEYWORD_TYPE_EXPECTED",["maximum","number"])},exclusiveMaximum:function(a,b){"boolean"!=typeof b.exclusiveMaximum?a.addError("KEYWORD_TYPE_EXPECTED",["exclusiveMaximum","boolean"]):void 0===b.maximum&&a.addError("KEYWORD_DEPENDENCY",["exclusiveMaximum","maximum"])},minimum:function(a,b){"number"!=typeof b.minimum&&a.addError("KEYWORD_TYPE_EXPECTED",["minimum","number"])},exclusiveMinimum:function(a,b){"boolean"!=typeof b.exclusiveMinimum?a.addError("KEYWORD_TYPE_EXPECTED",["exclusiveMinimum","boolean"]):void 0===b.minimum&&a.addError("KEYWORD_DEPENDENCY",["exclusiveMinimum","minimum"])},maxLength:function(a,b){"integer"!==g.whatIs(b.maxLength)?a.addError("KEYWORD_TYPE_EXPECTED",["maxLength","integer"]):b.maxLength<0&&a.addError("KEYWORD_MUST_BE",["maxLength","greater than, or equal to 0"])},minLength:function(a,b){"integer"!==g.whatIs(b.minLength)?a.addError("KEYWORD_TYPE_EXPECTED",["minLength","integer"]):b.minLength<0&&a.addError("KEYWORD_MUST_BE",["minLength","greater than, or equal to 0"])},pattern:function(a,b){if("string"!=typeof b.pattern)a.addError("KEYWORD_TYPE_EXPECTED",["pattern","string"]);else try{RegExp(b.pattern)}catch(c){a.addError("KEYWORD_PATTERN",["pattern",b.pattern])}},additionalItems:function(a,b){var d=g.whatIs(b.additionalItems);"boolean"!==d&&"object"!==d?a.addError("KEYWORD_TYPE_EXPECTED",["additionalItems",["boolean","object"]]):"object"===d&&(a.path.push("additionalItems"),c.validateSchema.call(this,a,b.additionalItems),a.path.pop())},items:function(a,b){var d=g.whatIs(b.items);if("object"===d)a.path.push("items"),c.validateSchema.call(this,a,b.items),a.path.pop();else if("array"===d)for(var e=b.items.length;e--;)a.path.push("items"),a.path.push(e.toString()),c.validateSchema.call(this,a,b.items[e]),a.path.pop(),a.path.pop();else a.addError("KEYWORD_TYPE_EXPECTED",["items",["array","object"]]);this.options.forceAdditional===!0&&void 0===b.additionalItems&&Array.isArray(b.items)&&a.addError("KEYWORD_UNDEFINED_STRICT",["additionalItems"]),this.options.assumeAdditional&&void 0===b.additionalItems&&Array.isArray(b.items)&&(b.additionalItems=!1)},maxItems:function(a,b){"number"!=typeof b.maxItems?a.addError("KEYWORD_TYPE_EXPECTED",["maxItems","integer"]):b.maxItems<0&&a.addError("KEYWORD_MUST_BE",["maxItems","greater than, or equal to 0"])},minItems:function(a,b){"integer"!==g.whatIs(b.minItems)?a.addError("KEYWORD_TYPE_EXPECTED",["minItems","integer"]):b.minItems<0&&a.addError("KEYWORD_MUST_BE",["minItems","greater than, or equal to 0"])},uniqueItems:function(a,b){"boolean"!=typeof b.uniqueItems&&a.addError("KEYWORD_TYPE_EXPECTED",["uniqueItems","boolean"])},maxProperties:function(a,b){"integer"!==g.whatIs(b.maxProperties)?a.addError("KEYWORD_TYPE_EXPECTED",["maxProperties","integer"]):b.maxProperties<0&&a.addError("KEYWORD_MUST_BE",["maxProperties","greater than, or equal to 0"])},minProperties:function(a,b){"integer"!==g.whatIs(b.minProperties)?a.addError("KEYWORD_TYPE_EXPECTED",["minProperties","integer"]):b.minProperties<0&&a.addError("KEYWORD_MUST_BE",["minProperties","greater than, or equal to 0"])},required:function(a,b){if("array"!==g.whatIs(b.required))a.addError("KEYWORD_TYPE_EXPECTED",["required","array"]);else if(0===b.required.length)a.addError("KEYWORD_MUST_BE",["required","an array with at least one element"]);else{for(var c=b.required.length;c--;)"string"!=typeof b.required[c]&&a.addError("KEYWORD_VALUE_TYPE",["required","string"]);g.isUniqueArray(b.required)===!1&&a.addError("KEYWORD_MUST_BE",["required","an array with unique items"])}},additionalProperties:function(a,b){var d=g.whatIs(b.additionalProperties);"boolean"!==d&&"object"!==d?a.addError("KEYWORD_TYPE_EXPECTED",["additionalProperties",["boolean","object"]]):"object"===d&&(a.path.push("additionalProperties"),c.validateSchema.call(this,a,b.additionalProperties),a.path.pop())},properties:function(a,b){if("object"!==g.whatIs(b.properties))return void a.addError("KEYWORD_TYPE_EXPECTED",["properties","object"]);for(var d=Object.keys(b.properties),e=d.length;e--;){var f=d[e],h=b.properties[f];a.path.push("properties"),a.path.push(f),c.validateSchema.call(this,a,h),a.path.pop(),a.path.pop()}this.options.forceAdditional===!0&&void 0===b.additionalProperties&&a.addError("KEYWORD_UNDEFINED_STRICT",["additionalProperties"]),this.options.assumeAdditional&&void 0===b.additionalProperties&&(b.additionalProperties=!1),this.options.forceProperties===!0&&0===d.length&&a.addError("CUSTOM_MODE_FORCE_PROPERTIES",["properties"])},patternProperties:function(a,b){if("object"!==g.whatIs(b.patternProperties))return void a.addError("KEYWORD_TYPE_EXPECTED",["patternProperties","object"]);for(var d=Object.keys(b.patternProperties),e=d.length;e--;){var f=d[e],h=b.patternProperties[f];try{RegExp(f)}catch(b){a.addError("KEYWORD_PATTERN",["patternProperties",f])}a.path.push("patternProperties"),a.path.push(f.toString()),c.validateSchema.call(this,a,h),a.path.pop(),a.path.pop()}this.options.forceProperties===!0&&0===d.length&&a.addError("CUSTOM_MODE_FORCE_PROPERTIES",["patternProperties"])},dependencies:function(a,b){if("object"!==g.whatIs(b.dependencies))a.addError("KEYWORD_TYPE_EXPECTED",["dependencies","object"]);else for(var d=Object.keys(b.dependencies),e=d.length;e--;){var f=d[e],h=b.dependencies[f],i=g.whatIs(h);if("object"===i)a.path.push("dependencies"),a.path.push(f),c.validateSchema.call(this,a,h),a.path.pop(),a.path.pop();else if("array"===i){var j=h.length;for(0===j&&a.addError("KEYWORD_MUST_BE",["dependencies","not empty array"]);j--;)"string"!=typeof h[j]&&a.addError("KEYWORD_VALUE_TYPE",["dependensices","string"]);g.isUniqueArray(h)===!1&&a.addError("KEYWORD_MUST_BE",["dependencies","an array with unique items"])}else a.addError("KEYWORD_VALUE_TYPE",["dependencies","object or array"])}},enum:function(a,b){Array.isArray(b.enum)===!1?a.addError("KEYWORD_TYPE_EXPECTED",["enum","array"]):0===b.enum.length?a.addError("KEYWORD_MUST_BE",["enum","an array with at least one element"]):g.isUniqueArray(b.enum)===!1&&a.addError("KEYWORD_MUST_BE",["enum","an array with unique elements"])},type:function(a,b){var c=["array","boolean","integer","number","null","object","string"],d=c.join(","),e=Array.isArray(b.type);if(e){for(var f=b.type.length;f--;)c.indexOf(b.type[f])===-1&&a.addError("KEYWORD_TYPE_EXPECTED",["type",d]);g.isUniqueArray(b.type)===!1&&a.addError("KEYWORD_MUST_BE",["type","an object with unique properties"])}else"string"==typeof b.type?c.indexOf(b.type)===-1&&a.addError("KEYWORD_TYPE_EXPECTED",["type",d]):a.addError("KEYWORD_TYPE_EXPECTED",["type",["string","array"]]);this.options.noEmptyStrings===!0&&("string"===b.type||e&&b.type.indexOf("string")!==-1)&&void 0===b.minLength&&void 0===b.enum&&void 0===b.format&&(b.minLength=1),this.options.noEmptyArrays===!0&&("array"===b.type||e&&b.type.indexOf("array")!==-1)&&void 0===b.minItems&&(b.minItems=1),this.options.forceProperties===!0&&("object"===b.type||e&&b.type.indexOf("object")!==-1)&&void 0===b.properties&&void 0===b.patternProperties&&a.addError("KEYWORD_UNDEFINED_STRICT",["properties"]),this.options.forceItems===!0&&("array"===b.type||e&&b.type.indexOf("array")!==-1)&&void 0===b.items&&a.addError("KEYWORD_UNDEFINED_STRICT",["items"]),this.options.forceMinItems===!0&&("array"===b.type||e&&b.type.indexOf("array")!==-1)&&void 0===b.minItems&&a.addError("KEYWORD_UNDEFINED_STRICT",["minItems"]),this.options.forceMaxItems===!0&&("array"===b.type||e&&b.type.indexOf("array")!==-1)&&void 0===b.maxItems&&a.addError("KEYWORD_UNDEFINED_STRICT",["maxItems"]),this.options.forceMinLength===!0&&("string"===b.type||e&&b.type.indexOf("string")!==-1)&&void 0===b.minLength&&void 0===b.format&&void 0===b.enum&&void 0===b.pattern&&a.addError("KEYWORD_UNDEFINED_STRICT",["minLength"]),this.options.forceMaxLength===!0&&("string"===b.type||e&&b.type.indexOf("string")!==-1)&&void 0===b.maxLength&&void 0===b.format&&void 0===b.enum&&void 0===b.pattern&&a.addError("KEYWORD_UNDEFINED_STRICT",["maxLength"])},allOf:function(a,b){if(Array.isArray(b.allOf)===!1)a.addError("KEYWORD_TYPE_EXPECTED",["allOf","array"]);else if(0===b.allOf.length)a.addError("KEYWORD_MUST_BE",["allOf","an array with at least one element"]);else for(var d=b.allOf.length;d--;)a.path.push("allOf"),a.path.push(d.toString()),c.validateSchema.call(this,a,b.allOf[d]),a.path.pop(),a.path.pop()},anyOf:function(a,b){if(Array.isArray(b.anyOf)===!1)a.addError("KEYWORD_TYPE_EXPECTED",["anyOf","array"]);else if(0===b.anyOf.length)a.addError("KEYWORD_MUST_BE",["anyOf","an array with at least one element"]);else for(var d=b.anyOf.length;d--;)a.path.push("anyOf"),a.path.push(d.toString()),c.validateSchema.call(this,a,b.anyOf[d]),a.path.pop(),a.path.pop()},oneOf:function(a,b){if(Array.isArray(b.oneOf)===!1)a.addError("KEYWORD_TYPE_EXPECTED",["oneOf","array"]);else if(0===b.oneOf.length)a.addError("KEYWORD_MUST_BE",["oneOf","an array with at least one element"]);else for(var d=b.oneOf.length;d--;)a.path.push("oneOf"),a.path.push(d.toString()),c.validateSchema.call(this,a,b.oneOf[d]),a.path.pop(),a.path.pop()},not:function(a,b){"object"!==g.whatIs(b.not)?a.addError("KEYWORD_TYPE_EXPECTED",["not","object"]):(a.path.push("not"),c.validateSchema.call(this,a,b.not),a.path.pop())},definitions:function(a,b){if("object"!==g.whatIs(b.definitions))a.addError("KEYWORD_TYPE_EXPECTED",["definitions","object"]);else for(var d=Object.keys(b.definitions),e=d.length;e--;){var f=d[e],h=b.definitions[f];a.path.push("definitions"),a.path.push(f),c.validateSchema.call(this,a,h),a.path.pop(),a.path.pop()}},format:function(a,b){"string"!=typeof b.format?a.addError("KEYWORD_TYPE_EXPECTED",["format","string"]):void 0===d[b.format]&&this.options.ignoreUnknownFormats!==!0&&a.addError("UNKNOWN_FORMAT",[b.format])},id:function(a,b){"string"!=typeof b.id&&a.addError("KEYWORD_TYPE_EXPECTED",["id","string"])},title:function(a,b){"string"!=typeof b.title&&a.addError("KEYWORD_TYPE_EXPECTED",["title","string"])},description:function(a,b){"string"!=typeof b.description&&a.addError("KEYWORD_TYPE_EXPECTED",["description","string"])},default:function(){}},i=function(a,b){for(var d=b.length;d--;)c.validateSchema.call(this,a,b[d]);return a.isValid()};c.validateSchema=function(a,b){if(a.commonErrorMessage="SCHEMA_VALIDATION_FAILED",Array.isArray(b))return i.call(this,a,b);if(b.__$validated)return!0;var c=b.$schema&&b.id!==b.$schema;if(c)if(b.__$schemaResolved&&b.__$schemaResolved!==b){var d=new f(a),j=e.validate.call(this,d,b.__$schemaResolved,b);j===!1&&a.addError("PARENT_SCHEMA_VALIDATION_FAILED",null,d) }else this.options.ignoreUnresolvableReferences!==!0&&a.addError("REF_UNRESOLVED",[b.$schema]);if(this.options.noTypeless===!0){if(void 0!==b.type){var k=[];Array.isArray(b.anyOf)&&(k=k.concat(b.anyOf)),Array.isArray(b.oneOf)&&(k=k.concat(b.oneOf)),Array.isArray(b.allOf)&&(k=k.concat(b.allOf)),k.forEach(function(a){a.type||(a.type=b.type)})}void 0===b.enum&&void 0===b.type&&void 0===b.anyOf&&void 0===b.oneOf&&void 0===b.not&&void 0===b.$ref&&a.addError("KEYWORD_UNDEFINED_STRICT",["type"])}for(var l=Object.keys(b),m=l.length;m--;){var n=l[m];0!==n.indexOf("__")&&(void 0!==h[n]?h[n].call(this,a,b):c||this.options.noExtraKeywords===!0&&a.addError("KEYWORD_UNEXPECTED",[n]))}if(this.options.pedanticCheck===!0){if(b.enum){var o=g.clone(b);for(delete o.enum,delete o.default,a.path.push("enum"),m=b.enum.length;m--;)a.path.push(m.toString()),e.validate.call(this,a,o,b.enum[m]),a.path.pop();a.path.pop()}b.default&&(a.path.push("default"),e.validate.call(this,a,b,b.default),a.path.pop())}var p=a.isValid();return p&&(b.__$validated=!0),p}},{"./FormatValidators":3,"./JsonValidation":4,"./Report":6,"./Utils":10}],10:[function(a,b,c){"use strict";c.isAbsoluteUri=function(a){return/^https?:\/\//.test(a)},c.isRelativeUri=function(a){return/.+#/.test(a)},c.whatIs=function(a){var b=typeof a;return"object"===b?null===a?"null":Array.isArray(a)?"array":"object":"number"===b?Number.isFinite(a)?a%1==0?"integer":"number":Number.isNaN(a)?"not-a-number":"unknown-number":b},c.areEqual=function a(b,d){if(b===d)return!0;var e,f;if(Array.isArray(b)&&Array.isArray(d)){if(b.length!==d.length)return!1;for(f=b.length,e=0;e<f;e++)if(!a(b[e],d[e]))return!1;return!0}if("object"===c.whatIs(b)&&"object"===c.whatIs(d)){var g=Object.keys(b);if(!a(g,Object.keys(d)))return!1;for(f=g.length,e=0;e<f;e++)if(!a(b[g[e]],d[g[e]]))return!1;return!0}return!1},c.isUniqueArray=function(a,b){var d,e,f=a.length;for(d=0;d<f;d++)for(e=d+1;e<f;e++)if(c.areEqual(a[d],a[e]))return b&&b.push(d,e),!1;return!0},c.difference=function(a,b){for(var c=[],d=a.length;d--;)b.indexOf(a[d])===-1&&c.push(a[d]);return c},c.clone=function(a){if(void 0!==a){if("object"!=typeof a||null===a)return a;var b,c;if(Array.isArray(a))for(b=[],c=a.length;c--;)b[c]=a[c];else{b={};var d=Object.keys(a);for(c=d.length;c--;){var e=d[c];b[e]=a[e]}}return b}},c.cloneDeep=function(a){function b(a){if("object"!=typeof a||null===a)return a;var e,f,g;if((g=c.indexOf(a))!==-1)return d[g];if(c.push(a),Array.isArray(a))for(e=[],d.push(e),f=a.length;f--;)e[f]=b(a[f]);else{e={},d.push(e);var h=Object.keys(a);for(f=h.length;f--;){var i=h[f];e[i]=b(a[i])}}return e}var c=[],d=[];return b(a)},c.ucs2decode=function(a){for(var b,c,d=[],e=0,f=a.length;e<f;)b=a.charCodeAt(e++),b>=55296&&b<=56319&&e<f?(c=a.charCodeAt(e++),56320==(64512&c)?d.push(((1023&b)<<10)+(1023&c)+65536):(d.push(b),e--)):d.push(b);return d}},{}],11:[function(a,b,c){(function(c){"use strict";function d(a){if(this.cache={},this.referenceCache=[],this.setRemoteReference("http://json-schema.org/draft-04/schema",m),this.setRemoteReference("http://json-schema.org/draft-04/hyper-schema",n),"object"==typeof a){for(var b,c=Object.keys(a),d=c.length;d--;)if(b=c[d],void 0===o[b])throw new Error("Unexpected option passed to constructor: "+b);for(c=Object.keys(o),d=c.length;d--;)b=c[d],void 0===a[b]&&(a[b]=l.clone(o[b]));this.options=a}else this.options=l.clone(o);this.options.strictMode===!0&&(this.options.forceAdditional=!0,this.options.forceItems=!0,this.options.forceMaxLength=!0,this.options.forceProperties=!0,this.options.noExtraKeywords=!0,this.options.noTypeless=!0,this.options.noEmptyStrings=!0,this.options.noEmptyArrays=!0)}a("./Polyfills");var e=_.get,f=a("./Report"),g=a("./FormatValidators"),h=a("./JsonValidation"),i=a("./SchemaCache"),j=a("./SchemaCompilation"),k=a("./SchemaValidation"),l=a("./Utils"),m=a("./schemas/schema.json"),n=a("./schemas/hyper-schema.json"),o={asyncTimeout:2e3,forceAdditional:!1,assumeAdditional:!1,forceItems:!1,forceMinItems:!1,forceMaxItems:!1,forceMinLength:!1,forceMaxLength:!1,forceProperties:!1,ignoreUnresolvableReferences:!1,noExtraKeywords:!1,noTypeless:!1,noEmptyStrings:!1,noEmptyArrays:!1,strictUris:!1,strictMode:!1,reportPathAsArray:!1,breakOnFirstError:!0,pedanticCheck:!1,ignoreUnknownFormats:!1,customValidator:null};d.prototype.compileSchema=function(a){var b=new f(this.options);return a=i.getSchema.call(this,b,a),j.compileSchema.call(this,b,a),this.lastReport=b,b.isValid()},d.prototype.validateSchema=function(a){if(Array.isArray(a)&&0===a.length)throw new Error(".validateSchema was called with an empty array");var b=new f(this.options);return a=i.getSchema.call(this,b,a),j.compileSchema.call(this,b,a)&&k.validateSchema.call(this,b,a),this.lastReport=b,b.isValid()},d.prototype.validate=function(a,b,d,g){"function"===l.whatIs(d)&&(g=d,d={}),d||(d={});var m=l.whatIs(b);if("string"!==m&&"object"!==m){var n=new Error("Invalid .validate call - schema must be an string or object but "+m+" was passed!");if(g)return void c.nextTick(function(){g(n,!1)});throw n}var o=!1,p=new f(this.options);if("string"==typeof b){var q=b;if(!(b=i.getSchema.call(this,p,q)))throw new Error("Schema with id '"+q+"' wasn't found in the validator cache!")}else b=i.getSchema.call(this,p,b);var r=!1;o||(r=j.compileSchema.call(this,p,b)),r||(this.lastReport=p,o=!0);var s=!1;if(o||(s=k.validateSchema.call(this,p,b)),s||(this.lastReport=p,o=!0),d.schemaPath&&(p.rootSchema=b,!(b=e(b,d.schemaPath))))throw new Error("Schema path '"+d.schemaPath+"' wasn't found in the schema!");if(o||h.validate.call(this,p,b,a),g)return void p.processAsyncTasks(this.options.asyncTimeout,g);if(p.asyncTasks.length>0)throw new Error("This validation has async tasks and cannot be done in sync mode, please provide callback argument.");return this.lastReport=p,p.isValid()},d.prototype.getLastError=function(){if(0===this.lastReport.errors.length)return null;var a=new Error;return a.name="z-schema validation error",a.message=this.lastReport.commonErrorMessage,a.details=this.lastReport.errors,a},d.prototype.getLastErrors=function(){return this.lastReport&&this.lastReport.errors.length>0?this.lastReport.errors:void 0},d.prototype.getMissingReferences=function(a){a=a||this.lastReport.errors;for(var b=[],c=a.length;c--;){var d=a[c];if("UNRESOLVABLE_REFERENCE"===d.code){var e=d.params[0];b.indexOf(e)===-1&&b.push(e)}d.inner&&(b=b.concat(this.getMissingReferences(d.inner)))}return b},d.prototype.getMissingRemoteReferences=function(){for(var a=this.getMissingReferences(),b=[],c=a.length;c--;){var d=i.getRemotePath(a[c]);d&&b.indexOf(d)===-1&&b.push(d)}return b},d.prototype.setRemoteReference=function(a,b){b="string"==typeof b?JSON.parse(b):l.cloneDeep(b),i.cacheSchemaByUri.call(this,a,b)},d.prototype.getResolvedSchema=function(a){var b=new f(this.options);a=i.getSchema.call(this,b,a),a=l.cloneDeep(a);var c=[],d=function(a){var b,e=l.whatIs(a);if(("object"===e||"array"===e)&&!a.___$visited){if(a.___$visited=!0,c.push(a),a.$ref&&a.__$refResolved){var f=a.__$refResolved,g=a;delete a.$ref,delete a.__$refResolved;for(b in f)f.hasOwnProperty(b)&&(g[b]=f[b])}for(b in a)a.hasOwnProperty(b)&&(0===b.indexOf("__$")?delete a[b]:d(a[b]))}};if(d(a),c.forEach(function(a){delete a.___$visited}),this.lastReport=b,b.isValid())return a;throw this.getLastError()},d.prototype.setSchemaReader=function(a){return d.setSchemaReader(a)},d.prototype.getSchemaReader=function(){return d.schemaReader},d.setSchemaReader=function(a){d.schemaReader=a},d.registerFormat=function(a,b){g[a]=b},d.unregisterFormat=function(a){delete g[a]},d.getRegisteredFormats=function(){return Object.keys(g)},d.getDefaultOptions=function(){return l.cloneDeep(o)},b.exports=d}).call(this,a("_process"))},{"./FormatValidators":3,"./JsonValidation":4,"./Polyfills":5,"./Report":6,"./SchemaCache":7,"./SchemaCompilation":8,"./SchemaValidation":9,"./Utils":10,"./schemas/hyper-schema.json":12,"./schemas/schema.json":13,_process:1}],12:[function(a,b,c){b.exports={$schema:"http://json-schema.org/draft-04/hyper-schema#",id:"http://json-schema.org/draft-04/hyper-schema#",title:"JSON Hyper-Schema",allOf:[{$ref:"http://json-schema.org/draft-04/schema#"}],properties:{additionalItems:{anyOf:[{type:"boolean"},{$ref:"#"}]},additionalProperties:{anyOf:[{type:"boolean"},{$ref:"#"}]},dependencies:{additionalProperties:{anyOf:[{$ref:"#"},{type:"array"}]}},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}]},definitions:{additionalProperties:{$ref:"#"}},patternProperties:{additionalProperties:{$ref:"#"}},properties:{additionalProperties:{$ref:"#"}},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"},links:{type:"array",items:{$ref:"#/definitions/linkDescription"}},fragmentResolution:{type:"string"},media:{type:"object",properties:{type:{description:"A media type, as described in RFC 2046",type:"string"},binaryEncoding:{description:"A content encoding scheme, as described in RFC 2045",type:"string"}}},pathStart:{description:"Instances' URIs must start with this value for this schema to apply to them",type:"string",format:"uri"}},definitions:{schemaArray:{type:"array",items:{$ref:"#"}},linkDescription:{title:"Link Description Object",type:"object",required:["href","rel"],properties:{href:{description:"a URI template, as defined by RFC 6570, with the addition of the $, ( and ) characters for pre-processing",type:"string"},rel:{description:"relation to the target resource of the link",type:"string"},title:{description:"a title for the link",type:"string"},targetSchema:{description:"JSON Schema describing the link target",$ref:"#"},mediaType:{description:"media type (as defined by RFC 2046) describing the link target",type:"string"},method:{description:'method for requesting the target of the link (e.g. for HTTP this might be "GET" or "DELETE")',type:"string"},encType:{description:"The media type in which to submit data along with the request",type:"string",default:"application/json"},schema:{description:"Schema describing the data to submit along with the request",$ref:"#"}}}}}},{}],13:[function(a,b,c){b.exports={id:"http://json-schema.org/draft-04/schema#",$schema:"http://json-schema.org/draft-04/schema#",description:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},positiveInteger:{type:"integer",minimum:0},positiveIntegerDefault0:{allOf:[{$ref:"#/definitions/positiveInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},minItems:1,uniqueItems:!0}},type:"object",properties:{id:{type:"string",format:"uri"},$schema:{type:"string",format:"uri"},title:{type:"string"},description:{type:"string"},default:{},multipleOf:{type:"number",minimum:0,exclusiveMinimum:!0},maximum:{type:"number"},exclusiveMaximum:{type:"boolean",default:!1},minimum:{type:"number"},exclusiveMinimum:{type:"boolean",default:!1},maxLength:{$ref:"#/definitions/positiveInteger"},minLength:{$ref:"#/definitions/positiveIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{anyOf:[{type:"boolean"},{$ref:"#"}],default:{}},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:{}},maxItems:{$ref:"#/definitions/positiveInteger"},minItems:{$ref:"#/definitions/positiveIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxProperties:{$ref:"#/definitions/positiveInteger"},minProperties:{$ref:"#/definitions/positiveIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{anyOf:[{type:"boolean"},{$ref:"#"}],default:{}},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},enum:{type:"array",minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},dependencies:{exclusiveMaximum:["maximum"],exclusiveMinimum:["minimum"]},default:{}}},{}]},{},[2,3,4,5,6,7,8,9,10,11])(11)}); //# sourceMappingURL=ZSchema-browser-min.js.map