diff --git a/README.md b/README.md index 01c890cb..0efb313d 100644 --- a/README.md +++ b/README.md @@ -257,7 +257,6 @@ versions packaged. * Bootstrap: [homepage](https://getbootstrap.com/) - [snapshot](https://github.com/twbs/bootstrap/releases/download/v3.3.7/bootstrap-3.3.7-dist.zip) - [license](https://github.com/twbs/bootstrap/blob/v3.3.7/LICENSE) * Bootstrap Toggle: [homepage](https://www.bootstraptoggle.com/) - [snapshot](https://github.com/minhur/bootstrap-toggle/archive/b76c094.zip) - [license](https://github.com/minhur/bootstrap-toggle/blob/2.2.0/LICENSE) -* Dexie: [homepage](https://dexie.org/) - [snapshot](https://github.com/dfahlander/Dexie.js/archive/v2.0.0-beta.10.zip) - [license](https://github.com/dfahlander/Dexie.js/blob/v2.0.0-beta.10/LICENSE) * Handlebars: [homepage](https://handlebarsjs.com/) - [snapshot](http://builds.handlebarsjs.com.s3.amazonaws.com/handlebars.min-714a4c4.js) - [license](https://github.com/wycats/handlebars.js/blob/v4.0.6/LICENSE) * jQuery: [homepage](https://blog.jquery.com/) - [snapshot](https://code.jquery.com/jquery-3.2.1.min.js) - [license](https://github.com/jquery/jquery/blob/3.2.1/LICENSE.txt) * JSZip: [homepage](https://stuk.github.io/jszip/) - [snapshot](https://raw.githubusercontent.com/Stuk/jszip/de7f52fbcba485737bef7923a83f0fad92d9f5bc/dist/jszip.min.js) - [license](https://github.com/Stuk/jszip/blob/v3.1.3/LICENSE.markdown) diff --git a/ext/bg/background.html b/ext/bg/background.html index 3ab68639..bbfbd1e1 100644 --- a/ext/bg/background.html +++ b/ext/bg/background.html @@ -14,7 +14,6 @@
- diff --git a/ext/bg/legal.html b/ext/bg/legal.html index 30927da6..377d25ba 100644 --- a/ext/bg/legal.html +++ b/ext/bg/legal.html @@ -42,7 +42,6 @@ and are used in conformance with the Group's Bootstrap v3.3.7
  • Bootstrap Toggle v2.2.0
  • -
  • Dexie v2.0.0-beta.10
  • Handlebars v4.0.6
  • jQuery v3.2.1
  • JSZip v3.1.3
  • diff --git a/ext/mixed/lib/dexie.min.js b/ext/mixed/lib/dexie.min.js deleted file mode 100644 index 81676ce2..00000000 --- a/ext/mixed/lib/dexie.min.js +++ /dev/null @@ -1,3 +0,0 @@ -!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):n.Dexie=t()}(this,function(){"use strict";function n(n,t){return"object"!=typeof t?n:(Cn(t).forEach(function(e){n[e]=t[e]}),n)}function t(n,t){return Fn.call(n,t)}function e(n,t){"function"==typeof t&&(t=t(Bn(n))),Cn(t).forEach(function(e){r(n,e,t[e])})}function r(e,r,i,o){Mn(e,r,n(i&&t(i,"get")&&"function"==typeof i.get?{get:i.get,set:i.set,configurable:!0}:{value:i,configurable:!0,writable:!0},o))}function i(n){return{from:function(t){return n.prototype=Object.create(t.prototype),r(n.prototype,"constructor",n),{extend:e.bind(null,n.prototype)}}}}function o(n,t){var e,r=Nn(n,t);return r||(e=Bn(n))&&o(e,t)}function u(n,t,e){return qn.call(n,t,e)}function a(n,t){return t(n)}function c(n){var t=setTimeout(n,1e3);clearTimeout(t)}function s(n){if(!n)throw new Error("Assertion Failed")}function f(n){Kn.setImmediate?setImmediate(n):setTimeout(n,0)}function l(n,t){return n.reduce(function(n,e,r){var i=t(e,r);return i&&(n[i[0]]=i[1]),n},{})}function h(n,t){return function(){try{n.apply(this,arguments)}catch(n){t(n)}}}function d(n,t,e){try{n.apply(null,e)}catch(n){t&&t(n)}}function v(n,e){if(t(n,e))return n[e];if(!e)return n;if("string"!=typeof e){for(var r=[],i=0,o=e.length;i=0)e=n;else{e=n.constructor?Object.create(n.constructor.prototype):{};for(var o in n)t(n,o)&&(e[o]=b(n[o]))}return e}function w(n,e,r,i){return r=r||{},i=i||"",Cn(n).forEach(function(o){if(t(e,o)){var u=n[o],a=e[o];"object"==typeof u&&"object"==typeof a&&u&&a&&u.constructor===a.constructor?w(u,a,r,i+o+"."):u!==a&&(r[i+o]=e[o])}else r[i+o]=void 0}),Cn(e).forEach(function(o){t(n,o)||(r[i+o]=e[o])}),r}function _(n){var t,e,r,i;if(1===arguments.length){if(Tn(n))return n.slice();if(this===Ln&&"string"==typeof n)return[n];if(i=zn(n)){for(e=[];r=i.next(),!r.done;)e.push(r.value);return e}if(null==n)return[n];if(t=n.length,"number"==typeof t){for(e=new Array(t);t--;)e[t]=n[t];return e}return[n]}for(t=arguments.length,e=new Array(t);t--;)e[t]=arguments[t];return e}function k(n,t){Wn=n,Qn=t}function x(){if(Hn)try{throw x.arguments,new Error}catch(n){return n}return new Error}function j(n,t){var e=n.stack;return e?(t=t||0,0===e.indexOf(n.name)&&(t+=(n.name+n.message).split("\n").length),e.split("\n").slice(t).filter(Qn).map(function(n){return"\n"+n}).join("")):""}function E(n,t){return function(){return console.warn(n+" is deprecated. See https://github.com/dfahlander/Dexie.js/wiki/Deprecations. "+j(x(),1)),t.apply(this,arguments)}}function P(n,t){this._e=x(),this.name=n,this.message=t}function A(n,t){return n+". Errors: "+t.map(function(n){return n.toString()}).filter(function(n,t,e){return e.indexOf(n)===t}).join("\n")}function O(n,t,e,r){this._e=x(),this.failures=t,this.failedKeys=r,this.successCount=e}function S(n,t){this._e=x(),this.name="BulkError",this.failures=t,this.message=A(n,t)}function I(n,t){if(!n||n instanceof P||n instanceof TypeError||n instanceof SyntaxError||!n.name||!tt[n.name])return n;var e=new tt[n.name](t||n.message,n);return"stack"in n&&r(e,"stack",{get:function(){return this.inner.stack}}),e}function D(){}function C(n){return n}function T(n,t){return null==n||n===C?t:function(e){return t(n(e))}}function K(n,t){return function(){n.apply(this,arguments),t.apply(this,arguments)}}function B(n,t){return n===D?t:function(){var e=n.apply(this,arguments);void 0!==e&&(arguments[0]=e);var r=this.onsuccess,i=this.onerror;this.onsuccess=null,this.onerror=null;var o=t.apply(this,arguments);return r&&(this.onsuccess=this.onsuccess?K(r,this.onsuccess):r),i&&(this.onerror=this.onerror?K(i,this.onerror):i),void 0!==o?o:e}}function F(n,t){return n===D?t:function(){n.apply(this,arguments);var e=this.onsuccess,r=this.onerror;this.onsuccess=this.onerror=null,t.apply(this,arguments),e&&(this.onsuccess=this.onsuccess?K(e,this.onsuccess):e),r&&(this.onerror=this.onerror?K(r,this.onerror):r)}}function M(t,e){return t===D?e:function(r){var i=t.apply(this,arguments);n(r,i);var o=this.onsuccess,u=this.onerror;this.onsuccess=null,this.onerror=null;var a=e.apply(this,arguments);return o&&(this.onsuccess=this.onsuccess?K(o,this.onsuccess):o),u&&(this.onerror=this.onerror?K(u,this.onerror):u),void 0===i?void 0===a?void 0:a:n(i,a)}}function N(n,t){return n===D?t:function(){return t.apply(this,arguments)!==!1&&n.apply(this,arguments)}}function q(n,t){return n===D?t:function(){var e=n.apply(this,arguments);if(e&&"function"==typeof e.then){for(var r=this,i=arguments.length,o=new Array(i);i--;)o[i]=arguments[i];return e.then(function(){return t.apply(r,o)})}return t.apply(this,arguments)}}function R(n){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");this._listeners=[],this.onuncatched=D,this._lib=!1;var t=this._PSD=Et;if(Wn&&(this._stackHolder=x(),this._prev=null,this._numPrev=0),"function"!=typeof n){if(n!==rt)throw new TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(this._state===!1&&z(this,this._value))}this._state=null,this._value=null,++t.ref,V(this,n)}function U(n,t,e,r,i){this.onFulfilled="function"==typeof n?n:null,this.onRejected="function"==typeof t?t:null,this.resolve=e,this.reject=r,this.psd=i}function V(n,t){try{t(function(t){if(null===n._state){if(t===n)throw new TypeError("A promise cannot be resolved with itself.");var e=n._lib&&Y();t&&"function"==typeof t.then?V(n,function(n,e){t instanceof R?t._then(n,e):t.then(n,e)}):(n._state=!0,n._value=t,L(n)),e&&$()}},z.bind(null,n))}catch(t){z(n,t)}}function z(n,t){if(_t.push(t),null===n._state){var e=n._lib&&Y();t=xt(t),n._state=!1,n._value=t,Wn&&null!==t&&"object"==typeof t&&!t._promise&&d(function(){var e=o(t,"stack");t._promise=n,r(t,"stack",{get:function(){return pt?e&&(e.get?e.get.apply(t):e.value):n.stack}})}),nn(n),L(n),e&&$()}}function L(n){var t=n._listeners;n._listeners=[];for(var e=0,r=t.length;e0;)for(n=Pt,Pt=[],e=n.length,t=0;t0);gt=!0,bt=!0}function X(){var n=wt;wt=[],n.forEach(function(n){n._PSD.onunhandled.call(null,n._value,n)});for(var t=Ot.slice(0),e=t.length;e;)t[--e]()}function Z(n){function t(){n(),Ot.splice(Ot.indexOf(t),1)}Ot.push(t),++At,mt(function(){0===--At&&X()},[])}function nn(n){wt.some(function(t){return t._value===n._value})||wt.push(n)}function tn(n){for(var t=wt.length;t;)if(wt[--t]._value===n._value)return void wt.splice(t,1)}function en(n){return new R(rt,!1,n)}function rn(n,t){var e=Et;return function(){var r=Y(),i=Et;try{return ln(e,!0),n.apply(this,arguments)}catch(n){t&&t(n)}finally{ln(i,!1),r&&$()}}}function on(t,e,r,i){var o=Et,u=Object.create(o);u.parent=o,u.ref=0,u.global=!1,u.id=++Bt;var a=jt.env;u.env=vt?{Promise:R,all:R.all,race:R.race,resolve:R.resolve,reject:R.reject,nthen:yn(a.nthen,u),gthen:yn(a.gthen,u)}:{},e&&n(u,e),++o.ref,u.finalize=function(){--this.parent.ref||this.parent.finalize()};var c=dn(u,t,r,i);return 0===u.ref&&u.finalize(),c}function un(){return It.id||(It.id=++Dt),++It.awaits,It.echoes+=ut,It.id}function an(n){!It.awaits||n&&n!==It.id||(0===--It.awaits&&(It.id=0),It.echoes=It.awaits*ut)}function cn(n){return It.echoes&&n&&n.constructor===ht?(un(),n.then(function(n){return an(),n},function(n){return an(),Nt(n)})):n}function sn(n){++Kt,It.echoes&&0!==--It.echoes||(It.echoes=It.id=0),Ct.push(Et),ln(n,!0)}function fn(){var n=Ct[Ct.length-1];Ct.pop(),ln(n,!1)}function ln(n,t){var e=Et;if((t?!It.echoes||Tt++&&n===Et:!Tt||--Tt&&n===Et)||vn(t?sn.bind(null,n):fn),n!==Et&&(Et=n,e===jt&&(jt.env=hn()),vt)){var r=jt.env.Promise,i=n.env;st.then=i.nthen,r.prototype.then=i.gthen,(e.global||n.global)&&(Kn.Promise=i.Promise,r.all=i.all,r.race=i.race,r.resolve=i.resolve,r.reject=i.reject)}}function hn(){var n=Kn.Promise;return vt?{Promise:n,all:n.all,race:n.race,resolve:n.resolve,reject:n.reject,nthen:st.then,gthen:n.prototype.then}:{}}function dn(n,t,e,r,i){var o=Et;try{return ln(n,!0),t(e,r,i)}finally{ln(o,!1)}}function vn(n){lt.call(ct,n)}function pn(n,t,e){return"function"!=typeof n?n:function(){var r=Et;e&&un(),ln(t,!0);try{return n.apply(this,arguments)}finally{ln(r,!1)}}}function yn(n,t){return function(e,r){return n.call(this,pn(e,t,!1),pn(r,t,!1))}}function mn(t,e){var r;try{r=e.onuncatched(t)}catch(n){}if(r!==!1)try{var i,o={promise:e,reason:t};if(Kn.document&&document.createEvent?(i=document.createEvent("Event"),i.initEvent(Ft,!0,!0),n(i,o)):Kn.CustomEvent&&(i=new CustomEvent(Ft,{detail:o}),n(i,o)),i&&Kn.dispatchEvent&&(dispatchEvent(i),!Kn.PromiseRejectionEvent&&Kn.onunhandledrejection))try{Kn.onunhandledrejection(i)}catch(n){}i.defaultPrevented||console.warn("Unhandled rejection: "+(t.stack||t))}catch(n){}}function gn(n){function t(n,t,o){if("object"==typeof n)return e(n);t||(t=N),o||(o=D);var u={subscribers:[],fire:o,subscribe:function(n){u.subscribers.indexOf(n)===-1&&(u.subscribers.push(n),u.fire=t(u.fire,n))},unsubscribe:function(n){u.subscribers=u.subscribers.filter(function(t){return t!==n}),u.fire=u.subscribers.reduce(t,o)}};return r[n]=i[n]=u,u}function e(n){Cn(n).forEach(function(e){var r=n[e];if(Tn(r))t(e,n[e][0],n[e][1]);else{if("asap"!==r)throw new nt.InvalidArgument("Invalid event config");var i=t(e,C,function(){for(var n=arguments.length,t=new Array(n);n--;)t[n]=arguments[n];i.subscribers.forEach(function(n){f(function(){n.apply(null,t)})})})}})}var r={},i=function(t,e){if(e){for(var i=arguments.length,o=new Array(i-1);--i;)o[i-1]=arguments[i];return r[t].subscribe.apply(null,o),n}if("string"==typeof t)return r[t]};i.addEventType=t;for(var o=1,u=arguments.length;o0?console.warn("Another connection wants to upgrade database '"+et.name+"'. Closing db now to resume the upgrade."):console.warn("Another connection wants to delete database '"+et.name+"'. Closing db now to resume the delete request."),et.close()}),et.on("blocked",function(n){!n.newVersion||n.newVersionn});return a.forEach(function(n){i.push(function(){var r=Vn,i=n._cfg.dbschema;yn(r,e),yn(i,e),Vn=et._dbSchema=i;var o=P(r,i);if(o.add.forEach(function(n){A(e,n[0],n[1].primKey,n[1].indexes)}),o.change.forEach(function(n){if(n.recreate)throw new nt.Upgrade("Not yet support for changing primary key");var t=e.objectStore(n.name);n.add.forEach(function(n){N(t,n)}),n.change.forEach(function(n){t.deleteIndex(n.name),N(t,n)}),n.del.forEach(function(n){t.deleteIndex(n)})}),n._cfg.contentUpgrade)return u=!0,R.follow(function(){n._cfg.contentUpgrade(t)})}),i.push(function(t){if(!u||!Ht){var e=n._cfg.dbschema;K(e,t)}})}),r().then(function(){I(Vn,e)})}function P(n,t){var e={del:[],add:[],change:[]};for(var r in n)t[r]||e.del.push(r);for(r in t){var i=n[r],o=t[r];if(i){var u={name:r,def:o,recreate:!1,del:[],add:[],change:[]};if(i.primKey.src!==o.primKey.src)u.recreate=!0,e.change.push(u);else{var a=i.idxByName,c=o.idxByName;for(var s in a)c[s]||u.del.push(s);for(s in c){var f=a[s],l=c[s];f?f.src!==l.src&&u.change.push(l):u.add.push(l)}(u.del.length>0||u.add.length>0||u.change.length>0)&&e.change.push(u)}}else e.add.push([r,o])}return e}function A(n,t,e,r){var i=n.db.createObjectStore(t,e.keyPath?{keyPath:e.keyPath,autoIncrement:e.auto}:{autoIncrement:e.auto});return r.forEach(function(n){N(i,n)}),i}function I(n,t){Cn(n).forEach(function(e){t.db.objectStoreNames.contains(e)||A(t,e,n[e].primKey,n[e].indexes)})}function K(n,t){for(var e=0;e0?n:t}function sn(n,t){return Rn.cmp(n,t)}function fn(n,t){return Rn.cmp(t,n)}function ln(n,t){return nt?-1:n===t?0:1}function vn(n,t){return n?t?function(){return n.apply(this,arguments)&&t.apply(this,arguments)}:n:t}function pn(){if(et.verno=Gn.version/10,et._dbSchema=Vn={},Qn=u(Gn.objectStoreNames,0),0!==Qn.length){var n=Gn.transaction(In(Qn),"readonly");Qn.forEach(function(t){for(var e=n.objectStore(t),r=e.keyPath,i=r&&"string"==typeof r&&r.indexOf(".")!==-1,o=new On(r,r||"",!1,!1,!!e.autoIncrement,r&&"string"!=typeof r,i),u=[],a=0;aMath.pow(2,62)?0:n.oldVersion;k(u/10,t,e,r)}},e),r.onsuccess=rn(function(){if(t=null,Gn=r.result,Wt.push(et),ot)pn();else if(Gn.objectStoreNames.length>0)try{yn(Vn,Gn.transaction(In(Gn.objectStoreNames),Zn))}catch(n){}Gn.onversionchange=rn(function(n){et._vcFired=!0,et.on("versionchange").fire(n)}),ut||"__dbnames"===i||Mt.dbnames.put({name:i}).catch(D),n()},e)})]).then(function(){return $n=[],R.resolve(bn.vip(et.on.ready.fire)).then(function n(){if($n.length>0){var t=$n.reduce(q,D);return $n=[],R.resolve(bn.vip(t)).then(n)}})}).finally(function(){$n=null}).then(function(){return Yn=!1,et}).catch(function(n){try{t&&t.abort()}catch(n){}return Yn=!1,et.close(),Jn=n,Nt(Jn)}).finally(function(){Xn=!0,n()})},this.close=function(){var n=Wt.indexOf(et);if(n>=0&&Wt.splice(n,1),Gn){try{Gn.close()}catch(n){}Gn=null}qn=!1,Jn=new nt.DatabaseClosed,Yn&&Kn(Jn),rt=new R(function(n){wn=n}),it=new R(function(n,t){Kn=t})},this.delete=function(){var n=arguments.length>0;return new R(function(t,e){function r(){et.close();var n=Rn.deleteDatabase(i);n.onsuccess=rn(function(){ut||Mt.dbnames.delete(i).catch(D),t()}),n.onerror=xn(e),n.onblocked=mn}if(n)throw new nt.InvalidArgument("Arguments not allowed in db.delete()");Yn?rt.then(r):r()})},this.backendDB=function(){return Gn},this.isOpen=function(){return null!==Gn},this.hasBeenClosed=function(){return Jn&&Jn instanceof nt.DatabaseClosed},this.hasFailed=function(){return null!==Jn},this.dynamicallyOpened=function(){return ot},this.name=i,e(this,{tables:{get:function(){return Cn(Hn).map(function(n){return Hn[n]})}}}),this.on=gn(this,"populate","blocked","versionchange",{ready:[q,D]}),this.on.ready.subscribe=a(this.on.ready.subscribe,function(n){return function(t,e){bn.vip(function(){Xn?(Jn||R.resolve().then(t),e&&n(t)):$n?($n.push(t),e&&n(t)):(n(t),e||n(function n(){et.on.ready.unsubscribe(t),et.on.ready.unsubscribe(n)}))})}}),Yt(function(){et.on("populate").fire(et._createTransaction(tt,Qn,Vn))}),this.transaction=function(){var n=V.apply(this,arguments);return this._transaction.apply(this,n)},this._transaction=function(n,t,e){function r(){return R.resolve().then(function(){var t=Et.transless||Et,r=et._createTransaction(n,u,Vn,i),o={trans:r,transless:t};i?r.idbtrans=i.idbtrans:r.create(),e.constructor===dt&&un();var a,c=R.follow(function(){if(a=e.call(r,r))if(a.constructor===ht){var n=an.bind(null,null);a.then(n,n)}else"function"==typeof a.next&&"function"==typeof a.throw&&(a=An(a))},o);return(a&&"function"==typeof a.then?R.resolve(a).then(function(n){return r.active?n:Nt(new nt.PrematureCommit("Transaction committed too early. See http://bit.ly/2eVASrf"))}):c.then(function(){return a})).then(function(n){return i&&r._resolve(),r._completion.then(function(){return n})}).catch(function(n){return r._reject(n),Nt(n)})})}var i=Et.trans;i&&i.db===et&&n.indexOf("!")===-1||(i=null);var o=n.indexOf("?")!==-1;n=n.replace("!","").replace("?","");try{var u=t.map(function(n){var t=n instanceof z?n.name:n;if("string"!=typeof t)throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return t});if("r"==n||n==Zn)n=Zn;else{if("rw"!=n&&n!=tt)throw new nt.InvalidArgument("Invalid transaction mode: "+n);n=tt}if(i){if(i.mode===Zn&&n===tt){if(!o)throw new nt.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");i=null}i&&u.forEach(function(n){if(i&&i.storeNames.indexOf(n)===-1){if(!o)throw new nt.SubTransaction("Table "+n+" not included in parent transaction.");i=null}}),o&&i&&!i.active&&(i=null)}}catch(n){return i?i._promise(null,function(t,e){e(n)}):Nt(n)}return i?i._promise(n,r,"lock"):Et.trans?dn(Et.transless,function(){return et._whenReady(r)}):et._whenReady(r)},this.table=function(n){if($t&&ot)return new z(n);if(!t(Hn,n))throw new nt.InvalidTable("Table "+n+" does not exist");return Hn[n]},e(z.prototype,{_trans:function(n,t,e){var r=this._tx||Et.trans;return r&&r.db===et?r===Et.trans?r._promise(n,t,e):on(function(){return r._promise(n,t,e)},{trans:r,transless:Et.transless||Et}):U(n,[this.name],t)},_idbstore:function(n,t,e){function r(n,e,r){if(r.storeNames.indexOf(i)===-1)throw new nt.NotFound("Table"+i+" not part of transaction");return t(n,e,r.idbtrans.objectStore(i),r)}if($t)return new R(t);var i=this.name;return this._trans(n,r,e)},get:function(n,t){if(n&&n.constructor===Object)return this.where(n).first(t);var e=this;return this._idbstore(Zn,function(t,r,i){$t&&t(e.schema.instanceTemplate);var o=i.get(n);o.onerror=xn(r),o.onsuccess=rn(function(){t(e.hook.reading.fire(o.result))},r)}).then(t)},where:function(n){if("string"==typeof n)return new H(this,n);if(Tn(n))return new H(this,"["+n.join("+")+"]");var t=Cn(n);if(1===t.length)return this.where(t[0]).equals(n[t[0]]);var e=this.schema.indexes.concat(this.schema.primKey).filter(function(n){return n.compound&&t.every(function(t){return n.keyPath.indexOf(t)>=0})&&n.keyPath.every(function(n){return t.indexOf(n)>=0})})[0];if(e&&Ut!==Rt)return this.where(e.name).equals(e.keyPath.map(function(t){return n[t]}));e||console.warn("The query "+JSON.stringify(n)+" on "+this.name+" would benefit of a "+("compound index ["+t.join("+")+"]"));var r=this.schema.idxByName,i=t.reduce(function(t,e){return[t[0]||r[e],t[0]||!r[e]?vn(t[1],function(t){return""+v(t,e)==""+n[e]}):t[1]]},[null,null]),o=i[0];return o?this.where(o.name).equals(n[o.keyPath]).filter(i[1]):e?this.filter(i[1]):this.where(t).equals("")},count:function(n){return this.toCollection().count(n)},offset:function(n){return this.toCollection().offset(n)},limit:function(n){return this.toCollection().limit(n)},reverse:function(){return this.toCollection().reverse()},filter:function(n){return this.toCollection().and(n)},each:function(n){return this.toCollection().each(n)},toArray:function(n){return this.toCollection().toArray(n)},orderBy:function(n){return new G(new H(this,Tn(n)?"["+n.join("+")+"]":n))},toCollection:function(){return new G(new H(this))},mapToClass:function(n,e){this.schema.mappedClass=n;var r=Object.create(n.prototype);e&&_n(r,e),this.schema.instanceTemplate=r;var i=function(e){if(!e)return e;var r=Object.create(n.prototype);for(var i in e)if(t(e,i))try{r[i]=e[i]}catch(n){}return r};return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=i,this.hook("reading",i),n},defineClass:function(n){return this.mapToClass(bn.defineClass(n),n)},bulkDelete:function(n){return this.hook.deleting.fire===D?this._idbstore(tt,function(t,e,r,i){t(W(r,i,n,!1,D))}):this.where(":id").anyOf(n).delete().then(function(){})},bulkPut:function(n,t){var e=this;return this._idbstore(tt,function(r,i,o){if(!o.keyPath&&!e.schema.primKey.auto&&!t)throw new nt.InvalidArgument("bulkPut() with non-inbound keys requires keys array in second argument");if(o.keyPath&&t)throw new nt.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(t&&t.length!==n.length)throw new nt.InvalidArgument("Arguments objects and keys must have the same length");if(0===n.length)return r();var u,a,c=function(n){0===s.length?r(n):i(new S(e.name+".bulkPut(): "+s.length+" of "+f+" operations failed",s))},s=[],f=n.length,h=e;if(e.hook.creating.fire===D&&e.hook.updating.fire===D){a=L(s);for(var d=0,p=n.length;d=0;--i){var o=y[i];(null==o||m[o])&&(e.push(n[i]),t&&r.push(o),null!=o&&(m[o]=null))}return e.reverse(),t&&r.reverse(),h.bulkAdd(e,r)}).then(function(n){var t=y[y.length-1];return null!=t?t:n}):h.bulkAdd(n);g.then(c).catch(S,function(n){s=s.concat(n.failures),c()}).catch(i)}},"locked")},bulkAdd:function(n,t){var e=this,r=this.hook.creating.fire;return this._idbstore(tt,function(i,o,u,a){function c(n){0===h.length?i(n):o(new S(e.name+".bulkAdd(): "+h.length+" of "+y+" operations failed",h))}if(!u.keyPath&&!e.schema.primKey.auto&&!t)throw new nt.InvalidArgument("bulkAdd() with non-inbound keys requires keys array in second argument");if(u.keyPath&&t)throw new nt.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(t&&t.length!==n.length)throw new nt.InvalidArgument("Arguments objects and keys must have the same length");if(0===n.length)return i();var s,f,l,h=[],y=n.length;if(r!==D){var m,g=u.keyPath;f=L(h,null,!0),l=kn(null),d(function(){for(var e=0,i=n.length;e0&&!this._locked();){var n=this._blockedFuncs.shift();try{dn(n[1],n[0])}catch(n){}}return this},_locked:function(){return this._reculock&&Et.lockOwnerFor!==this},create:function(n){var t=this;if(!this.mode)return this;if(s(!this.idbtrans),!n&&!Gn)switch(Jn&&Jn.name){case"DatabaseClosedError":throw new nt.DatabaseClosed(Jn);case"MissingAPIError":throw new nt.MissingAPI(Jn.message,Jn);default:throw new nt.OpenFailed(Jn)}if(!this.active)throw new nt.TransactionInactive;return s(null===this._completion._state),n=this.idbtrans=n||Gn.transaction(In(this.storeNames),this.mode),n.onerror=rn(function(e){Pn(e),t._reject(n.error)}),n.onabort=rn(function(n){Pn(n),t.active&&t._reject(new nt.Abort),t.active=!1,t.on("abort").fire(n)}),n.oncomplete=rn(function(){t.active=!1,t._resolve()}),this},_promise:function(n,t,e){var r=this;if(n===tt&&this.mode!==tt)return Nt(new nt.ReadOnly("Transaction is readonly"));if(!this.active)return Nt(new nt.TransactionInactive);if(this._locked())return new R(function(i,o){r._blockedFuncs.push([function(){r._promise(n,t,e).then(i,o)},Et])});if(e)return on(function(){var n=new R(function(n,e){r._lock();var i=t(n,e,r);i&&i.then&&i.then(n,e)});return n.finally(function(){return r._unlock()}),n._lib=!0,n});var i=new R(function(n,e){var i=t(n,e,r);i&&i.then&&i.then(n,e)});return i._lib=!0,i},_root:function(){return this.parent?this.parent._root():this},waitFor:function(n){var t=this._root();if(n=R.resolve(n),t._waitingFor)t._waitingFor=t._waitingFor.then(function(){return n});else{t._waitingFor=n,t._waitingQueue=[];var e=t.idbtrans.objectStore(t.storeNames[0]);!function n(){for(++t._spinCount;t._waitingQueue.length;)t._waitingQueue.shift()();t._waitingFor&&(e.get(-(1/0)).onsuccess=n)}()}var r=t._waitingFor;return new R(function(e,i){n.then(function(n){return t._waitingQueue.push(rn(e.bind(null,n)))},function(n){return t._waitingQueue.push(rn(i.bind(null,n)))}).finally(function(){t._waitingFor===r&&(t._waitingFor=null)})})},abort:function(){this.active&&this._reject(new nt.Abort),this.active=!1},tables:{get:E("Transaction.tables",function(){return Hn})},table:function(n){var t=et.table(n);return new z(n,t.schema,this)}}),e(H.prototype,function(){function n(n,t,e){var r=n instanceof H?new G(n):n;return r._ctx.error=e?new e(t):new TypeError(t),r}function t(n){return new G(n,function(){return Un.only("")}).limit(0)}function e(n){return"next"===n?function(n){return n.toUpperCase()}:function(n){return n.toLowerCase()}}function r(n){return"next"===n?function(n){return n.toLowerCase()}:function(n){return n.toUpperCase()}}function i(n,t,e,r,i,o){for(var u=Math.min(n.length,r.length),a=-1,c=0;c=0?n.substr(0,a)+t[a]+e.substr(a+1):null;i(n[c],s)<0&&(a=c)}return u0)&&(a=s)}return t(null!==a?function(){n.continue(a+p)}:e),!1}),m}return{between:function(e,r,i,o){i=i!==!1,o=o===!0;try{return tn(e,r)>0||0===tn(e,r)&&(i||o)&&(!i||!o)?t(this):new G(this,function(){return Un.bound(e,r,!i,!o)})}catch(t){return n(this,zt)}},equals:function(n){return new G(this,function(){return Un.only(n)})},above:function(n){return new G(this,function(){return Un.lowerBound(n,!0)})},aboveOrEqual:function(n){return new G(this,function(){return Un.lowerBound(n)})},below:function(n){return new G(this,function(){return Un.upperBound(n,!0)})},belowOrEqual:function(n){return new G(this,function(){return Un.upperBound(n)})},startsWith:function(t){return"string"!=typeof t?n(this,Lt):this.between(t,t+Rt,!0,!0)},startsWithIgnoreCase:function(n){return""===n?this.startsWith(n):o(this,function(n,t){return 0===n.indexOf(t[0])},[n],Rt)},equalsIgnoreCase:function(n){return o(this,function(n,t){return n===t[0]},[n],"")},anyOfIgnoreCase:function(){var n=_.apply(Ln,arguments);return 0===n.length?t(this):o(this,function(n,t){return t.indexOf(n)!==-1},n,"")},startsWithAnyOfIgnoreCase:function(){var n=_.apply(Ln,arguments);return 0===n.length?t(this):o(this,function(n,t){return t.some(function(t){return 0===n.indexOf(t)})},n,Rt)},anyOf:function(){var e=_.apply(Ln,arguments),r=sn;try{e.sort(r)}catch(t){return n(this,zt)}if(0===e.length)return t(this);var i=new G(this,function(){return Un.bound(e[0],e[e.length-1])});i._ondirectionchange=function(n){r="next"===n?sn:fn,e.sort(r)};var o=0;return i._addAlgorithm(function(n,t,i){for(var u=n.key;r(u,e[o])>0;)if(++o,o===e.length)return t(i),!1;return 0===r(u,e[o])||(t(function(){n.continue(e[o])}),!1)}),i},notEqual:function(n){return this.inAnyRange([[Vt,n],[n,Ut]],{includeLowers:!1,includeUppers:!1})},noneOf:function(){var t=_.apply(Ln,arguments);if(0===t.length)return new G(this);try{t.sort(sn)}catch(t){return n(this,zt)}var e=t.reduce(function(n,t){return n?n.concat([[n[n.length-1][1],t]]):[[Vt,t]]},null);return e.push([t[t.length-1],Ut]),this.inAnyRange(e,{includeLowers:!1,includeUppers:!1})},inAnyRange:function(e,r){function i(n,t){for(var e=0,r=n.length;e0){i[0]=en(i[0],t[0]),i[1]=cn(i[1],t[1]);break}}return e===r&&n.push(t),n}function o(n,t){return f(n[0],t[0])}function u(n){return!h(n)&&!d(n)}if(0===e.length)return t(this);if(!e.every(function(n){return void 0!==n[0]&&void 0!==n[1]&&sn(n[0],n[1])<=0}))return n(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",nt.InvalidArgument);var a,c=!r||r.includeLowers!==!1,s=r&&r.includeUppers===!0,f=sn;try{a=e.reduce(i,[]),a.sort(o)}catch(t){return n(this,zt)}var l=0,h=s?function(n){return sn(n,a[l][1])>0}:function(n){return sn(n,a[l][1])>=0},d=c?function(n){return fn(n,a[l][0])>0}:function(n){return fn(n,a[l][0])>=0},v=h,p=new G(this,function(){return Un.bound(a[0][0],a[a.length-1][1],!c,!s)});return p._ondirectionchange=function(n){"next"===n?(v=h,f=sn):(v=d,f=fn),a.sort(o)},p._addAlgorithm(function(n,t,e){for(var r=n.key;v(r);)if(++l,l===a.length)return t(e),!1;return!!u(r)||0!==tn(r,a[l][1])&&0!==tn(r,a[l][0])&&(t(function(){f===sn?n.continue(a[l][0]):n.continue(a[l][1])}),!1)}),p},startsWithAnyOf:function(){var e=_.apply(Ln,arguments);return e.every(function(n){return"string"==typeof n})?0===e.length?t(this):this.inAnyRange(e.map(function(n){return[n,n+Rt]})):n(this,"startsWithAnyOf() only works with strings")}}}),e(G.prototype,function(){function e(n,t){n.filter=vn(n.filter,t)}function r(n,t,e){var r=n.replayFilter;n.replayFilter=r?function(){return vn(r(),t())}:t,n.justLimit=e&&!r}function i(n,t){n.isMatch=vn(n.isMatch,t)}function o(n,t){if(n.isPrimKey)return t;var e=n.table.schema.idxByName[n.index];if(!e)throw new nt.Schema("KeyPath "+n.index+" on object store "+t.name+" is not indexed");return t.index(e.name)}function u(n,t){var e=o(n,t);return n.keysOnly&&"openKeyCursor"in e?e.openKeyCursor(n.range||null,n.dir+n.unique):e.openCursor(n.range||null,n.dir+n.unique)}function a(n,e,r,i,o){var a=n.replayFilter?vn(n.filter,n.replayFilter()):n.filter;n.or?function(){function c(){2===++l&&r()}function s(n,r,o){if(!a||a(r,o,c,i)){var u=r.primaryKey.toString();t(f,u)||(f[u]=!0,e(n,r,o))}}var f={},l=0;n.or._iterate(s,c,i,o),Z(u(n,o),n.algorithm,s,c,i,!n.keysOnly&&n.valueMapper)}():Z(u(n,o),vn(n.algorithm,a),e,r,i,!n.keysOnly&&n.valueMapper)}function c(n){return n.table.schema.instanceTemplate}return{_read:function(n,t){var e=this._ctx;return e.error?e.table._trans(null,Nt.bind(null,e.error)):e.table._idbstore(Zn,n).then(t)},_write:function(n){var t=this._ctx;return t.error?t.table._trans(null,Nt.bind(null,t.error)):t.table._idbstore(tt,n,"locked")},_addAlgorithm:function(n){var t=this._ctx;t.algorithm=vn(t.algorithm,n)},_iterate:function(n,t,e,r){return a(this._ctx,n,t,e,r)},clone:function(t){var e=Object.create(this.constructor.prototype),r=Object.create(this._ctx);return t&&n(r,t),e._ctx=r,e},raw:function(){return this._ctx.valueMapper=null,this},each:function(n){var t=this._ctx;if($t){var e=c(t),r=t.table.schema.primKey.keyPath,i=v(e,t.index?t.table.schema.idxByName[t.index].keyPath:r),o=v(e,r);n(e,{key:i,primaryKey:o})}return this._read(function(e,r,i){a(t,n,e,r,i)})},count:function(n){if($t)return R.resolve(0).then(n);var t=this._ctx;if(J(t,!0))return this._read(function(n,e,r){var i=o(t,r),u=t.range?i.count(t.range):i.count();u.onerror=xn(e),u.onsuccess=function(e){n(Math.min(e.target.result,t.limit))}},n);var e=0;return this._read(function(n,r,i){a(t,function(){return++e,!1},function(){n(e)},r,i)},n)},sortBy:function(n,t){function e(n,t){return t?e(n[i[t]],t-1):n[o]}function r(n,t){var r=e(n,u),i=e(t,u);return ri?a:0}var i=n.split(".").reverse(),o=i[0],u=i.length-1,a="next"===this._ctx.dir?1:-1;return this.toArray(function(n){return n.sort(r)}).then(t)},toArray:function(n){var t=this._ctx;return this._read(function(n,e,r){if($t&&n([c(t)]),Bn&&"next"===t.dir&&J(t,!0)&&t.limit>0){var i=t.table.hook.reading.fire,u=o(t,r),s=t.limit<1/0?u.getAll(t.range,t.limit):u.getAll(t.range);s.onerror=xn(e),s.onsuccess=jn(i===C?n:function(t){try{n(t.map(i))}catch(n){e(n)}})}else{var f=[];a(t,function(n){f.push(n)},function(){n(f)},e,r)}},n)},offset:function(n){var t=this._ctx;return n<=0?this:(t.offset+=n,J(t)?r(t,function(){var t=n;return function(n,e){return 0===t||(1===t?(--t,!1):(e(function(){n.advance(t),t=0}),!1))}}):r(t,function(){var t=n;return function(){return--t<0}}),this)},limit:function(n){return this._ctx.limit=Math.min(this._ctx.limit,n),r(this._ctx,function(){var t=n;return function(n,e,r){return--t<=0&&e(r),t>=0}},!0),this},until:function(n,t){var r=this._ctx;return $t&&n(c(r)),e(this._ctx,function(e,r,i){return!n(e.value)||(r(i),t)}),this},first:function(n){return this.limit(1).toArray(function(n){return n[0]}).then(n)},last:function(n){return this.reverse().first(n)},filter:function(n){return $t&&n(c(this._ctx)),e(this._ctx,function(t){return n(t.value)}),i(this._ctx,n),this},and:function(n){return this.filter(n)},or:function(n){return new H(this._ctx.table,n,this)},reverse:function(){return this._ctx.dir="prev"===this._ctx.dir?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this},desc:function(){return this.reverse()},eachKey:function(n){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each(function(t,e){n(e.key,e)})},eachUniqueKey:function(n){return this._ctx.unique="unique",this.eachKey(n)},eachPrimaryKey:function(n){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each(function(t,e){n(e.primaryKey,e)})},keys:function(n){var t=this._ctx;t.keysOnly=!t.isMatch;var e=[];return this.each(function(n,t){e.push(t.key)}).then(function(){return e}).then(n)},primaryKeys:function(n){var t=this._ctx;if(Bn&&"next"===t.dir&&J(t,!0)&&t.limit>0)return this._read(function(n,e,r){var i=o(t,r),u=t.limit<1/0?i.getAllKeys(t.range,t.limit):i.getAllKeys(t.range);u.onerror=xn(e),u.onsuccess=jn(n)}).then(n);t.keysOnly=!t.isMatch;var e=[];return this.each(function(n,t){e.push(t.primaryKey)}).then(function(){return e}).then(n)},uniqueKeys:function(n){return this._ctx.unique="unique",this.keys(n)},firstKey:function(n){return this.limit(1).keys(function(n){return n[0]}).then(n)},lastKey:function(n){return this.reverse().firstKey(n)},distinct:function(){var n=this._ctx,r=n.index&&n.table.schema.idxByName[n.index];if(!r||!r.multi)return this;var i={};return e(this._ctx,function(n){var e=n.primaryKey.toString(),r=t(i,e);return i[e]=!0,!r}),this},modify:function(e){var r=this,i=this._ctx,o=i.table.hook,u=o.updating.fire,a=o.deleting.fire;return $t&&"function"==typeof e&&e.call({value:i.table.schema.instanceTemplate},i.table.schema.instanceTemplate),this._write(function(i,o,c,s){function f(n,e){function r(n){return P.push(n),A.push(i.primKey),h(),!0}S=e.primaryKey;var i={primKey:e.primaryKey,value:n,onsuccess:null,onerror:null};if(y.call(i,n,i)!==!1){var o=!t(i,"value");++x,d(function(){var n=o?e.delete():e.update(i.value);n._hookCtx=i,n.onerror=En(r),n.onsuccess=kn(function(){++j,h()})},r)}else i.onsuccess&&i.onsuccess(i.value)}function l(n){return n&&(P.push(n),A.push(S)),o(new O("Error modifying one or more objects",P,j,A))}function h(){E&&j+P.length===x&&(P.length>0?l():i(j))}var y;if("function"==typeof e)y=u===D&&a===D?e:function(n){var r=b(n);if(e.call(this,n,this)===!1)return!1;if(t(this,"value")){var i=w(r,this.value),o=u.call(this,i,this.primKey,r,s);o&&(n=this.value,Cn(o).forEach(function(t){p(n,t,o[t])}))}else a.call(this,this.primKey,n,s)};else if(u===D){var g=Cn(e),_=g.length;y=function(n){for(var t=!1,r=0;r<_;++r){var i=g[r],o=e[i];v(n,i)!==o&&(p(n,i,o),t=!0)}return t}}else{var k=e;e=m(k),y=function(t){var r=!1,i=u.call(this,e,this.primKey,b(t),s);return i&&n(e,i),Cn(e).forEach(function(n){var i=e[n];v(t,n)!==i&&(p(t,n,i),r=!0)}),i&&(e=m(k)),r}}var x=0,j=0,E=!1,P=[],A=[],S=null;r.clone().raw()._iterate(f,function(){E=!0,h()},l,c)})},delete:function(){var n=this,t=this._ctx,e=t.range,r=t.table.hook.deleting.fire,i=r!==D;if(!i&&J(t)&&(t.isPrimKey&&!Gt||!e))return this._write(function(n,t,r){var i=xn(t),o=e?r.count(e):r.count();o.onerror=i,o.onsuccess=function(){var u=o.result;d(function(){var t=e?r.delete(e):r.clear();t.onerror=i,t.onsuccess=function(){return n(u)}},function(n){return t(n)})}});var o=i?2e3:1e4;return this._write(function(e,u,a,c){var s=0,f=n.clone({keysOnly:!t.isMatch&&!i}).distinct().limit(o).raw(),l=[],h=function(){return f.each(i?function(n,t){l.push([t.primaryKey,t.value])}:function(n,t){l.push(t.primaryKey)}).then(function(){return i?l.sort(function(n,t){return sn(n[0],t[0])}):l.sort(sn),W(a,c,l,i,r)}).then(function(){var n=l.length;return s+=n,l=[],n{},p=F();return [p,Object.getPrototypeOf(p),Promise.resolve(),F.constructor];")()}catch(t){var n=Kn.Promise;return n?[n.resolve(),n.prototype,n.resolve()]:[]}}(),ct=at[0],st=at[1],ft=at[2],lt=st&&st.then,ht=ct&&ct.constructor,dt=at[3],vt=!!ft,pt=!1,yt=ft?function(){ft.then(J)}:Kn.setImmediate?setImmediate.bind(null,J):Kn.MutationObserver?function(){var n=document.createElement("div");new MutationObserver(function(){J(),n=null}).observe(n,{attributes:!0}),n.setAttribute("i","1")}:function(){setTimeout(J,0)},mt=function(n,t){Pt.push([n,t]),bt&&(yt(),bt=!1)},gt=!0,bt=!0,wt=[],_t=[],kt=null,xt=C,jt={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:mn,pgp:!1,env:{},finalize:function(){this.unhandleds.forEach(function(n){try{mn(n[0],n[1])}catch(n){}})}},Et=jt,Pt=[],At=0,Ot=[],St={get:function(){function n(n,r){var i=this,o=!t.global&&(t!==Et||e!==Kt);o&&an();var u=new R(function(e,u){W(i,new U(pn(n,t,o),pn(r,t,o),e,u,t))});return Wn&&G(u,this),u}var t=Et,e=Kt;return n.prototype=rt,n},set:function(n){r(this,"then",n&&n.prototype===rt?St:{get:function(){return n},set:St.set})}};e(R.prototype,{then:St,_then:function(n,t){W(this,new U(null,null,n,t,Et))},catch:function(n){if(1===arguments.length)return this.then(null,n);var t=arguments[0],e=arguments[1];return"function"==typeof t?this.then(null,function(n){return n instanceof t?e(n):en(n)}):this.then(null,function(n){return n&&n.name===t?e(n):en(n)})},finally:function(n){return this.then(function(t){return n(),t},function(t){return n(),en(t)})},stack:{get:function(){if(this._stack)return this._stack;try{pt=!0;var n=H(this,[],ot),t=n.join("\nFrom previous: ");return null!==this._state&&(this._stack=t),t}finally{pt=!1}}},timeout:function(n,t){var e=this;return n<1/0?new R(function(r,i){var o=setTimeout(function(){return i(new nt.Timeout(t))},n);e.then(r,i).finally(clearTimeout.bind(null,o))}):this}}),"undefined"!=typeof Symbol&&Symbol.toStringTag&&r(R.prototype,Symbol.toStringTag,"Promise"),jt.env=hn(),e(R,{all:function(){var n=_.apply(null,arguments).map(cn);return new R(function(t,e){0===n.length&&t([]);var r=n.length;n.forEach(function(i,o){return R.resolve(i).then(function(e){n[o]=e,--r||t(n)},e)})})},resolve:function(n){if(n instanceof R)return n;if(n&&"function"==typeof n.then)return new R(function(t,e){n.then(t,e)});var t=new R(rt,!0,n);return G(t,kt),t},reject:en,race:function(){var n=_.apply(null,arguments).map(cn);return new R(function(t,e){n.map(function(n){return R.resolve(n).then(t,e)})})},PSD:{get:function(){return Et},set:function(n){return Et=n}},newPSD:on,usePSD:dn,scheduler:{get:function(){return mt},set:function(n){mt=n}},rejectionMapper:{get:function(){return xt},set:function(n){xt=n}},follow:function(n,t){return new R(function(e,r){return on(function(t,e){var r=Et;r.unhandleds=[],r.onunhandled=e,r.finalize=K(function(){var n=this;Z(function(){0===n.unhandleds.length?t():e(n.unhandleds[0])})},r.finalize),n()},t,e,r)})}});var It={awaits:0,echoes:0,id:0},Dt=0,Ct=[],Tt=0,Kt=0,Bt=0,Ft="unhandledrejection";c(function(){mt=function(n,t){setTimeout(function(){n.apply(null,t)},0)}});var Mt,Nt=R.reject,qt="2.0.0-beta.10",Rt=String.fromCharCode(65535),Ut=function(){try{return IDBKeyRange.only([[]]),[[]]}catch(n){return Rt}}(),Vt=-(1/0),zt="Invalid key provided. Keys must be of type string, number, Date or Array.",Lt="String expected.",Wt=[],Qt="undefined"!=typeof navigator&&/(MSIE|Trident|Edge)/.test(navigator.userAgent),Ht=Qt,Gt=Qt,Jt=function(n){return!/(dexie\.js|dexie\.min\.js)/.test(n)};k(Wn,Jt);var Yt=function(){},$t=!1,Xt=Kn.idbModules&&Kn.idbModules.shimIndexedDB?Kn.idbModules:{};return e(bn,et),e(bn,{delete:function(n){var t=new bn(n),e=t.delete();return e.onblocked=function(n){return t.on("blocked",n),this},e},exists:function(n){return new bn(n).open().then(function(n){return n.close(),!0}).catch(bn.NoSuchDatabaseError,function(){return!1})},getDatabaseNames:function(n){var t=Dn(bn.dependencies.indexedDB);return t?new R(function(n,e){var r=t();r.onsuccess=function(t){n(u(t.target.result,0))},r.onerror=xn(e)}).then(n):Mt.dbnames.toCollection().primaryKeys(n)},defineClass:function(t){function e(e){e?n(this,e):$t&&_n(this,t)}return e},applyStructure:_n,ignoreTransaction:function(n){return Et.trans?dn(Et.transless,n):n()},vip:function(n){return on(function(){return Et.letThrough=!0,n()})},async:function(n){return function(){try{var t=An(n.apply(this,arguments));return t&&"function"==typeof t.then?t:R.resolve(t)}catch(n){return Nt(n)}}},spawn:function(n,t,e){try{var r=An(n.apply(e,t||[]));return r&&"function"==typeof r.then?r:R.resolve(r)}catch(n){return Nt(n)}},currentTransaction:{get:function(){return Et.trans||null}},waitFor:function(n,t){var e=R.resolve("function"==typeof n?bn.ignoreTransaction(n):n).timeout(t||6e4);return Et.trans?Et.trans.waitFor(e):e},Promise:R,debug:{get:function(){return Wn},set:function(n){k(n,"dexie"===n?function(){return!0}:Jt)}},derive:i,extend:n,props:e,override:a,Events:gn,getByKeyPath:v,setByKeyPath:p,delByKeyPath:y,shallowClone:m,deepClone:b,getObjectDiff:w,asap:f,maxKey:Ut,minKey:Vt,addons:[],connections:Wt,MultiModifyError:nt.Modify,errnames:Xn,IndexSpec:On,TableSchema:Sn,dependencies:{indexedDB:Xt.shimIndexedDB||Kn.indexedDB||Kn.mozIndexedDB||Kn.webkitIndexedDB||Kn.msIndexedDB,IDBKeyRange:Xt.IDBKeyRange||Kn.IDBKeyRange||Kn.webkitIDBKeyRange},semVer:qt,version:qt.split(".").map(function(n){return parseInt(n)}).reduce(function(n,t,e){return n+t/Math.pow(10,2*e)}),fakeAutoComplete:Yt,default:bn,Dexie:bn}),R.rejectionMapper=I,c(function(){bn.fakeAutoComplete=Yt=c,bn.fake=$t=!0}),Mt=new bn("__dbnames"),Mt.version(1).stores({dbnames:"name"}),function(){var n="Dexie.DatabaseNames";if(void 0!==typeof localStorage&&void 0!==Kn.document)try{JSON.parse(localStorage.getItem(n)||"[]").forEach(function(n){return Mt.dbnames.put({name:n}).catch(D)}),localStorage.removeItem(n)}catch(n){}}(),bn}); -//# sourceMappingURL=dist/dexie.min.js.map \ No newline at end of file