diff --git a/public/js/app.js b/public/js/app.js index df2090b..455ec6a 100755 --- a/public/js/app.js +++ b/public/js/app.js @@ -1 +1 @@ -!function(t){"use strict";var e,n=Object.prototype,r=n.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",a=i.toStringTag||"@@toStringTag",u="object"==typeof module,l=t.regeneratorRuntime;if(l)u&&(module.exports=l);else{(l=t.regeneratorRuntime=u?module.exports:{}).wrap=k;var c="suspendedStart",h="suspendedYield",f="executing",p="completed",d={},v={};v[o]=function(){return this};var m=Object.getPrototypeOf,y=m&&m(m(S([])));y&&y!==n&&r.call(y,o)&&(v=y);var g=x.prototype=_.prototype=Object.create(v);b.prototype=g.constructor=x,x.constructor=b,x[a]=b.displayName="GeneratorFunction",l.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},l.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,a in t||(t[a]="GeneratorFunction")),t.prototype=Object.create(g),t},l.awrap=function(t){return{__await:t}},O(L.prototype),L.prototype[s]=function(){return this},l.AsyncIterator=L,l.async=function(t,e,n,r){var i=new L(k(t,e,n,r));return l.isGeneratorFunction(e)?i:i.next().then(function(t){return t.done?t.value:i.next()})},O(g),g[a]="Generator",g[o]=function(){return this},g.toString=function(){return"[object Generator]"},l.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},l.values=S,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(C),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function i(r,i){return a.type="throw",a.arg=t,n.next=r,i&&(n.method="next",n.arg=e),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var s=this.tryEntries[o],a=s.completion;if("root"===s.tryLoc)return i("end");if(s.tryLoc<=this.prev){var u=r.call(s,"catchLoc"),l=r.call(s,"finallyLoc");if(u&&l){if(this.prev=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),C(n),d}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;C(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:S(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),d}}}function k(t,e,n,r){var i=e&&e.prototype instanceof _?e:_,o=Object.create(i.prototype),s=new I(r||[]);return o._invoke=function(t,e,n){var r=c;return function(i,o){if(r===f)throw new Error("Generator is already running");if(r===p){if("throw"===i)throw o;return R()}for(n.method=i,n.arg=o;;){var s=n.delegate;if(s){var a=P(s,n);if(a){if(a===d)continue;return a}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===c)throw r=p,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=f;var u=w(t,e,n);if("normal"===u.type){if(r=n.done?p:h,u.arg===d)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r=p,n.method="throw",n.arg=u.arg)}}}(t,n,s),o}function w(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}function _(){}function b(){}function x(){}function O(t){["next","throw","return"].forEach(function(e){t[e]=function(t){return this._invoke(e,t)}})}function L(t){var e;this._invoke=function(n,i){function o(){return new Promise(function(e,o){!function e(n,i,o,s){var a=w(t[n],t,i);if("throw"!==a.type){var u=a.arg,l=u.value;return l&&"object"==typeof l&&r.call(l,"__await")?Promise.resolve(l.__await).then(function(t){e("next",t,o,s)},function(t){e("throw",t,o,s)}):Promise.resolve(l).then(function(t){u.value=t,o(u)},function(t){return e("throw",t,o,s)})}s(a.arg)}(n,i,e,o)})}return e=e?e.then(o,o):o()}}function P(t,n){var r=t.iterator[n.method];if(r===e){if(n.delegate=null,"throw"===n.method){if(t.iterator.return&&(n.method="return",n.arg=e,P(t,n),"throw"===n.method))return d;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return d}var i=w(r,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,d;var o=i.arg;return o?o.done?(n[t.resultName]=o.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,d):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,d)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function C(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function I(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function S(t){if(t){var n=t[o];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,s=function n(){for(;++i=1;i--){var o={};o[r[i]]=n,n=o}e=r[0]}var s=e;e=function(){window[s]=n}}t.h.push(e)}},{key:"u",value:function(){for(var e=0;e0){this.it.splice(e,1);for(var n=this.wt(t),r=0,i=n.length;r0){var t=arguments[0],n=Array.prototype.slice.call(arguments,1);return e.I(t)&&(0===n.length||e.re.apply(null,[t[n[0]]].concat(n.slice(1))))}return!1}},{key:"Mt",value:function(t){return null===t||void 0===t}},{key:"I",value:function(t){return!e.Mt(t)}},{key:"m",value:function(){for(var t=0;t0&&(o=new Array(r+1-s).join("0")+o),n+=o}return n}},{key:"ge",value:function(t,e){for(var n=Math.floor(Math.log(265)/Math.log(e)),r=t.match(new RegExp(".{1,"+n+"}","g"))||[],i="",o=0,s=r.length;o1&&0==(3&a)&&(a%100!=0||a%400==0)?1:0),3),"%k":""+u,"%l":(u+11)%12+1,"%m":p(s+1,2),"%M":p(n.getMinutes(),2),"%p":u<12?"AM":"PM","%P":u<12?"am":"pm","%s":Math.round(n.getTime()/1e3),"%S":p(n.getSeconds(),2),"%u":i||7,"%V":function(){var t=f(),e=t.valueOf();t.setMonth(0,1);var n=t.getDay();return 4!==n&&t.setMonth(0,1+(4-n+7)%7),p(1+Math.ceil((e-t)/6048e5),2)}(),"%w":""+i,"%x":n.toLocaleDateString(),"%X":n.toLocaleTimeString(),"%y":(""+a).slice(2),"%Y":a,"%z":n.toTimeString().replace(/.+GMT([+-]\d+).+/,"$1"),"%Z":n.toTimeString().replace(/.+\((.+?)\)$/,"$1")}[t]||t})}},{key:"Se",value:function(n){var r=void 0;if(e.Mt(n)||"object"!=(void 0===n?"undefined":t(n)))return n;if(n instanceof Array){var i=[];for(r=0;r",""":'"',"'":"'","’":"’","‘":"‘","–":"–","—":"—","…":"…","”":"”"};return e.I(t)&&"function"==typeof t.replace?t.replace(/\&[\w\d\#]{2,5}\;/g,function(t){return n[t]}):t}},{key:"Me",value:function(t){var e=new FormData;for(var n in t)e.set(n,t[n]);return e}},{key:"ye",value:function(t,n){var r=window.getComputedStyle(t),i=window.getComputedStyle(n);if(i.height>r.height||i.width>r.width)return e.He(t,n)}},{key:"He",value:function(t,n){e.ve(t);for(var r=window.getComputedStyle(t),i=window.getComputedStyle(n),o=0,s=parseFloat(i.getPropertyValue("font-size")),a=i.width,u=i.height;i.height>r.height||i.width>r.width;)if(s*=.95,u>r.height&&(u*=.95),a>i.width&&(a*=.95),n.style["font-size"]=s+"px",n.style["max-height"]=u+"px",n.style["max-width"]=a+"px",++o>2e3){console.log("breaked");break}e.Pe(n),i=window.getComputedStyle(n),n.style["font-size"]=parseFloat(i.getPropertyValue("font-size"))/parseFloat(document.documentElement.clientHeight)*100+"vh"}},{key:"ve",value:function(t){for(var n=t.childNodes,r=0,i=n.length;r-1,i=e.userAgent.indexOf("Edge")>-1;return!!e.userAgent.match("CriOS")||null!==t&&void 0!==t&&"Google Inc."===n&&!1===r&&!1===i}},{key:"Le",value:function(t,e){for(var n={},r=0,i=t.length;r0&&(n=r[0])}else-1!==t.De.indexOf(e)&&(n=e);if(v.I(n)){localStorage.setItem("currentTheme",n.Re);var i=new Promise(function(t){document.querySelector("nav.top-bar").addEventListener("transitionend",function(){t()})});document.body.className=n.Be,t.Ie=n;for(var o=0,s=t.Ue.length;o0?t.xe(n[0]):t.De.length>0&&t.xe(t.De[0])}}},{key:"We",value:function(){return new l(t.Ie.Re,function(e){var n=(t.De.indexOf(t.Ie)+1)%t.De.length;t.xe(t.De[n]),e.title=t.Ie.Re,e.H.j()},h.Y)}},{key:"addChangeListener",value:function(e){t.Ue.push(e)}},{key:"getCurrentTheme",value:function(){return t.Ie}}]),t}();y.Ie=null,y.De=[],y.Ue=[],u.l("ThemeManager",{addChangeListener:y.addChangeListener,getCurrentTheme:y.getCurrentTheme});var g=function(){function t(e){s(this,t),this.Oe=e,this._e=!0,this.je=3650,this.Ve="complianceCookie",this.Je="true"}return n(t,null,[{key:"Ne",value:function(){var e=r(regeneratorRuntime.mark(function e(n){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new t(n).Ne());case 1:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}()}]),n(t,[{key:"Ne",value:function(){var e=r(regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",t.qe(this.Ve)!==this.Je?this.show():Promise.resolve());case 1:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}()},{key:"ze",value:function(){this.$e(this.Ve,this.Je,this.je)}},{key:"$e",value:function(t,e,n){var r=void 0;if(v.I(n)){var i=new Date;i.setTime(i.getTime()+24*n*60*60*1e3),r="; expires="+i.toGMTString()}else r="";this._e&&(document.cookie=t+"="+e+r+"; path=/")}},{key:"Ke",value:function(t){this.$e(t,"",-1)}},{key:"show",value:function(){var t=this,e=document.getElementById(this.Oe);return e.style.display="block",new Promise(function(n){e.querySelector("#close-cookie-msg").onclick=function(){t.ze(),e.remove(),n()}})}}],[{key:"qe",value:function(t){for(var e=t+"=",n=document.cookie.split(";"),r=0;r0||("smedium"===t||"small"===t)&&r.Ze(e.getElementsByClassName(h.S)).length>0||"small"===t&&r.Ze(e.getElementsByClassName(h.yt)).length>0||r.Ze(e.getElementsByClassName(h.tt)).length>0?document.getElementById("responsive-menu-toggle").style.display="block":(document.getElementById("responsive-menu-toggle").style.display="none",v.I(r.Ge)&&r.Ge.close())}},{key:"gt",value:function(){var t=e(r.prototype.__proto__||Object.getPrototypeOf(r.prototype),"gt",this).call(this);return function(e){t(e)instanceof c||!v.I(r.Ge)||r.Ge.close()}}},{key:"ht",value:function(t){var n=e(r.prototype.__proto__||Object.getPrototypeOf(r.prototype),"ht",this).call(this,t);return this.Xe(),r.Ge=this,n}},{key:"close",value:function(){document.getElementById("responsive-menu").style.display="none";for(var t=0,e=this.rt.length;t0;){var o=this.hs.firstChild;o.remove(),i.appendChild(o)}this.us={vn:i,title:document.title};var a=this;window.onpopstate=function(){if(a.ns.length>=1){var t=a.ns[a.ns.length-1].qn();!1!==t.Wn()&&a.Cn(t)}}}return n(t,[{key:"Hn",value:function(){return this.us}},{key:"cs",value:function(t){this.ls=t}},{key:"bn",value:function(){return this.ls}},{key:"ds",value:function(t){this.as.push(t)}},{key:"Dn",value:function(){return this.as}},{key:"ms",value:function(){return v.I(this.ss)?this.ss.qn():null}},{key:"gs",value:function(){var t=r(regeneratorRuntime.mark(function t(e){var n;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:n=this.ns.length-1;case 1:if(!(n>=0)){t.next=9;break}return t.next=4,e(this.ns[n].qn());case 4:if(!t.sent){t.next=6;break}return t.abrupt("return",this.ns[n].qn());case 6:n--,t.next=1;break;case 9:return t.abrupt("return",null);case 10:case"end":return t.stop()}},t,this)}));return function(){return t.apply(this,arguments)}}()},{key:"Ln",value:function(){var t=r(regeneratorRuntime.mark(function t(e,n){var i,o,s,a,u=this;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(e.prototype instanceof b){t.next=2;break}throw{error:"wrong class given! Expected AbstractSite, given "+e.name};case 2:return i=new e(this),o={},s=new Promise(function(t,e){o.resolve=t,o.reject=e}),a=new x(i,o),t.abrupt("return",(this.es.removeAllChildren().appendChild(v.he()),this.os=Promise.resolve(n).then(function(){var t=r(regeneratorRuntime.mark(function t(e){return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return a.Yn(e),t.next=3,Promise.all([i.an(e),i.sn]);case 3:return i.wn=i.xn(u.ps()),t.abrupt("return",u.show(a));case 5:case"end":return t.stop()}},t,u)}));return function(){return t.apply(this,arguments)}}()).catch(function(t){console.error("site start error for site ",e.name,t)}),s));case 4:case"end":return t.stop()}},t,this)}));return function(){return t.apply(this,arguments)}}()},{key:"Cn",value:function(t,e){var n=this;this.os.then(function(){var r=n.fs(t),i=n.ns.splice(r,1),o=null;if((i=i[0])===n.ss){n.ss.qn().cn(),n.ss=null;var s=n.ns.length-1;if(s<0)return n.Ss(),void app.ws();n.es.removeAllChildren().appendChild(v.he()),o=n.ns[s]}i.qn().dn(),Promise.resolve(e).then(function(t){i.Zn().resolve(t),v.I(o)&&n.show(o)})})}},{key:"addListener",value:function(t,e,n,r){this.es.addEventListener(e,function(e){var i=e.target;t.pn&&i.matches(n)&&r(i,e)})}},{key:"On",value:function(t,e,n,r,i){this.addListener(t,n,r,i),this.Nn(t,e,i)}},{key:"Nn",value:function(t,e,n){window.addEventListener("keydown",function(r){t.pn&&r.which===e&&n(this,r)})}},{key:"kn",value:function(t){var e=this.fs(t),n=this.ns.splice(e,1);n=n[0],this.show(n)}},{key:"Ms",value:function(){return this.show(this.ss)}},{key:"show",value:function(t){v.I(this.ss)&&(this.ss.Xn(this.ss.qn().cn()),this.ss.Kn(this.es.innerHTML)),this.es.removeAllChildren().appendChild(v.he());var e=this;return this.ss=t,-1===this.ns.indexOf(t)&&this.ns.push(t),t.qn().sn.then(function(n){return t.qn().wn.j(),e.es.removeAllChildren().appendChild(n),e.Pn(),d.Gt().Xt(),n}).then(function(n){t.qn().ln(t.Gn()),history.pushState({siteName:t.qn().constructor.name,siteData:n.outerHTML,stackPosition:e.ns.length-1},t.qn().constructor.name,t.qn().En())})}},{key:"Bn",value:function(t){if(v.I(this.ss)&&this.ss.qn()===t){history.replaceState({siteName:t.constructor.name,siteData:t.en.outerHTML,stackPosition:this.ns.length-1},t.constructor.name,t.En())}}},{key:"ms",value:function(){if(null!=this.ss)return this.ss.qn()}},{key:"ys",value:function(){null!=this.ss&&this.ss.qn().wn.j()}},{key:"Pn",value:function(){var t=this.ms().title;this.hs.removeAllChildren().appendChild(t.vn),document.title=v.m(t.title,this.us.title)}},{key:"fs",value:function(t){for(var e=0,n=this.ns.length;e=0&&(this.Cs[e].remove(!0),this.Cs.splice(e,1))}},{key:"Ln",value:function(t,e){return this.Ts.Ln(t,e)}},{key:"start",value:function(e){m.Ae(this.Ce);var n=v.m(this.js(),e),r=t.zs();this.xs=e,d.init(),y.init(),this.ks&&this.ds(y.We()),this.Ts=new O(this.bs,this.Ls),this.Ts.as=this.Cs,this.Ts.cs(e),this.Ts.Ln(n,r),this.Vs(),this.Fs&&(this.$s=g.Ne("cookie-compliance"))}},{key:"ms",value:function(){return this.Ts.ms()}},{key:"ws",value:function(){var t=r(regeneratorRuntime.mark(function t(){return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:"function"==typeof this.Ds&&this.Ds();case 1:case"end":return t.stop()}},t,this)}));return function(){return t.apply(this,arguments)}}()},{key:"setAppEndListener",value:function(t){this.Ds=t}},{key:"gs",value:function(){var t=r(regeneratorRuntime.mark(function t(e){return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.Ts.gs(e));case 1:case"end":return t.stop()}},t,this)}));return function(){return t.apply(this,arguments)}}()}],[{key:"Js",value:function(t){if(v.Mt(t))return null;for(var e={},n=[],r=t.split("&"),i=0;i0&&(e[n[0]]=decodeURIComponent(n[1]));return e}},{key:"zs",value:function(){return t.Js(window.location.search.substr(1))}}]),t}(),E=function(){function t(e,n){s(this,t),this.Ks=null,this.content=null,this.Gs=null,this.cancelable=!0,this.title=v.m(n,""),this.Xs=!0,this.Qs="",this.buttons=[],this.result=null,v.I(e)&&this.Ys(e)}return n(t,[{key:"k",value:function(t){return this.title=t,this}},{key:"Zs",value:function(t){this.Xs=t}},{key:"ti",value:function(t){this.Qs=t}},{key:"R",value:function(){return this.title}},{key:"ei",value:function(t){return this.cancelable=!0===t,this}},{key:"Ys",value:function(){var t=r(regeneratorRuntime.mark(function t(e){return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return this.ni=Promise.resolve(e),t.next=3,this.ni;case 3:return this.content=t.sent,t.abrupt("return",this);case 5:case"end":return t.stop()}},t,this)}));return function(){return t.apply(this,arguments)}}()},{key:"si",value:function(t,e,n){n=v.m(n,!0);var r=null;"string"==typeof t?((r=document.createElement("button")).classList.add("button"),r.classList.add("right"),r.appendChild(d.pt(t))):r=t;var i=this;if("function"!=typeof e){var o=e;e=function(){i.result=o}}var s;s=n?function(t){v.I(e)&&e(t),i.close()}:e,v.I(s)&&r.addEventListener("click",s),this.buttons.push(r)}},{key:"show",value:function(){var t=r(regeneratorRuntime.mark(function t(){var e,n,r,i,o,s,a,u,l;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:for((e=document.createElement("span")).classList.add("title"),this.Xs&&""!==this.title?e.appendChild(d.pt(this.title)):e.innerHTML=this.title,(n=document.createElement("div")).appendChild(e),(r=document.createElement("div")).classList.add("content-container"),(i=document.createElement("div")).className=this.Qs,i.classList.add("modal"),i.appendChild(n),i.appendChild(r),(o=document.createElement("div")).classList.add("modal-button-container"),s=0,a=this.buttons.length;s0&&e.ri(e.li,i),e.li++}}]),e}();I.li=0,I.hi=3500,I.ui=1e3,I.ai="success",I.ci="error",I.di="default",I.mi="info",I.gi="warning";var S=function(){function t(e,n){var i,o=this;s(this,t),this.pi=new Promise((i=r(regeneratorRuntime.mark(function t(r,i){var s,a;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return s=null,s=window.sqlite?new Promise(function(t){!function e(){window.sqliteIndexedDB?t(window.sqliteIndexedDB):setTimeout(e,200),console.log("t")}()}):Promise.resolve(window.myIndexedDB||window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB||window.shimIndexedDB),console.log("indexeddb 1"),t.next=5,s;case 5:o.fi=t.sent,console.log("indexeddb 2"),o.Si=o.fi.open(e,n),a=o,o.Si.onupgradeneeded=function(t){try{a.wi(a.Si.result,t.oldVersion,t.newVersion,t)}catch(t){throw i(t),t}},a.Si.onsuccess=function(t){a.Dt=a.Si.result,r(t)};case 10:case"end":return t.stop()}},t,o)})),function(){return i.apply(this,arguments)}))}return n(t,[{key:"Mi",value:function(t,e,n){var r=this;return"function"==typeof e&&v.Mt(n)&&(n=e,e="read"),this.pi.then(function(){var i=null;try{i=r.Si.result.transaction(t,e)}catch(e){console.warn(e),i=r.Si.result.transaction(t)}n(i)})}},{key:"yi",value:function(t,e,n){return"function"==typeof e&&v.Mt(n)&&(n=e,e="readonly"),this.Mi(t,e,function(e){n(e.objectStore(t))})}},{key:"Hi",value:function(t,e){var n=this;return new Promise(function(r){n.yi(e,"readwrite",function(e){var n=e.put(t);n.onsuccess=r,n.onerror=function(t){throw{type:"indexed-db-error",event:t}}})})}},{key:"vi",value:function(t,e){var n=this;return new Promise(function(r){n.yi(e,"readwrite",function(e){for(var n=[],i=function(r,i){n.push(new Promise(function(n){var r=e.put(t[i]);r.onsuccess=n,r.onerror=function(t){throw{type:"indexed-db-error",event:t}}}))},o=0,s=t.length;o=0){var n=new E("optimistic-locking-dialog","optimistic-locking-dialog-title");n.ii(),n.show()}else t(e)}:t,this.lr=n}},{key:"ur",value:function(){if(!this.rr){var t=this;return this.submit().then(function(e){if(e.success){if(null!==t.ar)return t.ar(e.result)}else if(v.I(t.lr))return t.lr(e.errors)})}}},{key:"load",value:function(t,e){return this.dr(B.load(t,e).then(function(t){return t.success?t.result:{}})),this}},{key:"dr",value:function(t){this.mr(!0);var e=this;return Promise.resolve(t).then(function(t){for(var n in e.mr(!1),t)if(v.I(e.sr.elements[n])){if(v.I(e.sr.elements[n].options)&&v.I(t[n+"Options"])){var r=e.sr.elements[n].options;for(var i in t[n+"Options"]){var o=document.createElement("option");o.value=i,o.innerText=t[n+"Options"][i],r.add(o)}}e.sr.elements[n].value=v.we(t[n]),v.I(t[n])&&""!==(""+t[n]).trim()?e.sr.elements[n].classList.add("notEmpty"):e.sr.elements[n].classList.remove("notEmpty")}return e})}},{key:"hr",value:function(){var t=r(regeneratorRuntime.mark(function t(e){var n,r,i,o;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:for(i in n=!1,r=null,e)v.I(this.sr.elements[i])&&"hidden"!==this.sr.elements[i].type&&v.Mt(this.sr.elements[i].gr)&&(v.Mt(this.sr.elements[i].disabled)||!this.sr.elements[i].disabled)&&(this.sr.elements[i].setCustomValidity(d.translate(v.m(e[i],"form-default-error"))),n=!0),v.Mt(r)&&(r=v.m(e[i],"form-default-error"));if(n||!v.I(r)){t.next=11;break}t.t0=regeneratorRuntime.keys(this.sr.elements);case 4:if((t.t1=t.t0()).done){t.next=11;break}if(o=t.t1.value,"hidden"===this.sr.elements[o].type){t.next=9;break}return this.sr.elements[o].setCustomValidity(d.translate(r)),n=!0,t.abrupt("break",11);case 9:t.next=4;break;case 11:n&&this.sr.querySelector("input[type=submit]").click();case 12:case"end":return t.stop()}},t,this)}));return function(){return t.apply(this,arguments)}}()},{key:"mr",value:function(t){this.rr=t,this.rr?this.sr.classList.add("sending"):this.sr.classList.remove("sending")}},{key:"submit",value:function(){var t=this;return new Promise(function(e){t.mr(!0);var n=new FormData(t.sr);e(t.or(n))}).then(function(e){return t.mr(!1),e})}},{key:"pr",value:function(t){this.ar=t}}]),t}(),F=function(){function t(){s(this,t),this.ke=null,this.wr="settings"}return n(t,null,[{key:"Gt",value:function(){return null===t.Sr&&(t.Sr=new t),t.Sr}}]),n(t,[{key:"Mr",value:function(){return v.Mt(this.ke)&&this.yr(),this.ke}},{key:"Hr",value:function(t,e){var n=this.Mr();return v.I(n[t])?n[t].value:e}},{key:"vr",value:function(t){this.Mr(),delete this.ke[t],this.Pr()}},{key:"Tr",value:function(t,e){this.Mr(),this.ke[t]={Lr:(new Date).getTime(),value:e},this.Pr()}},{key:"br",value:function(t){for(var e in this.Mr(),t)this.ke[e]=t[e];this.Pr()}},{key:"Ar",value:function(t){return v.m(this.ke[t])}},{key:"yr",value:function(){this.ke=localStorage.getItem(this.wr),null===this.ke?this.ke={}:this.ke=JSON.parse(this.ke)}},{key:"Pr",value:function(){null!==this.ke&&localStorage.setItem(this.wr,JSON.stringify(this.ke))}}]),t}();F.Sr=null;var U=function(){function t(){return s(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return o(t,G),n(t,[{key:"hn",value:function(){for(var n=e(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"hn",this).call(this),r=this.gn(".setting",!0),i=F.Gt(),o=function(t){var e=r[t],n=e.name,o=void 0;o=e.dataset.raw?localStorage.getItem(n):i.Hr(n);var s=!1;e instanceof HTMLInputElement&&("checkbox"===e.type||"radio"===e.type)&&(s=!0),(!e.dataset.raw&&!i.Ar(n)||e.dataset.raw&&null===o)&&v.I(r[t].dataset.default)&&(o=e.dataset.default,v.I(e.dataset.defaultTranslateable)&&(e.dataset.translation="",e.dataset.translationValue=o,o=d.translate(o))),v.I(o)&&(s?e.checked=o===e.value:e.value=o,""!==o&&e.classList.add("notEmpty")),e.addEventListener("change",function(){var t=this.value;s&&!this.checked&&(t=null),e.dataset.raw?localStorage.setItem(n,t):i.Tr(n,t),delete e.dataset.translationValue,delete e.dataset.translation})},s=0;sn&&o.zr[n].click(e,i,t)}),this.list=i,i}},{key:"Gr",value:function(){for(var t=document.createElement("tr"),e=document.createElement("tr"),n=[],r=0,i=this.zr.length;r=1&&(n=this.$r(n),r[0].values(n))}},{key:"Yr",value:function(t){t?this.Vr.classList.add("sending"):this.Vr.classList.remove("sending")}}]),t}(),$=function(){function t(e){s(this,t);var n=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,t.Zr,"settings"));for(var r in t.to)n.eo(r,new t.to[r](n));return n.active=null,n}return o(t,b),n(t,[{key:"eo",value:function(t,e){this.mn("#settings-fragments",e),delete this.rn["#settings-fragments"],this.rn[t]=e}},{key:"ln",value:function(){var n=e(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"ln",this).call(this);return v.I(this.active)&&!this.rn[this.active].un()&&this.setActive(null),this.no(),n}},{key:"setActive",value:function(t){v.I(this.active)&&(this.rn[this.active].sn.then(function(t){t.classList.remove("active")}),this.gn("#show-fragment-"+this.active).classList.remove("active")),this.active=t,v.I(this.active)&&(this.rn[this.active].sn.then(function(t){t.classList.add("active")}),this.gn("#show-fragment-"+this.active).classList.add("active"))}},{key:"no",value:function(){var t=this,e=this.gn("#settings-fragment-list");e.removeAllChildren();var n=this,r=function(r){if(t.rn[r].un()){var i=document.createElement("li");i.id="show-fragment-"+r,i.appendChild(d.pt(r,null,"a")),i.addEventListener("click",function(){n.setActive(r)}),e.appendChild(i),v.Mt(t.active)&&t.setActive(r)}};for(var i in this.rn)r(i)}}],[{key:"eo",value:function(e,n){t.to[e]=n}},{key:"so",value:function(e){t.io=e}},{key:"ro",value:function(e){t.Zr=e}}]),t}();$.Zr="core/html/settings.html",$.to={},$.io=!0,$.oo=null,$.ao=!0,a.t(function(t){var e=this;if($.io){if(t.Ns("settings",$),v.Mt($.oo)){var n=new l("settings",r(regeneratorRuntime.mark(function n(){var r,i;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!((r=t.ms())instanceof $)){e.next=5;break}r.finish(),e.next=9;break;case 5:return e.next=7,t.gs(function(t){return t instanceof $});case 7:i=e.sent,v.I(i)?i.kn():t.Ln($);case 9:case"end":return e.stop()}},n,e)})),l.Z,1e4);n.q("img/settings.png"),$.oo=n}$.ao&&t.ds($.oo)}});var K=function(){function t(){s(this,t)}return n(t,null,[{key:"init",value:function(e){t.lo=null,t.ho={uo:!1,id:null,accesses:["default"]},t.app=e,t.co=new Promise(function(e){t.do=e})}},{key:"setData",value:function(e){t.ho=Object.assign(t.ho,e);var n=t.app.Rs();n&&n.ys()}},{key:"mo",value:function(e){return t.lo=v.m(e,t.lo),B.load(t.lo).then(function(e){e.success&&t.setData(e.result),t.do()})}},{key:"po",value:function(){return B.load("u/logout").then(function(e){if(e.success){t.setData(e.result);var n=t.app.Rs();n&&n.Ms(),I.oi(I.ai,d.translate("logged-out-successfully"))}})}},{key:"fo",value:function(e){return t.ho.accesses.indexOf(e)>=0}},{key:"So",value:function(e,n){t.wo(function(r){n(r&&t.Mo(e))})}},{key:"wo",value:function(e){this.co.then(function(){e(t.yo())})}},{key:"Mo",value:function(e){return t.ho.id===e}},{key:"yo",value:function(){return v.I(t.ho)&&v.I(t.ho.id)}}]),t}();a.t(function(t){return K.init(t),K.mo("u/me").then(function(){K.wo(function(t){if(t){var e=F.Gt(),n=v.Se(e.Mr());for(var r in n)n[r].value=JSON.stringify(n[r].value);B.send("u/syncSettings",n).then(function(t){if(t.success){for(var n in t.result)t.result[n].value=JSON.parse(t.result[n].value);e.br(t.result)}})}})})});var Z=function(){function t(e,n,r,o,a){var u;return s(this,t),(u=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n,r,o))).Ho=v.m(a,"default"),u}return o(t,l),n(t,[{key:"O",value:function(){return e(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"O",this).call(this)&&K.fo(this.Ho)}},{key:"vo",value:function(){return this.Ho}},{key:"G",value:function(n){var r=e(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"G",this).call(this,v.m(n,new t));return r.Ho=this.Ho,r}}]),t}(),Q=function(){function t(e){return s(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,"userManagement/html/403.html"))}return o(t,b),t}(),tt=function(){function t(e,n,r,o){var a;return s(this,t),(a=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n,r))).Ho=o,a}return o(t,b),n(t,[{key:"an",value:function(n){return K.fo(this.Ho)?e(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"an",this).call(this,n):(this.Ln(Q),void this.finish({error:403}))}},{key:"ln",value:function(n){return K.fo(this.Ho)?e(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"ln",this).call(this,n):(this.Ln(Q),void this.finish({error:403}))}}]),t}(),et=function(){function t(e,n,r,o){s(this,t);var a=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n,r,o)),u=e.querySelector("#email"),l=e.querySelector("#password"),c=function(){u.setCustomValidity(""),l.setCustomValidity("")};return u.addEventListener("keydown",c),l.addEventListener("keydown",c),a}return o(t,V),t}(),nt=function(){function t(e,n,r,o){return s(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n,r,o))}return o(t,V),n(t,[{key:"Po",value:function(){}}]),t}(),rt=function(){function t(e,n,r){var o;return s(this,t),(o=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n))).Ho=r,o}return o(t,G),n(t,[{key:"un",value:function(){return e(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"un",this).call(this)&&K.fo(this.Ho)}}]),t}(),it=function(){function t(e){return s(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,"userManagement/html/fragments/passwordSettings.html","online"))}return o(t,rt),n(t,[{key:"hn",value:function(){var n=e(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"hn",this).call(this),r=new V(document.getElementById("change-password-form"),"u/passwordSettings/set","post");return r.pr(function(t){for(var e=0,n=t.length;e0,!t.t0){t.next=8;break}return t.next=8,new Promise(function(t){setTimeout(t,u),n.style.fontSize=c+"px"});case 8:return h=this,f=function(){return new Promise(function(t){setTimeout(function(){t(h.Xo(e,n,r,i,o,s,a,u,!1))},"number"==typeof l?l:255)})},t.abrupt("return",(!1!==l&&window.addEventListener("resize",f),f));case 10:case"end":return t.stop()}},t,this)}));return function(){return t.apply(this,arguments)}}()},{key:"Yo",value:function(){var t=r(regeneratorRuntime.mark(function t(e,n,r,i,o,s,a,u){return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.Xo(1,e,n,r,i,o,s,a,u));case 1:case"end":return t.stop()}},t,this)}));return function(){return t.apply(this,arguments)}}()},{key:"Qo",value:function(){var t=r(regeneratorRuntime.mark(function t(e,n,r,i,o,s,a,u){var l,c,h,f,p,d,m,y,g,k,w,_;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:for(s=v.m(s,10),i=v.m(i,!1),o=v.m(o,!1),a=v.m(a,n.innerHTML.length),u=v.m(u,!0),(l=r.classList.contains("no-transition"))||r.classList.add("no-transition"),c=0,h=[],f=0;f<5;f++)h.push(0);p=n.style.fontSize,d=1,m=0,y=0,g=0,k=0;case 6:if(d+=h[c]/(a+1),n.style.fontSize=d+"px",w=window.getComputedStyle(r),g=w.getPropertyValue("width").replace("px",""),k=w.getPropertyValue("height").replace("px",""),m=g-n.offsetWidth,y=k-n.offsetHeight,c=(c+1)%5,(_=o?y:i?m:Math.min(m,y))!==h[(c+1)%5]){t.next=12;break}return t.abrupt("break",14);case 12:h[c]=_;case 13:if((m>(1-e)*g||o)&&(y>(1-e)*k||i)){t.next=6;break}case 14:if(d-=s,n.style.fontSize=u?d+"px":p,t.t0=l,t.t0){t.next=21;break}return t.next=20,new Promise(function(t){setTimeout(t,50)});case 20:r.classList.remove("no-transition");case 21:return t.abrupt("return",d);case 22:case"end":return t.stop()}},t,this)}));return function(){return t.apply(this,arguments)}}()}]),t}(),mt=function(){function t(e,n,r){s(this,t),this.buffer=n,this.Zo=!1,this.loopStart=null,this.loopEnd=null,this.ta=r,this.context=e,this.startTime=null,this.ea=null,this.source=null,this.na=!1}return n(t,[{key:"sa",value:function(t){this.buffer=t}},{key:"ia",value:function(t,e,n){this.Zo=t,v.I(e)&&(this.loopStart=e),v.I(n)&&(this.loopEnd=n)}},{key:"start",value:function(){var t=r(regeneratorRuntime.mark(function t(e,n,r){var i;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e=v.m(e,0),n=v.m(n,0),(i=this.context.createBufferSource()).loop=this.Zo,v.I(this.loopStart)&&(i.loopStart=this.loopStart),v.I(this.loopEnd)&&(i.loopEnd=this.loopEnd),i.buffer=this.buffer,t.next=8,this.ta(i);case 8:v.Mt(r)?i.start(e,n):i.start(e,n,r),this.startTime=(new Date).getTime()-1e3*v.m(n,0),this.source=i,this.na=!0;case 12:case"end":return t.stop()}},t,this)}));return function(){return t.apply(this,arguments)}}()},{key:"stop",value:function(){var t=r(regeneratorRuntime.mark(function t(e){return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",v.I(this.source)?(e=v.m(e,0),this.ea=(new Date).getTime()-this.startTime,this.na=!1,this.source.stop(e)):null);case 1:case"end":return t.stop()}},t,this)}));return function(){return t.apply(this,arguments)}}()},{key:"resume",value:function(){var t=r(regeneratorRuntime.mark(function t(){return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(this.na){t.next=2;break}return t.abrupt("return",this.start(null,v.m(this.ea,0)/1e3));case 2:case"end":return t.stop()}},t,this)}));return function(){return t.apply(this,arguments)}}()}]),t}(),yt=function(){function e(){var t=this;s(this,e),this.ra={},this.context=new AudioContext,this.context.onstatechange=function(){console.log("stateChange from context",arguments)},this.context.oncomplete=function(){console.log("onComplete from context",arguments)},window.addEventListener("visibilitychange",function(){t.oa()})}return n(e,null,[{key:"Gt",value:function(){return v.Mt(e.te)&&(e.te=new e),e.te}}]),n(e,[{key:"aa",value:function(){return"suspended"!==this.context.state}},{key:"set",value:function(t,n){var r=this;n=v.m(n,e.ha.la);var i=v.m(this.ra[n],{});"string"==typeof t&&(t={ua:t});var o=t.ua;return v.I(o)&&(i.ca=fetch(o).then(function(t){return t.arrayBuffer()}).then(function(t){return new Promise(function(e){return r.context.decodeAudioData(t,e)})}).catch(function(t){return console.error(t)}),this.stop(n)),i.muted=v.m(t.muted,i.muted,!1),i.volume=v.m(t.volume,i.volume,1),i.loop=v.m(t.loop,i.loop,!1),i.da=v.m(t.da,i.da,0),this.ra[n]=i,i.muted&&this.stop(n),this.ra[n]}},{key:"ma",value:function(){var t=r(regeneratorRuntime.mark(function t(){return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if("function"!=typeof this.context.resume){t.next=2;break}return t.abrupt("return",this.context.resume());case 2:case"end":return t.stop()}},t,this)}));return function(){return t.apply(this,arguments)}}()},{key:"play",value:function(){var n=r(regeneratorRuntime.mark(function n(r,i){var o,s,a=this;return regeneratorRuntime.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(this.ma(),r=v.m(r,e.ha.la),v.Mt(i)?i={}:"object"!=(void 0===i?"undefined":t(i))&&(i={ua:i}),i.da=v.m(i.da,0),this.stop(r),this.set(i,r),this.ra[r].muted){n.next=10;break}return n.next=3,this.ra[r].ca;case 3:return o=n.sent,(s=new mt(this.context,o,function(t){var e=a.context.createGain();e.gain.value=a.ra[r].volume,t.connect(e),e.connect(a.context.destination)})).sa(o),s.ia(this.ra[r].loop,.3,o.duration-.3),this.ra[r].source=s,n.next=10,s.start();case 10:return n.abrupt("return",this.ra[r]);case 11:case"end":return n.stop()}},n,this)}));return function(){return n.apply(this,arguments)}}()},{key:"stop",value:function(t){t=v.m(t,e.ha.la);var n=this.ra[t];v.I(n)&&v.I(n.source)&&n.source.stop()}},{key:"get",value:function(t){return t=v.m(t,e.ha.la),this.ra[t]}},{key:"resume",value:function(){var t=r(regeneratorRuntime.mark(function t(n){return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(n=v.m(n,e.ha.la),!v.I(this.ra[n])||this.ra[n].muted||!v.I(this.ra[n].source)){t.next=2;break}return t.abrupt("return",this.ra[n].source.resume());case 2:case"end":return t.stop()}},t,this)}));return function(){return t.apply(this,arguments)}}()},{key:"ga",value:function(){for(var t in this.ra)v.I(this.ra[t].source)&&this.ra[t].source.stop()}},{key:"pa",value:function(){for(var t in this.ra)v.I(this.ra[t])&&!this.ra[t].muted&&v.I(this.ra[t].source)&&this.ra[t].source.resume()}},{key:"oa",value:function(){document.hidden?this.ga():this.pa()}}]),e}();yt.ha={fa:"music",Sa:"sound",la:"default"},a.t(function(){L.Ps.push(function(){yt.Gt().ga()}),L.vs.push(function(){yt.Gt().pa()})});var gt=function(){function t(e){s(this,t),"string"==typeof e&&(e={code:e}),this.wa=e,this.Ma=!1}return n(t,[{key:"ya",value:function(t){this.Ma=t}},{key:"Ha",value:function(){return this.Ma}},{key:"va",value:function(){return B.send("c/code",this.wa)}}]),t}(),kt=function(){function t(e){return s(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,"core/html/load.html","code"))}return o(t,b),n(t,[{key:"an",value:function(n){e(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"an",this).call(this,n),console.log(n);Promise.resolve();if(v.I(n.code)){var r=n.code,i=v.m(n.cachable,!1),o=new gt(r);o.ya(i);var s=this;o.va().then(function(t){t.success?I.oi(I.ai,d.translate(v.m(t.result.successMessage,"code-activated"))):I.oi(I.ai,d.translate(t.errors[0])),s.finish()})}}}]),t}();a.t(function(t){t.Ns("code",kt)});var wt=function(){function t(e){return s(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,"contact/html/contact.html",t.Pa))}return o(t,b),n(t,[{key:"hn",value:function(){var n=this;new V(this.gn("#contact-form"),"contact","post").pr(function(){I.oi("contact-message-sent"),n.finish()}),e(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"hn",this).call(this)}}]),t}();wt.Pa="contactMe",a.t(function(t){wt.Pa&&t.Ns(wt.Pa,wt)});var _t=function(){function t(){return s(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return o(t,b),t}(),bt=function(){function t(e,n,r,i){s(this,t),this.Ta=e,this.La=n,this.ba=r,this.Aa=i}return n(t,[{key:"Ca",value:function(){return v.cloneNode(this.Ta)}},{key:"ka",value:function(){return v.cloneNode(this.La)}},{key:"Fa",value:function(){return v.cloneNode(this.ba)}},{key:"xa",value:function(){return v.cloneNode(this.Aa)}}]),t}(),xt=function(){function t(e){s(this,t),this.rotation=0,this.vn=e,this.parent=null}return n(t,[{key:"Da",value:function(t){return t}},{key:"Ra",value:function(){return!1}},{key:"Ba",value:function(t){this.parent=t}},{key:"Ia",value:function(){if(null!==this.parent)return this.parent.Ia()}},{key:"Ua",value:function(){return!1}},{key:"Ea",value:function(){return 0===this.rotation}},{key:"rotate",value:function(){var t=r(regeneratorRuntime.mark(function t(){return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",Promise.resolve());case 1:case"end":return t.stop()}},t,this)}));return function(){return t.apply(this,arguments)}}()},{key:"Wa",value:function(){}},{key:"Na",value:function(t){return t}},{key:"Oa",value:function(t){return t}},{key:"_a",value:function(t){return t}},{key:"ja",value:function(){return this.vn}}]),t}(),Ot=function(){function t(e,n){var r;return s(this,t),(r=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e))).Va="A",v.I(n)&&r.Ja(n),r}return o(t,xt),n(t,[{key:"Ra",value:function(e){return e instanceof t&&e.Va===this.Va}},{key:"Ja",value:function(t){this.Va=t}},{key:"Wa",value:function(){this.vn.querySelector(".leaf-element").removeAllChildren().appendChild(document.createTextNode(this.Va))}}]),t}(),Lt=function(){function t(e){var n;s(this,t),(n=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e))).children=[],n.Xa="rotate-0",n.Ga=!0,n.Qa=100,n.Ya=0;var r=n;return n.Za=function(e){var n=(new Date).getTime(),i=null,o=null;if(e.changedTouches.length>=1&&(i=document.elementFromPoint(e.changedTouches[0].pageX,e.changedTouches[0].pageY),o={x:e.changedTouches[0].pageX,y:e.changedTouches[0].pageY}),null!=i&&0===e.targetTouches.length&&r.vn.contains(t.za)&&r.vn.contains(i)){if(e.stopPropagation(),e.preventDefault(),r.Ya+r.Qa>n)return;r.Ia().tl(r),r.rotate(t.za,i,t.$a,o),r.Ya=(new Date).getTime()}},n.el=function(e){var n=(new Date).getTime();if(null!==t.za&&r.vn.contains(t.za)&&r.vn.contains(e.target)){var i={x:e.pageX,y:e.pageY};if(e.stopPropagation(),e.preventDefault(),r.Ya+r.Qa>n)return;r.Ia().tl(r),r.rotate(t.za,e.target,t.$a,i),r.Ya=(new Date).getTime()}},n}return o(t,xt),n(t,[{key:"Ka",value:function(t){this.Ga=t,this.Wa()}}],[{key:"qa",value:function(){window.addEventListener("mousedown",function(e){t.za=e.target,t.$a={x:e.pageX,y:e.pageY}}),window.addEventListener("mouseup",function(){t.za=null,t.$a={}}),window.addEventListener("touchstart",function(e){1===e.targetTouches.length&&(t.za=e.targetTouches[0].target,t.$a={x:e.targetTouches[0].pageX,y:e.targetTouches[0].pageY})}),window.addEventListener("touchend",function(){t.za=null,t.$a={}})}}]),n(t,[{key:"Ua",value:function(){return this.Ga&&!this.Ia().nl()}},{key:"rotate",value:function(){var t=r(regeneratorRuntime.mark(function t(e,n,r,i){var o,s,a,u,l,c,h,f=this;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(o=1,v.I(n)&&v.I(e)&&(v.Mt(r)||v.Mt(i)||Math.abs(r.x-i.x)>5||Math.abs(r.y-i.y)>5)){for(s=-1,a=-1,u=[0,1,3,2],l=0;l=0&&a>=0&&(2===s&&(0===a||1===a)||1===s&&(0===a||3===a)||0===s&&3===a||3===s&&2===a)&&(o=-1)}if(!this.Ua()){t.next=8;break}return this.rotation+=360+90*o,this.rotation%=360,c=this.rotation,this.sl(),this.vn.classList.add("rotating"),-1===o&&this.vn.classList.add("reverse"),h=new Promise(function(t){setTimeout(t,250)}).then(function(){f.rotation===c&&(f.vn.classList.remove("rotating"),f.vn.classList.remove("reverse"))}),t.abrupt("return",(this.Ia().il(h),h));case 8:case"end":return t.stop()}},t,this)}));return function(){return t.apply(this,arguments)}}()},{key:"Ra",value:function(e){if(!(e instanceof t)||e.children.length!==this.children.length)return!1;for(var n=0;n=2&&this.vn.classList.add("layer-"+t),this.Ga||this.vn.classList.add("locked");var e=this.vn.querySelector(".child-container");e.removeAllChildren(),this.sl(),this.vn.removeEventListener("mouseup",this.el),this.vn.removeEventListener("touchend",this.Za),this.vn.addEventListener("mouseup",this.el),this.vn.addEventListener("touchend",this.Za);for(var n=0,r=this.children.length;n=1&&this.children[0]&&this.children[0]instanceof t?this.children[0].al()+1:1}}]),t}();Lt.qa();var Pt=function(){function t(e){s(this,t),this.ll=null,this.words=[],this.hl=[],this.ul=e,this.cl=!1,this.id=null,this.dl=null,this.ml=null;var n=this;this.gl=new Promise(function(t,e){n.dl=t,n.ml=e}),this.tl=function(){}}return n(t,[{key:"pl",value:function(){var t=this.Da(),e=this._a();localStorage.setItem("currentLevel",JSON.stringify({id:this.id,rotations:t,locks:e}))}},{key:"_a",value:function(){return null!==this.ll?this.ll._a([]):[]}},{key:"Da",value:function(){return null!==this.ll?this.ll.Da([]):[]}},{key:"fl",value:function(t){null!==this.ll&&this.ll.Oa(t)}},{key:"Sl",value:function(t){this.id=t}},{key:"$",value:function(){return this.id}},{key:"Ia",value:function(){return this}},{key:"wl",value:function(t){this.ll=t,this.ll.Ba(this),this.hl&&this.Na()}},{key:"Ml",value:function(t){this.words=[];for(var e=0,n=t.length;e=2&&this.words[0].length>=this.Cl&&this.words[1].length>=this.Cl){for(var t=Pt.Al(this.words[0],this.ul.Ca()),e=Pt.Al(this.words[1],this.ul.Ca()),n=new Et(this.ul.Fa()),r=0,i=this.Cl/2;r=6&&this.words[0].length>=this.Cl&&this.words[1].length>=this.Cl&&this.words[2].length>=this.Cl&&this.words[3].length>=this.Cl&&this.words[4].length>=this.Cl&&this.words[5].length>=this.Cl){var t=[];t[0]=Pt.Al(this.words[0],this.ul.Ca()),t[1]=Pt.Al(this.words[1],this.ul.Ca()),t[2]=Pt.Al(this.words[2],this.ul.Ca()),t[3]=Pt.Al(this.words[3],this.ul.Ca()),t[4]=Pt.Al(this.words[4],this.ul.Ca()),t[5]=Pt.Al(this.words[5],this.ul.Ca());for(var e=new Et(this.ul.Fa()),n=0;n=4&&this.words[0].length>=this.Cl&&this.words[1].length>=this.Cl&&this.words[2].length>=this.Cl&&this.words[3].length>=this.Cl){var t=[];t[0]=Pt.Al(this.words[0],this.ul.Ca()),t[1]=Pt.Al(this.words[1],this.ul.Ca()),t[2]=Pt.Al(this.words[2],this.ul.Ca()),t[3]=Pt.Al(this.words[3],this.ul.Ca());for(var e=new Et(this.ul.Fa()),n=0;n=1)&&e.createObjectStore(t.Rl.Dl,{keyPath:"id"}),(v.Mt(n)||n<2&&r>=2)&&i.target.transaction.objectStore(t.Rl.Dl).createIndex("played",["deleted","played","difficulty","id"],{unique:!1}),(v.Mt(n)||n<3&&r>=3)&&i.target.transaction.objectStore(t.Rl.Dl).createIndex("difficulty","difficulty",{unique:!1}),(v.Mt(n)||n<3&&r>=4)&&e.createObjectStore(t.Rl.Bl,{keyPath:"name"})}},{key:"Il",value:function(){var e=r(regeneratorRuntime.mark(function e(n){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.vi(n,t.Rl.Dl).catch(function(t){console.error("insert error!",t)}));case 1:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}()},{key:"Ul",value:function(){var e=r(regeneratorRuntime.mark(function e(n){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.load(n,t.Rl.Dl));case 1:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}()},{key:"El",value:function(){var e=r(regeneratorRuntime.mark(function e(n){var r,i,o,s,a,u;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.Pi(t.Rl.Dl);case 2:for(r=e.sent,i=[],o=[],s=-1,a=0,u=(r=r.sort(function(t,e){return t.difficulty-e.difficulty})).length;a=t){e-=t,localStorage.setItem("coins",e),this._l.title=e,this._l.j();for(var n=this.level.Tl(),r=(n=n.filter(function(t){return!t.Ea(!1)}))[Math.floor(Math.random()*n.length)];0!==r.rotation;)r.rotate();r.Ka(!1),this.level.pl(),pt.push(["trackEvent","LevelSite","Help","Coins",parseInt(v.m(localStorage.getItem("coins"),"0"))])}else I.oi("not-enough-coins"),pt.push(["trackEvent","LevelSite","Help","Not enough Coins",parseInt(v.m(localStorage.getItem("coins"),"0"))])}},{key:"oh",value:function(){var e=r(regeneratorRuntime.mark(function e(){var n,r,i,o,s,a,u,l,c,h,f,p,d,m=this;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(this.level.id!==t.uh.hh){e.next=20;break}n=v.m(localStorage.getItem("tutorial-step"),"1"),r=new vt,e.t0=(this.en.classList.add("tutorial"),this.en.classList.add("step-"+n),n),e.next="1"===e.t0?5:"2"===e.t0?11:17;break;case 5:return this.level.bl(function(){m.en.classList.remove("step-1"),localStorage.setItem("tutorial-step","2"),m.oh()}),i=this.gn(".tutorial-text .step-1"),e.next=9,this.Vl();case 9:return r.Yo(i,i.parentElement,null,!0,1,2),e.abrupt("break",18);case 11:return this.level.bl(function(){}),this.level.Hl().then(function(){m.en.classList.remove("tutorial"),m.en.classList.remove("step-2"),localStorage.removeItem("tutorial-step"),m.$l=m.$l.then(function(){I.oi("extra-coins-after-first-level"),localStorage.setItem("coins",parseInt(v.m(localStorage.getItem("coins"),"0"))+50),m._l.k(v.m(localStorage.getItem("coins"),"0")),m._l.j()})}),o=this.gn(".tutorial-text .step-2"),e.next=15,this.Vl();case 15:return r.Yo(o,o.parentElement,null,!0,1,2),e.abrupt("break",18);case 17:this.en.classList.remove("tutorial");case 18:e.next=52;break;case 20:if(this.level.id!==t.uh.dh){e.next=37;break}s=v.m(localStorage.getItem("tutorial-step"),"3"),e.t1=s,e.next="3"===e.t1?25:34;break;case 25:return a=new vt,this.en.classList.add("tutorial"),this.en.classList.add("step-"+s),u=function t(){m.en.classList.remove("tutorial"),m.en.classList.remove("step-3"),localStorage.setItem("tutorial-step","4"),m.gn("#help-button").removeEventListener("click",t),m.Vl()},this.gn("#help-button").addEventListener("click",u),l=this.gn(".tutorial-text .step-3"),e.next=32,this.Vl();case 32:return a.Yo(l,l.parentElement,null,!0,1,2),e.abrupt("break",35);case 34:this.en.classList.remove("tutorial");case 35:e.next=52;break;case 37:if(this.level.id!==t.uh.mh){e.next=52;break}c=v.m(localStorage.getItem("tutorial-step"),"4"),e.t2=c,e.next="4"===e.t2?42:51;break;case 42:return h=new vt,this.en.classList.add("tutorial"),this.en.classList.add("step-"+c),f=this.level.Tl()[0],(p=this.gn("#tutorial-pointer")).remove(),f.vn.appendChild(p),this.level.bl(function(t){f===t&&(m.en.classList.remove("tutorial"),m.en.classList.remove("step-4"),localStorage.setItem("tutorial-step","5"),m.Vl())}),d=this.gn(".tutorial-text .step-4"),e.next=49,this.Vl();case 49:return h.Yo(d,d.parentElement,null,!0,1,2),e.abrupt("break",52);case 51:this.en.classList.remove("tutorial");case 52:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}()}]),t}();Vt.lh=[20,40,60,100,120,140,160],Vt.uh={hh:67,dh:15,mh:341};var Ft=function(){function t(e){return s(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,4))}return o(t,Nt),n(t,[{key:"pl",value:function(){}}]),t}(),Ut=function(){function t(){var e;return s(this,t),e=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,w.tn("html/application/dialog/share.html").then(function(t){t.appendChild(M.ji(window.location.hostname+v.Kt("")));var n=function(){e.close()};return t.querySelectorAll("a").forEach(function(t){t.addEventListener("click",n)}),t}),"share-dialog"))}return o(t,E),t}(),Yt=function(){function t(e){var n;return s(this,t),(n=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,"html/application/menu.html"))).gh=n.ph(),n.listener=null,n}return o(t,_t),n(t,[{key:"ln",value:function(n){var i=this;pt.update("Menu Site");var o=e(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"ln",this).call(this,n),s=new Ft(this.ul);s.Ml(["WORD","ROTA","TORW","ORDR"]),s.Pl(),s.Hl().then(function(){pt.push(["trackEvent","MainMenu","levelSolved"]),i.fh()});var a=s.vl();a.Wa(),this.gn("#level").removeAllChildren().appendChild(a.ja());var u=s.Tl();(function t(){var e=4500*Math.random()+1500;i.Sh=setTimeout(function(){for(var e=-1,n=[],r=0;r=2));r++);1===n.length&&(e=n[0]);var i=Math.floor(Math.random()*u.length);i===e&&(i=(i+1)%u.length),u[i].rotate(),t()},e)})(),this.listener=r(regeneratorRuntime.mark(function t(){var e,n,r,o,s;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e=i.gn("#play-button"),(n=i.gn("#level-number")).innerText=v.m(localStorage.getItem("levelCounter"),1),r=i.gn("#level"),o=new vt,t.next=5,o.Yo(r,r.parentElement,!1,!1,2,8,null,!1);case 5:return s=getComputedStyle(r),e.style.width=s.getPropertyValue("width"),o.Yo(e.children[0],e,null,null,null,4,null,!1),t.next=10,o.Xo(.2,n.parentElement,n.parentElement.parentElement,null,null,null,10,null,!1);case 10:o.Yo(n,n.parentElement,!1,!1,8,null,null,!1);case 11:case"end":return t.stop()}},t,i)})),this.listener(),window.addEventListener("resize",this.listener);var l=F.Gt();return this.gn("#play-sound").checked="1"===l.Hr("play-sound","1"),this.gn("#play-music").checked="1"===l.Hr("play-music","1"),o}},{key:"fh",value:function(){var t=r(regeneratorRuntime.mark(function t(){var e=this;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:yt.Gt().ma(),this.Ln(Vt,Promise.race([this.gh,new Promise(function(){var t=r(regeneratorRuntime.mark(function t(n){var r;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Ht.Gt();case 2:return r=t.sent,t.next=5,r.El(Vt.lh);case 5:if(t.t0=t.sent,t.t1=null!==t.t0,!t.t1){t.next=9;break}n();case 9:case"end":return t.stop()}},t,e)}));return function(){return t.apply(this,arguments)}}())]));case 1:case"end":return t.stop()}},t,this)}));return function(){return t.apply(this,arguments)}}()},{key:"hn",value:function(){var n=r(regeneratorRuntime.mark(function n(){var r,i,o,s,a,u,l,c,h=this;return regeneratorRuntime.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:e(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"hn",this).call(this),this.gn("#play-button").addEventListener("click",function(){pt.push(["trackEvent","MainMenu","startButton"]),h.fh()}),r=this.gn("#segment-leaf-template"),i=this.gn("#segment-parent-template"),o=this.gn("#segment-row-template"),s=this.gn("#segment-triangle-template"),r.id=null,i.id=null,o.id=null,s.id=null,r.remove(),i.remove(),o.remove(),s.remove(),this.ul=new bt(r,i,o,s),v.m(t.app.$s)&&t.app.$s.then(function(){h.listener&&h.listener()}),a=F.Gt(),u=yt.Gt(),(l=this.gn("#play-music")).checked="1"===a.Hr("play-music","1"),l.addEventListener("change",function(){a.Tr("play-music",l.checked?"1":"0"),u.set({muted:!l.checked},yt.ha.fa),l.checked&&u.play(yt.ha.fa),pt.push(["trackEvent","MainMenu","PlayMusic","Play Music",l.checked?1:0])}),(c=this.gn("#play-sound")).checked="1"===a.Hr("play-sound","1"),c.addEventListener("change",function(){a.Tr("play-sound",c.checked?"1":"0"),u.set({muted:!c.checked},yt.ha.Sa),pt.push(["trackEvent","MainMenu","PlaySound","Play Sound",c.checked?1:0])}),this.gn("#share-button").addEventListener("click",function(){(new Ut).show()});case 7:case"end":return n.stop()}},n,this)}));return function(){return n.apply(this,arguments)}}()},{key:"cn",value:function(n){clearTimeout(this.Sh),window.removeEventListener("resize",this.listener),e(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"cn",this).call(this,n)}},{key:"ph",value:function(){var t=r(regeneratorRuntime.mark(function t(){var e,n,r,i,o,s,a,u,l,c,h;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,Ht.Gt();case 3:return e=t.sent,t.t0=v,t.next=7,e.Nl();case 7:t.t1=t.sent,n=t.t0.m.call(t.t0,t.t1,0),r=null,i=1,o=[],s=0;case 11:if(!(s=0&&(te="/pwa/wordRotator/publicTest/"),m.Ae(te),d.It=["de"],d.Vt=!1,pt.Jo="2",window.onerror=function(t,e,n){console.error(t,e,n)},String.prototype.format||(String.prototype.format=function(t){return this.replace(/{(\d+)}/g,function(e,n){return void 0!==t[n]?t[n]:e})}),Object.assign=v.m(Object.assign,function(e,n){if(e=v.m(e,{}),null===n||"object"!=(void 0===n?"undefined":t(n))||"isActiveClone"in n)return e;for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(n.isActiveClone=null,e[r]=n[r],delete n.isActiveClone);return e}),"undefined"!=typeof window&&(v.I(window.Node)&&!window.Node.prototype.removeAllChildren&&(Node.prototype.removeAllChildren=function(){for(;this.firstChild;)this.removeChild(this.firstChild);return this}),HTMLElement&&(HTMLElement.prototype.fadeOut=v.m(HTMLElement.prototype.fadeOut,function(t,e,n){t=v.m(t,.5),e=v.m(e,"ease-in-out"),n=v.m(n,0),this.style.transition="opacity "+t+"s "+e+" "+n+"s";var r=this,i=new Promise(function(e){var i=function t(n){r.removeEventListener("transitionend",t),r.removeEventListener("transitioncancel",o),r.style.opacity=null,r.style.transition=null,e(!0,n)},o=function t(n){r.removeEventListener("transitionend",i),r.removeEventListener("transitioncancel",t),r.style.opacity=null,r.style.transition=null,e(!1,n)};r.addEventListener("transitionend",i),r.addEventListener("transitioncancel",o),setTimeout(function(){e(!1)},1e3*(t+n))});return requestAnimationFrame(function(){requestAnimationFrame(function(){r.style.opacity=0})}),i}),HTMLElement.prototype.fadeIn=v.m(HTMLElement.prototype.fadeIn,function(t,e,n){t=v.m(t,.5),e=v.m(e,"ease-in-out"),n=v.m(n,0),this.style.transition="opacity "+t+"s "+e+" "+n+"s";var r=this;return new Promise(function(e){var i=function t(n){r.removeEventListener("transitionend",t),r.removeEventListener("transitioncancel",o),r.style.opacity=null,r.style.transition=null,e(!0,n)},o=function t(n){r.removeEventListener("transitionend",i),r.removeEventListener("transitioncancel",t),r.style.opacity=null,r.style.transition=null,e(!1,n)};r.addEventListener("transitionend",i),r.addEventListener("transitioncancel",o),"1"===getComputedStyle(r).getPropertyValue("opacity")&&e(!1),setTimeout(function(){e(!1)},1e3*(t+n)),requestAnimationFrame(function(){requestAnimationFrame(function(){r.style.opacity=1})})})})),Node&&(Node.prototype.replaceWith=v.m(Node.prototype.replaceWith,function(t){this.parentElement.replaceChild(t,this)}),Node.prototype.remove=v.m(Node.prototype.remove,function(){this.parentElement.removeChild(this)})),Element&&(Element.prototype.matches=v.m(Element.prototype.matches,v.m(Element.prototype.matchesSelector,Element.prototype.webkitMatchesSelector)),window.Element.prototype.closest=v.m(window.Element.prototype.getAll,function(t){var e=this;if(!document.documentElement.contains(e))return null;do{if(e.matches(t))return e;e=e.parentElement}while(null!==e);return null})),window.IDBObjectStore.prototype.getAll=v.m(window.IDBObjectStore.prototype.getAll,function(){var t={},e=[];return this.openCursor().onsuccess=function(n){var r=n.target.result;v.I(r)?(e.push(r.value),r.continue()):v.I(t.onsuccess)&&t.onsuccess({currentTarget:{result:e}})},t})),String.prototype.startsWith=v.m(String.prototype.startsWith,function(t,e){return e=e||0,this.indexOf(t,e)===e}),String.prototype.includes=v.m(String.prototype.includes,function(t){return this.indexOf(t)>=0}),String.prototype.endsWith=v.m(String.prototype.endsWith,function(t,e){var n=this.toString();("number"!=typeof e||!isFinite(e)||Math.floor(e)!==e||e>n.length)&&(e=n.length),e-=t.length;var r=n.indexOf(t,e);return-1!==r&&r===e}),window.fetch=v.m(window.fetch,function(t){console.log("customFetch",t);var e=null;if(window.XMLHttpRequest)e=new XMLHttpRequest;else if(window.Gi)try{e=new ActiveXObject("Msxml2.XMLHTTP")}catch(t){try{e=new ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}var n=new Promise(function(t){e.onload=t,e.onerror=function(e){t(Promise.reject(e))}}),r=new Promise(function(t){t({json:function(){return e.send(),n.then(function(){return JSON.parse(e.responseText)})},text:function(){return e.send(),n.then(function(){return e.responseText})},arrayBuffer:function(){return e.responseType="arraybuffer",e.send(),n.then(function(){return e.response})}})});return e.open("get",t,!0),r}),y.Ee(new q("red","red")),y.Ee(new q("blue","blue")),y.Ee(new q("black","black")),y.Ee(new q("green","green")),y.Ee(new q("pink","pink")),y.Ee(new q("dark","dark")),M._i(new dt(new D("img/whatsapp.svg"),"whatsapp",!0)),M._i(new dt(new A("img/sms.svg"),"sms",!0)),M._i(new dt(new N("img/telegram.svg"),"telegram",!0));var ee=new P;u.l(function(){window.app=ee,window.app.pause=ee.pause,window.app.resume=ee.resume,window.app.setAppEndListener=ee.setAppEndListener}),$.ro("html/application/setting-template.html"),lt.at=!1,ut.ko=!1,a.resolve(ee).then(r(regeneratorRuntime.mark(function t(){var e,n;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:$.oo.p=l.Y,e=F.Gt(),yt.Gt().play(yt.ha.fa,{ua:"sound/brightAndBeautifull__.mp3",loop:!0,volume:.6,muted:"1"!==e.Hr("play-music","1")}).catch(function(t){return console.error(t)}),ee.start(Yt),d.bt("de"),ft.Wo(function(){}),n=ht.Gt(),ft.Eo()&&n.persist(),"1"===v.m(localStorage.getItem("was-open"),"0")?Promise.all([n.xo(),navigator.serviceWorker.ready]).then(function(t){console.log("Init part ",t),t[0]||I.oi("warning-data-not-persistent")}):localStorage.setItem("was-open","1"),window.applyAndroidBridge=u.u;case 5:case"end":return t.stop()}},t,this)}))); \ No newline at end of file +!function(t){"use strict";var e,n=Object.prototype,r=n.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",a=i.toStringTag||"@@toStringTag",u="object"==typeof module,l=t.regeneratorRuntime;if(l)u&&(module.exports=l);else{(l=t.regeneratorRuntime=u?module.exports:{}).wrap=k;var c="suspendedStart",h="suspendedYield",f="executing",p="completed",d={},v={};v[o]=function(){return this};var m=Object.getPrototypeOf,y=m&&m(m(S([])));y&&y!==n&&r.call(y,o)&&(v=y);var g=x.prototype=_.prototype=Object.create(v);b.prototype=g.constructor=x,x.constructor=b,x[a]=b.displayName="GeneratorFunction",l.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},l.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,a in t||(t[a]="GeneratorFunction")),t.prototype=Object.create(g),t},l.awrap=function(t){return{__await:t}},O(L.prototype),L.prototype[s]=function(){return this},l.AsyncIterator=L,l.async=function(t,e,n,r){var i=new L(k(t,e,n,r));return l.isGeneratorFunction(e)?i:i.next().then(function(t){return t.done?t.value:i.next()})},O(g),g[a]="Generator",g[o]=function(){return this},g.toString=function(){return"[object Generator]"},l.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},l.values=S,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(C),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function i(r,i){return a.type="throw",a.arg=t,n.next=r,i&&(n.method="next",n.arg=e),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var s=this.tryEntries[o],a=s.completion;if("root"===s.tryLoc)return i("end");if(s.tryLoc<=this.prev){var u=r.call(s,"catchLoc"),l=r.call(s,"finallyLoc");if(u&&l){if(this.prev=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),C(n),d}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;C(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:S(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),d}}}function k(t,e,n,r){var i=e&&e.prototype instanceof _?e:_,o=Object.create(i.prototype),s=new I(r||[]);return o._invoke=function(t,e,n){var r=c;return function(i,o){if(r===f)throw new Error("Generator is already running");if(r===p){if("throw"===i)throw o;return R()}for(n.method=i,n.arg=o;;){var s=n.delegate;if(s){var a=P(s,n);if(a){if(a===d)continue;return a}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===c)throw r=p,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=f;var u=w(t,e,n);if("normal"===u.type){if(r=n.done?p:h,u.arg===d)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r=p,n.method="throw",n.arg=u.arg)}}}(t,n,s),o}function w(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}function _(){}function b(){}function x(){}function O(t){["next","throw","return"].forEach(function(e){t[e]=function(t){return this._invoke(e,t)}})}function L(t){var e;this._invoke=function(n,i){function o(){return new Promise(function(e,o){!function e(n,i,o,s){var a=w(t[n],t,i);if("throw"!==a.type){var u=a.arg,l=u.value;return l&&"object"==typeof l&&r.call(l,"__await")?Promise.resolve(l.__await).then(function(t){e("next",t,o,s)},function(t){e("throw",t,o,s)}):Promise.resolve(l).then(function(t){u.value=t,o(u)},function(t){return e("throw",t,o,s)})}s(a.arg)}(n,i,e,o)})}return e=e?e.then(o,o):o()}}function P(t,n){var r=t.iterator[n.method];if(r===e){if(n.delegate=null,"throw"===n.method){if(t.iterator.return&&(n.method="return",n.arg=e,P(t,n),"throw"===n.method))return d;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return d}var i=w(r,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,d;var o=i.arg;return o?o.done?(n[t.resultName]=o.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,d):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,d)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function C(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function I(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function S(t){if(t){var n=t[o];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,s=function n(){for(;++i=1;i--){var o={};o[r[i]]=n,n=o}e=r[0]}var s=e;e=function(){window[s]=n}}t.h.push(e)}},{key:"u",value:function(){for(var e=0;e0){this.it.splice(e,1);for(var n=this.wt(t),r=0,i=n.length;r0){var t=arguments[0],n=Array.prototype.slice.call(arguments,1);return e.I(t)&&(0===n.length||e.re.apply(null,[t[n[0]]].concat(n.slice(1))))}return!1}},{key:"Mt",value:function(t){return null===t||void 0===t}},{key:"I",value:function(t){return!e.Mt(t)}},{key:"m",value:function(){for(var t=0;t0&&(o=new Array(r+1-s).join("0")+o),n+=o}return n}},{key:"ge",value:function(t,e){for(var n=Math.floor(Math.log(265)/Math.log(e)),r=t.match(new RegExp(".{1,"+n+"}","g"))||[],i="",o=0,s=r.length;o1&&0==(3&a)&&(a%100!=0||a%400==0)?1:0),3),"%k":""+u,"%l":(u+11)%12+1,"%m":p(s+1,2),"%M":p(n.getMinutes(),2),"%p":u<12?"AM":"PM","%P":u<12?"am":"pm","%s":Math.round(n.getTime()/1e3),"%S":p(n.getSeconds(),2),"%u":i||7,"%V":function(){var t=f(),e=t.valueOf();t.setMonth(0,1);var n=t.getDay();return 4!==n&&t.setMonth(0,1+(4-n+7)%7),p(1+Math.ceil((e-t)/6048e5),2)}(),"%w":""+i,"%x":n.toLocaleDateString(),"%X":n.toLocaleTimeString(),"%y":(""+a).slice(2),"%Y":a,"%z":n.toTimeString().replace(/.+GMT([+-]\d+).+/,"$1"),"%Z":n.toTimeString().replace(/.+\((.+?)\)$/,"$1")}[t]||t})}},{key:"Se",value:function(n){var r=void 0;if(e.Mt(n)||"object"!=(void 0===n?"undefined":t(n)))return n;if(n instanceof Array){var i=[];for(r=0;r",""":'"',"'":"'","’":"’","‘":"‘","–":"–","—":"—","…":"…","”":"”"};return e.I(t)&&"function"==typeof t.replace?t.replace(/\&[\w\d\#]{2,5}\;/g,function(t){return n[t]}):t}},{key:"Me",value:function(t){var e=new FormData;for(var n in t)e.set(n,t[n]);return e}},{key:"ye",value:function(t,n){var r=window.getComputedStyle(t),i=window.getComputedStyle(n);if(i.height>r.height||i.width>r.width)return e.He(t,n)}},{key:"He",value:function(t,n){e.ve(t);for(var r=window.getComputedStyle(t),i=window.getComputedStyle(n),o=0,s=parseFloat(i.getPropertyValue("font-size")),a=i.width,u=i.height;i.height>r.height||i.width>r.width;)if(s*=.95,u>r.height&&(u*=.95),a>i.width&&(a*=.95),n.style["font-size"]=s+"px",n.style["max-height"]=u+"px",n.style["max-width"]=a+"px",++o>2e3){console.log("breaked");break}e.Pe(n),i=window.getComputedStyle(n),n.style["font-size"]=parseFloat(i.getPropertyValue("font-size"))/parseFloat(document.documentElement.clientHeight)*100+"vh"}},{key:"ve",value:function(t){for(var n=t.childNodes,r=0,i=n.length;r-1,i=e.userAgent.indexOf("Edge")>-1;return!!e.userAgent.match("CriOS")||null!==t&&void 0!==t&&"Google Inc."===n&&!1===r&&!1===i}},{key:"Le",value:function(t,e){for(var n={},r=0,i=t.length;r0&&(n=r[0])}else-1!==t.De.indexOf(e)&&(n=e);if(v.I(n)){localStorage.setItem("currentTheme",n.Re);var i=new Promise(function(t){document.querySelector("nav.top-bar").addEventListener("transitionend",function(){t()})});document.body.className=n.Be,t.Ie=n;for(var o=0,s=t.Ue.length;o0?t.xe(n[0]):t.De.length>0&&t.xe(t.De[0])}}},{key:"We",value:function(){return new l(t.Ie.Re,function(e){var n=(t.De.indexOf(t.Ie)+1)%t.De.length;t.xe(t.De[n]),e.title=t.Ie.Re,e.H.j()},h.Y)}},{key:"addChangeListener",value:function(e){t.Ue.push(e)}},{key:"getCurrentTheme",value:function(){return t.Ie}}]),t}();y.Ie=null,y.De=[],y.Ue=[],u.l("ThemeManager",{addChangeListener:y.addChangeListener,getCurrentTheme:y.getCurrentTheme});var g=function(){function t(e){s(this,t),this.Oe=e,this._e=!0,this.je=3650,this.Ve="complianceCookie",this.Je="true"}return n(t,null,[{key:"Ne",value:function(){var e=r(regeneratorRuntime.mark(function e(n){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new t(n).Ne());case 1:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}()}]),n(t,[{key:"Ne",value:function(){var e=r(regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",t.qe(this.Ve)!==this.Je?this.show():Promise.resolve());case 1:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}()},{key:"ze",value:function(){this.$e(this.Ve,this.Je,this.je)}},{key:"$e",value:function(t,e,n){var r=void 0;if(v.I(n)){var i=new Date;i.setTime(i.getTime()+24*n*60*60*1e3),r="; expires="+i.toGMTString()}else r="";this._e&&(document.cookie=t+"="+e+r+"; path=/")}},{key:"Ke",value:function(t){this.$e(t,"",-1)}},{key:"show",value:function(){var t=this,e=document.getElementById(this.Oe);return e.style.display="block",new Promise(function(n){e.querySelector("#close-cookie-msg").onclick=function(){t.ze(),e.remove(),n()}})}}],[{key:"qe",value:function(t){for(var e=t+"=",n=document.cookie.split(";"),r=0;r0||("smedium"===t||"small"===t)&&r.Ze(e.getElementsByClassName(h.S)).length>0||"small"===t&&r.Ze(e.getElementsByClassName(h.yt)).length>0||r.Ze(e.getElementsByClassName(h.tt)).length>0?document.getElementById("responsive-menu-toggle").style.display="block":(document.getElementById("responsive-menu-toggle").style.display="none",v.I(r.Ge)&&r.Ge.close())}},{key:"gt",value:function(){var t=e(r.prototype.__proto__||Object.getPrototypeOf(r.prototype),"gt",this).call(this);return function(e){t(e)instanceof c||!v.I(r.Ge)||r.Ge.close()}}},{key:"ht",value:function(t){var n=e(r.prototype.__proto__||Object.getPrototypeOf(r.prototype),"ht",this).call(this,t);return this.Xe(),r.Ge=this,n}},{key:"close",value:function(){document.getElementById("responsive-menu").style.display="none";for(var t=0,e=this.rt.length;t0;){var o=this.hs.firstChild;o.remove(),i.appendChild(o)}this.us={vn:i,title:document.title};var a=this;window.onpopstate=function(){if(a.ns.length>=1){var t=a.ns[a.ns.length-1].qn();!1!==t.Wn()&&a.Cn(t)}}}return n(t,[{key:"Hn",value:function(){return this.us}},{key:"cs",value:function(t){this.ls=t}},{key:"bn",value:function(){return this.ls}},{key:"ds",value:function(t){this.as.push(t)}},{key:"Dn",value:function(){return this.as}},{key:"ms",value:function(){return v.I(this.ss)?this.ss.qn():null}},{key:"gs",value:function(){var t=r(regeneratorRuntime.mark(function t(e){var n;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:n=this.ns.length-1;case 1:if(!(n>=0)){t.next=9;break}return t.next=4,e(this.ns[n].qn());case 4:if(!t.sent){t.next=6;break}return t.abrupt("return",this.ns[n].qn());case 6:n--,t.next=1;break;case 9:return t.abrupt("return",null);case 10:case"end":return t.stop()}},t,this)}));return function(){return t.apply(this,arguments)}}()},{key:"Ln",value:function(){var t=r(regeneratorRuntime.mark(function t(e,n){var i,o,s,a,u=this;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(e.prototype instanceof b){t.next=2;break}throw{error:"wrong class given! Expected AbstractSite, given "+e.name};case 2:return i=new e(this),o={},s=new Promise(function(t,e){o.resolve=t,o.reject=e}),a=new x(i,o),t.abrupt("return",(this.es.removeAllChildren().appendChild(v.he()),this.os=Promise.resolve(n).then(function(){var t=r(regeneratorRuntime.mark(function t(e){return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return a.Yn(e),t.next=3,Promise.all([i.an(e),i.sn]);case 3:return i.wn=i.xn(u.ps()),t.abrupt("return",u.show(a));case 5:case"end":return t.stop()}},t,u)}));return function(){return t.apply(this,arguments)}}()).catch(function(t){console.error("site start error for site ",e.name,t)}),s));case 4:case"end":return t.stop()}},t,this)}));return function(){return t.apply(this,arguments)}}()},{key:"Cn",value:function(t,e){var n=this;this.os.then(function(){var r=n.fs(t),i=n.ns.splice(r,1),o=null;if((i=i[0])===n.ss){n.ss.qn().cn(),n.ss=null;var s=n.ns.length-1;if(s<0)return n.Ss(),void app.ws();n.es.removeAllChildren().appendChild(v.he()),o=n.ns[s]}i.qn().dn(),Promise.resolve(e).then(function(t){i.Zn().resolve(t),v.I(o)&&n.show(o)})})}},{key:"addListener",value:function(t,e,n,r){this.es.addEventListener(e,function(e){var i=e.target;t.pn&&i.matches(n)&&r(i,e)})}},{key:"On",value:function(t,e,n,r,i){this.addListener(t,n,r,i),this.Nn(t,e,i)}},{key:"Nn",value:function(t,e,n){window.addEventListener("keydown",function(r){t.pn&&r.which===e&&n(this,r)})}},{key:"kn",value:function(t){var e=this.fs(t),n=this.ns.splice(e,1);n=n[0],this.show(n)}},{key:"Ms",value:function(){return this.show(this.ss)}},{key:"show",value:function(t){v.I(this.ss)&&(this.ss.Xn(this.ss.qn().cn()),this.ss.Kn(this.es.innerHTML)),this.es.removeAllChildren().appendChild(v.he());var e=this;return this.ss=t,-1===this.ns.indexOf(t)&&this.ns.push(t),t.qn().sn.then(function(n){return t.qn().wn.j(),e.es.removeAllChildren().appendChild(n),e.Pn(),d.Gt().Xt(),n}).then(function(n){t.qn().ln(t.Gn()),history.pushState({siteName:t.qn().constructor.name,siteData:n.outerHTML,stackPosition:e.ns.length-1},t.qn().constructor.name,t.qn().En())})}},{key:"Bn",value:function(t){if(v.I(this.ss)&&this.ss.qn()===t){history.replaceState({siteName:t.constructor.name,siteData:t.en.outerHTML,stackPosition:this.ns.length-1},t.constructor.name,t.En())}}},{key:"ms",value:function(){if(null!=this.ss)return this.ss.qn()}},{key:"ys",value:function(){null!=this.ss&&this.ss.qn().wn.j()}},{key:"Pn",value:function(){var t=this.ms().title;this.hs.removeAllChildren().appendChild(t.vn),document.title=v.m(t.title,this.us.title)}},{key:"fs",value:function(t){for(var e=0,n=this.ns.length;e=0&&(this.Cs[e].remove(!0),this.Cs.splice(e,1))}},{key:"Ln",value:function(t,e){return this.Ts.Ln(t,e)}},{key:"start",value:function(e){m.Ae(this.Ce);var n=v.m(this.js(),e),r=t.zs();this.xs=e,d.init(),y.init(),this.ks&&this.ds(y.We()),this.Ts=new O(this.bs,this.Ls),this.Ts.as=this.Cs,this.Ts.cs(e),this.Ts.Ln(n,r),this.Vs(),this.Fs&&(this.$s=g.Ne("cookie-compliance"))}},{key:"ms",value:function(){return this.Ts.ms()}},{key:"ws",value:function(){var t=r(regeneratorRuntime.mark(function t(){return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:"function"==typeof this.Ds&&this.Ds();case 1:case"end":return t.stop()}},t,this)}));return function(){return t.apply(this,arguments)}}()},{key:"setAppEndListener",value:function(t){this.Ds=t}},{key:"gs",value:function(){var t=r(regeneratorRuntime.mark(function t(e){return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.Ts.gs(e));case 1:case"end":return t.stop()}},t,this)}));return function(){return t.apply(this,arguments)}}()}],[{key:"Js",value:function(t){if(v.Mt(t))return null;for(var e={},n=[],r=t.split("&"),i=0;i0&&(e[n[0]]=decodeURIComponent(n[1]));return e}},{key:"zs",value:function(){return t.Js(window.location.search.substr(1))}}]),t}(),E=function(){function t(e,n){s(this,t),this.Ks=null,this.content=null,this.Gs=null,this.cancelable=!0,this.title=v.m(n,""),this.Xs=!0,this.Qs="",this.buttons=[],this.result=null,v.I(e)&&this.Ys(e)}return n(t,[{key:"k",value:function(t){return this.title=t,this}},{key:"Zs",value:function(t){this.Xs=t}},{key:"ti",value:function(t){this.Qs=t}},{key:"R",value:function(){return this.title}},{key:"ei",value:function(t){return this.cancelable=!0===t,this}},{key:"Ys",value:function(){var t=r(regeneratorRuntime.mark(function t(e){return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return this.ni=Promise.resolve(e),t.next=3,this.ni;case 3:return this.content=t.sent,t.abrupt("return",this);case 5:case"end":return t.stop()}},t,this)}));return function(){return t.apply(this,arguments)}}()},{key:"si",value:function(t,e,n){n=v.m(n,!0);var r=null;"string"==typeof t?((r=document.createElement("button")).classList.add("button"),r.classList.add("right"),r.appendChild(d.pt(t))):r=t;var i=this;if("function"!=typeof e){var o=e;e=function(){i.result=o}}var s;s=n?function(t){v.I(e)&&e(t),i.close()}:e,v.I(s)&&r.addEventListener("click",s),this.buttons.push(r)}},{key:"show",value:function(){var t=r(regeneratorRuntime.mark(function t(){var e,n,r,i,o,s,a,u,l;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:for((e=document.createElement("span")).classList.add("title"),this.Xs&&""!==this.title?e.appendChild(d.pt(this.title)):e.innerHTML=this.title,(n=document.createElement("div")).appendChild(e),(r=document.createElement("div")).classList.add("content-container"),(i=document.createElement("div")).className=this.Qs,i.classList.add("modal"),i.appendChild(n),i.appendChild(r),(o=document.createElement("div")).classList.add("modal-button-container"),s=0,a=this.buttons.length;s0&&e.ri(e.li,i),e.li++}}]),e}();I.li=0,I.hi=3500,I.ui=1e3,I.ai="success",I.ci="error",I.di="default",I.mi="info",I.gi="warning";var S=function(){function t(e,n){var i,o=this;s(this,t),this.pi=new Promise((i=r(regeneratorRuntime.mark(function t(r,i){var s,a;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return s=null,s=window.sqlite?new Promise(function(t){!function e(){window.sqliteIndexedDB?t(window.sqliteIndexedDB):setTimeout(e,200),console.log("t")}()}):Promise.resolve(window.myIndexedDB||window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB||window.shimIndexedDB),console.log("indexeddb 1"),t.next=5,s;case 5:o.fi=t.sent,console.log("indexeddb 2"),o.Si=o.fi.open(e,n),a=o,o.Si.onupgradeneeded=function(t){try{a.wi(a.Si.result,t.oldVersion,t.newVersion,t)}catch(t){throw i(t),t}},a.Si.onsuccess=function(t){a.Dt=a.Si.result,r(t)};case 10:case"end":return t.stop()}},t,o)})),function(){return i.apply(this,arguments)}))}return n(t,[{key:"Mi",value:function(t,e,n){var r=this;return"function"==typeof e&&v.Mt(n)&&(n=e,e="read"),this.pi.then(function(){var i=null;try{i=r.Si.result.transaction(t,e)}catch(e){console.warn(e),i=r.Si.result.transaction(t)}n(i)})}},{key:"yi",value:function(t,e,n){return"function"==typeof e&&v.Mt(n)&&(n=e,e="readonly"),this.Mi(t,e,function(e){n(e.objectStore(t))})}},{key:"Hi",value:function(t,e){var n=this;return new Promise(function(r){n.yi(e,"readwrite",function(e){var n=e.put(t);n.onsuccess=r,n.onerror=function(t){throw{type:"indexed-db-error",event:t}}})})}},{key:"vi",value:function(t,e){var n=this;return new Promise(function(r){n.yi(e,"readwrite",function(e){for(var n=[],i=function(r,i){n.push(new Promise(function(n){var r=e.put(t[i]);r.onsuccess=n,r.onerror=function(t){throw{type:"indexed-db-error",event:t}}}))},o=0,s=t.length;o=0){var n=new E("optimistic-locking-dialog","optimistic-locking-dialog-title");n.ii(),n.show()}else t(e)}:t,this.lr=n}},{key:"ur",value:function(){if(!this.rr){var t=this;return this.submit().then(function(e){if(e.success){if(null!==t.ar)return t.ar(e.result)}else if(v.I(t.lr))return t.lr(e.errors)})}}},{key:"load",value:function(t,e){return this.dr(B.load(t,e).then(function(t){return t.success?t.result:{}})),this}},{key:"dr",value:function(t){this.mr(!0);var e=this;return Promise.resolve(t).then(function(t){for(var n in e.mr(!1),t)if(v.I(e.sr.elements[n])){if(v.I(e.sr.elements[n].options)&&v.I(t[n+"Options"])){var r=e.sr.elements[n].options;for(var i in t[n+"Options"]){var o=document.createElement("option");o.value=i,o.innerText=t[n+"Options"][i],r.add(o)}}e.sr.elements[n].value=v.we(t[n]),v.I(t[n])&&""!==(""+t[n]).trim()?e.sr.elements[n].classList.add("notEmpty"):e.sr.elements[n].classList.remove("notEmpty")}return e})}},{key:"hr",value:function(){var t=r(regeneratorRuntime.mark(function t(e){var n,r,i,o;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:for(i in n=!1,r=null,e)v.I(this.sr.elements[i])&&"hidden"!==this.sr.elements[i].type&&v.Mt(this.sr.elements[i].gr)&&(v.Mt(this.sr.elements[i].disabled)||!this.sr.elements[i].disabled)&&(this.sr.elements[i].setCustomValidity(d.translate(v.m(e[i],"form-default-error"))),n=!0),v.Mt(r)&&(r=v.m(e[i],"form-default-error"));if(n||!v.I(r)){t.next=11;break}t.t0=regeneratorRuntime.keys(this.sr.elements);case 4:if((t.t1=t.t0()).done){t.next=11;break}if(o=t.t1.value,"hidden"===this.sr.elements[o].type){t.next=9;break}return this.sr.elements[o].setCustomValidity(d.translate(r)),n=!0,t.abrupt("break",11);case 9:t.next=4;break;case 11:n&&this.sr.querySelector("input[type=submit]").click();case 12:case"end":return t.stop()}},t,this)}));return function(){return t.apply(this,arguments)}}()},{key:"mr",value:function(t){this.rr=t,this.rr?this.sr.classList.add("sending"):this.sr.classList.remove("sending")}},{key:"submit",value:function(){var t=this;return new Promise(function(e){t.mr(!0);var n=new FormData(t.sr);e(t.or(n))}).then(function(e){return t.mr(!1),e})}},{key:"pr",value:function(t){this.ar=t}}]),t}(),F=function(){function t(){s(this,t),this.ke=null,this.wr="settings"}return n(t,null,[{key:"Gt",value:function(){return null===t.Sr&&(t.Sr=new t),t.Sr}}]),n(t,[{key:"Mr",value:function(){return v.Mt(this.ke)&&this.yr(),this.ke}},{key:"Hr",value:function(t,e){var n=this.Mr();return v.I(n[t])?n[t].value:e}},{key:"vr",value:function(t){this.Mr(),delete this.ke[t],this.Pr()}},{key:"Tr",value:function(t,e){this.Mr(),this.ke[t]={Lr:(new Date).getTime(),value:e},this.Pr()}},{key:"br",value:function(t){for(var e in this.Mr(),t)this.ke[e]=t[e];this.Pr()}},{key:"Ar",value:function(t){return v.m(this.ke[t])}},{key:"yr",value:function(){this.ke=localStorage.getItem(this.wr),null===this.ke?this.ke={}:this.ke=JSON.parse(this.ke)}},{key:"Pr",value:function(){null!==this.ke&&localStorage.setItem(this.wr,JSON.stringify(this.ke))}}]),t}();F.Sr=null;var U=function(){function t(){return s(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return o(t,G),n(t,[{key:"hn",value:function(){for(var n=e(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"hn",this).call(this),r=this.gn(".setting",!0),i=F.Gt(),o=function(t){var e=r[t],n=e.name,o=void 0;o=e.dataset.raw?localStorage.getItem(n):i.Hr(n);var s=!1;e instanceof HTMLInputElement&&("checkbox"===e.type||"radio"===e.type)&&(s=!0),(!e.dataset.raw&&!i.Ar(n)||e.dataset.raw&&null===o)&&v.I(r[t].dataset.default)&&(o=e.dataset.default,v.I(e.dataset.defaultTranslateable)&&(e.dataset.translation="",e.dataset.translationValue=o,o=d.translate(o))),v.I(o)&&(s?e.checked=o===e.value:e.value=o,""!==o&&e.classList.add("notEmpty")),e.addEventListener("change",function(){var t=this.value;s&&!this.checked&&(t=null),e.dataset.raw?localStorage.setItem(n,t):i.Tr(n,t),delete e.dataset.translationValue,delete e.dataset.translation})},s=0;sn&&o.zr[n].click(e,i,t)}),this.list=i,i}},{key:"Gr",value:function(){for(var t=document.createElement("tr"),e=document.createElement("tr"),n=[],r=0,i=this.zr.length;r=1&&(n=this.$r(n),r[0].values(n))}},{key:"Yr",value:function(t){t?this.Vr.classList.add("sending"):this.Vr.classList.remove("sending")}}]),t}(),$=function(){function t(e){s(this,t);var n=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,t.Zr,"settings"));for(var r in t.to)n.eo(r,new t.to[r](n));return n.active=null,n}return o(t,b),n(t,[{key:"eo",value:function(t,e){this.mn("#settings-fragments",e),delete this.rn["#settings-fragments"],this.rn[t]=e}},{key:"ln",value:function(){var n=e(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"ln",this).call(this);return v.I(this.active)&&!this.rn[this.active].un()&&this.setActive(null),this.no(),n}},{key:"setActive",value:function(t){v.I(this.active)&&(this.rn[this.active].sn.then(function(t){t.classList.remove("active")}),this.gn("#show-fragment-"+this.active).classList.remove("active")),this.active=t,v.I(this.active)&&(this.rn[this.active].sn.then(function(t){t.classList.add("active")}),this.gn("#show-fragment-"+this.active).classList.add("active"))}},{key:"no",value:function(){var t=this,e=this.gn("#settings-fragment-list");e.removeAllChildren();var n=this,r=function(r){if(t.rn[r].un()){var i=document.createElement("li");i.id="show-fragment-"+r,i.appendChild(d.pt(r,null,"a")),i.addEventListener("click",function(){n.setActive(r)}),e.appendChild(i),v.Mt(t.active)&&t.setActive(r)}};for(var i in this.rn)r(i)}}],[{key:"eo",value:function(e,n){t.to[e]=n}},{key:"so",value:function(e){t.io=e}},{key:"ro",value:function(e){t.Zr=e}}]),t}();$.Zr="core/html/settings.html",$.to={},$.io=!0,$.oo=null,$.ao=!0,a.t(function(t){var e=this;if($.io){if(t.Ns("settings",$),v.Mt($.oo)){var n=new l("settings",r(regeneratorRuntime.mark(function n(){var r,i;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!((r=t.ms())instanceof $)){e.next=5;break}r.finish(),e.next=9;break;case 5:return e.next=7,t.gs(function(t){return t instanceof $});case 7:i=e.sent,v.I(i)?i.kn():t.Ln($);case 9:case"end":return e.stop()}},n,e)})),l.Z,1e4);n.q("img/settings.png"),$.oo=n}$.ao&&t.ds($.oo)}});var K=function(){function t(){s(this,t)}return n(t,null,[{key:"init",value:function(e){t.lo=null,t.ho={uo:!1,id:null,accesses:["default"]},t.app=e,t.co=new Promise(function(e){t.do=e})}},{key:"setData",value:function(e){t.ho=Object.assign(t.ho,e);var n=t.app.Rs();n&&n.ys()}},{key:"mo",value:function(e){return t.lo=v.m(e,t.lo),B.load(t.lo).then(function(e){e.success&&t.setData(e.result),t.do()})}},{key:"po",value:function(){return B.load("u/logout").then(function(e){if(e.success){t.setData(e.result);var n=t.app.Rs();n&&n.Ms(),I.oi(I.ai,d.translate("logged-out-successfully"))}})}},{key:"fo",value:function(e){return t.ho.accesses.indexOf(e)>=0}},{key:"So",value:function(e,n){t.wo(function(r){n(r&&t.Mo(e))})}},{key:"wo",value:function(e){this.co.then(function(){e(t.yo())})}},{key:"Mo",value:function(e){return t.ho.id===e}},{key:"yo",value:function(){return v.I(t.ho)&&v.I(t.ho.id)}}]),t}();a.t(function(t){return K.init(t),K.mo("u/me").then(function(){K.wo(function(t){if(t){var e=F.Gt(),n=v.Se(e.Mr());for(var r in n)n[r].value=JSON.stringify(n[r].value);B.send("u/syncSettings",n).then(function(t){if(t.success){for(var n in t.result)t.result[n].value=JSON.parse(t.result[n].value);e.br(t.result)}})}})})});var Z=function(){function t(e,n,r,o,a){var u;return s(this,t),(u=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n,r,o))).Ho=v.m(a,"default"),u}return o(t,l),n(t,[{key:"O",value:function(){return e(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"O",this).call(this)&&K.fo(this.Ho)}},{key:"vo",value:function(){return this.Ho}},{key:"G",value:function(n){var r=e(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"G",this).call(this,v.m(n,new t));return r.Ho=this.Ho,r}}]),t}(),Q=function(){function t(e){return s(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,"userManagement/html/403.html"))}return o(t,b),t}(),tt=function(){function t(e,n,r,o){var a;return s(this,t),(a=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n,r))).Ho=o,a}return o(t,b),n(t,[{key:"an",value:function(n){return K.fo(this.Ho)?e(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"an",this).call(this,n):(this.Ln(Q),void this.finish({error:403}))}},{key:"ln",value:function(n){return K.fo(this.Ho)?e(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"ln",this).call(this,n):(this.Ln(Q),void this.finish({error:403}))}}]),t}(),et=function(){function t(e,n,r,o){s(this,t);var a=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n,r,o)),u=e.querySelector("#email"),l=e.querySelector("#password"),c=function(){u.setCustomValidity(""),l.setCustomValidity("")};return u.addEventListener("keydown",c),l.addEventListener("keydown",c),a}return o(t,V),t}(),nt=function(){function t(e,n,r,o){return s(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n,r,o))}return o(t,V),n(t,[{key:"Po",value:function(){}}]),t}(),rt=function(){function t(e,n,r){var o;return s(this,t),(o=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n))).Ho=r,o}return o(t,G),n(t,[{key:"un",value:function(){return e(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"un",this).call(this)&&K.fo(this.Ho)}}]),t}(),it=function(){function t(e){return s(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,"userManagement/html/fragments/passwordSettings.html","online"))}return o(t,rt),n(t,[{key:"hn",value:function(){var n=e(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"hn",this).call(this),r=new V(document.getElementById("change-password-form"),"u/passwordSettings/set","post");return r.pr(function(t){for(var e=0,n=t.length;e0,!t.t0){t.next=8;break}return t.next=8,new Promise(function(t){setTimeout(t,u),n.style.fontSize=c+"px"});case 8:return h=this,f=function(){return new Promise(function(t){setTimeout(function(){t(h.Xo(e,n,r,i,o,s,a,u,!1))},"number"==typeof l?l:255)})},t.abrupt("return",(!1!==l&&window.addEventListener("resize",f),f));case 10:case"end":return t.stop()}},t,this)}));return function(){return t.apply(this,arguments)}}()},{key:"Yo",value:function(){var t=r(regeneratorRuntime.mark(function t(e,n,r,i,o,s,a,u){return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.Xo(1,e,n,r,i,o,s,a,u));case 1:case"end":return t.stop()}},t,this)}));return function(){return t.apply(this,arguments)}}()},{key:"Qo",value:function(){var t=r(regeneratorRuntime.mark(function t(e,n,r,i,o,s,a,u){var l,c,h,f,p,d,m,y,g,k,w,_;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:for(s=v.m(s,10),i=v.m(i,!1),o=v.m(o,!1),a=v.m(a,n.innerHTML.length),u=v.m(u,!0),(l=r.classList.contains("no-transition"))||r.classList.add("no-transition"),c=0,h=[],f=0;f<5;f++)h.push(0);p=n.style.fontSize,d=1,m=0,y=0,g=0,k=0;case 6:if(d+=h[c]/(a+1),n.style.fontSize=d+"px",w=window.getComputedStyle(r),g=w.getPropertyValue("width").replace("px",""),k=w.getPropertyValue("height").replace("px",""),m=g-n.offsetWidth,y=k-n.offsetHeight,c=(c+1)%5,(_=o?y:i?m:Math.min(m,y))!==h[(c+1)%5]){t.next=12;break}return t.abrupt("break",14);case 12:h[c]=_;case 13:if((m>(1-e)*g||o)&&(y>(1-e)*k||i)){t.next=6;break}case 14:if(d-=s,n.style.fontSize=u?d+"px":p,t.t0=l,t.t0){t.next=21;break}return t.next=20,new Promise(function(t){setTimeout(t,50)});case 20:r.classList.remove("no-transition");case 21:return t.abrupt("return",d);case 22:case"end":return t.stop()}},t,this)}));return function(){return t.apply(this,arguments)}}()}]),t}(),mt=function(){function t(e,n,r){s(this,t),this.buffer=n,this.Zo=!1,this.loopStart=null,this.loopEnd=null,this.ta=r,this.context=e,this.startTime=null,this.ea=null,this.source=null,this.na=!1}return n(t,[{key:"sa",value:function(t){this.buffer=t}},{key:"ia",value:function(t,e,n){this.Zo=t,v.I(e)&&(this.loopStart=e),v.I(n)&&(this.loopEnd=n)}},{key:"start",value:function(){var t=r(regeneratorRuntime.mark(function t(e,n,r){var i;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e=v.m(e,0),n=v.m(n,0),(i=this.context.createBufferSource()).loop=this.Zo,v.I(this.loopStart)&&(i.loopStart=this.loopStart),v.I(this.loopEnd)&&(i.loopEnd=this.loopEnd),i.buffer=this.buffer,t.next=8,this.ta(i);case 8:v.Mt(r)?i.start(e,n):i.start(e,n,r),this.startTime=(new Date).getTime()-1e3*v.m(n,0),this.source=i,this.na=!0;case 12:case"end":return t.stop()}},t,this)}));return function(){return t.apply(this,arguments)}}()},{key:"stop",value:function(){var t=r(regeneratorRuntime.mark(function t(e){return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",v.I(this.source)?(e=v.m(e,0),this.ea=(new Date).getTime()-this.startTime,this.na=!1,this.source.stop(e)):null);case 1:case"end":return t.stop()}},t,this)}));return function(){return t.apply(this,arguments)}}()},{key:"resume",value:function(){var t=r(regeneratorRuntime.mark(function t(){return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(this.na){t.next=2;break}return t.abrupt("return",this.start(null,v.m(this.ea,0)/1e3));case 2:case"end":return t.stop()}},t,this)}));return function(){return t.apply(this,arguments)}}()}]),t}(),yt=function(){function e(){var t=this;s(this,e),this.ra={},this.context=new AudioContext,this.context.onstatechange=function(){console.log("stateChange from context",arguments)},this.context.oncomplete=function(){console.log("onComplete from context",arguments)},window.addEventListener("visibilitychange",function(){t.oa()})}return n(e,null,[{key:"Gt",value:function(){return v.Mt(e.te)&&(e.te=new e),e.te}}]),n(e,[{key:"aa",value:function(){return"suspended"!==this.context.state}},{key:"set",value:function(t,n){var r=this;n=v.m(n,e.ha.la);var i=v.m(this.ra[n],{});"string"==typeof t&&(t={ua:t});var o=t.ua;return v.I(o)&&(i.ca=fetch(o).then(function(t){return t.arrayBuffer()}).then(function(t){return new Promise(function(e){return r.context.decodeAudioData(t,e)})}).catch(function(t){return console.error(t)}),this.stop(n)),i.muted=v.m(t.muted,i.muted,!1),i.volume=v.m(t.volume,i.volume,1),i.loop=v.m(t.loop,i.loop,!1),i.da=v.m(t.da,i.da,0),this.ra[n]=i,i.muted&&this.stop(n),this.ra[n]}},{key:"ma",value:function(){var t=r(regeneratorRuntime.mark(function t(){return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if("function"!=typeof this.context.resume){t.next=2;break}return t.abrupt("return",this.context.resume());case 2:case"end":return t.stop()}},t,this)}));return function(){return t.apply(this,arguments)}}()},{key:"play",value:function(){var n=r(regeneratorRuntime.mark(function n(r,i){var o,s,a=this;return regeneratorRuntime.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(this.ma(),r=v.m(r,e.ha.la),v.Mt(i)?i={}:"object"!=(void 0===i?"undefined":t(i))&&(i={ua:i}),i.da=v.m(i.da,0),this.stop(r),this.set(i,r),this.ra[r].muted){n.next=10;break}return n.next=3,this.ra[r].ca;case 3:return o=n.sent,(s=new mt(this.context,o,function(t){var e=a.context.createGain();e.gain.value=a.ra[r].volume,t.connect(e),e.connect(a.context.destination)})).sa(o),s.ia(this.ra[r].loop,.3,o.duration-.3),this.ra[r].source=s,n.next=10,s.start();case 10:return n.abrupt("return",this.ra[r]);case 11:case"end":return n.stop()}},n,this)}));return function(){return n.apply(this,arguments)}}()},{key:"stop",value:function(t){t=v.m(t,e.ha.la);var n=this.ra[t];v.I(n)&&v.I(n.source)&&n.source.stop()}},{key:"get",value:function(t){return t=v.m(t,e.ha.la),this.ra[t]}},{key:"resume",value:function(){var t=r(regeneratorRuntime.mark(function t(n){return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(n=v.m(n,e.ha.la),!v.I(this.ra[n])||this.ra[n].muted||!v.I(this.ra[n].source)){t.next=2;break}return t.abrupt("return",this.ra[n].source.resume());case 2:case"end":return t.stop()}},t,this)}));return function(){return t.apply(this,arguments)}}()},{key:"ga",value:function(){for(var t in this.ra)v.I(this.ra[t].source)&&this.ra[t].source.stop()}},{key:"pa",value:function(){for(var t in this.ra)v.I(this.ra[t])&&!this.ra[t].muted&&v.I(this.ra[t].source)&&this.ra[t].source.resume()}},{key:"oa",value:function(){document.hidden?this.ga():this.pa()}}]),e}();yt.ha={fa:"music",Sa:"sound",la:"default"},a.t(function(){L.Ps.push(function(){yt.Gt().ga()}),L.vs.push(function(){yt.Gt().pa()})});var gt=function(){function t(e){s(this,t),"string"==typeof e&&(e={code:e}),this.wa=e,this.Ma=!1}return n(t,[{key:"ya",value:function(t){this.Ma=t}},{key:"Ha",value:function(){return this.Ma}},{key:"va",value:function(){return B.send("c/code",this.wa)}}]),t}(),kt=function(){function t(e){return s(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,"core/html/load.html","code"))}return o(t,b),n(t,[{key:"an",value:function(n){e(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"an",this).call(this,n),console.log(n);Promise.resolve();if(v.I(n.code)){var r=n.code,i=v.m(n.cachable,!1),o=new gt(r);o.ya(i);var s=this;o.va().then(function(t){t.success?I.oi(I.ai,d.translate(v.m(t.result.successMessage,"code-activated"))):I.oi(I.ai,d.translate(t.errors[0])),s.finish()})}}}]),t}();a.t(function(t){t.Ns("code",kt)});var wt=function(){function t(e){return s(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,"contact/html/contact.html",t.Pa))}return o(t,b),n(t,[{key:"hn",value:function(){var n=this;new V(this.gn("#contact-form"),"contact","post").pr(function(){I.oi("contact-message-sent"),n.finish()}),e(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"hn",this).call(this)}}]),t}();wt.Pa="contactMe",a.t(function(t){wt.Pa&&t.Ns(wt.Pa,wt)});var _t=function(){function t(){return s(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return o(t,b),t}(),bt=function(){function t(e,n,r,i){s(this,t),this.Ta=e,this.La=n,this.ba=r,this.Aa=i}return n(t,[{key:"Ca",value:function(){return v.cloneNode(this.Ta)}},{key:"ka",value:function(){return v.cloneNode(this.La)}},{key:"Fa",value:function(){return v.cloneNode(this.ba)}},{key:"xa",value:function(){return v.cloneNode(this.Aa)}}]),t}(),xt=function(){function t(e){s(this,t),this.rotation=0,this.vn=e,this.parent=null}return n(t,[{key:"Da",value:function(t){return t}},{key:"Ra",value:function(){return!1}},{key:"Ba",value:function(t){this.parent=t}},{key:"Ia",value:function(){if(null!==this.parent)return this.parent.Ia()}},{key:"Ua",value:function(){return!1}},{key:"Ea",value:function(){return 0===this.rotation}},{key:"rotate",value:function(){var t=r(regeneratorRuntime.mark(function t(){return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",Promise.resolve());case 1:case"end":return t.stop()}},t,this)}));return function(){return t.apply(this,arguments)}}()},{key:"Wa",value:function(){}},{key:"Na",value:function(t){return t}},{key:"Oa",value:function(t){return t}},{key:"_a",value:function(t){return t}},{key:"ja",value:function(){return this.vn}}]),t}(),Ot=function(){function t(e,n){var r;return s(this,t),(r=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e))).Va="A",v.I(n)&&r.Ja(n),r}return o(t,xt),n(t,[{key:"Ra",value:function(e){return e instanceof t&&e.Va===this.Va}},{key:"Ja",value:function(t){this.Va=t}},{key:"Wa",value:function(){this.vn.querySelector(".leaf-element").removeAllChildren().appendChild(document.createTextNode(this.Va))}}]),t}(),Lt=function(){function t(e){var n;s(this,t),(n=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e))).children=[],n.Xa="rotate-0",n.Ga=!0,n.Qa=100,n.Ya=0;var r=n;return n.Za=function(e){var n=(new Date).getTime(),i=null,o=null;if(e.changedTouches.length>=1&&(i=document.elementFromPoint(e.changedTouches[0].pageX,e.changedTouches[0].pageY),o={x:e.changedTouches[0].pageX,y:e.changedTouches[0].pageY}),null!=i&&0===e.targetTouches.length&&r.vn.contains(t.za)&&r.vn.contains(i)){if(e.stopPropagation(),e.preventDefault(),r.Ya+r.Qa>n)return;r.Ia().tl(r),r.rotate(t.za,i,t.$a,o),r.Ya=(new Date).getTime()}},n.el=function(e){var n=(new Date).getTime();if(null!==t.za&&r.vn.contains(t.za)&&r.vn.contains(e.target)){var i={x:e.pageX,y:e.pageY};if(e.stopPropagation(),e.preventDefault(),r.Ya+r.Qa>n)return;r.Ia().tl(r),r.rotate(t.za,e.target,t.$a,i),r.Ya=(new Date).getTime()}},n}return o(t,xt),n(t,[{key:"Ka",value:function(t){this.Ga=t,this.Wa()}}],[{key:"qa",value:function(){window.addEventListener("mousedown",function(e){t.za=e.target,t.$a={x:e.pageX,y:e.pageY}}),window.addEventListener("mouseup",function(){t.za=null,t.$a={}}),window.addEventListener("touchstart",function(e){1===e.targetTouches.length&&(t.za=e.targetTouches[0].target,t.$a={x:e.targetTouches[0].pageX,y:e.targetTouches[0].pageY})}),window.addEventListener("touchend",function(){t.za=null,t.$a={}})}}]),n(t,[{key:"Ua",value:function(){return this.Ga&&!this.Ia().nl()}},{key:"rotate",value:function(){var t=r(regeneratorRuntime.mark(function t(e,n,r,i){var o,s,a,u,l,c,h,f=this;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(o=1,v.I(n)&&v.I(e)&&(v.Mt(r)||v.Mt(i)||Math.abs(r.x-i.x)>5||Math.abs(r.y-i.y)>5)){for(s=-1,a=-1,u=[0,1,3,2],l=0;l=0&&a>=0&&(2===s&&(0===a||1===a)||1===s&&(0===a||3===a)||0===s&&3===a||3===s&&2===a)&&(o=-1)}if(!this.Ua()){t.next=8;break}return this.rotation+=360+90*o,this.rotation%=360,c=this.rotation,this.sl(),this.vn.classList.add("rotating"),-1===o&&this.vn.classList.add("reverse"),h=new Promise(function(t){setTimeout(t,250)}).then(function(){f.rotation===c&&(f.vn.classList.remove("rotating"),f.vn.classList.remove("reverse"))}),t.abrupt("return",(this.Ia().il(h),h));case 8:case"end":return t.stop()}},t,this)}));return function(){return t.apply(this,arguments)}}()},{key:"Ra",value:function(e){if(!(e instanceof t)||e.children.length!==this.children.length)return!1;for(var n=0;n=2&&this.vn.classList.add("layer-"+t),this.Ga||this.vn.classList.add("locked");var e=this.vn.querySelector(".child-container");e.removeAllChildren(),this.sl(),this.vn.removeEventListener("mouseup",this.el),this.vn.removeEventListener("touchend",this.Za),this.vn.addEventListener("mouseup",this.el),this.vn.addEventListener("touchend",this.Za);for(var n=0,r=this.children.length;n=1&&this.children[0]&&this.children[0]instanceof t?this.children[0].al()+1:1}}]),t}();Lt.qa();var Pt=function(){function t(e){s(this,t),this.ll=null,this.words=[],this.hl=[],this.ul=e,this.cl=!1,this.id=null,this.dl=null,this.ml=null;var n=this;this.gl=new Promise(function(t,e){n.dl=t,n.ml=e}),this.tl=function(){}}return n(t,[{key:"pl",value:function(){var t=this.Da(),e=this._a();localStorage.setItem("currentLevel",JSON.stringify({id:this.id,rotations:t,locks:e}))}},{key:"_a",value:function(){return null!==this.ll?this.ll._a([]):[]}},{key:"Da",value:function(){return null!==this.ll?this.ll.Da([]):[]}},{key:"fl",value:function(t){null!==this.ll&&this.ll.Oa(t)}},{key:"Sl",value:function(t){this.id=t}},{key:"$",value:function(){return this.id}},{key:"Ia",value:function(){return this}},{key:"wl",value:function(t){this.ll=t,this.ll.Ba(this),this.hl&&this.Na()}},{key:"Ml",value:function(t){this.words=[];for(var e=0,n=t.length;e=2&&this.words[0].length>=this.Cl&&this.words[1].length>=this.Cl){for(var t=Pt.Al(this.words[0],this.ul.Ca()),e=Pt.Al(this.words[1],this.ul.Ca()),n=new Et(this.ul.Fa()),r=0,i=this.Cl/2;r=6&&this.words[0].length>=this.Cl&&this.words[1].length>=this.Cl&&this.words[2].length>=this.Cl&&this.words[3].length>=this.Cl&&this.words[4].length>=this.Cl&&this.words[5].length>=this.Cl){var t=[];t[0]=Pt.Al(this.words[0],this.ul.Ca()),t[1]=Pt.Al(this.words[1],this.ul.Ca()),t[2]=Pt.Al(this.words[2],this.ul.Ca()),t[3]=Pt.Al(this.words[3],this.ul.Ca()),t[4]=Pt.Al(this.words[4],this.ul.Ca()),t[5]=Pt.Al(this.words[5],this.ul.Ca());for(var e=new Et(this.ul.Fa()),n=0;n=4&&this.words[0].length>=this.Cl&&this.words[1].length>=this.Cl&&this.words[2].length>=this.Cl&&this.words[3].length>=this.Cl){var t=[];t[0]=Pt.Al(this.words[0],this.ul.Ca()),t[1]=Pt.Al(this.words[1],this.ul.Ca()),t[2]=Pt.Al(this.words[2],this.ul.Ca()),t[3]=Pt.Al(this.words[3],this.ul.Ca());for(var e=new Et(this.ul.Fa()),n=0;n=1)&&e.createObjectStore(t.Rl.Dl,{keyPath:"id"}),(v.Mt(n)||n<2&&r>=2)&&i.target.transaction.objectStore(t.Rl.Dl).createIndex("played",["deleted","played","difficulty","id"],{unique:!1}),(v.Mt(n)||n<3&&r>=3)&&i.target.transaction.objectStore(t.Rl.Dl).createIndex("difficulty","difficulty",{unique:!1}),console.log("update",n,r),v.Mt(n)||n<6&&r>=6){try{e.deleteObjectStore(t.Rl.Bl)}catch(i){}e.createObjectStore(t.Rl.Bl,{keyPath:"name"})}}},{key:"Il",value:function(){var e=r(regeneratorRuntime.mark(function e(n){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.vi(n,t.Rl.Dl).catch(function(t){console.error("insert error!",t)}));case 1:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}()},{key:"Ul",value:function(){var e=r(regeneratorRuntime.mark(function e(n){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.load(n,t.Rl.Dl));case 1:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}()},{key:"El",value:function(){var e=r(regeneratorRuntime.mark(function e(n){var r,i,o,s,a,u;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.Pi(t.Rl.Dl);case 2:for(r=e.sent,i=[],o=[],s=-1,a=0,u=(r=r.sort(function(t,e){return t.difficulty-e.difficulty})).length;a=t){e-=t,localStorage.setItem("coins",e),this._l.title=e,this._l.j();for(var n=this.level.Tl(),r=(n=n.filter(function(t){return!t.Ea(!1)}))[Math.floor(Math.random()*n.length)];0!==r.rotation;)r.rotate();r.Ka(!1),this.level.pl(),pt.push(["trackEvent","LevelSite","Help","Coins",parseInt(v.m(localStorage.getItem("coins"),"0"))])}else I.oi("not-enough-coins"),pt.push(["trackEvent","LevelSite","Help","Not enough Coins",parseInt(v.m(localStorage.getItem("coins"),"0"))])}},{key:"oh",value:function(){var e=r(regeneratorRuntime.mark(function e(){var n,r,i,o,s,a,u,l,c,h,f,p,d,m=this;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(this.level.id!==t.uh.hh){e.next=20;break}n=v.m(localStorage.getItem("tutorial-step"),"1"),r=new vt,e.t0=(this.en.classList.add("tutorial"),this.en.classList.add("step-"+n),n),e.next="1"===e.t0?5:"2"===e.t0?11:17;break;case 5:return this.level.bl(function(){m.en.classList.remove("step-1"),localStorage.setItem("tutorial-step","2"),m.oh()}),i=this.gn(".tutorial-text .step-1"),e.next=9,this.Vl();case 9:return r.Yo(i,i.parentElement,null,!0,1,2),e.abrupt("break",18);case 11:return this.level.bl(function(){}),this.level.Hl().then(function(){m.en.classList.remove("tutorial"),m.en.classList.remove("step-2"),localStorage.removeItem("tutorial-step"),m.$l=m.$l.then(function(){I.oi("extra-coins-after-first-level"),localStorage.setItem("coins",parseInt(v.m(localStorage.getItem("coins"),"0"))+50),m._l.k(v.m(localStorage.getItem("coins"),"0")),m._l.j()})}),o=this.gn(".tutorial-text .step-2"),e.next=15,this.Vl();case 15:return r.Yo(o,o.parentElement,null,!0,1,2),e.abrupt("break",18);case 17:this.en.classList.remove("tutorial");case 18:e.next=52;break;case 20:if(this.level.id!==t.uh.dh){e.next=37;break}s=v.m(localStorage.getItem("tutorial-step"),"3"),e.t1=s,e.next="3"===e.t1?25:34;break;case 25:return a=new vt,this.en.classList.add("tutorial"),this.en.classList.add("step-"+s),u=function t(){m.en.classList.remove("tutorial"),m.en.classList.remove("step-3"),localStorage.setItem("tutorial-step","4"),m.gn("#help-button").removeEventListener("click",t),m.Vl()},this.gn("#help-button").addEventListener("click",u),l=this.gn(".tutorial-text .step-3"),e.next=32,this.Vl();case 32:return a.Yo(l,l.parentElement,null,!0,1,2),e.abrupt("break",35);case 34:this.en.classList.remove("tutorial");case 35:e.next=52;break;case 37:if(this.level.id!==t.uh.mh){e.next=52;break}c=v.m(localStorage.getItem("tutorial-step"),"4"),e.t2=c,e.next="4"===e.t2?42:51;break;case 42:return h=new vt,this.en.classList.add("tutorial"),this.en.classList.add("step-"+c),f=this.level.Tl()[0],(p=this.gn("#tutorial-pointer")).remove(),f.vn.appendChild(p),this.level.bl(function(t){f===t&&(m.en.classList.remove("tutorial"),m.en.classList.remove("step-4"),localStorage.setItem("tutorial-step","5"),m.Vl())}),d=this.gn(".tutorial-text .step-4"),e.next=49,this.Vl();case 49:return h.Yo(d,d.parentElement,null,!0,1,2),e.abrupt("break",52);case 51:this.en.classList.remove("tutorial");case 52:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}()}]),t}();Vt.lh=[20,40,60,100,120,140,160],Vt.uh={hh:67,dh:15,mh:341};var Ft=function(){function t(e){return s(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,4))}return o(t,Nt),n(t,[{key:"pl",value:function(){}}]),t}(),Ut=function(){function t(){var e;return s(this,t),e=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,w.tn("html/application/dialog/share.html").then(function(t){t.appendChild(M.ji(window.location.hostname+v.Kt("")));var n=function(){e.close()};return t.querySelectorAll("a").forEach(function(t){t.addEventListener("click",n)}),t}),"share-dialog"))}return o(t,E),t}(),Yt=function(){function t(e){var n;return s(this,t),(n=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,"html/application/menu.html"))).gh=n.ph(),n.listener=null,n}return o(t,_t),n(t,[{key:"ln",value:function(n){var i=this;pt.update("Menu Site");var o=e(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"ln",this).call(this,n),s=new Ft(this.ul);s.Ml(["WORD","ROTA","TORW","ORDR"]),s.Pl(),s.Hl().then(function(){pt.push(["trackEvent","MainMenu","levelSolved"]),i.fh()});var a=s.vl();a.Wa(),this.gn("#level").removeAllChildren().appendChild(a.ja());var u=s.Tl();(function t(){var e=4500*Math.random()+1500;i.Sh=setTimeout(function(){for(var e=-1,n=[],r=0;r=2));r++);1===n.length&&(e=n[0]);var i=Math.floor(Math.random()*u.length);i===e&&(i=(i+1)%u.length),u[i].rotate(),t()},e)})(),this.listener=r(regeneratorRuntime.mark(function t(){var e,n,r,o,s;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e=i.gn("#play-button"),(n=i.gn("#level-number")).innerText=v.m(localStorage.getItem("levelCounter"),1),r=i.gn("#level"),o=new vt,t.next=5,o.Yo(r,r.parentElement,!1,!1,2,8,null,!1);case 5:return s=getComputedStyle(r),e.style.width=s.getPropertyValue("width"),o.Yo(e.children[0],e,null,null,null,4,null,!1),t.next=10,o.Xo(.2,n.parentElement,n.parentElement.parentElement,null,null,null,10,null,!1);case 10:o.Yo(n,n.parentElement,!1,!1,8,null,null,!1);case 11:case"end":return t.stop()}},t,i)})),this.listener(),window.addEventListener("resize",this.listener);var l=F.Gt();return this.gn("#play-sound").checked="1"===l.Hr("play-sound","1"),this.gn("#play-music").checked="1"===l.Hr("play-music","1"),o}},{key:"fh",value:function(){var t=r(regeneratorRuntime.mark(function t(){var e=this;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:yt.Gt().ma(),this.Ln(Vt,Promise.race([this.gh,new Promise(function(){var t=r(regeneratorRuntime.mark(function t(n){var r;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Ht.Gt();case 2:return r=t.sent,t.next=5,r.El(Vt.lh);case 5:if(t.t0=t.sent,t.t1=null!==t.t0,!t.t1){t.next=9;break}n();case 9:case"end":return t.stop()}},t,e)}));return function(){return t.apply(this,arguments)}}())]));case 1:case"end":return t.stop()}},t,this)}));return function(){return t.apply(this,arguments)}}()},{key:"hn",value:function(){var n=r(regeneratorRuntime.mark(function n(){var r,i,o,s,a,u,l,c,h=this;return regeneratorRuntime.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:e(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"hn",this).call(this),this.gn("#play-button").addEventListener("click",function(){pt.push(["trackEvent","MainMenu","startButton"]),h.fh()}),r=this.gn("#segment-leaf-template"),i=this.gn("#segment-parent-template"),o=this.gn("#segment-row-template"),s=this.gn("#segment-triangle-template"),r.id=null,i.id=null,o.id=null,s.id=null,r.remove(),i.remove(),o.remove(),s.remove(),this.ul=new bt(r,i,o,s),v.m(t.app.$s)&&t.app.$s.then(function(){h.listener&&h.listener()}),a=F.Gt(),u=yt.Gt(),(l=this.gn("#play-music")).checked="1"===a.Hr("play-music","1"),l.addEventListener("change",function(){a.Tr("play-music",l.checked?"1":"0"),u.set({muted:!l.checked},yt.ha.fa),l.checked&&u.play(yt.ha.fa),pt.push(["trackEvent","MainMenu","PlayMusic","Play Music",l.checked?1:0])}),(c=this.gn("#play-sound")).checked="1"===a.Hr("play-sound","1"),c.addEventListener("change",function(){a.Tr("play-sound",c.checked?"1":"0"),u.set({muted:!c.checked},yt.ha.Sa),pt.push(["trackEvent","MainMenu","PlaySound","Play Sound",c.checked?1:0])}),this.gn("#share-button").addEventListener("click",function(){(new Ut).show()});case 7:case"end":return n.stop()}},n,this)}));return function(){return n.apply(this,arguments)}}()},{key:"cn",value:function(n){clearTimeout(this.Sh),window.removeEventListener("resize",this.listener),e(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"cn",this).call(this,n)}},{key:"ph",value:function(){var t=r(regeneratorRuntime.mark(function t(){var e,n,r,i,o,s,a,u,l,c,h;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,Ht.Gt();case 3:return e=t.sent,t.t0=v,t.next=7,e.Nl();case 7:t.t1=t.sent,n=t.t0.m.call(t.t0,t.t1,0),r=null,i=1,o=[],s=0;case 11:if(!(s=0&&(te="/pwa/wordRotator/publicTest/"),m.Ae(te),d.It=["de"],d.Vt=!1,pt.Jo="2",window.onerror=function(t,e,n){console.error(t,e,n)},String.prototype.format||(String.prototype.format=function(t){return this.replace(/{(\d+)}/g,function(e,n){return void 0!==t[n]?t[n]:e})}),Object.assign=v.m(Object.assign,function(e,n){if(e=v.m(e,{}),null===n||"object"!=(void 0===n?"undefined":t(n))||"isActiveClone"in n)return e;for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(n.isActiveClone=null,e[r]=n[r],delete n.isActiveClone);return e}),"undefined"!=typeof window&&(v.I(window.Node)&&!window.Node.prototype.removeAllChildren&&(Node.prototype.removeAllChildren=function(){for(;this.firstChild;)this.removeChild(this.firstChild);return this}),HTMLElement&&(HTMLElement.prototype.fadeOut=v.m(HTMLElement.prototype.fadeOut,function(t,e,n){t=v.m(t,.5),e=v.m(e,"ease-in-out"),n=v.m(n,0),this.style.transition="opacity "+t+"s "+e+" "+n+"s";var r=this,i=new Promise(function(e){var i=function t(n){r.removeEventListener("transitionend",t),r.removeEventListener("transitioncancel",o),r.style.opacity=null,r.style.transition=null,e(!0,n)},o=function t(n){r.removeEventListener("transitionend",i),r.removeEventListener("transitioncancel",t),r.style.opacity=null,r.style.transition=null,e(!1,n)};r.addEventListener("transitionend",i),r.addEventListener("transitioncancel",o),setTimeout(function(){e(!1)},1e3*(t+n))});return requestAnimationFrame(function(){requestAnimationFrame(function(){r.style.opacity=0})}),i}),HTMLElement.prototype.fadeIn=v.m(HTMLElement.prototype.fadeIn,function(t,e,n){t=v.m(t,.5),e=v.m(e,"ease-in-out"),n=v.m(n,0),this.style.transition="opacity "+t+"s "+e+" "+n+"s";var r=this;return new Promise(function(e){var i=function t(n){r.removeEventListener("transitionend",t),r.removeEventListener("transitioncancel",o),r.style.opacity=null,r.style.transition=null,e(!0,n)},o=function t(n){r.removeEventListener("transitionend",i),r.removeEventListener("transitioncancel",t),r.style.opacity=null,r.style.transition=null,e(!1,n)};r.addEventListener("transitionend",i),r.addEventListener("transitioncancel",o),"1"===getComputedStyle(r).getPropertyValue("opacity")&&e(!1),setTimeout(function(){e(!1)},1e3*(t+n)),requestAnimationFrame(function(){requestAnimationFrame(function(){r.style.opacity=1})})})})),Node&&(Node.prototype.replaceWith=v.m(Node.prototype.replaceWith,function(t){this.parentElement.replaceChild(t,this)}),Node.prototype.remove=v.m(Node.prototype.remove,function(){this.parentElement.removeChild(this)})),Element&&(Element.prototype.matches=v.m(Element.prototype.matches,v.m(Element.prototype.matchesSelector,Element.prototype.webkitMatchesSelector)),window.Element.prototype.closest=v.m(window.Element.prototype.getAll,function(t){var e=this;if(!document.documentElement.contains(e))return null;do{if(e.matches(t))return e;e=e.parentElement}while(null!==e);return null})),window.IDBObjectStore.prototype.getAll=v.m(window.IDBObjectStore.prototype.getAll,function(){var t={},e=[];return this.openCursor().onsuccess=function(n){var r=n.target.result;v.I(r)?(e.push(r.value),r.continue()):v.I(t.onsuccess)&&t.onsuccess({currentTarget:{result:e}})},t})),String.prototype.startsWith=v.m(String.prototype.startsWith,function(t,e){return e=e||0,this.indexOf(t,e)===e}),String.prototype.includes=v.m(String.prototype.includes,function(t){return this.indexOf(t)>=0}),String.prototype.endsWith=v.m(String.prototype.endsWith,function(t,e){var n=this.toString();("number"!=typeof e||!isFinite(e)||Math.floor(e)!==e||e>n.length)&&(e=n.length),e-=t.length;var r=n.indexOf(t,e);return-1!==r&&r===e}),window.fetch=v.m(window.fetch,function(t){console.log("customFetch",t);var e=null;if(window.XMLHttpRequest)e=new XMLHttpRequest;else if(window.Gi)try{e=new ActiveXObject("Msxml2.XMLHTTP")}catch(t){try{e=new ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}var n=new Promise(function(t){e.onload=t,e.onerror=function(e){t(Promise.reject(e))}}),r=new Promise(function(t){t({json:function(){return e.send(),n.then(function(){return JSON.parse(e.responseText)})},text:function(){return e.send(),n.then(function(){return e.responseText})},arrayBuffer:function(){return e.responseType="arraybuffer",e.send(),n.then(function(){return e.response})}})});return e.open("get",t,!0),r}),y.Ee(new q("red","red")),y.Ee(new q("blue","blue")),y.Ee(new q("black","black")),y.Ee(new q("green","green")),y.Ee(new q("pink","pink")),y.Ee(new q("dark","dark")),M._i(new dt(new D("img/whatsapp.svg"),"whatsapp",!0)),M._i(new dt(new A("img/sms.svg"),"sms",!0)),M._i(new dt(new N("img/telegram.svg"),"telegram",!0));var ee=new P;u.l(function(){window.app=ee,window.app.pause=ee.pause,window.app.resume=ee.resume,window.app.setAppEndListener=ee.setAppEndListener}),$.ro("html/application/setting-template.html"),lt.at=!1,ut.ko=!1,a.resolve(ee).then(r(regeneratorRuntime.mark(function t(){var e,n;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:$.oo.p=l.Y,e=F.Gt(),yt.Gt().play(yt.ha.fa,{ua:"sound/brightAndBeautifull__.mp3",loop:!0,volume:.6,muted:"1"!==e.Hr("play-music","1")}).catch(function(t){return console.error(t)}),ee.start(Yt),d.bt("de"),ft.Wo(function(){}),n=ht.Gt(),ft.Eo()&&n.persist(),"1"===v.m(localStorage.getItem("was-open"),"0")?Promise.all([n.xo(),navigator.serviceWorker.ready]).then(function(t){console.log("Init part ",t),t[0]||I.oi("warning-data-not-persistent")}):localStorage.setItem("was-open","1"),window.applyAndroidBridge=u.u;case 5:case"end":return t.stop()}},t,this)}))); \ No newline at end of file diff --git a/src/module/Application/pwa/js/WordRotatorDb.js b/src/module/Application/pwa/js/WordRotatorDb.js index f527a59..cba3d58 100755 --- a/src/module/Application/pwa/js/WordRotatorDb.js +++ b/src/module/Application/pwa/js/WordRotatorDb.js @@ -31,9 +31,10 @@ export class WordRotatorDb extends MyDb { console.log("update", oldVersion, newVersion); if (Helper.isNull(oldVersion) || oldVersion < 6 && newVersion >= 6) { - if (!e.target.transaction.objectStore(WordRotatorDb.OBJECT_STORE.SYSTEM_VARS)){ - let levelObjectStore = db.createObjectStore(WordRotatorDb.OBJECT_STORE.SYSTEM_VARS, {"keyPath": "name"}); - } + try { + db.deleteObjectStore(WordRotatorDb.OBJECT_STORE.SYSTEM_VARS); + } catch (e) {} + let levelObjectStore = db.createObjectStore(WordRotatorDb.OBJECT_STORE.SYSTEM_VARS, {"keyPath": "name"}); } }; @@ -50,8 +51,8 @@ export class WordRotatorDb extends MyDb { async loadNextLevel(rendererTypes) { let levels = await this.loadAll(WordRotatorDb.OBJECT_STORE.LEVEL); - levels = levels.sort((a,b) => { - return (a["difficulty"] - b["difficulty"]); + levels = levels.sort((a, b) => { + return (a["difficulty"] - b["difficulty"]); }); let wrongLevels = []; @@ -62,7 +63,7 @@ export class WordRotatorDb extends MyDb { newLevels.push(levels[i]); difficulty = levels[i]["difficulty"]; } - else if (levels[i]["difficulty"] !== 0 && !levels[i]["deleted"] && !levels[i]["played"] ) { + else if (levels[i]["difficulty"] !== 0 && !levels[i]["deleted"] && !levels[i]["played"]) { wrongLevels.push(levels[i]); } } @@ -80,21 +81,21 @@ export class WordRotatorDb extends MyDb { return await this.saveObj(level, WordRotatorDb.OBJECT_STORE.LEVEL); } - async loadDateLastSync(){ + async loadDateLastSync() { let dateLastSync = await this.load("date-last-sync", WordRotatorDb.OBJECT_STORE.SYSTEM_VARS); - if (dateLastSync){ + if (dateLastSync) { return dateLastSync["value"]; } return null; } - async saveDateLastSync(value){ - return await this.saveObj({"name": "date-last-sync", "value":value}, WordRotatorDb.OBJECT_STORE.SYSTEM_VARS) + async saveDateLastSync(value) { + return await this.saveObj({"name": "date-last-sync", "value": value}, WordRotatorDb.OBJECT_STORE.SYSTEM_VARS) } } WordRotatorDb.OBJECT_STORE = { LEVEL: "level", - SYSTEM_VARS:"vars" + SYSTEM_VARS: "vars" }; WordRotatorDb.instance = null;