@converse/skeletor 0.0.9 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/README.md +5 -89
  2. package/dist/skeletor.d.ts +764 -0
  3. package/dist/skeletor.js +7568 -7747
  4. package/dist/skeletor.min.js +6 -11
  5. package/package.json +46 -30
  6. package/src/{collection.js → collection.ts} +232 -271
  7. package/src/drivers/{sessionStorage.js → sessionStorage.ts} +81 -93
  8. package/src/{eventemitter.js → eventemitter.ts} +44 -59
  9. package/src/{helpers.js → helpers.ts} +56 -69
  10. package/src/index.ts +84 -0
  11. package/src/{listening.js → listening.ts} +32 -27
  12. package/src/{model.js → model.ts} +143 -162
  13. package/src/{storage.js → storage.ts} +92 -49
  14. package/src/types.ts +189 -0
  15. package/src/utils/{events.js → events.ts} +98 -48
  16. package/dist/skeletor.js.map +0 -1
  17. package/dist/skeletor.min.js.map +0 -1
  18. package/src/element.js +0 -238
  19. package/src/index.js +0 -47
  20. package/src/types/collection.d.ts +0 -366
  21. package/src/types/collection.d.ts.map +0 -1
  22. package/src/types/drivers/sessionStorage.d.ts +0 -37
  23. package/src/types/drivers/sessionStorage.d.ts.map +0 -1
  24. package/src/types/element.d.ts +0 -115
  25. package/src/types/element.d.ts.map +0 -1
  26. package/src/types/eventemitter.d.ts +0 -93
  27. package/src/types/eventemitter.d.ts.map +0 -1
  28. package/src/types/helpers.d.ts +0 -62
  29. package/src/types/helpers.d.ts.map +0 -1
  30. package/src/types/index.d.ts +0 -19
  31. package/src/types/index.d.ts.map +0 -1
  32. package/src/types/listening.d.ts +0 -40
  33. package/src/types/listening.d.ts.map +0 -1
  34. package/src/types/model.d.ts +0 -230
  35. package/src/types/model.d.ts.map +0 -1
  36. package/src/types/storage.d.ts +0 -35
  37. package/src/types/storage.d.ts.map +0 -1
  38. package/src/types/utils/events.d.ts +0 -28
  39. package/src/types/utils/events.d.ts.map +0 -1
@@ -1,13 +1,8 @@
1
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).skeletor={})}(this,(function(t){var e="object"==typeof global&&global&&global.Object===Object&&global,r="object"==typeof self&&self&&self.Object===Object&&self,n=e||r||Function("return this")(),o=n.Symbol;function i(t,e){for(var r=-1,n=null==t?0:t.length,o=Array(n);++r<n;)o[r]=e(t[r],r,t);return o}var s=Array.isArray,a=Object.prototype,u=a.hasOwnProperty,c=a.toString,l=o?o.toStringTag:void 0;var f=Object.prototype.toString;var h=o?o.toStringTag:void 0;function d(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":h&&h in Object(t)?function(t){var e=u.call(t,l),r=t[l];try{t[l]=void 0;var n=!0}catch(t){}var o=c.call(t);return n&&(e?t[l]=r:delete t[l]),o}(t):function(t){return f.call(t)}(t)}function v(t){return null!=t&&"object"==typeof t}function p(t){return"symbol"==typeof t||v(t)&&"[object Symbol]"==d(t)}var y=o?o.prototype:void 0,g=y?y.toString:void 0;function b(t){if("string"==typeof t)return t;if(s(t))return i(t,b)+"";if(p(t))return g?g.call(t):"";var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function m(t){return null==t?"":b(t)}var _=0;function w(t){var e=++_;return m(t)+e}
2
- /**
3
- * @license
4
- * Copyright 2017 Google LLC
5
- * SPDX-License-Identifier: BSD-3-Clause
6
- */const j=globalThis,A=j.trustedTypes,I=A?A.createPolicy("lit-html",{createHTML:t=>t}):void 0,S="$lit$",O=`lit$${Math.random().toFixed(9).slice(2)}$`,x="?"+O,E=`<${x}>`,N=document,k=()=>N.createComment(""),$=t=>null===t||"object"!=typeof t&&"function"!=typeof t,B=Array.isArray,R="[ \t\n\f\r]",P=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,T=/-->/g,z=/>/g,C=RegExp(`>|${R}(?:([^\\s"'>=/]+)(${R}*=${R}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),M=/'/g,D=/"/g,U=/^(?:script|style|textarea|title)$/i,F=Symbol.for("lit-noChange"),L=Symbol.for("lit-nothing"),H=new WeakMap,W=N.createTreeWalker(N,129);function q(t,e){if(!B(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==I?I.createHTML(e):e}const V=(t,e)=>{const r=t.length-1,n=[];let o,i=2===e?"<svg>":3===e?"<math>":"",s=P;for(let e=0;e<r;e++){const r=t[e];let u,c,l=-1,f=0;for(;f<r.length&&(s.lastIndex=f,c=s.exec(r),null!==c);){var a;f=s.lastIndex,s===P?"!--"===c[1]?s=T:void 0!==c[1]?s=z:void 0!==c[2]?(U.test(c[2])&&(o=RegExp("</"+c[2],"g")),s=C):void 0!==c[3]&&(s=C):s===C?">"===c[0]?(s=null!==(a=o)&&void 0!==a?a:P,l=-1):void 0===c[1]?l=-2:(l=s.lastIndex-c[2].length,u=c[1],s=void 0===c[3]?C:'"'===c[3]?D:M):s===D||s===M?s=C:s===T||s===z?s=P:(s=C,o=void 0)}const h=s===C&&t[e+1].startsWith("/>")?" ":"";i+=s===P?r+E:l>=0?(n.push(u),r.slice(0,l)+S+r.slice(l)+O+h):r+O+(-2===l?e:h)}return[q(t,i+(t[r]||"<?>")+(2===e?"</svg>":3===e?"</math>":"")),n]};class J{constructor({strings:t,_$litType$:e},r){let n;this.parts=[];let o=0,i=0;const s=t.length-1,a=this.parts,[u,c]=V(t,e);if(this.el=J.createElement(u,r),W.currentNode=this.el.content,2===e||3===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(n=W.nextNode())&&a.length<s;){if(1===n.nodeType){if(n.hasAttributes())for(const t of n.getAttributeNames())if(t.endsWith(S)){const e=c[i++],r=n.getAttribute(t).split(O),s=/([.?@])?(.*)/.exec(e);a.push({type:1,index:o,name:s[2],strings:r,ctor:"."===s[1]?Y:"?"===s[1]?Z:"@"===s[1]?tt:X}),n.removeAttribute(t)}else t.startsWith(O)&&(a.push({type:6,index:o}),n.removeAttribute(t));if(U.test(n.tagName)){const t=n.textContent.split(O),e=t.length-1;if(e>0){n.textContent=A?A.emptyScript:"";for(let r=0;r<e;r++)n.append(t[r],k()),W.nextNode(),a.push({type:2,index:++o});n.append(t[e],k())}}}else if(8===n.nodeType)if(n.data===x)a.push({type:2,index:o});else{let t=-1;for(;-1!==(t=n.data.indexOf(O,t+1));)a.push({type:7,index:o}),t+=O.length-1}o++}}static createElement(t,e){const r=N.createElement("template");return r.innerHTML=t,r}}function K(t,e,r=t,n){var o,i,s,a;if(e===F)return e;let u=void 0!==n?null===(o=r._$Co)||void 0===o?void 0:o[n]:r._$Cl;const c=$(e)?void 0:e._$litDirective$;return(null===(i=u)||void 0===i?void 0:i.constructor)!==c&&(null!==(s=u)&&void 0!==s&&null!==(a=s._$AO)&&void 0!==a&&a.call(s,!1),void 0===c?u=void 0:(u=new c(t),u._$AT(t,r,n)),void 0!==n?(r._$Co??=[])[n]=u:r._$Cl=u),void 0!==u&&(e=K(t,u._$AS(t,e.values),u,n)),e}class Q{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){var e;const{el:{content:r},parts:n}=this._$AD,o=(null!==(e=null==t?void 0:t.creationScope)&&void 0!==e?e:N).importNode(r,!0);W.currentNode=o;let i=W.nextNode(),s=0,a=0,u=n[0];for(;void 0!==u;){var c;if(s===u.index){let e;2===u.type?e=new G(i,i.nextSibling,this,t):1===u.type?e=new u.ctor(i,u.name,u.strings,this,t):6===u.type&&(e=new et(i,this,t)),this._$AV.push(e),u=n[++a]}s!==(null===(c=u)||void 0===c?void 0:c.index)&&(i=W.nextNode(),s++)}return W.currentNode=N,o}p(t){let e=0;for(const r of this._$AV)void 0!==r&&(void 0!==r.strings?(r._$AI(t,r,e),e+=r.strings.length-2):r._$AI(t[e])),e++}}class G{get _$AU(){var t,e;return null!==(t=null===(e=this._$AM)||void 0===e?void 0:e._$AU)&&void 0!==t?t:this._$Cv}constructor(t,e,r,n){var o;this.type=2,this._$AH=L,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=r,this.options=n,this._$Cv=null===(o=null==n?void 0:n.isConnected)||void 0===o||o}get parentNode(){var t;let e=this._$AA.parentNode;const r=this._$AM;return void 0!==r&&11===(null===(t=e)||void 0===t?void 0:t.nodeType)&&(e=r.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=K(this,t,e),$(t)?t===L||null==t||""===t?(this._$AH!==L&&this._$AR(),this._$AH=L):t!==this._$AH&&t!==F&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):(t=>B(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]))(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==L&&$(this._$AH)?this._$AA.nextSibling.data=t:this.T(N.createTextNode(t)),this._$AH=t}$(t){var e;const{values:r,_$litType$:n}=t,o="number"==typeof n?this._$AC(t):(void 0===n.el&&(n.el=J.createElement(q(n.h,n.h[0]),this.options)),n);if((null===(e=this._$AH)||void 0===e?void 0:e._$AD)===o)this._$AH.p(r);else{const t=new Q(o,this),e=t.u(this.options);t.p(r),this.T(e),this._$AH=t}}_$AC(t){let e=H.get(t.strings);return void 0===e&&H.set(t.strings,e=new J(t)),e}k(t){B(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let r,n=0;for(const o of t)n===e.length?e.push(r=new G(this.O(k()),this.O(k()),this,this.options)):r=e[n],r._$AI(o),n++;n<e.length&&(this._$AR(r&&r._$AB.nextSibling,n),e.length=n)}_$AR(t=this._$AA.nextSibling,e){for(null===(r=this._$AP)||void 0===r||r.call(this,!1,!0,e);t&&t!==this._$AB;){var r;const e=t.nextSibling;t.remove(),t=e}}setConnected(t){var e;void 0===this._$AM&&(this._$Cv=t,null===(e=this._$AP)||void 0===e||e.call(this,t))}}class X{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,r,n,o){this.type=1,this._$AH=L,this._$AN=void 0,this.element=t,this.name=e,this._$AM=n,this.options=o,r.length>2||""!==r[0]||""!==r[1]?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=L}_$AI(t,e=this,r,n){const o=this.strings;let i=!1;if(void 0===o)t=K(this,t,e,0),i=!$(t)||t!==this._$AH&&t!==F,i&&(this._$AH=t);else{const n=t;let a,u;for(t=o[0],a=0;a<o.length-1;a++){var s;u=K(this,n[r+a],e,a),u===F&&(u=this._$AH[a]),i||=!$(u)||u!==this._$AH[a],u===L?t=L:t!==L&&(t+=(null!==(s=u)&&void 0!==s?s:"")+o[a+1]),this._$AH[a]=u}}i&&!n&&this.j(t)}j(t){t===L?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class Y extends X{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===L?void 0:t}}class Z extends X{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==L)}}class tt extends X{constructor(t,e,r,n,o){super(t,e,r,n,o),this.type=5}_$AI(t,e=this){var r;if((t=null!==(r=K(this,t,e,0))&&void 0!==r?r:L)===F)return;const n=this._$AH,o=t===L&&n!==L||t.capture!==n.capture||t.once!==n.once||t.passive!==n.passive,i=t!==L&&(n===L||o);o&&this.element.removeEventListener(this.name,this,n),i&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e,r;"function"==typeof this._$AH?this._$AH.call(null!==(e=null===(r=this.options)||void 0===r?void 0:r.host)&&void 0!==e?e:this.element,t):this._$AH.handleEvent(t)}}class et{constructor(t,e,r){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(t){K(this,t)}}const rt=j.litHtmlPolyfillSupport;null!=rt&&rt(J,G),(j.litHtmlVersions??=[]).push("3.2.1");var nt=Object.prototype;function ot(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||nt)}function it(t,e){return function(r){return t(e(r))}}var st=it(Object.keys,Object),at=Object.prototype.hasOwnProperty;function ut(t){if(!ot(t))return st(t);var e=[];for(var r in Object(t))at.call(t,r)&&"constructor"!=r&&e.push(r);return e}function ct(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function lt(t){if(!ct(t))return!1;var e=d(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}var ft,ht=n["__core-js_shared__"],dt=(ft=/[^.]+$/.exec(ht&&ht.keys&&ht.keys.IE_PROTO||""))?"Symbol(src)_1."+ft:"";var vt=Function.prototype.toString;function pt(t){if(null!=t){try{return vt.call(t)}catch(t){}try{return t+""}catch(t){}}return""}var yt=/^\[object .+?Constructor\]$/,gt=Function.prototype,bt=Object.prototype,mt=gt.toString,_t=bt.hasOwnProperty,wt=RegExp("^"+mt.call(_t).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function jt(t){return!(!ct(t)||(e=t,dt&&dt in e))&&(lt(t)?wt:yt).test(pt(t));var e}function At(t,e){var r=function(t,e){return null==t?void 0:t[e]}(t,e);return jt(r)?r:void 0}var It=At(n,"DataView"),St=At(n,"Map"),Ot=At(n,"Promise"),xt=At(n,"Set"),Et=At(n,"WeakMap"),Nt="[object Map]",kt="[object Promise]",$t="[object Set]",Bt="[object WeakMap]",Rt="[object DataView]",Pt=pt(It),Tt=pt(St),zt=pt(Ot),Ct=pt(xt),Mt=pt(Et),Dt=d;(It&&Dt(new It(new ArrayBuffer(1)))!=Rt||St&&Dt(new St)!=Nt||Ot&&Dt(Ot.resolve())!=kt||xt&&Dt(new xt)!=$t||Et&&Dt(new Et)!=Bt)&&(Dt=function(t){var e=d(t),r="[object Object]"==e?t.constructor:void 0,n=r?pt(r):"";if(n)switch(n){case Pt:return Rt;case Tt:return Nt;case zt:return kt;case Ct:return $t;case Mt:return Bt}return e});function Ut(t){return v(t)&&"[object Arguments]"==d(t)}var Ft=Object.prototype,Lt=Ft.hasOwnProperty,Ht=Ft.propertyIsEnumerable,Wt=Ut(function(){return arguments}())?Ut:function(t){return v(t)&&Lt.call(t,"callee")&&!Ht.call(t,"callee")};function qt(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}function Vt(t){return null!=t&&qt(t.length)&&!lt(t)}var Jt="object"==typeof t&&t&&!t.nodeType&&t,Kt=Jt&&"object"==typeof module&&module&&!module.nodeType&&module,Qt=Kt&&Kt.exports===Jt?n.Buffer:void 0,Gt=(Qt?Qt.isBuffer:void 0)||function(){return!1},Xt={};function Yt(t){return function(e){return t(e)}}Xt["[object Float32Array]"]=Xt["[object Float64Array]"]=Xt["[object Int8Array]"]=Xt["[object Int16Array]"]=Xt["[object Int32Array]"]=Xt["[object Uint8Array]"]=Xt["[object Uint8ClampedArray]"]=Xt["[object Uint16Array]"]=Xt["[object Uint32Array]"]=!0,Xt["[object Arguments]"]=Xt["[object Array]"]=Xt["[object ArrayBuffer]"]=Xt["[object Boolean]"]=Xt["[object DataView]"]=Xt["[object Date]"]=Xt["[object Error]"]=Xt["[object Function]"]=Xt["[object Map]"]=Xt["[object Number]"]=Xt["[object Object]"]=Xt["[object RegExp]"]=Xt["[object Set]"]=Xt["[object String]"]=Xt["[object WeakMap]"]=!1;var Zt="object"==typeof t&&t&&!t.nodeType&&t,te=Zt&&"object"==typeof module&&module&&!module.nodeType&&module,ee=te&&te.exports===Zt&&e.process,re=function(){try{var t=te&&te.require&&te.require("util").types;return t||ee&&ee.binding&&ee.binding("util")}catch(t){}}(),ne=re&&re.isTypedArray,oe=ne?Yt(ne):function(t){return v(t)&&qt(t.length)&&!!Xt[d(t)]},ie=Object.prototype.hasOwnProperty;function se(t){if(null==t)return!0;if(Vt(t)&&(s(t)||"string"==typeof t||"function"==typeof t.splice||Gt(t)||oe(t)||Wt(t)))return!t.length;var e=Dt(t);if("[object Map]"==e||"[object Set]"==e)return!t.size;if(ot(t))return!ut(t).length;for(var r in t)if(ie.call(t,r))return!1;return!0}var ae=/^(?:0|[1-9]\d*)$/;function ue(t,e){var r=typeof t;return!!(e=e??9007199254740991)&&("number"==r||"symbol"!=r&&ae.test(t))&&t>-1&&t%1==0&&t<e}var ce=Object.prototype.hasOwnProperty;function le(t,e){var r=s(t),n=!r&&Wt(t),o=!r&&!n&&Gt(t),i=!r&&!n&&!o&&oe(t),a=r||n||o||i,u=a?function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}(t.length,String):[],c=u.length;for(var l in t)!e&&!ce.call(t,l)||a&&("length"==l||o&&("offset"==l||"parent"==l)||i&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||ue(l,c))||u.push(l);return u}function fe(t){return Vt(t)?le(t):ut(t)}var he=/\s/;var de=/^\s+/;function ve(t){return t?t.slice(0,function(t){for(var e=t.length;e--&&he.test(t.charAt(e)););return e}(t)+1).replace(de,""):t}var pe=/^[-+]0x[0-9a-f]+$/i,ye=/^0b[01]+$/i,ge=/^0o[0-7]+$/i,be=parseInt;var me=1/0;function _e(t){return t?(t=function(t){if("number"==typeof t)return t;if(p(t))return NaN;if(ct(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=ct(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=ve(t);var r=ye.test(t);return r||ge.test(t)?be(t.slice(2),r?2:8):pe.test(t)?NaN:+t}(t))===me||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}function we(t,e){var r;if("function"!=typeof e)throw new TypeError("Expected a function");return t=function(t){var e=_e(t),r=e%1;return e==e?r?e-r:e:0}(t),function(){return--t>0&&(r=e.apply(this,arguments)),t<=1&&(e=void 0),r}}const je=/\s+/;function Ae(t,e,r,n,o){let i,s=0;if(r&&"object"==typeof r){void 0!==n&&"context"in o&&void 0===o.context&&(o.context=n);for(i=fe(r);s<i.length;s++)e=Ae(t,e,i[s],r[i[s]],o)}else if(r&&je.test(r))for(i=r.split(je);s<i.length;s++)e=t(e,i[s],n,o);else e=t(e,r,n,o);return e}function Ie(t,e,r,n){if(r){const o=t[e]||(t[e]=[]),i=n.context,s=n.ctx,a=n.listening;a&&a.count++,o.push({callback:r,context:i,ctx:i||s,listening:a})}return t}function Se(t,e,r,n){if(!t)return;const o=n.context,i=n.listeners;let s,a=0;if(e||o||r){for(s=e?[e]:fe(t);a<s.length;a++){const n=t[e=s[a]];if(!n)break;const i=[];for(let t=0;t<n.length;t++){const s=n[t];if(r&&r!==s.callback&&r!==s.callback._callback||o&&o!==s.context)i.push(s);else{const t=s.listening;t&&t.stop(e,r)}}i.length?t[e]=i:delete t[e]}return t}for(s=fe(i);a<s.length;a++)i[s[a]].cleanup()}function Oe(t,e,r,n){if(r){const i=t[e]=(o=function(){n(e,i),r.apply(this,arguments)},we(2,o));i._callback=r}var o;return t}function xe(t,e,r,n){if(t){const r=t[e];let o=t.all;r&&o&&(o=o.slice()),r&&Ee(r,n),o&&Ee(o,[e].concat(n))}return t}function Ee(t,e){let r,n=-1;const o=t.length,i=e[0],s=e[1],a=e[2];switch(e.length){case 0:for(;++n<o;)(r=t[n]).callback.call(r.ctx);return;case 1:for(;++n<o;)(r=t[n]).callback.call(r.ctx,i);return;case 2:for(;++n<o;)(r=t[n]).callback.call(r.ctx,i,s);return;case 3:for(;++n<o;)(r=t[n]).callback.call(r.ctx,i,s,a);return;default:for(;++n<o;)(r=t[n]).callback.apply(r.ctx,e);return}}class Ne{constructor(t,e){this.id=t._listenId,this.listener=t,this.obj=e,this.interop=!0,this.count=0,this._events=void 0}start(t,e,r,n){if(this._events=Ae(Ie,this._events||{},t,e,{context:this.obj,ctx:r,listening:n}),n){(this.obj._listeners||(this.obj._listeners={}))[this.id]=this,this.interop=!1}return this}stop(t,e){let r;this.interop?(this._events=Ae(Se,this._events,t,e,{context:void 0,listeners:void 0}),r=!this._events):(this.count--,r=0===this.count),r&&this.cleanup()}cleanup(){delete this.listener._listeningTo[this.obj._listenId],this.interop||delete this.obj._listeners[this.id]}}
1
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).skeletor={})}(this,function(t){var e=Object.prototype;function r(t){var r=t&&t.constructor;return t===("function"==typeof r&&r.prototype||e)}function n(t,e){return function(r){return t(e(r))}}var o=n(Object.keys,Object),i=Object.prototype.hasOwnProperty;function s(t){if(!r(t))return o(t);var e=[];for(var n in Object(t))i.call(t,n)&&"constructor"!=n&&e.push(n);return e}var a="object"==typeof global&&global&&global.Object===Object&&global,u="object"==typeof self&&self&&self.Object===Object&&self,c=a||u||Function("return this")(),l=c.Symbol,f=Object.prototype,h=f.hasOwnProperty,d=f.toString,v=l?l.toStringTag:void 0;var p=Object.prototype.toString;var y=l?l.toStringTag:void 0;function b(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":y&&y in Object(t)?function(t){var e=h.call(t,v),r=t[v];try{t[v]=void 0;var n=!0}catch(t){}var o=d.call(t);return n&&(e?t[v]=r:delete t[v]),o}(t):function(t){return p.call(t)}(t)}function g(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function m(t){if(!g(t))return!1;var e=b(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}var _,w=c["__core-js_shared__"],j=(_=/[^.]+$/.exec(w&&w.keys&&w.keys.IE_PROTO||""))?"Symbol(src)_1."+_:"";var I=Function.prototype.toString;function S(t){if(null!=t){try{return I.call(t)}catch(t){}try{return t+""}catch(t){}}return""}var O=/^\[object .+?Constructor\]$/,A=Function.prototype,x=Object.prototype,E=A.toString,N=x.hasOwnProperty,k=RegExp("^"+E.call(N).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function B(t){return!(!g(t)||(e=t,j&&j in e))&&(m(t)?k:O).test(S(t));var e}function R(t,e){var r=function(t,e){return null==t?void 0:t[e]}(t,e);return B(r)?r:void 0}var P=R(c,"DataView"),z=R(c,"Map"),D=R(c,"Promise"),T=R(c,"Set"),C=R(c,"WeakMap"),M="[object Map]",F="[object Promise]",U="[object Set]",L="[object WeakMap]",q="[object DataView]",W=S(P),J=S(z),K=S(D),V=S(T),Q=S(C),G=b;function H(t){return null!=t&&"object"==typeof t}(P&&G(new P(new ArrayBuffer(1)))!=q||z&&G(new z)!=M||D&&G(D.resolve())!=F||T&&G(new T)!=U||C&&G(new C)!=L)&&(G=function(t){var e=b(t),r="[object Object]"==e?t.constructor:void 0,n=r?S(r):"";if(n)switch(n){case W:return q;case J:return M;case K:return F;case V:return U;case Q:return L}return e});function $(t){return H(t)&&"[object Arguments]"==b(t)}var X=Object.prototype,Y=X.hasOwnProperty,Z=X.propertyIsEnumerable,tt=$(function(){return arguments}())?$:function(t){return H(t)&&Y.call(t,"callee")&&!Z.call(t,"callee")},et=Array.isArray;function rt(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}function nt(t){return null!=t&&rt(t.length)&&!m(t)}var ot="object"==typeof t&&t&&!t.nodeType&&t,it=ot&&"object"==typeof module&&module&&!module.nodeType&&module,st=it&&it.exports===ot?c.Buffer:void 0,at=(st?st.isBuffer:void 0)||function(){return!1},ut={};function ct(t){return function(e){return t(e)}}ut["[object Float32Array]"]=ut["[object Float64Array]"]=ut["[object Int8Array]"]=ut["[object Int16Array]"]=ut["[object Int32Array]"]=ut["[object Uint8Array]"]=ut["[object Uint8ClampedArray]"]=ut["[object Uint16Array]"]=ut["[object Uint32Array]"]=!0,ut["[object Arguments]"]=ut["[object Array]"]=ut["[object ArrayBuffer]"]=ut["[object Boolean]"]=ut["[object DataView]"]=ut["[object Date]"]=ut["[object Error]"]=ut["[object Function]"]=ut["[object Map]"]=ut["[object Number]"]=ut["[object Object]"]=ut["[object RegExp]"]=ut["[object Set]"]=ut["[object String]"]=ut["[object WeakMap]"]=!1;var lt="object"==typeof t&&t&&!t.nodeType&&t,ft=lt&&"object"==typeof module&&module&&!module.nodeType&&module,ht=ft&&ft.exports===lt&&a.process,dt=function(){try{var t=ft&&ft.require&&ft.require("util").types;return t||ht&&ht.binding&&ht.binding("util")}catch(t){}}(),vt=dt&&dt.isTypedArray,pt=vt?ct(vt):function(t){return H(t)&&rt(t.length)&&!!ut[b(t)]},yt=Object.prototype.hasOwnProperty;function bt(t){if(null==t)return!0;if(nt(t)&&(et(t)||"string"==typeof t||"function"==typeof t.splice||at(t)||pt(t)||tt(t)))return!t.length;var e=G(t);if("[object Map]"==e||"[object Set]"==e)return!t.size;if(r(t))return!s(t).length;for(var n in t)if(yt.call(t,n))return!1;return!0}var gt=/^(?:0|[1-9]\d*)$/;function mt(t,e){var r=typeof t;return!!(e=e??9007199254740991)&&("number"==r||"symbol"!=r&&gt.test(t))&&t>-1&&t%1==0&&t<e}var _t=Object.prototype.hasOwnProperty;function wt(t,e){var r=et(t),n=!r&&tt(t),o=!r&&!n&&at(t),i=!r&&!n&&!o&&pt(t),s=r||n||o||i,a=s?function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}(t.length,String):[],u=a.length;for(var c in t)!e&&!_t.call(t,c)||s&&("length"==c||o&&("offset"==c||"parent"==c)||i&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||mt(c,u))||a.push(c);return a}function jt(t){return nt(t)?wt(t):s(t)}function It(t,e){for(var r=-1,n=null==t?0:t.length,o=Array(n);++r<n;)o[r]=e(t[r],r,t);return o}function St(t){return"symbol"==typeof t||H(t)&&"[object Symbol]"==b(t)}var Ot=l?l.prototype:void 0,At=Ot?Ot.toString:void 0;function xt(t){if("string"==typeof t)return t;if(et(t))return It(t,xt)+"";if(St(t))return At?At.call(t):"";var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function Et(t){return null==t?"":xt(t)}var Nt=0;function kt(t){var e=++Nt;return Et(t)+e}var Bt=/\s/;var Rt=/^\s+/;function Pt(t){return t?t.slice(0,function(t){for(var e=t.length;e--&&Bt.test(t.charAt(e)););return e}(t)+1).replace(Rt,""):t}var zt=/^[-+]0x[0-9a-f]+$/i,Dt=/^0b[01]+$/i,Tt=/^0o[0-7]+$/i,Ct=parseInt;var Mt=1/0;function Ft(t){return t?(t=function(t){if("number"==typeof t)return t;if(St(t))return NaN;if(g(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=g(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=Pt(t);var r=Dt.test(t);return r||Tt.test(t)?Ct(t.slice(2),r?2:8):zt.test(t)?NaN:+t}(t))===Mt||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}function Ut(t,e){var r;if("function"!=typeof e)throw new TypeError("Expected a function");return t=function(t){var e=Ft(t),r=e%1;return e==e?r?e-r:e:0}(t),function(){return--t>0&&(r=e.apply(this,arguments)),t<=1&&(e=void 0),r}}const Lt=/\s+/;function qt(t,e,r,n,o){let i,s=0;if(r&&"object"==typeof r){void 0!==n&&"context"in o&&void 0===o.context&&(o.context=n);for(i=Object.keys(r);s<i.length;s++)e=qt(t,e,i[s],r[i[s]],o)}else if(r&&"string"==typeof r&&Lt.test(r))for(i=r.split(Lt);s<i.length;s++){const r=t(e,i[s],n,o);void 0!==r&&(e=r)}else e=t(e,r,n,o);return e}function Wt(t,e,r,n){if(r){const o=t[e]||(t[e]=[]),i=n.context,s=n.ctx,a=n.listening;a&&a.count++,o.push({callback:r,context:i,ctx:i||s,listening:a})}return t}function Jt(t,e,r,n){if(!t)return;const o=n.context,i=n.listeners;let s,a=0;if(e||o||r){for(s=e?[e]:Object.keys(t);a<s.length;a++){const e=s[a],n=t[e];if(!n)continue;const i=[];for(let t=0;t<n.length;t++){const s=n[t];if(r&&r!==s.callback&&r!==s.callback._callback||o&&o!==s.context)i.push(s);else{const t=s.listening;t&&t.stop(e,r)}}i.length?t[e]=i:delete t[e]}return t}if(i)for(s=Object.keys(i);a<s.length;a++)i[s[a]].cleanup()}function Kt(t,e,r,n){if(r){const o=Ut(2,function(...t){n(e,o),r.apply(this,t)});t[e]=o,o._callback=r}return t}function Vt(t,e,r,n){if(t){const r=t[e];let o=t.all;r&&o&&(o=o.slice()),r&&Qt(r,n),o&&Qt(o,[e].concat(n))}return t}function Qt(t,e){let r,n=-1;const o=t.length,i=e[0],s=e[1],a=e[2];switch(e.length){case 0:for(;++n<o;)(r=t[n]).callback.call(r.ctx);return;case 1:for(;++n<o;)(r=t[n]).callback.call(r.ctx,i);return;case 2:for(;++n<o;)(r=t[n]).callback.call(r.ctx,i,s);return;case 3:for(;++n<o;)(r=t[n]).callback.call(r.ctx,i,s,a);return;default:for(;++n<o;)(r=t[n]).callback.apply(r.ctx,e);return}}class Gt{constructor(t,e){this.id=t._listenId,this.listener=t,this.obj=e,this.interop=!0,this.count=0,this._events=void 0}start(t,e,r,n){const o={context:this.obj,ctx:r,listening:n};if(this._events=qt(Wt,this._events||{},t,e,o),n){(this.obj._listeners||(this.obj._listeners={}))[this.id]=this,this.interop=!1}return this}stop(t,e){let r;this.interop?(this._events=qt(Jt,this._events,t,e,{context:void 0,listeners:void 0}),r=!this._events):(this.count--,r=0===this.count),r&&this.cleanup()}cleanup(){this.listener._listeningTo&&delete this.listener._listeningTo[this.obj._listenId],!this.interop&&this.obj._listeners&&delete this.obj._listeners[this.id]}}
7
2
  /**
8
3
  * @copyright 2010-2019 Jeremy Ashkenas and DocumentCloud
9
4
  * @copyright 2023 JC Brand
10
- */let ke;function $e(t){return class extends t{on(t,e,r){if(this._events=Ae(Ie,this._events||{},t,e,{context:r,ctx:this,listening:ke}),ke){(this._listeners||(this._listeners={}))[ke.id]=ke,ke.interop=!1}return this}listenTo(t,e,r){if(!t)return this;const n=t._listenId||(t._listenId=w("l")),o=this._listeningTo||(this._listeningTo={});let i=ke=o[n];i||(this._listenId||(this._listenId=w("l")),i=ke=o[n]=new Ne(this,t));const s=function(t,e,r,n){try{t.on(e,r,n)}catch(t){return t}}(t,e,r,this);if(ke=void 0,s)throw s;return i.interop&&i.start(e,r,this,ke),this}off(t,e,r){return this._events?(this._events=Ae(Se,this._events,t,e,{context:r,listeners:this._listeners}),this):this}stopListening(t,e,r){const n=this._listeningTo;if(!n)return this;const o=t?[t._listenId]:fe(n);for(let t=0;t<o.length;t++){const i=n[o[t]];if(!i)break;i.obj.off(e,r,this),i.interop&&i.stop(e,r)}return se(n)&&(this._listeningTo=void 0),this}once(t,e,r){const n=Ae(Oe,{},t,e,this.off.bind(this));return"string"==typeof t&&null==r&&(e=void 0),this.on(n,e,r)}listenToOnce(t,e,r){const n=Ae(Oe,{},e,r,this.stopListening.bind(this,t));return this.listenTo(t,n)}trigger(t,...e){return this._events?(Ae(xe,this._events,t,void 0,e),this):this}}}const Be=/^(\S+)\s*(.*)$/;class Re extends($e(HTMLElement)){set events(t){this._declarativeEvents=t}get events(){return this._declarativeEvents}constructor(t={}){super(),this.stopListening=null,this.cid=w("view"),this._declarativeEvents={},this._domEvents=[];const{model:e,collection:r,events:n}=t;Object.assign(this,{model:e,collection:r,events:n})}createRenderRoot(){return this}connectedCallback(){this._initialized||(this.preinitialize.apply(this,arguments),this.initialize.apply(this,arguments),this._initialized=!0),this.delegateEvents()}disconnectedCallback(){var t;this.undelegateEvents(),null===(t=this.stopListening)||void 0===t||t.call(this)}preinitialize(){}initialize(){}beforeRender(){}afterRender(){}render(){return this.beforeRender(),((t,e)=>{const r=e;let n=r._$litPart$;if(void 0===n){const t=null;r._$litPart$=n=new G(e.insertBefore(k(),t),t,void 0,{})}n._$AI(t)})(this.toHTML(),this),this.afterRender(),this}toHTML(){return""}delegateEvents(){if(!this.events)return this;this.undelegateEvents();for(const t in this.events){let e=this.events[t];if("function"!=typeof e&&(e=this[e]),!e)continue;const r=t.match(Be);this.delegate(r[1],r[2],e.bind(this))}return this}delegate(t,e,r){const n=this;if(!n)return this;if("function"==typeof e&&(r=e,e=null),-1!==["focus","blur"].indexOf(t)){const n=this.querySelectorAll(e);for(let e=0,o=n.length;e<o;e++){const o=n[e];o.addEventListener(t,r,!1),this._domEvents.push({el:o,eventName:t,handler:r})}return r}const o=e?function(t){let o=t.target||t.srcElement;for(;o&&o!=n;o=o.parentNode)o.matches(e)&&(t.delegateTarget=o,r(t))}:r;return this.addEventListener(t,o,!1),this._domEvents.push({el:this,eventName:t,handler:o,listener:r,selector:e}),this}undelegateEvents(){if(this){for(let t=0,e=this._domEvents.length;t<e;t++){const e=this._domEvents[t];e.el.removeEventListener(e.eventName,e.handler,!1)}this._domEvents.length=0}return this}undelegate(t,e,r){if("function"==typeof e&&(r=e,e=null),this){const n=this._domEvents.slice();let o=n.length;for(;o--;){const i=n[o];!(i.eventName!==t||r&&i.listener!==r||e&&i.selector!==e)&&(i.el.removeEventListener(i.eventName,i.handler,!1),this._domEvents.splice(o,1))}}return this}}
5
+ */let Ht;function $t(t){return class extends t{on(t,e,r){if(this._events=qt(Wt,this._events||{},t,e,{context:r,ctx:this,listening:Ht}),Ht){(this._listeners||(this._listeners={}))[Ht.id]=Ht,Ht.interop=!1}return this}listenTo(t,e,r){if(!t)return this;const n=t._listenId||(t._listenId=kt("l")),o=this._listeningTo||(this._listeningTo={});let i=Ht=o[n];i||(this._listenId||(this._listenId=kt("l")),i=Ht=o[n]=new Gt(this,t));const s=function(t,e,r,n){try{t.on(e,r,n)}catch(t){return t}}(t,e,r,this);if(Ht=void 0,s)throw s;return i.interop&&i.start(e,r,this,Ht),this}off(t,e,r){return this._events?(this._events=qt(Jt,this._events,t,e,{context:r,listeners:this._listeners}),this):this}stopListening(t,e,r){const n=this._listeningTo;if(!n)return this;const o=t?[t._listenId]:jt(n);for(let t=0;t<o.length;t++){const i=n[o[t]];if(!i)break;i.obj.off(e,r,this),i.interop&&i.stop(e,r)}return bt(n)&&(this._listeningTo=void 0),this}once(t,e,r){const n=qt(Kt,{},t,e,this.off.bind(this));return"string"==typeof t&&null==r&&(e=void 0),this.on(n,e,r)}listenToOnce(t,e,r){const n=qt(Kt,{},e,r,this.stopListening.bind(this,t));return this.listenTo(t,n)}trigger(t,...e){return this._events?(qt(Vt,this._events,t,void 0,e),this):this}}}const Xt=$t(Object);
11
6
  /*! *****************************************************************************
12
7
  Copyright (c) Microsoft Corporation.
13
8
 
@@ -21,7 +16,7 @@
21
16
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
22
17
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
23
18
  PERFORMANCE OF THIS SOFTWARE.
24
- ***************************************************************************** */var Pe=/^~~local_forage_type~([^~]+)~/,Te=Object.prototype.toString;function ze(t){var e=.75*t.length,r=t.length;"="===t[t.length-1]&&(e--,"="===t[t.length-2]&&e--);for(var n=new ArrayBuffer(e),o=new Uint8Array(n),i=0,s=0;i<r;i+=4){var a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(t[i]),u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(t[i+1]),c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(t[i+2]),l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(t[i+3]);o[s++]=a<<2|u>>4,o[s++]=(15&u)<<4|c>>2,o[s++]=(3&c)<<6|63&l}return n}function Ce(t){for(var e=new Uint8Array(t),r="",n=0;n<e.length;n+=3)r+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[e[n]>>2],r+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(3&e[n])<<4|e[n+1]>>4],r+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(15&e[n+1])<<2|e[n+2]>>6],r+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[63&e[n+2]];return e.length%3==2?r=r.substring(0,r.length-1)+"=":e.length%3==1&&(r=r.substring(0,r.length-2)+"=="),r}function Me(t){var e,r;if(null===t||"object"!=typeof t||"isActiveClone"in t)return t;var n=t instanceof Date?new Date(t):t.constructor();try{for(var o=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}
19
+ ***************************************************************************** */var Yt=/^~~local_forage_type~([^~]+)~/,Zt=Object.prototype.toString;function te(t){var e=.75*t.length,r=t.length;"="===t[t.length-1]&&(e--,"="===t[t.length-2]&&e--);for(var n=new ArrayBuffer(e),o=new Uint8Array(n),i=0,s=0;i<r;i+=4){var a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(t[i]),u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(t[i+1]),c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(t[i+2]),l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(t[i+3]);o[s++]=a<<2|u>>4,o[s++]=(15&u)<<4|c>>2,o[s++]=(3&c)<<6|63&l}return n}function ee(t){for(var e=new Uint8Array(t),r="",n=0;n<e.length;n+=3)r+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[e[n]>>2],r+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(3&e[n])<<4|e[n+1]>>4],r+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(15&e[n+1])<<2|e[n+2]>>6],r+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[63&e[n+2]];return e.length%3==2?r=r.substring(0,r.length-1)+"=":e.length%3==1&&(r=r.substring(0,r.length-2)+"=="),r}function re(t){var e,r;if(null===t||"object"!=typeof t||"isActiveClone"in t)return t;var n=t instanceof Date?new Date(t):t.constructor();try{for(var o=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}
25
20
  /*!
26
21
  MIT License
27
22
 
@@ -45,7 +40,7 @@
45
40
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
46
41
  SOFTWARE.
47
42
 
48
- */(Object.keys(t)),i=o.next();!i.done;i=o.next()){var s=i.value;Object.prototype.hasOwnProperty.call(t,s)&&(t.isActiveClone=null,n[s]=Me(t[s]),delete t.isActiveClone)}}catch(t){e={error:t}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(e)throw e.error}}return n}function De(t,e){return(t.name||e.name)+"/"+(t.storeName||e.storeName)+"/"}function Ue(t,e){e&&t.then((function(t){e(null,t)}),(function(t){e(t)}))}function Fe(){if(arguments.length&&"function"==typeof arguments[arguments.length-1])return arguments[arguments.length-1]}function Le(t,e){var r=this;if(e=Fe.apply(this,arguments),!(t="function"!=typeof t&&t||{}).name){var n=this.config();t.name=t.name||n.name,t.storeName=t.storeName||n.storeName}return{promise:t.name?new Promise((function(e){t.storeName?e(De(t,r._defaultConfig)):e(t.name+"/")})):Promise.reject("Invalid arguments"),callback:e}}function He(t){return"string"!=typeof t&&(console.warn(t+" used as a key, but it is not a string."),t=String(t)),t}var We={bufferToString:Ce,deserialize:function(t){if("__lfsc__:"!==t.substring(0,9))return JSON.parse(t);var e,r=t.substring(13),n=t.substring(9,13);if("blob"===n&&Pe.test(r)){var o=r.match(Pe);e=o[1],r=r.substring(o[0].length)}var i=ze(r);switch(n){case"arbf":return i;case"blob":return function(t,e){t=t||[],e=e||{};try{return new Blob(t,e)}catch(o){if("TypeError"!==o.name)throw o;for(var r=new("undefined"!=typeof BlobBuilder?BlobBuilder:"undefined"!=typeof MSBlobBuilder?MSBlobBuilder:"undefined"!=typeof MozBlobBuilder?MozBlobBuilder:WebKitBlobBuilder),n=0;n<t.length;n+=1)r.append(t[n]);return r.getBlob(e.type)}}([i],{type:e});case"si08":return new Int8Array(i);case"ui08":return new Uint8Array(i);case"uic8":return new Uint8ClampedArray(i);case"si16":return new Int16Array(i);case"ur16":return new Uint16Array(i);case"si32":return new Int32Array(i);case"ui32":return new Uint32Array(i);case"fl32":return new Float32Array(i);case"fl64":return new Float64Array(i);default:throw new Error("Unkown type: "+n)}},serialize:function(t,e){var r="";if(t&&(r=Te.call(t)),t&&("[object ArrayBuffer]"===r||t.buffer&&"[object ArrayBuffer]"===Te.call(t.buffer))){var n=void 0,o="__lfsc__:";t instanceof ArrayBuffer?(n=t,o+="arbf"):(n=t.buffer,"[object Int8Array]"===r?o+="si08":"[object Uint8Array]"===r?o+="ui08":"[object Uint8ClampedArray]"===r?o+="uic8":"[object Int16Array]"===r?o+="si16":"[object Uint16Array]"===r?o+="ur16":"[object Int32Array]"===r?o+="si32":"[object Uint32Array]"===r?o+="ui32":"[object Float32Array]"===r?o+="fl32":"[object Float64Array]"===r?o+="fl64":e(new Error("Failed to get type for BinaryArray"))),e(o+Ce(n))}else if("[object Blob]"===r){var i=new FileReader;i.onload=function(){var r="~~local_forage_type~"+t.type+"~"+Ce(this.result);e("__lfsc__:blob"+r)},i.readAsArrayBuffer(t)}else try{e(JSON.stringify(t))}catch(r){console.error("Couldn't convert value into a JSON string: ",t),e(null,r)}},stringToBuffer:ze},qe="localforage-driver-memory",Ve={},Je=function(){function t(t){this.kp=t,this.data={}}return t.resolve=function(e){return Ve[e]||(Ve[e]=new t(e)),Ve[e]},t.prototype.clear=function(){this.data={}},t.prototype.drop=function(){this.clear(),delete Ve[this.kp]},t.prototype.get=function(t){return this.data[t]},t.prototype.key=function(t){return this.keys()[t]},t.prototype.keys=function(){return Object.keys(this.data)},t.prototype.rm=function(t){delete this.data[t]},t.prototype.set=function(t,e){this.data[t]=e},t}();
43
+ */(Object.keys(t)),i=o.next();!i.done;i=o.next()){var s=i.value;Object.prototype.hasOwnProperty.call(t,s)&&(t.isActiveClone=null,n[s]=re(t[s]),delete t.isActiveClone)}}catch(t){e={error:t}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(e)throw e.error}}return n}function ne(t,e){return(t.name||e.name)+"/"+(t.storeName||e.storeName)+"/"}function oe(t,e){e&&t.then(function(t){e(null,t)},function(t){e(t)})}function ie(){if(arguments.length&&"function"==typeof arguments[arguments.length-1])return arguments[arguments.length-1]}function se(t,e){var r=this;if(e=ie.apply(this,arguments),!(t="function"!=typeof t&&t||{}).name){var n=this.config();t.name=t.name||n.name,t.storeName=t.storeName||n.storeName}return{promise:t.name?new Promise(function(e){t.storeName?e(ne(t,r._defaultConfig)):e(t.name+"/")}):Promise.reject("Invalid arguments"),callback:e}}function ae(t){return"string"!=typeof t&&(console.warn(t+" used as a key, but it is not a string."),t=String(t)),t}var ue={bufferToString:ee,deserialize:function(t){if("__lfsc__:"!==t.substring(0,9))return JSON.parse(t);var e,r=t.substring(13),n=t.substring(9,13);if("blob"===n&&Yt.test(r)){var o=r.match(Yt);e=o[1],r=r.substring(o[0].length)}var i=te(r);switch(n){case"arbf":return i;case"blob":return function(t,e){t=t||[],e=e||{};try{return new Blob(t,e)}catch(o){if("TypeError"!==o.name)throw o;for(var r=new("undefined"!=typeof BlobBuilder?BlobBuilder:"undefined"!=typeof MSBlobBuilder?MSBlobBuilder:"undefined"!=typeof MozBlobBuilder?MozBlobBuilder:WebKitBlobBuilder),n=0;n<t.length;n+=1)r.append(t[n]);return r.getBlob(e.type)}}([i],{type:e});case"si08":return new Int8Array(i);case"ui08":return new Uint8Array(i);case"uic8":return new Uint8ClampedArray(i);case"si16":return new Int16Array(i);case"ur16":return new Uint16Array(i);case"si32":return new Int32Array(i);case"ui32":return new Uint32Array(i);case"fl32":return new Float32Array(i);case"fl64":return new Float64Array(i);default:throw new Error("Unkown type: "+n)}},serialize:function(t,e){var r="";if(t&&(r=Zt.call(t)),t&&("[object ArrayBuffer]"===r||t.buffer&&"[object ArrayBuffer]"===Zt.call(t.buffer))){var n=void 0,o="__lfsc__:";t instanceof ArrayBuffer?(n=t,o+="arbf"):(n=t.buffer,"[object Int8Array]"===r?o+="si08":"[object Uint8Array]"===r?o+="ui08":"[object Uint8ClampedArray]"===r?o+="uic8":"[object Int16Array]"===r?o+="si16":"[object Uint16Array]"===r?o+="ur16":"[object Int32Array]"===r?o+="si32":"[object Uint32Array]"===r?o+="ui32":"[object Float32Array]"===r?o+="fl32":"[object Float64Array]"===r?o+="fl64":e(new Error("Failed to get type for BinaryArray"))),e(o+ee(n))}else if("[object Blob]"===r){var i=new FileReader;i.onload=function(){var r="~~local_forage_type~"+t.type+"~"+ee(this.result);e("__lfsc__:blob"+r)},i.readAsArrayBuffer(t)}else try{e(JSON.stringify(t))}catch(r){console.error("Couldn't convert value into a JSON string: ",t),e(null,r)}},stringToBuffer:te},ce="localforage-driver-memory",le={},fe=function(){function t(t){this.kp=t,this.data={}}return t.resolve=function(e){return le[e]||(le[e]=new t(e)),le[e]},t.prototype.clear=function(){this.data={}},t.prototype.drop=function(){this.clear(),delete le[this.kp]},t.prototype.get=function(t){return this.data[t]},t.prototype.key=function(t){return this.keys()[t]},t.prototype.keys=function(){return Object.keys(this.data)},t.prototype.rm=function(t){delete this.data[t]},t.prototype.set=function(t,e){this.data[t]=e},t}();
49
44
  /*!
50
45
  MIT License
51
46
 
@@ -69,11 +64,11 @@
69
64
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
70
65
  SOFTWARE.
71
66
 
72
- */var Ke=Object.freeze({__proto__:null,_driver:qe,_initStorage:function(t){var e=t?Me(t):{},r=De(e,this._defaultConfig),n=Je.resolve(r);return this._dbInfo=e,this._dbInfo.serializer=We,this._dbInfo.keyPrefix=r,this._dbInfo.mStore=n,Promise.resolve()},_support:!0,clear:function(t){var e=this,r=this.ready().then((function(){e._dbInfo.mStore.clear()}));return Ue(r,t),r},dropInstance:function(t,e){var r=Le.apply(this,arguments),n=r.promise,o=r.callback;return Ue(n.then((function(t){Je.resolve(t).drop()})),o),n},getItem:function(t,e){var r=this;t=He(t);var n=this.ready().then((function(){var e=r._dbInfo.mStore.get(t);return null==e?null:r._dbInfo.serializer.deserialize(e)}));return Ue(n,e),n},iterate:function(t,e){var r=this,n=this.ready().then((function(){for(var e=r._dbInfo.mStore,n=e.keys(),o=0;o<n.length;o++){var i=e.get(n[o]);if(i&&(i=r._dbInfo.serializer.deserialize(i)),void 0!==(i=t(i,n[o],o+1)))return i}}));return Ue(n,e),n},key:function(t,e){var r=this,n=this.ready().then((function(){var e;try{void 0===(e=r._dbInfo.mStore.key(t))&&(e=null)}catch(t){e=null}return e}));return Ue(n,e),n},keys:function(t){var e=this,r=this.ready().then((function(){return e._dbInfo.mStore.keys()}));return Ue(r,t),r},length:function(t){var e=this.keys().then((function(t){return t.length}));return Ue(e,t),e},removeItem:function(t,e){var r=this;t=He(t);var n=this.ready().then((function(){r._dbInfo.mStore.rm(t)}));return Ue(n,e),n},setItem:function(t,e,r){var n=this;t=He(t);var o=this.ready().then((function(){void 0===e&&(e=null);var r=e;return new Promise((function(o,i){n._dbInfo.serializer.serialize(e,(function(e,s){if(s)i(s);else try{n._dbInfo.mStore.set(t,e),o(r)}catch(t){i(t)}}))}))}));return Ue(o,r),o}});function Qe(t,e){return t===e||t!=t&&e!=e}function Ge(t,e){for(var r=t.length;r--;)if(Qe(t[r][0],e))return r;return-1}var Xe=Array.prototype.splice;function Ye(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Ye.prototype.clear=function(){this.__data__=[],this.size=0},Ye.prototype.delete=function(t){var e=this.__data__,r=Ge(e,t);return!(r<0)&&(r==e.length-1?e.pop():Xe.call(e,r,1),--this.size,!0)},Ye.prototype.get=function(t){var e=this.__data__,r=Ge(e,t);return r<0?void 0:e[r][1]},Ye.prototype.has=function(t){return Ge(this.__data__,t)>-1},Ye.prototype.set=function(t,e){var r=this.__data__,n=Ge(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this};var Ze=At(Object,"create");var tr=Object.prototype.hasOwnProperty;var er=Object.prototype.hasOwnProperty;function rr(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function nr(t,e){var r,n,o=t.__data__;return("string"==(n=typeof(r=e))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?o["string"==typeof e?"string":"hash"]:o.map}function or(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}rr.prototype.clear=function(){this.__data__=Ze?Ze(null):{},this.size=0},rr.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},rr.prototype.get=function(t){var e=this.__data__;if(Ze){var r=e[t];return"__lodash_hash_undefined__"===r?void 0:r}return tr.call(e,t)?e[t]:void 0},rr.prototype.has=function(t){var e=this.__data__;return Ze?void 0!==e[t]:er.call(e,t)},rr.prototype.set=function(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=Ze&&void 0===e?"__lodash_hash_undefined__":e,this},or.prototype.clear=function(){this.size=0,this.__data__={hash:new rr,map:new(St||Ye),string:new rr}},or.prototype.delete=function(t){var e=nr(this,t).delete(t);return this.size-=e?1:0,e},or.prototype.get=function(t){return nr(this,t).get(t)},or.prototype.has=function(t){return nr(this,t).has(t)},or.prototype.set=function(t,e){var r=nr(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this};function ir(t){var e=this.__data__=new Ye(t);this.size=e.size}ir.prototype.clear=function(){this.__data__=new Ye,this.size=0},ir.prototype.delete=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r},ir.prototype.get=function(t){return this.__data__.get(t)},ir.prototype.has=function(t){return this.__data__.has(t)},ir.prototype.set=function(t,e){var r=this.__data__;if(r instanceof Ye){var n=r.__data__;if(!St||n.length<199)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new or(n)}return r.set(t,e),this.size=r.size,this};var sr=function(){try{var t=At(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();function ar(t,e,r){"__proto__"==e&&sr?sr(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}var ur=Object.prototype.hasOwnProperty;function cr(t,e,r){var n=t[e];ur.call(t,e)&&Qe(n,r)&&(void 0!==r||e in t)||ar(t,e,r)}function lr(t,e,r,n){var o=!r;r||(r={});for(var i=-1,s=e.length;++i<s;){var a=e[i],u=void 0;void 0===u&&(u=t[a]),o?ar(r,a,u):cr(r,a,u)}return r}var fr=Object.prototype.hasOwnProperty;function hr(t){if(!ct(t))return function(t){var e=[];if(null!=t)for(var r in Object(t))e.push(r);return e}(t);var e=ot(t),r=[];for(var n in t)("constructor"!=n||!e&&fr.call(t,n))&&r.push(n);return r}function dr(t){return Vt(t)?le(t,!0):hr(t)}var vr="object"==typeof t&&t&&!t.nodeType&&t,pr=vr&&"object"==typeof module&&module&&!module.nodeType&&module,yr=pr&&pr.exports===vr?n.Buffer:void 0,gr=yr?yr.allocUnsafe:void 0;function br(t,e){if(e)return t.slice();var r=t.length,n=gr?gr(r):new t.constructor(r);return t.copy(n),n}function mr(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}function _r(){return[]}var wr=Object.prototype.propertyIsEnumerable,jr=Object.getOwnPropertySymbols,Ar=jr?function(t){return null==t?[]:(t=Object(t),function(t,e){for(var r=-1,n=null==t?0:t.length,o=0,i=[];++r<n;){var s=t[r];e(s,r,t)&&(i[o++]=s)}return i}(jr(t),(function(e){return wr.call(t,e)})))}:_r;function Ir(t,e){for(var r=-1,n=e.length,o=t.length;++r<n;)t[o+r]=e[r];return t}var Sr=it(Object.getPrototypeOf,Object),Or=Object.getOwnPropertySymbols?function(t){for(var e=[];t;)Ir(e,Ar(t)),t=Sr(t);return e}:_r;function xr(t,e,r){var n=e(t);return s(t)?n:Ir(n,r(t))}function Er(t){return xr(t,fe,Ar)}function Nr(t){return xr(t,dr,Or)}var kr=Object.prototype.hasOwnProperty;var $r=n.Uint8Array;function Br(t){var e=new t.constructor(t.byteLength);return new $r(e).set(new $r(t)),e}var Rr=/\w*$/;var Pr=o?o.prototype:void 0,Tr=Pr?Pr.valueOf:void 0;function zr(t,e){var r=e?Br(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}function Cr(t,e,r){var n,o=t.constructor;switch(e){case"[object ArrayBuffer]":return Br(t);case"[object Boolean]":case"[object Date]":return new o(+t);case"[object DataView]":return function(t,e){var r=e?Br(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}(t,r);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return zr(t,r);case"[object Map]":case"[object Set]":return new o;case"[object Number]":case"[object String]":return new o(t);case"[object RegExp]":return function(t){var e=new t.constructor(t.source,Rr.exec(t));return e.lastIndex=t.lastIndex,e}(t);case"[object Symbol]":return n=t,Tr?Object(Tr.call(n)):{}}}var Mr=Object.create,Dr=function(){function t(){}return function(e){if(!ct(e))return{};if(Mr)return Mr(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}();function Ur(t){return"function"!=typeof t.constructor||ot(t)?{}:Dr(Sr(t))}var Fr=re&&re.isMap,Lr=Fr?Yt(Fr):function(t){return v(t)&&"[object Map]"==Dt(t)};var Hr=re&&re.isSet,Wr=Hr?Yt(Hr):function(t){return v(t)&&"[object Set]"==Dt(t)},qr="[object Arguments]",Vr="[object Function]",Jr="[object Object]",Kr={};function Qr(t,e,r,n,o,i){var a,u=1&e,c=2&e,l=4&e;if(r&&(a=o?r(t,n,o,i):r(t)),void 0!==a)return a;if(!ct(t))return t;var f=s(t);if(f){if(a=function(t){var e=t.length,r=new t.constructor(e);return e&&"string"==typeof t[0]&&kr.call(t,"index")&&(r.index=t.index,r.input=t.input),r}(t),!u)return mr(t,a)}else{var h=Dt(t),d=h==Vr||"[object GeneratorFunction]"==h;if(Gt(t))return br(t,u);if(h==Jr||h==qr||d&&!o){if(a=c||d?{}:Ur(t),!u)return c?function(t,e){return lr(t,Or(t),e)}(t,function(t,e){return t&&lr(e,dr(e),t)}(a,t)):function(t,e){return lr(t,Ar(t),e)}(t,function(t,e){return t&&lr(e,fe(e),t)}(a,t))}else{if(!Kr[h])return o?t:{};a=Cr(t,h,u)}}i||(i=new ir);var v=i.get(t);if(v)return v;i.set(t,a),Wr(t)?t.forEach((function(n){a.add(Qr(n,e,r,n,t,i))})):Lr(t)&&t.forEach((function(n,o){a.set(o,Qr(n,e,r,o,t,i))}));var p=f?void 0:(l?c?Nr:Er:c?dr:fe)(t);return function(t,e){for(var r=-1,n=null==t?0:t.length;++r<n&&!1!==e(t[r],r,t););}(p||t,(function(n,o){p&&(n=t[o=n]),cr(a,o,Qr(n,e,r,o,t,i))})),a}Kr[qr]=Kr["[object Array]"]=Kr["[object ArrayBuffer]"]=Kr["[object DataView]"]=Kr["[object Boolean]"]=Kr["[object Date]"]=Kr["[object Float32Array]"]=Kr["[object Float64Array]"]=Kr["[object Int8Array]"]=Kr["[object Int16Array]"]=Kr["[object Int32Array]"]=Kr["[object Map]"]=Kr["[object Number]"]=Kr[Jr]=Kr["[object RegExp]"]=Kr["[object Set]"]=Kr["[object String]"]=Kr["[object Symbol]"]=Kr["[object Uint8Array]"]=Kr["[object Uint8ClampedArray]"]=Kr["[object Uint16Array]"]=Kr["[object Uint32Array]"]=!0,Kr["[object Error]"]=Kr[Vr]=Kr["[object WeakMap]"]=!1;function Gr(t){return"string"==typeof t||!s(t)&&v(t)&&"[object String]"==d(t)}var Xr="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Yr(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Zr(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var tn,en={exports:{}};
67
+ */var he=Object.freeze({__proto__:null,_driver:ce,_initStorage:function(t){var e=t?re(t):{},r=ne(e,this._defaultConfig),n=fe.resolve(r);return this._dbInfo=e,this._dbInfo.serializer=ue,this._dbInfo.keyPrefix=r,this._dbInfo.mStore=n,Promise.resolve()},_support:!0,clear:function(t){var e=this,r=this.ready().then(function(){e._dbInfo.mStore.clear()});return oe(r,t),r},dropInstance:function(t,e){var r=se.apply(this,arguments),n=r.promise,o=r.callback;return oe(n.then(function(t){fe.resolve(t).drop()}),o),n},getItem:function(t,e){var r=this;t=ae(t);var n=this.ready().then(function(){var e=r._dbInfo.mStore.get(t);return null==e?null:r._dbInfo.serializer.deserialize(e)});return oe(n,e),n},iterate:function(t,e){var r=this,n=this.ready().then(function(){for(var e=r._dbInfo.mStore,n=e.keys(),o=0;o<n.length;o++){var i=e.get(n[o]);if(i&&(i=r._dbInfo.serializer.deserialize(i)),void 0!==(i=t(i,n[o],o+1)))return i}});return oe(n,e),n},key:function(t,e){var r=this,n=this.ready().then(function(){var e;try{void 0===(e=r._dbInfo.mStore.key(t))&&(e=null)}catch(t){e=null}return e});return oe(n,e),n},keys:function(t){var e=this,r=this.ready().then(function(){return e._dbInfo.mStore.keys()});return oe(r,t),r},length:function(t){var e=this.keys().then(function(t){return t.length});return oe(e,t),e},removeItem:function(t,e){var r=this;t=ae(t);var n=this.ready().then(function(){r._dbInfo.mStore.rm(t)});return oe(n,e),n},setItem:function(t,e,r){var n=this;t=ae(t);var o=this.ready().then(function(){void 0===e&&(e=null);var r=e;return new Promise(function(o,i){n._dbInfo.serializer.serialize(e,function(e,s){if(s)i(s);else try{n._dbInfo.mStore.set(t,e),o(r)}catch(t){i(t)}})})});return oe(o,r),o}});function de(t,e){return t===e||t!=t&&e!=e}function ve(t,e){for(var r=t.length;r--;)if(de(t[r][0],e))return r;return-1}var pe=Array.prototype.splice;function ye(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}ye.prototype.clear=function(){this.__data__=[],this.size=0},ye.prototype.delete=function(t){var e=this.__data__,r=ve(e,t);return!(r<0)&&(r==e.length-1?e.pop():pe.call(e,r,1),--this.size,!0)},ye.prototype.get=function(t){var e=this.__data__,r=ve(e,t);return r<0?void 0:e[r][1]},ye.prototype.has=function(t){return ve(this.__data__,t)>-1},ye.prototype.set=function(t,e){var r=this.__data__,n=ve(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this};var be=R(Object,"create");var ge=Object.prototype.hasOwnProperty;var me=Object.prototype.hasOwnProperty;function _e(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function we(t,e){var r,n,o=t.__data__;return("string"==(n=typeof(r=e))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?o["string"==typeof e?"string":"hash"]:o.map}function je(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}_e.prototype.clear=function(){this.__data__=be?be(null):{},this.size=0},_e.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},_e.prototype.get=function(t){var e=this.__data__;if(be){var r=e[t];return"__lodash_hash_undefined__"===r?void 0:r}return ge.call(e,t)?e[t]:void 0},_e.prototype.has=function(t){var e=this.__data__;return be?void 0!==e[t]:me.call(e,t)},_e.prototype.set=function(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=be&&void 0===e?"__lodash_hash_undefined__":e,this},je.prototype.clear=function(){this.size=0,this.__data__={hash:new _e,map:new(z||ye),string:new _e}},je.prototype.delete=function(t){var e=we(this,t).delete(t);return this.size-=e?1:0,e},je.prototype.get=function(t){return we(this,t).get(t)},je.prototype.has=function(t){return we(this,t).has(t)},je.prototype.set=function(t,e){var r=we(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this};function Ie(t){var e=this.__data__=new ye(t);this.size=e.size}Ie.prototype.clear=function(){this.__data__=new ye,this.size=0},Ie.prototype.delete=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r},Ie.prototype.get=function(t){return this.__data__.get(t)},Ie.prototype.has=function(t){return this.__data__.has(t)},Ie.prototype.set=function(t,e){var r=this.__data__;if(r instanceof ye){var n=r.__data__;if(!z||n.length<199)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new je(n)}return r.set(t,e),this.size=r.size,this};var Se=function(){try{var t=R(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();function Oe(t,e,r){"__proto__"==e&&Se?Se(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}var Ae=Object.prototype.hasOwnProperty;function xe(t,e,r){var n=t[e];Ae.call(t,e)&&de(n,r)&&(void 0!==r||e in t)||Oe(t,e,r)}function Ee(t,e,r,n){var o=!r;r||(r={});for(var i=-1,s=e.length;++i<s;){var a=e[i],u=void 0;void 0===u&&(u=t[a]),o?Oe(r,a,u):xe(r,a,u)}return r}var Ne=Object.prototype.hasOwnProperty;function ke(t){if(!g(t))return function(t){var e=[];if(null!=t)for(var r in Object(t))e.push(r);return e}(t);var e=r(t),n=[];for(var o in t)("constructor"!=o||!e&&Ne.call(t,o))&&n.push(o);return n}function Be(t){return nt(t)?wt(t,!0):ke(t)}var Re="object"==typeof t&&t&&!t.nodeType&&t,Pe=Re&&"object"==typeof module&&module&&!module.nodeType&&module,ze=Pe&&Pe.exports===Re?c.Buffer:void 0,De=ze?ze.allocUnsafe:void 0;function Te(t,e){if(e)return t.slice();var r=t.length,n=De?De(r):new t.constructor(r);return t.copy(n),n}function Ce(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}function Me(){return[]}var Fe=Object.prototype.propertyIsEnumerable,Ue=Object.getOwnPropertySymbols,Le=Ue?function(t){return null==t?[]:(t=Object(t),function(t,e){for(var r=-1,n=null==t?0:t.length,o=0,i=[];++r<n;){var s=t[r];e(s,r,t)&&(i[o++]=s)}return i}(Ue(t),function(e){return Fe.call(t,e)}))}:Me;function qe(t,e){for(var r=-1,n=e.length,o=t.length;++r<n;)t[o+r]=e[r];return t}var We=n(Object.getPrototypeOf,Object),Je=Object.getOwnPropertySymbols?function(t){for(var e=[];t;)qe(e,Le(t)),t=We(t);return e}:Me;function Ke(t,e,r){var n=e(t);return et(t)?n:qe(n,r(t))}function Ve(t){return Ke(t,jt,Le)}function Qe(t){return Ke(t,Be,Je)}var Ge=Object.prototype.hasOwnProperty;var He=c.Uint8Array;function $e(t){var e=new t.constructor(t.byteLength);return new He(e).set(new He(t)),e}var Xe=/\w*$/;var Ye=l?l.prototype:void 0,Ze=Ye?Ye.valueOf:void 0;function tr(t,e){var r=e?$e(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}function er(t,e,r){var n,o=t.constructor;switch(e){case"[object ArrayBuffer]":return $e(t);case"[object Boolean]":case"[object Date]":return new o(+t);case"[object DataView]":return function(t,e){var r=e?$e(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}(t,r);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return tr(t,r);case"[object Map]":case"[object Set]":return new o;case"[object Number]":case"[object String]":return new o(t);case"[object RegExp]":return function(t){var e=new t.constructor(t.source,Xe.exec(t));return e.lastIndex=t.lastIndex,e}(t);case"[object Symbol]":return n=t,Ze?Object(Ze.call(n)):{}}}var rr=Object.create,nr=function(){function t(){}return function(e){if(!g(e))return{};if(rr)return rr(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}();function or(t){return"function"!=typeof t.constructor||r(t)?{}:nr(We(t))}var ir=dt&&dt.isMap,sr=ir?ct(ir):function(t){return H(t)&&"[object Map]"==G(t)};var ar=dt&&dt.isSet,ur=ar?ct(ar):function(t){return H(t)&&"[object Set]"==G(t)},cr="[object Arguments]",lr="[object Function]",fr="[object Object]",hr={};function dr(t,e,r,n,o,i){var s,a=1&e,u=2&e,c=4&e;if(r&&(s=o?r(t,n,o,i):r(t)),void 0!==s)return s;if(!g(t))return t;var l=et(t);if(l){if(s=function(t){var e=t.length,r=new t.constructor(e);return e&&"string"==typeof t[0]&&Ge.call(t,"index")&&(r.index=t.index,r.input=t.input),r}(t),!a)return Ce(t,s)}else{var f=G(t),h=f==lr||"[object GeneratorFunction]"==f;if(at(t))return Te(t,a);if(f==fr||f==cr||h&&!o){if(s=u||h?{}:or(t),!a)return u?function(t,e){return Ee(t,Je(t),e)}(t,function(t,e){return t&&Ee(e,Be(e),t)}(s,t)):function(t,e){return Ee(t,Le(t),e)}(t,function(t,e){return t&&Ee(e,jt(e),t)}(s,t))}else{if(!hr[f])return o?t:{};s=er(t,f,a)}}i||(i=new Ie);var d=i.get(t);if(d)return d;i.set(t,s),ur(t)?t.forEach(function(n){s.add(dr(n,e,r,n,t,i))}):sr(t)&&t.forEach(function(n,o){s.set(o,dr(n,e,r,o,t,i))});var v=l?void 0:(c?u?Qe:Ve:u?Be:jt)(t);return function(t,e){for(var r=-1,n=null==t?0:t.length;++r<n&&!1!==e(t[r],r,t););}(v||t,function(n,o){v&&(n=t[o=n]),xe(s,o,dr(n,e,r,o,t,i))}),s}hr[cr]=hr["[object Array]"]=hr["[object ArrayBuffer]"]=hr["[object DataView]"]=hr["[object Boolean]"]=hr["[object Date]"]=hr["[object Float32Array]"]=hr["[object Float64Array]"]=hr["[object Int8Array]"]=hr["[object Int16Array]"]=hr["[object Int32Array]"]=hr["[object Map]"]=hr["[object Number]"]=hr[fr]=hr["[object RegExp]"]=hr["[object Set]"]=hr["[object String]"]=hr["[object Symbol]"]=hr["[object Uint8Array]"]=hr["[object Uint8ClampedArray]"]=hr["[object Uint16Array]"]=hr["[object Uint32Array]"]=!0,hr["[object Error]"]=hr[lr]=hr["[object WeakMap]"]=!1;function vr(t){return"string"==typeof t||!et(t)&&H(t)&&"[object String]"==b(t)}var pr="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function yr(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function br(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var gr,mr={exports:{}};
73
68
  /*!
74
69
  localForage -- Offline Storage, Improved
75
70
  Version 1.10.0
76
71
  https://localforage.github.io/localForage
77
72
  (c) 2013-2017 Mozilla, Apache License 2.0
78
- */function rn(){return tn||(tn=1,function(t){t.exports=function t(e,r,n){function o(s,a){if(!r[s]){if(!e[s]){if(!a&&Zr)return Zr(s);if(i)return i(s,!0);var u=new Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var c=r[s]={exports:{}};e[s][0].call(c.exports,(function(t){var r=e[s][1][t];return o(r||t)}),c,c.exports,t,e,r,n)}return r[s].exports}for(var i=Zr,s=0;s<n.length;s++)o(n[s]);return o}({1:[function(t,e,r){(function(t){var r,n,o=t.MutationObserver||t.WebKitMutationObserver;if(o){var i=0,s=new o(l),a=t.document.createTextNode("");s.observe(a,{characterData:!0}),r=function(){a.data=i=++i%2}}else if(t.setImmediate||void 0===t.MessageChannel)r="document"in t&&"onreadystatechange"in t.document.createElement("script")?function(){var e=t.document.createElement("script");e.onreadystatechange=function(){l(),e.onreadystatechange=null,e.parentNode.removeChild(e),e=null},t.document.documentElement.appendChild(e)}:function(){setTimeout(l,0)};else{var u=new t.MessageChannel;u.port1.onmessage=l,r=function(){u.port2.postMessage(0)}}var c=[];function l(){var t,e;n=!0;for(var r=c.length;r;){for(e=c,c=[],t=-1;++t<r;)e[t]();r=c.length}n=!1}function f(t){1!==c.push(t)||n||r()}e.exports=f}).call(this,void 0!==Xr?Xr:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],2:[function(t,e,r){var n=t(1);function o(){}var i={},s=["REJECTED"],a=["FULFILLED"],u=["PENDING"];function c(t){if("function"!=typeof t)throw new TypeError("resolver must be a function");this.state=u,this.queue=[],this.outcome=void 0,t!==o&&d(this,t)}function l(t,e,r){this.promise=t,"function"==typeof e&&(this.onFulfilled=e,this.callFulfilled=this.otherCallFulfilled),"function"==typeof r&&(this.onRejected=r,this.callRejected=this.otherCallRejected)}function f(t,e,r){n((function(){var n;try{n=e(r)}catch(e){return i.reject(t,e)}n===t?i.reject(t,new TypeError("Cannot resolve promise with itself")):i.resolve(t,n)}))}function h(t){var e=t&&t.then;if(t&&("object"==typeof t||"function"==typeof t)&&"function"==typeof e)return function(){e.apply(t,arguments)}}function d(t,e){var r=!1;function n(e){r||(r=!0,i.reject(t,e))}function o(e){r||(r=!0,i.resolve(t,e))}function s(){e(o,n)}var a=v(s);"error"===a.status&&n(a.value)}function v(t,e){var r={};try{r.value=t(e),r.status="success"}catch(t){r.status="error",r.value=t}return r}function p(t){return t instanceof this?t:i.resolve(new this(o),t)}function y(t){var e=new this(o);return i.reject(e,t)}function g(t){var e=this;if("[object Array]"!==Object.prototype.toString.call(t))return this.reject(new TypeError("must be an array"));var r=t.length,n=!1;if(!r)return this.resolve([]);for(var s=new Array(r),a=0,u=-1,c=new this(o);++u<r;)l(t[u],u);return c;function l(t,o){function u(t){s[o]=t,++a!==r||n||(n=!0,i.resolve(c,s))}e.resolve(t).then(u,(function(t){n||(n=!0,i.reject(c,t))}))}}function b(t){var e=this;if("[object Array]"!==Object.prototype.toString.call(t))return this.reject(new TypeError("must be an array"));var r=t.length,n=!1;if(!r)return this.resolve([]);for(var s=-1,a=new this(o);++s<r;)u(t[s]);return a;function u(t){e.resolve(t).then((function(t){n||(n=!0,i.resolve(a,t))}),(function(t){n||(n=!0,i.reject(a,t))}))}}e.exports=c,c.prototype.catch=function(t){return this.then(null,t)},c.prototype.then=function(t,e){if("function"!=typeof t&&this.state===a||"function"!=typeof e&&this.state===s)return this;var r=new this.constructor(o);return this.state!==u?f(r,this.state===a?t:e,this.outcome):this.queue.push(new l(r,t,e)),r},l.prototype.callFulfilled=function(t){i.resolve(this.promise,t)},l.prototype.otherCallFulfilled=function(t){f(this.promise,this.onFulfilled,t)},l.prototype.callRejected=function(t){i.reject(this.promise,t)},l.prototype.otherCallRejected=function(t){f(this.promise,this.onRejected,t)},i.resolve=function(t,e){var r=v(h,e);if("error"===r.status)return i.reject(t,r.value);var n=r.value;if(n)d(t,n);else{t.state=a,t.outcome=e;for(var o=-1,s=t.queue.length;++o<s;)t.queue[o].callFulfilled(e)}return t},i.reject=function(t,e){t.state=s,t.outcome=e;for(var r=-1,n=t.queue.length;++r<n;)t.queue[r].callRejected(e);return t},c.resolve=p,c.reject=y,c.all=g,c.race=b},{1:1}],3:[function(t,e,r){(function(e){"function"!=typeof e.Promise&&(e.Promise=t(2))}).call(this,void 0!==Xr?Xr:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{2:2}],4:[function(t,e,r){var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(){try{if("undefined"!=typeof indexedDB)return indexedDB;if("undefined"!=typeof webkitIndexedDB)return webkitIndexedDB;if("undefined"!=typeof mozIndexedDB)return mozIndexedDB;if("undefined"!=typeof OIndexedDB)return OIndexedDB;if("undefined"!=typeof msIndexedDB)return msIndexedDB}catch(t){return}}var s=i();function a(){try{if(!s||!s.open)return!1;var t="undefined"!=typeof openDatabase&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),e="function"==typeof fetch&&-1!==fetch.toString().indexOf("[native code");return(!t||e)&&"undefined"!=typeof indexedDB&&"undefined"!=typeof IDBKeyRange}catch(t){return!1}}function u(t,e){t=t||[],e=e||{};try{return new Blob(t,e)}catch(o){if("TypeError"!==o.name)throw o;for(var r=new("undefined"!=typeof BlobBuilder?BlobBuilder:"undefined"!=typeof MSBlobBuilder?MSBlobBuilder:"undefined"!=typeof MozBlobBuilder?MozBlobBuilder:WebKitBlobBuilder),n=0;n<t.length;n+=1)r.append(t[n]);return r.getBlob(e.type)}}"undefined"==typeof Promise&&t(3);var c=Promise;function l(t,e){e&&t.then((function(t){e(null,t)}),(function(t){e(t)}))}function f(t,e,r){"function"==typeof e&&t.then(e),"function"==typeof r&&t.catch(r)}function h(t){return"string"!=typeof t&&(console.warn(t+" used as a key, but it is not a string."),t=String(t)),t}function d(){if(arguments.length&&"function"==typeof arguments[arguments.length-1])return arguments[arguments.length-1]}var v="local-forage-detect-blob-support",p=void 0,y={},g=Object.prototype.toString,b="readonly",m="readwrite";function _(t){for(var e=t.length,r=new ArrayBuffer(e),n=new Uint8Array(r),o=0;o<e;o++)n[o]=t.charCodeAt(o);return r}function w(t){return new c((function(e){var r=t.transaction(v,m),n=u([""]);r.objectStore(v).put(n,"key"),r.onabort=function(t){t.preventDefault(),t.stopPropagation(),e(!1)},r.oncomplete=function(){var t=navigator.userAgent.match(/Chrome\/(\d+)/),r=navigator.userAgent.match(/Edge\//);e(r||!t||parseInt(t[1],10)>=43)}})).catch((function(){return!1}))}function j(t){return"boolean"==typeof p?c.resolve(p):w(t).then((function(t){return p=t}))}function A(t){var e=y[t.name],r={};r.promise=new c((function(t,e){r.resolve=t,r.reject=e})),e.deferredOperations.push(r),e.dbReady?e.dbReady=e.dbReady.then((function(){return r.promise})):e.dbReady=r.promise}function I(t){var e=y[t.name].deferredOperations.pop();if(e)return e.resolve(),e.promise}function S(t,e){var r=y[t.name].deferredOperations.pop();if(r)return r.reject(e),r.promise}function O(t,e){return new c((function(r,n){if(y[t.name]=y[t.name]||z(),t.db){if(!e)return r(t.db);A(t),t.db.close()}var o=[t.name];e&&o.push(t.version);var i=s.open.apply(s,o);e&&(i.onupgradeneeded=function(e){var r=i.result;try{r.createObjectStore(t.storeName),e.oldVersion<=1&&r.createObjectStore(v)}catch(r){if("ConstraintError"!==r.name)throw r;console.warn('The database "'+t.name+'" has been upgraded from version '+e.oldVersion+" to version "+e.newVersion+', but the storage "'+t.storeName+'" already exists.')}}),i.onerror=function(t){t.preventDefault(),n(i.error)},i.onsuccess=function(){var e=i.result;e.onversionchange=function(t){t.target.close()},r(e),I(t)}}))}function x(t){return O(t,!1)}function E(t){return O(t,!0)}function N(t,e){if(!t.db)return!0;var r=!t.db.objectStoreNames.contains(t.storeName),n=t.version<t.db.version,o=t.version>t.db.version;if(n&&(t.version!==e&&console.warn('The database "'+t.name+"\" can't be downgraded from version "+t.db.version+" to version "+t.version+"."),t.version=t.db.version),o||r){if(r){var i=t.db.version+1;i>t.version&&(t.version=i)}return!0}return!1}function k(t){return new c((function(e,r){var n=new FileReader;n.onerror=r,n.onloadend=function(r){var n=btoa(r.target.result||"");e({__local_forage_encoded_blob:!0,data:n,type:t.type})},n.readAsBinaryString(t)}))}function $(t){return u([_(atob(t.data))],{type:t.type})}function B(t){return t&&t.__local_forage_encoded_blob}function R(t){var e=this,r=e._initReady().then((function(){var t=y[e._dbInfo.name];if(t&&t.dbReady)return t.dbReady}));return f(r,t,t),r}function P(t){A(t);for(var e=y[t.name],r=e.forages,n=0;n<r.length;n++){var o=r[n];o._dbInfo.db&&(o._dbInfo.db.close(),o._dbInfo.db=null)}return t.db=null,x(t).then((function(e){return t.db=e,N(t)?E(t):e})).then((function(n){t.db=e.db=n;for(var o=0;o<r.length;o++)r[o]._dbInfo.db=n})).catch((function(e){throw S(t,e),e}))}function T(t,e,r,n){void 0===n&&(n=1);try{var o=t.db.transaction(t.storeName,e);r(null,o)}catch(o){if(n>0&&(!t.db||"InvalidStateError"===o.name||"NotFoundError"===o.name))return c.resolve().then((function(){if(!t.db||"NotFoundError"===o.name&&!t.db.objectStoreNames.contains(t.storeName)&&t.version<=t.db.version)return t.db&&(t.version=t.db.version+1),E(t)})).then((function(){return P(t).then((function(){T(t,e,r,n-1)}))})).catch(r);r(o)}}function z(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function C(t){var e=this,r={db:null};if(t)for(var n in t)r[n]=t[n];var o=y[r.name];o||(o=z(),y[r.name]=o),o.forages.push(e),e._initReady||(e._initReady=e.ready,e.ready=R);var i=[];function s(){return c.resolve()}for(var a=0;a<o.forages.length;a++){var u=o.forages[a];u!==e&&i.push(u._initReady().catch(s))}var l=o.forages.slice(0);return c.all(i).then((function(){return r.db=o.db,x(r)})).then((function(t){return r.db=t,N(r,e._defaultConfig.version)?E(r):t})).then((function(t){r.db=o.db=t,e._dbInfo=r;for(var n=0;n<l.length;n++){var i=l[n];i!==e&&(i._dbInfo.db=r.db,i._dbInfo.version=r.version)}}))}function M(t,e){var r=this;t=h(t);var n=new c((function(e,n){r.ready().then((function(){T(r._dbInfo,b,(function(o,i){if(o)return n(o);try{var s=i.objectStore(r._dbInfo.storeName).get(t);s.onsuccess=function(){var t=s.result;void 0===t&&(t=null),B(t)&&(t=$(t)),e(t)},s.onerror=function(){n(s.error)}}catch(t){n(t)}}))})).catch(n)}));return l(n,e),n}function D(t,e){var r=this,n=new c((function(e,n){r.ready().then((function(){T(r._dbInfo,b,(function(o,i){if(o)return n(o);try{var s=i.objectStore(r._dbInfo.storeName).openCursor(),a=1;s.onsuccess=function(){var r=s.result;if(r){var n=r.value;B(n)&&(n=$(n));var o=t(n,r.key,a++);void 0!==o?e(o):r.continue()}else e()},s.onerror=function(){n(s.error)}}catch(t){n(t)}}))})).catch(n)}));return l(n,e),n}function U(t,e,r){var n=this;t=h(t);var o=new c((function(r,o){var i;n.ready().then((function(){return i=n._dbInfo,"[object Blob]"===g.call(e)?j(i.db).then((function(t){return t?e:k(e)})):e})).then((function(e){T(n._dbInfo,m,(function(i,s){if(i)return o(i);try{var a=s.objectStore(n._dbInfo.storeName);null===e&&(e=void 0);var u=a.put(e,t);s.oncomplete=function(){void 0===e&&(e=null),r(e)},s.onabort=s.onerror=function(){var t=u.error?u.error:u.transaction.error;o(t)}}catch(t){o(t)}}))})).catch(o)}));return l(o,r),o}function F(t,e){var r=this;t=h(t);var n=new c((function(e,n){r.ready().then((function(){T(r._dbInfo,m,(function(o,i){if(o)return n(o);try{var s=i.objectStore(r._dbInfo.storeName).delete(t);i.oncomplete=function(){e()},i.onerror=function(){n(s.error)},i.onabort=function(){var t=s.error?s.error:s.transaction.error;n(t)}}catch(t){n(t)}}))})).catch(n)}));return l(n,e),n}function L(t){var e=this,r=new c((function(t,r){e.ready().then((function(){T(e._dbInfo,m,(function(n,o){if(n)return r(n);try{var i=o.objectStore(e._dbInfo.storeName).clear();o.oncomplete=function(){t()},o.onabort=o.onerror=function(){var t=i.error?i.error:i.transaction.error;r(t)}}catch(t){r(t)}}))})).catch(r)}));return l(r,t),r}function H(t){var e=this,r=new c((function(t,r){e.ready().then((function(){T(e._dbInfo,b,(function(n,o){if(n)return r(n);try{var i=o.objectStore(e._dbInfo.storeName).count();i.onsuccess=function(){t(i.result)},i.onerror=function(){r(i.error)}}catch(t){r(t)}}))})).catch(r)}));return l(r,t),r}function W(t,e){var r=this,n=new c((function(e,n){t<0?e(null):r.ready().then((function(){T(r._dbInfo,b,(function(o,i){if(o)return n(o);try{var s=i.objectStore(r._dbInfo.storeName),a=!1,u=s.openKeyCursor();u.onsuccess=function(){var r=u.result;r?0===t||a?e(r.key):(a=!0,r.advance(t)):e(null)},u.onerror=function(){n(u.error)}}catch(t){n(t)}}))})).catch(n)}));return l(n,e),n}function q(t){var e=this,r=new c((function(t,r){e.ready().then((function(){T(e._dbInfo,b,(function(n,o){if(n)return r(n);try{var i=o.objectStore(e._dbInfo.storeName).openKeyCursor(),s=[];i.onsuccess=function(){var e=i.result;e?(s.push(e.key),e.continue()):t(s)},i.onerror=function(){r(i.error)}}catch(t){r(t)}}))})).catch(r)}));return l(r,t),r}function V(t,e){e=d.apply(this,arguments);var r=this.config();(t="function"!=typeof t&&t||{}).name||(t.name=t.name||r.name,t.storeName=t.storeName||r.storeName);var n,o=this;if(t.name){var i=t.name===r.name&&o._dbInfo.db?c.resolve(o._dbInfo.db):x(t).then((function(e){var r=y[t.name],n=r.forages;r.db=e;for(var o=0;o<n.length;o++)n[o]._dbInfo.db=e;return e}));n=t.storeName?i.then((function(e){if(e.objectStoreNames.contains(t.storeName)){var r=e.version+1;A(t);var n=y[t.name],o=n.forages;e.close();for(var i=0;i<o.length;i++){var a=o[i];a._dbInfo.db=null,a._dbInfo.version=r}var u=new c((function(e,n){var o=s.open(t.name,r);o.onerror=function(t){o.result.close(),n(t)},o.onupgradeneeded=function(){o.result.deleteObjectStore(t.storeName)},o.onsuccess=function(){var t=o.result;t.close(),e(t)}}));return u.then((function(t){n.db=t;for(var e=0;e<o.length;e++){var r=o[e];r._dbInfo.db=t,I(r._dbInfo)}})).catch((function(e){throw(S(t,e)||c.resolve()).catch((function(){})),e}))}})):i.then((function(e){A(t);var r=y[t.name],n=r.forages;e.close();for(var o=0;o<n.length;o++)n[o]._dbInfo.db=null;var i=new c((function(e,r){var n=s.deleteDatabase(t.name);n.onerror=function(){var t=n.result;t&&t.close(),r(n.error)},n.onblocked=function(){console.warn('dropInstance blocked for database "'+t.name+'" until all open connections are closed')},n.onsuccess=function(){var t=n.result;t&&t.close(),e(t)}}));return i.then((function(t){r.db=t;for(var e=0;e<n.length;e++)I(n[e]._dbInfo)})).catch((function(e){throw(S(t,e)||c.resolve()).catch((function(){})),e}))}))}else n=c.reject("Invalid arguments");return l(n,e),n}var J={_driver:"asyncStorage",_initStorage:C,_support:a(),iterate:D,getItem:M,setItem:U,removeItem:F,clear:L,length:H,key:W,keys:q,dropInstance:V};function K(){return"function"==typeof openDatabase}var Q="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",G="~~local_forage_type~",X=/^~~local_forage_type~([^~]+)~/,Y="__lfsc__:",Z=Y.length,tt="arbf",et="blob",rt="si08",nt="ui08",ot="uic8",it="si16",st="si32",at="ur16",ut="ui32",ct="fl32",lt="fl64",ft=Z+tt.length,ht=Object.prototype.toString;function dt(t){var e,r,n,o,i,s=.75*t.length,a=t.length,u=0;"="===t[t.length-1]&&(s--,"="===t[t.length-2]&&s--);var c=new ArrayBuffer(s),l=new Uint8Array(c);for(e=0;e<a;e+=4)r=Q.indexOf(t[e]),n=Q.indexOf(t[e+1]),o=Q.indexOf(t[e+2]),i=Q.indexOf(t[e+3]),l[u++]=r<<2|n>>4,l[u++]=(15&n)<<4|o>>2,l[u++]=(3&o)<<6|63&i;return c}function vt(t){var e,r=new Uint8Array(t),n="";for(e=0;e<r.length;e+=3)n+=Q[r[e]>>2],n+=Q[(3&r[e])<<4|r[e+1]>>4],n+=Q[(15&r[e+1])<<2|r[e+2]>>6],n+=Q[63&r[e+2]];return r.length%3==2?n=n.substring(0,n.length-1)+"=":r.length%3==1&&(n=n.substring(0,n.length-2)+"=="),n}function pt(t,e){var r="";if(t&&(r=ht.call(t)),t&&("[object ArrayBuffer]"===r||t.buffer&&"[object ArrayBuffer]"===ht.call(t.buffer))){var n,o=Y;t instanceof ArrayBuffer?(n=t,o+=tt):(n=t.buffer,"[object Int8Array]"===r?o+=rt:"[object Uint8Array]"===r?o+=nt:"[object Uint8ClampedArray]"===r?o+=ot:"[object Int16Array]"===r?o+=it:"[object Uint16Array]"===r?o+=at:"[object Int32Array]"===r?o+=st:"[object Uint32Array]"===r?o+=ut:"[object Float32Array]"===r?o+=ct:"[object Float64Array]"===r?o+=lt:e(new Error("Failed to get type for BinaryArray"))),e(o+vt(n))}else if("[object Blob]"===r){var i=new FileReader;i.onload=function(){var r=G+t.type+"~"+vt(this.result);e(Y+et+r)},i.readAsArrayBuffer(t)}else try{e(JSON.stringify(t))}catch(r){console.error("Couldn't convert value into a JSON string: ",t),e(null,r)}}function yt(t){if(t.substring(0,Z)!==Y)return JSON.parse(t);var e,r=t.substring(ft),n=t.substring(Z,ft);if(n===et&&X.test(r)){var o=r.match(X);e=o[1],r=r.substring(o[0].length)}var i=dt(r);switch(n){case tt:return i;case et:return u([i],{type:e});case rt:return new Int8Array(i);case nt:return new Uint8Array(i);case ot:return new Uint8ClampedArray(i);case it:return new Int16Array(i);case at:return new Uint16Array(i);case st:return new Int32Array(i);case ut:return new Uint32Array(i);case ct:return new Float32Array(i);case lt:return new Float64Array(i);default:throw new Error("Unkown type: "+n)}}var gt={serialize:pt,deserialize:yt,stringToBuffer:dt,bufferToString:vt};function bt(t,e,r,n){t.executeSql("CREATE TABLE IF NOT EXISTS "+e.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],r,n)}function mt(t){var e=this,r={db:null};if(t)for(var n in t)r[n]="string"!=typeof t[n]?t[n].toString():t[n];var o=new c((function(t,n){try{r.db=openDatabase(r.name,String(r.version),r.description,r.size)}catch(t){return n(t)}r.db.transaction((function(o){bt(o,r,(function(){e._dbInfo=r,t()}),(function(t,e){n(e)}))}),n)}));return r.serializer=gt,o}function _t(t,e,r,n,o,i){t.executeSql(r,n,o,(function(t,s){s.code===s.SYNTAX_ERR?t.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[e.storeName],(function(t,a){a.rows.length?i(t,s):bt(t,e,(function(){t.executeSql(r,n,o,i)}),i)}),i):i(t,s)}),i)}function wt(t,e){var r=this;t=h(t);var n=new c((function(e,n){r.ready().then((function(){var o=r._dbInfo;o.db.transaction((function(r){_t(r,o,"SELECT * FROM "+o.storeName+" WHERE key = ? LIMIT 1",[t],(function(t,r){var n=r.rows.length?r.rows.item(0).value:null;n&&(n=o.serializer.deserialize(n)),e(n)}),(function(t,e){n(e)}))}))})).catch(n)}));return l(n,e),n}function jt(t,e){var r=this,n=new c((function(e,n){r.ready().then((function(){var o=r._dbInfo;o.db.transaction((function(r){_t(r,o,"SELECT * FROM "+o.storeName,[],(function(r,n){for(var i=n.rows,s=i.length,a=0;a<s;a++){var u=i.item(a),c=u.value;if(c&&(c=o.serializer.deserialize(c)),void 0!==(c=t(c,u.key,a+1)))return void e(c)}e()}),(function(t,e){n(e)}))}))})).catch(n)}));return l(n,e),n}function At(t,e,r,n){var o=this;t=h(t);var i=new c((function(i,s){o.ready().then((function(){void 0===e&&(e=null);var a=e,u=o._dbInfo;u.serializer.serialize(e,(function(e,c){c?s(c):u.db.transaction((function(r){_t(r,u,"INSERT OR REPLACE INTO "+u.storeName+" (key, value) VALUES (?, ?)",[t,e],(function(){i(a)}),(function(t,e){s(e)}))}),(function(e){if(e.code===e.QUOTA_ERR){if(n>0)return void i(At.apply(o,[t,a,r,n-1]));s(e)}}))}))})).catch(s)}));return l(i,r),i}function It(t,e,r){return At.apply(this,[t,e,r,1])}function St(t,e){var r=this;t=h(t);var n=new c((function(e,n){r.ready().then((function(){var o=r._dbInfo;o.db.transaction((function(r){_t(r,o,"DELETE FROM "+o.storeName+" WHERE key = ?",[t],(function(){e()}),(function(t,e){n(e)}))}))})).catch(n)}));return l(n,e),n}function Ot(t){var e=this,r=new c((function(t,r){e.ready().then((function(){var n=e._dbInfo;n.db.transaction((function(e){_t(e,n,"DELETE FROM "+n.storeName,[],(function(){t()}),(function(t,e){r(e)}))}))})).catch(r)}));return l(r,t),r}function xt(t){var e=this,r=new c((function(t,r){e.ready().then((function(){var n=e._dbInfo;n.db.transaction((function(e){_t(e,n,"SELECT COUNT(key) as c FROM "+n.storeName,[],(function(e,r){var n=r.rows.item(0).c;t(n)}),(function(t,e){r(e)}))}))})).catch(r)}));return l(r,t),r}function Et(t,e){var r=this,n=new c((function(e,n){r.ready().then((function(){var o=r._dbInfo;o.db.transaction((function(r){_t(r,o,"SELECT key FROM "+o.storeName+" WHERE id = ? LIMIT 1",[t+1],(function(t,r){var n=r.rows.length?r.rows.item(0).key:null;e(n)}),(function(t,e){n(e)}))}))})).catch(n)}));return l(n,e),n}function Nt(t){var e=this,r=new c((function(t,r){e.ready().then((function(){var n=e._dbInfo;n.db.transaction((function(e){_t(e,n,"SELECT key FROM "+n.storeName,[],(function(e,r){for(var n=[],o=0;o<r.rows.length;o++)n.push(r.rows.item(o).key);t(n)}),(function(t,e){r(e)}))}))})).catch(r)}));return l(r,t),r}function kt(t){return new c((function(e,r){t.transaction((function(n){n.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],(function(r,n){for(var o=[],i=0;i<n.rows.length;i++)o.push(n.rows.item(i).name);e({db:t,storeNames:o})}),(function(t,e){r(e)}))}),(function(t){r(t)}))}))}function $t(t,e){e=d.apply(this,arguments);var r=this.config();(t="function"!=typeof t&&t||{}).name||(t.name=t.name||r.name,t.storeName=t.storeName||r.storeName);var n,o=this;return n=t.name?new c((function(e){var n;n=t.name===r.name?o._dbInfo.db:openDatabase(t.name,"","",0),t.storeName?e({db:n,storeNames:[t.storeName]}):e(kt(n))})).then((function(t){return new c((function(e,r){t.db.transaction((function(n){function o(t){return new c((function(e,r){n.executeSql("DROP TABLE IF EXISTS "+t,[],(function(){e()}),(function(t,e){r(e)}))}))}for(var i=[],s=0,a=t.storeNames.length;s<a;s++)i.push(o(t.storeNames[s]));c.all(i).then((function(){e()})).catch((function(t){r(t)}))}),(function(t){r(t)}))}))})):c.reject("Invalid arguments"),l(n,e),n}var Bt={_driver:"webSQLStorage",_initStorage:mt,_support:K(),iterate:jt,getItem:wt,setItem:It,removeItem:St,clear:Ot,length:xt,key:Et,keys:Nt,dropInstance:$t};function Rt(){try{return"undefined"!=typeof localStorage&&"setItem"in localStorage&&!!localStorage.setItem}catch(t){return!1}}function Pt(t,e){var r=t.name+"/";return t.storeName!==e.storeName&&(r+=t.storeName+"/"),r}function Tt(){var t="_localforage_support_test";try{return localStorage.setItem(t,!0),localStorage.removeItem(t),!1}catch(t){return!0}}function zt(){return!Tt()||localStorage.length>0}function Ct(t){var e=this,r={};if(t)for(var n in t)r[n]=t[n];return r.keyPrefix=Pt(t,e._defaultConfig),zt()?(e._dbInfo=r,r.serializer=gt,c.resolve()):c.reject()}function Mt(t){var e=this,r=e.ready().then((function(){for(var t=e._dbInfo.keyPrefix,r=localStorage.length-1;r>=0;r--){var n=localStorage.key(r);0===n.indexOf(t)&&localStorage.removeItem(n)}}));return l(r,t),r}function Dt(t,e){var r=this;t=h(t);var n=r.ready().then((function(){var e=r._dbInfo,n=localStorage.getItem(e.keyPrefix+t);return n&&(n=e.serializer.deserialize(n)),n}));return l(n,e),n}function Ut(t,e){var r=this,n=r.ready().then((function(){for(var e=r._dbInfo,n=e.keyPrefix,o=n.length,i=localStorage.length,s=1,a=0;a<i;a++){var u=localStorage.key(a);if(0===u.indexOf(n)){var c=localStorage.getItem(u);if(c&&(c=e.serializer.deserialize(c)),void 0!==(c=t(c,u.substring(o),s++)))return c}}}));return l(n,e),n}function Ft(t,e){var r=this,n=r.ready().then((function(){var e,n=r._dbInfo;try{e=localStorage.key(t)}catch(t){e=null}return e&&(e=e.substring(n.keyPrefix.length)),e}));return l(n,e),n}function Lt(t){var e=this,r=e.ready().then((function(){for(var t=e._dbInfo,r=localStorage.length,n=[],o=0;o<r;o++){var i=localStorage.key(o);0===i.indexOf(t.keyPrefix)&&n.push(i.substring(t.keyPrefix.length))}return n}));return l(r,t),r}function Ht(t){var e=this.keys().then((function(t){return t.length}));return l(e,t),e}function Wt(t,e){var r=this;t=h(t);var n=r.ready().then((function(){var e=r._dbInfo;localStorage.removeItem(e.keyPrefix+t)}));return l(n,e),n}function qt(t,e,r){var n=this;t=h(t);var o=n.ready().then((function(){void 0===e&&(e=null);var r=e;return new c((function(o,i){var s=n._dbInfo;s.serializer.serialize(e,(function(e,n){if(n)i(n);else try{localStorage.setItem(s.keyPrefix+t,e),o(r)}catch(t){"QuotaExceededError"!==t.name&&"NS_ERROR_DOM_QUOTA_REACHED"!==t.name||i(t),i(t)}}))}))}));return l(o,r),o}function Vt(t,e){if(e=d.apply(this,arguments),!(t="function"!=typeof t&&t||{}).name){var r=this.config();t.name=t.name||r.name,t.storeName=t.storeName||r.storeName}var n,o=this;return n=t.name?new c((function(e){t.storeName?e(Pt(t,o._defaultConfig)):e(t.name+"/")})).then((function(t){for(var e=localStorage.length-1;e>=0;e--){var r=localStorage.key(e);0===r.indexOf(t)&&localStorage.removeItem(r)}})):c.reject("Invalid arguments"),l(n,e),n}var Jt={_driver:"localStorageWrapper",_initStorage:Ct,_support:Rt(),iterate:Ut,getItem:Dt,setItem:qt,removeItem:Wt,clear:Mt,length:Ht,key:Ft,keys:Lt,dropInstance:Vt},Kt=function(t,e){return t===e||"number"==typeof t&&"number"==typeof e&&isNaN(t)&&isNaN(e)},Qt=function(t,e){for(var r=t.length,n=0;n<r;){if(Kt(t[n],e))return!0;n++}return!1},Gt=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},Xt={},Yt={},Zt={INDEXEDDB:J,WEBSQL:Bt,LOCALSTORAGE:Jt},te=[Zt.INDEXEDDB._driver,Zt.WEBSQL._driver,Zt.LOCALSTORAGE._driver],ee=["dropInstance"],re=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(ee),ne={description:"",driver:te.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function oe(t,e){t[e]=function(){var r=arguments;return t.ready().then((function(){return t[e].apply(t,r)}))}}function ie(){for(var t=1;t<arguments.length;t++){var e=arguments[t];if(e)for(var r in e)e.hasOwnProperty(r)&&(Gt(e[r])?arguments[0][r]=e[r].slice():arguments[0][r]=e[r])}return arguments[0]}var se=function(){function t(e){for(var r in o(this,t),Zt)if(Zt.hasOwnProperty(r)){var n=Zt[r],i=n._driver;this[r]=i,Xt[i]||this.defineDriver(n)}this._defaultConfig=ie({},ne),this._config=ie({},this._defaultConfig,e),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch((function(){}))}return t.prototype.config=function(t){if("object"===(void 0===t?"undefined":n(t))){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var e in t){if("storeName"===e&&(t[e]=t[e].replace(/\W/g,"_")),"version"===e&&"number"!=typeof t[e])return new Error("Database version must be a number.");this._config[e]=t[e]}return!("driver"in t)||!t.driver||this.setDriver(this._config.driver)}return"string"==typeof t?this._config[t]:this._config},t.prototype.defineDriver=function(t,e,r){var n=new c((function(e,r){try{var n=t._driver,o=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!t._driver)return void r(o);for(var i=re.concat("_initStorage"),s=0,a=i.length;s<a;s++){var u=i[s];if((!Qt(ee,u)||t[u])&&"function"!=typeof t[u])return void r(o)}var f=function(){for(var e=function(t){return function(){var e=new Error("Method "+t+" is not implemented by the current driver"),r=c.reject(e);return l(r,arguments[arguments.length-1]),r}},r=0,n=ee.length;r<n;r++){var o=ee[r];t[o]||(t[o]=e(o))}};f();var h=function(r){Xt[n]&&console.info("Redefining LocalForage driver: "+n),Xt[n]=t,Yt[n]=r,e()};"_support"in t?t._support&&"function"==typeof t._support?t._support().then(h,r):h(!!t._support):h(!0)}catch(t){r(t)}}));return f(n,e,r),n},t.prototype.driver=function(){return this._driver||null},t.prototype.getDriver=function(t,e,r){var n=Xt[t]?c.resolve(Xt[t]):c.reject(new Error("Driver not found."));return f(n,e,r),n},t.prototype.getSerializer=function(t){var e=c.resolve(gt);return f(e,t),e},t.prototype.ready=function(t){var e=this,r=e._driverSet.then((function(){return null===e._ready&&(e._ready=e._initDriver()),e._ready}));return f(r,t,t),r},t.prototype.setDriver=function(t,e,r){var n=this;Gt(t)||(t=[t]);var o=this._getSupportedDrivers(t);function i(){n._config.driver=n.driver()}function s(t){return n._extend(t),i(),n._ready=n._initStorage(n._config),n._ready}function a(t){return function(){var e=0;function r(){for(;e<t.length;){var o=t[e];return e++,n._dbInfo=null,n._ready=null,n.getDriver(o).then(s).catch(r)}i();var a=new Error("No available storage method found.");return n._driverSet=c.reject(a),n._driverSet}return r()}}var u=null!==this._driverSet?this._driverSet.catch((function(){return c.resolve()})):c.resolve();return this._driverSet=u.then((function(){var t=o[0];return n._dbInfo=null,n._ready=null,n.getDriver(t).then((function(t){n._driver=t._driver,i(),n._wrapLibraryMethodsWithReady(),n._initDriver=a(o)}))})).catch((function(){i();var t=new Error("No available storage method found.");return n._driverSet=c.reject(t),n._driverSet})),f(this._driverSet,e,r),this._driverSet},t.prototype.supports=function(t){return!!Yt[t]},t.prototype._extend=function(t){ie(this,t)},t.prototype._getSupportedDrivers=function(t){for(var e=[],r=0,n=t.length;r<n;r++){var o=t[r];this.supports(o)&&e.push(o)}return e},t.prototype._wrapLibraryMethodsWithReady=function(){for(var t=0,e=re.length;t<e;t++)oe(this,re[t])},t.prototype.createInstance=function(e){return new t(e)},t}(),ae=new se;e.exports=ae},{3:3}]},{},[4])(4)}(en)),en.exports}var nn=Yr(rn());function on(t,e,r){(void 0!==r&&!Qe(t[e],r)||void 0===r&&!(e in t))&&ar(t,e,r)}var sn=function(t,e,r){for(var n=-1,o=Object(t),i=r(t),s=i.length;s--;){var a=i[++n];if(!1===e(o[a],a,o))break}return t};var an=Function.prototype,un=Object.prototype,cn=an.toString,ln=un.hasOwnProperty,fn=cn.call(Object);function hn(t){if(!v(t)||"[object Object]"!=d(t))return!1;var e=Sr(t);if(null===e)return!0;var r=ln.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&cn.call(r)==fn}function dn(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}function vn(t,e,r,n,o,i,a){var u=dn(t,r),c=dn(e,r),l=a.get(c);if(l)on(t,r,l);else{var f,h=i?i(u,c,r+"",t,e,a):void 0,d=void 0===h;if(d){var p=s(c),y=!p&&Gt(c),g=!p&&!y&&oe(c);h=c,p||y||g?s(u)?h=u:v(f=u)&&Vt(f)?h=mr(u):y?(d=!1,h=br(c,!0)):g?(d=!1,h=zr(c,!0)):h=[]:hn(c)||Wt(c)?(h=u,Wt(u)?h=function(t){return lr(t,dr(t))}(u):ct(u)&&!lt(u)||(h=Ur(c))):d=!1}d&&(a.set(c,h),o(h,c,n,i,a),a.delete(c)),on(t,r,h)}}function pn(t,e,r,n,o){t!==e&&sn(e,(function(i,s){if(o||(o=new ir),ct(i))vn(t,e,s,r,pn,n,o);else{var a=n?n(dn(t,s),i,s+"",t,e,o):void 0;void 0===a&&(a=i),on(t,s,a)}}),dr)}function yn(t){return t}var gn=Math.max;function bn(t,e,r){return e=gn(void 0===e?t.length-1:e,0),function(){for(var n=arguments,o=-1,i=gn(n.length-e,0),s=Array(i);++o<i;)s[o]=n[e+o];o=-1;for(var a=Array(e+1);++o<e;)a[o]=n[o];return a[e]=r(s),function(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}(t,this,a)}}function mn(t){return function(){return t}}var _n=sr?function(t,e){return sr(t,"toString",{configurable:!0,enumerable:!1,value:mn(e),writable:!0})}:yn,wn=Date.now;var jn,An,In,Sn=(jn=_n,An=0,In=0,function(){var t=wn(),e=16-(t-In);if(In=t,e>0){if(++An>=800)return arguments[0]}else An=0;return jn.apply(void 0,arguments)});function On(t,e){return Sn(bn(t,e,yn),t+"")}function xn(t,e,r){if(!ct(r))return!1;var n=typeof e;return!!("number"==n?Vt(r)&&ue(e,r.length):"string"==n&&e in r)&&Qe(r[e],t)}function En(t){return On((function(e,r){var n=-1,o=r.length,i=o>1?r[o-1]:void 0,s=o>2?r[2]:void 0;for(i=t.length>3&&"function"==typeof i?(o--,i):void 0,s&&xn(r[0],r[1],s)&&(i=o<3?void 0:i,o=1),e=Object(e);++n<o;){var a=r[n];a&&t(e,a,n,i)}return e}))}var Nn=En((function(t,e,r){pn(t,e,r)})),kn=En((function(t,e,r,n){pn(t,e,r,n)}));function $n(){let t,e=()=>{},r=()=>{};if("function"==typeof Promise.withResolvers){const{promise:n,resolve:o,reject:i}=Promise.withResolvers();t=n,e=o,r=i}else t=new Promise(((t,n)=>{e=t,r=n}));return Object.assign(t,{isResolved:!1,isPending:!0,isRejected:!1,resolve:e,reject:r}),t.then((e=>(t.isResolved=!0,t.isPending=!1,t.isRejected=!1,e)),(e=>{throw t.isResolved=!1,t.isPending=!1,t.isRejected=!0,e})),t}const Bn=Math.max,Rn=Math.min;function Pn(t){if("number"==typeof t)return t;if("string"==typeof t){const e=parseFloat(t);return isNaN(e)?0:e}return 0}function Tn(t,e,r={}){let n,o,i,s,a,u,c=0,l=!1,f=r.promise?$n():null;if("function"!=typeof t)throw new TypeError("Expected a function");function h(e){const i=n,a=o,u=f;return n=o=void 0,c=e,s=t.apply(a,i),r.promise&&(u.resolve(s),f=$n()),r.promise?u:s}function d(t){const r=t-u;return void 0===u||r>=e||r<0||l&&t-c>=i}function v(){const t=Date.now();if(d(t))return p(t);a=setTimeout(v,function(t){const r=e-(t-u);return l?Rn(r,i-(t-c)):r}(t))}function p(t){return a=void 0,n?h(t):(n=o=void 0,r.promise?f:s)}function y(t,e){if(Array.isArray(t)&&Array.isArray(e))return null!=r&&r.dedupeArrays?t.concat(e.filter((e=>-1===t.indexOf(e)))):t.concat(e)}function g(){const t=Date.now(),i=d(t);var p,g;if(p=Array.from(arguments),n=null!==(g=n)&&void 0!==g&&g.length?p.length?null!=r&&r.concatArrays||null!=r&&r.dedupeArrays?kn(n,p,y):Nn(n,p):n:p||[],o=this,u=t,i){if(void 0===a)return function(t){return c=t,a=setTimeout(v,e),r.promise?f:s}(u);if(l)return clearTimeout(a),a=setTimeout(v,e),h(u)}return void 0===a&&(a=setTimeout(v,e)),r.promise?f:s}return e=Pn(e)||0,function(t){const e=typeof t;return null!=t&&("object"===e||"function"===e)}(r)&&(l="maxWait"in r,i=l?Bn(Pn(r.maxWait)||0,e):i),g.cancel=function(){void 0!==a&&clearTimeout(a),c=0,n=u=o=a=void 0},g.flush=function(){return void 0===a?s:p(Date.now())},g}function zn(t,e){e&&t.then((function(t){e(null,t)}),(function(t){e(t)}))}function Cn(){if(arguments.length&&"function"==typeof arguments[arguments.length-1])return arguments[arguments.length-1]}function Mn(t){return"string"!=typeof t&&(console.warn(`${t} used as a key, but it is not a string.`),t=String(t)),t}var Dn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Un=/^~~local_forage_type~([^~]+)~/,Fn="__lfsc__:",Ln="arbf",Hn="blob",Wn="si08",qn="ui08",Vn="uic8",Jn="si16",Kn="si32",Qn="ur16",Gn="ui32",Xn="fl32",Yn="fl64",Zn=Object.prototype.toString;function to(t){var e,r=new Uint8Array(t),n="";for(e=0;e<r.length;e+=3)n+=Dn[r[e]>>2],n+=Dn[(3&r[e])<<4|r[e+1]>>4],n+=Dn[(15&r[e+1])<<2|r[e+2]>>6],n+=Dn[63&r[e+2]];return r.length%3==2?n=n.substring(0,n.length-1)+"=":r.length%3==1&&(n=n.substring(0,n.length-2)+"=="),n}var eo=function(t,e){var r="";if(t&&(r=Zn.call(t)),t&&("[object ArrayBuffer]"===r||t.buffer&&"[object ArrayBuffer]"===Zn.call(t.buffer))){var n,o=Fn;t instanceof ArrayBuffer?(n=t,o+=Ln):(n=t.buffer,"[object Int8Array]"===r?o+=Wn:"[object Uint8Array]"===r?o+=qn:"[object Uint8ClampedArray]"===r?o+=Vn:"[object Int16Array]"===r?o+=Jn:"[object Uint16Array]"===r?o+=Qn:"[object Int32Array]"===r?o+=Kn:"[object Uint32Array]"===r?o+=Gn:"[object Float32Array]"===r?o+=Xn:"[object Float64Array]"===r?o+=Yn:e(new Error("Failed to get type for BinaryArray"))),e(o+to(n))}else if("[object Blob]"===r){var i=new FileReader;i.onload=function(){var r="~~local_forage_type~"+t.type+"~"+to(this.result);e(Fn+Hn+r)},i.readAsArrayBuffer(t)}else try{e(JSON.stringify(t))}catch(r){console.error("Couldn't convert value into a JSON string: ",t),e(null,r)}},ro=function(t){if(t.substring(0,9)!==Fn)return JSON.parse(t);var e,r=t.substring(13),n=t.substring(9,13);if(n===Hn&&Un.test(r)){var o=r.match(Un);e=o[1],r=r.substring(o[0].length)}var i=function(t){var e,r,n,o,i,s=.75*t.length,a=t.length,u=0;"="===t[t.length-1]&&(s--,"="===t[t.length-2]&&s--);var c=new ArrayBuffer(s),l=new Uint8Array(c);for(e=0;e<a;e+=4)r=Dn.indexOf(t[e]),n=Dn.indexOf(t[e+1]),o=Dn.indexOf(t[e+2]),i=Dn.indexOf(t[e+3]),l[u++]=r<<2|n>>4,l[u++]=(15&n)<<4|o>>2,l[u++]=(3&o)<<6|63&i;return c}(r);switch(n){case Ln:return i;case Hn:return function(t,e){t=t||[],e=e||{};try{return new Blob(t,e)}catch(o){if("TypeError"!==o.name)throw o;for(var r=new("undefined"!=typeof BlobBuilder?BlobBuilder:"undefined"!=typeof MSBlobBuilder?MSBlobBuilder:"undefined"!=typeof MozBlobBuilder?MozBlobBuilder:WebKitBlobBuilder),n=0;n<t.length;n+=1)r.append(t[n]);return r.getBlob(e.type)}}([i],{type:e});case Wn:return new Int8Array(i);case qn:return new Uint8Array(i);case Vn:return new Uint8ClampedArray(i);case Jn:return new Int16Array(i);case Qn:return new Uint16Array(i);case Kn:return new Int32Array(i);case Gn:return new Uint32Array(i);case Xn:return new Float32Array(i);case Yn:return new Float64Array(i);default:throw new Error("Unkown type: "+n)}};function no(t,e){let r=t.name+"/";return t.storeName!==e.storeName&&(r+=t.storeName+"/"),r}const oo={serializer:{serialize:eo,deserialize:ro}};const io={_driver:"sessionStorageWrapper",_initStorage:function(t){if(oo.keyPrefix=no(t,this._defaultConfig),t)for(const e in t)oo[e]=t[e]},_support:function(){try{if(sessionStorage&&"setItem"in sessionStorage)return!0}catch(t){console.log(t)}return!1}(),iterate:function(t,e){const r=this.ready().then((function(){const e=oo.keyPrefix,r=e.length,n=sessionStorage.length;let o=1;for(let i=0;i<n;i++){const n=sessionStorage.key(i);if(0!==n.indexOf(e))continue;let s=sessionStorage.getItem(n);if(s&&(s=oo.serializer.deserialize(s)),s=t(s,n.substring(r),o++),void 0!==s)return s}}));return zn(r,e),r},getItem:function(t,e){t=Mn(t);const r=this.ready().then((function(){let e=sessionStorage.getItem(oo.keyPrefix+t);return e&&(e=oo.serializer.deserialize(e)),e}));return zn(r,e),r},setItem:async function(t,e,r){var n;t=Mn(t),await this.ready();const o=e=null!==(n=e)&&void 0!==n?n:null;return oo.serializer.serialize(e,((e,n)=>{if(n)throw n;try{sessionStorage.setItem(oo.keyPrefix+t,e),zn(Promise.resolve(o),r)}catch(t){if("QuotaExceededError"===t.name||"NS_ERROR_DOM_QUOTA_REACHED"===t.name)throw console.error("Your sesionStorage capacity is used up."),t;throw t}})),e},removeItem:function(t,e){t=Mn(t);const r=this.ready().then((function(){sessionStorage.removeItem(oo.keyPrefix+t)}));return zn(r,e),r},clear:function(t){const e=this.ready().then((function(){const t=oo.keyPrefix;for(let e=sessionStorage.length-1;e>=0;e--){const r=sessionStorage.key(e);0===r.indexOf(t)&&sessionStorage.removeItem(r)}}));return zn(e,t),e},length:function(t){const e=this.keys().then((function(t){return t.length}));return zn(e,t),e},key:function(t,e){const r=this.ready().then((function(){let e;try{e=sessionStorage.key(t)}catch(t){e=null}return e&&(e=e.substring(oo.keyPrefix.length)),e}));return zn(r,e),r},keys:function(t){const e=this.ready().then((function(){const t=sessionStorage.length,e=[];for(let r=0;r<t;r++){const t=sessionStorage.key(r);0===t.indexOf(oo.keyPrefix)&&e.push(t.substring(oo.keyPrefix.length))}return e}));return zn(e,t),e},dropInstance:function(t,e){if(e=Cn.apply(this,arguments),!(t="function"!=typeof t&&t||{}).name){const e=this.config();t.name=t.name||e.name,t.storeName=t.storeName||e.storeName}const r=this;let n;return n=t.name?new Promise((function(e){t.storeName?e(no(t,r._defaultConfig)):e(`${t.name}/`)})).then((function(t){for(let e=sessionStorage.length-1;e>=0;e--){const r=sessionStorage.key(e);0===r.indexOf(t)&&sessionStorage.removeItem(r)}})):Promise.reject(new Error("Invalid arguments")),zn(n,e),n}};var so,ao={exports:{}};var uo=(so||(so=1,function(t,e){!function(t,e){function r(t){return r.result?r.result:t&&"function"==typeof t.getSerializer?(r.result=t.getSerializer(),r.result):Promise.reject(new Error("localforage.getSerializer() was not available! localforage v1.4+ is required!"))}function n(t,e){e&&t.then((function(t){e(null,t)}),(function(t){e(t)}))}function o(t,e,r,n){function o(t,e){var r=t||e;return t&&"function"==typeof t||"string"!=typeof r||(t=function(t){return t[r]}),t}var i=[];if("[object Array]"===Object.prototype.toString.call(t)){e=o(e,"key"),r=o(r,"value");for(var s=0,a=t.length;s<a;s++){var u=t[s];i.push(n(e(u),r(u)))}}else for(var c in t)t.hasOwnProperty(c)&&i.push(n(c,t[c]));return i}function i(t,e,r,i){var s=this,a=s.ready().then((function(){return new Promise((function(n,i){var a,u=s._dbInfo,c=u.db.transaction(u.storeName,"readwrite"),l=c.objectStore(u.storeName);function f(t){var e=t.target||this;a=e.error||e.transaction.error,i(a)}c.oncomplete=function(){n(t)},c.onabort=c.onerror=function(t){i(a||t.target)},o(t,e,r,(function(t,e){null===e&&(e=void 0),l.put(e,t).onerror=f}))}))}));return n(a,i),a}function s(t,e,i,s){var a=this,u=new Promise((function(n,s){a.ready().then((function(){return r(a)})).then((function(r){var u=a._dbInfo;u.db.transaction((function(a){var c="INSERT OR REPLACE INTO "+u.storeName+" (key, value) VALUES (?, ?)",l=o(t,e,i,(function(t,e){return new Promise((function(n,o){r.serialize(e,(function(e,r){r?o(r):a.executeSql(c,[t,e],(function(){n()}),(function(t,e){o(e)}))}))}))}));Promise.all(l).then((function(){n(t)}),s)}),(function(t){s(t)}))})).catch(s)}));return n(u,s),u}function a(t,e,r,i){var s=this,a=o(t,e,r,(function(t,e){return s.setItem(t,e)})),u=Promise.all(a);return n(u,i),u}function u(t,e,r,n){var o=this,u=o.driver();return u===o.INDEXEDDB?i.call(o,t,e,r,n):u===o.WEBSQL?s.call(o,t,e,r,n):a.call(o,t,e,r,n)}function c(t){var e=Object.getPrototypeOf(t);e&&(e.setItems=u,e.setItems.indexedDB=function(){return i.apply(this,arguments)},e.setItems.websql=function(){return s.apply(this,arguments)},e.setItems.generic=function(){return a.apply(this,arguments)})}var l=c(e="default"in e?e.default:e);t.setItemsGeneric=a,t.localforageSetItems=u,t.extendPrototype=c,t.extendPrototypeResult=l,Object.defineProperty(t,"__esModule",{value:!0})}(e,rn())}(0,ao.exports)),ao.exports);function co(t){return co.result?co.result:t&&"function"==typeof t.getSerializer?(co.result=t.getSerializer(),co.result):Promise.reject(new Error("localforage.getSerializer() was not available! localforage v1.4+ is required!"))}function lo(t,e){return e&&t.then((function(t){e(null,t)}),(function(t){e(t)})),t}function fo(t,e){var r=this.getItem(t).then((function(e){return{key:t,value:e}}));return lo(r,e),r}function ho(t){var e=this,r=new Promise((function(r,n){for(var o=[],i=0,s=t.length;i<s;i++)o.push(fo.call(e,t[i]));Promise.all(o).then((function(t){for(var e={},n=0,o=t.length;n<o;n++){var i=t[n];e[i.key]=i.value}r(e)})).catch(n)}));return r}function vo(){var t={};return this.iterate((function(e,r){t[r]=e})).then((function(){return t}))}var po="undefined"!=typeof IDBKeyRange?IDBKeyRange:"undefined"!=typeof webkitIDBKeyRange?webkitIDBKeyRange:"undefined"!=typeof mozIDBKeyRange?mozIDBKeyRange:void 0;function yo(t){t=t.slice();var e=this;function r(t,e){return t<e?-1:t>e?1:0}var n=new Promise((function(n,o){e.ready().then((function(){var i,s=e._dbInfo,a=s.db.transaction(s.storeName,"readonly").objectStore(s.storeName),u=t.sort(r),c=po.bound(t[0],t[t.length-1],!1,!1);if("getAll"in a)(i=a.getAll(c)).onsuccess=function(){var t=i.result;void 0===t&&(t=null),n(t)};else{i=a.openCursor(c);var l={},f=0;i.onsuccess=function(){var t=i.result;if(t){for(var e=t.key;e>u[f];)if(++f===u.length)return void n(l);if(e===u[f]){var r=t.value;void 0===r&&(r=null),l[e]=r,t.continue()}else t.continue(u[f])}else n(l)}}i.onerror=function(){o(i.error)}})).catch(o)}));return n}function go(t){var e=this,r=new Promise((function(r,n){e.ready().then((function(){return co(e)})).then((function(o){var i=e._dbInfo;i.db.transaction((function(e){for(var s=new Array(t.length),a=0,u=t.length;a<u;a++)s[a]="?";e.executeSql("SELECT * FROM "+i.storeName+" WHERE (key IN ("+s.join(",")+"))",t,(function(t,e){for(var n={},i=e.rows,s=0,a=i.length;s<a;s++){var u=i.item(s),c=u.value;c&&(c=o.deserialize(c)),n[u.key]=c}r(n)}),(function(t,e){n(e)}))}))})).catch(n)}));return r}function bo(t,e){var r,n=this;if(arguments.length&&null!==t){var o=n.driver();r=o===n.INDEXEDDB?yo.apply(n,arguments):o===n.WEBSQL?go.apply(n,arguments):ho.apply(n,arguments)}else r=vo.apply(n);return lo(r,e),r}function mo(t){var e=Object.getPrototypeOf(t);e&&(e.getItems=bo,e.getItems.indexedDB=function(){return yo.apply(this,arguments)},e.getItems.websql=function(){return go.apply(this,arguments)},e.getItems.generic=function(){return ho.apply(this,arguments)})}mo(nn);var _o=Object.prototype.hasOwnProperty;function wo(t,e){return null!=t&&_o.call(t,e)}var jo=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ao=/^\w*$/;function Io(t,e){if(s(t))return!1;var r=typeof t;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=t&&!p(t))||(Ao.test(t)||!jo.test(t)||null!=e&&t in Object(e))}function So(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var r=function(){var n=arguments,o=e?e.apply(this,n):n[0],i=r.cache;if(i.has(o))return i.get(o);var s=t.apply(this,n);return r.cache=i.set(o,s)||i,s};return r.cache=new(So.Cache||or),r}So.Cache=or;var Oo=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,xo=/\\(\\)?/g,Eo=function(t){var e=So(t,(function(t){return 500===r.size&&r.clear(),t})),r=e.cache;return e}((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(Oo,(function(t,r,n,o){e.push(n?o.replace(xo,"$1"):r||t)})),e}));function No(t,e){return s(t)?t:Io(t,e)?[t]:Eo(m(t))}function ko(t){if("string"==typeof t||p(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function $o(t,e,r){for(var n=-1,o=(e=No(e,t)).length,i=!1;++n<o;){var a=ko(e[n]);if(!(i=null!=t&&r(t,a)))break;t=t[a]}return i||++n!=o?i:!!(o=null==t?0:t.length)&&qt(o)&&ue(a,o)&&(s(t)||Wt(t))}function Bo(t,e,r){var n=-1,o=(e=No(e,t)).length;for(o||(o=1,t=void 0);++n<o;){var i=null==t?void 0:t[ko(e[n])];void 0===i&&(n=o,i=r),t=lt(i)?i.call(t):i}return t}function Ro(){return(65536*(1+Math.random())|0).toString(16).substring(1)}function Po(){const t={isResolved:!1,isPending:!0,isRejected:!1,resolve:null,reject:null},e=new Promise(((e,r)=>{t.resolve=e,t.reject=r}));return Object.assign(e,t),e.then((function(t){return e.isResolved=!0,e.isPending=!1,e.isRejected=!1,t}),(function(t){throw e.isResolved=!1,e.isPending=!1,e.isRejected=!0,t})),e}function To(){throw new Error('A "url" property or function must be specified')}function zo(t,e){const r=e.error;e.error=function(n){r&&r.call(e.context,t,n,e),t.trigger("error",t,n,e)}}const Co={create:"POST",update:"PUT",patch:"PATCH",delete:"DELETE",read:"GET"};function Mo(t){const e=Bo(t,"browserStorage")||Bo(t.collection,"browserStorage");return e?e.sync():Do}function Do(t,e,r={}){let n=r.data;null!=n||!e||"create"!==t&&"update"!==t&&"patch"!==t||(n=r.attrs||e.toJSON());const o={method:Co[t],body:n?JSON.stringify(n):"",success:r.success,error:r.error},i=r.url||Bo(e,"url")||To(),s=r.xhr=fetch(i,o);return e.trigger("request",e,s,{...o,xhr:s}),s}const Uo=qe;nn.defineDriver(Ke),uo.extendPrototype(nn),mo(nn);class Fo{constructor(t,e,r=!1){if("local"===e&&!window.localStorage)throw new Error("Skeletor.storage: Environment does not support localStorage.");if("session"===e&&!window.sessionStorage)throw new Error("Skeletor.storage: Environment does not support sessionStorage.");Gr(e)?this.storeInitialized=this.initStore(e,r):(this.store=e,r&&(this.store.debouncedSetItems=Tn((t=>this.store.setItems(t)),50,{promise:!0})),this.storeInitialized=Promise.resolve()),this.name=t}async initStore(t,e){if("session"===t)await nn.setDriver(io._driver);else if("local"===t)await nn.config({driver:nn.LOCALSTORAGE});else if("in_memory"===t)await nn.config({driver:Uo});else if("indexed"!==t)throw new Error("Skeletor.storage: No storage type was specified");this.store=nn,e&&(this.store.debouncedSetItems=Tn((t=>this.store.setItems(t)),50,{promise:!0}))}flush(){var t;return null===(t=this.store.debouncedSetItems)||void 0===t?void 0:t.flush()}async clear(){await this.store.removeItem(this.name).catch((t=>console.error(t)));const t=new RegExp(`^${this.name}-`),e=(await this.store.keys()).filter((e=>t.test(e)));await Promise.all(e.map((t=>this.store.removeItem(t).catch((t=>console.error(t))))))}sync(){const t=this;async function e(e,r,n){let o,i,s,a;const u=r.collection;["patch","update"].includes(e)&&(a=Qr(r.attributes,5)),await t.storeInitialized;try{const i=r.attributes;switch(e){case"read":o=void 0!==r.id?await t.find(r):await t.findAll();break;case"create":o=await t.create(r,n);break;case"patch":case"update":n.wait&&(r.attributes=a),s=t.update(r),n.wait&&(r.attributes=i),o=await s;break;case"delete":o=await t.destroy(r,u)}}catch(e){i=22===e.code&&0===t.getStorageSize()?"Private browsing is unsupported":e.message}if(o){if(n&&n.success){const t="read"===e?o:null;n.success(t,n)}}else i=i||"Record Not Found",n&&n.error&&n.error(i)}return e.__name__="localSync",e}removeCollectionReference(t,e){if(!e)return;const r=e.filter((e=>e.id!==t.id)).map((t=>this.getItemName(t.id)));return this.store.setItem(this.name,r)}addCollectionReference(t,e){if(!e)return;const r=e.map((t=>this.getItemName(t.id))),n=this.getItemName(t.id);return r.includes(n)||r.push(n),this.store.setItem(this.name,r)}getCollectionReferenceData(t){if(!t.collection)return{};const e=t.collection.map((t=>this.getItemName(t.id))),r=this.getItemName(t.id);e.includes(r)||e.push(r);const n={};return n[this.name]=e,n}async save(t){if(this.store.setItems){const e={};return e[this.getItemName(t.id)]=t.toJSON(),Object.assign(e,this.getCollectionReferenceData(t)),this.store.debouncedSetItems?this.store.debouncedSetItems(e):this.store.setItems(e)}{const e=this.getItemName(t.id),r=await this.store.setItem(e,t.toJSON());return await this.addCollectionReference(t,t.collection),r}}create(t,e){return t.id||(t.id=Ro()+Ro()+"-"+Ro()+"-"+Ro()+"-"+Ro()+"-"+Ro()+Ro()+Ro(),t.set(t.idAttribute,t.id,e)),this.save(t)}update(t){return this.save(t)}find(t){return this.store.getItem(this.getItemName(t.id))}async findAll(){const t=await this.store.getItem(this.name);if(null!=t&&t.length){const e=await this.store.getItems(t);return Object.values(e)}return[]}async destroy(t,e){return await this.flush(),await this.store.removeItem(this.getItemName(t.id)),await this.removeCollectionReference(t,e),t}getStorageSize(){return this.store.length}getItemName(t){return this.name+"-"+t}}Fo.sessionStorageInitialized=nn.defineDriver(io),Fo.localForage=nn;function Lo(t){return Qr(t,4)}var Ho=Object.prototype,Wo=Ho.hasOwnProperty,qo=On((function(t,e){t=Object(t);var r=-1,n=e.length,o=n>2?e[2]:void 0;for(o&&xn(e[0],e[1],o)&&(n=1);++r<n;)for(var i=e[r],s=dr(i),a=-1,u=s.length;++a<u;){var c=s[a],l=t[c];(void 0===l||Qe(l,Ho[c])&&!Wo.call(t,c))&&(t[c]=i[c])}return t}));var Vo=On((function(t,e){return function(t,e,r){if("function"!=typeof t)throw new TypeError("Expected a function");return setTimeout((function(){t.apply(void 0,r)}),e)}(t,1,e)}));function Jo(t,e){return t&&sn(t,e,fe)}var Ko,Qo,Go=Object.prototype.toString,Xo=(Ko=function(t,e,r){null!=e&&"function"!=typeof e.toString&&(e=Go.call(e)),t[e]=r},Qo=mn(yn),function(t,e){return function(t,e,r,n){return Jo(t,(function(t,o,i){e(n,r(t),o,i)})),n}(t,Ko,Qo(e),{})});function Yo(t){var e=-1,r=null==t?0:t.length;for(this.__data__=new or;++e<r;)this.add(t[e])}function Zo(t,e){for(var r=-1,n=null==t?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1}function ti(t,e){return t.has(e)}Yo.prototype.add=Yo.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},Yo.prototype.has=function(t){return this.__data__.has(t)};function ei(t,e,r,n,o,i){var s=1&r,a=t.length,u=e.length;if(a!=u&&!(s&&u>a))return!1;var c=i.get(t),l=i.get(e);if(c&&l)return c==e&&l==t;var f=-1,h=!0,d=2&r?new Yo:void 0;for(i.set(t,e),i.set(e,t);++f<a;){var v=t[f],p=e[f];if(n)var y=s?n(p,v,f,e,t,i):n(v,p,f,t,e,i);if(void 0!==y){if(y)continue;h=!1;break}if(d){if(!Zo(e,(function(t,e){if(!ti(d,e)&&(v===t||o(v,t,r,n,i)))return d.push(e)}))){h=!1;break}}else if(v!==p&&!o(v,p,r,n,i)){h=!1;break}}return i.delete(t),i.delete(e),h}function ri(t){var e=-1,r=Array(t.size);return t.forEach((function(t,n){r[++e]=[n,t]})),r}function ni(t){var e=-1,r=Array(t.size);return t.forEach((function(t){r[++e]=t})),r}var oi=o?o.prototype:void 0,ii=oi?oi.valueOf:void 0;var si=Object.prototype.hasOwnProperty;var ai="[object Arguments]",ui="[object Array]",ci="[object Object]",li=Object.prototype.hasOwnProperty;function fi(t,e,r,n,o,i){var a=s(t),u=s(e),c=a?ui:Dt(t),l=u?ui:Dt(e),f=(c=c==ai?ci:c)==ci,h=(l=l==ai?ci:l)==ci,d=c==l;if(d&&Gt(t)){if(!Gt(e))return!1;a=!0,f=!1}if(d&&!f)return i||(i=new ir),a||oe(t)?ei(t,e,r,n,o,i):function(t,e,r,n,o,i,s){switch(r){case"[object DataView]":if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case"[object ArrayBuffer]":return!(t.byteLength!=e.byteLength||!i(new $r(t),new $r(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return Qe(+t,+e);case"[object Error]":return t.name==e.name&&t.message==e.message;case"[object RegExp]":case"[object String]":return t==e+"";case"[object Map]":var a=ri;case"[object Set]":var u=1&n;if(a||(a=ni),t.size!=e.size&&!u)return!1;var c=s.get(t);if(c)return c==e;n|=2,s.set(t,e);var l=ei(a(t),a(e),n,o,i,s);return s.delete(t),l;case"[object Symbol]":if(ii)return ii.call(t)==ii.call(e)}return!1}(t,e,c,r,n,o,i);if(!(1&r)){var v=f&&li.call(t,"__wrapped__"),p=h&&li.call(e,"__wrapped__");if(v||p){var y=v?t.value():t,g=p?e.value():e;return i||(i=new ir),o(y,g,r,n,i)}}return!!d&&(i||(i=new ir),function(t,e,r,n,o,i){var s=1&r,a=Er(t),u=a.length;if(u!=Er(e).length&&!s)return!1;for(var c=u;c--;){var l=a[c];if(!(s?l in e:si.call(e,l)))return!1}var f=i.get(t),h=i.get(e);if(f&&h)return f==e&&h==t;var d=!0;i.set(t,e),i.set(e,t);for(var v=s;++c<u;){var p=t[l=a[c]],y=e[l];if(n)var g=s?n(y,p,l,e,t,i):n(p,y,l,t,e,i);if(!(void 0===g?p===y||o(p,y,r,n,i):g)){d=!1;break}v||(v="constructor"==l)}if(d&&!v){var b=t.constructor,m=e.constructor;b==m||!("constructor"in t)||!("constructor"in e)||"function"==typeof b&&b instanceof b&&"function"==typeof m&&m instanceof m||(d=!1)}return i.delete(t),i.delete(e),d}(t,e,r,n,o,i))}function hi(t,e,r,n,o){return t===e||(null==t||null==e||!v(t)&&!v(e)?t!=t&&e!=e:fi(t,e,r,n,hi,o))}function di(t,e){return hi(t,e)}function vi(t){return t==t&&!ct(t)}function pi(t,e){return function(r){return null!=r&&(r[t]===e&&(void 0!==e||t in Object(r)))}}function yi(t){var e=function(t){for(var e=fe(t),r=e.length;r--;){var n=e[r],o=t[n];e[r]=[n,o,vi(o)]}return e}(t);return 1==e.length&&e[0][2]?pi(e[0][0],e[0][1]):function(r){return r===t||function(t,e,r,n){var o=r.length,i=o;if(null==t)return!i;for(t=Object(t);o--;){var s=r[o];if(s[2]?s[1]!==t[s[0]]:!(s[0]in t))return!1}for(;++o<i;){var a=(s=r[o])[0],u=t[a],c=s[1];if(s[2]){if(void 0===u&&!(a in t))return!1}else if(!hi(c,u,3,n,new ir))return!1}return!0}(r,0,e)}}function gi(t,e){for(var r=0,n=(e=No(e,t)).length;null!=t&&r<n;)t=t[ko(e[r++])];return r&&r==n?t:void 0}function bi(t,e){return null!=t&&e in Object(t)}function mi(t,e){return null!=t&&$o(t,e,bi)}function _i(t,e){return Io(t)&&vi(e)?pi(ko(t),e):function(r){var n=function(t,e,r){var n=null==t?void 0:gi(t,e);return void 0===n?r:n}(r,t);return void 0===n&&n===e?mi(r,t):hi(e,n,3)}}function wi(t){return Io(t)?function(t){return function(e){return null==e?void 0:e[t]}}(ko(t)):function(t){return function(e){return gi(e,t)}}(t)}function ji(t){return"function"==typeof t?t:null==t?yn:"object"==typeof t?s(t)?_i(t[0],t[1]):yi(t):wi(t)}function Ai(t,e){return e.length<2?t:gi(t,function(t,e,r){var n=-1,o=t.length;e<0&&(e=-e>o?0:o+e),(r=r>o?o:r)<0&&(r+=o),o=e>r?0:r-e>>>0,e>>>=0;for(var i=Array(o);++n<o;)i[n]=t[n+e];return i}(e,0,-1))}function Ii(t,e){return null==(t=Ai(t,e=No(e,t)))||delete t[ko(function(t){var e=null==t?0:t.length;return e?t[e-1]:void 0}(e))]}function Si(t){return hn(t)?void 0:t}var Oi=o?o.isConcatSpreadable:void 0;function xi(t){return s(t)||Wt(t)||!!(Oi&&t&&t[Oi])}function Ei(t,e,r,n,o){var i=-1,s=t.length;for(r||(r=xi),o||(o=[]);++i<s;){var a=t[i];r(a)?Ir(o,a):o[o.length]=a}return o}function Ni(t){return(null==t?0:t.length)?Ei(t):[]}function ki(t){return Sn(bn(t,void 0,Ni),t+"")}var $i=ki((function(t,e){var r={};if(null==t)return r;var n=!1;e=i(e,(function(e){return e=No(e,t),n||(n=e.length>1),e})),lr(t,Nr(t),r),n&&(r=Qr(r,7,Si));for(var o=e.length;o--;)Ii(r,e[o]);return r}));function Bi(t,e,r,n){if(!ct(t))return t;for(var o=-1,i=(e=No(e,t)).length,s=i-1,a=t;null!=a&&++o<i;){var u=ko(e[o]),c=r;if("__proto__"===u||"constructor"===u||"prototype"===u)return t;if(o!=s){var l=a[u];void 0===(c=void 0)&&(c=ct(l)?l:ue(e[o+1])?[]:{})}cr(a,u,c),a=a[u]}return t}function Ri(t,e){return function(t,e,r){for(var n=-1,o=e.length,i={};++n<o;){var s=e[n],a=gi(t,s);r(a,s)&&Bi(i,No(s,t),a)}return i}(t,e,(function(e,r){return mi(t,r)}))}var Pi=ki((function(t,e){return null==t?{}:Ri(t,e)}));class Ti extends($e(Object)){constructor(t,e){super();let r=t||{};e||(e={}),this.preinitialize.apply(this,arguments),this.cid=w(this.cidPrefix),this.attributes={},this.validationError=null,e.collection&&(this.collection=e.collection),e.parse&&(r=this.parse(r,e)||{});const n=Bo(this,"defaults");r=qo(Object.assign({},n,r),n),this.set(r,e),this.initialize.apply(this,arguments),this.changed={}}set browserStorage(t){this._browserStorage=t}get browserStorage(){return this._browserStorage}get idAttribute(){return"id"}get cidPrefix(){return"c"}preinitialize(){}initialize(t,e){}validate(t,e){return""}toJSON(){return Lo(this.attributes)}sync(t,e,r){return Mo(e)(t,e,r)}get(t){return this.attributes[t]}keys(){return Object.keys(this.attributes)}values(){return Object.values(this.attributes)}pairs(){return this.entries()}entries(){return Object.entries(this.attributes)}invert(){return Xo(this.attributes)}pick(...t){return 1===t.length&&Array.isArray(t[0])&&(t=t[0]),Pi(this.attributes,t)}omit(...t){return 1===t.length&&Array.isArray(t[0])&&(t=t[0]),$i(this.attributes,t)}isEmpty(){return se(this.attributes)}has(t){return null!=this.get(t)}matches(t){return!!function(t){return ji("function"==typeof t?t:Qr(t,1))}(t)(this.attributes)}set(t,e,r){if(null==t)return this;let n;if("object"==typeof t?(n=t,r=e):(n={})[t]=e,r||(r={}),!this._validate(n,r))return!1;const o=r.unset,i=r.silent,s=[],a=this._changing;this._changing=!0,a||(this._previousAttributes=Lo(this.attributes),this.changed={});const u=this.attributes,c=this.changed,l=this._previousAttributes;for(const t in n)e=n[t],di(u[t],e)||s.push(t),di(l[t],e)?delete c[t]:c[t]=e,o?delete u[t]:u[t]=e;if(this.idAttribute in n&&(this.id=this.get(this.idAttribute)),!i){s.length&&(this._pending=r);for(let t=0;t<s.length;t++)this.trigger("change:"+s[t],this,u[s[t]],r)}if(a)return this;if(!i)for(;this._pending;)r=this._pending,this._pending=!1,this.trigger("change",this,r);return this._pending=!1,this._changing=!1,this}unset(t,e){return this.set(t,void 0,Object.assign({},e,{unset:!0}))}clear(t){const e={};for(const t in this.attributes)e[t]=void 0;return this.set(e,Object.assign({},t,{unset:!0}))}hasChanged(t){return null==t?!se(this.changed):(e=this.changed,r=t,null!=e&&$o(e,r,wo));var e,r}changedAttributes(t){if(!t)return!!this.hasChanged()&&Lo(this.changed);const e=this._changing?this._previousAttributes:this.attributes,r={};let n;for(const o in t){const i=t[o];di(e[o],i)||(r[o]=i,n=!0)}return!!n&&r}previous(t){return null!=t&&this._previousAttributes?this._previousAttributes[t]:null}previousAttributes(){return Lo(this._previousAttributes)}fetch(t={}){const e=(t=Object.assign({parse:!0},t)).success;return t.success=r=>{const n=t.parse?this.parse(r,t):r;if(!this.set(n,t))return!1;e&&e.call(t.context,this,r,t),this.trigger("sync",this,r,t)},zo(this,t),this.sync("read",this,t)}save(t,e,r){let n;null==t||"object"==typeof t?(n=t,r=e):(n={})[t]=e;const o=(r=Object.assign({validate:!0,parse:!0},r)).wait,i=r.promise,s=i&&Po();if(n&&!o){if(!this.set(n,r))return!1}else if(!this._validate(n,r))return!1;const a=r.success,u=r.error,c=this.attributes;r.success=t=>{this.attributes=c;let e=r.parse?this.parse(t,r):t;if(o&&(e=Object.assign({},n,e)),e&&!this.set(e,r))return!1;a&&a.call(r.context,this,t,r),this.trigger("sync",this,t,r),i&&s.resolve()},r.error=(t,e,r)=>{u&&u.call(r.context,t,e,r),i&&s.reject(e)},zo(this,r),n&&o&&(this.attributes=Object.assign({},c,n));const l=this.isNew()?"create":r.patch?"patch":"update";"patch"!==l||r.attrs||(r.attrs=n);const f=this.sync(l,this,r);return this.attributes=c,i?s:f}destroy(t){const e=(t=t?Lo(t):{}).success,r=t.wait,n=()=>{this.stopListening(),this.trigger("destroy",this,this.collection,t)};t.success=o=>{r&&n(),e&&e.call(t.context,this,o,t),this.isNew()||this.trigger("sync",this,o,t)};let o=!1;return this.isNew()?Vo(t.success):(zo(this,t),o=this.sync("delete",this,t)),r||n(),o}url(){const t=Bo(this,"urlRoot")||Bo(this.collection,"url")||To();if(this.isNew())return t;const e=this.get(this.idAttribute);return t.replace(/[^\/]$/,"$&/")+encodeURIComponent(e)}parse(t,e){return t}isNew(){return!this.has(this.idAttribute)}isValid(t){return this._validate({},Object.assign({},t,{validate:!0}))}_validate(t,e){if(!e.validate||!this.validate)return!0;t=Object.assign({},this.attributes,t);const r=this.validationError=this.validate(t,e)||null;return!r||(this.trigger("invalid",this,r,Object.assign(e,{validationError:r})),!1)}}function zi(t,e,r,n){for(var o=-1,i=null==t?0:t.length;++o<i;){var s=t[o];e(n,s,r(s),t)}return n}var Ci,Mi=(Ci=Jo,function(t,e){if(null==t)return t;if(!Vt(t))return Ci(t,e);for(var r=t.length,n=-1,o=Object(t);++n<r&&!1!==e(o[n],n,o););return t});function Di(t,e,r,n){return Mi(t,(function(t,o,i){e(n,t,r(t),i)})),n}function Ui(t,e){return function(e,r){return(s(e)?zi:Di)(e,t,ji(r),{})}}var Fi=Object.prototype.hasOwnProperty,Li=Ui((function(t,e,r){Fi.call(t,r)?++t[r]:ar(t,r,1)})),Hi=Object.prototype.hasOwnProperty,Wi=Ui((function(t,e,r){Hi.call(t,r)?t[r].push(e):ar(t,r,[e])})),qi=Ui((function(t,e,r){ar(t,r,e)}));function Vi(t,e){if(t!==e){var r=void 0!==t,n=null===t,o=t==t,i=p(t),s=void 0!==e,a=null===e,u=e==e,c=p(e);if(!a&&!c&&!i&&t>e||i&&s&&u&&!a&&!c||n&&s&&u||!r&&u||!o)return 1;if(!n&&!i&&!c&&t<e||c&&r&&o&&!n&&!i||a&&r&&o||!s&&o||!u)return-1}return 0}function Ji(t,e,r){e=e.length?i(e,(function(t){return s(t)?function(e){return gi(e,1===t.length?t[0]:t)}:t})):[yn];var n=-1;e=i(e,Yt(ji));var o=function(t,e){var r=-1,n=Vt(t)?Array(t.length):[];return Mi(t,(function(t,o,i){n[++r]=e(t,o,i)})),n}(t,(function(t,r,o){var s=i(e,(function(e){return e(t)}));return{criteria:s,index:++n,value:t}}));return function(t,e){var r=t.length;for(t.sort(e);r--;)t[r]=t[r].value;return t}(o,(function(t,e){return function(t,e,r){for(var n=-1,o=t.criteria,i=e.criteria,s=o.length,a=r.length;++n<s;){var u=Vi(o[n],i[n]);if(u)return n>=a?u:u*("desc"==r[n]?-1:1)}return t.index-e.index}(t,e,r)}))}var Ki=On((function(t,e){if(null==t)return[];var r=e.length;return r>1&&xn(t,e[0],e[1])?e=[]:r>2&&xn(e[0],e[1],e[2])&&(e=[e[0]]),Ji(t,Ei(e),[])}));const Qi=Array.prototype.slice,Gi={add:!0,remove:!0,merge:!0},Xi={add:!0,remove:!1};class Yi extends($e(Object)){constructor(t,e){super(),e||(e={}),this.preinitialize.apply(this,arguments),e.model&&(this._model=e.model),void 0!==e.comparator&&(this.comparator=e.comparator),this._reset(),this.initialize.apply(this,arguments),t&&this.reset(t,Object.assign({silent:!0},e)),this[Symbol.iterator]=this.values}set browserStorage(t){this._browserStorage=t}get browserStorage(){return this._browserStorage}get model(){var t;return null!==(t=this._model)&&void 0!==t?t:Ti}set model(t){this._model=t}get length(){return this.models.length}preinitialize(){}initialize(){}toJSON(t){return this.map((function(e){return e.toJSON(t)}))}sync(t,e,r){return Mo(this)(t,e,r)}add(t,e){return this.set(t,Object.assign({merge:!1},e,Xi))}remove(t,e){e=Object.assign({},e);const r=!Array.isArray(t),n=r?[t]:t.slice(),o=this._removeModels(n,e);return!e.silent&&o.length&&(e.changes={added:[],merged:[],removed:o},this.trigger("update",this,e)),r?o[0]:o}set(t,e){if(null==t)return;(e=Object.assign({},Gi,e)).parse&&!this._isModel(t)&&(t=this.parse(t,e)||[]);const r=!Array.isArray(t);t=r?[t]:t.slice();let n=e.at;null!=n&&(n=+n),n>this.length&&(n=this.length),n<0&&(n+=this.length+1);const o=[],i=[],s=[],a=[],u={},c=e.add,l=e.merge,f=e.remove;let h=!1;const d=this.comparator&&null==n&&!1!==e.sort,v=Gr(this.comparator)?this.comparator:null;let p,y;for(y=0;y<t.length;y++){p=t[y];const r=this.get(p);if(r){if(l&&p!==r){let t=this._isModel(p)?p.attributes:p;e.parse&&(t=r.parse(t,e)),r.set(t,e),s.push(r),d&&!h&&(h=r.hasChanged(v))}u[r.cid]||(u[r.cid]=!0,o.push(r)),t[y]=r}else c&&(p=t[y]=this._prepareModel(p,e),p&&(i.push(p),this._addReference(p,e),u[p.cid]=!0,o.push(p)))}if(f){for(y=0;y<this.length;y++)p=this.models[y],u[p.cid]||a.push(p);a.length&&this._removeModels(a,e)}let g=!1;const b=!d&&c&&f;if(o.length&&b)g=this.length!==o.length||this.models.some(((t,e)=>t!==o[e])),this.models.length=0,this.models.splice(0,0,...o);else if(i.length){d&&(h=!0);let t=n??this.length;t=Math.min(Math.max(t,0),this.models.length),this.models.splice(t,0,...i)}if(h&&this.sort({silent:!0}),!e.silent){for(y=0;y<i.length;y++)null!=n&&(e.index=n+y),p=i[y],p.trigger("add",p,this,e);(h||g)&&this.trigger("sort",this,e),(i.length||a.length||s.length)&&(e.changes={added:i,removed:a,merged:s},this.trigger("update",this,e))}return r?t[0]:t}async clearStore(t={},e=t=>t){await Promise.all(this.models.filter(e).map((e=>new Promise((r=>{e.destroy(Object.assign(t,{success:r,error:(t,e)=>{console.error(e),r()}}))}))))),await this.browserStorage.clear(),this.reset()}reset(t,e){e=e?Lo(e):{};for(let t=0;t<this.models.length;t++)this._removeReference(this.models[t],e);return e.previousModels=this.models,this._reset(),t=this.add(t,Object.assign({silent:!0},e)),e.silent||this.trigger("reset",this,e),t}push(t,e){return this.add(t,Object.assign({at:this.length},e))}pop(t){const e=this.at(this.length-1);return this.remove(e,t)}unshift(t,e){return this.add(t,Object.assign({at:0},e))}shift(t){const e=this.at(0);return this.remove(e,t)}slice(){return Qi.apply(this.models,arguments)}filter(t,e){return this.models.filter(lt(t)?t:e=>e.matches(t),e)}every(t){return lt(t)?this.models.map((t=>t.attributes)).every(t):this.models.every((e=>e.matches(t)))}difference(t){return this.models.filter((e=>!t.includes(e)))}max(){return Math.max.apply(Math,this.models)}min(){return Math.min.apply(Math,this.models)}drop(t=1){return this.models.slice(t)}some(t){return lt(t)?this.models.map((t=>t.attributes)).some(t):this.models.some((e=>e.matches(t)))}sortBy(t){return Ki(this.models,lt(t)?t:e=>Gr(t)?e.get(t):e.matches(t))}isEmpty(){return!this.models.length}keyBy(t){return qi(this.models,t)}each(t,e){return this.forEach(t,e)}forEach(t,e){return this.models.forEach(t,e)}includes(t){return this.models.includes(t)}size(){return this.models.length}countBy(t){return Li(this.models,lt(t)?t:e=>Gr(t)?e.get(t):e.matches(t))}groupBy(t){return Wi(this.models,lt(t)?t:e=>Gr(t)?e.get(t):e.matches(t))}indexOf(t){return this.models.indexOf(t)}findLastIndex(t,e){return this.models.findLastIndex(lt(t)?t:e=>Gr(t)?e.get(t):e.matches(t),e)}lastIndexOf(t){return this.models.lastIndexOf(t)}findIndex(t){return this.models.findIndex(lt(t)?t:e=>Gr(t)?e.get(t):e.matches(t))}last(){const t=null==this.models?0:this.models.length;return t?this.models[t-1]:void 0}head(){return this.models[0]}first(){return this.head()}map(t,e){return this.models.map(lt(t)?t:e=>Gr(t)?e.get(t):e.matches(t),e)}reduce(t,e){return this.models.reduce(t,e||this.models[0])}reduceRight(t,e){return this.models.reduceRight(t,e||this.models[0])}toArray(){return Array.from(this.models)}get(t){if(null!=t)return this._byId[t]||this._byId[this.modelId(this._isModel(t)?t.attributes:t)]||t.cid&&this._byId[t.cid]}has(t){return null!=this.get(t)}at(t){return t<0&&(t+=this.length),this.models[t]}where(t,e){return this[e?"find":"filter"](t)}findWhere(t){return this.where(t,!0)}find(t,e){const r=lt(t)?t:e=>e.matches(t);return this.models.find(r,e)}sort(t){let e=this.comparator;if(!e)throw new Error("Cannot sort a set without a comparator");t||(t={});const r=e.length;return lt(e)&&(e=e.bind(this)),1===r||Gr(e)?this.models=this.sortBy(e):this.models.sort(e),t.silent||this.trigger("sort",this,t),this}pluck(t){return this.map(t+"")}fetch(t){const e=(t=Object.assign({parse:!0},t)).success,r=this,n=t.promise&&Po();return t.success=function(o){const i=t.reset?"reset":"set";r[i](o,t),e&&e.call(t.context,r,o,t),n&&n.resolve(),r.trigger("sync",r,o,t)},zo(this,t),n||this.sync("read",this,t)}create(t,e){const r=(e=e?Lo(e):{}).wait,n=e.promise,o=n&&Po();if(!(t=this._prepareModel(t,e)))return!1;r||this.add(t,e);const i=this,s=e.success,a=e.error;return e.success=function(t,e,a){r&&i.add(t,a),s&&s.call(a.context,t,e,a),n&&o.resolve(t)},e.error=function(t,e,r){a&&a.call(r.context,t,e,r),n&&o.reject(e)},t.save(null,Object.assign(e,{promise:!1})),n?o:t}parse(t,e){return t}modelId(t){var e;return t[(null===(e=this.model.prototype)||void 0===e?void 0:e.idAttribute)||"id"]}values(){return new rs(this,Zi)}keys(){return new rs(this,ts)}entries(){return new rs(this,es)}_reset(){this.models=[],this._byId={}}createModel(t,e){return new(0,this.model)(t,e)}_prepareModel(t,e){if(this._isModel(t))return t.collection||(t.collection=this),t;(e=e?Lo(e):{}).collection=this;const r=this.createModel(t,e);return r.validationError?(this.trigger("invalid",this,r.validationError,e),null):r}_removeModels(t,e){const r=[];for(let n=0;n<t.length;n++){const o=this.get(t[n]);if(!o)continue;const i=this.indexOf(o);this.models.splice(i,1),delete this._byId[o.cid];const s=this.modelId(o.attributes);null!=s&&delete this._byId[s],e.silent||(e.index=i,o.trigger("remove",o,this,e)),r.push(o),this._removeReference(o,e)}return r}_isModel(t){return t instanceof Ti}_addReference(t,e){this._byId[t.cid]=t;const r=this.modelId(t.attributes);null!=r&&(this._byId[r]=t),t.on("all",this._onModelEvent,this)}_removeReference(t,e){delete this._byId[t.cid];const r=this.modelId(t.attributes);null!=r&&delete this._byId[r],this===t.collection&&delete t.collection,t.off("all",this._onModelEvent,this)}_onModelEvent(t,e,r,n){if(e){if(("add"===t||"remove"===t)&&r!==this)return;if("destroy"===t&&this.remove(e,n),"change"===t){const t=this.modelId(e.previousAttributes()),r=this.modelId(e.attributes);t!==r&&(null!=t&&delete this._byId[t],null!=r&&(this._byId[r]=e))}}this.trigger.apply(this,arguments)}}const Zi=1,ts=2,es=3;class rs{constructor(t,e){this._collection=t,this._kind=e,this._index=0}next(){if(this._collection){if(this._index<this._collection.length){const t=this._collection.at(this._index);let e;if(this._index++,this._kind===Zi)e=t;else{const r=this._collection.modelId(t.attributes);e=this._kind===ts?r:[r,t]}return{value:e,done:!1}}this._collection=void 0}return{value:void 0,done:!0}}[Symbol.iterator](){return this}}const ns={Collection:Yi,ElementView:Re,EventEmitter:$e,Model:Ti,sync:Do},os="object"==typeof self&&self.self===self&&self||"object"==typeof global&&global.global===global&&global;ns.VERSION="0.0.1";const is=os.Skeletor;ns.noConflict=function(){return os.Skeletor=is,this},os.Skeletor=ns,t.Collection=Yi,t.ElementView=Re,t.EventEmitter=$e,t.Model=Ti,t.Storage=Fo,t.default=ns,t.sync=Do,Object.defineProperty(t,"__esModule",{value:!0})}));
73
+ */function _r(){return gr||(gr=1,function(t){t.exports=function t(e,r,n){function o(s,a){if(!r[s]){if(!e[s]){if(!a&&br)return br(s);if(i)return i(s,!0);var u=new Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var c=r[s]={exports:{}};e[s][0].call(c.exports,function(t){var r=e[s][1][t];return o(r||t)},c,c.exports,t,e,r,n)}return r[s].exports}for(var i=br,s=0;s<n.length;s++)o(n[s]);return o}({1:[function(t,e,r){(function(t){var r,n,o=t.MutationObserver||t.WebKitMutationObserver;if(o){var i=0,s=new o(l),a=t.document.createTextNode("");s.observe(a,{characterData:!0}),r=function(){a.data=i=++i%2}}else if(t.setImmediate||void 0===t.MessageChannel)r="document"in t&&"onreadystatechange"in t.document.createElement("script")?function(){var e=t.document.createElement("script");e.onreadystatechange=function(){l(),e.onreadystatechange=null,e.parentNode.removeChild(e),e=null},t.document.documentElement.appendChild(e)}:function(){setTimeout(l,0)};else{var u=new t.MessageChannel;u.port1.onmessage=l,r=function(){u.port2.postMessage(0)}}var c=[];function l(){var t,e;n=!0;for(var r=c.length;r;){for(e=c,c=[],t=-1;++t<r;)e[t]();r=c.length}n=!1}function f(t){1!==c.push(t)||n||r()}e.exports=f}).call(this,void 0!==pr?pr:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],2:[function(t,e,r){var n=t(1);function o(){}var i={},s=["REJECTED"],a=["FULFILLED"],u=["PENDING"];function c(t){if("function"!=typeof t)throw new TypeError("resolver must be a function");this.state=u,this.queue=[],this.outcome=void 0,t!==o&&d(this,t)}function l(t,e,r){this.promise=t,"function"==typeof e&&(this.onFulfilled=e,this.callFulfilled=this.otherCallFulfilled),"function"==typeof r&&(this.onRejected=r,this.callRejected=this.otherCallRejected)}function f(t,e,r){n(function(){var n;try{n=e(r)}catch(e){return i.reject(t,e)}n===t?i.reject(t,new TypeError("Cannot resolve promise with itself")):i.resolve(t,n)})}function h(t){var e=t&&t.then;if(t&&("object"==typeof t||"function"==typeof t)&&"function"==typeof e)return function(){e.apply(t,arguments)}}function d(t,e){var r=!1;function n(e){r||(r=!0,i.reject(t,e))}function o(e){r||(r=!0,i.resolve(t,e))}function s(){e(o,n)}var a=v(s);"error"===a.status&&n(a.value)}function v(t,e){var r={};try{r.value=t(e),r.status="success"}catch(t){r.status="error",r.value=t}return r}function p(t){return t instanceof this?t:i.resolve(new this(o),t)}function y(t){var e=new this(o);return i.reject(e,t)}function b(t){var e=this;if("[object Array]"!==Object.prototype.toString.call(t))return this.reject(new TypeError("must be an array"));var r=t.length,n=!1;if(!r)return this.resolve([]);for(var s=new Array(r),a=0,u=-1,c=new this(o);++u<r;)l(t[u],u);return c;function l(t,o){function u(t){s[o]=t,++a!==r||n||(n=!0,i.resolve(c,s))}e.resolve(t).then(u,function(t){n||(n=!0,i.reject(c,t))})}}function g(t){var e=this;if("[object Array]"!==Object.prototype.toString.call(t))return this.reject(new TypeError("must be an array"));var r=t.length,n=!1;if(!r)return this.resolve([]);for(var s=-1,a=new this(o);++s<r;)u(t[s]);return a;function u(t){e.resolve(t).then(function(t){n||(n=!0,i.resolve(a,t))},function(t){n||(n=!0,i.reject(a,t))})}}e.exports=c,c.prototype.catch=function(t){return this.then(null,t)},c.prototype.then=function(t,e){if("function"!=typeof t&&this.state===a||"function"!=typeof e&&this.state===s)return this;var r=new this.constructor(o);return this.state!==u?f(r,this.state===a?t:e,this.outcome):this.queue.push(new l(r,t,e)),r},l.prototype.callFulfilled=function(t){i.resolve(this.promise,t)},l.prototype.otherCallFulfilled=function(t){f(this.promise,this.onFulfilled,t)},l.prototype.callRejected=function(t){i.reject(this.promise,t)},l.prototype.otherCallRejected=function(t){f(this.promise,this.onRejected,t)},i.resolve=function(t,e){var r=v(h,e);if("error"===r.status)return i.reject(t,r.value);var n=r.value;if(n)d(t,n);else{t.state=a,t.outcome=e;for(var o=-1,s=t.queue.length;++o<s;)t.queue[o].callFulfilled(e)}return t},i.reject=function(t,e){t.state=s,t.outcome=e;for(var r=-1,n=t.queue.length;++r<n;)t.queue[r].callRejected(e);return t},c.resolve=p,c.reject=y,c.all=b,c.race=g},{1:1}],3:[function(t,e,r){(function(e){"function"!=typeof e.Promise&&(e.Promise=t(2))}).call(this,void 0!==pr?pr:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{2:2}],4:[function(t,e,r){var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(){try{if("undefined"!=typeof indexedDB)return indexedDB;if("undefined"!=typeof webkitIndexedDB)return webkitIndexedDB;if("undefined"!=typeof mozIndexedDB)return mozIndexedDB;if("undefined"!=typeof OIndexedDB)return OIndexedDB;if("undefined"!=typeof msIndexedDB)return msIndexedDB}catch(t){return}}var s=i();function a(){try{if(!s||!s.open)return!1;var t="undefined"!=typeof openDatabase&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),e="function"==typeof fetch&&-1!==fetch.toString().indexOf("[native code");return(!t||e)&&"undefined"!=typeof indexedDB&&"undefined"!=typeof IDBKeyRange}catch(t){return!1}}function u(t,e){t=t||[],e=e||{};try{return new Blob(t,e)}catch(o){if("TypeError"!==o.name)throw o;for(var r=new("undefined"!=typeof BlobBuilder?BlobBuilder:"undefined"!=typeof MSBlobBuilder?MSBlobBuilder:"undefined"!=typeof MozBlobBuilder?MozBlobBuilder:WebKitBlobBuilder),n=0;n<t.length;n+=1)r.append(t[n]);return r.getBlob(e.type)}}"undefined"==typeof Promise&&t(3);var c=Promise;function l(t,e){e&&t.then(function(t){e(null,t)},function(t){e(t)})}function f(t,e,r){"function"==typeof e&&t.then(e),"function"==typeof r&&t.catch(r)}function h(t){return"string"!=typeof t&&(console.warn(t+" used as a key, but it is not a string."),t=String(t)),t}function d(){if(arguments.length&&"function"==typeof arguments[arguments.length-1])return arguments[arguments.length-1]}var v="local-forage-detect-blob-support",p=void 0,y={},b=Object.prototype.toString,g="readonly",m="readwrite";function _(t){for(var e=t.length,r=new ArrayBuffer(e),n=new Uint8Array(r),o=0;o<e;o++)n[o]=t.charCodeAt(o);return r}function w(t){return new c(function(e){var r=t.transaction(v,m),n=u([""]);r.objectStore(v).put(n,"key"),r.onabort=function(t){t.preventDefault(),t.stopPropagation(),e(!1)},r.oncomplete=function(){var t=navigator.userAgent.match(/Chrome\/(\d+)/),r=navigator.userAgent.match(/Edge\//);e(r||!t||parseInt(t[1],10)>=43)}}).catch(function(){return!1})}function j(t){return"boolean"==typeof p?c.resolve(p):w(t).then(function(t){return p=t})}function I(t){var e=y[t.name],r={};r.promise=new c(function(t,e){r.resolve=t,r.reject=e}),e.deferredOperations.push(r),e.dbReady?e.dbReady=e.dbReady.then(function(){return r.promise}):e.dbReady=r.promise}function S(t){var e=y[t.name].deferredOperations.pop();if(e)return e.resolve(),e.promise}function O(t,e){var r=y[t.name].deferredOperations.pop();if(r)return r.reject(e),r.promise}function A(t,e){return new c(function(r,n){if(y[t.name]=y[t.name]||T(),t.db){if(!e)return r(t.db);I(t),t.db.close()}var o=[t.name];e&&o.push(t.version);var i=s.open.apply(s,o);e&&(i.onupgradeneeded=function(e){var r=i.result;try{r.createObjectStore(t.storeName),e.oldVersion<=1&&r.createObjectStore(v)}catch(r){if("ConstraintError"!==r.name)throw r;console.warn('The database "'+t.name+'" has been upgraded from version '+e.oldVersion+" to version "+e.newVersion+', but the storage "'+t.storeName+'" already exists.')}}),i.onerror=function(t){t.preventDefault(),n(i.error)},i.onsuccess=function(){var e=i.result;e.onversionchange=function(t){t.target.close()},r(e),S(t)}})}function x(t){return A(t,!1)}function E(t){return A(t,!0)}function N(t,e){if(!t.db)return!0;var r=!t.db.objectStoreNames.contains(t.storeName),n=t.version<t.db.version,o=t.version>t.db.version;if(n&&(t.version!==e&&console.warn('The database "'+t.name+"\" can't be downgraded from version "+t.db.version+" to version "+t.version+"."),t.version=t.db.version),o||r){if(r){var i=t.db.version+1;i>t.version&&(t.version=i)}return!0}return!1}function k(t){return new c(function(e,r){var n=new FileReader;n.onerror=r,n.onloadend=function(r){var n=btoa(r.target.result||"");e({__local_forage_encoded_blob:!0,data:n,type:t.type})},n.readAsBinaryString(t)})}function B(t){return u([_(atob(t.data))],{type:t.type})}function R(t){return t&&t.__local_forage_encoded_blob}function P(t){var e=this,r=e._initReady().then(function(){var t=y[e._dbInfo.name];if(t&&t.dbReady)return t.dbReady});return f(r,t,t),r}function z(t){I(t);for(var e=y[t.name],r=e.forages,n=0;n<r.length;n++){var o=r[n];o._dbInfo.db&&(o._dbInfo.db.close(),o._dbInfo.db=null)}return t.db=null,x(t).then(function(e){return t.db=e,N(t)?E(t):e}).then(function(n){t.db=e.db=n;for(var o=0;o<r.length;o++)r[o]._dbInfo.db=n}).catch(function(e){throw O(t,e),e})}function D(t,e,r,n){void 0===n&&(n=1);try{var o=t.db.transaction(t.storeName,e);r(null,o)}catch(o){if(n>0&&(!t.db||"InvalidStateError"===o.name||"NotFoundError"===o.name))return c.resolve().then(function(){if(!t.db||"NotFoundError"===o.name&&!t.db.objectStoreNames.contains(t.storeName)&&t.version<=t.db.version)return t.db&&(t.version=t.db.version+1),E(t)}).then(function(){return z(t).then(function(){D(t,e,r,n-1)})}).catch(r);r(o)}}function T(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function C(t){var e=this,r={db:null};if(t)for(var n in t)r[n]=t[n];var o=y[r.name];o||(o=T(),y[r.name]=o),o.forages.push(e),e._initReady||(e._initReady=e.ready,e.ready=P);var i=[];function s(){return c.resolve()}for(var a=0;a<o.forages.length;a++){var u=o.forages[a];u!==e&&i.push(u._initReady().catch(s))}var l=o.forages.slice(0);return c.all(i).then(function(){return r.db=o.db,x(r)}).then(function(t){return r.db=t,N(r,e._defaultConfig.version)?E(r):t}).then(function(t){r.db=o.db=t,e._dbInfo=r;for(var n=0;n<l.length;n++){var i=l[n];i!==e&&(i._dbInfo.db=r.db,i._dbInfo.version=r.version)}})}function M(t,e){var r=this;t=h(t);var n=new c(function(e,n){r.ready().then(function(){D(r._dbInfo,g,function(o,i){if(o)return n(o);try{var s=i.objectStore(r._dbInfo.storeName).get(t);s.onsuccess=function(){var t=s.result;void 0===t&&(t=null),R(t)&&(t=B(t)),e(t)},s.onerror=function(){n(s.error)}}catch(t){n(t)}})}).catch(n)});return l(n,e),n}function F(t,e){var r=this,n=new c(function(e,n){r.ready().then(function(){D(r._dbInfo,g,function(o,i){if(o)return n(o);try{var s=i.objectStore(r._dbInfo.storeName).openCursor(),a=1;s.onsuccess=function(){var r=s.result;if(r){var n=r.value;R(n)&&(n=B(n));var o=t(n,r.key,a++);void 0!==o?e(o):r.continue()}else e()},s.onerror=function(){n(s.error)}}catch(t){n(t)}})}).catch(n)});return l(n,e),n}function U(t,e,r){var n=this;t=h(t);var o=new c(function(r,o){var i;n.ready().then(function(){return i=n._dbInfo,"[object Blob]"===b.call(e)?j(i.db).then(function(t){return t?e:k(e)}):e}).then(function(e){D(n._dbInfo,m,function(i,s){if(i)return o(i);try{var a=s.objectStore(n._dbInfo.storeName);null===e&&(e=void 0);var u=a.put(e,t);s.oncomplete=function(){void 0===e&&(e=null),r(e)},s.onabort=s.onerror=function(){var t=u.error?u.error:u.transaction.error;o(t)}}catch(t){o(t)}})}).catch(o)});return l(o,r),o}function L(t,e){var r=this;t=h(t);var n=new c(function(e,n){r.ready().then(function(){D(r._dbInfo,m,function(o,i){if(o)return n(o);try{var s=i.objectStore(r._dbInfo.storeName).delete(t);i.oncomplete=function(){e()},i.onerror=function(){n(s.error)},i.onabort=function(){var t=s.error?s.error:s.transaction.error;n(t)}}catch(t){n(t)}})}).catch(n)});return l(n,e),n}function q(t){var e=this,r=new c(function(t,r){e.ready().then(function(){D(e._dbInfo,m,function(n,o){if(n)return r(n);try{var i=o.objectStore(e._dbInfo.storeName).clear();o.oncomplete=function(){t()},o.onabort=o.onerror=function(){var t=i.error?i.error:i.transaction.error;r(t)}}catch(t){r(t)}})}).catch(r)});return l(r,t),r}function W(t){var e=this,r=new c(function(t,r){e.ready().then(function(){D(e._dbInfo,g,function(n,o){if(n)return r(n);try{var i=o.objectStore(e._dbInfo.storeName).count();i.onsuccess=function(){t(i.result)},i.onerror=function(){r(i.error)}}catch(t){r(t)}})}).catch(r)});return l(r,t),r}function J(t,e){var r=this,n=new c(function(e,n){t<0?e(null):r.ready().then(function(){D(r._dbInfo,g,function(o,i){if(o)return n(o);try{var s=i.objectStore(r._dbInfo.storeName),a=!1,u=s.openKeyCursor();u.onsuccess=function(){var r=u.result;r?0===t||a?e(r.key):(a=!0,r.advance(t)):e(null)},u.onerror=function(){n(u.error)}}catch(t){n(t)}})}).catch(n)});return l(n,e),n}function K(t){var e=this,r=new c(function(t,r){e.ready().then(function(){D(e._dbInfo,g,function(n,o){if(n)return r(n);try{var i=o.objectStore(e._dbInfo.storeName).openKeyCursor(),s=[];i.onsuccess=function(){var e=i.result;e?(s.push(e.key),e.continue()):t(s)},i.onerror=function(){r(i.error)}}catch(t){r(t)}})}).catch(r)});return l(r,t),r}function V(t,e){e=d.apply(this,arguments);var r=this.config();(t="function"!=typeof t&&t||{}).name||(t.name=t.name||r.name,t.storeName=t.storeName||r.storeName);var n,o=this;if(t.name){var i=t.name===r.name&&o._dbInfo.db?c.resolve(o._dbInfo.db):x(t).then(function(e){var r=y[t.name],n=r.forages;r.db=e;for(var o=0;o<n.length;o++)n[o]._dbInfo.db=e;return e});n=t.storeName?i.then(function(e){if(e.objectStoreNames.contains(t.storeName)){var r=e.version+1;I(t);var n=y[t.name],o=n.forages;e.close();for(var i=0;i<o.length;i++){var a=o[i];a._dbInfo.db=null,a._dbInfo.version=r}var u=new c(function(e,n){var o=s.open(t.name,r);o.onerror=function(t){o.result.close(),n(t)},o.onupgradeneeded=function(){o.result.deleteObjectStore(t.storeName)},o.onsuccess=function(){var t=o.result;t.close(),e(t)}});return u.then(function(t){n.db=t;for(var e=0;e<o.length;e++){var r=o[e];r._dbInfo.db=t,S(r._dbInfo)}}).catch(function(e){throw(O(t,e)||c.resolve()).catch(function(){}),e})}}):i.then(function(e){I(t);var r=y[t.name],n=r.forages;e.close();for(var o=0;o<n.length;o++)n[o]._dbInfo.db=null;var i=new c(function(e,r){var n=s.deleteDatabase(t.name);n.onerror=function(){var t=n.result;t&&t.close(),r(n.error)},n.onblocked=function(){console.warn('dropInstance blocked for database "'+t.name+'" until all open connections are closed')},n.onsuccess=function(){var t=n.result;t&&t.close(),e(t)}});return i.then(function(t){r.db=t;for(var e=0;e<n.length;e++)S(n[e]._dbInfo)}).catch(function(e){throw(O(t,e)||c.resolve()).catch(function(){}),e})})}else n=c.reject("Invalid arguments");return l(n,e),n}var Q={_driver:"asyncStorage",_initStorage:C,_support:a(),iterate:F,getItem:M,setItem:U,removeItem:L,clear:q,length:W,key:J,keys:K,dropInstance:V};function G(){return"function"==typeof openDatabase}var H="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",$="~~local_forage_type~",X=/^~~local_forage_type~([^~]+)~/,Y="__lfsc__:",Z=Y.length,tt="arbf",et="blob",rt="si08",nt="ui08",ot="uic8",it="si16",st="si32",at="ur16",ut="ui32",ct="fl32",lt="fl64",ft=Z+tt.length,ht=Object.prototype.toString;function dt(t){var e,r,n,o,i,s=.75*t.length,a=t.length,u=0;"="===t[t.length-1]&&(s--,"="===t[t.length-2]&&s--);var c=new ArrayBuffer(s),l=new Uint8Array(c);for(e=0;e<a;e+=4)r=H.indexOf(t[e]),n=H.indexOf(t[e+1]),o=H.indexOf(t[e+2]),i=H.indexOf(t[e+3]),l[u++]=r<<2|n>>4,l[u++]=(15&n)<<4|o>>2,l[u++]=(3&o)<<6|63&i;return c}function vt(t){var e,r=new Uint8Array(t),n="";for(e=0;e<r.length;e+=3)n+=H[r[e]>>2],n+=H[(3&r[e])<<4|r[e+1]>>4],n+=H[(15&r[e+1])<<2|r[e+2]>>6],n+=H[63&r[e+2]];return r.length%3==2?n=n.substring(0,n.length-1)+"=":r.length%3==1&&(n=n.substring(0,n.length-2)+"=="),n}function pt(t,e){var r="";if(t&&(r=ht.call(t)),t&&("[object ArrayBuffer]"===r||t.buffer&&"[object ArrayBuffer]"===ht.call(t.buffer))){var n,o=Y;t instanceof ArrayBuffer?(n=t,o+=tt):(n=t.buffer,"[object Int8Array]"===r?o+=rt:"[object Uint8Array]"===r?o+=nt:"[object Uint8ClampedArray]"===r?o+=ot:"[object Int16Array]"===r?o+=it:"[object Uint16Array]"===r?o+=at:"[object Int32Array]"===r?o+=st:"[object Uint32Array]"===r?o+=ut:"[object Float32Array]"===r?o+=ct:"[object Float64Array]"===r?o+=lt:e(new Error("Failed to get type for BinaryArray"))),e(o+vt(n))}else if("[object Blob]"===r){var i=new FileReader;i.onload=function(){var r=$+t.type+"~"+vt(this.result);e(Y+et+r)},i.readAsArrayBuffer(t)}else try{e(JSON.stringify(t))}catch(r){console.error("Couldn't convert value into a JSON string: ",t),e(null,r)}}function yt(t){if(t.substring(0,Z)!==Y)return JSON.parse(t);var e,r=t.substring(ft),n=t.substring(Z,ft);if(n===et&&X.test(r)){var o=r.match(X);e=o[1],r=r.substring(o[0].length)}var i=dt(r);switch(n){case tt:return i;case et:return u([i],{type:e});case rt:return new Int8Array(i);case nt:return new Uint8Array(i);case ot:return new Uint8ClampedArray(i);case it:return new Int16Array(i);case at:return new Uint16Array(i);case st:return new Int32Array(i);case ut:return new Uint32Array(i);case ct:return new Float32Array(i);case lt:return new Float64Array(i);default:throw new Error("Unkown type: "+n)}}var bt={serialize:pt,deserialize:yt,stringToBuffer:dt,bufferToString:vt};function gt(t,e,r,n){t.executeSql("CREATE TABLE IF NOT EXISTS "+e.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],r,n)}function mt(t){var e=this,r={db:null};if(t)for(var n in t)r[n]="string"!=typeof t[n]?t[n].toString():t[n];var o=new c(function(t,n){try{r.db=openDatabase(r.name,String(r.version),r.description,r.size)}catch(t){return n(t)}r.db.transaction(function(o){gt(o,r,function(){e._dbInfo=r,t()},function(t,e){n(e)})},n)});return r.serializer=bt,o}function _t(t,e,r,n,o,i){t.executeSql(r,n,o,function(t,s){s.code===s.SYNTAX_ERR?t.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[e.storeName],function(t,a){a.rows.length?i(t,s):gt(t,e,function(){t.executeSql(r,n,o,i)},i)},i):i(t,s)},i)}function wt(t,e){var r=this;t=h(t);var n=new c(function(e,n){r.ready().then(function(){var o=r._dbInfo;o.db.transaction(function(r){_t(r,o,"SELECT * FROM "+o.storeName+" WHERE key = ? LIMIT 1",[t],function(t,r){var n=r.rows.length?r.rows.item(0).value:null;n&&(n=o.serializer.deserialize(n)),e(n)},function(t,e){n(e)})})}).catch(n)});return l(n,e),n}function jt(t,e){var r=this,n=new c(function(e,n){r.ready().then(function(){var o=r._dbInfo;o.db.transaction(function(r){_t(r,o,"SELECT * FROM "+o.storeName,[],function(r,n){for(var i=n.rows,s=i.length,a=0;a<s;a++){var u=i.item(a),c=u.value;if(c&&(c=o.serializer.deserialize(c)),void 0!==(c=t(c,u.key,a+1)))return void e(c)}e()},function(t,e){n(e)})})}).catch(n)});return l(n,e),n}function It(t,e,r,n){var o=this;t=h(t);var i=new c(function(i,s){o.ready().then(function(){void 0===e&&(e=null);var a=e,u=o._dbInfo;u.serializer.serialize(e,function(e,c){c?s(c):u.db.transaction(function(r){_t(r,u,"INSERT OR REPLACE INTO "+u.storeName+" (key, value) VALUES (?, ?)",[t,e],function(){i(a)},function(t,e){s(e)})},function(e){if(e.code===e.QUOTA_ERR){if(n>0)return void i(It.apply(o,[t,a,r,n-1]));s(e)}})})}).catch(s)});return l(i,r),i}function St(t,e,r){return It.apply(this,[t,e,r,1])}function Ot(t,e){var r=this;t=h(t);var n=new c(function(e,n){r.ready().then(function(){var o=r._dbInfo;o.db.transaction(function(r){_t(r,o,"DELETE FROM "+o.storeName+" WHERE key = ?",[t],function(){e()},function(t,e){n(e)})})}).catch(n)});return l(n,e),n}function At(t){var e=this,r=new c(function(t,r){e.ready().then(function(){var n=e._dbInfo;n.db.transaction(function(e){_t(e,n,"DELETE FROM "+n.storeName,[],function(){t()},function(t,e){r(e)})})}).catch(r)});return l(r,t),r}function xt(t){var e=this,r=new c(function(t,r){e.ready().then(function(){var n=e._dbInfo;n.db.transaction(function(e){_t(e,n,"SELECT COUNT(key) as c FROM "+n.storeName,[],function(e,r){var n=r.rows.item(0).c;t(n)},function(t,e){r(e)})})}).catch(r)});return l(r,t),r}function Et(t,e){var r=this,n=new c(function(e,n){r.ready().then(function(){var o=r._dbInfo;o.db.transaction(function(r){_t(r,o,"SELECT key FROM "+o.storeName+" WHERE id = ? LIMIT 1",[t+1],function(t,r){var n=r.rows.length?r.rows.item(0).key:null;e(n)},function(t,e){n(e)})})}).catch(n)});return l(n,e),n}function Nt(t){var e=this,r=new c(function(t,r){e.ready().then(function(){var n=e._dbInfo;n.db.transaction(function(e){_t(e,n,"SELECT key FROM "+n.storeName,[],function(e,r){for(var n=[],o=0;o<r.rows.length;o++)n.push(r.rows.item(o).key);t(n)},function(t,e){r(e)})})}).catch(r)});return l(r,t),r}function kt(t){return new c(function(e,r){t.transaction(function(n){n.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(r,n){for(var o=[],i=0;i<n.rows.length;i++)o.push(n.rows.item(i).name);e({db:t,storeNames:o})},function(t,e){r(e)})},function(t){r(t)})})}function Bt(t,e){e=d.apply(this,arguments);var r=this.config();(t="function"!=typeof t&&t||{}).name||(t.name=t.name||r.name,t.storeName=t.storeName||r.storeName);var n,o=this;return l(n=t.name?new c(function(e){var n;n=t.name===r.name?o._dbInfo.db:openDatabase(t.name,"","",0),t.storeName?e({db:n,storeNames:[t.storeName]}):e(kt(n))}).then(function(t){return new c(function(e,r){t.db.transaction(function(n){function o(t){return new c(function(e,r){n.executeSql("DROP TABLE IF EXISTS "+t,[],function(){e()},function(t,e){r(e)})})}for(var i=[],s=0,a=t.storeNames.length;s<a;s++)i.push(o(t.storeNames[s]));c.all(i).then(function(){e()}).catch(function(t){r(t)})},function(t){r(t)})})}):c.reject("Invalid arguments"),e),n}var Rt={_driver:"webSQLStorage",_initStorage:mt,_support:G(),iterate:jt,getItem:wt,setItem:St,removeItem:Ot,clear:At,length:xt,key:Et,keys:Nt,dropInstance:Bt};function Pt(){try{return"undefined"!=typeof localStorage&&"setItem"in localStorage&&!!localStorage.setItem}catch(t){return!1}}function zt(t,e){var r=t.name+"/";return t.storeName!==e.storeName&&(r+=t.storeName+"/"),r}function Dt(){var t="_localforage_support_test";try{return localStorage.setItem(t,!0),localStorage.removeItem(t),!1}catch(t){return!0}}function Tt(){return!Dt()||localStorage.length>0}function Ct(t){var e=this,r={};if(t)for(var n in t)r[n]=t[n];return r.keyPrefix=zt(t,e._defaultConfig),Tt()?(e._dbInfo=r,r.serializer=bt,c.resolve()):c.reject()}function Mt(t){var e=this,r=e.ready().then(function(){for(var t=e._dbInfo.keyPrefix,r=localStorage.length-1;r>=0;r--){var n=localStorage.key(r);0===n.indexOf(t)&&localStorage.removeItem(n)}});return l(r,t),r}function Ft(t,e){var r=this;t=h(t);var n=r.ready().then(function(){var e=r._dbInfo,n=localStorage.getItem(e.keyPrefix+t);return n&&(n=e.serializer.deserialize(n)),n});return l(n,e),n}function Ut(t,e){var r=this,n=r.ready().then(function(){for(var e=r._dbInfo,n=e.keyPrefix,o=n.length,i=localStorage.length,s=1,a=0;a<i;a++){var u=localStorage.key(a);if(0===u.indexOf(n)){var c=localStorage.getItem(u);if(c&&(c=e.serializer.deserialize(c)),void 0!==(c=t(c,u.substring(o),s++)))return c}}});return l(n,e),n}function Lt(t,e){var r=this,n=r.ready().then(function(){var e,n=r._dbInfo;try{e=localStorage.key(t)}catch(t){e=null}return e&&(e=e.substring(n.keyPrefix.length)),e});return l(n,e),n}function qt(t){var e=this,r=e.ready().then(function(){for(var t=e._dbInfo,r=localStorage.length,n=[],o=0;o<r;o++){var i=localStorage.key(o);0===i.indexOf(t.keyPrefix)&&n.push(i.substring(t.keyPrefix.length))}return n});return l(r,t),r}function Wt(t){var e=this.keys().then(function(t){return t.length});return l(e,t),e}function Jt(t,e){var r=this;t=h(t);var n=r.ready().then(function(){var e=r._dbInfo;localStorage.removeItem(e.keyPrefix+t)});return l(n,e),n}function Kt(t,e,r){var n=this;t=h(t);var o=n.ready().then(function(){void 0===e&&(e=null);var r=e;return new c(function(o,i){var s=n._dbInfo;s.serializer.serialize(e,function(e,n){if(n)i(n);else try{localStorage.setItem(s.keyPrefix+t,e),o(r)}catch(t){"QuotaExceededError"!==t.name&&"NS_ERROR_DOM_QUOTA_REACHED"!==t.name||i(t),i(t)}})})});return l(o,r),o}function Vt(t,e){if(e=d.apply(this,arguments),!(t="function"!=typeof t&&t||{}).name){var r=this.config();t.name=t.name||r.name,t.storeName=t.storeName||r.storeName}var n,o=this;return n=t.name?new c(function(e){t.storeName?e(zt(t,o._defaultConfig)):e(t.name+"/")}).then(function(t){for(var e=localStorage.length-1;e>=0;e--){var r=localStorage.key(e);0===r.indexOf(t)&&localStorage.removeItem(r)}}):c.reject("Invalid arguments"),l(n,e),n}var Qt={_driver:"localStorageWrapper",_initStorage:Ct,_support:Pt(),iterate:Ut,getItem:Ft,setItem:Kt,removeItem:Jt,clear:Mt,length:Wt,key:Lt,keys:qt,dropInstance:Vt},Gt=function(t,e){return t===e||"number"==typeof t&&"number"==typeof e&&isNaN(t)&&isNaN(e)},Ht=function(t,e){for(var r=t.length,n=0;n<r;){if(Gt(t[n],e))return!0;n++}return!1},$t=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},Xt={},Yt={},Zt={INDEXEDDB:Q,WEBSQL:Rt,LOCALSTORAGE:Qt},te=[Zt.INDEXEDDB._driver,Zt.WEBSQL._driver,Zt.LOCALSTORAGE._driver],ee=["dropInstance"],re=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(ee),ne={description:"",driver:te.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function oe(t,e){t[e]=function(){var r=arguments;return t.ready().then(function(){return t[e].apply(t,r)})}}function ie(){for(var t=1;t<arguments.length;t++){var e=arguments[t];if(e)for(var r in e)e.hasOwnProperty(r)&&($t(e[r])?arguments[0][r]=e[r].slice():arguments[0][r]=e[r])}return arguments[0]}var se=function(){function t(e){for(var r in o(this,t),Zt)if(Zt.hasOwnProperty(r)){var n=Zt[r],i=n._driver;this[r]=i,Xt[i]||this.defineDriver(n)}this._defaultConfig=ie({},ne),this._config=ie({},this._defaultConfig,e),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return t.prototype.config=function(t){if("object"===(void 0===t?"undefined":n(t))){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var e in t){if("storeName"===e&&(t[e]=t[e].replace(/\W/g,"_")),"version"===e&&"number"!=typeof t[e])return new Error("Database version must be a number.");this._config[e]=t[e]}return!("driver"in t)||!t.driver||this.setDriver(this._config.driver)}return"string"==typeof t?this._config[t]:this._config},t.prototype.defineDriver=function(t,e,r){var n=new c(function(e,r){try{var n=t._driver,o=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!t._driver)return void r(o);for(var i=re.concat("_initStorage"),s=0,a=i.length;s<a;s++){var u=i[s];if((!Ht(ee,u)||t[u])&&"function"!=typeof t[u])return void r(o)}var f=function(){for(var e=function(t){return function(){var e=new Error("Method "+t+" is not implemented by the current driver"),r=c.reject(e);return l(r,arguments[arguments.length-1]),r}},r=0,n=ee.length;r<n;r++){var o=ee[r];t[o]||(t[o]=e(o))}};f();var h=function(r){Xt[n]&&console.info("Redefining LocalForage driver: "+n),Xt[n]=t,Yt[n]=r,e()};"_support"in t?t._support&&"function"==typeof t._support?t._support().then(h,r):h(!!t._support):h(!0)}catch(t){r(t)}});return f(n,e,r),n},t.prototype.driver=function(){return this._driver||null},t.prototype.getDriver=function(t,e,r){var n=Xt[t]?c.resolve(Xt[t]):c.reject(new Error("Driver not found."));return f(n,e,r),n},t.prototype.getSerializer=function(t){var e=c.resolve(bt);return f(e,t),e},t.prototype.ready=function(t){var e=this,r=e._driverSet.then(function(){return null===e._ready&&(e._ready=e._initDriver()),e._ready});return f(r,t,t),r},t.prototype.setDriver=function(t,e,r){var n=this;$t(t)||(t=[t]);var o=this._getSupportedDrivers(t);function i(){n._config.driver=n.driver()}function s(t){return n._extend(t),i(),n._ready=n._initStorage(n._config),n._ready}function a(t){return function(){var e=0;function r(){for(;e<t.length;){var o=t[e];return e++,n._dbInfo=null,n._ready=null,n.getDriver(o).then(s).catch(r)}i();var a=new Error("No available storage method found.");return n._driverSet=c.reject(a),n._driverSet}return r()}}var u=null!==this._driverSet?this._driverSet.catch(function(){return c.resolve()}):c.resolve();return this._driverSet=u.then(function(){var t=o[0];return n._dbInfo=null,n._ready=null,n.getDriver(t).then(function(t){n._driver=t._driver,i(),n._wrapLibraryMethodsWithReady(),n._initDriver=a(o)})}).catch(function(){i();var t=new Error("No available storage method found.");return n._driverSet=c.reject(t),n._driverSet}),f(this._driverSet,e,r),this._driverSet},t.prototype.supports=function(t){return!!Yt[t]},t.prototype._extend=function(t){ie(this,t)},t.prototype._getSupportedDrivers=function(t){for(var e=[],r=0,n=t.length;r<n;r++){var o=t[r];this.supports(o)&&e.push(o)}return e},t.prototype._wrapLibraryMethodsWithReady=function(){for(var t=0,e=re.length;t<e;t++)oe(this,re[t])},t.prototype.createInstance=function(e){return new t(e)},t}(),ae=new se;e.exports=ae},{3:3}]},{},[4])(4)}(mr)),mr.exports}var wr=yr(_r());function jr(t,e,r){(void 0!==r&&!de(t[e],r)||void 0===r&&!(e in t))&&Oe(t,e,r)}var Ir=function(t,e,r){for(var n=-1,o=Object(t),i=r(t),s=i.length;s--;){var a=i[++n];if(!1===e(o[a],a,o))break}return t};var Sr=Function.prototype,Or=Object.prototype,Ar=Sr.toString,xr=Or.hasOwnProperty,Er=Ar.call(Object);function Nr(t){if(!H(t)||"[object Object]"!=b(t))return!1;var e=We(t);if(null===e)return!0;var r=xr.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&Ar.call(r)==Er}function kr(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}function Br(t,e,r,n,o,i,s){var a=kr(t,r),u=kr(e,r),c=s.get(u);if(c)jr(t,r,c);else{var l,f=i?i(a,u,r+"",t,e,s):void 0,h=void 0===f;if(h){var d=et(u),v=!d&&at(u),p=!d&&!v&&pt(u);f=u,d||v||p?et(a)?f=a:H(l=a)&&nt(l)?f=Ce(a):v?(h=!1,f=Te(u,!0)):p?(h=!1,f=tr(u,!0)):f=[]:Nr(u)||tt(u)?(f=a,tt(a)?f=function(t){return Ee(t,Be(t))}(a):g(a)&&!m(a)||(f=or(u))):h=!1}h&&(s.set(u,f),o(f,u,n,i,s),s.delete(u)),jr(t,r,f)}}function Rr(t,e,r,n,o){t!==e&&Ir(e,function(i,s){if(o||(o=new Ie),g(i))Br(t,e,s,r,Rr,n,o);else{var a=n?n(kr(t,s),i,s+"",t,e,o):void 0;void 0===a&&(a=i),jr(t,s,a)}},Be)}function Pr(t){return t}var zr=Math.max;function Dr(t,e,r){return e=zr(void 0===e?t.length-1:e,0),function(){for(var n=arguments,o=-1,i=zr(n.length-e,0),s=Array(i);++o<i;)s[o]=n[e+o];o=-1;for(var a=Array(e+1);++o<e;)a[o]=n[o];return a[e]=r(s),function(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}(t,this,a)}}function Tr(t){return function(){return t}}var Cr=Se?function(t,e){return Se(t,"toString",{configurable:!0,enumerable:!1,value:Tr(e),writable:!0})}:Pr,Mr=Date.now;var Fr,Ur,Lr,qr=(Fr=Cr,Ur=0,Lr=0,function(){var t=Mr(),e=16-(t-Lr);if(Lr=t,e>0){if(++Ur>=800)return arguments[0]}else Ur=0;return Fr.apply(void 0,arguments)});function Wr(t,e){return qr(Dr(t,e,Pr),t+"")}function Jr(t,e,r){if(!g(r))return!1;var n=typeof e;return!!("number"==n?nt(r)&&mt(e,r.length):"string"==n&&e in r)&&de(r[e],t)}function Kr(t){return Wr(function(e,r){var n=-1,o=r.length,i=o>1?r[o-1]:void 0,s=o>2?r[2]:void 0;for(i=t.length>3&&"function"==typeof i?(o--,i):void 0,s&&Jr(r[0],r[1],s)&&(i=o<3?void 0:i,o=1),e=Object(e);++n<o;){var a=r[n];a&&t(e,a,n,i)}return e})}var Vr=Kr(function(t,e,r){Rr(t,e,r)}),Qr=Kr(function(t,e,r,n){Rr(t,e,r,n)});function Gr(){let t,e=()=>{},r=()=>{};if("function"==typeof Promise.withResolvers){const{promise:n,resolve:o,reject:i}=Promise.withResolvers();t=n,e=o,r=i}else t=new Promise((t,n)=>{e=t,r=n});return Object.assign(t,{isResolved:!1,isPending:!0,isRejected:!1,resolve:e,reject:r}),t.then(e=>(t.isResolved=!0,t.isPending=!1,t.isRejected=!1,e),e=>{throw t.isResolved=!1,t.isPending=!1,t.isRejected=!0,e}),t}const Hr=Math.max,$r=Math.min;function Xr(t){if("number"==typeof t)return t;if("string"==typeof t){const e=parseFloat(t);return isNaN(e)?0:e}return 0}function Yr(t,e,r={}){let n,o,i,s,a,u,c=0,l=!1,f=r.promise?Gr():null;if("function"!=typeof t)throw new TypeError("Expected a function");function h(e){const i=n,a=o,u=f;return n=o=void 0,c=e,s=t.apply(a,i),r.promise&&(u.resolve(s),f=Gr()),r.promise?u:s}function d(t){const r=t-u;return void 0===u||r>=e||r<0||l&&t-c>=i}function v(){const t=Date.now();if(d(t))return p(t);a=setTimeout(v,function(t){const r=e-(t-u);return l?$r(r,i-(t-c)):r}(t))}function p(t){return a=void 0,n?h(t):(n=o=void 0,r.promise?f:s)}function y(t,e){if(Array.isArray(t)&&Array.isArray(e))return r?.dedupeArrays?t.concat(e.filter(e=>-1===t.indexOf(e))):t.concat(e)}function b(){const t=Date.now(),i=d(t);var p;if(p=Array.from(arguments),n=n?.length?p.length?r?.concatArrays||r?.dedupeArrays?Qr(n,p,y):Vr(n,p):n:p||[],o=this,u=t,i){if(void 0===a)return function(t){return c=t,a=setTimeout(v,e),r.promise?f:s}(u);if(l)return clearTimeout(a),a=setTimeout(v,e),h(u)}return void 0===a&&(a=setTimeout(v,e)),r.promise?f:s}return e=Xr(e)||0,function(t){const e=typeof t;return null!=t&&("object"===e||"function"===e)}(r)&&(l="maxWait"in r,i=l?Hr(Xr(r.maxWait)||0,e):i),b.cancel=function(){void 0!==a&&clearTimeout(a),c=0,n=u=o=a=void 0},b.flush=function(){return void 0===a?s:p(Date.now())},b}function Zr(t,e){e&&t.then(function(t){e(null,t)},function(t){e(t)})}function tn(){if(arguments.length&&"function"==typeof arguments[arguments.length-1])return arguments[arguments.length-1]}function en(t){return"string"!=typeof t&&(console.warn(`${t} used as a key, but it is not a string.`),t=String(t)),t}var rn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",nn=/^~~local_forage_type~([^~]+)~/,on="__lfsc__:",sn="arbf",an="blob",un="si08",cn="ui08",ln="uic8",fn="si16",hn="si32",dn="ur16",vn="ui32",pn="fl32",yn="fl64",bn=Object.prototype.toString;function gn(t){var e,r=new Uint8Array(t),n="";for(e=0;e<r.length;e+=3)n+=rn[r[e]>>2],n+=rn[(3&r[e])<<4|r[e+1]>>4],n+=rn[(15&r[e+1])<<2|r[e+2]>>6],n+=rn[63&r[e+2]];return r.length%3==2?n=n.substring(0,n.length-1)+"=":r.length%3==1&&(n=n.substring(0,n.length-2)+"=="),n}function mn(t,e){let r=t.name+"/";return t.storeName!==e.storeName&&(r+=t.storeName+"/"),r}const _n={keyPrefix:"",serializer:{serialize:function(t,e){var r="";if(t&&(r=bn.call(t)),t&&("[object ArrayBuffer]"===r||t.buffer&&"[object ArrayBuffer]"===bn.call(t.buffer))){var n,o=on;t instanceof ArrayBuffer?(n=t,o+=sn):(n=t.buffer,"[object Int8Array]"===r?o+=un:"[object Uint8Array]"===r?o+=cn:"[object Uint8ClampedArray]"===r?o+=ln:"[object Int16Array]"===r?o+=fn:"[object Uint16Array]"===r?o+=dn:"[object Int32Array]"===r?o+=hn:"[object Uint32Array]"===r?o+=vn:"[object Float32Array]"===r?o+=pn:"[object Float64Array]"===r?o+=yn:e(new Error("Failed to get type for BinaryArray"))),e(o+gn(n))}else if("[object Blob]"===r){var i=new FileReader;i.onload=function(){var r="~~local_forage_type~"+t.type+"~"+gn(this.result);e(on+an+r)},i.readAsArrayBuffer(t)}else try{e(JSON.stringify(t))}catch(r){console.error("Couldn't convert value into a JSON string: ",t),e(null,r)}},deserialize:function(t){if(t.substring(0,9)!==on)return JSON.parse(t);var e,r=t.substring(13),n=t.substring(9,13);if(n===an&&nn.test(r)){var o=r.match(nn);e=o[1],r=r.substring(o[0].length)}var i=function(t){var e,r,n,o,i,s=.75*t.length,a=t.length,u=0;"="===t[t.length-1]&&(s--,"="===t[t.length-2]&&s--);var c=new ArrayBuffer(s),l=new Uint8Array(c);for(e=0;e<a;e+=4)r=rn.indexOf(t[e]),n=rn.indexOf(t[e+1]),o=rn.indexOf(t[e+2]),i=rn.indexOf(t[e+3]),l[u++]=r<<2|n>>4,l[u++]=(15&n)<<4|o>>2,l[u++]=(3&o)<<6|63&i;return c}(r);switch(n){case sn:return i;case an:return function(t,e){t=t||[],e=e||{};try{return new Blob(t,e)}catch(o){if("TypeError"!==o.name)throw o;for(var r=new("undefined"!=typeof BlobBuilder?BlobBuilder:"undefined"!=typeof MSBlobBuilder?MSBlobBuilder:"undefined"!=typeof MozBlobBuilder?MozBlobBuilder:WebKitBlobBuilder),n=0;n<t.length;n+=1)r.append(t[n]);return r.getBlob(e.type)}}([i],{type:e});case un:return new Int8Array(i);case cn:return new Uint8Array(i);case ln:return new Uint8ClampedArray(i);case fn:return new Int16Array(i);case dn:return new Uint16Array(i);case hn:return new Int32Array(i);case vn:return new Uint32Array(i);case pn:return new Float32Array(i);case yn:return new Float64Array(i);default:throw new Error("Unkown type: "+n)}}}};const wn={_driver:"sessionStorageWrapper",_initStorage:function(t){if(_n.keyPrefix=mn(t,this._defaultConfig),t)for(const e in t)_n[e]=t[e]},_support:function(){try{if(sessionStorage&&"setItem"in sessionStorage)return!0}catch(t){console.log(t)}return!1}(),iterate:function(t,e){const r=this.ready().then(function(){const e=_n.keyPrefix,r=e.length,n=sessionStorage.length;let o=1;for(let i=0;i<n;i++){const n=sessionStorage.key(i);if(!n||0!==n.indexOf(e))continue;const s=sessionStorage.getItem(n),a=s?_n.serializer.deserialize(s):s,u=t(a,n.substring(r),o++);if(void 0!==u)return u}});return Zr(r,e),r},getItem:function(t,e){t=en(t);const r=this.ready().then(function(){const e=sessionStorage.getItem(_n.keyPrefix+t);return e?_n.serializer.deserialize(e):null});return Zr(r,e),r},setItem:async function(t,e,r){t=en(t),await this.ready();const n=e=e??null;return new Promise((o,i)=>{_n.serializer.serialize(e,(e,s)=>{if(s)return i(s),void Zr(Promise.reject(s),r);try{sessionStorage.setItem(_n.keyPrefix+t,e),o(n),Zr(Promise.resolve(n),r)}catch(t){"QuotaExceededError"!==t.name&&"NS_ERROR_DOM_QUOTA_REACHED"!==t.name||console.error("Your sessionStorage capacity is used up."),i(t),Zr(Promise.reject(t),r)}})})},removeItem:function(t,e){t=en(t);const r=this.ready().then(function(){sessionStorage.removeItem(_n.keyPrefix+t)});return Zr(r,e),r},clear:function(t){const e=this.ready().then(function(){const t=_n.keyPrefix;for(let e=sessionStorage.length-1;e>=0;e--){const r=sessionStorage.key(e);r&&0===r.indexOf(t)&&sessionStorage.removeItem(r)}});return Zr(e,t),e},length:function(t){const e=this.keys().then(function(t){return t.length});return Zr(e,t),e},key:function(t,e){const r=this.ready().then(function(){let e;try{e=sessionStorage.key(t)}catch(t){e=null}return e&&(e=e.substring(_n.keyPrefix.length)),e});return Zr(r,e),r},keys:function(t){const e=this.ready().then(function(){const t=sessionStorage.length,e=[];for(let r=0;r<t;r++){const t=sessionStorage.key(r);t&&0===t.indexOf(_n.keyPrefix)&&e.push(t.substring(_n.keyPrefix.length))}return e});return Zr(e,t),e},dropInstance:function(t,e){if(e=tn.apply(this,arguments),!(t="function"!=typeof t&&t||{}).name){const e=this.config();t.name=t.name||e.name,t.storeName=t.storeName||e.storeName}const r=this;let n;return n=t.name?new Promise(function(e){t.storeName?e(mn(t,r._defaultConfig)):e(`${t.name}/`)}).then(function(t){for(let e=sessionStorage.length-1;e>=0;e--){const r=sessionStorage.key(e);r&&0===r.indexOf(t)&&sessionStorage.removeItem(r)}}):Promise.reject(new Error("Invalid arguments")),Zr(n,e),n}};var jn,In={exports:{}};var Sn=(jn||(jn=1,function(t,e){!function(t,e){function r(t){return r.result?r.result:t&&"function"==typeof t.getSerializer?(r.result=t.getSerializer(),r.result):Promise.reject(new Error("localforage.getSerializer() was not available! localforage v1.4+ is required!"))}function n(t,e){e&&t.then(function(t){e(null,t)},function(t){e(t)})}function o(t,e,r,n){function o(t,e){var r=t||e;return t&&"function"==typeof t||"string"!=typeof r||(t=function(t){return t[r]}),t}var i=[];if("[object Array]"===Object.prototype.toString.call(t)){e=o(e,"key"),r=o(r,"value");for(var s=0,a=t.length;s<a;s++){var u=t[s];i.push(n(e(u),r(u)))}}else for(var c in t)t.hasOwnProperty(c)&&i.push(n(c,t[c]));return i}function i(t,e,r,i){var s=this,a=s.ready().then(function(){return new Promise(function(n,i){var a,u=s._dbInfo,c=u.db.transaction(u.storeName,"readwrite"),l=c.objectStore(u.storeName);function f(t){var e=t.target||this;a=e.error||e.transaction.error,i(a)}c.oncomplete=function(){n(t)},c.onabort=c.onerror=function(t){i(a||t.target)},o(t,e,r,function(t,e){null===e&&(e=void 0),l.put(e,t).onerror=f})})});return n(a,i),a}function s(t,e,i,s){var a=this,u=new Promise(function(n,s){a.ready().then(function(){return r(a)}).then(function(r){var u=a._dbInfo;u.db.transaction(function(a){var c="INSERT OR REPLACE INTO "+u.storeName+" (key, value) VALUES (?, ?)",l=o(t,e,i,function(t,e){return new Promise(function(n,o){r.serialize(e,function(e,r){r?o(r):a.executeSql(c,[t,e],function(){n()},function(t,e){o(e)})})})});Promise.all(l).then(function(){n(t)},s)},function(t){s(t)})}).catch(s)});return n(u,s),u}function a(t,e,r,i){var s=this,a=o(t,e,r,function(t,e){return s.setItem(t,e)}),u=Promise.all(a);return n(u,i),u}function u(t,e,r,n){var o=this,u=o.driver();return u===o.INDEXEDDB?i.call(o,t,e,r,n):u===o.WEBSQL?s.call(o,t,e,r,n):a.call(o,t,e,r,n)}function c(t){var e=Object.getPrototypeOf(t);e&&(e.setItems=u,e.setItems.indexedDB=function(){return i.apply(this,arguments)},e.setItems.websql=function(){return s.apply(this,arguments)},e.setItems.generic=function(){return a.apply(this,arguments)})}var l=c(e="default"in e?e.default:e);t.setItemsGeneric=a,t.localforageSetItems=u,t.extendPrototype=c,t.extendPrototypeResult=l,Object.defineProperty(t,"__esModule",{value:!0})}(e,_r())}(0,In.exports)),In.exports);function On(t){return On.result?On.result:t&&"function"==typeof t.getSerializer?(On.result=t.getSerializer(),On.result):Promise.reject(new Error("localforage.getSerializer() was not available! localforage v1.4+ is required!"))}function An(t,e){return e&&t.then(function(t){e(null,t)},function(t){e(t)}),t}function xn(t,e){var r=this.getItem(t).then(function(e){return{key:t,value:e}});return An(r,e),r}function En(t){var e=this,r=new Promise(function(r,n){for(var o=[],i=0,s=t.length;i<s;i++)o.push(xn.call(e,t[i]));Promise.all(o).then(function(t){for(var e={},n=0,o=t.length;n<o;n++){var i=t[n];e[i.key]=i.value}r(e)}).catch(n)});return r}function Nn(){var t={};return this.iterate(function(e,r){t[r]=e}).then(function(){return t})}var kn="undefined"!=typeof IDBKeyRange?IDBKeyRange:"undefined"!=typeof webkitIDBKeyRange?webkitIDBKeyRange:"undefined"!=typeof mozIDBKeyRange?mozIDBKeyRange:void 0;function Bn(t){t=t.slice();var e=this;function r(t,e){return t<e?-1:t>e?1:0}var n=new Promise(function(n,o){e.ready().then(function(){var i,s=e._dbInfo,a=s.db.transaction(s.storeName,"readonly").objectStore(s.storeName),u=t.sort(r),c=kn.bound(t[0],t[t.length-1],!1,!1);if("getAll"in a)(i=a.getAll(c)).onsuccess=function(){var t=i.result;void 0===t&&(t=null),n(t)};else{i=a.openCursor(c);var l={},f=0;i.onsuccess=function(){var t=i.result;if(t){for(var e=t.key;e>u[f];)if(++f===u.length)return void n(l);if(e===u[f]){var r=t.value;void 0===r&&(r=null),l[e]=r,t.continue()}else t.continue(u[f])}else n(l)}}i.onerror=function(){o(i.error)}}).catch(o)});return n}function Rn(t){var e=this,r=new Promise(function(r,n){e.ready().then(function(){return On(e)}).then(function(o){var i=e._dbInfo;i.db.transaction(function(e){for(var s=new Array(t.length),a=0,u=t.length;a<u;a++)s[a]="?";e.executeSql("SELECT * FROM "+i.storeName+" WHERE (key IN ("+s.join(",")+"))",t,function(t,e){for(var n={},i=e.rows,s=0,a=i.length;s<a;s++){var u=i.item(s),c=u.value;c&&(c=o.deserialize(c)),n[u.key]=c}r(n)},function(t,e){n(e)})})}).catch(n)});return r}function Pn(t,e){var r,n=this;if(arguments.length&&null!==t){var o=n.driver();r=o===n.INDEXEDDB?Bn.apply(n,arguments):o===n.WEBSQL?Rn.apply(n,arguments):En.apply(n,arguments)}else r=Nn.apply(n);return An(r,e),r}function zn(t){var e=Object.getPrototypeOf(t);e&&(e.getItems=Pn,e.getItems.indexedDB=function(){return Bn.apply(this,arguments)},e.getItems.websql=function(){return Rn.apply(this,arguments)},e.getItems.generic=function(){return En.apply(this,arguments)})}zn(wr);var Dn=Object.prototype.hasOwnProperty;function Tn(t,e){return null!=t&&Dn.call(t,e)}var Cn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Mn=/^\w*$/;function Fn(t,e){if(et(t))return!1;var r=typeof t;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=t&&!St(t))||(Mn.test(t)||!Cn.test(t)||null!=e&&t in Object(e))}function Un(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var r=function(){var n=arguments,o=e?e.apply(this,n):n[0],i=r.cache;if(i.has(o))return i.get(o);var s=t.apply(this,n);return r.cache=i.set(o,s)||i,s};return r.cache=new(Un.Cache||je),r}Un.Cache=je;var Ln=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,qn=/\\(\\)?/g,Wn=function(t){var e=Un(t,function(t){return 500===r.size&&r.clear(),t}),r=e.cache;return e}(function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(Ln,function(t,r,n,o){e.push(n?o.replace(qn,"$1"):r||t)}),e});function Jn(t,e){return et(t)?t:Fn(t,e)?[t]:Wn(Et(t))}function Kn(t){if("string"==typeof t||St(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function Vn(t,e,r){for(var n=-1,o=(e=Jn(e,t)).length,i=!1;++n<o;){var s=Kn(e[n]);if(!(i=null!=t&&r(t,s)))break;t=t[s]}return i||++n!=o?i:!!(o=null==t?0:t.length)&&rt(o)&&mt(s,o)&&(et(t)||tt(t))}function Qn(t,e,r){var n=-1,o=(e=Jn(e,t)).length;for(o||(o=1,t=void 0);++n<o;){var i=null==t?void 0:t[Kn(e[n])];void 0===i&&(n=o,i=r),t=m(i)?i.call(t):i}return t}function Gn(){return(65536*(1+Math.random())|0).toString(16).substring(1)}function Hn(){const t={isResolved:!1,isPending:!0,isRejected:!1,resolve:null,reject:null},e=new Promise((e,r)=>{t.resolve=e,t.reject=r});return Object.assign(e,t),e.then(function(t){return e.isResolved=!0,e.isPending=!1,e.isRejected=!1,t},function(t){throw e.isResolved=!1,e.isPending=!1,e.isRejected=!0,t}),e}function $n(){throw new Error('A "url" property or function must be specified')}function Xn(t,e){const r=e.error;e.error=function(n){r&&r.call(e.context,t,n,e),t.trigger("error",t,n,e)}}const Yn={create:"POST",update:"PUT",patch:"PATCH",delete:"DELETE",read:"GET"};function Zn(t){const e=Qn(t,"browserStorage")||Qn(t.collection,"browserStorage");return e?e.sync():to}function to(t,e,r={}){let n=r.data;null!=n||!e||"create"!==t&&"update"!==t&&"patch"!==t||(n=r.attrs||e.toJSON());const o={method:Yn[t],body:n?JSON.stringify(n):"",headers:{"Content-Type":"application/json"},success:r.success,error:r.error},i=r.url||Qn(e,"url")||$n(),s=fetch(i,o);return r&&(r.xhr=s),e.trigger("request",e,s,{...o,xhr:s}),s}const eo=ce;wr.defineDriver(he),Sn.extendPrototype(wr),zn(wr);class ro{constructor(t,e,r=!1){if("local"===e&&!window.localStorage)throw new Error("Skeletor.storage: Environment does not support localStorage.");if("session"===e&&!window.sessionStorage)throw new Error("Skeletor.storage: Environment does not support sessionStorage.");vr(e)?this.storeInitialized=this.initStore(e,r):(this.store=e,r&&(this.store.debouncedSetItems=Yr(t=>this.store.setItems(t),50,{promise:!0})),this.storeInitialized=Promise.resolve()),this.name=t}async initStore(t,e){if("session"===t)await wr.setDriver(wn._driver);else if("local"===t)await wr.config({driver:wr.LOCALSTORAGE});else if("in_memory"===t)await wr.config({driver:eo});else if("indexed"!==t)throw new Error("Skeletor.storage: No storage type was specified");this.store=wr,e&&(this.store.debouncedSetItems=Yr(t=>this.store.setItems(t),50,{promise:!0}))}flush(){this.store.debouncedSetItems&&"function"==typeof this.store.debouncedSetItems.flush&&this.store.debouncedSetItems.flush()}async clear(){await this.store.removeItem(this.name).catch(t=>console.error(t));const t=new RegExp(`^${this.name}-`),e=(await this.store.keys()).filter(e=>t.test(e));await Promise.all(e.map(t=>this.store.removeItem(t).catch(t=>console.error(t))))}sync(){const t=this;async function e(e,r,n){let o,i,s,a;const u=r.collection;["patch","update"].includes(e)&&(a=dr(r.attributes,5)),await t.storeInitialized;try{const i=r.attributes;switch(e){case"read":o=void 0!==r.id?await t.find(r):await t.findAll();break;case"create":o=await t.create(r,n);break;case"patch":case"update":n.wait&&(r.attributes=a),s=t.update(r),n.wait&&(r.attributes=i),o=await s;break;case"delete":o=await t.destroy(r,u)}}catch(e){const r=await t.getStorageSize();i=22===e.code&&0===r?"Private browsing is unsupported":e.message}if(o){if(n&&n.success){const t="read"===e?o:null;n.success(t,n)}}else i=i||"Record Not Found",n&&n.error&&n.error(i)}return e.__name__="localSync",e}removeCollectionReference(t,e){if(!e)return;const r=e.filter(e=>e.id!==t.id).map(t=>this.getItemName(t.id));return this.store.setItem(this.name,r)}addCollectionReference(t,e){if(!e)return;const r=e.map(t=>this.getItemName(t.id)),n=this.getItemName(t.id);return r.includes(n)||r.push(n),this.store.setItem(this.name,r)}getCollectionReferenceData(t){if(!t.collection)return{};const e=t.collection.map(t=>this.getItemName(t.id)),r=this.getItemName(t.id);e.includes(r)||e.push(r);const n={};return n[this.name]=e,n}async save(t){if(this.store.setItems){const e={};return e[this.getItemName(t.id)]=t.toJSON(),Object.assign(e,this.getCollectionReferenceData(t)),this.store.debouncedSetItems?this.store.debouncedSetItems(e):this.store.setItems(e)}{const e=this.getItemName(t.id),r=await this.store.setItem(e,t.toJSON());return await this.addCollectionReference(t,t.collection),r}}create(t,e){return t.id||(t.id=Gn()+Gn()+"-"+Gn()+"-"+Gn()+"-"+Gn()+"-"+Gn()+Gn()+Gn(),t.set(t.idAttribute,t.id,e)),this.save(t)}update(t){return this.save(t)}find(t){return this.store.getItem(this.getItemName(t.id))}async findAll(){const t=await this.store.getItem(this.name);if(t?.length){const e=await this.store.getItems(t);return Object.values(e)}return[]}async destroy(t,e){return await this.flush(),await this.store.removeItem(this.getItemName(t.id)),await this.removeCollectionReference(t,e),t}async getStorageSize(){return await this.store.length()}getItemName(t){return this.name+"-"+t}}ro.sessionStorageInitialized=wr.defineDriver(wn),ro.localForage=wr;function no(t){return dr(t,4)}function oo(t,e,r,n){for(var o=-1,i=null==t?0:t.length;++o<i;){var s=t[o];e(n,s,r(s),t)}return n}function io(t,e){return t&&Ir(t,e,jt)}var so,ao=(so=io,function(t,e){if(null==t)return t;if(!nt(t))return so(t,e);for(var r=t.length,n=-1,o=Object(t);++n<r&&!1!==e(o[n],n,o););return t});function uo(t,e,r,n){return ao(t,function(t,o,i){e(n,t,r(t),i)}),n}function co(t){var e=-1,r=null==t?0:t.length;for(this.__data__=new je;++e<r;)this.add(t[e])}function lo(t,e){for(var r=-1,n=null==t?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1}function fo(t,e){return t.has(e)}co.prototype.add=co.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},co.prototype.has=function(t){return this.__data__.has(t)};function ho(t,e,r,n,o,i){var s=1&r,a=t.length,u=e.length;if(a!=u&&!(s&&u>a))return!1;var c=i.get(t),l=i.get(e);if(c&&l)return c==e&&l==t;var f=-1,h=!0,d=2&r?new co:void 0;for(i.set(t,e),i.set(e,t);++f<a;){var v=t[f],p=e[f];if(n)var y=s?n(p,v,f,e,t,i):n(v,p,f,t,e,i);if(void 0!==y){if(y)continue;h=!1;break}if(d){if(!lo(e,function(t,e){if(!fo(d,e)&&(v===t||o(v,t,r,n,i)))return d.push(e)})){h=!1;break}}else if(v!==p&&!o(v,p,r,n,i)){h=!1;break}}return i.delete(t),i.delete(e),h}function vo(t){var e=-1,r=Array(t.size);return t.forEach(function(t,n){r[++e]=[n,t]}),r}function po(t){var e=-1,r=Array(t.size);return t.forEach(function(t){r[++e]=t}),r}var yo=l?l.prototype:void 0,bo=yo?yo.valueOf:void 0;var go=Object.prototype.hasOwnProperty;var mo="[object Arguments]",_o="[object Array]",wo="[object Object]",jo=Object.prototype.hasOwnProperty;function Io(t,e,r,n,o,i){var s=et(t),a=et(e),u=s?_o:G(t),c=a?_o:G(e),l=(u=u==mo?wo:u)==wo,f=(c=c==mo?wo:c)==wo,h=u==c;if(h&&at(t)){if(!at(e))return!1;s=!0,l=!1}if(h&&!l)return i||(i=new Ie),s||pt(t)?ho(t,e,r,n,o,i):function(t,e,r,n,o,i,s){switch(r){case"[object DataView]":if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case"[object ArrayBuffer]":return!(t.byteLength!=e.byteLength||!i(new He(t),new He(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return de(+t,+e);case"[object Error]":return t.name==e.name&&t.message==e.message;case"[object RegExp]":case"[object String]":return t==e+"";case"[object Map]":var a=vo;case"[object Set]":var u=1&n;if(a||(a=po),t.size!=e.size&&!u)return!1;var c=s.get(t);if(c)return c==e;n|=2,s.set(t,e);var l=ho(a(t),a(e),n,o,i,s);return s.delete(t),l;case"[object Symbol]":if(bo)return bo.call(t)==bo.call(e)}return!1}(t,e,u,r,n,o,i);if(!(1&r)){var d=l&&jo.call(t,"__wrapped__"),v=f&&jo.call(e,"__wrapped__");if(d||v){var p=d?t.value():t,y=v?e.value():e;return i||(i=new Ie),o(p,y,r,n,i)}}return!!h&&(i||(i=new Ie),function(t,e,r,n,o,i){var s=1&r,a=Ve(t),u=a.length;if(u!=Ve(e).length&&!s)return!1;for(var c=u;c--;){var l=a[c];if(!(s?l in e:go.call(e,l)))return!1}var f=i.get(t),h=i.get(e);if(f&&h)return f==e&&h==t;var d=!0;i.set(t,e),i.set(e,t);for(var v=s;++c<u;){var p=t[l=a[c]],y=e[l];if(n)var b=s?n(y,p,l,e,t,i):n(p,y,l,t,e,i);if(!(void 0===b?p===y||o(p,y,r,n,i):b)){d=!1;break}v||(v="constructor"==l)}if(d&&!v){var g=t.constructor,m=e.constructor;g==m||!("constructor"in t)||!("constructor"in e)||"function"==typeof g&&g instanceof g&&"function"==typeof m&&m instanceof m||(d=!1)}return i.delete(t),i.delete(e),d}(t,e,r,n,o,i))}function So(t,e,r,n,o){return t===e||(null==t||null==e||!H(t)&&!H(e)?t!=t&&e!=e:Io(t,e,r,n,So,o))}function Oo(t){return t==t&&!g(t)}function Ao(t,e){return function(r){return null!=r&&(r[t]===e&&(void 0!==e||t in Object(r)))}}function xo(t){var e=function(t){for(var e=jt(t),r=e.length;r--;){var n=e[r],o=t[n];e[r]=[n,o,Oo(o)]}return e}(t);return 1==e.length&&e[0][2]?Ao(e[0][0],e[0][1]):function(r){return r===t||function(t,e,r,n){var o=r.length,i=o;if(null==t)return!i;for(t=Object(t);o--;){var s=r[o];if(s[2]?s[1]!==t[s[0]]:!(s[0]in t))return!1}for(;++o<i;){var a=(s=r[o])[0],u=t[a],c=s[1];if(s[2]){if(void 0===u&&!(a in t))return!1}else if(!So(c,u,3,n,new Ie))return!1}return!0}(r,0,e)}}function Eo(t,e){for(var r=0,n=(e=Jn(e,t)).length;null!=t&&r<n;)t=t[Kn(e[r++])];return r&&r==n?t:void 0}function No(t,e){return null!=t&&e in Object(t)}function ko(t,e){return null!=t&&Vn(t,e,No)}function Bo(t,e){return Fn(t)&&Oo(e)?Ao(Kn(t),e):function(r){var n=function(t,e,r){var n=null==t?void 0:Eo(t,e);return void 0===n?r:n}(r,t);return void 0===n&&n===e?ko(r,t):So(e,n,3)}}function Ro(t){return Fn(t)?function(t){return function(e){return null==e?void 0:e[t]}}(Kn(t)):function(t){return function(e){return Eo(e,t)}}(t)}function Po(t){return"function"==typeof t?t:null==t?Pr:"object"==typeof t?et(t)?Bo(t[0],t[1]):xo(t):Ro(t)}function zo(t,e){return function(e,r){return(et(e)?oo:uo)(e,t,Po(r),{})}}var Do=Object.prototype.hasOwnProperty,To=zo(function(t,e,r){Do.call(t,r)?++t[r]:Oe(t,r,1)}),Co=Object.prototype.hasOwnProperty,Mo=zo(function(t,e,r){Co.call(t,r)?t[r].push(e):Oe(t,r,[e])}),Fo=zo(function(t,e,r){Oe(t,r,e)}),Uo=l?l.isConcatSpreadable:void 0;function Lo(t){return et(t)||tt(t)||!!(Uo&&t&&t[Uo])}function qo(t,e,r,n,o){var i=-1,s=t.length;for(r||(r=Lo),o||(o=[]);++i<s;){var a=t[i];r(a)?qe(o,a):o[o.length]=a}return o}function Wo(t,e){if(t!==e){var r=void 0!==t,n=null===t,o=t==t,i=St(t),s=void 0!==e,a=null===e,u=e==e,c=St(e);if(!a&&!c&&!i&&t>e||i&&s&&u&&!a&&!c||n&&s&&u||!r&&u||!o)return 1;if(!n&&!i&&!c&&t<e||c&&r&&o&&!n&&!i||a&&r&&o||!s&&o||!u)return-1}return 0}function Jo(t,e,r){e=e.length?It(e,function(t){return et(t)?function(e){return Eo(e,1===t.length?t[0]:t)}:t}):[Pr];var n=-1;e=It(e,ct(Po));var o=function(t,e){var r=-1,n=nt(t)?Array(t.length):[];return ao(t,function(t,o,i){n[++r]=e(t,o,i)}),n}(t,function(t,r,o){var i=It(e,function(e){return e(t)});return{criteria:i,index:++n,value:t}});return function(t,e){var r=t.length;for(t.sort(e);r--;)t[r]=t[r].value;return t}(o,function(t,e){return function(t,e,r){for(var n=-1,o=t.criteria,i=e.criteria,s=o.length,a=r.length;++n<s;){var u=Wo(o[n],i[n]);if(u)return n>=a?u:u*("desc"==r[n]?-1:1)}return t.index-e.index}(t,e,r)})}var Ko=Wr(function(t,e){if(null==t)return[];var r=e.length;return r>1&&Jr(t,e[0],e[1])?e=[]:r>2&&Jr(e[0],e[1],e[2])&&(e=[e[0]]),Jo(t,qo(e),[])}),Vo=Object.prototype,Qo=Vo.hasOwnProperty,Go=Wr(function(t,e){t=Object(t);var r=-1,n=e.length,o=n>2?e[2]:void 0;for(o&&Jr(e[0],e[1],o)&&(n=1);++r<n;)for(var i=e[r],s=Be(i),a=-1,u=s.length;++a<u;){var c=s[a],l=t[c];(void 0===l||de(l,Vo[c])&&!Qo.call(t,c))&&(t[c]=i[c])}return t});var Ho=Wr(function(t,e){return function(t,e,r){if("function"!=typeof t)throw new TypeError("Expected a function");return setTimeout(function(){t.apply(void 0,r)},e)}(t,1,e)});var $o,Xo,Yo=Object.prototype.toString,Zo=($o=function(t,e,r){null!=e&&"function"!=typeof e.toString&&(e=Yo.call(e)),t[e]=r},Xo=Tr(Pr),function(t,e){return function(t,e,r,n){return io(t,function(t,o,i){e(n,r(t),o,i)}),n}(t,$o,Xo(e),{})});function ti(t,e){return So(t,e)}function ei(t,e){return e.length<2?t:Eo(t,function(t,e,r){var n=-1,o=t.length;e<0&&(e=-e>o?0:o+e),(r=r>o?o:r)<0&&(r+=o),o=e>r?0:r-e>>>0,e>>>=0;for(var i=Array(o);++n<o;)i[n]=t[n+e];return i}(e,0,-1))}function ri(t,e){return null==(t=ei(t,e=Jn(e,t)))||delete t[Kn(function(t){var e=null==t?0:t.length;return e?t[e-1]:void 0}(e))]}function ni(t){return Nr(t)?void 0:t}function oi(t){return(null==t?0:t.length)?qo(t):[]}function ii(t){return qr(Dr(t,void 0,oi),t+"")}var si=ii(function(t,e){var r={};if(null==t)return r;var n=!1;e=It(e,function(e){return e=Jn(e,t),n||(n=e.length>1),e}),Ee(t,Qe(t),r),n&&(r=dr(r,7,ni));for(var o=e.length;o--;)ri(r,e[o]);return r});function ai(t,e,r,n){if(!g(t))return t;for(var o=-1,i=(e=Jn(e,t)).length,s=i-1,a=t;null!=a&&++o<i;){var u=Kn(e[o]),c=r;if("__proto__"===u||"constructor"===u||"prototype"===u)return t;if(o!=s){var l=a[u];void 0===(c=void 0)&&(c=g(l)?l:mt(e[o+1])?[]:{})}xe(a,u,c),a=a[u]}return t}function ui(t,e){return function(t,e,r){for(var n=-1,o=e.length,i={};++n<o;){var s=e[n],a=Eo(t,s);r(a,s)&&ai(i,Jn(s,t),a)}return i}(t,e,function(e,r){return ko(t,r)})}var ci,li=ii(function(t,e){return null==t?{}:ui(t,e)});class fi extends Xt{constructor(t,e){super(),this._changing=!1,this._pending=!1,this._url="",this.changed={},this.validationError=null;let r=t||{};e=e||{},this.preinitialize.apply(this,arguments),this.cid=kt(this.cidPrefix),this.attributes={},e.collection&&(this.collection=e.collection),e.parse&&(r=this.parse(r,e)||{});const n=Qn(this,"defaults");r=Go(Object.assign({},n,r),n),this.set(r,e),this.initialize.apply(this,arguments),this.changed={}}set browserStorage(t){this._browserStorage=t}get browserStorage(){return this._browserStorage}get idAttribute(){return"id"}get cidPrefix(){return"c"}preinitialize(...t){}initialize(t,e){}validate(t,e){return null}defaults(){return{}}toJSON(){return no(this.attributes)}sync(t,e,r){return Zn(e)(t,e,r)}get(t){return this.attributes[t]}keys(){return Object.keys(this.attributes)}values(){return Object.values(this.attributes)}pairs(){return this.entries()}entries(){return Object.entries(this.attributes)}invert(){return Zo(this.attributes)}pick(...t){return 1===t.length&&Array.isArray(t[0])&&(t=t[0]),li(this.attributes,t)}omit(...t){return 1===t.length&&Array.isArray(t[0])&&(t=t[0]),si(this.attributes,t)}isEmpty(){return bt(this.attributes)}has(t){return null!=this.get(t)}matches(t){return!!function(t){return Po("function"==typeof t?t:dr(t,1))}(t)(this.attributes)}set(t,e,r){if(null==t)return this;let n;if("object"==typeof t?(n=t,r=e):(n={},n[t]=e),r=r||{},!this._validate(n,r))return null;const o=r.unset,i=r.silent,s=[],a=this._changing;this._changing=!0,a||(this._previousAttributes=no(this.attributes),this.changed={});const u=this.attributes,c=this.changed,l=this._previousAttributes;for(const t in n)e=n[t],ti(u[t],e)||s.push(t),ti(l[t],e)?delete c[t]:c[t]=e,o?delete u[t]:u[t]=e;if(this.idAttribute in n&&(this.id=this.get(this.idAttribute)),!i){s.length&&(this._pending=r);for(let t=0;t<s.length;t++)this.trigger("change:"+s[t],this,u[s[t]],r)}if(a)return this;if(!i)for(;this._pending;)r=this._pending,this._pending=!1,this.trigger("change",this,r);return this._pending=!1,this._changing=!1,this}unset(t,e){return this.set(t,void 0,Object.assign({},e,{unset:!0}))}clear(t){const e={};for(const t in this.attributes)e[t]=void 0;return this.set(e,Object.assign({},t,{unset:!0}))}hasChanged(t){return null==t?!bt(this.changed):(e=this.changed,r=t,null!=e&&Vn(e,r,Tn));var e,r}changedAttributes(t){if(!t)return!!this.hasChanged()&&no(this.changed);const e=this._changing?this._previousAttributes:this.attributes,r={};let n=!1;for(const o in t){const i=t[o];ti(e[o],i)||(r[o]=i,n=!0)}return!!n&&r}previous(t){return null!=t&&this._previousAttributes?this._previousAttributes[t]:null}previousAttributes(){return this._previousAttributes?no(this._previousAttributes):void 0}fetch(t={}){const e=(t=Object.assign({parse:!0},t)).success;return t.success=r=>{const n=t.parse?this.parse(r,t):r;if(!this.set(n,t))return!1;e&&e.call(t.context,this,r,t),this.trigger("sync",this,r,t)},Xn(this,t),this.sync("read",this,t)}save(t,e,r){let n;null==t||"object"==typeof t?(n=t,r=e):(n={},n[t]=e);const o=(r=Object.assign({validate:!0,parse:!0},r)).wait,i=r.promise,s=i&&Hn();if(n&&!o){if(!this.set(n,r))return!1}else if(!this._validate(n||{},r))return!1;const a=r.success,u=r.error,c=this.attributes;r.success=t=>{this.attributes=c;let e=r.parse?this.parse(t,r):t;if(o&&(e=Object.assign({},n,e)),e&&!this.set(e,r))return!1;a&&a.call(r.context,this,t,r),this.trigger("sync",this,t,r),i&&s.resolve()},r.error=(t,e,r)=>{u&&u.call(r.context,t,e,r),i&&s.reject(e)},Xn(this,r),n&&o&&(this.attributes=Object.assign({},c,n));const l=this.isNew()?"create":r.patch?"patch":"update";"patch"!==l||r.attrs||(r.attrs=n);const f=this.sync(l,this,r);return this.attributes=c,i?s:f}destroy(t){const e=(t=t?no(t):{}).success,r=t.wait,n=()=>{this.stopListening(),this.trigger("destroy",this,this.collection,t)};t.success=o=>{r&&n(),e&&e.call(t.context,this,o,t),this.isNew()||this.trigger("sync",this,o,t)};let o=!1;return this.isNew()?Ho(t.success):(Xn(this,t),o=this.sync("delete",this,t)),r||n(),o}get urlRoot(){return this._urlRoot}set urlRoot(t){this._urlRoot=t}get url(){if(this._url)return this._url;const t=Qn(this,"urlRoot")||Qn(this.collection,"url")||$n();if(this.isNew())return t;const e=this.get(this.idAttribute);return t.replace(/[^\/]$/,"$&/")+encodeURIComponent(String(e))}set url(t){this._url=t}parse(t,e){return t}isNew(){return!this.has(this.idAttribute)}isValid(t){return this._validate({},Object.assign({},t,{validate:!0}))}_validate(t,e){if(!e?.validate||!this.validate)return!0;t=Object.assign({},this.attributes,t);const r=this.validationError=this.validate(t,e)||null;return!r||(this.trigger("invalid",this,r,Object.assign(e,{validationError:r})),!1)}}const hi={add:!0,remove:!0,merge:!0},di={add:!0,remove:!1};class vi extends Xt{constructor(t,e){super(),this._url="",this[ci]=this.values,e=e||{},this.preinitialize.apply(this,arguments),e.model&&(this._model=e.model),void 0!==e.comparator&&(this.comparator=e.comparator),this._reset(),this.initialize.apply(this,arguments),t&&this.reset(t,Object.assign({silent:!0},e)),this[Symbol.iterator]=this.values}get comparator(){return this._comparator}set comparator(t){this._comparator=t}set browserStorage(t){this._browserStorage=t}get browserStorage(){return this._browserStorage}get model(){return this._model??fi}set model(t){this._model=t}get length(){return this.models.length}get url(){return this._url}set url(t){this._url=t}preinitialize(...t){}initialize(...t){}toJSON(){return this.map(function(t){return t.toJSON()})}sync(t,e,r){return Zn(this)(t,e,r)}add(t,e){return this.set(t,Object.assign({merge:!1},e,di))}remove(t,e){e=Object.assign({},e);const r=!Array.isArray(t),n=r?[t]:t.slice(),o=this._removeModels(n,e);return!e.silent&&o.length&&(e.changes={added:[],merged:[],removed:o},this.trigger("update",this,e)),r?o[0]:o}set(t,e){if(null==t)return;(e=Object.assign({},hi,e)).parse&&!this._isModel(t)&&(t=this.parse(t,e)||[]);const r=!Array.isArray(t);t=r?[t]:t.slice();let n=e.at;null!=n&&(n=+n),n>this.length&&(n=this.length),n<0&&(n+=this.length+1);const o=[],i=[],s=[],a=[],u={},c=e.add,l=e.merge,f=e.remove;let h=!1;const d=this.comparator&&null==n&&!1!==e.sort,v=vr(this.comparator)?this.comparator:null;let p,y;for(y=0;y<t.length;y++){p=t[y];const r=this.get(p);if(r){if(l&&p!==r){let t=this._isModel(p)?p.attributes:p;e.parse&&(t=r.parse(t,e)),r.set(t,e),s.push(r),d&&!h&&(h=r.hasChanged(v))}u[r.cid]||(u[r.cid]=!0,o.push(r)),t[y]=r}else c&&(p=t[y]=this._prepareModel(p,e),p&&(i.push(p),this._addReference(p,e),u[p.cid]=!0,o.push(p)))}if(f){for(y=0;y<this.length;y++)p=this.models[y],u[p.cid]||a.push(p);a.length&&this._removeModels(a,e)}let b=!1;const g=!d&&c&&f;if(o.length&&g)b=this.length!==o.length||this.models.some((t,e)=>t!==o[e]),this.models.length=0,this.models.splice(0,0,...o);else if(i.length){d&&(h=!0);let t=n??this.length;t=Math.min(Math.max(t,0),this.models.length),this.models.splice(t,0,...i)}if(h&&this.sort({silent:!0}),!e.silent){for(y=0;y<i.length;y++)null!=n&&(e.index=n+y),p=i[y],p.trigger("add",p,this,e);(h||b)&&this.trigger("sort",this,e),(i.length||a.length||s.length)&&(e.changes={added:i,removed:a,merged:s},this.trigger("update",this,e))}return r?t[0]:t}async clearStore(t={},e=()=>!0){await Promise.all(this.models.filter(e).map(e=>new Promise(r=>{e.destroy(Object.assign(t,{success:r,error:(t,e)=>{console.error(e),r()}}))}))),await(this.browserStorage?.clear()),this.reset()}reset(t,e){e=e?no(e):{};for(let t=0;t<this.models.length;t++)this._removeReference(this.models[t],e);return e.previousModels=this.models,this._reset(),t=this.add(t,Object.assign({silent:!0},e)),e.silent||this.trigger("reset",this,e),t}push(t,e){return this.add(t,Object.assign({at:this.length},e))}pop(t){const e=this.at(this.length-1);return this.remove(e,t)}unshift(t,e){return this.add(t,Object.assign({at:0},e))}shift(t){const e=this.at(0);return this.remove(e,t)}slice(t,e){return this.models.slice(t,e)}filter(t,e){return this.models.filter(m(t)?t:e=>e.matches(t),e)}every(t){return m(t)?this.models.map(t=>t.attributes).every(t):this.models.every(e=>e.matches(t))}difference(t){return this.models.filter(e=>!t.includes(e))}max(){return Math.max.apply(Math,this.models)}min(){return Math.min.apply(Math,this.models)}drop(t=1){return this.models.slice(t)}some(t){return m(t)?this.models.map(t=>t.attributes).some(t):this.models.some(e=>e.matches(t))}sortBy(t){return Ko(this.models,m(t)?t:e=>vr(t)?e.get(t):e.matches(t))}isEmpty(){return!this.models.length}keyBy(t){return Fo(this.models,t)}each(t,e){return this.forEach(t,e)}forEach(t,e){return this.models.forEach(t,e)}includes(t){return this.models.includes(t)}size(){return this.models.length}countBy(t){return To(this.models,m(t)?t:e=>vr(t)?e.get(t):e.matches(t))}groupBy(t){return Mo(this.models,m(t)?t:e=>vr(t)?e.get(t):e.matches(t))}indexOf(t,e){return this.models.indexOf(t,e)}findLastIndex(t,e){return this.models.findLastIndex(m(t)?t:e=>vr(t)?e.get(t):e.matches(t),e)}lastIndexOf(t,e){return this.models.lastIndexOf(t,e)}findIndex(t){return this.models.findIndex(m(t)?t:e=>vr(t)?e.get(t):e.matches(t))}last(){const t=null==this.models?0:this.models.length;return t?this.models[t-1]:void 0}head(){return this.models[0]}first(){return this.head()}map(t,e){return this.models.map(m(t)?t:e=>vr(t)?e.get(t):e.matches(t),e)}reduce(t,e){return this.models.reduce(t,e||this.models[0])}reduceRight(t,e){return this.models.reduceRight(t,e||this.models[0])}toArray(){return Array.from(this.models)}get(t){if(null!=t)return this._byId[t]||this._byId[this.modelId(this._isModel(t)?t.attributes:t)]||t.cid&&this._byId[t.cid]}has(t){return null!=this.get(t)}at(t){return t<0&&(t+=this.length),this.models[t]}where(t,e){return this[e?"find":"filter"](t)}findWhere(t){return this.where(t,!0)}find(t,e){const r=m(t)?t:e=>e.matches(t);return this.models.find(r,e)}sort(t){let e=this.comparator;if(!e)throw new Error("Cannot sort a set without a comparator");t=t||{};const r=m(e)?e.length:0;return m(e)&&(e=e.bind(this)),1===r||vr(e)?this.models=this.sortBy(e):this.models.sort(e),t.silent||this.trigger("sort",this,t),this}pluck(t){return this.map(t+"")}fetch(t){const e=(t=Object.assign({parse:!0},t)).success,r=this,n=t.promise&&Hn();return t.success=function(o){const i=t.reset?"reset":"set";r[i](o,t),e&&e.call(t.context,r,o,t),n&&n.resolve(),r.trigger("sync",r,o,t)},Xn(this,t),n||this.sync("read",this,t)}create(t,e){const r=(e=e?no(e):{}).wait,n=e.promise,o=n&&Hn(),i=this._prepareModel(t,e);if(!i)return!1;r||this.add(i,e);const s=this,a=e.success,u=e.error;return e.success=function(t,e,i){r&&s.add(t,i),a&&a.call(i.context,t,e,i),n&&o.resolve(t)},e.error=function(t,e,r){u&&u.call(r.context,t,e,r),n&&o.reject(e)},i.save(null,Object.assign(e,{promise:!1})),n?o:i}parse(t,e){return t}modelId(t){return t[this.model.prototype?.idAttribute||"id"]}values(){return new gi(this,pi)}keys(){return new gi(this,yi)}entries(){return new gi(this,bi)}_reset(){this.models=[],this._byId={}}createModel(t,e){return new(0,this.model)(t,e)}_prepareModel(t,e){if(this._isModel(t))return t.collection||(t.collection=this),t;(e=e?no(e):{}).collection=this;const r=this.createModel(t,e);return r.validationError?(this.trigger("invalid",this,r.validationError,e),null):r}_removeModels(t,e){const r=[];for(let n=0;n<t.length;n++){const o=this.get(t[n]);if(!o)continue;const i=this.indexOf(o);this.models.splice(i,1),delete this._byId[o.cid];const s=this.modelId(o.attributes);null!=s&&delete this._byId[s],e?.silent||((e=e||{}).index=i,o.trigger("remove",o,this,e)),r.push(o),this._removeReference(o,e)}return r}_isModel(t){return t instanceof fi}_addReference(t,e){this._byId[t.cid]=t;const r=this.modelId(t.attributes);null!=r&&(this._byId[r]=t),t.on("all",this._onModelEvent,this)}_removeReference(t,e){delete this._byId[t.cid];const r=this.modelId(t.attributes);null!=r&&delete this._byId[r],this===t.collection&&delete t.collection,t.off("all",this._onModelEvent,this)}_onModelEvent(t,e,r,n){if(e){if(("add"===t||"remove"===t)&&r!==this)return;if("destroy"===t&&this.remove(e,n),"change"===t){const t=this.modelId(e.previousAttributes()),r=this.modelId(e.attributes);t!==r&&(null!=t&&delete this._byId[t],null!=r&&(this._byId[r]=e))}}this.trigger.apply(this,arguments)}}ci=Symbol.iterator;const pi=1,yi=2,bi=3;class gi{constructor(t,e){this._collection=t,this._kind=e,this._index=0}next(){if(this._collection){if(this._index<this._collection.length){const t=this._collection.at(this._index);if(this._index++,!t)return{value:void 0,done:!0};let e;if(this._kind===pi)e=t;else{const r=this._collection.modelId(t.attributes);e=this._kind===yi?r:[r,t]}return{value:e,done:!1}}this._collection=void 0}return{value:void 0,done:!0}}[Symbol.iterator](){return this}}const mi={Collection:vi,EventEmitter:$t,Model:fi,sync:to},_i="object"==typeof self&&self.self===self&&self||"object"==typeof global&&global.global===global&&global;mi.VERSION="0.0.1";const wi=_i.Skeletor;function ji(){return _i.Skeletor=wi,this}mi.noConflict=ji,_i.Skeletor=mi,t.Collection=vi,t.EventEmitter=$t,t.Model=fi,t.Storage=ro,t.default=mi,t.noConflict=ji,t.sync=to,Object.defineProperty(t,"__esModule",{value:!0})});
79
74
  //# sourceMappingURL=skeletor.min.js.map