2018-09-23 00:30:19 +02:00

1 line
102 KiB
JavaScript
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

!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<s.catchLoc)return i(s.catchLoc,!0);if(this.prev<s.finallyLoc)return i(s.finallyLoc)}else if(u){if(this.prev<s.catchLoc)return i(s.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<s.finallyLoc)return i(s.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var s=o?o.completion:{};return s.type=t,s.arg=e,o?(this.method="next",this.next=o.finallyLoc,v):this.complete(s)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=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(;++i<t.length;)if(r.call(t,i))return n.value=t[i],n.done=!1,n;return n.value=e,n.done=!0,n};return s.next=s}}return{next:j}}function j(){return{value:e,done:!0}}}(function(){return this||"object"==typeof self&&self}()||Function("return this")());var t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e=function t(e,n,r){null===e&&(e=Function.prototype);var i=Object.getOwnPropertyDescriptor(e,n);if(void 0===i){var o=Object.getPrototypeOf(e);return null===o?void 0:t(o,n,r)}if("value"in i)return i.value;var s=i.get;return void 0!==s?s.call(r):void 0},n=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}();function r(t){return function(){var e=t.apply(this,arguments);return new Promise(function(t,n){return function r(i,o){try{var s=e[i](o),a=s.value}catch(t){return void n(t)}if(!s.done)return Promise.resolve(a).then(function(t){r("next",t)},function(t){r("throw",t)});t(a)}("next")})}}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function s(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var a=function(){function t(e,n,r,i){s(this,t),this.title=d.t(e,null),this.s=n,this.i=d.t(r,t.o),this.order=d.t(i,1e3),this.l="",this.h=null,this.u=!0,this.g=!0,this.id=t.m++,this.p=null,this.S=!0,this.M=[]}return n(t,[{key:"H",value:function(t){this.title=t}},{key:"v",value:function(t){this.S=t}},{key:"T",value:function(){return this.i}},{key:"P",value:function(){return this.title}},{key:"L",value:function(){return this.S}},{key:"remove",value:function(t){if(t=d.t(t,!1),d.A(this.h)&&(console.log(this.h),this.h.F(this),this.h=null),t)for(var e=0;e<this.M.length;e++)this.M[e].remove()}},{key:"C",value:function(){return this.h}},{key:"R",value:function(t){this.h=t}},{key:"D",value:function(){return this.g}},{key:"B",value:function(t){t!==this.g&&(this.g=t,this.k())}},{key:"I",value:function(){return this.u}},{key:"U",value:function(){return this.p}},{key:"W",value:function(t){this.p=t}},{key:"O",value:function(){return this.id}},{key:"k",value:function(){d.A(this.h)&&this.h.N(this)}},{key:"_",value:function(e){var n=d.t(e,new t);return n.title=this.title,n.s=this.s,n.i=this.i,n.order=this.order,n.l=this.l,n.u=this.u,n.g=this.g,n.p=this.p,n.S=this.S,n.h=null,n.id=t.m++,this.M.push(n),n}},{key:"j",value:function(){d.A(this.h)&&this.h.k()}}]),t}();a.m=0,a.V="always",a.o="medium",a.J="large",a.q="never";var u=function(){function t(e,n,r,o){var a;return s(this,t),(a=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,function(t){t.K().toggle(),t.k()},r,o))).X=n,n.$(a),a}return o(t,a),n(t,[{key:"K",value:function(){return this.X}},{key:"_",value:function(n){return e(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"_",this).call(this,d.t(n,new t(null,this.X._())))}}]),t}(),l=function(){function t(e){s(this,t),this.G=[],this.Y=[],"string"==typeof e?this.Z=document.querySelectorAll(e):Array.isArray(e)?this.Z=e:this.Z=[e]}return n(t,[{key:"_",value:function(e){(e=d.t(e,new t([]))).G=[];for(var n=0,r=this.G.length;n<r;n++)e.G.push(this.G[n]._());e.Y=[];for(var i=0,o=this.Y.length;i<o;i++)e.Y.push(this.Y[i]._());return e}},{key:"tt",value:function(t){d.et(this.G,t)&&(this.G.push(t),this.k(),t.R(this),t instanceof u&&this.Y.push(t.K()))}},{key:"nt",value:function(){if(d.A(this.Z)){this.st();for(var t=[],e=0;e<this.G.length;e++){var n=this.it(this.G[e]);this.G[e].rt=n,t.push(n)}for(var r=0,i=this.Z.length;r<i;r++){this.Z[r].removeAllChildren();for(var o=0,s=t.length;o<s;o++)this.Z[r].appendChild(d.cloneNode(t[o]));this.Z[r].onclick=this.ot()}}}},{key:"ot",value:function(){var t=this;return function(e){var n=e.target;if(n.matches(".action")||n.matches(".action *")){n=n.closest(".action");for(var r=parseInt(n.dataset.id),i=0,o=t.G.length;i<o;i++)if(t.G[i].id===r)return"function"==typeof t.G[i].s&&t.G[i].I()&&t.G[i].s(t.G[i],e),t.G[i];for(var s=0,a=t.Y.length;s<a;s++)if(t.Y[s].click(r,e))return t.Y[s]}return null}}},{key:"it",value:function(t){var e=document.createElement("a");if("string"==typeof t.s&&(e.href=t.s),d.A(t.U())){var n=document.createElement("img");n.src=t.U(),n.classList.add("action-image"),t.L()&&(n.dataset.translationTitle=t.title),e.appendChild(n)}var r=t.P();return r=t.L()?f.at(r):document.createTextNode(r),e.appendChild(r),this.lt(e,t)}},{key:"lt",value:function(t,e){var n=document.createElement("li");return n.classList.add("action"),""!==e.l.trim()&&n.classList.add(e.l),n.appendChild(t),n.dataset.id=e.id,d.A(e.U())&&n.classList.add("img"),e.D()||n.classList.add("hidden"),e instanceof u&&(e.K().nt(),n.appendChild(e.K().ht()),n.classList.add("is-dropdown-submenu-parent"),n.classList.add("opens-right")),n}},{key:"st",value:function(){this.G=this.G.sort(function(t,e){return t.order-e.order})}},{key:"ut",value:function(t){for(var e=[],n=0;n<this.Z.length;n++){var r=this.Z[n].querySelector('[data-id="'+t.O()+'"]');d.ct(r)||e.push(r)}return e}},{key:"N",value:function(t){var e=this.ut(t);if(0!==e.length){var n=this.it(t);t.rt=n;for(var r=0;r<e.length;r++)e[r].replaceWith(d.cloneNode(n))}}},{key:"F",value:function(t){var e=this.G.indexOf(t);if(e>0){this.G.splice(e,1);for(var n=this.ut(t),r=0,i=n.length;r<i;r++)n[r].remove();if(t instanceof u){var o=this.Y.indexOf(t.K());this.Y.splice(o,1)}}}},{key:"k",value:function(){this.nt()}}]),t}();l.V="always",l.o="medium",l.dt="smedium",l.J="large",l.q="never";var c=function(){function t(){var e;s(this,t);var n=document.createElement("ul");return n.classList.add("menu"),n.classList.add("vertical"),n.classList.add("submenu"),n.classList.add("is-dropdown-submenu"),n.classList.add("first-sub"),(e=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,n))).gt=null,e.isOpen=!1,e}return o(t,l),n(t,[{key:"_",value:function(n){(n=e(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"_",this).call(this,d.t(n,new t))).Z=[];for(var r=0,i=this.Z.length;r<i;r++)n.Z.push(d.cloneNode(this.Z[r]));return n.gt=this.gt,n.isOpen=this.isOpen,n}},{key:"$",value:function(t){this.gt=t}},{key:"nt",value:function(){var n=this;e(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"nt",this).call(this),d.A(this.Z)&&function(){for(var t=n,e=0;e<n.Z.length;e++){var r=document.createElement("div");r.classList.add("close-listener"),r.onclick=function(e){console.log(e),t.close()},n.Z[e].insertBefore(r,n.Z[e].firstElementChild)}}()}},{key:"ht",value:function(){return this.Z[0]}},{key:"ot",value:function(){return function(){}}},{key:"click",value:function(t,e){for(var n=0,r=this.G.length;n<r;n++)if(this.G[n].id===t)return"function"==typeof this.G[n].s&&this.G[n].I()&&this.G[n].s(this.G[n],e),this.close(),!0;return!1}},{key:"toggle",value:function(){this.isOpen?this.close():this.open()}},{key:"open",value:function(){this.isOpen=!0;for(var t=0,e=this.Z.length;t<e;t++)this.Z[t].classList.add("js-dropdown-active");d.A(this.gt)&&this.gt.k()}},{key:"close",value:function(){this.isOpen=!1;for(var t=0,e=this.Z.length;t<e;t++)this.Z[t].classList.remove("js-dropdown-active");d.A(this.gt)&&this.gt.k()}}]),t}(),h=function(){function t(){s(this,t),this.pt=indexedDB||mozIndexedDB||webkitIndexedDB||msIndexedDB,this.ft=3;var e=this;this.St=new Promise(function(t,n){var r=e.pt.open("Translator",e.ft);r.onupgradeneeded=function(t){var n=t.target.result;e.wt(n)},r.onsuccess=function(e){var n=e.target.result;t(n)},r.onerror=function(t){n(t)}}).catch(function(t){console.error(t)})}return n(t,[{key:"wt",value:function(t){try{t.deleteObjectStore("currentLang"),t.deleteObjectStore("translations")}catch(t){console.warn(t)}t.createObjectStore("currentLang",{keyPath:"id"}),t.createObjectStore("translations",{keyPath:["lang","key"]}).createIndex("lang","lang",{unique:!1})}},{key:"setLanguage",value:function(e){this.St.then(function(n){t.Mt(["currentLang"],"readwrite",n).objectStore("currentLang").put({id:1,lang:e})}).catch(function(t){console.error(t)})}},{key:"Ht",value:function(e,n){return this.St.then(function(r){return new Promise(function(i){var o=t.Mt(["translations"],"readwrite",r),s=o.objectStore("translations");for(var a in n)s.put({lang:e,key:a,translation:n[a]});o.oncomplete=function(){i()}})}).catch(function(){})}},{key:"yt",value:function(e){return this.St.then(function(n){return new Promise(function(r){var i=t.Mt(["translations"],"readonly",n),o={};i.objectStore("translations").index("lang").openCursor(IDBKeyRange.only(e)).onsuccess=function(t){var e=t.target.result;if(e){var n=e.value;o[n.key]=n.translation,e.continue()}},i.oncomplete=function(){r(o)}})}).catch(function(t){return console.error(t),{}})}},{key:"vt",value:function(){return this.St.then(function(e){return new Promise(function(n){var r=t.Mt(["currentLang"],"readonly",e).objectStore("currentLang").get(1);r.onsuccess=function(t){var e=t.currentTarget.result;n(e?e.lang:null)},r.onerror=function(){n(null)}})}).catch(function(){})}}],[{key:"Mt",value:function(t,e,n){var r=null;try{r=n.transaction(t,e)}catch(e){console.warn(e),r=n.transaction(t)}return r}}]),t}(),f=function(){function e(){s(this,e),this.Tt=[],this.Pt=new h,this.Lt=null,this.bt=e.At,this.Ft=e.Ct,this.Rt=e.xt,this.Dt=e.Bt,this.kt=e.It;var t=this;this.Ut=this.Et().then(function(){return t.Wt()})}return n(e,[{key:"Ot",value:function(t){var e=this;return fetch(d.Nt(this.Rt+t+".json")).then(function(t){return t.json()}).then(function(n){e.Tt[t]=Object.assign(n,e.Tt[t]),e.Pt.Ht(t,e.Tt[t])}).catch(function(e){console.error("could not load lang "+t+" because of error: ",e)})}},{key:"Et",value:function(){var t=this;return this.Ot(this.Ft).then(function(){t.Lt=t.Ft,"undefined"!=typeof document&&document.getElementsByTagName("html")[0].setAttribute("lang",t.Ft)})}},{key:"setLanguage",value:function(t){if(this.Lt===t)return this.jt(),Promise.resolve();if(-1===this.bt.indexOf(t))return Promise.resolve();this.Lt=t,"undefined"!=typeof localStorage&&localStorage.setItem("language",t),this.Pt.setLanguage(t);var e=this;return this.Ot(t).then(function(){"undefined"!=typeof document&&document.getElementsByTagName("html")[0].setAttribute("lang",t),e.jt()})}},{key:"translate",value:function(n,r){"object"==(void 0===n?"undefined":t(n))&&d.A(n)&&(n=this.Vt(n));var i=null;return d.A(this.Tt[this.Lt])&&d.A(this.Tt[this.Lt][n])&&(i=this.Tt[this.Lt][n]),d.ct(i)&&(e.Jt&&console.warn("missing translation for language "+this.Lt+" and key "+n),d.A(this.Tt[this.Ft])&&(i=this.Tt[this.Ft][n]),d.ct(i)&&(e.Jt&&console.error("missing base translation for key "+n+". FIX IT"),i=n),this.Dt&&(i="&gt;&gt;"+i+"&lt;&lt;")),this.kt&&(i="$"+i+"$"),void 0!==r&&(i=i.format(r)),i}},{key:"Vt",value:function(t){var e=t.key;for(var n in delete t.key,t)t.hasOwnProperty(n)&&(d.ct(this.Tt[n])&&(this.Tt[n]={}),this.Tt[n][e]=t[n]);return e}},{key:"jt",value:function(){if("undefined"!=typeof document)for(var t=document.querySelectorAll("[data-translation]"),e=0,n=t.length;e<n;e++){if(""!=t[e].dataset.translation)try{t[e].innerHTML=this.translate(t[e].dataset.translation,void 0!==t[e].dataset.translationArgs?JSON.parse(t[e].dataset.translationArgs):void 0)}catch(t){console.error("wrong configured translation: "+t)}for(var r in t[e].dataset)if(r.startsWith("translation")&&!r.endsWith("Args"))try{t[e][r.substr(11).toLowerCase()]=this.translate(t[e].dataset[r],void 0!==t[e].dataset[r+"Args"]?JSON.parse(t[e].dataset[r+"Args"]):void 0)}catch(t){console.error("wrong configured translation: "+t)}}}},{key:"Wt",value:function(){var t=localStorage.getItem("language");if(d.ct(t)||-1===this.bt.indexOf(t)){var e=[];if(d.A(navigator.languages)&&(e=navigator.languages.slice(0)),void 0!==navigator.language&&e.push(navigator.language),e.push(this.Ft),void 0!==e)for(var n=0,r=e.length;n<r;n++)if(-1!==this.bt.indexOf(e[n])){t=e[n];break}}return this.setLanguage(t.toLowerCase())}}],[{key:"setLanguage",value:function(t){var n=e._t();if(n)return n.setLanguage(t)}},{key:"translate",value:function(t,n){var r=e._t();return r?r.translate(t,n):""}},{key:"Vt",value:function(t){var n=e._t();if(n)return n.Vt(t)}},{key:"at",value:function(n,r,i){if(i=d.t(i,"span"),"object"==(void 0===n?"undefined":t(n))&&(n=e.Vt(n)),"undefined"!=typeof document){var o=document.createElement(i);return o.dataset.translation=n,void 0!==r&&(o.dataset.translationArgs=JSON.stringify(r)),o.innerHTML=e.translate(n,r),o}}},{key:"zt",value:function(){var t=new c;return t.tt(new a("en",function(){e._t().setLanguage("en")})),t.tt(new a("de",function(){e._t().setLanguage("de")})),new u("current-lang",t,l.V)}},{key:"init",value:function(){e.qt=new e}},{key:"_t",value:function(){return e.qt}}]),e}();f.Jt=!1,f.qt=null,f.Ct="en",f.At=["de","en"],f.Bt=!0,f.It=!1,f.xt="js/lang/",f.Kt=null,f.Xt={};var d=function(){function e(){s(this,e)}return n(e,null,[{key:"init",value:function(){e.$t=null,e.Gt=null}},{key:"et",value:function(t,e,n){return-1===t.indexOf(e,n)}},{key:"includes",value:function(t,n,r){return!e.et(t,n,r)}},{key:"Qt",value:function(){if(arguments.length>0){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.length<e;)t="0"+t;return t}},{key:"cloneNode",value:function(t){var e=t.cloneNode(!0);return e.onclick=t.onclick,e}},{key:"re",value:function(t,e){for(var n="",r=Math.floor(Math.log(265)/Math.log(e)),i=0;i<t.length;i++){var o=t.charCodeAt(i).toString(e),s=o.length%r;s>0&&(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;o<s;o++)i+=String.fromCharCode(parseInt(r[o],e));return i}},{key:"ae",value:function(t){return"none"===t.style.display?(t.style.display="",!0):(t.style.display="none",!1)}},{key:"print",value:function(t){var e=document.getElementById("print-content");t instanceof Element?(e.removeAllChildren(),e.appendChild(t)):e.innerHTML=t,window.print()}},{key:"le",value:function(t,n,r){n instanceof Date||(n=new Date(n));var i=(r=e.t(r,!1))?n.getUTCDay():n.getDay(),o=r?n.getUTCDate():n.getDate(),s=r?n.getUTCMonth():n.getMonth(),a=r?n.getUTCFullYear():n.getFullYear(),u=r?n.getUTCHours():n.getHours(),l=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],c=["January","February","March","April","May","June","July","August","September","October","November","December"],h=[0,31,59,90,120,151,181,212,243,273,304,334],d=function(){var t=new Date(n);return t.setDate(o-(i+6)%7+3),t},v=function(t,e){return(""+(Math.pow(10,e)+t)).slice(1)};return t.replace(/%[a-z]/gi,function(t){return{"%a":f.at(l[i].slice(0,3)).outerHTML,"%A":f.at(l[i]).outerHTML,"%b":f.at(c[s].slice(0,3)).outerHTML,"%B":f.at(c[s]).outerHTML,"%c":n.toUTCString(),"%C":Math.floor(a/100),"%d":v(o,2),"%e":o,"%f":v(n.getTime()%1e3,4),"%F":n.toISOString().slice(0,10),"%G":d().getFullYear(),"%g":(""+d().getFullYear()).slice(2),"%H":v(u,2),"%I":v((u+11)%12+1,2),"%j":v(h[s]+o+(s>1&&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<n.length;++r)i[r]=e.he(n[r]);return i}if(n instanceof Date)return new Date(n.getTime());var o={};for(r in n)o[r]=e.he(n[r]);return o}},{key:"ue",value:function(t){var n={"&amp;":"&","&#038;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#039;":"'","&#8217;":"","&#8216;":"","&#8211;":"","&#8212;":"—","&#8230;":"…","&#8221;":"”"};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<i;r++)n[r]instanceof Element&&(e.pe(n[r]),e.me(n[r]))}},{key:"pe",value:function(t){var e=t.classList.contains("no-transtition");t.classList.add("no-transition");var n=t.parentNode;console.log(t);var r=window.getComputedStyle(t),i=window.getComputedStyle(n),o=parseFloat(r.getPropertyValue("font-size"))/parseFloat(i.getPropertyValue("font-size")),s=r.height,a=r.width,u=i.height,l=i.width,c=t.style;c["max-height"]=Math.floor(s/u*100)+"%",c["margin-left"]=Math.floor(parseFloat(r.getPropertyValue("margin-left"))/l*100)+"%",c["margin-right"]=Math.floor(parseFloat(r.getPropertyValue("margin-right"))/l*100)+"%",c["margin-top"]=Math.floor(parseFloat(r.getPropertyValue("margin-top"))/u*100)+"%",c["margin-bottom"]=Math.floor(parseFloat(r.getPropertyValue("margin-bottom"))/u*100)+"%",c["max-width"]=Math.floor(a/l*100)+"%",c["font-size"]=o+"em",e||t.classList.remove("no-transition")}},{key:"fe",value:function(){var t=window.chrome,e=window.navigator,n=e.vendor,r=e.userAgent.indexOf("OPR")>-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;r<i;r++)n[t[r][e]]=t[r];return n}},{key:"we",value:function(t){var e={};for(var n in t)t.hasOwnProperty(n)&&(e[t[n]]=n);return e}},{key:"toArray",value:function(t){var e=[];for(var n in t)e.push(t[n]);return e}}]),e}();d.init();var v=function(){function t(){s(this,t)}return n(t,null,[{key:"Me",value:function(e){t.He=e}},{key:"ne",value:function(){return t.He}},{key:"set",value:function(e,n){t.ye[e]=n}},{key:"get",value:function(e,n){return d.t(t.ye[e],n)}},{key:"has",value:function(e){return d.t(t.ye[e])}}]),t}();v.Me("/"),v.ye={};var p=function(){function t(){s(this,t)}return n(t,null,[{key:"init",value:function(){t.ve()}},{key:"Te",value:function(e){var n=null;if("string"==typeof e){var r=t.Pe.filter(function(t){return t.Le===e});r.length>0&&(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;o<s;o++)t.Fe[o](t.Ae,i)}}},{key:"Ce",value:function(e){t.Pe.push(e)}},{key:"ve",value:function(){if(t.Te(localStorage.getItem("currentTheme")),d.ct(t.Ae)){var e=document.body.className,n=t.Pe.filter(function(t){return t.be===e});n.length>0?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;r<n.length;r++){for(var i=n[r];" "===i.charAt(0);)i=i.substring(1,i.length);if(0===i.indexOf(e))return i.substring(e.length,i.length)}return null}}]),t}(),m=function(){function r(){return s(this,r),i(this,(r.__proto__||Object.getPrototypeOf(r)).apply(this,arguments))}return o(r,l),n(r,[{key:"lt",value:function(t,n){var i=e(r.prototype.__proto__||Object.getPrototypeOf(r.prototype),"lt",this).call(this,t,n);return i.classList.add(n.T()),i}},{key:"je",value:function(){var t=r.Je(),e=this.Z[0];("medium"===t||"smedium"===t||"small"===t)&&r.ze(e.getElementsByClassName(l.J)).length>0||("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;t<e;t++)this.Y[t].close()}},{key:"F",value:function(t){var n=e(r.prototype.__proto__||Object.getPrototypeOf(r.prototype),"F",this).call(this,t);return this.je(),n}}],[{key:"init",value:function(){var t=document.getElementsByClassName("foundation-mq");if(0!==t.length){var e=[];for(var n in t=function(t){var e={};return"string"!=typeof t?e:(t=t.trim().slice(1,-1))?e=t.split("&").reduce(function(t,e){var n=e.replace(/\+/g," ").split("="),r=n[0],i=n[1];return r=decodeURIComponent(r),i=void 0===i?null:decodeURIComponent(i),t.hasOwnProperty(r)?Array.isArray(t[r])?t[r].push(i):t[r]=[t[r],i]:t[r]=i,t},{}):e}(window.getComputedStyle(t[0]).getPropertyValue("font-family")))t.hasOwnProperty(n)&&e.push({Le:n,value:"only screen and (min-width: "+t[n]+")"});window.addEventListener("resize",function(){d.A(r._e)&&r._e.je()});var i=document.getElementById("responsive-menu");document.getElementById("responsive-menu-toggle").onclick=function(){"none"===window.getComputedStyle(i).getPropertyValue("display")?i.style.display="block":d.A(r._e)&&r._e.close()},i.firstElementChild.addEventListener("click",function(t){t.target===i.firstElementChild&&d.A(r._e)&&r._e.close()}),r.Ve=e}}},{key:"Je",value:function(){for(var e=void 0,n=0;n<r.Ve.length;n++){var i=r.Ve[n];matchMedia(i.value).matches&&(e=i)}return"object"==(void 0===e?"undefined":t(e))?e.Le:e}},{key:"ze",value:function(t){for(var e=[],n=0,r=t.length;n<r;n++)t[n].classList.contains("hidden")||e.push(t[n]);return e}}]),r}();m.Ve=[],m._e=null,m.init();var g=function(){function t(){s(this,t)}return n(t,null,[{key:"qe",value:function(e,n){n=d.t(n,[]).slice(0);var r=Promise.resolve();if(e instanceof Element)r=Promise.resolve(e);else{if(-1!==n.indexOf(e))return Promise.reject("views are in a circuit! cannot resolve view for url "+n[0]+"! url "+e+" is in stack before!");n.push(e),r=fetch(d.Nt(e),{credentials:"same-origin"}).then(function(t){return t.text()}).then(function(t){var e=(new DOMParser).parseFromString(t,"text/html");return d.ct(e)&&((e=document.implementation.createHTMLDocument("")).body.innerHTML=t),e.body.firstChild})}return r.then(function(e){for(var r=[],i=e.querySelectorAll("[data-view]"),o=function(e,o){r.push(t.qe(i[o].dataset.view,n).then(function(t){i[o].replaceWith(t)}))},s=0,a=i.length;s<a;s++)o(0,s);return Promise.all(r).then(function(){return e})})}}]),t}(),k=function(){function t(e){s(this,t);var n=this;this.Ke=null,this.Xe=!0,this.$e=new Promise(function(t){n.Ge=t}),this.Qe={},d.A(e)&&this.Ye(e)}return n(t,[{key:"Ze",value:function(){var t=[];for(var e in this.Qe)t.push(this.Qe[e].Ze.apply(this.Qe[e],arguments)),t.push(this.Qe[e].$e);return Promise.all(t)}},{key:"tn",value:function(){var t=this,e=arguments;this.Xe&&(this.en(),this.Xe=!1);var n=function(n){var r=t.Qe[n];r.tn.apply(t.Qe[n],e),t.Qe[n].$e.then(function(t){r.nn()?t.classList.remove("hidden"):t.classList.add("hidden")})};for(var r in this.Qe)n(r)}},{key:"en",value:function(){}},{key:"sn",value:function(){for(var t in this.Qe)this.Qe[t].sn.apply(this.Qe[t],arguments)}},{key:"in",value:function(){for(var t in this.Qe)this.Qe[t].in.apply(this.Qe[t],arguments)}},{key:"rn",value:function(t,e){this.Qe[t]=e,this.$e=this.$e.then(function(n){return e.$e.then(function(e){return n.querySelector(t).appendChild(e),n})})}},{key:"Ye",value:function(t){var e=this;return this.Ge(g.qe(t).then(function(t){return e.Ke=t,t})),this.$e}},{key:"on",value:function(t,e,n){e=d.t(e,!1);var r=function(n){var r=null;return e?(r=n.querySelectorAll(t),n.matches(t)&&r.push(n)):r=n.matches(t)?n:n.querySelector(t),r};return(n=d.t(n,!1))?this.$e.then(function(t){return r(t)}):r(this.Ke)}}]),t}(),w=function(){function t(e,n,r){var o;return s(this,t),(o=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,n))).an=!1,o.ln=e,o.hn=!1,o.un=null,o.url="",o.cn=r,o.dn={},o.title=e.gn(),o}return o(t,k),n(t,[{key:"H",value:function(t,e){"string"==typeof t&&(e=t,t=document.createTextNode(t)),this.title={mn:t},this.title.title=d.t(e,this.title.title),this.an&&this.ln.pn()}},{key:"fn",value:function(){return this.Sn(this.ln.wn())}},{key:"Ye",value:function(n){var r=this;return e(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"Ye",this).call(this,n).then(function(t){for(var e=[],n=0,i=r.Qe.length;n<i;n++)e.push(r.Qe[n].$e);return Promise.all(e).then(function(){return t})})}},{key:"Ze",value:function(n){return this.dn=n,d.A(this.cn)&&this.Mn(n),e(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"Ze",this).call(this,n)}},{key:"tn",value:function(n){this.an=!0;var r=e(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"tn",this).call(this,n);return this.un.k(),r}},{key:"sn",value:function(n){e(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"sn",this).call(this,n),this.an=!1}},{key:"finish",value:function(t){this.hn||(this.hn=!0,this.ln.Hn(this,t))}},{key:"Sn",value:function(t,e){return this.ln.Sn(t,e)}},{key:"yn",value:function(){this.ln.yn(this)}},{key:"vn",value:function(t,e,n){this.Sn(t,e),this.finish(n)}},{key:"Tn",value:function(t){for(var e=this.ln.Pn(),n=0,r=e.length;n<r;n++)t.tt(e[n]._());return t}},{key:"Ln",value:function(t){this.url=t,this.ln.bn(this)}},{key:"Mn",value:function(t){this.Ln(this.cn+d.Zt(t))}},{key:"An",value:function(t){this.dn=Object.assign(this.dn,t),this.Mn(this.dn)}},{key:"Fn",value:function(){return this.url}},{key:"Cn",value:function(){return d.Nt(this.url)}},{key:"Rn",value:function(){}},{key:"addListener",value:function(t,e,n){this.ln.addListener(this,t,e,n)}},{key:"xn",value:function(t,e){this.ln.xn(this,t,e)}},{key:"Dn",value:function(t,e,n,r){this.ln.Dn(this,t,e,n,r)}}]),t}(),_=function(){function t(e,n){s(this,t),this.Bn=e,this.Ke=null,this.kn={},this.In={},this.Un=n}return n(t,[{key:"En",value:function(){return this.Bn}},{key:"Wn",value:function(t){t instanceof w&&(this.Bn=t)}},{key:"On",value:function(){return this.Ke}},{key:"Nn",value:function(t){this.Ke=t}},{key:"_n",value:function(){return this.kn}},{key:"jn",value:function(t){this.kn=t}},{key:"Vn",value:function(){return this.In}},{key:"Jn",value:function(t){this.In=t}},{key:"zn",value:function(){return this.Un}},{key:"qn",value:function(t){this.Un=t}}]),t}(),b=function(){function t(e,n){s(this,t),this.Kn=document.getElementById(e),this.Xn=[],this.$n=null,this.Gn=d.t(n,".action-bar"),this.Qn=Promise.resolve(),this.Yn=[],this.Zn=null,this.ts=document.querySelector(".top-bar-title");for(var r=document.createElement("span");this.ts.childNodes.length>0;){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<n;e++)if(this.Xn[e].En()===t)return e;return-1}},{key:"us",value:function(t){var e=this.os(t);return-1===e?null:this.Xn[e]}},{key:"as",value:function(){this.Kn.removeAllChildren().appendChild(f.at("The app has ended! Please close the window."))}},{key:"rs",value:function(){return new m(this.Gn)}}]),t}(),O=function(){function t(){return s(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return o(t,w),n(t,[{key:"Ze",value:function(t){var e=null;d.Qt(t,"url")?e=t.url:(e=document.createElement("div")).innerHTML="Paused...",this.Ye(e)}}]),t}(),L=function(){function t(){s(this,t),this.cs=null,this.ds=".action-bar",this.He=v.ne(),this.gs="site-content",this.ms=new Map,this.ps=[],this.fs=!1,this.Ss=!0,this.ws=null}return n(t,[{key:"Ms",value:function(){return this.cs}},{key:"ss",value:function(t){this.ps.push(t)}},{key:"Hs",value:function(t){this.fs=t}},{key:"ys",value:function(){return this.gs}},{key:"vs",value:function(t){this.gs=t}},{key:"Ts",value:function(){return this.ds}},{key:"Ps",value:function(t){this.ds=t}},{key:"ne",value:function(){return this.He}},{key:"Me",value:function(t){this.He=t}},{key:"Ls",value:function(t,e){this.ms.set(t.toLowerCase(),e)}},{key:"bs",value:function(t){this.Ss=t}},{key:"refreshCurrentSite",value:function(){this.cs.refreshCurrentSite()}},{key:"pause",value:function(t){this.Sn(O,{url:t})}},{key:"resume",value:function(){var t=this.cs.ls();t instanceof O&&t.finish()}},{key:"As",value:function(t){return t=t.toLowerCase(),this.ms.has(t)?this.ms.get(t):null}},{key:"Fs",value:function(){var t="";return 0===window.location.pathname.search(this.He)&&(t=window.location.pathname.substr(this.He.length).trim()),"/"===t.charAt(0)&&(t=t.substr(1).trim()),"/"===t.charAt(t.length-1)&&(t=t.substr(0,t.length-2).trim()),0===t.length&&window.location.hash&&(t=window.location.hash.substr(1).trim()),this.As(t)}},{key:"Cs",value:function(){for(var e=this,n=document.getElementsByClassName("deep-link"),r=0,i=n.length;r<i;r++)n[r].addEventListener("click",function(n){return n.preventDefault(),e.cs.Sn(d.t(e.As(this.dataset.siteName),e.ws),t.Rs(this.dataset.siteArgs)),!0})}},{key:"xs",value:function(t){var e=this.ps.indexOf(t);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;i<r.length;i++)(n=r[i].split("="))[0].trim().length>0&&(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;s<a;s++)o.appendChild(this.buttons[s]);return t.next=13,this._s;case 13:return this.content instanceof Node||(this.content=this.Is?f.at(this.content):document.createTextNode(this.content)),r.appendChild(this.content),this.ks=document.createElement("div"),this.ks.classList.add("background"),this.ks.appendChild(i),this.ks.querySelector(".modal").appendChild(o),this.ks.style.display="block",u=this,this.cancelable&&((l=document.createElement("span")).classList.add("close"),l.innerHTML="&times;",n.appendChild(l),l.addEventListener("click",function(){u.close()}),window.addEventListener("click",function(t){t.target===u.ks&&u.close()})),t.abrupt("return",(document.body.appendChild(this.ks),f._t().jt(),new Promise(function(t){u.Bs=t})));case 23:case"end":return t.stop()}},t,this)}));return function(){return t.apply(this,arguments)}}()},{key:"close",value:function(){d.A(this.ks)&&(this.ks.style.display="none",this.ks.remove(),this.ks=null),d.A(this.Bs)&&this.Bs(this.result)}},{key:"Vs",value:function(){this.js("confirm-button")}}]),t}(),x=function(){function e(){s(this,e)}return n(e,null,[{key:"Js",value:function(t,e){e=d.t(e,0),setTimeout(function(){var e=document.getElementById("flashMessage"+t);e.fadeOut(.2).then(function(){e.remove()})},e)}},{key:"zs",value:function(n,r,i,o){var s=null;(d.ct(r)||"object"==(void 0===r?"undefined":t(r)))&&(s=r,r=n,n=e.qs,o=!0),o=d.t(o,!1);var a=e.Ks,u=document.createElement("div"),l=document.createElement("div");l.className="flashMessage "+n,l.id="flashMessage"+a,l.style.opacity="0",l.addEventListener("click",function(){e.Js(a)}),l.appendChild(o?f.at(r,s,"span"):document.createTextNode(r)),u.appendChild(l),document.getElementById("flashMessageContainer").appendChild(u),l.fadeIn(),(i=d.t(i,e.Xs))>0&&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<s;o++)i(0,o);r(Promise.all(n))})})}},{key:"load",value:function(t,e){var n=this;return new Promise(function(r){n.hi(e,function(e){var n=e.get(t);n.onsuccess=function(t){r(t.currentTarget.result)},n.onerror=function(t){throw console.warn(t),{type:"indexed-db-load-error",event:t}}})})}},{key:"di",value:function(t,e,n){var r=this;return new Promise(function(i){r.hi(t,function(t){var r=t.getAll(e,n);r.onsuccess=function(t){i(t.currentTarget.result)},r.onerror=function(t){throw console.warn(t),{type:"indexed-db-load-error",event:t}}})})}},{key:"gi",value:function(t,e,n,r,i){var o=this;return new Promise(function(s){o.hi(n,function(n){var o=n.index(t);o.onerror=function(t){throw{type:"indexed-db-index-error",event:t}};var a=o.openCursor(e,i);a.onerror=function(t){throw{type:"indexed-db-index-error",event:t}};var u=[],l=0;a.onsuccess=function(t){var e=t.target.result;e&&(u.push(e.value),l++,d.ct(r)||l<r)?e.continue():s(u)}})})}},{key:"remove",value:function(t,e){var n=this;return new Promise(function(r){n.hi(e,"readwrite",function(e){var n=e.delete(t);n.onerror=function(t){throw{type:"indexed-db-delete-error",event:t}},n.onsuccess=function(){r()}})})}},{key:"mi",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){(r=e.delete(t[i])).onerror=function(t){throw{type:"indexed-db-delete-error",event:t}},n.push(new Promise(function(t){r.onsuccess=function(){t()}}))},o=0,s=t.length;o<s;o++)i(s,o);r(Promise.all(n))})})}},{key:"pi",value:function(t,e,n){var r=this;return new Promise(function(i){r.hi(n,"readwrite",function(n){var r=n.index(t);r.onerror=function(t){throw{type:"indexed-db-index-error",event:t}};var o=r.openCursor(e);o.onerror=function(t){throw{type:"indexed-db-index-error",event:t}},o.onsuccess=function(t){var e=t.target.result;e?(e.delete(),e.continue()):i()}})})}},{key:"fi",value:function(t){var e=this;return new Promise(function(n){e.hi(t,"readwrite",function(t){var e=t.clear();e.onerror=function(t){throw{type:"indexed-db-index-error",event:t}},e.onsuccess=n})})}},{key:"oi",value:function(){}}]),t}(),S=function(){function t(){s(this,t)}return n(t,null,[{key:"Si",value:function(e){if(d.A(t.wi[e]))return t.wi[e];var n=new Promise(function(t){var n=document.createElement("script");n.src=d.Nt(e),n.onload=t,document.body.appendChild(n)});return t.wi[e]=n,n}},{key:"Mi",value:function(e,n){if(d.A(t.Hi[e]))return t.Hi[e];n=d.t(n,"all");var r=new Promise(function(t){var r=document.createElement("link");r.rel="stylesheet",r.type="text/css",r.href=d.Nt(e),r.media=n,r.onload=t,document.head.appendChild(r)});return t.Hi[e]=r,r}}]),t}();S.wi={},S.Hi={};var C=function(){function t(e,n,r){s(this,t),this.yi=e,this.p=n,this.vi=r}return n(t,[{key:"Ti",value:function(t){return t===(t&this.yi)}},{key:"U",value:function(){return this.p}},{key:"Pi",value:function(){return this.vi}}]),t}();C.Li=1,C.bi=2,C.Ai=4,C.Fi=C.bi+C.Ai,C.Ci=C.Li+C.Fi;var j=function(){function t(){s(this,t)}return n(t,null,[{key:"init",value:function(){t.Ri=[]}},{key:"xi",value:function(e){t.Ri.push(e)}},{key:"Di",value:function(e){return t.Bi(e,t.ki())}},{key:"Ii",value:function(e,n){return t.Ui(e,n,t.ki())}},{key:"Bi",value:function(e,n){return t.Ui(e,t.Ri,n)}},{key:"Ui",value:function(e,n,r){for(var i=document.createElement("div"),o=t.Ei(),s=function(t){if(n[t].Ti(o)){var s=r(n[t],e);s.onclick=function(r){n[t].Pi()(e,this,r)},i.appendChild(s)}},a=0,u=n.length;a<u;a++)s(a);return i}},{key:"Ei",value:function(){return navigator.userAgent.match(/iPhone|iPad|iPod/i)?C.bi:null!==navigator.userAgent.match(/Android|BlackBerry|Opera Mini|IEMobile/i)||void 0!==window.orientation?C.Ai:C.Li}},{key:"ki",value:function(){return function(t){var e=document.createElement("a"),n=document.createElement("img");return e.appendChild(n),n.src=d.Nt(t.U()),n.classList.add("share-icon"),e}}}]),t}();j.init();var T=function(){function t(e){return s(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,C.Fi,e,function(t){var e;e=j.Ei()===C.bi?"sms:&body="+encodeURIComponent(t):"sms:?body="+encodeURIComponent(t),window.open(e,"_blank")}))}return o(t,C),t}(),M=function(){function t(e){return s(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,C.Ci,e,function(t){var e="https://t.me/share/url?url="+encodeURIComponent(t);window.open(e,"_blank")}))}return o(t,C),t}(),I=function(){function t(e){return s(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,C.Ci,e,function(t){var e;e=j.Ei()===C.Li?"https://web.whatsapp.com/send?text="+encodeURIComponent(t):"whatsapp://send?text="+encodeURIComponent(t),window.open(e,"_blank")}))}return o(t,C),t}(),R=function(){function t(e,n){var r;return s(this,t),(r=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,n))).Wi=e,r.active=!0,r}return o(t,k),n(t,[{key:"En",value:function(){return this.Wi}},{key:"nn",value:function(){return this.active}}]),t}(),N=function t(e,n,r){s(this,t),this.Le=e,this.be=n,this.p=r};var D=function t(){s(this,t)};D.Ni={_i:"version/2/ckeditor/ckeditor.js",ji:"version/1/listjs/list.min.js"};var F=function(){function t(){s(this,t)}return n(t,null,[{key:"load",value:function(e,n,r){n=d.t(n,!1),r=d.t(r,!1);var i=n?d.Nt(t.Vi+e):d.Nt(t.Ji+e);return fetch(i,{credentials:"same-origin"}).then(function(t){return r?t.text():t.json()}).catch(function(t){if(console.error("error",t),!r)return{success:!1,errors:["not-online"]}})}},{key:"send",value:function(e,n){var r=d.Nt(t.Ji+e);if(!(n instanceof FormData)){var i=new FormData;for(var o in n)i.append(o,n[o]);n=i}return fetch(r,{credentials:"same-origin",method:"POST",body:n}).then(function(t){return t.json()}).catch(function(t){return console.error("error",t),{success:!1,errors:["not-online"]}})}},{key:"Zt",value:function(t){return d.Zt(t)}}]),t}();F.Ji="data/",F.Vi="cached/";var B=function(){function t(e,n,i,o){s(this,t),this.zi=e,this.method=d.t(i,d.t(e.method,"POST")),this.qi=!0===d.t(o,"get"===this.method.toLowerCase()),this.Ki=!1,this.Xi="string"==typeof n?function(t){return"get"===l.method.toLowerCase()?F.load(n+F.Zt(t),l.qi):F.send(n,t)}:n;var a,u,l=this;this.$i=null,this.Gi=(u=r(regeneratorRuntime.mark(function t(e){return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,l.Qi(e);case 2:case"end":return t.stop()}},t,this)})),function(){return u.apply(this,arguments)}),e.addEventListener("submit",(a=r(regeneratorRuntime.mark(function t(e){return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return console.log("submitting!",e),e.preventDefault(),t.next=4,l.Yi(e);case 4:case"end":return t.stop()}},t,this)})),function(){return a.apply(this,arguments)}));for(var c=0,h=e.elements.length;c<h;c++){var f=e.elements[c];f.addEventListener("change",function(){""!==this.value.trim()?this.classList.add("notEmpty"):this.classList.remove("notEmpty"),this.setCustomValidity("")}),f.addEventListener("keydown",function(){this.setCustomValidity("")})}}return n(t,[{key:"Zi",value:function(t,e){var n;n=(e=d.t(e,!0))?function(e){if(Array.isArray(e)&&e.indexOf("optimistic-locking-exception")>=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;s<r.length;s++)o(s);return n}}]),t}(),q=function(){function t(e,n,r){s(this,t),this.Le=e,this.pr=n,this.Sr=d.t(r,!0),this.wr=!0,this.Mr=-1,this.Hr=null}return n(t,[{key:"yr",value:function(t){return this.Hr=t,this}},{key:"vr",value:function(t){this.Mr=t}},{key:"Tr",value:function(){return this.Le}},{key:"Pr",value:function(){return this.pr}},{key:"Lr",value:function(){var t=document.createElement("th");return t.appendChild(this.Sr?f.at(this.pr):document.createTextNode(this.pr)),this.wr&&(t.classList.add("sort"),t.dataset.sort=this.Le),t.dataset.column=this.Mr,this.br=t,this.br}},{key:"Ar",value:function(){return this.Le}},{key:"Fr",value:function(t){return t}},{key:"Cr",value:function(){var t=document.createElement("td");return t.classList.add(this.Le),t.dataset.column=this.Mr,d.A(this.Hr)&&t.classList.add("clickable"),t}},{key:"click",value:function(t,e,n){d.A(this.Hr)&&this.Hr(t,e,n)}}]),t}(),Z=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))).wr=!1,a.Rr=d.t(o,!1),a}return o(t,q),n(t,[{key:"Ar",value:function(){return null}},{key:"Cr",value:function(){var n=e(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"Cr",this).call(this);return n.classList.remove(this.Le),n.appendChild(this.Rr?f.at(this.Le):document.createTextNode(this.Le)),n}}]),t}(),G=function(){function t(e,n,r){return s(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n,r=d.t(r,!1)))}return o(t,q),n(t,[{key:"Lr",value:function(){return document.createTextNode("")}},{key:"Ar",value:function(){return{data:[this.Le]}}},{key:"Cr",value:function(){return document.createTextNode("")}}]),t}(),V=function(){function t(e,n,r){var o;return s(this,t),(o=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n,r))).Rr=!1,o}return o(t,Z),n(t,[{key:"Cr",value:function(){var n=e(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"Cr",this).call(this),r=document.createElement("img");return r.src=this.Le,n.removeAllChildren().appendChild(r),n}}]),t}(),$=function(){function t(e,n,r){s(this,t),this.xr=e,this.Dr=d.t(n,{}),this.Br=r,"string"==typeof this.xr&&(this.xr=document.getElementById(this.xr)),this.kr=[],Array.isArray(n)?this.kr=n:d.A(n.columns)&&(this.kr=n.columns)}return n(t,[{key:"Fr",value:function(t){if(console.log("prepareData",t),d.A(t))for(var e=0,n=t.length;e<n;e++)t[e]=this.Ir(t[e]);return t}},{key:"Ir",value:function(t){console.log("prepareDataset",t);for(var e=0,n=this.kr.length;e<n;e++)d.A(t[this.kr[e].Tr()])&&(t[this.kr[e].Tr()]=this.kr[e].Fr(t[this.kr[e].Tr()],t));return t}},{key:"Ur",value:function(){d.A(this.kr)&&this.Er();var t=this.xr,e=this.Dr,n=this.Br;e.item=d.t(e.item,t.id+"-template-item"),e.page=d.t(e.page,5),e.pagination=d.t(e.pagination,{outerWindow:1,innerWindow:1});var r=document.getElementById(e.item);r&&(e.item=r.outerHTML,r.remove()),n=this.Fr(n);var i=new List(t,e,n),o=this;return t.querySelector("."+d.t(e.listClass,"list")).addEventListener("click",function(t){var e=t.target.closest("td[data-column]"),n=parseInt(e.dataset.column);o.kr.length>n&&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<i;r++){this.kr[r].vr(r),t.appendChild(this.kr[r].Lr()),e.appendChild(this.kr[r].Cr());var o=this.kr[r].Ar();d.A(o)&&n.push(o)}var s=this.xr.querySelector("thead"),a=this.xr.querySelector("tfoot");d.A(s)&&s.removeAllChildren().appendChild(t),d.A(a)&&a.removeAllChildren().appendChild(d.cloneNode(t)),this.Dr.item=e.outerHTML,this.Dr.valueNames=n}},{key:"Wr",value:function(){return this.list}},{key:"Or",value:function(t,e,n){var r=this.list.get(t,e);d.A(r)&&r.length>=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;e<n;e++)x.zs(t[e]);r.tr({oldPassword:"",newPassword1:"",newPassword2:""})}),n}}]),t}();E.ti(function(){U.Vr("password-settings",et)});var nt=function(){function t(e){return s(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,"userManagement/html/fragments/userSettings.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);return new B(document.getElementById("user-settings-form"),"u/userSettings/set","post").load("u/userSettings").sr(function(t){for(var e=0,n=t.length;e<n;e++)x.zs(t[e])}),n}}]),t}();E.ti(function(){U.Vr("user-settings",nt)});var rt=function(){function t(e){return s(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,"userManagement/html/editUserRoles.html","userRoles","admin"))}return o(t,Y),n(t,[{key:"Ze",value:function(n){var r=e(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"Ze",this).call(this,n);this.userId=n.id;var i=this;return Promise.all([S.Si(D.Ni.ji),F.load("u/userRoles"+F.Zt({id:i.userId})).then(function(t){t.success?(i.co(t.result.userRoles),i.do(t.result.availableRoles),i.mo(t.result.username)):(x.zs(t.errors[0]),i.finish())})]).then(function(){return r})}},{key:"en",value:function(){this.on("#username").innerHTML=this.username;var t=this.on("#userRoles"),e=this.on("#availableRoles"),n=new V("img/minus.png","",!1),r=new V("img/plus.png","",!1),i=[new G("id"),new q("name","name"),new q("description","description"),n],o=[new G("id"),new q("name","name"),new q("description","description"),r],s=new $(t,i,this.userRoles),a=new $(e,o,this.availableRoles),u=s.Ur(),l=a.Ur(),c=this,h=function(t,e){return s.Nr(!0),a.Nr(!0),F.send("u/changeUserRole",{id:t,userId:c.userId,add:e}).then(function(e){if(s.Nr(!1),a.Nr(!1),!e.success)return x.zs(e.errors[0]),e;var n=null,r=null;e.result.hasRole?(n=l,r=u):(r=l,n=u);var i=n.get("id",t);return 1===i.length&&(r.add(i[0].values()),n.remove("id",t)),e})};n.yr(function(t){var e=t.closest("tr").dataset.id;h(e,!1)}),r.yr(function(t){var e=t.closest("tr").dataset.id;h(e,!0)})}},{key:"co",value:function(t){this.userRoles=t}},{key:"do",value:function(t){this.availableRoles=t}},{key:"mo",value:function(t){this.username=t}}]),t}();E.ti(function(t){t.Ls("userRoles",rt),t.ss(new K("userRoles",function(){t.Sn(rt)},null,1100,"admin"))});var it=function(){function t(e){return s(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,"userManagement/html/forgotPassword.html","forgotPassword","offline"))}return o(t,Y),n(t,[{key:"en",value:function(){var t=this;new B(document.getElementById("forgot-password-form"),"u/newPassword","post").sr(function(){x.zs(x.qs,f.translate("new-password-code-send")),t.finish()})}}]),t}();E.ti(function(t){t.Ls("forgotPassword",it)});var ot=function(){function t(e){return s(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,"userManagement/html/login.html","login","offline"))}return o(t,Y),n(t,[{key:"en",value:function(){var t=this;new J(document.getElementById("login-form"),"u/login","post").sr(function(e){X.setData(e),t.fn(),x.zs(x.qs,f.translate("login-success")),t.finish()}),this.on("#forgot-password-link").addEventListener("click",function(){t.Sn(it),t.finish()})}}]),t}();ot.po=null,ot.fo=null,ot.So=!0,ot.wo=!0,E.ti(function(t){t.Ls("login",ot),d.ct(ot.po)&&(ot.po=new K("login",function(){t.Sn(ot)},l.q,1100,"offline")),d.ct(ot.fo)&&(ot.fo=new K("logout",function(){X.no()},l.q,1100,"online")),ot.So&&t.ss(ot.po),ot.wo&&t.ss(ot.fo)});var st=function(){function t(e){return s(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,"userManagement/html/registration.html","registration","offline"))}return o(t,Y),n(t,[{key:"en",value:function(){new W(document.getElementById("registration-form"),"u/registration","post").sr(function(){x.zs(x.qs,f.translate("registration-success"))})}}]),t}();st.action=null,st.tt=!0,E.ti(function(t){t.Ls("registration",st),d.ct(st.action)&&(st.action=new K("registration",function(){t.Sn(st)},null,1100,"offline")),st.tt&&t.ss(st.action)});var at=function(){function t(e){return s(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,"userManagement/html/setNewPassword.html","newPassword","offline"))}return o(t,Y),n(t,[{key:"Ze",value:function(n){return this.code=n.code,e(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"Ze",this).call(this,n)}},{key:"en",value:function(){var t=document.getElementById("new-password-form");document.getElementById("code").value=this.code;var e=this;new B(t,"c/code","post").sr(function(){x.zs(x.qs,f.translate("password-updated")),e.Sn(ot),e.finish()})}}]),t}();E.ti(function(t){t.Ls("newPassword",at)});var ut=function(){function t(){s(this,t)}return n(t,[{key:"Mo",value:function(){var t=r(regeneratorRuntime.mark(function t(e,n,r,i,o,s,a,u,l){var c,h,f;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return l=d.t(l,!0),u=d.t(u,0),t.next=3,this.Ho(e,n,r,i,o,s,a,0===u);case 3:if(c=t.sent,t.t0=u>0,!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<u;a++)!(s<0||s===r[a].difficulty)||r[a].deleted||r[a].played||-1===n.indexOf(r[a].rendererType)?0===r[a].difficulty||r[a].deleted||r[a].played||i.push(r[a]):(o.push(r[a]),s=r[a].difficulty);return e.abrupt("return",0===o.length?null:o[Math.round(Math.random()*o.length)%o.length]);case 6:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}()},{key:"Do",value:function(){var e=r(regeneratorRuntime.mark(function e(n){var r;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.Ro(n);case 2:return(r=e.sent).played=!0,e.next=6,this.ui(r,t.Fo.Ao);case 6:return e.abrupt("return",e.sent);case 7:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}()}]),t}();ht.Fo={Ao:"level"},ht.qt=null;var ft=function(){function t(e){s(this,t),this.rotation=0,this.mn=e,this.parent=null}return n(t,[{key:"Bo",value:function(t){return t}},{key:"ko",value:function(){return!1}},{key:"Io",value:function(t){this.parent=t}},{key:"Uo",value:function(){if(null!==this.parent)return this.parent.Uo()}},{key:"Eo",value:function(){return!1}},{key:"Wo",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:"Oo",value:function(){}},{key:"No",value:function(t){return t}},{key:"_o",value:function(t){return t}},{key:"jo",value:function(t){return t}},{key:"Vo",value:function(){return this.mn}}]),t}(),dt=function(){function t(e){var n;s(this,t),(n=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e))).children=[],n.Xo="rotate-0",n.Ko=!0;var r=n;return n.$o=function(e){0===e.targetTouches.length&&1===e.changedTouches.length&&r.mn.contains(t.zo)&&r.mn.contains(document.elementFromPoint(e.changedTouches[0].pageX,e.changedTouches[0].pageY))&&(r.rotate(),e.stopPropagation(),e.preventDefault())},n.Go=function(e){null!==t.zo&&r.mn.contains(t.zo)&&r.mn.contains(e.target)&&(r.rotate(),e.stopPropagation(),e.preventDefault())},n}return o(t,ft),n(t,[{key:"qo",value:function(t){this.Ko=t,this.Oo()}}],[{key:"Jo",value:function(){window.addEventListener("mousedown",function(e){t.zo=e.target}),window.addEventListener("mouseup",function(){t.zo=null}),window.addEventListener("touchstart",function(e){console.log("start",e),1===e.targetTouches.length&&(t.zo=e.targetTouches[0].target)}),window.addEventListener("touchend",function(e){console.log("end",e),t.zo=null})}}]),n(t,[{key:"Eo",value:function(){return this.Ko&&!this.Uo().Qo()}},{key:"rotate",value:function(){var t=r(regeneratorRuntime.mark(function t(){var e,n,r;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.Eo()){t.next=6;break}return this.rotation+=90,this.rotation%=360,e=this.rotation,this.Yo(),this.mn.classList.add("rotating"),n=this,r=new Promise(function(t){setTimeout(t,250)}).then(function(){n.rotation===e&&n.mn.classList.remove("rotating")}),t.abrupt("return",(this.Uo().Zo(r),r));case 6:case"end":return t.stop()}},t,this)}));return function(){return t.apply(this,arguments)}}()},{key:"ko",value:function(e){if(!(e instanceof t)||e.children.length!==this.children.length)return!1;for(var n=0;n<this.children.length;n++)if(!this.children[n].ko(e.children[n]))return!1;return!0}},{key:"No",value:function(t){this.rotation=t[0],t.splice(0,1);for(var e=0,n=this.children.length;e<n;e++)t=this.children[e].No(t);return t}},{key:"_o",value:function(t){this.Ko=t[0],t.splice(0,1);for(var e=0,n=this.children.length;e<n;e++)t=this.children[e]._o(t);return t}},{key:"Bo",value:function(t){t.push(this.rotation);for(var e=0,n=this.children.length;e<n;e++)t=this.children[e].Bo(t);return t}},{key:"jo",value:function(t){t.push(this.Ko);for(var e=0,n=this.children.length;e<n;e++)t=this.children[e].jo(t);return t}},{key:"Wo",value:function(){for(var t=0,e=this.children.length;t<e;t++)if(!this.children[t].Wo())return!1;return 0===this.rotation||this.children[0].ko(this.children[2])&&this.children[1].ko(this.children[3])&&(2===this.rotation||this.children[0].ko(this.children[1]))}},{key:"ta",value:function(t){this.children=[];for(var e=0,n=t.length;e<n;e++)this.ea(t[e])}},{key:"ea",value:function(t){this.children.push(t),t.Io(this),this.Oo()}},{key:"Yo",value:function(){this.mn.classList.remove(this.Xo),this.Xo="rotate-"+this.rotation,"rotate-0"===this.Xo&&(this.Xo="rotate-360"),this.mn.classList.add(this.Xo)}},{key:"Oo",value:function(){var t=this.na();t>=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<r;n++)this.children[n].Oo(),e.appendChild(this.children[n].Vo()),n%2==1&&this.children.length-1!==n&&e.appendChild(document.createElement("br"))}},{key:"na",value:function(){return this.children.length>=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<n;e++)this.words.push(t[e].toUpperCase())}},{key:"La",value:function(t){this.ma=t}},{key:"No",value:function(t){this.ga&&(t=d.t(t,this.ma),this.ga.No(t))}},{key:"Qo",value:function(){return this.fa}},{key:"Zo",value:function(t){if(this.ga.Wo()){this.fa=!0;var e=this;return t.then(function(){e.Sa(!0)}),!0}return this.Ha(),!1}},{key:"ba",value:function(){return this.Ma}},{key:"Aa",value:function(){return this.ga}},{key:"Fa",value:function(){}},{key:"Ca",value:function(){return t.Ra(this.ga)}}],[{key:"Ra",value:function(e){var n=[];if(e.Eo()&&n.push(e),e instanceof dt)for(var r=0;r<e.children.length;r++)n.push.apply(n,t.Ra(e.children[r]));return n}},{key:"xa",value:function(t,e){for(var n=[],r=0,i=t.length;r<i;r++)n.push(new vt(d.cloneNode(e),t.charAt(r)));return n}}]),t}(),mt=function(){function t(e){var n;return s(this,t),(n=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e))).Ko=!1,n}return o(t,dt),n(t,[{key:"No",value:function(t){for(var e=0,n=this.children.length;e<n;e++)t=this.children[e].No(t);return t}},{key:"Bo",value:function(t){for(var e=0,n=this.children.length;e<n;e++)t=this.children[e].Bo(t);return t}},{key:"jo",value:function(t){for(var e=0,n=this.children.length;e<n;e++)t=this.children[e].jo(t);return t}},{key:"_o",value:function(t){for(var e=0,n=this.children.length;e<n;e++)t=this.children[e]._o(t);return t}},{key:"Oo",value:function(){var t=this.mn.querySelector(".child-container");t.removeAllChildren(),this.Yo();var e=this;this.mn.onclick=function(t){e.rotate(),t.stopPropagation()};for(var n=0,r=this.children.length;n<r;n++)this.children[n].Oo(),t.appendChild(this.children[n].Vo())}}]),t}(),gt=function(){function t(e,n){var r;return s(this,t),(r=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e))).Da=n,r}return o(t,yt),n(t,[{key:"Fa",value:function(){if(this.words.length>=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<i;r++){var o=new dt(this.pa.ua());o.ea(t[2*r]),o.ea(t[2*r+1]),o.ea(e[2*r]),o.ea(e[2*r+1]),n.ea(o)}this.Ta(n)}}}]),t}(),kt=function(){function t(e){return s(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,6))}return o(t,gt),t}(),wt=function(){function t(e){return s(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,8))}return o(t,gt),t}(),_t=function(){function t(e){return s(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,10))}return o(t,gt),t}(),bt=function(){function t(){return s(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return o(t,mt),t}(),Ot=function(){function t(e,n){var r;return s(this,t),(r=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e))).Da=n,r}return o(t,yt),n(t,[{key:"Fa",value:function(){if(this.words.length>=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<this.Da/4;n++){var r=[];r[0]=new dt(this.pa.ua()),r[1]=new dt(this.pa.ua()),r[2]=new dt(this.pa.ua()),r[3]=new dt(this.pa.ua()),r[4]=new dt(this.pa.ua()),r[5]=new dt(this.pa.ua()),r[0].ea(t[0][4*n]),r[0].ea(t[0][4*n+1]),r[0].ea(t[1][4*n]),r[0].ea(t[1][4*n+1]),r[1].ea(t[0][4*n+2]),r[1].ea(t[0][4*n+3]),r[1].ea(t[1][4*n+2]),r[1].ea(t[1][4*n+3]),r[2].ea(t[2][4*n]),r[2].ea(t[2][4*n+1]),r[2].ea(t[3][4*n]),r[2].ea(t[3][4*n+1]),r[3].ea(t[2][4*n+2]),r[3].ea(t[2][4*n+3]),r[3].ea(t[3][4*n+2]),r[3].ea(t[3][4*n+3]),r[4].ea(t[4][4*n]),r[4].ea(t[4][4*n+1]),r[4].ea(t[5][4*n]),r[4].ea(t[5][4*n+1]),r[5].ea(t[4][4*n+2]),r[5].ea(t[4][4*n+3]),r[5].ea(t[5][4*n+2]),r[5].ea(t[5][4*n+3]);var i=new dt(this.pa.ua()),o=new bt(this.pa.da());if(n%2==0){i.ea(r[0]),i.ea(r[1]),i.ea(r[2]),i.ea(r[3]);var s=new mt(this.pa.ca());s.ea(r[4]),s.ea(r[5]),o.ea(i),o.ea(s),o.Vo().classList.add("type-1")}else{var a=new mt(this.pa.ca());a.ea(r[0]),a.ea(r[1]),o.ea(a),o.ea(i),i.ea(r[2]),i.ea(r[3]),i.ea(r[4]),i.ea(r[5]),o.Vo().classList.add("type-2")}e.ea(o)}this.Ta(e)}}}]),t}(),Lt=function(){function t(e){return s(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,8))}return o(t,Ot),t}(),Pt=function(){function t(e){return s(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,12))}return o(t,Ot),t}(),xt=function(){function t(e,n){var r;return s(this,t),(r=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e))).Da=n,r}return o(t,yt),n(t,[{key:"Fa",value:function(){if(this.words.length>=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<this.Da/4;n++){var r=[];r[0]=new dt(this.pa.ua()),r[1]=new dt(this.pa.ua()),r[2]=new dt(this.pa.ua()),r[3]=new dt(this.pa.ua()),r[0].ea(t[0][4*n]),r[0].ea(t[0][4*n+1]),r[0].ea(t[1][4*n]),r[0].ea(t[1][4*n+1]),r[1].ea(t[0][4*n+2]),r[1].ea(t[0][4*n+3]),r[1].ea(t[1][4*n+2]),r[1].ea(t[1][4*n+3]),r[2].ea(t[2][4*n]),r[2].ea(t[2][4*n+1]),r[2].ea(t[3][4*n]),r[2].ea(t[3][4*n+1]),r[3].ea(t[2][4*n+2]),r[3].ea(t[2][4*n+3]),r[3].ea(t[3][4*n+2]),r[3].ea(t[3][4*n+3]);var i=new dt(this.pa.ua());i.ea(r[0]),i.ea(r[1]),i.ea(r[2]),i.ea(r[3]),e.ea(i)}this.Ta(e)}}}]),t}(),Et=function(){function t(e){return s(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,8))}return o(t,xt),t}(),At=function(){function t(e){return s(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,12))}return o(t,xt),t}(),St=function(){function t(){s(this,t)}return n(t,null,[{key:"Ba",value:function(e,n){t.types[e]=n}},{key:"ka",value:function(e){return t.types[e]}},{key:"Ia",value:function(e,n){var r=new t.types[e.rendererType](n);r.Pa(e.words),r.va(e.id);for(var i=0,o=e.rotations.length;i<o;i++)e.rotations[i]<=4&&(e.rotations[i]=90*e.rotations[i]);return r.La(e.rotations),r}}]),t}();St.types={20:kt,40:wt,60:_t,100:Lt,120:Et,140:Pt,160:At};var Ct=function(){function t(){return s(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return o(t,w),t}(),jt=function(){function t(e){return s(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,"html/application/end.html"))}return o(t,Ct),t}(),Tt=function(){function t(e){return s(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,"html/application/level.html"))}return o(t,Ct),n(t,[{key:"Tn",value:function(n){n=e(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"Tn",this).call(this,n);var r=new a(d.t(localStorage.getItem("coins"),"0"),function(){},a.V,900);return r.v(!1),r.l="coin-counter",n.tt(r),this.Ua=r,n}},{key:"Ze",value:function(n){var r=this;return this.Ea=d.t(localStorage.getItem("levelCounter"),1),this.Wa=function(){},this.Oa={Na:!1,_a:null,ja:new Audio},this.Oa.Va=Promise.race([new Promise(function(t){r.Oa.ja.addEventListener("loadeddata",t)}),new Promise(function(t){r.Oa.ja.addEventListener("error",t)})]),this.Oa.ja.src=d.Nt("sound/single_coin_fall_on_concrete_.mp3"),e(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"Ze",this).call(this,n)}},{key:"en",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:return e(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"en",this).call(this),r=this.on("#segment-leaf-template"),i=this.on("#segment-parent-template"),o=this.on("#segment-row-template"),s=this.on("#segment-triangle-template"),r.id=null,i.id=null,o.id=null,s.id=null,r.remove(),i.remove(),o.remove(),s.remove(),a=this,(u=this.on("#continue-button")).addEventListener("click",function(){a.Ja()}),l=this.on("#won-text"),c=new ut,n.next=8,c.yo(u,u.parentElement,!1,!0);case 8:return this.za=n.sent,n.next=11,c.yo(l,l.parentElement,!1,!1,10,null,5);case 11:return this.qa=n.sent,this.Ka=l,this.Ka.style.fontSize="0",this.Xa=document.getElementById("level-number-container"),this.$a=document.getElementById("level-number"),this.$a.innerText=this.Ea,n.next=19,c.yo(this.$a,this.Xa,!1,!1,4);case 19:this.Ga=n.sent,this.Xa.classList.add("visible"),this.pa=new pt(r,i,o,s),this.Qa=this.on("#coin-template"),this.Ya=this.on("#coin-container"),this.Qa.id=null,this.Ya.removeAllChildren(),this.on("#help-button").addEventListener("click",function(){h.Za()}),this.tl();case 28:case"end":return n.stop()}},n,this)}));return function(){return n.apply(this,arguments)}}()},{key:"tl",value:function(){var t=r(regeneratorRuntime.mark(function t(){var e,n,r,i,o,s,a;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(t.prev=0,null===(e=localStorage.getItem("currentLevel"))){t.next=21;break}return e=JSON.parse(e),n=ht._t(),t.next=7,n.Ro(e.id);case 7:if(null!==(r=t.sent)){t.next=10;break}return t.abrupt("return",this.Ja());case 10:return(i=St.Ia(r,this.pa)).La(e.rotations),o=this,i.ba().then(function(){o.el(i)}),i.Fa(),i.ya(e.locks),i.Aa().Oo(),i.Ha(),(s=this.on("#level")).removeAllChildren().appendChild(i.Aa().Vo()),a=new ut,t.next=19,a.yo(s,s.parentElement,!1,!1,2,2*i.words[0].length,null,0);case 19:return this.Wa=t.sent,t.abrupt("return",void(this.level=i));case 21:t.next=26;break;case 23:t.prev=23,t.t0=t.catch(0),console.error(t.t0);case 26:return t.abrupt("return",this.Ja());case 27:case"end":return t.stop()}},t,this,[[0,23]])}));return function(){return t.apply(this,arguments)}}()},{key:"Ja",value:function(){var t=r(regeneratorRuntime.mark(function t(){var e,n,r,i,o,s;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,this.Ke.classList.remove("won"),this.Ka.style.fontSize="0",e=ht._t(),t.next=5,e.xo([20,40,60,100,120,140,160]);case 5:if(null!==(n=t.sent)){t.next=8;break}return t.abrupt("return",void this.Sn(jt));case 8:return r=St.Ia(n,this.pa),i=this,r.ba().then(function(){i.el(r)}),r.Fa(),r.Aa().Oo(),r.Ha(),(o=this.on("#level")).removeAllChildren().appendChild(r.Aa().Vo()),s=new ut,t.next=15,s.yo(o,o.parentElement,!1,!1,2,2*r.words[0].length,null,0);case 15:this.Wa=t.sent,this.level=r,this.$a.innerText=this.Ea,this.Ga(),this.Ua.H(d.t(localStorage.getItem("coins"),"0")),this.Ua.k(),this.Oa.Na=!0,clearTimeout(this.Oa._a),t.next=28;break;case 25:t.prev=25,t.t0=t.catch(0),console.error(t.t0);case 28:case"end":return t.stop()}},t,this,[[0,25]])}));return function(){return t.apply(this,arguments)}}()},{key:"tn",value:function(n){var r=e(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"tn",this).call(this,n);return this.$a&&(this.$a.innerText=this.Ea,this.Xa.classList.add("visible")),this.Wa(),r}},{key:"sn",value:function(n){e(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"sn",this).call(this,n),this.Xa.classList.remove("visible")}},{key:"el",value:function(){var t=r(regeneratorRuntime.mark(function t(e){var n=this;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.delegateYield(regeneratorRuntime.mark(function t(){var r,i,o,s,a,u,l,c;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:for(r=ht._t().Do(e.O()),n.Ea++,localStorage.setItem("levelCounter",n.Ea),n.Ke.classList.add("won"),localStorage.removeItem("currentLevel"),(i=n.on("#continue-button")).style.transition="none",i.style.opacity=0,n.Ya.removeAllChildren(),o=v.get("coinsPerLevel",5),s=parseInt(d.t(localStorage.getItem("coins"),"0")),localStorage.setItem("coins",s+parseInt(o)),a=Promise.all([new Promise(function(t){setTimeout(function(){t(i.fadeIn())},500)}),n.Oa.Va]),n.Oa.Na=!1,u=n.Oa.ja,l=function(){var t=d.cloneNode(n.Qa);n.Ya.appendChild(t),a=a.then(function(){return new Promise(function(e){n.Oa.Na||(t.fadeIn(.35),null!==u&&(u.pause(),u.currentTime=0,u.play()),n.Oa._a=setTimeout(function(){n.Ua.H(s++),n.Ua.k()},175)),setTimeout(e,350)})})},c=0;c<o;c++)l(c);return n.qa(),n.za(),n.Wa(),t.next=16,r;case 16:case"end":return t.stop()}},t,n)})(),"t0",2);case 2:t.next=7;break;case 4:t.prev=4,t.t1=t.catch(0),console.error(t.t1);case 7:case"end":return t.stop()}},t,this,[[0,4]])}));return function(){return t.apply(this,arguments)}}()},{key:"Za",value:function(){var t=v.get("costForHelp",25),e=parseInt(d.t(localStorage.getItem("coins"),0));if(e>=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(!(s<i)){t.next=17;break}return t.next=6,F.load("wordRotator/levels"+F.Zt({currentRun:s,dateLastSync:e}));case 6:if((a=t.sent).success){t.next=10;break}return x.zs("sync-error",null,6e3),r=null,t.abrupt("break",17);case 10:for(a=a.result,r=d.t(r,a.currentSyncDate),i=a.maxRuns,u=a.levels,l=function(t){var e=u[t];o.push(n.Ro(u[t].id).then(function(t){return e.played=d.t(d.t(t,{}).played,!1),e}))},c=0,h=u.length;c<h;c++)l(c,h);case 14:s++,t.next=3;break;case 17:return t.next=19,Promise.all(o);case 19:return f=t.sent,t.next=22,n.Co(f);case 22:null!=r&&"null"!==r&&localStorage.setItem("date-last-sync",r);case 23:case"end":return t.stop()}},t,this)}));return function(){return t.apply(this,arguments)}}()}]),t}(),Rt=function(){function t(e){return s(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,"html/application/fragment/settings.html"))}return o(t,H),n(t,[{key:"en",value:function(){var n=this.on("#theme-radio-template");delete n.id;var r=n.parentNode;r.removeAllChildren();for(var i=function(t){var e=d.cloneNode(n),i=p.Pe[t];e.appendChild(f.at(i.Le));var o=e.querySelector("input");o.value=i.be,o.addEventListener("change",function(){this.checked&&p.Te(i)}),r.appendChild(e)},o=0;o<p.Pe.length;o++)i(o);return z._t().cr("theme",p.Ae.Le),this.on("#reset-levels").addEventListener("click",function(){localStorage.removeItem("currentLevel"),localStorage.removeItem("date-last-sync"),localStorage.removeItem("levelCounter"),ht._t().fi(ht.Fo.Ao)}),e(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"en",this).call(this)}}]),t}();E.ti(function(){U.Vr("settings",Rt)});var Nt="/pwa/wordRotator/public/";window.location.pathname.endsWith("publicTest/")&&(Nt="/pwa/wordRotator/publicTest/"),v.Me(Nt),f.At=["de","en"],f.It=!1,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=d.t(Object.assign,function(e,n){if(e=d.t(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&&(d.A(window.Node)&&!window.Node.prototype.removeAllChildren&&(Node.prototype.removeAllChildren=function(){for(;this.firstChild;)this.removeChild(this.firstChild);return this}),HTMLElement&&(HTMLElement.prototype.fadeOut=d.t(HTMLElement.prototype.fadeOut,function(t,e,n){t=d.t(t,.5),e=d.t(e,"ease-in-out"),n=d.t(n,0),this.style.transition="opacity "+t+"s "+e+" "+n+"s";var r=this,i=new Promise(function(t){var e=function e(i){r.removeEventListener("transitionend",e),r.removeEventListener("transitioncancel",n),r.style.opacity=null,r.style.transition=null,t(!0,i)},n=function n(i){r.removeEventListener("transitionend",e),r.removeEventListener("transitioncancel",n),r.style.opacity=null,r.style.transition=null,t(!1,i)};r.addEventListener("transitionend",e),r.addEventListener("transitioncancel",n)});return requestAnimationFrame(function(){requestAnimationFrame(function(){r.style.opacity=0})}),i}),HTMLElement.prototype.fadeIn=d.t(HTMLElement.prototype.fadeIn,function(t,e,n){t=d.t(t,.5),e=d.t(e,"ease-in-out"),n=d.t(n,0),this.style.transition="opacity "+t+"s "+e+" "+n+"s";var r=this,i=new Promise(function(t){var e=function e(i){r.removeEventListener("transitionend",e),r.removeEventListener("transitioncancel",n),r.style.opacity=null,r.style.transition=null,t(!0,i)},n=function n(i){r.removeEventListener("transitionend",e),r.removeEventListener("transitioncancel",n),r.style.opacity=null,r.style.transition=null,t(!1,i)};r.addEventListener("transitionend",e),r.addEventListener("transitioncancel",n)});return requestAnimationFrame(function(){requestAnimationFrame(function(){r.style.opacity=1})}),i})),Node&&(Node.prototype.replaceWith=d.t(Node.prototype.replaceWith,function(t){this.parentElement.replaceChild(t,this)}),Node.prototype.remove=d.t(Node.prototype.remove,function(){this.parentElement.removeChild(this)})),Element&&(Element.prototype.matches=d.t(Element.prototype.matches,d.t(Element.prototype.matchesSelector,Element.prototype.webkitMatchesSelector)),window.Element.prototype.closest=d.t(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=d.t(window.IDBObjectStore.prototype.getAll,function(){var t={},e=[];return this.openCursor().onsuccess=function(n){var r=n.target.result;d.A(r)?(e.push(r.value),r.continue()):d.A(t.onsuccess)&&t.onsuccess({currentTarget:{result:e}})},t})),String.prototype.startsWith=d.t(String.prototype.startsWith,function(t,e){return e=e||0,this.indexOf(t,e)===e}),String.prototype.endsWith=d.t(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=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")});