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

localforage

Package Overview
Dependencies
Maintainers
1
Versions
62
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

localforage - npm Package Compare versions

Comparing version 0.6.2 to 0.7.0

component.json

2

dist/localforage.min.js

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

!function(){var a,b,c,d;!function(){var e={},f={};a=function(a,b,c){e[a]={deps:b,callback:c}},d=c=b=function(a){function c(b){if("."!==b.charAt(0))return b;for(var c=b.split("/"),d=a.split("/").slice(0,-1),e=0,f=c.length;f>e;e++){var g=c[e];if(".."===g)d.pop();else{if("."===g)continue;d.push(g)}}return d.join("/")}if(d._eak_seen=e,f[a])return f[a];if(f[a]={},!e[a])throw new Error("Could not find module "+a);for(var g,h=e[a],i=h.deps,j=h.callback,k=[],l=0,m=i.length;m>l;l++)k.push("exports"===i[l]?g={}:b(c(i[l])));var n=j.apply(this,k);return f[a]=g||n}}(),a("promise/all",["./utils","exports"],function(a,b){"use strict";function c(a){var b=this;if(!d(a))throw new TypeError("You must pass an array to all.");return new b(function(b,c){function d(a){return function(b){f(a,b)}}function f(a,c){h[a]=c,0===--i&&b(h)}var g,h=[],i=a.length;0===i&&b([]);for(var j=0;j<a.length;j++)g=a[j],g&&e(g.then)?g.then(d(j),c):f(j,g)})}var d=a.isArray,e=a.isFunction;b.all=c}),a("promise/asap",["exports"],function(a){"use strict";function b(){return function(){process.nextTick(e)}}function c(){var a=0,b=new i(e),c=document.createTextNode("");return b.observe(c,{characterData:!0}),function(){c.data=a=++a%2}}function d(){return function(){j.setTimeout(e,1)}}function e(){for(var a=0;a<k.length;a++){var b=k[a],c=b[0],d=b[1];c(d)}k=[]}function f(a,b){var c=k.push([a,b]);1===c&&g()}var g,h="undefined"!=typeof window?window:{},i=h.MutationObserver||h.WebKitMutationObserver,j="undefined"!=typeof global?global:this,k=[];g="undefined"!=typeof process&&"[object process]"==={}.toString.call(process)?b():i?c():d(),a.asap=f}),a("promise/cast",["exports"],function(a){"use strict";function b(a){if(a&&"object"==typeof a&&a.constructor===this)return a;var b=this;return new b(function(b){b(a)})}a.cast=b}),a("promise/config",["exports"],function(a){"use strict";function b(a,b){return 2!==arguments.length?c[a]:void(c[a]=b)}var c={instrument:!1};a.config=c,a.configure=b}),a("promise/polyfill",["./promise","./utils","exports"],function(a,b,c){"use strict";function d(){var a="Promise"in window&&"cast"in window.Promise&&"resolve"in window.Promise&&"reject"in window.Promise&&"all"in window.Promise&&"race"in window.Promise&&function(){var a;return new window.Promise(function(b){a=b}),f(a)}();a||(window.Promise=e)}var e=a.Promise,f=b.isFunction;c.polyfill=d}),a("promise/promise",["./config","./utils","./cast","./all","./race","./resolve","./reject","./asap","exports"],function(a,b,c,d,e,f,g,h,i){"use strict";function j(a){if(!w(a))throw new TypeError("You must pass a resolver function as the first argument to the promise constructor");if(!(this instanceof j))throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.");this._subscribers=[],k(a,this)}function k(a,b){function c(a){p(b,a)}function d(a){r(b,a)}try{a(c,d)}catch(e){d(e)}}function l(a,b,c,d){var e,f,g,h,i=w(c);if(i)try{e=c(d),g=!0}catch(j){h=!0,f=j}else e=d,g=!0;o(b,e)||(i&&g?p(b,e):h?r(b,f):a===F?p(b,e):a===G&&r(b,e))}function m(a,b,c,d){var e=a._subscribers,f=e.length;e[f]=b,e[f+F]=c,e[f+G]=d}function n(a,b){for(var c,d,e=a._subscribers,f=a._detail,g=0;g<e.length;g+=3)c=e[g],d=e[g+b],l(b,c,d,f);a._subscribers=null}function o(a,b){var c,d=null;try{if(a===b)throw new TypeError("A promises callback cannot return that same promise.");if(v(b)&&(d=b.then,w(d)))return d.call(b,function(d){return c?!0:(c=!0,void(b!==d?p(a,d):q(a,d)))},function(b){return c?!0:(c=!0,void r(a,b))}),!0}catch(e){return c?!0:(r(a,e),!0)}return!1}function p(a,b){a===b?q(a,b):o(a,b)||q(a,b)}function q(a,b){a._state===D&&(a._state=E,a._detail=b,u.async(s,a))}function r(a,b){a._state===D&&(a._state=E,a._detail=b,u.async(t,a))}function s(a){n(a,a._state=F)}function t(a){n(a,a._state=G)}var u=a.config,v=(a.configure,b.objectOrFunction),w=b.isFunction,x=(b.now,c.cast),y=d.all,z=e.race,A=f.resolve,B=g.reject,C=h.asap;u.async=C;var D=void 0,E=0,F=1,G=2;j.prototype={constructor:j,_state:void 0,_detail:void 0,_subscribers:void 0,then:function(a,b){var c=this,d=new this.constructor(function(){});if(this._state){var e=arguments;u.async(function(){l(c._state,d,e[c._state-1],c._detail)})}else m(this,d,a,b);return d},"catch":function(a){return this.then(null,a)}},j.all=y,j.cast=x,j.race=z,j.resolve=A,j.reject=B,i.Promise=j}),a("promise/race",["./utils","exports"],function(a,b){"use strict";function c(a){var b=this;if(!d(a))throw new TypeError("You must pass an array to race.");return new b(function(b,c){for(var d,e=0;e<a.length;e++)d=a[e],d&&"function"==typeof d.then?d.then(b,c):b(d)})}var d=a.isArray;b.race=c}),a("promise/reject",["exports"],function(a){"use strict";function b(a){var b=this;return new b(function(b,c){c(a)})}a.reject=b}),a("promise/resolve",["exports"],function(a){"use strict";function b(a){var b=this;return new b(function(b){b(a)})}a.resolve=b}),a("promise/utils",["exports"],function(a){"use strict";function b(a){return c(a)||"object"==typeof a&&null!==a}function c(a){return"function"==typeof a}function d(a){return"[object Array]"===Object.prototype.toString.call(a)}var e=Date.now||function(){return(new Date).getTime()};a.objectOrFunction=b,a.isFunction=c,a.isArray=d,a.now=e}),b("promise/polyfill").polyfill()}(),function(){"use strict";function a(a){if(a)for(var b in a)j[b]=a[b];return new h(function(a,b){var c=k.open(j.name,j.version);c.onerror=function(){b(c.error.name)},c.onupgradeneeded=function(){c.result.createObjectStore(j.storeName)},c.onsuccess=function(){i=c.result,a()}})}function b(a,b){var c=this;return new h(function(d,e){c.ready().then(function(){var c=i.transaction(j.storeName,"readonly").objectStore(j.storeName),f=c.get(a);f.onsuccess=function(){var a=f.result;void 0===a&&(a=null),b&&b(a),d(a)},f.onerror=function(){b&&b(null,f.error.name),e(f.error.name)}})})}function c(a,b,c){var d=this;return new h(function(e,f){d.ready().then(function(){var d=i.transaction(j.storeName,"readwrite").objectStore(j.storeName);void 0===b&&(b=null);var g=d.put(b,a);g.onsuccess=function(){c&&c(b),e(b)},g.onerror=function(){c&&c(null,g.error.name),f(g.error.name)}})})}function d(a,b){var c=this;return new h(function(d,e){c.ready().then(function(){var c=i.transaction(j.storeName,"readwrite").objectStore(j.storeName),f=c["delete"](a);f.onsuccess=function(){b&&b(),d()},f.onerror=function(){b&&b(f.error.name),e(f.error.name)},f.onabort=function(a){var c=a.target.error;"QuotaExceededError"===c.name&&(b&&b(c.name),e(c.name))}})})}function e(a){var b=this;return new h(function(c,d){b.ready().then(function(){var b=i.transaction(j.storeName,"readwrite").objectStore(j.storeName),e=b.clear();e.onsuccess=function(){a&&a(),c()},e.onerror=function(){a&&a(null,e.error.name),d(e.error.name)}})})}function f(a){var b=this;return new h(function(c,d){b.ready().then(function(){var b=i.transaction(j.storeName,"readonly").objectStore(j.storeName),e=b.count();e.onsuccess=function(){a&&a(e.result),c(e.result)},e.onerror=function(){a&&a(null,e.error.name),d(e.error.name)}})})}function g(a,b){var c=this;return new h(function(d,e){return 0>a?(b&&b(null),void d(null)):void c.ready().then(function(){var c=i.transaction(j.storeName,"readonly").objectStore(j.storeName),f=!1,g=c.openCursor();g.onsuccess=function(){var c=g.result;return c?void(0===a?(b&&b(c.key),d(c.key)):f?(b&&b(c.key),d(c.key)):(f=!0,c.advance(a))):(b&&b(null),void d(null))},g.onerror=function(){b&&b(null,g.error.name),e(g.error.name)}})})}var h=this.Promise,i=null,j={},k=k||this.indexedDB||this.webkitIndexedDB||this.mozIndexedDB||this.OIndexedDB||this.msIndexedDB;if(k){var l={_driver:"asyncStorage",_initStorage:a,getItem:b,setItem:c,removeItem:d,clear:e,length:f,key:g};"function"==typeof define&&define.amd?define("asyncStorage",function(){return l}):"undefined"!=typeof module&&module.exports?module.exports=l:this.asyncStorage=l}}.call(this),function(){"use strict";function a(a){if(a)for(var b in a)l[b]=a[b];return k=l.name+"/",m.resolve()}function b(a){var b=this;return new m(function(c){b.ready().then(function(){n.clear(),a&&a(),c()})})}function c(a,b){var c=this;return new m(function(d,e){c.ready().then(function(){try{var c=n.getItem(k+a);c&&(c=g(c)),b&&b(c,null),d(c)}catch(f){b&&b(null,f),e(f)}})})}function d(a,b){var c=this;return new m(function(d){c.ready().then(function(){var c=n.key(a);c&&(c=c.substring(k.length)),b&&b(c),d(c)})})}function e(a){var b=this;return new m(function(c){b.ready().then(function(){var b=n.length;a&&a(b),c(b)})})}function f(a,b){var c=this;return new m(function(d){c.ready().then(function(){n.removeItem(k+a),b&&b(),d()})})}function g(a){if(a.substring(0,q)!==p)return JSON.parse(a);for(var b=a.substring(C),c=a.substring(q,C),d=new ArrayBuffer(2*b.length),e=new Uint16Array(d),f=b.length-1;f>=0;f--)e[f]=b.charCodeAt(f);switch(c){case r:return d;case s:return new Blob([d]);case t:return new Int8Array(d);case u:return new Uint8Array(d);case v:return new Uint8ClampedArray(d);case w:return new Int16Array(d);case y:return new Uint16Array(d);case x:return new Int32Array(d);case z:return new Uint32Array(d);case A:return new Float32Array(d);case B:return new Float64Array(d);default:throw new Error("Unkown type: "+c)}}function h(a){var b="",c=new Uint16Array(a);try{b=String.fromCharCode.apply(null,c)}catch(d){for(var e=0;e<c.length;e++)b+=String.fromCharCode(c[e])}return b}function i(a,b){var c="";if(a&&(c=a.toString()),a&&("[object ArrayBuffer]"===a.toString()||a.buffer&&"[object ArrayBuffer]"===a.buffer.toString())){var d,e=p;a instanceof ArrayBuffer?(d=a,e+=r):(d=a.buffer,"[object Int8Array]"===c?e+=t:"[object Uint8Array]"===c?e+=u:"[object Uint8ClampedArray]"===c?e+=v:"[object Int16Array]"===c?e+=w:"[object Uint16Array]"===c?e+=y:"[object Int32Array]"===c?e+=x:"[object Uint32Array]"===c?e+=z:"[object Float32Array]"===c?e+=A:"[object Float64Array]"===c?e+=B:b(new Error("Failed to get type for BinaryArray"))),b(e+h(d))}else if("[object Blob]"===c){var f=new FileReader;f.onload=function(){var a=h(this.result);b(p+s+a)},f.readAsArrayBuffer(a)}else try{b(JSON.stringify(a))}catch(g){window.console&&window.console.error&&window.console.error("Couldn't convert value into a JSON string: ",a),b(null,g)}}function j(a,b,c){var d=this;return new m(function(e,f){d.ready().then(function(){void 0===b&&(b=null);var d=b;i(b,function(b,g){if(g)c&&c(null,g),f(g);else{try{n.setItem(k+a,b)}catch(h){("QuotaExceededError"===h.name||"NS_ERROR_DOM_QUOTA_REACHED"===h.name)&&(c&&c(null,h),f(h))}c&&c(d),e(d)}})})})}var k="",l={},m=this.Promise,n=null;try{n=this.localStorage}catch(o){return}var p="__lfsc__:",q=p.length,r="arbf",s="blob",t="si08",u="ui08",v="uic8",w="si16",x="si32",y="ur16",z="ui32",A="fl32",B="fl64",C=q+r.length,D={_driver:"localStorageWrapper",_initStorage:a,getItem:c,setItem:j,removeItem:f,clear:b,length:e,key:d};"function"==typeof define&&define.amd?define("localStorageWrapper",function(){return D}):"undefined"!=typeof module&&module.exports?module.exports=D:this.localStorageWrapper=D}.call(this),function(){"use strict";function a(a){var b=this;if(a)for(var c in o)o[c]="string"!=typeof a[c]?a[c].toString():a[c];return new l(function(a){try{n=m(o.name,o.version,o.description,o.size)}catch(c){return b.setDriver("localStorageWrapper").then(a)}n.transaction(function(b){b.executeSql("CREATE TABLE IF NOT EXISTS "+o.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],function(){a()},null)})})}function b(a,b){var c=this;return new l(function(d,e){c.ready().then(function(){n.transaction(function(c){c.executeSql("SELECT * FROM "+o.storeName+" WHERE key = ? LIMIT 1",[a],function(a,c){var e=c.rows.length?c.rows.item(0).value:null;e&&(e=i(e)),b&&b(e),d(e)},function(a,c){b&&b(null,c),e(c)})})})})}function c(a,b,c){var d=this;return new l(function(e,f){d.ready().then(function(){void 0===b&&(b=null);var d=b;j(b,function(b,g){g?f(g):n.transaction(function(g){g.executeSql("INSERT OR REPLACE INTO "+o.storeName+" (key, value) VALUES (?, ?)",[a,b],function(){c&&c(d),e(d)},function(a,b){c&&c(null,b),f(b)})},function(a){a.code===a.QUOTA_ERR&&(c&&c(null,a),f(a))})})})})}function d(a,b){var c=this;return new l(function(d,e){c.ready().then(function(){n.transaction(function(c){c.executeSql("DELETE FROM "+o.storeName+" WHERE key = ?",[a],function(){b&&b(),d()},function(a,c){b&&b(c),e(c)})})})})}function e(a){var b=this;return new l(function(c,d){b.ready().then(function(){n.transaction(function(b){b.executeSql("DELETE FROM "+o.storeName,[],function(){a&&a(),c()},function(b,c){a&&a(c),d(c)})})})})}function f(a){var b=this;return new l(function(c,d){b.ready().then(function(){n.transaction(function(b){b.executeSql("SELECT COUNT(key) as c FROM "+o.storeName,[],function(b,d){var e=d.rows.item(0).c;a&&a(e),c(e)},function(b,c){a&&a(null,c),d(c)})})})})}function g(a,b){var c=this;return new l(function(d,e){c.ready().then(function(){n.transaction(function(c){c.executeSql("SELECT key FROM "+o.storeName+" WHERE id = ? LIMIT 1",[a+1],function(a,c){var e=c.rows.length?c.rows.item(0).key:null;b&&b(e),d(e)},function(a,c){b&&b(null,c),e(c)})})})})}function h(a){var b,c=new Uint8Array(a),d="";for(b=0;b<c.length;b+=3)d+=k[c[b]>>2],d+=k[(3&c[b])<<4|c[b+1]>>4],d+=k[(15&c[b+1])<<2|c[b+2]>>6],d+=k[63&c[b+2]];return c.length%3===2?d=d.substring(0,d.length-1)+"=":c.length%3===1&&(d=d.substring(0,d.length-2)+"=="),d}function i(a){if(a.substring(0,q)!==p)return JSON.parse(a);var b,c,d,e,f,g=a.substring(C),h=a.substring(q,C),i=.75*g.length,j=g.length,l=0;"="===g[g.length-1]&&(i--,"="===g[g.length-2]&&i--);var m=new ArrayBuffer(i),n=new Uint8Array(m);for(b=0;j>b;b+=4)c=k.indexOf(g[b]),d=k.indexOf(g[b+1]),e=k.indexOf(g[b+2]),f=k.indexOf(g[b+3]),n[l++]=c<<2|d>>4,n[l++]=(15&d)<<4|e>>2,n[l++]=(3&e)<<6|63&f;switch(h){case r:return m;case s:return new Blob([m]);case t:return new Int8Array(m);case u:return new Uint8Array(m);case v:return new Uint8ClampedArray(m);case w:return new Int16Array(m);case y:return new Uint16Array(m);case x:return new Int32Array(m);case z:return new Uint32Array(m);case A:return new Float32Array(m);case B:return new Float64Array(m);default:throw new Error("Unkown type: "+h)}}function j(a,b){var c="";if(a&&(c=a.toString()),a&&("[object ArrayBuffer]"===a.toString()||a.buffer&&"[object ArrayBuffer]"===a.buffer.toString())){var d,e=p;a instanceof ArrayBuffer?(d=a,e+=r):(d=a.buffer,"[object Int8Array]"===c?e+=t:"[object Uint8Array]"===c?e+=u:"[object Uint8ClampedArray]"===c?e+=v:"[object Int16Array]"===c?e+=w:"[object Uint16Array]"===c?e+=y:"[object Int32Array]"===c?e+=x:"[object Uint32Array]"===c?e+=z:"[object Float32Array]"===c?e+=A:"[object Float64Array]"===c?e+=B:b(new Error("Failed to get type for BinaryArray"))),b(e+h(d))}else if("[object Blob]"===c){var f=new FileReader;f.onload=function(){var a=h(this.result);b(p+s+a)},f.readAsArrayBuffer(a)}else try{b(JSON.stringify(a))}catch(g){window.console&&window.console.error&&window.console.error("Couldn't convert value into a JSON string: ",a),b(null,g)}}var k="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",l=this.Promise,m=this.openDatabase,n=null,o={},p="__lfsc__:",q=p.length,r="arbf",s="blob",t="si08",u="ui08",v="uic8",w="si16",x="si32",y="ur16",z="ui32",A="fl32",B="fl64",C=q+r.length;if(m){var D={_driver:"webSQLStorage",_initStorage:a,getItem:b,setItem:c,removeItem:d,clear:e,length:f,key:g};"function"==typeof define&&define.amd?define("webSQLStorage",function(){return D}):"undefined"!=typeof module&&module.exports?module.exports=D:this.webSQLStorage=D}}.call(this),function(){"use strict";var a=this.Promise,b=1,c=2,d=3,e=d;"function"==typeof define&&define.amd?e=b:"undefined"!=typeof module&&module.exports&&(e=c);var f,g=g||this.indexedDB||this.webkitIndexedDB||this.mozIndexedDB||this.OIndexedDB||this.msIndexedDB,h=this.openDatabase,i=this,j={INDEXEDDB:"asyncStorage",LOCALSTORAGE:"localStorageWrapper",WEBSQL:"webSQLStorage",_config:{description:"",name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1},config:function(a){if("object"==typeof a){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var b in a)this._config[b]=a[b];return!0}return"string"==typeof a?this._config[a]:this._config},driver:function(){return this._driver||null},_ready:a.reject(new Error("setDriver() wasn't called")),setDriver:function(d,f){var k=new a(function(a,f){if(!g&&d===j.INDEXEDDB||!h&&d===j.WEBSQL)return void f(j);if(j._ready=null,e===b)return void require([d],function(b){j._extend(b),a(j)});if(e===c){var k;switch(d){case j.INDEXEDDB:k=require("localforage/src/drivers/indexeddb");break;case j.LOCALSTORAGE:k=require("localforage/src/drivers/localstorage");break;case j.WEBSQL:k=require("localforage/src/drivers/websql")}j._extend(k)}else j._extend(i[d]);a(j)});return k.then(f,f),k},ready:function(a){return null===this._ready&&(this._ready=this._initStorage(this._config)),this._ready.then(a,a),this._ready},_extend:function(a){for(var b in a)a.hasOwnProperty(b)&&(this[b]=a[b])}};f=g&&null===g.open("_localforage_spec_test",1).onupgradeneeded?j.INDEXEDDB:h?j.WEBSQL:j.LOCALSTORAGE,this.localForageConfig&&(j.config=this.localForageConfig),j.setDriver(f),e===b?define(function(){return j}):e===c?module.exports=j:this.localforage=j}.call(this);
!function(){var a,b,c,d;!function(){var e={},f={};a=function(a,b,c){e[a]={deps:b,callback:c}},d=c=b=function(a){function c(b){if("."!==b.charAt(0))return b;for(var c=b.split("/"),d=a.split("/").slice(0,-1),e=0,f=c.length;f>e;e++){var g=c[e];if(".."===g)d.pop();else{if("."===g)continue;d.push(g)}}return d.join("/")}if(d._eak_seen=e,f[a])return f[a];if(f[a]={},!e[a])throw new Error("Could not find module "+a);for(var g,h=e[a],i=h.deps,j=h.callback,k=[],l=0,m=i.length;m>l;l++)k.push("exports"===i[l]?g={}:b(c(i[l])));var n=j.apply(this,k);return f[a]=g||n}}(),a("promise/all",["./utils","exports"],function(a,b){"use strict";function c(a){var b=this;if(!d(a))throw new TypeError("You must pass an array to all.");return new b(function(b,c){function d(a){return function(b){f(a,b)}}function f(a,c){h[a]=c,0===--i&&b(h)}var g,h=[],i=a.length;0===i&&b([]);for(var j=0;j<a.length;j++)g=a[j],g&&e(g.then)?g.then(d(j),c):f(j,g)})}var d=a.isArray,e=a.isFunction;b.all=c}),a("promise/asap",["exports"],function(a){"use strict";function b(){return function(){process.nextTick(e)}}function c(){var a=0,b=new i(e),c=document.createTextNode("");return b.observe(c,{characterData:!0}),function(){c.data=a=++a%2}}function d(){return function(){j.setTimeout(e,1)}}function e(){for(var a=0;a<k.length;a++){var b=k[a],c=b[0],d=b[1];c(d)}k=[]}function f(a,b){var c=k.push([a,b]);1===c&&g()}var g,h="undefined"!=typeof window?window:{},i=h.MutationObserver||h.WebKitMutationObserver,j="undefined"!=typeof global?global:this,k=[];g="undefined"!=typeof process&&"[object process]"==={}.toString.call(process)?b():i?c():d(),a.asap=f}),a("promise/cast",["exports"],function(a){"use strict";function b(a){if(a&&"object"==typeof a&&a.constructor===this)return a;var b=this;return new b(function(b){b(a)})}a.cast=b}),a("promise/config",["exports"],function(a){"use strict";function b(a,b){return 2!==arguments.length?c[a]:void(c[a]=b)}var c={instrument:!1};a.config=c,a.configure=b}),a("promise/polyfill",["./promise","./utils","exports"],function(a,b,c){"use strict";function d(){var a="Promise"in window&&"cast"in window.Promise&&"resolve"in window.Promise&&"reject"in window.Promise&&"all"in window.Promise&&"race"in window.Promise&&function(){var a;return new window.Promise(function(b){a=b}),f(a)}();a||(window.Promise=e)}var e=a.Promise,f=b.isFunction;c.polyfill=d}),a("promise/promise",["./config","./utils","./cast","./all","./race","./resolve","./reject","./asap","exports"],function(a,b,c,d,e,f,g,h,i){"use strict";function j(a){if(!w(a))throw new TypeError("You must pass a resolver function as the first argument to the promise constructor");if(!(this instanceof j))throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.");this._subscribers=[],k(a,this)}function k(a,b){function c(a){p(b,a)}function d(a){r(b,a)}try{a(c,d)}catch(e){d(e)}}function l(a,b,c,d){var e,f,g,h,i=w(c);if(i)try{e=c(d),g=!0}catch(j){h=!0,f=j}else e=d,g=!0;o(b,e)||(i&&g?p(b,e):h?r(b,f):a===F?p(b,e):a===G&&r(b,e))}function m(a,b,c,d){var e=a._subscribers,f=e.length;e[f]=b,e[f+F]=c,e[f+G]=d}function n(a,b){for(var c,d,e=a._subscribers,f=a._detail,g=0;g<e.length;g+=3)c=e[g],d=e[g+b],l(b,c,d,f);a._subscribers=null}function o(a,b){var c,d=null;try{if(a===b)throw new TypeError("A promises callback cannot return that same promise.");if(v(b)&&(d=b.then,w(d)))return d.call(b,function(d){return c?!0:(c=!0,void(b!==d?p(a,d):q(a,d)))},function(b){return c?!0:(c=!0,void r(a,b))}),!0}catch(e){return c?!0:(r(a,e),!0)}return!1}function p(a,b){a===b?q(a,b):o(a,b)||q(a,b)}function q(a,b){a._state===D&&(a._state=E,a._detail=b,u.async(s,a))}function r(a,b){a._state===D&&(a._state=E,a._detail=b,u.async(t,a))}function s(a){n(a,a._state=F)}function t(a){n(a,a._state=G)}var u=a.config,v=(a.configure,b.objectOrFunction),w=b.isFunction,x=(b.now,c.cast),y=d.all,z=e.race,A=f.resolve,B=g.reject,C=h.asap;u.async=C;var D=void 0,E=0,F=1,G=2;j.prototype={constructor:j,_state:void 0,_detail:void 0,_subscribers:void 0,then:function(a,b){var c=this,d=new this.constructor(function(){});if(this._state){var e=arguments;u.async(function(){l(c._state,d,e[c._state-1],c._detail)})}else m(this,d,a,b);return d},"catch":function(a){return this.then(null,a)}},j.all=y,j.cast=x,j.race=z,j.resolve=A,j.reject=B,i.Promise=j}),a("promise/race",["./utils","exports"],function(a,b){"use strict";function c(a){var b=this;if(!d(a))throw new TypeError("You must pass an array to race.");return new b(function(b,c){for(var d,e=0;e<a.length;e++)d=a[e],d&&"function"==typeof d.then?d.then(b,c):b(d)})}var d=a.isArray;b.race=c}),a("promise/reject",["exports"],function(a){"use strict";function b(a){var b=this;return new b(function(b,c){c(a)})}a.reject=b}),a("promise/resolve",["exports"],function(a){"use strict";function b(a){var b=this;return new b(function(b){b(a)})}a.resolve=b}),a("promise/utils",["exports"],function(a){"use strict";function b(a){return c(a)||"object"==typeof a&&null!==a}function c(a){return"function"==typeof a}function d(a){return"[object Array]"===Object.prototype.toString.call(a)}var e=Date.now||function(){return(new Date).getTime()};a.objectOrFunction=b,a.isFunction=c,a.isArray=d,a.now=e}),b("promise/polyfill").polyfill()}(),function(){"use strict";function a(a){if(a)for(var b in a)j[b]=a[b];return new h(function(a,b){var c=k.open(j.name,j.version);c.onerror=function(){b(c.error.name)},c.onupgradeneeded=function(){c.result.createObjectStore(j.storeName)},c.onsuccess=function(){i=c.result,a()}})}function b(a,b){var c=this;return new h(function(d,e){c.ready().then(function(){var c=i.transaction(j.storeName,"readonly").objectStore(j.storeName),f=c.get(a);f.onsuccess=function(){var a=f.result;void 0===a&&(a=null),b&&b(a),d(a)},f.onerror=function(){b&&b(null,f.error.name),e(f.error.name)}})})}function c(a,b,c){var d=this;return new h(function(e,f){d.ready().then(function(){var d=i.transaction(j.storeName,"readwrite").objectStore(j.storeName);void 0===b&&(b=null);var g=d.put(b,a);g.onsuccess=function(){c&&c(b),e(b)},g.onerror=function(){c&&c(null,g.error.name),f(g.error.name)}})})}function d(a,b){var c=this;return new h(function(d,e){c.ready().then(function(){var c=i.transaction(j.storeName,"readwrite").objectStore(j.storeName),f=c["delete"](a);f.onsuccess=function(){b&&b(),d()},f.onerror=function(){b&&b(f.error.name),e(f.error.name)},f.onabort=function(a){var c=a.target.error;"QuotaExceededError"===c.name&&(b&&b(c.name),e(c.name))}})})}function e(a){var b=this;return new h(function(c,d){b.ready().then(function(){var b=i.transaction(j.storeName,"readwrite").objectStore(j.storeName),e=b.clear();e.onsuccess=function(){a&&a(),c()},e.onerror=function(){a&&a(null,e.error.name),d(e.error.name)}})})}function f(a){var b=this;return new h(function(c,d){b.ready().then(function(){var b=i.transaction(j.storeName,"readonly").objectStore(j.storeName),e=b.count();e.onsuccess=function(){a&&a(e.result),c(e.result)},e.onerror=function(){a&&a(null,e.error.name),d(e.error.name)}})})}function g(a,b){var c=this;return new h(function(d,e){return 0>a?(b&&b(null),void d(null)):void c.ready().then(function(){var c=i.transaction(j.storeName,"readonly").objectStore(j.storeName),f=!1,g=c.openCursor();g.onsuccess=function(){var c=g.result;return c?void(0===a?(b&&b(c.key),d(c.key)):f?(b&&b(c.key),d(c.key)):(f=!0,c.advance(a))):(b&&b(null),void d(null))},g.onerror=function(){b&&b(null,g.error.name),e(g.error.name)}})})}var h="undefined"!=typeof module&&module.exports?require("promise"):this.Promise,i=null,j={},k=k||this.indexedDB||this.webkitIndexedDB||this.mozIndexedDB||this.OIndexedDB||this.msIndexedDB;if(k){var l={_driver:"asyncStorage",_initStorage:a,getItem:b,setItem:c,removeItem:d,clear:e,length:f,key:g};"function"==typeof define&&define.amd?define("asyncStorage",function(){return l}):"undefined"!=typeof module&&module.exports?module.exports=l:this.asyncStorage=l}}.call(this),function(){"use strict";function a(a){if(a)for(var b in a)l[b]=a[b];return k=l.name+"/",m.resolve()}function b(a){var b=this;return new m(function(c){b.ready().then(function(){n.clear(),a&&a(),c()})})}function c(a,b){var c=this;return new m(function(d,e){c.ready().then(function(){try{var c=n.getItem(k+a);c&&(c=g(c)),b&&b(c,null),d(c)}catch(f){b&&b(null,f),e(f)}})})}function d(a,b){var c=this;return new m(function(d){c.ready().then(function(){var c=n.key(a);c&&(c=c.substring(k.length)),b&&b(c),d(c)})})}function e(a){var b=this;return new m(function(c){b.ready().then(function(){var b=n.length;a&&a(b),c(b)})})}function f(a,b){var c=this;return new m(function(d){c.ready().then(function(){n.removeItem(k+a),b&&b(),d()})})}function g(a){if(a.substring(0,q)!==p)return JSON.parse(a);for(var b=a.substring(C),c=a.substring(q,C),d=new ArrayBuffer(2*b.length),e=new Uint16Array(d),f=b.length-1;f>=0;f--)e[f]=b.charCodeAt(f);switch(c){case r:return d;case s:return new Blob([d]);case t:return new Int8Array(d);case u:return new Uint8Array(d);case v:return new Uint8ClampedArray(d);case w:return new Int16Array(d);case y:return new Uint16Array(d);case x:return new Int32Array(d);case z:return new Uint32Array(d);case A:return new Float32Array(d);case B:return new Float64Array(d);default:throw new Error("Unkown type: "+c)}}function h(a){var b="",c=new Uint16Array(a);try{b=String.fromCharCode.apply(null,c)}catch(d){for(var e=0;e<c.length;e++)b+=String.fromCharCode(c[e])}return b}function i(a,b){var c="";if(a&&(c=a.toString()),a&&("[object ArrayBuffer]"===a.toString()||a.buffer&&"[object ArrayBuffer]"===a.buffer.toString())){var d,e=p;a instanceof ArrayBuffer?(d=a,e+=r):(d=a.buffer,"[object Int8Array]"===c?e+=t:"[object Uint8Array]"===c?e+=u:"[object Uint8ClampedArray]"===c?e+=v:"[object Int16Array]"===c?e+=w:"[object Uint16Array]"===c?e+=y:"[object Int32Array]"===c?e+=x:"[object Uint32Array]"===c?e+=z:"[object Float32Array]"===c?e+=A:"[object Float64Array]"===c?e+=B:b(new Error("Failed to get type for BinaryArray"))),b(e+h(d))}else if("[object Blob]"===c){var f=new FileReader;f.onload=function(){var a=h(this.result);b(p+s+a)},f.readAsArrayBuffer(a)}else try{b(JSON.stringify(a))}catch(g){window.console&&window.console.error&&window.console.error("Couldn't convert value into a JSON string: ",a),b(null,g)}}function j(a,b,c){var d=this;return new m(function(e,f){d.ready().then(function(){void 0===b&&(b=null);var d=b;i(b,function(b,g){if(g)c&&c(null,g),f(g);else{try{n.setItem(k+a,b)}catch(h){("QuotaExceededError"===h.name||"NS_ERROR_DOM_QUOTA_REACHED"===h.name)&&(c&&c(null,h),f(h))}c&&c(d),e(d)}})})})}var k="",l={},m="undefined"!=typeof module&&module.exports?require("promise"):this.Promise,n=null;try{n=this.localStorage}catch(o){return}var p="__lfsc__:",q=p.length,r="arbf",s="blob",t="si08",u="ui08",v="uic8",w="si16",x="si32",y="ur16",z="ui32",A="fl32",B="fl64",C=q+r.length,D={_driver:"localStorageWrapper",_initStorage:a,getItem:c,setItem:j,removeItem:f,clear:b,length:e,key:d};"function"==typeof define&&define.amd?define("localStorageWrapper",function(){return D}):"undefined"!=typeof module&&module.exports?module.exports=D:this.localStorageWrapper=D}.call(this),function(){"use strict";function a(a){var b=this;if(a)for(var c in o)o[c]="string"!=typeof a[c]?a[c].toString():a[c];return new l(function(a){try{n=m(o.name,o.version,o.description,o.size)}catch(c){return b.setDriver("localStorageWrapper").then(a)}n.transaction(function(b){b.executeSql("CREATE TABLE IF NOT EXISTS "+o.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],function(){a()},null)})})}function b(a,b){var c=this;return new l(function(d,e){c.ready().then(function(){n.transaction(function(c){c.executeSql("SELECT * FROM "+o.storeName+" WHERE key = ? LIMIT 1",[a],function(a,c){var e=c.rows.length?c.rows.item(0).value:null;e&&(e=i(e)),b&&b(e),d(e)},function(a,c){b&&b(null,c),e(c)})})})})}function c(a,b,c){var d=this;return new l(function(e,f){d.ready().then(function(){void 0===b&&(b=null);var d=b;j(b,function(b,g){g?f(g):n.transaction(function(g){g.executeSql("INSERT OR REPLACE INTO "+o.storeName+" (key, value) VALUES (?, ?)",[a,b],function(){c&&c(d),e(d)},function(a,b){c&&c(null,b),f(b)})},function(a){a.code===a.QUOTA_ERR&&(c&&c(null,a),f(a))})})})})}function d(a,b){var c=this;return new l(function(d,e){c.ready().then(function(){n.transaction(function(c){c.executeSql("DELETE FROM "+o.storeName+" WHERE key = ?",[a],function(){b&&b(),d()},function(a,c){b&&b(c),e(c)})})})})}function e(a){var b=this;return new l(function(c,d){b.ready().then(function(){n.transaction(function(b){b.executeSql("DELETE FROM "+o.storeName,[],function(){a&&a(),c()},function(b,c){a&&a(c),d(c)})})})})}function f(a){var b=this;return new l(function(c,d){b.ready().then(function(){n.transaction(function(b){b.executeSql("SELECT COUNT(key) as c FROM "+o.storeName,[],function(b,d){var e=d.rows.item(0).c;a&&a(e),c(e)},function(b,c){a&&a(null,c),d(c)})})})})}function g(a,b){var c=this;return new l(function(d,e){c.ready().then(function(){n.transaction(function(c){c.executeSql("SELECT key FROM "+o.storeName+" WHERE id = ? LIMIT 1",[a+1],function(a,c){var e=c.rows.length?c.rows.item(0).key:null;b&&b(e),d(e)},function(a,c){b&&b(null,c),e(c)})})})})}function h(a){var b,c=new Uint8Array(a),d="";for(b=0;b<c.length;b+=3)d+=k[c[b]>>2],d+=k[(3&c[b])<<4|c[b+1]>>4],d+=k[(15&c[b+1])<<2|c[b+2]>>6],d+=k[63&c[b+2]];return c.length%3===2?d=d.substring(0,d.length-1)+"=":c.length%3===1&&(d=d.substring(0,d.length-2)+"=="),d}function i(a){if(a.substring(0,q)!==p)return JSON.parse(a);var b,c,d,e,f,g=a.substring(C),h=a.substring(q,C),i=.75*g.length,j=g.length,l=0;"="===g[g.length-1]&&(i--,"="===g[g.length-2]&&i--);var m=new ArrayBuffer(i),n=new Uint8Array(m);for(b=0;j>b;b+=4)c=k.indexOf(g[b]),d=k.indexOf(g[b+1]),e=k.indexOf(g[b+2]),f=k.indexOf(g[b+3]),n[l++]=c<<2|d>>4,n[l++]=(15&d)<<4|e>>2,n[l++]=(3&e)<<6|63&f;switch(h){case r:return m;case s:return new Blob([m]);case t:return new Int8Array(m);case u:return new Uint8Array(m);case v:return new Uint8ClampedArray(m);case w:return new Int16Array(m);case y:return new Uint16Array(m);case x:return new Int32Array(m);case z:return new Uint32Array(m);case A:return new Float32Array(m);case B:return new Float64Array(m);default:throw new Error("Unkown type: "+h)}}function j(a,b){var c="";if(a&&(c=a.toString()),a&&("[object ArrayBuffer]"===a.toString()||a.buffer&&"[object ArrayBuffer]"===a.buffer.toString())){var d,e=p;a instanceof ArrayBuffer?(d=a,e+=r):(d=a.buffer,"[object Int8Array]"===c?e+=t:"[object Uint8Array]"===c?e+=u:"[object Uint8ClampedArray]"===c?e+=v:"[object Int16Array]"===c?e+=w:"[object Uint16Array]"===c?e+=y:"[object Int32Array]"===c?e+=x:"[object Uint32Array]"===c?e+=z:"[object Float32Array]"===c?e+=A:"[object Float64Array]"===c?e+=B:b(new Error("Failed to get type for BinaryArray"))),b(e+h(d))}else if("[object Blob]"===c){var f=new FileReader;f.onload=function(){var a=h(this.result);b(p+s+a)},f.readAsArrayBuffer(a)}else try{b(JSON.stringify(a))}catch(g){window.console&&window.console.error&&window.console.error("Couldn't convert value into a JSON string: ",a),b(null,g)}}var k="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",l="undefined"!=typeof module&&module.exports?require("promise"):this.Promise,m=this.openDatabase,n=null,o={},p="__lfsc__:",q=p.length,r="arbf",s="blob",t="si08",u="ui08",v="uic8",w="si16",x="si32",y="ur16",z="ui32",A="fl32",B="fl64",C=q+r.length;if(m){var D={_driver:"webSQLStorage",_initStorage:a,getItem:b,setItem:c,removeItem:d,clear:e,length:f,key:g};"function"==typeof define&&define.amd?define("webSQLStorage",function(){return D}):"undefined"!=typeof module&&module.exports?module.exports=D:this.webSQLStorage=D}}.call(this),function(){"use strict";var a="undefined"!=typeof module&&module.exports?require("promise"):this.Promise,b=1,c=2,d=3,e=d;"function"==typeof define&&define.amd?e=b:"undefined"!=typeof module&&module.exports&&(e=c);var f,g=g||this.indexedDB||this.webkitIndexedDB||this.mozIndexedDB||this.OIndexedDB||this.msIndexedDB,h=this.openDatabase,i=this,j={INDEXEDDB:"asyncStorage",LOCALSTORAGE:"localStorageWrapper",WEBSQL:"webSQLStorage",_config:{description:"",name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1},config:function(a){if("object"==typeof a){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var b in a)this._config[b]=a[b];return!0}return"string"==typeof a?this._config[a]:this._config},driver:function(){return this._driver||null},_ready:a.reject(new Error("setDriver() wasn't called")),setDriver:function(d,f){var k=new a(function(a,f){if(!g&&d===j.INDEXEDDB||!h&&d===j.WEBSQL)return void f(j);if(j._ready=null,e===b)return void require([d],function(b){j._extend(b),a(j)});if(e===c){var k;switch(d){case j.INDEXEDDB:k=require("./drivers/indexeddb");break;case j.LOCALSTORAGE:k=require("./drivers/localstorage");break;case j.WEBSQL:k=require("./drivers/websql")}j._extend(k)}else j._extend(i[d]);a(j)});return k.then(f,f),k},ready:function(a){return null===this._ready&&(this._ready=this._initStorage(this._config)),this._ready.then(a,a),this._ready},_extend:function(a){for(var b in a)a.hasOwnProperty(b)&&(this[b]=a[b])}};f=g&&null===g.open("_localforage_spec_test",1).onupgradeneeded?j.INDEXEDDB:h?j.WEBSQL:j.LOCALSTORAGE,this.localForageConfig&&(j.config=this.localForageConfig),j.setDriver(f),e===b?define(function(){return j}):e===c?module.exports=j:this.localforage=j}.call(this);

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

!function(){var a,b,c,d;!function(){var e={},f={};a=function(a,b,c){e[a]={deps:b,callback:c}},d=c=b=function(a){function c(b){if("."!==b.charAt(0))return b;for(var c=b.split("/"),d=a.split("/").slice(0,-1),e=0,f=c.length;f>e;e++){var g=c[e];if(".."===g)d.pop();else{if("."===g)continue;d.push(g)}}return d.join("/")}if(d._eak_seen=e,f[a])return f[a];if(f[a]={},!e[a])throw new Error("Could not find module "+a);for(var g,h=e[a],i=h.deps,j=h.callback,k=[],l=0,m=i.length;m>l;l++)k.push("exports"===i[l]?g={}:b(c(i[l])));var n=j.apply(this,k);return f[a]=g||n}}(),a("promise/all",["./utils","exports"],function(a,b){"use strict";function c(a){var b=this;if(!d(a))throw new TypeError("You must pass an array to all.");return new b(function(b,c){function d(a){return function(b){f(a,b)}}function f(a,c){h[a]=c,0===--i&&b(h)}var g,h=[],i=a.length;0===i&&b([]);for(var j=0;j<a.length;j++)g=a[j],g&&e(g.then)?g.then(d(j),c):f(j,g)})}var d=a.isArray,e=a.isFunction;b.all=c}),a("promise/asap",["exports"],function(a){"use strict";function b(){return function(){process.nextTick(e)}}function c(){var a=0,b=new i(e),c=document.createTextNode("");return b.observe(c,{characterData:!0}),function(){c.data=a=++a%2}}function d(){return function(){j.setTimeout(e,1)}}function e(){for(var a=0;a<k.length;a++){var b=k[a],c=b[0],d=b[1];c(d)}k=[]}function f(a,b){var c=k.push([a,b]);1===c&&g()}var g,h="undefined"!=typeof window?window:{},i=h.MutationObserver||h.WebKitMutationObserver,j="undefined"!=typeof global?global:this,k=[];g="undefined"!=typeof process&&"[object process]"==={}.toString.call(process)?b():i?c():d(),a.asap=f}),a("promise/cast",["exports"],function(a){"use strict";function b(a){if(a&&"object"==typeof a&&a.constructor===this)return a;var b=this;return new b(function(b){b(a)})}a.cast=b}),a("promise/config",["exports"],function(a){"use strict";function b(a,b){return 2!==arguments.length?c[a]:void(c[a]=b)}var c={instrument:!1};a.config=c,a.configure=b}),a("promise/polyfill",["./promise","./utils","exports"],function(a,b,c){"use strict";function d(){var a="Promise"in window&&"cast"in window.Promise&&"resolve"in window.Promise&&"reject"in window.Promise&&"all"in window.Promise&&"race"in window.Promise&&function(){var a;return new window.Promise(function(b){a=b}),f(a)}();a||(window.Promise=e)}var e=a.Promise,f=b.isFunction;c.polyfill=d}),a("promise/promise",["./config","./utils","./cast","./all","./race","./resolve","./reject","./asap","exports"],function(a,b,c,d,e,f,g,h,i){"use strict";function j(a){if(!w(a))throw new TypeError("You must pass a resolver function as the first argument to the promise constructor");if(!(this instanceof j))throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.");this._subscribers=[],k(a,this)}function k(a,b){function c(a){p(b,a)}function d(a){r(b,a)}try{a(c,d)}catch(e){d(e)}}function l(a,b,c,d){var e,f,g,h,i=w(c);if(i)try{e=c(d),g=!0}catch(j){h=!0,f=j}else e=d,g=!0;o(b,e)||(i&&g?p(b,e):h?r(b,f):a===F?p(b,e):a===G&&r(b,e))}function m(a,b,c,d){var e=a._subscribers,f=e.length;e[f]=b,e[f+F]=c,e[f+G]=d}function n(a,b){for(var c,d,e=a._subscribers,f=a._detail,g=0;g<e.length;g+=3)c=e[g],d=e[g+b],l(b,c,d,f);a._subscribers=null}function o(a,b){var c,d=null;try{if(a===b)throw new TypeError("A promises callback cannot return that same promise.");if(v(b)&&(d=b.then,w(d)))return d.call(b,function(d){return c?!0:(c=!0,void(b!==d?p(a,d):q(a,d)))},function(b){return c?!0:(c=!0,void r(a,b))}),!0}catch(e){return c?!0:(r(a,e),!0)}return!1}function p(a,b){a===b?q(a,b):o(a,b)||q(a,b)}function q(a,b){a._state===D&&(a._state=E,a._detail=b,u.async(s,a))}function r(a,b){a._state===D&&(a._state=E,a._detail=b,u.async(t,a))}function s(a){n(a,a._state=F)}function t(a){n(a,a._state=G)}var u=a.config,v=(a.configure,b.objectOrFunction),w=b.isFunction,x=(b.now,c.cast),y=d.all,z=e.race,A=f.resolve,B=g.reject,C=h.asap;u.async=C;var D=void 0,E=0,F=1,G=2;j.prototype={constructor:j,_state:void 0,_detail:void 0,_subscribers:void 0,then:function(a,b){var c=this,d=new this.constructor(function(){});if(this._state){var e=arguments;u.async(function(){l(c._state,d,e[c._state-1],c._detail)})}else m(this,d,a,b);return d},"catch":function(a){return this.then(null,a)}},j.all=y,j.cast=x,j.race=z,j.resolve=A,j.reject=B,i.Promise=j}),a("promise/race",["./utils","exports"],function(a,b){"use strict";function c(a){var b=this;if(!d(a))throw new TypeError("You must pass an array to race.");return new b(function(b,c){for(var d,e=0;e<a.length;e++)d=a[e],d&&"function"==typeof d.then?d.then(b,c):b(d)})}var d=a.isArray;b.race=c}),a("promise/reject",["exports"],function(a){"use strict";function b(a){var b=this;return new b(function(b,c){c(a)})}a.reject=b}),a("promise/resolve",["exports"],function(a){"use strict";function b(a){var b=this;return new b(function(b){b(a)})}a.resolve=b}),a("promise/utils",["exports"],function(a){"use strict";function b(a){return c(a)||"object"==typeof a&&null!==a}function c(a){return"function"==typeof a}function d(a){return"[object Array]"===Object.prototype.toString.call(a)}var e=Date.now||function(){return(new Date).getTime()};a.objectOrFunction=b,a.isFunction=c,a.isArray=d,a.now=e}),b("promise/polyfill").polyfill()}(),function(){"use strict";function a(a){if(a)for(var b in a)j[b]=a[b];return new h(function(a,b){var c=k.open(j.name,j.version);c.onerror=function(){b(c.error.name)},c.onupgradeneeded=function(){c.result.createObjectStore(j.storeName)},c.onsuccess=function(){i=c.result,a()}})}function b(a,b){var c=this;return new h(function(d,e){c.ready().then(function(){var c=i.transaction(j.storeName,"readonly").objectStore(j.storeName),f=c.get(a);f.onsuccess=function(){var a=f.result;void 0===a&&(a=null),b&&b(a),d(a)},f.onerror=function(){b&&b(null,f.error.name),e(f.error.name)}})})}function c(a,b,c){var d=this;return new h(function(e,f){d.ready().then(function(){var d=i.transaction(j.storeName,"readwrite").objectStore(j.storeName);void 0===b&&(b=null);var g=d.put(b,a);g.onsuccess=function(){c&&c(b),e(b)},g.onerror=function(){c&&c(null,g.error.name),f(g.error.name)}})})}function d(a,b){var c=this;return new h(function(d,e){c.ready().then(function(){var c=i.transaction(j.storeName,"readwrite").objectStore(j.storeName),f=c["delete"](a);f.onsuccess=function(){b&&b(),d()},f.onerror=function(){b&&b(f.error.name),e(f.error.name)},f.onabort=function(a){var c=a.target.error;"QuotaExceededError"===c.name&&(b&&b(c.name),e(c.name))}})})}function e(a){var b=this;return new h(function(c,d){b.ready().then(function(){var b=i.transaction(j.storeName,"readwrite").objectStore(j.storeName),e=b.clear();e.onsuccess=function(){a&&a(),c()},e.onerror=function(){a&&a(null,e.error.name),d(e.error.name)}})})}function f(a){var b=this;return new h(function(c,d){b.ready().then(function(){var b=i.transaction(j.storeName,"readonly").objectStore(j.storeName),e=b.count();e.onsuccess=function(){a&&a(e.result),c(e.result)},e.onerror=function(){a&&a(null,e.error.name),d(e.error.name)}})})}function g(a,b){var c=this;return new h(function(d,e){return 0>a?(b&&b(null),void d(null)):void c.ready().then(function(){var c=i.transaction(j.storeName,"readonly").objectStore(j.storeName),f=!1,g=c.openCursor();g.onsuccess=function(){var c=g.result;return c?void(0===a?(b&&b(c.key),d(c.key)):f?(b&&b(c.key),d(c.key)):(f=!0,c.advance(a))):(b&&b(null),void d(null))},g.onerror=function(){b&&b(null,g.error.name),e(g.error.name)}})})}var h=this.Promise,i=null,j={},k=k||this.indexedDB||this.webkitIndexedDB||this.mozIndexedDB||this.OIndexedDB||this.msIndexedDB;if(k){var l={_driver:"asyncStorage",_initStorage:a,getItem:b,setItem:c,removeItem:d,clear:e,length:f,key:g};"function"==typeof define&&define.amd?define("asyncStorage",function(){return l}):"undefined"!=typeof module&&module.exports?module.exports=l:this.asyncStorage=l}}.call(this),function(){"use strict";function a(a){if(a)for(var b in a)l[b]=a[b];return k=l.name+"/",m.resolve()}function b(a){var b=this;return new m(function(c){b.ready().then(function(){n.clear(),a&&a(),c()})})}function c(a,b){var c=this;return new m(function(d,e){c.ready().then(function(){try{var c=n.getItem(k+a);c&&(c=g(c)),b&&b(c,null),d(c)}catch(f){b&&b(null,f),e(f)}})})}function d(a,b){var c=this;return new m(function(d){c.ready().then(function(){var c=n.key(a);c&&(c=c.substring(k.length)),b&&b(c),d(c)})})}function e(a){var b=this;return new m(function(c){b.ready().then(function(){var b=n.length;a&&a(b),c(b)})})}function f(a,b){var c=this;return new m(function(d){c.ready().then(function(){n.removeItem(k+a),b&&b(),d()})})}function g(a){if(a.substring(0,q)!==p)return JSON.parse(a);for(var b=a.substring(C),c=a.substring(q,C),d=new ArrayBuffer(2*b.length),e=new Uint16Array(d),f=b.length-1;f>=0;f--)e[f]=b.charCodeAt(f);switch(c){case r:return d;case s:return new Blob([d]);case t:return new Int8Array(d);case u:return new Uint8Array(d);case v:return new Uint8ClampedArray(d);case w:return new Int16Array(d);case y:return new Uint16Array(d);case x:return new Int32Array(d);case z:return new Uint32Array(d);case A:return new Float32Array(d);case B:return new Float64Array(d);default:throw new Error("Unkown type: "+c)}}function h(a){var b="",c=new Uint16Array(a);try{b=String.fromCharCode.apply(null,c)}catch(d){for(var e=0;e<c.length;e++)b+=String.fromCharCode(c[e])}return b}function i(a,b){var c="";if(a&&(c=a.toString()),a&&("[object ArrayBuffer]"===a.toString()||a.buffer&&"[object ArrayBuffer]"===a.buffer.toString())){var d,e=p;a instanceof ArrayBuffer?(d=a,e+=r):(d=a.buffer,"[object Int8Array]"===c?e+=t:"[object Uint8Array]"===c?e+=u:"[object Uint8ClampedArray]"===c?e+=v:"[object Int16Array]"===c?e+=w:"[object Uint16Array]"===c?e+=y:"[object Int32Array]"===c?e+=x:"[object Uint32Array]"===c?e+=z:"[object Float32Array]"===c?e+=A:"[object Float64Array]"===c?e+=B:b(new Error("Failed to get type for BinaryArray"))),b(e+h(d))}else if("[object Blob]"===c){var f=new FileReader;f.onload=function(){var a=h(this.result);b(p+s+a)},f.readAsArrayBuffer(a)}else try{b(JSON.stringify(a))}catch(g){window.console&&window.console.error&&window.console.error("Couldn't convert value into a JSON string: ",a),b(null,g)}}function j(a,b,c){var d=this;return new m(function(e,f){d.ready().then(function(){void 0===b&&(b=null);var d=b;i(b,function(b,g){if(g)c&&c(null,g),f(g);else{try{n.setItem(k+a,b)}catch(h){("QuotaExceededError"===h.name||"NS_ERROR_DOM_QUOTA_REACHED"===h.name)&&(c&&c(null,h),f(h))}c&&c(d),e(d)}})})})}var k="",l={},m=this.Promise,n=null;try{n=this.localStorage}catch(o){return}var p="__lfsc__:",q=p.length,r="arbf",s="blob",t="si08",u="ui08",v="uic8",w="si16",x="si32",y="ur16",z="ui32",A="fl32",B="fl64",C=q+r.length,D={_driver:"localStorageWrapper",_initStorage:a,getItem:c,setItem:j,removeItem:f,clear:b,length:e,key:d};"function"==typeof define&&define.amd?define("localStorageWrapper",function(){return D}):"undefined"!=typeof module&&module.exports?module.exports=D:this.localStorageWrapper=D}.call(this),function(){"use strict";function a(a){var b=this;if(a)for(var c in o)o[c]="string"!=typeof a[c]?a[c].toString():a[c];return new l(function(a){try{n=m(o.name,o.version,o.description,o.size)}catch(c){return b.setDriver("localStorageWrapper").then(a)}n.transaction(function(b){b.executeSql("CREATE TABLE IF NOT EXISTS "+o.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],function(){a()},null)})})}function b(a,b){var c=this;return new l(function(d,e){c.ready().then(function(){n.transaction(function(c){c.executeSql("SELECT * FROM "+o.storeName+" WHERE key = ? LIMIT 1",[a],function(a,c){var e=c.rows.length?c.rows.item(0).value:null;e&&(e=i(e)),b&&b(e),d(e)},function(a,c){b&&b(null,c),e(c)})})})})}function c(a,b,c){var d=this;return new l(function(e,f){d.ready().then(function(){void 0===b&&(b=null);var d=b;j(b,function(b,g){g?f(g):n.transaction(function(g){g.executeSql("INSERT OR REPLACE INTO "+o.storeName+" (key, value) VALUES (?, ?)",[a,b],function(){c&&c(d),e(d)},function(a,b){c&&c(null,b),f(b)})},function(a){a.code===a.QUOTA_ERR&&(c&&c(null,a),f(a))})})})})}function d(a,b){var c=this;return new l(function(d,e){c.ready().then(function(){n.transaction(function(c){c.executeSql("DELETE FROM "+o.storeName+" WHERE key = ?",[a],function(){b&&b(),d()},function(a,c){b&&b(c),e(c)})})})})}function e(a){var b=this;return new l(function(c,d){b.ready().then(function(){n.transaction(function(b){b.executeSql("DELETE FROM "+o.storeName,[],function(){a&&a(),c()},function(b,c){a&&a(c),d(c)})})})})}function f(a){var b=this;return new l(function(c,d){b.ready().then(function(){n.transaction(function(b){b.executeSql("SELECT COUNT(key) as c FROM "+o.storeName,[],function(b,d){var e=d.rows.item(0).c;a&&a(e),c(e)},function(b,c){a&&a(null,c),d(c)})})})})}function g(a,b){var c=this;return new l(function(d,e){c.ready().then(function(){n.transaction(function(c){c.executeSql("SELECT key FROM "+o.storeName+" WHERE id = ? LIMIT 1",[a+1],function(a,c){var e=c.rows.length?c.rows.item(0).key:null;b&&b(e),d(e)},function(a,c){b&&b(null,c),e(c)})})})})}function h(a){var b,c=new Uint8Array(a),d="";for(b=0;b<c.length;b+=3)d+=k[c[b]>>2],d+=k[(3&c[b])<<4|c[b+1]>>4],d+=k[(15&c[b+1])<<2|c[b+2]>>6],d+=k[63&c[b+2]];return c.length%3===2?d=d.substring(0,d.length-1)+"=":c.length%3===1&&(d=d.substring(0,d.length-2)+"=="),d}function i(a){if(a.substring(0,q)!==p)return JSON.parse(a);var b,c,d,e,f,g=a.substring(C),h=a.substring(q,C),i=.75*g.length,j=g.length,l=0;"="===g[g.length-1]&&(i--,"="===g[g.length-2]&&i--);var m=new ArrayBuffer(i),n=new Uint8Array(m);for(b=0;j>b;b+=4)c=k.indexOf(g[b]),d=k.indexOf(g[b+1]),e=k.indexOf(g[b+2]),f=k.indexOf(g[b+3]),n[l++]=c<<2|d>>4,n[l++]=(15&d)<<4|e>>2,n[l++]=(3&e)<<6|63&f;switch(h){case r:return m;case s:return new Blob([m]);case t:return new Int8Array(m);case u:return new Uint8Array(m);case v:return new Uint8ClampedArray(m);case w:return new Int16Array(m);case y:return new Uint16Array(m);case x:return new Int32Array(m);case z:return new Uint32Array(m);case A:return new Float32Array(m);case B:return new Float64Array(m);default:throw new Error("Unkown type: "+h)}}function j(a,b){var c="";if(a&&(c=a.toString()),a&&("[object ArrayBuffer]"===a.toString()||a.buffer&&"[object ArrayBuffer]"===a.buffer.toString())){var d,e=p;a instanceof ArrayBuffer?(d=a,e+=r):(d=a.buffer,"[object Int8Array]"===c?e+=t:"[object Uint8Array]"===c?e+=u:"[object Uint8ClampedArray]"===c?e+=v:"[object Int16Array]"===c?e+=w:"[object Uint16Array]"===c?e+=y:"[object Int32Array]"===c?e+=x:"[object Uint32Array]"===c?e+=z:"[object Float32Array]"===c?e+=A:"[object Float64Array]"===c?e+=B:b(new Error("Failed to get type for BinaryArray"))),b(e+h(d))}else if("[object Blob]"===c){var f=new FileReader;f.onload=function(){var a=h(this.result);b(p+s+a)},f.readAsArrayBuffer(a)}else try{b(JSON.stringify(a))}catch(g){window.console&&window.console.error&&window.console.error("Couldn't convert value into a JSON string: ",a),b(null,g)}}var k="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",l=this.Promise,m=this.openDatabase,n=null,o={},p="__lfsc__:",q=p.length,r="arbf",s="blob",t="si08",u="ui08",v="uic8",w="si16",x="si32",y="ur16",z="ui32",A="fl32",B="fl64",C=q+r.length;if(m){var D={_driver:"webSQLStorage",_initStorage:a,getItem:b,setItem:c,removeItem:d,clear:e,length:f,key:g};"function"==typeof define&&define.amd?define("webSQLStorage",function(){return D}):"undefined"!=typeof module&&module.exports?module.exports=D:this.webSQLStorage=D}}.call(this),function(){"use strict";var a=this.Promise,b=1,c=2,d=3,e=d;"function"==typeof define&&define.amd?e=b:"undefined"!=typeof module&&module.exports&&(e=c);var f,g=g||this.indexedDB||this.webkitIndexedDB||this.mozIndexedDB||this.OIndexedDB||this.msIndexedDB,h=this.openDatabase,i=this,j={INDEXEDDB:"asyncStorage",LOCALSTORAGE:"localStorageWrapper",WEBSQL:"webSQLStorage",_config:{description:"",name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1},config:function(a){if("object"==typeof a){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var b in a)this._config[b]=a[b];return!0}return"string"==typeof a?this._config[a]:this._config},driver:function(){return this._driver||null},_ready:a.reject(new Error("setDriver() wasn't called")),setDriver:function(d,f){var k=new a(function(a,f){if(!g&&d===j.INDEXEDDB||!h&&d===j.WEBSQL)return void f(j);if(j._ready=null,e===b)return void require([d],function(b){j._extend(b),a(j)});if(e===c){var k;switch(d){case j.INDEXEDDB:k=require("localforage/src/drivers/indexeddb");break;case j.LOCALSTORAGE:k=require("localforage/src/drivers/localstorage");break;case j.WEBSQL:k=require("localforage/src/drivers/websql")}j._extend(k)}else j._extend(i[d]);a(j)});return k.then(f,f),k},ready:function(a){return null===this._ready&&(this._ready=this._initStorage(this._config)),this._ready.then(a,a),this._ready},_extend:function(a){for(var b in a)a.hasOwnProperty(b)&&(this[b]=a[b])}};f=g&&null===g.open("_localforage_spec_test",1).onupgradeneeded?j.INDEXEDDB:h?j.WEBSQL:j.LOCALSTORAGE,this.localForageConfig&&(j.config=this.localForageConfig),j.setDriver(f),e===b?define(function(){return j}):e===c?module.exports=j:this.localforage=j}.call(this);
!function(){var a,b,c,d;!function(){var e={},f={};a=function(a,b,c){e[a]={deps:b,callback:c}},d=c=b=function(a){function c(b){if("."!==b.charAt(0))return b;for(var c=b.split("/"),d=a.split("/").slice(0,-1),e=0,f=c.length;f>e;e++){var g=c[e];if(".."===g)d.pop();else{if("."===g)continue;d.push(g)}}return d.join("/")}if(d._eak_seen=e,f[a])return f[a];if(f[a]={},!e[a])throw new Error("Could not find module "+a);for(var g,h=e[a],i=h.deps,j=h.callback,k=[],l=0,m=i.length;m>l;l++)k.push("exports"===i[l]?g={}:b(c(i[l])));var n=j.apply(this,k);return f[a]=g||n}}(),a("promise/all",["./utils","exports"],function(a,b){"use strict";function c(a){var b=this;if(!d(a))throw new TypeError("You must pass an array to all.");return new b(function(b,c){function d(a){return function(b){f(a,b)}}function f(a,c){h[a]=c,0===--i&&b(h)}var g,h=[],i=a.length;0===i&&b([]);for(var j=0;j<a.length;j++)g=a[j],g&&e(g.then)?g.then(d(j),c):f(j,g)})}var d=a.isArray,e=a.isFunction;b.all=c}),a("promise/asap",["exports"],function(a){"use strict";function b(){return function(){process.nextTick(e)}}function c(){var a=0,b=new i(e),c=document.createTextNode("");return b.observe(c,{characterData:!0}),function(){c.data=a=++a%2}}function d(){return function(){j.setTimeout(e,1)}}function e(){for(var a=0;a<k.length;a++){var b=k[a],c=b[0],d=b[1];c(d)}k=[]}function f(a,b){var c=k.push([a,b]);1===c&&g()}var g,h="undefined"!=typeof window?window:{},i=h.MutationObserver||h.WebKitMutationObserver,j="undefined"!=typeof global?global:this,k=[];g="undefined"!=typeof process&&"[object process]"==={}.toString.call(process)?b():i?c():d(),a.asap=f}),a("promise/cast",["exports"],function(a){"use strict";function b(a){if(a&&"object"==typeof a&&a.constructor===this)return a;var b=this;return new b(function(b){b(a)})}a.cast=b}),a("promise/config",["exports"],function(a){"use strict";function b(a,b){return 2!==arguments.length?c[a]:void(c[a]=b)}var c={instrument:!1};a.config=c,a.configure=b}),a("promise/polyfill",["./promise","./utils","exports"],function(a,b,c){"use strict";function d(){var a="Promise"in window&&"cast"in window.Promise&&"resolve"in window.Promise&&"reject"in window.Promise&&"all"in window.Promise&&"race"in window.Promise&&function(){var a;return new window.Promise(function(b){a=b}),f(a)}();a||(window.Promise=e)}var e=a.Promise,f=b.isFunction;c.polyfill=d}),a("promise/promise",["./config","./utils","./cast","./all","./race","./resolve","./reject","./asap","exports"],function(a,b,c,d,e,f,g,h,i){"use strict";function j(a){if(!w(a))throw new TypeError("You must pass a resolver function as the first argument to the promise constructor");if(!(this instanceof j))throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.");this._subscribers=[],k(a,this)}function k(a,b){function c(a){p(b,a)}function d(a){r(b,a)}try{a(c,d)}catch(e){d(e)}}function l(a,b,c,d){var e,f,g,h,i=w(c);if(i)try{e=c(d),g=!0}catch(j){h=!0,f=j}else e=d,g=!0;o(b,e)||(i&&g?p(b,e):h?r(b,f):a===F?p(b,e):a===G&&r(b,e))}function m(a,b,c,d){var e=a._subscribers,f=e.length;e[f]=b,e[f+F]=c,e[f+G]=d}function n(a,b){for(var c,d,e=a._subscribers,f=a._detail,g=0;g<e.length;g+=3)c=e[g],d=e[g+b],l(b,c,d,f);a._subscribers=null}function o(a,b){var c,d=null;try{if(a===b)throw new TypeError("A promises callback cannot return that same promise.");if(v(b)&&(d=b.then,w(d)))return d.call(b,function(d){return c?!0:(c=!0,void(b!==d?p(a,d):q(a,d)))},function(b){return c?!0:(c=!0,void r(a,b))}),!0}catch(e){return c?!0:(r(a,e),!0)}return!1}function p(a,b){a===b?q(a,b):o(a,b)||q(a,b)}function q(a,b){a._state===D&&(a._state=E,a._detail=b,u.async(s,a))}function r(a,b){a._state===D&&(a._state=E,a._detail=b,u.async(t,a))}function s(a){n(a,a._state=F)}function t(a){n(a,a._state=G)}var u=a.config,v=(a.configure,b.objectOrFunction),w=b.isFunction,x=(b.now,c.cast),y=d.all,z=e.race,A=f.resolve,B=g.reject,C=h.asap;u.async=C;var D=void 0,E=0,F=1,G=2;j.prototype={constructor:j,_state:void 0,_detail:void 0,_subscribers:void 0,then:function(a,b){var c=this,d=new this.constructor(function(){});if(this._state){var e=arguments;u.async(function(){l(c._state,d,e[c._state-1],c._detail)})}else m(this,d,a,b);return d},"catch":function(a){return this.then(null,a)}},j.all=y,j.cast=x,j.race=z,j.resolve=A,j.reject=B,i.Promise=j}),a("promise/race",["./utils","exports"],function(a,b){"use strict";function c(a){var b=this;if(!d(a))throw new TypeError("You must pass an array to race.");return new b(function(b,c){for(var d,e=0;e<a.length;e++)d=a[e],d&&"function"==typeof d.then?d.then(b,c):b(d)})}var d=a.isArray;b.race=c}),a("promise/reject",["exports"],function(a){"use strict";function b(a){var b=this;return new b(function(b,c){c(a)})}a.reject=b}),a("promise/resolve",["exports"],function(a){"use strict";function b(a){var b=this;return new b(function(b){b(a)})}a.resolve=b}),a("promise/utils",["exports"],function(a){"use strict";function b(a){return c(a)||"object"==typeof a&&null!==a}function c(a){return"function"==typeof a}function d(a){return"[object Array]"===Object.prototype.toString.call(a)}var e=Date.now||function(){return(new Date).getTime()};a.objectOrFunction=b,a.isFunction=c,a.isArray=d,a.now=e}),b("promise/polyfill").polyfill()}(),function(){"use strict";function a(a){if(a)for(var b in a)j[b]=a[b];return new h(function(a,b){var c=k.open(j.name,j.version);c.onerror=function(){b(c.error.name)},c.onupgradeneeded=function(){c.result.createObjectStore(j.storeName)},c.onsuccess=function(){i=c.result,a()}})}function b(a,b){var c=this;return new h(function(d,e){c.ready().then(function(){var c=i.transaction(j.storeName,"readonly").objectStore(j.storeName),f=c.get(a);f.onsuccess=function(){var a=f.result;void 0===a&&(a=null),b&&b(a),d(a)},f.onerror=function(){b&&b(null,f.error.name),e(f.error.name)}})})}function c(a,b,c){var d=this;return new h(function(e,f){d.ready().then(function(){var d=i.transaction(j.storeName,"readwrite").objectStore(j.storeName);void 0===b&&(b=null);var g=d.put(b,a);g.onsuccess=function(){c&&c(b),e(b)},g.onerror=function(){c&&c(null,g.error.name),f(g.error.name)}})})}function d(a,b){var c=this;return new h(function(d,e){c.ready().then(function(){var c=i.transaction(j.storeName,"readwrite").objectStore(j.storeName),f=c["delete"](a);f.onsuccess=function(){b&&b(),d()},f.onerror=function(){b&&b(f.error.name),e(f.error.name)},f.onabort=function(a){var c=a.target.error;"QuotaExceededError"===c.name&&(b&&b(c.name),e(c.name))}})})}function e(a){var b=this;return new h(function(c,d){b.ready().then(function(){var b=i.transaction(j.storeName,"readwrite").objectStore(j.storeName),e=b.clear();e.onsuccess=function(){a&&a(),c()},e.onerror=function(){a&&a(null,e.error.name),d(e.error.name)}})})}function f(a){var b=this;return new h(function(c,d){b.ready().then(function(){var b=i.transaction(j.storeName,"readonly").objectStore(j.storeName),e=b.count();e.onsuccess=function(){a&&a(e.result),c(e.result)},e.onerror=function(){a&&a(null,e.error.name),d(e.error.name)}})})}function g(a,b){var c=this;return new h(function(d,e){return 0>a?(b&&b(null),void d(null)):void c.ready().then(function(){var c=i.transaction(j.storeName,"readonly").objectStore(j.storeName),f=!1,g=c.openCursor();g.onsuccess=function(){var c=g.result;return c?void(0===a?(b&&b(c.key),d(c.key)):f?(b&&b(c.key),d(c.key)):(f=!0,c.advance(a))):(b&&b(null),void d(null))},g.onerror=function(){b&&b(null,g.error.name),e(g.error.name)}})})}var h="undefined"!=typeof module&&module.exports?require("promise"):this.Promise,i=null,j={},k=k||this.indexedDB||this.webkitIndexedDB||this.mozIndexedDB||this.OIndexedDB||this.msIndexedDB;if(k){var l={_driver:"asyncStorage",_initStorage:a,getItem:b,setItem:c,removeItem:d,clear:e,length:f,key:g};"function"==typeof define&&define.amd?define("asyncStorage",function(){return l}):"undefined"!=typeof module&&module.exports?module.exports=l:this.asyncStorage=l}}.call(this),function(){"use strict";function a(a){if(a)for(var b in a)l[b]=a[b];return k=l.name+"/",m.resolve()}function b(a){var b=this;return new m(function(c){b.ready().then(function(){n.clear(),a&&a(),c()})})}function c(a,b){var c=this;return new m(function(d,e){c.ready().then(function(){try{var c=n.getItem(k+a);c&&(c=g(c)),b&&b(c,null),d(c)}catch(f){b&&b(null,f),e(f)}})})}function d(a,b){var c=this;return new m(function(d){c.ready().then(function(){var c=n.key(a);c&&(c=c.substring(k.length)),b&&b(c),d(c)})})}function e(a){var b=this;return new m(function(c){b.ready().then(function(){var b=n.length;a&&a(b),c(b)})})}function f(a,b){var c=this;return new m(function(d){c.ready().then(function(){n.removeItem(k+a),b&&b(),d()})})}function g(a){if(a.substring(0,q)!==p)return JSON.parse(a);for(var b=a.substring(C),c=a.substring(q,C),d=new ArrayBuffer(2*b.length),e=new Uint16Array(d),f=b.length-1;f>=0;f--)e[f]=b.charCodeAt(f);switch(c){case r:return d;case s:return new Blob([d]);case t:return new Int8Array(d);case u:return new Uint8Array(d);case v:return new Uint8ClampedArray(d);case w:return new Int16Array(d);case y:return new Uint16Array(d);case x:return new Int32Array(d);case z:return new Uint32Array(d);case A:return new Float32Array(d);case B:return new Float64Array(d);default:throw new Error("Unkown type: "+c)}}function h(a){var b="",c=new Uint16Array(a);try{b=String.fromCharCode.apply(null,c)}catch(d){for(var e=0;e<c.length;e++)b+=String.fromCharCode(c[e])}return b}function i(a,b){var c="";if(a&&(c=a.toString()),a&&("[object ArrayBuffer]"===a.toString()||a.buffer&&"[object ArrayBuffer]"===a.buffer.toString())){var d,e=p;a instanceof ArrayBuffer?(d=a,e+=r):(d=a.buffer,"[object Int8Array]"===c?e+=t:"[object Uint8Array]"===c?e+=u:"[object Uint8ClampedArray]"===c?e+=v:"[object Int16Array]"===c?e+=w:"[object Uint16Array]"===c?e+=y:"[object Int32Array]"===c?e+=x:"[object Uint32Array]"===c?e+=z:"[object Float32Array]"===c?e+=A:"[object Float64Array]"===c?e+=B:b(new Error("Failed to get type for BinaryArray"))),b(e+h(d))}else if("[object Blob]"===c){var f=new FileReader;f.onload=function(){var a=h(this.result);b(p+s+a)},f.readAsArrayBuffer(a)}else try{b(JSON.stringify(a))}catch(g){window.console&&window.console.error&&window.console.error("Couldn't convert value into a JSON string: ",a),b(null,g)}}function j(a,b,c){var d=this;return new m(function(e,f){d.ready().then(function(){void 0===b&&(b=null);var d=b;i(b,function(b,g){if(g)c&&c(null,g),f(g);else{try{n.setItem(k+a,b)}catch(h){("QuotaExceededError"===h.name||"NS_ERROR_DOM_QUOTA_REACHED"===h.name)&&(c&&c(null,h),f(h))}c&&c(d),e(d)}})})})}var k="",l={},m="undefined"!=typeof module&&module.exports?require("promise"):this.Promise,n=null;try{n=this.localStorage}catch(o){return}var p="__lfsc__:",q=p.length,r="arbf",s="blob",t="si08",u="ui08",v="uic8",w="si16",x="si32",y="ur16",z="ui32",A="fl32",B="fl64",C=q+r.length,D={_driver:"localStorageWrapper",_initStorage:a,getItem:c,setItem:j,removeItem:f,clear:b,length:e,key:d};"function"==typeof define&&define.amd?define("localStorageWrapper",function(){return D}):"undefined"!=typeof module&&module.exports?module.exports=D:this.localStorageWrapper=D}.call(this),function(){"use strict";function a(a){var b=this;if(a)for(var c in o)o[c]="string"!=typeof a[c]?a[c].toString():a[c];return new l(function(a){try{n=m(o.name,o.version,o.description,o.size)}catch(c){return b.setDriver("localStorageWrapper").then(a)}n.transaction(function(b){b.executeSql("CREATE TABLE IF NOT EXISTS "+o.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],function(){a()},null)})})}function b(a,b){var c=this;return new l(function(d,e){c.ready().then(function(){n.transaction(function(c){c.executeSql("SELECT * FROM "+o.storeName+" WHERE key = ? LIMIT 1",[a],function(a,c){var e=c.rows.length?c.rows.item(0).value:null;e&&(e=i(e)),b&&b(e),d(e)},function(a,c){b&&b(null,c),e(c)})})})})}function c(a,b,c){var d=this;return new l(function(e,f){d.ready().then(function(){void 0===b&&(b=null);var d=b;j(b,function(b,g){g?f(g):n.transaction(function(g){g.executeSql("INSERT OR REPLACE INTO "+o.storeName+" (key, value) VALUES (?, ?)",[a,b],function(){c&&c(d),e(d)},function(a,b){c&&c(null,b),f(b)})},function(a){a.code===a.QUOTA_ERR&&(c&&c(null,a),f(a))})})})})}function d(a,b){var c=this;return new l(function(d,e){c.ready().then(function(){n.transaction(function(c){c.executeSql("DELETE FROM "+o.storeName+" WHERE key = ?",[a],function(){b&&b(),d()},function(a,c){b&&b(c),e(c)})})})})}function e(a){var b=this;return new l(function(c,d){b.ready().then(function(){n.transaction(function(b){b.executeSql("DELETE FROM "+o.storeName,[],function(){a&&a(),c()},function(b,c){a&&a(c),d(c)})})})})}function f(a){var b=this;return new l(function(c,d){b.ready().then(function(){n.transaction(function(b){b.executeSql("SELECT COUNT(key) as c FROM "+o.storeName,[],function(b,d){var e=d.rows.item(0).c;a&&a(e),c(e)},function(b,c){a&&a(null,c),d(c)})})})})}function g(a,b){var c=this;return new l(function(d,e){c.ready().then(function(){n.transaction(function(c){c.executeSql("SELECT key FROM "+o.storeName+" WHERE id = ? LIMIT 1",[a+1],function(a,c){var e=c.rows.length?c.rows.item(0).key:null;b&&b(e),d(e)},function(a,c){b&&b(null,c),e(c)})})})})}function h(a){var b,c=new Uint8Array(a),d="";for(b=0;b<c.length;b+=3)d+=k[c[b]>>2],d+=k[(3&c[b])<<4|c[b+1]>>4],d+=k[(15&c[b+1])<<2|c[b+2]>>6],d+=k[63&c[b+2]];return c.length%3===2?d=d.substring(0,d.length-1)+"=":c.length%3===1&&(d=d.substring(0,d.length-2)+"=="),d}function i(a){if(a.substring(0,q)!==p)return JSON.parse(a);var b,c,d,e,f,g=a.substring(C),h=a.substring(q,C),i=.75*g.length,j=g.length,l=0;"="===g[g.length-1]&&(i--,"="===g[g.length-2]&&i--);var m=new ArrayBuffer(i),n=new Uint8Array(m);for(b=0;j>b;b+=4)c=k.indexOf(g[b]),d=k.indexOf(g[b+1]),e=k.indexOf(g[b+2]),f=k.indexOf(g[b+3]),n[l++]=c<<2|d>>4,n[l++]=(15&d)<<4|e>>2,n[l++]=(3&e)<<6|63&f;switch(h){case r:return m;case s:return new Blob([m]);case t:return new Int8Array(m);case u:return new Uint8Array(m);case v:return new Uint8ClampedArray(m);case w:return new Int16Array(m);case y:return new Uint16Array(m);case x:return new Int32Array(m);case z:return new Uint32Array(m);case A:return new Float32Array(m);case B:return new Float64Array(m);default:throw new Error("Unkown type: "+h)}}function j(a,b){var c="";if(a&&(c=a.toString()),a&&("[object ArrayBuffer]"===a.toString()||a.buffer&&"[object ArrayBuffer]"===a.buffer.toString())){var d,e=p;a instanceof ArrayBuffer?(d=a,e+=r):(d=a.buffer,"[object Int8Array]"===c?e+=t:"[object Uint8Array]"===c?e+=u:"[object Uint8ClampedArray]"===c?e+=v:"[object Int16Array]"===c?e+=w:"[object Uint16Array]"===c?e+=y:"[object Int32Array]"===c?e+=x:"[object Uint32Array]"===c?e+=z:"[object Float32Array]"===c?e+=A:"[object Float64Array]"===c?e+=B:b(new Error("Failed to get type for BinaryArray"))),b(e+h(d))}else if("[object Blob]"===c){var f=new FileReader;f.onload=function(){var a=h(this.result);b(p+s+a)},f.readAsArrayBuffer(a)}else try{b(JSON.stringify(a))}catch(g){window.console&&window.console.error&&window.console.error("Couldn't convert value into a JSON string: ",a),b(null,g)}}var k="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",l="undefined"!=typeof module&&module.exports?require("promise"):this.Promise,m=this.openDatabase,n=null,o={},p="__lfsc__:",q=p.length,r="arbf",s="blob",t="si08",u="ui08",v="uic8",w="si16",x="si32",y="ur16",z="ui32",A="fl32",B="fl64",C=q+r.length;if(m){var D={_driver:"webSQLStorage",_initStorage:a,getItem:b,setItem:c,removeItem:d,clear:e,length:f,key:g};"function"==typeof define&&define.amd?define("webSQLStorage",function(){return D}):"undefined"!=typeof module&&module.exports?module.exports=D:this.webSQLStorage=D}}.call(this),function(){"use strict";var a="undefined"!=typeof module&&module.exports?require("promise"):this.Promise,b=1,c=2,d=3,e=d;"function"==typeof define&&define.amd?e=b:"undefined"!=typeof module&&module.exports&&(e=c);var f,g=g||this.indexedDB||this.webkitIndexedDB||this.mozIndexedDB||this.OIndexedDB||this.msIndexedDB,h=this.openDatabase,i=this,j={INDEXEDDB:"asyncStorage",LOCALSTORAGE:"localStorageWrapper",WEBSQL:"webSQLStorage",_config:{description:"",name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1},config:function(a){if("object"==typeof a){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var b in a)this._config[b]=a[b];return!0}return"string"==typeof a?this._config[a]:this._config},driver:function(){return this._driver||null},_ready:a.reject(new Error("setDriver() wasn't called")),setDriver:function(d,f){var k=new a(function(a,f){if(!g&&d===j.INDEXEDDB||!h&&d===j.WEBSQL)return void f(j);if(j._ready=null,e===b)return void require([d],function(b){j._extend(b),a(j)});if(e===c){var k;switch(d){case j.INDEXEDDB:k=require("./drivers/indexeddb");break;case j.LOCALSTORAGE:k=require("./drivers/localstorage");break;case j.WEBSQL:k=require("./drivers/websql")}j._extend(k)}else j._extend(i[d]);a(j)});return k.then(f,f),k},ready:function(a){return null===this._ready&&(this._ready=this._initStorage(this._config)),this._ready.then(a,a),this._ready},_extend:function(a){for(var b in a)a.hasOwnProperty(b)&&(this[b]=a[b])}};f=g&&null===g.open("_localforage_spec_test",1).onupgradeneeded?j.INDEXEDDB:h?j.WEBSQL:j.LOCALSTORAGE,this.localForageConfig&&(j.config=this.localForageConfig),j.setDriver(f),e===b?define(function(){return j}):e===c?module.exports=j:this.localforage=j}.call(this);
/*global exports:true, require:true */
var path = require('path');
module.exports = exports = function(grunt) {

@@ -75,3 +77,3 @@ 'use strict';

' localForage -- Offline Storage, Improved\n' +
' Version 0.6.2\n' +
' Version 0.7.0\n' +
' http://mozilla.github.io/localForage\n' +

@@ -90,12 +92,14 @@ ' (c) 2013-2014 Mozilla, Apache License 2.0\n' +

shell: {
options: {
stdout: true
},
component: {
command: path.resolve('node_modules', 'component', 'bin',
'component-build') +
' -o test -n localforage.component'
},
publishDocs: {
options: {
stdout: true
},
command: 'rake publish ALLOW_DIRTY=true'
},
serveDocs: {
options: {
stdout: true
},
command: 'bundle exec middleman server'

@@ -140,3 +144,3 @@ }

grunt.registerTask('test', ['build', 'jshint', 'server', 'casper']);
grunt.registerTask('test', ['build', 'jshint', 'shell:component', 'server', 'casper']);
};

@@ -11,3 +11,3 @@ {

],
"version": "0.6.2",
"version": "0.7.0",
"homepage": "https://github.com/mozilla/localForage",

@@ -28,8 +28,9 @@ "repository": {

"grunt-contrib-concat": "^0.3.0",
"grunt-contrib-jshint": "^0.9.2",
"grunt-contrib-uglify": "^0.4.0",
"grunt-contrib-watch": "^0.5.0",
"grunt-shell": "^0.6.4",
"load-grunt-tasks": "^0.4.0",
"uglify-js": "^2.3.x",
"grunt-contrib-jshint": "^0.9.2",
"grunt-shell": "^0.6.4",
"load-grunt-tasks": "^0.4.0"
"component": "^1.0.0"
},

@@ -36,0 +37,0 @@ "browser": "dist/localforage.js",

@@ -6,3 +6,8 @@ // Some code originally from async_storage.js in

var Promise = this.Promise;
// Originally found in https://github.com/mozilla-b2g/gaia/blob/e8f624e4cc9ea945727278039b3bc9bcb9f8667a/shared/js/async_storage.js
// Promises!
var Promise = (typeof module !== 'undefined' && module.exports) ?
require('promise') : this.Promise;
var db = null;

@@ -9,0 +14,0 @@ var dbInfo = {};

@@ -10,3 +10,5 @@ // If IndexedDB isn't available, we'll fall back to localStorage.

var dbInfo = {};
var Promise = this.Promise;
// Promises!
var Promise = (typeof module !== 'undefined' && module.exports) ?
require('promise') : this.Promise;
var localStorage = null;

@@ -13,0 +15,0 @@

@@ -18,3 +18,6 @@ /*

var Promise = this.Promise;
// Promises!
var Promise = (typeof module !== 'undefined' && module.exports) ?
require('promise') : this.Promise;
var openDatabase = this.openDatabase;

@@ -21,0 +24,0 @@ var db = null;

@@ -5,3 +5,4 @@ (function() {

// Promises!
var Promise = this.Promise;
var Promise = (typeof module !== 'undefined' && module.exports) ?
require('promise') : this.Promise;

@@ -112,9 +113,9 @@ // Avoid those magic constants!

case localForage.INDEXEDDB:
driver = require('localforage/src/drivers/indexeddb');
driver = require('./drivers/indexeddb');
break;
case localForage.LOCALSTORAGE:
driver = require('localforage/src/drivers/localstorage');
driver = require('./drivers/localstorage');
break;
case localForage.WEBSQL:
driver = require('localforage/src/drivers/websql');
driver = require('./drivers/websql');
}

@@ -121,0 +122,0 @@

Sorry, the diff of this file is not supported yet

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