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

incache

Package Overview
Dependencies
Maintainers
2
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

incache - npm Package Compare versions

Comparing version 7.0.6 to 7.1.0

3

CHANGELOG.md

@@ -7,2 +7,5 @@ # Change Log

## [7.1.0] - 2018-09-20
- **Added** method `info`, now it's possible retrieve only record info without increase `hits`
## [7.0.6] - 2018-09-19

@@ -9,0 +12,0 @@ - **Removed** vulnerable library

4

dist/incache.min.js

@@ -1,2 +0,2 @@

// [AIV] InCache Build version: 7.0.6
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("incache",[],t):"object"==typeof exports?exports.incache=t():e.incache=t()}(this,function(){return function(e){function t(n){if(r[n])return r[n].exports;var i=r[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var r={};return t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=6)}([function(e,t,r){"use strict";var n,i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(e){"object"===("undefined"==typeof window?"undefined":i(window))&&(n=window)}e.exports=n},function(e,t,r){"use strict";function n(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function o(e){if(c===setTimeout)return setTimeout(e,0);if((c===n||!c)&&setTimeout)return c=setTimeout,setTimeout(e,0);try{return c(e,0)}catch(t){try{return c.call(null,e,0)}catch(t){return c.call(this,e,0)}}}function s(e){if(h===clearTimeout)return clearTimeout(e);if((h===i||!h)&&clearTimeout)return h=clearTimeout,clearTimeout(e);try{return h(e)}catch(t){try{return h.call(null,e)}catch(t){return h.call(this,e)}}}function u(){v&&y&&(v=!1,y.length?d=y.concat(d):m=-1,d.length&&a())}function a(){if(!v){var e=o(u);v=!0;for(var t=d.length;t;){for(y=d,d=[];++m<t;)y&&y[m].run();m=-1,t=d.length}y=null,v=!1,s(e)}}function f(e,t){this.fun=e,this.array=t}function l(){}var c,h,p=e.exports={};!function(){try{c="function"==typeof setTimeout?setTimeout:n}catch(e){c=n}try{h="function"==typeof clearTimeout?clearTimeout:i}catch(e){h=i}}();var y,d=[],v=!1,m=-1;p.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];d.push(new f(e,t)),1!==d.length||v||o(a)},f.prototype.run=function(){this.fun.apply(null,this.array)},p.title="browser",p.browser=!0,p.env={},p.argv=[],p.version="",p.versions={},p.on=l,p.addListener=l,p.once=l,p.off=l,p.removeListener=l,p.removeAllListeners=l,p.emit=l,p.prependListener=l,p.prependOnceListener=l,p.listeners=function(e){return[]},p.binding=function(e){throw new Error("process.binding is not supported")},p.cwd=function(){return"/"},p.chdir=function(e){throw new Error("process.chdir is not supported")},p.umask=function(){return 0}},function(e,t,r){"use strict"},function(e,t,r){"use strict";e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,r){"use strict";(function(e){function r(e,t){for(var r=0,n=e.length-1;n>=0;n--){var i=e[n];"."===i?e.splice(n,1):".."===i?(e.splice(n,1),r++):r&&(e.splice(n,1),r--)}if(t)for(;r--;r)e.unshift("..");return e}function n(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 i=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,o=function(e){return i.exec(e).slice(1)};t.resolve=function(){for(var t="",i=!1,o=arguments.length-1;o>=-1&&!i;o--){var s=o>=0?arguments[o]:e.cwd();if("string"!=typeof s)throw new TypeError("Arguments to path.resolve must be strings");s&&(t=s+"/"+t,i="/"===s.charAt(0))}return t=r(n(t.split("/"),function(e){return!!e}),!i).join("/"),(i?"/":"")+t||"."},t.normalize=function(e){var i=t.isAbsolute(e),o="/"===s(e,-1);return e=r(n(e.split("/"),function(e){return!!e}),!i).join("/"),e||i||(e="."),e&&o&&(e+="/"),(i?"/":"")+e},t.isAbsolute=function(e){return"/"===e.charAt(0)},t.join=function(){var e=Array.prototype.slice.call(arguments,0);return t.normalize(n(e,function(e,t){if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e}).join("/"))},t.relative=function(e,r){function n(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=t.resolve(e).substr(1),r=t.resolve(r).substr(1);for(var i=n(e.split("/")),o=n(r.split("/")),s=Math.min(i.length,o.length),u=s,a=0;a<s;a++)if(i[a]!==o[a]){u=a;break}for(var f=[],a=u;a<i.length;a++)f.push("..");return f=f.concat(o.slice(u)),f.join("/")},t.sep="/",t.delimiter=":",t.dirname=function(e){var t=o(e),r=t[0],n=t[1];return r||n?(n&&(n=n.substr(0,n.length-1)),r+n):"."},t.basename=function(e,t){var r=o(e)[2];return t&&r.substr(-1*t.length)===t&&(r=r.substr(0,r.length-t.length)),r},t.extname=function(e){return o(e)[3]};var s="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)}}).call(t,r(1))},function(e,t,r){"use strict";(function(e){function n(){return o.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function i(e,t){if(n()<t)throw new RangeError("Invalid typed array length");return o.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t),e.__proto__=o.prototype):(null===e&&(e=new o(t)),e.length=t),e}function o(e,t,r){if(!(o.TYPED_ARRAY_SUPPORT||this instanceof o))return new o(e,t,r);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return f(this,e)}return s(this,e,t,r)}function s(e,t,r,n){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?h(e,t,r,n):"string"==typeof t?l(e,t,r):p(e,t)}function u(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function a(e,t,r,n){return u(t),t<=0?i(e,t):void 0!==r?"string"==typeof n?i(e,t).fill(r,n):i(e,t).fill(r):i(e,t)}function f(e,t){if(u(t),e=i(e,t<0?0:0|y(t)),!o.TYPED_ARRAY_SUPPORT)for(var r=0;r<t;++r)e[r]=0;return e}function l(e,t,r){if("string"==typeof r&&""!==r||(r="utf8"),!o.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|v(t,r);e=i(e,n);var s=e.write(t,r);return s!==n&&(e=e.slice(0,s)),e}function c(e,t){var r=t.length<0?0:0|y(t.length);e=i(e,r);for(var n=0;n<r;n+=1)e[n]=255&t[n];return e}function h(e,t,r,n){if(t.byteLength,r<0||t.byteLength<r)throw new RangeError("'offset' is out of bounds");if(t.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");return t=void 0===r&&void 0===n?new Uint8Array(t):void 0===n?new Uint8Array(t,r):new Uint8Array(t,r,n),o.TYPED_ARRAY_SUPPORT?(e=t,e.__proto__=o.prototype):e=c(e,t),e}function p(e,t){if(o.isBuffer(t)){var r=0|y(t.length);return e=i(e,r),0===e.length?e:(t.copy(e,0,0,r),e)}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||H(t.length)?i(e,0):c(e,t);if("Buffer"===t.type&&$(t.data))return c(e,t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function y(e){if(e>=n())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+n().toString(16)+" bytes");return 0|e}function d(e){return+e!=e&&(e=0),o.alloc(+e)}function v(e,t){if(o.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return V(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return J(e).length;default:if(n)return V(e).length;t=(""+t).toLowerCase(),n=!0}}function m(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if(r>>>=0,t>>>=0,r<=t)return"";for(e||(e="utf8");;)switch(e){case"hex":return C(this,t,r);case"utf8":case"utf-8":return P(this,t,r);case"ascii":return T(this,t,r);case"latin1":case"binary":return B(this,t,r);case"base64":return x(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return j(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function g(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function b(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=o.from(t,n)),o.isBuffer(t))return 0===t.length?-1:w(e,t,r,n,i);if("number"==typeof t)return t&=255,o.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):w(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function w(e,t,r,n,i){function o(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}var s=1,u=e.length,a=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;s=2,u/=2,a/=2,r/=2}var f;if(i){var l=-1;for(f=r;f<u;f++)if(o(e,f)===o(t,-1===l?0:f-l)){if(-1===l&&(l=f),f-l+1===a)return l*s}else-1!==l&&(f-=f-l),l=-1}else for(r+a>u&&(r=u-a),f=r;f>=0;f--){for(var c=!0,h=0;h<a;h++)if(o(e,f+h)!==o(t,h)){c=!1;break}if(c)return f}return-1}function _(e,t,r,n){r=Number(r)||0;var i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;var o=t.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var s=0;s<n;++s){var u=parseInt(t.substr(2*s,2),16);if(isNaN(u))return s;e[r+s]=u}return s}function E(e,t,r,n){return X(V(t,e.length-r),e,r,n)}function A(e,t,r,n){return X(q(t),e,r,n)}function S(e,t,r,n){return A(e,t,r,n)}function O(e,t,r,n){return X(J(t),e,r,n)}function k(e,t,r,n){return X(K(t,e.length-r),e,r,n)}function x(e,t,r){return 0===t&&r===e.length?W.fromByteArray(e):W.fromByteArray(e.slice(t,r))}function P(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i<r;){var o=e[i],s=null,u=o>239?4:o>223?3:o>191?2:1;if(i+u<=r){var a,f,l,c;switch(u){case 1:o<128&&(s=o);break;case 2:a=e[i+1],128==(192&a)&&(c=(31&o)<<6|63&a)>127&&(s=c);break;case 3:a=e[i+1],f=e[i+2],128==(192&a)&&128==(192&f)&&(c=(15&o)<<12|(63&a)<<6|63&f)>2047&&(c<55296||c>57343)&&(s=c);break;case 4:a=e[i+1],f=e[i+2],l=e[i+3],128==(192&a)&&128==(192&f)&&128==(192&l)&&(c=(15&o)<<18|(63&a)<<12|(63&f)<<6|63&l)>65535&&c<1114112&&(s=c)}}null===s?(s=65533,u=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|1023&s),n.push(s),i+=u}return R(n)}function R(e){var t=e.length;if(t<=Q)return String.fromCharCode.apply(String,e);for(var r="",n=0;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=Q));return r}function T(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function B(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function C(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var i="",o=t;o<r;++o)i+=z(e[o]);return i}function j(e,t,r){for(var n=e.slice(t,r),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function L(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function I(e,t,r,n,i,s){if(!o.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<s)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function D(e,t,r,n){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-r,2);i<o;++i)e[r+i]=(t&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function U(e,t,r,n){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-r,4);i<o;++i)e[r+i]=t>>>8*(n?i:3-i)&255}function M(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function N(e,t,r,n,i){return i||M(e,t,r,4,3.4028234663852886e38,-3.4028234663852886e38),Z.write(e,t,r,n,23,4),r+4}function Y(e,t,r,n,i){return i||M(e,t,r,8,1.7976931348623157e308,-1.7976931348623157e308),Z.write(e,t,r,n,52,8),r+8}function F(e){if(e=G(e).replace(ee,""),e.length<2)return"";for(;e.length%4!=0;)e+="=";return e}function G(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function z(e){return e<16?"0"+e.toString(16):e.toString(16)}function V(e,t){t=t||1/0;for(var r,n=e.length,i=null,o=[],s=0;s<n;++s){if((r=e.charCodeAt(s))>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function q(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}function K(e,t){for(var r,n,i,o=[],s=0;s<e.length&&!((t-=2)<0);++s)r=e.charCodeAt(s),n=r>>8,i=r%256,o.push(i),o.push(n);return o}function J(e){return W.toByteArray(F(e))}function X(e,t,r,n){for(var i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function H(e){return e!==e}var W=r(16),Z=r(17),$=r(18);t.Buffer=o,t.SlowBuffer=d,t.INSPECT_MAX_BYTES=50,o.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}(),t.kMaxLength=n(),o.poolSize=8192,o._augment=function(e){return e.__proto__=o.prototype,e},o.from=function(e,t,r){return s(null,e,t,r)},o.TYPED_ARRAY_SUPPORT&&(o.prototype.__proto__=Uint8Array.prototype,o.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&o[Symbol.species]===o&&Object.defineProperty(o,Symbol.species,{value:null,configurable:!0})),o.alloc=function(e,t,r){return a(null,e,t,r)},o.allocUnsafe=function(e){return f(null,e)},o.allocUnsafeSlow=function(e){return f(null,e)},o.isBuffer=function(e){return!(null==e||!e._isBuffer)},o.compare=function(e,t){if(!o.isBuffer(e)||!o.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var r=e.length,n=t.length,i=0,s=Math.min(r,n);i<s;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},o.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},o.concat=function(e,t){if(!$(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return o.alloc(0);var r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;var n=o.allocUnsafe(t),i=0;for(r=0;r<e.length;++r){var s=e[r];if(!o.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(n,i),i+=s.length}return n},o.byteLength=v,o.prototype._isBuffer=!0,o.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)g(this,t,t+1);return this},o.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)g(this,t,t+3),g(this,t+1,t+2);return this},o.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)g(this,t,t+7),g(this,t+1,t+6),g(this,t+2,t+5),g(this,t+3,t+4);return this},o.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?P(this,0,e):m.apply(this,arguments)},o.prototype.equals=function(e){if(!o.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===o.compare(this,e)},o.prototype.inspect=function(){var e="",r=t.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(e+=" ... ")),"<Buffer "+e+">"},o.prototype.compare=function(e,t,r,n,i){if(!o.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(t>>>=0,r>>>=0,n>>>=0,i>>>=0,this===e)return 0;for(var s=i-n,u=r-t,a=Math.min(s,u),f=this.slice(n,i),l=e.slice(t,r),c=0;c<a;++c)if(f[c]!==l[c]){s=f[c],u=l[c];break}return s<u?-1:u<s?1:0},o.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},o.prototype.indexOf=function(e,t,r){return b(this,e,t,r,!0)},o.prototype.lastIndexOf=function(e,t,r){return b(this,e,t,r,!1)},o.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return _(this,e,t,r);case"utf8":case"utf-8":return E(this,e,t,r);case"ascii":return A(this,e,t,r);case"latin1":case"binary":return S(this,e,t,r);case"base64":return O(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var Q=4096;o.prototype.slice=function(e,t){var r=this.length;e=~~e,t=void 0===t?r:~~t,e<0?(e+=r)<0&&(e=0):e>r&&(e=r),t<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);var n;if(o.TYPED_ARRAY_SUPPORT)n=this.subarray(e,t),n.__proto__=o.prototype;else{var i=t-e;n=new o(i,void 0);for(var s=0;s<i;++s)n[s]=this[s+e]}return n},o.prototype.readUIntLE=function(e,t,r){e|=0,t|=0,r||L(e,t,this.length);for(var n=this[e],i=1,o=0;++o<t&&(i*=256);)n+=this[e+o]*i;return n},o.prototype.readUIntBE=function(e,t,r){e|=0,t|=0,r||L(e,t,this.length);for(var n=this[e+--t],i=1;t>0&&(i*=256);)n+=this[e+--t]*i;return n},o.prototype.readUInt8=function(e,t){return t||L(e,1,this.length),this[e]},o.prototype.readUInt16LE=function(e,t){return t||L(e,2,this.length),this[e]|this[e+1]<<8},o.prototype.readUInt16BE=function(e,t){return t||L(e,2,this.length),this[e]<<8|this[e+1]},o.prototype.readUInt32LE=function(e,t){return t||L(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},o.prototype.readUInt32BE=function(e,t){return t||L(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},o.prototype.readIntLE=function(e,t,r){e|=0,t|=0,r||L(e,t,this.length);for(var n=this[e],i=1,o=0;++o<t&&(i*=256);)n+=this[e+o]*i;return i*=128,n>=i&&(n-=Math.pow(2,8*t)),n},o.prototype.readIntBE=function(e,t,r){e|=0,t|=0,r||L(e,t,this.length);for(var n=t,i=1,o=this[e+--n];n>0&&(i*=256);)o+=this[e+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o},o.prototype.readInt8=function(e,t){return t||L(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},o.prototype.readInt16LE=function(e,t){t||L(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},o.prototype.readInt16BE=function(e,t){t||L(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},o.prototype.readInt32LE=function(e,t){return t||L(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},o.prototype.readInt32BE=function(e,t){return t||L(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},o.prototype.readFloatLE=function(e,t){return t||L(e,4,this.length),Z.read(this,e,!0,23,4)},o.prototype.readFloatBE=function(e,t){return t||L(e,4,this.length),Z.read(this,e,!1,23,4)},o.prototype.readDoubleLE=function(e,t){return t||L(e,8,this.length),Z.read(this,e,!0,52,8)},o.prototype.readDoubleBE=function(e,t){return t||L(e,8,this.length),Z.read(this,e,!1,52,8)},o.prototype.writeUIntLE=function(e,t,r,n){if(e=+e,t|=0,r|=0,!n){I(this,e,t,r,Math.pow(2,8*r)-1,0)}var i=1,o=0;for(this[t]=255&e;++o<r&&(i*=256);)this[t+o]=e/i&255;return t+r},o.prototype.writeUIntBE=function(e,t,r,n){if(e=+e,t|=0,r|=0,!n){I(this,e,t,r,Math.pow(2,8*r)-1,0)}var i=r-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r},o.prototype.writeUInt8=function(e,t,r){return e=+e,t|=0,r||I(this,e,t,1,255,0),o.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},o.prototype.writeUInt16LE=function(e,t,r){return e=+e,t|=0,r||I(this,e,t,2,65535,0),o.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):D(this,e,t,!0),t+2},o.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||I(this,e,t,2,65535,0),o.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):D(this,e,t,!1),t+2},o.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||I(this,e,t,4,4294967295,0),o.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):U(this,e,t,!0),t+4},o.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||I(this,e,t,4,4294967295,0),o.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):U(this,e,t,!1),t+4},o.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);I(this,e,t,r,i-1,-i)}var o=0,s=1,u=0;for(this[t]=255&e;++o<r&&(s*=256);)e<0&&0===u&&0!==this[t+o-1]&&(u=1),this[t+o]=(e/s>>0)-u&255;return t+r},o.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);I(this,e,t,r,i-1,-i)}var o=r-1,s=1,u=0;for(this[t+o]=255&e;--o>=0&&(s*=256);)e<0&&0===u&&0!==this[t+o+1]&&(u=1),this[t+o]=(e/s>>0)-u&255;return t+r},o.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||I(this,e,t,1,127,-128),o.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},o.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||I(this,e,t,2,32767,-32768),o.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):D(this,e,t,!0),t+2},o.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||I(this,e,t,2,32767,-32768),o.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):D(this,e,t,!1),t+2},o.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||I(this,e,t,4,2147483647,-2147483648),o.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):U(this,e,t,!0),t+4},o.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||I(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),o.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):U(this,e,t,!1),t+4},o.prototype.writeFloatLE=function(e,t,r){return N(this,e,t,!0,r)},o.prototype.writeFloatBE=function(e,t,r){return N(this,e,t,!1,r)},o.prototype.writeDoubleLE=function(e,t,r){return Y(this,e,t,!0,r)},o.prototype.writeDoubleBE=function(e,t,r){return Y(this,e,t,!1,r)},o.prototype.copy=function(e,t,r,n){if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);var i,s=n-r;if(this===e&&r<t&&t<n)for(i=s-1;i>=0;--i)e[i+t]=this[i+r];else if(s<1e3||!o.TYPED_ARRAY_SUPPORT)for(i=0;i<s;++i)e[i+t]=this[i+r];else Uint8Array.prototype.set.call(e,this.subarray(r,r+s),t);return s},o.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===e.length){var i=e.charCodeAt(0);i<256&&(e=i)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!o.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0);var s;if("number"==typeof e)for(s=t;s<r;++s)this[s]=e;else{var u=o.isBuffer(e)?e:V(new o(e,n).toString()),a=u.length;for(s=0;s<r-t;++s)this[s+t]=u[s%a]}return this};var ee=/[^+\/0-9A-Za-z-_]/g}).call(t,r(0))},function(e,t,r){"use strict";e.exports=r(7)},function(e,t,r){"use strict";(function(t,n){function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=r(8),a=r(9),f=r(2),l=r(10),c=r(12),h=r(15),p=r(19),y=r(21),d=y.SAVE_MODE,v=y.RECORD,m=function(){function e(){var t=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};i(this,e),Object.defineProperties(this,{_root:{writable:!0,enumerable:!1},_storage:{writable:!0,enumerable:!1},_memory:{writable:!0,enumerable:!1},_emitter:{value:new a},_opts:{writable:!0,enumerable:!1},_timerExpiryCheck:{value:null,writable:!0,enumerable:!1},_timerSaveCheck:{value:null,writable:!0,enumerable:!1},GLOBAL_KEY:{writable:!0,enumerable:!1},_lastChange:{value:null,writable:!0,enumerable:!1},_lastChangeDetected:{value:null,writable:!0,enumerable:!1},_lastSave:{value:null,writable:!0,enumerable:!1},_saving:{value:!1,writable:!0,enumerable:!1},_loading:{value:!1,writable:!0,enumerable:!1}}),this.GLOBAL_KEY="___InCache___storage___global___key___",this.DEFAULT_CONFIG={storeName:"",autoLoad:!0,autoSave:!1,autoSaveMode:d.TERMINATE,autoSavePeriod:5,save:!1,clone:!1,preserve:!1,deleteOnExpires:!0,filePath:".incache",maxAge:0,maxRecordNumber:0,expires:null,silent:!1,share:!1,autoRemovePeriod:0,nullIfNotFound:!1,global:{silent:!1,life:0}},this._onRemoved=function(){},this._onCreated=function(){},this._onUpdated=function(){},this.on("_change",function(e){t._lastChange=(new Date).getTime(),t._opts.silent||t._emitter.fire("change",e)}),this.setConfig(r)}return s(e,[{key:"_checkExceeded",value:function(){if(this._opts.maxRecordNumber){var e=Object.keys(this._memory.data);if(e.length>this._opts.maxRecordNumber){var t=e.length-this._opts.maxRecordNumber;this._emitter.fire("exceed",t),this.bulkRemove(e.slice(0,t),!0)}}}},{key:"_importData",value:function(t){if(u.is(t,"object")){var r=Object.keys(t);r.length&&(e.isRecord(t[r[0]])?this._memory.data=t:this.bulkSet(t,!0))}else{if(!u.is(t,"array"))throw new Error("bad data");t.length&&this.bulkSet(t,!0)}}},{key:"load",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this._opts.filePath;return new Promise(function(r,n){if(!t)return r(e);if(e._loading)return n("loading locked");if(!1===e._emitter.fireTheFirst("beforeLoad",e))return n();e._loading=!0;try{var i=u.isServer()?f.readFileSync(t):window.localStorage.getItem(t);null===i&&u.throwError("content cannot is null"),e._importData(JSON.parse(i.toString())),e._loading=!1,r(e),e._emitter.fireAsync("load",null,e)}catch(t){t=t.message,e._loading=!1,n(t),e._emitter.fireAsync("load",t,e)}})}},{key:"save",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this._opts.filePath;return new Promise(function(r,n){if(!t)return r(e);if(e._saving)return n("saving locked");if(!1===e._emitter.fireTheFirst("beforeSave",e))return n();e._saving=!0;var i=JSON.stringify(e._memory.data);try{u.isServer()?l.sync(t,i,{}):window.localStorage.setItem(t,i),e._lastSave=(new Date).getTime(),e._saving=!1,r(e),e._emitter.fireAsync("save",null,e)}catch(t){t=t.message,e._saving=!1,n(t),e._emitter.fireAsync("save",t,e)}})}},{key:"setConfig",value:function(){var e=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(r.global&&(u.deprecated(r.global.life,"global.life is deprecated use maxAge instead"),u.deprecated(r.global.silent,"global.silent is deprecated use silent instead")),u.defaults(r,this.DEFAULT_CONFIG),this._opts=r,this._root=r.share?u.isServer()?t:window:{},r.storeName&&(this.GLOBAL_KEY+=r.storeName),this._root[this.GLOBAL_KEY]||(this._root[this.GLOBAL_KEY]={data:{}}),this._memory=this._root[this.GLOBAL_KEY],r.autoLoad&&this.load().then().catch(function(e){}),r.autoSave||r.save)if(r.autoSaveMode===d.TERMINATE&&u.isServer()){var i=function(){o.save().then().catch(function(e){})},o=this;n.removeListener("exit",i),n.removeListener("SIGINT",i),n.on("exit",i),n.on("SIGINT",i)}else r.autoSaveMode===d.TIMER&&(this._timerSaveCheck&&(clearInterval(this._timerSaveCheck),this._timerSaveCheck=null),r.autoSavePeriod&&(this._timerSaveCheck=setInterval(function(){e._lastChange!==e._lastChangeDetected&&(e._lastChangeDetected=e._lastChange,e.save().then().catch(function(e){}))},1e3*r.autoSavePeriod)));this._timerExpiryCheck&&(clearInterval(this._timerExpiryCheck),this._timerExpiryCheck=null),r.autoRemovePeriod&&(this._timerExpiryCheck=setInterval(function(){var t=e.removeExpired();t.length&&e._emitter.fire("expired",t)},1e3*r.autoRemovePeriod))}},{key:"getConfig",value:function(){return this._opts}},{key:"set",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if((r.silent||!1!==this._emitter.fireTheFirst("beforeSet",e,t))&&(r=u.defaults(r,this._opts),!this.has(e)||!this._memory.data[e].isPreserved)){r.clone&&(t=h(t));var n=Object.assign({},v);return n.isNew=!0,n.isPreserved=r.preserve,n.toDelete=r.deleteOnExpires,n.hits=0,n.value=t,r.expires&&(u.is(r.expires,"date")||u.is(r.expires,"string"))?n.expiresOn=new Date(r.expires):r.maxAge&&u.is(r.maxAge,"number")?n.expiresOn=u.addMSToNow(r.maxAge):r.life&&u.is(r.life,"number")&&(u.deprecated(r.life,"life is deprecated use maxAge instead"),n.expiresOn=u.addSecondsToNow(r.life)),this.has(e)?(n.isNew=!1,n.hits=this._memory.data[e].hits,n.id=this._memory.data[e].id,n.createdOn=this._memory.data[e].createdOn,n.updatedOn=new Date,r.silent||(this._onUpdated.call(this,e,n),this._emitter.fire("update",e,n))):(n.id=c(),n.createdOn=new Date,r.silent||(this._onCreated.call(this,e,n),this._emitter.fire("create",e,n))),this._memory.data[e]=n,r.silent||this._emitter.fire("set",e,n),this._checkExceeded(),this._emitter.fire("_change","set"),n}}},{key:"get",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return this.has(e)?!this._opts.autoRemovePeriod&&this.expired(e)&&this._memory.data[e].toDelete?(this.remove(e,!0),this._opts.nullIfNotFound?null:void 0):(this._memory.data[e].hits+=1,this._memory.data[e].lastHit=new Date,t?this._memory.data[e].value:this._memory.data[e]):this._opts.nullIfNotFound?null:void 0}},{key:"remove",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];(t||!1!==this._emitter.fireTheFirst("beforeRemove",e))&&(delete this._memory.data[e],t||(this._onRemoved.call(this,e),this._emitter.fire("remove",e)),this._emitter.fire("_change","remove"))}},{key:"removeFrom",value:function(e,t){if(!this.has(e))return null;if(u.is(t,"undefined"))throw new Error("where cannot be undefined");if(!this._memory.data[e].isPreserved){var r=this.get(e);if(!u.is(r,"array"))throw new Error("value must be an array");var n=r.length;for(var i in r)if(r.hasOwnProperty(i)){var o=[];for(var s in t)t.hasOwnProperty(s)&&(u.is(t,"object")?o.push(void 0!==r[i][s]&&r[i][s]===t[s]):o.push(r[i]===t));o.length&&-1===o.indexOf(!1)&&r.splice(i,1)}n!==r.length&&this.set(e,r)}}},{key:"removeExpired",value:function(){var e=[];for(var t in this._memory.data)this._memory.data.hasOwnProperty(t)&&this.expired(t)&&this._memory.data[t].toDelete&&(this.remove(t,!0),e.push(t));return e}},{key:"addTo",value:function(e,t){if(this.has(e)){var r=this.get(e);if(!this._memory.data[e].isPreserved){if(!u.is(r,"array"))throw new Error("object must be an array");return r.push(t),this.set(e,r)}}}},{key:"prependTo",value:function(e,t){if(this.has(e)&&!this._memory.data[e].isPreserved){var r=this.get(e);if(!u.is(r,"array"))throw new Error("object must be an array");return r.unshift(t),this.set(e,r)}}},{key:"updateIn",value:function(e,t,r){if(this.has(e)){if(u.is(t,"undefined"))throw new Error("value cannot be undefined");if(u.is(r,"undefined"))throw new Error("where cannot be undefined");if(!this._memory.data[e].isPreserved){var n=this.get(e);if(!u.is(n,"array"))throw new Error("value must be an array");var i=!1;for(var o in n)if(n.hasOwnProperty(o)){var s=[];for(var a in r)r.hasOwnProperty(a)&&(u.is(r,"object")?s.push(void 0!==n[o][a]&&n[o][a]===r[a]):s.push(n[o]===r));s.length&&-1===s.indexOf(!1)&&(i=!0,n[o]=t)}i&&this.set(e,n)}}}},{key:"bulkSet",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!u.is(e,"array")&&!u.is(e,"object"))throw new Error("records must be an array, e.g. {key: foo, value: bar}");if(t||!1!==this._emitter.fireTheFirst("beforeBulkSet",e)){for(var r={},n=void 0,i=0;i<e.length;i++)u.is(e[i].key,"undefined")||u.is(e[i].value,"undefined")?(n=this.set(i,e[i],{silent:!0,fromBulk:!0}))&&(r[i]=n):(n=this.set(e[i].key,e[i].value,{silent:!0,fromBulk:!0}))&&(r[e[i].key]=n);return t||this._emitter.fire("bulkSet",e),r}}},{key:"bulkRemove",value:function(e,t){if(!u.is(e,"array"))throw new Error("keys must be an array of keys");if(t||!1!==this._emitter.fireTheFirst("beforeBulkRemove",e)){for(var r=0;r<e.length;r++)this.remove(e[r],!0);t||this._emitter.fire("bulkRemove",e)}}},{key:"clean",value:function(e){if(!u.is(e,"string"))throw new Error("key must be a string");for(var t in this._memory.data)this._memory.data.hasOwnProperty(t)&&-1!==t.indexOf(e)&&(delete this._memory.data[t],this._emitter.fire("_change","clean"))}},{key:"all",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=e?{}:[];for(var r in this._memory.data)this._memory.data.hasOwnProperty(r)&&(!this._opts.autoRemovePeriod&&this.expired(r)&&this._memory.data[r].toDelete?this.remove(r,!0):Array.isArray(t)?t.push({key:r,value:this._memory.data[r].value}):t[r]=this._memory.data[r].value);return t}},{key:"count",value:function(){return this.removeExpired(),Object.keys(this._memory.data).length}},{key:"expired",value:function(e){if(this._memory.data[e]&&this._memory.data[e].expiresOn){return new Date>new Date(this._memory.data[e].expiresOn)}return!1}},{key:"clear",value:function(){this._memory.data={},this._emitter.fire("_change","clear")}},{key:"has",value:function(e){return this._memory.data.hasOwnProperty(e)}},{key:"destroy",value:function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];this.remove.apply(this,t)}},{key:"stats",value:function(){return{count:this.count(),size:p(this._memory.data)}}},{key:"on",value:function(e,t){return this._emitter.on.call(this._emitter,e,t),this}},{key:"suspendEvent",value:function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return this._emitter.suspendEvent.call(this._emitter,t),this}},{key:"resumeEvent",value:function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return this._emitter.resumeEvent.call(this._emitter,t),this}},{key:"suspendEvents",value:function(){return this._emitter.suspendEvents.call(this._emitter),this}},{key:"resumeEvents",value:function(){return this._emitter.resumeEvents.call(this._emitter),this}},{key:"onRemoved",value:function(e){this._onRemoved=e}},{key:"onCreated",value:function(e){this._onCreated=e}},{key:"onUpdated",value:function(e){this._onUpdated=e}}],[{key:"isRecord",value:function(e){return Object.keys(v).every(function(t){return"object"===(void 0===e?"undefined":o(e))&&e.hasOwnProperty(t)})}}]),e}();e.exports=m,e.exports.SAVE_MODE=d}).call(t,r(0),r(1))},function(e,t,r){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i={};i.is=function(e,t){return Object.prototype.toString.call(e).toLowerCase()==="[object "+t+"]".toLowerCase()},i.defaults=function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e.hasOwnProperty(r)?"object"===n(e[r])&&null!==e[r]&&i.defaults(e[r],t[r]):e[r]=t[r]);return e},i.addSecondsToNow=function(e){var t=new Date;return new Date(t.setSeconds(t.getSeconds()+e))},i.addMSToNow=function(e){var t=new Date;return new Date(t.setMilliseconds(t.getMilliseconds()+e))},i.isServer=function(){return"undefined"==typeof window},i.deprecated=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"warn";return void 0!==e&&(console[r](t||e),!0)},i.throwError=function(e){throw new Error(e)},e.exports=i},function(e,t,r){"use strict";(function(e){var r,n,i,o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};!function(s,u){"object"===o(t)&&"object"===o(e)?e.exports=u():(n=[],r=u,void 0!==(i="function"==typeof r?r.apply(t,n):r)&&(e.exports=i))}(0,function(){return function(e){function t(n){if(r[n])return r[n].exports;var i=r[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var r={};return t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=0)}([function(e,t,r){e.exports=r(1)},function(e,t,r){function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),o=r(2),s=r(3),u=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};n(this,e),this.defaultClassOpts={maxListeners:10,asyncDelay:10},this.defaultListenerOpts={maxCalls:0,prepend:!1},this.opts=o.defaults(t,this.defaultClassOpts),this.events={}}return i(e,[{key:"_createEvent",value:function(e,t,r){if(this.events[e]||(this.events[e]=[]),this.opts.maxListeners){var n=this.opts.maxListeners;if(this.events[e].length>=n)throw new Error(s[3]+n)}t.opts=o.defaults(r,this.defaultListenerOpts),t.state={suspended:!1,calls:0},r.prepend?this.events[e].unshift(t):this.events[e].push(t),this._created.call(this,e,t,r)}},{key:"_callEvent",value:function(e,t,r){if(!t.state.suspended)return t.opts.maxCalls&&t.state.calls++>=t.opts.maxCalls?void this.off(e,t):(this._catchAll.call(this,r),t.apply(this,r))}},{key:"_suspendEvent",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments[1],r=void 0;for(var n in e)r=e[n],this.events[r]&&this.events[r].forEach(function(e){e.state.suspended=t});return this}},{key:"_created",value:function(){}},{key:"_removed",value:function(){}},{key:"_catchAll",value:function(){}},{key:"on",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!o.is(e,"string"))throw new Error(s[0]);if(e=e.trim(),!e.length)throw new Error(s[4]);if(o.is(t,"array")){for(var n in t)if(t.hasOwnProperty(n)){if(!o.is(t[n],"function"))throw new Error(s[1]);this._createEvent(e,t[n],r)}}else{if(!o.is(t,"function"))throw new Error(s[1]);this._createEvent(e,t,r)}return this}},{key:"once",value:function(e,t){return this.on(e,t,{maxCalls:1})}},{key:"fire",value:function(e){if(this.exists(e)){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];for(var i=0;i<this.events[e].length;i++)this._callEvent(e,this.events[e][i],r)}return this}},{key:"fireTheFirst",value:function(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];if(this.exists(e))return this._callEvent(e,this.events[e][0],r)}},{key:"fireAsync",value:function(e){for(var t=this,r=arguments.length,n=Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];n.unshift(e),setTimeout(function(){t.fire.apply(t,n)},this.opts.asyncDelay)}},{key:"off",value:function(e,t){if(!o.is(e,"string"))throw new Error(s[0]);if(this.events[e])if("function"==typeof t)for(var r=0;r<this.events[e].length;r++)this.events[e][r]===t&&(this.events[e].splice(r,1),this._removed.call(this,e,t));else delete this.events[e],this._removed.call(this,e);return this}},{key:"prependListener",value:function(e,t){return this.on(e,t,{prepend:!0})}},{key:"prependOnceListener",value:function(e,t){return this.on(e,t,{maxCalls:1,prepend:!0})}},{key:"suspendEvent",value:function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return this._suspendEvent(t,!0)}},{key:"resumeEvent",value:function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return this._suspendEvent(t,!1)}},{key:"suspendEvents",value:function(){return this._suspendEvent(Object.keys(this.events),!0)}},{key:"resumeEvents",value:function(){return this._suspendEvent(Object.keys(this.events),!1)}},{key:"isSuspended",value:function(e){return!!this.exists(e)&&this.events[e][0].state.suspended}},{key:"clear",value:function(){return this.events=[],this}},{key:"getListenersCount",value:function(e){return this.getListeners(e).length}},{key:"getListeners",value:function(e){if(!o.is(e,"string"))throw new Error(s[0]);if(!this.exists(e))throw new Error(s[5]);return this.events[e]}},{key:"getEvents",value:function(){return this.events}},{key:"exists",value:function(e){if(!o.is(e,"string"))throw new Error(s[0]);return!o.is(this.events[e],"undefined")}},{key:"getMaxListeners",value:function(){return this.opts.maxListeners}},{key:"setMaxListeners",value:function(e){if(!o.is(e,"number"))throw new Error(s[2]);return this.opts.maxListeners=e,this}},{key:"onCatchAll",value:function(e){return this._catchAll=e,this}},{key:"onCreated",value:function(e){return this._created=e,this}},{key:"onRemoved",value:function(e){return this._removed=e,this}}]),e}();e.exports=u,e.exports._error=s},function(e,t,r){var n="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return void 0===e?"undefined":o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":void 0===e?"undefined":o(e)},i={};i.is=function(e,t){return Object.prototype.toString.call(e).toLowerCase()==="[object "+t+"]".toLowerCase()},i.defaults=function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e.hasOwnProperty(r)?"object"===n(e[r])&&i.defaults(e[r],t[r]):e[r]=t[r]);return e},e.exports=i},function(e,t,r){e.exports=["event name is required and must be a string","listener is required and must be a function or an array of function","value must be a number","increase maxListeners per event: ","event name not valid","event not found"]}])})}).call(t,r(3)(e))},function(e,t,r){"use strict";function n(e,t,r,u){return"function"==typeof r&&(u=r,r={}),"function"!=typeof u?n.promise.apply(null,arguments):"string"!=typeof e?void u(new TypeError("expected filepath to be a string")):void s(o.dirname(e),r,function(n){if(n)return void u(n);i.writeFile(e,t,r,u)})}var i=r(2),o=r(4),s=r(11);n.promise=function(e,t,r){return"string"!=typeof e?Promise.reject(new TypeError("expected filepath to be a string")):new Promise(function(n,u){s(o.dirname(e),r,function(o){if(o)return void u(o);i.writeFile(e,t,r,function(e){if(e)return void u(e);n(t)})})})},n.sync=function(e,t,r){if("string"!=typeof e)throw new TypeError("expected filepath to be a string");s.sync(o.dirname(e),r),i.writeFileSync(e,t,r)},n.stream=function(e,t){return s.sync(o.dirname(e),t),i.createWriteStream(e,t)},e.exports=n},function(e,t,r){"use strict";(function(t){function n(e,r,a,f){"function"==typeof r?(a=r,r={}):r&&"object"===(void 0===r?"undefined":i(r))||(r={mode:r});var l=r.mode,c=r.fs||s;void 0===l&&(l=u&~t.umask()),f||(f=null);var h=a||function(){};e=o.resolve(e),c.mkdir(e,l,function(t){if(!t)return f=f||e,h(null,f);switch(t.code){case"ENOENT":n(o.dirname(e),r,function(t,i){t?h(t,i):n(e,r,h,i)});break;default:c.stat(e,function(e,r){e||!r.isDirectory()?h(t,f):h(null,f)})}})}var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o=r(4),s=r(2),u=parseInt("0777",8);e.exports=n.mkdirp=n.mkdirP=n,n.sync=function e(r,n,a){n&&"object"===(void 0===n?"undefined":i(n))||(n={mode:n});var f=n.mode,l=n.fs||s;void 0===f&&(f=u&~t.umask()),a||(a=null),r=o.resolve(r);try{l.mkdirSync(r,f),a=a||r}catch(t){switch(t.code){case"ENOENT":a=e(o.dirname(r),n,a),e(r,n,a);break;default:var c;try{c=l.statSync(r)}catch(e){throw t}if(!c.isDirectory())throw t}}return a}}).call(t,r(1))},function(e,t,r){"use strict";function n(e,t,r){var n=t&&r||0,i=t||[];e=e||{};var s=void 0!==e.clockseq?e.clockseq:a,c=void 0!==e.msecs?e.msecs:(new Date).getTime(),h=void 0!==e.nsecs?e.nsecs:l+1,p=c-f+(h-l)/1e4;if(p<0&&void 0===e.clockseq&&(s=s+1&16383),(p<0||c>f)&&void 0===e.nsecs&&(h=0),h>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");f=c,l=h,a=s,c+=122192928e5;var y=(1e4*(268435455&c)+h)%4294967296;i[n++]=y>>>24&255,i[n++]=y>>>16&255,i[n++]=y>>>8&255,i[n++]=255&y;var d=c/4294967296*1e4&268435455;i[n++]=d>>>8&255,i[n++]=255&d,i[n++]=d>>>24&15|16,i[n++]=d>>>16&255,i[n++]=s>>>8|128,i[n++]=255&s;for(var v=e.node||u,m=0;m<6;++m)i[n+m]=v[m];return t||o(i)}var i=r(13),o=r(14),s=i(),u=[1|s[0],s[1],s[2],s[3],s[4],s[5]],a=16383&(s[6]<<8|s[7]),f=0,l=0;e.exports=n},function(e,t,r){"use strict";(function(t){var r,n=t.crypto||t.msCrypto;if(n&&n.getRandomValues){var i=new Uint8Array(16);r=function(){return n.getRandomValues(i),i}}if(!r){var o=new Array(16);r=function(){for(var e,t=0;t<16;t++)0==(3&t)&&(e=4294967296*Math.random()),o[t]=e>>>((3&t)<<3)&255;return o}}e.exports=r}).call(t,r(0))},function(e,t,r){"use strict";function n(e,t){var r=t||0,n=i;return n[e[r++]]+n[e[r++]]+n[e[r++]]+n[e[r++]]+"-"+n[e[r++]]+n[e[r++]]+"-"+n[e[r++]]+n[e[r++]]+"-"+n[e[r++]]+n[e[r++]]+"-"+n[e[r++]]+n[e[r++]]+n[e[r++]]+n[e[r++]]+n[e[r++]]+n[e[r++]]}for(var i=[],o=0;o<256;++o)i[o]=(o+256).toString(16).substr(1);e.exports=n},function(e,t,r){"use strict";(function(e,t){var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n=function(){function t(e,t){return null!=t&&e instanceof t}function n(i,o,s,u,h){function p(i,s){if(null===i)return null;if(0===s)return i;var m,g;if("object"!=(void 0===i?"undefined":r(i)))return i;if(t(i,f))m=new f;else if(t(i,l))m=new l;else if(t(i,c))m=new c(function(e,t){i.then(function(t){e(p(t,s-1))},function(e){t(p(e,s-1))})});else if(n.__isArray(i))m=[];else if(n.__isRegExp(i))m=new RegExp(i.source,a(i)),i.lastIndex&&(m.lastIndex=i.lastIndex);else if(n.__isDate(i))m=new Date(i.getTime());else{if(v&&e.isBuffer(i))return m=new e(i.length),i.copy(m),m;t(i,Error)?m=Object.create(i):void 0===u?(g=Object.getPrototypeOf(i),m=Object.create(g)):(m=Object.create(u),g=u)}if(o){var b=y.indexOf(i);if(-1!=b)return d[b];y.push(i),d.push(m)}t(i,f)&&i.forEach(function(e,t){var r=p(t,s-1),n=p(e,s-1);m.set(r,n)}),t(i,l)&&i.forEach(function(e){var t=p(e,s-1);m.add(t)});for(var w in i){var _;g&&(_=Object.getOwnPropertyDescriptor(g,w)),_&&null==_.set||(m[w]=p(i[w],s-1))}if(Object.getOwnPropertySymbols)for(var E=Object.getOwnPropertySymbols(i),w=0;w<E.length;w++){var A=E[w],S=Object.getOwnPropertyDescriptor(i,A);(!S||S.enumerable||h)&&(m[A]=p(i[A],s-1),S.enumerable||Object.defineProperty(m,A,{enumerable:!1}))}if(h)for(var O=Object.getOwnPropertyNames(i),w=0;w<O.length;w++){var k=O[w],S=Object.getOwnPropertyDescriptor(i,k);S&&S.enumerable||(m[k]=p(i[k],s-1),Object.defineProperty(m,k,{enumerable:!1}))}return m}"object"===(void 0===o?"undefined":r(o))&&(s=o.depth,u=o.prototype,h=o.includeNonEnumerable,o=o.circular);var y=[],d=[],v=void 0!==e;return void 0===o&&(o=!0),void 0===s&&(s=1/0),p(i,s)}function i(e){return Object.prototype.toString.call(e)}function o(e){return"object"===(void 0===e?"undefined":r(e))&&"[object Date]"===i(e)}function s(e){return"object"===(void 0===e?"undefined":r(e))&&"[object Array]"===i(e)}function u(e){return"object"===(void 0===e?"undefined":r(e))&&"[object RegExp]"===i(e)}function a(e){var t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),t}var f;try{f=Map}catch(e){f=function(){}}var l;try{l=Set}catch(e){l=function(){}}var c;try{c=Promise}catch(e){c=function(){}}return n.clonePrototype=function(e){if(null===e)return null;var t=function(){};return t.prototype=e,new t},n.__objToStr=i,n.__isDate=o,n.__isArray=s,n.__isRegExp=u,n.__getRegExpFlags=a,n}();"object"===r(t)&&t.exports&&(t.exports=n)}).call(t,r(5).Buffer,r(3)(e))},function(e,t,r){"use strict";function n(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===e[t-2]?2:"="===e[t-1]?1:0}function i(e){return 3*e.length/4-n(e)}function o(e){var t,r,i,o,s,u=e.length;o=n(e),s=new c(3*u/4-o),r=o>0?u-4:u;var a=0;for(t=0;t<r;t+=4)i=l[e.charCodeAt(t)]<<18|l[e.charCodeAt(t+1)]<<12|l[e.charCodeAt(t+2)]<<6|l[e.charCodeAt(t+3)],s[a++]=i>>16&255,s[a++]=i>>8&255,s[a++]=255&i;return 2===o?(i=l[e.charCodeAt(t)]<<2|l[e.charCodeAt(t+1)]>>4,s[a++]=255&i):1===o&&(i=l[e.charCodeAt(t)]<<10|l[e.charCodeAt(t+1)]<<4|l[e.charCodeAt(t+2)]>>2,s[a++]=i>>8&255,s[a++]=255&i),s}function s(e){return f[e>>18&63]+f[e>>12&63]+f[e>>6&63]+f[63&e]}function u(e,t,r){for(var n,i=[],o=t;o<r;o+=3)n=(e[o]<<16)+(e[o+1]<<8)+e[o+2],i.push(s(n));return i.join("")}function a(e){for(var t,r=e.length,n=r%3,i="",o=[],s=0,a=r-n;s<a;s+=16383)o.push(u(e,s,s+16383>a?a:s+16383));return 1===n?(t=e[r-1],i+=f[t>>2],i+=f[t<<4&63],i+="=="):2===n&&(t=(e[r-2]<<8)+e[r-1],i+=f[t>>10],i+=f[t>>4&63],i+=f[t<<2&63],i+="="),o.push(i),o.join("")}t.byteLength=i,t.toByteArray=o,t.fromByteArray=a;for(var f=[],l=[],c="undefined"!=typeof Uint8Array?Uint8Array:Array,h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",p=0,y=h.length;p<y;++p)f[p]=h[p],l[h.charCodeAt(p)]=p;l["-".charCodeAt(0)]=62,l["_".charCodeAt(0)]=63},function(e,t,r){"use strict";t.read=function(e,t,r,n,i){var o,s,u=8*i-n-1,a=(1<<u)-1,f=a>>1,l=-7,c=r?i-1:0,h=r?-1:1,p=e[t+c];for(c+=h,o=p&(1<<-l)-1,p>>=-l,l+=u;l>0;o=256*o+e[t+c],c+=h,l-=8);for(s=o&(1<<-l)-1,o>>=-l,l+=n;l>0;s=256*s+e[t+c],c+=h,l-=8);if(0===o)o=1-f;else{if(o===a)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,n),o-=f}return(p?-1:1)*s*Math.pow(2,o-n)},t.write=function(e,t,r,n,i,o){var s,u,a,f=8*o-i-1,l=(1<<f)-1,c=l>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,y=n?1:-1,d=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(u=isNaN(t)?1:0,s=l):(s=Math.floor(Math.log(t)/Math.LN2),t*(a=Math.pow(2,-s))<1&&(s--,a*=2),t+=s+c>=1?h/a:h*Math.pow(2,1-c),t*a>=2&&(s++,a/=2),s+c>=l?(u=0,s=l):s+c>=1?(u=(t*a-1)*Math.pow(2,i),s+=c):(u=t*Math.pow(2,c-1)*Math.pow(2,i),s=0));i>=8;e[r+p]=255&u,p+=y,u/=256,i-=8);for(s=s<<i|u,f+=i;f>0;e[r+p]=255&s,p+=y,s/=256,f-=8);e[r+p-y]|=128*d}},function(e,t,r){"use strict";var n={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},function(e,t,r){"use strict";function n(e){if(null!==e&&"object"===(void 0===e?"undefined":i(e))){if(s.isBuffer(e))return e.length;var t=0;for(var r in e)if(Object.hasOwnProperty.call(e,r)){t+=n(r);try{t+=n(e[r])}catch(e){e instanceof RangeError&&(t=0)}}return t}return"string"==typeof e?e.length*o.STRING:"boolean"==typeof e?o.BOOLEAN:"number"==typeof e?o.NUMBER:0}var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o=r(20),s=r(5).Buffer;e.exports=n},function(e,t,r){"use strict";e.exports={STRING:2,BOOLEAN:4,NUMBER:8}},function(e,t,r){"use strict";t.SAVE_MODE=Object.defineProperties({},{TERMINATE:{value:"terminate",enumerable:!0},TIMER:{value:"timer",enumerable:!0}}),t.REMOVE_EXCEED=Object.defineProperties({},{OLDER:{value:"older",enumerable:!0},USAGE:{value:"usage",enumerable:!0},NONE:{value:"none",enumerable:!0}}),t.RECORD={id:null,isNew:!0,isPreserved:null,toDelete:null,hits:null,lastHit:null,createdOn:null,updatedOn:null,expiresOn:null,value:null}}])});
// [AIV] InCache Build version: 7.1.0
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("incache",[],t):"object"==typeof exports?exports.incache=t():e.incache=t()}(this,function(){return function(e){function t(n){if(r[n])return r[n].exports;var i=r[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var r={};return t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=6)}([function(e,t,r){"use strict";var n,i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(e){"object"===("undefined"==typeof window?"undefined":i(window))&&(n=window)}e.exports=n},function(e,t,r){"use strict";function n(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function o(e){if(l===setTimeout)return setTimeout(e,0);if((l===n||!l)&&setTimeout)return l=setTimeout,setTimeout(e,0);try{return l(e,0)}catch(t){try{return l.call(null,e,0)}catch(t){return l.call(this,e,0)}}}function s(e){if(h===clearTimeout)return clearTimeout(e);if((h===i||!h)&&clearTimeout)return h=clearTimeout,clearTimeout(e);try{return h(e)}catch(t){try{return h.call(null,e)}catch(t){return h.call(this,e)}}}function u(){v&&y&&(v=!1,y.length?d=y.concat(d):m=-1,d.length&&a())}function a(){if(!v){var e=o(u);v=!0;for(var t=d.length;t;){for(y=d,d=[];++m<t;)y&&y[m].run();m=-1,t=d.length}y=null,v=!1,s(e)}}function f(e,t){this.fun=e,this.array=t}function c(){}var l,h,p=e.exports={};!function(){try{l="function"==typeof setTimeout?setTimeout:n}catch(e){l=n}try{h="function"==typeof clearTimeout?clearTimeout:i}catch(e){h=i}}();var y,d=[],v=!1,m=-1;p.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];d.push(new f(e,t)),1!==d.length||v||o(a)},f.prototype.run=function(){this.fun.apply(null,this.array)},p.title="browser",p.browser=!0,p.env={},p.argv=[],p.version="",p.versions={},p.on=c,p.addListener=c,p.once=c,p.off=c,p.removeListener=c,p.removeAllListeners=c,p.emit=c,p.prependListener=c,p.prependOnceListener=c,p.listeners=function(e){return[]},p.binding=function(e){throw new Error("process.binding is not supported")},p.cwd=function(){return"/"},p.chdir=function(e){throw new Error("process.chdir is not supported")},p.umask=function(){return 0}},function(e,t,r){"use strict"},function(e,t,r){"use strict";e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,r){"use strict";(function(e){function r(e,t){for(var r=0,n=e.length-1;n>=0;n--){var i=e[n];"."===i?e.splice(n,1):".."===i?(e.splice(n,1),r++):r&&(e.splice(n,1),r--)}if(t)for(;r--;r)e.unshift("..");return e}function n(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 i=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,o=function(e){return i.exec(e).slice(1)};t.resolve=function(){for(var t="",i=!1,o=arguments.length-1;o>=-1&&!i;o--){var s=o>=0?arguments[o]:e.cwd();if("string"!=typeof s)throw new TypeError("Arguments to path.resolve must be strings");s&&(t=s+"/"+t,i="/"===s.charAt(0))}return t=r(n(t.split("/"),function(e){return!!e}),!i).join("/"),(i?"/":"")+t||"."},t.normalize=function(e){var i=t.isAbsolute(e),o="/"===s(e,-1);return e=r(n(e.split("/"),function(e){return!!e}),!i).join("/"),e||i||(e="."),e&&o&&(e+="/"),(i?"/":"")+e},t.isAbsolute=function(e){return"/"===e.charAt(0)},t.join=function(){var e=Array.prototype.slice.call(arguments,0);return t.normalize(n(e,function(e,t){if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e}).join("/"))},t.relative=function(e,r){function n(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=t.resolve(e).substr(1),r=t.resolve(r).substr(1);for(var i=n(e.split("/")),o=n(r.split("/")),s=Math.min(i.length,o.length),u=s,a=0;a<s;a++)if(i[a]!==o[a]){u=a;break}for(var f=[],a=u;a<i.length;a++)f.push("..");return f=f.concat(o.slice(u)),f.join("/")},t.sep="/",t.delimiter=":",t.dirname=function(e){var t=o(e),r=t[0],n=t[1];return r||n?(n&&(n=n.substr(0,n.length-1)),r+n):"."},t.basename=function(e,t){var r=o(e)[2];return t&&r.substr(-1*t.length)===t&&(r=r.substr(0,r.length-t.length)),r},t.extname=function(e){return o(e)[3]};var s="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)}}).call(t,r(1))},function(e,t,r){"use strict";(function(e){function n(){return o.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function i(e,t){if(n()<t)throw new RangeError("Invalid typed array length");return o.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t),e.__proto__=o.prototype):(null===e&&(e=new o(t)),e.length=t),e}function o(e,t,r){if(!(o.TYPED_ARRAY_SUPPORT||this instanceof o))return new o(e,t,r);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return f(this,e)}return s(this,e,t,r)}function s(e,t,r,n){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?h(e,t,r,n):"string"==typeof t?c(e,t,r):p(e,t)}function u(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function a(e,t,r,n){return u(t),t<=0?i(e,t):void 0!==r?"string"==typeof n?i(e,t).fill(r,n):i(e,t).fill(r):i(e,t)}function f(e,t){if(u(t),e=i(e,t<0?0:0|y(t)),!o.TYPED_ARRAY_SUPPORT)for(var r=0;r<t;++r)e[r]=0;return e}function c(e,t,r){if("string"==typeof r&&""!==r||(r="utf8"),!o.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|v(t,r);e=i(e,n);var s=e.write(t,r);return s!==n&&(e=e.slice(0,s)),e}function l(e,t){var r=t.length<0?0:0|y(t.length);e=i(e,r);for(var n=0;n<r;n+=1)e[n]=255&t[n];return e}function h(e,t,r,n){if(t.byteLength,r<0||t.byteLength<r)throw new RangeError("'offset' is out of bounds");if(t.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");return t=void 0===r&&void 0===n?new Uint8Array(t):void 0===n?new Uint8Array(t,r):new Uint8Array(t,r,n),o.TYPED_ARRAY_SUPPORT?(e=t,e.__proto__=o.prototype):e=l(e,t),e}function p(e,t){if(o.isBuffer(t)){var r=0|y(t.length);return e=i(e,r),0===e.length?e:(t.copy(e,0,0,r),e)}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||H(t.length)?i(e,0):l(e,t);if("Buffer"===t.type&&$(t.data))return l(e,t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function y(e){if(e>=n())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+n().toString(16)+" bytes");return 0|e}function d(e){return+e!=e&&(e=0),o.alloc(+e)}function v(e,t){if(o.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return V(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return J(e).length;default:if(n)return V(e).length;t=(""+t).toLowerCase(),n=!0}}function m(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if(r>>>=0,t>>>=0,r<=t)return"";for(e||(e="utf8");;)switch(e){case"hex":return j(this,t,r);case"utf8":case"utf-8":return P(this,t,r);case"ascii":return T(this,t,r);case"latin1":case"binary":return B(this,t,r);case"base64":return R(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function g(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function b(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=o.from(t,n)),o.isBuffer(t))return 0===t.length?-1:w(e,t,r,n,i);if("number"==typeof t)return t&=255,o.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):w(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function w(e,t,r,n,i){function o(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}var s=1,u=e.length,a=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;s=2,u/=2,a/=2,r/=2}var f;if(i){var c=-1;for(f=r;f<u;f++)if(o(e,f)===o(t,-1===c?0:f-c)){if(-1===c&&(c=f),f-c+1===a)return c*s}else-1!==c&&(f-=f-c),c=-1}else for(r+a>u&&(r=u-a),f=r;f>=0;f--){for(var l=!0,h=0;h<a;h++)if(o(e,f+h)!==o(t,h)){l=!1;break}if(l)return f}return-1}function _(e,t,r,n){r=Number(r)||0;var i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;var o=t.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var s=0;s<n;++s){var u=parseInt(t.substr(2*s,2),16);if(isNaN(u))return s;e[r+s]=u}return s}function E(e,t,r,n){return X(V(t,e.length-r),e,r,n)}function A(e,t,r,n){return X(q(t),e,r,n)}function S(e,t,r,n){return A(e,t,r,n)}function O(e,t,r,n){return X(J(t),e,r,n)}function x(e,t,r,n){return X(K(t,e.length-r),e,r,n)}function R(e,t,r){return 0===t&&r===e.length?W.fromByteArray(e):W.fromByteArray(e.slice(t,r))}function P(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i<r;){var o=e[i],s=null,u=o>239?4:o>223?3:o>191?2:1;if(i+u<=r){var a,f,c,l;switch(u){case 1:o<128&&(s=o);break;case 2:a=e[i+1],128==(192&a)&&(l=(31&o)<<6|63&a)>127&&(s=l);break;case 3:a=e[i+1],f=e[i+2],128==(192&a)&&128==(192&f)&&(l=(15&o)<<12|(63&a)<<6|63&f)>2047&&(l<55296||l>57343)&&(s=l);break;case 4:a=e[i+1],f=e[i+2],c=e[i+3],128==(192&a)&&128==(192&f)&&128==(192&c)&&(l=(15&o)<<18|(63&a)<<12|(63&f)<<6|63&c)>65535&&l<1114112&&(s=l)}}null===s?(s=65533,u=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|1023&s),n.push(s),i+=u}return k(n)}function k(e){var t=e.length;if(t<=Q)return String.fromCharCode.apply(String,e);for(var r="",n=0;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=Q));return r}function T(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function B(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function j(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var i="",o=t;o<r;++o)i+=z(e[o]);return i}function C(e,t,r){for(var n=e.slice(t,r),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function L(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function I(e,t,r,n,i,s){if(!o.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<s)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function D(e,t,r,n){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-r,2);i<o;++i)e[r+i]=(t&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function U(e,t,r,n){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-r,4);i<o;++i)e[r+i]=t>>>8*(n?i:3-i)&255}function M(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function N(e,t,r,n,i){return i||M(e,t,r,4,3.4028234663852886e38,-3.4028234663852886e38),Z.write(e,t,r,n,23,4),r+4}function Y(e,t,r,n,i){return i||M(e,t,r,8,1.7976931348623157e308,-1.7976931348623157e308),Z.write(e,t,r,n,52,8),r+8}function F(e){if(e=G(e).replace(ee,""),e.length<2)return"";for(;e.length%4!=0;)e+="=";return e}function G(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function z(e){return e<16?"0"+e.toString(16):e.toString(16)}function V(e,t){t=t||1/0;for(var r,n=e.length,i=null,o=[],s=0;s<n;++s){if((r=e.charCodeAt(s))>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function q(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}function K(e,t){for(var r,n,i,o=[],s=0;s<e.length&&!((t-=2)<0);++s)r=e.charCodeAt(s),n=r>>8,i=r%256,o.push(i),o.push(n);return o}function J(e){return W.toByteArray(F(e))}function X(e,t,r,n){for(var i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function H(e){return e!==e}var W=r(16),Z=r(17),$=r(18);t.Buffer=o,t.SlowBuffer=d,t.INSPECT_MAX_BYTES=50,o.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}(),t.kMaxLength=n(),o.poolSize=8192,o._augment=function(e){return e.__proto__=o.prototype,e},o.from=function(e,t,r){return s(null,e,t,r)},o.TYPED_ARRAY_SUPPORT&&(o.prototype.__proto__=Uint8Array.prototype,o.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&o[Symbol.species]===o&&Object.defineProperty(o,Symbol.species,{value:null,configurable:!0})),o.alloc=function(e,t,r){return a(null,e,t,r)},o.allocUnsafe=function(e){return f(null,e)},o.allocUnsafeSlow=function(e){return f(null,e)},o.isBuffer=function(e){return!(null==e||!e._isBuffer)},o.compare=function(e,t){if(!o.isBuffer(e)||!o.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var r=e.length,n=t.length,i=0,s=Math.min(r,n);i<s;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},o.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},o.concat=function(e,t){if(!$(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return o.alloc(0);var r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;var n=o.allocUnsafe(t),i=0;for(r=0;r<e.length;++r){var s=e[r];if(!o.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(n,i),i+=s.length}return n},o.byteLength=v,o.prototype._isBuffer=!0,o.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)g(this,t,t+1);return this},o.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)g(this,t,t+3),g(this,t+1,t+2);return this},o.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)g(this,t,t+7),g(this,t+1,t+6),g(this,t+2,t+5),g(this,t+3,t+4);return this},o.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?P(this,0,e):m.apply(this,arguments)},o.prototype.equals=function(e){if(!o.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===o.compare(this,e)},o.prototype.inspect=function(){var e="",r=t.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(e+=" ... ")),"<Buffer "+e+">"},o.prototype.compare=function(e,t,r,n,i){if(!o.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(t>>>=0,r>>>=0,n>>>=0,i>>>=0,this===e)return 0;for(var s=i-n,u=r-t,a=Math.min(s,u),f=this.slice(n,i),c=e.slice(t,r),l=0;l<a;++l)if(f[l]!==c[l]){s=f[l],u=c[l];break}return s<u?-1:u<s?1:0},o.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},o.prototype.indexOf=function(e,t,r){return b(this,e,t,r,!0)},o.prototype.lastIndexOf=function(e,t,r){return b(this,e,t,r,!1)},o.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return _(this,e,t,r);case"utf8":case"utf-8":return E(this,e,t,r);case"ascii":return A(this,e,t,r);case"latin1":case"binary":return S(this,e,t,r);case"base64":return O(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var Q=4096;o.prototype.slice=function(e,t){var r=this.length;e=~~e,t=void 0===t?r:~~t,e<0?(e+=r)<0&&(e=0):e>r&&(e=r),t<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);var n;if(o.TYPED_ARRAY_SUPPORT)n=this.subarray(e,t),n.__proto__=o.prototype;else{var i=t-e;n=new o(i,void 0);for(var s=0;s<i;++s)n[s]=this[s+e]}return n},o.prototype.readUIntLE=function(e,t,r){e|=0,t|=0,r||L(e,t,this.length);for(var n=this[e],i=1,o=0;++o<t&&(i*=256);)n+=this[e+o]*i;return n},o.prototype.readUIntBE=function(e,t,r){e|=0,t|=0,r||L(e,t,this.length);for(var n=this[e+--t],i=1;t>0&&(i*=256);)n+=this[e+--t]*i;return n},o.prototype.readUInt8=function(e,t){return t||L(e,1,this.length),this[e]},o.prototype.readUInt16LE=function(e,t){return t||L(e,2,this.length),this[e]|this[e+1]<<8},o.prototype.readUInt16BE=function(e,t){return t||L(e,2,this.length),this[e]<<8|this[e+1]},o.prototype.readUInt32LE=function(e,t){return t||L(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},o.prototype.readUInt32BE=function(e,t){return t||L(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},o.prototype.readIntLE=function(e,t,r){e|=0,t|=0,r||L(e,t,this.length);for(var n=this[e],i=1,o=0;++o<t&&(i*=256);)n+=this[e+o]*i;return i*=128,n>=i&&(n-=Math.pow(2,8*t)),n},o.prototype.readIntBE=function(e,t,r){e|=0,t|=0,r||L(e,t,this.length);for(var n=t,i=1,o=this[e+--n];n>0&&(i*=256);)o+=this[e+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o},o.prototype.readInt8=function(e,t){return t||L(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},o.prototype.readInt16LE=function(e,t){t||L(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},o.prototype.readInt16BE=function(e,t){t||L(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},o.prototype.readInt32LE=function(e,t){return t||L(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},o.prototype.readInt32BE=function(e,t){return t||L(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},o.prototype.readFloatLE=function(e,t){return t||L(e,4,this.length),Z.read(this,e,!0,23,4)},o.prototype.readFloatBE=function(e,t){return t||L(e,4,this.length),Z.read(this,e,!1,23,4)},o.prototype.readDoubleLE=function(e,t){return t||L(e,8,this.length),Z.read(this,e,!0,52,8)},o.prototype.readDoubleBE=function(e,t){return t||L(e,8,this.length),Z.read(this,e,!1,52,8)},o.prototype.writeUIntLE=function(e,t,r,n){if(e=+e,t|=0,r|=0,!n){I(this,e,t,r,Math.pow(2,8*r)-1,0)}var i=1,o=0;for(this[t]=255&e;++o<r&&(i*=256);)this[t+o]=e/i&255;return t+r},o.prototype.writeUIntBE=function(e,t,r,n){if(e=+e,t|=0,r|=0,!n){I(this,e,t,r,Math.pow(2,8*r)-1,0)}var i=r-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r},o.prototype.writeUInt8=function(e,t,r){return e=+e,t|=0,r||I(this,e,t,1,255,0),o.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},o.prototype.writeUInt16LE=function(e,t,r){return e=+e,t|=0,r||I(this,e,t,2,65535,0),o.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):D(this,e,t,!0),t+2},o.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||I(this,e,t,2,65535,0),o.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):D(this,e,t,!1),t+2},o.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||I(this,e,t,4,4294967295,0),o.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):U(this,e,t,!0),t+4},o.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||I(this,e,t,4,4294967295,0),o.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):U(this,e,t,!1),t+4},o.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);I(this,e,t,r,i-1,-i)}var o=0,s=1,u=0;for(this[t]=255&e;++o<r&&(s*=256);)e<0&&0===u&&0!==this[t+o-1]&&(u=1),this[t+o]=(e/s>>0)-u&255;return t+r},o.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);I(this,e,t,r,i-1,-i)}var o=r-1,s=1,u=0;for(this[t+o]=255&e;--o>=0&&(s*=256);)e<0&&0===u&&0!==this[t+o+1]&&(u=1),this[t+o]=(e/s>>0)-u&255;return t+r},o.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||I(this,e,t,1,127,-128),o.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},o.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||I(this,e,t,2,32767,-32768),o.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):D(this,e,t,!0),t+2},o.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||I(this,e,t,2,32767,-32768),o.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):D(this,e,t,!1),t+2},o.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||I(this,e,t,4,2147483647,-2147483648),o.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):U(this,e,t,!0),t+4},o.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||I(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),o.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):U(this,e,t,!1),t+4},o.prototype.writeFloatLE=function(e,t,r){return N(this,e,t,!0,r)},o.prototype.writeFloatBE=function(e,t,r){return N(this,e,t,!1,r)},o.prototype.writeDoubleLE=function(e,t,r){return Y(this,e,t,!0,r)},o.prototype.writeDoubleBE=function(e,t,r){return Y(this,e,t,!1,r)},o.prototype.copy=function(e,t,r,n){if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);var i,s=n-r;if(this===e&&r<t&&t<n)for(i=s-1;i>=0;--i)e[i+t]=this[i+r];else if(s<1e3||!o.TYPED_ARRAY_SUPPORT)for(i=0;i<s;++i)e[i+t]=this[i+r];else Uint8Array.prototype.set.call(e,this.subarray(r,r+s),t);return s},o.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===e.length){var i=e.charCodeAt(0);i<256&&(e=i)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!o.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0);var s;if("number"==typeof e)for(s=t;s<r;++s)this[s]=e;else{var u=o.isBuffer(e)?e:V(new o(e,n).toString()),a=u.length;for(s=0;s<r-t;++s)this[s+t]=u[s%a]}return this};var ee=/[^+\/0-9A-Za-z-_]/g}).call(t,r(0))},function(e,t,r){"use strict";e.exports=r(7)},function(e,t,r){"use strict";(function(t,n){function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),f=r(8),c=r(9),l=r(2),h=r(10),p=r(12),y=r(15),d=r(19),v=r(21),m=v.SAVE_MODE,g=v.RECORD,b=function(e){function r(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};i(this,r);var t=o(this,(r.__proto__||Object.getPrototypeOf(r)).call(this));return Object.defineProperties(t,{_root:{writable:!0,enumerable:!1},_storage:{writable:!0,enumerable:!1},_memory:{writable:!0,enumerable:!1},_opts:{writable:!0,enumerable:!1},_timerExpiryCheck:{value:null,writable:!0,enumerable:!1},_timerSaveCheck:{value:null,writable:!0,enumerable:!1},GLOBAL_KEY:{writable:!0,enumerable:!1},_lastChange:{value:null,writable:!0,enumerable:!1},_lastChangeDetected:{value:null,writable:!0,enumerable:!1},_lastSave:{value:null,writable:!0,enumerable:!1},_saving:{value:!1,writable:!0,enumerable:!1},_loading:{value:!1,writable:!0,enumerable:!1}}),t.GLOBAL_KEY="___InCache___storage___global___key___",t.DEFAULT_CONFIG={storeName:"",autoLoad:!0,autoSave:!1,autoSaveMode:m.TERMINATE,autoSavePeriod:5,save:!1,clone:!1,preserve:!1,deleteOnExpires:!0,filePath:".incache",maxAge:0,maxRecordNumber:0,expires:null,silent:!1,share:!1,autoRemovePeriod:0,nullIfNotFound:!1,global:{silent:!1,life:0}},t._onRemoved=function(){},t._onCreated=function(){},t._onUpdated=function(){},t.on("_change",function(e){t._lastChange=(new Date).getTime(),t._opts.silent||t.fire("change",e)}),t.setConfig(e),t}return s(r,e),a(r,[{key:"_checkExceeded",value:function(){if(this._opts.maxRecordNumber){var e=Object.keys(this._memory.data);if(e.length>this._opts.maxRecordNumber){var t=e.length-this._opts.maxRecordNumber;this.fire("exceed",t),this.bulkRemove(e.slice(0,t),!0)}}}},{key:"_importData",value:function(e){if(f.is(e,"object")){var t=Object.keys(e);t.length&&(r.isRecord(e[t[0]])?this._memory.data=e:this.bulkSet(e,!0))}else{if(!f.is(e,"array"))throw new Error("bad data");e.length&&this.bulkSet(e,!0)}}},{key:"load",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this._opts.filePath;return new Promise(function(r,n){if(!t)return r(e);if(e._loading)return n("loading locked");if(!1===e.fireTheFirst("beforeLoad",e))return n();e._loading=!0;try{var i=f.isServer()?l.readFileSync(t):window.localStorage.getItem(t);null===i&&f.throwError("content cannot is null"),e._importData(JSON.parse(i.toString())),e._loading=!1,r(e),e.fireAsync("load",null,e)}catch(t){t=t.message,e._loading=!1,n(t),e.fireAsync("load",t,e)}})}},{key:"save",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this._opts.filePath;return new Promise(function(r,n){if(!t)return r(e);if(e._saving)return n("saving locked");if(!1===e.fireTheFirst("beforeSave",e))return n();e._saving=!0;var i=JSON.stringify(e._memory.data);try{f.isServer()?h.sync(t,i,{}):window.localStorage.setItem(t,i),e._lastSave=(new Date).getTime(),e._saving=!1,r(e),e.fireAsync("save",null,e)}catch(t){t=t.message,e._saving=!1,n(t),e.fireAsync("save",t,e)}})}},{key:"setConfig",value:function(){var e=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(r.global&&(f.deprecated(r.global.life,"global.life is deprecated use maxAge instead"),f.deprecated(r.global.silent,"global.silent is deprecated use silent instead")),f.defaults(r,this.DEFAULT_CONFIG),this._opts=r,this._root=r.share?f.isServer()?t:window:{},r.storeName&&(this.GLOBAL_KEY+=r.storeName),this._root[this.GLOBAL_KEY]||(this._root[this.GLOBAL_KEY]={data:{}}),this._memory=this._root[this.GLOBAL_KEY],r.autoLoad&&this.load().then().catch(function(e){}),r.autoSave||r.save)if(r.autoSaveMode===m.TERMINATE&&f.isServer()){var i=function(){o.save().then().catch(function(e){})},o=this;n.removeListener("exit",i),n.removeListener("SIGINT",i),n.on("exit",i),n.on("SIGINT",i)}else r.autoSaveMode===m.TIMER&&(this._timerSaveCheck&&(clearInterval(this._timerSaveCheck),this._timerSaveCheck=null),r.autoSavePeriod&&(this._timerSaveCheck=setInterval(function(){e._lastChange!==e._lastChangeDetected&&(e._lastChangeDetected=e._lastChange,e.save().then().catch(function(e){}))},1e3*r.autoSavePeriod)));this._timerExpiryCheck&&(clearInterval(this._timerExpiryCheck),this._timerExpiryCheck=null),r.autoRemovePeriod&&(this._timerExpiryCheck=setInterval(function(){var t=e.removeExpired();t.length&&e.fire("expired",t)},1e3*r.autoRemovePeriod))}},{key:"getConfig",value:function(){return this._opts}},{key:"set",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if((r.silent||!1!==this.fireTheFirst("beforeSet",e,t))&&(r=f.defaults(r,this._opts),!this.has(e)||!this._memory.data[e].isPreserved)){r.clone&&(t=y(t));var n=Object.assign({},g);return n.isNew=!0,n.isPreserved=r.preserve,n.toDelete=r.deleteOnExpires,n.hits=0,n.value=t,r.expires&&(f.is(r.expires,"date")||f.is(r.expires,"string"))?n.expiresOn=new Date(r.expires):r.maxAge&&f.is(r.maxAge,"number")?n.expiresOn=f.addMSToNow(r.maxAge):r.life&&f.is(r.life,"number")&&(f.deprecated(r.life,"life is deprecated use maxAge instead"),n.expiresOn=f.addSecondsToNow(r.life)),this.has(e)?(n.isNew=!1,n.hits=this._memory.data[e].hits,n.id=this._memory.data[e].id,n.createdOn=this._memory.data[e].createdOn,n.updatedOn=new Date,r.silent||(this._onUpdated.call(this,e,n),this.fire("update",e,n))):(n.id=p(),n.createdOn=new Date,r.silent||(this._onCreated.call(this,e,n),this.fire("create",e,n))),this._memory.data[e]=n,r.silent||this.fire("set",e,n),this._checkExceeded(),this.fire("_change","set"),n}}},{key:"get",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return this.has(e)?this.canBeAutoRemove(e)?(this.remove(e,!0),this._opts.nullIfNotFound?null:void 0):(this._memory.data[e].hits+=1,this._memory.data[e].lastHit=new Date,t?this._memory.data[e].value:this._memory.data[e]):this._opts.nullIfNotFound?null:void 0}},{key:"info",value:function(e){if(this.has(e)){if(this.canBeAutoRemove(e))return void this.remove(e,!0);var t=Object.assign({},this._memory.data[e]);return delete t.value,t}}},{key:"remove",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];(t||!1!==this.fireTheFirst("beforeRemove",e))&&(delete this._memory.data[e],t||(this._onRemoved.call(this,e),this.fire("remove",e)),this.fire("_change","remove"))}},{key:"removeFrom",value:function(e,t){if(!this.has(e))return null;if(f.is(t,"undefined"))throw new Error("where cannot be undefined");if(!this._memory.data[e].isPreserved){var r=this.get(e);if(!f.is(r,"array"))throw new Error("value must be an array");var n=r.length;for(var i in r)if(r.hasOwnProperty(i)){var o=[];for(var s in t)t.hasOwnProperty(s)&&(f.is(t,"object")?o.push(void 0!==r[i][s]&&r[i][s]===t[s]):o.push(r[i]===t));o.length&&-1===o.indexOf(!1)&&r.splice(i,1)}n!==r.length&&this.set(e,r)}}},{key:"removeExpired",value:function(){var e=[];for(var t in this._memory.data)this._memory.data.hasOwnProperty(t)&&this.expired(t)&&this._memory.data[t].toDelete&&(this.remove(t,!0),e.push(t));return e}},{key:"addTo",value:function(e,t){if(this.has(e)){var r=this.get(e);if(!this._memory.data[e].isPreserved){if(!f.is(r,"array"))throw new Error("object must be an array");return r.push(t),this.set(e,r)}}}},{key:"prependTo",value:function(e,t){if(this.has(e)&&!this._memory.data[e].isPreserved){var r=this.get(e);if(!f.is(r,"array"))throw new Error("object must be an array");return r.unshift(t),this.set(e,r)}}},{key:"updateIn",value:function(e,t,r){if(this.has(e)){if(f.is(t,"undefined"))throw new Error("value cannot be undefined");if(f.is(r,"undefined"))throw new Error("where cannot be undefined");if(!this._memory.data[e].isPreserved){var n=this.get(e);if(!f.is(n,"array"))throw new Error("value must be an array");var i=!1;for(var o in n)if(n.hasOwnProperty(o)){var s=[];for(var u in r)r.hasOwnProperty(u)&&(f.is(r,"object")?s.push(void 0!==n[o][u]&&n[o][u]===r[u]):s.push(n[o]===r));s.length&&-1===s.indexOf(!1)&&(i=!0,n[o]=t)}i&&this.set(e,n)}}}},{key:"bulkSet",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!f.is(e,"array")&&!f.is(e,"object"))throw new Error("records must be an array, e.g. {key: foo, value: bar}");if(t||!1!==this.fireTheFirst("beforeBulkSet",e)){for(var r={},n=void 0,i=0;i<e.length;i++)f.is(e[i].key,"undefined")||f.is(e[i].value,"undefined")?(n=this.set(i,e[i],{silent:!0,fromBulk:!0}))&&(r[i]=n):(n=this.set(e[i].key,e[i].value,{silent:!0,fromBulk:!0}))&&(r[e[i].key]=n);return t||this.fire("bulkSet",e),r}}},{key:"bulkRemove",value:function(e,t){if(!f.is(e,"array"))throw new Error("keys must be an array of keys");if(t||!1!==this.fireTheFirst("beforeBulkRemove",e)){for(var r=0;r<e.length;r++)this.remove(e[r],!0);t||this.fire("bulkRemove",e)}}},{key:"clean",value:function(e){if(!f.is(e,"string"))throw new Error("key must be a string");for(var t in this._memory.data)this._memory.data.hasOwnProperty(t)&&-1!==t.indexOf(e)&&(delete this._memory.data[t],this.fire("_change","clean"))}},{key:"all",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=e?{}:[];for(var r in this._memory.data)this._memory.data.hasOwnProperty(r)&&(this.canBeAutoRemove(r)?this.remove(r,!0):Array.isArray(t)?t.push({key:r,value:this._memory.data[r].value}):t[r]=this._memory.data[r].value);return t}},{key:"count",value:function(){return this.removeExpired(),Object.keys(this._memory.data).length}},{key:"expired",value:function(e){if(this._memory.data[e]&&this._memory.data[e].expiresOn){return new Date>new Date(this._memory.data[e].expiresOn)}return!1}},{key:"clear",value:function(){this._memory.data={},this.fire("_change","clear")}},{key:"has",value:function(e){return this._memory.data.hasOwnProperty(e)}},{key:"destroy",value:function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];this.remove.apply(this,t)}},{key:"stats",value:function(){return{count:this.count(),size:d(this._memory.data)}}},{key:"canBeAutoRemove",value:function(e){return!this._opts.autoRemovePeriod&&this.expired(e)&&this._memory.data[e].toDelete}},{key:"onRemoved",value:function(e){this._onRemoved=e}},{key:"onCreated",value:function(e){this._onCreated=e}},{key:"onUpdated",value:function(e){this._onUpdated=e}}],[{key:"isRecord",value:function(e){return Object.keys(g).every(function(t){return"object"===(void 0===e?"undefined":u(e))&&e.hasOwnProperty(t)})}}]),r}(c);e.exports=b,e.exports.SAVE_MODE=m}).call(t,r(0),r(1))},function(e,t,r){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i={};i.is=function(e,t){return Object.prototype.toString.call(e).toLowerCase()==="[object "+t+"]".toLowerCase()},i.defaults=function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e.hasOwnProperty(r)?"object"===n(e[r])&&null!==e[r]&&i.defaults(e[r],t[r]):e[r]=t[r]);return e},i.addSecondsToNow=function(e){var t=new Date;return new Date(t.setSeconds(t.getSeconds()+e))},i.addMSToNow=function(e){var t=new Date;return new Date(t.setMilliseconds(t.getMilliseconds()+e))},i.isServer=function(){return"undefined"==typeof window},i.deprecated=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"warn";return void 0!==e&&(console[r](t||e),!0)},i.throwError=function(e){throw new Error(e)},e.exports=i},function(e,t,r){"use strict";(function(e){var r,n,i,o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};!function(s,u){"object"===o(t)&&"object"===o(e)?e.exports=u():(n=[],r=u,void 0!==(i="function"==typeof r?r.apply(t,n):r)&&(e.exports=i))}(0,function(){return function(e){function t(n){if(r[n])return r[n].exports;var i=r[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var r={};return t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=0)}([function(e,t,r){e.exports=r(1)},function(e,t,r){function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),o=r(2),s=r(3),u=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};n(this,e),this.defaultClassOpts={maxListeners:10,asyncDelay:10},this.defaultListenerOpts={maxCalls:0,prepend:!1},this.opts=o.defaults(t,this.defaultClassOpts),this.events={}}return i(e,[{key:"_createEvent",value:function(e,t,r){if(this.events[e]||(this.events[e]=[]),this.opts.maxListeners){var n=this.opts.maxListeners;if(this.events[e].length>=n)throw new Error(s[3]+n)}t.opts=o.defaults(r,this.defaultListenerOpts),t.state={suspended:!1,calls:0},r.prepend?this.events[e].unshift(t):this.events[e].push(t),this._created.call(this,e,t,r)}},{key:"_callEvent",value:function(e,t,r){if(!t.state.suspended)return t.opts.maxCalls&&t.state.calls++>=t.opts.maxCalls?void this.off(e,t):(this._catchAll.call(this,r),t.apply(this,r))}},{key:"_suspendEvent",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments[1],r=void 0;for(var n in e)r=e[n],this.events[r]&&this.events[r].forEach(function(e){e.state.suspended=t});return this}},{key:"_created",value:function(){}},{key:"_removed",value:function(){}},{key:"_catchAll",value:function(){}},{key:"on",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!o.is(e,"string"))throw new Error(s[0]);if(e=e.trim(),!e.length)throw new Error(s[4]);if(o.is(t,"array")){for(var n in t)if(t.hasOwnProperty(n)){if(!o.is(t[n],"function"))throw new Error(s[1]);this._createEvent(e,t[n],r)}}else{if(!o.is(t,"function"))throw new Error(s[1]);this._createEvent(e,t,r)}return this}},{key:"once",value:function(e,t){return this.on(e,t,{maxCalls:1})}},{key:"fire",value:function(e){if(this.exists(e)){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];for(var i=0;i<this.events[e].length;i++)this._callEvent(e,this.events[e][i],r)}return this}},{key:"fireTheFirst",value:function(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];if(this.exists(e))return this._callEvent(e,this.events[e][0],r)}},{key:"fireAsync",value:function(e){for(var t=this,r=arguments.length,n=Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];n.unshift(e),setTimeout(function(){t.fire.apply(t,n)},this.opts.asyncDelay)}},{key:"off",value:function(e,t){if(!o.is(e,"string"))throw new Error(s[0]);if(this.events[e])if("function"==typeof t)for(var r=0;r<this.events[e].length;r++)this.events[e][r]===t&&(this.events[e].splice(r,1),this._removed.call(this,e,t));else delete this.events[e],this._removed.call(this,e);return this}},{key:"prependListener",value:function(e,t){return this.on(e,t,{prepend:!0})}},{key:"prependOnceListener",value:function(e,t){return this.on(e,t,{maxCalls:1,prepend:!0})}},{key:"suspendEvent",value:function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return this._suspendEvent(t,!0)}},{key:"resumeEvent",value:function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return this._suspendEvent(t,!1)}},{key:"suspendEvents",value:function(){return this._suspendEvent(Object.keys(this.events),!0)}},{key:"resumeEvents",value:function(){return this._suspendEvent(Object.keys(this.events),!1)}},{key:"isSuspended",value:function(e){return!!this.exists(e)&&this.events[e][0].state.suspended}},{key:"clear",value:function(){return this.events=[],this}},{key:"getListenersCount",value:function(e){return this.getListeners(e).length}},{key:"getListeners",value:function(e){if(!o.is(e,"string"))throw new Error(s[0]);if(!this.exists(e))throw new Error(s[5]);return this.events[e]}},{key:"getEvents",value:function(){return this.events}},{key:"exists",value:function(e){if(!o.is(e,"string"))throw new Error(s[0]);return!o.is(this.events[e],"undefined")}},{key:"getMaxListeners",value:function(){return this.opts.maxListeners}},{key:"setMaxListeners",value:function(e){if(!o.is(e,"number"))throw new Error(s[2]);return this.opts.maxListeners=e,this}},{key:"onCatchAll",value:function(e){return this._catchAll=e,this}},{key:"onCreated",value:function(e){return this._created=e,this}},{key:"onRemoved",value:function(e){return this._removed=e,this}}]),e}();e.exports=u,e.exports._error=s},function(e,t,r){var n="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return void 0===e?"undefined":o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":void 0===e?"undefined":o(e)},i={};i.is=function(e,t){return Object.prototype.toString.call(e).toLowerCase()==="[object "+t+"]".toLowerCase()},i.defaults=function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e.hasOwnProperty(r)?"object"===n(e[r])&&i.defaults(e[r],t[r]):e[r]=t[r]);return e},e.exports=i},function(e,t,r){e.exports=["event name is required and must be a string","listener is required and must be a function or an array of function","value must be a number","increase maxListeners per event: ","event name not valid","event not found"]}])})}).call(t,r(3)(e))},function(e,t,r){"use strict";function n(e,t,r,u){return"function"==typeof r&&(u=r,r={}),"function"!=typeof u?n.promise.apply(null,arguments):"string"!=typeof e?void u(new TypeError("expected filepath to be a string")):void s(o.dirname(e),r,function(n){if(n)return void u(n);i.writeFile(e,t,r,u)})}var i=r(2),o=r(4),s=r(11);n.promise=function(e,t,r){return"string"!=typeof e?Promise.reject(new TypeError("expected filepath to be a string")):new Promise(function(n,u){s(o.dirname(e),r,function(o){if(o)return void u(o);i.writeFile(e,t,r,function(e){if(e)return void u(e);n(t)})})})},n.sync=function(e,t,r){if("string"!=typeof e)throw new TypeError("expected filepath to be a string");s.sync(o.dirname(e),r),i.writeFileSync(e,t,r)},n.stream=function(e,t){return s.sync(o.dirname(e),t),i.createWriteStream(e,t)},e.exports=n},function(e,t,r){"use strict";(function(t){function n(e,r,a,f){"function"==typeof r?(a=r,r={}):r&&"object"===(void 0===r?"undefined":i(r))||(r={mode:r});var c=r.mode,l=r.fs||s;void 0===c&&(c=u&~t.umask()),f||(f=null);var h=a||function(){};e=o.resolve(e),l.mkdir(e,c,function(t){if(!t)return f=f||e,h(null,f);switch(t.code){case"ENOENT":n(o.dirname(e),r,function(t,i){t?h(t,i):n(e,r,h,i)});break;default:l.stat(e,function(e,r){e||!r.isDirectory()?h(t,f):h(null,f)})}})}var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o=r(4),s=r(2),u=parseInt("0777",8);e.exports=n.mkdirp=n.mkdirP=n,n.sync=function e(r,n,a){n&&"object"===(void 0===n?"undefined":i(n))||(n={mode:n});var f=n.mode,c=n.fs||s;void 0===f&&(f=u&~t.umask()),a||(a=null),r=o.resolve(r);try{c.mkdirSync(r,f),a=a||r}catch(t){switch(t.code){case"ENOENT":a=e(o.dirname(r),n,a),e(r,n,a);break;default:var l;try{l=c.statSync(r)}catch(e){throw t}if(!l.isDirectory())throw t}}return a}}).call(t,r(1))},function(e,t,r){"use strict";function n(e,t,r){var n=t&&r||0,i=t||[];e=e||{};var s=void 0!==e.clockseq?e.clockseq:a,l=void 0!==e.msecs?e.msecs:(new Date).getTime(),h=void 0!==e.nsecs?e.nsecs:c+1,p=l-f+(h-c)/1e4;if(p<0&&void 0===e.clockseq&&(s=s+1&16383),(p<0||l>f)&&void 0===e.nsecs&&(h=0),h>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");f=l,c=h,a=s,l+=122192928e5;var y=(1e4*(268435455&l)+h)%4294967296;i[n++]=y>>>24&255,i[n++]=y>>>16&255,i[n++]=y>>>8&255,i[n++]=255&y;var d=l/4294967296*1e4&268435455;i[n++]=d>>>8&255,i[n++]=255&d,i[n++]=d>>>24&15|16,i[n++]=d>>>16&255,i[n++]=s>>>8|128,i[n++]=255&s;for(var v=e.node||u,m=0;m<6;++m)i[n+m]=v[m];return t||o(i)}var i=r(13),o=r(14),s=i(),u=[1|s[0],s[1],s[2],s[3],s[4],s[5]],a=16383&(s[6]<<8|s[7]),f=0,c=0;e.exports=n},function(e,t,r){"use strict";(function(t){var r,n=t.crypto||t.msCrypto;if(n&&n.getRandomValues){var i=new Uint8Array(16);r=function(){return n.getRandomValues(i),i}}if(!r){var o=new Array(16);r=function(){for(var e,t=0;t<16;t++)0==(3&t)&&(e=4294967296*Math.random()),o[t]=e>>>((3&t)<<3)&255;return o}}e.exports=r}).call(t,r(0))},function(e,t,r){"use strict";function n(e,t){var r=t||0,n=i;return n[e[r++]]+n[e[r++]]+n[e[r++]]+n[e[r++]]+"-"+n[e[r++]]+n[e[r++]]+"-"+n[e[r++]]+n[e[r++]]+"-"+n[e[r++]]+n[e[r++]]+"-"+n[e[r++]]+n[e[r++]]+n[e[r++]]+n[e[r++]]+n[e[r++]]+n[e[r++]]}for(var i=[],o=0;o<256;++o)i[o]=(o+256).toString(16).substr(1);e.exports=n},function(e,t,r){"use strict";(function(e,t){var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n=function(){function t(e,t){return null!=t&&e instanceof t}function n(i,o,s,u,h){function p(i,s){if(null===i)return null;if(0===s)return i;var m,g;if("object"!=(void 0===i?"undefined":r(i)))return i;if(t(i,f))m=new f;else if(t(i,c))m=new c;else if(t(i,l))m=new l(function(e,t){i.then(function(t){e(p(t,s-1))},function(e){t(p(e,s-1))})});else if(n.__isArray(i))m=[];else if(n.__isRegExp(i))m=new RegExp(i.source,a(i)),i.lastIndex&&(m.lastIndex=i.lastIndex);else if(n.__isDate(i))m=new Date(i.getTime());else{if(v&&e.isBuffer(i))return m=new e(i.length),i.copy(m),m;t(i,Error)?m=Object.create(i):void 0===u?(g=Object.getPrototypeOf(i),m=Object.create(g)):(m=Object.create(u),g=u)}if(o){var b=y.indexOf(i);if(-1!=b)return d[b];y.push(i),d.push(m)}t(i,f)&&i.forEach(function(e,t){var r=p(t,s-1),n=p(e,s-1);m.set(r,n)}),t(i,c)&&i.forEach(function(e){var t=p(e,s-1);m.add(t)});for(var w in i){var _;g&&(_=Object.getOwnPropertyDescriptor(g,w)),_&&null==_.set||(m[w]=p(i[w],s-1))}if(Object.getOwnPropertySymbols)for(var E=Object.getOwnPropertySymbols(i),w=0;w<E.length;w++){var A=E[w],S=Object.getOwnPropertyDescriptor(i,A);(!S||S.enumerable||h)&&(m[A]=p(i[A],s-1),S.enumerable||Object.defineProperty(m,A,{enumerable:!1}))}if(h)for(var O=Object.getOwnPropertyNames(i),w=0;w<O.length;w++){var x=O[w],S=Object.getOwnPropertyDescriptor(i,x);S&&S.enumerable||(m[x]=p(i[x],s-1),Object.defineProperty(m,x,{enumerable:!1}))}return m}"object"===(void 0===o?"undefined":r(o))&&(s=o.depth,u=o.prototype,h=o.includeNonEnumerable,o=o.circular);var y=[],d=[],v=void 0!==e;return void 0===o&&(o=!0),void 0===s&&(s=1/0),p(i,s)}function i(e){return Object.prototype.toString.call(e)}function o(e){return"object"===(void 0===e?"undefined":r(e))&&"[object Date]"===i(e)}function s(e){return"object"===(void 0===e?"undefined":r(e))&&"[object Array]"===i(e)}function u(e){return"object"===(void 0===e?"undefined":r(e))&&"[object RegExp]"===i(e)}function a(e){var t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),t}var f;try{f=Map}catch(e){f=function(){}}var c;try{c=Set}catch(e){c=function(){}}var l;try{l=Promise}catch(e){l=function(){}}return n.clonePrototype=function(e){if(null===e)return null;var t=function(){};return t.prototype=e,new t},n.__objToStr=i,n.__isDate=o,n.__isArray=s,n.__isRegExp=u,n.__getRegExpFlags=a,n}();"object"===r(t)&&t.exports&&(t.exports=n)}).call(t,r(5).Buffer,r(3)(e))},function(e,t,r){"use strict";function n(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===e[t-2]?2:"="===e[t-1]?1:0}function i(e){return 3*e.length/4-n(e)}function o(e){var t,r,i,o,s,u=e.length;o=n(e),s=new l(3*u/4-o),r=o>0?u-4:u;var a=0;for(t=0;t<r;t+=4)i=c[e.charCodeAt(t)]<<18|c[e.charCodeAt(t+1)]<<12|c[e.charCodeAt(t+2)]<<6|c[e.charCodeAt(t+3)],s[a++]=i>>16&255,s[a++]=i>>8&255,s[a++]=255&i;return 2===o?(i=c[e.charCodeAt(t)]<<2|c[e.charCodeAt(t+1)]>>4,s[a++]=255&i):1===o&&(i=c[e.charCodeAt(t)]<<10|c[e.charCodeAt(t+1)]<<4|c[e.charCodeAt(t+2)]>>2,s[a++]=i>>8&255,s[a++]=255&i),s}function s(e){return f[e>>18&63]+f[e>>12&63]+f[e>>6&63]+f[63&e]}function u(e,t,r){for(var n,i=[],o=t;o<r;o+=3)n=(e[o]<<16)+(e[o+1]<<8)+e[o+2],i.push(s(n));return i.join("")}function a(e){for(var t,r=e.length,n=r%3,i="",o=[],s=0,a=r-n;s<a;s+=16383)o.push(u(e,s,s+16383>a?a:s+16383));return 1===n?(t=e[r-1],i+=f[t>>2],i+=f[t<<4&63],i+="=="):2===n&&(t=(e[r-2]<<8)+e[r-1],i+=f[t>>10],i+=f[t>>4&63],i+=f[t<<2&63],i+="="),o.push(i),o.join("")}t.byteLength=i,t.toByteArray=o,t.fromByteArray=a;for(var f=[],c=[],l="undefined"!=typeof Uint8Array?Uint8Array:Array,h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",p=0,y=h.length;p<y;++p)f[p]=h[p],c[h.charCodeAt(p)]=p;c["-".charCodeAt(0)]=62,c["_".charCodeAt(0)]=63},function(e,t,r){"use strict";t.read=function(e,t,r,n,i){var o,s,u=8*i-n-1,a=(1<<u)-1,f=a>>1,c=-7,l=r?i-1:0,h=r?-1:1,p=e[t+l];for(l+=h,o=p&(1<<-c)-1,p>>=-c,c+=u;c>0;o=256*o+e[t+l],l+=h,c-=8);for(s=o&(1<<-c)-1,o>>=-c,c+=n;c>0;s=256*s+e[t+l],l+=h,c-=8);if(0===o)o=1-f;else{if(o===a)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,n),o-=f}return(p?-1:1)*s*Math.pow(2,o-n)},t.write=function(e,t,r,n,i,o){var s,u,a,f=8*o-i-1,c=(1<<f)-1,l=c>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,y=n?1:-1,d=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(u=isNaN(t)?1:0,s=c):(s=Math.floor(Math.log(t)/Math.LN2),t*(a=Math.pow(2,-s))<1&&(s--,a*=2),t+=s+l>=1?h/a:h*Math.pow(2,1-l),t*a>=2&&(s++,a/=2),s+l>=c?(u=0,s=c):s+l>=1?(u=(t*a-1)*Math.pow(2,i),s+=l):(u=t*Math.pow(2,l-1)*Math.pow(2,i),s=0));i>=8;e[r+p]=255&u,p+=y,u/=256,i-=8);for(s=s<<i|u,f+=i;f>0;e[r+p]=255&s,p+=y,s/=256,f-=8);e[r+p-y]|=128*d}},function(e,t,r){"use strict";var n={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},function(e,t,r){"use strict";function n(e){if(null!==e&&"object"===(void 0===e?"undefined":i(e))){if(s.isBuffer(e))return e.length;var t=0;for(var r in e)if(Object.hasOwnProperty.call(e,r)){t+=n(r);try{t+=n(e[r])}catch(e){e instanceof RangeError&&(t=0)}}return t}return"string"==typeof e?e.length*o.STRING:"boolean"==typeof e?o.BOOLEAN:"number"==typeof e?o.NUMBER:0}var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o=r(20),s=r(5).Buffer;e.exports=n},function(e,t,r){"use strict";e.exports={STRING:2,BOOLEAN:4,NUMBER:8}},function(e,t,r){"use strict";t.SAVE_MODE=Object.defineProperties({},{TERMINATE:{value:"terminate",enumerable:!0},TIMER:{value:"timer",enumerable:!0}}),t.REMOVE_EXCEED=Object.defineProperties({},{OLDER:{value:"older",enumerable:!0},USAGE:{value:"usage",enumerable:!0},NONE:{value:"none",enumerable:!0}}),t.RECORD={id:null,isNew:!0,isPreserved:null,toDelete:null,hits:null,lastHit:null,createdOn:null,updatedOn:null,expiresOn:null,value:null}}])});
{
"name": "incache",
"version": "7.0.6",
"version": "7.1.0",
"description": "Powerful key/value in-memory storage or on disk to persist some data",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -39,6 +39,21 @@ const helper = require('./helper');

/**
* InCache recordInfo
* @typedef {Object} InCache~recordInfo
* @property {string} id - uuid
* @property {boolean} isNew - indicates if is a new record
* @property {boolean} isPreserved - indicates if record will no longer be editable once created
* @property {boolean} toDelete - indicates if record will be deleted after expiry
* @property {number} hits - how many times it has been used
* @property {Date|null} lastHit - last usage
* @property {Date|null} createdOn - creation date
* @property {Date|null} updatedOn - update date
* @property {Date|null} expiresOn - expiry date
*/
/**
* @class
*/
class InCache {
class InCache extends Flak {

@@ -76,2 +91,4 @@ /**

super();
Object.defineProperties(this, {

@@ -90,5 +107,2 @@ _root: {

},
_emitter: {
value: new Flak()
},
_opts: {

@@ -185,3 +199,3 @@ writable: true,

if (!this._opts.silent)
this._emitter.fire('change', by);
this.fire('change', by);
});

@@ -200,3 +214,3 @@

let diff = keys.length - this._opts.maxRecordNumber;
this._emitter.fire('exceed', diff);
this.fire('exceed', diff);
this.bulkRemove(keys.slice(0, diff), true);

@@ -243,3 +257,3 @@ }

/* istanbul ignore else */
if (this._emitter.fireTheFirst('beforeLoad', this) === false) {
if (this.fireTheFirst('beforeLoad', this) === false) {
return reject();

@@ -259,3 +273,3 @@ }

resolve(this);
this._emitter.fireAsync('load', null, this);
this.fireAsync('load', null, this);
} catch (err) {

@@ -265,3 +279,3 @@ err = err.message;

reject(err);
this._emitter.fireAsync('load', err, this);
this.fireAsync('load', err, this);
}

@@ -288,3 +302,3 @@ }

/* istanbul ignore else */
if (this._emitter.fireTheFirst('beforeSave', this) === false) {
if (this.fireTheFirst('beforeSave', this) === false) {
return reject();

@@ -306,3 +320,3 @@ }

resolve(this);
this._emitter.fireAsync('save', null, this);
this.fireAsync('save', null, this);
} catch (err) {

@@ -312,3 +326,3 @@ err = err.message;

reject(err);
this._emitter.fireAsync('save', err, this);
this.fireAsync('save', err, this);
}

@@ -420,3 +434,3 @@ }

if (expired.length) {
this._emitter.fire('expired', expired);
this.fire('expired', expired);
}

@@ -460,3 +474,3 @@ }, opts.autoRemovePeriod * 1000);

/* istanbul ignore else */
if (!opts.silent && this._emitter.fireTheFirst('beforeSet', key, value) === false) {
if (!opts.silent && this.fireTheFirst('beforeSet', key, value) === false) {
return;

@@ -502,3 +516,3 @@ }

this._onUpdated.call(this, key, record);
this._emitter.fire('update', key, record);
this.fire('update', key, record);
}

@@ -510,3 +524,3 @@ } else {

this._onCreated.call(this, key, record);
this._emitter.fire('create', key, record);
this.fire('create', key, record);
}

@@ -518,3 +532,3 @@ }

if (!opts.silent) {
this._emitter.fire('set', key, record);
this.fire('set', key, record);
}

@@ -524,3 +538,3 @@

this._emitter.fire('_change', 'set');
this.fire('_change', 'set');

@@ -540,3 +554,3 @@ return record;

if (this.has(key)) {
if (!this._opts.autoRemovePeriod && this.expired(key) && this._memory.data[key].toDelete) {
if (this.canBeAutoRemove(key)) {
this.remove(key, true);

@@ -554,2 +568,26 @@ return (this._opts.nullIfNotFound ? null : undefined);

/**
* Get info record by key
* @param key {string}
* @returns {InCache~recordInfo|*|undefined}
* @example
* inCache.info('my key');
* @since 7.1.0
*/
info(key) {
if (this.has(key)) {
if (this.canBeAutoRemove(key)) {
this.remove(key, true);
return undefined;
}
const record = Object.assign({}, this._memory.data[key]);
delete record.value;
return record;
} else {
return undefined;
}
}
/**
* Delete a record

@@ -564,3 +602,3 @@ * @param key {string}

remove(key, silent = false) {
if (!silent && this._emitter.fireTheFirst('beforeRemove', key) === false) {
if (!silent && this.fireTheFirst('beforeRemove', key) === false) {
return;

@@ -571,5 +609,5 @@ }

this._onRemoved.call(this, key);
this._emitter.fire('remove', key);
this.fire('remove', key);
}
this._emitter.fire('_change', 'remove');
this.fire('_change', 'remove');
}

@@ -778,3 +816,3 @@

if (!silent && this._emitter.fireTheFirst('beforeBulkSet', records) === false) {
if (!silent && this.fireTheFirst('beforeBulkSet', records) === false) {
return;

@@ -801,3 +839,3 @@ }

if (!silent) {
this._emitter.fire('bulkSet', records);
this.fire('bulkSet', records);
}

@@ -821,3 +859,3 @@

if (!silent && this._emitter.fireTheFirst('beforeBulkRemove', keys) === false) {
if (!silent && this.fireTheFirst('beforeBulkRemove', keys) === false) {
return;

@@ -831,3 +869,3 @@ }

if (!silent) {
this._emitter.fire('bulkRemove', keys);
this.fire('bulkRemove', keys);
}

@@ -851,3 +889,3 @@ }

delete this._memory.data[k];
this._emitter.fire('_change', 'clean');
this.fire('_change', 'clean');
}

@@ -867,3 +905,3 @@ }

if (this._memory.data.hasOwnProperty(key)) {
if (!this._opts.autoRemovePeriod && this.expired(key) && this._memory.data[key].toDelete) {
if (this.canBeAutoRemove(key)) {
this.remove(key, true);

@@ -920,3 +958,3 @@ } else {

this._memory.data = {};
this._emitter.fire('_change', 'clear');
this.fire('_change', 'clear');
}

@@ -963,6 +1001,2 @@

*/
on(eventName, callback) {
this._emitter.on.call(this._emitter, eventName, callback);
return this;
}

@@ -975,6 +1009,2 @@ /**

*/
suspendEvent(...eventName) {
this._emitter.suspendEvent.call(this._emitter, eventName);
return this;
}

@@ -987,6 +1017,2 @@ /**

*/
resumeEvent(...eventName) {
this._emitter.resumeEvent.call(this._emitter, eventName);
return this;
}

@@ -998,6 +1024,2 @@ /**

*/
suspendEvents() {
this._emitter.suspendEvents.call(this._emitter);
return this;
}

@@ -1009,5 +1031,10 @@ /**

*/
resumeEvents() {
this._emitter.resumeEvents.call(this._emitter);
return this;
/**
* Check if key can be auto removed
* @param key
* @returns {boolean|*}
*/
canBeAutoRemove(key) {
return !this._opts.autoRemovePeriod && this.expired(key) && this._memory.data[key].toDelete
}

@@ -1014,0 +1041,0 @@

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