!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",d="completed",v={},p={};p[o]=function(){return this};var y=Object.getPrototypeOf,m=y&&y(y(C([])));m&&m!==n&&r.call(m,o)&&(p=m);var g=O.prototype=_.prototype=Object.create(p);b.prototype=g.constructor=O,O.constructor=b,O[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,O):(t.__proto__=O,a in t||(t[a]="GeneratorFunction")),t.prototype=Object.create(g),t},l.awrap=function(t){return{__await:t}},L(P.prototype),P.prototype[s]=function(){return this},l.AsyncIterator=P,l.async=function(t,e,n,r){var i=new P(k(t,e,n,r));return l.isGeneratorFunction(e)?i:i.next().then(function(t){return t.done?t.value:i.next()})},L(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=C,S.prototype={constructor:S,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(A),!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),A(n),v}},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;A(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:C(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),v}}}function k(t,e,n,r){var i=e&&e.prototype instanceof _?e:_,o=Object.create(i.prototype),s=new S(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===d){if("throw"===i)throw o;return j()}for(n.method=i,n.arg=o;;){var s=n.delegate;if(s){var a=x(s,n);if(a){if(a===v)continue;return a}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===c)throw r=d,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?d:h,u.arg===v)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r=d,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 O(){}function L(t){["next","throw","return"].forEach(function(e){t[e]=function(t){return this._invoke(e,t)}})}function P(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 x(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,x(t,n),"throw"===n.method))return v;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return v}var i=w(r,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;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,v):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}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 A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function S(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function C(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(;++i0){this.G.splice(e,1);for(var n=this.ut(t),r=0,i=n.length;r0){var t=arguments[0],n=Array.prototype.slice.call(arguments,1);return e.A(t)&&(0===n.length||e.Qt.apply(null,[t[n[0]]].concat(n.slice(1))))}return!1}},{key:"ct",value:function(t){return null===t||void 0===t}},{key:"A",value:function(t){return!e.ct(t)}},{key:"t",value:function(t,n){return e.A(t)?t:n}},{key:"Yt",value:function(t){return!e.empty(t)}},{key:"Zt",value:function(t){var e=[];for(var n in t)e.push(encodeURIComponent(n)+"="+encodeURIComponent(t[n]));return"?"+e.join("&")}},{key:"empty",value:function(t){return e.ct(t)||"string"==typeof t&&""===t.trim()}},{key:"te",value:function(t){var e=document.createElement("template");return e.innerHTML=t,e.content.childNodes}},{key:"ee",value:function(){var t="http://www.w3.org/2000/svg",e=document.createElement("div");e.className="loader";var n=document.createElementNS(t,"svg");n.setAttribute("viewBox","0 0 32 32"),n.setAttribute("widh","32"),n.setAttribute("height","32");var r=document.createElementNS(t,"circle");return r.setAttribute("id","spinner"),r.setAttribute("cx","16"),r.setAttribute("cy","16"),r.setAttribute("r","14"),r.setAttribute("fill","none"),n.appendChild(r),e.appendChild(n),e}},{key:"Nt",value:function(t){return v.ne()+t}},{key:"se",value:function(){return navigator.userAgent.match(/iPhone|iPad|iPod/i)}},{key:"ie",value:function(){return null!==navigator.userAgent.match(/Android|BlackBerry|Opera Mini|IEMobile/i)||e.se()||void 0!==window.orientation||!1===window.orientation||null===window.orientation}},{key:"select",value:function(t){var e=document.createRange();e.selectNodeContents(t);var n=window.getSelection();n.removeAllRanges(),n.addRange(e)}},{key:"format",value:function(t,e){for(t=""+t;t.length0&&(o=new Array(r+1-s).join("0")+o),n+=o}return n}},{key:"oe",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":v(s+1,2),"%M":v(n.getMinutes(),2),"%p":u<12?"AM":"PM","%P":u<12?"am":"pm","%s":Math.round(n.getTime()/1e3),"%S":v(n.getSeconds(),2),"%u":i||7,"%V":function(){var t=d(),e=t.valueOf();t.setMonth(0,1);var n=t.getDay();return 4!==n&&t.setMonth(0,1+(4-n+7)%7),v(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:"he",value:function(n){var r=void 0;if(e.ct(n)||"object"!=(void 0===n?"undefined":t(n)))return n;if(n instanceof Array){var i=[];for(r=0;r",""":'"',"'":"'","’":"’","‘":"‘","–":"–","—":"—","…":"…","”":"”"};return e.A(t)&&"function"==typeof t.replace?t.replace(/\&[\w\d\#]{2,5}\;/g,function(t){return n[t]}):t}},{key:"ce",value:function(t){var e=new FormData;for(var n in t)e.set(n,t[n]);return e}},{key:"de",value:function(t,n){var r=window.getComputedStyle(t),i=window.getComputedStyle(n);if(i.height>r.height||i.width>r.width)return e.ge(t,n)}},{key:"ge",value:function(t,n){e.me(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:"me",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:"Se",value:function(t,e){for(var n={},r=0,i=t.length;r0&&(n=r[0])}else-1!==t.Pe.indexOf(e)&&(n=e);if(d.A(n)){localStorage.setItem("currentTheme",n.Le);var i=new Promise(function(t){document.querySelector("nav.top-bar").addEventListener("transitionend",function(){t()})});document.body.className=n.be,t.Ae=n;for(var o=0,s=t.Fe.length;o0?t.Te(n[0]):t.Pe.length>0&&t.Te(t.Pe[0])}}},{key:"Re",value:function(){return new a(t.Ae.Le,function(e){var n=(t.Pe.indexOf(t.Ae)+1)%t.Pe.length;t.Te(t.Pe[n]),e.title=t.Ae.Le,e.h.k()},l.V)}},{key:"addChangeListener",value:function(e){t.Fe.push(e)}}]),t}();p.Pe=[],p.Fe=[];var y=function(){function t(e){s(this,t),this.xe=e,this.De=!0,this.Be=3650,this.ke="complianceCookie",this.Ie="true"}return n(t,[{key:"Ue",value:function(){t.Ee(this.ke)!==this.Ie&&this.show()}},{key:"We",value:function(){this.Oe(this.ke,this.Ie,this.Be)}},{key:"Oe",value:function(t,e,n){var r=void 0;if(d.A(n)){var i=new Date;i.setTime(i.getTime()+24*n*60*60*1e3),r="; expires="+i.toGMTString()}else r="";this.De&&(document.cookie=t+"="+e+r+"; path=/")}},{key:"Ne",value:function(t){this.Oe(t,"",-1)}},{key:"show",value:function(){var t=this,e=document.getElementById(this.xe);e.style.display="block",e.querySelector("#close-cookie-msg").onclick=function(){t.We(),e.remove()}}}],[{key:"Ee",value:function(t){for(var e=t+"=",n=document.cookie.split(";"),r=0;r0||("smedium"===t||"small"===t)&&r.ze(e.getElementsByClassName(l.o)).length>0||"small"===t&&r.ze(e.getElementsByClassName(l.dt)).length>0||r.ze(e.getElementsByClassName(l.q)).length>0?document.getElementById("responsive-menu-toggle").style.display="block":(document.getElementById("responsive-menu-toggle").style.display="none",d.A(r._e)&&r._e.close())}},{key:"ot",value:function(){var t=e(r.prototype.__proto__||Object.getPrototypeOf(r.prototype),"ot",this).call(this);return function(e){t(e)instanceof u||!d.A(r._e)||r._e.close()}}},{key:"nt",value:function(t){var n=e(r.prototype.__proto__||Object.getPrototypeOf(r.prototype),"nt",this).call(this,t);return this.je(),r._e=this,n}},{key:"close",value:function(){document.getElementById("responsive-menu").style.display="none";for(var t=0,e=this.Y.length;t0;){var i=this.ts.firstChild;i.remove(),r.appendChild(i)}this.es={mn:r,title:document.title};var o=this;window.onpopstate=function(){if(o.Xn.length>=1){var t=o.Xn[o.Xn.length-1].En();!1!==t.Rn()&&o.Hn(t)}}}return n(t,[{key:"gn",value:function(){return this.es}},{key:"ns",value:function(t){this.Zn=t}},{key:"wn",value:function(){return this.Zn}},{key:"ss",value:function(t){this.Yn.push(t)}},{key:"Pn",value:function(){return this.Yn}},{key:"Sn",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 w){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 _(i,o),t.abrupt("return",(this.Kn.removeAllChildren().appendChild(d.ee()),this.Qn=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.Jn(e),t.next=3,Promise.all([i.Ze(e),i.$e]);case 3:return i.un=i.Tn(u.rs()),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:",t)}),s));case 4:case"end":return t.stop()}},t,this)}));return function(){return t.apply(this,arguments)}}()},{key:"Hn",value:function(t,e){var n=this;this.Qn.then(function(){var r=n.os(t),i=n.Xn.splice(r,1),o=null;if((i=i[0])===n.$n){n.$n.En().sn(),n.$n=null;var s=n.Xn.length-1;if(s<0)return n.as(),void n.Sn(n.Zn);n.Kn.removeAllChildren().appendChild(d.ee()),o=n.Xn[s]}i.En().in(),Promise.resolve(e).then(function(t){i.zn().resolve(t),d.A(o)&&n.show(o)})})}},{key:"addListener",value:function(t,e,n,r){this.Kn.addEventListener(e,function(e){var i=e.target;t.an&&i.matches(n)&&r(i,e)})}},{key:"Dn",value:function(t,e,n,r,i){this.addListener(t,n,r,i),this.xn(t,e,i)}},{key:"xn",value:function(t,e,n){window.addEventListener("keydown",function(r){t.an&&r.which===e&&n(this,r)})}},{key:"yn",value:function(t){var e=this.os(t),n=this.Xn.splice(e,1);n=n[0],this.show(n)}},{key:"refreshCurrentSite",value:function(){return this.show(this.$n)}},{key:"show",value:function(t){d.A(this.$n)&&(this.$n.jn(this.$n.En().sn()),this.$n.Nn(this.Kn.innerHTML)),this.Kn.removeAllChildren().appendChild(d.ee());var e=this;return this.$n=t,-1===this.Xn.indexOf(t)&&this.Xn.push(t),t.En().$e.then(function(n){return t.En().un.k(),e.Kn.removeAllChildren().appendChild(n),e.pn(),f._t().jt(),n}).then(function(n){t.En().tn(t._n()),history.pushState({siteName:t.En().constructor.name,siteData:n.outerHTML,stackPosition:e.Xn.length-1},t.En().constructor.name,t.En().Cn())})}},{key:"bn",value:function(t){if(d.A(this.$n)&&this.$n.En()===t){history.replaceState({siteName:t.constructor.name,siteData:t.Ke.outerHTML,stackPosition:this.Xn.length-1},t.constructor.name,t.Cn())}}},{key:"ls",value:function(){if(null!=this.$n)return this.$n.En()}},{key:"hs",value:function(){null!=this.$n&&this.$n.En().un.k()}},{key:"pn",value:function(){var t=this.ls().title;this.ts.removeAllChildren().appendChild(t.mn),document.title=d.t(t.title,this.es.title)}},{key:"os",value:function(t){for(var e=0,n=this.Xn.length;e=0&&(this.ps[e].remove(!0),this.ps.splice(e,1))}},{key:"Sn",value:function(t,e){return this.cs.Sn(t,e)}},{key:"start",value:function(e){v.Me(this.He);var n=d.t(this.Fs(),e),r=t.Ds();this.ws=e,f.init(),p.init(),this.fs&&this.ss(p.Re()),this.cs=new b(this.gs,this.ds),this.cs.Yn=this.ps,this.cs.ns(e),this.cs.Sn(n,r),this.Cs(),this.Ss&&new y("cookie-compliance").Ue()}}],[{key:"Rs",value:function(t){if(d.ct(t))return null;for(var e={},n=[],r=t.split("&"),i=0;i0&&(e[n[0]]=decodeURIComponent(n[1]));return e}},{key:"Ds",value:function(){return t.Rs(window.location.search.substr(1))}}]),t}(),P=function(){function t(e,n){s(this,t),this.Bs=null,this.content=null,this.ks=null,this.cancelable=!0,this.title=d.t(n,""),this.Is=!0,this.Us="",this.buttons=[],this.result=null,d.A(e)&&this.Es(e)}return n(t,[{key:"H",value:function(t){return this.title=t,this}},{key:"Ws",value:function(t){this.Is=t}},{key:"Os",value:function(t){this.Us=t}},{key:"P",value:function(){return this.title}},{key:"Ns",value:function(t){return this.cancelable=!0===t,this}},{key:"Es",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._s=Promise.resolve(e),t.next=3,this._s;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:"js",value:function(t,e,n){n=d.t(n,!0);var r=null;"string"==typeof t?((r=document.createElement("button")).classList.add("button"),r.classList.add("right"),r.appendChild(f.at(t))):r=t;var i=this;if("function"!=typeof e){var o=e;e=function(){i.result=o}}var s;s=n?function(t){d.A(e)&&e(t),i.close()}:e,d.A(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.Is&&""!==this.title?e.appendChild(f.at(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.Us,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.Js(e.Ks,i),e.Ks++}}]),e}();x.Ks=0,x.Xs=3500,x.$s=1e3,x.qs="success",x.Gs="error",x.Qs="default",x.Ys="info",x.Zs="warning";var E=function(){function t(){s(this,t)}return n(t,null,[{key:"ti",value:function(e){if("function"==typeof e){var n=e;e=t.ei.then(function(t){return n(t)})}t.ni.push(e)}},{key:"resolve",value:function(e){return t.si(e),t.ei.then(function(){return Promise.all(t.ni)})}}]),t}();E.ni=[],E.ei=new Promise(function(t){E.si=t});var A=function(){function t(e,n){s(this,t);var r=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB||window.ii;this.ri=r.open(e,n);var i=this;this.ri.onupgradeneeded=function(t){i.oi(i.ri.result,t.oldVersion,t.newVersion,t)},this.ai=new Promise(function(t){i.ri.onsuccess=function(e){i.Pt=i.ri.result,t(e)}})}return n(t,[{key:"li",value:function(t,e,n){var r=this;"function"==typeof e&&d.ct(n)&&(n=e,e="read"),this.ai.then(function(){var i=null;try{i=r.ri.result.transaction(t,e)}catch(e){console.warn(e),i=r.ri.result.transaction(t)}n(i)})}},{key:"hi",value:function(t,e,n){"function"==typeof e&&d.ct(n)&&(n=e,e="readonly"),this.li(t,e,function(e){n(e.objectStore(t))})}},{key:"ui",value:function(t,e){var n=this;return new Promise(function(r){n.hi(e,"readwrite",function(e){var n=e.put(t);n.onsuccess=r,n.onerror=function(t){throw{type:"indexed-db-error",event:t}}})})}},{key:"ci",value:function(t,e){var n=this;return new Promise(function(r){n.hi(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 P("optimistic-locking-dialog","optimistic-locking-dialog-title");n.Vs(),n.show()}else t(e)}:t,this.Gi=n}},{key:"Yi",value:function(){if(!this.Ki){var t=this;return this.submit().then(function(e){if(e.success){if(null!==t.$i)return t.$i(e.result)}else if(d.A(t.Gi))return t.Gi(e.errors)})}}},{key:"load",value:function(t,e){return this.tr(F.load(t,e).then(function(t){return t.success?t.result:{}})),this}},{key:"tr",value:function(t){this.er(!0);var e=this;return Promise.resolve(t).then(function(t){for(var n in e.er(!1),t)if(d.A(e.zi.elements[n])){if(d.A(e.zi.elements[n].options)&&d.A(t[n+"Options"])){var r=e.zi.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.zi.elements[n].value=d.ue(t[n]),d.A(t[n])&&""!==(""+t[n]).trim()?e.zi.elements[n].classList.add("notEmpty"):e.zi.elements[n].classList.remove("notEmpty")}return e})}},{key:"Qi",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)d.A(this.zi.elements[i])&&"hidden"!==this.zi.elements[i].type&&d.ct(this.zi.elements[i].nr)&&(d.ct(this.zi.elements[i].disabled)||!this.zi.elements[i].disabled)&&(this.zi.elements[i].setCustomValidity(f.translate(d.t(e[i],"form-default-error"))),n=!0),d.ct(r)&&(r=d.t(e[i],"form-default-error"));if(n||!d.A(r)){t.next=11;break}t.t0=regeneratorRuntime.keys(this.zi.elements);case 4:if((t.t1=t.t0()).done){t.next=11;break}if(o=t.t1.value,"hidden"===this.zi.elements[o].type){t.next=9;break}return this.zi.elements[o].setCustomValidity(f.translate(r)),n=!0,t.abrupt("break",11);case 9:t.next=4;break;case 11:n&&this.zi.querySelector("input[type=submit]").click();case 12:case"end":return t.stop()}},t,this)}));return function(){return t.apply(this,arguments)}}()},{key:"er",value:function(t){this.Ki=t,this.Ki?this.zi.classList.add("sending"):this.zi.classList.remove("sending")}},{key:"submit",value:function(){var t=this;return new Promise(function(e){t.er(!0);var n=new FormData(t.zi);e(t.Xi(n))}).then(function(e){return t.er(!1),e})}},{key:"sr",value:function(t){this.$i=t}}]),t}(),z=function(){function t(){s(this,t),this.ye=null,this.rr="settings"}return n(t,null,[{key:"_t",value:function(){return null===t.ir&&(t.ir=new t),t.ir}}]),n(t,[{key:"or",value:function(){return d.ct(this.ye)&&this.ar(),this.ye}},{key:"lr",value:function(t,e){var n=this.or();return d.A(n[t])?n[t].value:e}},{key:"hr",value:function(t){this.or(),delete this.ye[t],this.ur()}},{key:"cr",value:function(t,e){this.or(),this.ye[t]={dr:(new Date).getTime(),value:e},this.ur()}},{key:"gr",value:function(t){for(var e in this.or(),t)this.ye[e]=t[e];this.ur()}},{key:"mr",value:function(t){return d.t(this.ye[t])}},{key:"ar",value:function(){this.ye=localStorage.getItem(this.rr),null===this.ye?this.ye={}:this.ye=JSON.parse(this.ye)}},{key:"ur",value:function(){null!==this.ye&&localStorage.setItem(this.rr,JSON.stringify(this.ye))}}]),t}();z.ir=null;var H=function(){function t(){return s(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return o(t,R),n(t,[{key:"en",value:function(){for(var n=e(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"en",this).call(this),r=this.on(".setting",!0),i=z._t(),o=function(t){var e=r[t],n=e.name,o=i.lr(n),s=!1;e instanceof HTMLInputElement&&("checkbox"===e.type||"radio"===e.type)&&(s=!0),!i.mr(n)&&d.A(r[t].dataset.default)&&(o=e.dataset.default,d.A(e.dataset.defaultTranslateable)&&(e.dataset.translation="",e.dataset.translationValue=o,o=f.translate(o))),d.A(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?i.cr(n,t):i.cr(n,null):i.cr(n,t),delete e.dataset.translationValue,delete e.dataset.translation})},s=0;sn&&o.kr[n].click(e,i,t)}),this.list=i,i}},{key:"Er",value:function(){for(var t=document.createElement("tr"),e=document.createElement("tr"),n=[],r=0,i=this.kr.length;r=1&&(n=this.Ir(n),r[0].values(n))}},{key:"Nr",value:function(t){t?this.xr.classList.add("sending"):this.xr.classList.remove("sending")}}]),t}(),U=function(){function t(e){s(this,t);var n=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,t._r,"settings"));for(var r in t.jr)n.Vr(r,new t.jr[r](n));return n.active=null,n}return o(t,w),n(t,[{key:"Vr",value:function(t,e){this.rn("#settings-fragments",e),delete this.Qe["#settings-fragments"],this.Qe[t]=e}},{key:"tn",value:function(){var n=e(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"tn",this).call(this);return d.A(this.active)&&!this.Qe[this.active].nn()&&this.setActive(null),this.Jr(),n}},{key:"setActive",value:function(t){d.A(this.active)&&(this.Qe[this.active].$e.then(function(t){t.classList.remove("active")}),this.on("#show-fragment-"+this.active).classList.remove("active")),this.active=t,d.A(this.active)&&(this.Qe[this.active].$e.then(function(t){t.classList.add("active")}),this.on("#show-fragment-"+this.active).classList.add("active"))}},{key:"Jr",value:function(){var t=this,e=this.on("#settings-fragment-list");e.removeAllChildren();var n=this,r=function(r){if(t.Qe[r].nn()){var i=document.createElement("li");i.id="show-fragment-"+r,i.appendChild(f.at(r,null,"a")),i.addEventListener("click",function(){n.setActive(r)}),e.appendChild(i),d.ct(t.active)&&t.setActive(r)}};for(var i in this.Qe)r(i)}}],[{key:"Vr",value:function(e,n){t.jr[e]=n}},{key:"zr",value:function(e){t.qr=e}},{key:"Kr",value:function(e){t._r=e}}]),t}();U._r="core/html/settings.html",U.jr={},U.qr=!0,U.Xr=null,U.$r=!0,E.ti(function(t){if(U.qr){if(t.Ls("settings",U),d.ct(U.Xr)){var e=new a("settings",function(){t.Sn(U)},a.J,1e4);e.W("img/settings.png"),U.Xr=e}U.$r&&t.ss(U.Xr)}});var X=function(){function t(){s(this,t)}return n(t,null,[{key:"init",value:function(e){t.Gr=null,t.Qr={Yr:!1,id:null,accesses:["default"]},t.app=e,t.Zr=new Promise(function(e){t.to=e})}},{key:"setData",value:function(e){t.Qr=Object.assign(t.Qr,e);var n=t.app.Ms();n&&n.hs()}},{key:"eo",value:function(e){return t.Gr=d.t(e,t.Gr),F.load(t.Gr).then(function(e){e.success&&t.setData(e.result),t.to()})}},{key:"no",value:function(){return F.load("u/logout").then(function(e){if(e.success){t.setData(e.result);var n=t.app.Ms();n&&n.refreshCurrentSite(),x.zs(x.qs,f.translate("logged-out-successfully"))}})}},{key:"so",value:function(e){return t.Qr.accesses.indexOf(e)>=0}},{key:"io",value:function(e,n){t.ro(function(r){n(r&&t.oo(e))})}},{key:"ro",value:function(e){this.Zr.then(function(){e(t.ao())})}},{key:"oo",value:function(e){return t.Qr.id===e}},{key:"ao",value:function(){return d.A(t.Qr)&&d.A(t.Qr.id)}}]),t}();E.ti(function(t){return X.init(t),X.eo("u/me").then(function(){X.ro(function(t){if(t){var e=z._t(),n=d.he(e.or());for(var r in n)n[r].value=JSON.stringify(n[r].value);F.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.gr(t.result)}})}})})});var K=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))).lo=d.t(a,"default"),u}return o(t,a),n(t,[{key:"D",value:function(){return e(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"D",this).call(this)&&X.so(this.lo)}},{key:"ho",value:function(){return this.lo}},{key:"_",value:function(n){var r=e(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"_",this).call(this,d.t(n,new t));return r.lo=this.lo,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,w),t}(),Y=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))).lo=o,a}return o(t,w),n(t,[{key:"Ze",value:function(n){return X.so(this.lo)?e(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"Ze",this).call(this,n):(this.Sn(Q),void this.finish({error:403}))}},{key:"tn",value:function(n){return X.so(this.lo)?e(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"tn",this).call(this,n):(this.Sn(Q),void this.finish({error:403}))}}]),t}(),J=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,B),t}(),W=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,B),n(t,[{key:"uo",value:function(){}}]),t}(),tt=function(){function t(e,n,r){var o;return s(this,t),(o=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n))).lo=r,o}return o(t,R),n(t,[{key:"nn",value:function(){return e(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"nn",this).call(this)&&X.so(this.lo)}}]),t}(),et=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,tt),n(t,[{key:"en",value:function(){var n=e(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"en",this).call(this),r=new B(document.getElementById("change-password-form"),"u/passwordSettings/set","post");return r.sr(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(){setTimeout(function(){h.Mo(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.Mo(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:"Ho",value:function(){var t=r(regeneratorRuntime.mark(function t(e,n,r,i,o,s,a,u){var l,c,h,f,v,p,y,m,g,k;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:s=d.t(s,10),i=d.t(i,!1),o=d.t(o,!1),a=d.t(a,n.innerHTML.length),u=d.t(u,!0),(l=r.classList.contains("no-transition"))||r.classList.add("no-transition"),c=n.style.fontSize,h=1,f=0,v=0,p=0,y=0,m=0;case 4:if(h+=f/(a+1),n.style.fontSize=h+"px",g=window.getComputedStyle(r),y=g.getPropertyValue("width").replace("px",""),m=g.getPropertyValue("height").replace("px",""),v=y-n.offsetWidth,p=m-n.offsetHeight,(k=o?p:i?v:Math.min(v,p))!==f){t.next=10;break}return t.abrupt("break",12);case 10:f=k;case 11:if((v>(1-e)*y||o)&&(p>(1-e)*m||i)){t.next=4;break}case 12:if(h-=s,n.style.fontSize=u?h+"px":c,t.t0=l,t.t0){t.next=19;break}return t.next=18,new Promise(function(t){setTimeout(t,50)});case 18:r.classList.remove("no-transition");case 19:return t.abrupt("return",h);case 20:case"end":return t.stop()}},t,this)}));return function(){return t.apply(this,arguments)}}()}]),t}(),lt=function(){function t(e){s(this,t),"string"==typeof e&&(e={code:e}),this.vo=e,this.To=!1}return n(t,[{key:"Po",value:function(t){this.To=t}},{key:"Lo",value:function(){return this.To}},{key:"bo",value:function(){return F.send("c/code",this.vo)}}]),t}(),ct=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,w),n(t,[{key:"Ze",value:function(n){e(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"Ze",this).call(this,n),console.log(n);Promise.resolve();if(d.A(n.code)){var r=n.code,i=d.t(n.cachable,!1),o=new lt(r);o.Po(i);var s=this;o.bo().then(function(t){t.success?x.zs(x.qs,f.translate(d.t(t.result.successMessage,"code-activated"))):x.zs(x.qs,f.translate(t.errors[0])),s.finish()})}}}]),t}();E.ti(function(t){t.Ls("code",ct)});var ht=function(){function t(){return s(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,"wordRotator",3))}return o(t,A),n(t,null,[{key:"_t",value:function(){return d.ct(t.qt)&&(t.qt=new t),t.qt}}]),n(t,[{key:"oi",value:function(e,n,r,i){(d.ct(n)||n<1&&r>=1)&&e.createObjectStore(t.Fo.Ao,{keyPath:"id"}),(d.ct(n)||n<2&&r>=2)&&i.target.transaction.objectStore(t.Fo.Ao).createIndex("played",["deleted","played","difficulty","id"],{unique:!1}),(d.ct(n)||n<3&&r>=3)&&i.target.transaction.objectStore(t.Fo.Ao).createIndex("difficulty","difficulty",{unique:!1})}},{key:"Co",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.ci(n,t.Fo.Ao));case 1:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}()},{key:"Ro",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.Fo.Ao));case 1:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}()},{key:"xo",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.gi("difficulty",IDBKeyRange.lowerBound(0),t.Fo.Ao);case 2:for(r=e.sent,i=[],o=[],s=-1,a=0,u=r.length;a=2&&this.mn.classList.add("layer-"+t),this.Ko||this.mn.classList.add("locked");var e=this.mn.querySelector(".child-container");e.removeAllChildren(),this.Yo(),this.mn.removeEventListener("mouseup",this.Go),this.mn.removeEventListener("touchend",this.$o),this.mn.addEventListener("mouseup",this.Go),this.mn.addEventListener("touchend",this.$o);for(var n=0,r=this.children.length;n=1&&this.children[0]&&this.children[0]instanceof t?this.children[0].na()+1:1}}]),t}();dt.Jo();var vt=function(){function t(e,n){var r;return s(this,t),(r=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e))).sa="A",d.A(n)&&r.ia(n),r}return o(t,ft),n(t,[{key:"ko",value:function(e){return e instanceof t&&e.sa===this.sa}},{key:"ia",value:function(t){this.sa=t}},{key:"Oo",value:function(){this.mn.querySelector(".leaf-element").removeAllChildren().appendChild(document.createTextNode(this.sa))}}]),t}(),pt=function(){function t(e,n,r,i){s(this,t),this.ra=e,this.oa=n,this.aa=r,this.la=i}return n(t,[{key:"ha",value:function(){return d.cloneNode(this.ra)}},{key:"ua",value:function(){return d.cloneNode(this.oa)}},{key:"ca",value:function(){return d.cloneNode(this.aa)}},{key:"da",value:function(){return d.cloneNode(this.la)}}]),t}(),yt=function(){function t(e){s(this,t),this.ga=null,this.words=[],this.ma=[],this.pa=e,this.fa=!1,this.id=null,this.Sa=null,this.wa=null;var n=this;this.Ma=new Promise(function(t,e){n.Sa=t,n.wa=e})}return n(t,[{key:"Ha",value:function(){var t=this.Bo(),e=this.jo();localStorage.setItem("currentLevel",JSON.stringify({id:this.id,rotations:t,locks:e}))}},{key:"jo",value:function(){return null!==this.ga?this.ga.jo([]):[]}},{key:"Bo",value:function(){return null!==this.ga?this.ga.Bo([]):[]}},{key:"ya",value:function(t){null!==this.ga&&this.ga._o(t)}},{key:"va",value:function(t){this.id=t}},{key:"O",value:function(){return this.id}},{key:"Uo",value:function(){return this}},{key:"Ta",value:function(t){this.ga=t,this.ga.Io(this),this.ma&&this.No()}},{key:"Pa",value:function(t){this.words=[];for(var e=0,n=t.length;e=2&&this.words[0].length>=this.Da&&this.words[1].length>=this.Da){for(var t=yt.xa(this.words[0],this.pa.ha()),e=yt.xa(this.words[1],this.pa.ha()),n=new mt(this.pa.ca()),r=0,i=this.Da/2;r=6&&this.words[0].length>=this.Da&&this.words[1].length>=this.Da&&this.words[2].length>=this.Da&&this.words[3].length>=this.Da&&this.words[4].length>=this.Da&&this.words[5].length>=this.Da){var t=[];t[0]=yt.xa(this.words[0],this.pa.ha()),t[1]=yt.xa(this.words[1],this.pa.ha()),t[2]=yt.xa(this.words[2],this.pa.ha()),t[3]=yt.xa(this.words[3],this.pa.ha()),t[4]=yt.xa(this.words[4],this.pa.ha()),t[5]=yt.xa(this.words[5],this.pa.ha());for(var e=new mt(this.pa.ca()),n=0;n=4&&this.words[0].length>=this.Da&&this.words[1].length>=this.Da&&this.words[2].length>=this.Da&&this.words[3].length>=this.Da){var t=[];t[0]=yt.xa(this.words[0],this.pa.ha()),t[1]=yt.xa(this.words[1],this.pa.ha()),t[2]=yt.xa(this.words[2],this.pa.ha()),t[3]=yt.xa(this.words[3],this.pa.ha());for(var e=new mt(this.pa.ca()),n=0;n=t){e-=t,localStorage.setItem("coins",e),this.Ua.title=e,this.Ua.k();for(var n=this.level.Ca(),r=(n=n.filter(function(t){return 0!==t.rotation}))[Math.floor(Math.random()*n.length)];0!==r.rotation;)r.rotate();r.qo(!1),this.level.Ha()}else x.zs("not-enough-coins")}}]),t}(),Mt=function(){function t(e){return s(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,"html/application/menu.html"))}return o(t,Ct),n(t,[{key:"en",value:function(){var n=this;e(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"en",this).call(this),this.on("#play-button").addEventListener("click",function(){n.Sn(Tt)})}}]),t}(),It=function(){function t(e){return s(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,"html/application/sync.html"))}return o(t,Ct),n(t,[{key:"Ze",value:function(){var n=r(regeneratorRuntime.mark(function n(r){var i;return regeneratorRuntime.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,e(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"Ze",this).call(this,r);case 2:return i=n.sent,n.next=5,this.nl();case 5:return n.abrupt("return",i);case 6:case"end":return n.stop()}},n,this)}));return function(){return n.apply(this,arguments)}}()},{key:"en",value:function(){e(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"en",this).call(this),this.Sn(Mt),this.finish()}},{key:"nl",value:function(){var t=r(regeneratorRuntime.mark(function t(){var e,n,r,i,o,s,a,u,l,c,h,f;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:e=d.t(localStorage.getItem("date-last-sync"),0),n=ht._t(),r=null,i=1,o=[],s=0;case 3:if(!(sn.length)&&(e=n.length),e-=t.length;var r=n.indexOf(t,e);return-1!==r&&r===e}),window.fetch=d.t(window.fetch,function(t){console.log("customFetch",t);var e=null;if(window.XMLHttpRequest)e=new XMLHttpRequest;else if(window.Oi)try{e=new ActiveXObject("Msxml2.XMLHTTP")}catch(t){try{e=new ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}var n=new Promise(function(t){e.onload=function(){var e=this.responseText;t({json:function(){return Promise.resolve(JSON.parse(e))},text:function(){return Promise.resolve(e)}})},e.onerror=function(e){t(Promise.reject(e))}});return e.open("get",t,!0),e.send(),n}),p.Ce(new N("red","")),p.Ce(new N("blue","blue")),p.Ce(new N("black","black")),p.Ce(new N("green","green")),p.Ce(new N("pink","pink")),j.xi(new I("img/whatsapp.svg")),j.xi(new T("img/sms.svg")),j.xi(new M("img/telegram.svg"));var Dt=new L;window.ThemeManager=p,window.ThemeManager.addChangeListener=p.addChangeListener,window.app=Dt,window.app.refreshCurrentSite=Dt.refreshCurrentSite,window.Translator=f,window.Translator.setLanguage=f.setLanguage,U.Kr("html/application/setting-template.html"),st.tt=!1,ot.So=!1,E.resolve(Dt).then(function(){U.Xr.i=a.V,Dt.start(It),f.setLanguage("de")});