function _typeof(n){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n})(n)}!function(n,t){"object"===("undefined"==typeof exports?"undefined":_typeof(exports))&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((n="undefined"!=typeof globalThis?globalThis:n||self).idbKeyval={})}(this,(function(n){"use strict";function t(n){return new Promise((function(t,e){n.oncomplete=n.onsuccess=function(){return t(n.result)},n.onabort=n.onerror=function(){return e(n.error)}}))}function e(n,e){var r,o=(!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise((function(n){var t=function(){return indexedDB.databases().finally(n)};r=setInterval(t,100),t()})).finally((function(){return clearInterval(r)})):Promise.resolve()).then((function(){var r=indexedDB.open(n);return r.onupgradeneeded=function(){return r.result.createObjectStore(e)},t(r)}));return function(n,t){return o.then((function(r){return t(r.transaction(e,n).objectStore(e))}))}}var r;function o(){return r||(r=e("keyval-store","keyval")),r}function u(n,e){return n("readonly",(function(n){return n.openCursor().onsuccess=function(){this.result&&(e(this.result),this.result.continue())},t(n.transaction)}))}n.clear=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:o();return n("readwrite",(function(n){return n.clear(),t(n.transaction)}))},n.createStore=e,n.del=function(n){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o();return e("readwrite",(function(e){return e.delete(n),t(e.transaction)}))},n.delMany=function(n){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o();return e("readwrite",(function(e){return n.forEach((function(n){return e.delete(n)})),t(e.transaction)}))},n.entries=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:o(),t=[];return u(n,(function(n){return t.push([n.key,n.value])})).then((function(){return t}))},n.get=function(n){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o();return e("readonly",(function(e){return t(e.get(n))}))},n.getMany=function(n){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o();return e("readonly",(function(e){return Promise.all(n.map((function(n){return t(e.get(n))})))}))},n.keys=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:o(),t=[];return u(n,(function(n){return t.push(n.key)})).then((function(){return t}))},n.promisifyRequest=t,n.set=function(n,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:o();return r("readwrite",(function(r){return r.put(e,n),t(r.transaction)}))},n.setMany=function(n){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o();return e("readwrite",(function(e){return n.forEach((function(n){return e.put(n[1],n[0])})),t(e.transaction)}))},n.update=function(n,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:o();return r("readwrite",(function(r){return new Promise((function(o,u){r.get(n).onsuccess=function(){try{r.put(e(this.result),n),o(t(r.transaction))}catch(n){u(n)}}}))}))},n.values=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:o(),t=[];return u(n,(function(n){return t.push(n.value)})).then((function(){return t}))},Object.defineProperty(n,"__esModule",{value:!0})}));
