rakis / _next /static /chunks /141-3a9c8eec94898f8e.js
hrishioa's picture
Upload 74 files
a1de0a7 verified
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[141],{53185:function(e,t,n){var r;r=function(){"use strict";var e=function(t,n){return(e=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(t,n)},t=function(){return(t=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function r(e,t,n){if(n||2==arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||((r=r||Array.prototype.slice.call(t,0,i))[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}var i="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:n.g,o=Object.keys,u=Array.isArray;function a(e,t){return"object"!=typeof t||o(t).forEach(function(n){e[n]=t[n]}),e}"undefined"==typeof Promise||i.Promise||(i.Promise=Promise);var s=Object.getPrototypeOf,c={}.hasOwnProperty;function l(e,t){return c.call(e,t)}function f(e,t){"function"==typeof t&&(t=t(s(e))),("undefined"==typeof Reflect?o:Reflect.ownKeys)(t).forEach(function(n){d(e,n,t[n])})}var h=Object.defineProperty;function d(e,t,n,r){h(e,t,a(n&&l(n,"get")&&"function"==typeof n.get?{get:n.get,set:n.set,configurable:!0}:{value:n,configurable:!0,writable:!0},r))}function p(e){return{from:function(t){return e.prototype=Object.create(t.prototype),d(e.prototype,"constructor",e),{extend:f.bind(null,e.prototype)}}}}var y=Object.getOwnPropertyDescriptor,v=[].slice;function m(e,t,n){return v.call(e,t,n)}function b(e,t){return t(e)}function g(e){if(!e)throw Error("Assertion Failed")}function w(e){i.setImmediate?setImmediate(e):setTimeout(e,0)}function _(e,t){if("string"==typeof t&&l(e,t))return e[t];if(!t)return e;if("string"!=typeof t){for(var n=[],r=0,i=t.length;r<i;++r){var o=_(e,t[r]);n.push(o)}return n}var u=t.indexOf(".");if(-1!==u){var a=e[t.substr(0,u)];return null==a?void 0:_(a,t.substr(u+1))}}function x(e,t,n){if(e&&void 0!==t&&!("isFrozen"in Object&&Object.isFrozen(e))){if("string"!=typeof t&&"length"in t){g("string"!=typeof n&&"length"in n);for(var r=0,i=t.length;r<i;++r)x(e,t[r],n[r])}else{var o,a,s=t.indexOf(".");-1!==s?(o=t.substr(0,s),""===(a=t.substr(s+1))?void 0===n?u(e)&&!isNaN(parseInt(o))?e.splice(o,1):delete e[o]:e[o]=n:x(s=(s=e[o])&&l(e,o)?s:e[o]={},a,n)):void 0===n?u(e)&&!isNaN(parseInt(t))?e.splice(t,1):delete e[t]:e[t]=n}}}function k(e){var t,n={};for(t in e)l(e,t)&&(n[t]=e[t]);return n}var O=[].concat;function E(e){return O.apply([],e)}var P="BigUint64Array,BigInt64Array,Array,Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,FileSystemDirectoryHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(E([8,16,32,64].map(function(e){return["Int","Uint","Float"].map(function(t){return t+e+"Array"})}))).filter(function(e){return i[e]}),A=new Set(P.map(function(e){return i[e]})),S=null;function j(e){return S=new WeakMap,e=function e(t){if(!t||"object"!=typeof t)return t;var n=S.get(t);if(n)return n;if(u(t)){n=[],S.set(t,n);for(var r=0,i=t.length;r<i;++r)n.push(e(t[r]))}else if(A.has(t.constructor))n=t;else{var o,a=s(t);for(o in n=a===Object.prototype?{}:Object.create(a),S.set(t,n),t)l(t,o)&&(n[o]=e(t[o]))}return n}(e),S=null,e}var K={}.toString;function C(e){return K.call(e).slice(8,-1)}var I="undefined"!=typeof Symbol?Symbol.iterator:"@@iterator",B="symbol"==typeof I?function(e){var t;return null!=e&&(t=e[I])&&t.apply(e)}:function(){return null};function T(e,t){return 0<=(t=e.indexOf(t))&&e.splice(t,1),0<=t}var q={};function R(e){var t,n,r,i;if(1==arguments.length){if(u(e))return e.slice();if(this===q&&"string"==typeof e)return[e];if(i=B(e)){for(n=[];!(r=i.next()).done;)n.push(r.value);return n}if(null==e||"number"!=typeof(t=e.length))return[e];for(n=Array(t);t--;)n[t]=e[t];return n}for(t=arguments.length,n=Array(t);t--;)n[t]=arguments[t];return n}var D="undefined"!=typeof Symbol?function(e){return"AsyncFunction"===e[Symbol.toStringTag]}:function(){return!1},N=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],M=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(N),F={VersionChanged:"Database version changed by other database connection",DatabaseClosed:"Database has been closed",Abort:"Transaction aborted",TransactionInactive:"Transaction has already completed or failed",MissingAPI:"IndexedDB API missing. Please visit https://tinyurl.com/y2uuvskb"};function $(e,t){this.name=e,this.message=t}function z(e,t){return e+". Errors: "+Object.keys(t).map(function(e){return t[e].toString()}).filter(function(e,t,n){return n.indexOf(e)===t}).join("\n")}function U(e,t,n,r){this.failures=t,this.failedKeys=r,this.successCount=n,this.message=z(e,t)}function L(e,t){this.name="BulkError",this.failures=Object.keys(t).map(function(e){return t[e]}),this.failuresByPos=t,this.message=z(e,this.failures)}p($).from(Error).extend({toString:function(){return this.name+": "+this.message}}),p(U).from($),p(L).from($);var V=M.reduce(function(e,t){return e[t]=t+"Error",e},{}),G=M.reduce(function(e,t){var n=t+"Error";function r(e,r){this.name=n,e?"string"==typeof e?(this.message="".concat(e).concat(r?"\n "+r:""),this.inner=r||null):"object"==typeof e&&(this.message="".concat(e.name," ").concat(e.message),this.inner=e):(this.message=F[t]||n,this.inner=null)}return p(r).from($),e[t]=r,e},{});G.Syntax=SyntaxError,G.Type=TypeError,G.Range=RangeError;var W=N.reduce(function(e,t){return e[t+"Error"]=G[t],e},{}),Y=M.reduce(function(e,t){return -1===["Syntax","Type","Range"].indexOf(t)&&(e[t+"Error"]=G[t]),e},{});function X(){}function H(e){return e}function Q(e,t){return null==e||e===H?t:function(n){return t(e(n))}}function J(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function Z(e,t){return e===X?t:function(){var n=e.apply(this,arguments);void 0!==n&&(arguments[0]=n);var r=this.onsuccess,i=this.onerror;this.onsuccess=null,this.onerror=null;var o=t.apply(this,arguments);return r&&(this.onsuccess=this.onsuccess?J(r,this.onsuccess):r),i&&(this.onerror=this.onerror?J(i,this.onerror):i),void 0!==o?o:n}}function ee(e,t){return e===X?t:function(){e.apply(this,arguments);var n=this.onsuccess,r=this.onerror;this.onsuccess=this.onerror=null,t.apply(this,arguments),n&&(this.onsuccess=this.onsuccess?J(n,this.onsuccess):n),r&&(this.onerror=this.onerror?J(r,this.onerror):r)}}function et(e,t){return e===X?t:function(n){var r=e.apply(this,arguments);a(n,r);var i=this.onsuccess,o=this.onerror;return this.onsuccess=null,this.onerror=null,n=t.apply(this,arguments),i&&(this.onsuccess=this.onsuccess?J(i,this.onsuccess):i),o&&(this.onerror=this.onerror?J(o,this.onerror):o),void 0===r?void 0===n?void 0:n:a(r,n)}}function en(e,t){return e===X?t:function(){return!1!==t.apply(this,arguments)&&e.apply(this,arguments)}}function er(e,t){return e===X?t:function(){var n=e.apply(this,arguments);if(n&&"function"==typeof n.then){for(var r=this,i=arguments.length,o=Array(i);i--;)o[i]=arguments[i];return n.then(function(){return t.apply(r,o)})}return t.apply(this,arguments)}}Y.ModifyError=U,Y.DexieError=$,Y.BulkError=L;var ei="undefined"!=typeof location&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href),eo={},P="undefined"==typeof Promise?[]:function(){var e=Promise.resolve();if("undefined"==typeof crypto||!crypto.subtle)return[e,s(e),e];var t=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[t,s(t),e]}(),N=P[0],M=P[1],P=P[2],M=M&&M.then,eu=N&&N.constructor,ea=!!P,es=function(e,t){ev.push([e,t]),el&&(queueMicrotask(eP),el=!1)},ec=!0,el=!0,ef=[],eh=[],ed=H,ep={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:X,pgp:!1,env:{},finalize:X},ey=ep,ev=[],em=0,eb=[];function eg(e){if("object"!=typeof this)throw TypeError("Promises must be constructed via new");this._listeners=[],this._lib=!1;var t=this._PSD=ey;if("function"!=typeof e){if(e!==eo)throw TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(!1===this._state&&ex(this,this._value))}this._state=null,this._value=null,++t.ref,function e(t,n){try{n(function(n){if(null===t._state){if(n===t)throw TypeError("A promise cannot be resolved with itself.");var r=t._lib&&eA();n&&"function"==typeof n.then?e(t,function(e,t){n instanceof eg?n._then(e,t):n.then(e,t)}):(t._state=!0,t._value=n,ek(t)),r&&eS()}},ex.bind(null,t))}catch(e){ex(t,e)}}(this,e)}var ew={get:function(){var e=ey,t=eR;function n(n,r){var i=this,o=!e.global&&(e!==ey||t!==eR),u=o&&!eF(),a=new eg(function(t,a){eO(i,new e_(eG(n,e,o,u),eG(r,e,o,u),t,a,e))});return this._consoleTask&&(a._consoleTask=this._consoleTask),a}return n.prototype=eo,n},set:function(e){d(this,"then",e&&e.prototype===eo?ew:{get:function(){return e},set:ew.set})}};function e_(e,t,n,r,i){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.resolve=n,this.reject=r,this.psd=i}function ex(e,t){var n;eh.push(t),null===e._state&&(n=e._lib&&eA(),t=ed(t),e._state=!1,e._value=t,ef.some(function(t){return t._value===e._value})||ef.push(e),ek(e),n&&eS())}function ek(e){var t=e._listeners;e._listeners=[];for(var n=0,r=t.length;n<r;++n)eO(e,t[n]);var i=e._PSD;--i.ref||i.finalize(),0===em&&(++em,es(function(){0==--em&&ej()},[]))}function eO(e,t){if(null!==e._state){var n=e._state?t.onFulfilled:t.onRejected;if(null===n)return(e._state?t.resolve:t.reject)(e._value);++t.psd.ref,++em,es(eE,[n,e,t])}else e._listeners.push(t)}function eE(e,t,n){try{var r,i=t._value;!t._state&&eh.length&&(eh=[]),r=ei&&t._consoleTask?t._consoleTask.run(function(){return e(i)}):e(i),t._state||-1!==eh.indexOf(i)||function(e){for(var t=ef.length;t;)if(ef[--t]._value===e._value)return ef.splice(t,1)}(t),n.resolve(r)}catch(e){n.reject(e)}finally{0==--em&&ej(),--n.psd.ref||n.psd.finalize()}}function eP(){eV(ep,function(){eA()&&eS()})}function eA(){var e=ec;return el=ec=!1,e}function eS(){var e,t,n;do for(;0<ev.length;)for(e=ev,ev=[],n=e.length,t=0;t<n;++t){var r=e[t];r[0].apply(null,r[1])}while(0<ev.length);el=ec=!0}function ej(){var e=ef;ef=[],e.forEach(function(e){e._PSD.onunhandled.call(null,e._value,e)});for(var t=eb.slice(0),n=t.length;n;)t[--n]()}function eK(e){return new eg(eo,!1,e)}function eC(e,t){var n=ey;return function(){var r=eA(),i=ey;try{return eU(n,!0),e.apply(this,arguments)}catch(e){t&&t(e)}finally{eU(i,!1),r&&eS()}}}f(eg.prototype,{then:ew,_then:function(e,t){eO(this,new e_(null,null,e,t,ey))},catch:function(e){if(1==arguments.length)return this.then(null,e);var t=arguments[1];return"function"==typeof e?this.then(null,function(n){return(n instanceof e?t:eK)(n)}):this.then(null,function(n){return(n&&n.name===e?t:eK)(n)})},finally:function(e){return this.then(function(t){return eg.resolve(e()).then(function(){return t})},function(t){return eg.resolve(e()).then(function(){return eK(t)})})},timeout:function(e,t){var n=this;return e<1/0?new eg(function(r,i){var o=setTimeout(function(){return i(new G.Timeout(t))},e);n.then(r,i).finally(clearTimeout.bind(null,o))}):this}}),"undefined"!=typeof Symbol&&Symbol.toStringTag&&d(eg.prototype,Symbol.toStringTag,"Dexie.Promise"),ep.env=eL(),f(eg,{all:function(){var e=R.apply(null,arguments).map(e$);return new eg(function(t,n){0===e.length&&t([]);var r=e.length;e.forEach(function(i,o){return eg.resolve(i).then(function(n){e[o]=n,--r||t(e)},n)})})},resolve:function(e){return e instanceof eg?e:e&&"function"==typeof e.then?new eg(function(t,n){e.then(t,n)}):new eg(eo,!0,e)},reject:eK,race:function(){var e=R.apply(null,arguments).map(e$);return new eg(function(t,n){e.map(function(e){return eg.resolve(e).then(t,n)})})},PSD:{get:function(){return ey},set:function(e){return ey=e}},totalEchoes:{get:function(){return eR}},newPSD:eN,usePSD:eV,scheduler:{get:function(){return es},set:function(e){es=e}},rejectionMapper:{get:function(){return ed},set:function(e){ed=e}},follow:function(e,t){return new eg(function(n,r){return eN(function(t,n){var r=ey;r.unhandleds=[],r.onunhandled=n,r.finalize=J(function(){var e,r=this;e=function(){0===r.unhandleds.length?t():n(r.unhandleds[0])},eb.push(function t(){e(),eb.splice(eb.indexOf(t),1)}),++em,es(function(){0==--em&&ej()},[])},r.finalize),e()},t,n,r)})}}),eu&&(eu.allSettled&&d(eg,"allSettled",function(){var e=R.apply(null,arguments).map(e$);return new eg(function(t){0===e.length&&t([]);var n=e.length,r=Array(n);e.forEach(function(e,i){return eg.resolve(e).then(function(e){return r[i]={status:"fulfilled",value:e}},function(e){return r[i]={status:"rejected",reason:e}}).then(function(){return--n||t(r)})})})}),eu.any&&"undefined"!=typeof AggregateError&&d(eg,"any",function(){var e=R.apply(null,arguments).map(e$);return new eg(function(t,n){0===e.length&&n(AggregateError([]));var r=e.length,i=Array(r);e.forEach(function(e,o){return eg.resolve(e).then(function(e){return t(e)},function(e){i[o]=e,--r||n(AggregateError(i))})})})}));var eI={awaits:0,echoes:0,id:0},eB=0,eT=[],eq=0,eR=0,eD=0;function eN(e,t,n,r){var i=ey,o=Object.create(i);return o.parent=i,o.ref=0,o.global=!1,o.id=++eD,ep.env,o.env=ea?{Promise:eg,PromiseProp:{value:eg,configurable:!0,writable:!0},all:eg.all,race:eg.race,allSettled:eg.allSettled,any:eg.any,resolve:eg.resolve,reject:eg.reject}:{},t&&a(o,t),++i.ref,o.finalize=function(){--this.parent.ref||this.parent.finalize()},r=eV(o,e,n,r),0===o.ref&&o.finalize(),r}function eM(){return eI.id||(eI.id=++eB),++eI.awaits,eI.echoes+=100,eI.id}function eF(){return!!eI.awaits&&(0==--eI.awaits&&(eI.id=0),eI.echoes=100*eI.awaits,!0)}function e$(e){return eI.echoes&&e&&e.constructor===eu?(eM(),e.then(function(e){return eF(),e},function(e){return eF(),eY(e)})):e}function ez(){var e=eT[eT.length-1];eT.pop(),eU(e,!1)}function eU(e,t){var n,r=ey;(t?!eI.echoes||eq++&&e===ey:!eq||--eq&&e===ey)||queueMicrotask(t?(function(e){++eR,eI.echoes&&0!=--eI.echoes||(eI.echoes=eI.awaits=eI.id=0),eT.push(ey),eU(e,!0)}).bind(null,e):ez),e!==ey&&(ey=e,r===ep&&(ep.env=eL()),ea&&(n=ep.env.Promise,t=e.env,(r.global||e.global)&&(Object.defineProperty(i,"Promise",t.PromiseProp),n.all=t.all,n.race=t.race,n.resolve=t.resolve,n.reject=t.reject,t.allSettled&&(n.allSettled=t.allSettled),t.any&&(n.any=t.any))))}function eL(){var e=i.Promise;return ea?{Promise:e,PromiseProp:Object.getOwnPropertyDescriptor(i,"Promise"),all:e.all,race:e.race,allSettled:e.allSettled,any:e.any,resolve:e.resolve,reject:e.reject}:{}}function eV(e,t,n,r,i){var o=ey;try{return eU(e,!0),t(n,r,i)}finally{eU(o,!1)}}function eG(e,t,n,r){return"function"!=typeof e?e:function(){var i=ey;n&&eM(),eU(t,!0);try{return e.apply(this,arguments)}finally{eU(i,!1),r&&queueMicrotask(eF)}}}function eW(e){Promise===eu&&0===eI.echoes?0===eq?e():enqueueNativeMicroTask(e):setTimeout(e,0)}-1===(""+M).indexOf("[native code]")&&(eM=eF=X);var eY=eg.reject,eX=String.fromCharCode(65535),eH="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",eQ="String expected.",eJ=[],eZ="__dbnames",e0="readonly",e1="readwrite";function e6(e,t){return e?t?function(){return e.apply(this,arguments)&&t.apply(this,arguments)}:e:t}var e2={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function e3(e){return"string"!=typeof e||/\./.test(e)?function(e){return e}:function(t){return void 0===t[e]&&e in t&&delete(t=j(t))[e],t}}function e8(){throw G.Type()}function e4(e,t){try{var n=e5(e),r=e5(t);if(n!==r)return"Array"===n?1:"Array"===r?-1:"binary"===n?1:"binary"===r?-1:"string"===n?1:"string"===r?-1:"Date"===n?1:"Date"!==r?NaN:-1;switch(n){case"number":case"Date":case"string":return t<e?1:e<t?-1:0;case"binary":return function(e,t){for(var n=e.length,r=t.length,i=n<r?n:r,o=0;o<i;++o)if(e[o]!==t[o])return e[o]<t[o]?-1:1;return n===r?0:n<r?-1:1}(e9(e),e9(t));case"Array":return function(e,t){for(var n=e.length,r=t.length,i=n<r?n:r,o=0;o<i;++o){var u=e4(e[o],t[o]);if(0!==u)return u}return n===r?0:n<r?-1:1}(e,t)}}catch(e){}return NaN}function e5(e){var t=typeof e;return"object"!=t?t:ArrayBuffer.isView(e)?"binary":"ArrayBuffer"===(e=C(e))?"binary":e}function e9(e){return e instanceof Uint8Array?e:ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(e)}var e7=(te.prototype._trans=function(e,t,n){var r=this._tx||ey.trans,i=this.name,o=ei&&"undefined"!=typeof console&&console.createTask&&console.createTask("Dexie: ".concat("readonly"===e?"read":"write"," ").concat(this.name));function u(e,n,r){if(!r.schema[i])throw new G.NotFound("Table "+i+" not part of transaction");return t(r.idbtrans,r)}var a=eA();try{var s=r&&r.db._novip===this.db._novip?r===ey.trans?r._promise(e,u,n):eN(function(){return r._promise(e,u,n)},{trans:r,transless:ey.transless||ey}):function e(t,n,r,i){if(t.idbdb&&(t._state.openComplete||ey.letThrough||t._vip)){var o=t._createTransaction(n,r,t._dbSchema);try{o.create(),t._state.PR1398_maxLoop=3}catch(o){return o.name===V.InvalidState&&t.isOpen()&&0<--t._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),t.close({disableAutoOpen:!1}),t.open().then(function(){return e(t,n,r,i)})):eY(o)}return o._promise(n,function(e,t){return eN(function(){return ey.trans=o,i(e,t,o)})}).then(function(e){if("readwrite"===n)try{o.idbtrans.commit()}catch(e){}return"readonly"===n?e:o._completion.then(function(){return e})})}if(t._state.openComplete)return eY(new G.DatabaseClosed(t._state.dbOpenError));if(!t._state.isBeingOpened){if(!t._state.autoOpen)return eY(new G.DatabaseClosed);t.open().catch(X)}return t._state.dbReadyPromise.then(function(){return e(t,n,r,i)})}(this.db,e,[this.name],u);return o&&(s._consoleTask=o,s=s.catch(function(e){return console.trace(e),eY(e)})),s}finally{a&&eS()}},te.prototype.get=function(e,t){var n=this;return e&&e.constructor===Object?this.where(e).first(t):null==e?eY(new G.Type("Invalid argument to Table.get()")):this._trans("readonly",function(t){return n.core.get({trans:t,key:e}).then(function(e){return n.hook.reading.fire(e)})}).then(t)},te.prototype.where=function(e){if("string"==typeof e)return new this.db.WhereClause(this,e);if(u(e))return new this.db.WhereClause(this,"[".concat(e.join("+"),"]"));var t=o(e);if(1===t.length)return this.where(t[0]).equals(e[t[0]]);var n=this.schema.indexes.concat(this.schema.primKey).filter(function(e){if(e.compound&&t.every(function(t){return 0<=e.keyPath.indexOf(t)})){for(var n=0;n<t.length;++n)if(-1===t.indexOf(e.keyPath[n]))return!1;return!0}return!1}).sort(function(e,t){return e.keyPath.length-t.keyPath.length})[0];if(n&&this.db._maxKey!==eX){var r=n.keyPath.slice(0,t.length);return this.where(r).equals(r.map(function(t){return e[t]}))}!n&&ei&&console.warn("The query ".concat(JSON.stringify(e)," on ").concat(this.name," would benefit from a ")+"compound index [".concat(t.join("+"),"]"));var i=this.schema.idxByName,a=this.db._deps.indexedDB;function s(e,t){return 0===a.cmp(e,t)}var c=t.reduce(function(t,n){var r=t[0],o=t[1],t=i[n],a=e[n];return[r||t,r||!t?e6(o,t&&t.multi?function(e){return u(e=_(e,n))&&e.some(function(e){return s(a,e)})}:function(e){return s(a,_(e,n))}):o]},[null,null]),r=c[0],c=c[1];return r?this.where(r.name).equals(e[r.keyPath]).filter(c):n?this.filter(c):this.where(t).equals("")},te.prototype.filter=function(e){return this.toCollection().and(e)},te.prototype.count=function(e){return this.toCollection().count(e)},te.prototype.offset=function(e){return this.toCollection().offset(e)},te.prototype.limit=function(e){return this.toCollection().limit(e)},te.prototype.each=function(e){return this.toCollection().each(e)},te.prototype.toArray=function(e){return this.toCollection().toArray(e)},te.prototype.toCollection=function(){return new this.db.Collection(new this.db.WhereClause(this))},te.prototype.orderBy=function(e){return new this.db.Collection(new this.db.WhereClause(this,u(e)?"[".concat(e.join("+"),"]"):e))},te.prototype.reverse=function(){return this.toCollection().reverse()},te.prototype.mapToClass=function(t){var n,r=this.db,i=this.name;function o(){return null!==n&&n.apply(this,arguments)||this}(this.schema.mappedClass=t).prototype instanceof e8&&(function(t,n){if("function"!=typeof n&&null!==n)throw TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}(o,n=t),Object.defineProperty(o.prototype,"db",{get:function(){return r},enumerable:!1,configurable:!0}),o.prototype.table=function(){return i},t=o);for(var u=new Set,a=t.prototype;a;a=s(a))Object.getOwnPropertyNames(a).forEach(function(e){return u.add(e)});function c(e){if(!e)return e;var n,r=Object.create(t.prototype);for(n in e)if(!u.has(n))try{r[n]=e[n]}catch(e){}return r}return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=c,this.hook("reading",c),t},te.prototype.defineClass=function(){return this.mapToClass(function(e){a(this,e)})},te.prototype.add=function(e,t){var n=this,r=this.schema.primKey,i=r.auto,o=r.keyPath,u=e;return o&&i&&(u=e3(o)(e)),this._trans("readwrite",function(e){return n.core.mutate({trans:e,type:"add",keys:null!=t?[t]:null,values:[u]})}).then(function(e){return e.numFailures?eg.reject(e.failures[0]):e.lastResult}).then(function(t){if(o)try{x(e,o,t)}catch(e){}return t})},te.prototype.update=function(e,t){return"object"!=typeof e||u(e)?this.where(":id").equals(e).modify(t):void 0===(e=_(e,this.schema.primKey.keyPath))?eY(new G.InvalidArgument("Given object does not contain its primary key")):this.where(":id").equals(e).modify(t)},te.prototype.put=function(e,t){var n=this,r=this.schema.primKey,i=r.auto,o=r.keyPath,u=e;return o&&i&&(u=e3(o)(e)),this._trans("readwrite",function(e){return n.core.mutate({trans:e,type:"put",values:[u],keys:null!=t?[t]:null})}).then(function(e){return e.numFailures?eg.reject(e.failures[0]):e.lastResult}).then(function(t){if(o)try{x(e,o,t)}catch(e){}return t})},te.prototype.delete=function(e){var t=this;return this._trans("readwrite",function(n){return t.core.mutate({trans:n,type:"delete",keys:[e]})}).then(function(e){return e.numFailures?eg.reject(e.failures[0]):void 0})},te.prototype.clear=function(){var e=this;return this._trans("readwrite",function(t){return e.core.mutate({trans:t,type:"deleteRange",range:e2})}).then(function(e){return e.numFailures?eg.reject(e.failures[0]):void 0})},te.prototype.bulkGet=function(e){var t=this;return this._trans("readonly",function(n){return t.core.getMany({keys:e,trans:n}).then(function(e){return e.map(function(e){return t.hook.reading.fire(e)})})})},te.prototype.bulkAdd=function(e,t,n){var r=this,i=Array.isArray(t)?t:void 0,o=(n=n||(i?void 0:t))?n.allKeys:void 0;return this._trans("readwrite",function(t){var n=r.schema.primKey,u=n.auto,n=n.keyPath;if(n&&i)throw new G.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(i&&i.length!==e.length)throw new G.InvalidArgument("Arguments objects and keys must have the same length");var a=e.length,n=n&&u?e.map(e3(n)):e;return r.core.mutate({trans:t,type:"add",keys:i,values:n,wantResults:o}).then(function(e){var t=e.numFailures,n=e.results,i=e.lastResult,e=e.failures;if(0===t)return o?n:i;throw new L("".concat(r.name,".bulkAdd(): ").concat(t," of ").concat(a," operations failed"),e)})})},te.prototype.bulkPut=function(e,t,n){var r=this,i=Array.isArray(t)?t:void 0,o=(n=n||(i?void 0:t))?n.allKeys:void 0;return this._trans("readwrite",function(t){var n=r.schema.primKey,u=n.auto,n=n.keyPath;if(n&&i)throw new G.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(i&&i.length!==e.length)throw new G.InvalidArgument("Arguments objects and keys must have the same length");var a=e.length,n=n&&u?e.map(e3(n)):e;return r.core.mutate({trans:t,type:"put",keys:i,values:n,wantResults:o}).then(function(e){var t=e.numFailures,n=e.results,i=e.lastResult,e=e.failures;if(0===t)return o?n:i;throw new L("".concat(r.name,".bulkPut(): ").concat(t," of ").concat(a," operations failed"),e)})})},te.prototype.bulkUpdate=function(e){var t=this,n=this.core,r=e.map(function(e){return e.key}),i=e.map(function(e){return e.changes}),o=[];return this._trans("readwrite",function(u){return n.getMany({trans:u,keys:r,cache:"clone"}).then(function(a){var s=[],c=[];e.forEach(function(e,n){var r=e.key,i=e.changes,u=a[n];if(u){for(var l=0,f=Object.keys(i);l<f.length;l++){var h=f[l],d=i[h];if(h===t.schema.primKey.keyPath){if(0!==e4(d,r))throw new G.Constraint("Cannot update primary key in bulkUpdate()")}else x(u,h,d)}o.push(n),s.push(r),c.push(u)}});var l=s.length;return n.mutate({trans:u,type:"put",keys:s,values:c,updates:{keys:r,changeSpecs:i}}).then(function(e){var n=e.numFailures,r=e.failures;if(0===n)return l;for(var i=0,u=Object.keys(r);i<u.length;i++){var a,s=u[i],c=o[Number(s)];null!=c&&(a=r[s],delete r[s],r[c]=a)}throw new L("".concat(t.name,".bulkUpdate(): ").concat(n," of ").concat(l," operations failed"),r)})})})},te.prototype.bulkDelete=function(e){var t=this,n=e.length;return this._trans("readwrite",function(n){return t.core.mutate({trans:n,type:"delete",keys:e})}).then(function(e){var r=e.numFailures,i=e.lastResult,e=e.failures;if(0===r)return i;throw new L("".concat(t.name,".bulkDelete(): ").concat(r," of ").concat(n," operations failed"),e)})},te);function te(){}function tt(e){function t(t,r){if(r){for(var i=arguments.length,o=Array(i-1);--i;)o[i-1]=arguments[i];return n[t].subscribe.apply(null,o),e}if("string"==typeof t)return n[t]}var n={};t.addEventType=a;for(var r=1,i=arguments.length;r<i;++r)a(arguments[r]);return t;function a(e,r,i){if("object"!=typeof e){r=r||en;var s={subscribers:[],fire:i=i||X,subscribe:function(e){-1===s.subscribers.indexOf(e)&&(s.subscribers.push(e),s.fire=r(s.fire,e))},unsubscribe:function(e){s.subscribers=s.subscribers.filter(function(t){return t!==e}),s.fire=s.subscribers.reduce(r,i)}};return n[e]=t[e]=s}o(e).forEach(function(t){var n=e[t];if(u(n))a(t,e[t][0],e[t][1]);else{if("asap"!==n)throw new G.InvalidArgument("Invalid event config");var r=a(t,H,function(){for(var e=arguments.length,t=Array(e);e--;)t[e]=arguments[e];r.subscribers.forEach(function(e){w(function(){e.apply(null,t)})})})}})}}function tn(e,t){return p(t).from({prototype:e}),t}function tr(e,t){return!(e.filter||e.algorithm||e.or)&&(t?e.justLimit:!e.replayFilter)}function ti(e,t){e.filter=e6(e.filter,t)}function to(e,t,n){var r=e.replayFilter;e.replayFilter=r?function(){return e6(r(),t())}:t,e.justLimit=n&&!r}function tu(e,t){if(e.isPrimKey)return t.primaryKey;var n=t.getIndexByKeyPath(e.index);if(!n)throw new G.Schema("KeyPath "+e.index+" on object store "+t.name+" is not indexed");return n}function ta(e,t,n){var r=tu(e,t.schema);return t.openCursor({trans:n,values:!e.keysOnly,reverse:"prev"===e.dir,unique:!!e.unique,query:{index:r,range:e.range}})}function ts(e,t,n,r){var i=e.replayFilter?e6(e.filter,e.replayFilter()):e.filter;if(e.or){var o={},u=function(e,n,r){var u,a;i&&!i(n,r,function(e){return n.stop(e)},function(e){return n.fail(e)})||("[object ArrayBuffer]"==(a=""+(u=n.primaryKey))&&(a=""+new Uint8Array(u)),l(o,a)||(o[a]=!0,t(e,n,r)))};return Promise.all([e.or._iterate(u,n),tc(ta(e,r,n),e.algorithm,u,!e.keysOnly&&e.valueMapper)])}return tc(ta(e,r,n),e6(e.algorithm,i),t,!e.keysOnly&&e.valueMapper)}function tc(e,t,n,r){var i=eC(r?function(e,t,i){return n(r(e),t,i)}:n);return e.then(function(e){if(e)return e.start(function(){var n=function(){return e.continue()};t&&!t(e,function(e){return n=e},function(t){e.stop(t),n=X},function(t){e.fail(t),n=X})||i(e.value,e,function(e){return n=e}),n()})})}var P=Symbol(),tl=(tf.prototype.execute=function(e){if(void 0!==this.add){var t=this.add;if(u(t))return r(r([],u(e)?e:[],!0),t,!0).sort();if("number"==typeof t)return(Number(e)||0)+t;if("bigint"==typeof t)try{return BigInt(e)+t}catch(e){return BigInt(0)+t}throw TypeError("Invalid term ".concat(t))}if(void 0!==this.remove){var n=this.remove;if(u(n))return u(e)?e.filter(function(e){return!n.includes(e)}).sort():[];if("number"==typeof n)return Number(e)-n;if("bigint"==typeof n)try{return BigInt(e)-n}catch(e){return BigInt(0)-n}throw TypeError("Invalid subtrahend ".concat(n))}return(t=null===(t=this.replacePrefix)||void 0===t?void 0:t[0])&&"string"==typeof e&&e.startsWith(t)?this.replacePrefix[1]+e.substring(t.length):e},tf);function tf(e){Object.assign(this,e)}var th=(td.prototype._read=function(e,t){var n=this._ctx;return n.error?n.table._trans(null,eY.bind(null,n.error)):n.table._trans("readonly",e).then(t)},td.prototype._write=function(e){var t=this._ctx;return t.error?t.table._trans(null,eY.bind(null,t.error)):t.table._trans("readwrite",e,"locked")},td.prototype._addAlgorithm=function(e){var t=this._ctx;t.algorithm=e6(t.algorithm,e)},td.prototype._iterate=function(e,t){return ts(this._ctx,e,t,this._ctx.table.core)},td.prototype.clone=function(e){var t=Object.create(this.constructor.prototype),n=Object.create(this._ctx);return e&&a(n,e),t._ctx=n,t},td.prototype.raw=function(){return this._ctx.valueMapper=null,this},td.prototype.each=function(e){var t=this._ctx;return this._read(function(n){return ts(t,e,n,t.table.core)})},td.prototype.count=function(e){var t=this;return this._read(function(e){var n=t._ctx,r=n.table.core;if(tr(n,!0))return r.count({trans:e,query:{index:tu(n,r.schema),range:n.range}}).then(function(e){return Math.min(e,n.limit)});var i=0;return ts(n,function(){return++i,!1},e,r).then(function(){return i})}).then(e)},td.prototype.sortBy=function(e,t){var n=e.split(".").reverse(),r=n[0],i=n.length-1;function o(e,t){return t?o(e[n[t]],t-1):e[r]}var u="next"===this._ctx.dir?1:-1;function a(e,t){return(e=o(e,i))<(t=o(t,i))?-u:t<e?u:0}return this.toArray(function(e){return e.sort(a)}).then(t)},td.prototype.toArray=function(e){var t=this;return this._read(function(e){var n=t._ctx;if("next"===n.dir&&tr(n,!0)&&0<n.limit){var r=n.valueMapper,i=tu(n,n.table.core.schema);return n.table.core.query({trans:e,limit:n.limit,values:!0,query:{index:i,range:n.range}}).then(function(e){return e=e.result,r?e.map(r):e})}var o=[];return ts(n,function(e){return o.push(e)},e,n.table.core).then(function(){return o})},e)},td.prototype.offset=function(e){var t=this._ctx;return e<=0||(t.offset+=e,tr(t)?to(t,function(){var t=e;return function(e,n){return 0===t||(1===t?--t:n(function(){e.advance(t),t=0}),!1)}}):to(t,function(){var t=e;return function(){return--t<0}})),this},td.prototype.limit=function(e){return this._ctx.limit=Math.min(this._ctx.limit,e),to(this._ctx,function(){var t=e;return function(e,n,r){return--t<=0&&n(r),0<=t}},!0),this},td.prototype.until=function(e,t){return ti(this._ctx,function(n,r,i){return!e(n.value)||(r(i),t)}),this},td.prototype.first=function(e){return this.limit(1).toArray(function(e){return e[0]}).then(e)},td.prototype.last=function(e){return this.reverse().first(e)},td.prototype.filter=function(e){var t;return ti(this._ctx,function(t){return e(t.value)}),(t=this._ctx).isMatch=e6(t.isMatch,e),this},td.prototype.and=function(e){return this.filter(e)},td.prototype.or=function(e){return new this.db.WhereClause(this._ctx.table,e,this)},td.prototype.reverse=function(){return this._ctx.dir="prev"===this._ctx.dir?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this},td.prototype.desc=function(){return this.reverse()},td.prototype.eachKey=function(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each(function(t,n){e(n.key,n)})},td.prototype.eachUniqueKey=function(e){return this._ctx.unique="unique",this.eachKey(e)},td.prototype.eachPrimaryKey=function(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each(function(t,n){e(n.primaryKey,n)})},td.prototype.keys=function(e){var t=this._ctx;t.keysOnly=!t.isMatch;var n=[];return this.each(function(e,t){n.push(t.key)}).then(function(){return n}).then(e)},td.prototype.primaryKeys=function(e){var t=this._ctx;if("next"===t.dir&&tr(t,!0)&&0<t.limit)return this._read(function(e){var n=tu(t,t.table.core.schema);return t.table.core.query({trans:e,values:!1,limit:t.limit,query:{index:n,range:t.range}})}).then(function(e){return e.result}).then(e);t.keysOnly=!t.isMatch;var n=[];return this.each(function(e,t){n.push(t.primaryKey)}).then(function(){return n}).then(e)},td.prototype.uniqueKeys=function(e){return this._ctx.unique="unique",this.keys(e)},td.prototype.firstKey=function(e){return this.limit(1).keys(function(e){return e[0]}).then(e)},td.prototype.lastKey=function(e){return this.reverse().firstKey(e)},td.prototype.distinct=function(){var e=this._ctx,e=e.index&&e.table.schema.idxByName[e.index];if(!e||!e.multi)return this;var t={};return ti(this._ctx,function(e){var n=e.primaryKey.toString(),e=l(t,n);return t[n]=!0,!e}),this},td.prototype.modify=function(e){var t=this,n=this._ctx;return this._write(function(r){function i(e,t){var n=t.failures,t=t.numFailures;y+=e-t;for(var r=0,i=o(n);r<i.length;r++){var u=i[r];p.push(n[u])}}s="function"==typeof e?e:(a=(u=o(e)).length,function(t){for(var n=!1,r=0;r<a;++r){var i=u[r],o=e[i],s=_(t,i);o instanceof tl?(x(t,i,o.execute(s)),n=!0):s!==o&&(x(t,i,o),n=!0)}return n});var u,a,s,c=n.table.core,l=c.schema.primaryKey,f=l.outbound,h=l.extractKey,d=t.db._options.modifyChunkSize||200,p=[],y=0,v=[];return t.clone().primaryKeys().then(function(t){var o=tr(n)&&n.limit===1/0&&("function"!=typeof e||e===tp)&&{index:n.index,range:n.range};return(function n(u){var a=Math.min(d,t.length-u);return c.getMany({trans:r,keys:t.slice(u,u+a),cache:"immutable"}).then(function(l){for(var p=[],y=[],v=f?[]:null,m=[],b=0;b<a;++b){var g=l[b],w={value:j(g),primKey:t[u+b]};!1!==s.call(w,w.value,w)&&(null==w.value?m.push(t[u+b]):f||0===e4(h(g),h(w.value))?(y.push(w.value),f&&v.push(t[u+b])):(m.push(t[u+b]),p.push(w.value)))}return Promise.resolve(0<p.length&&c.mutate({trans:r,type:"add",values:p}).then(function(e){for(var t in e.failures)m.splice(parseInt(t),1);i(p.length,e)})).then(function(){return(0<y.length||o&&"object"==typeof e)&&c.mutate({trans:r,type:"put",keys:v,values:y,criteria:o,changeSpec:"function"!=typeof e&&e,isAdditionalChunk:0<u}).then(function(e){return i(y.length,e)})}).then(function(){return(0<m.length||o&&e===tp)&&c.mutate({trans:r,type:"delete",keys:m,criteria:o,isAdditionalChunk:0<u}).then(function(e){return i(m.length,e)})}).then(function(){return t.length>u+a&&n(u+d)})})})(0).then(function(){if(0<p.length)throw new U("Error modifying one or more objects",p,y,v);return t.length})})})},td.prototype.delete=function(){var e=this._ctx,t=e.range;return tr(e)&&(e.isPrimKey||3===t.type)?this._write(function(n){var r=e.table.core.schema.primaryKey;return e.table.core.count({trans:n,query:{index:r,range:t}}).then(function(r){return e.table.core.mutate({trans:n,type:"deleteRange",range:t}).then(function(e){var t=e.failures;if(e.lastResult,e.results,e=e.numFailures)throw new U("Could not delete some values",Object.keys(t).map(function(e){return t[e]}),r-e);return r-e})})}):this.modify(tp)},td);function td(){}var tp=function(e,t){return t.value=null};function ty(e,t){return e<t?-1:e===t?0:1}function tv(e,t){return t<e?-1:e===t?0:1}function tm(e,t,n){return(e=e instanceof tx?new e.Collection(e):e)._ctx.error=new(n||TypeError)(t),e}function tb(e){return new e.Collection(e,function(){return t_("")}).limit(0)}function tg(e,t,n,r){var i,o,u,a,s,c,l,f=n.length;if(!n.every(function(e){return"string"==typeof e}))return tm(e,eQ);function h(e){i="next"===e?function(e){return e.toUpperCase()}:function(e){return e.toLowerCase()},o="next"===e?function(e){return e.toLowerCase()}:function(e){return e.toUpperCase()},u="next"===e?ty:tv;var t=n.map(function(e){return{lower:o(e),upper:i(e)}}).sort(function(e,t){return u(e.lower,t.lower)});a=t.map(function(e){return e.upper}),s=t.map(function(e){return e.lower}),l="next"===(c=e)?"":r}h("next"),(e=new e.Collection(e,function(){return tw(a[0],s[f-1]+r)}))._ondirectionchange=function(e){h(e)};var d=0;return e._addAlgorithm(function(e,n,r){var i=e.key;if("string"!=typeof i)return!1;var h=o(i);if(t(h,s,d))return!0;for(var p=null,y=d;y<f;++y){var v=function(e,t,n,r,i,o){for(var u=Math.min(e.length,r.length),a=-1,s=0;s<u;++s){var c=t[s];if(c!==r[s])return 0>i(e[s],n[s])?e.substr(0,s)+n[s]+n.substr(s+1):0>i(e[s],r[s])?e.substr(0,s)+r[s]+n.substr(s+1):0<=a?e.substr(0,a)+t[a]+n.substr(a+1):null;0>i(e[s],c)&&(a=s)}return u<r.length&&"next"===o?e+n.substr(e.length):u<e.length&&"prev"===o?e.substr(0,n.length):a<0?null:e.substr(0,a)+r[a]+n.substr(a+1)}(i,h,a[y],s[y],u,c);null===v&&null===p?d=y+1:(null===p||0<u(p,v))&&(p=v)}return n(null!==p?function(){e.continue(p+l)}:r),!1}),e}function tw(e,t,n,r){return{type:2,lower:e,upper:t,lowerOpen:n,upperOpen:r}}function t_(e){return{type:1,lower:e,upper:e}}var tx=(Object.defineProperty(tk.prototype,"Collection",{get:function(){return this._ctx.table.db.Collection},enumerable:!1,configurable:!0}),tk.prototype.between=function(e,t,n,r){n=!1!==n,r=!0===r;try{return 0<this._cmp(e,t)||0===this._cmp(e,t)&&(n||r)&&(!n||!r)?tb(this):new this.Collection(this,function(){return tw(e,t,!n,!r)})}catch(e){return tm(this,eH)}},tk.prototype.equals=function(e){return null==e?tm(this,eH):new this.Collection(this,function(){return t_(e)})},tk.prototype.above=function(e){return null==e?tm(this,eH):new this.Collection(this,function(){return tw(e,void 0,!0)})},tk.prototype.aboveOrEqual=function(e){return null==e?tm(this,eH):new this.Collection(this,function(){return tw(e,void 0,!1)})},tk.prototype.below=function(e){return null==e?tm(this,eH):new this.Collection(this,function(){return tw(void 0,e,!1,!0)})},tk.prototype.belowOrEqual=function(e){return null==e?tm(this,eH):new this.Collection(this,function(){return tw(void 0,e)})},tk.prototype.startsWith=function(e){return"string"!=typeof e?tm(this,eQ):this.between(e,e+eX,!0,!0)},tk.prototype.startsWithIgnoreCase=function(e){return""===e?this.startsWith(e):tg(this,function(e,t){return 0===e.indexOf(t[0])},[e],eX)},tk.prototype.equalsIgnoreCase=function(e){return tg(this,function(e,t){return e===t[0]},[e],"")},tk.prototype.anyOfIgnoreCase=function(){var e=R.apply(q,arguments);return 0===e.length?tb(this):tg(this,function(e,t){return -1!==t.indexOf(e)},e,"")},tk.prototype.startsWithAnyOfIgnoreCase=function(){var e=R.apply(q,arguments);return 0===e.length?tb(this):tg(this,function(e,t){return t.some(function(t){return 0===e.indexOf(t)})},e,eX)},tk.prototype.anyOf=function(){var e=this,t=R.apply(q,arguments),n=this._cmp;try{t.sort(n)}catch(e){return tm(this,eH)}if(0===t.length)return tb(this);var r=new this.Collection(this,function(){return tw(t[0],t[t.length-1])});r._ondirectionchange=function(r){n="next"===r?e._ascending:e._descending,t.sort(n)};var i=0;return r._addAlgorithm(function(e,r,o){for(var u=e.key;0<n(u,t[i]);)if(++i===t.length)return r(o),!1;return 0===n(u,t[i])||(r(function(){e.continue(t[i])}),!1)}),r},tk.prototype.notEqual=function(e){return this.inAnyRange([[-1/0,e],[e,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})},tk.prototype.noneOf=function(){var e=R.apply(q,arguments);if(0===e.length)return new this.Collection(this);try{e.sort(this._ascending)}catch(e){return tm(this,eH)}var t=e.reduce(function(e,t){return e?e.concat([[e[e.length-1][1],t]]):[[-1/0,t]]},null);return t.push([e[e.length-1],this.db._maxKey]),this.inAnyRange(t,{includeLowers:!1,includeUppers:!1})},tk.prototype.inAnyRange=function(e,t){var n=this,r=this._cmp,i=this._ascending,o=this._descending,u=this._min,a=this._max;if(0===e.length)return tb(this);if(!e.every(function(e){return void 0!==e[0]&&void 0!==e[1]&&0>=i(e[0],e[1])}))return tm(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",G.InvalidArgument);var s,c=!t||!1!==t.includeLowers,l=t&&!0===t.includeUppers,f=i;function h(e,t){return f(e[0],t[0])}try{(s=e.reduce(function(e,t){for(var n=0,i=e.length;n<i;++n){var o=e[n];if(0>r(t[0],o[1])&&0<r(t[1],o[0])){o[0]=u(o[0],t[0]),o[1]=a(o[1],t[1]);break}}return n===i&&e.push(t),e},[])).sort(h)}catch(e){return tm(this,eH)}var d=0,p=l?function(e){return 0<i(e,s[d][1])}:function(e){return 0<=i(e,s[d][1])},y=c?function(e){return 0<o(e,s[d][0])}:function(e){return 0<=o(e,s[d][0])},v=p,e=new this.Collection(this,function(){return tw(s[0][0],s[s.length-1][1],!c,!l)});return e._ondirectionchange=function(e){f="next"===e?(v=p,i):(v=y,o),s.sort(h)},e._addAlgorithm(function(e,t,r){for(var o=e.key;v(o);)if(++d===s.length)return t(r),!1;return!p(o)&&!y(o)||(0===n._cmp(o,s[d][1])||0===n._cmp(o,s[d][0])||t(function(){f===i?e.continue(s[d][0]):e.continue(s[d][1])}),!1)}),e},tk.prototype.startsWithAnyOf=function(){var e=R.apply(q,arguments);return e.every(function(e){return"string"==typeof e})?0===e.length?tb(this):this.inAnyRange(e.map(function(e){return[e,e+eX]})):tm(this,"startsWithAnyOf() only works with strings")},tk);function tk(){}function tO(e){return eC(function(t){return tE(t),e(t.target.error),!1})}function tE(e){e.stopPropagation&&e.stopPropagation(),e.preventDefault&&e.preventDefault()}var tP="storagemutated",tA="x-storagemutated-1",tS=tt(null,tP),tj=(tK.prototype._lock=function(){return g(!ey.global),++this._reculock,1!==this._reculock||ey.global||(ey.lockOwnerFor=this),this},tK.prototype._unlock=function(){if(g(!ey.global),0==--this._reculock)for(ey.global||(ey.lockOwnerFor=null);0<this._blockedFuncs.length&&!this._locked();){var e=this._blockedFuncs.shift();try{eV(e[1],e[0])}catch(e){}}return this},tK.prototype._locked=function(){return this._reculock&&ey.lockOwnerFor!==this},tK.prototype.create=function(e){var t=this;if(!this.mode)return this;var n=this.db.idbdb,r=this.db._state.dbOpenError;if(g(!this.idbtrans),!e&&!n)switch(r&&r.name){case"DatabaseClosedError":throw new G.DatabaseClosed(r);case"MissingAPIError":throw new G.MissingAPI(r.message,r);default:throw new G.OpenFailed(r)}if(!this.active)throw new G.TransactionInactive;return g(null===this._completion._state),(e=this.idbtrans=e||(this.db.core||n).transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability})).onerror=eC(function(n){tE(n),t._reject(e.error)}),e.onabort=eC(function(n){tE(n),t.active&&t._reject(new G.Abort(e.error)),t.active=!1,t.on("abort").fire(n)}),e.oncomplete=eC(function(){t.active=!1,t._resolve(),"mutatedParts"in e&&tS.storagemutated.fire(e.mutatedParts)}),this},tK.prototype._promise=function(e,t,n){var r=this;if("readwrite"===e&&"readwrite"!==this.mode)return eY(new G.ReadOnly("Transaction is readonly"));if(!this.active)return eY(new G.TransactionInactive);if(this._locked())return new eg(function(i,o){r._blockedFuncs.push([function(){r._promise(e,t,n).then(i,o)},ey])});if(n)return eN(function(){var e=new eg(function(e,n){r._lock();var i=t(e,n,r);i&&i.then&&i.then(e,n)});return e.finally(function(){return r._unlock()}),e._lib=!0,e});var i=new eg(function(e,n){var i=t(e,n,r);i&&i.then&&i.then(e,n)});return i._lib=!0,i},tK.prototype._root=function(){return this.parent?this.parent._root():this},tK.prototype.waitFor=function(e){var t,n=this._root(),r=eg.resolve(e);n._waitingFor?n._waitingFor=n._waitingFor.then(function(){return r}):(n._waitingFor=r,n._waitingQueue=[],t=n.idbtrans.objectStore(n.storeNames[0]),function e(){for(++n._spinCount;n._waitingQueue.length;)n._waitingQueue.shift()();n._waitingFor&&(t.get(-1/0).onsuccess=e)}());var i=n._waitingFor;return new eg(function(e,t){r.then(function(t){return n._waitingQueue.push(eC(e.bind(null,t)))},function(e){return n._waitingQueue.push(eC(t.bind(null,e)))}).finally(function(){n._waitingFor===i&&(n._waitingFor=null)})})},tK.prototype.abort=function(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new G.Abort))},tK.prototype.table=function(e){var t=this._memoizedTables||(this._memoizedTables={});if(l(t,e))return t[e];var n=this.schema[e];if(!n)throw new G.NotFound("Table "+e+" not part of transaction");return(n=new this.db.Table(e,n,this)).core=this.db.core.table(e),t[e]=n},tK);function tK(){}function tC(e,t,n,r,i,o,u){return{name:e,keyPath:t,unique:n,multi:r,auto:i,compound:o,src:(n&&!u?"&":"")+(r?"*":"")+(i?"++":"")+tI(t)}}function tI(e){return"string"==typeof e?e:e?"["+[].join.call(e,"+")+"]":""}function tB(e,t,n){var r;return{name:e,primKey:t,indexes:n,mappedClass:null,idxByName:(r=function(e){return[e.name,e]},n.reduce(function(e,t,n){return(n=r(t,n))&&(e[n[0]]=n[1]),e},{}))}}var tT=function(e){try{return e.only([[]]),tT=function(){return[[]]},[[]]}catch(e){return tT=function(){return eX},eX}};function tq(e){return null==e?function(){}:"string"==typeof e?1===e.split(".").length?function(t){return t[e]}:function(t){return _(t,e)}:function(t){return _(t,e)}}function tR(e){return[].slice.call(e)}var tD=0;function tN(e){return null==e?":id":"string"==typeof e?e:"[".concat(e.join("+"),"]")}function tM(e,n){var r,i,o,a,s=n.db,n=(r=e._middlewares,i=e._deps,o=n,a=i.IDBKeyRange,i.indexedDB,{dbcore:(o=function(e,t,n){function r(e){if(3===e.type)return null;if(4===e.type)throw Error("Cannot convert never type to IDBKeyRange");var n=e.lower,r=e.upper,i=e.lowerOpen,e=e.upperOpen;return void 0===n?void 0===r?null:t.upperBound(r,!!e):void 0===r?t.lowerBound(n,!!i):t.bound(n,r,!!i,!!e)}var i,o,a=(i=n,o=tR(e.objectStoreNames),{schema:{name:e.name,tables:o.map(function(e){return i.objectStore(e)}).map(function(e){var t=e.keyPath,n=e.autoIncrement,r=u(t),i={},n={name:e.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:null==t,compound:r,keyPath:t,autoIncrement:n,unique:!0,extractKey:tq(t)},indexes:tR(e.indexNames).map(function(t){return e.index(t)}).map(function(e){var t=e.name,n=e.unique,r=e.multiEntry,e=e.keyPath,r={name:t,compound:u(e),keyPath:e,unique:n,multiEntry:r,extractKey:tq(e)};return i[tN(e)]=r}),getIndexByKeyPath:function(e){return i[tN(e)]}};return i[":id"]=n.primaryKey,null!=t&&(i[tN(t)]=n.primaryKey),n})},hasGetAll:0<o.length&&"getAll"in i.objectStore(o[0])&&!("undefined"!=typeof navigator&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604)}),n=a.schema,s=a.hasGetAll,a=n.tables.map(function(e){var t=e.name;return{name:t,schema:e,mutate:function(e){var n=e.trans,i=e.type,o=e.keys,u=e.values,a=e.range;return new Promise(function(e,s){e=eC(e);var c=n.objectStore(t),l=null==c.keyPath,f="put"===i||"add"===i;if(!f&&"delete"!==i&&"deleteRange"!==i)throw Error("Invalid operation type: "+i);var h,d=(o||u||{length:1}).length;if(o&&u&&o.length!==u.length)throw Error("Given keys array must have same length as given values array.");if(0===d)return e({numFailures:0,failures:{},results:[],lastResult:void 0});function p(e){++m,tE(e)}var y=[],v=[],m=0;if("deleteRange"===i){if(4===a.type)return e({numFailures:m,failures:v,results:[],lastResult:void 0});3===a.type?y.push(h=c.clear()):y.push(h=c.delete(r(a)))}else{var l=f?l?[u,o]:[u,null]:[o,null],b=l[0],g=l[1];if(f)for(var w=0;w<d;++w)y.push(h=g&&void 0!==g[w]?c[i](b[w],g[w]):c[i](b[w])),h.onerror=p;else for(w=0;w<d;++w)y.push(h=c[i](b[w])),h.onerror=p}function _(t){t=t.target.result,y.forEach(function(e,t){return null!=e.error&&(v[t]=e.error)}),e({numFailures:m,failures:v,results:"delete"===i?o:y.map(function(e){return e.result}),lastResult:t})}h.onerror=function(e){p(e),_(e)},h.onsuccess=_})},getMany:function(e){var n=e.trans,r=e.keys;return new Promise(function(e,i){e=eC(e);for(var o,u=n.objectStore(t),a=r.length,s=Array(a),c=0,l=0,f=function(t){s[(t=t.target)._pos]=t.result,++l===c&&e(s)},h=tO(i),d=0;d<a;++d)null!=r[d]&&((o=u.get(r[d]))._pos=d,o.onsuccess=f,o.onerror=h,++c);0===c&&e(s)})},get:function(e){var n=e.trans,r=e.key;return new Promise(function(e,i){e=eC(e);var o=n.objectStore(t).get(r);o.onsuccess=function(t){return e(t.target.result)},o.onerror=tO(i)})},query:function(e){return new Promise(function(n,i){n=eC(n);var o,u,a,c=e.trans,l=e.values,f=e.limit,h=e.query,d=f===1/0?void 0:f,p=h.index,h=h.range,c=c.objectStore(t),p=p.isPrimaryKey?c:c.index(p.name),h=r(h);if(0===f)return n({result:[]});s?((d=l?p.getAll(h,d):p.getAllKeys(h,d)).onsuccess=function(e){return n({result:e.target.result})},d.onerror=tO(i)):(o=0,u=!l&&"openKeyCursor"in p?p.openKeyCursor(h):p.openCursor(h),a=[],u.onsuccess=function(e){var t=u.result;return t?(a.push(l?t.value:t.primaryKey),++o===f?n({result:a}):void t.continue()):n({result:a})},u.onerror=tO(i))})},openCursor:function(e){var n=e.trans,i=e.values,o=e.query,u=e.reverse,a=e.unique;return new Promise(function(e,s){e=eC(e);var c=o.index,l=o.range,f=n.objectStore(t),f=c.isPrimaryKey?f:f.index(c.name),c=u?a?"prevunique":"prev":a?"nextunique":"next",h=!i&&"openKeyCursor"in f?f.openKeyCursor(r(l),c):f.openCursor(r(l),c);h.onerror=tO(s),h.onsuccess=eC(function(t){var r,i,o,u,a=h.result;a?(a.___id=++tD,a.done=!1,r=a.continue.bind(a),i=(i=a.continuePrimaryKey)&&i.bind(a),o=a.advance.bind(a),u=function(){throw Error("Cursor not stopped")},a.trans=n,a.stop=a.continue=a.continuePrimaryKey=a.advance=function(){throw Error("Cursor not started")},a.fail=eC(s),a.next=function(){var e=this,t=1;return this.start(function(){return t--?e.continue():e.stop()}).then(function(){return e})},a.start=function(e){function t(){if(h.result)try{e()}catch(e){a.fail(e)}else a.done=!0,a.start=function(){throw Error("Cursor behind last entry")},a.stop()}var n=new Promise(function(e,t){e=eC(e),h.onerror=tO(t),a.fail=t,a.stop=function(t){a.stop=a.continue=a.continuePrimaryKey=a.advance=u,e(t)}});return h.onsuccess=eC(function(e){h.onsuccess=t,t()}),a.continue=r,a.continuePrimaryKey=i,a.advance=o,t(),n},e(a)):e(null)},s)})},count:function(e){var n=e.query,i=e.trans,o=n.index,u=n.range;return new Promise(function(e,n){var a=i.objectStore(t),s=o.isPrimaryKey?a:a.index(o.name),a=r(u),s=a?s.count(a):s.count();s.onsuccess=eC(function(t){return e(t.target.result)}),s.onerror=tO(n)})}}}),c={};return a.forEach(function(e){return c[e.name]=e}),{stack:"dbcore",transaction:e.transaction.bind(e),table:function(e){if(!c[e])throw Error("Table '".concat(e,"' not found"));return c[e]},MIN_KEY:-1/0,MAX_KEY:tT(t),schema:n}}(s,a,o),r.dbcore.reduce(function(e,n){return n=n.create,t(t({},e),n(e))},o))});e.core=n.dbcore,e.tables.forEach(function(t){var n=t.name;e.core.schema.tables.some(function(e){return e.name===n})&&(t.core=e.core.table(n),e[n]instanceof e.Table&&(e[n].core=t.core))})}function tF(e,t,n,r){n.forEach(function(n){var i=r[n];t.forEach(function(t){var r=function e(t,n){return y(t,n)||(t=s(t))&&e(t,n)}(t,n);(!r||"value"in r&&void 0===r.value)&&(t===e.Transaction.prototype||t instanceof e.Transaction?d(t,n,{get:function(){return this.table(n)},set:function(e){h(this,n,{value:e,writable:!0,configurable:!0,enumerable:!0})}}):t[n]=new e.Table(n,i))})})}function t$(e,t){t.forEach(function(t){for(var n in t)t[n]instanceof e.Table&&delete t[n]})}function tz(e,t){return e._cfg.version-t._cfg.version}function tU(e,t){var n,r={del:[],add:[],change:[]};for(n in e)t[n]||r.del.push(n);for(n in t){var i=e[n],o=t[n];if(i){var u={name:n,def:o,recreate:!1,del:[],add:[],change:[]};if(""+(i.primKey.keyPath||"")!=""+(o.primKey.keyPath||"")||i.primKey.auto!==o.primKey.auto)u.recreate=!0,r.change.push(u);else{var a=i.idxByName,s=o.idxByName,c=void 0;for(c in a)s[c]||u.del.push(c);for(c in s){var l=a[c],f=s[c];l?l.src!==f.src&&u.change.push(f):u.add.push(f)}(0<u.del.length||0<u.add.length||0<u.change.length)&&r.change.push(u)}}else r.add.push([n,o])}return r}function tL(e,t,n,r){var i=e.db.createObjectStore(t,n.keyPath?{keyPath:n.keyPath,autoIncrement:n.auto}:{autoIncrement:n.auto});return r.forEach(function(e){return tG(i,e)}),i}function tV(e,t){o(e).forEach(function(n){t.db.objectStoreNames.contains(n)||(ei&&console.debug("Dexie: Creating missing table",n),tL(t,n,e[n].primKey,e[n].indexes))})}function tG(e,t){e.createIndex(t.name,t.keyPath,{unique:t.unique,multiEntry:t.multi})}function tW(e,t,n){var r={};return m(t.objectStoreNames,0).forEach(function(e){for(var t=n.objectStore(e),i=tC(tI(s=t.keyPath),s||"",!0,!1,!!t.autoIncrement,s&&"string"!=typeof s,!0),o=[],u=0;u<t.indexNames.length;++u){var a=t.index(t.indexNames[u]),s=a.keyPath,a=tC(a.name,s,!!a.unique,!!a.multiEntry,!1,s&&"string"!=typeof s,!1);o.push(a)}r[e]=tB(e,i,o)}),r}function tY(e,t,n){for(var r=n.db.objectStoreNames,o=0;o<r.length;++o){var u=r[o],a=n.objectStore(u);e._hasGetAll="getAll"in a;for(var s=0;s<a.indexNames.length;++s){var c=a.indexNames[s],l=a.index(c).keyPath,f="string"==typeof l?l:"["+m(l).join("+")+"]";!t[u]||(l=t[u].idxByName[f])&&(l.name=c,delete t[u].idxByName[f],t[u].idxByName[c]=l)}}"undefined"!=typeof navigator&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&i.WorkerGlobalScope&&i instanceof i.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(e._hasGetAll=!1)}function tX(e){return e.split(",").map(function(e,t){var n=(e=e.trim()).replace(/([&*]|\+\+)/g,""),r=/^\[/.test(n)?n.match(/^\[(.*)\]$/)[1].split("+"):n;return tC(n,r||null,/\&/.test(e),/\*/.test(e),/\+\+/.test(e),u(r),0===t)})}var tH=(tQ.prototype._parseStoresSpec=function(e,t){o(e).forEach(function(n){if(null!==e[n]){var r=tX(e[n]),i=r.shift();if(i.unique=!0,i.multi)throw new G.Schema("Primary key cannot be multi-valued");r.forEach(function(e){if(e.auto)throw new G.Schema("Only primary key can be marked as autoIncrement (++)");if(!e.keyPath)throw new G.Schema("Index must have a name and cannot be an empty string")}),t[n]=tB(n,i,r)}})},tQ.prototype.stores=function(e){var t=this.db;this._cfg.storesSource=this._cfg.storesSource?a(this._cfg.storesSource,e):e;var e=t._versions,n={},r={};return e.forEach(function(e){a(n,e._cfg.storesSource),r=e._cfg.dbschema={},e._parseStoresSpec(n,r)}),t._dbSchema=r,t$(t,[t._allTables,t,t.Transaction.prototype]),tF(t,[t._allTables,t,t.Transaction.prototype,this._cfg.tables],o(r),r),t._storeNames=o(r),this},tQ.prototype.upgrade=function(e){return this._cfg.contentUpgrade=er(this._cfg.contentUpgrade||X,e),this},tQ);function tQ(){}function tJ(e,t){var n=e._dbNamesDB;return n||(n=e._dbNamesDB=new nO(eZ,{addons:[],indexedDB:e,IDBKeyRange:t})).version(1).stores({dbnames:"name"}),n.table("dbnames")}function tZ(e){return e&&"function"==typeof e.databases}function t0(e){return eN(function(){return ey.letThrough=!0,e()})}function t1(e){return!("from"in e)}var t6=function(e,t){if(!this){var n=new t6;return e&&"d"in e&&a(n,e),n}a(this,arguments.length?{d:1,from:e,to:1<arguments.length?t:e}:{d:0})};function t2(e,t,n){var r=e4(t,n);if(!isNaN(r)){if(0<r)throw RangeError();if(t1(e))return a(e,{from:t,to:n,d:1});var i=e.l,r=e.r;if(0>e4(n,e.from))return i?t2(i,t,n):e.l={from:t,to:n,d:1,l:null,r:null},t5(e);if(0<e4(t,e.to))return r?t2(r,t,n):e.r={from:t,to:n,d:1,l:null,r:null},t5(e);0>e4(t,e.from)&&(e.from=t,e.l=null,e.d=r?r.d+1:1),0<e4(n,e.to)&&(e.to=n,e.r=null,e.d=e.l?e.l.d+1:1),n=!e.r,i&&!e.l&&t3(e,i),r&&n&&t3(e,r)}}function t3(e,t){t1(t)||function e(t,n){var r=n.from,i=n.to,o=n.l,n=n.r;t2(t,r,i),o&&e(t,o),n&&e(t,n)}(e,t)}function t8(e,t){var n=t4(t),r=n.next();if(r.done)return!1;for(var i=r.value,o=t4(e),u=o.next(i.from),a=u.value;!r.done&&!u.done;){if(0>=e4(a.from,i.to)&&0<=e4(a.to,i.from))return!0;0>e4(i.from,a.from)?i=(r=n.next(a.from)).value:a=(u=o.next(i.from)).value}return!1}function t4(e){var t=t1(e)?null:{s:0,n:e};return{next:function(e){for(var n=0<arguments.length;t;)switch(t.s){case 0:if(t.s=1,n)for(;t.n.l&&0>e4(e,t.n.from);)t={up:t,n:t.n.l,s:1};else for(;t.n.l;)t={up:t,n:t.n.l,s:1};case 1:if(t.s=2,!n||0>=e4(e,t.n.to))return{value:t.n,done:!1};case 2:if(t.n.r){t.s=3,t={up:t,n:t.n.r,s:0};continue}case 3:t=t.up}return{done:!0}}}}function t5(e){var n,r,i=((null===(n=e.r)||void 0===n?void 0:n.d)||0)-((null===(r=e.l)||void 0===r?void 0:r.d)||0),o=1<i?"r":i<-1?"l":"";o&&(n="r"==o?"l":"r",r=t({},e),i=e[o],e.from=i.from,e.to=i.to,e[o]=i[o],r[o]=i[n],(e[n]=r).d=t9(r)),e.d=t9(e)}function t9(e){var t=e.r,e=e.l;return(t?e?Math.max(t.d,e.d):t.d:e?e.d:0)+1}function t7(e,t){return o(t).forEach(function(n){e[n]?t3(e[n],t[n]):e[n]=function e(t){var n,r,i={};for(n in t)l(t,n)&&(r=t[n],i[n]=!r||"object"!=typeof r||A.has(r.constructor)?r:e(r));return i}(t[n])}),e}function ne(e,t){return e.all||t.all||Object.keys(e).some(function(n){return t[n]&&t8(t[n],e[n])})}f(t6.prototype,((M={add:function(e){return t3(this,e),this},addKey:function(e){return t2(this,e,e),this},addKeys:function(e){var t=this;return e.forEach(function(e){return t2(t,e,e)}),this}})[I]=function(){return t4(this)},M));var nt={},nn={},nr=!1;function ni(e){t7(nn,e),nr||(nr=!0,setTimeout(function(){nr=!1,no(nn,(nn={},!1))},0))}function no(e,t){void 0===t&&(t=!1);var n=new Set;if(e.all)for(var r=0,i=Object.values(nt);r<i.length;r++)nu(u=i[r],e,n,t);else for(var o in e){var u,a=/^idb\:\/\/(.*)\/(.*)\//.exec(o);a&&(o=a[1],a=a[2],(u=nt["idb://".concat(o,"/").concat(a)])&&nu(u,e,n,t))}n.forEach(function(e){return e()})}function nu(e,t,n,r){for(var i=[],o=0,u=Object.entries(e.queries.query);o<u.length;o++){for(var a=u[o],s=a[0],c=[],l=0,f=a[1];l<f.length;l++){var h=f[l];ne(t,h.obsSet)?h.subscribers.forEach(function(e){return n.add(e)}):r&&c.push(h)}r&&i.push([s,c])}if(r)for(var d=0;d<i.length;d++){var p=i[d],s=p[0],c=p[1];e.queries.query[s]=c}}function na(e){function t(t){return e.next(t)}var n=i(t),r=i(function(t){return e.throw(t)});function i(e){return function(t){var i=e(t),t=i.value;return i.done?t:t&&"function"==typeof t.then?t.then(n,r):u(t)?Promise.all(t).then(n,r):n(t)}}return i(t)()}function ns(e,t,n){for(var r=u(e)?e.slice():[e],i=0;i<n;++i)r.push(t);return r}var nc={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(e){return t(t({},e),{table:function(n){var r=e.table(n),i=r.schema,o={},u=[];function a(e,n,r){var i=tN(e),s=o[i]=o[i]||[],c=null==e?0:"string"==typeof e?1:e.length,l=0<n,l=t(t({},r),{name:l?"".concat(i,"(virtual-from:").concat(r.name,")"):r.name,lowLevelIndex:r,isVirtual:l,keyTail:n,keyLength:c,extractKey:tq(e),unique:!l&&r.unique});return s.push(l),l.isPrimaryKey||u.push(l),1<c&&a(2===c?e[0]:e.slice(0,c-1),n+1,r),s.sort(function(e,t){return e.keyTail-t.keyTail}),l}n=a(i.primaryKey.keyPath,0,i.primaryKey),o[":id"]=[n];for(var s=0,c=i.indexes;s<c.length;s++){var l=c[s];a(l.keyPath,0,l)}function f(n){var r,i=n.query.index;return i.isVirtual?t(t({},n),{query:{index:i.lowLevelIndex,range:(r=n.query.range,i=i.keyTail,{type:1===r.type?2:r.type,lower:ns(r.lower,r.lowerOpen?e.MAX_KEY:e.MIN_KEY,i),lowerOpen:!0,upper:ns(r.upper,r.upperOpen?e.MIN_KEY:e.MAX_KEY,i),upperOpen:!0})}}):n}return t(t({},r),{schema:t(t({},i),{primaryKey:n,indexes:u,getIndexByKeyPath:function(e){return(e=o[tN(e)])&&e[0]}}),count:function(e){return r.count(f(e))},query:function(e){return r.query(f(e))},openCursor:function(t){var n=t.query.index,i=n.keyTail,o=n.isVirtual,u=n.keyLength;return o?r.openCursor(f(t)).then(function(n){return n&&Object.create(n,{continue:{value:function(r){null!=r?n.continue(ns(r,t.reverse?e.MAX_KEY:e.MIN_KEY,i)):t.unique?n.continue(n.key.slice(0,u).concat(t.reverse?e.MIN_KEY:e.MAX_KEY,i)):n.continue()}},continuePrimaryKey:{value:function(t,r){n.continuePrimaryKey(ns(t,e.MAX_KEY,i),r)}},primaryKey:{get:function(){return n.primaryKey}},key:{get:function(){var e=n.key;return 1===u?e[0]:e.slice(0,u)}},value:{get:function(){return n.value}}})}):r.openCursor(t)}})}})}};function nl(e,t,n,r){return n=n||{},r=r||"",o(e).forEach(function(i){var o,u,a;l(t,i)?(o=e[i],u=t[i],"object"==typeof o&&"object"==typeof u&&o&&u?(a=C(o))!==C(u)?n[r+i]=t[i]:"Object"===a?nl(o,u,n,r+i+"."):o!==u&&(n[r+i]=t[i]):o!==u&&(n[r+i]=t[i])):n[r+i]=void 0}),o(t).forEach(function(i){l(e,i)||(n[r+i]=t[i])}),n}function nf(e,t){return"delete"===t.type?t.keys:t.keys||t.values.map(e.extractKey)}var nh={stack:"dbcore",name:"HooksMiddleware",level:2,create:function(e){return t(t({},e),{table:function(n){var i=e.table(n),o=i.schema.primaryKey;return t(t({},i),{mutate:function(e){var u=ey.trans,a=u.table(n).hook,s=a.deleting,c=a.creating,f=a.updating;switch(e.type){case"add":if(c.fire===X)break;return u._promise("readwrite",function(){return h(e)},!0);case"put":if(c.fire===X&&f.fire===X)break;return u._promise("readwrite",function(){return h(e)},!0);case"delete":if(s.fire===X)break;return u._promise("readwrite",function(){return h(e)},!0);case"deleteRange":if(s.fire===X)break;return u._promise("readwrite",function(){return function e(n,r,u){return i.query({trans:n,values:!1,query:{index:o,range:r},limit:u}).then(function(i){var o=i.result;return h({type:"delete",keys:o,trans:n}).then(function(i){return 0<i.numFailures?Promise.reject(i.failures[0]):o.length<u?{failures:[],numFailures:0,lastResult:void 0}:e(n,t(t({},r),{lower:o[o.length-1],lowerOpen:!0}),u)})})}(e.trans,e.range,1e4)},!0)}return i.mutate(e);function h(e){var n,u=ey.trans,a=e.keys||nf(o,e);if(!a)throw Error("Keys missing");return"delete"!==(e="add"===e.type||"put"===e.type?t(t({},e),{keys:a}):t({},e)).type&&(e.values=r([],e.values,!0)),e.keys&&(e.keys=r([],e.keys,!0)),("add"===(n=e).type?Promise.resolve([]):i.getMany({trans:n.trans,keys:a,cache:"immutable"})).then(function(t){var n=a.map(function(n,r){var i,a,h,d=t[r],p={onerror:null,onsuccess:null};return"delete"===e.type?s.fire.call(p,n,d,u):"add"===e.type||void 0===d?(i=c.fire.call(p,n,e.values[r],u),null==n&&null!=i&&(e.keys[r]=n=i,o.outbound||x(e.values[r],o.keyPath,n))):(i=nl(d,e.values[r]),(a=f.fire.call(p,i,n,d,u))&&(h=e.values[r],Object.keys(a).forEach(function(e){l(h,e)?h[e]=a[e]:x(h,e,a[e])}))),p});return i.mutate(e).then(function(r){for(var i=r.failures,o=r.results,u=r.numFailures,r=r.lastResult,s=0;s<a.length;++s){var c=(o||a)[s],l=n[s];null==c?l.onerror&&l.onerror(i[s]):l.onsuccess&&l.onsuccess("put"===e.type&&t[s]?e.values[s]:c)}return{failures:i,results:o,numFailures:u,lastResult:r}}).catch(function(e){return n.forEach(function(t){return t.onerror&&t.onerror(e)}),Promise.reject(e)})})}}})}})}};function nd(e,t,n){try{if(!t||t.keys.length<e.length)return null;for(var r=[],i=0,o=0;i<t.keys.length&&o<e.length;++i)0===e4(t.keys[i],e[o])&&(r.push(n?j(t.values[i]):t.values[i]),++o);return r.length===e.length?r:null}catch(e){return null}}var np={stack:"dbcore",level:-1,create:function(e){return{table:function(n){var r=e.table(n);return t(t({},r),{getMany:function(e){if(!e.cache)return r.getMany(e);var t=nd(e.keys,e.trans._cache,"clone"===e.cache);return t?eg.resolve(t):r.getMany(e).then(function(t){return e.trans._cache={keys:e.keys,values:"clone"===e.cache?j(t):t},t})},mutate:function(e){return"add"!==e.type&&(e.trans._cache=null),r.mutate(e)}})}}}};function ny(e,t){return"readonly"===e.trans.mode&&!!e.subscr&&!e.trans.explicit&&"disabled"!==e.trans.db._options.cache&&!t.schema.primaryKey.outbound}function nv(e,t){switch(e){case"query":return t.values&&!t.unique;case"get":case"getMany":case"count":case"openCursor":return!1}}var nm={stack:"dbcore",level:0,name:"Observability",create:function(e){var n=e.schema.name,r=new t6(e.MIN_KEY,e.MAX_KEY);return t(t({},e),{transaction:function(t,n,r){if(ey.subscr&&"readonly"!==n)throw new G.ReadOnly("Readwrite transaction in liveQuery context. Querier source: ".concat(ey.querier));return e.transaction(t,n,r)},table:function(i){var a=e.table(i),s=a.schema,c=s.primaryKey,l=s.indexes,f=c.extractKey,h=c.outbound,d=c.autoIncrement&&l.filter(function(e){return e.compound&&e.keyPath.includes(c.keyPath)}),p=t(t({},a),{mutate:function(e){function t(e){return h[e="idb://".concat(n,"/").concat(i,"/").concat(e)]||(h[e]=new t6)}var o,l,f=e.trans,h=e.mutatedParts||(e.mutatedParts={}),p=t(""),y=t(":dels"),v=e.type,m="deleteRange"===e.type?[e.range]:"delete"===e.type?[e.keys]:e.values.length<50?[nf(c,e).filter(function(e){return e}),e.values]:[],b=m[0],g=m[1],m=e.trans._cache;return u(b)?(p.addKeys(b),(m="delete"===v||b.length===g.length?nd(b,m):null)||y.addKeys(b),(m||g)&&(o=m,l=g,s.indexes.forEach(function(e){var n=t(e.name||"");function r(t){return null!=t?e.extractKey(t):null}function i(t){return e.multiEntry&&u(t)?t.forEach(function(e){return n.addKey(e)}):n.addKey(t)}(o||l).forEach(function(e,t){var n=o&&r(o[t]),t=l&&r(l[t]);0!==e4(n,t)&&(null!=n&&i(n),null!=t&&i(t))})}))):b?(g={from:b.lower,to:b.upper},y.add(g),p.add(g)):(p.add(r),y.add(r),s.indexes.forEach(function(e){return t(e.name).add(r)})),a.mutate(e).then(function(n){return!b||"add"!==e.type&&"put"!==e.type||(p.addKeys(n.results),d&&d.forEach(function(r){var i=e.values.map(function(e){return r.extractKey(e)}),o=r.keyPath.findIndex(function(e){return e===c.keyPath});n.results.forEach(function(e){return i[o]=e}),t(r.name).addKeys(i)})),f.mutatedParts=t7(f.mutatedParts||{},h),n})}}),l=function(t){var n=t.query,t=n.index,n=n.range;return[t,new t6(null!==(t=n.lower)&&void 0!==t?t:e.MIN_KEY,null!==(n=n.upper)&&void 0!==n?n:e.MAX_KEY)]},y={get:function(e){return[c,new t6(e.key)]},getMany:function(e){return[c,(new t6).addKeys(e.keys)]},count:l,query:l,openCursor:l};return o(y).forEach(function(e){p[e]=function(o){var u=ey.subscr,s=!!u,c=ny(ey,a)&&nv(e,o)?o.obsSet={}:u;if(s){var l=function(e){return c[e="idb://".concat(n,"/").concat(i,"/").concat(e)]||(c[e]=new t6)},d=l(""),p=l(":dels"),u=y[e](o),s=u[0],u=u[1];if(("query"===e&&s.isPrimaryKey&&!o.values?p:l(s.name||"")).add(u),!s.isPrimaryKey){if("count"!==e){var v="query"===e&&h&&o.values&&a.query(t(t({},o),{values:!1}));return a[e].apply(this,arguments).then(function(t){if("query"===e){if(h&&o.values)return v.then(function(e){return e=e.result,d.addKeys(e),t});var n=o.values?t.result.map(f):t.result;(o.values?d:p).addKeys(n)}else if("openCursor"===e){var r=o.values;return t&&Object.create(t,{key:{get:function(){return p.addKey(t.primaryKey),t.key}},primaryKey:{get:function(){var e=t.primaryKey;return p.addKey(e),e}},value:{get:function(){return r&&d.addKey(t.primaryKey),t.value}}})}return t})}p.add(r)}}return a[e].apply(this,arguments)}}),p}})}};function nb(e,n,r){if(0===r.numFailures)return n;if("deleteRange"===n.type)return null;var i=n.keys?n.keys.length:"values"in n&&n.values?n.values.length:1;return r.numFailures===i?null:(u((n=t({},n)).keys)&&(n.keys=n.keys.filter(function(e,t){return!(t in r.failures)})),"values"in n&&u(n.values)&&(n.values=n.values.filter(function(e,t){return!(t in r.failures)})),n)}function ng(e,t){return(void 0===t.lower||(t.lowerOpen?0<e4(e,t.lower):0<=e4(e,t.lower)))&&(void 0===t.upper||(t.upperOpen?0>e4(e,t.upper):0>=e4(e,t.upper)))}function nw(e,t,n,r,i,o){if(!n||0===n.length)return e;var a=t.query.index,s=a.multiEntry,c=t.query.range,l=r.schema.primaryKey.extractKey,f=a.extractKey,h=(a.lowLevelIndex||a).extractKey,n=n.reduce(function(e,n){var r=e,i="add"===n.type||"put"===n.type?n.values.filter(function(e){return e=f(e),s&&u(e)?e.some(function(e){return ng(e,c)}):ng(e,c)}).map(function(e){return e=j(e),o&&Object.freeze(e),e}):[];switch(n.type){case"add":r=e.concat(t.values?i:i.map(function(e){return l(e)}));break;case"put":var a=(new t6).addKeys(n.values.map(function(e){return l(e)})),r=e.filter(function(e){return!t8(new t6(e=t.values?l(e):e),a)}).concat(t.values?i:i.map(function(e){return l(e)}));break;case"delete":var h=(new t6).addKeys(n.keys);r=e.filter(function(e){return!t8(new t6(e=t.values?l(e):e),h)});break;case"deleteRange":var d=n.range;r=e.filter(function(e){return!ng(l(e),d)})}return r},e);return n===e?e:(n.sort(function(e,t){return e4(h(e),h(t))||e4(l(e),l(t))}),t.limit&&t.limit<1/0&&(n.length>t.limit?n.length=t.limit:e.length===t.limit&&n.length<t.limit&&(i.dirty=!0)),o?Object.freeze(n):n)}function n_(e,t){return 0===e4(e.lower,t.lower)&&0===e4(e.upper,t.upper)&&!!e.lowerOpen==!!t.lowerOpen&&!!e.upperOpen==!!t.upperOpen}var nx={stack:"dbcore",level:0,name:"Cache",create:function(e){var n=e.schema.name;return t(t({},e),{transaction:function(t,r,i){var o,u,a=e.transaction(t,r,i);return"readwrite"===r&&(u=(o=new AbortController).signal,i=function(i){return function(){if(o.abort(),"readwrite"===r){for(var u=new Set,s=0;s<t.length;s++){var c=t[s],l=nt["idb://".concat(n,"/").concat(c)];if(l){var f=e.table(c),h=l.optimisticOps.filter(function(e){return e.trans===a});if(a._explicit&&i&&a.mutatedParts)for(var d=0,p=Object.values(l.queries.query);d<p.length;d++)for(var y=0,v=(g=p[d]).slice();y<v.length;y++)ne((w=v[y]).obsSet,a.mutatedParts)&&(T(g,w),w.subscribers.forEach(function(e){return u.add(e)}));else if(0<h.length){l.optimisticOps=l.optimisticOps.filter(function(e){return e.trans!==a});for(var m=0,b=Object.values(l.queries.query);m<b.length;m++)for(var g,w,_,x=0,k=(g=b[m]).slice();x<k.length;x++)null!=(w=k[x]).res&&a.mutatedParts&&(i&&!w.dirty?(_=Object.isFrozen(w.res),_=nw(w.res,w.req,h,f,w,_),w.dirty?(T(g,w),w.subscribers.forEach(function(e){return u.add(e)})):_!==w.res&&(w.res=_,w.promise=eg.resolve({result:_}))):(w.dirty&&T(g,w),w.subscribers.forEach(function(e){return u.add(e)})))}}}u.forEach(function(e){return e()})}}},a.addEventListener("abort",i(!1),{signal:u}),a.addEventListener("error",i(!1),{signal:u}),a.addEventListener("complete",i(!0),{signal:u})),a},table:function(r){var i=e.table(r),o=i.schema.primaryKey;return t(t({},i),{mutate:function(e){var u=ey.trans;if(o.outbound||"disabled"===u.db._options.cache||u.explicit)return i.mutate(e);var a=nt["idb://".concat(n,"/").concat(r)];return a?(u=i.mutate(e),("add"===e.type||"put"===e.type)&&(50<=e.values.length||nf(o,e).some(function(e){return null==e}))?u.then(function(n){var r=nb(0,t(t({},e),{values:e.values.map(function(e,r){var i,e=null!==(i=o.keyPath)&&void 0!==i&&i.includes(".")?j(e):t({},e);return x(e,o.keyPath,n.results[r]),e})}),n);a.optimisticOps.push(r),queueMicrotask(function(){return e.mutatedParts&&ni(e.mutatedParts)})}):(a.optimisticOps.push(e),e.mutatedParts&&ni(e.mutatedParts),u.then(function(t){0<t.numFailures&&(T(a.optimisticOps,e),(t=nb(0,e,t))&&a.optimisticOps.push(t),e.mutatedParts&&ni(e.mutatedParts))}),u.catch(function(){T(a.optimisticOps,e),e.mutatedParts&&ni(e.mutatedParts)})),u):i.mutate(e)},query:function(e){if(!ny(ey,i)||!nv("query",e))return i.query(e);var t,o,u="immutable"===(null===(l=ey.trans)||void 0===l?void 0:l.db._options.cache),a=ey,s=a.requery,c=a.signal,l=function(e,t,n,r){var i=nt["idb://".concat(e,"/").concat(t)];if(!i)return[];if(!(t=i.queries[n]))return[null,!1,i,null];var o=t[(r.query?r.query.index.name:null)||""];if(!o)return[null,!1,i,null];switch(n){case"query":var u=o.find(function(e){return e.req.limit===r.limit&&e.req.values===r.values&&n_(e.req.query.range,r.query.range)});return u?[u,!0,i,o]:[o.find(function(e){var t,n;return("limit"in e.req?e.req.limit:1/0)>=r.limit&&(!r.values||e.req.values)&&(t=e.req.query.range,n=r.query.range,0>=function(e,t,n,r){if(void 0===e)return void 0!==t?-1:0;if(void 0===t)return 1;if(0===(t=e4(e,t))){if(n&&r)return 0;if(n)return 1;if(r)return -1}return t}(t.lower,n.lower,t.lowerOpen,n.lowerOpen)&&0<=function(e,t,n,r){if(void 0===e)return void 0!==t?1:0;if(void 0===t)return -1;if(0===(t=e4(e,t))){if(n&&r)return 0;if(n)return -1;if(r)return 1}return t}(t.upper,n.upper,t.upperOpen,n.upperOpen))}),!1,i,o];case"count":return[u=o.find(function(e){return n_(e.req.query.range,r.query.range)}),!!u,i,o]}}(n,r,"query",e),f=l[0],a=l[1],h=l[2],d=l[3];return f&&a?f.obsSet=e.obsSet:(a=i.query(e).then(function(e){var t=e.result;if(f&&(f.res=t),u){for(var n=0,r=t.length;n<r;++n)Object.freeze(t[n]);Object.freeze(t)}else e.result=j(t);return e}).catch(function(e){return d&&f&&T(d,f),Promise.reject(e)}),f={obsSet:e.obsSet,promise:a,subscribers:new Set,type:"query",req:e,dirty:!1},d?d.push(f):(d=[f],(h=h||(nt["idb://".concat(n,"/").concat(r)]={queries:{query:{},count:{}},objs:new Map,optimisticOps:[],unsignaledParts:{}})).queries.query[e.query.index.name||""]=d)),t=f,o=d,t.subscribers.add(s),c.addEventListener("abort",function(){t.subscribers.delete(s),0===t.subscribers.size&&setTimeout(function(){0===t.subscribers.size&&T(o,t)},3e3)}),f.promise.then(function(t){return{result:nw(t.result,e,null==h?void 0:h.optimisticOps,i,f,u)}})}})}})}};function nk(e,t){return new Proxy(e,{get:function(e,n,r){return"db"===n?t:Reflect.get(e,n,r)}})}var nO=(nE.prototype.version=function(e){if(isNaN(e)||e<.1)throw new G.Type("Given version is not a positive number");if(e=Math.round(10*e)/10,this.idbdb||this._state.isBeingOpened)throw new G.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,e);var t=this._versions,n=t.filter(function(t){return t._cfg.version===e})[0];return n||(n=new this.Version(e),t.push(n),t.sort(tz),n.stores({}),this._state.autoSchema=!1,n)},nE.prototype._whenReady=function(e){var t=this;return this.idbdb&&(this._state.openComplete||ey.letThrough||this._vip)?e():new eg(function(e,n){if(t._state.openComplete)return n(new G.DatabaseClosed(t._state.dbOpenError));if(!t._state.isBeingOpened){if(!t._state.autoOpen)return void n(new G.DatabaseClosed);t.open().catch(X)}t._state.dbReadyPromise.then(e,n)}).then(e)},nE.prototype.use=function(e){var t=e.stack,n=e.create,r=e.level,i=e.name;return i&&this.unuse({stack:t,name:i}),(e=this._middlewares[t]||(this._middlewares[t]=[])).push({stack:t,create:n,level:null==r?10:r,name:i}),e.sort(function(e,t){return e.level-t.level}),this},nE.prototype.unuse=function(e){var t=e.stack,n=e.name,r=e.create;return t&&this._middlewares[t]&&(this._middlewares[t]=this._middlewares[t].filter(function(e){return r?e.create!==r:!!n&&e.name!==n})),this},nE.prototype.open=function(){var e=this;return eV(ep,function(){return function(e){var t=e._state,n=e._deps.indexedDB;if(t.isBeingOpened||e.idbdb)return t.dbReadyPromise.then(function(){return t.dbOpenError?eY(t.dbOpenError):e});t.isBeingOpened=!0,t.dbOpenError=null,t.openComplete=!1;var r=t.openCanceller,i=Math.round(10*e.verno),u=!1;function a(){if(t.openCanceller!==r)throw new G.DatabaseClosed("db.open() was cancelled")}var s,c=t.dbReadyResolve,l=null,f=!1;return eg.race([r,("undefined"==typeof navigator?eg.resolve():!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise(function(e){function t(){return indexedDB.databases().finally(e)}s=setInterval(t,100),t()}).finally(function(){return clearInterval(s)}):Promise.resolve()).then(function r(){return new eg(function(s,c){if(a(),!n)throw new G.MissingAPI;var h=e.name,d=t.autoSchema||!i?n.open(h):n.open(h,i);if(!d)throw new G.MissingAPI;d.onerror=tO(c),d.onblocked=eC(e._fireOnBlocked),d.onupgradeneeded=eC(function(r){var i,a,s,p,y,v,m;l=d.transaction,t.autoSchema&&!e._options.allowEmptyDB?(d.onerror=tE,l.abort(),d.result.close(),(i=n.deleteDatabase(h)).onsuccess=i.onerror=eC(function(){c(new G.NoSuchDatabase("Database ".concat(h," doesnt exist")))})):(l.onerror=tO(c),f=(r=r.oldVersion>0x4000000000000000?0:r.oldVersion)<1,e.idbdb=d.result,u&&function(e,t){tV(e._dbSchema,t),t.db.version%10!=0||t.objectStoreNames.contains("$meta")||t.db.createObjectStore("$meta").add(Math.ceil(t.db.version/10-1),"version");var n=tW(0,e.idbdb,t);tY(e,e._dbSchema,t);for(var r=0,i=tU(n,e._dbSchema).change;r<i.length;r++){var o=function(e){if(e.change.length||e.recreate)return console.warn("Unable to patch indexes of table ".concat(e.name," because it has changes on the type of index or primary key.")),{value:void 0};var n=t.objectStore(e.name);e.add.forEach(function(t){ei&&console.debug("Dexie upgrade patch: Creating missing index ".concat(e.name,".").concat(t.src)),tG(n,t)})}(i[r]);if("object"==typeof o)return o.value}}(e,l),a=r/10,s=l,p=e._dbSchema,s.objectStoreNames.contains("$meta")&&!p.$meta&&(p.$meta=tB("$meta",tX("")[0],[]),e._storeNames.push("$meta")),(y=e._createTransaction("readwrite",e._storeNames,p)).create(s),y._completion.catch(c),v=y._reject.bind(y),m=ey.transless||ey,eN(function(){return ey.trans=y,ey.transless=m,0!==a?(tM(e,s),(y.storeNames.includes("$meta")?y.table("$meta").get("version").then(function(e){return null!=e?e:a}):eg.resolve(a)).then(function(t){var n,r,i;return n=t,r=[],t=e._versions,i=e._dbSchema=tW(0,e.idbdb,s),0!==(t=t.filter(function(e){return e._cfg.version>=n})).length?(t.forEach(function(t){r.push(function(){var r=i,u=t._cfg.dbschema;tY(e,r,s),tY(e,u,s),i=e._dbSchema=u;var a=tU(r,u);a.add.forEach(function(e){tL(s,e[0],e[1].primKey,e[1].indexes)}),a.change.forEach(function(e){if(e.recreate)throw new G.Upgrade("Not yet support for changing primary key");var t=s.objectStore(e.name);e.add.forEach(function(e){return tG(t,e)}),e.change.forEach(function(e){t.deleteIndex(e.name),tG(t,e)}),e.del.forEach(function(e){return t.deleteIndex(e)})});var c=t._cfg.contentUpgrade;if(c&&t._cfg.version>n){tM(e,s),y._memoizedTables={};var l=k(u);a.del.forEach(function(e){l[e]=r[e]}),t$(e,[e.Transaction.prototype]),tF(e,[e.Transaction.prototype],o(l),l),y.schema=l;var f,h=D(c);return h&&eM(),a=eg.follow(function(){var e;(f=c(y))&&h&&(e=eF.bind(null,null),f.then(e,e))}),f&&"function"==typeof f.then?eg.resolve(f):a.then(function(){return f})}}),r.push(function(n){var r=t._cfg.dbschema;[].slice.call(n.db.objectStoreNames).forEach(function(e){return null==r[e]&&n.db.deleteObjectStore(e)}),t$(e,[e.Transaction.prototype]),tF(e,[e.Transaction.prototype],e._storeNames,e._dbSchema),y.schema=e._dbSchema}),r.push(function(n){e.idbdb.objectStoreNames.contains("$meta")&&(Math.ceil(e.idbdb.version/10)===t._cfg.version?(e.idbdb.deleteObjectStore("$meta"),delete e._dbSchema.$meta,e._storeNames=e._storeNames.filter(function(e){return"$meta"!==e})):n.objectStore("$meta").put(t._cfg.version,"version"))})}),(function e(){return r.length?eg.resolve(r.shift()(y.idbtrans)).then(e):eg.resolve()})().then(function(){tV(i,s)})):eg.resolve()}).catch(v)):(o(p).forEach(function(e){tL(s,e,p[e].primKey,p[e].indexes)}),tM(e,s),void eg.follow(function(){return e.on.populate.fire(y)}).catch(v))}))},c),d.onsuccess=eC(function(){l=null;var n,a,c,p=e.idbdb=d.result,y=m(p.objectStoreNames);if(0<y.length)try{var v=p.transaction(1===y.length?y[0]:y,"readonly");if(t.autoSchema)n=p,a=v,e.verno=n.version/10,a=e._dbSchema=tW(0,n,a),e._storeNames=m(n.objectStoreNames,0),tF(e,[e._allTables],o(a),a);else if(tY(e,e._dbSchema,v),((c=tU(tW(0,(c=e).idbdb,v),c._dbSchema)).add.length||c.change.some(function(e){return e.add.length||e.change.length}))&&!u)return console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Dexie will add missing parts and increment native version number to workaround this."),p.close(),i=p.version+1,u=!0,s(r());tM(e,v)}catch(e){}eJ.push(e),p.onversionchange=eC(function(n){t.vcFired=!0,e.on("versionchange").fire(n)}),p.onclose=eC(function(t){e.on("close").fire(t)}),f&&(c=e._deps,v=h,p=c.indexedDB,c=c.IDBKeyRange,tZ(p)||v===eZ||tJ(p,c).put({name:v}).catch(X)),s()},c)}).catch(function(e){switch(null==e?void 0:e.name){case"UnknownError":if(0<t.PR1398_maxLoop)return t.PR1398_maxLoop--,console.warn("Dexie: Workaround for Chrome UnknownError on open()"),r();break;case"VersionError":if(0<i)return i=0,r()}return eg.reject(e)})})]).then(function(){return a(),t.onReadyBeingFired=[],eg.resolve(t0(function(){return e.on.ready.fire(e.vip)})).then(function n(){if(0<t.onReadyBeingFired.length){var r=t.onReadyBeingFired.reduce(er,X);return t.onReadyBeingFired=[],eg.resolve(t0(function(){return r(e.vip)})).then(n)}})}).finally(function(){t.openCanceller===r&&(t.onReadyBeingFired=null,t.isBeingOpened=!1)}).catch(function(n){t.dbOpenError=n;try{l&&l.abort()}catch(e){}return r===t.openCanceller&&e._close(),eY(n)}).finally(function(){t.openComplete=!0,c()}).then(function(){var t;return f&&(t={},e.tables.forEach(function(n){n.schema.indexes.forEach(function(r){r.name&&(t["idb://".concat(e.name,"/").concat(n.name,"/").concat(r.name)]=new t6(-1/0,[[[]]]))}),t["idb://".concat(e.name,"/").concat(n.name,"/")]=t["idb://".concat(e.name,"/").concat(n.name,"/:dels")]=new t6(-1/0,[[[]]])}),tS(tP).fire(t),no(t,!0)),e})}(e)})},nE.prototype._close=function(){var e=this._state,t=eJ.indexOf(this);if(0<=t&&eJ.splice(t,1),this.idbdb){try{this.idbdb.close()}catch(e){}this.idbdb=null}e.isBeingOpened||(e.dbReadyPromise=new eg(function(t){e.dbReadyResolve=t}),e.openCanceller=new eg(function(t,n){e.cancelOpen=n}))},nE.prototype.close=function(e){var t=(void 0===e?{disableAutoOpen:!0}:e).disableAutoOpen,e=this._state;t?(e.isBeingOpened&&e.cancelOpen(new G.DatabaseClosed),this._close(),e.autoOpen=!1,e.dbOpenError=new G.DatabaseClosed):(this._close(),e.autoOpen=this._options.autoOpen||e.isBeingOpened,e.openComplete=!1,e.dbOpenError=null)},nE.prototype.delete=function(e){var t=this;void 0===e&&(e={disableAutoOpen:!0});var n=0<arguments.length&&"object"!=typeof arguments[0],r=this._state;return new eg(function(i,o){function u(){t.close(e);var n=t._deps.indexedDB.deleteDatabase(t.name);n.onsuccess=eC(function(){var e,n,r;e=t._deps,n=t.name,r=e.indexedDB,e=e.IDBKeyRange,tZ(r)||n===eZ||tJ(r,e).delete(n).catch(X),i()}),n.onerror=tO(o),n.onblocked=t._fireOnBlocked}if(n)throw new G.InvalidArgument("Invalid closeOptions argument to db.delete()");r.isBeingOpened?r.dbReadyPromise.then(u):u()})},nE.prototype.backendDB=function(){return this.idbdb},nE.prototype.isOpen=function(){return null!==this.idbdb},nE.prototype.hasBeenClosed=function(){var e=this._state.dbOpenError;return e&&"DatabaseClosed"===e.name},nE.prototype.hasFailed=function(){return null!==this._state.dbOpenError},nE.prototype.dynamicallyOpened=function(){return this._state.autoSchema},Object.defineProperty(nE.prototype,"tables",{get:function(){var e=this;return o(this._allTables).map(function(t){return e._allTables[t]})},enumerable:!1,configurable:!0}),nE.prototype.transaction=function(){var e=(function(e,t,n){var r=arguments.length;if(r<2)throw new G.InvalidArgument("Too few arguments");for(var i=Array(r-1);--r;)i[r-1]=arguments[r];return n=i.pop(),[e,E(i),n]}).apply(this,arguments);return this._transaction.apply(this,e)},nE.prototype._transaction=function(e,t,n){var r=this,i=ey.trans;i&&i.db===this&&-1===e.indexOf("!")||(i=null);var o,u,a=-1!==e.indexOf("?");e=e.replace("!","").replace("?","");try{if(u=t.map(function(e){if(e=e instanceof r.Table?e.name:e,"string"!=typeof e)throw TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return e}),"r"==e||e===e0)o=e0;else{if("rw"!=e&&e!=e1)throw new G.InvalidArgument("Invalid transaction mode: "+e);o=e1}if(i){if(i.mode===e0&&o===e1){if(!a)throw new G.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");i=null}i&&u.forEach(function(e){if(i&&-1===i.storeNames.indexOf(e)){if(!a)throw new G.SubTransaction("Table "+e+" not included in parent transaction.");i=null}}),a&&i&&!i.active&&(i=null)}}catch(e){return i?i._promise(null,function(t,n){n(e)}):eY(e)}var s=(function e(t,n,r,i,o){return eg.resolve().then(function(){var u=ey.transless||ey,a=t._createTransaction(n,r,t._dbSchema,i);if(a.explicit=!0,u={trans:a,transless:u},i)a.idbtrans=i.idbtrans;else try{a.create(),a.idbtrans._explicit=!0,t._state.PR1398_maxLoop=3}catch(i){return i.name===V.InvalidState&&t.isOpen()&&0<--t._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),t.close({disableAutoOpen:!1}),t.open().then(function(){return e(t,n,r,null,o)})):eY(i)}var s,c=D(o);return c&&eM(),u=eg.follow(function(){var e;(s=o.call(a,a))&&(c?(e=eF.bind(null,null),s.then(e,e)):"function"==typeof s.next&&"function"==typeof s.throw&&(s=na(s)))},u),(s&&"function"==typeof s.then?eg.resolve(s).then(function(e){return a.active?e:eY(new G.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))}):u.then(function(){return s})).then(function(e){return i&&a._resolve(),a._completion.then(function(){return e})}).catch(function(e){return a._reject(e),eY(e)})})}).bind(null,this,o,u,i,n);return i?i._promise(o,s,"lock"):ey.trans?eV(ey.transless,function(){return r._whenReady(s)}):this._whenReady(s)},nE.prototype.table=function(e){if(!l(this._allTables,e))throw new G.InvalidTable("Table ".concat(e," does not exist"));return this._allTables[e]},nE);function nE(e,n){var r=this;this._middlewares={},this.verno=0;var i=nE.dependencies;this._options=n=t({addons:nE.addons,autoOpen:!0,indexedDB:i.indexedDB,IDBKeyRange:i.IDBKeyRange,cache:"cloned"},n),this._deps={indexedDB:n.indexedDB,IDBKeyRange:n.IDBKeyRange},i=n.addons,this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null,this._novip=this;var o,u,a,s,c,l={dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:X,dbReadyPromise:null,cancelOpen:X,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3,autoOpen:n.autoOpen};l.dbReadyPromise=new eg(function(e){l.dbReadyResolve=e}),l.openCanceller=new eg(function(e,t){l.cancelOpen=t}),this._state=l,this.name=e,this.on=tt(this,"populate","blocked","versionchange","close",{ready:[er,X]}),this.on.ready.subscribe=b(this.on.ready.subscribe,function(e){return function(t,n){nE.vip(function(){var i=r._state;i.openComplete?(i.dbOpenError||eg.resolve().then(t),n&&e(t)):i.onReadyBeingFired?(i.onReadyBeingFired.push(t),n&&e(t)):(e(t),n||e(function e(){r.on.ready.unsubscribe(t),r.on.ready.unsubscribe(e)}))})}}),this.Collection=(o=this,tn(th.prototype,function(e,t){this.db=o;var n=e2,r=null;if(t)try{n=t()}catch(e){r=e}var i=e._ctx,t=i.table,e=t.hook.reading.fire;this._ctx={table:t,index:i.index,isPrimKey:!i.index||t.schema.primKey.keyPath&&i.index===t.schema.primKey.name,range:n,keysOnly:!1,dir:"next",unique:"",algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:r,or:i.or,valueMapper:e!==H?e:null}})),this.Table=(u=this,tn(e7.prototype,function(e,t,n){this.db=u,this._tx=n,this.name=e,this.schema=t,this.hook=u._allTables[e]?u._allTables[e].hook:tt(null,{creating:[Z,X],reading:[Q,H],updating:[et,X],deleting:[ee,X]})})),this.Transaction=(a=this,tn(tj.prototype,function(e,t,n,r,i){var o=this;this.db=a,this.mode=e,this.storeNames=t,this.schema=n,this.chromeTransactionDurability=r,this.idbtrans=null,this.on=tt(this,"complete","error","abort"),this.parent=i||null,this.active=!0,this._reculock=0,this._blockedFuncs=[],this._resolve=null,this._reject=null,this._waitingFor=null,this._waitingQueue=null,this._spinCount=0,this._completion=new eg(function(e,t){o._resolve=e,o._reject=t}),this._completion.then(function(){o.active=!1,o.on.complete.fire()},function(e){var t=o.active;return o.active=!1,o.on.error.fire(e),o.parent?o.parent._reject(e):t&&o.idbtrans&&o.idbtrans.abort(),eY(e)})})),this.Version=(s=this,tn(tH.prototype,function(e){this.db=s,this._cfg={version:e,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}})),this.WhereClause=(c=this,tn(tx.prototype,function(e,t,n){if(this.db=c,this._ctx={table:e,index:":id"===t?null:t,or:n},this._cmp=this._ascending=e4,this._descending=function(e,t){return e4(t,e)},this._max=function(e,t){return 0<e4(e,t)?e:t},this._min=function(e,t){return 0>e4(e,t)?e:t},this._IDBKeyRange=c._deps.IDBKeyRange,!this._IDBKeyRange)throw new G.MissingAPI})),this.on("versionchange",function(e){0<e.newVersion?console.warn("Another connection wants to upgrade database '".concat(r.name,"'. Closing db now to resume the upgrade.")):console.warn("Another connection wants to delete database '".concat(r.name,"'. Closing db now to resume the delete request.")),r.close({disableAutoOpen:!1})}),this.on("blocked",function(e){!e.newVersion||e.newVersion<e.oldVersion?console.warn("Dexie.delete('".concat(r.name,"') was blocked")):console.warn("Upgrade '".concat(r.name,"' blocked by other connection holding version ").concat(e.oldVersion/10))}),this._maxKey=tT(n.IDBKeyRange),this._createTransaction=function(e,t,n,i){return new r.Transaction(e,t,n,r._options.chromeTransactionDurability,i)},this._fireOnBlocked=function(e){r.on("blocked").fire(e),eJ.filter(function(e){return e.name===r.name&&e!==r&&!e._state.vcFired}).map(function(t){return t.on("versionchange").fire(e)})},this.use(np),this.use(nx),this.use(nm),this.use(nc),this.use(nh);var f=new Proxy(this,{get:function(e,t,n){if("_vip"===t)return!0;if("table"===t)return function(e){return nk(r.table(e),f)};var i=Reflect.get(e,t,n);return i instanceof e7?nk(i,f):"tables"===t?i.map(function(e){return nk(e,f)}):"_createTransaction"===t?function(){return nk(i.apply(this,arguments),f)}:i}});this.vip=f,i.forEach(function(e){return e(r)})}var nP,M="undefined"!=typeof Symbol&&"observable"in Symbol?Symbol.observable:"@@observable",nA=(nS.prototype.subscribe=function(e,t,n){return this._subscribe(e&&"function"!=typeof e?e:{next:e,error:t,complete:n})},nS.prototype[M]=function(){return this},nS);function nS(e){this._subscribe=e}try{nP={indexedDB:i.indexedDB||i.mozIndexedDB||i.webkitIndexedDB||i.msIndexedDB,IDBKeyRange:i.IDBKeyRange||i.webkitIDBKeyRange}}catch(e){nP={indexedDB:null,IDBKeyRange:null}}function nj(e){var t,n=!1,r=new nA(function(r){var i,o=D(e),u=!1,a={},s={},c={get closed(){return u},unsubscribe:function(){u||(u=!0,i&&i.abort(),f&&tS.storagemutated.unsubscribe(d))}};r.start&&r.start(c);var f=!1,h=function(){return eW(p)},d=function(e){t7(a,e),ne(s,a)&&h()},p=function(){var c,p;!u&&nP.indexedDB&&(a={},c={},i&&i.abort(),Promise.resolve(function(t){var n=eA();try{o&&eM();var r=eN(e,t);return r=o?r.finally(eF):r}finally{n&&eS()}}(p={subscr:c,signal:(i=new AbortController).signal,requery:h,querier:e,trans:null})).then(function(e){n=!0,t=e,u||p.signal.aborted||(a={},function(e){for(var t in e)if(l(e,t))return;return 1}(s=c)||f||(tS(tP,d),f=!0),eW(function(){return!u&&r.next&&r.next(e)}))},function(e){n=!1,["DatabaseClosedError","AbortError"].includes(null==e?void 0:e.name)||u||eW(function(){u||r.error&&r.error(e)})}))};return setTimeout(h,0),c});return r.hasValue=function(){return n},r.getValue=function(){return t},r}function nK(e){var t=nI;try{nI=!0,tS.storagemutated.fire(e),no(e,!0)}finally{nI=t}}f(nO,t(t({},Y),{delete:function(e){return new nO(e,{addons:[]}).delete()},exists:function(e){return new nO(e,{addons:[]}).open().then(function(e){return e.close(),!0}).catch("NoSuchDatabaseError",function(){return!1})},getDatabaseNames:function(e){var t,n;try{return n=(t=nO.dependencies).indexedDB,t=t.IDBKeyRange,(tZ(n)?Promise.resolve(n.databases()).then(function(e){return e.map(function(e){return e.name}).filter(function(e){return e!==eZ})}):tJ(n,t).toCollection().primaryKeys()).then(e)}catch(e){return eY(new G.MissingAPI)}},defineClass:function(){return function(e){a(this,e)}},ignoreTransaction:function(e){return ey.trans?eV(ey.transless,e):e()},vip:t0,async:function(e){return function(){try{var t=na(e.apply(this,arguments));return t&&"function"==typeof t.then?t:eg.resolve(t)}catch(e){return eY(e)}}},spawn:function(e,t,n){try{var r=na(e.apply(n,t||[]));return r&&"function"==typeof r.then?r:eg.resolve(r)}catch(e){return eY(e)}},currentTransaction:{get:function(){return ey.trans||null}},waitFor:function(e,t){return t=eg.resolve("function"==typeof e?nO.ignoreTransaction(e):e).timeout(t||6e4),ey.trans?ey.trans.waitFor(t):t},Promise:eg,debug:{get:function(){return ei},set:function(e){ei=e}},derive:p,extend:a,props:f,override:b,Events:tt,on:tS,liveQuery:nj,extendObservabilitySet:t7,getByKeyPath:_,setByKeyPath:x,delByKeyPath:function(e,t){"string"==typeof t?x(e,t,void 0):"length"in t&&[].map.call(t,function(t){x(e,t,void 0)})},shallowClone:k,deepClone:j,getObjectDiff:nl,cmp:e4,asap:w,minKey:-1/0,addons:[],connections:eJ,errnames:V,dependencies:nP,cache:nt,semVer:"4.0.7",version:"4.0.7".split(".").map(function(e){return parseInt(e)}).reduce(function(e,t,n){return e+t/Math.pow(10,2*n)})})),nO.maxKey=tT(nO.dependencies.IDBKeyRange),"undefined"!=typeof dispatchEvent&&"undefined"!=typeof addEventListener&&(tS(tP,function(e){nI||(e=new CustomEvent(tA,{detail:e}),nI=!0,dispatchEvent(e),nI=!1)}),addEventListener(tA,function(e){e=e.detail,nI||nK(e)}));var nC,nI=!1,nB=function(){};return"undefined"!=typeof BroadcastChannel&&((nB=function(){(nC=new BroadcastChannel(tA)).onmessage=function(e){return e.data&&nK(e.data)}})(),"function"==typeof nC.unref&&nC.unref(),tS(tP,function(e){nI||nC.postMessage(e)})),"undefined"!=typeof addEventListener&&(addEventListener("pagehide",function(e){if(!nO.disableBfCache&&e.persisted){ei&&console.debug("Dexie: handling persisted pagehide"),null!=nC&&nC.close();for(var t=0;t<eJ.length;t++)eJ[t].close({disableAutoOpen:!1})}}),addEventListener("pageshow",function(e){!nO.disableBfCache&&e.persisted&&(ei&&console.debug("Dexie: handling persisted pageshow"),nB(),nK({all:new t6(-1/0,[[]])}))})),eg.rejectionMapper=function(e,t){return!e||e instanceof $||e instanceof TypeError||e instanceof SyntaxError||!e.name||!W[e.name]?e:(t=new W[e.name](t||e.message,e),"stack"in e&&d(t,"stack",{get:function(){return this.inner.stack}}),t)},t(nO,Object.freeze({__proto__:null,Dexie:nO,liveQuery:nj,Entity:e8,cmp:e4,PropModSymbol:P,PropModification:tl,replacePrefix:function(e,t){return new tl({replacePrefix:[e,t]})},add:function(e){return new tl({add:e})},remove:function(e){return new tl({remove:e})},default:nO,RangeSet:t6,mergeRanges:t3,rangesOverlap:t8}),{default:nO}),nO},e.exports=r()},13414:function(e,t,n){var r=n(2381).Symbol;e.exports=r},12731:function(e,t,n){var r=n(13414),i=n(37363),o=n(68391),u=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":u&&u in Object(e)?i(e):o(e)}},19334:function(e,t,n){var r=n(25788),i=/^\s+/;e.exports=function(e){return e?e.slice(0,r(e)+1).replace(i,""):e}},93330:function(e,t,n){var r="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g;e.exports=r},37363:function(e,t,n){var r=n(13414),i=Object.prototype,o=i.hasOwnProperty,u=i.toString,a=r?r.toStringTag:void 0;e.exports=function(e){var t=o.call(e,a),n=e[a];try{e[a]=void 0;var r=!0}catch(e){}var i=u.call(e);return r&&(t?e[a]=n:delete e[a]),i}},68391:function(e){var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},2381:function(e,t,n){var r=n(93330),i="object"==typeof self&&self&&self.Object===Object&&self,o=r||i||Function("return this")();e.exports=o},25788:function(e){var t=/\s/;e.exports=function(e){for(var n=e.length;n--&&t.test(e.charAt(n)););return n}},22170:function(e,t,n){var r=n(63117),i=n(49423),o=n(49666),u=Math.max,a=Math.min;e.exports=function(e,t,n){var s,c,l,f,h,d,p=0,y=!1,v=!1,m=!0;if("function"!=typeof e)throw TypeError("Expected a function");function b(t){var n=s,r=c;return s=c=void 0,p=t,f=e.apply(r,n)}function g(e){var n=e-d,r=e-p;return void 0===d||n>=t||n<0||v&&r>=l}function w(){var e,n,r,o=i();if(g(o))return _(o);h=setTimeout(w,(e=o-d,n=o-p,r=t-e,v?a(r,l-n):r))}function _(e){return(h=void 0,m&&s)?b(e):(s=c=void 0,f)}function x(){var e,n=i(),r=g(n);if(s=arguments,c=this,d=n,r){if(void 0===h)return p=e=d,h=setTimeout(w,t),y?b(e):f;if(v)return clearTimeout(h),h=setTimeout(w,t),b(d)}return void 0===h&&(h=setTimeout(w,t)),f}return t=o(t)||0,r(n)&&(y=!!n.leading,l=(v="maxWait"in n)?u(o(n.maxWait)||0,t):l,m="trailing"in n?!!n.trailing:m),x.cancel=function(){void 0!==h&&clearTimeout(h),p=0,s=d=c=h=void 0},x.flush=function(){return void 0===h?f:_(i())},x}},63117:function(e){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},50561:function(e){e.exports=function(e){return null!=e&&"object"==typeof e}},41108:function(e,t,n){var r=n(12731),i=n(50561);e.exports=function(e){return"symbol"==typeof e||i(e)&&"[object Symbol]"==r(e)}},49423:function(e,t,n){var r=n(2381);e.exports=function(){return r.Date.now()}},49666:function(e,t,n){var r=n(19334),i=n(63117),o=n(41108),u=0/0,a=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,c=/^0o[0-7]+$/i,l=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(o(e))return u;if(i(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=i(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=r(e);var n=s.test(e);return n||c.test(e)?l(e.slice(2),n?2:8):a.test(e)?u:+e}},69893:function(e,t,n){"use strict";let r,i;n.d(t,{$3:function(){return T},P6:function(){return U},T:function(){return F},UG:function(){return z},Xx:function(){return D}});/*! noble-ed25519 - MIT License (c) 2019 Paul Miller (paulmillr.com) */let o=2n**255n-19n,u=2n**252n+0x14def9dea2f79cd65812631a5cf5d3edn,a={a:-1n,d:0x52036cee2b6ffe738cc740797779e89800700a4d4141d8ab75eb4dca135978a3n,p:o,n:u,h:8,Gx:0x216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51an,Gy:0x6666666666666666666666666666666666666666666666666666666666666658n},s=(e="")=>{throw Error(e)},c=e=>"string"==typeof e,l=e=>e instanceof Uint8Array||null!=e&&"object"==typeof e&&"Uint8Array"===e.constructor.name,f=(e,t)=>!l(e)||"number"==typeof t&&t>0&&e.length!==t?s("Uint8Array of valid length expected"):e,h=e=>new Uint8Array(e),d=(e,t)=>f(c(e)?_(e):h(f(e)),t),p=(e,t=o)=>{let n=e%t;return n>=0n?n:t+n},y=e=>e instanceof v?e:s("Point expected");class v{constructor(e,t,n,r){this.ex=e,this.ey=t,this.ez=n,this.et=r}static fromAffine(e){return new v(e.x,e.y,1n,p(e.x*e.y))}static fromHex(e,t=!1){let{d:n}=a,r=(e=d(e,32)).slice(),i=e[31];r[31]=-129&i;let u=k(r);t&&!(0n<=u&&u<2n**256n)&&s("bad y coord 1"),t||0n<=u&&u<o||s("bad y coord 2");let c=p(u*u),{isValid:l,value:f}=S(p(c-1n),p(n*c+1n));l||s("bad y coordinate 3");let h=(1n&f)===1n,y=(128&i)!=0;return!t&&0n===f&&y&&s("bad y coord 3"),y!==h&&(f=p(-f)),new v(f,u,1n,p(f*u))}get x(){return this.toAffine().x}get y(){return this.toAffine().y}equals(e){let{ex:t,ey:n,ez:r}=this,{ex:i,ey:o,ez:u}=y(e),a=p(t*u),s=p(i*r),c=p(n*u),l=p(o*r);return a===s&&c===l}is0(){return this.equals(b)}negate(){return new v(p(-this.ex),this.ey,this.ez,p(-this.et))}double(){let{ex:e,ey:t,ez:n}=this,{a:r}=a,i=p(e*e),o=p(t*t),u=p(2n*p(n*n)),s=p(r*i),c=e+t,l=p(p(c*c)-i-o),f=s+o,h=f-u,d=s-o,y=p(l*h),m=p(f*d),b=p(l*d);return new v(y,m,p(h*f),b)}add(e){let{ex:t,ey:n,ez:r,et:i}=this,{ex:o,ey:u,ez:s,et:c}=y(e),{a:l,d:f}=a,h=p(t*o),d=p(n*u),m=p(i*f*c),b=p(r*s),g=p((t+n)*(o+u)-h-d),w=p(b-m),_=p(b+m),x=p(d-l*h),k=p(g*w),O=p(_*x),E=p(g*x);return new v(k,O,p(w*_),E)}mul(e,t=!0){if(0n===e)return!0===t?s("cannot multiply by 0"):b;if("bigint"==typeof e&&0n<e&&e<u||s("invalid scalar, must be < L"),!t&&this.is0()||1n===e)return this;if(this.equals(m))return V(e).p;let n=b,r=m;for(let i=this;e>0n;i=i.double(),e>>=1n)1n&e?n=n.add(i):t&&(r=r.add(i));return n}multiply(e){return this.mul(e)}clearCofactor(){return this.mul(BigInt(a.h),!1)}isSmallOrder(){return this.clearCofactor().is0()}isTorsionFree(){let e=this.mul(u/2n,!1).double();return u%2n&&(e=e.add(this)),e.is0()}toAffine(){let{ex:e,ey:t,ez:n}=this;if(this.equals(b))return{x:0n,y:1n};let r=E(n);return 1n!==p(n*r)&&s("invalid inverse"),{x:p(e*r),y:p(t*r)}}toRawBytes(){let{x:e,y:t}=this.toAffine(),n=x(t);return n[31]|=1n&e?128:0,n}toHex(){return w(this.toRawBytes())}}v.BASE=new v(0x216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51an,0x6666666666666666666666666666666666666666666666666666666666666658n,1n,p(0x216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51an*0x6666666666666666666666666666666666666666666666666666666666666658n)),v.ZERO=new v(0n,1n,1n,0n);let{BASE:m,ZERO:b}=v,g=(e,t)=>e.toString(16).padStart(t,"0"),w=e=>Array.from(e).map(e=>g(e,2)).join(""),_=e=>{let t=e.length;(!c(e)||t%2)&&s("hex invalid 1");let n=h(t/2);for(let t=0;t<n.length;t++){let r=2*t,i=Number.parseInt(e.slice(r,r+2),16);(Number.isNaN(i)||i<0)&&s("hex invalid 2"),n[t]=i}return n},x=e=>_(g(e,64)).reverse(),k=e=>BigInt("0x"+w(h(f(e)).reverse())),O=(...e)=>{let t=h(e.reduce((e,t)=>e+f(t).length,0)),n=0;return e.forEach(e=>{t.set(e,n),n+=e.length}),t},E=(e,t=o)=>{(0n===e||t<=0n)&&s("no inverse n="+e+" mod="+t);let n=p(e,t),r=t,i=0n,u=1n,a=1n,c=0n;for(;0n!==n;){let e=r/n,t=r%n,o=i-a*e,s=u-c*e;r=n,n=t,i=a,u=c,a=o,c=s}return 1n===r?p(i,t):s("no inverse")},P=(e,t)=>{let n=e;for(;t-- >0n;)n*=n,n%=o;return n},A=e=>{let t=e*e%o*e%o,n=P(t,2n)*t%o,r=P(n,1n)*e%o,i=P(r,5n)*r%o,u=P(i,10n)*i%o,a=P(u,20n)*u%o,s=P(a,40n)*a%o,c=P(s,80n)*s%o,l=P(c,80n)*s%o,f=P(l,10n)*i%o;return{pow_p_5_8:P(f,2n)*e%o,b2:t}},S=(e,t)=>{let n=p(t*t*t),r=A(e*p(n*n*t)).pow_p_5_8,i=p(e*n*r),o=p(t*i*i),u=i,a=p(0x2b8324804fc1df0b2b4d00993dfbd7a72f431806ad2fe478c4ee1b274a0ea0b0n*i),s=o===e,c=o===p(-e),l=o===p(-(0x2b8324804fc1df0b2b4d00993dfbd7a72f431806ad2fe478c4ee1b274a0ea0b0n*e));return s&&(i=u),(c||l)&&(i=a),(1n&p(i))===1n&&(i=p(-i)),{isValid:s||c,value:i}},j=e=>p(k(e),u),K=(...e)=>z.sha512Async(...e),C=(...e)=>"function"==typeof r?r(...e):s("etc.sha512Sync not set"),I=e=>{let t=e.slice(0,32);t[0]&=248,t[31]&=127,t[31]|=64;let n=e.slice(32,64),r=j(t),i=m.mul(r),o=i.toRawBytes();return{head:t,prefix:n,scalar:r,point:i,pointBytes:o}},B=e=>I(C(d(e,32))),T=e=>B(e).pointBytes;function q(e,t){return e?K(t.hashable).then(t.finish):t.finish(C(t.hashable))}let R=(e,t,n)=>{let{pointBytes:r,scalar:i}=e,o=j(t),a=m.mul(o).toRawBytes();return{hashable:O(a,r,n),finish:e=>f(O(a,x(p(o+j(e)*i,u))),64)}},D=(e,t)=>{let n=d(e),r=B(t),i=C(r.prefix,n);return q(!1,R(r,i,n))},N={zip215:!0},M=(e,t,n,r=N)=>{t=d(t),e=d(e,64);let{zip215:i}=r,o,u,a,s,c=new Uint8Array;try{o=v.fromHex(n,i),u=v.fromHex(e.slice(0,32),i),a=k(e.slice(32,64)),s=m.mul(a,!1),c=O(u.toRawBytes(),o.toRawBytes(),t)}catch(e){}return{hashable:c,finish:e=>{if(null==s||!i&&o.isSmallOrder())return!1;let t=j(e);return u.add(o.mul(t,!1)).add(s.negate()).clearCofactor().is0()}}},F=(e,t,n,r=N)=>q(!1,M(e,t,n,r)),$=()=>"object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0,z={bytesToHex:w,hexToBytes:_,concatBytes:O,mod:p,invert:E,randomBytes:(e=32)=>{let t=$();return t&&t.getRandomValues||s("crypto.getRandomValues must be defined"),t.getRandomValues(h(e))},sha512Async:async(...e)=>{let t=$();t&&t.subtle||s("crypto.subtle or etc.sha512Async must be defined");let n=O(...e);return h(await t.subtle.digest("SHA-512",n.buffer))},sha512Sync:void 0};Object.defineProperties(z,{sha512Sync:{configurable:!1,get:()=>r,set(e){r||(r=e)}}});let U={getExtendedPublicKeyAsync:e=>K(d(e,32)).then(I),getExtendedPublicKey:B,randomPrivateKey:()=>z.randomBytes(32),precompute:(e=8,t=m)=>(t.multiply(3n),t)},L=()=>{let e=[],t=m,n=t;for(let r=0;r<33;r++){n=t,e.push(n);for(let r=1;r<128;r++)n=n.add(t),e.push(n);t=n.double()}return e},V=e=>{let t=i||(i=L()),n=(e,t)=>{let n=t.negate();return e?n:t},r=b,o=m,u=BigInt(255),a=BigInt(8);for(let i=0;i<33;i++){let s=128*i,c=Number(e&u);e>>=a,c>128&&(c-=256,e+=1n);let l=s+Math.abs(c)-1,f=i%2!=0,h=c<0;0===c?o=o.add(n(f,t[s])):r=r.add(n(h,t[l]))}return{p:r,f:o}}},14635:function(e,t,n){"use strict";var r=n(53185);let i=Symbol.for("Dexie"),o=globalThis[i]||(globalThis[i]=r);if(r.semVer!==o.semVer)throw Error(`Two different versions of Dexie loaded in the same app: ${r.semVer} and ${o.semVer}`);let{liveQuery:u,mergeRanges:a,rangesOverlap:s,RangeSet:c,cmp:l,Entity:f,PropModSymbol:h,PropModification:d,replacePrefix:p,add:y,remove:v}=o;t.ZP=o},51359:function(e,t,n){"use strict";n.d(t,{b:function(){return i}});var r=n(48926);class i extends r.G{constructor({address:e}){super(`Address "${e}" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAddressError"})}}},48926:function(e,t,n){"use strict";n.d(t,{G:function(){return i}});var r=n(94290);class i extends Error{constructor(e,t={}){super(),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ViemError"}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:(0,r.bo)()});let n=t.cause instanceof i?t.cause.details:t.cause?.message?t.cause.message:t.details,o=t.cause instanceof i&&t.cause.docsPath||t.docsPath;this.message=[e||"An error occurred.","",...t.metaMessages?[...t.metaMessages,""]:[],...o?[`Docs: https://viem.sh${o}${t.docsSlug?`#${t.docsSlug}`:""}`]:[],...n?[`Details: ${n}`]:[],`Version: ${this.version}`].join("\n"),t.cause&&(this.cause=t.cause),this.details=n,this.docsPath=o,this.metaMessages=t.metaMessages,this.shortMessage=e}walk(e){return function e(t,n){return n?.(t)?t:t&&"object"==typeof t&&"cause"in t?e(t.cause,n):n?null:t}(this,e)}}},74188:function(e,t,n){"use strict";n.d(t,{J5:function(){return i},M6:function(){return o}});var r=n(48926);class i extends r.G{constructor({max:e,min:t,signed:n,size:r,value:i}){super(`Number "${i}" is not in safe ${r?`${8*r}-bit ${n?"signed":"unsigned"} `:""}integer range ${e?`(${t} to ${e})`:`(above ${t})`}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"IntegerOutOfRangeError"})}}class o extends r.G{constructor({givenSize:e,maxSize:t}){super(`Size cannot exceed ${t} bytes. Given size: ${e} bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SizeOverflowError"})}}},94290:function(e,t,n){"use strict";n.d(t,{Gr:function(){return r},bo:function(){return i}});let r=e=>e,i=()=>"[email protected]"},99112:function(e,t,n){"use strict";n.d(t,{K:function(){return l},x:function(){return c}});var r=n(51359),i=n(82361),o=n(45626),u=n(98992),a=n(64113);let s=new u.k(8192);function c(e,t){if(s.has(`${e}.${t}`))return s.get(`${e}.${t}`);let n=t?`${t}${e.toLowerCase()}`:e.substring(2).toLowerCase(),r=(0,o.w)((0,i.qX)(n),"bytes"),u=(t?n.substring(`${t}0x`.length):n).split("");for(let e=0;e<40;e+=2)r[e>>1]>>4>=8&&u[e]&&(u[e]=u[e].toUpperCase()),(15&r[e>>1])>=8&&u[e+1]&&(u[e+1]=u[e+1].toUpperCase());let a=`0x${u.join("")}`;return s.set(`${e}.${t}`,a),a}function l(e,t){if(!(0,a.U)(e,{strict:!1}))throw new r.b({address:e});return c(e,t)}},64113:function(e,t,n){"use strict";n.d(t,{U:function(){return a}});var r=n(98992),i=n(99112);let o=/^0x[a-fA-F0-9]{40}$/,u=new r.k(8192);function a(e,t){let{strict:n=!0}=t??{},r=`${e}.${n}`;if(u.has(r))return u.get(r);let a=!!o.test(e)&&(e.toLowerCase()===e||!n||(0,i.x)(e)===e);return u.set(r,a),a}},40369:function(e,t,n){"use strict";function r(e,{strict:t=!0}={}){return!!e&&"string"==typeof e&&(t?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x"))}n.d(t,{v:function(){return r}})},685:function(e,t,n){"use strict";n.d(t,{vk:function(){return o}});var r=n(48926);class i extends r.G{constructor({size:e,targetSize:t,type:n}){super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} size (${e}) exceeds padding size (${t}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SizeExceedsPaddingSizeError"})}}function o(e,{dir:t,size:n=32}={}){return"string"==typeof e?function(e,{dir:t,size:n=32}={}){if(null===n)return e;let r=e.replace("0x","");if(r.length>2*n)throw new i({size:Math.ceil(r.length/2),targetSize:n,type:"hex"});return`0x${r["right"===t?"padEnd":"padStart"](2*n,"0")}`}(e,{dir:t,size:n}):function(e,{dir:t,size:n=32}={}){if(null===n)return e;if(e.length>n)throw new i({size:e.length,targetSize:n,type:"bytes"});let r=new Uint8Array(n);for(let i=0;i<n;i++){let o="right"===t;r[o?i:n-i-1]=e[o?i:e.length-i-1]}return r}(e,{dir:t,size:n})}},88294:function(e,t,n){"use strict";n.d(t,{Yf:function(){return u},y_:function(){return a},ly:function(){return s}});var r=n(74188),i=n(40369);function o(e){return(0,i.v)(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}function u(e,{size:t}){if(o(e)>t)throw new r.M6({givenSize:o(e),maxSize:t})}function a(e,t={}){let{signed:n}=t;t.size&&u(e,{size:t.size});let r=BigInt(e);if(!n)return r;let i=(e.length-2)/2;return r<=(1n<<8n*BigInt(i)-1n)-1n?r:r-BigInt(`0x${"f".padStart(2*i,"f")}`)-1n}function s(e,t={}){return Number(a(e,t))}},82361:function(e,t,n){"use strict";n.d(t,{O0:function(){return c},qX:function(){return d}});var r=n(48926),i=n(40369),o=n(685),u=n(88294),a=n(95046);let s=new TextEncoder;function c(e,t={}){return"number"==typeof e||"bigint"==typeof e?h((0,a.eC)(e,t)):"boolean"==typeof e?function(e,t={}){let n=new Uint8Array(1);return(n[0]=Number(e),"number"==typeof t.size)?((0,u.Yf)(n,{size:t.size}),(0,o.vk)(n,{size:t.size})):n}(e,t):(0,i.v)(e)?h(e,t):d(e,t)}let l={zero:48,nine:57,A:65,F:70,a:97,f:102};function f(e){return e>=l.zero&&e<=l.nine?e-l.zero:e>=l.A&&e<=l.F?e-(l.A-10):e>=l.a&&e<=l.f?e-(l.a-10):void 0}function h(e,t={}){let n=e;t.size&&((0,u.Yf)(n,{size:t.size}),n=(0,o.vk)(n,{dir:"right",size:t.size}));let i=n.slice(2);i.length%2&&(i=`0${i}`);let a=i.length/2,s=new Uint8Array(a);for(let e=0,t=0;e<a;e++){let n=f(i.charCodeAt(t++)),o=f(i.charCodeAt(t++));if(void 0===n||void 0===o)throw new r.G(`Invalid byte sequence ("${i[t-2]}${i[t-1]}" in "${i}").`);s[e]=16*n+o}return s}function d(e,t={}){let n=s.encode(e);return"number"==typeof t.size?((0,u.Yf)(n,{size:t.size}),(0,o.vk)(n,{dir:"right",size:t.size})):n}},95046:function(e,t,n){"use strict";n.d(t,{$G:function(){return f},NC:function(){return a},eC:function(){return c}});var r=n(74188),i=n(685),o=n(88294);let u=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function a(e,t={}){return"number"==typeof e||"bigint"==typeof e?c(e,t):"string"==typeof e?f(e,t):"boolean"==typeof e?function(e,t={}){let n=`0x${Number(e)}`;return"number"==typeof t.size?((0,o.Yf)(n,{size:t.size}),(0,i.vk)(n,{size:t.size})):n}(e,t):s(e,t)}function s(e,t={}){let n="";for(let t=0;t<e.length;t++)n+=u[e[t]];let r=`0x${n}`;return"number"==typeof t.size?((0,o.Yf)(r,{size:t.size}),(0,i.vk)(r,{dir:"right",size:t.size})):r}function c(e,t={}){let n;let{signed:o,size:u}=t,a=BigInt(e);u?n=o?(1n<<8n*BigInt(u)-1n)-1n:2n**(8n*BigInt(u))-1n:"number"==typeof e&&(n=BigInt(Number.MAX_SAFE_INTEGER));let s="bigint"==typeof n&&o?-n-1n:0;if(n&&a>n||a<s){let t="bigint"==typeof e?"n":"";throw new r.J5({max:n?`${n}${t}`:void 0,min:`${s}${t}`,signed:o,size:u,value:`${e}${t}`})}let c=`0x${(o&&a<0?(1n<<BigInt(8*u))+BigInt(a):a).toString(16)}`;return u?(0,i.vk)(c,{size:u}):c}let l=new TextEncoder;function f(e,t={}){return s(l.encode(e),t)}},45626:function(e,t,n){"use strict";n.d(t,{w:function(){return j}});var r=n(95861);let i=BigInt(4294967296-1),o=BigInt(32),u=(e,t,n)=>e<<n|t>>>32-n,a=(e,t,n)=>t<<n|e>>>32-n,s=(e,t,n)=>t<<n-32|e>>>64-n,c=(e,t,n)=>e<<n-32|t>>>64-n;var l=n(12403);let[f,h,d]=[[],[],[]],p=BigInt(0),y=BigInt(1),v=BigInt(2),m=BigInt(7),b=BigInt(256),g=BigInt(113);for(let e=0,t=y,n=1,r=0;e<24;e++){[n,r]=[r,(2*n+3*r)%5],f.push(2*(5*r+n)),h.push((e+1)*(e+2)/2%64);let i=p;for(let e=0;e<7;e++)(t=(t<<y^(t>>m)*g)%b)&v&&(i^=y<<(y<<BigInt(e))-y);d.push(i)}let[w,_]=function(e,t=!1){let n=new Uint32Array(e.length),r=new Uint32Array(e.length);for(let u=0;u<e.length;u++){let{h:a,l:s}=function(e,t=!1){return t?{h:Number(e&i),l:Number(e>>o&i)}:{h:0|Number(e>>o&i),l:0|Number(e&i)}}(e[u],t);[n[u],r[u]]=[a,s]}return[n,r]}(d,!0),x=(e,t,n)=>n>32?s(e,t,n):u(e,t,n),k=(e,t,n)=>n>32?c(e,t,n):a(e,t,n);class O extends l.kb{constructor(e,t,n,i=!1,o=24){if(super(),this.blockLen=e,this.suffix=t,this.outputLen=n,this.enableXOF=i,this.rounds=o,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,(0,r.Rx)(n),0>=this.blockLen||this.blockLen>=200)throw Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=(0,l.Jq)(this.state)}keccak(){!function(e,t=24){let n=new Uint32Array(10);for(let r=24-t;r<24;r++){for(let t=0;t<10;t++)n[t]=e[t]^e[t+10]^e[t+20]^e[t+30]^e[t+40];for(let t=0;t<10;t+=2){let r=(t+8)%10,i=(t+2)%10,o=n[i],u=n[i+1],a=x(o,u,1)^n[r],s=k(o,u,1)^n[r+1];for(let n=0;n<50;n+=10)e[t+n]^=a,e[t+n+1]^=s}let t=e[2],i=e[3];for(let n=0;n<24;n++){let r=h[n],o=x(t,i,r),u=k(t,i,r),a=f[n];t=e[a],i=e[a+1],e[a]=o,e[a+1]=u}for(let t=0;t<50;t+=10){for(let r=0;r<10;r++)n[r]=e[t+r];for(let r=0;r<10;r++)e[t+r]^=~n[(r+2)%10]&n[(r+4)%10]}e[0]^=w[r],e[1]^=_[r]}n.fill(0)}(this.state32,this.rounds),this.posOut=0,this.pos=0}update(e){(0,r.Gg)(this);let{blockLen:t,state:n}=this,i=(e=(0,l.O0)(e)).length;for(let r=0;r<i;){let o=Math.min(t-this.pos,i-r);for(let t=0;t<o;t++)n[this.pos++]^=e[r++];this.pos===t&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;let{state:e,suffix:t,pos:n,blockLen:r}=this;e[n]^=t,(128&t)!=0&&n===r-1&&this.keccak(),e[r-1]^=128,this.keccak()}writeInto(e){(0,r.Gg)(this,!1),(0,r.aI)(e),this.finish();let t=this.state,{blockLen:n}=this;for(let r=0,i=e.length;r<i;){this.posOut>=n&&this.keccak();let o=Math.min(n-this.posOut,i-r);e.set(t.subarray(this.posOut,this.posOut+o),r),this.posOut+=o,r+=o}return e}xofInto(e){if(!this.enableXOF)throw Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return(0,r.Rx)(e),this.xofInto(new Uint8Array(e))}digestInto(e){if((0,r.J8)(e,this),this.finished)throw Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){let{blockLen:t,suffix:n,outputLen:r,rounds:i,enableXOF:o}=this;return e||(e=new O(t,n,r,o,i)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=i,e.suffix=n,e.outputLen=r,e.enableXOF=o,e.destroyed=this.destroyed,e}}let E=(0,l.hE)(()=>new O(136,1,32));var P=n(40369),A=n(82361),S=n(95046);function j(e,t){let n=E((0,P.v)(e,{strict:!1})?(0,A.O0)(e):e);return"bytes"===(t||"hex")?n:(0,S.NC)(n)}},98992:function(e,t,n){"use strict";n.d(t,{k:function(){return r}});class r extends Map{constructor(e){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=e}set(e,t){return super.set(e,t),this.maxSize&&this.size>this.maxSize&&this.delete(this.keys().next().value),this}}},2342:function(e,t,n){"use strict";n.d(t,{k:function(){return h}});var r=n(82361),i=n(45626),o=n(99112),u=n(40369),a=n(88294),s=n(95046);async function c({hash:e,signature:t}){let r=(0,u.v)(e)?e:(0,s.NC)(e),{secp256k1:i}=await n.e(600).then(n.bind(n,35600)),o=(()=>{if("object"==typeof t&&"r"in t&&"s"in t){let{r:e,s:n,v:r,yParity:o}=t,u=l(Number(o??r));return new i.Signature((0,a.y_)(e),(0,a.y_)(n)).addRecoveryBit(u)}let e=(0,u.v)(t)?t:(0,s.NC)(t),n=l((0,a.ly)(`0x${e.slice(130)}`));return i.Signature.fromCompact(e.substring(2,130)).addRecoveryBit(n)})().recoverPublicKey(r.substring(2)).toHex(!1);return`0x${o}`}function l(e){if(0===e||1===e)return e;if(27===e)return 0;if(28===e)return 1;throw Error("Invalid yParityOrV value")}async function f({hash:e,signature:t}){return function(e){let t=(0,i.w)(`0x${e.substring(4)}`).substring(26);return(0,o.x)(`0x${t}`)}(await c({hash:e,signature:t}))}async function h({message:e,signature:t}){return f({hash:function(e,t){var n;let o="string"==typeof e?(0,r.qX)(e):e.raw instanceof Uint8Array?e.raw:(0,r.O0)(e.raw),u=(0,r.qX)(`\x19Ethereum Signed Message:
${o.length}`);return(0,i.w)("string"==typeof(n=[u,o])[0]?`0x${n.reduce((e,t)=>e+t.replace("0x",""),"")}`:function(e){let t=0;for(let n of e)t+=n.length;let n=new Uint8Array(t),r=0;for(let t of e)n.set(t,r),r+=t.length;return n}(n),void 0)}(e),signature:t})}},25645:function(e,t,n){"use strict";n.d(t,{n:function(){return a}});var r=n(99112),i=n(51359),o=n(64113),u=n(2342);async function a({address:e,message:t,signature:n}){return function(e,t){if(!(0,o.U)(e,{strict:!1}))throw new i.b({address:e});if(!(0,o.U)(t,{strict:!1}))throw new i.b({address:t});return e.toLowerCase()===t.toLowerCase()}((0,r.K)(e),await (0,u.k)({message:t,signature:n}))}},95861:function(e,t,n){"use strict";function r(e){if(!Number.isSafeInteger(e)||e<0)throw Error(`Wrong positive integer: ${e}`)}function i(e,...t){if(!(e instanceof Uint8Array))throw Error("Expected Uint8Array");if(t.length>0&&!t.includes(e.length))throw Error(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}function o(e){if("function"!=typeof e||"function"!=typeof e.create)throw Error("Hash should be wrapped by utils.wrapConstructor");r(e.outputLen),r(e.blockLen)}function u(e,t=!0){if(e.destroyed)throw Error("Hash instance has been destroyed");if(t&&e.finished)throw Error("Hash#digest() has already been called")}function a(e,t){i(e);let n=t.outputLen;if(e.length<n)throw Error(`digestInto() expects output buffer of length at least ${n}`)}n.d(t,{Gg:function(){return u},J8:function(){return a},Rx:function(){return r},aI:function(){return i},vp:function(){return o}})},12403:function(e,t,n){"use strict";n.d(t,{kb:function(){return l},eV:function(){return c},GL:function(){return u},O6:function(){return h},np:function(){return a},O0:function(){return s},Jq:function(){return o},hE:function(){return f}});let r="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0,i=e=>e instanceof Uint8Array,o=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4)),u=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),a=(e,t)=>e<<32-t|e>>>t;if(68!==new Uint8Array(new Uint32Array([287454020]).buffer)[0])throw Error("Non little-endian hardware is not supported");function s(e){if("string"==typeof e&&(e=function(e){if("string"!=typeof e)throw Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}(e)),!i(e))throw Error(`expected Uint8Array, got ${typeof e}`);return e}function c(...e){let t=new Uint8Array(e.reduce((e,t)=>e+t.length,0)),n=0;return e.forEach(e=>{if(!i(e))throw Error("Uint8Array expected");t.set(e,n),n+=e.length}),t}class l{clone(){return this._cloneInto()}}function f(e){let t=t=>e().update(s(t)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function h(e=32){if(r&&"function"==typeof r.getRandomValues)return r.getRandomValues(new Uint8Array(e));throw Error("crypto.getRandomValues must be defined")}}}]);