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

mycache

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mycache - npm Package Compare versions

Comparing version 0.4.1 to 0.4.2

5

CHANGELOG.md

@@ -7,2 +7,7 @@ # Changelog

## [0.4.2] - 2018-06-21
### Changed
- Use localForage typing in local
- Fix some typing
## [0.4.1] - 2018-04-27

@@ -9,0 +14,0 @@ ### Added

30

dist/cjs/mycache.prod.min.js

@@ -22,4 +22,4 @@ "use strict"

function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.")
for(;a;)try{if(r=1,n&&(o=n[2&i[0]?"return":i[0]?"throw":"next"])&&!(o=o.call(n,i[1])).done)return o
switch(n=0,o&&(i=[0,o.value]),i[0]){case 0:case 1:o=i
for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o
switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i
break

@@ -291,3 +291,3 @@ case 4:return a.label++,{value:i[1],done:!1}

default:throw Error("Unkown type: "+type)}},stringToBuffer:Q,bufferToString:H}
function Z(e,t,r,n){e.executeSql("CREATE TABLE IF NOT EXISTS "+t.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],r,n)}function Y(e,t,r,n,o,i){e.executeSql(r,n,o,function(e,a){a.code===a.SYNTAX_ERR?e.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[name],function(e,s){s.rows.length?i(e,a):Z(e,t,function(){e.executeSql(r,n,o,i)},i)},i):i(e,a)},i)}var $={_driver:"webSQLStorage",_initStorage:function(e){var t=this,r={db:null}
function Z(e,t,r,n){e.executeSql("CREATE TABLE IF NOT EXISTS "+t.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],r,n)}function Y(e,t,r,n,o,i){e.executeSql(r,n,o,function(e,a){a.code===a.SYNTAX_ERR?e.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[t.storeName],function(e,s){s.rows.length?i(e,a):Z(e,t,function(){e.executeSql(r,n,o,i)},i)},i):i(e,a)},i)}var $={_driver:"webSQLStorage",_initStorage:function(e){var t=this,r={db:null}
if(e)for(var n in e)r[n]="string"!=typeof e[n]?""+e[n]:e[n]

@@ -402,4 +402,4 @@ var o=new a(function(e,n){try{r.db=openDatabase(r.name,r.version+"",r.description,r.size)}catch(e){return n(e)}r.db.transaction(function(o){Z(o,r,function(){t._dbInfo=r,e()},function(e,t){n(t)})},n)})

function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.")
for(;a;)try{if(r=1,n&&(o=n[2&i[0]?"return":i[0]?"throw":"next"])&&!(o=o.call(n,i[1])).done)return o
switch(n=0,o&&(i=[0,o.value]),i[0]){case 0:case 1:o=i
for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o
switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i
break

@@ -438,4 +438,4 @@ case 4:return a.label++,{value:i[1],done:!1}

function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.")
for(;a;)try{if(r=1,n&&(o=n[2&i[0]?"return":i[0]?"throw":"next"])&&!(o=o.call(n,i[1])).done)return o
switch(n=0,o&&(i=[0,o.value]),i[0]){case 0:case 1:o=i
for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o
switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i
break

@@ -486,9 +486,11 @@ case 4:return a.label++,{value:i[1],done:!1}

case 3:return[2]}})})},e.prototype.get=function(e){return n(this,void 0,void 0,function(){var t,r,n
return o(this,function(o){switch(o.label){case 0:return o.trys.push([0,5,,6]),[4,this.getMeta(e)]
case 1:return(t=o.sent())?void 0===t.length||void 0===t.expire||void 0===t.now||void 0===t.count?[3,4]:this.expiredVaule(t.expire)?(this.remove(e),[2,Promise.resolve(null)]):[4,this.valueCacheInstance.get(e)]:[2,Promise.resolve(null)]
case 2:return r=o.sent(),[4,this.setMeta(e)]
case 3:return o.sent(),[2,Promise.resolve(r)]
case 4:return[2,Promise.resolve(t)]
case 5:return n=o.sent(),[2,Promise.reject(n)]
case 6:return[2]}})})},e.prototype.gets=function(e){return n(this,void 0,void 0,function(){var t,r,n,i,a,s
return o(this,function(o){switch(o.label){case 0:return o.trys.push([0,7,,8]),[4,this.getMeta(e)]
case 1:return(t=o.sent())?void 0===t.length||void 0===t.expire||void 0===t.now||void 0===t.count?[3,6]:this.expiredVaule(t.expire)?[4,this.remove(e)]:[3,3]:[2,Promise.resolve(null)]
case 2:return o.sent(),[2,Promise.resolve(null)]
case 3:return[4,this.valueCacheInstance.get(e)]
case 4:return r=o.sent(),[4,this.setMeta(e)]
case 5:return o.sent(),[2,Promise.resolve(r)]
case 6:return[2,Promise.resolve(t)]
case 7:return n=o.sent(),[2,Promise.reject(n)]
case 8:return[2]}})})},e.prototype.gets=function(e){return n(this,void 0,void 0,function(){var t,r,n,i,a,s
return o(this,function(o){switch(o.label){case 0:o.trys.push([0,5,,6]),t=[],r=0,n=e,o.label=1

@@ -495,0 +497,0 @@ case 1:return r<n.length?(a=(i=t).push,[4,this.get(n[r])]):[3,4]

@@ -20,4 +20,4 @@ var commonjsGlobal="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{}

function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.")
for(;a;)try{if(r=1,n&&(o=n[2&i[0]?"return":i[0]?"throw":"next"])&&!(o=o.call(n,i[1])).done)return o
switch(n=0,o&&(i=[0,o.value]),i[0]){case 0:case 1:o=i
for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o
switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i
break

@@ -289,3 +289,3 @@ case 4:return a.label++,{value:i[1],done:!1}

default:throw Error("Unkown type: "+type)}},stringToBuffer:Q,bufferToString:H}
function Z(e,t,r,n){e.executeSql("CREATE TABLE IF NOT EXISTS "+t.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],r,n)}function Y(e,t,r,n,o,i){e.executeSql(r,n,o,function(e,a){a.code===a.SYNTAX_ERR?e.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[name],function(e,s){s.rows.length?i(e,a):Z(e,t,function(){e.executeSql(r,n,o,i)},i)},i):i(e,a)},i)}var $={_driver:"webSQLStorage",_initStorage:function(e){var t=this,r={db:null}
function Z(e,t,r,n){e.executeSql("CREATE TABLE IF NOT EXISTS "+t.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],r,n)}function Y(e,t,r,n,o,i){e.executeSql(r,n,o,function(e,a){a.code===a.SYNTAX_ERR?e.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[t.storeName],function(e,s){s.rows.length?i(e,a):Z(e,t,function(){e.executeSql(r,n,o,i)},i)},i):i(e,a)},i)}var $={_driver:"webSQLStorage",_initStorage:function(e){var t=this,r={db:null}
if(e)for(var n in e)r[n]="string"!=typeof e[n]?""+e[n]:e[n]

@@ -400,4 +400,4 @@ var o=new a(function(e,n){try{r.db=openDatabase(r.name,r.version+"",r.description,r.size)}catch(e){return n(e)}r.db.transaction(function(o){Z(o,r,function(){t._dbInfo=r,e()},function(e,t){n(t)})},n)})

function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.")
for(;a;)try{if(r=1,n&&(o=n[2&i[0]?"return":i[0]?"throw":"next"])&&!(o=o.call(n,i[1])).done)return o
switch(n=0,o&&(i=[0,o.value]),i[0]){case 0:case 1:o=i
for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o
switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i
break

@@ -436,4 +436,4 @@ case 4:return a.label++,{value:i[1],done:!1}

function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.")
for(;a;)try{if(r=1,n&&(o=n[2&i[0]?"return":i[0]?"throw":"next"])&&!(o=o.call(n,i[1])).done)return o
switch(n=0,o&&(i=[0,o.value]),i[0]){case 0:case 1:o=i
for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o
switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i
break

@@ -484,9 +484,11 @@ case 4:return a.label++,{value:i[1],done:!1}

case 3:return[2]}})})},e.prototype.get=function(e){return n(this,void 0,void 0,function(){var t,r,n
return o(this,function(o){switch(o.label){case 0:return o.trys.push([0,5,,6]),[4,this.getMeta(e)]
case 1:return(t=o.sent())?void 0===t.length||void 0===t.expire||void 0===t.now||void 0===t.count?[3,4]:this.expiredVaule(t.expire)?(this.remove(e),[2,Promise.resolve(null)]):[4,this.valueCacheInstance.get(e)]:[2,Promise.resolve(null)]
case 2:return r=o.sent(),[4,this.setMeta(e)]
case 3:return o.sent(),[2,Promise.resolve(r)]
case 4:return[2,Promise.resolve(t)]
case 5:return n=o.sent(),[2,Promise.reject(n)]
case 6:return[2]}})})},e.prototype.gets=function(e){return n(this,void 0,void 0,function(){var t,r,n,i,a,s
return o(this,function(o){switch(o.label){case 0:return o.trys.push([0,7,,8]),[4,this.getMeta(e)]
case 1:return(t=o.sent())?void 0===t.length||void 0===t.expire||void 0===t.now||void 0===t.count?[3,6]:this.expiredVaule(t.expire)?[4,this.remove(e)]:[3,3]:[2,Promise.resolve(null)]
case 2:return o.sent(),[2,Promise.resolve(null)]
case 3:return[4,this.valueCacheInstance.get(e)]
case 4:return r=o.sent(),[4,this.setMeta(e)]
case 5:return o.sent(),[2,Promise.resolve(r)]
case 6:return[2,Promise.resolve(t)]
case 7:return n=o.sent(),[2,Promise.reject(n)]
case 8:return[2]}})})},e.prototype.gets=function(e){return n(this,void 0,void 0,function(){var t,r,n,i,a,s
return o(this,function(o){switch(o.label){case 0:o.trys.push([0,5,,6]),t=[],r=0,n=e,o.label=1

@@ -493,0 +495,0 @@ case 1:return r<n.length?(a=(i=t).push,[4,this.get(n[r])]):[3,4]

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(e.Mycache={})}(this,function(e){"use strict"
var t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{}
function n(){throw Error("Dynamic requires are not currently supported by rollup-plugin-commonjs")}function r(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function o(e,t){return e(t={exports:{}},t.exports),t.exports}var i=o(function(e,t){Object.defineProperty(t,"__esModule",{value:!0})
var n=Object.prototype.toString
function r(e){return null!=e&&"object"==typeof e&&!1===Array.isArray(e)}function o(e){return!0===r(e)&&"[object Object]"===Object.prototype.toString.call(e)}t.isDate=function(e){return"[object Date]"===n.call(e)},t.isNumber=function(e){return"[object Number]"===n.call(e)},t.isArray=Array.isArray,t.isPlainObject=function(e){if(!1===o(e))return!1
function r(){throw Error("Dynamic requires are not currently supported by rollup-plugin-commonjs")}function n(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function o(e,t){return e(t={exports:{}},t.exports),t.exports}var i=o(function(e,t){Object.defineProperty(t,"__esModule",{value:!0})
var r=Object.prototype.toString
function n(e){return null!=e&&"object"==typeof e&&!1===Array.isArray(e)}function o(e){return!0===n(e)&&"[object Object]"===Object.prototype.toString.call(e)}t.isDate=function(e){return"[object Date]"===r.call(e)},t.isNumber=function(e){return"[object Number]"===r.call(e)},t.isArray=Array.isArray,t.isPlainObject=function(e){if(!1===o(e))return!1
var t=e.constructor
if("function"!=typeof t)return!1
var n=t.prototype
return!1!==o(n)&&!1!==n.hasOwnProperty("isPrototypeOf")},t.extend=function(e,t){if(null===t||"object"!=typeof t)return e
for(var n=Object.keys(t),r=n.length;r--;)e[n[r]]=t[n[r]]
return e},t.omit=function(e,t){if(!r(e))return{}
var r=t.prototype
return!1!==o(r)&&!1!==r.hasOwnProperty("isPrototypeOf")},t.extend=function(e,t){if(null===t||"object"!=typeof t)return e
for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]]
return e},t.omit=function(e,t){if(!n(e))return{}
"string"==typeof t&&(t=[t])
for(var n={},o=0,i=Object.keys(e);o<i.length;o++){var a=i[o]
t&&-1!==t.indexOf(a)||(n[a]=e[a])}return n},t.utf16ByteLength=function(e){for(var t=0,n=0;n<e.length;n++)t+=e.charCodeAt(n)<=65535?2:4
for(var r={},o=0,i=Object.keys(e);o<i.length;o++){var a=i[o]
t&&-1!==t.indexOf(a)||(r[a]=e[a])}return r},t.utf16ByteLength=function(e){for(var t=0,r=0;r<e.length;r++)t+=e.charCodeAt(r)<=65535?2:4
return t}})
r(i)
var a=o(function(e,n){var r=t&&t.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{s(r.next(e))}catch(e){i(e)}}function c(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(a,c)}s((r=r.apply(e,t||[])).next())})},o=t&&t.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1]
n(i)
var a=o(function(e,r){var n=t&&t.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(o,i){function a(e){try{s(n.next(e))}catch(e){i(e)}}function c(e){try{s(n.throw(e))}catch(e){i(e)}}function s(e){e.done?o(e.value):new r(function(t){t(e.value)}).then(a,c)}s((n=n.apply(e,t||[])).next())})},o=t&&t.__generator||function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1]
return o[1]},trys:[],ops:[]}
return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i
function c(i){return function(c){return function(i){if(n)throw new TypeError("Generator is already executing.")
for(;a;)try{if(n=1,r&&(o=r[2&i[0]?"return":i[0]?"throw":"next"])&&!(o=o.call(r,i[1])).done)return o
switch(r=0,o&&(i=[0,o.value]),i[0]){case 0:case 1:o=i
function c(i){return function(c){return function(i){if(r)throw new TypeError("Generator is already executing.")
for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o
switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i
break
case 4:return a.label++,{value:i[1],done:!1}
case 5:a.label++,r=i[1],i=[0]
case 5:a.label++,n=i[1],i=[0]
continue

@@ -34,69 +34,69 @@ case 7:i=a.ops.pop(),a.trys.pop()

break}o[2]&&a.ops.pop(),a.trys.pop()
continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1]
continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1]
return{value:i[0]?i[1]:void 0,done:!0}}([i,c])}}}
Object.defineProperty(n,"__esModule",{value:!0})
var a=function(){function e(e){void 0===e&&(e={}),this.cacheConfig=i.extend(e,{name:"memcache"}),this.cacheInstance={}}return e.prototype.getExpiredKeys=function(){return r(this,void 0,void 0,function(){var e,t,n,r,i,a
Object.defineProperty(r,"__esModule",{value:!0})
var a=function(){function e(e){void 0===e&&(e={}),this.cacheConfig=i.extend(e,{name:"memcache"}),this.cacheInstance={}}return e.prototype.getExpiredKeys=function(){return n(this,void 0,void 0,function(){var e,t,r,n,i,a
return o(this,function(o){switch(o.label){case 0:return o.trys.push([0,6,,7]),e=[],[4,this.keys()]
case 1:t=o.sent(),n=0,r=t,o.label=2
case 2:return n<r.length?[4,this.isExpired(i=r[n])]:[3,5]
case 1:t=o.sent(),r=0,n=t,o.label=2
case 2:return r<n.length?[4,this.isExpired(i=n[r])]:[3,5]
case 3:o.sent()&&e.push(i),o.label=4
case 4:return n++,[3,2]
case 4:return r++,[3,2]
case 5:return[2,Promise.resolve(e)]
case 6:return a=o.sent(),[2,Promise.reject(a)]
case 7:return[2]}})})},e.prototype.isExpired=function(e){return r(this,void 0,void 0,function(){var t,n,r
return o(this,function(o){return t=this.getKey(e),n=this.cacheInstance[t],r=(new Date).getTime(),n&&n.expire&&n.expire>0&&n.expire<r?[2,Promise.resolve(!0)]:[2,Promise.resolve(!1)]})})},e.prototype.get=function(e){return r(this,void 0,void 0,function(){var t,n,r
return o(this,function(o){switch(o.label){case 0:return t=this.getKey(e),n=this.cacheInstance[t],[4,this.isExpired(e)]
case 1:return r=o.sent(),n&&n.value?r?(this.remove(t),[2,Promise.resolve(null)]):n.value?[2,Promise.resolve(n.value)]:[2]:[2,Promise.resolve(null)]}})})},e.prototype.gets=function(e){return r(this,void 0,void 0,function(){var t,n,r,i,a
return o(this,function(o){switch(o.label){case 0:t=[],n=0,r=e,o.label=1
case 1:return n<r.length?(a=(i=t).push,[4,this.get(r[n])]):[3,4]
case 7:return[2]}})})},e.prototype.isExpired=function(e){return n(this,void 0,void 0,function(){var t,r,n
return o(this,function(o){return t=this.getKey(e),r=this.cacheInstance[t],n=(new Date).getTime(),r&&r.expire&&r.expire>0&&r.expire<n?[2,Promise.resolve(!0)]:[2,Promise.resolve(!1)]})})},e.prototype.get=function(e){return n(this,void 0,void 0,function(){var t,r,n
return o(this,function(o){switch(o.label){case 0:return t=this.getKey(e),r=this.cacheInstance[t],[4,this.isExpired(e)]
case 1:return n=o.sent(),r&&r.value?n?(this.remove(t),[2,Promise.resolve(null)]):r.value?[2,Promise.resolve(r.value)]:[2]:[2,Promise.resolve(null)]}})})},e.prototype.gets=function(e){return n(this,void 0,void 0,function(){var t,r,n,i,a
return o(this,function(o){switch(o.label){case 0:t=[],r=0,n=e,o.label=1
case 1:return r<n.length?(a=(i=t).push,[4,this.get(n[r])]):[3,4]
case 2:a.call(i,o.sent()),o.label=3
case 3:return n++,[3,1]
case 4:return[2,Promise.resolve(t)]}})})},e.prototype.set=function(e,t,n){void 0===n&&(n=-1)
var r=this.getKey(e)
return i.isDate(n)?n=n.getTime():i.isNumber(n)&&n>0&&(n=(new Date).getTime()+1e3*n),this.cacheInstance[r]={value:t,expire:n},Promise.resolve(t)},e.prototype.append=function(e,t,n){void 0===n&&(n=-1)
var r=this.cacheInstance[this.getKey(e)]
return r?(i.isArray(t)&&i.isArray(r.value)?t=r.value.concat(t):i.isPlainObject(t)&&i.isPlainObject(r.value)&&(t=i.extend(r.value,t)),this.set(e,t,n=n||r.expire)):this.set(e,t,n)},e.prototype.has=function(e){return this.get(e)?Promise.resolve(!0):Promise.resolve(!1)},e.prototype.remove=function(e){var t=this.getKey(e)
return this.cacheInstance[t]&&(this.cacheInstance[t]=null,this.cacheInstance=i.omit(this.cacheInstance,t)),Promise.resolve()},e.prototype.keys=function(){for(var e=[],t=0,n=Object.keys(this.cacheInstance);t<n.length;t++){e.push(n[t].replace(this.cacheConfig.name+"/",""))}return Promise.resolve(e)},e.prototype.clear=function(){return this.cacheInstance={},Promise.resolve()},e.prototype.length=function(){var e=Object.keys(this.cacheInstance)
return e.length?Promise.resolve(e.length):Promise.resolve(0)},e.prototype.each=function(e){return r(this,void 0,void 0,function(){var t,n,r,i
return o(this,function(o){switch(o.label){case 0:t=Object.keys(this.cacheInstance),n=0,o.label=1
case 1:return n<t.length?(r=t[n].replace(this.cacheConfig.name+"/",""),[4,this.get(r)]):[3,4]
case 2:i=o.sent(),e&&e(i,r,n),o.label=3
case 3:return n++,[3,1]
case 3:return r++,[3,1]
case 4:return[2,Promise.resolve(t)]}})})},e.prototype.set=function(e,t,r){void 0===r&&(r=-1)
var n=this.getKey(e)
return i.isDate(r)?r=r.getTime():i.isNumber(r)&&r>0&&(r=(new Date).getTime()+1e3*r),this.cacheInstance[n]={value:t,expire:r},Promise.resolve(t)},e.prototype.append=function(e,t,r){void 0===r&&(r=-1)
var n=this.cacheInstance[this.getKey(e)]
return n?(i.isArray(t)&&i.isArray(n.value)?t=n.value.concat(t):i.isPlainObject(t)&&i.isPlainObject(n.value)&&(t=i.extend(n.value,t)),this.set(e,t,r=r||n.expire)):this.set(e,t,r)},e.prototype.has=function(e){return this.get(e)?Promise.resolve(!0):Promise.resolve(!1)},e.prototype.remove=function(e){var t=this.getKey(e)
return this.cacheInstance[t]&&(this.cacheInstance[t]=null,this.cacheInstance=i.omit(this.cacheInstance,t)),Promise.resolve()},e.prototype.keys=function(){for(var e=[],t=0,r=Object.keys(this.cacheInstance);t<r.length;t++){e.push(r[t].replace(this.cacheConfig.name+"/",""))}return Promise.resolve(e)},e.prototype.clear=function(){return this.cacheInstance={},Promise.resolve()},e.prototype.length=function(){var e=Object.keys(this.cacheInstance)
return e.length?Promise.resolve(e.length):Promise.resolve(0)},e.prototype.each=function(e){return n(this,void 0,void 0,function(){var t,r,n,i
return o(this,function(o){switch(o.label){case 0:t=Object.keys(this.cacheInstance),r=0,o.label=1
case 1:return r<t.length?(n=t[r].replace(this.cacheConfig.name+"/",""),[4,this.get(n)]):[3,4]
case 2:i=o.sent(),e&&e(i,n,r),o.label=3
case 3:return r++,[3,1]
case 4:return[2,Promise.resolve(!0)]}})})},e.prototype.getKey=function(e){return this.cacheConfig.name+"/"+e},e}()
n.default=a})
r(a)
r.default=a})
n(a)
var c=o(function(e,t){Object.defineProperty(t,"__esModule",{value:!0})
var n=String.fromCharCode,r=function(e){return{v:e,d:{}}},o=function(e){return n(e+32)},i=function(e,t,n){if(null==e)return[]
var o,i=0,a=0,c=0,s={},u=!0,f=0,l=r(3),h=1,d=4,v=2,p=[],y=0,m=0
if(e.length){for(c=(f=e.charCodeAt(0))<256?0:1,i=0;i<v;i++)y=c>>i|y<<1,++m===t&&(m=0,p.push(n(y)),y=0)
for(c=8+8*c,i=0;i<c;i++)y=f>>i&1|y<<1,++m===t&&(m=0,p.push(n(y)),y=0)
var r=String.fromCharCode,n=function(e){return{v:e,d:{}}},o=function(e){return r(e+32)},i=function(e,t,r){if(null==e)return[]
var o,i=0,a=0,c=0,s={},u=!0,f=0,l=n(3),h=1,d=4,v=2,p=[],y=0,m=0
if(e.length){for(c=(f=e.charCodeAt(0))<256?0:1,i=0;i<v;i++)y=c>>i|y<<1,++m===t&&(m=0,p.push(r(y)),y=0)
for(c=8+8*c,i=0;i<c;i++)y=f>>i&1|y<<1,++m===t&&(m=0,p.push(r(y)),y=0)
for(s[f]=l,a=1;a<e.length;a++)if(f=e.charCodeAt(a),o=l.d[f])l=o
else{if(u)u=!1
else for(c=l.v,i=0;i<v;i++)y=c>>i&1|y<<1,++m===t&&(m=0,p.push(n(y)),y=0)
if(void 0===s[f]){for(0==--h&&(h=1<<v++),c=f<256?0:1,i=0;i<v;i++)y=c>>i|y<<1,++m===t&&(m=0,p.push(n(y)),y=0)
for(c=8+8*c,i=0;i<c;i++)y=f>>i&1|y<<1,++m===t&&(m=0,p.push(n(y)),y=0)
s[f]=r(d++),u=!0}l.d[f]=r(d++),0==--h&&(h=1<<v++),l=s[f]}if(u)u=!1
else for(c=l.v,i=0;i<v;i++)y=c>>i&1|y<<1,++m===t&&(m=0,p.push(n(y)),y=0)
if(void 0===s[f]){for(0==--h&&(h=1<<v++),c=f<256?0:1,i=0;i<v;i++)y=c>>i|y<<1,++m===t&&(m=0,p.push(n(y)),y=0)
for(c=8+8*c,i=0;i<c;i++)y=f>>i&1|y<<1,++m===t&&(m=0,p.push(n(y)),y=0)}0==--h&&(h=1<<v++)}for(i=0;i<v;i++)y=2>>i&1|y<<1,++m===t&&(m=0,p.push(n(y)),y=0)
return p.push(n(y<<=t-m)),p},a=function(e,t,r){for(var o=["","",""],i=4,a=4,c=3,s="",u=[],f=0,l=2,h=0,d="",v=r(0),p=t,y=1;h!==l;)f+=(v>>--p&1)<<h++,0===p&&(p=t,v=r(y++))
else for(c=l.v,i=0;i<v;i++)y=c>>i&1|y<<1,++m===t&&(m=0,p.push(r(y)),y=0)
if(void 0===s[f]){for(0==--h&&(h=1<<v++),c=f<256?0:1,i=0;i<v;i++)y=c>>i|y<<1,++m===t&&(m=0,p.push(r(y)),y=0)
for(c=8+8*c,i=0;i<c;i++)y=f>>i&1|y<<1,++m===t&&(m=0,p.push(r(y)),y=0)
s[f]=n(d++),u=!0}l.d[f]=n(d++),0==--h&&(h=1<<v++),l=s[f]}if(u)u=!1
else for(c=l.v,i=0;i<v;i++)y=c>>i&1|y<<1,++m===t&&(m=0,p.push(r(y)),y=0)
if(void 0===s[f]){for(0==--h&&(h=1<<v++),c=f<256?0:1,i=0;i<v;i++)y=c>>i|y<<1,++m===t&&(m=0,p.push(r(y)),y=0)
for(c=8+8*c,i=0;i<c;i++)y=f>>i&1|y<<1,++m===t&&(m=0,p.push(r(y)),y=0)}0==--h&&(h=1<<v++)}for(i=0;i<v;i++)y=2>>i&1|y<<1,++m===t&&(m=0,p.push(r(y)),y=0)
return p.push(r(y<<=t-m)),p},a=function(e,t,n){for(var o=["","",""],i=4,a=4,c=3,s="",u=[],f=0,l=2,h=0,d="",v=n(0),p=t,y=1;h!==l;)f+=(v>>--p&1)<<h++,0===p&&(p=t,v=n(y++))
if(2===f)return""
for(l=8*f+8,f=h=0;h!==l;)f+=(v>>--p&1)<<h++,0===p&&(p=t,v=r(y++))
for(d=n(f),o[3]=d,u.push(d);y<=e;){for(l=c,f=h=0;h!==l;)f+=(v>>--p&1)<<h++,0===p&&(p=t,v=r(y++))
if(f<2){for(l=8+8*f,f=h=0;h!==l;)f+=(v>>--p&1)<<h++,0===p&&(p=t,v=r(y++))
o[a]=n(f),f=a++,0==--i&&(i=1<<c++)}else if(2===f)return u.join("")
for(l=8*f+8,f=h=0;h!==l;)f+=(v>>--p&1)<<h++,0===p&&(p=t,v=n(y++))
for(d=r(f),o[3]=d,u.push(d);y<=e;){for(l=c,f=h=0;h!==l;)f+=(v>>--p&1)<<h++,0===p&&(p=t,v=n(y++))
if(f<2){for(l=8+8*f,f=h=0;h!==l;)f+=(v>>--p&1)<<h++,0===p&&(p=t,v=n(y++))
o[a]=r(f),f=a++,0==--i&&(i=1<<c++)}else if(2===f)return u.join("")
if(f>o.length)return null
s=f<o.length?o[f]:d+d.charAt(0),u.push(s),o[a++]=d+s.charAt(0),d=s,0==--i&&(i=1<<c++)}return""},c=function(e){return i(e,16,function(e){return n(e)})}
s=f<o.length?o[f]:d+d.charAt(0),u.push(s),o[a++]=d+s.charAt(0),d=s,0==--i&&(i=1<<c++)}return""},c=function(e){return i(e,16,function(e){return r(e)})}
t.default={compressToUTF16:function(e){if(null==e)return""
var t=i(e,15,o)
return t.push(" "),t.join("")},decompressFromUTF16:function(e){return null===e?"":""===e?null:a(e.length,15,function(t){return e.charCodeAt(t)-32})},compress:function(e){return c(e).join("")},compressToArray:c,decompress:function(e){return null===e?"":""===e?null:a(e.length,16,function(t){return e.charCodeAt(t)})},decompressFromArray:function(e){return null===e?"":0===e.length?null:a(e.length,16,function(t){return e[t].charCodeAt(0)})}}})
r(c)
var s=o(function(e,r){e.exports=function e(t,r,o){function i(c,s){if(!r[c]){if(!t[c]){var u=n
n(c)
var s=o(function(e,n){e.exports=function e(t,n,o){function i(c,s){if(!n[c]){if(!t[c]){var u=r
if(!s&&u)return u(c,!0)
if(a)return a(c,!0)
var f=Error("Cannot find module '"+c+"'")
throw f.code="MODULE_NOT_FOUND",f}var l=r[c]={exports:{}}
t[c][0].call(l.exports,function(e){var n=t[c][1][e]
return i(n||e)},l,l.exports,e,t,r,o)}return r[c].exports}for(var a=n,c=0;c<o.length;c++)i(o[c])
return i}({1:[function(e,n,r){!function(e){var t,r,o=e.MutationObserver||e.WebKitMutationObserver
throw f.code="MODULE_NOT_FOUND",f}var l=n[c]={exports:{}}
t[c][0].call(l.exports,function(e){var r=t[c][1][e]
return i(r||e)},l,l.exports,e,t,n,o)}return n[c].exports}for(var a=r,c=0;c<o.length;c++)i(o[c])
return i}({1:[function(e,r,n){!function(e){var t,n,o=e.MutationObserver||e.WebKitMutationObserver
if(o){var i=0,a=new o(f),c=e.document.createTextNode("")

@@ -108,37 +108,37 @@ a.observe(c,{characterData:!0}),t=function(){c.data=i=++i%2}}else if(e.setImmediate||void 0===e.MessageChannel)t="document"in e&&"onreadystatechange"in e.document.createElement("script")?function(){var t=e.document.createElement("script")

function f(){var e,t
r=!0
for(var n=u.length;n;){for(t=u,u=[],e=-1;++e<n;)t[e]()
n=u.length}r=!1}n.exports=function(e){1!==u.push(e)||r||t()}}(void 0!==t?t:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],2:[function(e,t,n){var r=e(1)
n=!0
for(var r=u.length;r;){for(t=u,u=[],e=-1;++e<r;)t[e]()
r=u.length}n=!1}r.exports=function(e){1!==u.push(e)||n||t()}}(void 0!==t?t:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],2:[function(e,t,r){var n=e(1)
function o(){}var i={},a=["REJECTED"],c=["FULFILLED"],s=["PENDING"]
function u(e){if("function"!=typeof e)throw new TypeError("resolver must be a function")
this.state=s,this.queue=[],this.outcome=void 0,e!==o&&d(this,e)}function f(e,t,n){this.promise=e,"function"==typeof t&&(this.onFulfilled=t,this.callFulfilled=this.otherCallFulfilled),"function"==typeof n&&(this.onRejected=n,this.callRejected=this.otherCallRejected)}function l(e,t,n){r(function(){var r
try{r=t(n)}catch(t){return i.reject(e,t)}r===e?i.reject(e,new TypeError("Cannot resolve promise with itself")):i.resolve(e,r)})}function h(e){var t=e&&e.then
if(e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof t)return function(){t.apply(e,arguments)}}function d(e,t){var n=!1
function r(t){n||(n=!0,i.reject(e,t))}function o(t){n||(n=!0,i.resolve(e,t))}var a=v(function(){t(o,r)})
"error"===a.status&&r(a.value)}function v(e,t){var n={}
try{n.value=e(t),n.status="success"}catch(e){n.status="error",n.value=e}return n}t.exports=u,u.prototype.catch=function(e){return this.then(null,e)},u.prototype.then=function(e,t){if("function"!=typeof e&&this.state===c||"function"!=typeof t&&this.state===a)return this
var n=new this.constructor(o)
if(this.state!==s){var r=this.state===c?e:t
l(n,r,this.outcome)}else this.queue.push(new f(n,e,t))
return n},f.prototype.callFulfilled=function(e){i.resolve(this.promise,e)},f.prototype.otherCallFulfilled=function(e){l(this.promise,this.onFulfilled,e)},f.prototype.callRejected=function(e){i.reject(this.promise,e)},f.prototype.otherCallRejected=function(e){l(this.promise,this.onRejected,e)},i.resolve=function(e,t){var n=v(h,t)
if("error"===n.status)return i.reject(e,n.value)
var r=n.value
if(r)d(e,r)
this.state=s,this.queue=[],this.outcome=void 0,e!==o&&d(this,e)}function f(e,t,r){this.promise=e,"function"==typeof t&&(this.onFulfilled=t,this.callFulfilled=this.otherCallFulfilled),"function"==typeof r&&(this.onRejected=r,this.callRejected=this.otherCallRejected)}function l(e,t,r){n(function(){var n
try{n=t(r)}catch(t){return i.reject(e,t)}n===e?i.reject(e,new TypeError("Cannot resolve promise with itself")):i.resolve(e,n)})}function h(e){var t=e&&e.then
if(e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof t)return function(){t.apply(e,arguments)}}function d(e,t){var r=!1
function n(t){r||(r=!0,i.reject(e,t))}function o(t){r||(r=!0,i.resolve(e,t))}var a=v(function(){t(o,n)})
"error"===a.status&&n(a.value)}function v(e,t){var r={}
try{r.value=e(t),r.status="success"}catch(e){r.status="error",r.value=e}return r}t.exports=u,u.prototype.catch=function(e){return this.then(null,e)},u.prototype.then=function(e,t){if("function"!=typeof e&&this.state===c||"function"!=typeof t&&this.state===a)return this
var r=new this.constructor(o)
if(this.state!==s){var n=this.state===c?e:t
l(r,n,this.outcome)}else this.queue.push(new f(r,e,t))
return r},f.prototype.callFulfilled=function(e){i.resolve(this.promise,e)},f.prototype.otherCallFulfilled=function(e){l(this.promise,this.onFulfilled,e)},f.prototype.callRejected=function(e){i.reject(this.promise,e)},f.prototype.otherCallRejected=function(e){l(this.promise,this.onRejected,e)},i.resolve=function(e,t){var r=v(h,t)
if("error"===r.status)return i.reject(e,r.value)
var n=r.value
if(n)d(e,n)
else{e.state=c,e.outcome=t
for(var o=-1,a=e.queue.length;++o<a;)e.queue[o].callFulfilled(t)}return e},i.reject=function(e,t){e.state=a,e.outcome=t
for(var n=-1,r=e.queue.length;++n<r;)e.queue[n].callRejected(t)
for(var r=-1,n=e.queue.length;++r<n;)e.queue[r].callRejected(t)
return e},u.resolve=function(e){return e instanceof this?e:i.resolve(new this(o),e)},u.reject=function(e){var t=new this(o)
return i.reject(t,e)},u.all=function(e){var t=this
if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"))
var n=e.length,r=!1
if(!n)return this.resolve([])
for(var a=Array(n),c=0,s=-1,u=new this(o);++s<n;)f(e[s],s)
var r=e.length,n=!1
if(!r)return this.resolve([])
for(var a=Array(r),c=0,s=-1,u=new this(o);++s<r;)f(e[s],s)
return u
function f(e,o){t.resolve(e).then(function(e){a[o]=e,++c!==n||r||(r=!0,i.resolve(u,a))},function(e){r||(r=!0,i.reject(u,e))})}},u.race=function(e){var t=this
function f(e,o){t.resolve(e).then(function(e){a[o]=e,++c!==r||n||(n=!0,i.resolve(u,a))},function(e){n||(n=!0,i.reject(u,e))})}},u.race=function(e){var t=this
if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"))
var n=e.length,r=!1
if(!n)return this.resolve([])
for(var a=-1,c=new this(o);++a<n;)t.resolve(e[a]).then(function(e){r||(r=!0,i.resolve(c,e))},function(e){r||(r=!0,i.reject(c,e))})
return c}},{1:1}],3:[function(e,n,r){var o
"function"!=typeof(o=void 0!==t?t:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{}).Promise&&(o.Promise=e(2))},{2:2}],4:[function(e,t,n){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},o=function(){try{if("undefined"!=typeof indexedDB)return indexedDB
var r=e.length,n=!1
if(!r)return this.resolve([])
for(var a=-1,c=new this(o);++a<r;)t.resolve(e[a]).then(function(e){n||(n=!0,i.resolve(c,e))},function(e){n||(n=!0,i.reject(c,e))})
return c}},{1:1}],3:[function(e,r,n){var o
"function"!=typeof(o=void 0!==t?t:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{}).Promise&&(o.Promise=e(2))},{2:2}],4:[function(e,t,r){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},o=function(){try{if("undefined"!=typeof indexedDB)return indexedDB
if("undefined"!=typeof webkitIndexedDB)return webkitIndexedDB

@@ -150,131 +150,131 @@ if("undefined"!=typeof mozIndexedDB)return mozIndexedDB

try{return new Blob(e,t)}catch(i){if("TypeError"!==i.name)throw i
for(var n="undefined"!=typeof BlobBuilder?BlobBuilder:"undefined"!=typeof MSBlobBuilder?MSBlobBuilder:"undefined"!=typeof MozBlobBuilder?MozBlobBuilder:WebKitBlobBuilder,r=new n,o=0;o<e.length;o+=1)r.append(e[o])
return r.getBlob(t.type)}}"undefined"==typeof Promise&&e(3)
for(var r="undefined"!=typeof BlobBuilder?BlobBuilder:"undefined"!=typeof MSBlobBuilder?MSBlobBuilder:"undefined"!=typeof MozBlobBuilder?MozBlobBuilder:WebKitBlobBuilder,n=new r,o=0;o<e.length;o+=1)n.append(e[o])
return n.getBlob(t.type)}}"undefined"==typeof Promise&&e(3)
var a=Promise
function c(e,t){t&&e.then(function(e){t(null,e)},function(e){t(e)})}function s(e,t,n){"function"==typeof t&&e.then(t),"function"==typeof n&&e.catch(n)}function u(e){return"string"!=typeof e&&(console.warn(e+" used as a key, but it is not a string."),e+=""),e}function f(){if(arguments.length&&"function"==typeof arguments[arguments.length-1])return arguments[arguments.length-1]}var l="local-forage-detect-blob-support",h=void 0,d={},v=Object.prototype.toString,p="readonly",y="readwrite"
function m(e){return"boolean"==typeof h?a.resolve(h):function(e){return new a(function(t){var n=e.transaction(l,y),r=i([""])
n.objectStore(l).put(r,"key"),n.onabort=function(e){e.preventDefault(),e.stopPropagation(),t(!1)},n.oncomplete=function(){var e=navigator.userAgent.match(/Chrome\/(\d+)/),n=navigator.userAgent.match(/Edge\//)
t(n||!e||parseInt(e[1],10)>=43)}}).catch(function(){return!1})}(e).then(function(e){return h=e})}function b(e){var t=d[e.name],n={}
n.promise=new a(function(e,t){n.resolve=e,n.reject=t}),t.deferredOperations.push(n),t.dbReady=t.dbReady?t.dbReady.then(function(){return n.promise}):n.promise}function g(e){var t=d[e.name],n=t.deferredOperations.pop()
if(n)return n.resolve(),n.promise}function _(e,t){var n=d[e.name],r=n.deferredOperations.pop()
if(r)return r.reject(t),r.promise}function w(e,t){return new a(function(n,r){if(d[e.name]=d[e.name]||{forages:[],db:null,dbReady:null,deferredOperations:[]},e.db){if(!t)return n(e.db)
function c(e,t){t&&e.then(function(e){t(null,e)},function(e){t(e)})}function s(e,t,r){"function"==typeof t&&e.then(t),"function"==typeof r&&e.catch(r)}function u(e){return"string"!=typeof e&&(console.warn(e+" used as a key, but it is not a string."),e+=""),e}function f(){if(arguments.length&&"function"==typeof arguments[arguments.length-1])return arguments[arguments.length-1]}var l="local-forage-detect-blob-support",h=void 0,d={},v=Object.prototype.toString,p="readonly",y="readwrite"
function m(e){return"boolean"==typeof h?a.resolve(h):function(e){return new a(function(t){var r=e.transaction(l,y),n=i([""])
r.objectStore(l).put(n,"key"),r.onabort=function(e){e.preventDefault(),e.stopPropagation(),t(!1)},r.oncomplete=function(){var e=navigator.userAgent.match(/Chrome\/(\d+)/),r=navigator.userAgent.match(/Edge\//)
t(r||!e||parseInt(e[1],10)>=43)}}).catch(function(){return!1})}(e).then(function(e){return h=e})}function b(e){var t=d[e.name],r={}
r.promise=new a(function(e,t){r.resolve=e,r.reject=t}),t.deferredOperations.push(r),t.dbReady=t.dbReady?t.dbReady.then(function(){return r.promise}):r.promise}function g(e){var t=d[e.name],r=t.deferredOperations.pop()
if(r)return r.resolve(),r.promise}function _(e,t){var r=d[e.name],n=r.deferredOperations.pop()
if(n)return n.reject(t),n.promise}function w(e,t){return new a(function(r,n){if(d[e.name]=d[e.name]||{forages:[],db:null,dbReady:null,deferredOperations:[]},e.db){if(!t)return r(e.db)
b(e),e.db.close()}var i=[e.name]
t&&i.push(e.version)
var a=o.open.apply(o,i)
t&&(a.onupgradeneeded=function(t){var n=a.result
try{n.createObjectStore(e.storeName),t.oldVersion<=1&&n.createObjectStore(l)}catch(n){if("ConstraintError"!==n.name)throw n
console.warn('The database "'+e.name+'" has been upgraded from version '+t.oldVersion+" to version "+t.newVersion+', but the storage "'+e.storeName+'" already exists.')}}),a.onerror=function(e){e.preventDefault(),r(a.error)},a.onsuccess=function(){n(a.result),g(e)}})}function I(e){return w(e,!1)}function j(e){return w(e,!0)}function S(e,t){if(!e.db)return!0
var n=!e.db.objectStoreNames.contains(e.storeName),r=e.version<e.db.version,o=e.version>e.db.version
if(r&&(e.version!==t&&console.warn('The database "'+e.name+"\" can't be downgraded from version "+e.db.version+" to version "+e.version+"."),e.version=e.db.version),o||n){if(n){var i=e.db.version+1
i>e.version&&(e.version=i)}return!0}return!1}function P(e){var t=function(e){for(var t=e.length,n=new ArrayBuffer(t),r=new Uint8Array(n),o=0;o<t;o++)r[o]=e.charCodeAt(o)
return n}(atob(e.data))
return i([t],{type:e.type})}function x(e){return e&&e.__local_forage_encoded_blob}function E(e){var t=this,n=t._initReady().then(function(){var e=d[t._dbInfo.name]
t&&(a.onupgradeneeded=function(t){var r=a.result
try{r.createObjectStore(e.storeName),t.oldVersion<=1&&r.createObjectStore(l)}catch(r){if("ConstraintError"!==r.name)throw r
console.warn('The database "'+e.name+'" has been upgraded from version '+t.oldVersion+" to version "+t.newVersion+', but the storage "'+e.storeName+'" already exists.')}}),a.onerror=function(e){e.preventDefault(),n(a.error)},a.onsuccess=function(){r(a.result),g(e)}})}function I(e){return w(e,!1)}function j(e){return w(e,!0)}function S(e,t){if(!e.db)return!0
var r=!e.db.objectStoreNames.contains(e.storeName),n=e.version<e.db.version,o=e.version>e.db.version
if(n&&(e.version!==t&&console.warn('The database "'+e.name+"\" can't be downgraded from version "+e.db.version+" to version "+e.version+"."),e.version=e.db.version),o||r){if(r){var i=e.db.version+1
i>e.version&&(e.version=i)}return!0}return!1}function P(e){var t=function(e){for(var t=e.length,r=new ArrayBuffer(t),n=new Uint8Array(r),o=0;o<t;o++)n[o]=e.charCodeAt(o)
return r}(atob(e.data))
return i([t],{type:e.type})}function x(e){return e&&e.__local_forage_encoded_blob}function E(e){var t=this,r=t._initReady().then(function(){var e=d[t._dbInfo.name]
if(e&&e.dbReady)return e.dbReady})
return s(n,e,e),n}function O(e,t,n,r){void 0===r&&(r=1)
return s(r,e,e),r}function O(e,t,r,n){void 0===n&&(n=1)
try{var o=e.db.transaction(e.storeName,t)
n(null,o)}catch(o){if(r>0&&(!e.db||"InvalidStateError"===o.name||"NotFoundError"===o.name))return a.resolve().then(function(){if(!e.db||"NotFoundError"===o.name&&!e.db.objectStoreNames.contains(e.storeName)&&e.version<=e.db.version)return e.db&&(e.version=e.db.version+1),j(e)}).then(function(){return function(e){b(e)
for(var t=d[e.name],n=t.forages,r=0;r<n.length;r++){var o=n[r]
o._dbInfo.db&&(o._dbInfo.db.close(),o._dbInfo.db=null)}return e.db=null,I(e).then(function(t){return e.db=t,S(e)?j(e):t}).then(function(r){e.db=t.db=r
for(var o=0;o<n.length;o++)n[o]._dbInfo.db=r}).catch(function(t){throw _(e,t),t})}(e).then(function(){O(e,t,n,r-1)})}).catch(n)
n(o)}}var C={_driver:"asyncStorage",_initStorage:function(e){var t=this,n={db:null}
if(e)for(var r in e)n[r]=e[r]
var o=d[n.name]
o||(d[n.name]=o={forages:[],db:null,dbReady:null,deferredOperations:[]}),o.forages.push(t),t._initReady||(t._initReady=t.ready,t.ready=E)
r(null,o)}catch(o){if(n>0&&(!e.db||"InvalidStateError"===o.name||"NotFoundError"===o.name))return a.resolve().then(function(){if(!e.db||"NotFoundError"===o.name&&!e.db.objectStoreNames.contains(e.storeName)&&e.version<=e.db.version)return e.db&&(e.version=e.db.version+1),j(e)}).then(function(){return function(e){b(e)
for(var t=d[e.name],r=t.forages,n=0;n<r.length;n++){var o=r[n]
o._dbInfo.db&&(o._dbInfo.db.close(),o._dbInfo.db=null)}return e.db=null,I(e).then(function(t){return e.db=t,S(e)?j(e):t}).then(function(n){e.db=t.db=n
for(var o=0;o<r.length;o++)r[o]._dbInfo.db=n}).catch(function(t){throw _(e,t),t})}(e).then(function(){O(e,t,r,n-1)})}).catch(r)
r(o)}}var C={_driver:"asyncStorage",_initStorage:function(e){var t=this,r={db:null}
if(e)for(var n in e)r[n]=e[n]
var o=d[r.name]
o||(d[r.name]=o={forages:[],db:null,dbReady:null,deferredOperations:[]}),o.forages.push(t),t._initReady||(t._initReady=t.ready,t.ready=E)
var i=[]
function c(){return a.resolve()}for(var s=0;s<o.forages.length;s++){var u=o.forages[s]
u!==t&&i.push(u._initReady().catch(c))}var f=o.forages.slice(0)
return a.all(i).then(function(){return n.db=o.db,I(n)}).then(function(e){return n.db=e,S(n,t._defaultConfig.version)?j(n):e}).then(function(e){n.db=o.db=e,t._dbInfo=n
for(var r=0;r<f.length;r++){var i=f[r]
i!==t&&(i._dbInfo.db=n.db,i._dbInfo.version=n.version)}})},_support:function(){try{if(!o)return!1
return a.all(i).then(function(){return r.db=o.db,I(r)}).then(function(e){return r.db=e,S(r,t._defaultConfig.version)?j(r):e}).then(function(e){r.db=o.db=e,t._dbInfo=r
for(var n=0;n<f.length;n++){var i=f[n]
i!==t&&(i._dbInfo.db=r.db,i._dbInfo.version=r.version)}})},_support:function(){try{if(!o)return!1
var e="undefined"!=typeof openDatabase&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),t="function"==typeof fetch&&-1!==(""+fetch).indexOf("[native code")
return(!e||t)&&"undefined"!=typeof indexedDB&&"undefined"!=typeof IDBKeyRange}catch(e){return!1}}(),iterate:function(e,t){var n=this,r=new a(function(t,r){n.ready().then(function(){O(n._dbInfo,p,function(o,i){if(o)return r(o)
try{var a=i.objectStore(n._dbInfo.storeName),c=a.openCursor(),s=1
c.onsuccess=function(){var n=c.result
if(n){var r=n.value
x(r)&&(r=P(r))
var o=e(r,n.key,s++)
void 0!==o?t(o):n.continue()}else t()},c.onerror=function(){r(c.error)}}catch(e){r(e)}})}).catch(r)})
return c(r,t),r},getItem:function(e,t){var n=this
return(!e||t)&&"undefined"!=typeof indexedDB&&"undefined"!=typeof IDBKeyRange}catch(e){return!1}}(),iterate:function(e,t){var r=this,n=new a(function(t,n){r.ready().then(function(){O(r._dbInfo,p,function(o,i){if(o)return n(o)
try{var a=i.objectStore(r._dbInfo.storeName),c=a.openCursor(),s=1
c.onsuccess=function(){var r=c.result
if(r){var n=r.value
x(n)&&(n=P(n))
var o=e(n,r.key,s++)
void 0!==o?t(o):r.continue()}else t()},c.onerror=function(){n(c.error)}}catch(e){n(e)}})}).catch(n)})
return c(n,t),n},getItem:function(e,t){var r=this
e=u(e)
var r=new a(function(t,r){n.ready().then(function(){O(n._dbInfo,p,function(o,i){if(o)return r(o)
try{var a=i.objectStore(n._dbInfo.storeName),c=a.get(e)
var n=new a(function(t,n){r.ready().then(function(){O(r._dbInfo,p,function(o,i){if(o)return n(o)
try{var a=i.objectStore(r._dbInfo.storeName),c=a.get(e)
c.onsuccess=function(){var e=c.result
void 0===e&&(e=null),x(e)&&(e=P(e)),t(e)},c.onerror=function(){r(c.error)}}catch(e){r(e)}})}).catch(r)})
return c(r,t),r},setItem:function(e,t,n){var r=this
void 0===e&&(e=null),x(e)&&(e=P(e)),t(e)},c.onerror=function(){n(c.error)}}catch(e){n(e)}})}).catch(n)})
return c(n,t),n},setItem:function(e,t,r){var n=this
e=u(e)
var o=new a(function(n,o){var i
r.ready().then(function(){return i=r._dbInfo,"[object Blob]"===v.call(t)?m(i.db).then(function(e){return e?t:(n=t,new a(function(e,t){var r=new FileReader
r.onerror=t,r.onloadend=function(t){var r=btoa(t.target.result||"")
e({__local_forage_encoded_blob:!0,data:r,type:n.type})},r.readAsBinaryString(n)}))
var n}):t}).then(function(t){O(r._dbInfo,y,function(i,a){if(i)return o(i)
try{var c=a.objectStore(r._dbInfo.storeName)
var o=new a(function(r,o){var i
n.ready().then(function(){return i=n._dbInfo,"[object Blob]"===v.call(t)?m(i.db).then(function(e){return e?t:(r=t,new a(function(e,t){var n=new FileReader
n.onerror=t,n.onloadend=function(t){var n=btoa(t.target.result||"")
e({__local_forage_encoded_blob:!0,data:n,type:r.type})},n.readAsBinaryString(r)}))
var r}):t}).then(function(t){O(n._dbInfo,y,function(i,a){if(i)return o(i)
try{var c=a.objectStore(n._dbInfo.storeName)
null===t&&(t=void 0)
var s=c.put(t,e)
a.oncomplete=function(){void 0===t&&(t=null),n(t)},a.onabort=a.onerror=function(){var e=s.error?s.error:s.transaction.error
a.oncomplete=function(){void 0===t&&(t=null),r(t)},a.onabort=a.onerror=function(){var e=s.error?s.error:s.transaction.error
o(e)}}catch(e){o(e)}})}).catch(o)})
return c(o,n),o},removeItem:function(e,t){var n=this
return c(o,r),o},removeItem:function(e,t){var r=this
e=u(e)
var r=new a(function(t,r){n.ready().then(function(){O(n._dbInfo,y,function(o,i){if(o)return r(o)
try{var a=i.objectStore(n._dbInfo.storeName),c=a.delete(e)
i.oncomplete=function(){t()},i.onerror=function(){r(c.error)},i.onabort=function(){var e=c.error?c.error:c.transaction.error
r(e)}}catch(e){r(e)}})}).catch(r)})
return c(r,t),r},clear:function(e){var t=this,n=new a(function(e,n){t.ready().then(function(){O(t._dbInfo,y,function(r,o){if(r)return n(r)
var n=new a(function(t,n){r.ready().then(function(){O(r._dbInfo,y,function(o,i){if(o)return n(o)
try{var a=i.objectStore(r._dbInfo.storeName),c=a.delete(e)
i.oncomplete=function(){t()},i.onerror=function(){n(c.error)},i.onabort=function(){var e=c.error?c.error:c.transaction.error
n(e)}}catch(e){n(e)}})}).catch(n)})
return c(n,t),n},clear:function(e){var t=this,r=new a(function(e,r){t.ready().then(function(){O(t._dbInfo,y,function(n,o){if(n)return r(n)
try{var i=o.objectStore(t._dbInfo.storeName),a=i.clear()
o.oncomplete=function(){e()},o.onabort=o.onerror=function(){var e=a.error?a.error:a.transaction.error
n(e)}}catch(e){n(e)}})}).catch(n)})
return c(n,e),n},length:function(e){var t=this,n=new a(function(e,n){t.ready().then(function(){O(t._dbInfo,p,function(r,o){if(r)return n(r)
r(e)}}catch(e){r(e)}})}).catch(r)})
return c(r,e),r},length:function(e){var t=this,r=new a(function(e,r){t.ready().then(function(){O(t._dbInfo,p,function(n,o){if(n)return r(n)
try{var i=o.objectStore(t._dbInfo.storeName),a=i.count()
a.onsuccess=function(){e(a.result)},a.onerror=function(){n(a.error)}}catch(e){n(e)}})}).catch(n)})
return c(n,e),n},key:function(e,t){var n=this,r=new a(function(t,r){e<0?t(null):n.ready().then(function(){O(n._dbInfo,p,function(o,i){if(o)return r(o)
try{var a=i.objectStore(n._dbInfo.storeName),c=!1,s=a.openCursor()
s.onsuccess=function(){var n=s.result
n?0===e?t(n.key):c?t(n.key):(c=!0,n.advance(e)):t(null)},s.onerror=function(){r(s.error)}}catch(e){r(e)}})}).catch(r)})
return c(r,t),r},keys:function(e){var t=this,n=new a(function(e,n){t.ready().then(function(){O(t._dbInfo,p,function(r,o){if(r)return n(r)
a.onsuccess=function(){e(a.result)},a.onerror=function(){r(a.error)}}catch(e){r(e)}})}).catch(r)})
return c(r,e),r},key:function(e,t){var r=this,n=new a(function(t,n){e<0?t(null):r.ready().then(function(){O(r._dbInfo,p,function(o,i){if(o)return n(o)
try{var a=i.objectStore(r._dbInfo.storeName),c=!1,s=a.openCursor()
s.onsuccess=function(){var r=s.result
r?0===e?t(r.key):c?t(r.key):(c=!0,r.advance(e)):t(null)},s.onerror=function(){n(s.error)}}catch(e){n(e)}})}).catch(n)})
return c(n,t),n},keys:function(e){var t=this,r=new a(function(e,r){t.ready().then(function(){O(t._dbInfo,p,function(n,o){if(n)return r(n)
try{var i=o.objectStore(t._dbInfo.storeName),a=i.openCursor(),c=[]
a.onsuccess=function(){var t=a.result
t?(c.push(t.key),t.continue()):e(c)},a.onerror=function(){n(a.error)}}catch(e){n(e)}})}).catch(n)})
return c(n,e),n},dropInstance:function(e,t){t=f.apply(this,arguments)
var n,r=this.config()
if((e="function"!=typeof e&&e||{}).name||(e.name=e.name||r.name,e.storeName=e.storeName||r.storeName),e.name){var i=e.name===r.name&&this._dbInfo.db,s=i?a.resolve(this._dbInfo.db):I(e).then(function(t){var n=d[e.name],r=n.forages
n.db=t
for(var o=0;o<r.length;o++)r[o]._dbInfo.db=t
t?(c.push(t.key),t.continue()):e(c)},a.onerror=function(){r(a.error)}}catch(e){r(e)}})}).catch(r)})
return c(r,e),r},dropInstance:function(e,t){t=f.apply(this,arguments)
var r,n=this.config()
if((e="function"!=typeof e&&e||{}).name||(e.name=e.name||n.name,e.storeName=e.storeName||n.storeName),e.name){var i=e.name===n.name&&this._dbInfo.db,s=i?a.resolve(this._dbInfo.db):I(e).then(function(t){var r=d[e.name],n=r.forages
r.db=t
for(var o=0;o<n.length;o++)n[o]._dbInfo.db=t
return t})
n=s.then(e.storeName?function(t){if(t.objectStoreNames.contains(e.storeName)){var n=t.version+1
r=s.then(e.storeName?function(t){if(t.objectStoreNames.contains(e.storeName)){var r=t.version+1
b(e)
var r=d[e.name],i=r.forages
var n=d[e.name],i=n.forages
t.close()
for(var c=0;c<i.length;c++){var s=i[c]
s._dbInfo.db=null,s._dbInfo.version=n}var u=new a(function(t,r){var i=o.open(e.name,n)
s._dbInfo.db=null,s._dbInfo.version=r}var u=new a(function(t,n){var i=o.open(e.name,r)
i.onerror=function(e){var t=i.result
t.close(),r(e)},i.onupgradeneeded=function(){var t=i.result
t.close(),n(e)},i.onupgradeneeded=function(){var t=i.result
t.deleteObjectStore(e.storeName)},i.onsuccess=function(){var e=i.result
e.close(),t(e)}})
return u.then(function(e){r.db=e
for(var t=0;t<i.length;t++){var n=i[t]
n._dbInfo.db=e,g(n._dbInfo)}}).catch(function(t){throw(_(e,t)||a.resolve()).catch(function(){}),t})}}:function(t){b(e)
var n=d[e.name],r=n.forages
return u.then(function(e){n.db=e
for(var t=0;t<i.length;t++){var r=i[t]
r._dbInfo.db=e,g(r._dbInfo)}}).catch(function(t){throw(_(e,t)||a.resolve()).catch(function(){}),t})}}:function(t){b(e)
var r=d[e.name],n=r.forages
t.close()
for(var i=0;i<r.length;i++){var c=r[i]
c._dbInfo.db=null}var s=new a(function(t,n){var r=o.deleteDatabase(e.name)
r.onerror=r.onblocked=function(e){var t=r.result
t&&t.close(),n(e)},r.onsuccess=function(){var e=r.result
for(var i=0;i<n.length;i++){var c=n[i]
c._dbInfo.db=null}var s=new a(function(t,r){var n=o.deleteDatabase(e.name)
n.onerror=n.onblocked=function(e){var t=n.result
t&&t.close(),r(e)},n.onsuccess=function(){var e=n.result
e&&e.close(),t(e)}})
return s.then(function(e){n.db=e
for(var t=0;t<r.length;t++){var o=r[t]
g(o._dbInfo)}}).catch(function(t){throw(_(e,t)||a.resolve()).catch(function(){}),t})})}else n=a.reject("Invalid arguments")
return c(n,t),n}},N="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",A="~~local_forage_type~",k=/^~~local_forage_type~([^~]+)~/,D="__lfsc__:",T=D.length,R="arbf",M="blob",B="si08",L="ui08",F="uic8",U="si16",z="si32",K="ur16",q="ui32",W="fl32",G="fl64",J=T+R.length,Q=Object.prototype.toString
function V(e){var t,n,r,o,i,a=.75*e.length,c=e.length,s=0
return s.then(function(e){r.db=e
for(var t=0;t<n.length;t++){var o=n[t]
g(o._dbInfo)}}).catch(function(t){throw(_(e,t)||a.resolve()).catch(function(){}),t})})}else r=a.reject("Invalid arguments")
return c(r,t),r}},N="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",A="~~local_forage_type~",k=/^~~local_forage_type~([^~]+)~/,D="__lfsc__:",T=D.length,R="arbf",M="blob",B="si08",L="ui08",F="uic8",U="si16",z="si32",K="ur16",q="ui32",W="fl32",G="fl64",J=T+R.length,Q=Object.prototype.toString
function V(e){var t,r,n,o,i,a=.75*e.length,c=e.length,s=0
"="===e[e.length-1]&&(a--,"="===e[e.length-2]&&a--)
var u=new ArrayBuffer(a),f=new Uint8Array(u)
for(t=0;t<c;t+=4)n=N.indexOf(e[t]),r=N.indexOf(e[t+1]),o=N.indexOf(e[t+2]),i=N.indexOf(e[t+3]),f[s++]=n<<2|r>>4,f[s++]=(15&r)<<4|o>>2,f[s++]=(3&o)<<6|63&i
return u}function H(e){var t,n=new Uint8Array(e),r=""
for(t=0;t<n.length;t+=3)r+=N[n[t]>>2],r+=N[(3&n[t])<<4|n[t+1]>>4],r+=N[(15&n[t+1])<<2|n[t+2]>>6],r+=N[63&n[t+2]]
return n.length%3==2?r=r.substring(0,r.length-1)+"=":n.length%3==1&&(r=r.substring(0,r.length-2)+"=="),r}var X={serialize:function(e,t){var n=""
if(e&&(n=Q.call(e)),e&&("[object ArrayBuffer]"===n||e.buffer&&"[object ArrayBuffer]"===Q.call(e.buffer))){var r,o=D
e instanceof ArrayBuffer?(r=e,o+=R):(r=e.buffer,"[object Int8Array]"===n?o+=B:"[object Uint8Array]"===n?o+=L:"[object Uint8ClampedArray]"===n?o+=F:"[object Int16Array]"===n?o+=U:"[object Uint16Array]"===n?o+=K:"[object Int32Array]"===n?o+=z:"[object Uint32Array]"===n?o+=q:"[object Float32Array]"===n?o+=W:"[object Float64Array]"===n?o+=G:t(Error("Failed to get type for BinaryArray"))),t(o+H(r))}else if("[object Blob]"===n){var i=new FileReader
i.onload=function(){var n=A+e.type+"~"+H(this.result)
t(D+M+n)},i.readAsArrayBuffer(e)}else try{t(JSON.stringify(e))}catch(n){console.error("Couldn't convert value into a JSON string: ",e),t(null,n)}},deserialize:function(e){if(e.substring(0,T)!==D)return JSON.parse(e)
var t,n=e.substring(J),type=e.substring(T,J)
if(type===M&&k.test(n)){var r=n.match(k)
t=r[1],n=n.substring(r[0].length)}var o=V(n)
for(t=0;t<c;t+=4)r=N.indexOf(e[t]),n=N.indexOf(e[t+1]),o=N.indexOf(e[t+2]),i=N.indexOf(e[t+3]),f[s++]=r<<2|n>>4,f[s++]=(15&n)<<4|o>>2,f[s++]=(3&o)<<6|63&i
return u}function H(e){var t,r=new Uint8Array(e),n=""
for(t=0;t<r.length;t+=3)n+=N[r[t]>>2],n+=N[(3&r[t])<<4|r[t+1]>>4],n+=N[(15&r[t+1])<<2|r[t+2]>>6],n+=N[63&r[t+2]]
return r.length%3==2?n=n.substring(0,n.length-1)+"=":r.length%3==1&&(n=n.substring(0,n.length-2)+"=="),n}var X={serialize:function(e,t){var r=""
if(e&&(r=Q.call(e)),e&&("[object ArrayBuffer]"===r||e.buffer&&"[object ArrayBuffer]"===Q.call(e.buffer))){var n,o=D
e instanceof ArrayBuffer?(n=e,o+=R):(n=e.buffer,"[object Int8Array]"===r?o+=B:"[object Uint8Array]"===r?o+=L:"[object Uint8ClampedArray]"===r?o+=F:"[object Int16Array]"===r?o+=U:"[object Uint16Array]"===r?o+=K:"[object Int32Array]"===r?o+=z:"[object Uint32Array]"===r?o+=q:"[object Float32Array]"===r?o+=W:"[object Float64Array]"===r?o+=G:t(Error("Failed to get type for BinaryArray"))),t(o+H(n))}else if("[object Blob]"===r){var i=new FileReader
i.onload=function(){var r=A+e.type+"~"+H(this.result)
t(D+M+r)},i.readAsArrayBuffer(e)}else try{t(JSON.stringify(e))}catch(r){console.error("Couldn't convert value into a JSON string: ",e),t(null,r)}},deserialize:function(e){if(e.substring(0,T)!==D)return JSON.parse(e)
var t,r=e.substring(J),type=e.substring(T,J)
if(type===M&&k.test(r)){var n=r.match(k)
t=n[1],r=r.substring(n[0].length)}var o=V(r)
switch(type){case R:return o

@@ -292,117 +292,117 @@ case M:return i([o],{type:t})

default:throw Error("Unkown type: "+type)}},stringToBuffer:V,bufferToString:H}
function Y(e,t,n,r){e.executeSql("CREATE TABLE IF NOT EXISTS "+t.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],n,r)}function Z(e,t,n,r,o,i){e.executeSql(n,r,o,function(e,a){a.code===a.SYNTAX_ERR?e.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[name],function(e,c){c.rows.length?i(e,a):Y(e,t,function(){e.executeSql(n,r,o,i)},i)},i):i(e,a)},i)}var $={_driver:"webSQLStorage",_initStorage:function(e){var t=this,n={db:null}
if(e)for(var r in e)n[r]="string"!=typeof e[r]?""+e[r]:e[r]
var o=new a(function(e,r){try{n.db=openDatabase(n.name,n.version+"",n.description,n.size)}catch(e){return r(e)}n.db.transaction(function(o){Y(o,n,function(){t._dbInfo=n,e()},function(e,t){r(t)})},r)})
return n.serializer=X,o},_support:"function"==typeof openDatabase,iterate:function(e,t){var n=this,r=new a(function(t,r){n.ready().then(function(){var o=n._dbInfo
o.db.transaction(function(n){Z(n,o,"SELECT * FROM "+o.storeName,[],function(n,r){for(var i=r.rows,a=i.length,c=0;c<a;c++){var s=i.item(c),u=s.value
if(u&&(u=o.serializer.deserialize(u)),void 0!==(u=e(u,s.key,c+1)))return void t(u)}t()},function(e,t){r(t)})})}).catch(r)})
return c(r,t),r},getItem:function(e,t){var n=this
function Y(e,t,r,n){e.executeSql("CREATE TABLE IF NOT EXISTS "+t.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],r,n)}function Z(e,t,r,n,o,i){e.executeSql(r,n,o,function(e,a){a.code===a.SYNTAX_ERR?e.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[t.storeName],function(e,c){c.rows.length?i(e,a):Y(e,t,function(){e.executeSql(r,n,o,i)},i)},i):i(e,a)},i)}var $={_driver:"webSQLStorage",_initStorage:function(e){var t=this,r={db:null}
if(e)for(var n in e)r[n]="string"!=typeof e[n]?""+e[n]:e[n]
var o=new a(function(e,n){try{r.db=openDatabase(r.name,r.version+"",r.description,r.size)}catch(e){return n(e)}r.db.transaction(function(o){Y(o,r,function(){t._dbInfo=r,e()},function(e,t){n(t)})},n)})
return r.serializer=X,o},_support:"function"==typeof openDatabase,iterate:function(e,t){var r=this,n=new a(function(t,n){r.ready().then(function(){var o=r._dbInfo
o.db.transaction(function(r){Z(r,o,"SELECT * FROM "+o.storeName,[],function(r,n){for(var i=n.rows,a=i.length,c=0;c<a;c++){var s=i.item(c),u=s.value
if(u&&(u=o.serializer.deserialize(u)),void 0!==(u=e(u,s.key,c+1)))return void t(u)}t()},function(e,t){n(t)})})}).catch(n)})
return c(n,t),n},getItem:function(e,t){var r=this
e=u(e)
var r=new a(function(t,r){n.ready().then(function(){var o=n._dbInfo
o.db.transaction(function(n){Z(n,o,"SELECT * FROM "+o.storeName+" WHERE key = ? LIMIT 1",[e],function(e,n){var r=n.rows.length?n.rows.item(0).value:null
r&&(r=o.serializer.deserialize(r)),t(r)},function(e,t){r(t)})})}).catch(r)})
return c(r,t),r},setItem:function(e,t,n){return function e(t,n,r,o){var i=this
var n=new a(function(t,n){r.ready().then(function(){var o=r._dbInfo
o.db.transaction(function(r){Z(r,o,"SELECT * FROM "+o.storeName+" WHERE key = ? LIMIT 1",[e],function(e,r){var n=r.rows.length?r.rows.item(0).value:null
n&&(n=o.serializer.deserialize(n)),t(n)},function(e,t){n(t)})})}).catch(n)})
return c(n,t),n},setItem:function(e,t,r){return function e(t,r,n,o){var i=this
t=u(t)
var s=new a(function(a,c){i.ready().then(function(){void 0===n&&(n=null)
var s=n,u=i._dbInfo
u.serializer.serialize(n,function(n,f){f?c(f):u.db.transaction(function(e){Z(e,u,"INSERT OR REPLACE INTO "+u.storeName+" (key, value) VALUES (?, ?)",[t,n],function(){a(s)},function(e,t){c(t)})},function(n){if(n.code===n.QUOTA_ERR){if(o>0)return void a(e.call(i,t,s,r,o-1))
c(n)}})})}).catch(c)})
return c(s,r),s}.call(this,e,t,n,1)},removeItem:function(e,t){var n=this
var s=new a(function(a,c){i.ready().then(function(){void 0===r&&(r=null)
var s=r,u=i._dbInfo
u.serializer.serialize(r,function(r,f){f?c(f):u.db.transaction(function(e){Z(e,u,"INSERT OR REPLACE INTO "+u.storeName+" (key, value) VALUES (?, ?)",[t,r],function(){a(s)},function(e,t){c(t)})},function(r){if(r.code===r.QUOTA_ERR){if(o>0)return void a(e.call(i,t,s,n,o-1))
c(r)}})})}).catch(c)})
return c(s,n),s}.call(this,e,t,r,1)},removeItem:function(e,t){var r=this
e=u(e)
var r=new a(function(t,r){n.ready().then(function(){var o=n._dbInfo
o.db.transaction(function(n){Z(n,o,"DELETE FROM "+o.storeName+" WHERE key = ?",[e],function(){t()},function(e,t){r(t)})})}).catch(r)})
return c(r,t),r},clear:function(e){var t=this,n=new a(function(e,n){t.ready().then(function(){var r=t._dbInfo
r.db.transaction(function(t){Z(t,r,"DELETE FROM "+r.storeName,[],function(){e()},function(e,t){n(t)})})}).catch(n)})
return c(n,e),n},length:function(e){var t=this,n=new a(function(e,n){t.ready().then(function(){var r=t._dbInfo
r.db.transaction(function(t){Z(t,r,"SELECT COUNT(key) as c FROM "+r.storeName,[],function(t,n){var r=n.rows.item(0).c
e(r)},function(e,t){n(t)})})}).catch(n)})
return c(n,e),n},key:function(e,t){var n=this,r=new a(function(t,r){n.ready().then(function(){var o=n._dbInfo
o.db.transaction(function(n){Z(n,o,"SELECT key FROM "+o.storeName+" WHERE id = ? LIMIT 1",[e+1],function(e,n){var r=n.rows.length?n.rows.item(0).key:null
t(r)},function(e,t){r(t)})})}).catch(r)})
return c(r,t),r},keys:function(e){var t=this,n=new a(function(e,n){t.ready().then(function(){var r=t._dbInfo
r.db.transaction(function(t){Z(t,r,"SELECT key FROM "+r.storeName,[],function(t,n){for(var r=[],o=0;o<n.rows.length;o++)r.push(n.rows.item(o).key)
e(r)},function(e,t){n(t)})})}).catch(n)})
return c(n,e),n},dropInstance:function(e,t){t=f.apply(this,arguments)
var n=this.config();(e="function"!=typeof e&&e||{}).name||(e.name=e.name||n.name,e.storeName=e.storeName||n.storeName)
var r,o=this
return c(r=e.name?new a(function(t){var r
r=e.name===n.name?o._dbInfo.db:openDatabase(e.name,"","",0),t(e.storeName?{db:r,storeNames:[e.storeName]}:function(e){return new a(function(t,n){e.transaction(function(r){r.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(n,r){for(var o=[],i=0;i<r.rows.length;i++)o.push(r.rows.item(i).name)
t({db:e,storeNames:o})},function(e,t){n(t)})},function(e){n(e)})})}(r))}).then(function(e){return new a(function(t,n){e.db.transaction(function(r){function o(e){return new a(function(t,n){r.executeSql("DROP TABLE IF EXISTS "+e,[],function(){t()},function(e,t){n(t)})})}for(var i=[],c=0,s=e.storeNames.length;c<s;c++)i.push(o(e.storeNames[c]))
a.all(i).then(function(){t()}).catch(function(e){n(e)})},function(e){n(e)})})}):a.reject("Invalid arguments"),t),r}}
function ee(e,t){var n=e.name+"/"
return e.storeName!==t.storeName&&(n+=e.storeName+"/"),n}function te(){return!function(){try{return localStorage.setItem("_localforage_support_test",!0),localStorage.removeItem("_localforage_support_test"),!1}catch(e){return!0}}()||localStorage.length>0}var ne={_driver:"localStorageWrapper",_initStorage:function(e){var t={}
if(e)for(var n in e)t[n]=e[n]
return t.keyPrefix=ee(e,this._defaultConfig),te()?(this._dbInfo=t,t.serializer=X,a.resolve()):a.reject()},_support:function(){try{return"undefined"!=typeof localStorage&&"setItem"in localStorage&&!!localStorage.setItem}catch(e){return!1}}(),iterate:function(e,t){var n=this,r=n.ready().then(function(){for(var t=n._dbInfo,r=t.keyPrefix,o=r.length,i=localStorage.length,a=1,c=0;c<i;c++){var s=localStorage.key(c)
if(0===s.indexOf(r)){var u=localStorage.getItem(s)
var n=new a(function(t,n){r.ready().then(function(){var o=r._dbInfo
o.db.transaction(function(r){Z(r,o,"DELETE FROM "+o.storeName+" WHERE key = ?",[e],function(){t()},function(e,t){n(t)})})}).catch(n)})
return c(n,t),n},clear:function(e){var t=this,r=new a(function(e,r){t.ready().then(function(){var n=t._dbInfo
n.db.transaction(function(t){Z(t,n,"DELETE FROM "+n.storeName,[],function(){e()},function(e,t){r(t)})})}).catch(r)})
return c(r,e),r},length:function(e){var t=this,r=new a(function(e,r){t.ready().then(function(){var n=t._dbInfo
n.db.transaction(function(t){Z(t,n,"SELECT COUNT(key) as c FROM "+n.storeName,[],function(t,r){var n=r.rows.item(0).c
e(n)},function(e,t){r(t)})})}).catch(r)})
return c(r,e),r},key:function(e,t){var r=this,n=new a(function(t,n){r.ready().then(function(){var o=r._dbInfo
o.db.transaction(function(r){Z(r,o,"SELECT key FROM "+o.storeName+" WHERE id = ? LIMIT 1",[e+1],function(e,r){var n=r.rows.length?r.rows.item(0).key:null
t(n)},function(e,t){n(t)})})}).catch(n)})
return c(n,t),n},keys:function(e){var t=this,r=new a(function(e,r){t.ready().then(function(){var n=t._dbInfo
n.db.transaction(function(t){Z(t,n,"SELECT key FROM "+n.storeName,[],function(t,r){for(var n=[],o=0;o<r.rows.length;o++)n.push(r.rows.item(o).key)
e(n)},function(e,t){r(t)})})}).catch(r)})
return c(r,e),r},dropInstance:function(e,t){t=f.apply(this,arguments)
var r=this.config();(e="function"!=typeof e&&e||{}).name||(e.name=e.name||r.name,e.storeName=e.storeName||r.storeName)
var n,o=this
return c(n=e.name?new a(function(t){var n
n=e.name===r.name?o._dbInfo.db:openDatabase(e.name,"","",0),t(e.storeName?{db:n,storeNames:[e.storeName]}:function(e){return new a(function(t,r){e.transaction(function(n){n.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(r,n){for(var o=[],i=0;i<n.rows.length;i++)o.push(n.rows.item(i).name)
t({db:e,storeNames:o})},function(e,t){r(t)})},function(e){r(e)})})}(n))}).then(function(e){return new a(function(t,r){e.db.transaction(function(n){function o(e){return new a(function(t,r){n.executeSql("DROP TABLE IF EXISTS "+e,[],function(){t()},function(e,t){r(t)})})}for(var i=[],c=0,s=e.storeNames.length;c<s;c++)i.push(o(e.storeNames[c]))
a.all(i).then(function(){t()}).catch(function(e){r(e)})},function(e){r(e)})})}):a.reject("Invalid arguments"),t),n}}
function ee(e,t){var r=e.name+"/"
return e.storeName!==t.storeName&&(r+=e.storeName+"/"),r}function te(){return!function(){try{return localStorage.setItem("_localforage_support_test",!0),localStorage.removeItem("_localforage_support_test"),!1}catch(e){return!0}}()||localStorage.length>0}var re={_driver:"localStorageWrapper",_initStorage:function(e){var t={}
if(e)for(var r in e)t[r]=e[r]
return t.keyPrefix=ee(e,this._defaultConfig),te()?(this._dbInfo=t,t.serializer=X,a.resolve()):a.reject()},_support:function(){try{return"undefined"!=typeof localStorage&&"setItem"in localStorage&&!!localStorage.setItem}catch(e){return!1}}(),iterate:function(e,t){var r=this,n=r.ready().then(function(){for(var t=r._dbInfo,n=t.keyPrefix,o=n.length,i=localStorage.length,a=1,c=0;c<i;c++){var s=localStorage.key(c)
if(0===s.indexOf(n)){var u=localStorage.getItem(s)
if(u&&(u=t.serializer.deserialize(u)),void 0!==(u=e(u,s.substring(o),a++)))return u}}})
return c(r,t),r},getItem:function(e,t){var n=this
return c(n,t),n},getItem:function(e,t){var r=this
e=u(e)
var r=n.ready().then(function(){var t=n._dbInfo,r=localStorage.getItem(t.keyPrefix+e)
return r&&(r=t.serializer.deserialize(r)),r})
return c(r,t),r},setItem:function(e,t,n){var r=this
var n=r.ready().then(function(){var t=r._dbInfo,n=localStorage.getItem(t.keyPrefix+e)
return n&&(n=t.serializer.deserialize(n)),n})
return c(n,t),n},setItem:function(e,t,r){var n=this
e=u(e)
var o=r.ready().then(function(){void 0===t&&(t=null)
var n=t
return new a(function(o,i){var a=r._dbInfo
a.serializer.serialize(t,function(t,r){if(r)i(r)
else try{localStorage.setItem(a.keyPrefix+e,t),o(n)}catch(e){"QuotaExceededError"!==e.name&&"NS_ERROR_DOM_QUOTA_REACHED"!==e.name||i(e),i(e)}})})})
return c(o,n),o},removeItem:function(e,t){var n=this
var o=n.ready().then(function(){void 0===t&&(t=null)
var r=t
return new a(function(o,i){var a=n._dbInfo
a.serializer.serialize(t,function(t,n){if(n)i(n)
else try{localStorage.setItem(a.keyPrefix+e,t),o(r)}catch(e){"QuotaExceededError"!==e.name&&"NS_ERROR_DOM_QUOTA_REACHED"!==e.name||i(e),i(e)}})})})
return c(o,r),o},removeItem:function(e,t){var r=this
e=u(e)
var r=n.ready().then(function(){var t=n._dbInfo
var n=r.ready().then(function(){var t=r._dbInfo
localStorage.removeItem(t.keyPrefix+e)})
return c(r,t),r},clear:function(e){var t=this,n=t.ready().then(function(){for(var e=t._dbInfo.keyPrefix,n=localStorage.length-1;n>=0;n--){var r=localStorage.key(n)
0===r.indexOf(e)&&localStorage.removeItem(r)}})
return c(n,e),n},length:function(e){var t=this.keys().then(function(e){return e.length})
return c(t,e),t},key:function(e,t){var n=this,r=n.ready().then(function(){var t,r=n._dbInfo
try{t=localStorage.key(e)}catch(e){t=null}return t&&(t=t.substring(r.keyPrefix.length)),t})
return c(r,t),r},keys:function(e){var t=this,n=t.ready().then(function(){for(var e=t._dbInfo,n=localStorage.length,r=[],o=0;o<n;o++){var i=localStorage.key(o)
0===i.indexOf(e.keyPrefix)&&r.push(i.substring(e.keyPrefix.length))}return r})
return c(n,e),n},dropInstance:function(e,t){if(t=f.apply(this,arguments),!(e="function"!=typeof e&&e||{}).name){var n=this.config()
e.name=e.name||n.name,e.storeName=e.storeName||n.storeName}var r,o=this
return c(r=e.name?new a(function(t){t(e.storeName?ee(e,o._defaultConfig):e.name+"/")}).then(function(e){for(var t=localStorage.length-1;t>=0;t--){var n=localStorage.key(t)
0===n.indexOf(e)&&localStorage.removeItem(n)}}):a.reject("Invalid arguments"),t),r}},re=function(e,t){for(var n=e.length,r=0;r<n;){if((o=e[r])===(i=t)||"number"==typeof o&&"number"==typeof i&&isNaN(o)&&isNaN(i))return!0
r++}var o,i
return!1},oe=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},ie={},ae={},ce={INDEXEDDB:C,WEBSQL:$,LOCALSTORAGE:ne},se=[ce.INDEXEDDB._driver,ce.WEBSQL._driver,ce.LOCALSTORAGE._driver],ue=["dropInstance"],fe=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(ue),le={description:"",driver:se.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1}
function he(e,t){e[t]=function(){var n=arguments
return e.ready().then(function(){return e[t].apply(e,n)})}}function de(){for(var e=1;e<arguments.length;e++){var t=arguments[e]
if(t)for(var n in t)t.hasOwnProperty(n)&&(arguments[0][n]=oe(t[n])?t[n].slice():t[n])}return arguments[0]}var ve=function(){function e(t){for(var n in function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),ce)if(ce.hasOwnProperty(n)){var r=ce[n],o=r._driver
this[n]=o,ie[o]||this.defineDriver(r)}this._defaultConfig=de({},le),this._config=de({},this._defaultConfig,t),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return e.prototype.config=function(e){if("object"===(void 0===e?"undefined":r(e))){if(this._ready)return Error("Can't call config() after localforage has been used.")
return c(n,t),n},clear:function(e){var t=this,r=t.ready().then(function(){for(var e=t._dbInfo.keyPrefix,r=localStorage.length-1;r>=0;r--){var n=localStorage.key(r)
0===n.indexOf(e)&&localStorage.removeItem(n)}})
return c(r,e),r},length:function(e){var t=this.keys().then(function(e){return e.length})
return c(t,e),t},key:function(e,t){var r=this,n=r.ready().then(function(){var t,n=r._dbInfo
try{t=localStorage.key(e)}catch(e){t=null}return t&&(t=t.substring(n.keyPrefix.length)),t})
return c(n,t),n},keys:function(e){var t=this,r=t.ready().then(function(){for(var e=t._dbInfo,r=localStorage.length,n=[],o=0;o<r;o++){var i=localStorage.key(o)
0===i.indexOf(e.keyPrefix)&&n.push(i.substring(e.keyPrefix.length))}return n})
return c(r,e),r},dropInstance:function(e,t){if(t=f.apply(this,arguments),!(e="function"!=typeof e&&e||{}).name){var r=this.config()
e.name=e.name||r.name,e.storeName=e.storeName||r.storeName}var n,o=this
return c(n=e.name?new a(function(t){t(e.storeName?ee(e,o._defaultConfig):e.name+"/")}).then(function(e){for(var t=localStorage.length-1;t>=0;t--){var r=localStorage.key(t)
0===r.indexOf(e)&&localStorage.removeItem(r)}}):a.reject("Invalid arguments"),t),n}},ne=function(e,t){for(var r=e.length,n=0;n<r;){if((o=e[n])===(i=t)||"number"==typeof o&&"number"==typeof i&&isNaN(o)&&isNaN(i))return!0
n++}var o,i
return!1},oe=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},ie={},ae={},ce={INDEXEDDB:C,WEBSQL:$,LOCALSTORAGE:re},se=[ce.INDEXEDDB._driver,ce.WEBSQL._driver,ce.LOCALSTORAGE._driver],ue=["dropInstance"],fe=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(ue),le={description:"",driver:se.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1}
function he(e,t){e[t]=function(){var r=arguments
return e.ready().then(function(){return e[t].apply(e,r)})}}function de(){for(var e=1;e<arguments.length;e++){var t=arguments[e]
if(t)for(var r in t)t.hasOwnProperty(r)&&(arguments[0][r]=oe(t[r])?t[r].slice():t[r])}return arguments[0]}var ve=function(){function e(t){for(var r in function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),ce)if(ce.hasOwnProperty(r)){var n=ce[r],o=n._driver
this[r]=o,ie[o]||this.defineDriver(n)}this._defaultConfig=de({},le),this._config=de({},this._defaultConfig,t),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return e.prototype.config=function(e){if("object"===(void 0===e?"undefined":n(e))){if(this._ready)return Error("Can't call config() after localforage has been used.")
for(var t in e){if("storeName"===t&&(e[t]=e[t].replace(/\W/g,"_")),"version"===t&&"number"!=typeof e[t])return Error("Database version must be a number.")
this._config[t]=e[t]}return!("driver"in e&&e.driver)||this.setDriver(this._config.driver)}return"string"==typeof e?this._config[e]:this._config},e.prototype.defineDriver=function(e,t,n){var r=new a(function(t,n){try{var r=e._driver,o=Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver")
if(!e._driver)return void n(o)
for(var i=fe.concat("_initStorage"),s=0,u=i.length;s<u;s++){var f=i[s],l=!re(ue,f)
if((l||e[f])&&"function"!=typeof e[f])return void n(o)}!function(){for(var t=function(e){return function(){var t=Error("Method "+e+" is not implemented by the current driver"),n=a.reject(t)
return c(n,arguments[arguments.length-1]),n}},n=0,r=ue.length;n<r;n++){var o=ue[n]
this._config[t]=e[t]}return!("driver"in e&&e.driver)||this.setDriver(this._config.driver)}return"string"==typeof e?this._config[e]:this._config},e.prototype.defineDriver=function(e,t,r){var n=new a(function(t,r){try{var n=e._driver,o=Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver")
if(!e._driver)return void r(o)
for(var i=fe.concat("_initStorage"),s=0,u=i.length;s<u;s++){var f=i[s],l=!ne(ue,f)
if((l||e[f])&&"function"!=typeof e[f])return void r(o)}!function(){for(var t=function(e){return function(){var t=Error("Method "+e+" is not implemented by the current driver"),r=a.reject(t)
return c(r,arguments[arguments.length-1]),r}},r=0,n=ue.length;r<n;r++){var o=ue[r]
e[o]||(e[o]=t(o))}}()
var h=function(n){ie[r]&&console.info("Redefining LocalForage driver: "+r),ie[r]=e,ae[r]=n,t()}
"_support"in e?e._support&&"function"==typeof e._support?e._support().then(h,n):h(!!e._support):h(!0)}catch(e){n(e)}})
return s(r,t,n),r},e.prototype.driver=function(){return this._driver||null},e.prototype.getDriver=function(e,t,n){var r=ie[e]?a.resolve(ie[e]):a.reject(Error("Driver not found."))
return s(r,t,n),r},e.prototype.getSerializer=function(e){var t=a.resolve(X)
return s(t,e),t},e.prototype.ready=function(e){var t=this,n=t._driverSet.then(function(){return null===t._ready&&(t._ready=t._initDriver()),t._ready})
return s(n,e,e),n},e.prototype.setDriver=function(e,t,n){var r=this
var h=function(r){ie[n]&&console.info("Redefining LocalForage driver: "+n),ie[n]=e,ae[n]=r,t()}
"_support"in e?e._support&&"function"==typeof e._support?e._support().then(h,r):h(!!e._support):h(!0)}catch(e){r(e)}})
return s(n,t,r),n},e.prototype.driver=function(){return this._driver||null},e.prototype.getDriver=function(e,t,r){var n=ie[e]?a.resolve(ie[e]):a.reject(Error("Driver not found."))
return s(n,t,r),n},e.prototype.getSerializer=function(e){var t=a.resolve(X)
return s(t,e),t},e.prototype.ready=function(e){var t=this,r=t._driverSet.then(function(){return null===t._ready&&(t._ready=t._initDriver()),t._ready})
return s(r,e,e),r},e.prototype.setDriver=function(e,t,r){var n=this
oe(e)||(e=[e])
var o=this._getSupportedDrivers(e)
function i(){r._config.driver=r.driver()}function c(e){return r._extend(e),i(),r._ready=r._initStorage(r._config),r._ready}var u=null!==this._driverSet?this._driverSet.catch(function(){return a.resolve()}):a.resolve()
function i(){n._config.driver=n.driver()}function c(e){return n._extend(e),i(),n._ready=n._initStorage(n._config),n._ready}var u=null!==this._driverSet?this._driverSet.catch(function(){return a.resolve()}):a.resolve()
return this._driverSet=u.then(function(){var e=o[0]
return r._dbInfo=null,r._ready=null,r.getDriver(e).then(function(e){r._driver=e._driver,i(),r._wrapLibraryMethodsWithReady(),r._initDriver=function(e){return function(){var t=0
return function n(){for(;t<e.length;){var o=e[t]
return t++,r._dbInfo=null,r._ready=null,r.getDriver(o).then(c).catch(n)}i()
return n._dbInfo=null,n._ready=null,n.getDriver(e).then(function(e){n._driver=e._driver,i(),n._wrapLibraryMethodsWithReady(),n._initDriver=function(e){return function(){var t=0
return function r(){for(;t<e.length;){var o=e[t]
return t++,n._dbInfo=null,n._ready=null,n.getDriver(o).then(c).catch(r)}i()
var s=Error("No available storage method found.")
return r._driverSet=a.reject(s),r._driverSet}()}}(o)})}).catch(function(){i()
return n._driverSet=a.reject(s),n._driverSet}()}}(o)})}).catch(function(){i()
var e=Error("No available storage method found.")
return r._driverSet=a.reject(e),r._driverSet}),s(this._driverSet,t,n),this._driverSet},e.prototype.supports=function(e){return!!ae[e]},e.prototype._extend=function(e){de(this,e)},e.prototype._getSupportedDrivers=function(e){for(var t=[],n=0,r=e.length;n<r;n++){var o=e[n]
return n._driverSet=a.reject(e),n._driverSet}),s(this._driverSet,t,r),this._driverSet},e.prototype.supports=function(e){return!!ae[e]},e.prototype._extend=function(e){de(this,e)},e.prototype._getSupportedDrivers=function(e){for(var t=[],r=0,n=e.length;r<n;r++){var o=e[r]
this.supports(o)&&t.push(o)}return t},e.prototype._wrapLibraryMethodsWithReady=function(){for(var e=0,t=fe.length;e<t;e++)he(this,fe[e])},e.prototype.createInstance=function(t){return new e(t)},e}(),pe=new ve
t.exports=pe},{3:3}]},{},[4])(4)}),u=o(function(e,t){Object.defineProperty(t,"__esModule",{value:!0})
var n={name:"persistMeta"},r=function(){function e(e){void 0===e&&(e={}),this.cacheConfig=i.extend(n,e),this.cacheInstance=s.createInstance({driver:s.LOCALSTORAGE,name:this.cacheConfig.name})}return e.prototype.get=function(e){return this.cacheInstance.getItem(e)},e.prototype.set=function(e,t){return this.cacheInstance.setItem(e,t)},e.prototype.remove=function(e){return this.cacheInstance.removeItem(e)},e.prototype.clear=function(){return this.cacheInstance.clear()},e.prototype.keys=function(){return this.cacheInstance.keys()},e.prototype.length=function(){return this.cacheInstance.length()},e}()
t.default=r})
r(u)
var f=o(function(e,n){var r=t&&t.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{s(r.next(e))}catch(e){i(e)}}function c(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(a,c)}s((r=r.apply(e,t||[])).next())})},o=t&&t.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1]
var r={name:"persistMeta"},n=function(){function e(e){void 0===e&&(e={}),this.cacheConfig=i.extend(r,e),this.cacheInstance=s.createInstance({driver:s.LOCALSTORAGE,name:this.cacheConfig.name})}return e.prototype.get=function(e){return this.cacheInstance.getItem(e)},e.prototype.set=function(e,t){return this.cacheInstance.setItem(e,t)},e.prototype.remove=function(e){return this.cacheInstance.removeItem(e)},e.prototype.clear=function(){return this.cacheInstance.clear()},e.prototype.keys=function(){return this.cacheInstance.keys()},e.prototype.length=function(){return this.cacheInstance.length()},e}()
t.default=n})
n(u)
var f=o(function(e,r){var n=t&&t.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(o,i){function a(e){try{s(n.next(e))}catch(e){i(e)}}function c(e){try{s(n.throw(e))}catch(e){i(e)}}function s(e){e.done?o(e.value):new r(function(t){t(e.value)}).then(a,c)}s((n=n.apply(e,t||[])).next())})},o=t&&t.__generator||function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1]
return o[1]},trys:[],ops:[]}
return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i
function c(i){return function(c){return function(i){if(n)throw new TypeError("Generator is already executing.")
for(;a;)try{if(n=1,r&&(o=r[2&i[0]?"return":i[0]?"throw":"next"])&&!(o=o.call(r,i[1])).done)return o
switch(r=0,o&&(i=[0,o.value]),i[0]){case 0:case 1:o=i
function c(i){return function(c){return function(i){if(r)throw new TypeError("Generator is already executing.")
for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o
switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i
break
case 4:return a.label++,{value:i[1],done:!1}
case 5:a.label++,r=i[1],i=[0]
case 5:a.label++,n=i[1],i=[0]
continue

@@ -416,29 +416,29 @@ case 7:i=a.ops.pop(),a.trys.pop()

break}o[2]&&a.ops.pop(),a.trys.pop()
continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1]
continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1]
return{value:i[0]?i[1]:void 0,done:!0}}([i,c])}}}
Object.defineProperty(n,"__esModule",{value:!0})
var a={name:"persistValue"},c=function(){function e(e){void 0===e&&(e={}),this.cacheConfig=i.extend(a,e),this.cacheInstance=s.createInstance({driver:s.INDEXEDDB,name:this.cacheConfig.name,storeName:"store"+this.cacheConfig.name})}return e.prototype.get=function(e){return this.cacheInstance.getItem(e)},e.prototype.gets=function(e){return r(this,void 0,void 0,function(){var t,n,r,i,a,c
return o(this,function(o){switch(o.label){case 0:o.trys.push([0,5,,6]),t=[],n=0,r=e,o.label=1
case 1:return n<r.length?(a=(i=t).push,[4,this.get(r[n])]):[3,4]
Object.defineProperty(r,"__esModule",{value:!0})
var a={name:"persistValue"},c=function(){function e(e){void 0===e&&(e={}),this.cacheConfig=i.extend(a,e),this.cacheInstance=s.createInstance({driver:s.INDEXEDDB,name:this.cacheConfig.name,storeName:"store"+this.cacheConfig.name})}return e.prototype.get=function(e){return this.cacheInstance.getItem(e)},e.prototype.gets=function(e){return n(this,void 0,void 0,function(){var t,r,n,i,a,c
return o(this,function(o){switch(o.label){case 0:o.trys.push([0,5,,6]),t=[],r=0,n=e,o.label=1
case 1:return r<n.length?(a=(i=t).push,[4,this.get(n[r])]):[3,4]
case 2:a.call(i,o.sent()),o.label=3
case 3:return n++,[3,1]
case 3:return r++,[3,1]
case 4:return[2,Promise.resolve(t)]
case 5:return c=o.sent(),[2,Promise.reject(c)]
case 6:return[2]}})})},e.prototype.set=function(e,t){return this.cacheInstance.setItem(e,t)},e.prototype.append=function(e,t){return r(this,void 0,void 0,function(){var n,r
case 6:return[2]}})})},e.prototype.set=function(e,t){return this.cacheInstance.setItem(e,t)},e.prototype.append=function(e,t){return n(this,void 0,void 0,function(){var r,n
return o(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,this.cacheInstance.getItem(e)]
case 1:return(n=o.sent())?(i.isArray(t)&&i.isArray(n)?t=n.concat(t):i.isPlainObject(t)&&i.isPlainObject(n)&&(t=i.extend(n,t)),[2,this.set(e,t)]):[2,this.set(e,t)]
case 2:return r=o.sent(),[2,Promise.reject(r)]
case 1:return(r=o.sent())?(i.isArray(t)&&i.isArray(r)?t=r.concat(t):i.isPlainObject(t)&&i.isPlainObject(r)&&(t=i.extend(r,t)),[2,this.set(e,t)]):[2,this.set(e,t)]
case 2:return n=o.sent(),[2,Promise.reject(n)]
case 3:return[2]}})})},e.prototype.remove=function(e){return this.cacheInstance.removeItem(e)},e.prototype.clear=function(){return this.cacheInstance.clear()},e}()
n.default=c})
r(f)
var l=o(function(e,n){var r=t&&t.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])
return e},o=t&&t.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{s(r.next(e))}catch(e){i(e)}}function c(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(a,c)}s((r=r.apply(e,t||[])).next())})},a=t&&t.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1]
r.default=c})
n(f)
var l=o(function(e,r){var n=t&&t.__assign||Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])
return e},o=t&&t.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(o,i){function a(e){try{s(n.next(e))}catch(e){i(e)}}function c(e){try{s(n.throw(e))}catch(e){i(e)}}function s(e){e.done?o(e.value):new r(function(t){t(e.value)}).then(a,c)}s((n=n.apply(e,t||[])).next())})},a=t&&t.__generator||function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1]
return o[1]},trys:[],ops:[]}
return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i
function c(i){return function(c){return function(i){if(n)throw new TypeError("Generator is already executing.")
for(;a;)try{if(n=1,r&&(o=r[2&i[0]?"return":i[0]?"throw":"next"])&&!(o=o.call(r,i[1])).done)return o
switch(r=0,o&&(i=[0,o.value]),i[0]){case 0:case 1:o=i
function c(i){return function(c){return function(i){if(r)throw new TypeError("Generator is already executing.")
for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o
switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i
break
case 4:return a.label++,{value:i[1],done:!1}
case 5:a.label++,r=i[1],i=[0]
case 5:a.label++,n=i[1],i=[0]
continue

@@ -452,52 +452,54 @@ case 7:i=a.ops.pop(),a.trys.pop()

break}o[2]&&a.ops.pop(),a.trys.pop()
continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1]
continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1]
return{value:i[0]?i[1]:void 0,done:!0}}([i,c])}}}
Object.defineProperty(n,"__esModule",{value:!0})
var s={name:"persist",isCompress:!1,valueMaxLength:20480,oldItemsCount:.2},l=function(){function e(e){void 0===e&&(e={}),this.cacheConfig=i.extend(s,e),this.metaCacheInstance=new u.default({name:this.cacheConfig.name}),this.valueCacheInstance=new f.default({name:this.cacheConfig.name})}return e.prototype.getOldKeys=function(){return o(this,void 0,void 0,function(){var e,t,n,r,o,i,c,s
Object.defineProperty(r,"__esModule",{value:!0})
var s={name:"persist",isCompress:!1,valueMaxLength:20480,oldItemsCount:.2},l=function(){function e(e){void 0===e&&(e={}),this.cacheConfig=i.extend(s,e),this.metaCacheInstance=new u.default({name:this.cacheConfig.name}),this.valueCacheInstance=new f.default({name:this.cacheConfig.name})}return e.prototype.getOldKeys=function(){return o(this,void 0,void 0,function(){var e,t,r,n,o,i,c,s
return a(this,function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),[4,this.length()]
case 1:return e=a.sent(),n=Math.floor((t=this.cacheConfig.oldItemsCount)<1?e*t:t),r=[],[4,this.getSortedItems()]
case 2:for(o=a.sent(),i=o.reverse(),c=0;c<i.length;c++)c<n&&r.push(i[c].key)
return[2,Promise.resolve(r)]
case 1:return e=a.sent(),r=Math.floor((t=this.cacheConfig.oldItemsCount)<1?e*t:t),n=[],[4,this.getSortedItems()]
case 2:for(o=a.sent(),i=o.reverse(),c=0;c<i.length;c++)c<r&&n.push(i[c].key)
return[2,Promise.resolve(n)]
case 3:return s=a.sent(),[2,Promise.reject(s)]
case 4:return[2]}})})},e.prototype.getExpiredKeys=function(){return o(this,void 0,void 0,function(){var e,t,n,r,o,i
case 4:return[2]}})})},e.prototype.getExpiredKeys=function(){return o(this,void 0,void 0,function(){var e,t,r,n,o,i
return a(this,function(a){switch(a.label){case 0:return a.trys.push([0,6,,7]),e=[],[4,this.keys()]
case 1:t=a.sent(),n=0,r=t,a.label=2
case 2:return n<r.length?[4,this.isExpired(o=r[n])]:[3,5]
case 1:t=a.sent(),r=0,n=t,a.label=2
case 2:return r<n.length?[4,this.isExpired(o=n[r])]:[3,5]
case 3:a.sent()&&e.push(o),a.label=4
case 4:return n++,[3,2]
case 4:return r++,[3,2]
case 5:return[2,Promise.resolve(e)]
case 6:return i=a.sent(),[2,Promise.reject(i)]
case 7:return[2]}})})},e.prototype.getOverLengthKeys=function(){return o(this,void 0,void 0,function(){var e,t,n,r,o,i
case 7:return[2]}})})},e.prototype.getOverLengthKeys=function(){return o(this,void 0,void 0,function(){var e,t,r,n,o,i
return a(this,function(a){switch(a.label){case 0:return a.trys.push([0,6,,7]),e=[],[4,this.keys()]
case 1:t=a.sent(),n=0,r=t,a.label=2
case 2:return n<r.length?[4,this.isOverLength(o=r[n])]:[3,5]
case 1:t=a.sent(),r=0,n=t,a.label=2
case 2:return r<n.length?[4,this.isOverLength(o=n[r])]:[3,5]
case 3:a.sent()&&e.push(o),a.label=4
case 4:return n++,[3,2]
case 4:return r++,[3,2]
case 5:return[2,Promise.resolve(e)]
case 6:return i=a.sent(),[2,Promise.reject(i)]
case 7:return[2]}})})},e.prototype.isOverLength=function(e){return o(this,void 0,void 0,function(){var t,n
return a(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.getMeta(e)]
case 1:return(t=r.sent())&&t.length&&t.length>this.cacheConfig.valueMaxLength?[2,Promise.resolve(!0)]:[2,Promise.resolve(!1)]
case 2:return n=r.sent(),[2,Promise.reject(n)]
case 3:return[2]}})})},e.prototype.isExpired=function(e){return o(this,void 0,void 0,function(){var t,n
return a(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.getMeta(e)]
case 1:return(t=r.sent())&&t.expire?[2,Promise.resolve(this.expiredVaule(t.expire))]:[2,Promise.resolve(!1)]
case 2:return n=r.sent(),[2,Promise.reject(n)]
case 3:return[2]}})})},e.prototype.get=function(e){return o(this,void 0,void 0,function(){var t,n,r
return a(this,function(o){switch(o.label){case 0:return o.trys.push([0,5,,6]),[4,this.getMeta(e)]
case 1:return(t=o.sent())?void 0===t.length||void 0===t.expire||void 0===t.now||void 0===t.count?[3,4]:this.expiredVaule(t.expire)?(this.remove(e),[2,Promise.resolve(null)]):[4,this.valueCacheInstance.get(e)]:[2,Promise.resolve(null)]
case 2:return n=o.sent(),[4,this.setMeta(e)]
case 3:return o.sent(),[2,Promise.resolve(n)]
case 4:return[2,Promise.resolve(t)]
case 5:return r=o.sent(),[2,Promise.reject(r)]
case 6:return[2]}})})},e.prototype.gets=function(e){return o(this,void 0,void 0,function(){var t,n,r,o,i,c
return a(this,function(a){switch(a.label){case 0:a.trys.push([0,5,,6]),t=[],n=0,r=e,a.label=1
case 1:return n<r.length?(i=(o=t).push,[4,this.get(r[n])]):[3,4]
case 7:return[2]}})})},e.prototype.isOverLength=function(e){return o(this,void 0,void 0,function(){var t,r
return a(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.getMeta(e)]
case 1:return(t=n.sent())&&t.length&&t.length>this.cacheConfig.valueMaxLength?[2,Promise.resolve(!0)]:[2,Promise.resolve(!1)]
case 2:return r=n.sent(),[2,Promise.reject(r)]
case 3:return[2]}})})},e.prototype.isExpired=function(e){return o(this,void 0,void 0,function(){var t,r
return a(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.getMeta(e)]
case 1:return(t=n.sent())&&t.expire?[2,Promise.resolve(this.expiredVaule(t.expire))]:[2,Promise.resolve(!1)]
case 2:return r=n.sent(),[2,Promise.reject(r)]
case 3:return[2]}})})},e.prototype.get=function(e){return o(this,void 0,void 0,function(){var t,r,n
return a(this,function(o){switch(o.label){case 0:return o.trys.push([0,7,,8]),[4,this.getMeta(e)]
case 1:return(t=o.sent())?void 0===t.length||void 0===t.expire||void 0===t.now||void 0===t.count?[3,6]:this.expiredVaule(t.expire)?[4,this.remove(e)]:[3,3]:[2,Promise.resolve(null)]
case 2:return o.sent(),[2,Promise.resolve(null)]
case 3:return[4,this.valueCacheInstance.get(e)]
case 4:return r=o.sent(),[4,this.setMeta(e)]
case 5:return o.sent(),[2,Promise.resolve(r)]
case 6:return[2,Promise.resolve(t)]
case 7:return n=o.sent(),[2,Promise.reject(n)]
case 8:return[2]}})})},e.prototype.gets=function(e){return o(this,void 0,void 0,function(){var t,r,n,o,i,c
return a(this,function(a){switch(a.label){case 0:a.trys.push([0,5,,6]),t=[],r=0,n=e,a.label=1
case 1:return r<n.length?(i=(o=t).push,[4,this.get(n[r])]):[3,4]
case 2:i.call(o,a.sent()),a.label=3
case 3:return n++,[3,1]
case 3:return r++,[3,1]
case 4:return[2,Promise.resolve(t)]
case 5:return c=a.sent(),[2,Promise.reject(c)]
case 6:return[2]}})})},e.prototype.set=function(e,t,n){return void 0===n&&(n=-1),o(this,void 0,void 0,function(){var r,o
case 6:return[2]}})})},e.prototype.set=function(e,t,r){return void 0===r&&(r=-1),o(this,void 0,void 0,function(){var n,o
return a(this,function(i){switch(i.label){case 0:return i.trys.push([0,3,,6]),[4,this.getMeta(e)]
case 1:return!(r=i.sent())||r.length||r.expire||r.count||r.now?[4,this.setMeta(e,t,n)]:[2,this.metaCacheInstance.set(e,t)]
case 1:return!(n=i.sent())||n.length||n.expire||n.count||n.now?[4,this.setMeta(e,t,r)]:[2,this.metaCacheInstance.set(e,t)]
case 2:return i.sent(),[2,this.valueCacheInstance.set(e,t)]

@@ -507,5 +509,5 @@ case 3:return(o=i.sent()).name.toUpperCase().indexOf("QUOTA")>=0?[4,this.clearKeys()]:[3,5]

case 5:return[2,Promise.reject(o)]
case 6:return[2]}})})},e.prototype.append=function(e,t,n){return void 0===n&&(n=-1),o(this,void 0,void 0,function(){var r,o,i
case 6:return[2]}})})},e.prototype.append=function(e,t,r){return void 0===r&&(r=-1),o(this,void 0,void 0,function(){var n,o,i
return a(this,function(a){switch(a.label){case 0:return a.trys.push([0,3,,6]),[4,this.getMeta(e)]
case 1:return(r=a.sent())?(n=n||r.expire,o=this.valueCacheInstance.append(e,t),[4,this.setMeta(e,o,n)]):[2,this.set(e,t,n)]
case 1:return(n=a.sent())?(r=r||n.expire,o=this.valueCacheInstance.append(e,t),[4,this.setMeta(e,o,r)]):[2,this.set(e,t,r)]
case 2:return a.sent(),[2,Promise.resolve(o)]

@@ -516,10 +518,10 @@ case 3:return(i=a.sent()).name.toUpperCase().indexOf("QUOTA")>=0?[4,this.clearKeys()]:[3,5]

case 6:return[2]}})})},e.prototype.has=function(e){return o(this,void 0,void 0,function(){var t
return a(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.getMeta(e)]
case 1:return n.sent()?[2,Promise.resolve(!0)]:[2,Promise.resolve(!1)]
case 2:return t=n.sent(),[2,Promise.reject(t)]
return a(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.getMeta(e)]
case 1:return r.sent()?[2,Promise.resolve(!0)]:[2,Promise.resolve(!1)]
case 2:return t=r.sent(),[2,Promise.reject(t)]
case 3:return[2]}})})},e.prototype.remove=function(e){return o(this,void 0,void 0,function(){var t
return a(this,function(n){switch(n.label){case 0:return n.trys.push([0,3,,4]),[4,this.metaCacheInstance.remove(e)]
case 1:return n.sent(),[4,this.valueCacheInstance.remove(e)]
case 2:return n.sent(),[2,Promise.resolve()]
case 3:return t=n.sent(),[2,Promise.reject(t)]
return a(this,function(r){switch(r.label){case 0:return r.trys.push([0,3,,4]),[4,this.metaCacheInstance.remove(e)]
case 1:return r.sent(),[4,this.valueCacheInstance.remove(e)]
case 2:return r.sent(),[2,Promise.resolve()]
case 3:return t=r.sent(),[2,Promise.reject(t)]
case 4:return[2]}})})},e.prototype.clear=function(){return o(this,void 0,void 0,function(){var e

@@ -530,17 +532,17 @@ return a(this,function(t){switch(t.label){case 0:return t.trys.push([0,3,,4]),[4,this.metaCacheInstance.clear()]

case 3:return e=t.sent(),[2,Promise.reject(e)]
case 4:return[2]}})})},e.prototype.keys=function(){return this.metaCacheInstance.keys()},e.prototype.length=function(){return this.metaCacheInstance.length()},e.prototype.each=function(e){return o(this,void 0,void 0,function(){var t,n,r,o,i
case 4:return[2]}})})},e.prototype.keys=function(){return this.metaCacheInstance.keys()},e.prototype.length=function(){return this.metaCacheInstance.length()},e.prototype.each=function(e){return o(this,void 0,void 0,function(){var t,r,n,o,i
return a(this,function(a){switch(a.label){case 0:return a.trys.push([0,7,,8]),[4,this.keys()]
case 1:t=a.sent(),n=0,a.label=2
case 2:return n<t.length?[4,this.get(r=t[n])]:[3,6]
case 3:return o=a.sent(),e?[4,e(o,r,n)]:[3,5]
case 1:t=a.sent(),r=0,a.label=2
case 2:return r<t.length?[4,this.get(n=t[r])]:[3,6]
case 3:return o=a.sent(),e?[4,e(o,n,r)]:[3,5]
case 4:a.sent(),a.label=5
case 5:return n++,[3,2]
case 5:return r++,[3,2]
case 6:return[2,Promise.resolve(!0)]
case 7:return i=a.sent(),[2,Promise.reject(i)]
case 8:return[2]}})})},e.prototype.getSortedItems=function(){return o(this,void 0,void 0,function(){var e,t,n,o,i,c,s,u,f,l,h,d,v,p,y,m
case 8:return[2]}})})},e.prototype.getSortedItems=function(){return o(this,void 0,void 0,function(){var e,t,r,o,i,c,s,u,f,l,h,d,v,p,y,m
return a(this,function(a){switch(a.label){case 0:return a.trys.push([0,6,,7]),[4,this.keys()]
case 1:e=a.sent(),t=[],n=0,o=e,a.label=2
case 2:return n<o.length?[4,this.getMeta(i=o[n])]:[3,5]
case 3:c=a.sent(),t.push(r({},c,{key:i})),a.label=4
case 4:return n++,[3,2]
case 1:e=a.sent(),t=[],r=0,o=e,a.label=2
case 2:return r<o.length?[4,this.getMeta(i=o[r])]:[3,5]
case 3:c=a.sent(),t.push(n({},c,{key:i})),a.label=4
case 4:return r++,[3,2]
case 5:for(s={},u=0,f=t;u<f.length;u++)s[(l=f[u]).count]||(s[l.count]=[]),s[l.count].push(l)

@@ -552,15 +554,15 @@ for(d in h=[],s)s.hasOwnProperty(d)&&h.push({count:parseInt(d,10),items:s[d].sort(function(e,t){return t.now-e.now})})

case 7:return[2]}})})},e.prototype.expiredVaule=function(e){var t=(new Date).getTime()
return e&&e>0&&e<t},e.prototype.setMeta=function(e,t,n){return void 0===t&&(t=""),void 0===n&&(n=-1),o(this,void 0,void 0,function(){var o,s,u,f,l,h,d
return e&&e>0&&e<t},e.prototype.setMeta=function(e,t,r){return void 0===t&&(t=""),void 0===r&&(r=-1),o(this,void 0,void 0,function(){var o,s,u,f,l,h,d
return a(this,function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),[4,this.getMeta(e)]
case 1:return o=a.sent(),s=(new Date).getTime(),u=void 0,u=i.isDate(n)?n.getTime():i.isNumber(n)&&n>0?s+1e3*n:-1,f=0,o&&void 0!==o.count&&(f=o.count+1),l=void 0,l=t?{length:i.utf16ByteLength(JSON.stringify(t)),now:s,count:f,expire:u}:r({},o,{now:s,count:f}),h=this.cacheConfig.isCompress?c.default.compressToUTF16(JSON.stringify(l)):JSON.stringify(l),[2,this.metaCacheInstance.set(e,h)]
case 1:return o=a.sent(),s=(new Date).getTime(),u=void 0,u=i.isDate(r)?r.getTime():i.isNumber(r)&&r>0?s+1e3*r:-1,f=0,o&&void 0!==o.count&&(f=o.count+1),l=void 0,l=t?{length:i.utf16ByteLength(JSON.stringify(t)),now:s,count:f,expire:u}:n({},o,{now:s,count:f}),h=this.cacheConfig.isCompress?c.default.compressToUTF16(JSON.stringify(l)):JSON.stringify(l),[2,this.metaCacheInstance.set(e,h)]
case 2:return d=a.sent(),[2,Promise.reject(d)]
case 3:return[2]}})})},e.prototype.getMeta=function(e){return o(this,void 0,void 0,function(){var t,n,r
case 3:return[2]}})})},e.prototype.getMeta=function(e){return o(this,void 0,void 0,function(){var t,r,n
return a(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,this.metaCacheInstance.get(e)]
case 1:return t=o.sent(),n=null,null!=t&&(n=JSON.parse(this.cacheConfig.isCompress?c.default.decompressFromUTF16(t):t)),[2,Promise.resolve(n)]
case 2:return r=o.sent(),[2,Promise.reject(r)]
case 3:return[2]}})})},e.prototype.clearKeys=function(){return o(this,void 0,void 0,function(){var e,t,n,r,o,i,c,s
case 1:return t=o.sent(),r=null,null!=t&&(r=JSON.parse(this.cacheConfig.isCompress?c.default.decompressFromUTF16(t):t)),[2,Promise.resolve(r)]
case 2:return n=o.sent(),[2,Promise.reject(n)]
case 3:return[2]}})})},e.prototype.clearKeys=function(){return o(this,void 0,void 0,function(){var e,t,r,n,o,i,c,s
return a(this,function(a){switch(a.label){case 0:return a.trys.push([0,8,,9]),[4,this.getExpiredKeys()]
case 1:return e=a.sent(),n=(t=e).concat,[4,this.getOverLengthKeys()]
case 2:return n.call(t,a.sent()),o=(r=e).concat,[4,this.getOldKeys()]
case 3:o.call(r,a.sent()),e=e.sort().filter(function(e,t,n){return!t||e!==n[t-1]}),i=0,c=e,a.label=4
case 1:return e=a.sent(),r=(t=e).concat,[4,this.getOverLengthKeys()]
case 2:return r.call(t,a.sent()),o=(n=e).concat,[4,this.getOldKeys()]
case 3:o.call(n,a.sent()),e=e.sort().filter(function(e,t,r){return!t||e!==r[t-1]}),i=0,c=e,a.label=4
case 4:return i<c.length?[4,this.remove(c[i])]:[3,7]

@@ -572,8 +574,8 @@ case 5:a.sent(),a.label=6

case 9:return[2]}})})},e}()
n.default=l})
r(l)
r.default=l})
n(l)
var h=o(function(e,t){Object.defineProperty(t,"__esModule",{value:!0})})
r(h)
var d=o(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.MemCache=a.default,t.Persist=l.default,t.typed=h}),v=r(d),p=d.MemCache,y=d.Persist,m=d.typed
n(h)
var d=o(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.MemCache=a.default,t.Persist=l.default,t.typed=h}),v=n(d),p=d.MemCache,y=d.Persist,m=d.typed
e.default=v,e.MemCache=p,e.Persist=y,e.typed=m,Object.defineProperty(e,"__esModule",{value:!0})})
//# sourceMappingURL=mycache.prod.min.js.map
{
"name": "mycache",
"version": "0.4.1",
"version": "0.4.2",
"description": "A Cache library",

@@ -38,6 +38,5 @@ "keywords": [

"dependencies": {
"localforage": "^1.7.1"
"localforage": "^1.7.2"
},
"devDependencies": {
"@types/localforage": "0.0.34",
"@types/node": "^9.6.0",

@@ -44,0 +43,0 @@ "ava": "^0.25.0",

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

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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