@talend/json-schema-form-core
Version:
JSON-Schema and JSON-UI-Schema utilities for form generation.
2 lines • 243 kB
JavaScript
/*! For license information please see index.js.LICENSE.txt */
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.TalendJsonSchemaFormCore=t():e.TalendJsonSchemaFormCore=t()}(this,()=>(()=>{var e={288:(e,t,n)=>{"use strict";var r,o,i;o={"'":/\\\'/g,'"':/\\\"/g},i={parse:function(e){if("string"!=typeof e)throw new TypeError("ObjectPath.parse must be passed a string");for(var t,n,r,i,s=0,u=[];s<e.length;)if(t=e.indexOf(".",s),n=e.indexOf("[",s),-1===t&&-1===n)u.push(e.slice(s,e.length)),s=e.length;else if(-1===n||-1!==t&&t<n)u.push(e.slice(s,t)),s=t+1;else if(n>s&&(u.push(e.slice(s,n)),s=n),'"'!==(r=e.slice(n+1,n+2))&&"'"!==r)-1===(i=e.indexOf("]",n))&&(i=e.length),u.push(e.slice(s+1,i)),s="."===e.slice(i+1,i+2)?i+2:i+1;else{for(-1===(i=e.indexOf(r+"]",n))&&(i=e.length);"\\"===e.slice(i-1,i)&&n<e.length;)n++,i=e.indexOf(r+"]",n);u.push(e.slice(s+2,i).replace(o[r],r)),s="."===e.slice(i+2,i+3)?i+3:i+2}return u},stringify:function(e,t){return Array.isArray(e)||(e=[e.toString()]),t='"'===t?'"':"'",e.map(function(e){return"["+t+e.toString().replace(new RegExp(t,"g"),"\\"+t)+t+"]"}).join("")},normalize:function(e,t){return i.stringify(Array.isArray(e)?e:i.parse(e),t)},registerModule:function(e){e.module("ObjectPath",[]).provider("ObjectPath",function(){this.parse=i.parse,this.stringify=i.stringify,this.normalize=i.normalize,this.$get=function(){return i}})}},void 0===(r=function(){return{ObjectPath:i,parse:i.parse,stringify:i.stringify,normalize:i.normalize}}.call(t,n,t,e))||(e.exports=r)},750:function(e,t){var n,r;n=function(){var e,t,n,r;Object.keys||(Object.keys=(e=Object.prototype.hasOwnProperty,t=!{toString:null}.propertyIsEnumerable("toString"),r=(n=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"]).length,function(o){if("object"!=typeof o&&"function"!=typeof o||null===o)throw new TypeError("Object.keys called on non-object");var i=[];for(var s in o)e.call(o,s)&&i.push(s);if(t)for(var u=0;u<r;u++)e.call(o,n[u])&&i.push(n[u]);return i})),Object.create||(Object.create=function(){function e(){}return function(t){if(1!==arguments.length)throw new Error("Object.create implementation only accepts one parameter.");return e.prototype=t,new e}}()),Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),Array.prototype.indexOf||(Array.prototype.indexOf=function(e){if(null===this)throw new TypeError;var t=Object(this),n=t.length>>>0;if(0===n)return-1;var r=0;if(arguments.length>1&&((r=Number(arguments[1]))!=r?r=0:0!==r&&r!==1/0&&r!==-1/0&&(r=(r>0||-1)*Math.floor(Math.abs(r)))),r>=n)return-1;for(var o=r>=0?r:Math.max(n-Math.abs(r),0);o<n;o++)if(o in t&&t[o]===e)return o;return-1}),Object.isFrozen||(Object.isFrozen=function(e){for(var t="tv4_test_frozen_key";e.hasOwnProperty(t);)t+=Math.random();try{return e[t]=!0,delete e[t],!1}catch(e){return!0}});var o={"+":!0,"#":!0,".":!0,"/":!0,";":!0,"?":!0,"&":!0},i={"*":!0};function s(e){return encodeURI(e).replace(/%25[0-9][0-9]/g,function(e){return"%"+e.substring(3)})}function u(e){var t="";o[e.charAt(0)]&&(t=e.charAt(0),e=e.substring(1));var n="",r="",u=!0,a=!1,l=!1;"+"===t?u=!1:"."===t?(r=".",n="."):"/"===t?(r="/",n="/"):"#"===t?(r="#",u=!1):";"===t?(r=";",n=";",a=!0,l=!0):"?"===t?(r="?",n="&",a=!0):"&"===t&&(r="&",n="&",a=!0);for(var c=[],f=e.split(","),d=[],h={},p=0;p<f.length;p++){var _=f[p],m=null;if(-1!==_.indexOf(":")){var y=_.split(":");_=y[0],m=parseInt(y[1],10)}for(var v={};i[_.charAt(_.length-1)];)v[_.charAt(_.length-1)]=!0,_=_.substring(0,_.length-1);var g={truncate:m,name:_,suffices:v};d.push(g),h[_]=g,c.push(_)}var b=function(e){for(var t="",o=0,i=0;i<d.length;i++){var c=d[i],f=e(c.name);if(null==f||Array.isArray(f)&&0===f.length||"object"==typeof f&&0===Object.keys(f).length)o++;else if(t+=i===o?r:n||",",Array.isArray(f)){a&&(t+=c.name+"=");for(var h=0;h<f.length;h++)h>0&&(t+=c.suffices["*"]&&n||",",c.suffices["*"]&&a&&(t+=c.name+"=")),t+=u?encodeURIComponent(f[h]).replace(/!/g,"%21"):s(f[h])}else if("object"==typeof f){a&&!c.suffices["*"]&&(t+=c.name+"=");var p=!0;for(var _ in f)p||(t+=c.suffices["*"]&&n||","),p=!1,t+=u?encodeURIComponent(_).replace(/!/g,"%21"):s(_),t+=c.suffices["*"]?"=":",",t+=u?encodeURIComponent(f[_]).replace(/!/g,"%21"):s(f[_])}else a&&(t+=c.name,l&&""===f||(t+="=")),null!=c.truncate&&(f=f.substring(0,c.truncate)),t+=u?encodeURIComponent(f).replace(/!/g,"%21"):s(f)}return t};return b.varNames=c,{prefix:r,substitution:b}}function a(e){if(!(this instanceof a))return new a(e);for(var t=e.split("{"),n=[t.shift()],r=[],o=[],i=[];t.length>0;){var s=t.shift(),l=s.split("}")[0],c=s.substring(l.length+1),f=u(l);o.push(f.substitution),r.push(f.prefix),n.push(c),i=i.concat(f.substitution.varNames)}this.fill=function(e){for(var t=n[0],r=0;r<o.length;r++)t+=(0,o[r])(e),t+=n[r+1];return t},this.varNames=i,this.template=e}a.prototype={toString:function(){return this.template},fillFromObject:function(e){return this.fill(function(t){return e[t]})}};var l=function(e,t,n,r,o){if(this.missing=[],this.missingMap={},this.formatValidators=e?Object.create(e.formatValidators):{},this.schemas=e?Object.create(e.schemas):{},this.collectMultiple=t,this.errors=[],this.handleError=t?this.collectError:this.returnError,r&&(this.checkRecursive=!0,this.scanned=[],this.scannedFrozen=[],this.scannedFrozenSchemas=[],this.scannedFrozenValidationErrors=[],this.validatedSchemasKey="tv4_validation_id",this.validationErrorsKey="tv4_validation_errors_id"),o&&(this.trackUnknownProperties=!0,this.knownPropertyPaths={},this.unknownPropertyPaths={}),this.errorReporter=n||y("en"),"string"==typeof this.errorReporter)throw new Error("debug");if(this.definedKeywords={},e)for(var i in e.definedKeywords)this.definedKeywords[i]=e.definedKeywords[i].slice(0)};function c(e,t){if(e===t)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){if(Array.isArray(e)!==Array.isArray(t))return!1;if(Array.isArray(e)){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!c(e[n],t[n]))return!1}else{var r;for(r in e)if(void 0===t[r]&&void 0!==e[r])return!1;for(r in t)if(void 0===e[r]&&void 0!==t[r])return!1;for(r in e)if(!c(e[r],t[r]))return!1}return!0}return!1}l.prototype.defineKeyword=function(e,t){this.definedKeywords[e]=this.definedKeywords[e]||[],this.definedKeywords[e].push(t)},l.prototype.createError=function(e,t,n,r,o,i,s){var u=new w(e,t,n,r,o);return u.message=this.errorReporter(u,i,s),u},l.prototype.returnError=function(e){return e},l.prototype.collectError=function(e){return e&&this.errors.push(e),null},l.prototype.prefixErrors=function(e,t,n){for(var r=e;r<this.errors.length;r++)this.errors[r]=this.errors[r].prefixWith(t,n);return this},l.prototype.banUnknownProperties=function(e,t){for(var n in this.unknownPropertyPaths){var r=this.createError(v.UNKNOWN_PROPERTY,{path:n},n,"",null,e,t),o=this.handleError(r);if(o)return o}return null},l.prototype.addFormat=function(e,t){if("object"==typeof e){for(var n in e)this.addFormat(n,e[n]);return this}this.formatValidators[e]=t},l.prototype.resolveRefs=function(e,t){if(void 0!==e.$ref){if((t=t||{})[e.$ref])return this.createError(v.CIRCULAR_REFERENCE,{urls:Object.keys(t).join(", ")},"","",null,void 0,e);t[e.$ref]=!0,e=this.getSchema(e.$ref,t)}return e},l.prototype.getSchema=function(e,t){var n;if(void 0!==this.schemas[e])return n=this.schemas[e],this.resolveRefs(n,t);var r=e,o="";if(-1!==e.indexOf("#")&&(o=e.substring(e.indexOf("#")+1),r=e.substring(0,e.indexOf("#"))),"object"==typeof this.schemas[r]){n=this.schemas[r];var i=decodeURIComponent(o);if(""===i)return this.resolveRefs(n,t);if("/"!==i.charAt(0))return;for(var s=i.split("/").slice(1),u=0;u<s.length;u++){var a=s[u].replace(/~1/g,"/").replace(/~0/g,"~");if(void 0===n[a]){n=void 0;break}n=n[a]}if(void 0!==n)return this.resolveRefs(n,t)}void 0===this.missing[r]&&(this.missing.push(r),this.missing[r]=r,this.missingMap[r]=r)},l.prototype.searchSchemas=function(e,t){if(Array.isArray(e))for(var n=0;n<e.length;n++)this.searchSchemas(e[n],t);else if(e&&"object"==typeof e)for(var r in"string"==typeof e.id&&function(e,t){if(t.substring(0,e.length)===e){var n=t.substring(e.length);if(t.length>0&&"/"===t.charAt(e.length-1)||"#"===n.charAt(0)||"?"===n.charAt(0))return!0}return!1}(t,e.id)&&void 0===this.schemas[e.id]&&(this.schemas[e.id]=e),e)if("enum"!==r)if("object"==typeof e[r])this.searchSchemas(e[r],t);else if("$ref"===r){var o=_(e[r]);o&&void 0===this.schemas[o]&&void 0===this.missingMap[o]&&(this.missingMap[o]=o)}},l.prototype.addSchema=function(e,t){if("string"!=typeof e||void 0===t){if("object"!=typeof e||"string"!=typeof e.id)return;e=(t=e).id}e===_(e)+"#"&&(e=_(e)),this.schemas[e]=t,delete this.missingMap[e],m(t,e),this.searchSchemas(t,e)},l.prototype.getSchemaMap=function(){var e={};for(var t in this.schemas)e[t]=this.schemas[t];return e},l.prototype.getSchemaUris=function(e){var t=[];for(var n in this.schemas)e&&!e.test(n)||t.push(n);return t},l.prototype.getMissingUris=function(e){var t=[];for(var n in this.missingMap)e&&!e.test(n)||t.push(n);return t},l.prototype.dropSchemas=function(){this.schemas={},this.reset()},l.prototype.reset=function(){this.missing=[],this.missingMap={},this.errors=[]},l.prototype.validateAll=function(e,t,n,r,o){var i;if(!(t=this.resolveRefs(t)))return null;if(t instanceof w)return this.errors.push(t),t;var s,u=this.errors.length,a=null,l=null;if(this.checkRecursive&&e&&"object"==typeof e){if(i=!this.scanned.length,e[this.validatedSchemasKey]){var c=e[this.validatedSchemasKey].indexOf(t);if(-1!==c)return this.errors=this.errors.concat(e[this.validationErrorsKey][c]),null}if(Object.isFrozen(e)&&-1!==(s=this.scannedFrozen.indexOf(e))){var f=this.scannedFrozenSchemas[s].indexOf(t);if(-1!==f)return this.errors=this.errors.concat(this.scannedFrozenValidationErrors[s][f]),null}if(this.scanned.push(e),Object.isFrozen(e))-1===s&&(s=this.scannedFrozen.length,this.scannedFrozen.push(e),this.scannedFrozenSchemas.push([])),a=this.scannedFrozenSchemas[s].length,this.scannedFrozenSchemas[s][a]=t,this.scannedFrozenValidationErrors[s][a]=[];else{if(!e[this.validatedSchemasKey])try{Object.defineProperty(e,this.validatedSchemasKey,{value:[],configurable:!0}),Object.defineProperty(e,this.validationErrorsKey,{value:[],configurable:!0})}catch(t){e[this.validatedSchemasKey]=[],e[this.validationErrorsKey]=[]}l=e[this.validatedSchemasKey].length,e[this.validatedSchemasKey][l]=t,e[this.validationErrorsKey][l]=[]}}var d=this.errors.length,h=this.validateBasic(e,t,o)||this.validateNumeric(e,t,o)||this.validateString(e,t,o)||this.validateArray(e,t,o)||this.validateObject(e,t,o)||this.validateCombinations(e,t,o)||this.validateHypermedia(e,t,o)||this.validateFormat(e,t,o)||this.validateDefinedKeywords(e,t,o)||null;if(i){for(;this.scanned.length;)delete this.scanned.pop()[this.validatedSchemasKey];this.scannedFrozen=[],this.scannedFrozenSchemas=[]}if(h||d!==this.errors.length)for(;n&&n.length||r&&r.length;){var p=n&&n.length?""+n.pop():null,_=r&&r.length?""+r.pop():null;h&&(h=h.prefixWith(p,_)),this.prefixErrors(d,p,_)}return null!==a?this.scannedFrozenValidationErrors[s][a]=this.errors.slice(u):null!==l&&(e[this.validationErrorsKey][l]=this.errors.slice(u)),this.handleError(h)},l.prototype.validateFormat=function(e,t){if("string"!=typeof t.format||!this.formatValidators[t.format])return null;var n=this.formatValidators[t.format].call(null,e,t);return"string"==typeof n||"number"==typeof n?this.createError(v.FORMAT_CUSTOM,{message:n},"","/format",null,e,t):n&&"object"==typeof n?this.createError(v.FORMAT_CUSTOM,{message:n.message||"?"},n.dataPath||"",n.schemaPath||"/format",null,e,t):null},l.prototype.validateDefinedKeywords=function(e,t,n){for(var r in this.definedKeywords)if(void 0!==t[r])for(var o=this.definedKeywords[r],i=0;i<o.length;i++){var s=(0,o[i])(e,t[r],t,n);if("string"==typeof s||"number"==typeof s)return this.createError(v.KEYWORD_CUSTOM,{key:r,message:s},"","",null,e,t).prefixWith(null,r);if(s&&"object"==typeof s){var u=s.code;if("string"==typeof u){if(!v[u])throw new Error("Undefined error code (use defineError): "+u);u=v[u]}else"number"!=typeof u&&(u=v.KEYWORD_CUSTOM);var a="object"==typeof s.message?s.message:{key:r,message:s.message||"?"},l=s.schemaPath||"/"+r.replace(/~/g,"~0").replace(/\//g,"~1");return this.createError(u,a,s.dataPath||null,l,null,e,t)}}return null},l.prototype.validateBasic=function(e,t,n){var r;return(r=this.validateType(e,t,n))||(r=this.validateEnum(e,t,n))?r.prefixWith(null,"type"):null},l.prototype.validateType=function(e,t){if(void 0===t.type)return null;var n=typeof e;null===e?n="null":Array.isArray(e)&&(n="array");var r=t.type;Array.isArray(r)||(r=[r]);for(var o=0;o<r.length;o++){var i=r[o];if(i===n||"integer"===i&&"number"===n&&e%1==0)return null}return this.createError(v.INVALID_TYPE,{type:n,expected:r.join("/")},"","",null,e,t)},l.prototype.validateEnum=function(e,t){if(void 0===t.enum)return null;for(var n=0;n<t.enum.length;n++)if(c(e,t.enum[n]))return null;return this.createError(v.ENUM_MISMATCH,{value:"undefined"!=typeof JSON?JSON.stringify(e):e},"","",null,e,t)},l.prototype.validateNumeric=function(e,t,n){return this.validateMultipleOf(e,t,n)||this.validateMinMax(e,t,n)||this.validateNaN(e,t,n)||null};var f=Math.pow(2,-51),d=1-f;function h(e){var t=String(e).replace(/^\s+|\s+$/g,"").match(/^([^:\/?#]+:)?(\/\/(?:[^:@]*(?::[^:@]*)?@)?(([^:\/?#]*)(?::(\d*))?))?([^?#]*)(\?[^#]*)?(#[\s\S]*)?/);return t?{href:t[0]||"",protocol:t[1]||"",authority:t[2]||"",host:t[3]||"",hostname:t[4]||"",port:t[5]||"",pathname:t[6]||"",search:t[7]||"",hash:t[8]||""}:null}function p(e,t){return t=h(t||""),e=h(e||""),t&&e?(t.protocol||e.protocol)+(t.protocol||t.authority?t.authority:e.authority)+(n=t.protocol||t.authority||"/"===t.pathname.charAt(0)?t.pathname:t.pathname?(e.authority&&!e.pathname?"/":"")+e.pathname.slice(0,e.pathname.lastIndexOf("/")+1)+t.pathname:e.pathname,r=[],n.replace(/^(\.\.?(\/|$))+/,"").replace(/\/(\.(\/|$))+/g,"/").replace(/\/\.\.$/,"/../").replace(/\/?[^\/]*/g,function(e){"/.."===e?r.pop():r.push(e)}),r.join("").replace(/^\//,"/"===n.charAt(0)?"/":""))+(t.protocol||t.authority||t.pathname?t.search:t.search||e.search)+t.hash:null;var n,r}function _(e){return e.split("#")[0]}function m(e,t){if(e&&"object"==typeof e)if(void 0===t?t=e.id:"string"==typeof e.id&&(t=p(t,e.id),e.id=t),Array.isArray(e))for(var n=0;n<e.length;n++)m(e[n],t);else for(var r in"string"==typeof e.$ref&&(e.$ref=p(t,e.$ref)),e)"enum"!==r&&m(e[r],t)}function y(e){var t=x[e=e||"en"];return function(e){var n=t[e.code]||j[e.code];if("string"!=typeof n)return"Unknown error code "+e.code+": "+JSON.stringify(e.messageParams);var r=e.params;return n.replace(/\{([^{}]*)\}/g,function(e,t){var n=r[t];return"string"==typeof n||"number"==typeof n?n:e})}}l.prototype.validateMultipleOf=function(e,t){var n=t.multipleOf||t.divisibleBy;if(void 0===n)return null;if("number"==typeof e){var r=e/n%1;if(r>=f&&r<d)return this.createError(v.NUMBER_MULTIPLE_OF,{value:e,multipleOf:n},"","",null,e,t)}return null},l.prototype.validateMinMax=function(e,t){if("number"!=typeof e)return null;if(void 0!==t.minimum){if(e<t.minimum)return this.createError(v.NUMBER_MINIMUM,{value:e,minimum:t.minimum},"","/minimum",null,e,t);if(t.exclusiveMinimum&&e===t.minimum)return this.createError(v.NUMBER_MINIMUM_EXCLUSIVE,{value:e,minimum:t.minimum},"","/exclusiveMinimum",null,e,t)}if(void 0!==t.maximum){if(e>t.maximum)return this.createError(v.NUMBER_MAXIMUM,{value:e,maximum:t.maximum},"","/maximum",null,e,t);if(t.exclusiveMaximum&&e===t.maximum)return this.createError(v.NUMBER_MAXIMUM_EXCLUSIVE,{value:e,maximum:t.maximum},"","/exclusiveMaximum",null,e,t)}return null},l.prototype.validateNaN=function(e,t){return"number"!=typeof e?null:!0===isNaN(e)||e===1/0||e===-1/0?this.createError(v.NUMBER_NOT_A_NUMBER,{value:e},"","/type",null,e,t):null},l.prototype.validateString=function(e,t,n){return this.validateStringLength(e,t,n)||this.validateStringPattern(e,t,n)||null},l.prototype.validateStringLength=function(e,t){return"string"!=typeof e?null:void 0!==t.minLength&&e.length<t.minLength?this.createError(v.STRING_LENGTH_SHORT,{length:e.length,minimum:t.minLength},"","/minLength",null,e,t):void 0!==t.maxLength&&e.length>t.maxLength?this.createError(v.STRING_LENGTH_LONG,{length:e.length,maximum:t.maxLength},"","/maxLength",null,e,t):null},l.prototype.validateStringPattern=function(e,t){if("string"!=typeof e||"string"!=typeof t.pattern&&!(t.pattern instanceof RegExp))return null;var n;if(t.pattern instanceof RegExp)n=t.pattern;else{var r,o="",i=t.pattern.match(/^\/(.+)\/([img]*)$/);i?(r=i[1],o=i[2]):r=t.pattern,n=new RegExp(r,o)}return n.test(e)?null:this.createError(v.STRING_PATTERN,{pattern:t.pattern},"","/pattern",null,e,t)},l.prototype.validateArray=function(e,t,n){return Array.isArray(e)&&(this.validateArrayLength(e,t,n)||this.validateArrayUniqueItems(e,t,n)||this.validateArrayItems(e,t,n))||null},l.prototype.validateArrayLength=function(e,t){var n;return void 0!==t.minItems&&e.length<t.minItems&&(n=this.createError(v.ARRAY_LENGTH_SHORT,{length:e.length,minimum:t.minItems},"","/minItems",null,e,t),this.handleError(n))||void 0!==t.maxItems&&e.length>t.maxItems&&(n=this.createError(v.ARRAY_LENGTH_LONG,{length:e.length,maximum:t.maxItems},"","/maxItems",null,e,t),this.handleError(n))?n:null},l.prototype.validateArrayUniqueItems=function(e,t){if(t.uniqueItems)for(var n=0;n<e.length;n++)for(var r=n+1;r<e.length;r++)if(c(e[n],e[r])){var o=this.createError(v.ARRAY_UNIQUE,{match1:n,match2:r},"","/uniqueItems",null,e,t);if(this.handleError(o))return o}return null},l.prototype.validateArrayItems=function(e,t,n){if(void 0===t.items)return null;var r,o;if(Array.isArray(t.items)){for(o=0;o<e.length;o++)if(o<t.items.length){if(r=this.validateAll(e[o],t.items[o],[o],["items",o],n+"/"+o))return r}else if(void 0!==t.additionalItems)if("boolean"==typeof t.additionalItems){if(!t.additionalItems&&(r=this.createError(v.ARRAY_ADDITIONAL_ITEMS,{},"/"+o,"/additionalItems",null,e,t),this.handleError(r)))return r}else if(r=this.validateAll(e[o],t.additionalItems,[o],["additionalItems"],n+"/"+o))return r}else for(o=0;o<e.length;o++)if(r=this.validateAll(e[o],t.items,[o],["items"],n+"/"+o))return r;return null},l.prototype.validateObject=function(e,t,n){return"object"!=typeof e||null===e||Array.isArray(e)?null:this.validateObjectMinMaxProperties(e,t,n)||this.validateObjectRequiredProperties(e,t,n)||this.validateObjectProperties(e,t,n)||this.validateObjectDependencies(e,t,n)||null},l.prototype.validateObjectMinMaxProperties=function(e,t){var n,r=Object.keys(e);return void 0!==t.minProperties&&r.length<t.minProperties&&(n=this.createError(v.OBJECT_PROPERTIES_MINIMUM,{propertyCount:r.length,minimum:t.minProperties},"","/minProperties",null,e,t),this.handleError(n))||void 0!==t.maxProperties&&r.length>t.maxProperties&&(n=this.createError(v.OBJECT_PROPERTIES_MAXIMUM,{propertyCount:r.length,maximum:t.maxProperties},"","/maxProperties",null,e,t),this.handleError(n))?n:null},l.prototype.validateObjectRequiredProperties=function(e,t){if(void 0!==t.required)for(var n=0;n<t.required.length;n++){var r=t.required[n];if(void 0===e[r]){var o=this.createError(v.OBJECT_REQUIRED,{key:r},"","/required/"+n,null,e,t);if(this.handleError(o))return o}}return null},l.prototype.validateObjectProperties=function(e,t,n){var r;for(var o in e){var i=n+"/"+o.replace(/~/g,"~0").replace(/\//g,"~1"),s=!1;if(void 0!==t.properties&&void 0!==t.properties[o]&&(s=!0,r=this.validateAll(e[o],t.properties[o],[o],["properties",o],i)))return r;if(void 0!==t.patternProperties)for(var u in t.patternProperties)if(new RegExp(u).test(o)&&(s=!0,r=this.validateAll(e[o],t.patternProperties[u],[o],["patternProperties",u],i)))return r;if(s)this.trackUnknownProperties&&(this.knownPropertyPaths[i]=!0,delete this.unknownPropertyPaths[i]);else if(void 0!==t.additionalProperties){if(this.trackUnknownProperties&&(this.knownPropertyPaths[i]=!0,delete this.unknownPropertyPaths[i]),"boolean"==typeof t.additionalProperties){if(!t.additionalProperties&&(r=this.createError(v.OBJECT_ADDITIONAL_PROPERTIES,{key:o},"","/additionalProperties",null,e,t).prefixWith(o,null),this.handleError(r)))return r}else if(r=this.validateAll(e[o],t.additionalProperties,[o],["additionalProperties"],i))return r}else this.trackUnknownProperties&&!this.knownPropertyPaths[i]&&(this.unknownPropertyPaths[i]=!0)}return null},l.prototype.validateObjectDependencies=function(e,t,n){var r;if(void 0!==t.dependencies)for(var o in t.dependencies)if(void 0!==e[o]){var i=t.dependencies[o];if("string"==typeof i){if(void 0===e[i]&&(r=this.createError(v.OBJECT_DEPENDENCY_KEY,{key:o,missing:i},"","",null,e,t).prefixWith(null,o).prefixWith(null,"dependencies"),this.handleError(r)))return r}else if(Array.isArray(i))for(var s=0;s<i.length;s++){var u=i[s];if(void 0===e[u]&&(r=this.createError(v.OBJECT_DEPENDENCY_KEY,{key:o,missing:u},"","/"+s,null,e,t).prefixWith(null,o).prefixWith(null,"dependencies"),this.handleError(r)))return r}else if(r=this.validateAll(e,i,[],["dependencies",o],n))return r}return null},l.prototype.validateCombinations=function(e,t,n){return this.validateAllOf(e,t,n)||this.validateAnyOf(e,t,n)||this.validateOneOf(e,t,n)||this.validateNot(e,t,n)||null},l.prototype.validateAllOf=function(e,t,n){if(void 0===t.allOf)return null;for(var r,o=0;o<t.allOf.length;o++){var i=t.allOf[o];if(r=this.validateAll(e,i,[],["allOf",o],n))return r}return null},l.prototype.validateAnyOf=function(e,t,n){if(void 0===t.anyOf)return null;var r,o,i=[],s=this.errors.length;this.trackUnknownProperties&&(r=this.unknownPropertyPaths,o=this.knownPropertyPaths);for(var u=!0,a=0;a<t.anyOf.length;a++){this.trackUnknownProperties&&(this.unknownPropertyPaths={},this.knownPropertyPaths={});var l=t.anyOf[a],c=this.errors.length,f=this.validateAll(e,l,[],["anyOf",a],n);if(null===f&&c===this.errors.length){if(this.errors=this.errors.slice(0,s),this.trackUnknownProperties){for(var d in this.knownPropertyPaths)o[d]=!0,delete r[d];for(var h in this.unknownPropertyPaths)o[h]||(r[h]=!0);u=!1;continue}return null}f&&i.push(f.prefixWith(null,""+a).prefixWith(null,"anyOf"))}return this.trackUnknownProperties&&(this.unknownPropertyPaths=r,this.knownPropertyPaths=o),u?(i=i.concat(this.errors.slice(s)),this.errors=this.errors.slice(0,s),this.createError(v.ANY_OF_MISSING,{},"","/anyOf",i,e,t)):void 0},l.prototype.validateOneOf=function(e,t,n){if(void 0===t.oneOf)return null;var r,o,i=null,s=[],u=this.errors.length;this.trackUnknownProperties&&(r=this.unknownPropertyPaths,o=this.knownPropertyPaths);for(var a=0;a<t.oneOf.length;a++){this.trackUnknownProperties&&(this.unknownPropertyPaths={},this.knownPropertyPaths={});var l=t.oneOf[a],c=this.errors.length,f=this.validateAll(e,l,[],["oneOf",a],n);if(null===f&&c===this.errors.length){if(null!==i)return this.errors=this.errors.slice(0,u),this.createError(v.ONE_OF_MULTIPLE,{index1:i,index2:a},"","/oneOf",null,e,t);if(i=a,this.trackUnknownProperties){for(var d in this.knownPropertyPaths)o[d]=!0,delete r[d];for(var h in this.unknownPropertyPaths)o[h]||(r[h]=!0)}}else f&&s.push(f)}return this.trackUnknownProperties&&(this.unknownPropertyPaths=r,this.knownPropertyPaths=o),null===i?(s=s.concat(this.errors.slice(u)),this.errors=this.errors.slice(0,u),this.createError(v.ONE_OF_MISSING,{},"","/oneOf",s,e,t)):(this.errors=this.errors.slice(0,u),null)},l.prototype.validateNot=function(e,t,n){if(void 0===t.not)return null;var r,o,i=this.errors.length;this.trackUnknownProperties&&(r=this.unknownPropertyPaths,o=this.knownPropertyPaths,this.unknownPropertyPaths={},this.knownPropertyPaths={});var s=this.validateAll(e,t.not,null,null,n),u=this.errors.slice(i);return this.errors=this.errors.slice(0,i),this.trackUnknownProperties&&(this.unknownPropertyPaths=r,this.knownPropertyPaths=o),null===s&&0===u.length?this.createError(v.NOT_PASSED,{},"","/not",null,e,t):null},l.prototype.validateHypermedia=function(e,t,n){if(!t.links)return null;for(var r,o=0;o<t.links.length;o++){var i=t.links[o];if("describedby"===i.rel){for(var s=new a(i.href),u=!0,l=0;l<s.varNames.length;l++)if(!(s.varNames[l]in e)){u=!1;break}if(u){var c={$ref:s.fillFromObject(e)};if(r=this.validateAll(e,c,[],["links",o],n))return r}}}};var v={INVALID_TYPE:0,ENUM_MISMATCH:1,ANY_OF_MISSING:10,ONE_OF_MISSING:11,ONE_OF_MULTIPLE:12,NOT_PASSED:13,NUMBER_MULTIPLE_OF:100,NUMBER_MINIMUM:101,NUMBER_MINIMUM_EXCLUSIVE:102,NUMBER_MAXIMUM:103,NUMBER_MAXIMUM_EXCLUSIVE:104,NUMBER_NOT_A_NUMBER:105,STRING_LENGTH_SHORT:200,STRING_LENGTH_LONG:201,STRING_PATTERN:202,OBJECT_PROPERTIES_MINIMUM:300,OBJECT_PROPERTIES_MAXIMUM:301,OBJECT_REQUIRED:302,OBJECT_ADDITIONAL_PROPERTIES:303,OBJECT_DEPENDENCY_KEY:304,ARRAY_LENGTH_SHORT:400,ARRAY_LENGTH_LONG:401,ARRAY_UNIQUE:402,ARRAY_ADDITIONAL_ITEMS:403,FORMAT_CUSTOM:500,KEYWORD_CUSTOM:501,CIRCULAR_REFERENCE:600,UNKNOWN_PROPERTY:1e3},g={};for(var b in v)g[v[b]]=b;var j={INVALID_TYPE:"Invalid type: {type} (expected {expected})",ENUM_MISMATCH:"No enum match for: {value}",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": indices {index1} and {index2}',NOT_PASSED:'Data matches schema from "not"',NUMBER_MULTIPLE_OF:"Value {value} is not a multiple of {multipleOf}",NUMBER_MINIMUM:"Value {value} is less than minimum {minimum}",NUMBER_MINIMUM_EXCLUSIVE:"Value {value} is equal to exclusive minimum {minimum}",NUMBER_MAXIMUM:"Value {value} is greater than maximum {maximum}",NUMBER_MAXIMUM_EXCLUSIVE:"Value {value} is equal to exclusive maximum {maximum}",NUMBER_NOT_A_NUMBER:"Value {value} is not a valid number",STRING_LENGTH_SHORT:"String is too short ({length} chars), minimum {minimum}",STRING_LENGTH_LONG:"String is too long ({length} chars), maximum {maximum}",STRING_PATTERN:"String does not match pattern: {pattern}",OBJECT_PROPERTIES_MINIMUM:"Too few properties defined ({propertyCount}), minimum {minimum}",OBJECT_PROPERTIES_MAXIMUM:"Too many properties defined ({propertyCount}), maximum {maximum}",OBJECT_REQUIRED:"Missing required property: {key}",OBJECT_ADDITIONAL_PROPERTIES:"Additional properties not allowed",OBJECT_DEPENDENCY_KEY:"Dependency failed - key must exist: {missing} (due to key: {key})",ARRAY_LENGTH_SHORT:"Array is too short ({length}), minimum {minimum}",ARRAY_LENGTH_LONG:"Array is too long ({length}), maximum {maximum}",ARRAY_UNIQUE:"Array items are not unique (indices {match1} and {match2})",ARRAY_ADDITIONAL_ITEMS:"Additional items not allowed",FORMAT_CUSTOM:"Format validation failed ({message})",KEYWORD_CUSTOM:"Keyword failed: {key} ({message})",CIRCULAR_REFERENCE:"Circular $refs: {urls}",UNKNOWN_PROPERTY:"Unknown property (not in schema)"};function w(e,t,n,r,o){if(Error.call(this),void 0===e)throw new Error("No error code supplied: "+r);this.message="",this.params=t,this.code=e,this.dataPath=n||"",this.schemaPath=r||"",this.subErrors=o||null;var i=new Error(this.message);if(this.stack=i.stack||i.stacktrace,!this.stack)try{throw i}catch(i){this.stack=i.stack||i.stacktrace}}w.prototype=Object.create(Error.prototype),w.prototype.constructor=w,w.prototype.name="ValidationError",w.prototype.prefixWith=function(e,t){if(null!==e&&(e=e.replace(/~/g,"~0").replace(/\//g,"~1"),this.dataPath="/"+e+this.dataPath),null!==t&&(t=t.replace(/~/g,"~0").replace(/\//g,"~1"),this.schemaPath="/"+t+this.schemaPath),null!==this.subErrors)for(var n=0;n<this.subErrors.length;n++)this.subErrors[n].prefixWith(e,t);return this};var x={};var E=function e(t){var n,r,o=new l,i={setErrorReporter:function(e){return"string"==typeof e?this.language(e):(r=e,!0)},addFormat:function(){o.addFormat.apply(o,arguments)},language:function(e){return e?(x[e]||(e=e.split("-")[0]),!!x[e]&&(n=e,e)):n},addLanguage:function(e,t){var n;for(n in v)t[n]&&!t[v[n]]&&(t[v[n]]=t[n]);var r=e.split("-")[0];if(x[r])for(n in x[e]=Object.create(x[r]),t)void 0===x[r][n]&&(x[r][n]=t[n]),x[e][n]=t[n];else x[e]=t,x[r]=t;return this},freshApi:function(t){var n=e();return t&&n.language(t),n},validate:function(e,t,i,s){var u=y(n),a=r?function(e,t,n){return r(e,t,n)||u(e,t,n)}:u,c=new l(o,!1,a,i,s);"string"==typeof t&&(t={$ref:t}),c.addSchema("",t);var f=c.validateAll(e,t,null,null,"");return!f&&s&&(f=c.banUnknownProperties(e,t)),this.error=f,this.missing=c.missing,this.valid=null===f,this.valid},validateResult:function(){var e={toString:function(){return this.valid?"valid":this.error.message}};return this.validate.apply(e,arguments),e},validateMultiple:function(e,t,i,s){var u=y(n),a=r?function(e,t,n){return r(e,t,n)||u(e,t,n)}:u,c=new l(o,!0,a,i,s);"string"==typeof t&&(t={$ref:t}),c.addSchema("",t),c.validateAll(e,t,null,null,""),s&&c.banUnknownProperties(e,t);var f={toString:function(){return this.valid?"valid":this.error.message}};return f.errors=c.errors,f.missing=c.missing,f.valid=0===f.errors.length,f},addSchema:function(){return o.addSchema.apply(o,arguments)},getSchema:function(){return o.getSchema.apply(o,arguments)},getSchemaMap:function(){return o.getSchemaMap.apply(o,arguments)},getSchemaUris:function(){return o.getSchemaUris.apply(o,arguments)},getMissingUris:function(){return o.getMissingUris.apply(o,arguments)},dropSchemas:function(){o.dropSchemas.apply(o,arguments)},defineKeyword:function(){o.defineKeyword.apply(o,arguments)},defineError:function(e,t,n){if("string"!=typeof e||!/^[A-Z]+(_[A-Z]+)*$/.test(e))throw new Error("Code name must be a string in UPPER_CASE_WITH_UNDERSCORES");if("number"!=typeof t||t%1!=0||t<1e4)throw new Error("Code number must be an integer > 10000");if(void 0!==v[e])throw new Error("Error already defined: "+e+" as "+v[e]);if(void 0!==g[t])throw new Error("Error code already used: "+g[t]+" as "+t);for(var r in v[e]=t,g[t]=e,j[e]=j[t]=n,x){var o=x[r];o[e]&&(o[t]=o[t]||o[e])}},reset:function(){o.reset(),this.error=null,this.missing=[],this.valid=!0},missing:[],error:null,valid:!0,normSchema:m,resolveUrl:p,getDocumentUri:_,errorCodes:v};return i.language(t||"en"),i}();return E.addLanguage("en-gb",j),E.tv4=E,E},void 0===(r=n.apply(t,[]))||(e.exports=r)},906:(e,t,n)=>{e.exports=n(288).ObjectPath},913:()=>{!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s="./index.js")}({"./index.js":function(e,t,n){"use strict";(function(t){var r=n("./node_modules/lodash/lodash.js"),o=n("./node_modules/graphlib/index.js"),i=n("./node_modules/webpack/node_modules/path-browserify/index.js"),s=n("./node_modules/path-loader/index.js"),u=n("./node_modules/querystring-es3/index.js"),a=n("./node_modules/slash/index.js"),l=n("./node_modules/uri-js/dist/es5/uri.all.js"),c=/~(?:[^01]|$)/g,f={},d=["relative","remote"],h=["absolute","uri"],p={};function _(e,t){r.isString(e)&&(e=a(e)),r.isString(t)&&(t=a(t));var n,o,s=O(r.isUndefined(t)?"":t);return h.indexOf(s.reference)>-1?o=s:(n=r.isUndefined(e)?void 0:O(e),r.isUndefined(n)?o=s:((o=n).path=a(i.join(n.path,s.path)),o.query=function(e,t){var n={};function o(e){r.forOwn(e,function(e,t){n[t]=e})}return o(u.parse(e||"")),o(u.parse(t||"")),0===Object.keys(n).length?void 0:u.stringify(n)}(n.query,s.query))),o.fragment=void 0,(-1===h.indexOf(o.reference)&&0===o.path.indexOf("../")?"../":"")+l.serialize(o)}function m(e){return d.indexOf(b(e))>-1}function y(e){return r.isUndefined(e.error)&&"invalid"!==e.type}function v(e,t){var n=e;return t.forEach(function(e){if(!(e in n))throw Error("JSON Pointer points to missing location: "+M(t));n=n[e]}),n}function g(e){return Object.keys(e).filter(function(e){return"$ref"!==e})}function b(e){var t;switch(e.uriDetails.reference){case"absolute":case"uri":t="remote";break;case"same-document":t="local";break;default:t=e.uriDetails.reference}return t}function j(e,t){var n=f[e],o=Promise.resolve(),i=r.cloneDeep(t.loaderOptions||{});return r.isUndefined(n)?(r.isUndefined(i.processContent)&&(i.processContent=function(e,t){t(void 0,JSON.parse(e.text))}),o=(o=s.load(decodeURI(e),i)).then(function(t){return f[e]={value:t},t}).catch(function(t){throw f[e]={error:t},t})):o=o.then(function(){if(r.isError(n.error))throw n.error;return n.value}),o.then(function(e){return r.cloneDeep(e)})}function w(e,t){var n=!0;try{if(!r.isPlainObject(e))throw new Error("obj is not an Object");if(!r.isString(e.$ref))throw new Error("obj.$ref is not a String")}catch(e){if(t)throw e;n=!1}return n}function x(e){return-1!==e.indexOf("://")||i.isAbsolute(e)?e:i.resolve(t.cwd(),e)}function E(e,t){e.error=t.message,e.missing=!0}function O(e){return l.parse(e)}function S(e,t,n){var o,s,u=Promise.resolve(),a=M(t.subDocPath),l=x(t.location),c=i.dirname(t.location),f=l+a;return r.isUndefined(n.docs[l])&&(n.docs[l]=e),r.isUndefined(n.deps[f])&&(n.deps[f]={},o=C(e,t),r.forOwn(o,function(o,i){var l,d,h=x(t.location)+i,p=o.refdId=decodeURI(x(m(o)?_(c,o.uri):t.location)+"#"+(o.uri.indexOf("#")>-1?o.uri.split("#")[1]:""));n.refs[h]=o,y(o)&&(o.fqURI=p,n.deps[f][i===a?"#":i.replace(a+"/","#/")]=p,0!==h.indexOf(p+"/")&&h!==p?((s=r.cloneDeep(t)).subDocPath=r.isUndefined(o.uriDetails.fragment)?[]:U(decodeURI(o.uriDetails.fragment)),m(o)?(delete s.filter,s.location=p.split("#")[0],u=u.then((l=n,d=s,function(){var e=x(d.location),t=l.docs[e];return r.isUndefined(t)?j(e,d).catch(function(t){return l.docs[e]=t,t}):Promise.resolve().then(function(){return t})}))):u=u.then(function(){return e}),u=u.then(function(e,t,n){return function(o){if(r.isError(o))E(n,o);else try{return S(o,t,e).catch(function(e){E(n,e)})}catch(e){E(n,e)}}}(n,s,o))):o.circular=!0)})),u}function A(e,t,n){v(e,t.slice(0,t.length-1))[t[t.length-1]]=n}function T(e,t,n,o){var i=!0;function s(t,r){n.push(r),T(e,t,n,o),n.pop()}r.isFunction(o)&&(i=o(e,t,n)),-1===e.indexOf(t)&&(e.push(t),!1!==i&&(r.isArray(t)?t.forEach(function(e,t){s(e,t.toString())}):r.isObject(t)&&r.forOwn(t,function(e,t){s(e,t)})),e.pop())}function P(e,t){var n,o;if(e=r.isUndefined(e)?{}:r.cloneDeep(e),!r.isObject(e))throw new TypeError("options must be an Object");if(!r.isUndefined(e.resolveCirculars)&&!r.isBoolean(e.resolveCirculars))throw new TypeError("options.resolveCirculars must be a Boolean");if(!(r.isUndefined(e.filter)||r.isArray(e.filter)||r.isFunction(e.filter)||r.isString(e.filter)))throw new TypeError("options.filter must be an Array, a Function of a String");if(!r.isUndefined(e.includeInvalid)&&!r.isBoolean(e.includeInvalid))throw new TypeError("options.includeInvalid must be a Boolean");if(!r.isUndefined(e.location)&&!r.isString(e.location))throw new TypeError("options.location must be a String");if(!r.isUndefined(e.refPreProcessor)&&!r.isFunction(e.refPreProcessor))throw new TypeError("options.refPreProcessor must be a Function");if(!r.isUndefined(e.refPostProcessor)&&!r.isFunction(e.refPostProcessor))throw new TypeError("options.refPostProcessor must be a Function");if(!r.isUndefined(e.subDocPath)&&!r.isArray(e.subDocPath)&&!N(e.subDocPath))throw new TypeError("options.subDocPath must be an Array of path segments or a valid JSON Pointer");if(r.isUndefined(e.resolveCirculars)&&(e.resolveCirculars=!1),e.filter=function(e){var t,n;return r.isArray(e.filter)||r.isString(e.filter)?(n=r.isString(e.filter)?[e.filter]:e.filter,t=function(e){return n.indexOf(e.type)>-1||n.indexOf(b(e))>-1}):r.isFunction(e.filter)?t=e.filter:r.isUndefined(e.filter)&&(t=function(){return!0}),function(n,r){return("invalid"!==n.type||!0===e.includeInvalid)&&t(n,r)}}(e),r.isUndefined(e.location)&&(e.location=x("./root.json")),(n=e.location.split("#")).length>1&&(e.subDocPath="#"+n[1]),o=decodeURI(e.location)===e.location,e.location=_(e.location,void 0),o&&(e.location=decodeURI(e.location)),e.subDocPath=function(e){var t;return r.isArray(e.subDocPath)?t=e.subDocPath:r.isString(e.subDocPath)?t=U(e.subDocPath):r.isUndefined(e.subDocPath)&&(t=[]),t}(e),!r.isUndefined(t))try{v(t,e.subDocPath)}catch(e){throw e.message=e.message.replace("JSON Pointer","options.subDocPath"),e}return e}function I(e){if(!r.isArray(e))throw new TypeError("path must be an array");return e.map(function(e){return r.isString(e)||(e=JSON.stringify(e)),e.replace(/~1/g,"/").replace(/~0/g,"~")})}function k(e){if(!r.isArray(e))throw new TypeError("path must be an array");return e.map(function(e){return r.isString(e)||(e=JSON.stringify(e)),e.replace(/~/g,"~0").replace(/\//g,"~1")})}function C(e,t){var n={};if(!r.isArray(e)&&!r.isObject(e))throw new TypeError("obj must be an Array or an Object");return T(function(e,t){var n,r=[];return t.length>0&&(n=e,t.slice(0,t.length-1).forEach(function(e){e in n&&(n=n[e],r.push(n))})),r}(e,(t=P(t,e)).subDocPath),v(e,t.subDocPath),r.cloneDeep(t.subDocPath),function(e,o,i){var s,u,a=!0;return w(o)&&(r.isUndefined(t.refPreProcessor)||(o=t.refPreProcessor(r.cloneDeep(o),i)),s=R(o),r.isUndefined(t.refPostProcessor)||(s=t.refPostProcessor(s,i)),t.filter(s,i)&&(u=M(i),n[u]=s),g(o).length>0&&(a=!1)),a}),n}function R(e){var t,n,o,i={def:e};try{if(w(e,!0),t=e.$ref,o=p[t],r.isUndefined(o)&&(o=p[t]=O(t)),i.uri=t,i.uriDetails=o,r.isUndefined(o.error)){i.type=b(i);try{["#","/"].indexOf(t[0])>-1?N(t,!0):t.indexOf("#")>-1&&N(o.fragment,!0)}catch(e){i.error=e.message,i.type="invalid"}}else i.error=i.uriDetails.error,i.type="invalid";(n=g(e)).length>0&&(i.warning="Extra JSON Reference properties will be ignored: "+n.join(", "))}catch(e){i.error=e.message,i.type="invalid"}return i}function N(e,t){var n,o=!0;try{if(!r.isString(e))throw new Error("ptr is not a String");if(""!==e){if(n=e.charAt(0),-1===["#","/"].indexOf(n))throw new Error("ptr must start with a / or #/");if("#"===n&&"#"!==e&&"/"!==e.charAt(1))throw new Error("ptr must start with a / or #/");if(e.match(c))throw new Error("ptr has invalid token(s)")}}catch(e){if(!0===t)throw e;o=!1}return o}function U(e){try{N(e,!0)}catch(e){throw new Error("ptr must be a JSON Pointer: "+e.message)}var t=e.split("/");return t.shift(),I(t)}function M(e,t){if(!r.isArray(e))throw new Error("path must be an Array");return(!1!==t?"#":"")+(e.length>0?"/":"")+k(e).join("/")}function D(e,t){var n=Promise.resolve();return n.then(function(){if(!r.isArray(e)&&!r.isObject(e))throw new TypeError("obj must be an Array or an Object");t=P(t,e),e=r.cloneDeep(e)}).then(function(){var n={deps:{},docs:{},refs:{}};return S(e,t,n).then(function(){return n})}).then(function(e){var n={},s=[],u=[],a=new o.Graph,l=x(t.location),c=l+M(t.subDocPath),f=i.dirname(l);function d(r,o,i){var s,u=o.split("#"),a=e.refs[o];n[u[0]===t.location?"#"+u[1]:M(t.subDocPath.concat(i))]=a,!a.circular&&y(a)?(s=e.deps[a.refdId],0!==a.refdId.indexOf(r)&&Object.keys(s).forEach(function(e){d(a.refdId,a.refdId+e.substr(1),i.concat(U(e)))})):!a.circular&&a.error&&(a.error=a.error.replace("options.subDocPath","JSON Pointer"),a.error.indexOf("#")>-1&&(a.error=a.error.replace(a.uri.substr(a.uri.indexOf("#")),a.uri)),0!==a.error.indexOf("ENOENT:")&&0!==a.error.indexOf("Not Found")||(a.error="JSON Pointer points to missing location: "+a.uri))}return Object.keys(e.deps).forEach(function(e){a.setNode(e)}),r.forOwn(e.deps,function(e,t){r.forOwn(e,function(e){a.setEdge(t,e)})}),(s=o.alg.findCycles(a)).forEach(function(e){e.forEach(function(e){-1===u.indexOf(e)&&u.push(e)})}),r.forOwn(e.deps,function(t,n){r.forOwn(t,function(t,r){var o,i=!1,a=n+r.slice(1),l=e.refs[n+r.slice(1)],c=m(l);u.indexOf(t)>-1&&s.forEach(function(e){i||(o=e.indexOf(t))>-1&&e.forEach(function(n){i||0===a.indexOf(n+"/")&&(c&&o!==e.length-1&&"#"===t[t.length-1]||(i=!0))})}),i&&(l.circular=!0)})}),r.forOwn(Object.keys(e.deps).reverse(),function(n){var o=e.deps[n],i=n.split("#"),s=e.docs[i[0]],u=U(i[1]);r.forOwn(o,function(n,o){var a=n.split("#"),l=e.docs[a[0]],c=u.concat(U(o)),f=e.refs[i[0]+M(c)];if(r.isUndefined(f.error)&&r.isUndefined(f.missing))if(!t.resolveCirculars&&f.circular)f.value=r.cloneDeep(f.def);else{try{f.value=v(l,U(a[1]))}catch(e){return void E(f,e)}""===i[1]&&"#"===o?e.docs[i[0]]=f.value:A(s,c,f.value)}})}),Object.keys(e.refs).forEach(function(t){var n,o,i=e.refs[t];"invalid"!==i.type&&("#"===i.fqURI[i.fqURI.length-1]&&"#"!==i.uri[i.uri.length-1]&&(i.fqURI=i.fqURI.substr(0,i.fqURI.length-1)),n=i.fqURI.split("/"),o=i.uri.split("/"),r.times(o.length-1,function(e){var t=o[o.length-e-1],r=o[o.length-e],i=n.length-e-1;"."!==t&&".."!==t&&".."!==r&&(n[i]=t)}),i.fqURI=n.join("/"),0===i.fqURI.indexOf(l)?i.fqURI=i.fqURI.replace(l,""):0===i.fqURI.indexOf(f)&&(i.fqURI=i.fqURI.replace(f,"")),"/"===i.fqURI[0]&&(i.fqURI="."+i.fqURI)),0===t.indexOf(c)&&d(c,t,U(t.substr(c.length)))}),r.forOwn(n,function(t,n){delete t.refdId,t.circular&&"local"===t.type&&(t.value.$ref=t.fqURI,A(e.docs[l],U(n),t.value)),t.missing&&(t.error=t.error.split(": ")[0]+": "+t.def.$ref)}),{refs:n,resolved:e.docs[l]}})}"undefined"==typeof Promise&&n("./node_modules/native-promise-only/lib/npo.src.js"),e.exports.clearCache=function(){f={}},e.exports.decodePath=function(e){return I(e)},e.exports.encodePath=function(e){return k(e)},e.exports.findRefs=function(e,t){return C(e,t)},e.exports.findRefsAt=function(e,t){return function(e,t){return Promise.resolve().then(function(){if(!r.isString(e))throw new TypeError("location must be a string");return r.isUndefined(t)&&(t={}),r.isObject(t)&&(t.location=e),j((t=P(t)).location,t)}).then(function(e){var n=r.cloneDeep(f[t.location]),o=r.cloneDeep(t);return r.isUndefined(n.refs)&&(delete o.filter,delete o.subDocPath,o.includeInvalid=!0,f[t.location].refs=C(e,o)),r.isUndefined(t.filter)||(o.filter=t.filter),{refs:C(e,o),value:e}})}(e,t)},e.exports.getRefDetails=function(e){return R(e)},e.exports.isPtr=function(e,t){return N(e,t)},e.exports.isRef=function(e,t){return function(e,t){return w(e,t)&&"invalid"!==R(e).type}(e,t)},e.exports.pathFromPtr=function(e){return U(e)},e.exports.pathToPtr=function(e,t){return M(e,t)},e.exports.resolveRefs=function(e,t){return D(e,t)},e.exports.resolveRefsAt=function(e,t){return function(e,t){return Promise.resolve().then(function(){if(!r.isString(e))throw new TypeError("location must be a string");return r.isUndefined(t)&&(t={}),r.isObject(t)&&(t.location=e),j((t=P(t)).location,t)}).then(function(e){return D(e,t).then(function(t){return{refs:t.refs,resolved:t.resolved,value:e}})})}(e,t)}}).call(this,n("./node_modules/process/browser.js"))},"./node_modules/component-emitter/index.js":function(e,t,n){function r(e){if(e)return function(e){for(var t in r.prototype)e[t]=r.prototype[t];return e}(e)}e.exports=r,r.prototype.on=r.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},r.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},r.prototype.off=r.prototype.removeListener=r.prototype.removeAllListeners=r.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n,r=this._callbacks["$"+e];if(!r)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var o=0;o<r.length;o++)if((n=r[o])===t||n.fn===t){r.splice(o,1);break}return this},r.prototype.emit=function(e){this._callbacks=this._callbacks||{};var t=[].slice.call(arguments,1),n=this._callbacks["$"+e];if(n)for(var r=0,o=(n=n.slice(0)).length;r<o;++r)n[r].apply(this,t);return this},r.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},r.prototype.hasListeners=function(e){return!!this.listeners(e).length}},"./node_modules/graphlib/index.js":function(e,t,n){var r=n("./node_modules/graphlib/lib/index.js");e.exports={Graph:r.Graph,json:n("./node_modules/graphlib/lib/json.js"),alg:n("./node_modules/graphlib/lib/alg/index.js"),version:r.version}},"./node_modules/graphlib/lib/alg/components.js":function(e,t,n){var r=n("./node_modules/graphlib/lib/lodash.js");e.exports=function(e){var t,n={},o=[];function i(o){r.has(n,o)||(n[o]=!0,t.push(o),r.each(e.successors(o),i),r.each(e.predecessors(o),i))}return r.each(e.nodes(),function(e){t=[],i(e),t.length&&o.push(t)}),o}},"./node_modules/graphlib/lib/alg/dfs.js":function(e,t,n){var r=n("./node_modules/graphlib/lib/lodash.js");function o(e,t,n,i,s,u){r.has(i,t)||(i[t]=!0,n||u.push(t),r.each(s(t),function(t){o(e,t,n,i,s,u)}),n&&u.push(t))}e.exports=function(e,t,n){r.isArray(t)||(t=[t]);var i=(e.isDirected()?e.successors:e.neighbors).bind(e),s=[],u={};return r.each(t,function(t){if(!e.hasNode(t))throw new Error("Graph does not have node: "+t);o(e,t,"post"===n,u,i,s)}),s}},"./node_modules/graphlib/lib/alg/dijkstra-all.js":function(e,t,n){var r=n("./node_modules/graphlib/lib/alg/dijkstra.js"),o=n("./node_modules/graphlib/lib/lodash.js");e.exports=function(e,t,n){return o.transform(e.nodes(),function(o,i){o[i]=r(e,i,t,n)},{})}},"./node_modules/graphlib/lib/alg/dijkstra.js":function(e,t,n){var r=n("./node_modules/graphlib/lib/lodash.js"),o=n("./node_modules/graphlib/lib/data/priority-queue.js");e.exports=function(e,t,n,r){return function(e,t,n,r){var i,s,u={},a=new o,l=function(e){var t=e.v!==i?e.v:e.w,r=u[t],o=n(e),l=s.distance+o;if(o<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+e+" Weight: "+o);l<r.distance&&(r.distance=l,r.predecessor=i,a.decrease(t,l))};for(e.nodes().forEach(function(e){var n=e===t?0:Number.POSITIVE_INFINITY;u[e]={distance:n},a.add(e,n)});a.size()>0&&(i=a.removeMin(),(s=u[i]).distance!==Number.POSITIVE_INFINITY);)r(i).forEach(l);return u}(e,String(t),n||i,r||function(t){return e.outEdges(t)})};var i=r.constant(1)},"./node_modules/graphlib/lib/alg/find-cycles.js":function(e,t,n){var r=n("./node_modules/graphlib/lib/lodash.js"),o=n("./node_modules/graphlib/lib/alg/tarjan.js");e.exports=function(e){return r.filter(o(e),function(t){return t.length>1||1===t.length&&e.hasEdge(t[0],t[0])})}},"./node_modules/graphlib/lib/alg/floyd-warshall.js":function(e,t,n){var r=n("./node_modules/graphlib/lib/lodash.js");e.exports=function(e,t,n){return function(e,t,n){var r={},o=e.nodes();return o.forEach(function(e){r[e]={},r[e][e]={distance:0},o.forEach(function(t){e!==t&&(r[e][t]={distance:Number.POSITIVE_INFINITY})}),n(e).forEach(function(n){var o=n.v===e?n.w:n.v,i=t(n);r[e][o]={distance:i,predecessor:e}})}),o.forEach(function(e){var t=r[e];o.forEach(function(n){var i=r[n];o.forEach(function(n){var r=i[e],o=t[n],s=i[n],u=r.distance+o.distance;u<s.distance&&(s.distance=u,s.predecessor=o.predecessor)})})}),r}(e,t||o,n||function(t){return e.outEdges(t)})};var o=r.constant(1)},"./node_modules/graphlib/lib/alg/index.js":function(e,t,n){e.exports={components:n("./node_modules/graphlib/lib/alg/components.js"),dijkstra:n("./node_modules/graphlib/lib/alg/dijkstra.js"),dijkstraAll:n("./node_modules/graphlib/lib/alg/dijkstra-all.js"),findCycles:n("./node_modules/graphlib/lib/alg/find-cycles.js"),floydWarshall:n("./node_modules/graphlib/lib/alg/floyd-warshall.js"),isAcyclic:n("./node_modules/graphlib/lib/alg/is-acyclic.js"),postorder:n("./node_modules/graphlib/lib/alg/postorder.js"),preorder:n("./node_modules/graphlib/lib/alg/preorder.js"),prim:n("./node_modules/graphlib/lib/alg/prim.js"),tarjan:n("./node_modules/graphlib/lib/alg/tarjan.js"),topsort:n("./node_modules/graphlib/lib/alg/topsort.js")}},"./node_modules/graphlib/lib/alg/is-acyclic.js":function(e,t,n){var r=n("./node_modules/graphlib/lib/alg/topsort.js");e.exports=function(e){try{r(e)}catch(e){if(e instanceof r.CycleException)return!1;throw e}return!0}},"./node_modules/graphlib/lib/alg/postorder.js":function(e,t,n){var r=n("./node_modules/graphlib/lib/alg/dfs.js");e.exports=function(e,t){return r(e,t,"post")}},"./node_modules/graphlib/lib/alg/preorder.js":function(e,t,n){var r=n("./node_modules/graphlib/lib/alg/dfs.js");e.exports=function(e,t){return r(e,t,"pre")}},"./node_modules/graphlib/lib/alg/prim.js":function(e,t,n){var r=n("./node_modules/graphlib/lib/lodash.js"),o=n("./node_modules/graphlib/lib/graph.js"),i=n("./node_modules/graphlib/lib/data/priority-queue.js");e.exports=function(e,t){var n,s=new o,u={},a=new i;function l(e){var r=e.v===n?e.w:e.v,o=a.priority(r);if(void 0!==o){var i=t(e);i<o&&(u[r]=n,a.decrease(r,i))}}if(0===e.nodeCount())return s;r.each(e.nodes(),function(e){a.add(e,Number.POSITIVE_INFINITY),s.setNode(e)}),a.decrease(e.nodes()[0],0);for(var c=!1;a.size()>0;){if(n=a.removeMin(),r.has(u,n))s.setEdge(n,u[n]);else{if(c)throw new Error("Input graph is not connected: "+e);c=!0}e.nodeEdges(n).forEach(l)}return s}},"./node_modules/graphlib/lib/alg/tarjan.js":function(e,t,n){var r=n("./node_modules/graphlib/lib/lodash.js");e.exports=function(e){var t=0,n=[],o={},i=[];function s(u){var a=o[u]={onStack:!0,lowlink:t,index:t++};if(n.push(u),e.successors(u).forEach(function(e){r.has(o,e)?o[e].onStack&&(a.lowlink=Math.min(a.lowlink,o[e].index)):(s(e),a.lowlink=Math.min(a.lowlink,o[e].lowlink))}),a.lowlink===a.index){var l,c=[];do{l=n.pop(),o[l].onStack=!1,c.push(l)}while(u!==l);i.push(c)}}return e.nodes().forEach(function(e){r.has(o,e)||s(e)}),i}},"./node_modules/graphlib/lib/alg/topsort.js":function(e,t,n){var r=n("./node_modules/graphlib/lib/lodash.js");function o(e){var t={},n={},o=[];if(r.each(e.sinks(),function s(u){if(r.has(n,u))throw new i;r.has(t,u)