@converse/skeletor 0.0.8 → 0.0.9

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 (42) hide show
  1. package/README.md +38 -25
  2. package/dist/skeletor.js +9232 -5096
  3. package/dist/skeletor.js.map +1 -1
  4. package/dist/skeletor.min.js +74 -3
  5. package/dist/skeletor.min.js.map +1 -1
  6. package/package.json +21 -11
  7. package/src/collection.js +540 -395
  8. package/src/drivers/sessionStorage.js +222 -219
  9. package/src/element.js +132 -82
  10. package/src/eventemitter.js +187 -0
  11. package/src/helpers.js +143 -118
  12. package/src/{main.js → index.js} +21 -17
  13. package/src/listening.js +81 -0
  14. package/src/model.js +340 -238
  15. package/src/storage.js +222 -230
  16. package/src/types/collection.d.ts +366 -0
  17. package/src/types/collection.d.ts.map +1 -0
  18. package/src/types/drivers/sessionStorage.d.ts +37 -0
  19. package/src/types/drivers/sessionStorage.d.ts.map +1 -0
  20. package/src/types/element.d.ts +115 -0
  21. package/src/types/element.d.ts.map +1 -0
  22. package/src/types/eventemitter.d.ts +93 -0
  23. package/src/types/eventemitter.d.ts.map +1 -0
  24. package/src/types/helpers.d.ts +62 -0
  25. package/src/types/helpers.d.ts.map +1 -0
  26. package/src/types/index.d.ts +19 -0
  27. package/src/types/index.d.ts.map +1 -0
  28. package/src/types/listening.d.ts +40 -0
  29. package/src/types/listening.d.ts.map +1 -0
  30. package/src/types/model.d.ts +230 -0
  31. package/src/types/model.d.ts.map +1 -0
  32. package/src/types/storage.d.ts +35 -0
  33. package/src/types/storage.d.ts.map +1 -0
  34. package/src/types/utils/events.d.ts +28 -0
  35. package/src/types/utils/events.d.ts.map +1 -0
  36. package/src/utils/events.js +174 -0
  37. package/src/drivers/sessionStorage.js~ +0 -307
  38. package/src/events.js +0 -328
  39. package/src/history.js +0 -301
  40. package/src/overview.js +0 -191
  41. package/src/router.js +0 -119
  42. package/src/view.js +0 -267
@@ -1,8 +1,79 @@
1
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self).skeletor=e()}(this,(function(){"use strict";var t="object"==typeof global&&global&&global.Object===Object&&global,e="object"==typeof self&&self&&self.Object===Object&&self,n=t||e||Function("return this")(),r=n.Symbol,i=Object.prototype,o=i.hasOwnProperty,s=i.toString,c=r?r.toStringTag:void 0;var u=Object.prototype.toString;var a=r?r.toStringTag:void 0;function l(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":a&&a in Object(t)?function(t){var e=o.call(t,c),n=t[c];try{t[c]=void 0;var r=!0}catch(t){}var i=s.call(t);return r&&(e?t[c]=n:delete t[c]),i}(t):function(t){return u.call(t)}(t)}function h(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function f(t){if(!h(t))return!1;var e=l(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}var d,p=n["__core-js_shared__"],v=(d=/[^.]+$/.exec(p&&p.keys&&p.keys.IE_PROTO||""))?"Symbol(src)_1."+d:"";var g=Function.prototype.toString;function y(t){if(null!=t){try{return g.call(t)}catch(t){}try{return t+""}catch(t){}}return""}var b=/^\[object .+?Constructor\]$/,_=Function.prototype,m=Object.prototype,j=_.toString,A=m.hasOwnProperty,w=RegExp("^"+j.call(A).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function $(t){return!(!h(t)||(e=t,v&&v in e))&&(f(t)?w:b).test(y(t));var e}function x(t,e){var n=function(t,e){return null==t?void 0:t[e]}(t,e);return $(n)?n:void 0}var O=function(){try{var t=x(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();function E(t,e,n){"__proto__"==e&&O?O(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function S(t,e){return t===e||t!=t&&e!=e}var I=Object.prototype.hasOwnProperty;function M(t,e,n){var r=t[e];I.call(t,e)&&S(r,n)&&(void 0!==n||e in t)||E(t,e,n)}function P(t,e,n,r){var i=!n;n||(n={});for(var o=-1,s=e.length;++o<s;){var c=e[o],u=r?r(n[c],t[c],c,n,t):void 0;void 0===u&&(u=t[c]),i?E(n,c,u):M(n,c,u)}return n}function H(t){return null!=t&&"object"==typeof t}function N(t){return H(t)&&"[object Arguments]"==l(t)}var k=Object.prototype,T=k.hasOwnProperty,C=k.propertyIsEnumerable,R=N(function(){return arguments}())?N:function(t){return H(t)&&T.call(t,"callee")&&!C.call(t,"callee")},z=Array.isArray;var U="object"==typeof exports&&exports&&!exports.nodeType&&exports,L=U&&"object"==typeof module&&module&&!module.nodeType&&module,B=L&&L.exports===U?n.Buffer:void 0,F=(B?B.isBuffer:void 0)||function(){return!1},D=/^(?:0|[1-9]\d*)$/;function W(t,e){var n=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==n||"symbol"!=n&&D.test(t))&&t>-1&&t%1==0&&t<e}function V(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}var q={};function J(t){return function(e){return t(e)}}q["[object Float32Array]"]=q["[object Float64Array]"]=q["[object Int8Array]"]=q["[object Int16Array]"]=q["[object Int32Array]"]=q["[object Uint8Array]"]=q["[object Uint8ClampedArray]"]=q["[object Uint16Array]"]=q["[object Uint32Array]"]=!0,q["[object Arguments]"]=q["[object Array]"]=q["[object ArrayBuffer]"]=q["[object Boolean]"]=q["[object DataView]"]=q["[object Date]"]=q["[object Error]"]=q["[object Function]"]=q["[object Map]"]=q["[object Number]"]=q["[object Object]"]=q["[object RegExp]"]=q["[object Set]"]=q["[object String]"]=q["[object WeakMap]"]=!1;var G="object"==typeof exports&&exports&&!exports.nodeType&&exports,Z=G&&"object"==typeof module&&module&&!module.nodeType&&module,K=Z&&Z.exports===G&&t.process,Q=function(){try{var t=Z&&Z.require&&Z.require("util").types;return t||K&&K.binding&&K.binding("util")}catch(t){}}(),X=Q&&Q.isTypedArray,Y=X?J(X):function(t){return H(t)&&V(t.length)&&!!q[l(t)]},tt=Object.prototype.hasOwnProperty;function et(t,e){var n=z(t),r=!n&&R(t),i=!n&&!r&&F(t),o=!n&&!r&&!i&&Y(t),s=n||r||i||o,c=s?function(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}(t.length,String):[],u=c.length;for(var a in t)!e&&!tt.call(t,a)||s&&("length"==a||i&&("offset"==a||"parent"==a)||o&&("buffer"==a||"byteLength"==a||"byteOffset"==a)||W(a,u))||c.push(a);return c}var nt=Object.prototype;function rt(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||nt)}function it(t,e){return function(n){return t(e(n))}}var ot=it(Object.keys,Object),st=Object.prototype.hasOwnProperty;function ct(t){if(!rt(t))return ot(t);var e=[];for(var n in Object(t))st.call(t,n)&&"constructor"!=n&&e.push(n);return e}function ut(t){return null!=t&&V(t.length)&&!f(t)}function at(t){return ut(t)?et(t):ct(t)}function lt(t,e){return t&&P(e,at(e),t)}var ht=Object.create,ft=function(){function t(){}return function(e){if(!h(e))return{};if(ht)return ht(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();function dt(t){return t}function pt(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}var vt=Math.max;function gt(t,e,n){return e=vt(void 0===e?t.length-1:e,0),function(){for(var r=arguments,i=-1,o=vt(r.length-e,0),s=Array(o);++i<o;)s[i]=r[e+i];i=-1;for(var c=Array(e+1);++i<e;)c[i]=r[i];return c[e]=n(s),pt(t,this,c)}}function yt(t){return function(){return t}}var bt=O?function(t,e){return O(t,"toString",{configurable:!0,enumerable:!1,value:yt(e),writable:!0})}:dt,_t=Date.now;var mt,jt,At,wt=(mt=bt,jt=0,At=0,function(){var t=_t(),e=16-(t-At);if(At=t,e>0){if(++jt>=800)return arguments[0]}else jt=0;return mt.apply(void 0,arguments)});function $t(t,e){return wt(gt(t,e,dt),t+"")}function xt(t,e,n){if(!h(n))return!1;var r=typeof e;return!!("number"==r?ut(n)&&W(e,n.length):"string"==r&&e in n)&&S(n[e],t)}var Ot=Object.prototype.hasOwnProperty;function Et(t){if(!h(t))return function(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e}(t);var e=rt(t),n=[];for(var r in t)("constructor"!=r||!e&&Ot.call(t,r))&&n.push(r);return n}function St(t){return ut(t)?et(t,!0):Et(t)}var It,Mt=(It=function(t,e){P(e,St(e),t)},$t((function(t,e){var n=-1,r=e.length,i=r>1?e[r-1]:void 0,o=r>2?e[2]:void 0;for(i=It.length>3&&"function"==typeof i?(r--,i):void 0,o&&xt(e[0],e[1],o)&&(i=r<3?void 0:i,r=1),t=Object(t);++n<r;){var s=e[n];s&&It(t,s,n,i)}return t}))),Pt=Object.prototype.hasOwnProperty;function Ht(t,e){return null!=t&&Pt.call(t,e)}function Nt(t){return"symbol"==typeof t||H(t)&&"[object Symbol]"==l(t)}var kt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Tt=/^\w*$/;function Ct(t,e){if(z(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!Nt(t))||(Tt.test(t)||!kt.test(t)||null!=e&&t in Object(e))}var Rt=x(Object,"create");var zt=Object.prototype.hasOwnProperty;var Ut=Object.prototype.hasOwnProperty;function Lt(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Bt(t,e){for(var n=t.length;n--;)if(S(t[n][0],e))return n;return-1}Lt.prototype.clear=function(){this.__data__=Rt?Rt(null):{},this.size=0},Lt.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},Lt.prototype.get=function(t){var e=this.__data__;if(Rt){var n=e[t];return"__lodash_hash_undefined__"===n?void 0:n}return zt.call(e,t)?e[t]:void 0},Lt.prototype.has=function(t){var e=this.__data__;return Rt?void 0!==e[t]:Ut.call(e,t)},Lt.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=Rt&&void 0===e?"__lodash_hash_undefined__":e,this};var Ft=Array.prototype.splice;function Dt(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Dt.prototype.clear=function(){this.__data__=[],this.size=0},Dt.prototype.delete=function(t){var e=this.__data__,n=Bt(e,t);return!(n<0)&&(n==e.length-1?e.pop():Ft.call(e,n,1),--this.size,!0)},Dt.prototype.get=function(t){var e=this.__data__,n=Bt(e,t);return n<0?void 0:e[n][1]},Dt.prototype.has=function(t){return Bt(this.__data__,t)>-1},Dt.prototype.set=function(t,e){var n=this.__data__,r=Bt(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this};var Wt=x(n,"Map");function Vt(t,e){var n,r,i=t.__data__;return("string"==(r=typeof(n=e))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof e?"string":"hash"]:i.map}function qt(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}qt.prototype.clear=function(){this.size=0,this.__data__={hash:new Lt,map:new(Wt||Dt),string:new Lt}},qt.prototype.delete=function(t){var e=Vt(this,t).delete(t);return this.size-=e?1:0,e},qt.prototype.get=function(t){return Vt(this,t).get(t)},qt.prototype.has=function(t){return Vt(this,t).has(t)},qt.prototype.set=function(t,e){var n=Vt(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this};function Jt(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var n=function(){var r=arguments,i=e?e.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var s=t.apply(this,r);return n.cache=o.set(i,s)||o,s};return n.cache=new(Jt.Cache||qt),n}Jt.Cache=qt;var Gt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Zt=/\\(\\)?/g,Kt=function(t){var e=Jt(t,(function(t){return 500===n.size&&n.clear(),t})),n=e.cache;return e}((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(Gt,(function(t,n,r,i){e.push(r?i.replace(Zt,"$1"):n||t)})),e}));function Qt(t,e){for(var n=-1,r=null==t?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}var Xt=r?r.prototype:void 0,Yt=Xt?Xt.toString:void 0;function te(t){if("string"==typeof t)return t;if(z(t))return Qt(t,te)+"";if(Nt(t))return Yt?Yt.call(t):"";var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function ee(t){return null==t?"":te(t)}function ne(t,e){return z(t)?t:Ct(t,e)?[t]:Kt(ee(t))}function re(t){if("string"==typeof t||Nt(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function ie(t,e,n){for(var r=-1,i=(e=ne(e,t)).length,o=!1;++r<i;){var s=re(e[r]);if(!(o=null!=t&&n(t,s)))break;t=t[s]}return o||++r!=i?o:!!(i=null==t?0:t.length)&&V(i)&&W(s,i)&&(z(t)||R(t))}function oe(t,e){return null!=t&&ie(t,e,Ht)}function se(t,e,n){var r=-1,i=(e=ne(e,t)).length;for(i||(i=1,t=void 0);++r<i;){var o=null==t?void 0:t[re(e[r])];void 0===o&&(r=i,o=n),t=f(o)?o.call(t):o}return t}function ce(t,e){const n=this;let r;return r=t&&oe(t,"constructor")?t.constructor:function(){return n.apply(this,arguments)},Mt(r,n,e),r.prototype=function(t,e){var n=ft(t);return null==e?n:lt(n,e)}(n.prototype,t),r.prototype.constructor=r,r.__super__=n.prototype,r}function ue(){const t={isResolved:!1,isPending:!0,isRejected:!1},e=new Promise((e,n)=>{t.resolve=e,t.reject=n});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 ae(){throw new Error('A "url" property or function must be specified')}function le(t,e){const n=e.error;e.error=function(r){n&&n.call(e.context,t,r,e),t.trigger("error",t,r,e)}}const he={create:"POST",update:"PUT",patch:"PATCH",delete:"DELETE",read:"GET"};function fe(t){const e=se(t,"browserStorage")||se(t.collection,"browserStorage");return e?e.sync():de}function de(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=he[t],i={type:r,dataType:"json"};n.url||(i.url=se(e,"url")||ae()),null!=n.data||!e||"create"!==t&&"update"!==t&&"patch"!==t||(i.contentType="application/json",i.data=JSON.stringify(n.attrs||e.toJSON(n))),"GET"!==i.type&&(i.processData=!1);const o=n.error;n.error=function(t,e,r){n.textStatus=e,n.errorThrown=r,o&&o.call(n.context,t,e,r)};const s=n.xhr=pe(Mt(i,n));return e.trigger("request",e,s,n),s}function pe(){return fetch.apply(this,arguments)}var ve=x(n,"DataView"),ge=x(n,"Promise"),ye=x(n,"Set"),be=x(n,"WeakMap"),_e=y(ve),me=y(Wt),je=y(ge),Ae=y(ye),we=y(be),$e=l;(ve&&"[object DataView]"!=$e(new ve(new ArrayBuffer(1)))||Wt&&"[object Map]"!=$e(new Wt)||ge&&"[object Promise]"!=$e(ge.resolve())||ye&&"[object Set]"!=$e(new ye)||be&&"[object WeakMap]"!=$e(new be))&&($e=function(t){var e=l(t),n="[object Object]"==e?t.constructor:void 0,r=n?y(n):"";if(r)switch(r){case _e:return"[object DataView]";case me:return"[object Map]";case je:return"[object Promise]";case Ae:return"[object Set]";case we:return"[object WeakMap]"}return e});var xe=$e,Oe=Object.prototype.hasOwnProperty;function Ee(t){if(null==t)return!0;if(ut(t)&&(z(t)||"string"==typeof t||"function"==typeof t.splice||F(t)||Y(t)||R(t)))return!t.length;var e=xe(t);if("[object Map]"==e||"[object Set]"==e)return!t.size;if(rt(t))return!ct(t).length;for(var n in t)if(Oe.call(t,n))return!1;return!0}var Se=/\s/;var Ie=/^\s+/;function Me(t){return t?t.slice(0,function(t){for(var e=t.length;e--&&Se.test(t.charAt(e)););return e}(t)+1).replace(Ie,""):t}var Pe=/^[-+]0x[0-9a-f]+$/i,He=/^0b[01]+$/i,Ne=/^0o[0-7]+$/i,ke=parseInt;function Te(t){return t?(t=function(t){if("number"==typeof t)return t;if(Nt(t))return NaN;if(h(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=h(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=Me(t);var n=He.test(t);return n||Ne.test(t)?ke(t.slice(2),n?2:8):Pe.test(t)?NaN:+t}(t))===1/0||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}function Ce(t){var e=Te(t),n=e%1;return e==e?n?e-n:e:0}function Re(t){return function(t,e){var n;if("function"!=typeof e)throw new TypeError("Expected a function");return t=Ce(t),function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=void 0),n}}(2,t)}var ze=0;function Ue(t){var e=++ze;return ee(t)+e}const Le={},Be=/\s+/;let Fe;const De=function(t,e,n,r,i){let o,s=0;if(n&&"object"==typeof n){void 0!==r&&"context"in i&&void 0===i.context&&(i.context=r);for(o=at(n);s<o.length;s++)e=De(t,e,o[s],n[o[s]],i)}else if(n&&Be.test(n))for(o=n.split(Be);s<o.length;s++)e=t(e,o[s],r,i);else e=t(e,n,r,i);return e};Le.on=function(t,e,n){if(this._events=De(We,this._events||{},t,e,{context:n,ctx:this,listening:Fe}),Fe){(this._listeners||(this._listeners={}))[Fe.id]=Fe,Fe.interop=!1}return this},Le.listenTo=function(t,e,n){if(!t)return this;const r=t._listenId||(t._listenId=Ue("l")),i=this._listeningTo||(this._listeningTo={});let o=Fe=i[r];o||(this._listenId||(this._listenId=Ue("l")),o=Fe=i[r]=new Ke(this,t));const s=Ve(t,e,n,this);if(Fe=void 0,s)throw s;return o.interop&&o.on(e,n),this};const We=function(t,e,n,r){if(n){const i=t[e]||(t[e]=[]),o=r.context,s=r.ctx,c=r.listening;c&&c.count++,i.push({callback:n,context:o,ctx:o||s,listening:c})}return t},Ve=function(t,e,n,r){try{t.on(e,n,r)}catch(t){return t}};Le.off=function(t,e,n){return this._events?(this._events=De(qe,this._events,t,e,{context:n,listeners:this._listeners}),this):this},Le.stopListening=function(t,e,n){const r=this._listeningTo;if(!r)return this;const i=t?[t._listenId]:at(r);for(let t=0;t<i.length;t++){const o=r[i[t]];if(!o)break;o.obj.off(e,n,this),o.interop&&o.off(e,n)}return Ee(r)&&(this._listeningTo=void 0),this};const qe=function(t,e,n,r){if(!t)return;const i=r.context,o=r.listeners;let s,c=0;if(e||i||n){for(s=e?[e]:at(t);c<s.length;c++){const r=t[e=s[c]];if(!r)break;const o=[];for(let t=0;t<r.length;t++){const s=r[t];if(n&&n!==s.callback&&n!==s.callback._callback||i&&i!==s.context)o.push(s);else{const t=s.listening;t&&t.off(e,n)}}o.length?t[e]=o:delete t[e]}return t}for(s=at(o);c<s.length;c++)o[s[c]].cleanup()};Le.once=function(t,e,n){const r=De(Je,{},t,e,this.off.bind(this));return"string"==typeof t&&null==n&&(e=void 0),this.on(r,e,n)},Le.listenToOnce=function(t,e,n){const r=De(Je,{},e,n,this.stopListening.bind(this,t));return this.listenTo(t,r)};const Je=function(t,e,n,r){if(n){const i=t[e]=Re((function(){r(e,i),n.apply(this,arguments)}));i._callback=n}return t};Le.trigger=function(t){if(!this._events)return this;const e=Math.max(0,arguments.length-1),n=Array(e);for(let t=0;t<e;t++)n[t]=arguments[t+1];return De(Ge,this._events,t,void 0,n),this};const Ge=function(t,e,n,r){if(t){const n=t[e];let i=t.all;n&&i&&(i=i.slice()),n&&Ze(n,r),i&&Ze(i,[e].concat(r))}return t},Ze=function(t,e){let n,r=-1;const i=t.length,o=e[0],s=e[1],c=e[2];switch(e.length){case 0:for(;++r<i;)(n=t[r]).callback.call(n.ctx);return;case 1:for(;++r<i;)(n=t[r]).callback.call(n.ctx,o);return;case 2:for(;++r<i;)(n=t[r]).callback.call(n.ctx,o,s);return;case 3:for(;++r<i;)(n=t[r]).callback.call(n.ctx,o,s,c);return;default:for(;++r<i;)(n=t[r]).callback.apply(n.ctx,e);return}},Ke=function(t,e){this.id=t._listenId,this.listener=t,this.obj=e,this.interop=!0,this.count=0,this._events=void 0};Ke.prototype.on=Le.on,Ke.prototype.off=function(t,e){let n;this.interop?(this._events=De(qe,this._events,t,e,{context:void 0,listeners:void 0}),n=!this._events):(this.count--,n=0===this.count),n&&this.cleanup()},Ke.prototype.cleanup=function(){delete this.listener._listeningTo[this.obj._listenId],this.interop||delete this.obj._listeners[this.id]},Le.bind=Le.on,Le.unbind=Le.off;function Qe(t){var e=this.__data__=new Dt(t);this.size=e.size}Qe.prototype.clear=function(){this.__data__=new Dt,this.size=0},Qe.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},Qe.prototype.get=function(t){return this.__data__.get(t)},Qe.prototype.has=function(t){return this.__data__.has(t)},Qe.prototype.set=function(t,e){var n=this.__data__;if(n instanceof Dt){var r=n.__data__;if(!Wt||r.length<199)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new qt(r)}return n.set(t,e),this.size=n.size,this};var Xe="object"==typeof exports&&exports&&!exports.nodeType&&exports,Ye=Xe&&"object"==typeof module&&module&&!module.nodeType&&module,tn=Ye&&Ye.exports===Xe?n.Buffer:void 0,en=tn?tn.allocUnsafe:void 0;function nn(){return[]}var rn=Object.prototype.propertyIsEnumerable,on=Object.getOwnPropertySymbols,sn=on?function(t){return null==t?[]:(t=Object(t),function(t,e){for(var n=-1,r=null==t?0:t.length,i=0,o=[];++n<r;){var s=t[n];e(s,n,t)&&(o[i++]=s)}return o}(on(t),(function(e){return rn.call(t,e)})))}:nn;function cn(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}var un=it(Object.getPrototypeOf,Object),an=Object.getOwnPropertySymbols?function(t){for(var e=[];t;)cn(e,sn(t)),t=un(t);return e}:nn;function ln(t,e,n){var r=e(t);return z(t)?r:cn(r,n(t))}function hn(t){return ln(t,at,sn)}function fn(t){return ln(t,St,an)}var dn=Object.prototype.hasOwnProperty;var pn=n.Uint8Array;function vn(t){var e=new t.constructor(t.byteLength);return new pn(e).set(new pn(t)),e}var gn=/\w*$/;var yn=r?r.prototype:void 0,bn=yn?yn.valueOf:void 0;function _n(t,e,n){var r,i=t.constructor;switch(e){case"[object ArrayBuffer]":return vn(t);case"[object Boolean]":case"[object Date]":return new i(+t);case"[object DataView]":return function(t,e){var n=e?vn(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}(t,n);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 function(t,e){var n=e?vn(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}(t,n);case"[object Map]":return new i;case"[object Number]":case"[object String]":return new i(t);case"[object RegExp]":return function(t){var e=new t.constructor(t.source,gn.exec(t));return e.lastIndex=t.lastIndex,e}(t);case"[object Set]":return new i;case"[object Symbol]":return r=t,bn?Object(bn.call(r)):{}}}var mn=Q&&Q.isMap,jn=mn?J(mn):function(t){return H(t)&&"[object Map]"==xe(t)};var An=Q&&Q.isSet,wn=An?J(An):function(t){return H(t)&&"[object Set]"==xe(t)},$n={};function xn(t,e,n,r,i,o){var s,c=1&e,u=2&e,a=4&e;if(n&&(s=i?n(t,r,i,o):n(t)),void 0!==s)return s;if(!h(t))return t;var l=z(t);if(l){if(s=function(t){var e=t.length,n=new t.constructor(e);return e&&"string"==typeof t[0]&&dn.call(t,"index")&&(n.index=t.index,n.input=t.input),n}(t),!c)return function(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e}(t,s)}else{var f=xe(t),d="[object Function]"==f||"[object GeneratorFunction]"==f;if(F(t))return function(t,e){if(e)return t.slice();var n=t.length,r=en?en(n):new t.constructor(n);return t.copy(r),r}(t,c);if("[object Object]"==f||"[object Arguments]"==f||d&&!i){if(s=u||d?{}:function(t){return"function"!=typeof t.constructor||rt(t)?{}:ft(un(t))}(t),!c)return u?function(t,e){return P(t,an(t),e)}(t,function(t,e){return t&&P(e,St(e),t)}(s,t)):function(t,e){return P(t,sn(t),e)}(t,lt(s,t))}else{if(!$n[f])return i?t:{};s=_n(t,f,c)}}o||(o=new Qe);var p=o.get(t);if(p)return p;o.set(t,s),wn(t)?t.forEach((function(r){s.add(xn(r,e,n,r,t,o))})):jn(t)&&t.forEach((function(r,i){s.set(i,xn(r,e,n,i,t,o))}));var v=l?void 0:(a?u?fn:hn:u?St:at)(t);return function(t,e){for(var n=-1,r=null==t?0:t.length;++n<r&&!1!==e(t[n],n,t););}(v||t,(function(r,i){v&&(r=t[i=r]),M(s,i,xn(r,e,n,i,t,o))})),s}$n["[object Arguments]"]=$n["[object Array]"]=$n["[object ArrayBuffer]"]=$n["[object DataView]"]=$n["[object Boolean]"]=$n["[object Date]"]=$n["[object Float32Array]"]=$n["[object Float64Array]"]=$n["[object Int8Array]"]=$n["[object Int16Array]"]=$n["[object Int32Array]"]=$n["[object Map]"]=$n["[object Number]"]=$n["[object Object]"]=$n["[object RegExp]"]=$n["[object Set]"]=$n["[object String]"]=$n["[object Symbol]"]=$n["[object Uint8Array]"]=$n["[object Uint8ClampedArray]"]=$n["[object Uint16Array]"]=$n["[object Uint32Array]"]=!0,$n["[object Error]"]=$n["[object Function]"]=$n["[object WeakMap]"]=!1;function On(t){return xn(t,4)}var En=Object.prototype,Sn=En.hasOwnProperty,In=$t((function(t,e){t=Object(t);var n=-1,r=e.length,i=r>2?e[2]:void 0;for(i&&xt(e[0],e[1],i)&&(r=1);++n<r;)for(var o=e[n],s=St(o),c=-1,u=s.length;++c<u;){var a=s[c],l=t[a];(void 0===l||S(l,En[a])&&!Sn.call(t,a))&&(t[a]=o[a])}return t}));var Mn=$t((function(t,e){return function(t,e,n){if("function"!=typeof t)throw new TypeError("Expected a function");return setTimeout((function(){t.apply(void 0,n)}),e)}(t,1,e)}));var Pn,Hn=(Pn={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},function(t){return null==Pn?void 0:Pn[t]}),Nn=/[&<>"']/g,kn=RegExp(Nn.source);var Tn,Cn=function(t,e,n){for(var r=-1,i=Object(t),o=n(t),s=o.length;s--;){var c=o[Tn?s:++r];if(!1===e(i[c],c,i))break}return t};function Rn(t,e){return t&&Cn(t,e,at)}var zn,Un,Ln=Object.prototype.toString,Bn=(zn=function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=Ln.call(e)),t[e]=n},Un=yt(dt),function(t,e){return function(t,e,n,r){return Rn(t,(function(t,i,o){e(r,n(t),i,o)})),r}(t,zn,Un(e),{})});function Fn(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new qt;++e<n;)this.add(t[e])}function Dn(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}function Wn(t,e){return t.has(e)}Fn.prototype.add=Fn.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},Fn.prototype.has=function(t){return this.__data__.has(t)};function Vn(t,e,n,r,i,o){var s=1&n,c=t.length,u=e.length;if(c!=u&&!(s&&u>c))return!1;var a=o.get(t),l=o.get(e);if(a&&l)return a==e&&l==t;var h=-1,f=!0,d=2&n?new Fn:void 0;for(o.set(t,e),o.set(e,t);++h<c;){var p=t[h],v=e[h];if(r)var g=s?r(v,p,h,e,t,o):r(p,v,h,t,e,o);if(void 0!==g){if(g)continue;f=!1;break}if(d){if(!Dn(e,(function(t,e){if(!Wn(d,e)&&(p===t||i(p,t,n,r,o)))return d.push(e)}))){f=!1;break}}else if(p!==v&&!i(p,v,n,r,o)){f=!1;break}}return o.delete(t),o.delete(e),f}function qn(t){var e=-1,n=Array(t.size);return t.forEach((function(t,r){n[++e]=[r,t]})),n}function Jn(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n}var Gn=r?r.prototype:void 0,Zn=Gn?Gn.valueOf:void 0;var Kn=Object.prototype.hasOwnProperty;var Qn=Object.prototype.hasOwnProperty;function Xn(t,e,n,r,i,o){var s=z(t),c=z(e),u=s?"[object Array]":xe(t),a=c?"[object Array]":xe(e),l="[object Object]"==(u="[object Arguments]"==u?"[object Object]":u),h="[object Object]"==(a="[object Arguments]"==a?"[object Object]":a),f=u==a;if(f&&F(t)){if(!F(e))return!1;s=!0,l=!1}if(f&&!l)return o||(o=new Qe),s||Y(t)?Vn(t,e,n,r,i,o):function(t,e,n,r,i,o,s){switch(n){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||!o(new pn(t),new pn(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return S(+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 c=qn;case"[object Set]":var u=1&r;if(c||(c=Jn),t.size!=e.size&&!u)return!1;var a=s.get(t);if(a)return a==e;r|=2,s.set(t,e);var l=Vn(c(t),c(e),r,i,o,s);return s.delete(t),l;case"[object Symbol]":if(Zn)return Zn.call(t)==Zn.call(e)}return!1}(t,e,u,n,r,i,o);if(!(1&n)){var d=l&&Qn.call(t,"__wrapped__"),p=h&&Qn.call(e,"__wrapped__");if(d||p){var v=d?t.value():t,g=p?e.value():e;return o||(o=new Qe),i(v,g,n,r,o)}}return!!f&&(o||(o=new Qe),function(t,e,n,r,i,o){var s=1&n,c=hn(t),u=c.length;if(u!=hn(e).length&&!s)return!1;for(var a=u;a--;){var l=c[a];if(!(s?l in e:Kn.call(e,l)))return!1}var h=o.get(t),f=o.get(e);if(h&&f)return h==e&&f==t;var d=!0;o.set(t,e),o.set(e,t);for(var p=s;++a<u;){var v=t[l=c[a]],g=e[l];if(r)var y=s?r(g,v,l,e,t,o):r(v,g,l,t,e,o);if(!(void 0===y?v===g||i(v,g,n,r,o):y)){d=!1;break}p||(p="constructor"==l)}if(d&&!p){var b=t.constructor,_=e.constructor;b==_||!("constructor"in t)||!("constructor"in e)||"function"==typeof b&&b instanceof b&&"function"==typeof _&&_ instanceof _||(d=!1)}return o.delete(t),o.delete(e),d}(t,e,n,r,i,o))}function Yn(t,e,n,r,i){return t===e||(null==t||null==e||!H(t)&&!H(e)?t!=t&&e!=e:Xn(t,e,n,r,Yn,i))}function tr(t,e){return Yn(t,e)}function er(t){return t==t&&!h(t)}function nr(t,e){return function(n){return null!=n&&(n[t]===e&&(void 0!==e||t in Object(n)))}}function rr(t){var e=function(t){for(var e=at(t),n=e.length;n--;){var r=e[n],i=t[r];e[n]=[r,i,er(i)]}return e}(t);return 1==e.length&&e[0][2]?nr(e[0][0],e[0][1]):function(n){return n===t||function(t,e,n,r){var i=n.length,o=i,s=!r;if(null==t)return!o;for(t=Object(t);i--;){var c=n[i];if(s&&c[2]?c[1]!==t[c[0]]:!(c[0]in t))return!1}for(;++i<o;){var u=(c=n[i])[0],a=t[u],l=c[1];if(s&&c[2]){if(void 0===a&&!(u in t))return!1}else{var h=new Qe;if(r)var f=r(a,l,u,t,e,h);if(!(void 0===f?Yn(l,a,3,r,h):f))return!1}}return!0}(n,t,e)}}function ir(t,e){for(var n=0,r=(e=ne(e,t)).length;null!=t&&n<r;)t=t[re(e[n++])];return n&&n==r?t:void 0}function or(t,e){return null!=t&&e in Object(t)}function sr(t,e){return null!=t&&ie(t,e,or)}function cr(t,e){return Ct(t)&&er(e)?nr(re(t),e):function(n){var r=function(t,e,n){var r=null==t?void 0:ir(t,e);return void 0===r?n:r}(n,t);return void 0===r&&r===e?sr(n,t):Yn(e,r,3)}}function ur(t){return Ct(t)?(e=re(t),function(t){return null==t?void 0:t[e]}):function(t){return function(e){return ir(e,t)}}(t);var e}function ar(t){return"function"==typeof t?t:null==t?dt:"object"==typeof t?z(t)?cr(t[0],t[1]):rr(t):ur(t)}function lr(t,e){return e.length<2?t:ir(t,function(t,e,n){var r=-1,i=t.length;e<0&&(e=-e>i?0:i+e),(n=n>i?i:n)<0&&(n+=i),i=e>n?0:n-e>>>0,e>>>=0;for(var o=Array(i);++r<i;)o[r]=t[r+e];return o}(e,0,-1))}function hr(t,e){return null==(t=lr(t,e=ne(e,t)))||delete t[re((n=e,r=null==n?0:n.length,r?n[r-1]:void 0))];var n,r}var fr=Function.prototype,dr=Object.prototype,pr=fr.toString,vr=dr.hasOwnProperty,gr=pr.call(Object);function yr(t){if(!H(t)||"[object Object]"!=l(t))return!1;var e=un(t);if(null===e)return!0;var n=vr.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&pr.call(n)==gr}function br(t){return yr(t)?void 0:t}var _r=r?r.isConcatSpreadable:void 0;function mr(t){return z(t)||R(t)||!!(_r&&t&&t[_r])}function jr(t,e,n,r,i){var o=-1,s=t.length;for(n||(n=mr),i||(i=[]);++o<s;){var c=t[o];e>0&&n(c)?e>1?jr(c,e-1,n,r,i):cn(i,c):r||(i[i.length]=c)}return i}function Ar(t){return(null==t?0:t.length)?jr(t,1):[]}function wr(t){return wt(gt(t,void 0,Ar),t+"")}var $r=wr((function(t,e){var n={};if(null==t)return n;var r=!1;e=Qt(e,(function(e){return e=ne(e,t),r||(r=e.length>1),e})),P(t,fn(t),n),r&&(n=xn(n,7,br));for(var i=e.length;i--;)hr(n,e[i]);return n}));function xr(t,e,n,r){if(!h(t))return t;for(var i=-1,o=(e=ne(e,t)).length,s=o-1,c=t;null!=c&&++i<o;){var u=re(e[i]),a=n;if("__proto__"===u||"constructor"===u||"prototype"===u)return t;if(i!=s){var l=c[u];void 0===(a=r?r(l,u,c):void 0)&&(a=h(l)?l:W(e[i+1])?[]:{})}M(c,u,a),c=c[u]}return t}function Or(t,e){return function(t,e,n){for(var r=-1,i=e.length,o={};++r<i;){var s=e[r],c=ir(t,s);n(c,s)&&xr(o,ne(s,t),c)}return o}(t,e,(function(e,n){return sr(t,n)}))}var Er=wr((function(t,e){return null==t?{}:Or(t,e)}));const Sr=function(t,e){let n=t||{};e||(e={}),this.preinitialize.apply(this,arguments),this.cid=Ue(this.cidPrefix),this.attributes={},e.collection&&(this.collection=e.collection),e.parse&&(n=this.parse(n,e)||{});const r=se(this,"defaults");n=In(Mt({},r,n),r),this.set(n,e),this.changed={},this.initialize.apply(this,arguments)};function Ir(t,e,n,r){for(var i=-1,o=null==t?0:t.length;++i<o;){var s=t[i];e(r,s,n(s),t)}return r}Sr.extend=ce,Object.assign(Sr.prototype,Le,{changed:null,validationError:null,idAttribute:"id",cidPrefix:"c",preinitialize:function(){},initialize:function(){},toJSON:function(t){return On(this.attributes)},sync:function(t,e,n){return fe(this)(t,e,n)},get:function(t){return this.attributes[t]},keys:function(){return Object.keys(this.attributes)},values:function(){return Object.values(this.attributes)},pairs:function(){return this.entries()},entries:function(){return Object.entries(this.attributes)},invert:function(){return Bn(this.attributes)},pick:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),Er(this.attributes,e)},omit:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),$r(this.attributes,e)},isEmpty:function(){return Ee(this.attributes)},escape:function(t){return(e=ee(e=this.get(t)))&&kn.test(e)?e.replace(Nn,Hn):e;var e},has:function(t){return null!=this.get(t)},matches:function(t){return!!function(t){return ar("function"==typeof t?t:xn(t,1))}(t)(this.attributes)},set:function(t,e,n){if(null==t)return this;let r;if("object"==typeof t?(r=t,n=e):(r={})[t]=e,n||(n={}),!this._validate(r,n))return!1;const i=n.unset,o=n.silent,s=[],c=this._changing;this._changing=!0,c||(this._previousAttributes=On(this.attributes),this.changed={});const u=this.attributes,a=this.changed,l=this._previousAttributes;for(const t in r)e=r[t],tr(u[t],e)||s.push(t),tr(l[t],e)?delete a[t]:a[t]=e,i?delete u[t]:u[t]=e;if(this.idAttribute in r&&(this.id=this.get(this.idAttribute)),!o){s.length&&(this._pending=n);for(let t=0;t<s.length;t++)this.trigger("change:"+s[t],this,u[s[t]],n)}if(c)return this;if(!o)for(;this._pending;)n=this._pending,this._pending=!1,this.trigger("change",this,n);return this._pending=!1,this._changing=!1,this},unset:function(t,e){return this.set(t,void 0,Mt({},e,{unset:!0}))},clear:function(t){const e={};for(const t in this.attributes)e[t]=void 0;return this.set(e,Mt({},t,{unset:!0}))},hasChanged:function(t){return null==t?!Ee(this.changed):oe(this.changed,t)},changedAttributes:function(t){if(!t)return!!this.hasChanged()&&On(this.changed);const e=this._changing?this._previousAttributes:this.attributes,n={};let r;for(const i in t){const o=t[i];tr(e[i],o)||(n[i]=o,r=!0)}return!!r&&n},previous:function(t){return null!=t&&this._previousAttributes?this._previousAttributes[t]:null},previousAttributes:function(){return On(this._previousAttributes)},fetch:function(t){t=Mt({parse:!0},t);const e=this,n=t.success;return t.success=function(r){const i=t.parse?e.parse(r,t):r;if(!e.set(i,t))return!1;n&&n.call(t.context,e,r,t),e.trigger("sync",e,r,t)},le(this,t),this.sync("read",this,t)},save:function(t,e,n){let r;null==t||"object"==typeof t?(r=t,n=e):(r={})[t]=e;const i=(n=Mt({validate:!0,parse:!0},n)).wait,o=n.promise,s=o&&ue();if(r&&!i){if(!this.set(r,n))return!1}else if(!this._validate(r,n))return!1;const c=this,u=n.success,a=n.error,l=this.attributes;n.success=function(t){c.attributes=l;let e=n.parse?c.parse(t,n):t;if(i&&(e=Mt({},r,e)),e&&!c.set(e,n))return!1;u&&u.call(n.context,c,t,n),c.trigger("sync",c,t,n),o&&s.resolve()},n.error=function(t,e,n){a&&a.call(n.context,t,e,n),o&&s.reject(e)},le(this,n),r&&i&&(this.attributes=Mt({},l,r));const h=this.isNew()?"create":n.patch?"patch":"update";"patch"!==h||n.attrs||(n.attrs=r);const f=this.sync(h,this,n);return this.attributes=l,o?s:f},destroy:function(t){t=t?On(t):{};const e=this,n=t.success,r=t.wait,i=function(){e.stopListening(),e.trigger("destroy",e,e.collection,t)};t.success=function(o){r&&i(),n&&n.call(t.context,e,o,t),e.isNew()||e.trigger("sync",e,o,t)};let o=!1;return this.isNew()?Mn(t.success):(le(this,t),o=this.sync("delete",this,t)),r||i(),o},url:function(){const t=se(this,"urlRoot")||se(this.collection,"url")||ae();if(this.isNew())return t;const e=this.get(this.idAttribute);return t.replace(/[^\/]$/,"$&/")+encodeURIComponent(e)},parse:function(t,e){return t},clone:function(){return new this.constructor(this.attributes)},isNew:function(){return!this.has(this.idAttribute)},isValid:function(t){return this._validate({},Mt({},t,{validate:!0}))},_validate:function(t,e){if(!e.validate||!this.validate)return!0;t=Mt({},this.attributes,t);const n=this.validationError=this.validate(t,e)||null;return!n||(this.trigger("invalid",this,n,Mt(e,{validationError:n})),!1)}});var Mr=function(t,e){return function(n,r){if(null==n)return n;if(!ut(n))return t(n,r);for(var i=n.length,o=e?i:-1,s=Object(n);(e?o--:++o<i)&&!1!==r(s[o],o,s););return n}}(Rn);function Pr(t,e,n,r){return Mr(t,(function(t,i,o){e(r,t,n(t),o)})),r}function Hr(t,e){return function(n,r){var i=z(n)?Ir:Pr,o=e?e():{};return i(n,t,ar(r),o)}}var Nr=Object.prototype.hasOwnProperty,kr=Hr((function(t,e,n){Nr.call(t,n)?++t[n]:E(t,n,1)}));function Tr(t,e,n,r){for(var i=t.length,o=n+(r?1:-1);r?o--:++o<i;)if(e(t[o],o,t))return o;return-1}function Cr(t){return t!=t}function Rr(t,e,n){return e==e?function(t,e,n){for(var r=n-1,i=t.length;++r<i;)if(t[r]===e)return r;return-1}(t,e,n):Tr(t,Cr,n)}function zr(t,e){return!!(null==t?0:t.length)&&Rr(t,e,0)>-1}function Ur(t,e,n){for(var r=-1,i=null==t?0:t.length;++r<i;)if(n(e,t[r]))return!0;return!1}function Lr(t){return H(t)&&ut(t)}var Br=$t((function(t,e){return Lr(t)?function(t,e,n,r){var i=-1,o=zr,s=!0,c=t.length,u=[],a=e.length;if(!c)return u;n&&(e=Qt(e,J(n))),r?(o=Ur,s=!1):e.length>=200&&(o=Wn,s=!1,e=new Fn(e));t:for(;++i<c;){var l=t[i],h=null==n?l:n(l);if(l=r||0!==l?l:0,s&&h==h){for(var f=a;f--;)if(e[f]===h)continue t;u.push(l)}else o(e,h,r)||u.push(l)}return u}(t,jr(e,1,Lr,!0)):[]}));function Fr(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(!e(t[n],n,t))return!1;return!0}function Dr(t,e){var n=!0;return Mr(t,(function(t,r,i){return n=!!e(t,r,i)})),n}var Wr=Math.max;var Vr=Math.max,qr=Math.min;var Jr=Object.prototype.hasOwnProperty,Gr=Hr((function(t,e,n){Jr.call(t,n)?t[n].push(e):E(t,n,[e])})),Zr=Math.max;function Kr(t){return"string"==typeof t||!z(t)&&H(t)&&"[object String]"==l(t)}var Qr=Hr((function(t,e,n){E(t,n,e)}));var Xr=Math.max,Yr=Math.min;function ti(t,e){var n;return Mr(t,(function(t,r,i){return!(n=e(t,r,i))})),!!n}function ei(t,e,n){var r=z(t)?Dn:ti;return n&&xt(t,e,n)&&(e=void 0),r(t,ar(e))}function ni(t,e){if(t!==e){var n=void 0!==t,r=null===t,i=t==t,o=Nt(t),s=void 0!==e,c=null===e,u=e==e,a=Nt(e);if(!c&&!a&&!o&&t>e||o&&s&&u&&!c&&!a||r&&s&&u||!n&&u||!i)return 1;if(!r&&!o&&!a&&t<e||a&&n&&i&&!r&&!o||c&&n&&i||!s&&i||!u)return-1}return 0}function ri(t,e,n){e=e.length?Qt(e,(function(t){return z(t)?function(e){return ir(e,1===t.length?t[0]:t)}:t})):[dt];var r=-1;return e=Qt(e,J(ar)),function(t,e){var n=t.length;for(t.sort(e);n--;)t[n]=t[n].value;return t}(function(t,e){var n=-1,r=ut(t)?Array(t.length):[];return Mr(t,(function(t,i,o){r[++n]=e(t,i,o)})),r}(t,(function(t,n,i){return{criteria:Qt(e,(function(e){return e(t)})),index:++r,value:t}})),(function(t,e){return function(t,e,n){for(var r=-1,i=t.criteria,o=e.criteria,s=i.length,c=n.length;++r<s;){var u=ni(i[r],o[r]);if(u)return r>=c?u:u*("desc"==n[r]?-1:1)}return t.index-e.index}(t,e,n)}))}var ii=$t((function(t,e){if(null==t)return[];var n=e.length;return n>1&&xt(t,e[0],e[1])?e=[]:n>2&&xt(e[0],e[1],e[2])&&(e=[e[0]]),ri(t,jr(e,1),[])}));const oi=Array.prototype.slice,si=function(t,e){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,Mt({silent:!0},e))};si.extend=ce;const ci={add:!0,remove:!0,merge:!0},ui={add:!0,remove:!1},ai=function(t,e,n){n=Math.min(Math.max(n,0),t.length);const r=Array(t.length-n),i=e.length;let o;for(o=0;o<r.length;o++)r[o]=t[o+n];for(o=0;o<i;o++)t[o+n]=e[o];for(o=0;o<r.length;o++)t[o+i+n]=r[o]};Object.assign(si.prototype,Le,{model:Sr,preinitialize:function(){},initialize:function(){},toJSON:function(t){return this.map((function(e){return e.toJSON(t)}))},sync:function(t,e,n){return fe(this)(t,e,n)},add:function(t,e){return this.set(t,Mt({merge:!1},e,ui))},remove:function(t,e){e=Mt({},e);const n=!Array.isArray(t);t=n?[t]:t.slice();const r=this._removeModels(t,e);return!e.silent&&r.length&&(e.changes={added:[],merged:[],removed:r},this.trigger("update",this,e)),n?r[0]:r},set:function(t,e){if(null==t)return;(e=Mt({},ci,e)).parse&&!this._isModel(t)&&(t=this.parse(t,e)||[]);const n=!Array.isArray(t);t=n?[t]:t.slice();let r=e.at;null!=r&&(r=+r),r>this.length&&(r=this.length),r<0&&(r+=this.length+1);const i=[],o=[],s=[],c=[],u={},a=e.add,l=e.merge,h=e.remove;let f=!1;const d=this.comparator&&null==r&&!1!==e.sort,p=Kr(this.comparator)?this.comparator:null;let v,g;for(g=0;g<t.length;g++){v=t[g];const n=this.get(v);if(n){if(l&&v!==n){let t=this._isModel(v)?v.attributes:v;e.parse&&(t=n.parse(t,e)),n.set(t,e),s.push(n),d&&!f&&(f=n.hasChanged(p))}u[n.cid]||(u[n.cid]=!0,i.push(n)),t[g]=n}else a&&(v=t[g]=this._prepareModel(v,e),v&&(o.push(v),this._addReference(v,e),u[v.cid]=!0,i.push(v)))}if(h){for(g=0;g<this.length;g++)v=this.models[g],u[v.cid]||c.push(v);c.length&&this._removeModels(c,e)}let y=!1;const b=!d&&a&&h;if(i.length&&b?(y=this.length!==i.length||ei(this.models,(t,e)=>t!==i[e]),this.models.length=0,ai(this.models,i,0),this.length=this.models.length):o.length&&(d&&(f=!0),ai(this.models,o,null==r?this.length:r),this.length=this.models.length),f&&this.sort({silent:!0}),!e.silent){for(g=0;g<o.length;g++)null!=r&&(e.index=r+g),v=o[g],v.trigger("add",v,this,e);(f||y)&&this.trigger("sort",this,e),(o.length||c.length||s.length)&&(e.changes={added:o,removed:c,merged:s},this.trigger("update",this,e))}return n?t[0]:t},clearStore:async function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t=>t;await Promise.all(this.models.filter(e).map(e=>new Promise(n=>{e.destroy(Object.assign(t,{success:n,error:(t,e)=>{console.error(e),n()}}))}))),await this.browserStorage.clear(),this.reset()},reset:function(t,e){e=e?On(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,Mt({silent:!0},e)),e.silent||this.trigger("reset",this,e),t},push:function(t,e){return this.add(t,Mt({at:this.length},e))},pop:function(t){const e=this.at(this.length-1);return this.remove(e,t)},unshift:function(t,e){return this.add(t,Mt({at:0},e))},shift:function(t){const e=this.at(0);return this.remove(e,t)},slice:function(){return oi.apply(this.models,arguments)},filter:function(t,e){return this.models.filter(f(t)?t:e=>e.matches(t),e)},every:function(t){return function(t,e,n){var r=z(t)?Fr:Dr;return n&&xt(t,e,n)&&(e=void 0),r(t,ar(e))}(this.models.map(t=>t.attributes),t)},difference:function(t){return Br(this.models,t)},max:function(){return Math.max.apply(Math,this.models)},min:function(){return Math.min.apply(Math,this.models)},drop:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return this.models.slice(t)},some:function(t){return ei(this.models.map(t=>t.attributes),t)},sortBy:function(t){return ii(this.models,f(t)?t:e=>Kr(t)?e.get(t):e.matches(t))},isEmpty:function(){return Ee(this.models)},keyBy:function(t){return Qr(this.models,t)},each:function(t,e){return this.forEach(t,e)},forEach:function(t,e){return this.models.forEach(t,e)},includes:function(t){return this.models.includes(t)},size:function(){return this.models.length},countBy:function(t){return kr(this.models,f(t)?t:e=>Kr(t)?e.get(t):e.matches(t))},groupBy:function(t){return Gr(this.models,f(t)?t:e=>Kr(t)?e.get(t):e.matches(t))},indexOf:function(t){return function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=null==n?0:Ce(n);return i<0&&(i=Zr(r+i,0)),Rr(t,e,i)}(this.models,t)},findLastIndex:function(t,e){return function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=r-1;return void 0!==n&&(i=Ce(n),i=n<0?Vr(r+i,0):qr(i,r-1)),Tr(t,ar(e),i,!0)}(this.models,f(t)?t:e=>Kr(t)?e.get(t):e.matches(t),e)},lastIndexOf:function(t){return function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=r;return void 0!==n&&(i=(i=Ce(n))<0?Xr(r+i,0):Yr(i,r-1)),e==e?function(t,e,n){for(var r=n+1;r--;)if(t[r]===e)return r;return r}(t,e,i):Tr(t,Cr,i,!0)}(this.models,t)},findIndex:function(t){return function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=null==n?0:Ce(n);return i<0&&(i=Wr(r+i,0)),Tr(t,ar(e),i)}(this.models,f(t)?t:e=>Kr(t)?e.get(t):e.matches(t))},last:function(){const t=null==this.models?0:this.models.length;return t?this.models[t-1]:void 0},head:function(){return this.models[0]},first:function(){return this.head()},map:function(t,e){return this.models.map(f(t)?t:e=>Kr(t)?e.get(t):e.matches(t),e)},reduce:function(t,e){return this.models.reduce(t,e||this.models[0])},reduceRight:function(t,e){return this.models.reduceRight(t,e||this.models[0])},toArray:function(){return Array.from(this.models)},get:function(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:function(t){return null!=this.get(t)},at:function(t){return t<0&&(t+=this.length),this.models[t]},where:function(t,e){return this[e?"find":"filter"](t)},findWhere:function(t){return this.where(t,!0)},find:function(t,e){const n=f(t)?t:e=>e.matches(t);return this.models.find(n,e)},sort:function(t){let e=this.comparator;if(!e)throw new Error("Cannot sort a set without a comparator");t||(t={});const n=e.length;return f(e)&&(e=e.bind(this)),1===n||Kr(e)?this.models=this.sortBy(e):this.models.sort(e),t.silent||this.trigger("sort",this,t),this},pluck:function(t){return this.map(t+"")},fetch:function(t){const e=(t=Mt({parse:!0},t)).success,n=this,r=t.promise&&ue();return t.success=function(i){const o=t.reset?"reset":"set";n[o](i,t),e&&e.call(t.context,n,i,t),r&&r.resolve(),n.trigger("sync",n,i,t)},le(this,t),r||this.sync("read",this,t)},create:function(t,e){const n=(e=e?On(e):{}).wait,r=e.promise,i=r&&ue();if(!(t=this._prepareModel(t,e)))return!1;n||this.add(t,e);const o=this,s=e.success,c=e.error;return e.success=function(t,e,c){n&&o.add(t,c),s&&s.call(c.context,t,e,c),r&&i.resolve(t)},e.error=function(t,e,n){c&&c.call(n.context,t,e,n),r&&i.reject(e)},t.save(null,Object.assign(e,{promise:!1})),r?i:t},parse:function(t,e){return t},clone:function(){return new this.constructor(this.models,{model:this.model,comparator:this.comparator})},modelId:function(t){var e;return t[(null===(e=this.model.prototype)||void 0===e?void 0:e.idAttribute)||"id"]},values:function(){return new hi(this,fi)},keys:function(){return new hi(this,di)},entries:function(){return new hi(this,pi)},_reset:function(){this.length=0,this.models=[],this._byId={}},_prepareModel:function(t,e){if(this._isModel(t))return t.collection||(t.collection=this),t;(e=e?On(e):{}).collection=this;const n=new this.model(t,e);return n.validationError?(this.trigger("invalid",this,n.validationError,e),!1):n},_removeModels:function(t,e){const n=[];for(let r=0;r<t.length;r++){const i=this.get(t[r]);if(!i)continue;const o=this.indexOf(i);this.models.splice(o,1),this.length--,delete this._byId[i.cid];const s=this.modelId(i.attributes);null!=s&&delete this._byId[s],e.silent||(e.index=o,i.trigger("remove",i,this,e)),n.push(i),this._removeReference(i,e)}return n},_isModel:function(t){return t instanceof Sr},_addReference:function(t,e){this._byId[t.cid]=t;const n=this.modelId(t.attributes);null!=n&&(this._byId[n]=t),t.on("all",this._onModelEvent,this)},_removeReference:function(t,e){delete this._byId[t.cid];const n=this.modelId(t.attributes);null!=n&&delete this._byId[n],this===t.collection&&delete t.collection,t.off("all",this._onModelEvent,this)},_onModelEvent:function(t,e,n,r){if(e){if(("add"===t||"remove"===t)&&n!==this)return;if("destroy"===t&&this.remove(e,r),"change"===t){const t=this.modelId(e.previousAttributes()),n=this.modelId(e.attributes);t!==n&&(null!=t&&delete this._byId[t],null!=n&&(this._byId[n]=e))}}this.trigger.apply(this,arguments)}});const li="function"==typeof Symbol&&Symbol.iterator;li&&(si.prototype[li]=si.prototype.values);const hi=function(t,e){this._collection=t,this._kind=e,this._index=0},fi=1,di=2,pi=3;li&&(hi.prototype[li]=function(){return this}),hi.prototype.next=function(){if(this._collection){if(this._index<this._collection.length){const t=this._collection.at(this._index);let e;if(this._index++,this._kind===fi)e=t;else{const n=this._collection.modelId(t.attributes);e=this._kind===di?n:[n,t]}return{value:e,done:!1}}this._collection=void 0}return{value:void 0,done:!0}};const vi=function(){this.handlers=[],this.checkUrl=this.checkUrl.bind(this),"undefined"!=typeof window&&(this.location=window.location,this.history=window.history)};vi.extend=ce;const gi=/^[#\/]|\s+$/g,yi=/^\/+|\/+$/g,bi=/#.*$/;vi.started=!1,Object.assign(vi.prototype,Le,{interval:50,atRoot:function(){return this.location.pathname.replace(/[^\/]$/,"$&/")===this.root&&!this.getSearch()},matchRoot:function(){return this.decodeFragment(this.location.pathname).slice(0,this.root.length-1)+"/"===this.root},decodeFragment:function(t){return decodeURI(t.replace(/%25/g,"%2525"))},getSearch:function(){const t=this.location.href.replace(/#.*/,"").match(/\?.+/);return t?t[0]:""},getHash:function(t){const e=(t||this).location.href.match(/#(.*)$/);return e?e[1]:""},getPath:function(){const t=this.decodeFragment(this.location.pathname+this.getSearch()).slice(this.root.length-1);return"/"===t.charAt(0)?t.slice(1):t},getFragment:function(t){return null==t&&(t=this._usePushState||!this._wantsHashChange?this.getPath():this.getHash()),t.replace(gi,"")},start:function(t){if(vi.started)throw new Error("history has already been started");if(vi.started=!0,this.options=Mt({root:"/"},this.options,t),this.root=this.options.root,this._wantsHashChange=!1!==this.options.hashChange,this._hasHashChange="onhashchange"in window&&(void 0===document.documentMode||document.documentMode>7),this._useHashChange=this._wantsHashChange&&this._hasHashChange,this._wantsPushState=!!this.options.pushState,this._hasPushState=!(!this.history||!this.history.pushState),this._usePushState=this._wantsPushState&&this._hasPushState,this.fragment=this.getFragment(),this.root=("/"+this.root+"/").replace(yi,"/"),this._wantsHashChange&&this._wantsPushState){if(!this._hasPushState&&!this.atRoot()){const t=this.root.slice(0,-1)||"/";return this.location.replace(t+"#"+this.getPath()),!0}this._hasPushState&&this.atRoot()&&this.navigate(this.getHash(),{replace:!0})}if(!this._hasHashChange&&this._wantsHashChange&&!this._usePushState){this.iframe=document.createElement("iframe"),this.iframe.src="javascript:0",this.iframe.style.display="none",this.iframe.tabIndex=-1;const t=document.body,e=t.insertBefore(this.iframe,t.firstChild).contentWindow;e.document.open(),e.document.close(),e.location.hash="#"+this.fragment}if(this._usePushState?addEventListener("popstate",this.checkUrl,!1):this._useHashChange&&!this.iframe?addEventListener("hashchange",this.checkUrl,!1):this._wantsHashChange&&(this._checkUrlInterval=setInterval(this.checkUrl,this.interval)),!this.options.silent)return this.loadUrl()},stop:function(){this._usePushState?removeEventListener("popstate",this.checkUrl,!1):this._useHashChange&&!this.iframe&&removeEventListener("hashchange",this.checkUrl,!1),this.iframe&&(document.body.removeChild(this.iframe),this.iframe=null),this._checkUrlInterval&&clearInterval(this._checkUrlInterval),vi.started=!1},route:function(t,e){this.handlers.unshift({route:t,callback:e})},checkUrl:function(t){let e=this.getFragment();if(e===this.fragment&&this.iframe&&(e=this.getHash(this.iframe.contentWindow)),e===this.fragment)return!1;this.iframe&&this.navigate(e),this.loadUrl()},loadUrl:function(t){return!!this.matchRoot()&&(t=this.fragment=this.getFragment(t),ei(this.handlers,(function(e){if(e.route.test(t))return e.callback(t),!0})))},navigate:function(t,e){if(!vi.started)return!1;e&&!0!==e||(e={trigger:!!e}),t=this.getFragment(t||"");let n=this.root;""!==t&&"?"!==t.charAt(0)||(n=n.slice(0,-1)||"/");const r=n+t;t=t.replace(bi,"");const i=this.decodeFragment(t);if(this.fragment!==i){if(this.fragment=i,this._usePushState)this.history[e.replace?"replaceState":"pushState"]({},document.title,r);else{if(!this._wantsHashChange)return this.location.assign(r);if(this._updateHash(this.location,t,e.replace),this.iframe&&t!==this.getHash(this.iframe.contentWindow)){const n=this.iframe.contentWindow;e.replace||(n.document.open(),n.document.close()),this._updateHash(n.location,t,e.replace)}}return e.trigger?this.loadUrl(t):void 0}},_updateHash:function(t,e,n){if(n){const n=t.href.replace(/(javascript:|#).*$/,"");t.replace(n+"#"+e)}else t.hash="#"+e}});var _i=Q&&Q.isRegExp,mi=_i?J(_i):function(t){return H(t)&&"[object RegExp]"==l(t)};const ji=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.history=t.history||new vi,this.preinitialize.apply(this,arguments),t.routes&&(this.routes=t.routes),this._bindRoutes(),this.initialize.apply(this,arguments)};ji.extend=ce;const Ai=/\((.*?)\)/g,wi=/(\(\?)?:\w+/g,$i=/\*\w+/g,xi=/[\-{}\[\]+?.,\\\^$|#\s]/g;
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
2
  /**
3
3
  * @license
4
4
  * Copyright 2017 Google LLC
5
5
  * SPDX-License-Identifier: BSD-3-Clause
6
- */
7
- var Oi;Object.assign(ji.prototype,Le,{preinitialize:function(){},initialize:function(){},route:function(t,e,n){return mi(t)||(t=this._routeToRegExp(t)),f(e)&&(n=e,e=""),n||(n=this[e]),this.history.route(t,r=>{const i=this._extractParameters(t,r);!1!==this.execute(n,i,e)&&(this.trigger.apply(this,["route:"+e].concat(i)),this.trigger("route",e,i),this.history.trigger("route",this,e,i))}),this},execute:function(t,e,n){t&&t.apply(this,e)},navigate:function(t,e){return this.history.navigate(t,e),this},_bindRoutes:function(){if(!this.routes)return;let t;this.routes=se(this,"routes");const e=at(this.routes);for(;null!=(t=e.pop());)this.route(t,this.routes[t])},_routeToRegExp:function(t){return t=t.replace(xi,"\\$&").replace(Ai,"(?:$1)?").replace(wi,(function(t,e){return e?t:"([^/?]+)"})).replace($i,"([^?]*?)"),new RegExp("^"+t+"(?:\\?([\\s\\S]*))?$")},_extractParameters:function(t,e){const n=t.exec(e).slice(1);return n.map((function(t,e){return e===n.length-1?t||null:t?decodeURIComponent(t):null}))}});const Ei=window,Si=Ei.trustedTypes,Ii=Si?Si.createPolicy("lit-html",{createHTML:t=>t}):void 0,Mi=`lit$${(Math.random()+"").slice(9)}$`,Pi="?"+Mi,Hi=`<${Pi}>`,Ni=document,ki=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return Ni.createComment(t)},Ti=t=>null===t||"object"!=typeof t&&"function"!=typeof t,Ci=Array.isArray,Ri=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,zi=/-->/g,Ui=/>/g,Li=RegExp(">|[ \t\n\f\r](?:([^\\s\"'>=/]+)([ \t\n\f\r]*=[ \t\n\f\r]*(?:[^ \t\n\f\r\"'`<>=]|(\"|')|))|$)","g"),Bi=/'/g,Fi=/"/g,Di=/^(?:script|style|textarea|title)$/i,Wi=Symbol.for("lit-noChange"),Vi=Symbol.for("lit-nothing"),qi=new WeakMap,Ji=Ni.createTreeWalker(Ni,129,null,!1),Gi=(t,e)=>{const n=t.length-1,r=[];let i,o=2===e?"<svg>":"",s=Ri;for(let e=0;e<n;e++){const n=t[e];let c,u,a=-1,l=0;for(;l<n.length&&(s.lastIndex=l,u=s.exec(n),null!==u);)l=s.lastIndex,s===Ri?"!--"===u[1]?s=zi:void 0!==u[1]?s=Ui:void 0!==u[2]?(Di.test(u[2])&&(i=RegExp("</"+u[2],"g")),s=Li):void 0!==u[3]&&(s=Li):s===Li?">"===u[0]?(s=null!=i?i:Ri,a=-1):void 0===u[1]?a=-2:(a=s.lastIndex-u[2].length,c=u[1],s=void 0===u[3]?Li:'"'===u[3]?Fi:Bi):s===Fi||s===Bi?s=Li:s===zi||s===Ui?s=Ri:(s=Li,i=void 0);const h=s===Li&&t[e+1].startsWith("/>")?" ":"";o+=s===Ri?n+Hi:a>=0?(r.push(c),n.slice(0,a)+"$lit$"+n.slice(a)+Mi+h):n+Mi+(-2===a?(r.push(void 0),e):h)}const c=o+(t[n]||"<?>")+(2===e?"</svg>":"");if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==Ii?Ii.createHTML(c):c,r]};class Zi{constructor(t,e){let n,{strings:r,_$litType$:i}=t;this.parts=[];let o=0,s=0;const c=r.length-1,u=this.parts,[a,l]=Gi(r,i);if(this.el=Zi.createElement(a,e),Ji.currentNode=this.el.content,2===i){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(n=Ji.nextNode())&&u.length<c;){if(1===n.nodeType){if(n.hasAttributes()){const t=[];for(const e of n.getAttributeNames())if(e.endsWith("$lit$")||e.startsWith(Mi)){const r=l[s++];if(t.push(e),void 0!==r){const t=n.getAttribute(r.toLowerCase()+"$lit$").split(Mi),e=/([.?@])?(.*)/.exec(r);u.push({type:1,index:o,name:e[2],strings:t,ctor:"."===e[1]?to:"?"===e[1]?no:"@"===e[1]?ro:Yi})}else u.push({type:6,index:o})}for(const e of t)n.removeAttribute(e)}if(Di.test(n.tagName)){const t=n.textContent.split(Mi),e=t.length-1;if(e>0){n.textContent=Si?Si.emptyScript:"";for(let r=0;r<e;r++)n.append(t[r],ki()),Ji.nextNode(),u.push({type:2,index:++o});n.append(t[e],ki())}}}else if(8===n.nodeType)if(n.data===Pi)u.push({type:2,index:o});else{let t=-1;for(;-1!==(t=n.data.indexOf(Mi,t+1));)u.push({type:7,index:o}),t+=Mi.length-1}o++}}static createElement(t,e){const n=Ni.createElement("template");return n.innerHTML=t,n}}function Ki(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t,r=arguments.length>3?arguments[3]:void 0;var i,o,s,c;if(e===Wi)return e;let u=void 0!==r?null===(i=n._$Co)||void 0===i?void 0:i[r]:n._$Cl;const a=Ti(e)?void 0:e._$litDirective$;return(null==u?void 0:u.constructor)!==a&&(null===(o=null==u?void 0:u._$AO)||void 0===o||o.call(u,!1),void 0===a?u=void 0:(u=new a(t),u._$AT(t,n,r)),void 0!==r?(null!==(s=(c=n)._$Co)&&void 0!==s?s:c._$Co=[])[r]=u:n._$Cl=u),void 0!==u&&(e=Ki(t,u._$AS(t,e.values),u,r)),e}class Qi{constructor(t,e){this.u=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}v(t){var e;const{el:{content:n},parts:r}=this._$AD,i=(null!==(e=null==t?void 0:t.creationScope)&&void 0!==e?e:Ni).importNode(n,!0);Ji.currentNode=i;let o=Ji.nextNode(),s=0,c=0,u=r[0];for(;void 0!==u;){if(s===u.index){let e;2===u.type?e=new Xi(o,o.nextSibling,this,t):1===u.type?e=new u.ctor(o,u.name,u.strings,this,t):6===u.type&&(e=new io(o,this,t)),this.u.push(e),u=r[++c]}s!==(null==u?void 0:u.index)&&(o=Ji.nextNode(),s++)}return i}p(t){let e=0;for(const n of this.u)void 0!==n&&(void 0!==n.strings?(n._$AI(t,n,e),e+=n.strings.length-2):n._$AI(t[e])),e++}}class Xi{constructor(t,e,n,r){var i;this.type=2,this._$AH=Vi,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=n,this.options=r,this._$Cm=null===(i=null==r?void 0:r.isConnected)||void 0===i||i}get _$AU(){var t,e;return null!==(e=null===(t=this._$AM)||void 0===t?void 0:t._$AU)&&void 0!==e?e:this._$Cm}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t){t=Ki(this,t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:this),Ti(t)?t===Vi||null==t||""===t?(this._$AH!==Vi&&this._$AR(),this._$AH=Vi):t!==this._$AH&&t!==Wi&&this.g(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):(t=>Ci(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]))(t)?this.k(t):this.g(t)}O(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._$AB;return this._$AA.parentNode.insertBefore(t,e)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}g(t){this._$AH!==Vi&&Ti(this._$AH)?this._$AA.nextSibling.data=t:this.T(Ni.createTextNode(t)),this._$AH=t}$(t){var e;const{values:n,_$litType$:r}=t,i="number"==typeof r?this._$AC(t):(void 0===r.el&&(r.el=Zi.createElement(r.h,this.options)),r);if((null===(e=this._$AH)||void 0===e?void 0:e._$AD)===i)this._$AH.p(n);else{const t=new Qi(i,this),e=t.v(this.options);t.p(n),this.T(e),this._$AH=t}}_$AC(t){let e=qi.get(t.strings);return void 0===e&&qi.set(t.strings,e=new Zi(t)),e}k(t){Ci(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let n,r=0;for(const i of t)r===e.length?e.push(n=new Xi(this.O(ki()),this.O(ki()),this,this.options)):n=e[r],n._$AI(i),r++;r<e.length&&(this._$AR(n&&n._$AB.nextSibling,r),e.length=r)}_$AR(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this._$AA.nextSibling,e=arguments.length>1?arguments[1]:void 0;var n;for(null===(n=this._$AP)||void 0===n||n.call(this,!1,!0,e);t&&t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){var e;void 0===this._$AM&&(this._$Cm=t,null===(e=this._$AP)||void 0===e||e.call(this,t))}}class Yi{constructor(t,e,n,r,i){this.type=1,this._$AH=Vi,this._$AN=void 0,this.element=t,this.name=e,this._$AM=r,this.options=i,n.length>2||""!==n[0]||""!==n[1]?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=Vi}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;const i=this.strings;let o=!1;if(void 0===i)t=Ki(this,t,e,0),o=!Ti(t)||t!==this._$AH&&t!==Wi,o&&(this._$AH=t);else{const r=t;let s,c;for(t=i[0],s=0;s<i.length-1;s++)c=Ki(this,r[n+s],e,s),c===Wi&&(c=this._$AH[s]),o||(o=!Ti(c)||c!==this._$AH[s]),c===Vi?t=Vi:t!==Vi&&(t+=(null!=c?c:"")+i[s+1]),this._$AH[s]=c}o&&!r&&this.j(t)}j(t){t===Vi?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class to extends Yi{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===Vi?void 0:t}}const eo=Si?Si.emptyScript:"";class no extends Yi{constructor(){super(...arguments),this.type=4}j(t){t&&t!==Vi?this.element.setAttribute(this.name,eo):this.element.removeAttribute(this.name)}}class ro extends Yi{constructor(t,e,n,r,i){super(t,e,n,r,i),this.type=5}_$AI(t){var e;if((t=null!==(e=Ki(this,t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:this,0))&&void 0!==e?e:Vi)===Wi)return;const n=this._$AH,r=t===Vi&&n!==Vi||t.capture!==n.capture||t.once!==n.once||t.passive!==n.passive,i=t!==Vi&&(n===Vi||r);r&&this.element.removeEventListener(this.name,this,n),i&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e,n;"function"==typeof this._$AH?this._$AH.call(null!==(n=null===(e=this.options)||void 0===e?void 0:e.host)&&void 0!==n?n:this.element,t):this._$AH.handleEvent(t)}}class io{constructor(t,e,n){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(t){Ki(this,t)}}const oo=Ei.litHtmlPolyfillSupport;null==oo||oo(Zi,Xi),(null!==(Oi=Ei.litHtmlVersions)&&void 0!==Oi?Oi:Ei.litHtmlVersions=[]).push("2.6.1");const so=/^\s*</,co=function(t){this.cid=Ue("view"),this._domEvents=[],this.preinitialize.apply(this,arguments),Mt(this,Er(t,ao)),this._ensureElement(),this.initialize.apply(this,arguments)};co.extend=ce;const uo=/^(\S+)\s*(.*)$/,ao=["model","collection","el","id","attributes","className","tagName","events"];Object.assign(co.prototype,Le,{tagName:"div",$:function(t){return this.el.querySelectorAll(t)},preinitialize:function(){},initialize:function(){},render:function(){return f(this.beforeRender)&&this.beforeRender(),f(this.toHTML)&&((t,e,n)=>{var r,i;const o=null!==(r=null==n?void 0:n.renderBefore)&&void 0!==r?r:e;let s=o._$litPart$;if(void 0===s){const t=null!==(i=null==n?void 0:n.renderBefore)&&void 0!==i?i:null;o._$litPart$=s=new Xi(e.insertBefore(ki(),t),t,void 0,null!=n?n:{})}s._$AI(t)})(this.toHTML(),this.el),f(this.afterRender)&&this.afterRender(),this},remove:function(){return this._removeElement(),this.stopListening(),this},_removeElement:function(){this.undelegateEvents(),this.el.parentNode&&this.el.parentNode.removeChild(this.el)},setElement:function(t){return this.undelegateEvents(),this._setElement(t),this.delegateEvents(),this},_setElement:function(t){if("string"==typeof t)if(so.test(t)){const e=document.createElement("div");e.innerHTML=t,this.el=e.firstChild}else this.el=document.querySelector(t);else t&&(!H(e=t)||1!==e.nodeType||yr(e))&&t.length?this.el=t[0]:this.el=t;var e},delegateEvents:function(t){if(t||(t=se(this,"events")),!t)return this;this.undelegateEvents();for(const e in t){let n=t[e];if(f(n)||(n=this[n]),!n)continue;const r=e.match(uo);this.delegate(r[1],r[2],n.bind(this))}return this},delegate:function(t,e,n){const r=this.el;if(!r)return this;if("function"==typeof e&&(n=e,e=null),-1!==["focus","blur"].indexOf(t)){const r=this.el.querySelectorAll(e);for(let e=0,i=r.length;e<i;e++){const i=r[e];i.addEventListener(t,n,!1),this._domEvents.push({el:i,eventName:t,handler:n})}return n}const i=e?function(t){let i=t.target||t.srcElement;for(;i&&i!=r;i=i.parentNode)i.matches(e)&&(t.delegateTarget=i,n(t))}:n;return this.el.addEventListener(t,i,!1),this._domEvents.push({el:this.el,eventName:t,handler:i,listener:n,selector:e}),this},undelegateEvents:function(){if(this.el){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:function(t,e,n){if("function"==typeof e&&(n=e,e=null),this.el){const r=this._domEvents.slice();let i=r.length;for(;i--;){const o=r[i];!(o.eventName!==t||n&&o.listener!==n||e&&o.selector!==e)&&(o.el.removeEventListener(o.eventName,o.handler,!1),this._domEvents.splice(i,1))}}return this},_createElement:function(t){return document.createElement(t)},_ensureElement:function(){if(this.el)this.setElement(se(this,"el"));else{const t=Mt({},se(this,"attributes"));this.id&&(t.id=se(this,"id")),this.className&&(t.class=se(this,"className")),this.setElement(this._createElement(se(this,"tagName"))),this._setAttributes(t)}},_setAttributes:function(t){for(const e in t)e in this.el?this.el[e]=t[e]:this.el.setAttribute(e,t[e])}});const lo={Collection:si,Events:Le,History:vi,Model:Sr,Router:ji,View:co,ajax:pe,sync:de};Object.assign(lo,Le);const ho="object"==typeof self&&self.self===self&&self||"object"==typeof global&&global.global===global&&global;lo.VERSION="0.0.1";const fo=ho.Skeletor;return lo.noConflict=function(){return ho.Skeletor=fo,this},ho.Skeletor=lo,lo}));
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]}}
7
+ /**
8
+ * @copyright 2010-2019 Jeremy Ashkenas and DocumentCloud
9
+ * @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}}
11
+ /*! *****************************************************************************
12
+ Copyright (c) Microsoft Corporation.
13
+
14
+ Permission to use, copy, modify, and/or distribute this software for any
15
+ purpose with or without fee is hereby granted.
16
+
17
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
18
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
19
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
20
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
21
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
22
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
23
+ 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.")}
25
+ /*!
26
+ MIT License
27
+
28
+ Copyright (c) 2018 Arturas Molcanovas <a.molcanovas@gmail.com>
29
+
30
+ Permission is hereby granted, free of charge, to any person obtaining a copy
31
+ of this software and associated documentation files (the "Software"), to deal
32
+ in the Software without restriction, including without limitation the rights
33
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
34
+ copies of the Software, and to permit persons to whom the Software is
35
+ furnished to do so, subject to the following conditions:
36
+
37
+ The above copyright notice and this permission notice shall be included in all
38
+ copies or substantial portions of the Software.
39
+
40
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
41
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
42
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
43
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
44
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
45
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
46
+ SOFTWARE.
47
+
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}();
49
+ /*!
50
+ MIT License
51
+
52
+ Copyright (c) 2018 Arturas Molcanovas <a.molcanovas@gmail.com>
53
+
54
+ Permission is hereby granted, free of charge, to any person obtaining a copy
55
+ of this software and associated documentation files (the "Software"), to deal
56
+ in the Software without restriction, including without limitation the rights
57
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
58
+ copies of the Software, and to permit persons to whom the Software is
59
+ furnished to do so, subject to the following conditions:
60
+
61
+ The above copyright notice and this permission notice shall be included in all
62
+ copies or substantial portions of the Software.
63
+
64
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
65
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
66
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
67
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
68
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
69
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
70
+ SOFTWARE.
71
+
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:{}};
73
+ /*!
74
+ localForage -- Offline Storage, Improved
75
+ Version 1.10.0
76
+ https://localforage.github.io/localForage
77
+ (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})}));
8
79
  //# sourceMappingURL=skeletor.min.js.map