Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

indexeddb-fs

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

indexeddb-fs - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

3

dist/core/create-fs/create-fs.types.d.ts

@@ -15,3 +15,2 @@ import { FileEntry, DirectoryEntry } from "../../types";

rootDirectoryName: string;
hasRootDirectory: boolean;
remove: (fullPath: string) => Promise<void>;

@@ -21,6 +20,4 @@ exists: (fullPath: string) => Promise<boolean>;

removeFile: (fullPath: string) => Promise<void>;
createRootDirectory: () => Promise<DirectoryEntry>;
isDirectory: (fullPath: string) => Promise<boolean>;
removeDirectory: (fullPath: string) => Promise<void>;
createRootDirectoryIfDoesNotExist: () => Promise<void>;
createDirectory: (fullPath: string) => Promise<DirectoryEntry>;

@@ -27,0 +24,0 @@ readFile: <TData = any>(fullPath: string) => Promise<FileEntry<TData>>;

2

dist/core/create-fs/parts/read-directory-decorator/read-directory-decorator.types.d.ts

@@ -9,6 +9,6 @@ import { FileEntry, DirectoryEntry } from "../../../../types";

isEmpty: boolean;
files: FileEntry[];
filesCount: number;
directoriesCount: number;
directories: DirectoryEntry[];
files: Omit<FileEntry, 'data'>[];
}
import { FileEntry, DirectoryEntry } from "./types";
import { createFs, CreateFsProps, CreateFsOutput } from "./core";
export { createFs, FileEntry, DirectoryEntry, CreateFsProps, CreateFsOutput };
declare const fs: CreateFsOutput;
export default fs;

@@ -15,3 +15,3 @@ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["indexeddb-fs"]={})}(this,(function(e){"use strict";

PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */function t(e,t,r,n){return new(r||(r=Promise))((function(o,a){function i(e){try{u(n.next(e))}catch(e){a(e)}}function s(e){try{u(n.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,s)}u((n=n.apply(e,t||[])).next())}))}function r(e,t){var r,n,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;i;)try{if(r=1,n&&(o=2&a[0]?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,n=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],n=0}finally{r=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}}var n=function(e){return"string"==typeof e||e instanceof String},o=new RegExp("^([A-Za-z]:|[A-Za-z0-9_-]+(.[A-Za-z0-9_-]+)*)((/[A-Za-z0-9_.-]+)+)$");function a(e){if(e.__esModule)return e;var t=Object.defineProperty({},"__esModule",{value:!0});return Object.keys(e).forEach((function(r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})})),t}
/*! https://mths.be/punycode v1.4.1 by @mathias */var i=2147483647,s=/[^\x20-\x7E]/,u=/[\x2E\u3002\uFF0E\uFF61]/g,c={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},h=Math.floor,f=String.fromCharCode;function l(e){throw new RangeError(c[e])}function m(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function d(e,t,r){var n=0;for(e=r?h(e/700):e>>1,e+=h(e/t);e>455;n+=36)e=h(e/35);return h(n+36*e/(e+38))}function p(e){return function(e,t){var r=e.split("@"),n="";r.length>1&&(n=r[0]+"@",e=r[1]);var o=function(e,t){for(var r=e.length,n=[];r--;)n[r]=t(e[r]);return n}((e=e.replace(u,".")).split("."),t).join(".");return n+o}(e,(function(e){return s.test(e)?"xn--"+function(e){var t,r,n,o,a,s,u,c,p,v,y,b,g,w,A,x=[];for(b=(e=function(e){for(var t,r,n=[],o=0,a=e.length;o<a;)(t=e.charCodeAt(o++))>=55296&&t<=56319&&o<a?56320==(64512&(r=e.charCodeAt(o++)))?n.push(((1023&t)<<10)+(1023&r)+65536):(n.push(t),o--):n.push(t);return n}(e)).length,t=128,r=0,a=72,s=0;s<b;++s)(y=e[s])<128&&x.push(f(y));for(n=o=x.length,o&&x.push("-");n<b;){for(u=i,s=0;s<b;++s)(y=e[s])>=t&&y<u&&(u=y);for(u-t>h((i-r)/(g=n+1))&&l("overflow"),r+=(u-t)*g,t=u,s=0;s<b;++s)if((y=e[s])<t&&++r>i&&l("overflow"),y==t){for(c=r,p=36;!(c<(v=p<=a?1:p>=a+26?26:p-a));p+=36)A=c-v,w=36-v,x.push(f(m(v+A%w,0))),c=h(A/w);x.push(f(m(c,0))),a=d(r,g,n==o),r=0,++n}++r,++t}return x.join("")}(e):e}))}function v(e){return null===e}function y(e){return"string"==typeof e}function b(e){return"object"==typeof e&&null!==e}function g(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var w=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};function A(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}}function x(e,t){if(e.map)return e.map(t);for(var r=[],n=0;n<e.length;n++)r.push(t(e[n],n));return r}var E=Object.keys||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.push(r);return t};function j(e,t,r,n){t=t||"&",r=r||"=";var o={};if("string"!=typeof e||0===e.length)return o;var a=/\+/g;e=e.split(t);var i=1e3;n&&"number"==typeof n.maxKeys&&(i=n.maxKeys);var s=e.length;i>0&&s>i&&(s=i);for(var u=0;u<s;++u){var c,h,f,l,m=e[u].replace(a,"%20"),d=m.indexOf(r);d>=0?(c=m.substr(0,d),h=m.substr(d+1)):(c=m,h=""),f=decodeURIComponent(c),l=decodeURIComponent(h),g(o,f)?w(o[f])?o[f].push(l):o[f]=[o[f],l]:o[f]=l}return o}var O={parse:q,resolve:T,resolveObject:U,format:V,Url:S};function S(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var F=/^([a-z0-9.+-]+:)/i,z=/:[0-9]*$/,P=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,N=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),$=["'"].concat(N),D=["%","/","?",";","#"].concat($),Z=["/","?","#"],R=/^[+a-z0-9A-Z_-]{0,63}$/,I=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,C={javascript:!0,"javascript:":!0},k={javascript:!0,"javascript:":!0},_={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function q(e,t,r){if(e&&b(e)&&e instanceof S)return e;var n=new S;return n.parse(e,t,r),n}function M(e,t,r,n){if(!y(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var o=t.indexOf("?"),a=-1!==o&&o<t.indexOf("#")?"?":"#",i=t.split(a);i[0]=i[0].replace(/\\/g,"/");var s=t=i.join(a);if(s=s.trim(),!n&&1===t.split("#").length){var u=P.exec(s);if(u)return e.path=s,e.href=s,e.pathname=u[1],u[2]?(e.search=u[2],e.query=r?j(e.search.substr(1)):e.search.substr(1)):r&&(e.search="",e.query={}),e}var c,h,f,l,m=F.exec(s);if(m){var d=(m=m[0]).toLowerCase();e.protocol=d,s=s.substr(m.length)}if(n||m||s.match(/^\/\/[^@\/]+@[^@\/]+/)){var v="//"===s.substr(0,2);!v||m&&k[m]||(s=s.substr(2),e.slashes=!0)}if(!k[m]&&(v||m&&!_[m])){var b,g,w=-1;for(c=0;c<Z.length;c++)-1!==(h=s.indexOf(Z[c]))&&(-1===w||h<w)&&(w=h);for(-1!==(g=-1===w?s.lastIndexOf("@"):s.lastIndexOf("@",w))&&(b=s.slice(0,g),s=s.slice(g+1),e.auth=decodeURIComponent(b)),w=-1,c=0;c<D.length;c++)-1!==(h=s.indexOf(D[c]))&&(-1===w||h<w)&&(w=h);-1===w&&(w=s.length),e.host=s.slice(0,w),s=s.slice(w),B(e),e.hostname=e.hostname||"";var A="["===e.hostname[0]&&"]"===e.hostname[e.hostname.length-1];if(!A){var x=e.hostname.split(/\./);for(c=0,f=x.length;c<f;c++){var E=x[c];if(E&&!E.match(R)){for(var O="",S=0,z=E.length;S<z;S++)E.charCodeAt(S)>127?O+="x":O+=E[S];if(!O.match(R)){var N=x.slice(0,c),q=x.slice(c+1),M=E.match(I);M&&(N.push(M[1]),q.unshift(M[2])),q.length&&(s="/"+q.join(".")+s),e.hostname=N.join(".");break}}}}e.hostname.length>255?e.hostname="":e.hostname=e.hostname.toLowerCase(),A||(e.hostname=p(e.hostname)),l=e.port?":"+e.port:"";var V=e.hostname||"";e.host=V+l,e.href+=e.host,A&&(e.hostname=e.hostname.substr(1,e.hostname.length-2),"/"!==s[0]&&(s="/"+s))}if(!C[d])for(c=0,f=$.length;c<f;c++){var T=$[c];if(-1!==s.indexOf(T)){var U=encodeURIComponent(T);U===T&&(U=escape(T)),s=s.split(T).join(U)}}var J=s.indexOf("#");-1!==J&&(e.hash=s.substr(J),s=s.slice(0,J));var Y=s.indexOf("?");if(-1!==Y?(e.search=s.substr(Y),e.query=s.substr(Y+1),r&&(e.query=j(e.query)),s=s.slice(0,Y)):r&&(e.search="",e.query={}),s&&(e.pathname=s),_[d]&&e.hostname&&!e.pathname&&(e.pathname="/"),e.pathname||e.search){l=e.pathname||"";var G=e.search||"";e.path=l+G}return e.href=L(e),e}function V(e){return y(e)&&(e=M({},e)),L(e)}function L(e){var t=e.auth||"";t&&(t=(t=encodeURIComponent(t)).replace(/%3A/i,":"),t+="@");var r=e.protocol||"",n=e.pathname||"",o=e.hash||"",a=!1,i="";e.host?a=t+e.host:e.hostname&&(a=t+(-1===e.hostname.indexOf(":")?e.hostname:"["+this.hostname+"]"),e.port&&(a+=":"+e.port)),e.query&&b(e.query)&&Object.keys(e.query).length&&(i=function(e,t,r,n){return t=t||"&",r=r||"=",null===e&&(e=void 0),"object"==typeof e?x(E(e),(function(n){var o=encodeURIComponent(A(n))+r;return w(e[n])?x(e[n],(function(e){return o+encodeURIComponent(A(e))})).join(t):o+encodeURIComponent(A(e[n]))})).join(t):n?encodeURIComponent(A(n))+r+encodeURIComponent(A(e)):""}(e.query));var s=e.search||i&&"?"+i||"";return r&&":"!==r.substr(-1)&&(r+=":"),e.slashes||(!r||_[r])&&!1!==a?(a="//"+(a||""),n&&"/"!==n.charAt(0)&&(n="/"+n)):a||(a=""),o&&"#"!==o.charAt(0)&&(o="#"+o),s&&"?"!==s.charAt(0)&&(s="?"+s),r+a+(n=n.replace(/[?#]/g,(function(e){return encodeURIComponent(e)})))+(s=s.replace("#","%23"))+o}function T(e,t){return q(e,!1,!0).resolve(t)}function U(e,t){return e?q(e,!1,!0).resolveObject(t):t}function B(e){var t=e.host,r=z.exec(t);r&&(":"!==(r=r[0])&&(e.port=r.substr(1)),t=t.substr(0,t.length-r.length)),t&&(e.hostname=t)}S.prototype.parse=function(e,t,r){return M(this,e,t,r)},S.prototype.format=function(){return L(this)},S.prototype.resolve=function(e){return this.resolveObject(q(e,!1,!0)).format()},S.prototype.resolveObject=function(e){if(y(e)){var t=new S;t.parse(e,!1,!0),e=t}for(var r,n=new S,o=Object.keys(this),a=0;a<o.length;a++){var i=o[a];n[i]=this[i]}if(n.hash=e.hash,""===e.href)return n.href=n.format(),n;if(e.slashes&&!e.protocol){for(var s=Object.keys(e),u=0;u<s.length;u++){var c=s[u];"protocol"!==c&&(n[c]=e[c])}return _[n.protocol]&&n.hostname&&!n.pathname&&(n.path=n.pathname="/"),n.href=n.format(),n}if(e.protocol&&e.protocol!==n.protocol){if(!_[e.protocol]){for(var h=Object.keys(e),f=0;f<h.length;f++){var l=h[f];n[l]=e[l]}return n.href=n.format(),n}if(n.protocol=e.protocol,e.host||k[e.protocol])n.pathname=e.pathname;else{for(r=(e.pathname||"").split("/");r.length&&!(e.host=r.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),""!==r[0]&&r.unshift(""),r.length<2&&r.unshift(""),n.pathname=r.join("/")}if(n.search=e.search,n.query=e.query,n.host=e.host||"",n.auth=e.auth,n.hostname=e.hostname||e.host,n.port=e.port,n.pathname||n.search){var m=n.pathname||"",d=n.search||"";n.path=m+d}return n.slashes=n.slashes||e.slashes,n.href=n.format(),n}var p,b=n.pathname&&"/"===n.pathname.charAt(0),g=e.host||e.pathname&&"/"===e.pathname.charAt(0),w=g||b||n.host&&e.pathname,A=w,x=n.pathname&&n.pathname.split("/")||[],E=n.protocol&&!_[n.protocol];if(r=e.pathname&&e.pathname.split("/")||[],E&&(n.hostname="",n.port=null,n.host&&(""===x[0]?x[0]=n.host:x.unshift(n.host)),n.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(""===r[0]?r[0]=e.host:r.unshift(e.host)),e.host=null),w=w&&(""===r[0]||""===x[0])),g)n.host=e.host||""===e.host?e.host:n.host,n.hostname=e.hostname||""===e.hostname?e.hostname:n.hostname,n.search=e.search,n.query=e.query,x=r;else if(r.length)x||(x=[]),x.pop(),x=x.concat(r),n.search=e.search,n.query=e.query;else if(null!=e.search)return E&&(n.hostname=n.host=x.shift(),(p=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=p.shift(),n.host=n.hostname=p.shift())),n.search=e.search,n.query=e.query,v(n.pathname)&&v(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n;if(!x.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var j=x.slice(-1)[0],O=(n.host||e.host||x.length>1)&&("."===j||".."===j)||""===j,F=0,z=x.length;z>=0;z--)"."===(j=x[z])?x.splice(z,1):".."===j?(x.splice(z,1),F++):F&&(x.splice(z,1),F--);if(!w&&!A)for(;F--;F)x.unshift("..");!w||""===x[0]||x[0]&&"/"===x[0].charAt(0)||x.unshift(""),O&&"/"!==x.join("/").substr(-1)&&x.push("");var P=""===x[0]||x[0]&&"/"===x[0].charAt(0);return E&&(n.hostname=n.host=P?"":x.length?x.shift():"",(p=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=p.shift(),n.host=n.hostname=p.shift())),(w=w||n.host&&x.length)&&!P&&x.unshift(""),x.length?n.pathname=x.join("/"):(n.pathname=null,n.path=null),v(n.pathname)&&v(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=e.auth||n.auth,n.slashes=n.slashes||e.slashes,n.href=n.format(),n},S.prototype.parseHost=function(){return B(this)};var J=a(Object.freeze({__proto__:null,parse:q,resolve:T,resolveObject:U,format:V,default:O,Url:S})),Y={},G=J,K=Y.ValidationError=function(e,t,r,n,o,a){if(Array.isArray(n)?(this.path=n,this.property=n.reduce((function(e,t){return e+re(t)}),"instance")):void 0!==n&&(this.property=n),e&&(this.message=e),r){var i=r.$id||r.id;this.schema=i||r}void 0!==t&&(this.instance=t),this.name=o,this.argument=a,this.stack=this.toString()};K.prototype.toString=function(){return this.property+" "+this.message};var H=Y.ValidatorResult=function(e,t,r,n){this.instance=e,this.schema=t,this.options=r,this.path=n.path,this.propertyPath=n.propertyPath,this.errors=[],this.throwError=r&&r.throwError,this.throwFirst=r&&r.throwFirst,this.throwAll=r&&r.throwAll,this.disableFormat=r&&!0===r.disableFormat};function W(e,t){return t+": "+e.toString()+"\n"}function X(e){Error.captureStackTrace&&Error.captureStackTrace(this,X),this.instance=e.instance,this.schema=e.schema,this.options=e.options,this.errors=e.errors}H.prototype.addError=function(e){var t;if("string"==typeof e)t=new K(e,this.instance,this.schema,this.path);else{if(!e)throw new Error("Missing error detail");if(!e.message)throw new Error("Missing error message");if(!e.name)throw new Error("Missing validator type");t=new K(e.message,this.instance,this.schema,this.path,e.name,e.argument)}if(this.errors.push(t),this.throwFirst)throw new X(this);if(this.throwError)throw t;return t},H.prototype.importErrors=function(e){"string"==typeof e||e&&e.validatorType?this.addError(e):e&&e.errors&&Array.prototype.push.apply(this.errors,e.errors)},H.prototype.toString=function(e){return this.errors.map(W).join("")},Object.defineProperty(H.prototype,"valid",{get:function(){return!this.errors.length}}),Y.ValidatorResultError=X,X.prototype=new Error,X.prototype.constructor=X,X.prototype.name="Validation Error";var Q=Y.SchemaError=function e(t,r){this.message=t,this.schema=r,Error.call(this,t),Error.captureStackTrace(this,e)};Q.prototype=Object.create(Error.prototype,{constructor:{value:Q,enumerable:!1},name:{value:"SchemaError",enumerable:!1}});var ee=Y.SchemaContext=function(e,t,r,n,o){this.schema=e,this.options=t,Array.isArray(r)?(this.path=r,this.propertyPath=r.reduce((function(e,t){return e+re(t)}),"instance")):this.propertyPath=r,this.base=n,this.schemas=o};ee.prototype.resolve=function(e){return G.resolve(this.base,e)},ee.prototype.makeChild=function(e,t){var r=void 0===t?this.path:this.path.concat([t]),n=e.$id||e.id,o=G.resolve(this.base,n||""),a=new ee(e,this.options,r,o,Object.create(this.schemas));return n&&!a.schemas[o]&&(a.schemas[o]=e),a};var te=Y.FORMAT_REGEXPS={"date-time":/^\d{4}-(?:0[0-9]{1}|1[0-2]{1})-(3[01]|0[1-9]|[12][0-9])[tT ](2[0-4]|[01][0-9]):([0-5][0-9]):(60|[0-5][0-9])(\.\d+)?([zZ]|[+-]([0-5][0-9]):(60|[0-5][0-9]))$/,date:/^\d{4}-(?:0[0-9]{1}|1[0-2]{1})-(3[01]|0[1-9]|[12][0-9])$/,time:/^(2[0-4]|[01][0-9]):([0-5][0-9]):(60|[0-5][0-9])$/,email:/^(?:[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+\.)*[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+@(?:(?:(?:[a-zA-Z0-9](?:[a-zA-Z0-9\-](?!\.)){0,61}[a-zA-Z0-9]?\.)+[a-zA-Z0-9](?:[a-zA-Z0-9\-](?!$)){0,61}[a-zA-Z0-9]?)|(?:\[(?:(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\.){3}(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\]))$/,"ip-address":/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/,ipv6:/^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/,uri:/^[a-zA-Z][a-zA-Z0-9+-.]*:[^\s]*$/,"uri-reference":/^(((([A-Za-z][+\-.0-9A-Za-z]*(:%[0-9A-Fa-f]{2}|:[!$&-.0-;=?-Z_a-z~]|[/?])|\?)(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|([A-Za-z][+\-.0-9A-Za-z]*:?)?)|([A-Za-z][+\-.0-9A-Za-z]*:)?\/((%[0-9A-Fa-f]{2}|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?[/?]|[!$&-.0-;=?-Z_a-z~])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|(\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?)?))#(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|(([A-Za-z][+\-.0-9A-Za-z]*)?%[0-9A-Fa-f]{2}|[!$&-.0-9;=@_~]|[A-Za-z][+\-.0-9A-Za-z]*[!$&-*,;=@_~])(%[0-9A-Fa-f]{2}|[!$&-.0-9;=@-Z_a-z~])*((([/?](%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*)?#|[/?])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*)?|([A-Za-z][+\-.0-9A-Za-z]*(:%[0-9A-Fa-f]{2}|:[!$&-.0-;=?-Z_a-z~]|[/?])|\?)(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|([A-Za-z][+\-.0-9A-Za-z]*:)?\/((%[0-9A-Fa-f]{2}|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?[/?]|[!$&-.0-;=?-Z_a-z~])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+(:\d*)?|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?:\d*|\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)?|[A-Za-z][+\-.0-9A-Za-z]*:?)?$/,color:/^(#?([0-9A-Fa-f]{3}){1,2}\b|aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow|(rgb\(\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*,\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*,\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*\))|(rgb\(\s*(\d?\d%|100%)+\s*,\s*(\d?\d%|100%)+\s*,\s*(\d?\d%|100%)+\s*\)))$/,hostname:/^(?=.{1,255}$)[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?(?:\.[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?)*\.?$/,"host-name":/^(?=.{1,255}$)[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?(?:\.[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?)*\.?$/,alpha:/^[a-zA-Z]+$/,alphanumeric:/^[a-zA-Z0-9]+$/,"utc-millisec":function(e){return"string"==typeof e&&parseFloat(e)===parseInt(e,10)&&!isNaN(e)},regex:function(e){var t=!0;try{new RegExp(e)}catch(e){t=!1}return t},style:/\s*(.+?):\s*([^;]+);?/,phone:/^\+(?:[0-9] ?){6,14}[0-9]$/};te.regexp=te.regex,te.pattern=te.regex,te.ipv4=te["ip-address"],Y.isFormat=function(e,t,r){if("string"==typeof e&&void 0!==te[t]){if(te[t]instanceof RegExp)return te[t].test(e);if("function"==typeof te[t])return te[t](e)}else if(r&&r.customFormats&&"function"==typeof r.customFormats[t])return r.customFormats[t](e);return!0};var re=Y.makeSuffix=function(e){return(e=e.toString()).match(/[.\s\[\]]/)||e.match(/^[\d]/)?e.match(/^\d+$/)?"["+e+"]":"["+JSON.stringify(e)+"]":"."+e};function ne(e,t,r,n){"object"==typeof r?t[n]=ie(e[n],r):-1===e.indexOf(r)&&t.push(r)}function oe(e,t,r){t[r]=e[r]}function ae(e,t,r,n){"object"==typeof t[n]&&t[n]&&e[n]?r[n]=ie(e[n],t[n]):r[n]=t[n]}function ie(e,t){var r=Array.isArray(t),n=r&&[]||{};return r?(e=e||[],n=n.concat(e),t.forEach(ne.bind(null,e,n))):(e&&"object"==typeof e&&Object.keys(e).forEach(oe.bind(null,e,n)),Object.keys(t).forEach(ae.bind(null,e,t,n))),n}function se(e){return"/"+encodeURIComponent(e).replace(/~/g,"%7E")}Y.deepCompareStrict=function e(t,r){if(typeof t!=typeof r)return!1;if(Array.isArray(t))return!!Array.isArray(r)&&(t.length===r.length&&t.every((function(n,o){return e(t[o],r[o])})));if("object"==typeof t){if(!t||!r)return t===r;var n=Object.keys(t),o=Object.keys(r);return n.length===o.length&&n.every((function(n){return e(t[n],r[n])}))}return t===r},Y.deepMerge=ie,Y.objectGetPath=function(e,t){for(var r,n=t.split("/").slice(1);"string"==typeof(r=n.shift());){var o=decodeURIComponent(r.replace(/~0/,"~").replace(/~1/g,"/"));if(!(o in e))return;e=e[o]}return e},Y.encodePath=function(e){return e.map(se).join("")},Y.getDecimalPlaces=function(e){var t=0;if(isNaN(e))return t;"number"!=typeof e&&(e=Number(e));var r=e.toString().split("e");if(2===r.length){if("-"!==r[1][0])return t;t=Number(r[1].slice(1))}var n=r[0].split(".");return 2===n.length&&(t+=n[1].length),t},Y.isSchema=function(e){return"object"==typeof e&&e||"boolean"==typeof e};var ue=Y,ce=ue.ValidatorResult,he=ue.SchemaError,fe={ignoreProperties:{id:!0,default:!0,description:!0,title:!0,additionalItems:!0,then:!0,else:!0,$schema:!0,$ref:!0,extends:!0}},le=fe.validators={};function me(e,t,r,n,o){var a=t.throwError,i=t.throwAll;t.throwError=!1,t.throwAll=!1;var s=this.validateSchema(e,o,t,r);return t.throwError=a,t.throwAll=i,!s.valid&&n instanceof Function&&n(s),s.valid}function de(e,t){if(Object.hasOwnProperty.call(e,t))return e[t];if(t in e)for(;e=Object.getPrototypeOf(e);)if(Object.propertyIsEnumerable.call(e,t))return e[t]}function pe(e,t,r,n,o,a){if(this.types.object(e)&&(!t.properties||void 0===t.properties[o]))if(!1===t.additionalProperties)a.addError({name:"additionalProperties",argument:o,message:"is not allowed to have the additional property "+JSON.stringify(o)});else{var i=t.additionalProperties||{};"function"==typeof r.preValidateProperty&&r.preValidateProperty(e,o,i,r,n);var s=this.validateSchema(e[o],i,r,n.makeChild(i,o));s.instance!==a.instance[o]&&(a.instance[o]=s.instance),a.importErrors(s)}}le.type=function(e,t,r,n){if(void 0===e)return null;var o=new ce(e,t,r,n),a=Array.isArray(t.type)?t.type:[t.type];if(!a.some(this.testType.bind(this,e,t,r,n))){var i=a.map((function(e){if(e){var t=e.$id||e.id;return t?"<"+t+">":e+""}}));o.addError({name:"type",argument:i,message:"is not of a type(s) "+i})}return o},le.anyOf=function(e,t,r,n){if(void 0===e)return null;var o=new ce(e,t,r,n),a=new ce(e,t,r,n);if(!Array.isArray(t.anyOf))throw new he("anyOf must be an array");if(!t.anyOf.some(me.bind(this,e,r,n,(function(e){a.importErrors(e)})))){var i=t.anyOf.map((function(e,t){var r=e.$id||e.id;return r?"<"+r+">":e.title&&JSON.stringify(e.title)||e.$ref&&"<"+e.$ref+">"||"[subschema "+t+"]"}));r.nestedErrors&&o.importErrors(a),o.addError({name:"anyOf",argument:i,message:"is not any of "+i.join(",")})}return o},le.allOf=function(e,t,r,n){if(void 0===e)return null;if(!Array.isArray(t.allOf))throw new he("allOf must be an array");var o=new ce(e,t,r,n),a=this;return t.allOf.forEach((function(t,i){var s=a.validateSchema(e,t,r,n);if(!s.valid){var u=t.$id||t.id||t.title&&JSON.stringify(t.title)||t.$ref&&"<"+t.$ref+">"||"[subschema "+i+"]";o.addError({name:"allOf",argument:{id:u,length:s.errors.length,valid:s},message:"does not match allOf schema "+u+" with "+s.errors.length+" error[s]:"}),o.importErrors(s)}})),o},le.oneOf=function(e,t,r,n){if(void 0===e)return null;if(!Array.isArray(t.oneOf))throw new he("oneOf must be an array");var o=new ce(e,t,r,n),a=new ce(e,t,r,n),i=t.oneOf.filter(me.bind(this,e,r,n,(function(e){a.importErrors(e)}))).length,s=t.oneOf.map((function(e,t){return e.$id||e.id||e.title&&JSON.stringify(e.title)||e.$ref&&"<"+e.$ref+">"||"[subschema "+t+"]"}));return 1!==i&&(r.nestedErrors&&o.importErrors(a),o.addError({name:"oneOf",argument:s,message:"is not exactly one from "+s.join(",")})),o},le.if=function(e,t,r,n){if(void 0===e)return null;if(!ue.isSchema(t.if))throw new Error('Expected "if" keyword to be a schema');var o,a=me.call(this,e,r,n,null,t.if),i=new ce(e,t,r,n);if(a){if(void 0===t.then)return;if(!ue.isSchema(t.then))throw new Error('Expected "then" keyword to be a schema');o=this.validateSchema(e,t.then,r,n.makeChild(t.then)),i.importErrors(o)}else{if(void 0===t.else)return;if(!ue.isSchema(t.else))throw new Error('Expected "else" keyword to be a schema');o=this.validateSchema(e,t.else,r,n.makeChild(t.else)),i.importErrors(o)}return i},le.propertyNames=function(e,t,r,n){if(this.types.object(e)){var o=new ce(e,t,r,n),a=void 0!==t.propertyNames?t.propertyNames:{};if(!ue.isSchema(a))throw new he('Expected "propertyNames" to be a schema (object or boolean)');for(var i in e)if(void 0!==de(e,i)){var s=this.validateSchema(i,a,r,n.makeChild(a));o.importErrors(s)}return o}},le.properties=function(e,t,r,n){if(this.types.object(e)){var o=new ce(e,t,r,n),a=t.properties||{};for(var i in a){var s=a[i];if(void 0!==s){if(null===s)throw new he('Unexpected null, expected schema in "properties"');"function"==typeof r.preValidateProperty&&r.preValidateProperty(e,i,s,r,n);var u=de(e,i),c=this.validateSchema(u,s,r,n.makeChild(s,i));c.instance!==o.instance[i]&&(o.instance[i]=c.instance),o.importErrors(c)}}return o}},le.patternProperties=function(e,t,r,n){if(this.types.object(e)){var o=new ce(e,t,r,n),a=t.patternProperties||{};for(var i in e){var s=!0;for(var u in a){var c=a[u];if(void 0!==c){if(null===c)throw new he('Unexpected null, expected schema in "patternProperties"');try{var h=new RegExp(u,"u")}catch(e){h=new RegExp(u)}if(h.test(i)){s=!1,"function"==typeof r.preValidateProperty&&r.preValidateProperty(e,i,c,r,n);var f=this.validateSchema(e[i],c,r,n.makeChild(c,i));f.instance!==o.instance[i]&&(o.instance[i]=f.instance),o.importErrors(f)}}}s&&pe.call(this,e,t,r,n,i,o)}return o}},le.additionalProperties=function(e,t,r,n){if(this.types.object(e)){if(t.patternProperties)return null;var o=new ce(e,t,r,n);for(var a in e)pe.call(this,e,t,r,n,a,o);return o}},le.minProperties=function(e,t,r,n){if(this.types.object(e)){var o=new ce(e,t,r,n);return Object.keys(e).length>=t.minProperties||o.addError({name:"minProperties",argument:t.minProperties,message:"does not meet minimum property length of "+t.minProperties}),o}},le.maxProperties=function(e,t,r,n){if(this.types.object(e)){var o=new ce(e,t,r,n);return Object.keys(e).length<=t.maxProperties||o.addError({name:"maxProperties",argument:t.maxProperties,message:"does not meet maximum property length of "+t.maxProperties}),o}},le.items=function(e,t,r,n){var o=this;if(this.types.array(e)&&t.items){var a=new ce(e,t,r,n);return e.every((function(e,i){var s=Array.isArray(t.items)?t.items[i]||t.additionalItems:t.items;if(void 0===s)return!0;if(!1===s)return a.addError({name:"items",message:"additionalItems not permitted"}),!1;var u=o.validateSchema(e,s,r,n.makeChild(s,i));return u.instance!==a.instance[i]&&(a.instance[i]=u.instance),a.importErrors(u),!0})),a}},le.minimum=function(e,t,r,n){if(this.types.number(e)){var o=new ce(e,t,r,n);return t.exclusiveMinimum&&!0===t.exclusiveMinimum?e>t.minimum||o.addError({name:"minimum",argument:t.minimum,message:"must be greater than "+t.minimum}):e>=t.minimum||o.addError({name:"minimum",argument:t.minimum,message:"must be greater than or equal to "+t.minimum}),o}},le.maximum=function(e,t,r,n){if(this.types.number(e)){var o=new ce(e,t,r,n);return t.exclusiveMaximum&&!0===t.exclusiveMaximum?e<t.maximum||o.addError({name:"maximum",argument:t.maximum,message:"must be less than "+t.maximum}):e<=t.maximum||o.addError({name:"maximum",argument:t.maximum,message:"must be less than or equal to "+t.maximum}),o}},le.exclusiveMinimum=function(e,t,r,n){if("boolean"!=typeof t.exclusiveMaximum&&this.types.number(e)){var o=new ce(e,t,r,n);return e>t.exclusiveMinimum||o.addError({name:"exclusiveMinimum",argument:t.exclusiveMinimum,message:"must be strictly greater than "+t.exclusiveMinimum}),o}},le.exclusiveMaximum=function(e,t,r,n){if("boolean"!=typeof t.exclusiveMaximum&&this.types.number(e)){var o=new ce(e,t,r,n);return e<t.exclusiveMaximum||o.addError({name:"exclusiveMaximum",argument:t.exclusiveMaximum,message:"must be strictly less than "+t.exclusiveMaximum}),o}};var ve=function(e,t,r,n,o,a){if(this.types.number(e)){var i=t[o];if(0==i)throw new he(o+" cannot be zero");var s=new ce(e,t,r,n),u=ue.getDecimalPlaces(e),c=ue.getDecimalPlaces(i),h=Math.max(u,c),f=Math.pow(10,h);return Math.round(e*f)%Math.round(i*f)!=0&&s.addError({name:o,argument:i,message:a+JSON.stringify(i)}),s}};function ye(e,t,r){var n,o=r.length;for(n=t+1;n<o;n++)if(ue.deepCompareStrict(e,r[n]))return!1;return!0}le.multipleOf=function(e,t,r,n){return ve.call(this,e,t,r,n,"multipleOf","is not a multiple of (divisible by) ")},le.divisibleBy=function(e,t,r,n){return ve.call(this,e,t,r,n,"divisibleBy","is not divisible by (multiple of) ")},le.required=function(e,t,r,n){var o=new ce(e,t,r,n);return void 0===e&&!0===t.required?o.addError({name:"required",message:"is required"}):this.types.object(e)&&Array.isArray(t.required)&&t.required.forEach((function(t){void 0===de(e,t)&&o.addError({name:"required",argument:t,message:"requires property "+JSON.stringify(t)})})),o},le.pattern=function(e,t,r,n){if(this.types.string(e)){var o=new ce(e,t,r,n),a=t.pattern;try{var i=new RegExp(a,"u")}catch(e){i=new RegExp(a)}return e.match(i)||o.addError({name:"pattern",argument:t.pattern,message:"does not match pattern "+JSON.stringify(t.pattern.toString())}),o}},le.format=function(e,t,r,n){if(void 0!==e){var o=new ce(e,t,r,n);return o.disableFormat||ue.isFormat(e,t.format,this)||o.addError({name:"format",argument:t.format,message:"does not conform to the "+JSON.stringify(t.format)+" format"}),o}},le.minLength=function(e,t,r,n){if(this.types.string(e)){var o=new ce(e,t,r,n),a=e.match(/[\uDC00-\uDFFF]/g);return e.length-(a?a.length:0)>=t.minLength||o.addError({name:"minLength",argument:t.minLength,message:"does not meet minimum length of "+t.minLength}),o}},le.maxLength=function(e,t,r,n){if(this.types.string(e)){var o=new ce(e,t,r,n),a=e.match(/[\uDC00-\uDFFF]/g);return e.length-(a?a.length:0)<=t.maxLength||o.addError({name:"maxLength",argument:t.maxLength,message:"does not meet maximum length of "+t.maxLength}),o}},le.minItems=function(e,t,r,n){if(this.types.array(e)){var o=new ce(e,t,r,n);return e.length>=t.minItems||o.addError({name:"minItems",argument:t.minItems,message:"does not meet minimum length of "+t.minItems}),o}},le.maxItems=function(e,t,r,n){if(this.types.array(e)){var o=new ce(e,t,r,n);return e.length<=t.maxItems||o.addError({name:"maxItems",argument:t.maxItems,message:"does not meet maximum length of "+t.maxItems}),o}},le.uniqueItems=function(e,t,r,n){if(!0===t.uniqueItems&&this.types.array(e)){var o=new ce(e,t,r,n);return e.every(ye)||o.addError({name:"uniqueItems",message:"contains duplicate item"}),o}},le.dependencies=function(e,t,r,n){if(this.types.object(e)){var o=new ce(e,t,r,n);for(var a in t.dependencies)if(void 0!==e[a]){var i=t.dependencies[a],s=n.makeChild(i,a);if("string"==typeof i&&(i=[i]),Array.isArray(i))i.forEach((function(t){void 0===e[t]&&o.addError({name:"dependencies",argument:s.propertyPath,message:"property "+t+" not found, required by "+s.propertyPath})}));else{var u=this.validateSchema(e,i,r,s);o.instance!==u.instance&&(o.instance=u.instance),u&&u.errors.length&&(o.addError({name:"dependencies",argument:s.propertyPath,message:"does not meet dependency required by "+s.propertyPath}),o.importErrors(u))}}return o}},le.enum=function(e,t,r,n){if(void 0===e)return null;if(!Array.isArray(t.enum))throw new he("enum expects an array",t);var o=new ce(e,t,r,n);return t.enum.some(ue.deepCompareStrict.bind(null,e))||o.addError({name:"enum",argument:t.enum,message:"is not one of enum values: "+t.enum.map(String).join(",")}),o},le.const=function(e,t,r,n){if(void 0===e)return null;var o=new ce(e,t,r,n);return ue.deepCompareStrict(t.const,e)||o.addError({name:"const",argument:t.const,message:"does not exactly match expected constant: "+t.const}),o},le.not=le.disallow=function(e,t,r,n){var o=this;if(void 0===e)return null;var a=new ce(e,t,r,n),i=t.not||t.disallow;return i?(Array.isArray(i)||(i=[i]),i.forEach((function(i){if(o.testType(e,t,r,n,i)){var s=i&&(i.$id||i.id)||i;a.addError({name:"not",argument:s,message:"is of prohibited type "+s})}})),a):null};var be=fe,ge={},we=J,Ae=Y;function xe(e,t){this.id=e,this.ref=t}ge.SchemaScanResult=xe,ge.scan=function(e,t){function r(e,t){if(t&&"object"==typeof t)if(t.$ref){var s=we.resolve(e,t.$ref);i[s]=i[s]?i[s]+1:0}else{var u=t.$id||t.id,c=u?we.resolve(e,u):e;if(c){if(c.indexOf("#")<0&&(c+="#"),a[c]){if(!Ae.deepCompareStrict(a[c],t))throw new Error("Schema <"+c+"> already exists with different definition");return a[c]}a[c]=t,"#"==c[c.length-1]&&(a[c.substring(0,c.length-1)]=t)}n(c+"/items",Array.isArray(t.items)?t.items:[t.items]),n(c+"/extends",Array.isArray(t.extends)?t.extends:[t.extends]),r(c+"/additionalItems",t.additionalItems),o(c+"/properties",t.properties),r(c+"/additionalProperties",t.additionalProperties),o(c+"/definitions",t.definitions),o(c+"/patternProperties",t.patternProperties),o(c+"/dependencies",t.dependencies),n(c+"/disallow",t.disallow),n(c+"/allOf",t.allOf),n(c+"/anyOf",t.anyOf),n(c+"/oneOf",t.oneOf),r(c+"/not",t.not)}}function n(e,t){if(Array.isArray(t))for(var n=0;n<t.length;n++)r(e+"/"+n,t[n])}function o(e,t){if(t&&"object"==typeof t)for(var n in t)r(e+"/"+n,t[n])}var a={},i={};return r(e,t),new xe(a,i)};var Ee=J,je=be,Oe=Y,Se=ge.scan,Fe=Oe.ValidatorResult,ze=Oe.ValidatorResultError,Pe=Oe.SchemaError,Ne=Oe.SchemaContext,$e=function e(){this.customFormats=Object.create(e.prototype.customFormats),this.schemas={},this.unresolvedRefs=[],this.types=Object.create(Ze),this.attributes=Object.create(je.validators)};function De(e){var t="string"==typeof e?e:e.$ref;return"string"==typeof t&&t}$e.prototype.customFormats={},$e.prototype.schemas=null,$e.prototype.types=null,$e.prototype.attributes=null,$e.prototype.unresolvedRefs=null,$e.prototype.addSchema=function(e,t){var r=this;if(!e)return null;var n=Se(t||"/",e),o=t||e.$id||e.id;for(var a in n.id)this.schemas[a]=n.id[a];for(var a in n.ref)this.unresolvedRefs.push(a);return this.unresolvedRefs=this.unresolvedRefs.filter((function(e){return void 0===r.schemas[e]})),this.schemas[o]},$e.prototype.addSubSchemaArray=function(e,t){if(Array.isArray(t))for(var r=0;r<t.length;r++)this.addSubSchema(e,t[r])},$e.prototype.addSubSchemaObject=function(e,t){if(t&&"object"==typeof t)for(var r in t)this.addSubSchema(e,t[r])},$e.prototype.setSchemas=function(e){this.schemas=e},$e.prototype.getSchema=function(e){return this.schemas[e]},$e.prototype.validate=function(e,t,r,n){if("boolean"!=typeof t&&"object"!=typeof t||null===t)throw new Pe("Expected `schema` to be an object or boolean");r||(r={});var o,a=t.$id||t.id,i=Ee.resolve(r.base||"/",a||"");if(!n){(n=new Ne(t,r,[],i,Object.create(this.schemas))).schemas[i]||(n.schemas[i]=t);var s=Se(i,t);for(var u in s.id){var c=s.id[u];n.schemas[u]=c}}if(r.required&&void 0===e)return(o=new Fe(e,t,r,n)).addError("is required, but is undefined"),o;if(!(o=this.validateSchema(e,t,r,n)))throw new Error("Result undefined");if(r.throwAll&&o.errors.length)throw new ze(o);return o},$e.prototype.validateSchema=function(e,t,r,n){var o=new Fe(e,t,r,n);if("boolean"==typeof t)!0===t?t={}:!1===t&&(t={type:[]});else if(!t)throw new Error("schema is undefined");if(t.extends)if(Array.isArray(t.extends)){var a={schema:t,ctx:n};t.extends.forEach(this.schemaTraverser.bind(this,a)),t=a.schema,a.schema=null,a.ctx=null,a=null}else t=Oe.deepMerge(t,this.superResolve(t.extends,n));var i=De(t);if(i){var s=this.resolve(t,i,n),u=new Ne(s.subschema,r,n.path,s.switchSchema,n.schemas);return this.validateSchema(e,s.subschema,r,u)}var c=r&&r.skipAttributes||[];for(var h in t)if(!je.ignoreProperties[h]&&c.indexOf(h)<0){var f=null,l=this.attributes[h];if(l)f=l.call(this,e,t,r,n);else if(!1===r.allowUnknownAttributes)throw new Pe("Unsupported attribute: "+h,t);f&&o.importErrors(f)}if("function"==typeof r.rewrite){var m=r.rewrite.call(this,e,t,r,n);o.instance=m}return o},$e.prototype.schemaTraverser=function(e,t){e.schema=Oe.deepMerge(e.schema,this.superResolve(t,e.ctx))},$e.prototype.superResolve=function(e,t){var r=De(e);return r?this.resolve(e,r,t).subschema:e},$e.prototype.resolve=function(e,t,r){if(t=r.resolve(t),r.schemas[t])return{subschema:r.schemas[t],switchSchema:t};var n=Ee.parse(t),o=n&&n.hash,a=o&&o.length&&t.substr(0,t.length-o.length);if(!a||!r.schemas[a])throw new Pe("no such schema <"+t+">",e);var i=Oe.objectGetPath(r.schemas[a],o.substr(1));if(void 0===i)throw new Pe("no such schema "+o+" located in <"+a+">",e);return{subschema:i,switchSchema:t}},$e.prototype.testType=function(e,t,r,n,o){if(void 0!==o){if(null===o)throw new Pe('Unexpected null in "type" keyword');if("function"==typeof this.types[o])return this.types[o].call(this,e);if(o&&"object"==typeof o){var a=this.validateSchema(e,o,r,n);return void 0===a||!(a&&a.errors.length)}return!0}};var Ze=$e.prototype.types={};Ze.string=function(e){return"string"==typeof e},Ze.number=function(e){return"number"==typeof e&&isFinite(e)},Ze.integer=function(e){return"number"==typeof e&&e%1==0},Ze.boolean=function(e){return"boolean"==typeof e},Ze.array=function(e){return Array.isArray(e)},Ze.null=function(e){return null===e},Ze.date=function(e){return e instanceof Date},Ze.any=function(e){return!0},Ze.object=function(e){return e&&"object"==typeof e&&!Array.isArray(e)&&!(e instanceof Date)};var Re=$e,Ie="^[a-zA-Z0-9_.-]*$",Ce={type:"object",id:"/CreateFsPropsSchema",properties:{databaseName:{minLength:4,maxLength:50,type:"string",pattern:Ie},objectStoreName:{minLength:1,maxLength:20,type:"string",pattern:Ie},rootDirectoryName:{minLength:1,maxLength:20,type:"string",pattern:Ie},databaseVersion:{minimum:1,maximum:100,type:"integer"}},required:["databaseName","databaseVersion","objectStoreName","rootDirectoryName"]};function ke(e){var t,r,n,o=(t=e,r=Ce,(new Re).validate(t,r,n)),a=o.valid,i=o.errors;if(a)return a;var s=JSON.stringify(i);throw new Error("Props passed to createFS function are invalid:\n"+s)}function _e(e,t){return""===e?t:function(e,t){if(!n(e)||!n(t)||""===t)return!1;var r=t+"/";return e.startsWith(r)}(e,t)?e:t+(function(e){return!(!n(e)||0===e.length)&&"/"===e[0]}(e)?"":"/")+e}function qe(e,t){if(!n(t)||""===t)throw new Error("rootDirectoryName parameter was not provided");if(!n(e))throw new Error("fullPath parameter was not provided");if(e===t)return t;var r=_e(e,t);if(!r||!function(e){return!!n(e)&&o.test(e)}(r))throw new Error('"'+e+'" path is invalid.');return r}var Me="directory";function Ve(e){return e?e.result:null}function Le(e,t){t||e(new Error("Something went wrong and the database transaction was not opened."))}var Te,Ue=function(e){var t=e.databaseName,r=e.databaseVersion,n=e.objectStoreName;return new Promise((function(e,o){var a=Be(t,r);a.onupgradeneeded=function(e){var t=Ve(e.target);Le(o,t),t.createObjectStore(n,{keyPath:"fullPath"}).createIndex(Me,Me,{unique:!1})},a.onsuccess=function(t){var r=t.target,n=Ve(r);Le(o,n),e(Ve(r))},a.onerror=o}))},Be=function(e,t){return indexedDB.open(e,t)};!function(e){e.FILE="file",e.DIRECTORY="directory"}(Te||(Te={}));function Je(e,t){for(var r=0,n=e.length-1;n>=0;n--){var o=e[n];"."===o?e.splice(n,1):".."===o?(e.splice(n,1),r++):r&&(e.splice(n,1),r--)}if(t)for(;r--;r)e.unshift("..");return e}var Ye=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,Ge=function(e){return Ye.exec(e).slice(1)};function Ke(){for(var e="",t=!1,r=arguments.length-1;r>=-1&&!t;r--){var n=r>=0?arguments[r]:"/";if("string"!=typeof n)throw new TypeError("Arguments to path.resolve must be strings");n&&(e=n+"/"+e,t="/"===n.charAt(0))}return(t?"/":"")+(e=Je(Qe(e.split("/"),(function(e){return!!e})),!t).join("/"))||"."}function He(e){var t=We(e),r="/"===et(e,-1);return(e=Je(Qe(e.split("/"),(function(e){return!!e})),!t).join("/"))||t||(e="."),e&&r&&(e+="/"),(t?"/":"")+e}function We(e){return"/"===e.charAt(0)}var Xe={extname:function(e){return Ge(e)[3]},basename:function(e,t){var r=Ge(e)[2];return t&&r.substr(-1*t.length)===t&&(r=r.substr(0,r.length-t.length)),r},dirname:function(e){var t=Ge(e),r=t[0],n=t[1];return r||n?(n&&(n=n.substr(0,n.length-1)),r+n):"."},sep:"/",delimiter:":",relative:function(e,t){function r(e){for(var t=0;t<e.length&&""===e[t];t++);for(var r=e.length-1;r>=0&&""===e[r];r--);return t>r?[]:e.slice(t,r-t+1)}e=Ke(e).substr(1),t=Ke(t).substr(1);for(var n=r(e.split("/")),o=r(t.split("/")),a=Math.min(n.length,o.length),i=a,s=0;s<a;s++)if(n[s]!==o[s]){i=s;break}var u=[];for(s=i;s<n.length;s++)u.push("..");return(u=u.concat(o.slice(i))).join("/")},join:function(){var e=Array.prototype.slice.call(arguments,0);return He(Qe(e,(function(e,t){if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e})).join("/"))},isAbsolute:We,normalize:He,resolve:Ke};function Qe(e,t){if(e.filter)return e.filter(t);for(var r=[],n=0;n<e.length;n++)t(e[n],n,e)&&r.push(e[n]);return r}var et="b"==="ab".substr(-1)?function(e,t,r){return e.substr(t,r)}:function(e,t,r){return t<0&&(t=e.length+t),e.substr(t,r)},tt={databaseVersion:1,objectStoreName:"files",rootDirectoryName:"root",databaseName:"indexeddb-fs"};function rt(e){var n=this,o=void 0===e?tt:e,a=o.databaseName,i=void 0===a?tt.databaseName:a,s=o.databaseVersion,u=void 0===s?tt.databaseVersion:s,c=o.objectStoreName,h=void 0===c?tt.objectStoreName:c,f=o.rootDirectoryName,l=void 0===f?tt.rootDirectoryName:f,m=!1;var d=function(e){var n=e.databaseName,o=e.databaseVersion,a=e.objectStoreName;return function(e){return t(void 0,void 0,void 0,(function(){return r(this,(function(t){switch(t.label){case 0:return[4,Ue({databaseName:n,databaseVersion:o,objectStoreName:a})];case 1:return[2,t.sent().transaction(a,e).objectStore(a)]}}))}))}}({databaseName:i,databaseVersion:u,objectStoreName:h}),p=function(e){var n=e.rootDirectoryName,o=e.initializeObjectStore;return function(e){return t(void 0,void 0,void 0,(function(){var t,a;return r(this,(function(r){switch(r.label){case 0:return t=qe(e,n),[4,o("readonly")];case 1:return a=r.sent(),[2,new Promise((function(e){var r=a.get(t);r.onerror=function(){return e(!1)},r.onsuccess=function(t){var r=t.target.result;e(Boolean(null==r?void 0:r.createdAt))}}))]}}))}))}}({rootDirectoryName:l,initializeObjectStore:d}),v=function(e){var n=e.exists,o=e.rootDirectoryName,a=e.initializeObjectStore;return function(e){return t(void 0,void 0,void 0,(function(){var t,i;return r(this,(function(r){switch(r.label){case 0:return t=qe(e,o),[4,n(t)];case 1:if(!r.sent())throw new Error('"'+e+'" file does not exist.');return[4,a("readonly")];case 2:return i=r.sent(),[2,new Promise((function(e){var r=i.get(t);r.onerror=function(){return e(!1)},r.onsuccess=function(t){var r=t.target.result;e(Boolean((null==r?void 0:r.type)===Te.FILE))}}))]}}))}))}}({exists:p,rootDirectoryName:l,initializeObjectStore:d}),y=function(e){var n=e.exists,o=e.rootDirectoryName,a=e.initializeObjectStore;return function(e){return t(void 0,void 0,void 0,(function(){var t,i;return r(this,(function(r){switch(r.label){case 0:if((t=qe(e,o))===o)throw new Error('Root directory: "'+e+'" cannot be removed.');return[4,n(t)];case 1:if(!r.sent())throw new Error('"'+e+'" file or directory does not exist.');return[4,a("readwrite")];case 2:return i=r.sent(),[2,new Promise((function(e,r){var n=i.delete(t);n.onerror=r,n.onsuccess=function(){return e()}}))]}}))}))}}({exists:p,rootDirectoryName:l,initializeObjectStore:d}),b=function(e){var n=e.isFile,o=e.rootDirectoryName,a=e.initializeObjectStore;return function(e){return t(void 0,void 0,void 0,(function(){var t,i;return r(this,(function(r){switch(r.label){case 0:return t=qe(e,o),[4,n(e)];case 1:if(!r.sent())throw new Error('"'+e+'" is not a file.');return[4,a("readonly")];case 2:return i=r.sent(),[2,new Promise((function(e,r){var n=i.get(t);n.onerror=r,n.onsuccess=function(t){var r=t.target.result;e(null==r?void 0:r.data)}}))]}}))}))}}({isFile:v,rootDirectoryName:l,initializeObjectStore:d}),g=function(e){var n=e.exists,o=e.rootDirectoryName,a=e.initializeObjectStore;return function(e,i){return t(void 0,void 0,void 0,(function(){var t,s,u,c;return r(this,(function(r){switch(r.label){case 0:if((t=qe(e,o))===o)throw new Error('Root directory: "'+t+'" cannot be a file.');return s=Xe.basename(t),u=Xe.dirname(t),[4,n(u)];case 1:if(!r.sent())throw new Error('"'+u+'" directory does not exist.');return[4,a("readwrite")];case 2:return c=r.sent(),[2,new Promise((function(e,r){var n={data:i,directory:u,name:s,type:Te.FILE,createdAt:Date.now(),fullPath:t},o=c.put(n);o.onerror=r,o.onsuccess=function(){return e(n)}}))]}}))}))}}({exists:p,rootDirectoryName:l,initializeObjectStore:d}),w=function(e){var n=e.isFile,o=e.rootDirectoryName,a=e.initializeObjectStore;return function(e){return t(void 0,void 0,void 0,(function(){var t,i;return r(this,(function(r){switch(r.label){case 0:if((t=qe(e,o))===o)throw new Error('Root directory: "'+e+'" cannot be removed.');return[4,n(t)];case 1:if(!r.sent())throw new Error('"'+e+'" is not a file.');return[4,a("readwrite")];case 2:return i=r.sent(),[2,new Promise((function(e,r){var n=i.delete(t);n.onerror=r,n.onsuccess=function(){return e()}}))]}}))}))}}({isFile:v,rootDirectoryName:l,initializeObjectStore:d}),A=function(e){var n=e.exists,o=e.rootDirectoryName,a=e.initializeObjectStore;return function(e){return t(void 0,void 0,void 0,(function(){var t,i;return r(this,(function(r){switch(r.label){case 0:return t=qe(e,o),[4,n(t)];case 1:if(!r.sent())throw new Error('"'+e+'" directory does not exist.');return[4,a("readonly")];case 2:return i=r.sent(),[2,new Promise((function(e){var r=i.get(t);r.onerror=function(){return e(!1)},r.onsuccess=function(t){var r=t.target.result;e(Boolean((null==r?void 0:r.type)===Te.DIRECTORY))}}))]}}))}))}}({exists:p,rootDirectoryName:l,initializeObjectStore:d}),x=function(e){var n=e.isDirectory,o=e.rootDirectoryName,a=e.initializeObjectStore;return function(e){return t(void 0,void 0,void 0,(function(){var t,i;return r(this,(function(r){switch(r.label){case 0:return t=qe(e,o),[4,n(e)];case 1:if(!r.sent())throw new Error('"'+e+'" is not a directory.');return[4,a("readonly")];case 2:return i=r.sent(),[2,new Promise((function(e,r){var n=i.index(Me),o=IDBKeyRange.only(t),a=n.openCursor(o);a.onerror=r;var s=[],u=[];a.onsuccess=function(t){var r=t.target.result;if(r){var n=r.value;n.type===Te.FILE?s.push(n):u.push(n),r.continue()}else{var o=s.length,a=u.length;e({isEmpty:0===o&&0===a,filesCount:o,directoriesCount:a,files:s,directories:u})}}}))]}}))}))}}({isDirectory:A,rootDirectoryName:l,initializeObjectStore:d}),E=function(e){var n=e.isDirectory,o=e.rootDirectoryName,a=e.initializeObjectStore;return function(e){return t(void 0,void 0,void 0,(function(){var t,i,s,u;return r(this,(function(r){switch(r.label){case 0:if((t=qe(e,o))===o)throw new Error('Root directory: "'+t+'" already exist.');return i=Xe.basename(t),s=Xe.dirname(t),[4,n(s)];case 1:if(!r.sent())throw new Error('"'+s+'" is not a directory.');return[4,a("readwrite")];case 2:return u=r.sent(),[2,new Promise((function(e,r){var n={directory:s,isRoot:!1,name:i,createdAt:Date.now(),type:Te.DIRECTORY,fullPath:t},o=u.put(n);o.onerror=r,o.onsuccess=function(){return e(n)}}))]}}))}))}}({isDirectory:A,rootDirectoryName:l,initializeObjectStore:d}),j=function(e){var n=e.remove,o=e.isDirectory,a=e.readDirectory,i=e.rootDirectoryName;function s(e){return t(this,void 0,void 0,(function(){var t,o,u,c,h,f,l,m,d,p;return r(this,(function(r){switch(r.label){case 0:return t=qe(e,i),[4,a(t)];case 1:if(o=r.sent(),u=o.files,c=o.directories,!(u.length>0))return[3,5];h=0,f=u,r.label=2;case 2:return h<f.length?(l=f[h],[4,n(l.fullPath)]):[3,5];case 3:r.sent(),r.label=4;case 4:return h++,[3,2];case 5:return(null==c?void 0:c.length)?[3,7]:[4,n(e)];case 6:return r.sent(),[2];case 7:m=0,d=c,r.label=8;case 8:return m<d.length?[4,s((p=d[m]).fullPath)]:[3,14];case 9:r.sent(),r.label=10;case 10:return r.trys.push([10,12,,13]),[4,n(p.fullPath)];case 11:case 12:return r.sent(),[3,13];case 13:return m++,[3,8];case 14:return[2]}}))}))}return function(e){return t(this,void 0,void 0,(function(){return r(this,(function(t){switch(t.label){case 0:if(e===i)throw new Error('Root directory: "'+e+'" cannot be removed.');return[4,o(e)];case 1:if(!t.sent())throw new Error('"'+e+'" is not a directory.');return[4,s(e)];case 2:return t.sent(),[4,n(e)];case 3:return t.sent(),[2]}}))}))}}({remove:y,isDirectory:A,readDirectory:x,rootDirectoryName:l}),O=function(e){var n=e.rootDirectoryName,o=e.initializeObjectStore;return function(){return t(void 0,void 0,void 0,(function(){var e;return r(this,(function(t){switch(t.label){case 0:return[4,o("readwrite")];case 1:return e=t.sent(),[2,new Promise((function(t,r){var o={isRoot:!0,createdAt:Date.now(),name:n,type:Te.DIRECTORY,fullPath:n,directory:n},a=e.put(o);a.onerror=r,a.onsuccess=function(){return t(o)}}))]}}))}))}}({rootDirectoryName:l,initializeObjectStore:d});function S(){return t(this,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return m?[3,3]:[4,p(l)];case 1:return(m=e.sent())?[3,3]:[4,O()];case 2:e.sent(),m=!0,e.label=3;case 3:return[2]}}))}))}var F=function(e){return function(){for(var o=[],a=0;a<arguments.length;a++)o[a]=arguments[a];return t(n,void 0,void 0,(function(){return r(this,(function(t){switch(t.label){case 0:return[4,S()];case 1:return t.sent(),[2,e.apply(void 0,o)]}}))}))}};return function(){if(!Boolean(indexedDB))throw new Error("Your browser does not support indexedDB.")}(),ke({databaseName:i,objectStoreName:h,databaseVersion:u,rootDirectoryName:l}),{databaseName:i,databaseVersion:u,objectStoreName:h,hasRootDirectory:m,rootDirectoryName:l,createRootDirectory:O,createRootDirectoryIfDoesNotExist:S,exists:F(p),isFile:F(v),remove:F(y),readFile:F(b),writeFile:F(g),removeFile:F(w),isDirectory:F(A),readDirectory:F(x),createDirectory:F(E),removeDirectory:F(j)}}module.exports=rt(),e.createFs=rt,Object.defineProperty(e,"__esModule",{value:!0})}));
***************************************************************************** */function t(e,t,r,n){return new(r||(r=Promise))((function(a,o){function i(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?a(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,s)}u((n=n.apply(e,t||[])).next())}))}function r(e,t){var r,n,a,o,i={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;i;)try{if(r=1,n&&(a=2&o[0]?n.return:o[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,o[1])).done)return a;switch(n=0,a&&(o=[2&o[0],a.value]),o[0]){case 0:case 1:a=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,n=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!(a=i.trys,(a=a.length>0&&a[a.length-1])||6!==o[0]&&2!==o[0])){i=0;continue}if(3===o[0]&&(!a||o[1]>a[0]&&o[1]<a[3])){i.label=o[1];break}if(6===o[0]&&i.label<a[1]){i.label=a[1],a=o;break}if(a&&i.label<a[2]){i.label=a[2],i.ops.push(o);break}a[2]&&i.ops.pop(),i.trys.pop();continue}o=t.call(e,i)}catch(e){o=[6,e],n=0}finally{r=a=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}var n=function(e){return"string"==typeof e||e instanceof String},a=new RegExp("^([A-Za-z]:|[A-Za-z0-9_-]+(.[A-Za-z0-9_-]+)*)((/[A-Za-z0-9_.-]+)+)$");function o(e){if(e.__esModule)return e;var t=Object.defineProperty({},"__esModule",{value:!0});return Object.keys(e).forEach((function(r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})})),t}
/*! https://mths.be/punycode v1.4.1 by @mathias */var i=2147483647,s=/[^\x20-\x7E]/,u=/[\x2E\u3002\uFF0E\uFF61]/g,c={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},h=Math.floor,f=String.fromCharCode;function l(e){throw new RangeError(c[e])}function m(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function p(e,t,r){var n=0;for(e=r?h(e/700):e>>1,e+=h(e/t);e>455;n+=36)e=h(e/35);return h(n+36*e/(e+38))}function d(e){return function(e,t){var r=e.split("@"),n="";r.length>1&&(n=r[0]+"@",e=r[1]);var a=function(e,t){for(var r=e.length,n=[];r--;)n[r]=t(e[r]);return n}((e=e.replace(u,".")).split("."),t).join(".");return n+a}(e,(function(e){return s.test(e)?"xn--"+function(e){var t,r,n,a,o,s,u,c,d,v,y,b,g,w,A,x=[];for(b=(e=function(e){for(var t,r,n=[],a=0,o=e.length;a<o;)(t=e.charCodeAt(a++))>=55296&&t<=56319&&a<o?56320==(64512&(r=e.charCodeAt(a++)))?n.push(((1023&t)<<10)+(1023&r)+65536):(n.push(t),a--):n.push(t);return n}(e)).length,t=128,r=0,o=72,s=0;s<b;++s)(y=e[s])<128&&x.push(f(y));for(n=a=x.length,a&&x.push("-");n<b;){for(u=i,s=0;s<b;++s)(y=e[s])>=t&&y<u&&(u=y);for(u-t>h((i-r)/(g=n+1))&&l("overflow"),r+=(u-t)*g,t=u,s=0;s<b;++s)if((y=e[s])<t&&++r>i&&l("overflow"),y==t){for(c=r,d=36;!(c<(v=d<=o?1:d>=o+26?26:d-o));d+=36)A=c-v,w=36-v,x.push(f(m(v+A%w,0))),c=h(A/w);x.push(f(m(c,0))),o=p(r,g,n==a),r=0,++n}++r,++t}return x.join("")}(e):e}))}function v(e){return null===e}function y(e){return"string"==typeof e}function b(e){return"object"==typeof e&&null!==e}function g(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var w=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};function A(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}}function x(e,t){if(e.map)return e.map(t);for(var r=[],n=0;n<e.length;n++)r.push(t(e[n],n));return r}var E=Object.keys||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.push(r);return t};function O(e,t,r,n){t=t||"&",r=r||"=";var a={};if("string"!=typeof e||0===e.length)return a;var o=/\+/g;e=e.split(t);var i=1e3;n&&"number"==typeof n.maxKeys&&(i=n.maxKeys);var s=e.length;i>0&&s>i&&(s=i);for(var u=0;u<s;++u){var c,h,f,l,m=e[u].replace(o,"%20"),p=m.indexOf(r);p>=0?(c=m.substr(0,p),h=m.substr(p+1)):(c=m,h=""),f=decodeURIComponent(c),l=decodeURIComponent(h),g(a,f)?w(a[f])?a[f].push(l):a[f]=[a[f],l]:a[f]=l}return a}var j={parse:q,resolve:T,resolveObject:U,format:V,Url:S};function S(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var F=/^([a-z0-9.+-]+:)/i,z=/:[0-9]*$/,P=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,N=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),$=["'"].concat(N),Z=["%","/","?",";","#"].concat($),D=["/","?","#"],R=/^[+a-z0-9A-Z_-]{0,63}$/,C=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,I={javascript:!0,"javascript:":!0},k={javascript:!0,"javascript:":!0},_={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function q(e,t,r){if(e&&b(e)&&e instanceof S)return e;var n=new S;return n.parse(e,t,r),n}function M(e,t,r,n){if(!y(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var a=t.indexOf("?"),o=-1!==a&&a<t.indexOf("#")?"?":"#",i=t.split(o);i[0]=i[0].replace(/\\/g,"/");var s=t=i.join(o);if(s=s.trim(),!n&&1===t.split("#").length){var u=P.exec(s);if(u)return e.path=s,e.href=s,e.pathname=u[1],u[2]?(e.search=u[2],e.query=r?O(e.search.substr(1)):e.search.substr(1)):r&&(e.search="",e.query={}),e}var c,h,f,l,m=F.exec(s);if(m){var p=(m=m[0]).toLowerCase();e.protocol=p,s=s.substr(m.length)}if(n||m||s.match(/^\/\/[^@\/]+@[^@\/]+/)){var v="//"===s.substr(0,2);!v||m&&k[m]||(s=s.substr(2),e.slashes=!0)}if(!k[m]&&(v||m&&!_[m])){var b,g,w=-1;for(c=0;c<D.length;c++)-1!==(h=s.indexOf(D[c]))&&(-1===w||h<w)&&(w=h);for(-1!==(g=-1===w?s.lastIndexOf("@"):s.lastIndexOf("@",w))&&(b=s.slice(0,g),s=s.slice(g+1),e.auth=decodeURIComponent(b)),w=-1,c=0;c<Z.length;c++)-1!==(h=s.indexOf(Z[c]))&&(-1===w||h<w)&&(w=h);-1===w&&(w=s.length),e.host=s.slice(0,w),s=s.slice(w),B(e),e.hostname=e.hostname||"";var A="["===e.hostname[0]&&"]"===e.hostname[e.hostname.length-1];if(!A){var x=e.hostname.split(/\./);for(c=0,f=x.length;c<f;c++){var E=x[c];if(E&&!E.match(R)){for(var j="",S=0,z=E.length;S<z;S++)E.charCodeAt(S)>127?j+="x":j+=E[S];if(!j.match(R)){var N=x.slice(0,c),q=x.slice(c+1),M=E.match(C);M&&(N.push(M[1]),q.unshift(M[2])),q.length&&(s="/"+q.join(".")+s),e.hostname=N.join(".");break}}}}e.hostname.length>255?e.hostname="":e.hostname=e.hostname.toLowerCase(),A||(e.hostname=d(e.hostname)),l=e.port?":"+e.port:"";var V=e.hostname||"";e.host=V+l,e.href+=e.host,A&&(e.hostname=e.hostname.substr(1,e.hostname.length-2),"/"!==s[0]&&(s="/"+s))}if(!I[p])for(c=0,f=$.length;c<f;c++){var T=$[c];if(-1!==s.indexOf(T)){var U=encodeURIComponent(T);U===T&&(U=escape(T)),s=s.split(T).join(U)}}var J=s.indexOf("#");-1!==J&&(e.hash=s.substr(J),s=s.slice(0,J));var Y=s.indexOf("?");if(-1!==Y?(e.search=s.substr(Y),e.query=s.substr(Y+1),r&&(e.query=O(e.query)),s=s.slice(0,Y)):r&&(e.search="",e.query={}),s&&(e.pathname=s),_[p]&&e.hostname&&!e.pathname&&(e.pathname="/"),e.pathname||e.search){l=e.pathname||"";var G=e.search||"";e.path=l+G}return e.href=L(e),e}function V(e){return y(e)&&(e=M({},e)),L(e)}function L(e){var t=e.auth||"";t&&(t=(t=encodeURIComponent(t)).replace(/%3A/i,":"),t+="@");var r=e.protocol||"",n=e.pathname||"",a=e.hash||"",o=!1,i="";e.host?o=t+e.host:e.hostname&&(o=t+(-1===e.hostname.indexOf(":")?e.hostname:"["+this.hostname+"]"),e.port&&(o+=":"+e.port)),e.query&&b(e.query)&&Object.keys(e.query).length&&(i=function(e,t,r,n){return t=t||"&",r=r||"=",null===e&&(e=void 0),"object"==typeof e?x(E(e),(function(n){var a=encodeURIComponent(A(n))+r;return w(e[n])?x(e[n],(function(e){return a+encodeURIComponent(A(e))})).join(t):a+encodeURIComponent(A(e[n]))})).join(t):n?encodeURIComponent(A(n))+r+encodeURIComponent(A(e)):""}(e.query));var s=e.search||i&&"?"+i||"";return r&&":"!==r.substr(-1)&&(r+=":"),e.slashes||(!r||_[r])&&!1!==o?(o="//"+(o||""),n&&"/"!==n.charAt(0)&&(n="/"+n)):o||(o=""),a&&"#"!==a.charAt(0)&&(a="#"+a),s&&"?"!==s.charAt(0)&&(s="?"+s),r+o+(n=n.replace(/[?#]/g,(function(e){return encodeURIComponent(e)})))+(s=s.replace("#","%23"))+a}function T(e,t){return q(e,!1,!0).resolve(t)}function U(e,t){return e?q(e,!1,!0).resolveObject(t):t}function B(e){var t=e.host,r=z.exec(t);r&&(":"!==(r=r[0])&&(e.port=r.substr(1)),t=t.substr(0,t.length-r.length)),t&&(e.hostname=t)}S.prototype.parse=function(e,t,r){return M(this,e,t,r)},S.prototype.format=function(){return L(this)},S.prototype.resolve=function(e){return this.resolveObject(q(e,!1,!0)).format()},S.prototype.resolveObject=function(e){if(y(e)){var t=new S;t.parse(e,!1,!0),e=t}for(var r,n=new S,a=Object.keys(this),o=0;o<a.length;o++){var i=a[o];n[i]=this[i]}if(n.hash=e.hash,""===e.href)return n.href=n.format(),n;if(e.slashes&&!e.protocol){for(var s=Object.keys(e),u=0;u<s.length;u++){var c=s[u];"protocol"!==c&&(n[c]=e[c])}return _[n.protocol]&&n.hostname&&!n.pathname&&(n.path=n.pathname="/"),n.href=n.format(),n}if(e.protocol&&e.protocol!==n.protocol){if(!_[e.protocol]){for(var h=Object.keys(e),f=0;f<h.length;f++){var l=h[f];n[l]=e[l]}return n.href=n.format(),n}if(n.protocol=e.protocol,e.host||k[e.protocol])n.pathname=e.pathname;else{for(r=(e.pathname||"").split("/");r.length&&!(e.host=r.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),""!==r[0]&&r.unshift(""),r.length<2&&r.unshift(""),n.pathname=r.join("/")}if(n.search=e.search,n.query=e.query,n.host=e.host||"",n.auth=e.auth,n.hostname=e.hostname||e.host,n.port=e.port,n.pathname||n.search){var m=n.pathname||"",p=n.search||"";n.path=m+p}return n.slashes=n.slashes||e.slashes,n.href=n.format(),n}var d,b=n.pathname&&"/"===n.pathname.charAt(0),g=e.host||e.pathname&&"/"===e.pathname.charAt(0),w=g||b||n.host&&e.pathname,A=w,x=n.pathname&&n.pathname.split("/")||[],E=n.protocol&&!_[n.protocol];if(r=e.pathname&&e.pathname.split("/")||[],E&&(n.hostname="",n.port=null,n.host&&(""===x[0]?x[0]=n.host:x.unshift(n.host)),n.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(""===r[0]?r[0]=e.host:r.unshift(e.host)),e.host=null),w=w&&(""===r[0]||""===x[0])),g)n.host=e.host||""===e.host?e.host:n.host,n.hostname=e.hostname||""===e.hostname?e.hostname:n.hostname,n.search=e.search,n.query=e.query,x=r;else if(r.length)x||(x=[]),x.pop(),x=x.concat(r),n.search=e.search,n.query=e.query;else if(null!=e.search)return E&&(n.hostname=n.host=x.shift(),(d=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=d.shift(),n.host=n.hostname=d.shift())),n.search=e.search,n.query=e.query,v(n.pathname)&&v(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n;if(!x.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var O=x.slice(-1)[0],j=(n.host||e.host||x.length>1)&&("."===O||".."===O)||""===O,F=0,z=x.length;z>=0;z--)"."===(O=x[z])?x.splice(z,1):".."===O?(x.splice(z,1),F++):F&&(x.splice(z,1),F--);if(!w&&!A)for(;F--;F)x.unshift("..");!w||""===x[0]||x[0]&&"/"===x[0].charAt(0)||x.unshift(""),j&&"/"!==x.join("/").substr(-1)&&x.push("");var P=""===x[0]||x[0]&&"/"===x[0].charAt(0);return E&&(n.hostname=n.host=P?"":x.length?x.shift():"",(d=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=d.shift(),n.host=n.hostname=d.shift())),(w=w||n.host&&x.length)&&!P&&x.unshift(""),x.length?n.pathname=x.join("/"):(n.pathname=null,n.path=null),v(n.pathname)&&v(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=e.auth||n.auth,n.slashes=n.slashes||e.slashes,n.href=n.format(),n},S.prototype.parseHost=function(){return B(this)};var J=o(Object.freeze({__proto__:null,parse:q,resolve:T,resolveObject:U,format:V,default:j,Url:S})),Y={},G=J,K=Y.ValidationError=function(e,t,r,n,a,o){if(Array.isArray(n)?(this.path=n,this.property=n.reduce((function(e,t){return e+re(t)}),"instance")):void 0!==n&&(this.property=n),e&&(this.message=e),r){var i=r.$id||r.id;this.schema=i||r}void 0!==t&&(this.instance=t),this.name=a,this.argument=o,this.stack=this.toString()};K.prototype.toString=function(){return this.property+" "+this.message};var H=Y.ValidatorResult=function(e,t,r,n){this.instance=e,this.schema=t,this.options=r,this.path=n.path,this.propertyPath=n.propertyPath,this.errors=[],this.throwError=r&&r.throwError,this.throwFirst=r&&r.throwFirst,this.throwAll=r&&r.throwAll,this.disableFormat=r&&!0===r.disableFormat};function W(e,t){return t+": "+e.toString()+"\n"}function X(e){Error.captureStackTrace&&Error.captureStackTrace(this,X),this.instance=e.instance,this.schema=e.schema,this.options=e.options,this.errors=e.errors}H.prototype.addError=function(e){var t;if("string"==typeof e)t=new K(e,this.instance,this.schema,this.path);else{if(!e)throw new Error("Missing error detail");if(!e.message)throw new Error("Missing error message");if(!e.name)throw new Error("Missing validator type");t=new K(e.message,this.instance,this.schema,this.path,e.name,e.argument)}if(this.errors.push(t),this.throwFirst)throw new X(this);if(this.throwError)throw t;return t},H.prototype.importErrors=function(e){"string"==typeof e||e&&e.validatorType?this.addError(e):e&&e.errors&&Array.prototype.push.apply(this.errors,e.errors)},H.prototype.toString=function(e){return this.errors.map(W).join("")},Object.defineProperty(H.prototype,"valid",{get:function(){return!this.errors.length}}),Y.ValidatorResultError=X,X.prototype=new Error,X.prototype.constructor=X,X.prototype.name="Validation Error";var Q=Y.SchemaError=function e(t,r){this.message=t,this.schema=r,Error.call(this,t),Error.captureStackTrace(this,e)};Q.prototype=Object.create(Error.prototype,{constructor:{value:Q,enumerable:!1},name:{value:"SchemaError",enumerable:!1}});var ee=Y.SchemaContext=function(e,t,r,n,a){this.schema=e,this.options=t,Array.isArray(r)?(this.path=r,this.propertyPath=r.reduce((function(e,t){return e+re(t)}),"instance")):this.propertyPath=r,this.base=n,this.schemas=a};ee.prototype.resolve=function(e){return G.resolve(this.base,e)},ee.prototype.makeChild=function(e,t){var r=void 0===t?this.path:this.path.concat([t]),n=e.$id||e.id,a=G.resolve(this.base,n||""),o=new ee(e,this.options,r,a,Object.create(this.schemas));return n&&!o.schemas[a]&&(o.schemas[a]=e),o};var te=Y.FORMAT_REGEXPS={"date-time":/^\d{4}-(?:0[0-9]{1}|1[0-2]{1})-(3[01]|0[1-9]|[12][0-9])[tT ](2[0-4]|[01][0-9]):([0-5][0-9]):(60|[0-5][0-9])(\.\d+)?([zZ]|[+-]([0-5][0-9]):(60|[0-5][0-9]))$/,date:/^\d{4}-(?:0[0-9]{1}|1[0-2]{1})-(3[01]|0[1-9]|[12][0-9])$/,time:/^(2[0-4]|[01][0-9]):([0-5][0-9]):(60|[0-5][0-9])$/,email:/^(?:[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+\.)*[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+@(?:(?:(?:[a-zA-Z0-9](?:[a-zA-Z0-9\-](?!\.)){0,61}[a-zA-Z0-9]?\.)+[a-zA-Z0-9](?:[a-zA-Z0-9\-](?!$)){0,61}[a-zA-Z0-9]?)|(?:\[(?:(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\.){3}(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\]))$/,"ip-address":/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/,ipv6:/^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/,uri:/^[a-zA-Z][a-zA-Z0-9+-.]*:[^\s]*$/,"uri-reference":/^(((([A-Za-z][+\-.0-9A-Za-z]*(:%[0-9A-Fa-f]{2}|:[!$&-.0-;=?-Z_a-z~]|[/?])|\?)(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|([A-Za-z][+\-.0-9A-Za-z]*:?)?)|([A-Za-z][+\-.0-9A-Za-z]*:)?\/((%[0-9A-Fa-f]{2}|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?[/?]|[!$&-.0-;=?-Z_a-z~])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|(\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?)?))#(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|(([A-Za-z][+\-.0-9A-Za-z]*)?%[0-9A-Fa-f]{2}|[!$&-.0-9;=@_~]|[A-Za-z][+\-.0-9A-Za-z]*[!$&-*,;=@_~])(%[0-9A-Fa-f]{2}|[!$&-.0-9;=@-Z_a-z~])*((([/?](%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*)?#|[/?])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*)?|([A-Za-z][+\-.0-9A-Za-z]*(:%[0-9A-Fa-f]{2}|:[!$&-.0-;=?-Z_a-z~]|[/?])|\?)(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|([A-Za-z][+\-.0-9A-Za-z]*:)?\/((%[0-9A-Fa-f]{2}|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?[/?]|[!$&-.0-;=?-Z_a-z~])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+(:\d*)?|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?:\d*|\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)?|[A-Za-z][+\-.0-9A-Za-z]*:?)?$/,color:/^(#?([0-9A-Fa-f]{3}){1,2}\b|aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow|(rgb\(\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*,\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*,\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*\))|(rgb\(\s*(\d?\d%|100%)+\s*,\s*(\d?\d%|100%)+\s*,\s*(\d?\d%|100%)+\s*\)))$/,hostname:/^(?=.{1,255}$)[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?(?:\.[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?)*\.?$/,"host-name":/^(?=.{1,255}$)[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?(?:\.[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?)*\.?$/,alpha:/^[a-zA-Z]+$/,alphanumeric:/^[a-zA-Z0-9]+$/,"utc-millisec":function(e){return"string"==typeof e&&parseFloat(e)===parseInt(e,10)&&!isNaN(e)},regex:function(e){var t=!0;try{new RegExp(e)}catch(e){t=!1}return t},style:/\s*(.+?):\s*([^;]+);?/,phone:/^\+(?:[0-9] ?){6,14}[0-9]$/};te.regexp=te.regex,te.pattern=te.regex,te.ipv4=te["ip-address"],Y.isFormat=function(e,t,r){if("string"==typeof e&&void 0!==te[t]){if(te[t]instanceof RegExp)return te[t].test(e);if("function"==typeof te[t])return te[t](e)}else if(r&&r.customFormats&&"function"==typeof r.customFormats[t])return r.customFormats[t](e);return!0};var re=Y.makeSuffix=function(e){return(e=e.toString()).match(/[.\s\[\]]/)||e.match(/^[\d]/)?e.match(/^\d+$/)?"["+e+"]":"["+JSON.stringify(e)+"]":"."+e};function ne(e,t,r,n){"object"==typeof r?t[n]=ie(e[n],r):-1===e.indexOf(r)&&t.push(r)}function ae(e,t,r){t[r]=e[r]}function oe(e,t,r,n){"object"==typeof t[n]&&t[n]&&e[n]?r[n]=ie(e[n],t[n]):r[n]=t[n]}function ie(e,t){var r=Array.isArray(t),n=r&&[]||{};return r?(e=e||[],n=n.concat(e),t.forEach(ne.bind(null,e,n))):(e&&"object"==typeof e&&Object.keys(e).forEach(ae.bind(null,e,n)),Object.keys(t).forEach(oe.bind(null,e,t,n))),n}function se(e){return"/"+encodeURIComponent(e).replace(/~/g,"%7E")}Y.deepCompareStrict=function e(t,r){if(typeof t!=typeof r)return!1;if(Array.isArray(t))return!!Array.isArray(r)&&(t.length===r.length&&t.every((function(n,a){return e(t[a],r[a])})));if("object"==typeof t){if(!t||!r)return t===r;var n=Object.keys(t),a=Object.keys(r);return n.length===a.length&&n.every((function(n){return e(t[n],r[n])}))}return t===r},Y.deepMerge=ie,Y.objectGetPath=function(e,t){for(var r,n=t.split("/").slice(1);"string"==typeof(r=n.shift());){var a=decodeURIComponent(r.replace(/~0/,"~").replace(/~1/g,"/"));if(!(a in e))return;e=e[a]}return e},Y.encodePath=function(e){return e.map(se).join("")},Y.getDecimalPlaces=function(e){var t=0;if(isNaN(e))return t;"number"!=typeof e&&(e=Number(e));var r=e.toString().split("e");if(2===r.length){if("-"!==r[1][0])return t;t=Number(r[1].slice(1))}var n=r[0].split(".");return 2===n.length&&(t+=n[1].length),t},Y.isSchema=function(e){return"object"==typeof e&&e||"boolean"==typeof e};var ue=Y,ce=ue.ValidatorResult,he=ue.SchemaError,fe={ignoreProperties:{id:!0,default:!0,description:!0,title:!0,additionalItems:!0,then:!0,else:!0,$schema:!0,$ref:!0,extends:!0}},le=fe.validators={};function me(e,t,r,n,a){var o=t.throwError,i=t.throwAll;t.throwError=!1,t.throwAll=!1;var s=this.validateSchema(e,a,t,r);return t.throwError=o,t.throwAll=i,!s.valid&&n instanceof Function&&n(s),s.valid}function pe(e,t){if(Object.hasOwnProperty.call(e,t))return e[t];if(t in e)for(;e=Object.getPrototypeOf(e);)if(Object.propertyIsEnumerable.call(e,t))return e[t]}function de(e,t,r,n,a,o){if(this.types.object(e)&&(!t.properties||void 0===t.properties[a]))if(!1===t.additionalProperties)o.addError({name:"additionalProperties",argument:a,message:"is not allowed to have the additional property "+JSON.stringify(a)});else{var i=t.additionalProperties||{};"function"==typeof r.preValidateProperty&&r.preValidateProperty(e,a,i,r,n);var s=this.validateSchema(e[a],i,r,n.makeChild(i,a));s.instance!==o.instance[a]&&(o.instance[a]=s.instance),o.importErrors(s)}}le.type=function(e,t,r,n){if(void 0===e)return null;var a=new ce(e,t,r,n),o=Array.isArray(t.type)?t.type:[t.type];if(!o.some(this.testType.bind(this,e,t,r,n))){var i=o.map((function(e){if(e){var t=e.$id||e.id;return t?"<"+t+">":e+""}}));a.addError({name:"type",argument:i,message:"is not of a type(s) "+i})}return a},le.anyOf=function(e,t,r,n){if(void 0===e)return null;var a=new ce(e,t,r,n),o=new ce(e,t,r,n);if(!Array.isArray(t.anyOf))throw new he("anyOf must be an array");if(!t.anyOf.some(me.bind(this,e,r,n,(function(e){o.importErrors(e)})))){var i=t.anyOf.map((function(e,t){var r=e.$id||e.id;return r?"<"+r+">":e.title&&JSON.stringify(e.title)||e.$ref&&"<"+e.$ref+">"||"[subschema "+t+"]"}));r.nestedErrors&&a.importErrors(o),a.addError({name:"anyOf",argument:i,message:"is not any of "+i.join(",")})}return a},le.allOf=function(e,t,r,n){if(void 0===e)return null;if(!Array.isArray(t.allOf))throw new he("allOf must be an array");var a=new ce(e,t,r,n),o=this;return t.allOf.forEach((function(t,i){var s=o.validateSchema(e,t,r,n);if(!s.valid){var u=t.$id||t.id||t.title&&JSON.stringify(t.title)||t.$ref&&"<"+t.$ref+">"||"[subschema "+i+"]";a.addError({name:"allOf",argument:{id:u,length:s.errors.length,valid:s},message:"does not match allOf schema "+u+" with "+s.errors.length+" error[s]:"}),a.importErrors(s)}})),a},le.oneOf=function(e,t,r,n){if(void 0===e)return null;if(!Array.isArray(t.oneOf))throw new he("oneOf must be an array");var a=new ce(e,t,r,n),o=new ce(e,t,r,n),i=t.oneOf.filter(me.bind(this,e,r,n,(function(e){o.importErrors(e)}))).length,s=t.oneOf.map((function(e,t){return e.$id||e.id||e.title&&JSON.stringify(e.title)||e.$ref&&"<"+e.$ref+">"||"[subschema "+t+"]"}));return 1!==i&&(r.nestedErrors&&a.importErrors(o),a.addError({name:"oneOf",argument:s,message:"is not exactly one from "+s.join(",")})),a},le.if=function(e,t,r,n){if(void 0===e)return null;if(!ue.isSchema(t.if))throw new Error('Expected "if" keyword to be a schema');var a,o=me.call(this,e,r,n,null,t.if),i=new ce(e,t,r,n);if(o){if(void 0===t.then)return;if(!ue.isSchema(t.then))throw new Error('Expected "then" keyword to be a schema');a=this.validateSchema(e,t.then,r,n.makeChild(t.then)),i.importErrors(a)}else{if(void 0===t.else)return;if(!ue.isSchema(t.else))throw new Error('Expected "else" keyword to be a schema');a=this.validateSchema(e,t.else,r,n.makeChild(t.else)),i.importErrors(a)}return i},le.propertyNames=function(e,t,r,n){if(this.types.object(e)){var a=new ce(e,t,r,n),o=void 0!==t.propertyNames?t.propertyNames:{};if(!ue.isSchema(o))throw new he('Expected "propertyNames" to be a schema (object or boolean)');for(var i in e)if(void 0!==pe(e,i)){var s=this.validateSchema(i,o,r,n.makeChild(o));a.importErrors(s)}return a}},le.properties=function(e,t,r,n){if(this.types.object(e)){var a=new ce(e,t,r,n),o=t.properties||{};for(var i in o){var s=o[i];if(void 0!==s){if(null===s)throw new he('Unexpected null, expected schema in "properties"');"function"==typeof r.preValidateProperty&&r.preValidateProperty(e,i,s,r,n);var u=pe(e,i),c=this.validateSchema(u,s,r,n.makeChild(s,i));c.instance!==a.instance[i]&&(a.instance[i]=c.instance),a.importErrors(c)}}return a}},le.patternProperties=function(e,t,r,n){if(this.types.object(e)){var a=new ce(e,t,r,n),o=t.patternProperties||{};for(var i in e){var s=!0;for(var u in o){var c=o[u];if(void 0!==c){if(null===c)throw new he('Unexpected null, expected schema in "patternProperties"');try{var h=new RegExp(u,"u")}catch(e){h=new RegExp(u)}if(h.test(i)){s=!1,"function"==typeof r.preValidateProperty&&r.preValidateProperty(e,i,c,r,n);var f=this.validateSchema(e[i],c,r,n.makeChild(c,i));f.instance!==a.instance[i]&&(a.instance[i]=f.instance),a.importErrors(f)}}}s&&de.call(this,e,t,r,n,i,a)}return a}},le.additionalProperties=function(e,t,r,n){if(this.types.object(e)){if(t.patternProperties)return null;var a=new ce(e,t,r,n);for(var o in e)de.call(this,e,t,r,n,o,a);return a}},le.minProperties=function(e,t,r,n){if(this.types.object(e)){var a=new ce(e,t,r,n);return Object.keys(e).length>=t.minProperties||a.addError({name:"minProperties",argument:t.minProperties,message:"does not meet minimum property length of "+t.minProperties}),a}},le.maxProperties=function(e,t,r,n){if(this.types.object(e)){var a=new ce(e,t,r,n);return Object.keys(e).length<=t.maxProperties||a.addError({name:"maxProperties",argument:t.maxProperties,message:"does not meet maximum property length of "+t.maxProperties}),a}},le.items=function(e,t,r,n){var a=this;if(this.types.array(e)&&t.items){var o=new ce(e,t,r,n);return e.every((function(e,i){var s=Array.isArray(t.items)?t.items[i]||t.additionalItems:t.items;if(void 0===s)return!0;if(!1===s)return o.addError({name:"items",message:"additionalItems not permitted"}),!1;var u=a.validateSchema(e,s,r,n.makeChild(s,i));return u.instance!==o.instance[i]&&(o.instance[i]=u.instance),o.importErrors(u),!0})),o}},le.minimum=function(e,t,r,n){if(this.types.number(e)){var a=new ce(e,t,r,n);return t.exclusiveMinimum&&!0===t.exclusiveMinimum?e>t.minimum||a.addError({name:"minimum",argument:t.minimum,message:"must be greater than "+t.minimum}):e>=t.minimum||a.addError({name:"minimum",argument:t.minimum,message:"must be greater than or equal to "+t.minimum}),a}},le.maximum=function(e,t,r,n){if(this.types.number(e)){var a=new ce(e,t,r,n);return t.exclusiveMaximum&&!0===t.exclusiveMaximum?e<t.maximum||a.addError({name:"maximum",argument:t.maximum,message:"must be less than "+t.maximum}):e<=t.maximum||a.addError({name:"maximum",argument:t.maximum,message:"must be less than or equal to "+t.maximum}),a}},le.exclusiveMinimum=function(e,t,r,n){if("boolean"!=typeof t.exclusiveMaximum&&this.types.number(e)){var a=new ce(e,t,r,n);return e>t.exclusiveMinimum||a.addError({name:"exclusiveMinimum",argument:t.exclusiveMinimum,message:"must be strictly greater than "+t.exclusiveMinimum}),a}},le.exclusiveMaximum=function(e,t,r,n){if("boolean"!=typeof t.exclusiveMaximum&&this.types.number(e)){var a=new ce(e,t,r,n);return e<t.exclusiveMaximum||a.addError({name:"exclusiveMaximum",argument:t.exclusiveMaximum,message:"must be strictly less than "+t.exclusiveMaximum}),a}};var ve=function(e,t,r,n,a,o){if(this.types.number(e)){var i=t[a];if(0==i)throw new he(a+" cannot be zero");var s=new ce(e,t,r,n),u=ue.getDecimalPlaces(e),c=ue.getDecimalPlaces(i),h=Math.max(u,c),f=Math.pow(10,h);return Math.round(e*f)%Math.round(i*f)!=0&&s.addError({name:a,argument:i,message:o+JSON.stringify(i)}),s}};function ye(e,t,r){var n,a=r.length;for(n=t+1;n<a;n++)if(ue.deepCompareStrict(e,r[n]))return!1;return!0}le.multipleOf=function(e,t,r,n){return ve.call(this,e,t,r,n,"multipleOf","is not a multiple of (divisible by) ")},le.divisibleBy=function(e,t,r,n){return ve.call(this,e,t,r,n,"divisibleBy","is not divisible by (multiple of) ")},le.required=function(e,t,r,n){var a=new ce(e,t,r,n);return void 0===e&&!0===t.required?a.addError({name:"required",message:"is required"}):this.types.object(e)&&Array.isArray(t.required)&&t.required.forEach((function(t){void 0===pe(e,t)&&a.addError({name:"required",argument:t,message:"requires property "+JSON.stringify(t)})})),a},le.pattern=function(e,t,r,n){if(this.types.string(e)){var a=new ce(e,t,r,n),o=t.pattern;try{var i=new RegExp(o,"u")}catch(e){i=new RegExp(o)}return e.match(i)||a.addError({name:"pattern",argument:t.pattern,message:"does not match pattern "+JSON.stringify(t.pattern.toString())}),a}},le.format=function(e,t,r,n){if(void 0!==e){var a=new ce(e,t,r,n);return a.disableFormat||ue.isFormat(e,t.format,this)||a.addError({name:"format",argument:t.format,message:"does not conform to the "+JSON.stringify(t.format)+" format"}),a}},le.minLength=function(e,t,r,n){if(this.types.string(e)){var a=new ce(e,t,r,n),o=e.match(/[\uDC00-\uDFFF]/g);return e.length-(o?o.length:0)>=t.minLength||a.addError({name:"minLength",argument:t.minLength,message:"does not meet minimum length of "+t.minLength}),a}},le.maxLength=function(e,t,r,n){if(this.types.string(e)){var a=new ce(e,t,r,n),o=e.match(/[\uDC00-\uDFFF]/g);return e.length-(o?o.length:0)<=t.maxLength||a.addError({name:"maxLength",argument:t.maxLength,message:"does not meet maximum length of "+t.maxLength}),a}},le.minItems=function(e,t,r,n){if(this.types.array(e)){var a=new ce(e,t,r,n);return e.length>=t.minItems||a.addError({name:"minItems",argument:t.minItems,message:"does not meet minimum length of "+t.minItems}),a}},le.maxItems=function(e,t,r,n){if(this.types.array(e)){var a=new ce(e,t,r,n);return e.length<=t.maxItems||a.addError({name:"maxItems",argument:t.maxItems,message:"does not meet maximum length of "+t.maxItems}),a}},le.uniqueItems=function(e,t,r,n){if(!0===t.uniqueItems&&this.types.array(e)){var a=new ce(e,t,r,n);return e.every(ye)||a.addError({name:"uniqueItems",message:"contains duplicate item"}),a}},le.dependencies=function(e,t,r,n){if(this.types.object(e)){var a=new ce(e,t,r,n);for(var o in t.dependencies)if(void 0!==e[o]){var i=t.dependencies[o],s=n.makeChild(i,o);if("string"==typeof i&&(i=[i]),Array.isArray(i))i.forEach((function(t){void 0===e[t]&&a.addError({name:"dependencies",argument:s.propertyPath,message:"property "+t+" not found, required by "+s.propertyPath})}));else{var u=this.validateSchema(e,i,r,s);a.instance!==u.instance&&(a.instance=u.instance),u&&u.errors.length&&(a.addError({name:"dependencies",argument:s.propertyPath,message:"does not meet dependency required by "+s.propertyPath}),a.importErrors(u))}}return a}},le.enum=function(e,t,r,n){if(void 0===e)return null;if(!Array.isArray(t.enum))throw new he("enum expects an array",t);var a=new ce(e,t,r,n);return t.enum.some(ue.deepCompareStrict.bind(null,e))||a.addError({name:"enum",argument:t.enum,message:"is not one of enum values: "+t.enum.map(String).join(",")}),a},le.const=function(e,t,r,n){if(void 0===e)return null;var a=new ce(e,t,r,n);return ue.deepCompareStrict(t.const,e)||a.addError({name:"const",argument:t.const,message:"does not exactly match expected constant: "+t.const}),a},le.not=le.disallow=function(e,t,r,n){var a=this;if(void 0===e)return null;var o=new ce(e,t,r,n),i=t.not||t.disallow;return i?(Array.isArray(i)||(i=[i]),i.forEach((function(i){if(a.testType(e,t,r,n,i)){var s=i&&(i.$id||i.id)||i;o.addError({name:"not",argument:s,message:"is of prohibited type "+s})}})),o):null};var be=fe,ge={},we=J,Ae=Y;function xe(e,t){this.id=e,this.ref=t}ge.SchemaScanResult=xe,ge.scan=function(e,t){function r(e,t){if(t&&"object"==typeof t)if(t.$ref){var s=we.resolve(e,t.$ref);i[s]=i[s]?i[s]+1:0}else{var u=t.$id||t.id,c=u?we.resolve(e,u):e;if(c){if(c.indexOf("#")<0&&(c+="#"),o[c]){if(!Ae.deepCompareStrict(o[c],t))throw new Error("Schema <"+c+"> already exists with different definition");return o[c]}o[c]=t,"#"==c[c.length-1]&&(o[c.substring(0,c.length-1)]=t)}n(c+"/items",Array.isArray(t.items)?t.items:[t.items]),n(c+"/extends",Array.isArray(t.extends)?t.extends:[t.extends]),r(c+"/additionalItems",t.additionalItems),a(c+"/properties",t.properties),r(c+"/additionalProperties",t.additionalProperties),a(c+"/definitions",t.definitions),a(c+"/patternProperties",t.patternProperties),a(c+"/dependencies",t.dependencies),n(c+"/disallow",t.disallow),n(c+"/allOf",t.allOf),n(c+"/anyOf",t.anyOf),n(c+"/oneOf",t.oneOf),r(c+"/not",t.not)}}function n(e,t){if(Array.isArray(t))for(var n=0;n<t.length;n++)r(e+"/"+n,t[n])}function a(e,t){if(t&&"object"==typeof t)for(var n in t)r(e+"/"+n,t[n])}var o={},i={};return r(e,t),new xe(o,i)};var Ee=J,Oe=be,je=Y,Se=ge.scan,Fe=je.ValidatorResult,ze=je.ValidatorResultError,Pe=je.SchemaError,Ne=je.SchemaContext,$e=function e(){this.customFormats=Object.create(e.prototype.customFormats),this.schemas={},this.unresolvedRefs=[],this.types=Object.create(De),this.attributes=Object.create(Oe.validators)};function Ze(e){var t="string"==typeof e?e:e.$ref;return"string"==typeof t&&t}$e.prototype.customFormats={},$e.prototype.schemas=null,$e.prototype.types=null,$e.prototype.attributes=null,$e.prototype.unresolvedRefs=null,$e.prototype.addSchema=function(e,t){var r=this;if(!e)return null;var n=Se(t||"/",e),a=t||e.$id||e.id;for(var o in n.id)this.schemas[o]=n.id[o];for(var o in n.ref)this.unresolvedRefs.push(o);return this.unresolvedRefs=this.unresolvedRefs.filter((function(e){return void 0===r.schemas[e]})),this.schemas[a]},$e.prototype.addSubSchemaArray=function(e,t){if(Array.isArray(t))for(var r=0;r<t.length;r++)this.addSubSchema(e,t[r])},$e.prototype.addSubSchemaObject=function(e,t){if(t&&"object"==typeof t)for(var r in t)this.addSubSchema(e,t[r])},$e.prototype.setSchemas=function(e){this.schemas=e},$e.prototype.getSchema=function(e){return this.schemas[e]},$e.prototype.validate=function(e,t,r,n){if("boolean"!=typeof t&&"object"!=typeof t||null===t)throw new Pe("Expected `schema` to be an object or boolean");r||(r={});var a,o=t.$id||t.id,i=Ee.resolve(r.base||"/",o||"");if(!n){(n=new Ne(t,r,[],i,Object.create(this.schemas))).schemas[i]||(n.schemas[i]=t);var s=Se(i,t);for(var u in s.id){var c=s.id[u];n.schemas[u]=c}}if(r.required&&void 0===e)return(a=new Fe(e,t,r,n)).addError("is required, but is undefined"),a;if(!(a=this.validateSchema(e,t,r,n)))throw new Error("Result undefined");if(r.throwAll&&a.errors.length)throw new ze(a);return a},$e.prototype.validateSchema=function(e,t,r,n){var a=new Fe(e,t,r,n);if("boolean"==typeof t)!0===t?t={}:!1===t&&(t={type:[]});else if(!t)throw new Error("schema is undefined");if(t.extends)if(Array.isArray(t.extends)){var o={schema:t,ctx:n};t.extends.forEach(this.schemaTraverser.bind(this,o)),t=o.schema,o.schema=null,o.ctx=null,o=null}else t=je.deepMerge(t,this.superResolve(t.extends,n));var i=Ze(t);if(i){var s=this.resolve(t,i,n),u=new Ne(s.subschema,r,n.path,s.switchSchema,n.schemas);return this.validateSchema(e,s.subschema,r,u)}var c=r&&r.skipAttributes||[];for(var h in t)if(!Oe.ignoreProperties[h]&&c.indexOf(h)<0){var f=null,l=this.attributes[h];if(l)f=l.call(this,e,t,r,n);else if(!1===r.allowUnknownAttributes)throw new Pe("Unsupported attribute: "+h,t);f&&a.importErrors(f)}if("function"==typeof r.rewrite){var m=r.rewrite.call(this,e,t,r,n);a.instance=m}return a},$e.prototype.schemaTraverser=function(e,t){e.schema=je.deepMerge(e.schema,this.superResolve(t,e.ctx))},$e.prototype.superResolve=function(e,t){var r=Ze(e);return r?this.resolve(e,r,t).subschema:e},$e.prototype.resolve=function(e,t,r){if(t=r.resolve(t),r.schemas[t])return{subschema:r.schemas[t],switchSchema:t};var n=Ee.parse(t),a=n&&n.hash,o=a&&a.length&&t.substr(0,t.length-a.length);if(!o||!r.schemas[o])throw new Pe("no such schema <"+t+">",e);var i=je.objectGetPath(r.schemas[o],a.substr(1));if(void 0===i)throw new Pe("no such schema "+a+" located in <"+o+">",e);return{subschema:i,switchSchema:t}},$e.prototype.testType=function(e,t,r,n,a){if(void 0!==a){if(null===a)throw new Pe('Unexpected null in "type" keyword');if("function"==typeof this.types[a])return this.types[a].call(this,e);if(a&&"object"==typeof a){var o=this.validateSchema(e,a,r,n);return void 0===o||!(o&&o.errors.length)}return!0}};var De=$e.prototype.types={};De.string=function(e){return"string"==typeof e},De.number=function(e){return"number"==typeof e&&isFinite(e)},De.integer=function(e){return"number"==typeof e&&e%1==0},De.boolean=function(e){return"boolean"==typeof e},De.array=function(e){return Array.isArray(e)},De.null=function(e){return null===e},De.date=function(e){return e instanceof Date},De.any=function(e){return!0},De.object=function(e){return e&&"object"==typeof e&&!Array.isArray(e)&&!(e instanceof Date)};var Re=$e,Ce="^[a-zA-Z0-9_.-]*$",Ie={type:"object",id:"/CreateFsPropsSchema",properties:{databaseName:{minLength:4,maxLength:50,type:"string",pattern:Ce},objectStoreName:{minLength:1,maxLength:20,type:"string",pattern:Ce},rootDirectoryName:{minLength:1,maxLength:20,type:"string",pattern:Ce},databaseVersion:{minimum:1,maximum:100,type:"integer"}},required:["databaseName","databaseVersion","objectStoreName","rootDirectoryName"]};function ke(e){var t,r,n,a=(t=e,r=Ie,(new Re).validate(t,r,n)),o=a.valid,i=a.errors;if(o)return o;var s=JSON.stringify(i);throw new Error("Props passed to createFS function are invalid:\n"+s)}function _e(e,t){return""===e?t:function(e,t){if(!n(e)||!n(t)||""===t)return!1;var r=t+"/";return e.startsWith(r)}(e,t)?e:t+(function(e){return!(!n(e)||0===e.length)&&"/"===e[0]}(e)?"":"/")+e}function qe(e,t){if(!n(t)||""===t)throw new Error("rootDirectoryName parameter was not provided");if(!n(e))throw new Error("fullPath parameter was not provided");if(e===t)return t;var r=_e(e,t);if(!r||!function(e){return!!n(e)&&a.test(e)}(r))throw new Error('"'+e+'" path is invalid.');return r}var Me="directory";function Ve(e){return e?e.result:null}function Le(e,t){t||e(new Error("Something went wrong and the database transaction was not opened."))}var Te,Ue=function(e){var t=e.databaseName,r=e.databaseVersion,n=e.objectStoreName;return new Promise((function(e,a){var o=Be(t,r);o.onupgradeneeded=function(e){var t=Ve(e.target);Le(a,t),t.createObjectStore(n,{keyPath:"fullPath"}).createIndex(Me,Me,{unique:!1})},o.onsuccess=function(t){var r=t.target,n=Ve(r);Le(a,n),e(Ve(r))},o.onerror=a}))},Be=function(e,t){return indexedDB.open(e,t)};!function(e){e.FILE="file",e.DIRECTORY="directory"}(Te||(Te={}));function Je(e,t){for(var r=0,n=e.length-1;n>=0;n--){var a=e[n];"."===a?e.splice(n,1):".."===a?(e.splice(n,1),r++):r&&(e.splice(n,1),r--)}if(t)for(;r--;r)e.unshift("..");return e}var Ye=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,Ge=function(e){return Ye.exec(e).slice(1)};function Ke(){for(var e="",t=!1,r=arguments.length-1;r>=-1&&!t;r--){var n=r>=0?arguments[r]:"/";if("string"!=typeof n)throw new TypeError("Arguments to path.resolve must be strings");n&&(e=n+"/"+e,t="/"===n.charAt(0))}return(t?"/":"")+(e=Je(Qe(e.split("/"),(function(e){return!!e})),!t).join("/"))||"."}function He(e){var t=We(e),r="/"===et(e,-1);return(e=Je(Qe(e.split("/"),(function(e){return!!e})),!t).join("/"))||t||(e="."),e&&r&&(e+="/"),(t?"/":"")+e}function We(e){return"/"===e.charAt(0)}var Xe={extname:function(e){return Ge(e)[3]},basename:function(e,t){var r=Ge(e)[2];return t&&r.substr(-1*t.length)===t&&(r=r.substr(0,r.length-t.length)),r},dirname:function(e){var t=Ge(e),r=t[0],n=t[1];return r||n?(n&&(n=n.substr(0,n.length-1)),r+n):"."},sep:"/",delimiter:":",relative:function(e,t){function r(e){for(var t=0;t<e.length&&""===e[t];t++);for(var r=e.length-1;r>=0&&""===e[r];r--);return t>r?[]:e.slice(t,r-t+1)}e=Ke(e).substr(1),t=Ke(t).substr(1);for(var n=r(e.split("/")),a=r(t.split("/")),o=Math.min(n.length,a.length),i=o,s=0;s<o;s++)if(n[s]!==a[s]){i=s;break}var u=[];for(s=i;s<n.length;s++)u.push("..");return(u=u.concat(a.slice(i))).join("/")},join:function(){var e=Array.prototype.slice.call(arguments,0);return He(Qe(e,(function(e,t){if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e})).join("/"))},isAbsolute:We,normalize:He,resolve:Ke};function Qe(e,t){if(e.filter)return e.filter(t);for(var r=[],n=0;n<e.length;n++)t(e[n],n,e)&&r.push(e[n]);return r}var et="b"==="ab".substr(-1)?function(e,t,r){return e.substr(t,r)}:function(e,t,r){return t<0&&(t=e.length+t),e.substr(t,r)},tt=function(e){var n=e.isDirectory,a=e.rootDirectoryName,o=e.initializeObjectStore;return function(e){return t(void 0,void 0,void 0,(function(){var t,i;return r(this,(function(r){switch(r.label){case 0:return t=qe(e,a),[4,n(e)];case 1:if(!r.sent())throw new Error('"'+t+'" is not a directory.');return[4,o("readonly")];case 2:return i=r.sent(),[2,new Promise((function(e,r){var n=i.index(Me),a=IDBKeyRange.only(t),o=n.openCursor(a);o.onerror=r;var s=[],u=[];o.onsuccess=function(t){var r=t.target.result;if(r){var n=r.value;if(n.type===Te.FILE){n.data;var a=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]])}return r}(n,["data"]);s.push(a)}else n.type!==Te.DIRECTORY||n.isRoot||u.push(n);r.continue()}else{var o=s.length,i=u.length;e({isEmpty:0===o&&0===i,filesCount:o,directoriesCount:i,files:s,directories:u})}}}))]}}))}))}},rt={databaseVersion:1,objectStoreName:"files",rootDirectoryName:"root",databaseName:"indexeddb-fs"};function nt(e){var n=this,a=void 0===e?rt:e,o=a.databaseName,i=void 0===o?rt.databaseName:o,s=a.databaseVersion,u=void 0===s?rt.databaseVersion:s,c=a.objectStoreName,h=void 0===c?rt.objectStoreName:c,f=a.rootDirectoryName,l=void 0===f?rt.rootDirectoryName:f;var m=function(e){var n=e.databaseName,a=e.databaseVersion,o=e.objectStoreName;return function(e){return t(void 0,void 0,void 0,(function(){return r(this,(function(t){switch(t.label){case 0:return[4,Ue({databaseName:n,databaseVersion:a,objectStoreName:o})];case 1:return[2,t.sent().transaction(o,e).objectStore(o)]}}))}))}}({databaseName:i,databaseVersion:u,objectStoreName:h}),p=function(e){var n=e.rootDirectoryName,a=e.initializeObjectStore;return function(e){return t(void 0,void 0,void 0,(function(){var t,o;return r(this,(function(r){switch(r.label){case 0:return t=qe(e,n),[4,a("readonly")];case 1:return o=r.sent(),[2,new Promise((function(e){var r=o.get(t);r.onerror=function(){return e(!1)},r.onsuccess=function(t){var r=t.target.result;e(Boolean(null==r?void 0:r.createdAt))}}))]}}))}))}}({rootDirectoryName:l,initializeObjectStore:m}),d=function(e){var n=e.exists,a=e.rootDirectoryName,o=e.initializeObjectStore;return function(e){return t(void 0,void 0,void 0,(function(){var t,i;return r(this,(function(r){switch(r.label){case 0:return t=qe(e,a),[4,n(t)];case 1:if(!r.sent())throw new Error('"'+t+'" file does not exist.');return[4,o("readonly")];case 2:return i=r.sent(),[2,new Promise((function(e){var r=i.get(t);r.onerror=function(){return e(!1)},r.onsuccess=function(t){var r=t.target.result;e(Boolean((null==r?void 0:r.type)===Te.FILE))}}))]}}))}))}}({exists:p,rootDirectoryName:l,initializeObjectStore:m}),v=function(e){var n=e.exists,a=e.rootDirectoryName,o=e.initializeObjectStore;return function(e){return t(void 0,void 0,void 0,(function(){var t,i;return r(this,(function(r){switch(r.label){case 0:return t=qe(e,a),[4,n(t)];case 1:if(!r.sent())throw new Error('"'+t+'" file or directory does not exist.');return[4,o("readwrite")];case 2:return i=r.sent(),[2,new Promise((function(e,r){var n=i.delete(t);n.onerror=r,n.onsuccess=function(){return e()}}))]}}))}))}}({exists:p,rootDirectoryName:l,initializeObjectStore:m}),y=function(e){var n=e.isFile,a=e.rootDirectoryName,o=e.initializeObjectStore;return function(e){return t(void 0,void 0,void 0,(function(){var t,i;return r(this,(function(r){switch(r.label){case 0:return t=qe(e,a),[4,n(e)];case 1:if(!r.sent())throw new Error('"'+t+'" is not a file.');return[4,o("readonly")];case 2:return i=r.sent(),[2,new Promise((function(e,r){var n=i.get(t);n.onerror=r,n.onsuccess=function(t){var r=t.target.result;e(null==r?void 0:r.data)}}))]}}))}))}}({isFile:d,rootDirectoryName:l,initializeObjectStore:m}),b=function(e){var n=e.exists,a=e.rootDirectoryName,o=e.initializeObjectStore;return function(e,i){return t(void 0,void 0,void 0,(function(){var t,s,u,c;return r(this,(function(r){switch(r.label){case 0:if((t=qe(e,a))===a)throw new Error('Root directory: "'+t+'" cannot be a file.');return s=Xe.basename(t),u=Xe.dirname(t),[4,n(u)];case 1:if(!r.sent())throw new Error('"'+u+'" directory does not exist.');return[4,o("readwrite")];case 2:return c=r.sent(),[2,new Promise((function(e,r){var n={data:i,directory:u,name:s,type:Te.FILE,createdAt:Date.now(),fullPath:t},a=c.put(n);a.onerror=r,a.onsuccess=function(){return e(n)}}))]}}))}))}}({exists:p,rootDirectoryName:l,initializeObjectStore:m}),g=function(e){var n=e.isFile,a=e.rootDirectoryName,o=e.initializeObjectStore;return function(e){return t(void 0,void 0,void 0,(function(){var t,i;return r(this,(function(r){switch(r.label){case 0:return t=qe(e,a),[4,n(t)];case 1:if(!r.sent())throw new Error('"'+t+'" is not a file.');return[4,o("readwrite")];case 2:return i=r.sent(),[2,new Promise((function(e,r){var n=i.delete(t);n.onerror=r,n.onsuccess=function(){return e()}}))]}}))}))}}({isFile:d,rootDirectoryName:l,initializeObjectStore:m}),w=function(e){var n=e.exists,a=e.rootDirectoryName,o=e.initializeObjectStore;return function(e){return t(void 0,void 0,void 0,(function(){var t,i;return r(this,(function(r){switch(r.label){case 0:return t=qe(e,a),[4,n(t)];case 1:if(!r.sent())throw new Error('"'+t+'" directory does not exist.');return[4,o("readonly")];case 2:return i=r.sent(),[2,new Promise((function(e){var r=i.get(t);r.onerror=function(){return e(!1)},r.onsuccess=function(t){var r=t.target.result;e(Boolean((null==r?void 0:r.type)===Te.DIRECTORY))}}))]}}))}))}}({exists:p,rootDirectoryName:l,initializeObjectStore:m}),A=tt({isDirectory:w,rootDirectoryName:l,initializeObjectStore:m}),x=function(e){var n=e.isDirectory,a=e.rootDirectoryName,o=e.initializeObjectStore;return function(e){return t(void 0,void 0,void 0,(function(){var t,i,s,u;return r(this,(function(r){switch(r.label){case 0:if((t=qe(e,a))===a)throw new Error('Root directory: "'+t+'" already exist.');return i=Xe.basename(t),s=Xe.dirname(t),[4,n(s)];case 1:if(!r.sent())throw new Error('"'+s+'" is not a directory.');return[4,o("readwrite")];case 2:return u=r.sent(),[2,new Promise((function(e,r){var n={directory:s,isRoot:!1,name:i,createdAt:Date.now(),type:Te.DIRECTORY,fullPath:t},a=u.put(n);a.onerror=r,a.onsuccess=function(){return e(n)}}))]}}))}))}}({isDirectory:w,rootDirectoryName:l,initializeObjectStore:m}),E=function(e){var n=e.remove,a=e.isDirectory,o=e.readDirectory,i=e.rootDirectoryName;function s(e){return t(this,void 0,void 0,(function(){var t,a,u,c,h,f,l,m,p,d,v,y;return r(this,(function(r){switch(r.label){case 0:return t=qe(e,i),[4,o(t)];case 1:if(a=r.sent(),u=a.filesCount,c=a.directoriesCount,h=a.files,f=a.directories,!(u>0))return[3,5];l=0,m=h,r.label=2;case 2:return l<m.length?(p=m[l],[4,n(p.fullPath)]):[3,5];case 3:r.sent(),r.label=4;case 4:return l++,[3,2];case 5:return c?[3,7]:[4,n(e)];case 6:return r.sent(),[2];case 7:d=0,v=f,r.label=8;case 8:return d<v.length?(y=v[d]).isRoot?[3,10]:[4,s(y.fullPath)]:[3,14];case 9:r.sent(),r.label=10;case 10:return r.trys.push([10,12,,13]),[4,n(y.fullPath)];case 11:case 12:return r.sent(),[3,13];case 13:return d++,[3,8];case 14:return[2]}}))}))}return function(e){return t(this,void 0,void 0,(function(){return r(this,(function(t){switch(t.label){case 0:return[4,a(e)];case 1:if(!t.sent())throw new Error('"'+e+'" is not a directory.');return[4,s(e)];case 2:return t.sent(),e===i?[3,4]:[4,n(e)];case 3:t.sent(),t.label=4;case 4:return[2]}}))}))}}({remove:v,isDirectory:w,readDirectory:A,rootDirectoryName:l}),O=function(e){var n=e.rootDirectoryName,a=e.initializeObjectStore;return function(){return t(void 0,void 0,void 0,(function(){var e;return r(this,(function(t){switch(t.label){case 0:return[4,a("readwrite")];case 1:return e=t.sent(),[2,new Promise((function(t,r){var a={isRoot:!0,createdAt:Date.now(),name:n,type:Te.DIRECTORY,fullPath:n,directory:n},o=e.put(a);o.onerror=r,o.onsuccess=function(){return t(a)}}))]}}))}))}}({rootDirectoryName:l,initializeObjectStore:m});function j(){return t(this,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,p(l)];case 1:return e.sent()?[3,3]:[4,O()];case 2:e.sent(),e.label=3;case 3:return[2]}}))}))}var S=function(e){return function(){for(var a=[],o=0;o<arguments.length;o++)a[o]=arguments[o];return t(n,void 0,void 0,(function(){return r(this,(function(t){switch(t.label){case 0:return[4,j()];case 1:return t.sent(),[2,e.apply(void 0,a)]}}))}))}};return function(){if(!Boolean(indexedDB))throw new Error("Your browser does not support indexedDB.")}(),ke({databaseName:i,objectStoreName:h,databaseVersion:u,rootDirectoryName:l}),{databaseName:i,databaseVersion:u,objectStoreName:h,rootDirectoryName:l,exists:S(p),isFile:S(d),remove:S(v),readFile:S(y),writeFile:S(b),removeFile:S(g),isDirectory:S(w),readDirectory:S(A),createDirectory:S(x),removeDirectory:S(E)}}var at=nt();e.createFs=nt,e.default=at,Object.defineProperty(e,"__esModule",{value:!0})}));
{
"name": "indexeddb-fs",
"version": "1.0.0",
"version": "1.0.1",
"description": "An 'fs' kind of library dedicated for the browser. It works based on indexed-db.",

@@ -5,0 +5,0 @@ "license": "MIT",

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc