(function(n){"use strict";function u(n){var t=null;switch(n){case 0:case 1:case"readwrite":case"readonly":t=n;break;default:t=r.READ_WRITE||"readwrite"}return t}var t=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB,f=window.IDBKeyRange||window.webkitIDBKeyRange,i=window.IDBCursor||window.webkitIDBCursor||{},r;typeof i.PREV=="undefined"&&(i.PREV="prev");typeof i.NEXT=="undefined"&&(i.NEXT="next");r=window.IDBTransaction||window.webkitIDBTransaction;n.extend({indexedDB:function(i,r){var s,h,c,e,o;if(r&&(typeof r=="number"&&(r={version:r}),s=r.version,r.schema&&!s)){h=-1;for(c in r.schema)h=h>c?h:c;s=r.version||h}return e={request:function(t,i){return n.Deferred(function(n){try{var r=typeof t=="function"?t(i):t;r.onsuccess=function(t){n.resolveWith(r,[r.result,t])};r.onerror=function(t){n.rejectWith(r,[r.error,t])};typeof r.onblocked!="undefined"&&r.onblocked===null&&(r.onblocked=function(t){var i;try{i=r.result}catch(t){i=null}n.notifyWith(r,[i,t])});typeof r.onupgradeneeded!="undefined"&&r.onupgradeneeded===null&&(r.onupgradeneeded=function(t){n.notifyWith(r,[r.result,t])})}catch(u){u.name="exception";n.rejectWith(r,["exception",u])}})},transaction:function(n){return{objectStore:function(t){try{return e.objectStore(n.objectStore(t))}catch(i){return n.readyState!==n.DONE&&n.abort(),e.objectStore(null)}},createObjectStore:function(t,i){try{return e.objectStore(n.db.createObjectStore(t,i))}catch(r){n.readyState!==n.DONE&&n.abort()}},deleteObjectStore:function(t){try{n.db.deleteObjectStore(t)}catch(i){n.readyState!==n.DONE&&n.abort()}},abort:function(){n.abort()}}},objectStore:function(n){for(var t={},r=["add","put","get","delete","clear","count"],i=0;i