UNPKG

@converse/skeletor

Version:

Modernized Backbone with web components

78 lines (66 loc) 109 kB
!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} /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */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]}} /** * @copyright 2010-2019 Jeremy Ashkenas and DocumentCloud * @copyright 2023 JC Brand */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}} /*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */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.")} /*! MIT License Copyright (c) 2018 Arturas Molcanovas <a.molcanovas@gmail.com> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */(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}(); /*! MIT License Copyright (c) 2018 Arturas Molcanovas <a.molcanovas@gmail.com> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */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:{}}; /*! localForage -- Offline Storage, Improved Version 1.10.0 https://localforage.github.io/localForage (c) 2013-2017 Mozilla, Apache License 2.0 */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().th