-
-
Notifications
You must be signed in to change notification settings - Fork 190
/
Copy pathindexeddbshim.min.js
3 lines (3 loc) · 143 KB
/
indexeddbshim.min.js
1
2
3
/*! indexeddbshim - v15.2.0 - 9/11/2024 */
!function(e){"function"==typeof define&&define.amd?define(e):e()}((function(){"use strict";function e(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function t(e,t,n,r,o,i,a){try{var u=e[i](a),c=u.value}catch(e){return void n(e)}u.done?t(c):Promise.resolve(c).then(r,o)}function n(e){return function(){var n=this,r=arguments;return new Promise((function(o,i){var a=e.apply(n,r);function u(e){t(a,o,i,u,c,"next",e)}function c(e){t(a,o,i,u,c,"throw",e)}u(void 0)}))}}function r(e,t,n){if(c())return Reflect.construct.apply(null,arguments);var r=[null];return r.push.apply(r,t),new(e.bind.apply(e,r))}function o(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,p(r.key),r)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function i(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=y(e))||t){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function a(e,t,n,r){var o={configurable:!0,enumerable:!0};return o[e]=r,Object.defineProperty(t,n,o)}function u(e,t,n){return(t=p(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(c=function(){return!!e})()}function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){u(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function f(){f=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(e,t,n){e[t]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function s(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(e){s=function(e,t,n){return e[t]=n}}function l(e,t,n,r){var i=t&&t.prototype instanceof b?t:b,a=Object.create(i.prototype),u=new B(r||[]);return o(a,"_invoke",{value:T(e,n,u)}),a}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=l;var _="suspendedStart",p="suspendedYield",h="executing",y="completed",v={};function b(){}function g(){}function m(){}var E={};s(E,a,(function(){return this}));var w=Object.getPrototypeOf,D=w&&w(w(F([])));D&&D!==n&&r.call(D,a)&&(E=D);var I=m.prototype=b.prototype=Object.create(E);function O(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function S(e,t){function n(o,i,a,u){var c=d(e[o],e,i);if("throw"!==c.type){var s=c.arg,l=s.value;return l&&"object"==typeof l&&r.call(l,"__await")?t.resolve(l.__await).then((function(e){n("next",e,a,u)}),(function(e){n("throw",e,a,u)})):t.resolve(l).then((function(e){s.value=e,a(s)}),(function(e){return n("throw",e,a,u)}))}u(c.arg)}var i;o(this,"_invoke",{value:function(e,r){function o(){return new t((function(t,o){n(e,r,t,o)}))}return i=i?i.then(o,o):o()}})}function T(t,n,r){var o=_;return function(i,a){if(o===h)throw Error("Generator is already running");if(o===y){if("throw"===i)throw a;return{value:e,done:!0}}for(r.method=i,r.arg=a;;){var u=r.delegate;if(u){var c=A(u,r);if(c){if(c===v)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===_)throw o=y,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=h;var s=d(t,n,r);if("normal"===s.type){if(o=r.done?y:p,s.arg===v)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(o=y,r.method="throw",r.arg=s.arg)}}}function A(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,A(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var i=d(o,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var a=i.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,v):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function N(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function B(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(N,this),this.reset(!0)}function F(t){if(t||""===t){var n=t[a];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function n(){for(;++o<t.length;)if(r.call(t,o))return n.value=t[o],n.done=!1,n;return n.value=e,n.done=!0,n};return i.next=i}}throw new TypeError(typeof t+" is not iterable")}return g.prototype=m,o(I,"constructor",{value:m,configurable:!0}),o(m,"constructor",{value:g,configurable:!0}),g.displayName=s(m,c,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,m):(e.__proto__=m,s(e,c,"GeneratorFunction")),e.prototype=Object.create(I),e},t.awrap=function(e){return{__await:e}},O(S.prototype),s(S.prototype,u,(function(){return this})),t.AsyncIterator=S,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new S(l(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},O(I),s(I,c,"Generator"),s(I,a,(function(){return this})),s(I,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=F,B.prototype={constructor:B,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(x),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function o(r,o){return u.type="throw",u.arg=t,n.next=r,o&&(n.method="next",n.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),s=r.call(a,"finallyLoc");if(c&&s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!s)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),v},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),x(n),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;x(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:F(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),v}},t}function d(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,u=[],c=!0,s=!1;try{if(i=(n=n.call(e)).next,0===t);else for(;!(c=(r=i.call(n)).done)&&(u.push(r.value),u.length!==t);c=!0);}catch(e){s=!0,o=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(s)throw o}}return u}}(e,t)||y(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _(t){return function(t){if(Array.isArray(t))return e(t)}(t)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||y(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function p(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}function h(e){return h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},h(e)}function y(t,n){if(t){if("string"==typeof t)return e(t,n);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?e(t,n):void 0}}function v(e){return v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},v(e)}var b=0,g=1,m=2,E=3,w="undefined"==typeof DOMException?function(e,t){var n=new Error(e);return n.name=t,n}:DOMException,D=new WeakMap,I=new WeakMap,O=function(e){var t=this;this[Symbol.toStringTag]="Event",this.toString=function(){return"[object Event]"};var n=Array.prototype.slice.call(arguments),r=n[1],o=n[2];if(!arguments.length)throw new TypeError("Failed to construct 'Event': 1 argument required, but only 0 present.");o=o||{};var i={};"composed"in(r=r||{})&&(i.composed=r.composed),D.set(this,o),I.set(this,i);this.initEvent(e,r.bubbles,r.cancelable),["target","currentTarget","eventPhase","defaultPrevented"].forEach((function(e){var n=e;Object.defineProperty(t,n,{get:function(){return void 0!==i[n]?i[n]:n in o?o[n]:"eventPhase"===n?0:"defaultPrevented"!==n&&null}})}));var a=["type","bubbles","cancelable","isTrusted","timeStamp","initEvent","composedPath","composed"];"[object CustomEvent]"===this.toString()&&a.push("detail","initCustomEvent"),Object.defineProperties(this,a.reduce((function(e,t){var n=t;return e[n]={get:function(){return n in i?i[n]:n in o?o[n]:!["bubbles","cancelable","composed"].includes(n)&&void 0}},e}),{}))};O.prototype.preventDefault=function(){if(!(this instanceof O))throw new TypeError("Illegal invocation");var e=D.get(this),t=I.get(this);this.cancelable&&!t._passive&&(t.defaultPrevented=!0,"function"==typeof e.preventDefault&&e.preventDefault())},O.prototype.stopImmediatePropagation=function(){I.get(this)._stopImmediatePropagation=!0},O.prototype.stopPropagation=function(){I.get(this)._stopPropagation=!0},O.prototype.initEvent=function(e,t,n){var r=I.get(this);r._dispatched||(Object.defineProperty(this,"type",{enumerable:!0,configurable:!0,get:function(){return e}}),Object.defineProperty(this,"bubbles",{enumerable:!0,configurable:!0,get:function(){return t}}),Object.defineProperty(this,"cancelable",{enumerable:!0,configurable:!0,get:function(){return n}}),r.type=e,void 0!==t&&(r.bubbles=t),void 0!==n&&(r.cancelable=n))},["type","target","currentTarget"].forEach((function(e){Object.defineProperty(O.prototype,e,{enumerable:!0,configurable:!0,get:function(){throw new TypeError("Illegal invocation")}})})),["eventPhase","defaultPrevented","bubbles","cancelable","timeStamp"].forEach((function(e){Object.defineProperty(O.prototype,e,{enumerable:!0,configurable:!0,get:function(){throw new TypeError("Illegal invocation")}})})),["NONE","CAPTURING_PHASE","AT_TARGET","BUBBLING_PHASE"].forEach((function(e,t){Object.defineProperty(O,e,{enumerable:!0,writable:!1,value:t}),Object.defineProperty(O.prototype,e,{writable:!1,value:t})})),O[Symbol.toStringTag]="Function",O.prototype[Symbol.toStringTag]="EventPrototype",Object.defineProperty(O,"prototype",{writable:!1});var S=function(e){var t=Array.prototype.slice.call(arguments),n=t[1],r=t[2];O.call(this,e,n,r),this[Symbol.toStringTag]="CustomEvent",this.toString=function(){return"[object CustomEvent]"},n=n||{},this.initCustomEvent(e,n.bubbles,n.cancelable,"detail"in n?n.detail:null)};function T(e,t,n){var r=e[t];void 0===r&&(e[t]=r=[]);var o="boolean"==typeof n?{capture:n}:n||{},i=JSON.stringify(o);return{listenersByTypeOptions:r.filter((function(e){return i===JSON.stringify(e.options)})),options:o,listenersByType:r}}Object.defineProperty(S.prototype,"constructor",{enumerable:!1,writable:!0,configurable:!0,value:S}),S.prototype.initCustomEvent=function(e,t,n,r){if(!(this instanceof S))throw new TypeError("Illegal invocation");var o=I.get(this);S.call(this,e,{bubbles:t,cancelable:n,detail:r},arguments[4]),o._dispatched||(void 0!==r&&(o.detail=r),Object.defineProperty(this,"detail",{get:function(){return o.detail}}))},S[Symbol.toStringTag]="Function",S.prototype[Symbol.toStringTag]="CustomEventPrototype",Object.defineProperty(S.prototype,"detail",{enumerable:!0,configurable:!0,get:function(){throw new TypeError("Illegal invocation")}}),Object.defineProperty(S,"prototype",{writable:!1});var A={addListener:function(e,t,n,r){var o=T(e,n,r),i=o.listenersByTypeOptions;r=o.options;var a=o.listenersByType;i.some((function(e){return e.listener===t}))||a.push({listener:t,options:r})},removeListener:function(e,t,n,r){var o=T(e,n,r),i=o.listenersByType,a=JSON.stringify(o.options);i.some((function(r,o){return r.listener===t&&a===JSON.stringify(r.options)&&(i.splice(o,1),i.length||delete e[n],!0)}))},hasListener:function(e,t,n,r){return T(e,n,r).listenersByTypeOptions.some((function(e){return e.listener===t}))}};function N(){throw new TypeError("Illegal constructor")}Object.assign(N.prototype,["Early","","Late","Default"].reduce((function(e,t){return["add","remove","has"].forEach((function(n){e[n+t+"EventListener"]=function(e,r){var o=arguments[2];if(arguments.length<2)throw new TypeError("2 or more arguments required");if("string"!=typeof e)throw new w("UNSPECIFIED_EVENT_TYPE_ERR","UNSPECIFIED_EVENT_TYPE_ERR");try{"handleEvent"in r&&r.handleEvent.bind&&(r=r.handleEvent.bind(r))}catch(e){console.log("Uncaught `handleEvent` error",e)}var i="_"+t.toLowerCase()+(""===t?"l":"L")+"isteners";return this[i]||Object.defineProperty(this,i,{value:{}}),A[n+"Listener"](this[i],r,e,o)}})),e}),{})),Object.assign(N.prototype,{_legacyOutputDidListenersThrowCheck:void 0,__setOptions:function(e){e=e||{},this._defaultSync=e.defaultSync,this._extraProperties=e.extraProperties||[],e.legacyOutputDidListenersThrowFlag&&(this._legacyOutputDidListenersThrowCheck=!0,this._extraProperties.push("__legacyOutputDidListenersThrowError"))},dispatchEvent:function(e){return this._dispatchEvent(e,!0)},_dispatchEvent:function(e,t){var n=this;["early","","late","default"].forEach((function(e){var t="_"+e+(""===e?"l":"L")+"isteners";n[t]||Object.defineProperty(n,t,{value:{}})}));var r,o=I.get(e);if(o&&t&&o._dispatched)throw new w("The object is in an invalid state.","InvalidStateError");o?r=e:(r=function(e){var t=e.bubbles,n=e.cancelable,r=e.detail,o=e.type;return"detail"in e?new S(o,{bubbles:t,cancelable:n,detail:r},e):new O(o,{bubbles:t,cancelable:n},e)}(e),(o=I.get(r))._dispatched=!0,this._extraProperties.forEach((function(t){t in e&&(r[t]=e[t])})));var i=r.type;function a(){o.eventPhase=b,o.currentTarget=null,delete o._children}function u(){o._stopImmediatePropagation=void 0,o._stopPropagation=void 0,r.defaultPrevented&&o.cancelable||(o.eventPhase=m,r.target.invokeCurrentListeners(r.target._defaultListeners,r,i)),a()}var c=function(){return o._stopImmediatePropagation=void 0,o._stopPropagation=void 0,n._defaultSync?u():setTimeout(u,0),o.eventPhase=m,o._stopPropagation||(o._stopImmediatePropagation=void 0,o._stopPropagation=void 0,r.target.invokeCurrentListeners(r.target._lateListeners,r,i)),a(),!r.defaultPrevented};switch(t&&(o.target=this),"eventPhase"in r&&r.eventPhase){case g:if(o._stopPropagation)return c();this.invokeCurrentListeners(this._listeners,r,i);var s=o._children&&o._children.length&&o._children.pop();return s&&s!==r.target||(o.eventPhase=m),s&&(s._defaultSync=this._defaultSync),(s||this)._dispatchEvent(r,!1);case m:return o._stopPropagation?c():(this.invokeCurrentListeners(this._listeners,r,i,!0),o.bubbles?(o.eventPhase=E,this._dispatchEvent(r,!1)):c());case E:if(o._stopPropagation)return c();var l=this.__getParent&&this.__getParent();return l?(l.invokeCurrentListeners(l._listeners,r,i,!0),l._defaultSync=this._defaultSync,l._dispatchEvent(r,!1)):c();default:if(o.eventPhase=m,this.invokeCurrentListeners(this._earlyListeners,r,i),!("__getParent"in this))return o.eventPhase=m,this._dispatchEvent(r,!1);for(var f=this,d=this;f.__getParent&&null!==(f=f.__getParent());)o._children||(o._children=[]),o._children.push(d),d=f;return d._defaultSync=this._defaultSync,o.eventPhase=g,d._dispatchEvent(r,!1)}},invokeCurrentListeners:function(e,t,n,r){var o=this,i=I.get(t);i.currentTarget=this;var a=T(e,n,{}).listenersByType.concat(),u=a.length?1:0;return a.some((function(e,a){var c=r?o["on"+n]:null;if(i._stopImmediatePropagation)return!0;a===u&&"function"==typeof c&&o.tryCatch(t,(function(){!1===c.call(t.currentTarget,t)&&t.preventDefault()}));var s=e.options,l=s.once,f=s.passive,d=s.capture;if(i._passive=f,d&&t.target!==t.currentTarget&&t.eventPhase===g||t.eventPhase===m||!d&&t.target!==t.currentTarget&&t.eventPhase===E){var _=e.listener;o.tryCatch(t,(function(){_.call(t.currentTarget,t)})),l&&o.removeEventListener(n,_,s)}return!1})),this.tryCatch(t,(function(){var e=r?o["on"+n]:null;"function"==typeof e&&a.length<2&&(!1===e.call(t.currentTarget,t)&&t.preventDefault())})),!t.defaultPrevented},tryCatch:function(e,t){try{t()}catch(t){this.triggerErrorEvent(t,e)}},triggerErrorEvent:function(e,t){var n,r=e;"string"==typeof e&&(r=new Error("Uncaught exception: "+e));var o=!1;"undefined"==typeof window||"undefined"==typeof ErrorEvent||window&&"object"===("undefined"==typeof window?"undefined":v(window))&&!window.dispatchEvent?(o=!0,n=function(){setTimeout((function(){throw r}))}):n=function(){var t=new ErrorEvent("error",{error:e,message:r.message||"",filename:r.fileName||"",lineno:r.lineNumber||0,colno:r.columnNumber||0});window.dispatchEvent(t)},o&&this._legacyOutputDidListenersThrowCheck||n(),this._legacyOutputDidListenersThrowCheck&&(t.__legacyOutputDidListenersThrowError=r)}}),N.prototype[Symbol.toStringTag]="EventTargetPrototype",Object.defineProperty(N,"prototype",{writable:!1});var x=N,B={createInstance:function(e){var t=function(){this.__setOptions(e)};return t.prototype=x.prototype,new t}};N.ShimEvent=O,N.ShimCustomEvent=S,N.ShimDOMException=w,N.ShimEventTarget=N,N.EventTargetFactory=B;var F={},j={};function P(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}["DEBUG","cacheDatabaseInstances","autoName","fullIDLSupport","checkOrigin","cursorPreloadPackSize","UnicodeIDStart","UnicodeIDContinue","registerSCA","avoidAutoShim","win","DEFAULT_DB_SIZE","useSQLiteIndexes","fs","addNonIDBGlobals","replaceNonIDBGlobals","escapeDatabaseName","unescapeDatabaseName","databaseCharacterEscapeList","databaseNameLengthLimit","escapeNFDForDatabaseNames","addSQLiteExtension",["memoryDatabase",function(e){if(!/^(?::memory:|file::memory:(\?(?:[\0-"\$-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?(#(?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?)?$/.test(e))throw new TypeError('`memoryDatabase` must be the empty string, ":memory:", or a "file::memory:[?queryString][#hash] URL".')}],"deleteDatabaseFiles","databaseBasePath","sysDatabaseBasePath","sqlBusyTimeout","sqlTrace","sqlProfile","createIndexes"].forEach((function(e){var t;if(Array.isArray(e)){var n=d(e,2);e=n[0],t=n[1]}Object.defineProperty(j,e,{get:function(){return F[e]},set:function(n){t&&t(n),F[e]=n}})}));var C=P(/[\xC0-\xC5\xC7-\xCF\xD1-\xD6\xD9-\xDD\xE0-\xE5\xE7-\xEF\xF1-\xF6\xF9-\xFD\xFF-\u010F\u0112-\u0125\u0128-\u0130\u0134-\u0137\u0139-\u013E\u0143-\u0148\u014C-\u0151\u0154-\u0165\u0168-\u017E\u01A0\u01A1\u01AF\u01B0\u01CD-\u01DC\u01DE-\u01E3\u01E6-\u01F0\u01F4\u01F5\u01F8-\u021B\u021E\u021F\u0226-\u0233\u0344\u0385\u0386\u0388-\u038A\u038C\u038E-\u0390\u03AA-\u03B0\u03CA-\u03CE\u03D3\u03D4\u0400\u0401\u0403\u0407\u040C-\u040E\u0419\u0439\u0450\u0451\u0453\u0457\u045C-\u045E\u0476\u0477\u04C1\u04C2\u04D0-\u04D3\u04D6\u04D7\u04DA-\u04DF\u04E2-\u04E7\u04EA-\u04F5\u04F8\u04F9\u0622-\u0626\u06C0\u06C2\u06D3\u0929\u0931\u0934\u0958-\u095F\u09CB\u09CC\u09DC\u09DD\u09DF\u0A33\u0A36\u0A59-\u0A5B\u0A5E\u0B48\u0B4B\u0B4C\u0B5C\u0B5D\u0B94\u0BCA-\u0BCC\u0C48\u0CC0\u0CC7\u0CC8\u0CCA\u0CCB\u0D4A-\u0D4C\u0DDA\u0DDC-\u0DDE\u0F43\u0F4D\u0F52\u0F57\u0F5C\u0F69\u0F73\u0F75\u0F76\u0F78\u0F81\u0F93\u0F9D\u0FA2\u0FA7\u0FAC\u0FB9\u1026\u1B06\u1B08\u1B0A\u1B0C\u1B0E\u1B12\u1B3B\u1B3D\u1B40\u1B41\u1B43\u1E00-\u1E99\u1E9B\u1EA0-\u1EF9\u1F00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FC1-\u1FC4\u1FC6-\u1FD3\u1FD6-\u1FDB\u1FDD-\u1FEE\u1FF2-\u1FF4\u1FF6-\u1FFC\u212B\u219A\u219B\u21AE\u21CD-\u21CF\u2204\u2209\u220C\u2224\u2226\u2241\u2244\u2247\u2249\u2260\u2262\u226D-\u2271\u2274\u2275\u2278\u2279\u2280\u2281\u2284\u2285\u2288\u2289\u22AC-\u22AF\u22E0-\u22E3\u22EA-\u22ED\u2ADC\u304C\u304E\u3050\u3052\u3054\u3056\u3058\u305A\u305C\u305E\u3060\u3062\u3065\u3067\u3069\u3070\u3071\u3073\u3074\u3076\u3077\u3079\u307A\u307C\u307D\u3094\u309E\u30AC\u30AE\u30B0\u30B2\u30B4\u30B6\u30B8\u30BA\u30BC\u30BE\u30C0\u30C2\u30C5\u30C7\u30C9\u30D0\u30D1\u30D3\u30D4\u30D6\u30D7\u30D9\u30DA\u30DC\u30DD\u30F4\u30F7-\u30FA\u30FE\uAC00-\uD7A3\uFB1D\uFB1F\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFB4E]|\uD804[\uDC9A\uDC9C\uDCAB\uDD2E\uDD2F\uDF4B\uDF4C]|\uD805[\uDCBB\uDCBC\uDCBE\uDDBA\uDDBB]|\uD806\uDD38|\uD834[\uDD5E-\uDD64\uDDBB-\uDDC0]/);function k(e){return e.replaceAll(/((?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])))(?!(?:(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]))|(^|(?:[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]))((?:(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]))/g,(function(e,t,n,r){return t?"^2"+t.codePointAt().toString(16).padStart(4,"0"):(n||"")+"^3"+r.codePointAt().toString(16).padStart(4,"0")}))}function L(e){return"_"+k(e.replaceAll("^","^^").replaceAll("\0","^0").replaceAll(/([A-Z])/g,"^$1"))}function R(e){return k(e.replaceAll("^","^^").replaceAll("\0","^0"))}function q(e){return function(e){return e.replaceAll(/(\^+)3(d[0-9a-f]{3})/g,(function(e,t,n){return t.length%2?t.slice(1)+String.fromCodePoint(Number.parseInt(n,16)):e})).replaceAll(/(\^+)2(d[0-9a-f]{3})/g,(function(e,t,n){return t.length%2?t.slice(1)+String.fromCodePoint(Number.parseInt(n,16)):e}))}(e).replaceAll(/(\^+)0/g,(function(e,t){return t.length%2?t.slice(1)+"\0":e})).replaceAll("^^","^")}function U(e){return'"'+function(e){return e.replaceAll('"','""')}(e)+'"'}function M(e){if(j.escapeDatabaseName)return j.escapeDatabaseName(R(e));if(e="D"+L(e),!1!==j.escapeNFDForDatabaseNames&&(e=e.replaceAll(new RegExp(C,"gu"),(function(e){return"^4"+e.codePointAt(0).toString(16).padStart(6,"0")}))),!1!==j.databaseCharacterEscapeList&&(e=e.replace(j.databaseCharacterEscapeList?new RegExp(j.databaseCharacterEscapeList,"gu"):/[\0-\x1F"\*\/:<>\?\\\|\x7F]/g,(function(e){return"^1"+e.charCodeAt(0).toString(16).padStart(2,"0")}))),!1!==j.databaseNameLengthLimit&&e.length>=(j.databaseNameLengthLimit||254)-(!1!==j.addSQLiteExtension?7:0))throw new Error("Unexpectedly long database name supplied; length limit required for Node compatibility; passed length: "+e.length+"; length limit setting: "+(j.databaseNameLengthLimit||254)+".");return e+(!1!==j.addSQLiteExtension?".sqlite":"")}function V(e){return U("S"+L(e))}function K(e){return U("I"+L(e))}function G(e){return"I"+L(e)}function H(e){return e.replaceAll("^","^^")}function Q(e,t){return t[Symbol.hasInstance](e)}function W(e){return null!==e&&"object"===h(e)}function Y(e){return W(e)&&Symbol.iterator in e&&"function"==typeof e[Symbol.iterator]}function $(e,t){t.forEach((function(t){var n=a("set",a("get",{},t,(function(){throw new TypeError("Illegal invocation")})),t,(function(e){throw new TypeError("Illegal invocation")})),r=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(e,t,r)}))}function J(e,t){t.forEach((function(t){var n=a("get",{},t,(function(){throw new TypeError("Illegal invocation")})),r=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(e,t,r)}))}function X(e,t){(t="string"==typeof t?[t]:t).forEach((function(t){var n=a("set",a("get",{},t,(function(){return e["__"+t]})),t,(function(n){e["__"+t]=n})),r=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(e,t,r)})),t.forEach((function(t){e[t]=null}))}function z(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;(t="string"==typeof t?[t]:t).forEach((function(t){var r;n&&t in n?r=n[t]:(Object.defineProperty(e,"__"+t,{enumerable:!1,configurable:!1,writable:!0}),r=a("get",{},t,(function(){return this["__"+t]})));var o=Object.getOwnPropertyDescriptor(r,t);Object.defineProperty(e,t,o)}))}function Z(e){var t=j.UnicodeIDStart||"[$A-Z_a-z]",n=j.UnicodeIDContinue||"[$0-9A-Z_a-z]";return new RegExp("^"+("(?:"+t+"|[$_])")+("(?:"+n+"|[$_])")+"*$","u").test(e)}function ee(e){return"string"==typeof e&&(""===e||Z(e)||e.split(".").every((function(e){return Z(e)})))}function te(e){return ee(e)||Array.isArray(e)&&Boolean(e.length)&&_(e).every((function(e){return ee(e)}))}function ne(e,t){var n,r;switch(e=Math.floor(Number(e)),t){case"unsigned long long":n=9007199254740991,r=0;break;case"unsigned long":n=4294967295,r=0;break;default:throw new Error("Unrecognized type supplied to enforceRange")}if(!Number.isFinite(e)||e>n||e<r)throw new TypeError("Invalid range: "+e);return e}function re(e,t){return null===e&&t?"":oe(e)}function oe(e){return""+e}function ie(e){return Y(e)?_(e).map((function(e){return oe(e)})):oe(e)}function ae(e){return null==e}function ue(e,t,n){var r=new O(e,n);return r.debug=t,r}Object.defineProperty(O,Symbol.hasInstance,{value:function(e){return W(e)&&"target"in e&&"bubbles"in e&&"boolean"==typeof e.bubbles}});function ce(e){O.call(this,e),this[Symbol.toStringTag]="IDBVersionChangeEvent",this.toString=function(){return"[object IDBVersionChangeEvent]"},this.__eventInitDict=arguments[1]||{}}function se(e,t){return new DOMException.prototype.constructor(t,e||"DOMException")}ce.prototype=Object.create(O.prototype),ce.prototype[Symbol.toStringTag]="IDBVersionChangeEventPrototype",["oldVersion","newVersion"].forEach((function(e){var t=a("get",{},e,(function(){if(!(this instanceof ce))throw new TypeError("Illegal invocation");return this.__eventInitDict&&this.__eventInitDict[e]||("oldVersion"===e?0:null)})),n=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(ce.prototype,e,n)})),Object.defineProperty(ce,Symbol.hasInstance,{value:function(e){return W(e)&&"oldVersion"in e&&"defaultPrevented"in e&&"boolean"==typeof e.defaultPrevented}}),Object.defineProperty(ce.prototype,"constructor",{enumerable:!1,writable:!0,configurable:!0,value:ce}),Object.defineProperty(ce,"prototype",{writable:!1});var le={IndexSizeError:1,HierarchyRequestError:3,WrongDocumentError:4,InvalidCharacterError:5,NoModificationAllowedError:7,NotFoundError:8,NotSupportedError:9,InUseAttributeError:10,InvalidStateError:11,SyntaxError:12,InvalidModificationError:13,NamespaceError:14,InvalidAccessError:15,TypeMismatchError:17,SecurityError:18,NetworkError:19,AbortError:20,URLMismatchError:21,QuotaExceededError:22,TimeoutError:23,InvalidNodeTypeError:24,DataCloneError:25,EncodingError:0,NotReadableError:0,UnknownError:0,ConstraintError:0,DataError:0,TransactionInactiveError:0,ReadOnlyError:0,VersionError:0,OperationError:0,NotAllowedError:0},fe={INDEX_SIZE_ERR:1,DOMSTRING_SIZE_ERR:2,HIERARCHY_REQUEST_ERR:3,WRONG_DOCUMENT_ERR:4,INVALID_CHARACTER_ERR:5,NO_DATA_ALLOWED_ERR:6,NO_MODIFICATION_ALLOWED_ERR:7,NOT_FOUND_ERR:8,NOT_SUPPORTED_ERR:9,INUSE_ATTRIBUTE_ERR:10,INVALID_STATE_ERR:11,SYNTAX_ERR:12,INVALID_MODIFICATION_ERR:13,NAMESPACE_ERR:14,INVALID_ACCESS_ERR:15,VALIDATION_ERR:16,TYPE_MISMATCH_ERR:17,SECURITY_ERR:18,NETWORK_ERR:19,ABORT_ERR:20,URL_MISMATCH_ERR:21,QUOTA_EXCEEDED_ERR:22,TIMEOUT_ERR:23,INVALID_NODE_TYPE_ERR:24,DATA_CLONE_ERR:25};var de=function(){function e(e,t){this[Symbol.toStringTag]="DOMException",this._code=t in le?le[t]:fe[t]||0,this._name=t||"Error",this._message=void 0===e?"":""+e,Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,writable:!0,value:this._code}),void 0!==t&&Object.defineProperty(this,"name",{configurable:!0,enumerable:!0,writable:!0,value:this._name}),void 0!==e&&Object.defineProperty(this,"message",{configurable:!0,enumerable:!1,writable:!0,value:this._message})}var t=function(){};return t.prototype=Object.create(Error.prototype),["name","message"].forEach((function(n){Object.defineProperty(t.prototype,n,{enumerable:!0,get:function(){if(!(this instanceof e||this instanceof t||this instanceof Error))throw new TypeError("Illegal invocation");return this["name"===n?"_name":"_message"]}})})),Object.defineProperty(t.prototype,"code",{configurable:!0,enumerable:!0,get:function(){throw new TypeError("Illegal invocation")}}),e.prototype=new t,e.prototype[Symbol.toStringTag]="DOMExceptionPrototype",Object.defineProperty(e,"prototype",{writable:!1}),Object.keys(le).forEach((function(t){Object.defineProperty(e.prototype,t,{enumerable:!0,configurable:!1,value:le[t]}),Object.defineProperty(e,t,{enumerable:!0,configurable:!1,value:le[t]})})),Object.keys(fe).forEach((function(t){Object.defineProperty(e.prototype,t,{enumerable:!0,configurable:!1,value:fe[t]}),Object.defineProperty(e,t,{enumerable:!0,configurable:!1,value:fe[t]})})),Object.defineProperty(e.prototype,"constructor",{writable:!0,configurable:!0,enumerable:!1,value:e}),e}();function _e(e,t,n){if(j.DEBUG){var r=n&&"object"===h(n)&&n.message?n.message:n,o="function"==typeof console.error?"error":"log";console[o](e+": "+t+". "+(r||"")),console.trace&&console.trace()}}function pe(e){return e&&"object"===h(e)&&"string"==typeof e.name}function he(e){var t,n;if(4===e.code)t="QuotaExceededError",n="The operation failed because there was not enough remaining storage space, or the storage quota was reached and the user declined to give more space to the database.";else t="UnknownError",n="The operation failed for reasons unrelated to the database itself and not covered by any other errors.";n+=" ("+e.message+")--("+e.code+")";var r=be(t,n);return r.sqlError=e,r}var ye,ve=!1;try{pe(ye=se("test name","test message"))&&"test name"===ye.name&&"test message"===ye.message&&(ve=!0)}catch(e){}var be=ve?function(e,t,n){return _e(e,t,n),se(e,t)}:function(e,t,n){return _e(e,t,n),function(e,t){return new de(t,e)}(e,t)},ge=ve?DOMException:de,me=["onsuccess","onerror"],Ee=["source","transaction","readyState"],we=["result","error"];function De(){throw new TypeError("Illegal constructor")}De.__super=function(){var e=this;this[Symbol.toStringTag]="IDBRequest",this.__setOptions({legacyOutputDidListenersThrowFlag:!0}),we.forEach((function(t){Object.defineProperty(e,"__"+t,{enumerable:!1,configurable:!1,writable:!0}),Object.defineProperty(e,t,{enumerable:!0,configurable:!0,get:function(){if(!this.__done)throw be("InvalidStateError","Can't get "+t+"; the request is still pending.");return this["__"+t]}})})),z(this,Ee,{readyState:{get readyState(){return this.__done?"done":"pending"}}}),X(this,me),this.__result=void 0,this.__error=this.__source=this.__transaction=null,this.__done=!1},De.__createInstance=function(){return new De.__super},De.prototype=B.createInstance({extraProperties:["debug"]}),De.prototype[Symbol.toStringTag]="IDBRequestPrototype",De.prototype.__getParent=function(){return"[object IDBOpenDBRequest]"===this.toString()?null:this.__transaction},J(De.prototype,Ee),J(De.prototype,we),$(De.prototype,me),Object.defineProperty(De.prototype,"constructor",{enumerable:!1,writable:!0,configurable:!0,value:De}),De.__super.prototype=De.prototype,Object.defineProperty(De,"prototype",{writable:!1});var Ie=["onblocked","onupgradeneeded"];function Oe(){throw new TypeError("Illegal constructor")}Oe.prototype=Object.create(De.prototype),Object.defineProperty(Oe.prototype,"constructor",{enumerable:!1,writable:!0,configurable:!0,value:Oe});var Se=Oe;function Te(e){return e&&"function"==typeof e.then}function Ae(e,t){e.then(null,t)}Oe.__createInstance=function(){function e(){De.__super.call(this),this[Symbol.toStringTag]="IDBOpenDBRequest",this.__setOptions({legacyOutputDidListenersThrowFlag:!0,extraProperties:["oldVersion","newVersion","debug"]}),X(this,Ie)}return e.prototype=Se.prototype,new e},$(Oe.prototype,Ie),Oe.prototype[Symbol.toStringTag]="IDBOpenDBRequestPrototype",Object.defineProperty(Oe,"prototype",{writable:!1});var Ne=2,xe=0,Be=1;function Fe(e){var t=this;function n(e,n){t.v=e,t.s=n,t.c[n].forEach((function(t){t(e)})),t.c[n].length&&(t.c=null)}function r(e){t.c&&(Te(e)?Ae(e.then(r),r):n(e,Be))}t.v=0,t.s=Ne,t.c=[[],[]];try{e((function e(o){t.c&&(Te(o)?Ae(o.then(e),r):n(o,xe))}),r)}catch(e){r(e)}}function je(e,t){var n=it(e),r=it(t),o=n>r?1:n===r?0:-1;if(j.DEBUG){var i=at(n),a=at(r);"object"===h(e)&&(e=JSON.stringify(e),i=JSON.stringify(i)),"object"===h(t)&&(t=JSON.stringify(t),a=JSON.stringify(a)),i!==e&&console.warn(e+" was incorrectly encoded as "+i),a!==t&&console.warn(t+" was incorrectly encoded as "+a)}return o}Fe.prototype.then=function(e,t){var n=this;return new Fe((function(r,o){var i="function"==typeof t?t:o;function a(){try{r(e?e(n.v):n.v)}catch(e){i(e)}}n.s===xe?a():n.s===Be?i(n.v):(n.c[xe].push(a),n.c[Be].push(i))}))},Fe.prototype.catch=function(e){var t=this;return new Fe((function(n,r){function o(){try{n(e(t.v))}catch(e){r(e)}}t.s===Be?o():t.s===xe?n(t.v):(t.c[Be].push(o),t.c[xe].push(n))}))},Fe.all=function(e){return new Fe((function(t,n){var r=e.length,o=[];r?e.forEach((function(i,a){Te(i)?Ae(i.then((function(e){o[a]=e,--r||t(o)})),n):(o[a]=i,--r||t(e))})):t(o)}))},Fe.race=function(e){var t=!1;return new Fe((function(n,r){e.some((function(e,o){return Te(e)?(Ae(e.then((function(e){t||(n(e),t=!0)})),r),!1):(n(e),t=!0,!0)}))}))},Fe.resolve=function(e){return new Fe((function(t,n){t(e)}))},Fe.reject=function(e){return new Fe((function(t,n){n(e)}))};var Pe={invalid:100,number:200,date:300,string:400,binary:500,array:600},Ce=Object.keys(Pe);Ce.forEach((function(e){Pe[e]=String.fromCodePoint(Pe[e])}));var ke=Ce.reduce((function(e,t){return e[Pe[t]]=t,e}),{}),Le=["negativeInfinity","bigNegative","smallNegative","smallPositive","bigPositive","positiveInfinity"],Re={invalid:{encode:function(){return Pe.invalid+"-"},decode:function(){}},number:{encode:function(e){var t,n,r,o=e===Number.MIN_VALUE?"0."+"0".repeat(214)+"2":Math.abs(e).toString(32),i=o.indexOf("."),a=(o=-1!==i?o.replace(".",""):o).search(/(?:[\0-\/1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/);return o=o.slice(a),Number.isFinite(Number(e))?e<0?e>-1?(t=Le.indexOf("smallNegative"),n=qe(a),r=Me(Ue(o))):(t=Le.indexOf("bigNegative"),n=Me(qe(-1!==i?i:o.length)),r=Me(Ue(o))):e<1?(t=Le.indexOf("smallPositive"),n=Me(qe(a)),r=Ue(o)):(t=Le.indexOf("bigPositive"),n=qe(-1!==i?i:o.length),r=Ue(o)):(n=Ge(2),r=Ge(11),t=Le.indexOf(e>0?"positiveInfinity":"negativeInfinity")),Pe.number+"-"+t+n+r},decode:function(e){var t=Number(e.slice(2,3)),n=e.slice(3,5),r=e.slice(5,16);switch(Le[t]){case"negativeInfinity":return Number.NEGATIVE_INFINITY;case"positiveInfinity":return Number.POSITIVE_INFINITY;case"bigPositive":return Ve(r,n);case"smallPositive":return Ve(r,n=He(Me(n)));case"smallNegative":return n=He(n),-Ve(r=Me(r),n);case"bigNegative":return n=Me(n),-Ve(r=Me(r),n);default:throw new Error("Invalid number.")}}},string:{encode:function(e,t){return t&&(e=e.replaceAll(/((?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]))/g,"-$1")+" "),Pe.string+"-"+e},decode:function(e,t){return e=e.slice(2),t&&(e=e.slice(0,-1).replaceAll(/\x2D((?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]))/g,"$1")),e}},array:{encode:function(e){var t,n=[],r=i(e.entries());try{for(r.s();!(t=r.n()).done;){var o=d(t.value,2),a=o[0],u=it(o[1],!0);n[a]=u}}catch(e){r.e(e)}finally{r.f()}return n.push(Pe.invalid+"-"),Pe.array+"-"+JSON.stringify(n)},decode:function(e){var t=JSON.parse(e.slice(2));t.pop();for(var n=0;n<t.length;n++){var r=at(t[n],!0);t[n]=r}return t}},date:{encode:function(e){return Pe.date+"-"+e.toJSON()},decode:function(e){return new Date(e.slice(2))}},binary:{encode:function(e){return Pe.binary+"-"+(e.byteLength?_(Ye(e)).map((function(e){return String(e).padStart(3,"0")})):"")},decode:function(e){var t=e.slice(2),n=t.length?t.split(",").map((function(e){return Number.parseInt(e)})):[],r=new ArrayBuffer(n.length);return new Uint8Array(r).set(n),r}}};function qe(e){var t=e.toString(32);return 1===t.length?"0"+t:t}function Ue(e){return(e+Ge(11)).slice(0,11)}function Me(e){var t,n="",r=i(e);try{for(r.s();!(t=r.n()).done;){var o=t.value;n+=(31-Number.parseInt(o,32)).toString(32)}}catch(e){r.e(e)}finally{r.f()}return n}function Ve(e,t){var n=Number.parseInt(t,32);if(n<0)return Ke(Number.parseInt(e,32)*Math.pow(32,n-10));if(n<11){var r=e.slice(0,n),o=Number.parseInt(r,32),i=e.slice(n);return Ke(o+Number.parseInt(i,32)*Math.pow(32,n-11))}var a=e+Ge(n-11);return Number.parseInt(a,32)}function Ke(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:16;return Number.parseFloat(e.toPrecision(t))}function Ge(e){return"0".repeat(e)}function He(e){return"-"+e}function Qe(e){if(Array.isArray(e))return"array";if(W(t=e)&&"getDate"in t&&"function"==typeof t.getDate)return"date";var t;if(function(e){return W(e)&&"byteLength"in e&&"number"==typeof e.byteLength&&("slice"in e&&"function"==typeof e.slice||"getFloat64"in e&&"function"==typeof e.getFloat64)}(e))return"binary";var n=h(e);return["string","number"].includes(n)?n:"invalid"}function We(e,t){return $e(e,t,!1,!0)}function Ye(e){var t=0,n=0;if(ArrayBuffer.isView(e)){if(void 0===e.buffer)throw new TypeError("Could not copy the bytes held by a buffer source as the buffer was undefined.");t=e.byteOffset,n=e.byteLength}else n=e.byteLength;return new Uint8Array("buffer"in e&&e.buffer||e,t,n)}function $e(e,t,n,r){if((t=t||[]).includes(e))return{type:"array",invalid:!0,message:"An array key cannot be circular"};var o=Qe(e),i={type:o,value:e};switch(o){case"number":return Number.isNaN(e)?{type:"NaN",invalid:!0}:Object.is(e,-0)?{type:o,value:0}:i;case"string":return i;case"binary":return{type:"binary",value:Ye(e)};case"array":var a=e,u=a.length;t.push(e);for(var c,s=[],l=function(){if(!n&&!Object.hasOwn(a,f))return{v:{type:o,invalid:!0,message:"Does not have own index property"}};try{var e=$e(a[f],t,!1,r);if(e.invalid)return n?0:{v:{type:o,invalid:!0,message:"Bad array entry value-to-key conversion"}};(!n||!r&&s.every((function(t){return 0!==je(t,e.value)}))||r&&s.every((function(t){return 0!==je(t,e)})))&&s.push(r?e:e.value)}catch(e){if(!n)throw e}},f=0;f<u;f++)if(0!==(c=l())&&c)return c.v;return{type:o,value:s};case"date":var d=e;return Number.isNaN(d.getTime())?{type:o,invalid:!0,message:"Not a valid date"}:r?{type:o,value:d.getTime()}:{type:o,value:new Date(d.getTime())};default:var _=null===e?"null":h(e);return{type:_,invalid:!0,message:"Not a valid key; type "+_}}}function Je(e,t){return $e(e,null,!0,t)}function Xe(e,t){var n=We(e,t);if(n.invalid)throw be("DataError",n.message||"Not a valid key; type: "+n.type);return n}function ze(e,t,n,r){var o=Ze(e,t);return o.failure?o:n?Je(o.value,r):$e(o.value,null,!1,r)}function Ze(e,t,n,r){if(Array.isArray(t)){var o=[];return t.some((function(t){var n=Ze(e,t);return!!n.failure||(o.push(n.value),!1)}))?{failure:!0}:{value:o}}return""===t?{value:e}:t.split(".").some((function(t){if("length"!==t||"string"!=typeof e&&!Array.isArray(e))if(W(n=e)&&"size"in n&&"number"==typeof n.size&&"slice"in n&&"function"==typeof n.slice&&!("lastModified"in n))switch(t){case"size":case"type":e=e[t]}else{if(!function(e){return W(e)&&"name"in e&&"string"==typeof e.name&&"slice"in e&&"function"==typeof e.slice&&"lastModified"in e}(e))return!W(e)||!Object.hasOwn(e,t)||void 0===(e=e[t]);switch(t){case"name":case"lastModified":e=e[t];break;case"lastModifiedDate":e=new Date(e.lastModified)}}else e=e.length;var n;return!1}))?{failure:!0}:{value:e}}function et(e,t,n){var r=n.split("."),o=r.pop();r.forEach((function(t){Object.hasOwn(e,t)||(e[t]={}),e=e[t]})),e[o]=t}function tt(e,t){var n=t.split(".");n.pop();var r,o=i(n);try{for(o.s();!(r=o.n()).done;){var a=r.value;if(!W(e))return!1;if(!Object.hasOwn(e,a))return!0;e=e[a]}}catch(e){o.e(e)}finally{o.f()}return W(e)}function nt(e,t,n){var r=void 0===t.lower,o=void 0===t.upper,i=it(e,!0),a=n?t.__lowerCached:it(t.lower,!0),u=n?t.__upperCached:it(t.upper,!0);return!r&&(t.lowerOpen&&null!==i&&null!==a&&i>a||!t.lowerOpen&&(!i&&!a||null!==i&&null!==a&&i>=a))&&(r=!0),!o&&(t.upperOpen&&null!==i&&null!==u&&i<u||!t.upperOpen&&(!i&&!u||null!==i&&null!==u&&i<=u))&&(o=!0),r&&o}function rt(e,t){return"array"===ke[t.slice(0,1)]?t.indexOf(e)>1:t===e}function ot(e,t){var n=[];if(Array.isArray(e)){var r,o=i(e);try{for(o.s();!(r=o.n()).done;){var a=r.value;if(Array.isArray(a)){if(t&&t.lower===t.upper)continue;if(1!==a.length){ot(a,t).length>0&&n.push(a);continue}a=a[0]}(ae(t)||nt(a,t,!0))&&n.push(a)}}catch(e){o.e(e)}finally{o.f()}}else(ae(t)||nt(e,t,!0))&&n.push(e);return n}function it(e,t){return void 0===e?null:Re[Qe(e)].encode(e,t)}function at(e,t){if("string"==typeof e)return Re[ke[e.slice(0,1)]].decode(e,t)}function ut(e,t){return at(it(e,t),t)}var ct=9007199254740992;function st(e,t,n,r){e.executeSql('SELECT "currNum" FROM __sys__ WHERE "name" = ?',[R(t.__currentName)],(function(e,t){1!==t.rows.length?n(1):n(t.rows.item(0).currNum)}),(function(e,t){return r(be("DataError","Could not get the auto increment value for key",t)),!1}))}function lt(e,t,n,r,o){var i='UPDATE __sys__ SET "currNum" = ? WHERE "name" = ?',a=[n,R(t.__currentName)];j.DEBUG&&console.log(i,a),e.executeSql(i,a,(function(){r(n)}),(function(e,t){return o(be("UnknownError","Could not set the auto increment value for key",t)),!1}))}function ft(e,t,n,r,o){return lt(e,t,n=n===ct?n+2:n+1,r,o)}function dt(e,t,n,r){st(e,t,(function(o){o>ct?n("failure"):ft(e,t,o,(function(){n(null,o,o)}),r)}),r)}function _t(e,t,n,r,o){"number"!=typeof n||n<1?r():st(e,t,(function(i){var a=Math.floor(Math.min(n,ct));a>=i?ft(e,t,a,(function(){r(i)}),o):r()}),o)}var pt=Object.freeze({__proto__:null,assignCurrentNumber:lt,checkKeyCouldBeInjectedIntoValue:tt,convertKeyToValue:function e(t){var n=t.type,r=t.value;switch(n){case"number":case"string":return r;case"array":for(var o=[],i=r.length,a=0;a<i;){var u=e(r[a]);o[a]=u,a++}return o;case"date":return new Date(r);case"binary":var c=r.length,s=new ArrayBuffer(c);return new Uint8Array(s,r.byteOffset||0,r.byteLength).set(r),s;default:throw new Error("Bad key")}},convertValueToKey:We,convertValueToKeyRethrowingAndIfInvalid:Xe,convertValueToKeyValueDecoded:$e,convertValueToMultiEntryKey:function(e){return $e(e,null,!0,!0)},convertValueToMultiEntryKeyDecoded:Je,decode:at,encode:it,evaluateKeyPathOnValue:function(e,t,n){return Ze(e,t)},extractKeyFromValueUsingKeyPath:function(e,t,n){return ze(e,t,n,!0)},extractKeyValueDecodedFromValueUsingKeyPath:ze,findMultiEntryMatches:ot,generateKeyForStore:dt,injectKeyIntoValueUsingKeyPath:et,isKeyInRange:nt,isMultiEntryMatch:rt,possiblyUpdateKeyGenerator:_t,roundTrip:ut});function ht(){throw this.__lowerOpen=!1,this.__upperOpen=!1,new TypeError("Illegal constructor")}var yt=ht;function vt(e,t,n,r,o,i){if(e&&(void 0!==e.lower||void 0!==e.upper)){var a,u;o&&n.push("AND");var c=void 0!==e.lower,s=void 0!==e.upper;if(c&&(a=i?e.__lowerCached:it(e.lower)),s&&(u=i?e.__upperCached:it(e.upper)),c){if(r.push(R(a)),s&&a===u&&!e.lowerOpen&&!e.upperOpen)return void n.push(t,"=","?");n.push(t,e.lowerOpen?">":">=","?")}c&&s&&n.push("AND"),s&&(n.push(t,e.upperOpen?"<":"<=","?"),r.push(R(u)))}}function bt(e,t){if(Q(e,ht))return"[object IDBKeyRange]"!==e.toString()?ht.__createInstance(e.lower,e.upper,e.lowerOpen,e.upperOpen):e;if(!ae(e))return Xe(e),ht.only(e);if(t)throw be("DataError","No key or range was specified")}ht.__createInstance=function(e,t,n,r){function o(){if(this[Symbol.toStringTag]="IDBKeyRange",void 0===e&&void 0===t)throw be("DataError","Both arguments to the key range method cannot be undefined");var o,i;if(void 0!==e&&(o=ut(e),Xe(e)),void 0!==t&&(i=ut(t),Xe(t)),void 0!==e&&void 0!==t&&e!==t&&it(e)>it(t))throw be("DataError","`lower` must not be greater than `upper` argument in `bound()` call.");this.__lower=o,this.__upper=i,this.__lowerOpen=Boolean(n),this.__upperOpen=Boolean(r)}return o.prototype=yt.prototype,new o},ht.prototype.includes=function(e){if(!W(this)||"boolean"!=typeof this.__lowerOpen)throw new TypeError("Illegal invocation");if(!arguments.length)throw new TypeError("IDBKeyRange.includes requires a key argument");return Xe(e),nt(e,this)},ht.only=function(e){if(!arguments.length)throw new TypeError("IDBKeyRange.only requires a value argument");return ht.__createInstance(e,e,!1,!1)},ht.lowerBound=function(e){if(!arguments.length)throw new TypeError("IDBKeyRange.lowerBound requires a value argument");return ht.__createInstance(e,void 0,arguments[1],!0)},ht.upperBound=function(e){if(!arguments.length)throw new TypeError("IDBKeyRange.upperBound requires a value argument");return ht.__createInstance(void 0,e,!0,arguments[1])},ht.bound=function(e,t){if(arguments.length<=1)throw new TypeError("IDBKeyRange.bound requires lower and upper arguments");return ht.__createInstance(e,t,arguments[2],arguments[3])},ht.prototype[Symbol.toStringTag]="IDBKeyRangePrototype",["lower","upper","lowerOpen","upperOpen"].forEach((function(e){Object.defineProperty(ht.prototype,"__"+e,{enumerable:!1,configurable:!1,writable:!0});var t=a("get",{},e,(function(){if(!W(this)||"boolean"!=typeof this.__lowerOpen)throw new TypeError("Illegal invocation");return this["__"+e]})),n=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(ht.prototype,e,n)})),Object.defineProperty(ht,Symbol.hasInstance,{value:function(e){return W(e)&&"upper"in e&&"lowerOpen"in e&&"boolean"==typeof e.lowerOpen}}),Object.defineProperty(ht,"prototype",{writable:!1});var gt=!1,mt={test:!0};if(Object.defineProperty)try{Object.defineProperty(mt,"test",{enumerable:!1}),mt.test&&(gt=!0)}catch(e){}var Et=function(){throw this._items=[],this._length=0,new TypeError("Illegal constructor")};Et.prototype=u(u({constructor:Et,contains:function(e){if(!arguments.length)throw new TypeError("DOMStringList.contains must be supplied a value");return this._items.includes(e)},item:function(e){if(!arguments.length)throw new TypeError("DOMStringList.item must be supplied a value");return e<0||e>=this.length||!Number.isInteger(e)?null:this._items[e]},clone:function(){var e=Et.__createInstance();return e._items=this._items.slice(),e._length=this.length,e.addIndexes(),e},addIndexes:function(){for(var e=0;e<this._items.length;e++)this[e]=this._items[e]},sortList:function(){return this._items.sort(),this.addIndexes(),this._items},forEach:function(e,t){this._items.forEach(e,t)},map:function(e,t){return this._items.map(e,t)},indexOf:function(e){return this._items.indexOf(e)},push:function(e){this._items.push(e),this._length++,this.sortList()},splice:function(){var e;for(var t in(e=this._items).splice.apply(e,arguments),this._length=this._items.length,this)t===String(Number.parseInt(t))&&delete this[t];this.sortList()}},Symbol.toStringTag,"DOMStringListPrototype"),Symbol.iterator,f().mark((function e(){var t;return f().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=0;case 1:if(!(t<this._items.length)){e.next=6;break}return e.next=4,this._items[t++];case 4:e.next=1;break;case 6:case"end":return e.stop()}}),e,this)}))),Object.defineProperty(Et,Symbol.hasInstance,{value:function(e){return"DOMStringListPrototype"===Object.prototype.toString.call(e)}});var wt=Et;if(Object.defineProperty(Et,"__createInstance",{value:function(){var e=function(){this.toString=function(){return"[object DOMStringList]"},Object.defineProperty(this,"length",{enumerable:!0,get:function(){return this._length}}),this._items=[],this._length=0};return e.prototype=wt.prototype,new e}}),gt){Object.defineProperty(Et,"prototype",{writable:!1});["addIndexes","sortList","forEach","map","indexOf","push","splice","constructor","__createInstance"].forEach((function(e){Object.defineProperty(Et.prototype,e,{enumerable:!1})})),Object.defineProperty(Et.prototype,"length",{configurable:!0,enumerable:!0,get:function(){throw new TypeError("Illegal invocation")}});["_items","_length"].forEach((function(e){Object.defineProperty(Et.prototype,e,{enumerable:!1,writable:!0})}))}var Dt=0,It=["onabort","oncomplete","onerror"],Ot=["objectStoreNames","mode","db","error"];function St(){throw new TypeError("Illegal constructor")}var Tt=St;function At(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Nt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?At(Object(n),!0).forEach((function(t){jt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):At(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function xt(e){return xt="function"==typeof Symbol&&"symbol"==h(Symbol.iterator)?function(e){return h(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":h(e)},xt(e)}function Bt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ft(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Lt(r.key),r)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function jt(e,t,n){return(t=Lt(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Pt(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,u=[],c=!0,s=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=i.call(n)).done)&&(u.push(r.value),u.length!==t);c=!0);}catch(e){s=!0,o=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(s)throw o}}return u}}(e,t)||Ct(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ct(e,t){if(e){if("string"==typeof e)return kt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?kt(e,t):void 0}}function kt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Lt(e){var t=function(e,t){if("object"!=h(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=h(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==h(t)?t:String(t)}St.__createInstance=function(e,t,n){function r(){var r=this,o=this;o[Symbol.toStringTag]="IDBTransaction",z(o,Ot),o.__id=++Dt,o.__active=!0,o.__running=!1,o.__errored=!1,o.__requests=[],o.__objectStoreNames=t,o.__mode=n,o.__db=e,o.__error=null,o.__setOptions({legacyOutputDidListenersThrowFlag:!0}),Ot.forEach((function(e){Object.defineProperty(r,e,{configurable:!0})})),X(this,It),o.__storeHandles={},setTimeout((function(){o.__executeRequests()}),0)}return r.prototype=Tt.prototype,new r},St.prototype=B.createInstance({defaultSync:!0,extraProperties:["complete"]}),St.prototype.__transFinishedCb=function(e,t){t(Boolean(e))},St.prototype.__executeRequests=function(){var e=this;e.__running?j.DEBUG&&console.log("Looks like the request set is already running",e.mode):(e.__running=!0,e.db.__db["readonly"===e.mode?"readTransaction":"transaction"]((function(t){e.__tx=t;var n,r=-1;function o(t,r){if(!e.__errored&&!e.__requestsFinished&&(r&&(n.req=r),n.req&&!n.req.__done)){n.req.__done=!0,n.req.__result=t,n.req.__error=null,e.__active=!0;var o=ue("success");if(n.req.dispatchEvent(o),o.__legacyOutputDidListenersThrowError)return _e("Error","An error occurred in a success handler attached to request chain",o.__legacyOutputDidListenersThrowError),void e.__abortTransaction(be("AbortError","A request was aborted (in user handler after success)."));u()}}function a(){if(!(e.__errored||e.__requestsFinished||n.req&&n.req.__done)){for(var t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];var a=function(e){var t;if(e){if(1===e.length)return e[0];var n,r=i(e);try{for(r.s();!(n=r.n()).done;){var o=n.value;if(pe(o))return o;o&&"string"==typeof o.message&&(t=o)}}catch(t){r.e(t)}finally{r.f()}}return t}(r);if(n.req){n.req.__done=!0,n.req.__error=a,n.req.__result=void 0,n.req.addLateEventListener("error",(function(e){e.cancelable&&e.defaultPrevented&&!e.__legacyOutputDidListenersThrowError&&u()})),n.req.addDefaultEventListener("error",(function(){n.req&&e.__abortTransaction(n.req.__error)})),e.__active=!0;var c=ue("error",a,{bubbles:!0,cancelable:!0});n.req.dispatchEvent(c),c.__legacyOutputDidListenersThrowError&&(_e("Error","An error occurred in an error handler attached to request chain",c.__legacyOutputDidListenersThrowError),c.preventDefault(),e.__abortTransaction(be("AbortError","A request was aborted (in user handler after error).")))}else e.__abortTransaction(a)}}function u(){if(!e.__errored&&!e.__requestsFinished)if(++r>=e.__requests.length)e.__requests=[],e.__active&&function(){function t(){e.__completed=!0,j.DEBUG&&console.log("Transaction completed");var t=ue("complete");try{e.__internal=!0,e.dispatchEvent(t),e.__internal=!1,e.dispatchEvent(ue("__complete"))}catch(t){throw e.__internal=!1,e.__errored=!0,t}finally{e.__storeHandles={}}}if(e.__active=!1,e.__requestsFinished=!0,"readwrite"===e.mode)return e.__transactionFinished?void t():void(e.__transactionEndCallback=t);if("readonly"===e.mode)return void t();var n=ue("__beforecomplete");n.complete=t,e.dispatchEvent(n)}();else try{if(!(n=e.__requests[r]).req)return void n.op(t,n.args,u,a);if(n.req.__done)return;n.op(t,n.args,o,a,u)}catch(e){a(e)}}u()}),(function(t){if(!0!==t){var n=he(t);e.__abortTransaction(n)}}),(function(){e.__transFinishedCb===St.prototype.__transFinishedCb&&(e.__transactionEndCallback||e.__requestsFinished?e.__transactionEndCallback&&!e.__completed&&e.__transFinishedCb(e.__errored,e.__transactionEndCallback):e.__transactionFinished=!0)}),(function(t,n,r,o,i){return!(!t.readOnly&&!n)||(e.__transFinishedCb=function(e,t){e?o(e,t):i(t)},e.__transactionEndCallback&&!e.__completed&&e.__transFinishedCb(e.__errored,e.__transactionEndCallback),!1)})))},St.prototype.__createRequest=function(e){var t=De.__createInstance();return t.__source=void 0!==e?e:this.db,t.__transaction=this,t},St.prototype.__addToTransactionQueue=function(e,t,n){var r=this.__createRequest(n);return this.__pushToQueue(r,e,t),r},St.prototype.__addNonRequestToTransactionQueue=function(e,t){this.__pushToQueue(null,e,t)},St.prototype.__pushToQueue=function(e,t,n){this.__assertActive(),this.__requests.push({op:t,args:n,req:e})},St.prototype.__assertActive=function(){if(!this.__active)throw be("TransactionInactiveError","A request was placed against a transaction which is currently not active, or which is finished")},St.prototype.__assertWritable=function(){if("readonly"===this.mode)throw be("ReadOnlyError","The transaction is read only")},St.prototype.__assertVersionChange=function(){St.__assertVersionChange(this)},St.prototype.objectStore=function(e){var t=this;if(!(t instanceof St))throw new TypeError("Illegal invocation");if(0===arguments.length)throw new TypeError("No object store name was specified");if(St.__assertNotFinished(t),-1===t.__objectStoreNames.indexOf(e))throw be("NotFoundError",e+" is not participating in this transaction");var n=t.db.__objectStores[e];if(!n)throw be("NotFoundError",e+" does not exist in "+t.db.name);return(!t.__storeHandles[e]||t.__storeHandles[e].__pendingDelete||t.__storeHandles[e].__deleted)&&(t.__storeHandles[e]=lr.__clone(n,t)),t.__storeHandles[e]},St.prototype.__abortTransaction=function(e){var t=this;function n(n,r){n?r&&"code"in r&&"number"==typeof r.code?j.DEBUG&&console.log("Rollback erred; feature is probably not supported as per WebSQL",t):j.DEBUG&&console.log("Rollback succeeded",t):j.DEBUG&&console.log("Rollback not possible due to missing transaction",t),t.dispatchEvent(ue("__preabort")),t.__requests.filter((function(e,t,n){return e.req&&!e.req.__done&&[t,-1].includes(n.map((function(e){return e.req})).lastIndexOf(e.req))})).reduce((function(e,t){return e.then((function(){if(!t.req)throw new Error("Missing request");t.req.__done=!0,t.req.__result=void 0,t.req.__error=be("AbortError","A request was aborted (an unfinished request).");var e=ue("error",t.req.__error,{bubbles:!0,cancelable:!0});return new Fe((function(n){setTimeout((function(){if(!t.req)throw new Error("Missing request");t.req.dispatchEvent(e),n()}))}))}))}),Fe.resolve(void 0)).then((function(){var n=ue("abort",e,{bubbles:!0,cancelable:!1});setTimeout((function(){t.__abortFinished=!0,t.dispatchEvent(n),t.__storeHandles={},t.dispatchEvent(ue("__abort"))}))})).catch((function(e){throw console.log("Abort error"),e}))}_e("Error","An error occurred in a transaction",e),t.__errored||(t.__errored=!0,"versionchange"===t.mode&&(t.db.__version=t.db.__oldVersion,t.db.__objectStoreNames=t.db.__oldObjectStoreNames,t.__objectStoreNames=t.db.__oldObjectStoreNames,Object.values(t.db.__objectStores).concat(Object.values(t.__storeHandles)).forEach((function(e){"__pendingName"in e&&t.db.__oldObjectStoreNames.indexOf(e.__pendingName)>-1&&(e.__name=e.__originalName),e.__indexNames=e.__oldIndexNames,delete e.__pendingDelete,Object.values(e.__indexes).concat(Object.values(e.__indexHandles)).forEach((function(t){"__pendingName"in t&&e.__oldIndexNames.indexOf(t.__pendingName)>-1&&(t.__name=t.__originalName),delete t.__pendingDelete}))}))),t.__active=!1,null!==e&&(t.__error=e),t.__requestsFinished&&setTimeout((function(){throw e}),0),t.__transFinishedCb(!0,(function(e){if(e&&t.__tx){if("readwrite"===t.mode)return t.__transactionFinished?void n():void(t.__transactionEndCallback=n);try{t.__tx.executeSql("ROLLBACK",[],n,n)}catch(e){n()}}else n(null,{code:0})})))},St.prototype.abort=function(){var e=this;if(!(e instanceof St))throw new TypeError("Illegal invocation");j.DEBUG&&console.log("The transaction was aborted",e),St.__assertNotFinished(e),e.__abortTransaction(null)},St.prototype[Symbol.toStringTag]="IDBTransactionPrototype",St.__assertVersionChange=function(e){if(!e||"versionchange"!==e.mode)throw be("InvalidStateError","Not a version transaction")},St.__assertNotVersionChange=function(e){if(e&&"versionchange"===e.mode)throw be("InvalidStateError","Cannot be called during a version transaction")},St.__assertNotFinished=function(e){if(!e||e.__completed||e.__abortFinished||e.__errored)throw be("InvalidStateError","Transaction finished by commit or abort")},St.__assertNotFinishedObjectStoreMethod=function(e){try{St.__assertNotFinished(e)}catch(t){if(e&&!e.__completed&&!e.__abortFinished)throw be("TransactionInactiveError","A request was placed against a transaction which is currently not active, or which is finished");throw t}},St.__assertActive=function(e){if(!e||!e.__active)throw be("TransactionInactiveError","A request was placed against a transaction which is currently not active, or which is finished")},St.prototype.__getParent=function(){return this.db},$(St.prototype,It),J(St.prototype,Ot),Object.defineProperty(St.prototype,"constructor",{enumerable:!1,writable:!0,configurable:!0,value:St}),Object.defineProperty(St,"prototype",{writable:!1});var Rt=Ft((function e(t){Bt(this,e),this.p=new Promise(t)}));Rt.__typeson__type__="TypesonPromise","undefined"!=typeof Symbol&&Object.defineProperty(Rt.prototype,Symbol.toStringTag,{get:function(){return"TypesonPromise"}}),Rt.prototype.then=function(e,t){var n=this;return new Rt((function(r,o){n.p.then((function(t){r(e?e(t):t)})).catch((function(e){return t?t(e):Promise.reject(e)})).then(r,o)}))},Rt.prototype.catch=function(e){return this.then((function(){}),e)},Rt.resolve=function(e){return new Rt((function(t){t(e)}))},Rt.reject=function(e){return new Rt((function(t,n){n(e)}))},Rt.all=function(e){return new Rt((function(t,n){Promise.all(e.map((function(e){return null!=e&&e.constructor&&"__typeson__type__"in e.constructor&&"TypesonPromise"===e.constructor.__typeson__type__?e.p:e}))).then(t,n)}))},Rt.race=function(e){return new Rt((function(t,n){Promise.race(e.map((function(e){return null!=e&&e.constructor&&"__typeson__type__"in e.constructor&&"TypesonPromise"===e.constructor.__typeson__type__?e.p:e}))).then(t,n)}))},Rt.allSettled=function(e){return new Rt((function(t,n){Promise.allSettled(e.map((function(e){return null!=e&&e.constructor&&"__typeson__type__"in e.constructor&&"TypesonPromise"===e.constructor.__typeson__type__?e.p:e}))).then(t,n)}))};var qt=Object.hasOwn,Ut=Object.getPrototypeOf;function Mt(e,t){return Qt(e)&&"function"==typeof e.then&&!t}function Vt(e){return Object.prototype.toString.call(e).slice(8,-1)}function Kt(e,t){if(!e||"object"!==xt(e))return!1;var n=Ut(e);if(!n)return null===t;var r=qt(n,"constructor")&&n.constructor;return"function"!=typeof r?null===t:t===r||null!==t&&Function.prototype.toString.call(r)===Function.prototype.toString.call(t)||"function"==typeof t&&"string"==typeof r.__typeson__type__&&r.__typeson__type__===t.__typeson__type__}function Gt(e){return!(!e||"Object"!==Vt(e))&&(!Ut(e)||Kt(e,Object))}function Ht(e){if(!e||"Object"!==Vt(e))return!1;var t=Ut(e);return!t||Kt(e,Object)||Ht(t)}function Qt(e){return null!==e&&"object"===xt(e)}function Wt(e){return e.replaceAll("''","''''").replace(/^$/,"''").replaceAll("~","~0").replaceAll(".","~1")}function Yt(e){return e.replaceAll("~1",".").replaceAll("~0","~").replace(/^''$/,"").replaceAll("''''","''")}function $t(e,t){if(""===t)return e;if(null===e||"object"!==xt(e))throw new TypeError("Unexpected non-object type");var n=t.indexOf(".");if(n>-1){var r=e[Yt(t.slice(0,n))];return void 0===r?void 0:$t(r,t.slice(n+1))}return e[Yt(t)]}function Jt(e,t,n){if(""===t)return n;if(!e||"object"!==xt(e))throw new TypeError("Unexpected non-object type");var r=t.indexOf(".");return r>-1?Jt(e[Yt(t.slice(0,r))],t.slice(r+1),n):(e[Yt(t)]=n,e)}function Xt(e){return null===e?"null":Array.isArray(e)?"array":xt(e)}function zt(e,t,n){return e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e}var Zt=Object.keys,en=Object.hasOwn,tn=Array.isArray,nn=["type","replaced","iterateIn","iterateUnsetNumeric","addLength"];function rn(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return Promise.resolve(e.apply(this,t))}catch(e){return Promise.reject(e)}}}function on(e,t){var n,r;if(""===e.keypath)return-1;var o=null!==(n=e.keypath.match(/\./g))&&void 0!==n?n:0,i=null!==(r=t.keypath.match(/\./g))&&void 0!==r?r:0;return o&&(o=o.length),i&&(i=i.length),o>i?-1:o<i?1:e.keypath<t.keypath?-1:e.keypath>t.keypath?1:0}var an=function(){function e(t){Bt(this,e),this.options=t,this.plainObjectReplacers=[],this.nonplainObjectReplacers=[],this.revivers={},this.types={}}return Ft(e,[{key:"stringify",value:function(e,t,n,r){r=Nt(Nt(Nt({},this.options),r),{},{stringification:!0});var o=this.encapsulate(e,null,r);return tn(o)?JSON.stringify(o[0],t,n):o.then((function(e){return JSON.stringify(e,t,n)}))}},{key:"stringifySync",value:function(e,t,n,r){return this.stringify(e,t,n,Nt(Nt({throwOnBadSyncType:!0},r),{},{sync:!0}))}},{key:"stringifyAsync",value:function(e,t,n,r){return this.stringify(e,t,n,Nt(Nt({throwOnBadSyncType:!0},r),{},{sync:!1}))}},{key:"parse",value:function(e,t,n){return n=Nt(Nt(Nt({},this.options),n),{},{parse:!0}),this.revive(JSON.parse(e,t),n)}},{key:"parseSync",value:function(e,t,n){return this.parse(e,t,Nt(Nt({throwOnBadSyncType:!0},n),{},{sync:!0}))}},{key:"parseAsync",value:function(e,t,n){return this.parse(e,t,Nt(Nt({throwOnBadSyncType:!0},n),{},{sync:!1}))}},{key:"specialTypeNames",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return n.returnTypeNames=!0,this.encapsulate(e,t,n)}},{key:"rootTypeName",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return n.iterateNone=!0,this.encapsulate(e,t,n)}},{key:"encapsulate",value:function(e,t,n){var r=this,o=Nt(Nt({sync:!0},this.options),n),i=o.sync,a={},u=[],c=[],s=[],l=!("cyclic"in o)||o.cyclic,f=o.encapsulateObserver,d=function(e){var t=Object.values(a);if(o.iterateNone)return t.length?t[0]:Xt(e);if(t.length){if(o.returnTypeNames)return function(e){return function(e){if(Array.isArray(e))return kt(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Ct(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(new Set(t));e&&Gt(e)&&!en(e,"$types")?e.$types=a:e={$:e,$types:{$:a}}}else Qt(e)&&en(e,"$types")&&(e={$:e,$types:!0});return!o.returnTypeNames&&e},_=rn((function(e,t){return zt(Promise.all(t.map((function(e){return e[1].p}))),(function(n){return zt(Promise.all(n.map(rn((function(n){var r=!1,o=[],i=Pt(t.splice(0,1),1),a=Pt(i[0],7),u=a[0],c=a[2],s=a[3],l=a[4],f=a[5],d=a[6],p=h(u,n,c,s,o,!0,d),y=Kt(p,Rt);return function(e,t){var n=e();return n&&n.then?n.then(t):t(n)}((function(){if(u&&y)return zt(p.p,(function(t){l[f]=t;var n=_(e,o);return r=!0,n}))}),(function(t){return r?t:(u?l[f]=p:e=y?p.p:p,_(e,o))}))})))),(function(){return e}))}))})),p=function(e,t,n){Object.assign(e,t);var r=nn.map((function(t){var n=e[t];return delete e[t],n}));n(),nn.forEach((function(t,n){e[t]=r[n]}))},h=function e(t,n,i,s,l,d,_){var h,v={},b=xt(n),g=f?function(e){var r,o=null!==(r=null!=_?_:s.type)&&void 0!==r?r:Xt(n);f(Object.assign(null!=e?e:v,{keypath:t,value:n,cyclic:i,stateObj:s,promisesData:l,resolvingTypesonPromise:d,awaitingTypesonPromise:Kt(n,Rt)},{type:o}))}:null;if(["string","boolean","number","undefined"].includes(b))return void 0===n||Number.isNaN(n)||n===Number.NEGATIVE_INFINITY||n===Number.POSITIVE_INFINITY||0===n?(h=s.replaced?n:y(t,n,s,l,!1,d,g))!==n&&(v={replaced:h}):h=n,g&&g(),h;if(null===n)return g&&g(),n;if(i&&!s.iterateIn&&!s.iterateUnsetNumeric&&n&&"object"===xt(n)){var m=u.indexOf(n);if(!(m<0))return a[t]="#",g&&g({cyclicKeypath:c[m]}),"#"+c[m];!0===i&&(u.push(n),c.push(t))}var E,w,D=Gt(n),I=tn(n),O=(D||I)&&(!r.plainObjectReplacers.length||s.replaced)||s.iterateIn?n:y(t,n,s,l,D||I,null,g);if(O!==n?(h=O,v={replaced:O}):""===t&&Kt(n,Rt)?(l.push([t,n,i,s,void 0,void 0,s.type]),h=n):I&&"object"!==s.iterateIn||"array"===s.iterateIn?(E=new Array(n.length),v={clone:E}):(["function","symbol"].includes(xt(n))||"toJSON"in n||Kt(n,Rt)||Kt(n,Promise)||Kt(n,ArrayBuffer))&&!D&&"object"!==s.iterateIn?h=n:(E={},s.addLength&&(E.length=n.length),v={clone:E}),g&&g(),o.iterateNone)return null!==(w=E)&&void 0!==w?w:h;if(!E)return h;if(s.iterateIn){var S=function(r){var o={ownKeys:en(n,r)};p(s,o,(function(){var o=t+(t?".":"")+Wt(r),a=e(o,n[r],Boolean(i),s,l,d);Kt(a,Rt)?l.push([o,a,Boolean(i),s,E,r,s.type]):void 0!==a&&(E[r]=a)}))};for(var T in n)S(T);g&&g({endIterateIn:!0,end:!0})}else Zt(n).forEach((function(r){var o=t+(t?".":"")+Wt(r);p(s,{ownKeys:!0},(function(){var t=e(o,n[r],Boolean(i),s,l,d);Kt(t,Rt)?l.push([o,t,Boolean(i),s,E,r,s.type]):void 0!==t&&(E[r]=t)}))})),g&&g({endIterateOwn:!0,end:!0});if(s.iterateUnsetNumeric){for(var A=n.length,N=function(r){if(!(r in n)){var o="".concat(t).concat(t?".":"").concat(r);p(s,{ownKeys:!1},(function(){var t=e(o,void 0,Boolean(i),s,l,d);Kt(t,Rt)?l.push([o,t,Boolean(i),s,E,r,s.type]):void 0!==t&&(E[r]=t)}))}},x=0;x<A;x++)N(x);g&&g({endIterateUnsetNumeric:!0,end:!0})}return E},y=function(e,t,n,o,u,c,s){for(var f=u?r.plainObjectReplacers:r.nonplainObjectReplacers,d=f.length;d--;){var _=f[d];if(_.test(t,n)){var p=_.type;if(r.revivers[p]){var y=a[e];a[e]=y?[p].concat(y):p}if(Object.assign(n,{type:p,replaced:!0}),(i||!_.replaceAsync)&&!_.replace)return s&&s({typeDetected:!0}),h(e,t,l&&"readonly",n,o,c,p);s&&s({replacing:!0});var v=void 0;if(i||!_.replaceAsync){if(void 0===_.replace)throw new TypeError("Missing replacer");v=_.replace(t,n)}else v=_.replaceAsync(t,n);return h(e,v,l&&"readonly",n,o,c,p)}}return t},v=h("",e,l,null!=t?t:{},s);if(s.length)return i&&o.throwOnBadSyncType?function(){throw new TypeError("Sync method requested but async result obtained")}():Promise.resolve(_(v,s)).then(d);if(!i&&o.throwOnBadSyncType)throw new TypeError("Async method requested but sync result obtained");return o.stringification&&i?[d(v)]:i?d(v):Promise.resolve(d(v))}},{key:"encapsulateSync",value:function(e,t,n){return this.encapsulate(e,t,Nt(Nt({throwOnBadSyncType:!0},n),{},{sync:!0}))}},{key:"encapsulateAsync",value:function(e,t,n){return this.encapsulate(e,t,Nt(Nt({throwOnBadSyncType:!0},n),{},{sync:!1}))}},{key:"revive",value:function(e,t){var n=this,r=Nt(Nt({sync:!0},this.options),t),o=r.sync;function i(e){if(o)return e;if(r.throwOnBadSyncType)throw new TypeError("Async method requested but sync result obtained");return Promise.resolve(e)}if(!e||"object"!==xt(e)||Array.isArray(e))return i(e);var a=e.$types;if(!0===a)return i(e.$);if(!a||"object"!==xt(a)||Array.isArray(a))return i(e);var u=[],c={},s=!0;a.$&&Gt(a.$)&&(e=e.$,a=a.$,s=!1);var l=function(e,t){var r,i=Pt(null!==(r=n.revivers[e])&&void 0!==r?r:[],1)[0];if(!i)throw new Error("Unregistered type: "+e);if(o&&!("revive"in i))return t;if(!o&&i.reviveAsync)return i.reviveAsync(t,c);if(i.revive)return i.revive(t,c);throw new Error("Missing reviver")},f=[];function d(e){return Kt(e,un)?void 0:e}var _,p=function(){var t=[];if(!a)throw new Error("Found bad `types`");if(Object.entries(a).forEach((function(e){var r=Pt(e,2),o=r[0],i=r[1];"#"!==i&&[].concat(i).forEach((function(e){var r;Pt(null!==(r=n.revivers[e])&&void 0!==r?r:[null,{}],2)[1].plain&&(t.push({keypath:o,type:e}),delete a[o])}))})),t.length)return t.sort(on).reduce((function t(n,r){var o=r.keypath,i=r.type;if(Mt(n))return n.then((function(e){return t(e,{keypath:o,type:i})}));var a=$t(e,o);if(Kt(a=l(i,a),Rt))return a.then((function(t){var n=Jt(e,o,t);n===t&&(e=n)}));var u=Jt(e,o,a);u===a&&(e=u)}),void 0)}();return Kt(p,Rt)?_=p.then((function(){return e})):(_=function e(t,n,r,o,i){if(!s||"$types"!==t){var c=a[t],d=tn(n);if(d||Gt(n)){var _=d?new Array(n.length):{};for(Zt(n).forEach((function(o){var i=e(t+(t?".":"")+Wt(o),n[o],null!=r?r:_,_,o),a=function(e){return Kt(e,un)?_[o]=void 0:void 0!==e&&(_[o]=e),e};Kt(i,Rt)?f.push(i.then((function(e){return a(e)}))):a(i)})),n=_;u.length;){var p=Pt(u[0],4),h=p[0],y=p[1],v=p[2],b=p[3],g=$t(h,y);if(void 0===g)break;v[b]=g,u.splice(0,1)}}if(!c)return n;if("#"===c){var m=$t(r,n.slice(1));return void 0===m&&u.push([r,n.slice(1),o,i]),m}return[].concat(c).reduce((function e(t,n){if(Kt(t,Rt))return t.then((function(t){return e(t,n)}));if("string"!=typeof n)throw new TypeError("Bad type JSON");return l(n,t)}),n)}}("",e,null),f.length&&(_=Rt.resolve(_).then((function(e){return Rt.all([e].concat(f))})).then((function(e){return Pt(e,1)[0]})))),Mt(_)?o&&r.throwOnBadSyncType?function(){throw new TypeError("Sync method requested but async result obtained")}():Kt(_,Rt)?_.p.then(d):_:!o&&r.throwOnBadSyncType?function(){throw new TypeError("Async method requested but sync result obtained")}():o?d(_):Promise.resolve(d(_))}},{key:"reviveSync",value:function(e,t){return this.revive(e,Nt(Nt({throwOnBadSyncType:!0},t),{},{sync:!0}))}},{key:"reviveAsync",value:function(e,t){return this.revive(e,Nt(Nt({throwOnBadSyncType:!0},t),{},{sync:!1}))}},{key:"register",value:function(e,t){var n=this,r=null!=t?t:{},o=function e(t){tn(t)?t.forEach((function(t){return e(t)})):Zt(t).forEach((function(e){var o;if("#"===e)throw new TypeError("# cannot be used as a type name as it is reserved for cyclic objects");if(cn.includes(e))throw new TypeError("Plain JSON object types are reserved as type names");var i=t[e],a=i&&"function"!=typeof i&&!Array.isArray(i)&&i.testPlainObjects?n.plainObjectReplacers:n.nonplainObjectReplacers,u=a.filter((function(t){return t.type===e}));if(u.length&&(a.splice(a.indexOf(u[0]),1),delete n.revivers[e],delete n.types[e]),"function"==typeof i){var c=i;i={test:function(e){return e&&e.constructor===c},replace:function(e){return Nt({},e)},revive:function(e){return Object.assign(Object.create(c.prototype),e)}}}else if(tn(i)){var s=Pt(i,3);i={test:s[0],replace:s[1],revive:s[2]}}if(null!==(o=i)&&void 0!==o&&o.test){var l={type:e,test:i.test.bind(i)};i.replace&&(l.replace=i.replace.bind(i)),i.replaceAsync&&(l.replaceAsync=i.replaceAsync.bind(i));var f="number"==typeof r.fallback?r.fallback:r.fallback?0:Number.POSITIVE_INFINITY;if(i.testPlainObjects?n.plainObjectReplacers.splice(f,0,l):n.nonplainObjectReplacers.splice(f,0,l),i.revive||i.reviveAsync){var d={};i.revive&&(d.revive=i.revive.bind(i)),i.reviveAsync&&(d.reviveAsync=i.reviveAsync.bind(i)),n.revivers[e]=[d,{plain:i.testPlainObjects}]}n.types[e]=i}}))};return[].concat(e).forEach((function(e){return o(e)})),this}}]),e}(),un=Ft((function e(){Bt(this,e)}));un.__typeson__type__="TypesonUndefined";for(var cn=["null","boolean","number","string","array","object"],sn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ln=new Uint8Array(256),fn=0;fn<64;fn++)ln[sn.codePointAt(fn)]=fn;var dn=function(e,t,n){null==n&&(n=e.byteLength);for(var r=new Uint8Array(e,0,n),o=r.length,i="",a=0;a<o;a+=3)i+=sn[r[a]>>2],i+=sn[(3&r[a])<<4|r[a+1]>>4],i+=sn[(15&r[a+1])<<2|r[a+2]>>6],i+=sn[63&r[a+2]];return o%3==2?i=i.slice(0,-1)+"=":o%3==1&&(i=i.slice(0,-2)+"=="),i},_n=function(e,t){var n=e.length;if(n%4)throw new Error("Bad base64 length: not divisible by four");var r,o,i,a,u=.75*e.length,c=0;"="===e[e.length-1]&&(u--,"="===e[e.length-2]&&u--);for(var s=new ArrayBuffer(u,t),l=new Uint8Array(s),f=0;f<n;f+=4)r=ln[e.codePointAt(f)],o=ln[e.codePointAt(f+1)],i=ln[e.codePointAt(f+2)],a=ln[e.codePointAt(f+3)],l[c++]=r<<2|o>>4,l[c++]=(15&o)<<4|i>>2,l[c++]=(3&i)<<6|63&a;return s},pn={arraybuffer:{test:function(e){return"ArrayBuffer"===Vt(e)},replace:function(e,t){t.buffers||(t.buffers=[]);var n=t.buffers.indexOf(e);return n>-1?{index:n}:(t.buffers.push(e),{s:dn(e),maxByteLength:e.maxByteLength})},revive:function(e,t){if(t.buffers||(t.buffers=[]),Object.hasOwn(e,"index"))return t.buffers[e.index];var n=_n(e.s,{maxByteLength:e.maxByteLength});return t.buffers.push(n),n}}},hn={bigintObject:{test:function(e){return"object"==h(e)&&Kt(e,BigInt)},replace:String,revive:function(e){return new Object(BigInt(e))}}},yn={bigint:{test:function(e){return"bigint"==typeof e},replace:String,revive:function(e){return BigInt(e)}}};function vn(e){return new Uint8Array(e).reduce((function(e,t){return e+String.fromCodePoint(t)}),"")}function bn(e){for(var t=new Uint8Array(e.length),n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return t.buffer}var gn={blob:{test:function(e){return"Blob"===Vt(e)},replace:function(e){var t=new XMLHttpRequest;if(t.overrideMimeType("text/plain; charset=x-user-defined"),t.open("GET",URL.createObjectURL(e),!1),t.send(),200!==t.status&&0!==t.status)throw new Error("Bad Blob access: "+t.status);return{type:e.type,stringContents:t.responseText}},revive:function(e){var t=e.type,n=e.stringContents;return new Blob([bn(n)],{type:t})},replaceAsync:function(e){return new Rt((function(t,n){var r=new FileReader;r.addEventListener("load",(function(){t({type:e.type,stringContents:vn(r.result)})})),r.addEventListener("error",(function(){n(r.error)})),r.readAsArrayBuffer(e)}))}}},mn={cryptokey:{test:function(e){return"CryptoKey"===Vt(e)&&e.extractable},replaceAsync:function(e){return new Rt(function(){var t=n(f().mark((function t(n,r){var o;return f().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,crypto.subtle.exportKey("jwk",e);case 3:o=t.sent,t.next=9;break;case 6:return t.prev=6,t.t0=t.catch(0),t.abrupt("return",void r(t.t0));case 9:n({jwk:o,algorithm:e.algorithm,usages:e.usages});case 10:case"end":return t.stop()}}),t,null,[[0,6]])})));return function(e,n){return t.apply(this,arguments)}}())},revive:function(e){var t=e.jwk,n=e.algorithm,r=e.usages;return crypto.subtle.importKey("jwk",t,n,!0,r)}}},En={dataview:{test:function(e){return"DataView"===Vt(e)},replace:function(e,t){var n=e.buffer,r=e.byteOffset,o=e.byteLength;t.buffers||(t.buffers=[]);var i=t.buffers.indexOf(n);return i>-1?{index:i,byteOffset:r,byteLength:o}:(t.buffers.push(n),{encoded:dn(n),maxByteLength:n.maxByteLength,byteOffset:r,byteLength:o})},revive:function(e,t){t.buffers||(t.buffers=[]);var n,r=e.byteOffset,o=e.byteLength,i=e.encoded,a=e.index,u=e.maxByteLength;return"index"in e?n=t.buffers[a]:(n=_n(i,void 0===u?u:{maxByteLength:u}),t.buffers.push(n)),new DataView(n,r,o)}}},wn={date:{test:function(e){return"Date"===Vt(e)},replace:function(e){var t=e.getTime();return Number.isNaN(t)?"NaN":t},revive:function(e){return"NaN"===e?new Date(Number.NaN):new Date(e)}}},Dn={domexception:{test:function(e){return"DOMException"===Vt(e)},replace:function(e){return{name:e.name,message:e.message}},revive:function(e){var t=e.message,n=e.name;return new DOMException(t,n)}}},In={};function On(e){In[e.name.toLowerCase()]={test:function(t){return Vt(t)===e.name},replace:function(e){return e.is2D?{a:e.a,b:e.b,c:e.c,d:e.d,e:e.e,f:e.f}:{m11:e.m11,m12:e.m12,m13:e.m13,m14:e.m14,m21:e.m21,m22:e.m22,m23:e.m23,m24:e.m24,m31:e.m31,m32:e.m32,m33:e.m33,m34:e.m34,m41:e.m41,m42:e.m42,m43:e.m43,m44:e.m44}},revive:function(t){return Object.hasOwn(t,"a")?new e([t.a,t.b,t.c,t.d,t.e,t.f]):new e([t.m11,t.m12,t.m13,t.m14,t.m21,t.m22,t.m23,t.m24,t.m31,t.m32,t.m33,t.m34,t.m41,t.m42,t.m43,t.m44])}}}"undefined"!=typeof DOMMatrix&&On(DOMMatrix),"undefined"!=typeof DOMMatrixReadOnly&&On(DOMMatrixReadOnly);var Sn={};function Tn(e){Sn[e.name.toLowerCase()]={test:function(t){return Vt(t)===e.name},replace:function(e){return{x:e.x,y:e.y,z:e.z,w:e.w}},revive:function(t){var n=t.x,r=t.y,o=t.z,i=t.w;return new e(n,r,o,i)}}}"undefined"!=typeof DOMPoint&&Tn(DOMPoint),"undefined"!=typeof DOMPointReadOnly&&Tn(DOMPointReadOnly);var An={domquad:{test:function(e){return"DOMQuad"===Vt(e)},replace:function(e){return{p1:e.p1,p2:e.p2,p3:e.p3,p4:e.p4}},revive:function(e){var t=e.p1,n=e.p2,r=e.p3,o=e.p4;return new DOMQuad(t,n,r,o)}}},Nn={};function xn(e){Nn[e.name.toLowerCase()]={test:function(t){return Vt(t)===e.name},replace:function(e){return{x:e.x,y:e.y,width:e.width,height:e.height}},revive:function(t){var n=t.x,r=t.y,o=t.width,i=t.height;return new e(n,r,o,i)}}}"undefined"!=typeof DOMRect&&xn(DOMRect),"undefined"!=typeof DOMRectReadOnly&&xn(DOMRectReadOnly);var Bn={error:{test:function(e){return"Error"===Vt(e)},replace:function(e){return{name:e.name,message:e.message,cause:e.cause,stack:e.stack,fileName:e.fileName,lineNumber:e.lineNumber,columnNumber:e.columnNumber}},revive:function(e){var t=new Error(e.message);return t.name=e.name,t.cause=e.cause,t.stack=e.stack,t.fileName=e.fileName,t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber,t}}},Fn={};function jn(e){Fn[e.name.toLowerCase()]={test:function(t){return Kt(t,e)},replace:function(e){return{name:e.name,message:e.message,cause:e.cause,stack:e.stack,fileName:e.fileName,lineNumber:e.lineNumber,columnNumber:e.columnNumber,errors:e.errors}},revive:function(t){var n="undefined"!=typeof AggregateError&&e===AggregateError?new e(t.errors,t.message):new e(t.message);return n.name=t.name,n.cause=t.cause,n.stack=t.stack,n.fileName=t.fileName,n.lineNumber=t.lineNumber,n.columnNumber=t.columnNumber,n}}}[TypeError,RangeError,SyntaxError,ReferenceError,EvalError,URIError].forEach((function(e){return jn(e)})),"undefined"!=typeof AggregateError&&jn(AggregateError),"function"==typeof InternalError&&jn(InternalError);var Pn={file:{test:function(e){return"File"===Vt(e)},replace:function(e){var t=new XMLHttpRequest;if(t.overrideMimeType("text/plain; charset=x-user-defined"),t.open("GET",URL.createObjectURL(e),!1),t.send(),200!==t.status&&0!==t.status)throw new Error("Bad File access: "+t.status);return{type:e.type,stringContents:t.responseText,name:e.name,lastModified:e.lastModified}},revive:function(e){var t=e.name,n=e.type,r=e.stringContents,o=e.lastModified;return new File([bn(r)],t,{type:n,lastModified:o})},replaceAsync:function(e){return new Rt((function(t,n){var r=new FileReader;r.addEventListener("load",(function(){t({type:e.type,stringContents:vn(r.result),name:e.name,lastModified:e.lastModified})})),r.addEventListener("error",(function(){n(r.error)})),r.readAsArrayBuffer(e)}))}}},Cn={file:Pn.file,filelist:{test:function(e){return"FileList"===Vt(e)},replace:function(e){for(var t=[],n=0;n<e.length;n++)t[n]=e.item(n);return t},revive:function(e){var t=function(){return o((function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._files=arguments[0],this.length=this._files.length}),[{key:"item",value:function(e){return this._files[e]}},{key:Symbol.toStringTag,get:function(){return"FileList"}}])}();return new t(e)}}},kn={imagebitmap:{test:function(e){return"ImageBitmap"===Vt(e)||e&&e.dataset&&"ImageBitmap"===e.dataset.toStringTag},replace:function(e){var t=document.createElement("canvas");return t.getContext("2d").drawImage(e,0,0),{width:e.width,height:e.height,dataURL:t.toDataURL()}},revive:function(e){var t="undefined"==typeof OffscreenCanvas?document.createElement("canvas"):new OffscreenCanvas(e.width,e.height),n=t.getContext("2d"),r=document.createElement("img");return r.addEventListener("load",(function(){n.drawImage(r,0,0)})),r.src=e.dataURL,"undefined"==typeof OffscreenCanvas?t:t.transferToImageBitmap()},reviveAsync:function(e){var t=document.createElement("canvas"),r=t.getContext("2d"),o=document.createElement("img");return o.addEventListener("load",(function(){r.drawImage(o,0,0)})),o.src=e.dataURL,new Rt(function(){var e=n(f().mark((function e(n,r){return f().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.t0=n,e.next=4,createImageBitmap(t);case 4:e.t1=e.sent,(0,e.t0)(e.t1),e.next=11;break;case 8:e.prev=8,e.t2=e.catch(0),r(e.t2);case 11:case"end":return e.stop()}}),e,null,[[0,8]])})));return function(t,n){return e.apply(this,arguments)}}())}}},Ln={imagedata:{test:function(e){return"ImageData"===Vt(e)},replace:function(e){return{array:_(e.data),width:e.width,height:e.height}},revive:function(e){return new ImageData(new Uint8ClampedArray(e.array),e.width,e.height)}}},Rn={infinity:{test:function(e){return e===Number.POSITIVE_INFINITY},replace:function(){return"Infinity"},revive:function(){return Number.POSITIVE_INFINITY}}},qn={map:{test:function(e){return"Map"===Vt(e)},replace:function(e){return _(e.entries())},revive:function(e){return new Map(e)}}},Un={nan:{test:function(e){return Number.isNaN(e)},replace:function(){return"NaN"},revive:function(){return Number.NaN}}},Mn={negativeInfinity:{test:function(e){return e===Number.NEGATIVE_INFINITY},replace:function(){return"-Infinity"},revive:function(){return Number.NEGATIVE_INFINITY}}},Vn={negativeZero:{test:function(e){return Object.is(e,-0)},replace:function(){return 0},revive:function(){return-0}}},Kn={StringObject:{test:function(e){return"String"===Vt(e)&&"object"==h(e)},replace:String,revive:function(e){return new String(e)}},BooleanObject:{test:function(e){return"Boolean"===Vt(e)&&"object"==h(e)},replace:function(e){return e.valueOf()},revive:function(e){return new Boolean(e)}},NumberObject:{test:function(e){return"Number"===Vt(e)&&"object"==h(e)},replace:Number,revive:function(e){return new Number(e)}}},Gn={regexp:{test:function(e){return"RegExp"===Vt(e)},replace:function(e){return{source:e.source,flags:(e.global?"g":"")+(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.sticky?"y":"")+(e.unicode?"u":"")}},revive:function(e){var t=e.source,n=e.flags;return new RegExp(t,n)}}},Hn={set:{test:function(e){return"Set"===Vt(e)},replace:function(e){return _(e.values())},revive:function(e){return new Set(e)}}},Qn={};"function"==typeof Int8Array&&[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array].concat(_("function"==typeof BigInt64Array?[BigInt64Array,BigUint64Array]:[])).forEach((function(e){return function(e){var t=e.name;Qn[t.toLowerCase()]={test:function(e){return Vt(e)===t},replace:function(e){return(0===e.byteOffset&&e.byteLength===e.buffer.byteLength?e:e.slice(0)).buffer},revive:function(t){return"ArrayBuffer"===Vt(t)?new e(t):t}}}(e)}));var Wn={};"function"==typeof Int8Array&&[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array].concat(_("function"==typeof BigInt64Array?[BigInt64Array,BigUint64Array]:[])).forEach((function(e){return function(e){var t=e.name;Wn[t.toLowerCase()]={test:function(e){return Vt(e)===t},replace:function(e,t){var n=e.buffer,r=e.byteOffset,o=e.length;t.buffers||(t.buffers=[]);var i=t.buffers.indexOf(n);return i>-1?{index:i,byteOffset:r,length:o}:(t.buffers.push(n),{maxByteLength:n.maxByteLength,encoded:dn(n),byteOffset:r,length:o})},revive:function(t,n){n.buffers||(n.buffers=[]);var r,o=t.byteOffset,i=t.length,a=t.encoded,u=t.index,c=t.maxByteLength;return"index"in t?r=n.buffers[u]:(r=_n(a,void 0===c?void 0:{maxByteLength:c}),n.buffers.push(r)),new e(r,o,i)}}}(e)}));var Yn={undef:{test:function(e,t){return void 0===e&&(t.ownKeys||!("ownKeys"in t))},replace:function(){return 0},revive:function(){return new un}}},$n={userObject:{test:function(e){return Ht(e)},replace:function(e){return l({},e)},revive:function(e){return e}}},Jn=[{arrayNonindexKeys:{testPlainObjects:!0,test:function(e,t){return!!Array.isArray(e)&&(Object.keys(e).some((function(e){return String(Number.parseInt(e))!==e}))&&(t.iterateIn="object",t.addLength=!0),!0)},replace:function(e,t){return t.iterateUnsetNumeric=!0,e},revive:function(e){if(Array.isArray(e))return e;var t=[];return Object.entries(e).forEach((function(e){var n=d(e,2),r=n[0],o=n[1];t[r]=o})),t}}},{sparseUndefined:{test:function(e,t){return void 0===e&&!1===t.ownKeys},replace:function(){return 0},revive:function(){}}}],Xn=[$n,Yn,Jn,Kn,[Un,Rn,Mn,Vn],wn,Gn,Ln,kn,Pn,Cn,gn,Bn,Fn].concat("function"==typeof Map?qn:[],"function"==typeof Set?Hn:[],"function"==typeof ArrayBuffer?pn:[],"function"==typeof Uint8Array?Wn:[],"function"==typeof DataView?En:[],"undefined"!=typeof crypto?mn:[],"undefined"!=typeof BigInt?[yn,hn]:[],"undefined"!=typeof DOMException?Dn:[],"undefined"!=typeof DOMRect?Nn:[],"undefined"!=typeof DOMPoint?Sn:[],"undefined"!=typeof DOMQuad?An:[],"undefined"!=typeof DOMMatrix?In:[]).concat({checkDataCloneException:{test:function(e){var t={}.toString.call(e).slice(8,-1);if(["symbol","function"].includes(h(e))||["Arguments","Module","Promise","WeakMap","WeakSet","Event","MessageChannel"].includes(t)||e&&"object"==h(e)&&"number"==typeof e.nodeType&&"function"==typeof e.insertBefore)throw new DOMException("The object cannot be cloned.","DataCloneError");return!1}}}),zn=(new an).register(Xn);function Zn(e){zn=(new an).register(e(Xn))}function er(e,t){var n;try{n=zn.stringifySync(e)}catch(e){if(Kt(e,ReferenceError)||Kt(e,ge))throw be("DataCloneError","The object cannot be cloned.");throw e}return t&&t(n),n}function tr(e){return zn.parse(e)}function nr(e){return tr(er(e))}var rr=Object.freeze({__proto__:null,clone:nr,decode:tr,encode:er,register:Zn}),or=["objectStore","keyPath","multiEntry","unique"];function ir(){throw new TypeError("Illegal constructor")}var ar=ir;function ur(e,t,n,r,o,i,a,u,c,s,l,f,d){t&&(e=1),e&&u.push("LIMIT",String(e));var _="count"===i;j.DEBUG&&console.log("Trying to fetch data for Index",u.join(" "),c),s.executeSql(u.join(" "),c,(function(e,u){var c=[],s=0,l=_?function(){}:"key"===i?function(e){return at(q(e.key))}:function(e){return tr(q(e.value))};if(n.multiEntry)for(var d=G(n.name),p=it(o,n.multiEntry),h=function(){var e,n=u.rows.item(y),i=at(n[d]);if(r&&(a&&o.some((function(e){return i.includes(e)}))||rt(JSON.stringify(p).slice(1,-1),n[d]))?(s++,e=n):r||a||void 0!==i&&(s+=Array.isArray(i)?i.length:1,e=n),e&&(c.push(l(e)),t))return 1},y=0;y<u.rows.length&&!h();y++);else{for(var v=0;v<u.rows.length;v++){var b=u.rows.item(v);b&&c.push(l(b))}s=c.length}f(_?s:0===s?t?void 0:[]:t?c[0]:c)}),d)}function cr(e,t,n,r,o){var i=e||!ae(n),a=["SELECT",U("count"===r?"key":r)+(t.multiEntry?", "+K(t.name):""),"FROM",V(t.objectStore.__currentName),"WHERE",K(t.name),"NOT NULL"],u=[];if(i)if(o)a.push("AND ("),n.forEach((function(e,n){n>0&&a.push("OR"),a.push(K(t.name),"LIKE ? ESCAPE '^' "),u.push("%"+H(it(e,t.multiEntry))+"%")})),a.push(")");else if(t.multiEntry)a.push("AND",K(t.name),"LIKE ? ESCAPE '^'"),Array.isArray(n)?u.push("%"+H(JSON.stringify(it(n,t.multiEntry)).slice(1,-1))+"%"):u.push("%"+H(it(n,t.multiEntry))+"%");else{vt(bt(n,e),K(t.name),a,u,!0,!1)}return[e,t,i,n,r,o,a,u]}ir.__createInstance=function(e,t){function n(){var n=this;n[Symbol.toStringTag]="IDBIndex",z(n,or),n.__objectStore=e,n.__name=n.__originalName=t.columnName,n.__keyPath=Array.isArray(t.keyPath)?t.keyPath.slice():t.keyPath;var r=t.optionalParams;n.__multiEntry=Boolean(r&&r.multiEntry),n.__unique=Boolean(r&&r.unique),n.__deleted=Boolean(t.__deleted),n.__objectStore.__cursors=t.cursors||[],Object.defineProperty(n,"__currentName",{get:function(){return"__pendingName"in n?n.__pendingName:n.name}}),Object.defineProperty(n,"name",{enumerable:!1,configurable:!1,get:function(){return this.__name},set:function(t){var n=this;t=re(t);var r=n.name;if(St.__assertVersionChange(n.objectStore.transaction),St.__assertActive(n.objectStore.transaction),ar.__invalidStateIfDeleted(n),lr.__invalidStateIfDeleted(n),t!==r){if(n.objectStore.__indexes[t]&&!n.objectStore.__indexes[t].__deleted&&!n.objectStore.__indexes[t].__pendingDelete)throw be("ConstraintError",'Index "'+t+'" already exists on '+n.objectStore.__currentName);n.__name=t;var o=n.objectStore;delete o.__indexes[r],o.__indexes[t]=n,o.indexNames.splice(o.indexNames.indexOf(r),1,t);var i=o.transaction.__storeHandles[o.name],a=i.__indexHandles[r];a.__name=t,i.__indexHandles[t]=a,n.__pendingName=r;var u=[["key","BLOB "+(o.autoIncrement?"UNIQUE, inc INTEGER PRIMARY KEY AUTOINCREMENT":"PRIMARY KEY")],["value","BLOB"]].concat(_(o.indexNames).filter((function(e){return e!==t})).map((function(e){return[K(e),"BLOB"]})));n.__renameIndex(o,r,t,u,(function(t,n){ar.__updateIndexList(e,t,(function(e){delete i.__pendingName,n(e)}))}))}}})}return n.prototype=ar.prototype,new n},ir.__invalidStateIfDeleted=function(e,t){if(e.__deleted||e.__pendingDelete||e.__pendingCreate&&e.objectStore.transaction&&e.objectStore.transaction.__errored)throw be("InvalidStateError",t||"This index has been deleted")},ir.__clone=function(e,t){var n=ir.__createInstance(t,{columnName:e.name,keyPath:e.keyPath,optionalParams:{multiEntry:e.multiEntry,unique:e.unique}});return["__pendingCreate","__pendingDelete","__deleted","__originalName","__recreated"].forEach((function(t){n[t]=e[t]})),n},ir.__createIndex=function(e,t){var n=t.name,r=e.__currentName,o=e.__indexes[n];t.__pendingCreate=!0,e.indexNames.push(n),e.__indexes[n]=t;var i=e.__indexHandles[n];(!i||t.__pendingDelete||t.__deleted||i.__pendingDelete||i.__deleted)&&(i=e.__indexHandles[n]=ir.__clone(t,e)),e.transaction.__addNonRequestToTransactionQueue((function(a,u,c,s){var l=o&&(o.__deleted||o.__recreated),f={};function d(e,t){s(be("UnknownError",'Could not create index "'+n+'"'+t.code+"::"+t.message,t))}function _(o){ir.__updateIndexList(e,o,(function(){o.executeSql('SELECT "key", "value" FROM '+V(r),[],(function(o,a){j.DEBUG&&console.log("Adding existing "+r+" records to the "+n+" index"),function u(l){if(l<a.rows.length)try{var _=ze(tr(q(a.rows.item(l).value)),t.keyPath,t.multiEntry);if("invalid"in _&&_.invalid||"failure"in _&&_.failure)throw new Error("Go to catch; ignore bad indexKey");var p=it(_.value,t.multiEntry);if(t.unique){if(f[p])return f={},void s(be("ConstraintError","Duplicate values already exist within the store"));f[p]=!0}o.executeSql("UPDATE "+V(r)+" SET "+K(n)+' = ? WHERE "key" = ?',[R(p),a.rows.item(l).key],(function(){u(l+1)}),d)}catch(e){u(l+1)}else delete t.__pendingCreate,delete i.__pendingCreate,t.__deleted&&(delete t.__deleted,delete i.__deleted,t.__recreated=!0,i.__recreated=!0),f={},c(e)}(0)}),d)}),d)}var p=V(r),h=K(t.name);if(l)_(a);else{var y=["ALTER TABLE",p,"ADD",h,"BLOB"].join(" ");j.DEBUG&&console.log(y),a.executeSql(y,[],(function(e){j.useSQLiteIndexes?e.executeSql('CREATE INDEX IF NOT EXISTS "'+p.slice(1,-1)+"^5"+h.slice(1,-1)+'" ON '+p+"("+h+")",[],_,d):_(e)}),d)}}))},ir.__deleteIndex=function(e,t){t.__pendingDelete=!0;var n=e.__indexHandles[t.name];n&&(n.__pendingDelete=!0),e.indexNames.splice(e.indexNames.indexOf(t.name),1),e.transaction.__addNonRequestToTransactionQueue((function(r,o,i,a){function u(e,n){a(be("UnknownError",'Could not delete index "'+t.name+'"',n))}function c(){ir.__updateIndexList(e,r,(function(e){delete t.__pendingDelete,delete t.__recreated,t.__deleted=!0,n&&(n.__deleted=!0,delete n.__pendingDelete),i(e)}),u)}j.useSQLiteIndexes?r.executeSql("DROP INDEX IF EXISTS "+U(V(e.name).slice(1,-1)+"^5"+K(t.name).slice(1,-1)),[],c,u):c()}))},ir.__updateIndexList=function(e,t,n,r){for(var o={},i=0;i<e.indexNames.length;i++){var a=e.__indexes[e.indexNames[i]];o[a.name]={columnName:a.name,keyPath:a.keyPath,optionalParams:{unique:a.unique,multiEntry:a.multiEntry},deleted:Boolean(a.__deleted)}}j.DEBUG&&console.log("Updating the index list for "+e.__currentName,o),t.executeSql('UPDATE __sys__ SET "indexList" = ? WHERE "name" = ?',[JSON.stringify(o),R(e.__currentName)],(function(){n(e)}),r)},ir.prototype.__fetchIndexData=function(e,t,n,r){var o=this;if(void 0!==r&&(r=ne(r,"unsigned long")),ir.__invalidStateIfDeleted(o),lr.__invalidStateIfDeleted(o.objectStore),o.objectStore.__deleted)throw be("InvalidStateError","This index's object store has been deleted");if(St.__assertActive(o.objectStore.transaction),n&&ae(e))throw be("DataError","No key or range was specified");var i=cr(n,o,e,t,!1);return o.objectStore.transaction.__addToTransactionQueue((function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];ur.apply(void 0,[r].concat(_(i),t))}),void 0,o)},ir.prototype.openCursor=function(){var e=this,t=Array.prototype.slice.call(arguments),n=t[0],r=t[1],o=Gr.__createInstance(n,r,e.objectStore,e,G(e.name),"value");return e.__objectStore.__cursors.push(o),o.__request},ir.prototype.openKeyCursor=function(){var e=this,t=Array.prototype.slice.call(arguments),n=t[0],r=t[1],o=Mr.__createInstance(n,r,e.objectStore,e,G(e.name),"key");return e.__objectStore.__cursors.push(o),o.__request},ir.prototype.get=function(e){if(!arguments.length)throw new TypeError("A parameter was missing for `IDBIndex.get`.");return this.__fetchIndexData(e,"value",!0)},ir.prototype.getKey=function(e){if(!arguments.length)throw new TypeError("A parameter was missing for `IDBIndex.getKey`.");return this.__fetchIndexData(e,"key",!0)},ir.prototype.getAll=function(){var e=Array.prototype.slice.call(arguments),t=e[0],n=e[1];return this.__fetchIndexData(t,"value",!1,n)},ir.prototype.getAllKeys=function(){var e=Array.prototype.slice.call(arguments),t=e[0],n=e[1];return this.__fetchIndexData(t,"key",!1,n)},ir.prototype.count=function(){var e=this,t=arguments[0];return Q(t,ht)?Gr.__createInstance(t,"next",e.objectStore,e,G(e.name),"value",!0).__request:e.__fetchIndexData(t,"count",!1)},ir.prototype.__renameIndex=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,i=e.__currentName,a=V(i),u=K(n),c=U("tmp_"+V(i).slice(1,-1)),s=r.map((function(e){return e[0]})),l=r.map((function(e){return e.join(" ")})),f=l.length?l.join(", ")+", ":"",d=s.length?s.join(", ")+", ":"";e.transaction.__addNonRequestToTransactionQueue((function(e,n,r,i){function l(e,t){i(t)}function _(){o?o(e,r):r()}var p="CREATE TABLE "+c+"("+f+u+" BLOB)";j.DEBUG&&console.log(p),e.executeSql(p,[],(function(){var n="INSERT INTO "+c+"("+d+u+") SELECT "+d+K(t)+" FROM "+a;j.DEBUG&&console.log(n),e.executeSql(n,[],(function(){var t="DROP TABLE "+a;j.DEBUG&&console.log(t),e.executeSql(t,[],(function(){var t="ALTER TABLE "+c+" RENAME TO "+a;j.DEBUG&&console.log(t),e.executeSql(t,[],(function(e){if(j.useSQLiteIndexes){var t=s.slice(2).map((function(t){return new Fe((function(n,r){var o="CREATE INDEX "+U(a.slice(1,-1)+"^5"+t.slice(1,-1))+" ON "+a+"("+t+")";j.DEBUG&&console.log(o),e.executeSql(o,[],n,(function(e,t){r(t)}))}))}));t.push(new Fe((function(t,n){var r=U("sk_"+a.slice(1,-1)),o="DROP INDEX IF EXISTS "+r;j.DEBUG&&console.log(o),e.executeSql(o,[],(function(){var o="CREATE INDEX "+r+" ON "+a+'("key")';j.DEBUG&&console.log(o),e.executeSql(o,[],t,(function(e,t){n(t)}))}),(function(e,t){n(t)}))}))),Fe.all(t).then(_,i).catch((function(e){throw console.log("Index rename error"),e}))}else _()}),l)}),l)}),l)}),l)}))},Object.defineProperty(ir,Symbol.hasInstance,{value:function(e){return W(e)&&"openCursor"in e&&"function"==typeof e.openCursor&&"multiEntry"in e&&"boolean"==typeof e.multiEntry}}),J(ir.prototype,or),$(ir.prototype,["name"]),ir.prototype[Symbol.toStringTag]="IDBIndexPrototype",Object.defineProperty(ir,"prototype",{writable:!1});var sr=["keyPath","indexNames","transaction","autoIncrement"];function lr(){throw new TypeError("Illegal constructor")}var fr=lr;function dr(e,t){for(var n=0,r=e.length-1;r>=0;r--){var o=e[r];"."===o?e.splice(r,1):".."===o?(e.splice(r,1),n++):n&&(e.splice(r,1),n--)}if(t)for(;n--;n)e.unshift("..");return e}lr.__createInstance=function(e,t){function n(){var n=this;n[Symbol.toStringTag]="IDBObjectStore",z(this,sr),n.__name=n.__originalName=e.name,n.__keyPath=Array.isArray(e.keyPath)?e.keyPath.slice():e.keyPath,n.__transaction=t,n.__idbdb=e.idbdb,n.__cursors=e.cursors||[],n.__autoIncrement=Boolean(e.autoInc),n.__indexes={},n.__indexHandles={},n.__indexNames=Et.__createInstance();var r=e.indexList;for(var o in r)if(Object.hasOwn(r,o)){var i=ir.__createInstance(n,r[o]);n.__indexes[i.name]=i,i.__deleted||n.indexNames.push(i.name)}n.__oldIndexNames=n.indexNames.clone(),Object.defineProperty(this,"__currentName",{get:function(){return"__pendingName"in this?this.__pendingName:this.name}}),Object.defineProperty(this,"name",{enumerable:!1,configurable:!1,get:function(){return this.__name},set:function(e){var t=this;e=re(e);var n=t.name;if(fr.__invalidStateIfDeleted(t),St.__assertVersionChange(t.transaction),St.__assertActive(t.transaction),n!==e){if(t.__idbdb.__objectStores[e]&&!t.__idbdb.__objectStores[e].__pendingDelete)throw be("ConstraintError",'Object store "'+e+'" already exists in '+t.__idbdb.name);t.__name=e;var r=t.__idbdb.__objectStores[n];r.__name=e,t.__idbdb.__objectStores[e]=r,delete t.__idbdb.__objectStores[n],t.__idbdb.objectStoreNames.splice(t.__idbdb.objectStoreNames.indexOf(n),1,e);var o=t.transaction.__storeHandles[n];o.__name=e,t.transaction.__storeHandles[e]=o,t.__pendingName=n;var i='UPDATE __sys__ SET "name" = ? WHERE "name" = ?',a=[R(e),R(n)];j.DEBUG&&console.log(i,a),t.transaction.__addNonRequestToTransactionQueue((function(r,o,u,c){r.executeSql(i,a,(function(r){var o="ALTER TABLE "+V(n)+" RENAME TO "+V(e);j.DEBUG&&console.log(o),r.executeSql(o,[],(function(){delete t.__pendingName,u()}))}),(function(e,t){return c(t),!1}))}))}}})}return n.prototype=fr.prototype,new n},lr.__clone=function(e,t){var n=lr.__createInstance({name:e.__currentName,keyPath:Array.isArray(e.keyPath)?e.keyPath.slice():e.keyPath,autoInc:e.autoIncrement,indexList:{},idbdb:e.__idbdb,cursors:e.__cursors},t);return["__indexes","__indexNames","__oldIndexNames","__deleted","__pendingDelete","__pendingCreate","__originalName"].forEach((function(t){n[t]=e[t]})),n},lr.__invalidStateIfDeleted=function(e,t){if(e.__deleted||e.__pendingDelete||e.__pendingCreate&&"transaction"in e&&e.transaction&&e.transaction.__errored)throw be("InvalidStateError",t||"This store has been deleted")},lr.__createObjectStore=function(e,t){var n=t.__currentName;t.__pendingCreate=!0,e.__objectStores[n]=t,e.objectStoreNames.push(n);var r=e.__versionTransaction,o=r.__storeHandles;return(!o[n]||o[n].__pendingDelete||o[n].__deleted)&&(o[n]=lr.__clone(t,r)),r.__addNonRequestToTransactionQueue((function(e,r,o,i){function a(e,t){return j.DEBUG&&console.log(t),i(be("UnknownError",'Could not create object store "'+n+'"',t)),!1}var u=V(n),c=["CREATE TABLE",u,"(key BLOB",t.autoIncrement?"UNIQUE, inc INTEGER PRIMARY KEY AUTOINCREMENT":"PRIMARY KEY",", value BLOB)"].join(" ");j.DEBUG&&console.log(c),e.executeSql(c,[],(function(e){function r(){var r=JSON.stringify(t.keyPath);e.executeSql("INSERT INTO __sys__ VALUES (?,?,?,?,?)",[R(n),r,Number(t.autoIncrement),"{}",1],(function(){delete t.__pendingCreate,delete t.__deleted,o(t)}),a)}j.useSQLiteIndexes?e.executeSql("CREATE INDEX IF NOT EXISTS "+U("sk_"+u.slice(1,-1))+" ON "+u+'("key")',[],r,a):r()}),a)})),o[n]},lr.__deleteObjectStore=function(e,t){t.__pendingDelete=!0,t.__indexNames=Et.__createInstance(),e.objectStoreNames.splice(e.objectStoreNames.indexOf(t.__currentName),1);var n=e.__versionTransaction.__storeHandles[t.__currentName];n&&(n.__indexNames=Et.__createInstance(),n.__pendingDelete=!0),e.__versionTransaction.__addNonRequestToTransactionQueue((function(e,r,o,i){function a(e,t){return j.DEBUG&&console.log(t),i(be("UnknownError","Could not delete ObjectStore",t)),!1}e.executeSql('SELECT "name" FROM __sys__ WHERE "name" = ?',[R(t.__currentName)],(function(e,r){r.rows.length>0&&e.executeSql("DROP TABLE "+V(t.__currentName),[],(function(){e.executeSql('DELETE FROM __sys__ WHERE "name" = ?',[R(t.__currentName)],(function(){delete t.__pendingDelete,t.__deleted=!0,n&&(delete n.__pendingDelete,n.__deleted=!0),o()}),a)}),a)}))}))},lr.prototype.__validateKeyAndValueAndCloneValue=function(e,t,n){var r=this;if(null!==r.keyPath){if(void 0!==t)throw be("DataError","The object store uses in-line keys and the key parameter was provided");var o=nr(e);if((t=ze(o,r.keyPath)).invalid)throw be("DataError","KeyPath was specified, but key was invalid.");if(t.failure){if(!n){if(!r.autoIncrement)throw be("DataError","Could not evaluate a key from keyPath and there is no key generator");if(!tt(o,r.keyPath))throw be("DataError","A key could not be injected into a value");return[void 0,o]}throw be("DataError","Could not evaluate a key from keyPath")}return[t.value,o]}if(void 0===t){if(!r.autoIncrement)throw be("DataError","The object store uses out-of-line keys and has no key generator and the key parameter was not provided.");t=void 0}else Xe(t);return[t,nr(e)]},lr.prototype.__deriveKey=function(e,t,n,r,o){var i=this;function a(e){er(n,(function(t){t=tr(t),r(t,e)}))}i.autoIncrement?void 0===n?dt(e,i,(function(e,n,a){e?o(be("ConstraintError","The key generator's current number has reached the maximum safe integer limit")):(null!==i.keyPath&&et(t,n,i.keyPath),r(n,a))}),o):_t(e,i,n,a,o):a()},lr.prototype.__insertData=function(e,t,n,r,o,i,a){var u=this,c={},s=Object.keys(u.__indexes).map((function(t){return new Fe((function(r,o){var i=u.__indexes[t];if(i.__pendingCreate||i.__deleted)r(void 0);else{var a;try{if("invalid"in(a=ze(n,i.keyPath,i.multiEntry))&&a.invalid||"failure"in a&&a.failure)throw new Error("Go to catch")}catch(e){return void r(void 0)}if(a=a.value,i.unique){var s=i.multiEntry&&Array.isArray(a),l=cr(!0,i,a,"key",s);ur.apply(void 0,[null].concat(_(l),[e,null,function(e){if(void 0===e)return f(i),void r(void 0);o(be("ConstraintError","Index already contains a record equal to "+(s?"one of the subkeys of":"")+"`indexKey`"))},o]))}else f(i),r(void 0)}function f(e){void 0!==a&&(c[e.__currentName]=it(a,e.multiEntry))}}))}));return Fe.all(s).then((function(){var n=["INSERT INTO",V(u.__currentName),"("],o=[" VALUES ("],s=[];void 0!==r&&(n.push(U("key"),","),o.push("?,"),s.push(R(it(r)))),Object.entries(c).forEach((function(e){var t=d(e,2),r=t[0],i=t[1];n.push(K(r)+","),o.push("?,"),s.push(R(i))})),n.push(U("value")+" )"),o.push("?)"),s.push(R(t));var l=n.join(" ")+o.join(" ");j.DEBUG&&console.log("SQL for adding",l,s),e.executeSql(l,s,(function(){i(r)}),(function(e,t){return a(be("ConstraintError",t.message,t)),!1}))})).catch((function(t){function n(){a(t)}return"number"==typeof o?(lt(e,u,o,n,n),null):(n(),null)}))},lr.prototype.add=function(e){var t=this,n=arguments[1];if(!(t instanceof lr))throw new TypeError("Illegal invocation");if(0===arguments.length)throw new TypeError("No value was specified");lr.__invalidStateIfDeleted(t),St.__assertActive(t.transaction),t.transaction.__assertWritable();var r=t.transaction.__createRequest(t),o=d(t.__validateKeyAndValueAndCloneValue(e,n,!1),2),i=o[0],a=o[1];return lr.__storingRecordObjectStore(r,t,!0,a,!0,i),r},lr.prototype.put=function(e){var t=this,n=arguments[1];if(!(t instanceof lr))throw new TypeError("Illegal invocation");if(0===arguments.length)throw new TypeError("No value was specified");lr.__invalidStateIfDeleted(t),St.__assertActive(t.transaction),t.transaction.__assertWritable();var r=t.transaction.__createRequest(t),o=d(t.__validateKeyAndValueAndCloneValue(e,n,!1),2),i=o[0],a=o[1];return lr.__storingRecordObjectStore(r,t,!0,a,!1,i),r},lr.prototype.__overwrite=function(e,t,n,r){var o="DELETE FROM "+V(this.__currentName)+' WHERE "key" = ?',i=it(t);e.executeSql(o,[R(i)],(function(e,r){j.DEBUG&&console.log("Did the row with the",t,"exist?",r.rowsAffected),n(e)}),(function(e,t){return r(t),!1}))},lr.__storingRecordObjectStore=function(e,t,n,r,o){var i=arguments[5];t.transaction.__pushToQueue(e,(function(e,a,u,c){t.__deriveKey(e,r,i,(function(i,a){er(r,(function(s){function l(e){t.__insertData(e,s,r,i,a,(function(){n&&t.__cursors.forEach((function(e){e.__invalidateCache()})),u.apply(void 0,arguments)}),c)}o?l(e):t.__overwrite(e,i,l,c)}))}),c)}))},lr.prototype.__get=function(e,t,n,r){var o=this;void 0!==r&&(r=ne(r,"unsigned long")),lr.__invalidStateIfDeleted(o),St.__assertActive(o.transaction);var i=bt(e,!n),a=["SELECT",U(t?"key":"value"),"FROM",V(o.__currentName)],u=[];if(void 0!==i&&(a.push("WHERE"),vt(i,U("key"),a,u)),n||(r=1),r){if(!Number.isFinite(r))throw new TypeError("The count parameter must be a finite number");a.push("LIMIT",String(r))}var c=a.join(" ");return o.transaction.__addToTransactionQueue((function(e,r,i,a){j.DEBUG&&console.log("Fetching",o.__currentName,u),e.executeSql(c,u,(function(e,r){var o;j.DEBUG&&console.log("Fetched data",r);try{if(0===r.rows.length)return void(n?i([]):i());if(o=[],t)for(var a=0;a<r.rows.length;a++)o.push(at(q(r.rows.item(a).key),!1));else for(var u=0;u<r.rows.length;u++)o.push(tr(q(r.rows.item(u).value)));n||(o=o[0])}catch(e){j.DEBUG&&console.log(e)}i(o)}),(function(e,t){return a(t),!1}))}),void 0,o)},lr.prototype.get=function(e){if(!arguments.length)throw new TypeError("A parameter was missing for `IDBObjectStore.get`.");return this.__get(e)},lr.prototype.getKey=function(e){if(!arguments.length)throw new TypeError("A parameter was missing for `IDBObjectStore.getKey`.");return this.__get(e,!0)},lr.prototype.getAll=function(){var e=Array.prototype.slice.call(arguments),t=e[0],n=e[1];return this.__get(t,!1,!0,n)},lr.prototype.getAllKeys=function(){var e=Array.prototype.slice.call(arguments),t=e[0],n=e[1];return this.__get(t,!0,!0,n)},lr.prototype.delete=function(e){var t=this;if(!(this instanceof lr))throw new TypeError("Illegal invocation");if(!arguments.length)throw new TypeError("A parameter was missing for `IDBObjectStore.delete`.");lr.__invalidStateIfDeleted(t),St.__assertActive(t.transaction),t.transaction.__assertWritable();var n=bt(e,!0),r=["DELETE FROM",V(t.__currentName),"WHERE"],o=[];vt(n,U("key"),r,o);var i=r.join(" ");return t.transaction.__addToTransactionQueue((function(e,n,r,a){j.DEBUG&&console.log("Deleting",t.__currentName,o),e.executeSql(i,o,(function(e,n){j.DEBUG&&console.log("Deleted from database",n.rowsAffected),t.__cursors.forEach((function(e){e.__invalidateCache()})),r()}),(function(e,t){return a(t),!1}))}),void 0,t)},lr.prototype.clear=function(){var e=this;if(!(this instanceof lr))throw new TypeError("Illegal invocation");return lr.__invalidStateIfDeleted(e),St.__assertActive(e.transaction),e.transaction.__assertWritable(),e.transaction.__addToTransactionQueue((function(t,n,r,o){t.executeSql("DELETE FROM "+V(e.__currentName),[],(function(t,n){j.DEBUG&&console.log("Cleared all records from database",n.rowsAffected),e.__cursors.forEach((function(e){e.__invalidateCache()})),r()}),(function(e,t){return o(t),!1}))}),void 0,e)},lr.prototype.count=function(){var e=this,t=arguments[0];if(!(e instanceof lr))throw new TypeError("Illegal invocation");return lr.__invalidStateIfDeleted(e),St.__assertActive(e.transaction),Gr.__createInstance(t,"next",e,e,"key","value",!0).__request},lr.prototype.openCursor=function(){var e=this,t=Array.prototype.slice.call(arguments),n=t[0],r=t[1];if(!(e instanceof lr))throw new TypeError("Illegal invocation");lr.__invalidStateIfDeleted(e);var o=Gr.__createInstance(n,r,e,e,"key","value");return e.__cursors.push(o),o.__request},lr.prototype.openKeyCursor=function(){var e=this;if(!(e instanceof lr))throw new TypeError("Illegal invocation");lr.__invalidStateIfDeleted(e);var t=Array.prototype.slice.call(arguments),n=t[0],r=t[1],o=Mr.__createInstance(n,r,e,e,"key","key");return e.__cursors.push(o),o.__request},lr.prototype.index=function(e){var t=this;if(!(t instanceof lr))throw new TypeError("Illegal invocation");if(0===arguments.length)throw new TypeError("No index name was specified");lr.__invalidStateIfDeleted(t),St.__assertNotFinished(t.transaction);var n=t.__indexes[e];if(!n||n.__deleted)throw be("NotFoundError",'Index "'+e+'" does not exist on '+t.__currentName);return(!t.__indexHandles[e]||t.__indexes[e].__pendingDelete||t.__indexes[e].__deleted)&&(t.__indexHandles[e]=ir.__clone(n,t)),t.__indexHandles[e]},lr.prototype.createIndex=function(e,t){var n=this,r=arguments[2];if(!(n instanceof lr))throw new TypeError("Illegal invocation");if(e=String(e),0===arguments.length)throw new TypeError("No index name was specified");if(1===arguments.length)throw new TypeError("No key path was specified");if(St.__assertVersionChange(n.transaction),lr.__invalidStateIfDeleted(n),St.__assertActive(n.transaction),n.__indexes[e]&&!n.__indexes[e].__deleted&&!n.__indexes[e].__pendingDelete)throw be("ConstraintError",'Index "'+e+'" already exists on '+n.__currentName);if(!te(t=ie(t)))throw be("SyntaxError","A valid keyPath must be supplied");if(Array.isArray(t)&&r&&r.multiEntry)throw be("InvalidAccessError","The keyPath argument was an array and the multiEntry option is true.");r=r||{};var o={columnName:e,keyPath:t,optionalParams:{unique:Boolean(r.unique),multiEntry:Boolean(r.multiEntry)}},i=ir.__createInstance(n,o);return ir.__createIndex(n,i),i},lr.prototype.deleteIndex=function(e){var t=this;if(!(t instanceof lr))throw new TypeError("Illegal invocation");if(0===arguments.length)throw new TypeError("No index name was specified");St.__assertVersionChange(t.transaction),lr.__invalidStateIfDeleted(t),St.__assertActive(t.transaction);var n=t.__indexes[e];if(!n)throw be("NotFoundError",'Index "'+e+'" does not exist on '+t.__currentName);ir.__deleteIndex(t,n)},J(lr.prototype,sr),$(lr.prototype,["name"]),lr.prototype[Symbol.toStringTag]="IDBObjectStorePrototype",Object.defineProperty(lr,"prototype",{writable:!1});var _r=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,pr=function(e){return _r.exec(e).slice(1)};function hr(){for(var e="",t=!1,n=arguments.length-1;n>=-1&&!t;n--){var r=n>=0?arguments[n]:"/";if("string"!=typeof r)throw new TypeError("Arguments to path.resolve must be strings");r&&(e=r+"/"+e,t="/"===r.charAt(0))}return e=dr(gr(e.split("/"),(function(e){return!!e})),!t).join("/"),(t?"/":"")+e||"."}function yr(e){var t=vr(e),n="/"===mr(e,-1);return e=dr(gr(e.split("/"),(function(e){return!!e})),!t).join("/"),e||t||(e="."),e&&n&&(e+="/"),(t?"/":"")+e}function vr(e){return"/"===e.charAt(0)}var br={extname:function(e){return pr(e)[3]},basename:function(e,t){var n=pr(e)[2];return t&&n.substr(-1*t.length)===t&&(n=n.substr(0,n.length-t.length)),n},dirname:function(e){var t=pr(e),n=t[0],r=t[1];return n||r?(r&&(r=r.substr(0,r.length-1)),n+r):"."},sep:"/",delimiter:":",relative:function(e,t){function n(e){for(var t=0;t<e.length&&""===e[t];t++);for(var n=e.length-1;n>=0&&""===e[n];n--);return t>n?[]:e.slice(t,n-t+1)}e=hr(e).substr(1),t=hr(t).substr(1);for(var r=n(e.split("/")),o=n(t.split("/")),i=Math.min(r.length,o.length),a=i,u=0;u<i;u++)if(r[u]!==o[u]){a=u;break}var c=[];for(u=a;u<r.length;u++)c.push("..");return(c=c.concat(o.slice(a))).join("/")},join:function(){return yr(gr(Array.prototype.slice.call(arguments,0),(function(e,t){if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e})).join("/"))},isAbsolute:vr,normalize:yr,resolve:hr};function gr(e,t){if(e.filter)return e.filter(t);for(var n=[],r=0;r<e.length;r++)t(e[r],r,e)&&n.push(e[r]);return n}var mr="b"==="ab".substr(-1)?function(e,t,n){return e.substr(t,n)}:function(e,t,n){return t<0&&(t=e.length+t),e.substr(t,n)},Er=["onabort","onclose","onerror","onversionchange"],wr=["name","version","objectStoreNames"];function Dr(){throw this.__versionTransaction=null,this.__objectStores=null,this.__transactions=[],new TypeError("Illegal constructor")}var Ir,Or=Dr;Dr.__createInstance=function(e,t,n,r,o){function i(){var i=this;this[Symbol.toStringTag]="IDBDatabase",z(this,wr),this.__db=e,this.__closePending=!1,this.__oldVersion=n,this.__version=r,this.__name=t,this.__upgradeTransaction=null,X(this,Er),this.__setOptions({legacyOutputDidListenersThrowFlag:!0}),this.__transactions=[],this.__objectStores={},this.__objectStoreNames=Et.__createInstance();for(var a={},u=function(){var e=o.rows.item(c);a.name=e.name,a.keyPath=JSON.parse(e.keyPath),["autoInc","indexList"].forEach((function(t){a[t]=JSON.parse(e[t])})),a.idbdb=i;var t=lr.__createInstance(a);i.__objectStores[t.name]=t,i.objectStoreNames.push(t.name)},c=0;c<o.rows.length;c++)u();this.__oldObjectStoreNames=this.objectStoreNames.clone()}return i.prototype=Or.prototype,new i},Dr.prototype=B.createInstance(),Dr.prototype[Symbol.toStringTag]="IDBDatabasePrototype",Dr.prototype.createObjectStore=function(e){var t=arguments[1];if(e=String(e),!(this instanceof Dr))throw new TypeError("Illegal invocation");if(0===arguments.length)throw new TypeError("No object store name was specified");St.__assertVersionChange(this.__versionTransaction),this.throwIfUpgradeTransactionNull(),St.__assertActive(this.__versionTransaction);var n=(t=l({},t)).keyPath;if(null!==(n=void 0===n?null:ie(n))&&!te(n))throw be("SyntaxError","The keyPath argument contains an invalid key path.");if(this.__objectStores[e]&&!this.__objectStores[e].__pendingDelete)throw be("ConstraintError",'Object store "'+e+'" already exists in '+this.name);var r=t.autoIncrement;if(r&&(""===n||Array.isArray(n)))throw be("InvalidAccessError","With autoIncrement set, the keyPath argument must not be an array or empty string.");var o={name:e,keyPath:n,autoInc:r,indexList:{},idbdb:this},i=lr.__createInstance(o,this.__versionTransaction);return lr.__createObjectStore(this,i)},Dr.prototype.deleteObjectStore=function(e){if(!(this instanceof Dr))throw new TypeError("Illegal invocation");if(0===arguments.length)throw new TypeError("No object store name was specified");St.__assertVersionChange(this.__versionTransaction),this.throwIfUpgradeTransactionNull(),St.__assertActive(this.__versionTransaction);var t=this.__objectStores[e];if(!t)throw be("NotFoundError",'Object store "'+e+'" does not exist in '+this.name);lr.__deleteObjectStore(this,t)},Dr.prototype.close=function(){if(!(this instanceof Dr))throw new TypeError("Illegal invocation");this.__closePending=!0,this.__unblocking&&this.__unblocking.check(),this.__transactions=[]},Dr.prototype.transaction=function(e){var t=this;if(0===arguments.length)throw new TypeError("You must supply a valid `storeNames` to `IDBDatabase.transaction`");var n=arguments[1];if(e=Y(e)?_(new Set(ie(e))).sort():[re(e)],n=n||"readonly",St.__assertNotVersionChange(this.__versionTransaction),this.__closePending)throw be("InvalidStateError","An attempt was made to start a new transaction on a database connection that is not open");var r=Et.__createInstance();if(e.forEach((function(e){if(!t.objectStoreNames.contains(e))throw be("NotFoundError",'The "'+e+'" object store does not exist');r.push(e)})),0===e.length)throw be("InvalidAccessError","No valid object store names were specified");if("readonly"!==n&&"readwrite"!==n)throw new TypeError("Invalid transaction mode: "+n);var o=St.__createInstance(this,r,n);return this.__transactions.push(o),o},Dr.prototype.throwIfUpgradeTransactionNull=function(){if(null===this.__upgradeTransaction)throw be("InvalidStateError","No upgrade transaction associated with database.")},Dr.prototype.__forceClose=function(e){var t=this;t.close();var n=0;t.__transactions.forEach((function(r){r.on__abort=function(){if(++n===t.__transactions.length){var e=ue("close");setTimeout((function(){t.dispatchEvent(e)}))}},r.__abortTransaction(be("AbortError","The connection was force-closed: "+(e||"")))})),t.__transactions=[]},$(Dr.prototype,Er),J(Dr.prototype,wr),Object.defineProperty(Dr.prototype,"constructor",{enumerable:!1,writable:!0,configurable:!0,value:Dr}),Object.defineProperty(Dr,"prototype",{writable:!1});var Sr=function(){return"object"===("undefined"==typeof location?"undefined":h(location))&&location?location.origin:"null"},Tr=function(){return!1!==j.checkOrigin&&"null"===Sr()},Ar={};function Nr(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Sr(),n=Ar[t][e];if(n[0]){var r=n[0],o=r.req,i=r.cb;o.addEventListener("success",a),o.addEventListener("error",a),o.addEventListener("blocked",a),i(o)}function a(){n.shift(),Nr(e,t)}}function xr(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Sr(),r=arguments.length>3?arguments[3]:void 0;Ar[n][t]||(Ar[n][t]=[]),Ar[n][t].push({req:e,cb:r}),1===Ar[n][t].length&&Nr(t,n)}function Br(e,t,n,r){var o=function(e){return e.__closePending},i=function(){return e.every((function(e){return o(e)}))};return e.reduce((function(e,t){return o(t)?e:e.then((function(){if(!o(t)){var e=new ce("versionchange",{oldVersion:n,newVersion:r});return new Fe((function(n){setTimeout((function(){t.dispatchEvent(e),n(void 0)}))}))}}))}),Fe.resolve(void 0)).then((function(){if(!i())return new Fe((function(a){var u={check:function(){i()&&a(void 0)}},c=new ce("blocked",{oldVersion:n,newVersion:r});setTimeout((function(){t.dispatchEvent(c),i()?a(void 0):e.forEach((function(e){o(e)||(e.__unblocking=u)}))}))}))}))}var Fr,jr={},Pr=0;function Cr(e){return Object.keys(jr[e]).map(Number).reduce((function(e,t){return t>e?t:e}),0)}function kr(e,t,n,r,o){if("string"==typeof j.memoryDatabase){var i=jr[t]?function(e){return jr[e]&&jr[e][Cr(e)]}(t):null;if(!i)return console.warn("Could not find a memory database instance to delete."),void r();var a=i._db&&i._db._db;return a&&a.close?void a.close((function(e){e?console.warn("Error closing (destroying) memory database"):r()})):void console.error("The `openDatabase` implementation does not have the expected `._db._db.close` method for closing the database")}Ir&&!1!==j.deleteDatabaseFiles?Ir.unlink(br.join(j.databaseBasePath||"",n),(function(e){e&&"ENOENT"!==e.code?o({code:0,message:"Error removing database file: "+n+" "+e}):r()})):e(br.join(j.databaseBasePath||"",n),"1",t,j.DEFAULT_DB_SIZE).transaction((function(e){e.executeSql('SELECT "name" FROM __sys__',[],(function(e,t){var n=t.rows;!function t(i){i>=n.length?e.executeSql("DROP TABLE IF EXISTS __sys__",[],(function(){r()}),o):e.executeSql("DROP TABLE "+V(q(n.item(i).name)),[],(function(){t(i+1)}),(function(){return t(i+1),!1}))}(0)}),(function(){return r(),!1}))}))}function Lr(e,t,n){function r(e,t){var r=he(t||e);j.DEBUG&&console.log("Error in sysdb transaction - when creating dbVersions",t),n(r)}Fr?t():(Fr=e("string"==typeof j.memoryDatabase?j.memoryDatabase:br.join("string"==typeof j.sysDatabaseBasePath?j.sysDatabaseBasePath:j.databaseBasePath||"","__sysdb__"+(!1!==j.addSQLiteExtension?".sqlite":"")),"1","System Database",j.DEFAULT_DB_SIZE)).transaction((function(e){e.executeSql("CREATE TABLE IF NOT EXISTS dbVersions (name BLOB, version INT);",[],(function(e){j.useSQLiteIndexes?e.executeSql("CREATE INDEX IF NOT EXISTS dbvname ON dbVersions(name)",[],t,r):t()}),r)}),r)}function Rr(){throw new TypeError("Illegal constructor")}var qr=Rr;Rr.__createInstance=function(){function e(){this[Symbol.toStringTag]="IDBFactory",this.__connections={}}return e.prototype=qr.prototype,new e},Rr.prototype.open=function(e){var t=this;if(!(t instanceof Rr))throw new TypeError("Illegal invocation");var n=arguments[1];if(0===arguments.length)throw new TypeError("Database name is required");if(void 0!==n&&0===(n=ne(n,"unsigned long long")))throw new TypeError("Version cannot be 0");if(Tr())throw be("SecurityError","Cannot open an IndexedDB database from an opaque origin.");var r=Oe.__createInstance(),o=!1;j.autoName&&""===e&&(e="autoNamedDatabase_"+Pr++);var i,a=R(e=String(e)),u="string"==typeof j.memoryDatabase,c=!1!==j.cacheDatabaseInstances||u;try{i=M(e)}catch(e){throw e}function s(e,t){if(o)return!1;var n=t?he(t):e;o=!0;var i=ue("error",n,{bubbles:!0,cancelable:!0});return r.__done=!0,r.__error=n,r.__result=void 0,r.dispatchEvent(i),!1}function l(o){var l;if((u||c)&&e in jr&&jr[e][n]?l=jr[e][n]:(l=t.__openDatabase(u?j.memoryDatabase:br.join(j.databaseBasePath||"",i),"1",e,j.DEFAULT_DB_SIZE),c&&(e in jr||(jr[e]={}),jr[e][n]=l)),void 0===n&&(n=o||1),o>n){var f=be("VersionError","An attempt was made to open a database using a lower version than the existing version.",n);c?setTimeout((function(){s(f)})):s(f)}else l.transaction((function(u){u.executeSql("CREATE TABLE IF NOT EXISTS __sys__ (name BLOB, keyPath BLOB, autoInc BOOLEAN, indexList BLOB, currNum INTEGER)",[],(function(){function f(){!function(o,u,l){o.executeSql('SELECT "name", "keyPath", "autoInc", "indexList" FROM __sys__',[],(function(o,f){function d(){r.__result=_,r.__done=!0}var _=Dr.__createInstance(u,e,l,n,f);if(t.__connections[e]||(t.__connections[e]=[]),t.__connections[e].push(_),l<n)Br(t.__connections[e].slice(0,-1),r,l,n).then((function(){var o=function(e,t,n){if(t)try{e.executeSql("ROLLBACK",[],n,n)}catch(t){Fr.transaction((function(e){function t(e){throw new Error("Unable to roll back upgrade transaction!"+(e||""))}0===l?e.executeSql('DELETE FROM dbVersions WHERE "name" = ?',[a],(function(){n(t)}),t):e.executeSql('UPDATE dbVersions SET "version" = ? WHERE "name" = ?',[l,a],n,t)}))}else n()};Fr.transaction((function(u){function f(){var a=new ce("upgradeneeded",{oldVersion:l,newVersion:n});r.__result=_,_.__upgradeTransaction=r.__transaction=r.__result.__versionTransaction=St.__createInstance(r.__result,r.__result.objectStoreNames,"versionchange"),r.__done=!0,r.transaction.__addNonRequestToTransactionQueue((function(e,t,n){if(r.dispatchEvent(a),a.__legacyOutputDidListenersThrowError)return _e("Error","An error occurred in an upgradeneeded handler attached to request chain",a.__legacyOutputDidListenersThrowError),void r.transaction.__abortTransaction(be("AbortError","A request was aborted."));n()})),r.transaction.on__beforecomplete=function(e){_.__upgradeTransaction=null,r.__result.__versionTransaction=null,o(u,!1,(function(){return r.transaction.__transFinishedCb(!1,(function(){e.complete(),r.__transaction=null})),!1}))},r.transaction.on__preabort=function(){_.__upgradeTransaction=null,c&&e in jr&&delete jr[e][n]},r.transaction.on__abort=function(){r.__transaction=null,r.__result=void 0,r.__done=!1,_.close(),setTimeout((function(){var n=be("AbortError","The upgrade transaction was aborted.");o(u,n,(function(r){return 0===l?(kr(t.__openDatabase,e,i,s.bind(null,n),r||s),!1):(s(n),!1)}))}))},r.transaction.on__complete=function(){var e=_.__transactions.indexOf(r.transaction);if(e>-1&&_.__transactions.splice(e,1),r.__result.__closePending)return r.__transaction=null,void s(be("AbortError","The connection has been closed."));d(),r.__transaction=null;var t=ue("success");r.dispatchEvent(t)}}0===l?u.executeSql("INSERT INTO dbVersions VALUES (?,?)",[a,n],f,s):u.executeSql('UPDATE dbVersions SET "version" = ? WHERE "name" = ?',[n,a],f,s)}),s,void 0,(function(e,t,n,r,i){return!(!e.readOnly&&!t&&(o=function(e,t,n){t?r(t,n):i(n)},1))}))})).catch((function(e){throw console.log("Error within `triggerAnyVersionChangeAndBlockedEvents`"),e}));else{d();var p=ue("success");r.dispatchEvent(p)}}),s)}(u,l,o)}j.createIndexes?u.executeSql("CREATE INDEX IF NOT EXISTS sysname ON __sys__(name)",[],f,s):f()}),s)}),s)}return xr(r,e,void 0,(function(){var n;c&&(e in jr||(jr[e]={}),n=Cr(e)),n?l(n):Lr(t.__openDatabase,(function(){Fr.readTransaction((function(e){e.executeSql('SELECT "version" FROM dbVersions WHERE "name" = ?',[a],(function(e,t){0===t.rows.length?l(0):l(t.rows.item(0).version)}),s)}),s)}),s)})),r},Rr.prototype.deleteDatabase=function(e){var t=this;if(!(t instanceof Rr))throw new TypeError("Illegal invocation");if(0===arguments.length)throw new TypeError("Database name is required");if(Tr())throw be("SecurityError","Cannot delete an IndexedDB database from an opaque origin.");var n,r=R(e=String(e));try{n=M(e)}catch(e){throw e}var o="string"==typeof j.memoryDatabase,i=!1!==j.cacheDatabaseInstances||o,a=Oe.__createInstance(),u=!1,c=0,s=function(e,t){t(e)};function l(e,t){if(u||!0===t)return!1;var n=he(t||e);return s(!0,(function(){a.__done=!0,a.__error=n,a.__result=void 0;var e=ue("error",n,{bubbles:!0,cancelable:!0});a.dispatchEvent(e),u=!0})),!1}return xr(a,e,void 0,(function(o){Lr(t.__openDatabase,(function(){function a(){o.__result=void 0,o.__done=!0;var e=new ce("success",{oldVersion:c,newVersion:null});o.dispatchEvent(e)}function u(){s(!1,(function(){i&&e in jr&&delete jr[e],delete t.__connections[e],a()}))}Fr.readTransaction((function(i){i.executeSql('SELECT "version" FROM dbVersions WHERE "name" = ?',[r],(function(i,f){if(0!==f.rows.length){var d=f.rows.item(0);c=d.version,Br(t.__connections[e]||[],o,c,null).then((function(){Fr.transaction((function(o){o.executeSql('DELETE FROM dbVersions WHERE "name" = ? ',[r],(function(){kr(t.__openDatabase,e,n,u,l)}),l)}),l,void 0,(function(e,t,n,r,o){return!(!e.readOnly&&!t)||(s=function(e,t){e?r(e,t):o(t)},!1)}))}),l)}else a()}),l)}))}),l)})),a},Rr.prototype.cmp=function(e,t){if(!(this instanceof Rr))throw new TypeError("Illegal invocation");if(arguments.length<2)throw new TypeError("You must provide two keys to be compared");return Xe(e),Xe(t),je(e,t)},Rr.prototype.databases=function(){var e=this,t=!1;return new Promise((function(n,r){if(!(e instanceof Rr))throw new TypeError("Illegal invocation");if(Tr())throw be("SecurityError","Cannot get IndexedDB database names from an opaque origin.");function o(e,n){if(t)return!1;var o=n?he(n):e;return t=!0,r(o),!1}Lr(e.__openDatabase,(function(){Fr.readTransaction((function(e){e.executeSql('SELECT "name", "version" FROM dbVersions',[],(function(e,t){for(var r=[],o=0;o<t.rows.length;o++){var i=t.rows.item(o),a=i.name,u=i.version;r.push({name:q(a),version:u})}n(r)}),o)}),o)}),o)}))},Rr.prototype.__forceClose=function(e,t,n){var r=this;function o(e){e.__forceClose(n)}if(ae(e))Object.values(r.__connections).forEach((function(e){e.forEach((function(e){o(e)}))}));else if(r.__connections[e])if(ae(t))r.__connections[e].forEach((function(e){o(e)}));else{if(!Number.isInteger(t)||t<0||t>r.__connections[e].length-1)throw new TypeError("If providing an argument, __forceClose must be called with a numeric index to indicate a specific connection to close");o(r.__connections[e][t])}else console.log("No database connections with that name to force close")},Rr.prototype.__setConnectionQueueOrigin=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Sr();Ar[e]={}},Rr.prototype[Symbol.toStringTag]="IDBFactoryPrototype",Object.defineProperty(Rr,"prototype",{writable:!1});var Ur=Rr.__createInstance();function Mr(){throw new TypeError("Illegal constructor")}var Vr=Mr;Mr.__super=function(e,t,n,r,o,i,a){this[Symbol.toStringTag]="IDBCursor",z(this,["key","primaryKey","request"]),lr.__invalidStateIfDeleted(n),this.__indexSource=Q(r,ir),this.__indexSource&&ir.__invalidStateIfDeleted(r),St.__assertActive(n.transaction);var u=bt(e);if(void 0!==t&&!["next","prev","nextunique","prevunique"].includes(t))throw new TypeError(t+"is not a valid cursor direction");Object.defineProperties(this,{source:{writable:!1,value:r},direction:{writable:!1,value:t||"next"}}),this.__key=void 0,this.__primaryKey=void 0,this.__store=n,this.__range=u,this.__request=De.__createInstance(),this.__request.__source=r,this.__request.__transaction=this.__store.transaction,this.__keyColumnName=o,this.__valueColumnName=i,this.__keyOnly="key"===i,this.__valueDecoder=this.__keyOnly?pt:rr,this.__count=a,this.__prefetchedIndex=-1,this.__multiEntryIndex=!!this.__indexSource&&("multiEntry"in r&&r.multiEntry),this.__unique=this.direction.includes("unique"),this.__sqlDirection=["prev","prevunique"].includes(this.direction)?"DESC":"ASC",void 0!==u&&(u.__lowerCached=void 0!==u.lower&&it(u.lower,this.__multiEntryIndex),u.__upperCached=void 0!==u.upper&&it(u.upper,this.__multiEntryIndex)),this.__gotValue=!0,this.continue()},Mr.__createInstance=function(){var e=Vr.__super;e.prototype=Vr.prototype;for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return r(e,n)},Mr.prototype.__find=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if(this.__multiEntryIndex){var r=t[0],o=t[1],i=t[2],a=t[3],u=t[4];this.__findMultiEntry(r,o,i,a,u)}else{var c=t[0],s=t[1],l=t[2],f=t[3],d=t[4],_=t[5];this.__findBasic(c,s,l,f,d,_)}},Mr.prototype.__findBasic=function(e,t,n,r,o,i){var a=void 0!==i;i=i||1;var u=this,c=U(u.__keyColumnName),s=U("key"),l=["SELECT * FROM",V(u.__store.__currentName)],f=[];l.push("WHERE",c,"NOT NULL"),vt(u.__range,c,l,f,!0,!0);var d=u.__sqlDirection,_="ASC"===d?">":"<";void 0!==t&&(l.push("AND",s,_+"= ?"),f.push(it(t))),void 0!==e?(l.push("AND",c,_+"= ?"),f.push(it(e))):a&&void 0!==u.__key&&(l.push("AND",c,_+" ?"),f.push(it(u.__key))),u.__count||(l.push("ORDER BY",c,d),"key"!==u.__keyColumnName&&(u.__unique?"prevunique"===u.direction&&l.push(",",s,"ASC"):l.push(",",s,d)),!u.__unique&&u.__indexSource&&l.push(",",U(u.__valueColumnName),d),l.push("LIMIT",String(i)));var p=l.join(" ");j.DEBUG&&console.log(p,f),n.executeSql(p,f,(function(e,t){u.__count?r(void 0,t.rows.length,void 0):t.rows.length>1?(u.__prefetchedIndex=0,u.__prefetchedData=t.rows,j.DEBUG&&console.log("Preloaded "+u.__prefetchedData.length+" records for cursor"),u.__decode(t.rows.item(0),r)):1===t.rows.length?u.__decode(t.rows.item(0),r):(j.DEBUG&&console.log("Reached end of cursors"),r(void 0,void 0,void 0))}),(function(e,t){return j.DEBUG&&console.log("Could not execute Cursor.continue",p,f),o(t),!1}))};var Kr=/\[/g;function Gr(){throw new TypeError("Illegal constructor")}Mr.prototype.__findMultiEntry=function(e,t,n,r,o){var a=this;if(a.__prefetchedData&&a.__prefetchedData.length===a.__prefetchedIndex)return j.DEBUG&&console.log("Reached end of multiEntry cursor"),void r(void 0,void 0,void 0);var u=U(a.__keyColumnName),c=["SELECT * FROM",V(a.__store.__currentName)],s=[];c.push("WHERE",u,"NOT NULL"),a.__range&&void 0!==a.__range.lower&&Array.isArray(a.__range.upper)&&0===a.__range.upper.indexOf(a.__range.lower)&&(c.push("AND",u,"LIKE ? ESCAPE '^'"),s.push("%"+H(a.__range.__lowerCached.slice(0,-1))+"%"));var l=a.__sqlDirection,f="ASC"===l?">":"<",d=U("key");void 0!==t&&(c.push("AND",d,f+"= ?"),s.push(it(t))),void 0!==e?(c.push("AND",u,f+"= ?"),s.push(it(e))):void 0!==a.__key&&(c.push("AND",u,f+" ?"),s.push(it(a.__key))),a.__count||(c.push("ORDER BY",u,l),a.__unique||"key"===a.__keyColumnName||c.push(",",U("key"),l),!a.__unique&&a.__indexSource&&c.push(",",U(a.__valueColumnName),l));var _=c.join(" ");j.DEBUG&&console.log(_,s),n.executeSql(_,s,(function(e,t){if(t.rows.length>0){if(a.__count){for(var n=0,o=0;o<t.rows.length;o++){n+=ot(at(t.rows.item(o)[a.__keyColumnName],!0),a.__range).length}return void r(void 0,n,void 0)}for(var u=[],c=0;c<t.rows.length;c++){var s,l=t.rows.item(c),f=i(ot(at(l[a.__keyColumnName],!0),a.__range));try{for(f.s();!(s=f.n()).done;){var d={matchingKey:it(s.value,!0),key:l.key};d[a.__keyColumnName]=l[a.__keyColumnName],d[a.__valueColumnName]=l[a.__valueColumnName],u.push(d)}}catch(e){f.e(e)}finally{f.f()}}var _=0===a.direction.indexOf("prev");u.sort((function(e,t){return e.matchingKey.replaceAll(Kr,"z")<t.matchingKey.replaceAll(Kr,"z")?_?1:-1:e.matchingKey.replaceAll(Kr,"z")>t.matchingKey.replaceAll(Kr,"z")?_?-1:1:e.key<t.key?"prev"===a.direction?1:-1:e.key>t.key?"prev"===a.direction?-1:1:0})),u.length>1?(a.__prefetchedIndex=0,a.__prefetchedData={data:u,length:u.length,item:function(e){return this.data[e]}},j.DEBUG&&console.log("Preloaded "+a.__prefetchedData.length+" records for multiEntry cursor"),a.__decode(u[0],r)):1===u.length?(j.DEBUG&&console.log("Reached end of multiEntry cursor"),a.__decode(u[0],r)):(j.DEBUG&&console.log("Reached end of multiEntry cursor"),r(void 0,void 0,void 0))}else j.DEBUG&&console.log("Reached end of multiEntry cursor"),r(void 0,void 0,void 0)}),(function(e,t){return j.DEBUG&&console.log("Could not execute Cursor.continue",_,s),o(t),!1}))},Mr.prototype.__onsuccess=function(e){var t=this;return function(n,r,o){t.__count?e(r,t.__request):(void 0!==n&&(t.__gotValue=!0),t.__key=void 0===n?null:n,t.__primaryKey=void 0===o?null:o,t.__value=void 0===r?null:r,e(void 0===n?null:t,t.__request))}},Mr.prototype.__decode=function(e,t){var n=this;if(n.__multiEntryIndex&&n.__unique){if(n.__matchedKeys||(n.__matchedKeys={}),n.__matchedKeys[e.matchingKey])return void t(void 0,void 0,void 0);n.__matchedKeys[e.matchingKey]=!0}var r=q(n.__multiEntryIndex?e.matchingKey:e[n.__keyColumnName]),o=q(e[n.__valueColumnName]),i=q(e.key);t(at(r,n.__multiEntryIndex),n.__valueDecoder.decode(o),at(i),r)},Mr.prototype.__sourceOrEffectiveObjStoreDeleted=function(){lr.__invalidStateIfDeleted(this.__store,"The cursor's effective object store has been deleted"),this.__indexSource&&ir.__invalidStateIfDeleted(this.source,"The cursor's index source has been deleted")},Mr.prototype.__invalidateCache=function(){this.__prefetchedData=null},Mr.prototype.__continue=function(e,t){var n=this,r=void 0!==n.__advanceCount;if(St.__assertActive(n.__store.transaction),n.__sourceOrEffectiveObjStoreDeleted(),!n.__gotValue&&!t)throw be("InvalidStateError","The cursor is being iterated or has iterated past its end.");if(void 0!==e){Xe(e);var o=je(e,n.key);if(0===o||n.direction.includes("next")&&-1===o||n.direction.includes("prev")&&1===o)throw be("DataError","Cannot "+(r?"advance":"continue")+" the cursor in an unexpected direction")}this.__continueFinish(e,void 0,r)},Mr.prototype.__continueFinish=function(e,t,n){var r=this,o=r.__advanceCount||j.cursorPreloadPackSize||100;r.__gotValue=!1,r.__request.__done=!1,r.__store.transaction.__pushToQueue(r.__request,(function i(a,u,c,s,l){function f(e,t,o){if(n){if(r.__advanceCount&&r.__advanceCount>=2&&void 0!==e)return r.__advanceCount--,r.__key=e,r.__continue(void 0,!0),void l();r.__advanceCount=void 0}r.__onsuccess(c)(e,t,o)}r.__prefetchedData&&(r.__prefetchedIndex++,r.__prefetchedIndex<r.__prefetchedData.length)?r.__decode(r.__prefetchedData.item(r.__prefetchedIndex),(function(n,o,l,d){var _;!r.__unique||r.__multiEntryIndex||d!==it(r.key,r.__multiEntryIndex)?(_=Number(void 0===e)||je(n,e))>0||0===_&&(r.__unique||void 0===t||je(l,t)>=0)?f(n,o,l):i(a,u,c,s):i(a,u,c,s)})):r.__find(e,t,a,f,(function(){r.__advanceCount=void 0;for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var o=t[0],i=t[1];s(o,i)}),o)}))},Mr.prototype.continue=function(){this.__continue(arguments[0])},Mr.prototype.continuePrimaryKey=function(e,t){var n=this;if(St.__assertActive(n.__store.transaction),n.__sourceOrEffectiveObjStoreDeleted(),!n.__indexSource)throw be("InvalidAccessError","`continuePrimaryKey` may only be called on an index source.");if(!["next","prev"].includes(n.direction))throw be("InvalidAccessError","`continuePrimaryKey` may not be called with unique cursors.");if(!n.__gotValue)throw be("InvalidStateError","The cursor is being iterated or has iterated past its end.");Xe(e),Xe(t);var r=je(e,n.key);if("next"===n.direction&&-1===r||"prev"===n.direction&&1===r)throw be("DataError","Cannot continue the cursor in an unexpected direction");function o(){n.__continueFinish(e,t,!1)}0===r?er(t,(function(e){er(n.primaryKey,(function(t){if(e===t||"next"===n.direction&&e<t||"prev"===n.direction&&e>t)throw be("DataError","Cannot continue the cursor in an unexpected direction");o()}))})):o()},Mr.prototype.advance=function(e){var t=this;if(0===(e=ne(e,"unsigned long")))throw new TypeError("Calling advance() with count argument 0");t.__gotValue&&(t.__advanceCount=e),t.__continue()},Mr.prototype.update=function(e){var t=this;if(!arguments.length)throw new TypeError("A value must be passed to update()");if(St.__assertActive(t.__store.transaction),t.__store.transaction.__assertWritable(),t.__sourceOrEffectiveObjStoreDeleted(),!t.__gotValue)throw be("InvalidStateError","The cursor is being iterated or has iterated past its end.");if(t.__keyOnly)throw be("InvalidStateError","This cursor method cannot be called when the key only flag has been set.");var n=t.__store.transaction.__createRequest(t),r=t.primaryKey;function o(e){lr.__storingRecordObjectStore(n,t.__store,!1,e,!1,r)}if(null!==t.__store.keyPath){var i=d(t.__store.__validateKeyAndValueAndCloneValue(e,void 0,!0),2),a=i[0],u=i[1];if(0!==je(t.primaryKey,a))throw be("DataError","The key of the supplied value to `update` is not equal to the cursor's effective key");o(u)}else{o(nr(e))}return n},Mr.prototype.delete=function(){var e=this;if(St.__assertActive(e.__store.transaction),e.__store.transaction.__assertWritable(),e.__sourceOrEffectiveObjStoreDeleted(),!e.__gotValue)throw be("InvalidStateError","The cursor is being iterated or has iterated past its end.");if(e.__keyOnly)throw be("InvalidStateError","This cursor method cannot be called when the key only flag has been set.");return this.__store.transaction.__addToTransactionQueue((function(t,n,r,o){e.__find(void 0,void 0,t,(function(n,i,a){var u="DELETE FROM "+V(e.__store.__currentName)+' WHERE "key" = ?';j.DEBUG&&console.log(u,n,a),t.executeSql(u,[R(it(a))],(function(e,t){1===t.rowsAffected?r(void 0):o("No rows with key found"+n)}),(function(e,t){return o(t),!1}))}),o)}),void 0,e)},Mr.prototype[Symbol.toStringTag]="IDBCursorPrototype",J(Mr.prototype,["source","direction","key","primaryKey","request"]),Object.defineProperty(Mr,"prototype",{writable:!1}),Gr.prototype=Object.create(Mr.prototype),Object.defineProperty(Gr.prototype,"constructor",{enumerable:!1,writable:!0,configurable:!0,value:Gr});var Hr=Gr;function Qr(e,t){if(e&&"object"===h(e))Object.entries(e).forEach((function(e){var t=d(e,2);Qr(t[0],t[1])}));else{if(!(e in j))throw new Error(e+" is not a valid configuration property");j[e]=t,"registerSCA"===e&&"function"==typeof t&&Zn(t)}}Gr.__createInstance=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];function r(){var e=t[0],n=t[1],r=t[2],o=t[3],i=t[4],a=t[5],u=t[6];Mr.__super.call(this,e,n,r,o,i,a,u),this[Symbol.toStringTag]="IDBCursorWithValue",z(this,"value")}return r.prototype=Hr.prototype,new r},J(Gr.prototype,["value"]),Gr.prototype[Symbol.toStringTag]="IDBCursorWithValuePrototype",Object.defineProperty(Gr,"prototype",{writable:!1}),j.win="undefined"!=typeof window?window:self,function(){var e=globalThis||{};function t(t,n,r){if(!r||!Object.defineProperty)try{e[t]=n}catch(e){console.log(e)}if(e[t]!==n&&Object.defineProperty)try{var o=r||{};if("get"in o){var i=a("get",{},t,(function(){return r.get.call(this)}));o=Object.getOwnPropertyDescriptor(i,t)}else"value"in o||(o.value=n),"writable"in o||(o.writable=!0);Object.defineProperty(e,t,o)}catch(e){}e[t]!==n&&"undefined"!=typeof console&&console.warn&&console.warn("Unable to shim "+t)}void 0!==j.win.openDatabase&&t("shimIndexedDB",Ur,{enumerable:!1,configurable:!0}),"shimIndexedDB"in e&&e.shimIndexedDB?(e.shimIndexedDB.__useShim=function(){function n(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";t(e+"DOMException",ge),t(e+"DOMStringList",Et,{enumerable:!1,configurable:!0,writable:!0,value:Et}),t(e+"Event",O,{configurable:!0,writable:!0,value:O,enumerable:!1}),t(e+"CustomEvent",S,{configurable:!0,writable:!0,value:S,enumerable:!1}),t(e+"EventTarget",N,{configurable:!0,writable:!0,value:N,enumerable:!1})}var r,o=Rr;if(void 0!==j.win.openDatabase){if(Ur.__openDatabase=j.win.openDatabase.bind(j.win),t("indexedDB",Ur,{enumerable:!0,configurable:!0,get:function(){if(this!==e&&!ae(this)&&!this.shimNS)throw new TypeError("Illegal invocation");return Ur}}),[["IDBFactory",o],["IDBDatabase",Dr],["IDBObjectStore",lr],["IDBIndex",ir],["IDBTransaction",St],["IDBCursor",Mr],["IDBCursorWithValue",Gr],["IDBKeyRange",ht],["IDBRequest",De],["IDBOpenDBRequest",Oe],["IDBVersionChangeEvent",ce]].forEach((function(e){var n=d(e,2);t(n[0],n[1],{enumerable:!1,configurable:!0})})),j.fs&&(r=j.fs,Ir=r),j.fullIDLSupport&&(Object.setPrototypeOf(e.IDBOpenDBRequest,e.IDBRequest),Object.setPrototypeOf(e.IDBCursorWithValue,e.IDBCursor),Object.setPrototypeOf(Dr,N),Object.setPrototypeOf(De,N),Object.setPrototypeOf(St,N),Object.setPrototypeOf(ce,O),Object.setPrototypeOf(ge,Error),Object.setPrototypeOf(ge.prototype,Error.prototype),Object.setPrototypeOf(S,O),Object.setPrototypeOf(S.prototype,O.prototype)),e.indexedDB&&!e.indexedDB.toString().includes("[native code]")&&(j.addNonIDBGlobals&&n("Shim"),j.replaceNonIDBGlobals&&n()),!e.shimIndexedDB)return;e.shimIndexedDB.__setConnectionQueueOrigin()}},e.shimIndexedDB.__debug=function(e){j.DEBUG=e},e.shimIndexedDB.__setConfig=Qr,e.shimIndexedDB.__getConfig=function(e){if(!(e in j))throw new Error(e+" is not a valid configuration property");return j[e]},e.shimIndexedDB.__setUnicodeIdentifiers=function(e){Qr({UnicodeIDStart:e.UnicodeIDStart,UnicodeIDContinue:e.UnicodeIDContinue})}):(e.shimIndexedDB={},["__useShim","__debug","__setConfig","__getConfig","__setUnicodeIdentifiers"].forEach((function(t){e.shimIndexedDB[t]=function(){console.warn("This browser does not have WebSQL to shim.")}}))),"indexedDB"in e||"undefined"==typeof window||(e.indexedDB=e.indexedDB||"webkitIndexedDB"in e&&e.webkitIndexedDB||"mozIndexedDB"in e&&e.mozIndexedDB||"oIndexedDB"in e&&e.oIndexedDB||"msIndexedDB"in e&&e.msIndexedDB);var n=!1;"undefined"!=typeof navigator&&navigator.userAgent&&(/Android (?:2|3|4\.[0-3])/.test(navigator.userAgent)&&!navigator.userAgent.includes("Chrome")||(!navigator.userAgent.includes("Safari")||navigator.userAgent.includes("Chrome"))&&/(iPad|iPhone|iPod)(?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])* o[s\u017F] 9_/i.test(navigator.userAgent)&&"undefined"!=typeof window&&!("MSStream"in window))&&(n=!0),j.DEFAULT_DB_SIZE||(j.DEFAULT_DB_SIZE=1024*("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.includes("Safari")&&!navigator.userAgent.includes("Chrome")?25:4)*1024),j.avoidAutoShim||e.indexedDB&&!n||void 0===j.win.openDatabase?(e.IDBDatabase=e.IDBDatabase||"webkitIDBDatabase"in e&&e.webkitIDBDatabase,e.IDBTransaction=e.IDBTransaction||"webkitIDBTransaction"in e&&e.webkitIDBTransaction||{},e.IDBCursor=e.IDBCursor||"webkitIDBCursor"in e&&e.webkitIDBCursor,e.IDBKeyRange=e.IDBKeyRange||"webkitIDBKeyRange"in e&&e.webkitIDBKeyRange):e.shimIndexedDB.__useShim()}()}));
//# sourceMappingURL=indexeddbshim.min.js.map