@mideind/netskrafl-react 1.0.0-beta.2 → 1.0.0-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +108 -108
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +98 -98
- package/dist/esm/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/netskrafl/Netskrafl.tsx +5 -2
- package/src/css/skrafl-explo.css +166 -165
- package/src/mithril/board.ts +21 -18
- package/src/mithril/chat.ts +1 -1
- package/src/mithril/components.ts +2 -2
- package/src/mithril/logo.ts +56 -3
- package/src/mithril/main.ts +2 -2
- package/src/mithril/page.ts +20 -16
- package/src/mithril/review.ts +2 -2
- package/src/mithril/rightcolumn.ts +2 -2
- package/src/mithril/tile.ts +4 -4
package/dist/cjs/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var e,t,n,i,o,r,s,a,l,c,d,h,u,p,g,f,m,v,b,w,x,y,_,k,C,I,S,T,E,P,R,L,N,D,A,O,M,F,z,U,j,q,B,V,H,$,W=require("react/jsx-runtime"),G=require("react");function K(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Y(){if(t)return e;function n(e,t,n,i,o,r){return{tag:e,key:t,attrs:n,children:i,text:o,dom:r,domSize:void 0,state:void 0,events:void 0,instance:void 0}}return t=1,n.normalize=function(e){return Array.isArray(e)?n("[",void 0,void 0,n.normalizeChildren(e),void 0,void 0):null==e||"boolean"==typeof e?null:"object"==typeof e?e:n("#",void 0,void 0,String(e),void 0,void 0)},n.normalizeChildren=function(e){var t=[];if(e.length){for(var i=null!=e[0]&&null!=e[0].key,o=1;o<e.length;o++)if((null!=e[o]&&null!=e[o].key)!==i)throw new TypeError(!i||null==e[o]&&"boolean"!=typeof e[o]?"In fragments, vnodes must either all have keys or none have keys.":"In fragments, vnodes must either all have keys or none have keys. You may wish to consider using an explicit keyed empty fragment, m.fragment({key: ...}), instead of a hole.");for(o=0;o<e.length;o++)t[o]=n.normalize(e[o])}return t},e=n}function J(){if(i)return n;i=1;var e=Y();return n=function(){var t,n=arguments[this],i=this+1;if(null==n?n={}:("object"!=typeof n||null!=n.tag||Array.isArray(n))&&(n={},i=this),arguments.length===i+1)t=arguments[i],Array.isArray(t)||(t=[t]);else for(t=[];i<arguments.length;)t.push(arguments[i++]);return e("",n.key,n,t)},n}function Q(){return r?o:(r=1,o={}.hasOwnProperty)}function X(){if(a)return s;a=1;var e=Y(),t=J(),n=Q(),i=/(?:(^|#|\.)([^#\.\[\]]+))|(\[(.+?)(?:\s*=\s*("|'|)((?:\\["'\]]|.)*?)\5)?\])/g,o=Object.create(null);function r(e){for(var t,r="div",s=[],a={};t=i.exec(e);){var l=t[1],c=t[2];if(""===l&&""!==c)r=c;else if("#"===l)a.id=c;else if("."===l)s.push(c);else if("["===t[3][0]){var d=t[6];d&&(d=d.replace(/\\(["'])/g,"$1").replace(/\\\\/g,"\\")),"class"===t[4]?s.push(d):a[t[4]]=""===d?d:d||!0}}return s.length>0&&(a.className=s.join(" ")),function(e){for(var t in e)if(n.call(e,t))return!1;return!0}(a)&&(a=null),o[e]={tag:r,attrs:a}}return s=function(i){if(null==i||"string"!=typeof i&&"function"!=typeof i&&"function"!=typeof i.view)throw Error("The selector must be either a string or a component.");var s=t.apply(1,arguments);return"string"==typeof i&&(s.children=e.normalizeChildren(s.children),"["!==i)?function(e,t){var i=t.attrs,o=n.call(i,"class"),r=o?i.class:i.className;return t.tag=e.tag,null!=e.attrs?(i=Object.assign({},e.attrs,i),null==r&&null==e.attrs.className||(i.className=null!=r?null!=e.attrs.className?String(e.attrs.className)+" "+String(r):r:null!=e.attrs.className?e.attrs.className:null)):null!=r&&(i.className=r),o&&(i.class=null),"input"===e.tag&&n.call(i,"type")&&(i=Object.assign({type:i.type},i)),t.attrs=i,t}(o[i]||r(i),s):(s.tag=i,s)},s}function Z(){if(p)return u;p=1;var e=X();return e.trust=function(){if(c)return l;c=1;var e=Y();return l=function(t){return null==t&&(t=""),e("<",void 0,void 0,t,void 0,void 0)}}(),e.fragment=function(){if(h)return d;h=1;var e=Y(),t=J();return d=function(){var n=t.apply(0,arguments);return n.tag="[",n.children=e.normalizeChildren(n.children),n},d}(),u=e}function ee(){if(f)return g;f=1;var e=new WeakMap;return g={delayedRemoval:e,domFor:function*(t,n={}){var i=t.dom,o=t.domSize,r=n.generation;if(null!=i)do{var s=i.nextSibling;e.get(i)===r&&(yield i,o--),i=s}while(o)}},g}function te(){if(v)return m;v=1;var e=Y(),t=ee(),n=t.delayedRemoval,i=t.domFor;return m=function(){var t,o,r={svg:"http://www.w3.org/2000/svg",math:"http://www.w3.org/1998/Math/MathML"};function s(e){return e.ownerDocument}function a(e){return e.attrs&&e.attrs.xmlns||r[e.tag]}function l(e,t){if(e.state!==t)throw new Error("'vnode.state' must not be modified.")}function c(e){var t=e.state;try{return this.apply(t,arguments)}finally{l(e,t)}}function d(e){try{return s(e).activeElement}catch(e){return null}}function h(e,t,n,i,o,r,s){for(var a=n;a<i;a++){var l=t[a];null!=l&&u(e,l,o,s,r)}}function u(t,n,i,o,r){var l=n.tag;if("string"==typeof l)switch(n.state={},null!=n.attrs&&O(n.attrs,n,i),l){case"#":!function(e,t,n){t.dom=s(e).createTextNode(t.children),_(e,t.dom,n)}(t,n,r);break;case"<":g(t,n,o,r);break;case"[":!function(e,t,n,i,o){var r=s(e).createDocumentFragment();if(null!=t.children){var a=t.children;h(r,a,0,a.length,n,null,i)}t.dom=r.firstChild,t.domSize=r.childNodes.length,_(e,r,o)}(t,n,i,o,r);break;default:!function(e,t,n,i,o){var r=t.tag,l=t.attrs,c=l&&l.is;i=a(t)||i;var d=i?c?s(e).createElementNS(i,r,{is:c}):s(e).createElementNS(i,r):c?s(e).createElement(r,{is:c}):s(e).createElement(r);t.dom=d,null!=l&&function(e,t,n){for(var i in t)E(e,i,null,t[i],n)}(t,l,i);if(_(e,d,o),!k(t)&&null!=t.children){var u=t.children;h(d,u,0,u.length,n,null,i),"select"===t.tag&&null!=l&&function(e,t){if("value"in t)if(null===t.value)-1!==e.dom.selectedIndex&&(e.dom.value=null);else{var n=""+t.value;e.dom.value===n&&-1!==e.dom.selectedIndex||(e.dom.value=n)}"selectedIndex"in t&&E(e,"selectedIndex",null,t.selectedIndex,void 0)}(t,l)}}(t,n,i,o,r)}else!function(t,n,i,o,r){(function(t,n){var i;if("function"==typeof t.tag.view){if(t.state=Object.create(t.tag),null!=(i=t.state.view).$$reentrantLock$$)return;i.$$reentrantLock$$=!0}else{if(t.state=void 0,null!=(i=t.tag).$$reentrantLock$$)return;i.$$reentrantLock$$=!0,t.state=null!=t.tag.prototype&&"function"==typeof t.tag.prototype.view?new t.tag(t):t.tag(t)}O(t.state,t,n),null!=t.attrs&&O(t.attrs,t,n);if(t.instance=e.normalize(c.call(t.state.view,t)),t.instance===t)throw Error("A view cannot return the vnode it received as argument");i.$$reentrantLock$$=null})(n,i),null!=n.instance?(u(t,n.instance,i,o,r),n.dom=n.instance.dom,n.domSize=null!=n.dom?n.instance.domSize:0):n.domSize=0}(t,n,i,o,r)}var p={caption:"table",thead:"table",tbody:"table",tfoot:"table",tr:"tbody",th:"tr",td:"tr",colgroup:"table",col:"colgroup"};function g(e,t,n,i){var o=t.children.match(/^\s*?<(\w+)/im)||[],r=s(e).createElement(p[o[1]]||"div");"http://www.w3.org/2000/svg"===n?(r.innerHTML='<svg xmlns="http://www.w3.org/2000/svg">'+t.children+"</svg>",r=r.firstChild):r.innerHTML=t.children,t.dom=r.firstChild,t.domSize=r.childNodes.length;for(var a,l=s(e).createDocumentFragment();a=r.firstChild;)l.appendChild(a);_(e,l,i)}function f(e,t,n,i,o,r){if(t!==n&&(null!=t||null!=n))if(null==t||0===t.length)h(e,n,0,n.length,i,o,r);else if(null==n||0===n.length)C(e,t,0,t.length);else{var s=null!=t[0]&&null!=t[0].key,a=null!=n[0]&&null!=n[0].key,l=0,c=0;if(!s)for(;c<t.length&&null==t[c];)c++;if(!a)for(;l<n.length&&null==n[l];)l++;if(s!==a)C(e,t,c,t.length),h(e,n,l,n.length,i,o,r);else if(a){for(var d,p,g,f,b,_=t.length-1,k=n.length-1;_>=c&&k>=l&&(g=t[_],f=n[k],g.key===f.key);)g!==f&&m(e,g,f,i,o,r),null!=f.dom&&(o=f.dom),_--,k--;for(;_>=c&&k>=l&&(d=t[c],p=n[l],d.key===p.key);)c++,l++,d!==p&&m(e,d,p,i,x(t,c,o),r);for(;_>=c&&k>=l&&l!==k&&d.key===f.key&&g.key===p.key;)y(e,g,b=x(t,c,o)),g!==p&&m(e,g,p,i,b,r),++l<=--k&&y(e,d,o),d!==f&&m(e,d,f,i,o,r),null!=f.dom&&(o=f.dom),c++,g=t[--_],f=n[k],d=t[c],p=n[l];for(;_>=c&&k>=l&&g.key===f.key;)g!==f&&m(e,g,f,i,o,r),null!=f.dom&&(o=f.dom),k--,g=t[--_],f=n[k];if(l>k)C(e,t,c,_+1);else if(c>_)h(e,n,l,k+1,i,o,r);else{var S,T,E=o,P=k-l+1,R=new Array(P),L=0,N=0,D=2147483647,A=0;for(N=0;N<P;N++)R[N]=-1;for(N=k;N>=l;N--){null==S&&(S=v(t,c,_+1));var O=S[(f=n[N]).key];null!=O&&(D=O<D?O:-1,R[N-l]=O,g=t[O],t[O]=null,g!==f&&m(e,g,f,i,o,r),null!=f.dom&&(o=f.dom),A++)}if(o=E,A!==_-c+1&&C(e,t,c,_+1),0===A)h(e,n,l,k+1,i,o,r);else if(-1===D)for(T=function(e){var t=[0],n=0,i=0,o=0,r=w.length=e.length;for(o=0;o<r;o++)w[o]=e[o];for(o=0;o<r;++o)if(-1!==e[o]){var s=t[t.length-1];if(e[s]<e[o])w[o]=s,t.push(o);else{for(n=0,i=t.length-1;n<i;){var a=(n>>>1)+(i>>>1)+(n&i&1);e[t[a]]<e[o]?n=a+1:i=a}e[o]<e[t[n]]&&(n>0&&(w[o]=t[n-1]),t[n]=o)}}n=t.length,i=t[n-1];for(;n-- >0;)t[n]=i,i=w[i];return w.length=0,t}(R),L=T.length-1,N=k;N>=l;N--)p=n[N],-1===R[N-l]?u(e,p,i,r,o):T[L]===N-l?L--:y(e,p,o),null!=p.dom&&(o=n[N].dom);else for(N=k;N>=l;N--)p=n[N],-1===R[N-l]&&u(e,p,i,r,o),null!=p.dom&&(o=n[N].dom)}}else{var M=t.length<n.length?t.length:n.length;for(l=l<c?l:c;l<M;l++)(d=t[l])===(p=n[l])||null==d&&null==p||(null==d?u(e,p,i,r,x(t,l+1,o)):null==p?I(e,d):m(e,d,p,i,x(t,l+1,o),r));t.length>M&&C(e,t,l,t.length),n.length>M&&h(e,n,l,n.length,i,o,r)}}}function m(t,n,i,o,r,s){var l=n.tag;if(l===i.tag){if(i.state=n.state,i.events=n.events,function(e,t){do{var n;if(null!=e.attrs&&"function"==typeof e.attrs.onbeforeupdate)if(void 0!==(n=c.call(e.attrs.onbeforeupdate,e,t))&&!n)break;if("string"!=typeof e.tag&&"function"==typeof e.state.onbeforeupdate)if(void 0!==(n=c.call(e.state.onbeforeupdate,e,t))&&!n)break;return!1}while(0);return e.dom=t.dom,e.domSize=t.domSize,e.instance=t.instance,e.attrs=t.attrs,e.children=t.children,e.text=t.text,!0}(i,n))return;if("string"==typeof l)switch(null!=i.attrs&&M(i.attrs,i,o),l){case"#":!function(e,t){e.children.toString()!==t.children.toString()&&(e.dom.nodeValue=t.children);t.dom=e.dom}(n,i);break;case"<":!function(e,t,n,i,o){t.children!==n.children?(S(e,t,void 0),g(e,n,i,o)):(n.dom=t.dom,n.domSize=t.domSize)}(t,n,i,s,r);break;case"[":!function(e,t,n,i,o,r){f(e,t.children,n.children,i,o,r);var s=0,a=n.children;if(n.dom=null,null!=a){for(var l=0;l<a.length;l++){var c=a[l];null!=c&&null!=c.dom&&(null==n.dom&&(n.dom=c.dom),s+=c.domSize||1)}1!==s&&(n.domSize=s)}}(t,n,i,o,r,s);break;default:!function(e,t,n,i){var o=t.dom=e.dom;i=a(t)||i,function(e,t,n,i){t&&t===n&&console.warn("Don't reuse attrs object, use new object for every redraw, this will throw in next major");if(null!=n)for(var o in n)E(e,o,t&&t[o],n[o],i);var r;if(null!=t)for(var o in t)null==(r=t[o])||null!=n&&null!=n[o]||P(e,o,r,i)}(t,e.attrs,t.attrs,i),k(t)||f(o,e.children,t.children,n,null,i)}(n,i,o,s)}else!function(t,n,i,o,r,s){if(i.instance=e.normalize(c.call(i.state.view,i)),i.instance===i)throw Error("A view cannot return the vnode it received as argument");M(i.state,i,o),null!=i.attrs&&M(i.attrs,i,o);null!=i.instance?(null==n.instance?u(t,i.instance,o,s,r):m(t,n.instance,i.instance,o,r,s),i.dom=i.instance.dom,i.domSize=i.instance.domSize):null!=n.instance?(I(t,n.instance),i.dom=void 0,i.domSize=0):(i.dom=n.dom,i.domSize=n.domSize)}(t,n,i,o,r,s)}else I(t,n),u(t,i,o,s,r)}function v(e,t,n){for(var i=Object.create(null);t<n;t++){var o=e[t];if(null!=o){var r=o.key;null!=r&&(i[r]=t)}}return i}var b,w=[];function x(e,t,n){for(;t<e.length;t++)if(null!=e[t]&&null!=e[t].dom)return e[t].dom;return n}function y(e,t,n){if(null!=t.dom){var o;if(null==t.domSize)o=t.dom;else for(var r of(o=s(e).createDocumentFragment(),i(t)))o.appendChild(r);_(e,o,n)}}function _(e,t,n){null!=n?e.insertBefore(t,n):e.appendChild(t)}function k(e){if(null==e.attrs||null==e.attrs.contenteditable&&null==e.attrs.contentEditable)return!1;var t=e.children;if(null!=t&&1===t.length&&"<"===t[0].tag){var n=t[0].children;e.dom.innerHTML!==n&&(e.dom.innerHTML=n)}else if(null!=t&&0!==t.length)throw new Error("Child node of a contenteditable must be trusted.");return!0}function C(e,t,n,i){for(var o=n;o<i;o++){var r=t[o];null!=r&&I(e,r)}}function I(e,t){var r,s,a,d,h=0,u=t.state;"string"!=typeof t.tag&&"function"==typeof t.state.onbeforeremove&&(null!=(a=c.call(t.state.onbeforeremove,t))&&"function"==typeof a.then&&(h=1,r=a));t.attrs&&"function"==typeof t.attrs.onbeforeremove&&(null!=(a=c.call(t.attrs.onbeforeremove,t))&&"function"==typeof a.then&&(h|=2,s=a));if(l(t,u),h){for(var p of(d=o,i(t)))n.set(p,d);null!=r&&r.finally((function(){1&h&&((h&=2)||(l(t,u),T(t),S(e,t,d)))})),null!=s&&s.finally((function(){2&h&&((h&=1)||(l(t,u),T(t),S(e,t,d)))}))}else T(t),S(e,t,d)}function S(e,t,o){if(null!=t.dom)if(null==t.domSize)n.get(t.dom)===o&&e.removeChild(t.dom);else for(var r of i(t,{generation:o}))e.removeChild(r)}function T(e){if("string"!=typeof e.tag&&"function"==typeof e.state.onremove&&c.call(e.state.onremove,e),e.attrs&&"function"==typeof e.attrs.onremove&&c.call(e.attrs.onremove,e),"string"!=typeof e.tag)null!=e.instance&&T(e.instance);else{var t=e.children;if(Array.isArray(t))for(var n=0;n<t.length;n++){var i=t[n];null!=i&&T(i)}}}function E(e,t,n,i,o){if("key"!==t&&"is"!==t&&null!=i&&!R(t)&&(n!==i||function(e,t){return"value"===t||"checked"===t||"selectedIndex"===t||"selected"===t&&e.dom===d(e.dom)||"option"===e.tag&&e.dom.parentNode===d(e.dom)}(e,t)||"object"==typeof i)){if("o"===t[0]&&"n"===t[1])return A(e,t,i);if("xlink:"===t.slice(0,6))e.dom.setAttributeNS("http://www.w3.org/1999/xlink",t.slice(6),i);else if("style"===t)N(e.dom,n,i);else if(L(e,t,o)){if("value"===t){var r="input"===e.tag&&"file"===e.attrs.type;if(("input"===e.tag||"textarea"===e.tag)&&e.dom.value===""+i&&(r||e.dom===d(e.dom)))return;if("select"===e.tag&&null!==n&&e.dom.value===""+i)return;if("option"===e.tag&&null!==n&&e.dom.value===""+i)return;if(r&&""+i!="")return void console.error("`value` is read-only on file inputs!")}"input"===e.tag&&"type"===t?e.dom.setAttribute(t,i):e.dom[t]=i}else"boolean"==typeof i?i?e.dom.setAttribute(t,""):e.dom.removeAttribute(t):e.dom.setAttribute("className"===t?"class":t,i)}}function P(e,t,n,i){if("key"!==t&&"is"!==t&&null!=n&&!R(t))if("o"===t[0]&&"n"===t[1])A(e,t,void 0);else if("style"===t)N(e.dom,n,null);else if(!L(e,t,i)||"className"===t||"title"===t||"value"===t&&("option"===e.tag||"select"===e.tag&&-1===e.dom.selectedIndex&&e.dom===d(e.dom))||"input"===e.tag&&"type"===t){var o=t.indexOf(":");-1!==o&&(t=t.slice(o+1)),!1!==n&&e.dom.removeAttribute("className"===t?"class":t)}else e.dom[t]=null}function R(e){return"oninit"===e||"oncreate"===e||"onupdate"===e||"onremove"===e||"onbeforeremove"===e||"onbeforeupdate"===e}function L(e,t,n){return void 0===n&&(e.tag.indexOf("-")>-1||null!=e.attrs&&e.attrs.is||"href"!==t&&"list"!==t&&"form"!==t&&"width"!==t&&"height"!==t)&&t in e.dom}function N(e,t,n){if(t===n);else if(null==n)e.style="";else if("object"!=typeof n)e.style=n;else if(null==t||"object"!=typeof t)for(var i in e.style.cssText="",n){null!=(o=n[i])&&("-"===i[0]&&"-"===i[1]?e.style.setProperty(i,String(o)):e.style[i]=String(o))}else{for(var i in n){var o;null!=(o=n[i])&&(o=String(o))!==String(t[i])&&("-"===i[0]&&"-"===i[1]?e.style.setProperty(i,o):e.style[i]=o)}for(var i in t)null!=t[i]&&null==n[i]&&("-"===i[0]&&"-"===i[1]?e.style.removeProperty(i):e.style[i]="")}}function D(){this._=t}function A(e,n,i){if(null!=e.events){if(e.events._=t,e.events[n]===i)return;null==i||"function"!=typeof i&&"object"!=typeof i?(null!=e.events[n]&&e.dom.removeEventListener(n.slice(2),e.events,!1),e.events[n]=void 0):(null==e.events[n]&&e.dom.addEventListener(n.slice(2),e.events,!1),e.events[n]=i)}else null==i||"function"!=typeof i&&"object"!=typeof i||(e.events=new D,e.dom.addEventListener(n.slice(2),e.events,!1),e.events[n]=i)}function O(e,t,n){"function"==typeof e.oninit&&c.call(e.oninit,t),"function"==typeof e.oncreate&&n.push(c.bind(e.oncreate,t))}function M(e,t,n){"function"==typeof e.onupdate&&n.push(c.bind(e.onupdate,t))}return D.prototype=Object.create(null),D.prototype.handleEvent=function(e){var t,n=this["on"+e.type];"function"==typeof n?t=n.call(e.currentTarget,e):"function"==typeof n.handleEvent&&n.handleEvent(e),this._&&!1!==e.redraw&&(0,this._)(),!1===t&&(e.preventDefault(),e.stopPropagation())},function(n,i,r){if(!n)throw new TypeError("DOM element being rendered to does not exist.");if(null!=b&&n.contains(b))throw new TypeError("Node is currently being rendered to and thus is locked.");var s=t,a=b,l=[],c=d(n),h=n.namespaceURI;b=n,t="function"==typeof r?r:void 0,o={};try{null==n.vnodes&&(n.textContent=""),i=e.normalizeChildren(Array.isArray(i)?i:[i]),f(n,n.vnodes,i,l,null,"http://www.w3.org/1999/xhtml"===h?void 0:h),n.vnodes=i,null!=c&&d(n)!==c&&"function"==typeof c.focus&&c.focus();for(var u=0;u<l.length;u++)l[u]()}finally{t=s,b=a}}},m}function ne(){return w?b:(w=1,b=te()("undefined"!=typeof window?window:null))}function ie(){if(k)return _;k=1;var e=ne();return _=function(){if(y)return x;y=1;var e=Y();return x=function(t,n,i){var o=[],r=!1,s=-1;function a(){for(s=0;s<o.length;s+=2)try{t(o[s],e(o[s+1]),l)}catch(e){i.error(e)}s=-1}function l(){r||(r=!0,n((function(){r=!1,a()})))}return l.sync=a,{mount:function(n,i){if(null!=i&&null==i.view&&"function"!=typeof i)throw new TypeError("m.mount expects a component, not a vnode.");var r=o.indexOf(n);r>=0&&(o.splice(r,2),r<=s&&(s-=2),t(n,[])),null!=i&&(o.push(n,i),t(n,e(i),l))},redraw:l}},x}()(e,"undefined"!=typeof requestAnimationFrame?requestAnimationFrame:null,"undefined"!=typeof console?console:null),_}function oe(){return I?C:(I=1,C=function(e){if("[object Object]"!==Object.prototype.toString.call(e))return"";var t=[];for(var n in e)i(n,e[n]);return t.join("&");function i(e,n){if(Array.isArray(n))for(var o=0;o<n.length;o++)i(e+"["+o+"]",n[o]);else if("[object Object]"===Object.prototype.toString.call(n))for(var o in n)i(e+"["+o+"]",n[o]);else t.push(encodeURIComponent(e)+(null!=n&&""!==n?"="+encodeURIComponent(n):""))}})}function re(){if(T)return S;T=1;var e=oe();return S=function(t,n){if(/:([^\/\.-]+)(\.{3})?:/.test(t))throw new SyntaxError("Template parameter names must be separated by either a '/', '-', or '.'.");if(null==n)return t;var i=t.indexOf("?"),o=t.indexOf("#"),r=o<0?t.length:o,s=i<0?r:i,a=t.slice(0,s),l={};Object.assign(l,n);var c=a.replace(/:([^\/\.-]+)(\.{3})?/g,(function(e,t,i){return delete l[t],null==n[t]?e:i?n[t]:encodeURIComponent(String(n[t]))})),d=c.indexOf("?"),h=c.indexOf("#"),u=h<0?c.length:h,p=d<0?u:d,g=c.slice(0,p);i>=0&&(g+=t.slice(i,r)),d>=0&&(g+=(i<0?"?":"&")+c.slice(d,u));var f=e(l);return f&&(g+=(i<0&&d<0?"?":"&")+f),o>=0&&(g+=t.slice(o)),h>=0&&(g+=(o<0?"":"&")+c.slice(h)),g},S}function se(){if(P)return E;P=1;var e=re(),t=Q();return E=function(n,i){function o(e){return new Promise(e)}function r(e,n){for(var i in e.headers)if(t.call(e.headers,i)&&i.toLowerCase()===n)return!0;return!1}return o.prototype=Promise.prototype,o.__proto__=Promise,{request:function(s,a){"string"!=typeof s?(a=s,s=s.url):null==a&&(a={});var l=function(i,o){return new Promise((function(s,a){i=e(i,o.params);var l,c=null!=o.method?o.method.toUpperCase():"GET",d=o.body,h=(null==o.serialize||o.serialize===JSON.serialize)&&!(d instanceof n.FormData||d instanceof n.URLSearchParams),u=o.responseType||("function"==typeof o.extract?"":"json"),p=new n.XMLHttpRequest,g=!1,f=!1,m=p,v=p.abort;for(var b in p.abort=function(){g=!0,v.call(this)},p.open(c,i,!1!==o.async,"string"==typeof o.user?o.user:void 0,"string"==typeof o.password?o.password:void 0),h&&null!=d&&!r(o,"content-type")&&p.setRequestHeader("Content-Type","application/json; charset=utf-8"),"function"==typeof o.deserialize||r(o,"accept")||p.setRequestHeader("Accept","application/json, text/*"),o.withCredentials&&(p.withCredentials=o.withCredentials),o.timeout&&(p.timeout=o.timeout),p.responseType=u,o.headers)t.call(o.headers,b)&&p.setRequestHeader(b,o.headers[b]);p.onreadystatechange=function(e){if(!g&&4===e.target.readyState)try{var t,n=e.target.status>=200&&e.target.status<300||304===e.target.status||/^file:\/\//i.test(i),r=e.target.response;if("json"===u){if(!e.target.responseType&&"function"!=typeof o.extract)try{r=JSON.parse(e.target.responseText)}catch(e){r=null}}else u&&"text"!==u||null==r&&(r=e.target.responseText);if("function"==typeof o.extract?(r=o.extract(e.target,o),n=!0):"function"==typeof o.deserialize&&(r=o.deserialize(r)),n){if("function"==typeof o.type)if(Array.isArray(r))for(var l=0;l<r.length;l++)r[l]=new o.type(r[l]);else r=new o.type(r);s(r)}else{var c=function(){try{t=e.target.responseText}catch(e){t=r}var n=new Error(t);n.code=e.target.status,n.response=r,a(n)};0===p.status?setTimeout((function(){f||c()})):c()}}catch(e){a(e)}},p.ontimeout=function(e){f=!0;var t=new Error("Request timed out");t.code=e.target.status,a(t)},"function"==typeof o.config&&(p=o.config(p,o,i)||p)!==m&&(l=p.abort,p.abort=function(){g=!0,l.call(this)}),null==d?p.send():"function"==typeof o.serialize?p.send(o.serialize(d)):d instanceof n.FormData||d instanceof n.URLSearchParams?p.send(d):p.send(JSON.stringify(d))}))}(s,a);if(!0===a.background)return l;var c=0;function d(){0==--c&&"function"==typeof i&&i()}return function e(t){var n=t.then;return t.constructor=o,t.then=function(){c++;var i=n.apply(t,arguments);return i.then(d,(function(e){if(d(),0===c)throw e})),e(i)},t}(l)}}},E}function ae(){if(D)return N;function e(e){try{return decodeURIComponent(e)}catch(t){return e}}return D=1,N=function(t){if(""===t||null==t)return{};"?"===t.charAt(0)&&(t=t.slice(1));for(var n=t.split("&"),i={},o={},r=0;r<n.length;r++){var s=n[r].split("="),a=e(s[0]),l=2===s.length?e(s[1]):"";"true"===l?l=!0:"false"===l&&(l=!1);var c=a.split(/\]\[?|\[/),d=o;a.indexOf("[")>-1&&c.pop();for(var h=0;h<c.length;h++){var u=c[h],p=c[h+1],g=""==p||!isNaN(parseInt(p,10));if(""===u)null==i[a=c.slice(0,h).join()]&&(i[a]=Array.isArray(d)?d.length:0),u=i[a]++;else if("__proto__"===u)break;if(h===c.length-1)d[u]=l;else{var f=Object.getOwnPropertyDescriptor(d,u);null!=f&&(f=f.value),null==f&&(d[u]=f=g?[]:{}),d=f}}}return o}}function le(){if(O)return A;O=1;var e=ae();return A=function(t){var n=t.indexOf("?"),i=t.indexOf("#"),o=i<0?t.length:i,r=n<0?o:n,s=t.slice(0,r).replace(/\/{2,}/g,"/");return s?"/"!==s[0]&&(s="/"+s):s="/",{path:s,params:n<0?{}:e(t.slice(n+1,o))}}}function ce(){if(F)return M;F=1;var e=le();return M=function(t){var n=e(t),i=Object.keys(n.params),o=[],r=new RegExp("^"+n.path.replace(/:([^\/.-]+)(\.{3}|\.(?!\.)|-)?|[\\^$*+.()|\[\]{}]/g,(function(e,t,n){return null==t?"\\"+e:(o.push({k:t,r:"..."===n}),"..."===n?"(.*)":"."===n?"([^/]+)\\.":"([^/]+)"+(n||""))}))+"$");return function(e){for(var t=0;t<i.length;t++)if(n.params[i[t]]!==e.params[i[t]])return!1;if(!o.length)return r.test(e.path);var s=r.exec(e.path);if(null==s)return!1;for(t=0;t<o.length;t++)e.params[o[t].k]=o[t].r?s[t+1]:decodeURIComponent(s[t+1]);return!0}},M}function de(){if(U)return z;U=1;var e=Q(),t=new RegExp("^(?:key|oninit|oncreate|onbeforeupdate|onupdate|onbeforeremove|onremove)$");return z=function(n,i){var o={};if(null!=i)for(var r in n)e.call(n,r)&&!t.test(r)&&i.indexOf(r)<0&&(o[r]=n[r]);else for(var r in n)e.call(n,r)&&!t.test(r)&&(o[r]=n[r]);return o}}function he(){if(V)return B;V=1;var e=ie();return B=function(){if(q)return j;q=1;var e=Y(),t=X(),n=re(),i=le(),o=ce(),r=de(),s={};function a(e){try{return decodeURIComponent(e)}catch(t){return e}}return j=function(l,c){var d,h,u,p,g,f,m=null==l?null:"function"==typeof l.setImmediate?l.setImmediate:l.setTimeout,v=Promise.resolve(),b=!1,w=!1,x=0,y=s,_={onbeforeupdate:function(){return!(!(x=x?2:1)||s===y)},onremove:function(){l.removeEventListener("popstate",I,!1),l.removeEventListener("hashchange",C,!1)},view:function(){if(x&&s!==y){var t=[e(u,p.key,p)];return y&&(t=y.render(t[0])),t}}},k=T.SKIP={};function C(){b=!1;var e=l.location.hash;"#"!==T.prefix[0]&&(e=l.location.search+e,"?"!==T.prefix[0]&&"/"!==(e=l.location.pathname+e)[0]&&(e="/"+e));var t=e.concat().replace(/(?:%[a-f89][a-f0-9])+/gim,a).slice(T.prefix.length),n=i(t);function o(e){console.error(e),S(h,null,{replace:!0})}Object.assign(n.params,l.history.state),function e(i){for(;i<d.length;i++)if(d[i].check(n)){var r=d[i].component,s=d[i].route,a=r,l=f=function(o){if(l===f){if(o===k)return e(i+1);u=null==o||"function"!=typeof o.view&&"function"!=typeof o?"div":o,p=n.params,g=t,f=null,y=r.render?r:null,2===x?c.redraw():(x=2,c.redraw.sync())}};return void(r.view||"function"==typeof r?(r={},l(a)):r.onmatch?v.then((function(){return r.onmatch(n.params,t,s)})).then(l,t===h?null:o):l("div"))}if(t===h)throw new Error("Could not resolve default route "+h+".");S(h,null,{replace:!0})}(0)}function I(){b||(b=!0,m(C))}function S(e,t,i){if(e=n(e,t),w){I();var o=i?i.state:null,r=i?i.title:null;i&&i.replace?l.history.replaceState(o,r,T.prefix+e):l.history.pushState(o,r,T.prefix+e)}else l.location.href=T.prefix+e}function T(e,t,n){if(!e)throw new TypeError("DOM element being rendered to does not exist.");if(d=Object.keys(n).map((function(e){if("/"!==e[0])throw new SyntaxError("Routes must start with a '/'.");if(/:([^\/\.-]+)(\.{3})?:/.test(e))throw new SyntaxError("Route parameter names must be separated with either '/', '.', or '-'.");return{route:e,component:n[e],check:o(e)}})),h=t,null!=t){var r=i(t);if(!d.some((function(e){return e.check(r)})))throw new ReferenceError("Default route doesn't match any known routes.")}"function"==typeof l.history.pushState?l.addEventListener("popstate",I,!1):"#"===T.prefix[0]&&l.addEventListener("hashchange",C,!1),w=!0,c.mount(e,_),C()}return T.set=function(e,t,n){null!=f&&((n=n||{}).replace=!0),f=null,S(e,t,n)},T.get=function(){return g},T.prefix="#!",T.Link={view:function(e){var i,o,s,a=t(e.attrs.selector||"a",r(e.attrs,["options","params","selector","onclick"]),e.children);return(a.attrs.disabled=Boolean(a.attrs.disabled))?(a.attrs.href=null,a.attrs["aria-disabled"]="true"):(i=e.attrs.options,o=e.attrs.onclick,s=n(a.attrs.href,e.attrs.params),a.attrs.href=T.prefix+s,a.attrs.onclick=function(e){var t;"function"==typeof o?t=o.call(e.currentTarget,e):null==o||"object"!=typeof o||"function"==typeof o.handleEvent&&o.handleEvent(e),!1===t||e.defaultPrevented||0!==e.button&&0!==e.which&&1!==e.which||e.currentTarget.target&&"_self"!==e.currentTarget.target||e.ctrlKey||e.metaKey||e.shiftKey||e.altKey||(e.preventDefault(),e.redraw=!1,T.set(s,null,i))}),a}},T.param=function(e){return p&&null!=e?p[e]:p},T},j}()("undefined"!=typeof window?window:null,e),B}var ue=function(){if($)return H;$=1;var e=Z(),t=function(){if(L)return R;L=1;var e=ie();return R=se()("undefined"!=typeof window?window:null,e.redraw)}(),n=ie(),i=ee(),o=function(){return e.apply(this,arguments)};return o.m=e,o.trust=e.trust,o.fragment=e.fragment,o.Fragment="[",o.mount=n.mount,o.route=he(),o.render=ne(),o.redraw=n.redraw,o.request=t.request,o.parseQueryString=ae(),o.buildQueryString=oe(),o.parsePathname=le(),o.buildPathname=re(),o.vnode=Y(),o.censor=de(),o.domFor=i.domFor,H=o}(),pe=K(ue);let ge="http://127.0.0.1:3000",fe="https://moves-dot-explo-dev.appspot.com",me="None";const ve=e=>`${ge}${e}`,be=e=>pe.request({withCredentials:!0,...e,url:ve(e.url)}),we=e=>{const t={"Content-Type":"application/json; charset=UTF-8",Authorization:`Bearer ${me}`,...null==e?void 0:e.headers};return pe.request({withCredentials:!1,method:"POST",...e,url:`${fe}${e.url}`,headers:t})};let xe="is_IS",ye="is";const _e=/{\s*(\w+)\s*}/g;let ke={},Ce=!1;function Ie(e,t){for(let n in e)if(void 0!==e[n][t])return!0;return!1}function Se(e,t){xe=e,ye=e.split("_")[0],Ie(t,xe)||Ie(t,ye)||(xe="en_US",ye="en"),ke={};for(let e in t)for(let n in t[e]){let i=t[e][n];if(Array.isArray(i)&&(i=i.join("")),void 0===ke[e]&&(ke[e]={}),i.match(/<[a-z]+>/)){const e=[];let t=0,n=null;for(;t<i.length&&(n=i.slice(t).match(/<[a-z]+>/))&&void 0!==n.index;){const o=n[0];let r=t+n.index+o.length,s=i.indexOf("</"+o.slice(1),r);s<0?t=r:(n.index>0&&e.push(i.slice(t,t+n.index)),e.push(pe(o.slice(1,-1),i.slice(r,s))),t=s+o.length+1)}t<i.length&&e.push(i.slice(t)),i=e}ke[e][n]=i}Ce=!0}function Te(e,t={}){const n=ke[e];if(void 0===n)return Ce?e:"";const i=n[xe]||n[ye]||e;return Object.keys(t).length?Re(i,t):i}function Ee(e,t={}){const n=ke[e];if(void 0===n)return Ce?e:"";const i=n[xe]||n[ye]||e;return"string"!=typeof i?"":Object.keys(t).length?function(e,t){return e.replace(_e,((e,n)=>t[n]||e))}(i,t):i}function Pe(e,t){return"string"==typeof t?pe(e,Te(t)):Array.isArray(t)?pe(e,t.map((e=>"string"==typeof e?Te(e):e))):pe(e,t)}function Re(e,t){return"string"==typeof e?e.replace(_e,((e,n)=>t[n]||e)):Array.isArray(e)?e.map((e=>Re(e,t))):e}const Le="ABCDEFGHIJKLMNO",Ne={1:"Enginn stafur lagður niður",2:"Fyrsta orð verður að liggja um byrjunarreitinn",3:"Orð verður að vera samfellt á borðinu",4:"Orð verður að tengjast orði sem fyrir er",5:"Reitur þegar upptekinn",6:"Ekki má vera eyða í orði",7:"word_not_found",8:"word_not_found",9:"Of margir stafir lagðir niður",10:"Stafur er ekki í rekkanum",11:"Of fáir stafir eftir, skipting ekki leyfð",12:"Of mörgum stöfum skipt",13:"Leik vantar á borðið - notið F5/Refresh",14:"Notandi ekki innskráður - notið F5/Refresh",15:"Rangur eða óþekktur notandi",16:"Viðureign finnst ekki",17:"Viðureign er ekki utan tímamarka",18:"Netþjónn gat ekki tekið við leiknum - reyndu aftur",19:"Véfenging er ekki möguleg í þessari viðureign",20:"Síðasti leikur er ekki véfengjanlegur",21:"Aðeins véfenging eða pass leyfileg",server:"Netþjónn gat ekki tekið við leiknum - reyndu aftur"};var De=[],Ae=-1;var Oe=!1;const Me="/board?game=";function Fe(e,t,n){e.onpointerdown=ze,e.onpointermove=Ue.bind(null,t,n),e.onpointerup=je,e.onpointercancel=je,e.onpointerout=je,e.onpointerleave=je}function ze(e){De.push(e)}function Ue(e,t,n){for(let e=0;e<De.length;e++)if(n.pointerId===De[e].pointerId){De[e]=n;break}if(2==De.length){const n=Math.sqrt(Math.pow(De[0].clientX-De[1].clientX,2)+Math.pow(De[0].clientY-De[1].clientY,2));Ae>0?n-Ae>=10?(Oe||e(),Oe=!0):Ae-n>=10&&(Oe||t(),Oe=!0):Ae<0&&(Ae=n,Oe=!1)}}function je(e){!function(e){for(let t=0;t<De.length;t++)if(De[t].pointerId===e.pointerId){De.splice(t,1);break}}(e),De.length<2&&(Ae=-1)}function qe(e){const t=e.currentTarget.classList;void 0===t||t.contains("disabled")||t.add("over"),e.redraw=!1}function Be(e){const t=e.currentTarget.classList;void 0!==t&&t.remove("over"),e.redraw=!1}function Ve(e,t,n){return pe("span.glyphicon.glyphicon-"+e+(n?".grayed":""),t)}function He(e,t){return pe("span.glyphicon.glyphicon-"+e+".grayed",t)}function $e(e){return pe.trust(" ")}function We(e){const t={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};return String(e).replace(/[&<>"'/]/g,(e=>{var n;return null!==(n=t[e])&&void 0!==n?n:""}))}function Ge(e){return document.getElementById(e).value}function Ke(e){const t=document.getElementById(e);t&&t.play()}function Ye(e){e.slice(0,12)==Me&&(e=e.slice(12));const t=e.slice(0,36);let n=e.slice(36);return n.length>0&&"&"==n.charAt(0)&&(n="?"+n.slice(1)),"/game/"+t+n}function Je(){let e=document.querySelectorAll("div.movelist .move");if(!e||!e.length)return;let t=e[e.length-1],n=t.parentNode,i=n.getAttribute("data-len"),o=i?parseInt(i):0;e.length>o&&(n.scrollTop=t.offsetTop),n.setAttribute("data-len",e.length.toString())}function Qe(e,t){return e<0||e>=15||t<0||t>=15?null:Le[e]+(t+1)}function Xe(e){var t=0,n=0,i=0,o=Le.indexOf(e[0]);return o>=0?(i=parseInt(e.slice(1))-1,t=1):(o=Le.indexOf(e.slice(-1)),i=parseInt(e)-1,n=1),{col:i,row:o,dx:t,dy:n}}function Ze(){!function(e,t,n,i,o,r,s){e.SalesCloudObject=o,e[o]=e[o]||function(){(e[o].q=e[o].q||[]).push(arguments)},e[o].l=1*new Date,r=t.createElement(n),s=t.getElementsByTagName(n)[0],r.src=i,s.parentNode.insertBefore(r,s)}(window,document,"script","https://cdn.salescloud.is/js/salescloud.min.js","salescloud")}
|
|
1
|
+
"use strict";var e,t,n,i,o,r,s,a,l,c,d,h,u,p,g,f,m,v,b,w,x,y,_,k,C,I,S,T,E,L,P,R,N,A,D,O,M,F,z,U,j,V,q,B,H,$,W=require("react/jsx-runtime"),G=require("react");function K(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Y(){if(t)return e;function n(e,t,n,i,o,r){return{tag:e,key:t,attrs:n,children:i,text:o,dom:r,domSize:void 0,state:void 0,events:void 0,instance:void 0}}return t=1,n.normalize=function(e){return Array.isArray(e)?n("[",void 0,void 0,n.normalizeChildren(e),void 0,void 0):null==e||"boolean"==typeof e?null:"object"==typeof e?e:n("#",void 0,void 0,String(e),void 0,void 0)},n.normalizeChildren=function(e){var t=[];if(e.length){for(var i=null!=e[0]&&null!=e[0].key,o=1;o<e.length;o++)if((null!=e[o]&&null!=e[o].key)!==i)throw new TypeError(!i||null==e[o]&&"boolean"!=typeof e[o]?"In fragments, vnodes must either all have keys or none have keys.":"In fragments, vnodes must either all have keys or none have keys. You may wish to consider using an explicit keyed empty fragment, m.fragment({key: ...}), instead of a hole.");for(o=0;o<e.length;o++)t[o]=n.normalize(e[o])}return t},e=n}function J(){if(i)return n;i=1;var e=Y();return n=function(){var t,n=arguments[this],i=this+1;if(null==n?n={}:("object"!=typeof n||null!=n.tag||Array.isArray(n))&&(n={},i=this),arguments.length===i+1)t=arguments[i],Array.isArray(t)||(t=[t]);else for(t=[];i<arguments.length;)t.push(arguments[i++]);return e("",n.key,n,t)},n}function Z(){return r?o:(r=1,o={}.hasOwnProperty)}function Q(){if(a)return s;a=1;var e=Y(),t=J(),n=Z(),i=/(?:(^|#|\.)([^#\.\[\]]+))|(\[(.+?)(?:\s*=\s*("|'|)((?:\\["'\]]|.)*?)\5)?\])/g,o=Object.create(null);function r(e){for(var t,r="div",s=[],a={};t=i.exec(e);){var l=t[1],c=t[2];if(""===l&&""!==c)r=c;else if("#"===l)a.id=c;else if("."===l)s.push(c);else if("["===t[3][0]){var d=t[6];d&&(d=d.replace(/\\(["'])/g,"$1").replace(/\\\\/g,"\\")),"class"===t[4]?s.push(d):a[t[4]]=""===d?d:d||!0}}return s.length>0&&(a.className=s.join(" ")),function(e){for(var t in e)if(n.call(e,t))return!1;return!0}(a)&&(a=null),o[e]={tag:r,attrs:a}}return s=function(i){if(null==i||"string"!=typeof i&&"function"!=typeof i&&"function"!=typeof i.view)throw Error("The selector must be either a string or a component.");var s=t.apply(1,arguments);return"string"==typeof i&&(s.children=e.normalizeChildren(s.children),"["!==i)?function(e,t){var i=t.attrs,o=n.call(i,"class"),r=o?i.class:i.className;return t.tag=e.tag,null!=e.attrs?(i=Object.assign({},e.attrs,i),null==r&&null==e.attrs.className||(i.className=null!=r?null!=e.attrs.className?String(e.attrs.className)+" "+String(r):r:null!=e.attrs.className?e.attrs.className:null)):null!=r&&(i.className=r),o&&(i.class=null),"input"===e.tag&&n.call(i,"type")&&(i=Object.assign({type:i.type},i)),t.attrs=i,t}(o[i]||r(i),s):(s.tag=i,s)},s}function X(){if(p)return u;p=1;var e=Q();return e.trust=function(){if(c)return l;c=1;var e=Y();return l=function(t){return null==t&&(t=""),e("<",void 0,void 0,t,void 0,void 0)}}(),e.fragment=function(){if(h)return d;h=1;var e=Y(),t=J();return d=function(){var n=t.apply(0,arguments);return n.tag="[",n.children=e.normalizeChildren(n.children),n},d}(),u=e}function ee(){if(f)return g;f=1;var e=new WeakMap;return g={delayedRemoval:e,domFor:function*(t,n={}){var i=t.dom,o=t.domSize,r=n.generation;if(null!=i)do{var s=i.nextSibling;e.get(i)===r&&(yield i,o--),i=s}while(o)}},g}function te(){if(v)return m;v=1;var e=Y(),t=ee(),n=t.delayedRemoval,i=t.domFor;return m=function(){var t,o,r={svg:"http://www.w3.org/2000/svg",math:"http://www.w3.org/1998/Math/MathML"};function s(e){return e.ownerDocument}function a(e){return e.attrs&&e.attrs.xmlns||r[e.tag]}function l(e,t){if(e.state!==t)throw new Error("'vnode.state' must not be modified.")}function c(e){var t=e.state;try{return this.apply(t,arguments)}finally{l(e,t)}}function d(e){try{return s(e).activeElement}catch(e){return null}}function h(e,t,n,i,o,r,s){for(var a=n;a<i;a++){var l=t[a];null!=l&&u(e,l,o,s,r)}}function u(t,n,i,o,r){var l=n.tag;if("string"==typeof l)switch(n.state={},null!=n.attrs&&O(n.attrs,n,i),l){case"#":!function(e,t,n){t.dom=s(e).createTextNode(t.children),_(e,t.dom,n)}(t,n,r);break;case"<":g(t,n,o,r);break;case"[":!function(e,t,n,i,o){var r=s(e).createDocumentFragment();if(null!=t.children){var a=t.children;h(r,a,0,a.length,n,null,i)}t.dom=r.firstChild,t.domSize=r.childNodes.length,_(e,r,o)}(t,n,i,o,r);break;default:!function(e,t,n,i,o){var r=t.tag,l=t.attrs,c=l&&l.is;i=a(t)||i;var d=i?c?s(e).createElementNS(i,r,{is:c}):s(e).createElementNS(i,r):c?s(e).createElement(r,{is:c}):s(e).createElement(r);t.dom=d,null!=l&&function(e,t,n){for(var i in t)E(e,i,null,t[i],n)}(t,l,i);if(_(e,d,o),!k(t)&&null!=t.children){var u=t.children;h(d,u,0,u.length,n,null,i),"select"===t.tag&&null!=l&&function(e,t){if("value"in t)if(null===t.value)-1!==e.dom.selectedIndex&&(e.dom.value=null);else{var n=""+t.value;e.dom.value===n&&-1!==e.dom.selectedIndex||(e.dom.value=n)}"selectedIndex"in t&&E(e,"selectedIndex",null,t.selectedIndex,void 0)}(t,l)}}(t,n,i,o,r)}else!function(t,n,i,o,r){(function(t,n){var i;if("function"==typeof t.tag.view){if(t.state=Object.create(t.tag),null!=(i=t.state.view).$$reentrantLock$$)return;i.$$reentrantLock$$=!0}else{if(t.state=void 0,null!=(i=t.tag).$$reentrantLock$$)return;i.$$reentrantLock$$=!0,t.state=null!=t.tag.prototype&&"function"==typeof t.tag.prototype.view?new t.tag(t):t.tag(t)}O(t.state,t,n),null!=t.attrs&&O(t.attrs,t,n);if(t.instance=e.normalize(c.call(t.state.view,t)),t.instance===t)throw Error("A view cannot return the vnode it received as argument");i.$$reentrantLock$$=null})(n,i),null!=n.instance?(u(t,n.instance,i,o,r),n.dom=n.instance.dom,n.domSize=null!=n.dom?n.instance.domSize:0):n.domSize=0}(t,n,i,o,r)}var p={caption:"table",thead:"table",tbody:"table",tfoot:"table",tr:"tbody",th:"tr",td:"tr",colgroup:"table",col:"colgroup"};function g(e,t,n,i){var o=t.children.match(/^\s*?<(\w+)/im)||[],r=s(e).createElement(p[o[1]]||"div");"http://www.w3.org/2000/svg"===n?(r.innerHTML='<svg xmlns="http://www.w3.org/2000/svg">'+t.children+"</svg>",r=r.firstChild):r.innerHTML=t.children,t.dom=r.firstChild,t.domSize=r.childNodes.length;for(var a,l=s(e).createDocumentFragment();a=r.firstChild;)l.appendChild(a);_(e,l,i)}function f(e,t,n,i,o,r){if(t!==n&&(null!=t||null!=n))if(null==t||0===t.length)h(e,n,0,n.length,i,o,r);else if(null==n||0===n.length)C(e,t,0,t.length);else{var s=null!=t[0]&&null!=t[0].key,a=null!=n[0]&&null!=n[0].key,l=0,c=0;if(!s)for(;c<t.length&&null==t[c];)c++;if(!a)for(;l<n.length&&null==n[l];)l++;if(s!==a)C(e,t,c,t.length),h(e,n,l,n.length,i,o,r);else if(a){for(var d,p,g,f,b,_=t.length-1,k=n.length-1;_>=c&&k>=l&&(g=t[_],f=n[k],g.key===f.key);)g!==f&&m(e,g,f,i,o,r),null!=f.dom&&(o=f.dom),_--,k--;for(;_>=c&&k>=l&&(d=t[c],p=n[l],d.key===p.key);)c++,l++,d!==p&&m(e,d,p,i,x(t,c,o),r);for(;_>=c&&k>=l&&l!==k&&d.key===f.key&&g.key===p.key;)y(e,g,b=x(t,c,o)),g!==p&&m(e,g,p,i,b,r),++l<=--k&&y(e,d,o),d!==f&&m(e,d,f,i,o,r),null!=f.dom&&(o=f.dom),c++,g=t[--_],f=n[k],d=t[c],p=n[l];for(;_>=c&&k>=l&&g.key===f.key;)g!==f&&m(e,g,f,i,o,r),null!=f.dom&&(o=f.dom),k--,g=t[--_],f=n[k];if(l>k)C(e,t,c,_+1);else if(c>_)h(e,n,l,k+1,i,o,r);else{var S,T,E=o,L=k-l+1,P=new Array(L),R=0,N=0,A=2147483647,D=0;for(N=0;N<L;N++)P[N]=-1;for(N=k;N>=l;N--){null==S&&(S=v(t,c,_+1));var O=S[(f=n[N]).key];null!=O&&(A=O<A?O:-1,P[N-l]=O,g=t[O],t[O]=null,g!==f&&m(e,g,f,i,o,r),null!=f.dom&&(o=f.dom),D++)}if(o=E,D!==_-c+1&&C(e,t,c,_+1),0===D)h(e,n,l,k+1,i,o,r);else if(-1===A)for(T=function(e){var t=[0],n=0,i=0,o=0,r=w.length=e.length;for(o=0;o<r;o++)w[o]=e[o];for(o=0;o<r;++o)if(-1!==e[o]){var s=t[t.length-1];if(e[s]<e[o])w[o]=s,t.push(o);else{for(n=0,i=t.length-1;n<i;){var a=(n>>>1)+(i>>>1)+(n&i&1);e[t[a]]<e[o]?n=a+1:i=a}e[o]<e[t[n]]&&(n>0&&(w[o]=t[n-1]),t[n]=o)}}n=t.length,i=t[n-1];for(;n-- >0;)t[n]=i,i=w[i];return w.length=0,t}(P),R=T.length-1,N=k;N>=l;N--)p=n[N],-1===P[N-l]?u(e,p,i,r,o):T[R]===N-l?R--:y(e,p,o),null!=p.dom&&(o=n[N].dom);else for(N=k;N>=l;N--)p=n[N],-1===P[N-l]&&u(e,p,i,r,o),null!=p.dom&&(o=n[N].dom)}}else{var M=t.length<n.length?t.length:n.length;for(l=l<c?l:c;l<M;l++)(d=t[l])===(p=n[l])||null==d&&null==p||(null==d?u(e,p,i,r,x(t,l+1,o)):null==p?I(e,d):m(e,d,p,i,x(t,l+1,o),r));t.length>M&&C(e,t,l,t.length),n.length>M&&h(e,n,l,n.length,i,o,r)}}}function m(t,n,i,o,r,s){var l=n.tag;if(l===i.tag){if(i.state=n.state,i.events=n.events,function(e,t){do{var n;if(null!=e.attrs&&"function"==typeof e.attrs.onbeforeupdate)if(void 0!==(n=c.call(e.attrs.onbeforeupdate,e,t))&&!n)break;if("string"!=typeof e.tag&&"function"==typeof e.state.onbeforeupdate)if(void 0!==(n=c.call(e.state.onbeforeupdate,e,t))&&!n)break;return!1}while(0);return e.dom=t.dom,e.domSize=t.domSize,e.instance=t.instance,e.attrs=t.attrs,e.children=t.children,e.text=t.text,!0}(i,n))return;if("string"==typeof l)switch(null!=i.attrs&&M(i.attrs,i,o),l){case"#":!function(e,t){e.children.toString()!==t.children.toString()&&(e.dom.nodeValue=t.children);t.dom=e.dom}(n,i);break;case"<":!function(e,t,n,i,o){t.children!==n.children?(S(e,t,void 0),g(e,n,i,o)):(n.dom=t.dom,n.domSize=t.domSize)}(t,n,i,s,r);break;case"[":!function(e,t,n,i,o,r){f(e,t.children,n.children,i,o,r);var s=0,a=n.children;if(n.dom=null,null!=a){for(var l=0;l<a.length;l++){var c=a[l];null!=c&&null!=c.dom&&(null==n.dom&&(n.dom=c.dom),s+=c.domSize||1)}1!==s&&(n.domSize=s)}}(t,n,i,o,r,s);break;default:!function(e,t,n,i){var o=t.dom=e.dom;i=a(t)||i,function(e,t,n,i){t&&t===n&&console.warn("Don't reuse attrs object, use new object for every redraw, this will throw in next major");if(null!=n)for(var o in n)E(e,o,t&&t[o],n[o],i);var r;if(null!=t)for(var o in t)null==(r=t[o])||null!=n&&null!=n[o]||L(e,o,r,i)}(t,e.attrs,t.attrs,i),k(t)||f(o,e.children,t.children,n,null,i)}(n,i,o,s)}else!function(t,n,i,o,r,s){if(i.instance=e.normalize(c.call(i.state.view,i)),i.instance===i)throw Error("A view cannot return the vnode it received as argument");M(i.state,i,o),null!=i.attrs&&M(i.attrs,i,o);null!=i.instance?(null==n.instance?u(t,i.instance,o,s,r):m(t,n.instance,i.instance,o,r,s),i.dom=i.instance.dom,i.domSize=i.instance.domSize):null!=n.instance?(I(t,n.instance),i.dom=void 0,i.domSize=0):(i.dom=n.dom,i.domSize=n.domSize)}(t,n,i,o,r,s)}else I(t,n),u(t,i,o,s,r)}function v(e,t,n){for(var i=Object.create(null);t<n;t++){var o=e[t];if(null!=o){var r=o.key;null!=r&&(i[r]=t)}}return i}var b,w=[];function x(e,t,n){for(;t<e.length;t++)if(null!=e[t]&&null!=e[t].dom)return e[t].dom;return n}function y(e,t,n){if(null!=t.dom){var o;if(null==t.domSize)o=t.dom;else for(var r of(o=s(e).createDocumentFragment(),i(t)))o.appendChild(r);_(e,o,n)}}function _(e,t,n){null!=n?e.insertBefore(t,n):e.appendChild(t)}function k(e){if(null==e.attrs||null==e.attrs.contenteditable&&null==e.attrs.contentEditable)return!1;var t=e.children;if(null!=t&&1===t.length&&"<"===t[0].tag){var n=t[0].children;e.dom.innerHTML!==n&&(e.dom.innerHTML=n)}else if(null!=t&&0!==t.length)throw new Error("Child node of a contenteditable must be trusted.");return!0}function C(e,t,n,i){for(var o=n;o<i;o++){var r=t[o];null!=r&&I(e,r)}}function I(e,t){var r,s,a,d,h=0,u=t.state;"string"!=typeof t.tag&&"function"==typeof t.state.onbeforeremove&&(null!=(a=c.call(t.state.onbeforeremove,t))&&"function"==typeof a.then&&(h=1,r=a));t.attrs&&"function"==typeof t.attrs.onbeforeremove&&(null!=(a=c.call(t.attrs.onbeforeremove,t))&&"function"==typeof a.then&&(h|=2,s=a));if(l(t,u),h){for(var p of(d=o,i(t)))n.set(p,d);null!=r&&r.finally((function(){1&h&&((h&=2)||(l(t,u),T(t),S(e,t,d)))})),null!=s&&s.finally((function(){2&h&&((h&=1)||(l(t,u),T(t),S(e,t,d)))}))}else T(t),S(e,t,d)}function S(e,t,o){if(null!=t.dom)if(null==t.domSize)n.get(t.dom)===o&&e.removeChild(t.dom);else for(var r of i(t,{generation:o}))e.removeChild(r)}function T(e){if("string"!=typeof e.tag&&"function"==typeof e.state.onremove&&c.call(e.state.onremove,e),e.attrs&&"function"==typeof e.attrs.onremove&&c.call(e.attrs.onremove,e),"string"!=typeof e.tag)null!=e.instance&&T(e.instance);else{var t=e.children;if(Array.isArray(t))for(var n=0;n<t.length;n++){var i=t[n];null!=i&&T(i)}}}function E(e,t,n,i,o){if("key"!==t&&"is"!==t&&null!=i&&!P(t)&&(n!==i||function(e,t){return"value"===t||"checked"===t||"selectedIndex"===t||"selected"===t&&e.dom===d(e.dom)||"option"===e.tag&&e.dom.parentNode===d(e.dom)}(e,t)||"object"==typeof i)){if("o"===t[0]&&"n"===t[1])return D(e,t,i);if("xlink:"===t.slice(0,6))e.dom.setAttributeNS("http://www.w3.org/1999/xlink",t.slice(6),i);else if("style"===t)N(e.dom,n,i);else if(R(e,t,o)){if("value"===t){var r="input"===e.tag&&"file"===e.attrs.type;if(("input"===e.tag||"textarea"===e.tag)&&e.dom.value===""+i&&(r||e.dom===d(e.dom)))return;if("select"===e.tag&&null!==n&&e.dom.value===""+i)return;if("option"===e.tag&&null!==n&&e.dom.value===""+i)return;if(r&&""+i!="")return void console.error("`value` is read-only on file inputs!")}"input"===e.tag&&"type"===t?e.dom.setAttribute(t,i):e.dom[t]=i}else"boolean"==typeof i?i?e.dom.setAttribute(t,""):e.dom.removeAttribute(t):e.dom.setAttribute("className"===t?"class":t,i)}}function L(e,t,n,i){if("key"!==t&&"is"!==t&&null!=n&&!P(t))if("o"===t[0]&&"n"===t[1])D(e,t,void 0);else if("style"===t)N(e.dom,n,null);else if(!R(e,t,i)||"className"===t||"title"===t||"value"===t&&("option"===e.tag||"select"===e.tag&&-1===e.dom.selectedIndex&&e.dom===d(e.dom))||"input"===e.tag&&"type"===t){var o=t.indexOf(":");-1!==o&&(t=t.slice(o+1)),!1!==n&&e.dom.removeAttribute("className"===t?"class":t)}else e.dom[t]=null}function P(e){return"oninit"===e||"oncreate"===e||"onupdate"===e||"onremove"===e||"onbeforeremove"===e||"onbeforeupdate"===e}function R(e,t,n){return void 0===n&&(e.tag.indexOf("-")>-1||null!=e.attrs&&e.attrs.is||"href"!==t&&"list"!==t&&"form"!==t&&"width"!==t&&"height"!==t)&&t in e.dom}function N(e,t,n){if(t===n);else if(null==n)e.style="";else if("object"!=typeof n)e.style=n;else if(null==t||"object"!=typeof t)for(var i in e.style.cssText="",n){null!=(o=n[i])&&("-"===i[0]&&"-"===i[1]?e.style.setProperty(i,String(o)):e.style[i]=String(o))}else{for(var i in n){var o;null!=(o=n[i])&&(o=String(o))!==String(t[i])&&("-"===i[0]&&"-"===i[1]?e.style.setProperty(i,o):e.style[i]=o)}for(var i in t)null!=t[i]&&null==n[i]&&("-"===i[0]&&"-"===i[1]?e.style.removeProperty(i):e.style[i]="")}}function A(){this._=t}function D(e,n,i){if(null!=e.events){if(e.events._=t,e.events[n]===i)return;null==i||"function"!=typeof i&&"object"!=typeof i?(null!=e.events[n]&&e.dom.removeEventListener(n.slice(2),e.events,!1),e.events[n]=void 0):(null==e.events[n]&&e.dom.addEventListener(n.slice(2),e.events,!1),e.events[n]=i)}else null==i||"function"!=typeof i&&"object"!=typeof i||(e.events=new A,e.dom.addEventListener(n.slice(2),e.events,!1),e.events[n]=i)}function O(e,t,n){"function"==typeof e.oninit&&c.call(e.oninit,t),"function"==typeof e.oncreate&&n.push(c.bind(e.oncreate,t))}function M(e,t,n){"function"==typeof e.onupdate&&n.push(c.bind(e.onupdate,t))}return A.prototype=Object.create(null),A.prototype.handleEvent=function(e){var t,n=this["on"+e.type];"function"==typeof n?t=n.call(e.currentTarget,e):"function"==typeof n.handleEvent&&n.handleEvent(e),this._&&!1!==e.redraw&&(0,this._)(),!1===t&&(e.preventDefault(),e.stopPropagation())},function(n,i,r){if(!n)throw new TypeError("DOM element being rendered to does not exist.");if(null!=b&&n.contains(b))throw new TypeError("Node is currently being rendered to and thus is locked.");var s=t,a=b,l=[],c=d(n),h=n.namespaceURI;b=n,t="function"==typeof r?r:void 0,o={};try{null==n.vnodes&&(n.textContent=""),i=e.normalizeChildren(Array.isArray(i)?i:[i]),f(n,n.vnodes,i,l,null,"http://www.w3.org/1999/xhtml"===h?void 0:h),n.vnodes=i,null!=c&&d(n)!==c&&"function"==typeof c.focus&&c.focus();for(var u=0;u<l.length;u++)l[u]()}finally{t=s,b=a}}},m}function ne(){return w?b:(w=1,b=te()("undefined"!=typeof window?window:null))}function ie(){if(k)return _;k=1;var e=ne();return _=function(){if(y)return x;y=1;var e=Y();return x=function(t,n,i){var o=[],r=!1,s=-1;function a(){for(s=0;s<o.length;s+=2)try{t(o[s],e(o[s+1]),l)}catch(e){i.error(e)}s=-1}function l(){r||(r=!0,n((function(){r=!1,a()})))}return l.sync=a,{mount:function(n,i){if(null!=i&&null==i.view&&"function"!=typeof i)throw new TypeError("m.mount expects a component, not a vnode.");var r=o.indexOf(n);r>=0&&(o.splice(r,2),r<=s&&(s-=2),t(n,[])),null!=i&&(o.push(n,i),t(n,e(i),l))},redraw:l}},x}()(e,"undefined"!=typeof requestAnimationFrame?requestAnimationFrame:null,"undefined"!=typeof console?console:null),_}function oe(){return I?C:(I=1,C=function(e){if("[object Object]"!==Object.prototype.toString.call(e))return"";var t=[];for(var n in e)i(n,e[n]);return t.join("&");function i(e,n){if(Array.isArray(n))for(var o=0;o<n.length;o++)i(e+"["+o+"]",n[o]);else if("[object Object]"===Object.prototype.toString.call(n))for(var o in n)i(e+"["+o+"]",n[o]);else t.push(encodeURIComponent(e)+(null!=n&&""!==n?"="+encodeURIComponent(n):""))}})}function re(){if(T)return S;T=1;var e=oe();return S=function(t,n){if(/:([^\/\.-]+)(\.{3})?:/.test(t))throw new SyntaxError("Template parameter names must be separated by either a '/', '-', or '.'.");if(null==n)return t;var i=t.indexOf("?"),o=t.indexOf("#"),r=o<0?t.length:o,s=i<0?r:i,a=t.slice(0,s),l={};Object.assign(l,n);var c=a.replace(/:([^\/\.-]+)(\.{3})?/g,(function(e,t,i){return delete l[t],null==n[t]?e:i?n[t]:encodeURIComponent(String(n[t]))})),d=c.indexOf("?"),h=c.indexOf("#"),u=h<0?c.length:h,p=d<0?u:d,g=c.slice(0,p);i>=0&&(g+=t.slice(i,r)),d>=0&&(g+=(i<0?"?":"&")+c.slice(d,u));var f=e(l);return f&&(g+=(i<0&&d<0?"?":"&")+f),o>=0&&(g+=t.slice(o)),h>=0&&(g+=(o<0?"":"&")+c.slice(h)),g},S}function se(){if(L)return E;L=1;var e=re(),t=Z();return E=function(n,i){function o(e){return new Promise(e)}function r(e,n){for(var i in e.headers)if(t.call(e.headers,i)&&i.toLowerCase()===n)return!0;return!1}return o.prototype=Promise.prototype,o.__proto__=Promise,{request:function(s,a){"string"!=typeof s?(a=s,s=s.url):null==a&&(a={});var l=function(i,o){return new Promise((function(s,a){i=e(i,o.params);var l,c=null!=o.method?o.method.toUpperCase():"GET",d=o.body,h=(null==o.serialize||o.serialize===JSON.serialize)&&!(d instanceof n.FormData||d instanceof n.URLSearchParams),u=o.responseType||("function"==typeof o.extract?"":"json"),p=new n.XMLHttpRequest,g=!1,f=!1,m=p,v=p.abort;for(var b in p.abort=function(){g=!0,v.call(this)},p.open(c,i,!1!==o.async,"string"==typeof o.user?o.user:void 0,"string"==typeof o.password?o.password:void 0),h&&null!=d&&!r(o,"content-type")&&p.setRequestHeader("Content-Type","application/json; charset=utf-8"),"function"==typeof o.deserialize||r(o,"accept")||p.setRequestHeader("Accept","application/json, text/*"),o.withCredentials&&(p.withCredentials=o.withCredentials),o.timeout&&(p.timeout=o.timeout),p.responseType=u,o.headers)t.call(o.headers,b)&&p.setRequestHeader(b,o.headers[b]);p.onreadystatechange=function(e){if(!g&&4===e.target.readyState)try{var t,n=e.target.status>=200&&e.target.status<300||304===e.target.status||/^file:\/\//i.test(i),r=e.target.response;if("json"===u){if(!e.target.responseType&&"function"!=typeof o.extract)try{r=JSON.parse(e.target.responseText)}catch(e){r=null}}else u&&"text"!==u||null==r&&(r=e.target.responseText);if("function"==typeof o.extract?(r=o.extract(e.target,o),n=!0):"function"==typeof o.deserialize&&(r=o.deserialize(r)),n){if("function"==typeof o.type)if(Array.isArray(r))for(var l=0;l<r.length;l++)r[l]=new o.type(r[l]);else r=new o.type(r);s(r)}else{var c=function(){try{t=e.target.responseText}catch(e){t=r}var n=new Error(t);n.code=e.target.status,n.response=r,a(n)};0===p.status?setTimeout((function(){f||c()})):c()}}catch(e){a(e)}},p.ontimeout=function(e){f=!0;var t=new Error("Request timed out");t.code=e.target.status,a(t)},"function"==typeof o.config&&(p=o.config(p,o,i)||p)!==m&&(l=p.abort,p.abort=function(){g=!0,l.call(this)}),null==d?p.send():"function"==typeof o.serialize?p.send(o.serialize(d)):d instanceof n.FormData||d instanceof n.URLSearchParams?p.send(d):p.send(JSON.stringify(d))}))}(s,a);if(!0===a.background)return l;var c=0;function d(){0==--c&&"function"==typeof i&&i()}return function e(t){var n=t.then;return t.constructor=o,t.then=function(){c++;var i=n.apply(t,arguments);return i.then(d,(function(e){if(d(),0===c)throw e})),e(i)},t}(l)}}},E}function ae(){if(A)return N;function e(e){try{return decodeURIComponent(e)}catch(t){return e}}return A=1,N=function(t){if(""===t||null==t)return{};"?"===t.charAt(0)&&(t=t.slice(1));for(var n=t.split("&"),i={},o={},r=0;r<n.length;r++){var s=n[r].split("="),a=e(s[0]),l=2===s.length?e(s[1]):"";"true"===l?l=!0:"false"===l&&(l=!1);var c=a.split(/\]\[?|\[/),d=o;a.indexOf("[")>-1&&c.pop();for(var h=0;h<c.length;h++){var u=c[h],p=c[h+1],g=""==p||!isNaN(parseInt(p,10));if(""===u)null==i[a=c.slice(0,h).join()]&&(i[a]=Array.isArray(d)?d.length:0),u=i[a]++;else if("__proto__"===u)break;if(h===c.length-1)d[u]=l;else{var f=Object.getOwnPropertyDescriptor(d,u);null!=f&&(f=f.value),null==f&&(d[u]=f=g?[]:{}),d=f}}}return o}}function le(){if(O)return D;O=1;var e=ae();return D=function(t){var n=t.indexOf("?"),i=t.indexOf("#"),o=i<0?t.length:i,r=n<0?o:n,s=t.slice(0,r).replace(/\/{2,}/g,"/");return s?"/"!==s[0]&&(s="/"+s):s="/",{path:s,params:n<0?{}:e(t.slice(n+1,o))}}}function ce(){if(F)return M;F=1;var e=le();return M=function(t){var n=e(t),i=Object.keys(n.params),o=[],r=new RegExp("^"+n.path.replace(/:([^\/.-]+)(\.{3}|\.(?!\.)|-)?|[\\^$*+.()|\[\]{}]/g,(function(e,t,n){return null==t?"\\"+e:(o.push({k:t,r:"..."===n}),"..."===n?"(.*)":"."===n?"([^/]+)\\.":"([^/]+)"+(n||""))}))+"$");return function(e){for(var t=0;t<i.length;t++)if(n.params[i[t]]!==e.params[i[t]])return!1;if(!o.length)return r.test(e.path);var s=r.exec(e.path);if(null==s)return!1;for(t=0;t<o.length;t++)e.params[o[t].k]=o[t].r?s[t+1]:decodeURIComponent(s[t+1]);return!0}},M}function de(){if(U)return z;U=1;var e=Z(),t=new RegExp("^(?:key|oninit|oncreate|onbeforeupdate|onupdate|onbeforeremove|onremove)$");return z=function(n,i){var o={};if(null!=i)for(var r in n)e.call(n,r)&&!t.test(r)&&i.indexOf(r)<0&&(o[r]=n[r]);else for(var r in n)e.call(n,r)&&!t.test(r)&&(o[r]=n[r]);return o}}function he(){if(B)return q;B=1;var e=ie();return q=function(){if(V)return j;V=1;var e=Y(),t=Q(),n=re(),i=le(),o=ce(),r=de(),s={};function a(e){try{return decodeURIComponent(e)}catch(t){return e}}return j=function(l,c){var d,h,u,p,g,f,m=null==l?null:"function"==typeof l.setImmediate?l.setImmediate:l.setTimeout,v=Promise.resolve(),b=!1,w=!1,x=0,y=s,_={onbeforeupdate:function(){return!(!(x=x?2:1)||s===y)},onremove:function(){l.removeEventListener("popstate",I,!1),l.removeEventListener("hashchange",C,!1)},view:function(){if(x&&s!==y){var t=[e(u,p.key,p)];return y&&(t=y.render(t[0])),t}}},k=T.SKIP={};function C(){b=!1;var e=l.location.hash;"#"!==T.prefix[0]&&(e=l.location.search+e,"?"!==T.prefix[0]&&"/"!==(e=l.location.pathname+e)[0]&&(e="/"+e));var t=e.concat().replace(/(?:%[a-f89][a-f0-9])+/gim,a).slice(T.prefix.length),n=i(t);function o(e){console.error(e),S(h,null,{replace:!0})}Object.assign(n.params,l.history.state),function e(i){for(;i<d.length;i++)if(d[i].check(n)){var r=d[i].component,s=d[i].route,a=r,l=f=function(o){if(l===f){if(o===k)return e(i+1);u=null==o||"function"!=typeof o.view&&"function"!=typeof o?"div":o,p=n.params,g=t,f=null,y=r.render?r:null,2===x?c.redraw():(x=2,c.redraw.sync())}};return void(r.view||"function"==typeof r?(r={},l(a)):r.onmatch?v.then((function(){return r.onmatch(n.params,t,s)})).then(l,t===h?null:o):l("div"))}if(t===h)throw new Error("Could not resolve default route "+h+".");S(h,null,{replace:!0})}(0)}function I(){b||(b=!0,m(C))}function S(e,t,i){if(e=n(e,t),w){I();var o=i?i.state:null,r=i?i.title:null;i&&i.replace?l.history.replaceState(o,r,T.prefix+e):l.history.pushState(o,r,T.prefix+e)}else l.location.href=T.prefix+e}function T(e,t,n){if(!e)throw new TypeError("DOM element being rendered to does not exist.");if(d=Object.keys(n).map((function(e){if("/"!==e[0])throw new SyntaxError("Routes must start with a '/'.");if(/:([^\/\.-]+)(\.{3})?:/.test(e))throw new SyntaxError("Route parameter names must be separated with either '/', '.', or '-'.");return{route:e,component:n[e],check:o(e)}})),h=t,null!=t){var r=i(t);if(!d.some((function(e){return e.check(r)})))throw new ReferenceError("Default route doesn't match any known routes.")}"function"==typeof l.history.pushState?l.addEventListener("popstate",I,!1):"#"===T.prefix[0]&&l.addEventListener("hashchange",C,!1),w=!0,c.mount(e,_),C()}return T.set=function(e,t,n){null!=f&&((n=n||{}).replace=!0),f=null,S(e,t,n)},T.get=function(){return g},T.prefix="#!",T.Link={view:function(e){var i,o,s,a=t(e.attrs.selector||"a",r(e.attrs,["options","params","selector","onclick"]),e.children);return(a.attrs.disabled=Boolean(a.attrs.disabled))?(a.attrs.href=null,a.attrs["aria-disabled"]="true"):(i=e.attrs.options,o=e.attrs.onclick,s=n(a.attrs.href,e.attrs.params),a.attrs.href=T.prefix+s,a.attrs.onclick=function(e){var t;"function"==typeof o?t=o.call(e.currentTarget,e):null==o||"object"!=typeof o||"function"==typeof o.handleEvent&&o.handleEvent(e),!1===t||e.defaultPrevented||0!==e.button&&0!==e.which&&1!==e.which||e.currentTarget.target&&"_self"!==e.currentTarget.target||e.ctrlKey||e.metaKey||e.shiftKey||e.altKey||(e.preventDefault(),e.redraw=!1,T.set(s,null,i))}),a}},T.param=function(e){return p&&null!=e?p[e]:p},T},j}()("undefined"!=typeof window?window:null,e),q}var ue=function(){if($)return H;$=1;var e=X(),t=function(){if(R)return P;R=1;var e=ie();return P=se()("undefined"!=typeof window?window:null,e.redraw)}(),n=ie(),i=ee(),o=function(){return e.apply(this,arguments)};return o.m=e,o.trust=e.trust,o.fragment=e.fragment,o.Fragment="[",o.mount=n.mount,o.route=he(),o.render=ne(),o.redraw=n.redraw,o.request=t.request,o.parseQueryString=ae(),o.buildQueryString=oe(),o.parsePathname=le(),o.buildPathname=re(),o.vnode=Y(),o.censor=de(),o.domFor=i.domFor,H=o}(),pe=K(ue);let ge="http://127.0.0.1:3000",fe="https://moves-dot-explo-dev.appspot.com",me="None";const ve=e=>`${ge}${e}`,be=e=>pe.request({withCredentials:!0,...e,url:ve(e.url)}),we=e=>{const t={"Content-Type":"application/json; charset=UTF-8",Authorization:`Bearer ${me}`,...null==e?void 0:e.headers};return pe.request({withCredentials:!1,method:"POST",...e,url:`${fe}${e.url}`,headers:t})};let xe="is_IS",ye="is";const _e=/{\s*(\w+)\s*}/g;let ke={},Ce=!1;function Ie(e,t){for(let n in e)if(void 0!==e[n][t])return!0;return!1}function Se(e,t){xe=e,ye=e.split("_")[0],Ie(t,xe)||Ie(t,ye)||(xe="en_US",ye="en"),ke={};for(let e in t)for(let n in t[e]){let i=t[e][n];if(Array.isArray(i)&&(i=i.join("")),void 0===ke[e]&&(ke[e]={}),i.match(/<[a-z]+>/)){const e=[];let t=0,n=null;for(;t<i.length&&(n=i.slice(t).match(/<[a-z]+>/))&&void 0!==n.index;){const o=n[0];let r=t+n.index+o.length,s=i.indexOf("</"+o.slice(1),r);s<0?t=r:(n.index>0&&e.push(i.slice(t,t+n.index)),e.push(pe(o.slice(1,-1),i.slice(r,s))),t=s+o.length+1)}t<i.length&&e.push(i.slice(t)),i=e}ke[e][n]=i}Ce=!0}function Te(e,t={}){const n=ke[e];if(void 0===n)return Ce?e:"";const i=n[xe]||n[ye]||e;return Object.keys(t).length?Pe(i,t):i}function Ee(e,t={}){const n=ke[e];if(void 0===n)return Ce?e:"";const i=n[xe]||n[ye]||e;return"string"!=typeof i?"":Object.keys(t).length?function(e,t){return e.replace(_e,((e,n)=>t[n]||e))}(i,t):i}function Le(e,t){return"string"==typeof t?pe(e,Te(t)):Array.isArray(t)?pe(e,t.map((e=>"string"==typeof e?Te(e):e))):pe(e,t)}function Pe(e,t){return"string"==typeof e?e.replace(_e,((e,n)=>t[n]||e)):Array.isArray(e)?e.map((e=>Pe(e,t))):e}const Re="ABCDEFGHIJKLMNO",Ne={1:"Enginn stafur lagður niður",2:"Fyrsta orð verður að liggja um byrjunarreitinn",3:"Orð verður að vera samfellt á borðinu",4:"Orð verður að tengjast orði sem fyrir er",5:"Reitur þegar upptekinn",6:"Ekki má vera eyða í orði",7:"word_not_found",8:"word_not_found",9:"Of margir stafir lagðir niður",10:"Stafur er ekki í rekkanum",11:"Of fáir stafir eftir, skipting ekki leyfð",12:"Of mörgum stöfum skipt",13:"Leik vantar á borðið - notið F5/Refresh",14:"Notandi ekki innskráður - notið F5/Refresh",15:"Rangur eða óþekktur notandi",16:"Viðureign finnst ekki",17:"Viðureign er ekki utan tímamarka",18:"Netþjónn gat ekki tekið við leiknum - reyndu aftur",19:"Véfenging er ekki möguleg í þessari viðureign",20:"Síðasti leikur er ekki véfengjanlegur",21:"Aðeins véfenging eða pass leyfileg",server:"Netþjónn gat ekki tekið við leiknum - reyndu aftur"};var Ae=[],De=-1;var Oe=!1;const Me="/board?game=";function Fe(e,t,n){e.onpointerdown=ze,e.onpointermove=Ue.bind(null,t,n),e.onpointerup=je,e.onpointercancel=je,e.onpointerout=je,e.onpointerleave=je}function ze(e){Ae.push(e)}function Ue(e,t,n){for(let e=0;e<Ae.length;e++)if(n.pointerId===Ae[e].pointerId){Ae[e]=n;break}if(2==Ae.length){const n=Math.sqrt(Math.pow(Ae[0].clientX-Ae[1].clientX,2)+Math.pow(Ae[0].clientY-Ae[1].clientY,2));De>0?n-De>=10?(Oe||e(),Oe=!0):De-n>=10&&(Oe||t(),Oe=!0):De<0&&(De=n,Oe=!1)}}function je(e){!function(e){for(let t=0;t<Ae.length;t++)if(Ae[t].pointerId===e.pointerId){Ae.splice(t,1);break}}(e),Ae.length<2&&(De=-1)}function Ve(e){const t=e.currentTarget.classList;void 0===t||t.contains("disabled")||t.add("over"),e.redraw=!1}function qe(e){const t=e.currentTarget.classList;void 0!==t&&t.remove("over"),e.redraw=!1}function Be(e,t,n){return pe("span.glyphicon.glyphicon-"+e+(n?".grayed":""),t)}function He(e,t){return pe("span.glyphicon.glyphicon-"+e+".grayed",t)}function $e(e){return pe.trust(" ")}function We(e){const t={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};return String(e).replace(/[&<>"'/]/g,(e=>{var n;return null!==(n=t[e])&&void 0!==n?n:""}))}function Ge(e){return document.getElementById(e).value}function Ke(e){const t=document.getElementById(e);t&&t.play()}function Ye(e){e.slice(0,12)==Me&&(e=e.slice(12));const t=e.slice(0,36);let n=e.slice(36);return n.length>0&&"&"==n.charAt(0)&&(n="?"+n.slice(1)),"/game/"+t+n}function Je(){let e=document.querySelectorAll("div.movelist .move");if(!e||!e.length)return;let t=e[e.length-1],n=t.parentNode,i=n.getAttribute("data-len"),o=i?parseInt(i):0;e.length>o&&(n.scrollTop=t.offsetTop),n.setAttribute("data-len",e.length.toString())}function Ze(e,t){return e<0||e>=15||t<0||t>=15?null:Re[e]+(t+1)}function Qe(e){var t=0,n=0,i=0,o=Re.indexOf(e[0]);return o>=0?(i=parseInt(e.slice(1))-1,t=1):(o=Re.indexOf(e.slice(-1)),i=parseInt(e)-1,n=1),{col:i,row:o,dx:t,dy:n}}function Xe(){!function(e,t,n,i,o,r,s){e.SalesCloudObject=o,e[o]=e[o]||function(){(e[o].q=e[o].q||[]).push(arguments)},e[o].l=1*new Date,r=t.createElement(n),s=t.getElementsByTagName(n)[0],r.src=i,s.parentNode.insertBefore(r,s)}(window,document,"script","https://cdn.salescloud.is/js/salescloud.min.js","salescloud")}
|
|
2
2
|
/**
|
|
3
3
|
* @license
|
|
4
4
|
* Copyright 2017 Google LLC
|
|
@@ -147,7 +147,7 @@ function bt(){return"undefined"!=typeof navigator&&"string"==typeof navigator.us
|
|
|
147
147
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
148
148
|
* See the License for the specific language governing permissions and
|
|
149
149
|
* limitations under the License.
|
|
150
|
-
*/function Et(e){return JSON.parse(e)}function
|
|
150
|
+
*/function Et(e){return JSON.parse(e)}function Lt(e){return JSON.stringify(e)}
|
|
151
151
|
/**
|
|
152
152
|
* @license
|
|
153
153
|
* Copyright 2017 Google LLC
|
|
@@ -163,7 +163,7 @@ function bt(){return"undefined"!=typeof navigator&&"string"==typeof navigator.us
|
|
|
163
163
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
164
164
|
* See the License for the specific language governing permissions and
|
|
165
165
|
* limitations under the License.
|
|
166
|
-
*/const
|
|
166
|
+
*/const Pt=function(e){let t={},n={},i={},o="";try{const r=e.split(".");t=Et(ct(r[0])||""),n=Et(ct(r[1])||""),o=r[2],i=n.d||{},delete n.d}catch(e){}return{header:t,claims:n,data:i,signature:o}};
|
|
167
167
|
/**
|
|
168
168
|
* @license
|
|
169
169
|
* Copyright 2017 Google LLC
|
|
@@ -180,7 +180,7 @@ function bt(){return"undefined"!=typeof navigator&&"string"==typeof navigator.us
|
|
|
180
180
|
* See the License for the specific language governing permissions and
|
|
181
181
|
* limitations under the License.
|
|
182
182
|
*/
|
|
183
|
-
function
|
|
183
|
+
function Rt(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Nt(e,t){return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0}function At(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}function Dt(e,t,n){const i={};for(const o in e)Object.prototype.hasOwnProperty.call(e,o)&&(i[o]=t.call(n,e[o],o,e));return i}function Ot(e,t){if(e===t)return!0;const n=Object.keys(e),i=Object.keys(t);for(const o of n){if(!i.includes(o))return!1;const n=e[o],r=t[o];if(Mt(n)&&Mt(r)){if(!Ot(n,r))return!1}else if(n!==r)return!1}for(const e of i)if(!n.includes(e))return!1;return!0}function Mt(e){return null!==e&&"object"==typeof e}
|
|
184
184
|
/**
|
|
185
185
|
* @license
|
|
186
186
|
* Copyright 2017 Google LLC
|
|
@@ -212,7 +212,7 @@ function Lt(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Nt(e,
|
|
|
212
212
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
213
213
|
* See the License for the specific language governing permissions and
|
|
214
214
|
* limitations under the License.
|
|
215
|
-
*/class zt{constructor(){this.chain_=[],this.buf_=[],this.W_=[],this.pad_=[],this.inbuf_=0,this.total_=0,this.blockSize=64,this.pad_[0]=128;for(let e=1;e<this.blockSize;++e)this.pad_[e]=0;this.reset()}reset(){this.chain_[0]=1732584193,this.chain_[1]=4023233417,this.chain_[2]=2562383102,this.chain_[3]=271733878,this.chain_[4]=3285377520,this.inbuf_=0,this.total_=0}compress_(e,t){t||(t=0);const n=this.W_;if("string"==typeof e)for(let i=0;i<16;i++)n[i]=e.charCodeAt(t)<<24|e.charCodeAt(t+1)<<16|e.charCodeAt(t+2)<<8|e.charCodeAt(t+3),t+=4;else for(let i=0;i<16;i++)n[i]=e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3],t+=4;for(let e=16;e<80;e++){const t=n[e-3]^n[e-8]^n[e-14]^n[e-16];n[e]=4294967295&(t<<1|t>>>31)}let i,o,r=this.chain_[0],s=this.chain_[1],a=this.chain_[2],l=this.chain_[3],c=this.chain_[4];for(let e=0;e<80;e++){e<40?e<20?(i=l^s&(a^l),o=1518500249):(i=s^a^l,o=1859775393):e<60?(i=s&a|l&(s|a),o=2400959708):(i=s^a^l,o=3395469782);const t=(r<<5|r>>>27)+i+c+o+n[e]&4294967295;c=l,l=a,a=4294967295&(s<<30|s>>>2),s=r,r=t}this.chain_[0]=this.chain_[0]+r&4294967295,this.chain_[1]=this.chain_[1]+s&4294967295,this.chain_[2]=this.chain_[2]+a&4294967295,this.chain_[3]=this.chain_[3]+l&4294967295,this.chain_[4]=this.chain_[4]+c&4294967295}update(e,t){if(null==e)return;void 0===t&&(t=e.length);const n=t-this.blockSize;let i=0;const o=this.buf_;let r=this.inbuf_;for(;i<t;){if(0===r)for(;i<=n;)this.compress_(e,i),i+=this.blockSize;if("string"==typeof e){for(;i<t;)if(o[r]=e.charCodeAt(i),++r,++i,r===this.blockSize){this.compress_(o),r=0;break}}else for(;i<t;)if(o[r]=e[i],++r,++i,r===this.blockSize){this.compress_(o),r=0;break}}this.inbuf_=r,this.total_+=t}digest(){const e=[];let t=8*this.total_;this.inbuf_<56?this.update(this.pad_,56-this.inbuf_):this.update(this.pad_,this.blockSize-(this.inbuf_-56));for(let e=this.blockSize-1;e>=56;e--)this.buf_[e]=255&t,t/=256;this.compress_(this.buf_);let n=0;for(let t=0;t<5;t++)for(let i=24;i>=0;i-=8)e[n]=this.chain_[t]>>i&255,++n;return e}}class Ut{constructor(e,t){this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=t,this.task.then((()=>{e(this)})).catch((e=>{this.error(e)}))}next(e){this.forEachObserver((t=>{t.next(e)}))}error(e){this.forEachObserver((t=>{t.error(e)})),this.close(e)}complete(){this.forEachObserver((e=>{e.complete()})),this.close()}subscribe(e,t,n){let i;if(void 0===e&&void 0===t&&void 0===n)throw new Error("Missing Observer.");i=function(e,t){if("object"!=typeof e||null===e)return!1;for(const n of t)if(n in e&&"function"==typeof e[n])return!0;return!1}(e,["next","error","complete"])?e:{next:e,error:t,complete:n},void 0===i.next&&(i.next=jt),void 0===i.error&&(i.error=jt),void 0===i.complete&&(i.complete=jt);const o=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then((()=>{try{this.finalError?i.error(this.finalError):i.complete()}catch(e){}})),this.observers.push(i),o}unsubscribeOne(e){void 0!==this.observers&&void 0!==this.observers[e]&&(delete this.observers[e],this.observerCount-=1,0===this.observerCount&&void 0!==this.onNoObservers&&this.onNoObservers(this))}forEachObserver(e){if(!this.finalized)for(let t=0;t<this.observers.length;t++)this.sendOne(t,e)}sendOne(e,t){this.task.then((()=>{if(void 0!==this.observers&&void 0!==this.observers[e])try{t(this.observers[e])}catch(e){"undefined"!=typeof console&&console.error&&console.error(e)}}))}close(e){this.finalized||(this.finalized=!0,void 0!==e&&(this.finalError=e),this.task.then((()=>{this.observers=void 0,this.onNoObservers=void 0})))}}function jt(){}function
|
|
215
|
+
*/class zt{constructor(){this.chain_=[],this.buf_=[],this.W_=[],this.pad_=[],this.inbuf_=0,this.total_=0,this.blockSize=64,this.pad_[0]=128;for(let e=1;e<this.blockSize;++e)this.pad_[e]=0;this.reset()}reset(){this.chain_[0]=1732584193,this.chain_[1]=4023233417,this.chain_[2]=2562383102,this.chain_[3]=271733878,this.chain_[4]=3285377520,this.inbuf_=0,this.total_=0}compress_(e,t){t||(t=0);const n=this.W_;if("string"==typeof e)for(let i=0;i<16;i++)n[i]=e.charCodeAt(t)<<24|e.charCodeAt(t+1)<<16|e.charCodeAt(t+2)<<8|e.charCodeAt(t+3),t+=4;else for(let i=0;i<16;i++)n[i]=e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3],t+=4;for(let e=16;e<80;e++){const t=n[e-3]^n[e-8]^n[e-14]^n[e-16];n[e]=4294967295&(t<<1|t>>>31)}let i,o,r=this.chain_[0],s=this.chain_[1],a=this.chain_[2],l=this.chain_[3],c=this.chain_[4];for(let e=0;e<80;e++){e<40?e<20?(i=l^s&(a^l),o=1518500249):(i=s^a^l,o=1859775393):e<60?(i=s&a|l&(s|a),o=2400959708):(i=s^a^l,o=3395469782);const t=(r<<5|r>>>27)+i+c+o+n[e]&4294967295;c=l,l=a,a=4294967295&(s<<30|s>>>2),s=r,r=t}this.chain_[0]=this.chain_[0]+r&4294967295,this.chain_[1]=this.chain_[1]+s&4294967295,this.chain_[2]=this.chain_[2]+a&4294967295,this.chain_[3]=this.chain_[3]+l&4294967295,this.chain_[4]=this.chain_[4]+c&4294967295}update(e,t){if(null==e)return;void 0===t&&(t=e.length);const n=t-this.blockSize;let i=0;const o=this.buf_;let r=this.inbuf_;for(;i<t;){if(0===r)for(;i<=n;)this.compress_(e,i),i+=this.blockSize;if("string"==typeof e){for(;i<t;)if(o[r]=e.charCodeAt(i),++r,++i,r===this.blockSize){this.compress_(o),r=0;break}}else for(;i<t;)if(o[r]=e[i],++r,++i,r===this.blockSize){this.compress_(o),r=0;break}}this.inbuf_=r,this.total_+=t}digest(){const e=[];let t=8*this.total_;this.inbuf_<56?this.update(this.pad_,56-this.inbuf_):this.update(this.pad_,this.blockSize-(this.inbuf_-56));for(let e=this.blockSize-1;e>=56;e--)this.buf_[e]=255&t,t/=256;this.compress_(this.buf_);let n=0;for(let t=0;t<5;t++)for(let i=24;i>=0;i-=8)e[n]=this.chain_[t]>>i&255,++n;return e}}class Ut{constructor(e,t){this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=t,this.task.then((()=>{e(this)})).catch((e=>{this.error(e)}))}next(e){this.forEachObserver((t=>{t.next(e)}))}error(e){this.forEachObserver((t=>{t.error(e)})),this.close(e)}complete(){this.forEachObserver((e=>{e.complete()})),this.close()}subscribe(e,t,n){let i;if(void 0===e&&void 0===t&&void 0===n)throw new Error("Missing Observer.");i=function(e,t){if("object"!=typeof e||null===e)return!1;for(const n of t)if(n in e&&"function"==typeof e[n])return!0;return!1}(e,["next","error","complete"])?e:{next:e,error:t,complete:n},void 0===i.next&&(i.next=jt),void 0===i.error&&(i.error=jt),void 0===i.complete&&(i.complete=jt);const o=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then((()=>{try{this.finalError?i.error(this.finalError):i.complete()}catch(e){}})),this.observers.push(i),o}unsubscribeOne(e){void 0!==this.observers&&void 0!==this.observers[e]&&(delete this.observers[e],this.observerCount-=1,0===this.observerCount&&void 0!==this.onNoObservers&&this.onNoObservers(this))}forEachObserver(e){if(!this.finalized)for(let t=0;t<this.observers.length;t++)this.sendOne(t,e)}sendOne(e,t){this.task.then((()=>{if(void 0!==this.observers&&void 0!==this.observers[e])try{t(this.observers[e])}catch(e){"undefined"!=typeof console&&console.error&&console.error(e)}}))}close(e){this.finalized||(this.finalized=!0,void 0!==e&&(this.finalError=e),this.task.then((()=>{this.observers=void 0,this.onNoObservers=void 0})))}}function jt(){}function Vt(e,t){return`${e} failed: ${t} argument `}
|
|
216
216
|
/**
|
|
217
217
|
* @license
|
|
218
218
|
* Copyright 2017 Google LLC
|
|
@@ -228,7 +228,7 @@ function Lt(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Nt(e,
|
|
|
228
228
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
229
229
|
* See the License for the specific language governing permissions and
|
|
230
230
|
* limitations under the License.
|
|
231
|
-
*/const
|
|
231
|
+
*/const qt=function(e){let t=0;for(let n=0;n<e.length;n++){const i=e.charCodeAt(n);i<128?t++:i<2048?t+=2:i>=55296&&i<=56319?(t+=4,n++):t+=3}return t};function Bt(e,t=1e3,n=2){const i=t*Math.pow(n,e),o=Math.round(.5*i*(Math.random()-.5)*2);return Math.min(144e5,i+o)}
|
|
232
232
|
/**
|
|
233
233
|
* @license
|
|
234
234
|
* Copyright 2021 Google LLC
|
|
@@ -308,7 +308,7 @@ function Lt(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Nt(e,
|
|
|
308
308
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
309
309
|
* See the License for the specific language governing permissions and
|
|
310
310
|
* limitations under the License.
|
|
311
|
-
*/var Yt;!function(e){e[e.DEBUG=0]="DEBUG",e[e.VERBOSE=1]="VERBOSE",e[e.INFO=2]="INFO",e[e.WARN=3]="WARN",e[e.ERROR=4]="ERROR",e[e.SILENT=5]="SILENT"}(Yt||(Yt={}));const Jt={debug:Yt.DEBUG,verbose:Yt.VERBOSE,info:Yt.INFO,warn:Yt.WARN,error:Yt.ERROR,silent:Yt.SILENT},
|
|
311
|
+
*/var Yt;!function(e){e[e.DEBUG=0]="DEBUG",e[e.VERBOSE=1]="VERBOSE",e[e.INFO=2]="INFO",e[e.WARN=3]="WARN",e[e.ERROR=4]="ERROR",e[e.SILENT=5]="SILENT"}(Yt||(Yt={}));const Jt={debug:Yt.DEBUG,verbose:Yt.VERBOSE,info:Yt.INFO,warn:Yt.WARN,error:Yt.ERROR,silent:Yt.SILENT},Zt=Yt.INFO,Qt={[Yt.DEBUG]:"log",[Yt.VERBOSE]:"log",[Yt.INFO]:"info",[Yt.WARN]:"warn",[Yt.ERROR]:"error"},Xt=(e,t,...n)=>{if(t<e.logLevel)return;const i=(new Date).toISOString(),o=Qt[t];if(!o)throw new Error(`Attempted to log a message with an invalid logType (value: ${t})`);console[o](`[${i}] ${e.name}:`,...n)};class en{constructor(e){this.name=e,this._logLevel=Zt,this._logHandler=Xt,this._userLogHandler=null}get logLevel(){return this._logLevel}set logLevel(e){if(!(e in Yt))throw new TypeError(`Invalid value "${e}" assigned to \`logLevel\``);this._logLevel=e}setLogLevel(e){this._logLevel="string"==typeof e?Jt[e]:e}get logHandler(){return this._logHandler}set logHandler(e){if("function"!=typeof e)throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=e}get userLogHandler(){return this._userLogHandler}set userLogHandler(e){this._userLogHandler=e}debug(...e){this._userLogHandler&&this._userLogHandler(this,Yt.DEBUG,...e),this._logHandler(this,Yt.DEBUG,...e)}log(...e){this._userLogHandler&&this._userLogHandler(this,Yt.VERBOSE,...e),this._logHandler(this,Yt.VERBOSE,...e)}info(...e){this._userLogHandler&&this._userLogHandler(this,Yt.INFO,...e),this._logHandler(this,Yt.INFO,...e)}warn(...e){this._userLogHandler&&this._userLogHandler(this,Yt.WARN,...e),this._logHandler(this,Yt.WARN,...e)}error(...e){this._userLogHandler&&this._userLogHandler(this,Yt.ERROR,...e),this._logHandler(this,Yt.ERROR,...e)}}let tn,nn;const on=new WeakMap,rn=new WeakMap,sn=new WeakMap,an=new WeakMap,ln=new WeakMap;let cn={get(e,t,n){if(e instanceof IDBTransaction){if("done"===t)return rn.get(e);if("objectStoreNames"===t)return e.objectStoreNames||sn.get(e);if("store"===t)return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return un(e[t])},set:(e,t,n)=>(e[t]=n,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function dn(e){return e!==IDBDatabase.prototype.transaction||"objectStoreNames"in IDBTransaction.prototype?(nn||(nn=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(pn(this),t),un(on.get(this))}:function(...t){return un(e.apply(pn(this),t))}:function(t,...n){const i=e.call(pn(this),t,...n);return sn.set(i,t.sort?t.sort():[t]),un(i)}}function hn(e){return"function"==typeof e?dn(e):(e instanceof IDBTransaction&&function(e){if(rn.has(e))return;const t=new Promise(((t,n)=>{const i=()=>{e.removeEventListener("complete",o),e.removeEventListener("error",r),e.removeEventListener("abort",r)},o=()=>{t(),i()},r=()=>{n(e.error||new DOMException("AbortError","AbortError")),i()};e.addEventListener("complete",o),e.addEventListener("error",r),e.addEventListener("abort",r)}));rn.set(e,t)}(e),t=e,(tn||(tn=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])).some((e=>t instanceof e))?new Proxy(e,cn):e);var t}function un(e){if(e instanceof IDBRequest)return function(e){const t=new Promise(((t,n)=>{const i=()=>{e.removeEventListener("success",o),e.removeEventListener("error",r)},o=()=>{t(un(e.result)),i()},r=()=>{n(e.error),i()};e.addEventListener("success",o),e.addEventListener("error",r)}));return t.then((t=>{t instanceof IDBCursor&&on.set(t,e)})).catch((()=>{})),ln.set(t,e),t}(e);if(an.has(e))return an.get(e);const t=hn(e);return t!==e&&(an.set(e,t),ln.set(t,e)),t}const pn=e=>ln.get(e);function gn(e,t,{blocked:n,upgrade:i,blocking:o,terminated:r}={}){const s=indexedDB.open(e,t),a=un(s);return i&&s.addEventListener("upgradeneeded",(e=>{i(un(s.result),e.oldVersion,e.newVersion,un(s.transaction),e)})),n&&s.addEventListener("blocked",(e=>n(e.oldVersion,e.newVersion,e))),a.then((e=>{r&&e.addEventListener("close",(()=>r())),o&&e.addEventListener("versionchange",(e=>o(e.oldVersion,e.newVersion,e)))})).catch((()=>{})),a}const fn=["get","getKey","getAll","getAllKeys","count"],mn=["put","add","delete","clear"],vn=new Map;function bn(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!=typeof t)return;if(vn.get(t))return vn.get(t);const n=t.replace(/FromIndex$/,""),i=t!==n,o=mn.includes(n);if(!(n in(i?IDBIndex:IDBObjectStore).prototype)||!o&&!fn.includes(n))return;const r=async function(e,...t){const r=this.transaction(e,o?"readwrite":"readonly");let s=r.store;return i&&(s=s.index(t.shift())),(await Promise.all([s[n](...t),o&&r.done]))[0]};return vn.set(t,r),r}cn=(e=>({...e,get:(t,n,i)=>bn(t,n)||e.get(t,n,i),has:(t,n)=>!!bn(t,n)||e.has(t,n)}))(cn);
|
|
312
312
|
/**
|
|
313
313
|
* @license
|
|
314
314
|
* Copyright 2019 Google LLC
|
|
@@ -325,7 +325,7 @@ function Lt(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Nt(e,
|
|
|
325
325
|
* See the License for the specific language governing permissions and
|
|
326
326
|
* limitations under the License.
|
|
327
327
|
*/
|
|
328
|
-
class wn{constructor(e){this.container=e}getPlatformInfoString(){return this.container.getProviders().map((e=>{if(function(e){const t=e.getComponent();return"VERSION"===(null==t?void 0:t.type)}(e)){const t=e.getImmediate();return`${t.library}/${t.version}`}return null})).filter((e=>e)).join(" ")}}const xn="@firebase/app",yn="0.10.16",_n=new en("@firebase/app"),kn="@firebase/app-compat",Cn="@firebase/analytics-compat",In="@firebase/analytics",Sn="@firebase/app-check-compat",Tn="@firebase/app-check",En="@firebase/auth",
|
|
328
|
+
class wn{constructor(e){this.container=e}getPlatformInfoString(){return this.container.getProviders().map((e=>{if(function(e){const t=e.getComponent();return"VERSION"===(null==t?void 0:t.type)}(e)){const t=e.getImmediate();return`${t.library}/${t.version}`}return null})).filter((e=>e)).join(" ")}}const xn="@firebase/app",yn="0.10.16",_n=new en("@firebase/app"),kn="@firebase/app-compat",Cn="@firebase/analytics-compat",In="@firebase/analytics",Sn="@firebase/app-check-compat",Tn="@firebase/app-check",En="@firebase/auth",Ln="@firebase/auth-compat",Pn="@firebase/database",Rn="@firebase/data-connect",Nn="@firebase/database-compat",An="@firebase/functions",Dn="@firebase/functions-compat",On="@firebase/installations",Mn="@firebase/installations-compat",Fn="@firebase/messaging",zn="@firebase/messaging-compat",Un="@firebase/performance",jn="@firebase/performance-compat",Vn="@firebase/remote-config",qn="@firebase/remote-config-compat",Bn="@firebase/storage",Hn="@firebase/storage-compat",$n="@firebase/firestore",Wn="@firebase/vertexai",Gn="@firebase/firestore-compat",Kn="firebase",Yn="[DEFAULT]",Jn={[xn]:"fire-core",[kn]:"fire-core-compat",[In]:"fire-analytics",[Cn]:"fire-analytics-compat",[Tn]:"fire-app-check",[Sn]:"fire-app-check-compat",[En]:"fire-auth",[Ln]:"fire-auth-compat",[Pn]:"fire-rtdb",[Rn]:"fire-data-connect",[Nn]:"fire-rtdb-compat",[An]:"fire-fn",[Dn]:"fire-fn-compat",[On]:"fire-iid",[Mn]:"fire-iid-compat",[Fn]:"fire-fcm",[zn]:"fire-fcm-compat",[Un]:"fire-perf",[jn]:"fire-perf-compat",[Vn]:"fire-rc",[qn]:"fire-rc-compat",[Bn]:"fire-gcs",[Hn]:"fire-gcs-compat",[$n]:"fire-fst",[Gn]:"fire-fst-compat",[Wn]:"fire-vertex","fire-js":"fire-js",[Kn]:"fire-js-all"},Zn=new Map,Qn=new Map,Xn=new Map;function ei(e,t){try{e.container.addComponent(t)}catch(n){_n.debug(`Component ${t.name} failed to register with FirebaseApp ${e.name}`,n)}}function ti(e){const t=e.name;if(Xn.has(t))return _n.debug(`There were multiple attempts to register component ${t}.`),!1;Xn.set(t,e);for(const t of Zn.values())ei(t,e);for(const t of Qn.values())ei(t,e);return!0}function ni(e,t){const n=e.container.getProvider("heartbeat").getImmediate({optional:!0});return n&&n.triggerHeartbeat(),e.container.getProvider(t)}function ii(e){return void 0!==e.settings}
|
|
329
329
|
/**
|
|
330
330
|
* @license
|
|
331
331
|
* Copyright 2019 Google LLC
|
|
@@ -374,7 +374,7 @@ class ri{constructor(e,t,n){this._isDeleted=!1,this._options=Object.assign({},e)
|
|
|
374
374
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
375
375
|
* See the License for the specific language governing permissions and
|
|
376
376
|
* limitations under the License.
|
|
377
|
-
*/const si="11.0.2";function ai(e,t={}){let n=e;if("object"!=typeof t){t={name:t}}const i=Object.assign({name:Yn,automaticDataCollectionEnabled:!1},t),o=i.name;if("string"!=typeof o||!o)throw oi.create("bad-app-name",{appName:String(o)});if(n||(n=ft()),!n)throw oi.create("no-options");const r=
|
|
377
|
+
*/const si="11.0.2";function ai(e,t={}){let n=e;if("object"!=typeof t){t={name:t}}const i=Object.assign({name:Yn,automaticDataCollectionEnabled:!1},t),o=i.name;if("string"!=typeof o||!o)throw oi.create("bad-app-name",{appName:String(o)});if(n||(n=ft()),!n)throw oi.create("no-options");const r=Zn.get(o);if(r){if(Ot(n,r.options)&&Ot(i,r.config))return r;throw oi.create("duplicate-app",{appName:o})}const s=new Kt(o);for(const e of Xn.values())s.addComponent(e);const a=new ri(n,i,s);return Zn.set(o,a),a}function li(e=Yn){const t=Zn.get(e);if(!t&&e===Yn&&ft())return ai();if(!t)throw oi.create("no-app",{appName:e});return t}function ci(e,t,n){var i;let o=null!==(i=Jn[e])&&void 0!==i?i:e;n&&(o+=`-${n}`);const r=o.match(/\s|\//),s=t.match(/\s|\//);if(r||s){const e=[`Unable to register library "${o}" with version "${t}":`];return r&&e.push(`library name "${o}" contains illegal characters (whitespace or "/")`),r&&s&&e.push("and"),s&&e.push(`version name "${t}" contains illegal characters (whitespace or "/")`),void _n.warn(e.join(" "))}ti(new $t(`${o}-version`,(()=>({library:o,version:t})),"VERSION"))}
|
|
378
378
|
/**
|
|
379
379
|
* @license
|
|
380
380
|
* Copyright 2021 Google LLC
|
|
@@ -455,7 +455,7 @@ ci("firebase","11.0.2","app");const xi="@firebase/installations",yi="0.6.11",_i=
|
|
|
455
455
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
456
456
|
* See the License for the specific language governing permissions and
|
|
457
457
|
* limitations under the License.
|
|
458
|
-
*/function Ei({projectId:e}){return`https://firebaseinstallations.googleapis.com/v1/projects/${e}/installations`}function
|
|
458
|
+
*/function Ei({projectId:e}){return`https://firebaseinstallations.googleapis.com/v1/projects/${e}/installations`}function Li(e){return{token:e.token,requestStatus:2,expiresIn:(t=e.expiresIn,Number(t.replace("s","000"))),creationTime:Date.now()};var t}async function Pi(e,t){const n=(await t.json()).error;return Si.create("request-failed",{requestName:e,serverCode:n.code,serverMessage:n.message,serverStatus:n.status})}function Ri({apiKey:e}){return new Headers({"Content-Type":"application/json",Accept:"application/json","x-goog-api-key":e})}function Ni(e,{refreshToken:t}){const n=Ri(e);return n.append("Authorization",function(e){return`${Ci} ${e}`}
|
|
459
459
|
/**
|
|
460
460
|
* @license
|
|
461
461
|
* Copyright 2019 Google LLC
|
|
@@ -471,7 +471,7 @@ ci("firebase","11.0.2","app");const xi="@firebase/installations",yi="0.6.11",_i=
|
|
|
471
471
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
472
472
|
* See the License for the specific language governing permissions and
|
|
473
473
|
* limitations under the License.
|
|
474
|
-
*/(t)),n}async function
|
|
474
|
+
*/(t)),n}async function Ai(e){const t=await e();return t.status>=500&&t.status<600?e():t}
|
|
475
475
|
/**
|
|
476
476
|
* @license
|
|
477
477
|
* Copyright 2019 Google LLC
|
|
@@ -488,7 +488,7 @@ ci("firebase","11.0.2","app");const xi="@firebase/installations",yi="0.6.11",_i=
|
|
|
488
488
|
* See the License for the specific language governing permissions and
|
|
489
489
|
* limitations under the License.
|
|
490
490
|
*/
|
|
491
|
-
function
|
|
491
|
+
function Di(e){return new Promise((t=>{setTimeout(t,e)}))}
|
|
492
492
|
/**
|
|
493
493
|
* @license
|
|
494
494
|
* Copyright 2019 Google LLC
|
|
@@ -553,7 +553,7 @@ const Oi=/^[cdef][\w-]{21}$/;function Mi(){try{const e=new Uint8Array(17);(self.
|
|
|
553
553
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
554
554
|
* See the License for the specific language governing permissions and
|
|
555
555
|
* limitations under the License.
|
|
556
|
-
*/const zi=new Map;function Ui(e,t){const n=Fi(e);ji(n,t),function(e,t){const n=function(){!
|
|
556
|
+
*/const zi=new Map;function Ui(e,t){const n=Fi(e);ji(n,t),function(e,t){const n=function(){!Vi&&"BroadcastChannel"in self&&(Vi=new BroadcastChannel("[Firebase] FID Change"),Vi.onmessage=e=>{ji(e.data.key,e.data.fid)});return Vi}();n&&n.postMessage({key:e,fid:t});0===zi.size&&Vi&&(Vi.close(),Vi=null)}(n,t)}function ji(e,t){const n=zi.get(e);if(n)for(const e of n)e(t)}let Vi=null;
|
|
557
557
|
/**
|
|
558
558
|
* @license
|
|
559
559
|
* Copyright 2019 Google LLC
|
|
@@ -570,7 +570,7 @@ const Oi=/^[cdef][\w-]{21}$/;function Mi(){try{const e=new Uint8Array(17);(self.
|
|
|
570
570
|
* See the License for the specific language governing permissions and
|
|
571
571
|
* limitations under the License.
|
|
572
572
|
*/
|
|
573
|
-
const
|
|
573
|
+
const qi="firebase-installations-store";let Bi=null;function Hi(){return Bi||(Bi=gn("firebase-installations-database",1,{upgrade:(e,t)=>{if(0===t)e.createObjectStore(qi)}})),Bi}async function $i(e,t){const n=Fi(e),i=(await Hi()).transaction(qi,"readwrite"),o=i.objectStore(qi),r=await o.get(n);return await o.put(t,n),await i.done,r&&r.fid===t.fid||Ui(e,t.fid),t}async function Wi(e){const t=Fi(e),n=(await Hi()).transaction(qi,"readwrite");await n.objectStore(qi).delete(t),await n.done}async function Gi(e,t){const n=Fi(e),i=(await Hi()).transaction(qi,"readwrite"),o=i.objectStore(qi),r=await o.get(n),s=t(r);return void 0===s?await o.delete(n):await o.put(s,n),await i.done,!s||r&&r.fid===s.fid||Ui(e,s.fid),s}
|
|
574
574
|
/**
|
|
575
575
|
* @license
|
|
576
576
|
* Copyright 2019 Google LLC
|
|
@@ -586,7 +586,7 @@ const Bi="firebase-installations-store";let Vi=null;function Hi(){return Vi||(Vi
|
|
|
586
586
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
587
587
|
* See the License for the specific language governing permissions and
|
|
588
588
|
* limitations under the License.
|
|
589
|
-
*/async function Ki(e){let t;const n=await Gi(e.appConfig,(n=>{const i=function(e){const t=e||{fid:Mi(),registrationStatus:0};return
|
|
589
|
+
*/async function Ki(e){let t;const n=await Gi(e.appConfig,(n=>{const i=function(e){const t=e||{fid:Mi(),registrationStatus:0};return Zi(t)}(n),o=function(e,t){if(0===t.registrationStatus){if(!navigator.onLine){return{installationEntry:t,registrationPromise:Promise.reject(Si.create("app-offline"))}}const n={fid:t.fid,registrationStatus:1,registrationTime:Date.now()},i=async function(e,t){try{const n=await async function({appConfig:e,heartbeatServiceProvider:t},{fid:n}){const i=Ei(e),o=Ri(e),r=t.getImmediate({optional:!0});if(r){const e=await r.getHeartbeatsHeader();e&&o.append("x-firebase-client",e)}const s={fid:n,authVersion:Ci,appId:e.appId,sdkVersion:ki},a={method:"POST",headers:o,body:JSON.stringify(s)},l=await Ai((()=>fetch(i,a)));if(l.ok){const e=await l.json();return{fid:e.fid||n,registrationStatus:2,refreshToken:e.refreshToken,authToken:Li(e.authToken)}}throw await Pi("Create Installation",l)}(e,t);return $i(e.appConfig,n)}catch(n){throw Ti(n)&&409===n.customData.serverCode?await Wi(e.appConfig):await $i(e.appConfig,{fid:t.fid,registrationStatus:0}),n}}(e,n);return{installationEntry:n,registrationPromise:i}}return 1===t.registrationStatus?{installationEntry:t,registrationPromise:Yi(e)}:{installationEntry:t}}(e,i);return t=o.registrationPromise,o.installationEntry}));return""===n.fid?{installationEntry:await t}:{installationEntry:n,registrationPromise:t}}async function Yi(e){let t=await Ji(e.appConfig);for(;1===t.registrationStatus;)await Di(100),t=await Ji(e.appConfig);if(0===t.registrationStatus){const{installationEntry:t,registrationPromise:n}=await Ki(e);return n||t}return t}function Ji(e){return Gi(e,(e=>{if(!e)throw Si.create("installation-not-found");return Zi(e)}))}function Zi(e){return 1===(t=e).registrationStatus&&t.registrationTime+_i<Date.now()?{fid:e.fid,registrationStatus:0}:e;var t;
|
|
590
590
|
/**
|
|
591
591
|
* @license
|
|
592
592
|
* Copyright 2019 Google LLC
|
|
@@ -602,7 +602,7 @@ const Bi="firebase-installations-store";let Vi=null;function Hi(){return Vi||(Vi
|
|
|
602
602
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
603
603
|
* See the License for the specific language governing permissions and
|
|
604
604
|
* limitations under the License.
|
|
605
|
-
*/}async function
|
|
605
|
+
*/}async function Qi({appConfig:e,heartbeatServiceProvider:t},n){const i=function(e,{fid:t}){return`${Ei(e)}/${t}/authTokens:generate`}
|
|
606
606
|
/**
|
|
607
607
|
* @license
|
|
608
608
|
* Copyright 2019 Google LLC
|
|
@@ -618,7 +618,7 @@ const Bi="firebase-installations-store";let Vi=null;function Hi(){return Vi||(Vi
|
|
|
618
618
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
619
619
|
* See the License for the specific language governing permissions and
|
|
620
620
|
* limitations under the License.
|
|
621
|
-
*/(e,n),o=Ni(e,n),r=t.getImmediate({optional:!0});if(r){const e=await r.getHeartbeatsHeader();e&&o.append("x-firebase-client",e)}const s={installation:{sdkVersion:ki,appId:e.appId}},a={method:"POST",headers:o,body:JSON.stringify(s)},l=await
|
|
621
|
+
*/(e,n),o=Ni(e,n),r=t.getImmediate({optional:!0});if(r){const e=await r.getHeartbeatsHeader();e&&o.append("x-firebase-client",e)}const s={installation:{sdkVersion:ki,appId:e.appId}},a={method:"POST",headers:o,body:JSON.stringify(s)},l=await Ai((()=>fetch(i,a)));if(l.ok){return Li(await l.json())}throw await Pi("Generate Auth Token",l)}async function Xi(e,t=!1){let n;const i=await Gi(e.appConfig,(i=>{if(!to(i))throw Si.create("not-registered");const o=i.authToken;if(!t&&function(e){return 2===e.requestStatus&&!function(e){const t=Date.now();return t<e.creationTime||e.creationTime+e.expiresIn<t+Ii}(e)}(o))return i;if(1===o.requestStatus)return n=async function(e,t){let n=await eo(e.appConfig);for(;1===n.authToken.requestStatus;)await Di(100),n=await eo(e.appConfig);const i=n.authToken;return 0===i.requestStatus?Xi(e,t):i}(e,t),i;{if(!navigator.onLine)throw Si.create("app-offline");const t=function(e){const t={requestStatus:1,requestTime:Date.now()};return Object.assign(Object.assign({},e),{authToken:t})}(i);return n=async function(e,t){try{const n=await Qi(e,t),i=Object.assign(Object.assign({},t),{authToken:n});return await $i(e.appConfig,i),n}catch(n){if(!Ti(n)||401!==n.customData.serverCode&&404!==n.customData.serverCode){const n=Object.assign(Object.assign({},t),{authToken:{requestStatus:0}});await $i(e.appConfig,n)}else await Wi(e.appConfig);throw n}}(e,t),t}}));return n?await n:i.authToken}function eo(e){return Gi(e,(e=>{if(!to(e))throw Si.create("not-registered");const t=e.authToken;return 1===(n=t).requestStatus&&n.requestTime+_i<Date.now()?Object.assign(Object.assign({},e),{authToken:{requestStatus:0}}):e;var n;
|
|
622
622
|
/**
|
|
623
623
|
* @license
|
|
624
624
|
* Copyright 2019 Google LLC
|
|
@@ -667,7 +667,7 @@ async function no(e,t=!1){const n=e;await async function(e){const{registrationPr
|
|
|
667
667
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
668
668
|
* See the License for the specific language governing permissions and
|
|
669
669
|
* limitations under the License.
|
|
670
|
-
*/(n);return(await
|
|
670
|
+
*/(n);return(await Xi(n,t)).token}function io(e){return Si.create("missing-app-config-values",{valueName:e})}
|
|
671
671
|
/**
|
|
672
672
|
* @license
|
|
673
673
|
* Copyright 2020 Google LLC
|
|
@@ -683,7 +683,7 @@ async function no(e,t=!1){const n=e;await async function(e){const{registrationPr
|
|
|
683
683
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
684
684
|
* See the License for the specific language governing permissions and
|
|
685
685
|
* limitations under the License.
|
|
686
|
-
*/const oo="installations",ro=e=>{const t=e.getProvider("app").getImmediate(),n=function(e){if(!e||!e.options)throw io("App Configuration");if(!e.name)throw io("App Name");const t=["projectId","apiKey","appId"];for(const n of t)if(!e.options[n])throw io(n);return{appName:e.name,projectId:e.options.projectId,apiKey:e.options.apiKey,appId:e.options.appId}}(t);return{app:t,appConfig:n,heartbeatServiceProvider:ni(t,"heartbeat"),_delete:()=>Promise.resolve()}},so=e=>{const t=ni(e.getProvider("app").getImmediate(),oo).getImmediate();return{getId:()=>async function(e){const t=e,{installationEntry:n,registrationPromise:i}=await Ki(t);return i?i.catch(console.error):
|
|
686
|
+
*/const oo="installations",ro=e=>{const t=e.getProvider("app").getImmediate(),n=function(e){if(!e||!e.options)throw io("App Configuration");if(!e.name)throw io("App Name");const t=["projectId","apiKey","appId"];for(const n of t)if(!e.options[n])throw io(n);return{appName:e.name,projectId:e.options.projectId,apiKey:e.options.apiKey,appId:e.options.appId}}(t);return{app:t,appConfig:n,heartbeatServiceProvider:ni(t,"heartbeat"),_delete:()=>Promise.resolve()}},so=e=>{const t=ni(e.getProvider("app").getImmediate(),oo).getImmediate();return{getId:()=>async function(e){const t=e,{installationEntry:n,registrationPromise:i}=await Ki(t);return i?i.catch(console.error):Xi(t).catch(console.error),n.fid}(t),getToken:e=>no(t,e)}};ti(new $t(oo,ro,"PUBLIC")),ti(new $t("installations-internal",so,"PRIVATE")),ci(xi,yi),ci(xi,yi,"esm2017");
|
|
687
687
|
/**
|
|
688
688
|
* @license
|
|
689
689
|
* Copyright 2019 Google LLC
|
|
@@ -717,7 +717,7 @@ const ao="analytics",lo="https://www.googletagmanager.com/gtag/js",co=new en("@f
|
|
|
717
717
|
* See the License for the specific language governing permissions and
|
|
718
718
|
* limitations under the License.
|
|
719
719
|
*/
|
|
720
|
-
function uo(e){if(!e.startsWith(lo)){const t=ho.create("invalid-gtag-resource",{gtagURL:e});return co.warn(t.message),""}return e}function po(e){return Promise.all(e.map((e=>e.catch((e=>e)))))}function go(e,t){const n=function(e,t){let n;return window.trustedTypes&&(n=window.trustedTypes.createPolicy(e,t)),n}("firebase-js-sdk-policy",{createScriptURL:uo}),i=document.createElement("script"),o=`${lo}?l=${e}&id=${t}`;i.src=n?null==n?void 0:n.createScriptURL(o):o,i.async=!0,document.head.appendChild(i)}function fo(e,t,n,i){return async function(o,...r){try{if("event"===o){const[i,o]=r;await async function(e,t,n,i,o){try{let r=[];if(o&&o.send_to){let e=o.send_to;Array.isArray(e)||(e=[e]);const i=await po(n);for(const n of e){const e=i.find((e=>e.measurementId===n)),o=e&&t[e.appId];if(!o){r=[];break}r.push(o)}}0===r.length&&(r=Object.values(t)),await Promise.all(r),e("event",i,o||{})}catch(e){co.error(e)}}(e,t,n,i,o)}else if("config"===o){const[o,s]=r;await async function(e,t,n,i,o,r){const s=i[o];try{if(s)await t[s];else{const e=(await po(n)).find((e=>e.measurementId===o));e&&await t[e.appId]}}catch(e){co.error(e)}e("config",o,r)}(e,t,n,i,o,s)}else if("consent"===o){const[t,n]=r;e("consent",t,n)}else if("get"===o){const[t,n,i]=r;e("get",t,n,i)}else if("set"===o){const[t]=r;e("set",t)}else e(o,...r)}catch(e){co.error(e)}}}const mo=new class{constructor(e={},t=1e3){this.throttleMetadata=e,this.intervalMillis=t}getThrottleMetadata(e){return this.throttleMetadata[e]}setThrottleMetadata(e,t){this.throttleMetadata[e]=t}deleteThrottleMetadata(e){delete this.throttleMetadata[e]}};function vo(e){return new Headers({Accept:"application/json","x-goog-api-key":e})}async function bo(e,t=mo,n){const{appId:i,apiKey:o,measurementId:r}=e.options;if(!i)throw ho.create("no-app-id");if(!o){if(r)return{measurementId:r,appId:i};throw ho.create("no-api-key")}const s=t.getThrottleMetadata(i)||{backoffCount:0,throttleEndTimeMillis:Date.now()},a=new xo;return setTimeout((async()=>{a.abort()}),6e4),wo({appId:i,apiKey:o,measurementId:r},s,a,t)}async function wo(e,{throttleEndTimeMillis:t,backoffCount:n},i,o=mo){var r;const{appId:s,measurementId:a}=e;try{await function(e,t){return new Promise(((n,i)=>{const o=Math.max(t-Date.now(),0),r=setTimeout(n,o);e.addEventListener((()=>{clearTimeout(r),i(ho.create("fetch-throttle",{throttleEndTimeMillis:t}))}))}))}(i,t)}catch(e){if(a)return co.warn(`Timed out fetching this Firebase app's measurement ID from the server. Falling back to the measurement ID ${a} provided in the "measurementId" field in the local Firebase config. [${null==e?void 0:e.message}]`),{appId:s,measurementId:a};throw e}try{const t=await async function(e){var t;const{appId:n,apiKey:i}=e,o={method:"GET",headers:vo(i)},r="https://firebase.googleapis.com/v1alpha/projects/-/apps/{app-id}/webConfig".replace("{app-id}",n),s=await fetch(r,o);if(200!==s.status&&304!==s.status){let e="";try{const n=await s.json();(null===(t=n.error)||void 0===t?void 0:t.message)&&(e=n.error.message)}catch(e){}throw ho.create("config-fetch-failed",{httpStatus:s.status,responseMessage:e})}return s.json()}(e);return o.deleteThrottleMetadata(s),t}catch(t){const l=t;if(!function(e){if(!(e instanceof It&&e.customData))return!1;const t=Number(e.customData.httpStatus);return 429===t||500===t||503===t||504===t}(l)){if(o.deleteThrottleMetadata(s),a)return co.warn(`Failed to fetch this Firebase app's measurement ID from the server. Falling back to the measurement ID ${a} provided in the "measurementId" field in the local Firebase config. [${null==l?void 0:l.message}]`),{appId:s,measurementId:a};throw t}const c=503===Number(null===(r=null==l?void 0:l.customData)||void 0===r?void 0:r.httpStatus)?
|
|
720
|
+
function uo(e){if(!e.startsWith(lo)){const t=ho.create("invalid-gtag-resource",{gtagURL:e});return co.warn(t.message),""}return e}function po(e){return Promise.all(e.map((e=>e.catch((e=>e)))))}function go(e,t){const n=function(e,t){let n;return window.trustedTypes&&(n=window.trustedTypes.createPolicy(e,t)),n}("firebase-js-sdk-policy",{createScriptURL:uo}),i=document.createElement("script"),o=`${lo}?l=${e}&id=${t}`;i.src=n?null==n?void 0:n.createScriptURL(o):o,i.async=!0,document.head.appendChild(i)}function fo(e,t,n,i){return async function(o,...r){try{if("event"===o){const[i,o]=r;await async function(e,t,n,i,o){try{let r=[];if(o&&o.send_to){let e=o.send_to;Array.isArray(e)||(e=[e]);const i=await po(n);for(const n of e){const e=i.find((e=>e.measurementId===n)),o=e&&t[e.appId];if(!o){r=[];break}r.push(o)}}0===r.length&&(r=Object.values(t)),await Promise.all(r),e("event",i,o||{})}catch(e){co.error(e)}}(e,t,n,i,o)}else if("config"===o){const[o,s]=r;await async function(e,t,n,i,o,r){const s=i[o];try{if(s)await t[s];else{const e=(await po(n)).find((e=>e.measurementId===o));e&&await t[e.appId]}}catch(e){co.error(e)}e("config",o,r)}(e,t,n,i,o,s)}else if("consent"===o){const[t,n]=r;e("consent",t,n)}else if("get"===o){const[t,n,i]=r;e("get",t,n,i)}else if("set"===o){const[t]=r;e("set",t)}else e(o,...r)}catch(e){co.error(e)}}}const mo=new class{constructor(e={},t=1e3){this.throttleMetadata=e,this.intervalMillis=t}getThrottleMetadata(e){return this.throttleMetadata[e]}setThrottleMetadata(e,t){this.throttleMetadata[e]=t}deleteThrottleMetadata(e){delete this.throttleMetadata[e]}};function vo(e){return new Headers({Accept:"application/json","x-goog-api-key":e})}async function bo(e,t=mo,n){const{appId:i,apiKey:o,measurementId:r}=e.options;if(!i)throw ho.create("no-app-id");if(!o){if(r)return{measurementId:r,appId:i};throw ho.create("no-api-key")}const s=t.getThrottleMetadata(i)||{backoffCount:0,throttleEndTimeMillis:Date.now()},a=new xo;return setTimeout((async()=>{a.abort()}),6e4),wo({appId:i,apiKey:o,measurementId:r},s,a,t)}async function wo(e,{throttleEndTimeMillis:t,backoffCount:n},i,o=mo){var r;const{appId:s,measurementId:a}=e;try{await function(e,t){return new Promise(((n,i)=>{const o=Math.max(t-Date.now(),0),r=setTimeout(n,o);e.addEventListener((()=>{clearTimeout(r),i(ho.create("fetch-throttle",{throttleEndTimeMillis:t}))}))}))}(i,t)}catch(e){if(a)return co.warn(`Timed out fetching this Firebase app's measurement ID from the server. Falling back to the measurement ID ${a} provided in the "measurementId" field in the local Firebase config. [${null==e?void 0:e.message}]`),{appId:s,measurementId:a};throw e}try{const t=await async function(e){var t;const{appId:n,apiKey:i}=e,o={method:"GET",headers:vo(i)},r="https://firebase.googleapis.com/v1alpha/projects/-/apps/{app-id}/webConfig".replace("{app-id}",n),s=await fetch(r,o);if(200!==s.status&&304!==s.status){let e="";try{const n=await s.json();(null===(t=n.error)||void 0===t?void 0:t.message)&&(e=n.error.message)}catch(e){}throw ho.create("config-fetch-failed",{httpStatus:s.status,responseMessage:e})}return s.json()}(e);return o.deleteThrottleMetadata(s),t}catch(t){const l=t;if(!function(e){if(!(e instanceof It&&e.customData))return!1;const t=Number(e.customData.httpStatus);return 429===t||500===t||503===t||504===t}(l)){if(o.deleteThrottleMetadata(s),a)return co.warn(`Failed to fetch this Firebase app's measurement ID from the server. Falling back to the measurement ID ${a} provided in the "measurementId" field in the local Firebase config. [${null==l?void 0:l.message}]`),{appId:s,measurementId:a};throw t}const c=503===Number(null===(r=null==l?void 0:l.customData)||void 0===r?void 0:r.httpStatus)?Bt(n,o.intervalMillis,30):Bt(n,o.intervalMillis),d={throttleEndTimeMillis:Date.now()+c,backoffCount:n+1};return o.setThrottleMetadata(s,d),co.debug(`Calling attemptFetch again in ${c} millis`),wo(e,d,i,o)}}class xo{constructor(){this.listeners=[]}addEventListener(e){this.listeners.push(e)}abort(){this.listeners.forEach((e=>e()))}}async function yo(e,t,n,i,o,r,s){var a;const l=bo(e);l.then((t=>{n[t.measurementId]=t.appId,e.options.measurementId&&t.measurementId!==e.options.measurementId&&co.warn(`The measurement ID in the local Firebase config (${e.options.measurementId}) does not match the measurement ID fetched from the server (${t.measurementId}). To ensure analytics events are always sent to the correct Analytics property, update the measurement ID field in the local config or remove it from the local config.`)})).catch((e=>co.error(e))),t.push(l);const c=
|
|
721
721
|
/**
|
|
722
722
|
* @license
|
|
723
723
|
* Copyright 2020 Google LLC
|
|
@@ -766,7 +766,7 @@ async function(){if(!kt())return co.warn(ho.create("indexeddb-unavailable",{erro
|
|
|
766
766
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
767
767
|
* See the License for the specific language governing permissions and
|
|
768
768
|
* limitations under the License.
|
|
769
|
-
*/class _o{constructor(e){this.app=e}_delete(){return delete ko[this.app.options.appId],Promise.resolve()}}let ko={},Co=[];const Io={};let So,To,Eo="dataLayer",
|
|
769
|
+
*/class _o{constructor(e){this.app=e}_delete(){return delete ko[this.app.options.appId],Promise.resolve()}}let ko={},Co=[];const Io={};let So,To,Eo="dataLayer",Lo=!1;function Po(){const e=[];if(xt()&&e.push("This is a browser extension environment."),"undefined"!=typeof navigator&&navigator.cookieEnabled||e.push("Cookies are not available."),e.length>0){const t=e.map(((e,t)=>`(${t+1}) ${e}`)).join(" "),n=ho.create("invalid-analytics-context",{errorInfo:t});co.warn(n.message)}}function Ro(e,t,n){Po();const i=e.options.appId;if(!i)throw ho.create("no-app-id");if(!e.options.apiKey){if(!e.options.measurementId)throw ho.create("no-api-key");co.warn(`The "apiKey" field is empty in the local Firebase config. This is needed to fetch the latest measurement ID for this Firebase app. Falling back to the measurement ID ${e.options.measurementId} provided in the "measurementId" field in the local Firebase config.`)}if(null!=ko[i])throw ho.create("already-exists",{id:i});if(!Lo){!function(e){let t=[];Array.isArray(window[e])?t=window[e]:window[e]=t}(Eo);const{wrappedGtag:e,gtagCore:t}=function(e,t,n,i,o){let r=function(...e){window[i].push(arguments)};return window[o]&&"function"==typeof window[o]&&(r=window[o]),window[o]=fo(r,e,t,n),{gtagCore:r,wrappedGtag:window[o]}}(ko,Co,Io,Eo,"gtag");To=e,So=t,Lo=!0}ko[i]=yo(e,Co,Io,t,So,Eo,n);return new _o(e)}function No(e=li()){const t=ni(e=Ht(e),ao);return t.isInitialized()?t.getImmediate():function(e,t={}){const n=ni(e,ao);if(n.isInitialized()){const e=n.getImmediate();if(Ot(t,n.getOptions()))return e;throw ho.create("already-initialized")}const i=n.initialize({options:t});return i}(e)}function Ao(e,t,n,i){e=Ht(e),async function(e,t,n,i,o){if(o&&o.global)e("event",n,i);else{const o=await t;e("event",n,Object.assign(Object.assign({},i),{send_to:o}))}}(To,ko[e.app.options.appId],t,n,i).catch((e=>co.error(e)))}const Do="@firebase/analytics",Oo="0.10.10";function Mo(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(n[i[o]]=e[i[o]])}return n}function Fo(){return{"dependent-sdk-initialized-before-auth":"Another Firebase SDK was initialized and is trying to use Auth before Auth is initialized. Please be sure to call `initializeAuth` or `getAuth` before starting any other Firebase SDK."}}ti(new $t(ao,((e,{options:t})=>Ro(e.getProvider("app").getImmediate(),e.getProvider("installations-internal").getImmediate(),t)),"PUBLIC")),ti(new $t("analytics-internal",(function(e){try{const t=e.getProvider(ao).getImmediate();return{logEvent:(e,n,i)=>Ao(t,e,n,i)}}catch(e){throw ho.create("interop-component-reg-failed",{reason:e})}}),"PRIVATE")),ci(Do,Oo),ci(Do,Oo,"esm2017"),"function"==typeof SuppressedError&&SuppressedError;const zo=Fo,Uo=new St("auth","Firebase",{"dependent-sdk-initialized-before-auth":"Another Firebase SDK was initialized and is trying to use Auth before Auth is initialized. Please be sure to call `initializeAuth` or `getAuth` before starting any other Firebase SDK."}),jo=new en("@firebase/auth");function Vo(e,...t){jo.logLevel<=Yt.ERROR&&jo.error(`Auth (${si}): ${e}`,...t)}
|
|
770
770
|
/**
|
|
771
771
|
* @license
|
|
772
772
|
* Copyright 2020 Google LLC
|
|
@@ -782,7 +782,7 @@ async function(){if(!kt())return co.warn(ho.create("indexeddb-unavailable",{erro
|
|
|
782
782
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
783
783
|
* See the License for the specific language governing permissions and
|
|
784
784
|
* limitations under the License.
|
|
785
|
-
*/function
|
|
785
|
+
*/function qo(e,...t){throw Wo(e,...t)}function Bo(e,...t){return Wo(e,...t)}function Ho(e,t,n){const i=Object.assign(Object.assign({},zo()),{[t]:n});return new St("auth","Firebase",i).create(t,{appName:e.name})}function $o(e){return Ho(e,"operation-not-supported-in-this-environment","Operations that alter the current user are not supported in conjunction with FirebaseServerApp")}function Wo(e,...t){if("string"!=typeof e){const n=t[0],i=[...t.slice(1)];return i[0]&&(i[0].appName=e.name),e._errorFactory.create(n,...i)}return Uo.create(e,...t)}function Go(e,t,...n){if(!e)throw Wo(t,...n)}function Ko(e){const t="INTERNAL ASSERTION FAILED: "+e;throw Vo(t),new Error(t)}function Yo(e,t){e||Ko(t)}
|
|
786
786
|
/**
|
|
787
787
|
* @license
|
|
788
788
|
* Copyright 2020 Google LLC
|
|
@@ -798,7 +798,7 @@ async function(){if(!kt())return co.warn(ho.create("indexeddb-unavailable",{erro
|
|
|
798
798
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
799
799
|
* See the License for the specific language governing permissions and
|
|
800
800
|
* limitations under the License.
|
|
801
|
-
*/function Jo(){var e;return"undefined"!=typeof self&&(null===(e=self.location)||void 0===e?void 0:e.href)||""}function
|
|
801
|
+
*/function Jo(){var e;return"undefined"!=typeof self&&(null===(e=self.location)||void 0===e?void 0:e.href)||""}function Zo(){var e;return"undefined"!=typeof self&&(null===(e=self.location)||void 0===e?void 0:e.protocol)||null}
|
|
802
802
|
/**
|
|
803
803
|
* @license
|
|
804
804
|
* Copyright 2020 Google LLC
|
|
@@ -814,7 +814,7 @@ async function(){if(!kt())return co.warn(ho.create("indexeddb-unavailable",{erro
|
|
|
814
814
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
815
815
|
* See the License for the specific language governing permissions and
|
|
816
816
|
* limitations under the License.
|
|
817
|
-
*/function
|
|
817
|
+
*/function Qo(){return"undefined"==typeof navigator||!navigator||!("onLine"in navigator)||"boolean"!=typeof navigator.onLine||"http:"!==Zo()&&"https:"!==Zo()&&!xt()&&!("connection"in navigator)||navigator.onLine}
|
|
818
818
|
/**
|
|
819
819
|
* @license
|
|
820
820
|
* Copyright 2020 Google LLC
|
|
@@ -831,7 +831,7 @@ async function(){if(!kt())return co.warn(ho.create("indexeddb-unavailable",{erro
|
|
|
831
831
|
* See the License for the specific language governing permissions and
|
|
832
832
|
* limitations under the License.
|
|
833
833
|
*/
|
|
834
|
-
class
|
|
834
|
+
class Xo{constructor(e,t){this.shortDelay=e,this.longDelay=t,Yo(t>e,"Short delay should be less than long delay!"),this.isMobile=wt()||yt()}get(){return Qo()?this.isMobile?this.longDelay:this.shortDelay:Math.min(5e3,this.shortDelay)}}
|
|
835
835
|
/**
|
|
836
836
|
* @license
|
|
837
837
|
* Copyright 2020 Google LLC
|
|
@@ -879,7 +879,7 @@ class Zo{constructor(e,t){this.shortDelay=e,this.longDelay=t,Yo(t>e,"Short delay
|
|
|
879
879
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
880
880
|
* See the License for the specific language governing permissions and
|
|
881
881
|
* limitations under the License.
|
|
882
|
-
*/const nr={CREDENTIAL_MISMATCH:"custom-token-mismatch",MISSING_CUSTOM_TOKEN:"internal-error",INVALID_IDENTIFIER:"invalid-email",MISSING_CONTINUE_URI:"internal-error",INVALID_PASSWORD:"wrong-password",MISSING_PASSWORD:"missing-password",INVALID_LOGIN_CREDENTIALS:"invalid-credential",EMAIL_EXISTS:"email-already-in-use",PASSWORD_LOGIN_DISABLED:"operation-not-allowed",INVALID_IDP_RESPONSE:"invalid-credential",INVALID_PENDING_TOKEN:"invalid-credential",FEDERATED_USER_ID_ALREADY_LINKED:"credential-already-in-use",MISSING_REQ_TYPE:"internal-error",EMAIL_NOT_FOUND:"user-not-found",RESET_PASSWORD_EXCEED_LIMIT:"too-many-requests",EXPIRED_OOB_CODE:"expired-action-code",INVALID_OOB_CODE:"invalid-action-code",MISSING_OOB_CODE:"internal-error",CREDENTIAL_TOO_OLD_LOGIN_AGAIN:"requires-recent-login",INVALID_ID_TOKEN:"invalid-user-token",TOKEN_EXPIRED:"user-token-expired",USER_NOT_FOUND:"user-token-expired",TOO_MANY_ATTEMPTS_TRY_LATER:"too-many-requests",PASSWORD_DOES_NOT_MEET_REQUIREMENTS:"password-does-not-meet-requirements",INVALID_CODE:"invalid-verification-code",INVALID_SESSION_INFO:"invalid-verification-id",INVALID_TEMPORARY_PROOF:"invalid-credential",MISSING_SESSION_INFO:"missing-verification-id",SESSION_EXPIRED:"code-expired",MISSING_ANDROID_PACKAGE_NAME:"missing-android-pkg-name",UNAUTHORIZED_DOMAIN:"unauthorized-continue-uri",INVALID_OAUTH_CLIENT_ID:"invalid-oauth-client-id",ADMIN_ONLY_OPERATION:"admin-restricted-operation",INVALID_MFA_PENDING_CREDENTIAL:"invalid-multi-factor-session",MFA_ENROLLMENT_NOT_FOUND:"multi-factor-info-not-found",MISSING_MFA_ENROLLMENT_ID:"missing-multi-factor-info",MISSING_MFA_PENDING_CREDENTIAL:"missing-multi-factor-session",SECOND_FACTOR_EXISTS:"second-factor-already-in-use",SECOND_FACTOR_LIMIT_EXCEEDED:"maximum-second-factor-count-exceeded",BLOCKING_FUNCTION_ERROR_RESPONSE:"internal-error",RECAPTCHA_NOT_ENABLED:"recaptcha-not-enabled",MISSING_RECAPTCHA_TOKEN:"missing-recaptcha-token",INVALID_RECAPTCHA_TOKEN:"invalid-recaptcha-token",INVALID_RECAPTCHA_ACTION:"invalid-recaptcha-action",MISSING_CLIENT_TYPE:"missing-client-type",MISSING_RECAPTCHA_VERSION:"missing-recaptcha-version",INVALID_RECAPTCHA_VERSION:"invalid-recaptcha-version",INVALID_REQ_TYPE:"invalid-req-type"},ir=new
|
|
882
|
+
*/const nr={CREDENTIAL_MISMATCH:"custom-token-mismatch",MISSING_CUSTOM_TOKEN:"internal-error",INVALID_IDENTIFIER:"invalid-email",MISSING_CONTINUE_URI:"internal-error",INVALID_PASSWORD:"wrong-password",MISSING_PASSWORD:"missing-password",INVALID_LOGIN_CREDENTIALS:"invalid-credential",EMAIL_EXISTS:"email-already-in-use",PASSWORD_LOGIN_DISABLED:"operation-not-allowed",INVALID_IDP_RESPONSE:"invalid-credential",INVALID_PENDING_TOKEN:"invalid-credential",FEDERATED_USER_ID_ALREADY_LINKED:"credential-already-in-use",MISSING_REQ_TYPE:"internal-error",EMAIL_NOT_FOUND:"user-not-found",RESET_PASSWORD_EXCEED_LIMIT:"too-many-requests",EXPIRED_OOB_CODE:"expired-action-code",INVALID_OOB_CODE:"invalid-action-code",MISSING_OOB_CODE:"internal-error",CREDENTIAL_TOO_OLD_LOGIN_AGAIN:"requires-recent-login",INVALID_ID_TOKEN:"invalid-user-token",TOKEN_EXPIRED:"user-token-expired",USER_NOT_FOUND:"user-token-expired",TOO_MANY_ATTEMPTS_TRY_LATER:"too-many-requests",PASSWORD_DOES_NOT_MEET_REQUIREMENTS:"password-does-not-meet-requirements",INVALID_CODE:"invalid-verification-code",INVALID_SESSION_INFO:"invalid-verification-id",INVALID_TEMPORARY_PROOF:"invalid-credential",MISSING_SESSION_INFO:"missing-verification-id",SESSION_EXPIRED:"code-expired",MISSING_ANDROID_PACKAGE_NAME:"missing-android-pkg-name",UNAUTHORIZED_DOMAIN:"unauthorized-continue-uri",INVALID_OAUTH_CLIENT_ID:"invalid-oauth-client-id",ADMIN_ONLY_OPERATION:"admin-restricted-operation",INVALID_MFA_PENDING_CREDENTIAL:"invalid-multi-factor-session",MFA_ENROLLMENT_NOT_FOUND:"multi-factor-info-not-found",MISSING_MFA_ENROLLMENT_ID:"missing-multi-factor-info",MISSING_MFA_PENDING_CREDENTIAL:"missing-multi-factor-session",SECOND_FACTOR_EXISTS:"second-factor-already-in-use",SECOND_FACTOR_LIMIT_EXCEEDED:"maximum-second-factor-count-exceeded",BLOCKING_FUNCTION_ERROR_RESPONSE:"internal-error",RECAPTCHA_NOT_ENABLED:"recaptcha-not-enabled",MISSING_RECAPTCHA_TOKEN:"missing-recaptcha-token",INVALID_RECAPTCHA_TOKEN:"invalid-recaptcha-token",INVALID_RECAPTCHA_ACTION:"invalid-recaptcha-action",MISSING_CLIENT_TYPE:"missing-client-type",MISSING_RECAPTCHA_VERSION:"missing-recaptcha-version",INVALID_RECAPTCHA_VERSION:"invalid-recaptcha-version",INVALID_REQ_TYPE:"invalid-req-type"},ir=new Xo(3e4,6e4);
|
|
883
883
|
/**
|
|
884
884
|
* @license
|
|
885
885
|
* Copyright 2020 Google LLC
|
|
@@ -895,7 +895,7 @@ class Zo{constructor(e,t){this.shortDelay=e,this.longDelay=t,Yo(t>e,"Short delay
|
|
|
895
895
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
896
896
|
* See the License for the specific language governing permissions and
|
|
897
897
|
* limitations under the License.
|
|
898
|
-
*/function or(e,t){return e.tenantId&&!t.tenantId?Object.assign(Object.assign({},t),{tenantId:e.tenantId}):t}async function rr(e,t,n,i,o={}){return sr(e,o,(async()=>{let o={},r={};i&&("GET"===t?r=i:o={body:JSON.stringify(i)});const s=Ft(Object.assign({key:e.config.apiKey},r)).slice(1),a=await e._getAdditionalHeaders();a["Content-Type"]="application/json",e.languageCode&&(a["X-Firebase-Locale"]=e.languageCode);const l=Object.assign({method:t,headers:a},o);return"undefined"!=typeof navigator&&"Cloudflare-Workers"===navigator.userAgent||(l.referrerPolicy="no-referrer"),tr.fetch()(lr(e,e.config.apiHost,n,s),l)}))}async function sr(e,t,n){e._canInitEmulator=!1;const i=Object.assign(Object.assign({},nr),t);try{const t=new cr(e),o=await Promise.race([n(),t.promise]);t.clearNetworkTimeout();const r=await o.json();if("needConfirmation"in r)throw dr(e,"account-exists-with-different-credential",r);if(o.ok&&!("errorMessage"in r))return r;{const t=o.ok?r.errorMessage:r.error.message,[n,s]=t.split(" : ");if("FEDERATED_USER_ID_ALREADY_LINKED"===n)throw dr(e,"credential-already-in-use",r);if("EMAIL_EXISTS"===n)throw dr(e,"email-already-in-use",r);if("USER_DISABLED"===n)throw dr(e,"user-disabled",r);const a=i[n]||n.toLowerCase().replace(/[_\s]+/g,"-");if(s)throw Ho(e,a,s);
|
|
898
|
+
*/function or(e,t){return e.tenantId&&!t.tenantId?Object.assign(Object.assign({},t),{tenantId:e.tenantId}):t}async function rr(e,t,n,i,o={}){return sr(e,o,(async()=>{let o={},r={};i&&("GET"===t?r=i:o={body:JSON.stringify(i)});const s=Ft(Object.assign({key:e.config.apiKey},r)).slice(1),a=await e._getAdditionalHeaders();a["Content-Type"]="application/json",e.languageCode&&(a["X-Firebase-Locale"]=e.languageCode);const l=Object.assign({method:t,headers:a},o);return"undefined"!=typeof navigator&&"Cloudflare-Workers"===navigator.userAgent||(l.referrerPolicy="no-referrer"),tr.fetch()(lr(e,e.config.apiHost,n,s),l)}))}async function sr(e,t,n){e._canInitEmulator=!1;const i=Object.assign(Object.assign({},nr),t);try{const t=new cr(e),o=await Promise.race([n(),t.promise]);t.clearNetworkTimeout();const r=await o.json();if("needConfirmation"in r)throw dr(e,"account-exists-with-different-credential",r);if(o.ok&&!("errorMessage"in r))return r;{const t=o.ok?r.errorMessage:r.error.message,[n,s]=t.split(" : ");if("FEDERATED_USER_ID_ALREADY_LINKED"===n)throw dr(e,"credential-already-in-use",r);if("EMAIL_EXISTS"===n)throw dr(e,"email-already-in-use",r);if("USER_DISABLED"===n)throw dr(e,"user-disabled",r);const a=i[n]||n.toLowerCase().replace(/[_\s]+/g,"-");if(s)throw Ho(e,a,s);qo(e,a)}}catch(t){if(t instanceof It)throw t;qo(e,"network-request-failed",{message:String(t)})}}async function ar(e,t,n,i,o={}){const r=await rr(e,t,n,i,o);return"mfaPendingCredential"in r&&qo(e,"multi-factor-auth-required",{_serverResponse:r}),r}function lr(e,t,n,i){const o=`${t}${n}?${i}`;return e.config.emulator?er(e.config,o):`${e.config.apiScheme}://${o}`}class cr{clearNetworkTimeout(){clearTimeout(this.timer)}constructor(e){this.auth=e,this.timer=null,this.promise=new Promise(((e,t)=>{this.timer=setTimeout((()=>t(Bo(this.auth,"network-request-failed"))),ir.get())}))}}function dr(e,t,n){const i={appName:e.name};n.email&&(i.email=n.email),n.phoneNumber&&(i.phoneNumber=n.phoneNumber);const o=Bo(e,t,i);return o.customData._tokenResponse=n,o}
|
|
899
899
|
/**
|
|
900
900
|
* @license
|
|
901
901
|
* Copyright 2020 Google LLC
|
|
@@ -927,7 +927,7 @@ class Zo{constructor(e,t){this.shortDelay=e,this.longDelay=t,Yo(t>e,"Short delay
|
|
|
927
927
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
928
928
|
* See the License for the specific language governing permissions and
|
|
929
929
|
* limitations under the License.
|
|
930
|
-
*/function ur(e){if(e)try{const t=new Date(Number(e));if(!isNaN(t.getTime()))return t.toUTCString()}catch(e){}}function pr(e){return 1e3*Number(e)}function gr(e){const[t,n,i]=e.split(".");if(void 0===t||void 0===n||void 0===i)return
|
|
930
|
+
*/function ur(e){if(e)try{const t=new Date(Number(e));if(!isNaN(t.getTime()))return t.toUTCString()}catch(e){}}function pr(e){return 1e3*Number(e)}function gr(e){const[t,n,i]=e.split(".");if(void 0===t||void 0===n||void 0===i)return Vo("JWT malformed, contained fewer than 3 sections"),null;try{const e=ct(n);return e?JSON.parse(e):(Vo("Failed to decode base64 JWT payload"),null)}catch(e){return Vo("Caught error parsing JWT payload as JSON",null==e?void 0:e.toString()),null}}function fr(e){const t=gr(e);return Go(t,"internal-error"),Go(void 0!==t.exp,"internal-error"),Go(void 0!==t.iat,"internal-error"),Number(t.exp)-Number(t.iat)}
|
|
931
931
|
/**
|
|
932
932
|
* @license
|
|
933
933
|
* Copyright 2020 Google LLC
|
|
@@ -1088,7 +1088,7 @@ class yr{constructor(){this.refreshToken=null,this.accessToken=null,this.expirat
|
|
|
1088
1088
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1089
1089
|
* See the License for the specific language governing permissions and
|
|
1090
1090
|
* limitations under the License.
|
|
1091
|
-
*/function Er(e,t,n){return`firebase:${e}:${t}:${n}`}class
|
|
1091
|
+
*/function Er(e,t,n){return`firebase:${e}:${t}:${n}`}class Lr{constructor(e,t,n){this.persistence=e,this.auth=t,this.userKey=n;const{config:i,name:o}=this.auth;this.fullUserKey=Er(this.userKey,i.apiKey,o),this.fullPersistenceKey=Er("persistence",i.apiKey,o),this.boundEventHandler=t._onStorageEvent.bind(t),this.persistence._addListener(this.fullUserKey,this.boundEventHandler)}setCurrentUser(e){return this.persistence._set(this.fullUserKey,e.toJSON())}async getCurrentUser(){const e=await this.persistence._get(this.fullUserKey);return e?kr._fromJSON(this.auth,e):null}removeCurrentUser(){return this.persistence._remove(this.fullUserKey)}savePersistenceForRedirect(){return this.persistence._set(this.fullPersistenceKey,this.persistence.type)}async setPersistence(e){if(this.persistence===e)return;const t=await this.getCurrentUser();return await this.removeCurrentUser(),this.persistence=e,t?this.setCurrentUser(t):void 0}delete(){this.persistence._removeListener(this.fullUserKey,this.boundEventHandler)}static async create(e,t,n="authUser"){if(!t.length)return new Lr(Ir(Tr),e,n);const i=(await Promise.all(t.map((async e=>{if(await e._isAvailable())return e})))).filter((e=>e));let o=i[0]||Ir(Tr);const r=Er(n,e.config.apiKey,e.name);let s=null;for(const n of t)try{const t=await n._get(r);if(t){const i=kr._fromJSON(e,t);n!==o&&(s=i),o=n;break}}catch(e){}const a=i.filter((e=>e._shouldAllowMigration));return o._shouldAllowMigration&&a.length?(o=a[0],s&&await o._set(r,s.toJSON()),await Promise.all(t.map((async e=>{if(e!==o)try{await e._remove(r)}catch(e){}}))),new Lr(o,e,n)):new Lr(o,e,n)}}
|
|
1092
1092
|
/**
|
|
1093
1093
|
* @license
|
|
1094
1094
|
* Copyright 2020 Google LLC
|
|
@@ -1104,7 +1104,7 @@ class yr{constructor(){this.refreshToken=null,this.accessToken=null,this.expirat
|
|
|
1104
1104
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1105
1105
|
* See the License for the specific language governing permissions and
|
|
1106
1106
|
* limitations under the License.
|
|
1107
|
-
*/function
|
|
1107
|
+
*/function Pr(e){const t=e.toLowerCase();if(t.includes("opera/")||t.includes("opr/")||t.includes("opios/"))return"Opera";if(Dr(t))return"IEMobile";if(t.includes("msie")||t.includes("trident/"))return"IE";if(t.includes("edge/"))return"Edge";if(Rr(t))return"Firefox";if(t.includes("silk/"))return"Silk";if(Mr(t))return"Blackberry";if(Fr(t))return"Webos";if(Nr(t))return"Safari";if((t.includes("chrome/")||Ar(t))&&!t.includes("edge/"))return"Chrome";if(Or(t))return"Android";{const t=/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/,n=e.match(t);if(2===(null==n?void 0:n.length))return n[1]}return"Other"}function Rr(e=bt()){return/firefox\//i.test(e)}function Nr(e=bt()){const t=e.toLowerCase();return t.includes("safari/")&&!t.includes("chrome/")&&!t.includes("crios/")&&!t.includes("android")}function Ar(e=bt()){return/crios\//i.test(e)}function Dr(e=bt()){return/iemobile/i.test(e)}function Or(e=bt()){return/android/i.test(e)}function Mr(e=bt()){return/blackberry/i.test(e)}function Fr(e=bt()){return/webos/i.test(e)}function zr(e=bt()){return/iphone|ipad|ipod/i.test(e)||/macintosh/i.test(e)&&/mobile/i.test(e)}function Ur(){return function(){const e=bt();return e.indexOf("MSIE ")>=0||e.indexOf("Trident/")>=0}()&&10===document.documentMode}function jr(e=bt()){return zr(e)||Or(e)||Fr(e)||Mr(e)||/windows phone/i.test(e)||Dr(e)}
|
|
1108
1108
|
/**
|
|
1109
1109
|
* @license
|
|
1110
1110
|
* Copyright 2020 Google LLC
|
|
@@ -1120,7 +1120,7 @@ class yr{constructor(){this.refreshToken=null,this.accessToken=null,this.expirat
|
|
|
1120
1120
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1121
1121
|
* See the License for the specific language governing permissions and
|
|
1122
1122
|
* limitations under the License.
|
|
1123
|
-
*/function
|
|
1123
|
+
*/function Vr(e,t=[]){let n;switch(e){case"Browser":n=Pr(bt());break;case"Worker":n=`${Pr(bt())}-${e}`;break;default:n=e}const i=t.length?t.join(","):"FirebaseCore-web";return`${n}/JsCore/${si}/${i}`}
|
|
1124
1124
|
/**
|
|
1125
1125
|
* @license
|
|
1126
1126
|
* Copyright 2022 Google LLC
|
|
@@ -1136,7 +1136,7 @@ class yr{constructor(){this.refreshToken=null,this.accessToken=null,this.expirat
|
|
|
1136
1136
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1137
1137
|
* See the License for the specific language governing permissions and
|
|
1138
1138
|
* limitations under the License.
|
|
1139
|
-
*/class
|
|
1139
|
+
*/class qr{constructor(e){this.auth=e,this.queue=[]}pushCallback(e,t){const n=t=>new Promise(((n,i)=>{try{n(e(t))}catch(e){i(e)}}));n.onAbort=t,this.queue.push(n);const i=this.queue.length-1;return()=>{this.queue[i]=()=>Promise.resolve()}}async runMiddleware(e){if(this.auth.currentUser===e)return;const t=[];try{for(const n of this.queue)await n(e),n.onAbort&&t.push(n.onAbort)}catch(e){t.reverse();for(const e of t)try{e()}catch(e){}throw this.auth._errorFactory.create("login-blocked",{originalMessage:null==e?void 0:e.message})}}}
|
|
1140
1140
|
/**
|
|
1141
1141
|
* @license
|
|
1142
1142
|
* Copyright 2023 Google LLC
|
|
@@ -1152,7 +1152,7 @@ class yr{constructor(){this.refreshToken=null,this.accessToken=null,this.expirat
|
|
|
1152
1152
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1153
1153
|
* See the License for the specific language governing permissions and
|
|
1154
1154
|
* limitations under the License.
|
|
1155
|
-
*/class
|
|
1155
|
+
*/class Br{constructor(e){var t,n,i,o;const r=e.customStrengthOptions;this.customStrengthOptions={},this.customStrengthOptions.minPasswordLength=null!==(t=r.minPasswordLength)&&void 0!==t?t:6,r.maxPasswordLength&&(this.customStrengthOptions.maxPasswordLength=r.maxPasswordLength),void 0!==r.containsLowercaseCharacter&&(this.customStrengthOptions.containsLowercaseLetter=r.containsLowercaseCharacter),void 0!==r.containsUppercaseCharacter&&(this.customStrengthOptions.containsUppercaseLetter=r.containsUppercaseCharacter),void 0!==r.containsNumericCharacter&&(this.customStrengthOptions.containsNumericCharacter=r.containsNumericCharacter),void 0!==r.containsNonAlphanumericCharacter&&(this.customStrengthOptions.containsNonAlphanumericCharacter=r.containsNonAlphanumericCharacter),this.enforcementState=e.enforcementState,"ENFORCEMENT_STATE_UNSPECIFIED"===this.enforcementState&&(this.enforcementState="OFF"),this.allowedNonAlphanumericCharacters=null!==(i=null===(n=e.allowedNonAlphanumericCharacters)||void 0===n?void 0:n.join(""))&&void 0!==i?i:"",this.forceUpgradeOnSignin=null!==(o=e.forceUpgradeOnSignin)&&void 0!==o&&o,this.schemaVersion=e.schemaVersion}validatePassword(e){var t,n,i,o,r,s;const a={isValid:!0,passwordPolicy:this};return this.validatePasswordLengthOptions(e,a),this.validatePasswordCharacterOptions(e,a),a.isValid&&(a.isValid=null===(t=a.meetsMinPasswordLength)||void 0===t||t),a.isValid&&(a.isValid=null===(n=a.meetsMaxPasswordLength)||void 0===n||n),a.isValid&&(a.isValid=null===(i=a.containsLowercaseLetter)||void 0===i||i),a.isValid&&(a.isValid=null===(o=a.containsUppercaseLetter)||void 0===o||o),a.isValid&&(a.isValid=null===(r=a.containsNumericCharacter)||void 0===r||r),a.isValid&&(a.isValid=null===(s=a.containsNonAlphanumericCharacter)||void 0===s||s),a}validatePasswordLengthOptions(e,t){const n=this.customStrengthOptions.minPasswordLength,i=this.customStrengthOptions.maxPasswordLength;n&&(t.meetsMinPasswordLength=e.length>=n),i&&(t.meetsMaxPasswordLength=e.length<=i)}validatePasswordCharacterOptions(e,t){let n;this.updatePasswordCharacterOptionsStatuses(t,!1,!1,!1,!1);for(let i=0;i<e.length;i++)n=e.charAt(i),this.updatePasswordCharacterOptionsStatuses(t,n>="a"&&n<="z",n>="A"&&n<="Z",n>="0"&&n<="9",this.allowedNonAlphanumericCharacters.includes(n))}updatePasswordCharacterOptionsStatuses(e,t,n,i,o){this.customStrengthOptions.containsLowercaseLetter&&(e.containsLowercaseLetter||(e.containsLowercaseLetter=t)),this.customStrengthOptions.containsUppercaseLetter&&(e.containsUppercaseLetter||(e.containsUppercaseLetter=n)),this.customStrengthOptions.containsNumericCharacter&&(e.containsNumericCharacter||(e.containsNumericCharacter=i)),this.customStrengthOptions.containsNonAlphanumericCharacter&&(e.containsNonAlphanumericCharacter||(e.containsNonAlphanumericCharacter=o))}}
|
|
1156
1156
|
/**
|
|
1157
1157
|
* @license
|
|
1158
1158
|
* Copyright 2020 Google LLC
|
|
@@ -1168,7 +1168,7 @@ class yr{constructor(){this.refreshToken=null,this.accessToken=null,this.expirat
|
|
|
1168
1168
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1169
1169
|
* See the License for the specific language governing permissions and
|
|
1170
1170
|
* limitations under the License.
|
|
1171
|
-
*/class Hr{constructor(e,t,n,i){this.app=e,this.heartbeatServiceProvider=t,this.appCheckServiceProvider=n,this.config=i,this.currentUser=null,this.emulatorConfig=null,this.operations=Promise.resolve(),this.authStateSubscription=new Wr(this),this.idTokenSubscription=new Wr(this),this.beforeStateQueue=new
|
|
1171
|
+
*/class Hr{constructor(e,t,n,i){this.app=e,this.heartbeatServiceProvider=t,this.appCheckServiceProvider=n,this.config=i,this.currentUser=null,this.emulatorConfig=null,this.operations=Promise.resolve(),this.authStateSubscription=new Wr(this),this.idTokenSubscription=new Wr(this),this.beforeStateQueue=new qr(this),this.redirectUser=null,this.isProactiveRefreshEnabled=!1,this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION=1,this._canInitEmulator=!0,this._isInitialized=!1,this._deleted=!1,this._initializationPromise=null,this._popupRedirectResolver=null,this._errorFactory=Uo,this._agentRecaptchaConfig=null,this._tenantRecaptchaConfigs={},this._projectPasswordPolicy=null,this._tenantPasswordPolicies={},this.lastNotifiedUid=void 0,this.languageCode=null,this.tenantId=null,this.settings={appVerificationDisabledForTesting:!1},this.frameworks=[],this.name=e.name,this.clientVersion=i.sdkClientVersion}_initializeWithPersistence(e,t){return t&&(this._popupRedirectResolver=Ir(t)),this._initializationPromise=this.queue((async()=>{var n,i;if(!this._deleted&&(this.persistenceManager=await Lr.create(this,e),!this._deleted)){if(null===(n=this._popupRedirectResolver)||void 0===n?void 0:n._shouldInitProactively)try{await this._popupRedirectResolver._initialize(this)}catch(e){}await this.initializeCurrentUser(t),this.lastNotifiedUid=(null===(i=this.currentUser)||void 0===i?void 0:i.uid)||null,this._deleted||(this._isInitialized=!0)}})),this._initializationPromise}async _onStorageEvent(){if(this._deleted)return;const e=await this.assertedPersistence.getCurrentUser();return this.currentUser||e?this.currentUser&&e&&this.currentUser.uid===e.uid?(this._currentUser._assign(e),void await this.currentUser.getIdToken()):void await this._updateCurrentUser(e,!0):void 0}async initializeCurrentUserFromIdToken(e){try{const t=await hr(this,{idToken:e}),n=await kr._fromGetAccountInfoResponse(this,t,e);await this.directlySetCurrentUser(n)}catch(e){console.warn("FirebaseServerApp could not login user with provided authIdToken: ",e),await this.directlySetCurrentUser(null)}}async initializeCurrentUser(e){var t;if(ii(this.app)){const e=this.app.settings.authIdToken;return e?new Promise((t=>{setTimeout((()=>this.initializeCurrentUserFromIdToken(e).then(t,t)))})):this.directlySetCurrentUser(null)}const n=await this.assertedPersistence.getCurrentUser();let i=n,o=!1;if(e&&this.config.authDomain){await this.getOrInitRedirectPersistenceManager();const n=null===(t=this.redirectUser)||void 0===t?void 0:t._redirectEventId,r=null==i?void 0:i._redirectEventId,s=await this.tryRedirectSignIn(e);n&&n!==r||!(null==s?void 0:s.user)||(i=s.user,o=!0)}if(!i)return this.directlySetCurrentUser(null);if(!i._redirectEventId){if(o)try{await this.beforeStateQueue.runMiddleware(i)}catch(e){i=n,this._popupRedirectResolver._overrideRedirectResult(this,(()=>Promise.reject(e)))}return i?this.reloadAndSetCurrentUserOrClear(i):this.directlySetCurrentUser(null)}return Go(this._popupRedirectResolver,this,"argument-error"),await this.getOrInitRedirectPersistenceManager(),this.redirectUser&&this.redirectUser._redirectEventId===i._redirectEventId?this.directlySetCurrentUser(i):this.reloadAndSetCurrentUserOrClear(i)}async tryRedirectSignIn(e){let t=null;try{t=await this._popupRedirectResolver._completeRedirectFn(this,e,!0)}catch(e){await this._setRedirectUser(null)}return t}async reloadAndSetCurrentUserOrClear(e){try{await wr(e)}catch(e){if("auth/network-request-failed"!==(null==e?void 0:e.code))return this.directlySetCurrentUser(null)}return this.directlySetCurrentUser(e)}useDeviceLanguage(){this.languageCode=function(){if("undefined"==typeof navigator)return null;const e=navigator;return e.languages&&e.languages[0]||e.language||null}()}async _delete(){this._deleted=!0}async updateCurrentUser(e){if(ii(this.app))return Promise.reject($o(this));const t=e?Ht(e):null;return t&&Go(t.auth.config.apiKey===this.config.apiKey,this,"invalid-user-token"),this._updateCurrentUser(t&&t._clone(this))}async _updateCurrentUser(e,t=!1){if(!this._deleted)return e&&Go(this.tenantId===e.tenantId,this,"tenant-id-mismatch"),t||await this.beforeStateQueue.runMiddleware(e),this.queue((async()=>{await this.directlySetCurrentUser(e),this.notifyAuthListeners()}))}async signOut(){return ii(this.app)?Promise.reject($o(this)):(await this.beforeStateQueue.runMiddleware(null),(this.redirectPersistenceManager||this._popupRedirectResolver)&&await this._setRedirectUser(null),this._updateCurrentUser(null,!0))}setPersistence(e){return ii(this.app)?Promise.reject($o(this)):this.queue((async()=>{await this.assertedPersistence.setPersistence(Ir(e))}))}_getRecaptchaConfig(){return null==this.tenantId?this._agentRecaptchaConfig:this._tenantRecaptchaConfigs[this.tenantId]}async validatePassword(e){this._getPasswordPolicyInternal()||await this._updatePasswordPolicy();const t=this._getPasswordPolicyInternal();return t.schemaVersion!==this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION?Promise.reject(this._errorFactory.create("unsupported-password-policy-schema-version",{})):t.validatePassword(e)}_getPasswordPolicyInternal(){return null===this.tenantId?this._projectPasswordPolicy:this._tenantPasswordPolicies[this.tenantId]}async _updatePasswordPolicy(){const e=await async function(e,t={}){return rr(e,"GET","/v2/passwordPolicy",or(e,t))}
|
|
1172
1172
|
/**
|
|
1173
1173
|
* @license
|
|
1174
1174
|
* Copyright 2023 Google LLC
|
|
@@ -1184,7 +1184,7 @@ class yr{constructor(){this.refreshToken=null,this.accessToken=null,this.expirat
|
|
|
1184
1184
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1185
1185
|
* See the License for the specific language governing permissions and
|
|
1186
1186
|
* limitations under the License.
|
|
1187
|
-
*/(this),t=new
|
|
1187
|
+
*/(this),t=new Br(e);null===this.tenantId?this._projectPasswordPolicy=t:this._tenantPasswordPolicies[this.tenantId]=t}_getPersistence(){return this.assertedPersistence.persistence.type}_updateErrorMap(e){this._errorFactory=new St("auth","Firebase",e())}onAuthStateChanged(e,t,n){return this.registerStateListener(this.authStateSubscription,e,t,n)}beforeAuthStateChanged(e,t){return this.beforeStateQueue.pushCallback(e,t)}onIdTokenChanged(e,t,n){return this.registerStateListener(this.idTokenSubscription,e,t,n)}authStateReady(){return new Promise(((e,t)=>{if(this.currentUser)e();else{const n=this.onAuthStateChanged((()=>{n(),e()}),t)}}))}async revokeAccessToken(e){if(this.currentUser){const t={providerId:"apple.com",tokenType:"ACCESS_TOKEN",token:e,idToken:await this.currentUser.getIdToken()};null!=this.tenantId&&(t.tenantId=this.tenantId),await async function(e,t){return rr(e,"POST","/v2/accounts:revokeToken",or(e,t))}(this,t)}}toJSON(){var e;return{apiKey:this.config.apiKey,authDomain:this.config.authDomain,appName:this.name,currentUser:null===(e=this._currentUser)||void 0===e?void 0:e.toJSON()}}async _setRedirectUser(e,t){const n=await this.getOrInitRedirectPersistenceManager(t);return null===e?n.removeCurrentUser():n.setCurrentUser(e)}async getOrInitRedirectPersistenceManager(e){if(!this.redirectPersistenceManager){const t=e&&Ir(e)||this._popupRedirectResolver;Go(t,this,"argument-error"),this.redirectPersistenceManager=await Lr.create(this,[Ir(t._redirectPersistence)],"redirectUser"),this.redirectUser=await this.redirectPersistenceManager.getCurrentUser()}return this.redirectPersistenceManager}async _redirectUserForId(e){var t,n;return this._isInitialized&&await this.queue((async()=>{})),(null===(t=this._currentUser)||void 0===t?void 0:t._redirectEventId)===e?this._currentUser:(null===(n=this.redirectUser)||void 0===n?void 0:n._redirectEventId)===e?this.redirectUser:null}async _persistUserIfCurrent(e){if(e===this.currentUser)return this.queue((async()=>this.directlySetCurrentUser(e)))}_notifyListenersIfCurrent(e){e===this.currentUser&&this.notifyAuthListeners()}_key(){return`${this.config.authDomain}:${this.config.apiKey}:${this.name}`}_startProactiveRefresh(){this.isProactiveRefreshEnabled=!0,this.currentUser&&this._currentUser._startProactiveRefresh()}_stopProactiveRefresh(){this.isProactiveRefreshEnabled=!1,this.currentUser&&this._currentUser._stopProactiveRefresh()}get _currentUser(){return this.currentUser}notifyAuthListeners(){var e,t;if(!this._isInitialized)return;this.idTokenSubscription.next(this.currentUser);const n=null!==(t=null===(e=this.currentUser)||void 0===e?void 0:e.uid)&&void 0!==t?t:null;this.lastNotifiedUid!==n&&(this.lastNotifiedUid=n,this.authStateSubscription.next(this.currentUser))}registerStateListener(e,t,n,i){if(this._deleted)return()=>{};const o="function"==typeof t?t:t.next.bind(t);let r=!1;const s=this._isInitialized?Promise.resolve():this._initializationPromise;if(Go(s,this,"internal-error"),s.then((()=>{r||o(this.currentUser)})),"function"==typeof t){const o=e.addObserver(t,n,i);return()=>{r=!0,o()}}{const n=e.addObserver(t);return()=>{r=!0,n()}}}async directlySetCurrentUser(e){this.currentUser&&this.currentUser!==e&&this._currentUser._stopProactiveRefresh(),e&&this.isProactiveRefreshEnabled&&e._startProactiveRefresh(),this.currentUser=e,e?await this.assertedPersistence.setCurrentUser(e):await this.assertedPersistence.removeCurrentUser()}queue(e){return this.operations=this.operations.then(e,e),this.operations}get assertedPersistence(){return Go(this.persistenceManager,this,"internal-error"),this.persistenceManager}_logFramework(e){e&&!this.frameworks.includes(e)&&(this.frameworks.push(e),this.frameworks.sort(),this.clientVersion=Vr(this.config.clientPlatform,this._getFrameworks()))}_getFrameworks(){return this.frameworks}async _getAdditionalHeaders(){var e;const t={"X-Client-Version":this.clientVersion};this.app.options.appId&&(t["X-Firebase-gmpid"]=this.app.options.appId);const n=await(null===(e=this.heartbeatServiceProvider.getImmediate({optional:!0}))||void 0===e?void 0:e.getHeartbeatsHeader());n&&(t["X-Firebase-Client"]=n);const i=await this._getAppCheckToken();return i&&(t["X-Firebase-AppCheck"]=i),t}async _getAppCheckToken(){var e;const t=await(null===(e=this.appCheckServiceProvider.getImmediate({optional:!0}))||void 0===e?void 0:e.getToken());return(null==t?void 0:t.error)&&function(e,...t){jo.logLevel<=Yt.WARN&&jo.warn(`Auth (${si}): ${e}`,...t)}(`Error while retrieving App Check token: ${t.error}`),null==t?void 0:t.token}}function $r(e){return Ht(e)}class Wr{constructor(e){this.auth=e,this.observer=null,this.addObserver=function(e,t){const n=new Ut(e,t);return n.subscribe.bind(n)}((e=>this.observer=e))}get next(){return Go(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)}}
|
|
1188
1188
|
/**
|
|
1189
1189
|
* @license
|
|
1190
1190
|
* Copyright 2020 Google LLC
|
|
@@ -1216,7 +1216,7 @@ class yr{constructor(){this.refreshToken=null,this.accessToken=null,this.expirat
|
|
|
1216
1216
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1217
1217
|
* See the License for the specific language governing permissions and
|
|
1218
1218
|
* limitations under the License.
|
|
1219
|
-
*/()}function Yr(e){const t=e.indexOf(":");return t<0?"":e.substr(0,t+1)}function Jr(e){if(!e)return null;const t=Number(e);return isNaN(t)?null:t}class
|
|
1219
|
+
*/()}function Yr(e){const t=e.indexOf(":");return t<0?"":e.substr(0,t+1)}function Jr(e){if(!e)return null;const t=Number(e);return isNaN(t)?null:t}class Zr{constructor(e,t){this.providerId=e,this.signInMethod=t}toJSON(){return Ko("not implemented")}_getIdTokenResponse(e){return Ko("not implemented")}_linkToIdToken(e,t){return Ko("not implemented")}_getReauthenticationResolver(e){return Ko("not implemented")}}
|
|
1220
1220
|
/**
|
|
1221
1221
|
* @license
|
|
1222
1222
|
* Copyright 2020 Google LLC
|
|
@@ -1232,7 +1232,7 @@ class yr{constructor(){this.refreshToken=null,this.accessToken=null,this.expirat
|
|
|
1232
1232
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1233
1233
|
* See the License for the specific language governing permissions and
|
|
1234
1234
|
* limitations under the License.
|
|
1235
|
-
*/async function
|
|
1235
|
+
*/async function Qr(e,t){return ar(e,"POST","/v1/accounts:signInWithIdp",or(e,t))}
|
|
1236
1236
|
/**
|
|
1237
1237
|
* @license
|
|
1238
1238
|
* Copyright 2020 Google LLC
|
|
@@ -1248,7 +1248,7 @@ class yr{constructor(){this.refreshToken=null,this.accessToken=null,this.expirat
|
|
|
1248
1248
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1249
1249
|
* See the License for the specific language governing permissions and
|
|
1250
1250
|
* limitations under the License.
|
|
1251
|
-
*/class
|
|
1251
|
+
*/class Xr extends Zr{constructor(){super(...arguments),this.pendingToken=null}static _fromParams(e){const t=new Xr(e.providerId,e.signInMethod);return e.idToken||e.accessToken?(e.idToken&&(t.idToken=e.idToken),e.accessToken&&(t.accessToken=e.accessToken),e.nonce&&!e.pendingToken&&(t.nonce=e.nonce),e.pendingToken&&(t.pendingToken=e.pendingToken)):e.oauthToken&&e.oauthTokenSecret?(t.accessToken=e.oauthToken,t.secret=e.oauthTokenSecret):qo("argument-error"),t}toJSON(){return{idToken:this.idToken,accessToken:this.accessToken,secret:this.secret,nonce:this.nonce,pendingToken:this.pendingToken,providerId:this.providerId,signInMethod:this.signInMethod}}static fromJSON(e){const t="string"==typeof e?JSON.parse(e):e,{providerId:n,signInMethod:i}=t,o=Mo(t,["providerId","signInMethod"]);if(!n||!i)return null;const r=new Xr(n,i);return r.idToken=o.idToken||void 0,r.accessToken=o.accessToken||void 0,r.secret=o.secret,r.nonce=o.nonce,r.pendingToken=o.pendingToken||null,r}_getIdTokenResponse(e){return Qr(e,this.buildRequest())}_linkToIdToken(e,t){const n=this.buildRequest();return n.idToken=t,Qr(e,n)}_getReauthenticationResolver(e){const t=this.buildRequest();return t.autoCreate=!1,Qr(e,t)}buildRequest(){const e={requestUri:"http://localhost",returnSecureToken:!0};if(this.pendingToken)e.pendingToken=this.pendingToken;else{const t={};this.idToken&&(t.id_token=this.idToken),this.accessToken&&(t.access_token=this.accessToken),this.secret&&(t.oauth_token_secret=this.secret),t.providerId=this.providerId,this.nonce&&!this.pendingToken&&(t.nonce=this.nonce),e.postBody=Ft(t)}return e}}
|
|
1252
1252
|
/**
|
|
1253
1253
|
* @license
|
|
1254
1254
|
* Copyright 2020 Google LLC
|
|
@@ -1296,7 +1296,7 @@ class yr{constructor(){this.refreshToken=null,this.accessToken=null,this.expirat
|
|
|
1296
1296
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1297
1297
|
* See the License for the specific language governing permissions and
|
|
1298
1298
|
* limitations under the License.
|
|
1299
|
-
*/class ns extends ts{constructor(){super("facebook.com")}static credential(e){return
|
|
1299
|
+
*/class ns extends ts{constructor(){super("facebook.com")}static credential(e){return Xr._fromParams({providerId:ns.PROVIDER_ID,signInMethod:ns.FACEBOOK_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return ns.credentialFromTaggedObject(e)}static credentialFromError(e){return ns.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e))return null;if(!e.oauthAccessToken)return null;try{return ns.credential(e.oauthAccessToken)}catch(e){return null}}}ns.FACEBOOK_SIGN_IN_METHOD="facebook.com",ns.PROVIDER_ID="facebook.com";
|
|
1300
1300
|
/**
|
|
1301
1301
|
* @license
|
|
1302
1302
|
* Copyright 2020 Google LLC
|
|
@@ -1313,7 +1313,7 @@ class yr{constructor(){this.refreshToken=null,this.accessToken=null,this.expirat
|
|
|
1313
1313
|
* See the License for the specific language governing permissions and
|
|
1314
1314
|
* limitations under the License.
|
|
1315
1315
|
*/
|
|
1316
|
-
class is extends ts{constructor(){super("google.com"),this.addScope("profile")}static credential(e,t){return
|
|
1316
|
+
class is extends ts{constructor(){super("google.com"),this.addScope("profile")}static credential(e,t){return Xr._fromParams({providerId:is.PROVIDER_ID,signInMethod:is.GOOGLE_SIGN_IN_METHOD,idToken:e,accessToken:t})}static credentialFromResult(e){return is.credentialFromTaggedObject(e)}static credentialFromError(e){return is.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{oauthIdToken:t,oauthAccessToken:n}=e;if(!t&&!n)return null;try{return is.credential(t,n)}catch(e){return null}}}is.GOOGLE_SIGN_IN_METHOD="google.com",is.PROVIDER_ID="google.com";
|
|
1317
1317
|
/**
|
|
1318
1318
|
* @license
|
|
1319
1319
|
* Copyright 2020 Google LLC
|
|
@@ -1330,7 +1330,7 @@ class is extends ts{constructor(){super("google.com"),this.addScope("profile")}s
|
|
|
1330
1330
|
* See the License for the specific language governing permissions and
|
|
1331
1331
|
* limitations under the License.
|
|
1332
1332
|
*/
|
|
1333
|
-
class os extends ts{constructor(){super("github.com")}static credential(e){return
|
|
1333
|
+
class os extends ts{constructor(){super("github.com")}static credential(e){return Xr._fromParams({providerId:os.PROVIDER_ID,signInMethod:os.GITHUB_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return os.credentialFromTaggedObject(e)}static credentialFromError(e){return os.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e))return null;if(!e.oauthAccessToken)return null;try{return os.credential(e.oauthAccessToken)}catch(e){return null}}}os.GITHUB_SIGN_IN_METHOD="github.com",os.PROVIDER_ID="github.com";
|
|
1334
1334
|
/**
|
|
1335
1335
|
* @license
|
|
1336
1336
|
* Copyright 2020 Google LLC
|
|
@@ -1347,7 +1347,7 @@ class os extends ts{constructor(){super("github.com")}static credential(e){retur
|
|
|
1347
1347
|
* See the License for the specific language governing permissions and
|
|
1348
1348
|
* limitations under the License.
|
|
1349
1349
|
*/
|
|
1350
|
-
class rs extends ts{constructor(){super("twitter.com")}static credential(e,t){return
|
|
1350
|
+
class rs extends ts{constructor(){super("twitter.com")}static credential(e,t){return Xr._fromParams({providerId:rs.PROVIDER_ID,signInMethod:rs.TWITTER_SIGN_IN_METHOD,oauthToken:e,oauthTokenSecret:t})}static credentialFromResult(e){return rs.credentialFromTaggedObject(e)}static credentialFromError(e){return rs.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{oauthAccessToken:t,oauthTokenSecret:n}=e;if(!t||!n)return null;try{return rs.credential(t,n)}catch(e){return null}}}rs.TWITTER_SIGN_IN_METHOD="twitter.com",rs.PROVIDER_ID="twitter.com";
|
|
1351
1351
|
/**
|
|
1352
1352
|
* @license
|
|
1353
1353
|
* Copyright 2020 Google LLC
|
|
@@ -1577,7 +1577,7 @@ function ys(){return void 0!==xs().WorkerGlobalScope&&"function"==typeof xs().im
|
|
|
1577
1577
|
* See the License for the specific language governing permissions and
|
|
1578
1578
|
* limitations under the License.
|
|
1579
1579
|
*/
|
|
1580
|
-
const _s="firebaseLocalStorageDb",ks="firebaseLocalStorage",Cs="fbase_key";class Is{constructor(e){this.request=e}toPromise(){return new Promise(((e,t)=>{this.request.addEventListener("success",(()=>{e(this.request.result)})),this.request.addEventListener("error",(()=>{t(this.request.error)}))}))}}function Ss(e,t){return e.transaction([ks],t?"readwrite":"readonly").objectStore(ks)}function Ts(){const e=indexedDB.open(_s,1);return new Promise(((t,n)=>{e.addEventListener("error",(()=>{n(e.error)})),e.addEventListener("upgradeneeded",(()=>{const t=e.result;try{t.createObjectStore(ks,{keyPath:Cs})}catch(e){n(e)}})),e.addEventListener("success",(async()=>{const n=e.result;n.objectStoreNames.contains(ks)?t(n):(n.close(),await function(){const e=indexedDB.deleteDatabase(_s);return new Is(e).toPromise()}(),t(await Ts()))}))}))}async function Es(e,t,n){const i=Ss(e,!0).put({[Cs]:t,value:n});return new Is(i).toPromise()}function
|
|
1580
|
+
const _s="firebaseLocalStorageDb",ks="firebaseLocalStorage",Cs="fbase_key";class Is{constructor(e){this.request=e}toPromise(){return new Promise(((e,t)=>{this.request.addEventListener("success",(()=>{e(this.request.result)})),this.request.addEventListener("error",(()=>{t(this.request.error)}))}))}}function Ss(e,t){return e.transaction([ks],t?"readwrite":"readonly").objectStore(ks)}function Ts(){const e=indexedDB.open(_s,1);return new Promise(((t,n)=>{e.addEventListener("error",(()=>{n(e.error)})),e.addEventListener("upgradeneeded",(()=>{const t=e.result;try{t.createObjectStore(ks,{keyPath:Cs})}catch(e){n(e)}})),e.addEventListener("success",(async()=>{const n=e.result;n.objectStoreNames.contains(ks)?t(n):(n.close(),await function(){const e=indexedDB.deleteDatabase(_s);return new Is(e).toPromise()}(),t(await Ts()))}))}))}async function Es(e,t,n){const i=Ss(e,!0).put({[Cs]:t,value:n});return new Is(i).toPromise()}function Ls(e,t){const n=Ss(e,!0).delete(t);return new Is(n).toPromise()}class Ps{constructor(){this.type="LOCAL",this._shouldAllowMigration=!0,this.listeners={},this.localCache={},this.pollTimer=null,this.pendingWrites=0,this.receiver=null,this.sender=null,this.serviceWorkerReceiverAvailable=!1,this.activeServiceWorker=null,this._workerInitializationPromise=this.initializeServiceWorkerMessaging().then((()=>{}),(()=>{}))}async _openDb(){return this.db||(this.db=await Ts()),this.db}async _withRetries(e){let t=0;for(;;)try{const t=await this._openDb();return await e(t)}catch(e){if(t++>3)throw e;this.db&&(this.db.close(),this.db=void 0)}}async initializeServiceWorkerMessaging(){return ys()?this.initializeReceiver():this.initializeSender()}async initializeReceiver(){this.receiver=vs._getInstance(ys()?self:null),this.receiver._subscribe("keyChanged",(async(e,t)=>({keyProcessed:(await this._poll()).includes(t.key)}))),this.receiver._subscribe("ping",(async(e,t)=>["keyChanged"]))}async initializeSender(){var e,t;if(this.activeServiceWorker=await async function(){if(!(null===navigator||void 0===navigator?void 0:navigator.serviceWorker))return null;try{return(await navigator.serviceWorker.ready).active}catch(e){return null}}(),!this.activeServiceWorker)return;this.sender=new ws(this.activeServiceWorker);const n=await this.sender._send("ping",{},800);n&&(null===(e=n[0])||void 0===e?void 0:e.fulfilled)&&(null===(t=n[0])||void 0===t?void 0:t.value.includes("keyChanged"))&&(this.serviceWorkerReceiverAvailable=!0)}async notifyServiceWorker(e){var t;if(this.sender&&this.activeServiceWorker&&((null===(t=null===navigator||void 0===navigator?void 0:navigator.serviceWorker)||void 0===t?void 0:t.controller)||null)===this.activeServiceWorker)try{await this.sender._send("keyChanged",{key:e},this.serviceWorkerReceiverAvailable?800:50)}catch(t){}}async _isAvailable(){try{if(!indexedDB)return!1;const e=await Ts();return await Es(e,hs,"1"),await Ls(e,hs),!0}catch(e){}return!1}async _withPendingWrite(e){this.pendingWrites++;try{await e()}finally{this.pendingWrites--}}async _set(e,t){return this._withPendingWrite((async()=>(await this._withRetries((n=>Es(n,e,t))),this.localCache[e]=t,this.notifyServiceWorker(e))))}async _get(e){const t=await this._withRetries((t=>async function(e,t){const n=Ss(e,!1).get(t),i=await new Is(n).toPromise();return void 0===i?null:i.value}(t,e)));return this.localCache[e]=t,t}async _remove(e){return this._withPendingWrite((async()=>(await this._withRetries((t=>Ls(t,e))),delete this.localCache[e],this.notifyServiceWorker(e))))}async _poll(){const e=await this._withRetries((e=>{const t=Ss(e,!1).getAll();return new Is(t).toPromise()}));if(!e)return[];if(0!==this.pendingWrites)return[];const t=[],n=new Set;if(0!==e.length)for(const{fbase_key:i,value:o}of e)n.add(i),JSON.stringify(this.localCache[i])!==JSON.stringify(o)&&(this.notifyListeners(i,o),t.push(i));for(const e of Object.keys(this.localCache))this.localCache[e]&&!n.has(e)&&(this.notifyListeners(e,null),t.push(e));return t}notifyListeners(e,t){this.localCache[e]=t;const n=this.listeners[e];if(n)for(const e of Array.from(n))e(t)}startPolling(){this.stopPolling(),this.pollTimer=setInterval((async()=>this._poll()),800)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}_addListener(e,t){0===Object.keys(this.listeners).length&&this.startPolling(),this.listeners[e]||(this.listeners[e]=new Set,this._get(e)),this.listeners[e].add(t)}_removeListener(e,t){this.listeners[e]&&(this.listeners[e].delete(t),0===this.listeners[e].size&&delete this.listeners[e]),0===Object.keys(this.listeners).length&&this.stopPolling()}}Ps.type="LOCAL";const Rs=Ps;new Xo(3e4,6e4);
|
|
1581
1581
|
/**
|
|
1582
1582
|
* @license
|
|
1583
1583
|
* Copyright 2019 Google LLC
|
|
@@ -1594,7 +1594,7 @@ const _s="firebaseLocalStorageDb",ks="firebaseLocalStorage",Cs="fbase_key";class
|
|
|
1594
1594
|
* See the License for the specific language governing permissions and
|
|
1595
1595
|
* limitations under the License.
|
|
1596
1596
|
*/
|
|
1597
|
-
class Ns extends
|
|
1597
|
+
class Ns extends Zr{constructor(e){super("custom","custom"),this.params=e}_getIdTokenResponse(e){return Qr(e,this._buildIdpRequest())}_linkToIdToken(e,t){return Qr(e,this._buildIdpRequest(t))}_getReauthenticationResolver(e){return Qr(e,this._buildIdpRequest())}_buildIdpRequest(e){const t={requestUri:this.params.requestUri,sessionId:this.params.sessionId,postBody:this.params.postBody,tenantId:this.params.tenantId,pendingToken:this.params.pendingToken,returnSecureToken:!0,returnIdpCredential:!0};return e&&(t.idToken=e),t}}function As(e){
|
|
1598
1598
|
/**
|
|
1599
1599
|
* @license
|
|
1600
1600
|
* Copyright 2020 Google LLC
|
|
@@ -1611,7 +1611,7 @@ class Ns extends Qr{constructor(e){super("custom","custom"),this.params=e}_getId
|
|
|
1611
1611
|
* See the License for the specific language governing permissions and
|
|
1612
1612
|
* limitations under the License.
|
|
1613
1613
|
*/
|
|
1614
|
-
return async function(e,t,n=!1){if(ii(e.app))return Promise.reject($o(e));const i="signIn",o=await cs(e,i,t),r=await ss._fromIdTokenResponse(e,i,o);return n||await e._updateCurrentUser(r.user),r}(e.auth,new Ns(e),e.bypassAuthState)}function
|
|
1614
|
+
return async function(e,t,n=!1){if(ii(e.app))return Promise.reject($o(e));const i="signIn",o=await cs(e,i,t),r=await ss._fromIdTokenResponse(e,i,o);return n||await e._updateCurrentUser(r.user),r}(e.auth,new Ns(e),e.bypassAuthState)}function Ds(e){const{auth:t,user:n}=e;return Go(n,t,"internal-error"),
|
|
1615
1615
|
/**
|
|
1616
1616
|
* @license
|
|
1617
1617
|
* Copyright 2019 Google LLC
|
|
@@ -1628,7 +1628,7 @@ return async function(e,t,n=!1){if(ii(e.app))return Promise.reject($o(e));const
|
|
|
1628
1628
|
* See the License for the specific language governing permissions and
|
|
1629
1629
|
* limitations under the License.
|
|
1630
1630
|
*/
|
|
1631
|
-
async function(e,t,n=!1){const{auth:i}=e;if(ii(i.app))return Promise.reject($o(i));const o="reauthenticate";try{const r=await mr(e,cs(i,o,t,e),n);Go(r.idToken,i,"internal-error");const s=gr(r.idToken);Go(s,i,"internal-error");const{sub:a}=s;return Go(e.uid===a,i,"user-mismatch"),ss._forOperation(e,o,r)}catch(e){throw"auth/user-not-found"===(null==e?void 0:e.code)&&
|
|
1631
|
+
async function(e,t,n=!1){const{auth:i}=e;if(ii(i.app))return Promise.reject($o(i));const o="reauthenticate";try{const r=await mr(e,cs(i,o,t,e),n);Go(r.idToken,i,"internal-error");const s=gr(r.idToken);Go(s,i,"internal-error");const{sub:a}=s;return Go(e.uid===a,i,"user-mismatch"),ss._forOperation(e,o,r)}catch(e){throw"auth/user-not-found"===(null==e?void 0:e.code)&&qo(i,"user-mismatch"),e}}(n,new Ns(e),e.bypassAuthState)}async function Os(e){const{auth:t,user:n}=e;return Go(n,t,"internal-error"),async function(e,t,n=!1){const i=await mr(e,t._linkToIdToken(e.auth,await e.getIdToken()),n);return ss._forOperation(e,"link",i)}(n,new Ns(e),e.bypassAuthState)}
|
|
1632
1632
|
/**
|
|
1633
1633
|
* @license
|
|
1634
1634
|
* Copyright 2020 Google LLC
|
|
@@ -1644,7 +1644,7 @@ async function(e,t,n=!1){const{auth:i}=e;if(ii(i.app))return Promise.reject($o(i
|
|
|
1644
1644
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1645
1645
|
* See the License for the specific language governing permissions and
|
|
1646
1646
|
* limitations under the License.
|
|
1647
|
-
*/class Ms{constructor(e,t,n,i,o=!1){this.auth=e,this.resolver=n,this.user=i,this.bypassAuthState=o,this.pendingPromise=null,this.eventManager=null,this.filter=Array.isArray(t)?t:[t]}execute(){return new Promise((async(e,t)=>{this.pendingPromise={resolve:e,reject:t};try{this.eventManager=await this.resolver._initialize(this.auth),await this.onExecution(),this.eventManager.registerConsumer(this)}catch(e){this.reject(e)}}))}async onAuthEvent(e){const{urlResponse:t,sessionId:n,postBody:i,tenantId:o,error:r,type:s}=e;if(r)return void this.reject(r);const a={auth:this.auth,requestUri:t,sessionId:n,tenantId:o||void 0,postBody:i||void 0,user:this.user,bypassAuthState:this.bypassAuthState};try{this.resolve(await this.getIdpTask(s)(a))}catch(e){this.reject(e)}}onError(e){this.reject(e)}getIdpTask(e){switch(e){case"signInViaPopup":case"signInViaRedirect":return
|
|
1647
|
+
*/class Ms{constructor(e,t,n,i,o=!1){this.auth=e,this.resolver=n,this.user=i,this.bypassAuthState=o,this.pendingPromise=null,this.eventManager=null,this.filter=Array.isArray(t)?t:[t]}execute(){return new Promise((async(e,t)=>{this.pendingPromise={resolve:e,reject:t};try{this.eventManager=await this.resolver._initialize(this.auth),await this.onExecution(),this.eventManager.registerConsumer(this)}catch(e){this.reject(e)}}))}async onAuthEvent(e){const{urlResponse:t,sessionId:n,postBody:i,tenantId:o,error:r,type:s}=e;if(r)return void this.reject(r);const a={auth:this.auth,requestUri:t,sessionId:n,tenantId:o||void 0,postBody:i||void 0,user:this.user,bypassAuthState:this.bypassAuthState};try{this.resolve(await this.getIdpTask(s)(a))}catch(e){this.reject(e)}}onError(e){this.reject(e)}getIdpTask(e){switch(e){case"signInViaPopup":case"signInViaRedirect":return As;case"linkViaPopup":case"linkViaRedirect":return Os;case"reauthViaPopup":case"reauthViaRedirect":return Ds;default:qo(this.auth,"internal-error")}}resolve(e){Yo(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.resolve(e),this.unregisterAndCleanUp()}reject(e){Yo(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.reject(e),this.unregisterAndCleanUp()}unregisterAndCleanUp(){this.eventManager&&this.eventManager.unregisterConsumer(this),this.pendingPromise=null,this.cleanUp()}}
|
|
1648
1648
|
/**
|
|
1649
1649
|
* @license
|
|
1650
1650
|
* Copyright 2020 Google LLC
|
|
@@ -1660,7 +1660,7 @@ async function(e,t,n=!1){const{auth:i}=e;if(ii(i.app))return Promise.reject($o(i
|
|
|
1660
1660
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1661
1661
|
* See the License for the specific language governing permissions and
|
|
1662
1662
|
* limitations under the License.
|
|
1663
|
-
*/const Fs=new
|
|
1663
|
+
*/const Fs=new Xo(2e3,1e4);class zs extends Ms{constructor(e,t,n,i,o){super(e,t,i,o),this.provider=n,this.authWindow=null,this.pollId=null,zs.currentPopupAction&&zs.currentPopupAction.cancel(),zs.currentPopupAction=this}async executeNotNull(){const e=await this.execute();return Go(e,this.auth,"internal-error"),e}async onExecution(){Yo(1===this.filter.length,"Popup operations only handle one event");const e=bs();this.authWindow=await this.resolver._openPopup(this.auth,this.provider,this.filter[0],e),this.authWindow.associatedEvent=e,this.resolver._originValidation(this.auth).catch((e=>{this.reject(e)})),this.resolver._isIframeWebStorageSupported(this.auth,(e=>{e||this.reject(Bo(this.auth,"web-storage-unsupported"))})),this.pollUserCancellation()}get eventId(){var e;return(null===(e=this.authWindow)||void 0===e?void 0:e.associatedEvent)||null}cancel(){this.reject(Bo(this.auth,"cancelled-popup-request"))}cleanUp(){this.authWindow&&this.authWindow.close(),this.pollId&&window.clearTimeout(this.pollId),this.authWindow=null,this.pollId=null,zs.currentPopupAction=null}pollUserCancellation(){const e=()=>{var t,n;(null===(n=null===(t=this.authWindow)||void 0===t?void 0:t.window)||void 0===n?void 0:n.closed)?this.pollId=window.setTimeout((()=>{this.pollId=null,this.reject(Bo(this.auth,"popup-closed-by-user"))}),8e3):this.pollId=window.setTimeout(e,Fs.get())};e()}}zs.currentPopupAction=null;
|
|
1664
1664
|
/**
|
|
1665
1665
|
* @license
|
|
1666
1666
|
* Copyright 2020 Google LLC
|
|
@@ -1677,7 +1677,7 @@ async function(e,t,n=!1){const{auth:i}=e;if(ii(i.app))return Promise.reject($o(i
|
|
|
1677
1677
|
* See the License for the specific language governing permissions and
|
|
1678
1678
|
* limitations under the License.
|
|
1679
1679
|
*/
|
|
1680
|
-
const Us="pendingRedirect",js=new Map;class
|
|
1680
|
+
const Us="pendingRedirect",js=new Map;class Vs extends Ms{constructor(e,t,n=!1){super(e,["signInViaRedirect","linkViaRedirect","reauthViaRedirect","unknown"],t,void 0,n),this.eventId=null}async execute(){let e=js.get(this.auth._key());if(!e){try{const t=await async function(e,t){const n=function(e){return Er(Us,e.config.apiKey,e.name)}(t),i=function(e){return Ir(e._redirectPersistence)}(e);if(!await i._isAvailable())return!1;const o="true"===await i._get(n);return await i._remove(n),o}(this.resolver,this.auth),n=t?await super.execute():null;e=()=>Promise.resolve(n)}catch(t){e=()=>Promise.reject(t)}js.set(this.auth._key(),e)}return this.bypassAuthState||js.set(this.auth._key(),(()=>Promise.resolve(null))),e()}async onAuthEvent(e){if("signInViaRedirect"===e.type)return super.onAuthEvent(e);if("unknown"!==e.type){if(e.eventId){const t=await this.auth._redirectUserForId(e.eventId);if(t)return this.user=t,super.onAuthEvent(e);this.resolve(null)}}else this.resolve(null)}async onExecution(){}cleanUp(){}}function qs(e,t){js.set(e._key(),t)}async function Bs(e,t,n=!1){if(ii(e.app))return Promise.reject($o(e));const i=$r(e),o=
|
|
1681
1681
|
/**
|
|
1682
1682
|
* @license
|
|
1683
1683
|
* Copyright 2021 Google LLC
|
|
@@ -1694,7 +1694,7 @@ const Us="pendingRedirect",js=new Map;class qs extends Ms{constructor(e,t,n=!1){
|
|
|
1694
1694
|
* See the License for the specific language governing permissions and
|
|
1695
1695
|
* limitations under the License.
|
|
1696
1696
|
*/
|
|
1697
|
-
function(e,t){return t?Ir(t):(Go(e._popupRedirectResolver,e,"argument-error"),e._popupRedirectResolver)}(i,t),r=new
|
|
1697
|
+
function(e,t){return t?Ir(t):(Go(e._popupRedirectResolver,e,"argument-error"),e._popupRedirectResolver)}(i,t),r=new Vs(i,o,n),s=await r.execute();return s&&!n&&(delete s.user._redirectEventId,await i._persistUserIfCurrent(s.user),await i._setRedirectUser(null,t)),s}
|
|
1698
1698
|
/**
|
|
1699
1699
|
* @license
|
|
1700
1700
|
* Copyright 2020 Google LLC
|
|
@@ -1726,7 +1726,7 @@ function(e,t){return t?Ir(t):(Go(e._popupRedirectResolver,e,"argument-error"),e.
|
|
|
1726
1726
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1727
1727
|
* See the License for the specific language governing permissions and
|
|
1728
1728
|
* limitations under the License.
|
|
1729
|
-
*/(e)||(this.hasHandledPotentialRedirect=!0,t||(this.queuedRedirectEvent=e,t=!0)),t}sendToConsumer(e,t){var n;if(e.error&&!Ws(e)){const i=(null===(n=e.error.code)||void 0===n?void 0:n.split("auth/")[1])||"internal-error";t.onError(
|
|
1729
|
+
*/(e)||(this.hasHandledPotentialRedirect=!0,t||(this.queuedRedirectEvent=e,t=!0)),t}sendToConsumer(e,t){var n;if(e.error&&!Ws(e)){const i=(null===(n=e.error.code)||void 0===n?void 0:n.split("auth/")[1])||"internal-error";t.onError(Bo(this.auth,i))}else t.onAuthEvent(e)}isEventForConsumer(e,t){const n=null===t.eventId||!!e.eventId&&e.eventId===t.eventId;return t.filter.includes(e.type)&&n}hasEventBeenHandled(e){return Date.now()-this.lastProcessedEventTime>=6e5&&this.cachedEventUids.clear(),this.cachedEventUids.has($s(e))}saveEventToCache(e){this.cachedEventUids.add($s(e)),this.lastProcessedEventTime=Date.now()}}function $s(e){return[e.type,e.eventId,e.sessionId,e.tenantId].filter((e=>e)).join("-")}function Ws({type:e,error:t}){return"unknown"===e&&"auth/no-auth-event"===(null==t?void 0:t.code)}
|
|
1730
1730
|
/**
|
|
1731
1731
|
* @license
|
|
1732
1732
|
* Copyright 2020 Google LLC
|
|
@@ -1743,7 +1743,7 @@ function(e,t){return t?Ir(t):(Go(e._popupRedirectResolver,e,"argument-error"),e.
|
|
|
1743
1743
|
* See the License for the specific language governing permissions and
|
|
1744
1744
|
* limitations under the License.
|
|
1745
1745
|
*/
|
|
1746
|
-
const Gs=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,Ks=/^https?/;async function Ys(e){if(e.config.emulator)return;const{authorizedDomains:t}=await async function(e,t={}){return rr(e,"GET","/v1/projects",t)}(e);for(const e of t)try{if(Js(e))return}catch(e){}
|
|
1746
|
+
const Gs=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,Ks=/^https?/;async function Ys(e){if(e.config.emulator)return;const{authorizedDomains:t}=await async function(e,t={}){return rr(e,"GET","/v1/projects",t)}(e);for(const e of t)try{if(Js(e))return}catch(e){}qo(e,"unauthorized-domain")}function Js(e){const t=Jo(),{protocol:n,hostname:i}=new URL(t);if(e.startsWith("chrome-extension://")){const o=new URL(e);return""===o.hostname&&""===i?"chrome-extension:"===n&&e.replace("chrome-extension://","")===t.replace("chrome-extension://",""):"chrome-extension:"===n&&o.hostname===i}if(!Ks.test(n))return!1;if(Gs.test(e))return i===e;const o=e.replace(/\./g,"\\.");return new RegExp("^(.+\\."+o+"|"+o+")$","i").test(i)}
|
|
1747
1747
|
/**
|
|
1748
1748
|
* @license
|
|
1749
1749
|
* Copyright 2020 Google LLC.
|
|
@@ -1759,7 +1759,7 @@ const Gs=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,Ks=/^https?/;async function Ys(e
|
|
|
1759
1759
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1760
1760
|
* See the License for the specific language governing permissions and
|
|
1761
1761
|
* limitations under the License.
|
|
1762
|
-
*/const
|
|
1762
|
+
*/const Zs=new Xo(3e4,6e4);function Qs(){const e=xs().___jsl;if(null==e?void 0:e.H)for(const t of Object.keys(e.H))if(e.H[t].r=e.H[t].r||[],e.H[t].L=e.H[t].L||[],e.H[t].r=[...e.H[t].L],e.CP)for(let t=0;t<e.CP.length;t++)e.CP[t]=null}function Xs(e){return new Promise(((t,n)=>{var i,o,r,s;function a(){Qs(),gapi.load("gapi.iframes",{callback:()=>{t(gapi.iframes.getContext())},ontimeout:()=>{Qs(),n(Bo(e,"network-request-failed"))},timeout:Zs.get()})}if(null===(o=null===(i=xs().gapi)||void 0===i?void 0:i.iframes)||void 0===o?void 0:o.Iframe)t(gapi.iframes.getContext());else{if(!(null===(r=xs().gapi)||void 0===r?void 0:r.load)){const t=`__${"iframefcb"}${Math.floor(1e6*Math.random())}`;return xs()[t]=()=>{gapi.load?a():n(Bo(e,"network-request-failed"))},(s=`${Gr.gapiScript}?onload=${t}`,Gr.loadJS(s)).catch((e=>n(e)))}a()}})).catch((e=>{throw ea=null,e}))}let ea=null;
|
|
1763
1763
|
/**
|
|
1764
1764
|
* @license
|
|
1765
1765
|
* Copyright 2020 Google LLC.
|
|
@@ -1776,7 +1776,7 @@ const Gs=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,Ks=/^https?/;async function Ys(e
|
|
|
1776
1776
|
* See the License for the specific language governing permissions and
|
|
1777
1777
|
* limitations under the License.
|
|
1778
1778
|
*/
|
|
1779
|
-
const ta=new
|
|
1779
|
+
const ta=new Xo(5e3,15e3),na={style:{position:"absolute",top:"-100px",width:"1px",height:"1px"},"aria-hidden":"true",tabindex:"-1"},ia=new Map([["identitytoolkit.googleapis.com","p"],["staging-identitytoolkit.sandbox.googleapis.com","s"],["test-identitytoolkit.sandbox.googleapis.com","t"]]);function oa(e){const t=e.config;Go(t.authDomain,e,"auth-domain-config-required");const n=t.emulator?er(t,"emulator/auth/iframe"):`https://${e.config.authDomain}/__/auth/iframe`,i={apiKey:t.apiKey,appName:e.name,v:si},o=ia.get(e.config.apiHost);o&&(i.eid=o);const r=e._getFrameworks();return r.length&&(i.fw=r.join(",")),`${n}?${Ft(i).slice(1)}`}async function ra(e){const t=await function(e){return ea=ea||Xs(e),ea}(e),n=xs().gapi;return Go(n,e,"internal-error"),t.open({where:document.body,url:oa(e),messageHandlersFilter:n.iframes.CROSS_ORIGIN_IFRAMES_FILTER,attributes:na,dontclear:!0},(t=>new Promise((async(n,i)=>{await t.restyle({setHideOnLeave:!1});const o=Bo(e,"network-request-failed"),r=xs().setTimeout((()=>{i(o)}),ta.get());function s(){xs().clearTimeout(r),n(t)}t.ping(s).then(s,(()=>{i(o)}))}))))}
|
|
1780
1780
|
/**
|
|
1781
1781
|
* @license
|
|
1782
1782
|
* Copyright 2020 Google LLC.
|
|
@@ -1792,7 +1792,7 @@ const ta=new Zo(5e3,15e3),na={style:{position:"absolute",top:"-100px",width:"1px
|
|
|
1792
1792
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1793
1793
|
* See the License for the specific language governing permissions and
|
|
1794
1794
|
* limitations under the License.
|
|
1795
|
-
*/const sa={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"};class aa{constructor(e){this.window=e,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch(e){}}}function la(e,t,n,i=500,o=600){const r=Math.max((window.screen.availHeight-o)/2,0).toString(),s=Math.max((window.screen.availWidth-i)/2,0).toString();let a="";const l=Object.assign(Object.assign({},sa),{width:i.toString(),height:o.toString(),top:r,left:s}),c=bt().toLowerCase();n&&(a=
|
|
1795
|
+
*/const sa={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"};class aa{constructor(e){this.window=e,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch(e){}}}function la(e,t,n,i=500,o=600){const r=Math.max((window.screen.availHeight-o)/2,0).toString(),s=Math.max((window.screen.availWidth-i)/2,0).toString();let a="";const l=Object.assign(Object.assign({},sa),{width:i.toString(),height:o.toString(),top:r,left:s}),c=bt().toLowerCase();n&&(a=Ar(c)?"_blank":n),Rr(c)&&(t=t||"http://localhost",l.scrollbars="yes");const d=Object.entries(l).reduce(((e,[t,n])=>`${e}${t}=${n},`),"");if(function(e=bt()){var t;return zr(e)&&!!(null===(t=window.navigator)||void 0===t?void 0:t.standalone)}(c)&&"_self"!==a)return function(e,t){const n=document.createElement("a");n.href=e,n.target=t;const i=document.createEvent("MouseEvent");i.initMouseEvent("click",!0,!0,window,1,0,0,0,0,!1,!1,!1,!1,1,null),n.dispatchEvent(i)}
|
|
1796
1796
|
/**
|
|
1797
1797
|
* @license
|
|
1798
1798
|
* Copyright 2021 Google LLC
|
|
@@ -1808,7 +1808,7 @@ const ta=new Zo(5e3,15e3),na={style:{position:"absolute",top:"-100px",width:"1px
|
|
|
1808
1808
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1809
1809
|
* See the License for the specific language governing permissions and
|
|
1810
1810
|
* limitations under the License.
|
|
1811
|
-
*/(t||"",a),new aa(null);const h=window.open(t||"",a,d);Go(h,e,"popup-blocked");try{h.focus()}catch(e){}return new aa(h)}const ca="__/auth/handler",da="emulator/auth/handler",ha=encodeURIComponent("fac");async function ua(e,t,n,i,o,r){Go(e.config.authDomain,e,"auth-domain-config-required"),Go(e.config.apiKey,e,"invalid-api-key");const s={apiKey:e.config.apiKey,appName:e.name,authType:n,redirectUrl:i,v:si,eventId:o};if(t instanceof es){t.setDefaultLanguage(e.languageCode),s.providerId=t.providerId||"",
|
|
1811
|
+
*/(t||"",a),new aa(null);const h=window.open(t||"",a,d);Go(h,e,"popup-blocked");try{h.focus()}catch(e){}return new aa(h)}const ca="__/auth/handler",da="emulator/auth/handler",ha=encodeURIComponent("fac");async function ua(e,t,n,i,o,r){Go(e.config.authDomain,e,"auth-domain-config-required"),Go(e.config.apiKey,e,"invalid-api-key");const s={apiKey:e.config.apiKey,appName:e.name,authType:n,redirectUrl:i,v:si,eventId:o};if(t instanceof es){t.setDefaultLanguage(e.languageCode),s.providerId=t.providerId||"",At(t.getCustomParameters())||(s.customParameters=JSON.stringify(t.getCustomParameters()));for(const[e,t]of Object.entries({}))s[e]=t}if(t instanceof ts){const e=t.getScopes().filter((e=>""!==e));e.length>0&&(s.scopes=e.join(","))}e.tenantId&&(s.tid=e.tenantId);const a=s;for(const e of Object.keys(a))void 0===a[e]&&delete a[e];const l=await e._getAppCheckToken(),c=l?`#${ha}=${encodeURIComponent(l)}`:"";return`${function({config:e}){if(!e.emulator)return`https://${e.authDomain}/${ca}`;return er(e,da)}
|
|
1812
1812
|
/**
|
|
1813
1813
|
* @license
|
|
1814
1814
|
* Copyright 2020 Google LLC
|
|
@@ -1824,7 +1824,7 @@ const ta=new Zo(5e3,15e3),na={style:{position:"absolute",top:"-100px",width:"1px
|
|
|
1824
1824
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1825
1825
|
* See the License for the specific language governing permissions and
|
|
1826
1826
|
* limitations under the License.
|
|
1827
|
-
*/(e)}?${Ft(a).slice(1)}${c}`}const pa="webStorageSupport";const ga=class{constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=ms,this._completeRedirectFn=
|
|
1827
|
+
*/(e)}?${Ft(a).slice(1)}${c}`}const pa="webStorageSupport";const ga=class{constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=ms,this._completeRedirectFn=Bs,this._overrideRedirectResult=qs}async _openPopup(e,t,n,i){var o;Yo(null===(o=this.eventManagers[e._key()])||void 0===o?void 0:o.manager,"_initialize() not called before _openPopup()");return la(e,await ua(e,t,n,Jo(),i),bs())}async _openRedirect(e,t,n,i){await this._originValidation(e);return function(e){xs().location.href=e}(await ua(e,t,n,Jo(),i)),new Promise((()=>{}))}_initialize(e){const t=e._key();if(this.eventManagers[t]){const{manager:e,promise:n}=this.eventManagers[t];return e?Promise.resolve(e):(Yo(n,"If manager is not set, promise should be"),n)}const n=this.initAndGetManager(e);return this.eventManagers[t]={promise:n},n.catch((()=>{delete this.eventManagers[t]})),n}async initAndGetManager(e){const t=await ra(e),n=new Hs(e);return t.register("authEvent",(t=>{Go(null==t?void 0:t.authEvent,e,"invalid-auth-event");return{status:n.onEvent(t.authEvent)?"ACK":"ERROR"}}),gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER),this.eventManagers[e._key()]={manager:n},this.iframes[e._key()]=t,n}_isIframeWebStorageSupported(e,t){this.iframes[e._key()].send(pa,{type:pa},(n=>{var i;const o=null===(i=null==n?void 0:n[0])||void 0===i?void 0:i[pa];void 0!==o&&t(!!o),qo(e,"internal-error")}),gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)}_originValidation(e){const t=e._key();return this.originValidationPromises[t]||(this.originValidationPromises[t]=Ys(e)),this.originValidationPromises[t]}get _shouldInitProactively(){return jr()||Nr()||zr()}};var fa="@firebase/auth",ma="1.8.1";
|
|
1828
1828
|
/**
|
|
1829
1829
|
* @license
|
|
1830
1830
|
* Copyright 2020 Google LLC
|
|
@@ -1891,7 +1891,7 @@ const ba=mt("authIdTokenMaxAge")||300;let wa=null;function xa(e=li()){const t=ni
|
|
|
1891
1891
|
* See the License for the specific language governing permissions and
|
|
1892
1892
|
* limitations under the License.
|
|
1893
1893
|
*/
|
|
1894
|
-
function(e,t){const n=ni(e,"auth");if(n.isInitialized()){const e=n.getImmediate();if(Ot(n.getOptions(),null!=t?t:{}))return e;
|
|
1894
|
+
function(e,t){const n=ni(e,"auth");if(n.isInitialized()){const e=n.getImmediate();if(Ot(n.getOptions(),null!=t?t:{}))return e;qo(e,"already-initialized")}return n.initialize({options:t})}(e,{popupRedirectResolver:ga,persistence:[Rs,gs,ms]}),i=mt("authTokenSyncURL");if(i&&"boolean"==typeof isSecureContext&&isSecureContext){const e=new URL(i,location.origin);if(location.origin===e.origin){const t=(o=e.toString(),async e=>{const t=e&&await e.getIdTokenResult(),n=t&&((new Date).getTime()-Date.parse(t.issuedAtTime))/1e3;if(n&&n>ba)return;const i=null==t?void 0:t.token;wa!==i&&(wa=i,await fetch(o,{method:i?"POST":"DELETE",headers:i?{Authorization:`Bearer ${i}`}:{}}))});!function(e,t,n){Ht(e).beforeAuthStateChanged(t,n)}(n,t,(()=>t(n.currentUser))),function(e,t,n,i){Ht(e).onIdTokenChanged(t,n,i)}(n,(e=>t(e)))}}var o;const r=gt("auth");return r&&Kr(n,`http://${r}`),n}var ya,_a;ya={loadJS:e=>new Promise(((t,n)=>{const i=document.createElement("script");var o,r;i.setAttribute("src",e),i.onload=t,i.onerror=e=>{const t=Bo("internal-error");t.customData=e,n(t)},i.type="text/javascript",i.charset="UTF-8",(null!==(r=null===(o=document.getElementsByTagName("head"))||void 0===o?void 0:o[0])&&void 0!==r?r:document).appendChild(i)})),gapiScript:"https://apis.google.com/js/api.js",recaptchaV2Script:"https://www.google.com/recaptcha/api.js",recaptchaEnterpriseScript:"https://www.google.com/recaptcha/enterprise.js?render="},Gr=ya,_a="Browser",ti(new $t("auth",((e,{options:t})=>{const n=e.getProvider("app").getImmediate(),i=e.getProvider("heartbeat"),o=e.getProvider("app-check-internal"),{apiKey:r,authDomain:s}=n.options;Go(r&&!r.includes(":"),"invalid-api-key",{appName:n.name});const a={apiKey:r,authDomain:s,clientPlatform:_a,apiHost:"identitytoolkit.googleapis.com",tokenApiHost:"securetoken.googleapis.com",apiScheme:"https",sdkClientVersion:Vr(_a)},l=new Hr(n,i,o,a);return function(e,t){const n=(null==t?void 0:t.persistence)||[],i=(Array.isArray(n)?n:[n]).map(Ir);(null==t?void 0:t.errorMap)&&e._updateErrorMap(t.errorMap),e._initializeWithPersistence(i,null==t?void 0:t.popupRedirectResolver)}(l,t),l}),"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback(((e,t,n)=>{e.getProvider("auth-internal").initialize()}))),ti(new $t("auth-internal",(e=>(e=>new va(e))($r(e.getProvider("auth").getImmediate()))),"PRIVATE").setInstantiationMode("EXPLICIT")),ci(fa,ma,function(e){switch(e){case"Node":return"node";case"ReactNative":return"rn";case"Worker":return"webworker";case"Cordova":return"cordova";case"WebExtension":return"web-extension";default:return}}(_a)),ci(fa,ma,"esm2017");const ka="@firebase/database",Ca="1.0.10";
|
|
1895
1895
|
/**
|
|
1896
1896
|
* @license
|
|
1897
1897
|
* Copyright 2019 Google LLC
|
|
@@ -1925,7 +1925,7 @@ let Ia="";
|
|
|
1925
1925
|
* See the License for the specific language governing permissions and
|
|
1926
1926
|
* limitations under the License.
|
|
1927
1927
|
*/
|
|
1928
|
-
class Sa{constructor(e){this.domStorage_=e,this.prefix_="firebase:"}set(e,t){null==t?this.domStorage_.removeItem(this.prefixedName_(e)):this.domStorage_.setItem(this.prefixedName_(e),
|
|
1928
|
+
class Sa{constructor(e){this.domStorage_=e,this.prefix_="firebase:"}set(e,t){null==t?this.domStorage_.removeItem(this.prefixedName_(e)):this.domStorage_.setItem(this.prefixedName_(e),Lt(t))}get(e){const t=this.domStorage_.getItem(this.prefixedName_(e));return null==t?null:Et(t)}remove(e){this.domStorage_.removeItem(this.prefixedName_(e))}prefixedName_(e){return this.prefix_+e}toString(){return this.domStorage_.toString()}}
|
|
1929
1929
|
/**
|
|
1930
1930
|
* @license
|
|
1931
1931
|
* Copyright 2017 Google LLC
|
|
@@ -1941,7 +1941,7 @@ class Sa{constructor(e){this.domStorage_=e,this.prefix_="firebase:"}set(e,t){nul
|
|
|
1941
1941
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1942
1942
|
* See the License for the specific language governing permissions and
|
|
1943
1943
|
* limitations under the License.
|
|
1944
|
-
*/class Ta{constructor(){this.cache_={},this.isInMemoryStorage=!0}set(e,t){null==t?delete this.cache_[e]:this.cache_[e]=t}get(e){return
|
|
1944
|
+
*/class Ta{constructor(){this.cache_={},this.isInMemoryStorage=!0}set(e,t){null==t?delete this.cache_[e]:this.cache_[e]=t}get(e){return Rt(this.cache_,e)?this.cache_[e]:null}remove(e){delete this.cache_[e]}}
|
|
1945
1945
|
/**
|
|
1946
1946
|
* @license
|
|
1947
1947
|
* Copyright 2017 Google LLC
|
|
@@ -1957,7 +1957,7 @@ class Sa{constructor(e){this.domStorage_=e,this.prefix_="firebase:"}set(e,t){nul
|
|
|
1957
1957
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1958
1958
|
* See the License for the specific language governing permissions and
|
|
1959
1959
|
* limitations under the License.
|
|
1960
|
-
*/const Ea=function(e){try{if("undefined"!=typeof window&&void 0!==window[e]){const t=window[e];return t.setItem("firebase:sentinel","cache"),t.removeItem("firebase:sentinel"),new Sa(t)}}catch(e){}return new Ta},
|
|
1960
|
+
*/const Ea=function(e){try{if("undefined"!=typeof window&&void 0!==window[e]){const t=window[e];return t.setItem("firebase:sentinel","cache"),t.removeItem("firebase:sentinel"),new Sa(t)}}catch(e){}return new Ta},La=Ea("localStorage"),Pa=Ea("sessionStorage"),Ra=new en("@firebase/database"),Na=function(){let e=1;return function(){return e++}}(),Aa=function(e){const t=function(e){const t=[];let n=0;for(let i=0;i<e.length;i++){let o=e.charCodeAt(i);if(o>=55296&&o<=56319){const t=o-55296;i++,nt(i<e.length,"Surrogate pair missing trail surrogate."),o=65536+(t<<10)+(e.charCodeAt(i)-56320)}o<128?t[n++]=o:o<2048?(t[n++]=o>>6|192,t[n++]=63&o|128):o<65536?(t[n++]=o>>12|224,t[n++]=o>>6&63|128,t[n++]=63&o|128):(t[n++]=o>>18|240,t[n++]=o>>12&63|128,t[n++]=o>>6&63|128,t[n++]=63&o|128)}return t}(e),n=new zt;n.update(t);const i=n.digest();return rt.encodeByteArray(i)},Da=function(...e){let t="";for(let n=0;n<e.length;n++){const i=e[n];Array.isArray(i)||i&&"object"==typeof i&&"number"==typeof i.length?t+=Da.apply(null,i):t+="object"==typeof i?Lt(i):i,t+=" "}return t};let Oa=null,Ma=!0;const Fa=function(...e){var t;if(!0===Ma&&(Ma=!1,null===Oa&&!0===Pa.get("logging_enabled")&&(nt(!t,"Can't turn on custom loggers persistently."),Ra.logLevel=Yt.VERBOSE,Oa=Ra.log.bind(Ra))),Oa){const t=Da.apply(null,e);Oa(t)}},za=function(e){return function(...t){Fa(e,...t)}},Ua=function(...e){const t="FIREBASE INTERNAL ERROR: "+Da(...e);Ra.error(t)},ja=function(...e){const t=`FIREBASE FATAL ERROR: ${Da(...e)}`;throw Ra.error(t),new Error(t)},Va=function(...e){const t="FIREBASE WARNING: "+Da(...e);Ra.warn(t)},qa=function(e){return"number"==typeof e&&(e!=e||e===Number.POSITIVE_INFINITY||e===Number.NEGATIVE_INFINITY)},Ba="[MIN_NAME]",Ha="[MAX_NAME]",$a=function(e,t){if(e===t)return 0;if(e===Ba||t===Ha)return-1;if(t===Ba||e===Ha)return 1;{const n=Xa(e),i=Xa(t);return null!==n?null!==i?n-i==0?e.length-t.length:n-i:-1:null!==i?1:e<t?-1:1}},Wa=function(e,t){return e===t?0:e<t?-1:1},Ga=function(e,t){if(t&&e in t)return t[e];throw new Error("Missing required key ("+e+") in object: "+Lt(t))},Ka=function(e){if("object"!=typeof e||null===e)return Lt(e);const t=[];for(const n in e)t.push(n);t.sort();let n="{";for(let i=0;i<t.length;i++)0!==i&&(n+=","),n+=Lt(t[i]),n+=":",n+=Ka(e[t[i]]);return n+="}",n},Ya=function(e,t){const n=e.length;if(n<=t)return[e];const i=[];for(let o=0;o<n;o+=t)o+t>n?i.push(e.substring(o,n)):i.push(e.substring(o,o+t));return i};function Ja(e,t){for(const n in e)e.hasOwnProperty(n)&&t(n,e[n])}const Za=function(e){nt(!qa(e),"Invalid JSON number");const t=1023;let n,i,o,r,s;0===e?(i=0,o=0,n=1/e==-1/0?1:0):(n=e<0,(e=Math.abs(e))>=Math.pow(2,-1022)?(r=Math.min(Math.floor(Math.log(e)/Math.LN2),t),i=r+t,o=Math.round(e*Math.pow(2,52-r)-Math.pow(2,52))):(i=0,o=Math.round(e/Math.pow(2,-1074))));const a=[];for(s=52;s;s-=1)a.push(o%2?1:0),o=Math.floor(o/2);for(s=11;s;s-=1)a.push(i%2?1:0),i=Math.floor(i/2);a.push(n?1:0),a.reverse();const l=a.join("");let c="";for(s=0;s<64;s+=8){let e=parseInt(l.substr(s,8),2).toString(16);1===e.length&&(e="0"+e),c+=e}return c.toLowerCase()};const Qa=new RegExp("^-?(0*)\\d{1,10}$"),Xa=function(e){if(Qa.test(e)){const t=Number(e);if(t>=-2147483648&&t<=2147483647)return t}return null},el=function(e){try{e()}catch(e){setTimeout((()=>{const t=e.stack||"";throw Va("Exception was thrown by user callback.",t),e}),Math.floor(0))}},tl=function(e,t){const n=setTimeout(e,t);return"number"==typeof n&&"undefined"!=typeof Deno&&Deno.unrefTimer?Deno.unrefTimer(n):"object"==typeof n&&n.unref&&n.unref(),n};
|
|
1961
1961
|
/**
|
|
1962
1962
|
* @license
|
|
1963
1963
|
* Copyright 2021 Google LLC
|
|
@@ -1974,7 +1974,7 @@ class Sa{constructor(e){this.domStorage_=e,this.prefix_="firebase:"}set(e,t){nul
|
|
|
1974
1974
|
* See the License for the specific language governing permissions and
|
|
1975
1975
|
* limitations under the License.
|
|
1976
1976
|
*/
|
|
1977
|
-
class nl{constructor(e,t){this.appName_=e,this.appCheckProvider=t,this.appCheck=null==t?void 0:t.getImmediate({optional:!0}),this.appCheck||null==t||t.get().then((e=>this.appCheck=e))}getToken(e){return this.appCheck?this.appCheck.getToken(e):new Promise(((t,n)=>{setTimeout((()=>{this.appCheck?this.getToken(e).then(t,n):t(null)}),0)}))}addTokenChangeListener(e){var t;null===(t=this.appCheckProvider)||void 0===t||t.get().then((t=>t.addTokenListener(e)))}notifyForInvalidToken(){
|
|
1977
|
+
class nl{constructor(e,t){this.appName_=e,this.appCheckProvider=t,this.appCheck=null==t?void 0:t.getImmediate({optional:!0}),this.appCheck||null==t||t.get().then((e=>this.appCheck=e))}getToken(e){return this.appCheck?this.appCheck.getToken(e):new Promise(((t,n)=>{setTimeout((()=>{this.appCheck?this.getToken(e).then(t,n):t(null)}),0)}))}addTokenChangeListener(e){var t;null===(t=this.appCheckProvider)||void 0===t||t.get().then((t=>t.addTokenListener(e)))}notifyForInvalidToken(){Va(`Provided AppCheck credentials for the app named "${this.appName_}" are invalid. This usually indicates your app was not initialized correctly.`)}}
|
|
1978
1978
|
/**
|
|
1979
1979
|
* @license
|
|
1980
1980
|
* Copyright 2017 Google LLC
|
|
@@ -1990,7 +1990,7 @@ class nl{constructor(e,t){this.appName_=e,this.appCheckProvider=t,this.appCheck=
|
|
|
1990
1990
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1991
1991
|
* See the License for the specific language governing permissions and
|
|
1992
1992
|
* limitations under the License.
|
|
1993
|
-
*/class il{constructor(e,t,n){this.appName_=e,this.firebaseOptions_=t,this.authProvider_=n,this.auth_=null,this.auth_=n.getImmediate({optional:!0}),this.auth_||n.onInit((e=>this.auth_=e))}getToken(e){return this.auth_?this.auth_.getToken(e).catch((e=>e&&"auth/token-not-initialized"===e.code?(Fa("Got auth/token-not-initialized error. Treating as null token."),null):Promise.reject(e))):new Promise(((t,n)=>{setTimeout((()=>{this.auth_?this.getToken(e).then(t,n):t(null)}),0)}))}addTokenChangeListener(e){this.auth_?this.auth_.addAuthTokenListener(e):this.authProvider_.get().then((t=>t.addAuthTokenListener(e)))}removeTokenChangeListener(e){this.authProvider_.get().then((t=>t.removeAuthTokenListener(e)))}notifyForInvalidToken(){let e='Provided authentication credentials for the app named "'+this.appName_+'" are invalid. This usually indicates your app was not initialized correctly. ';"credential"in this.firebaseOptions_?e+='Make sure the "credential" property provided to initializeApp() is authorized to access the specified "databaseURL" and is from the correct project.':"serviceAccount"in this.firebaseOptions_?e+='Make sure the "serviceAccount" property provided to initializeApp() is authorized to access the specified "databaseURL" and is from the correct project.':e+='Make sure the "apiKey" and "databaseURL" properties provided to initializeApp() match the values provided for your app at https://console.firebase.google.com/.',
|
|
1993
|
+
*/class il{constructor(e,t,n){this.appName_=e,this.firebaseOptions_=t,this.authProvider_=n,this.auth_=null,this.auth_=n.getImmediate({optional:!0}),this.auth_||n.onInit((e=>this.auth_=e))}getToken(e){return this.auth_?this.auth_.getToken(e).catch((e=>e&&"auth/token-not-initialized"===e.code?(Fa("Got auth/token-not-initialized error. Treating as null token."),null):Promise.reject(e))):new Promise(((t,n)=>{setTimeout((()=>{this.auth_?this.getToken(e).then(t,n):t(null)}),0)}))}addTokenChangeListener(e){this.auth_?this.auth_.addAuthTokenListener(e):this.authProvider_.get().then((t=>t.addAuthTokenListener(e)))}removeTokenChangeListener(e){this.authProvider_.get().then((t=>t.removeAuthTokenListener(e)))}notifyForInvalidToken(){let e='Provided authentication credentials for the app named "'+this.appName_+'" are invalid. This usually indicates your app was not initialized correctly. ';"credential"in this.firebaseOptions_?e+='Make sure the "credential" property provided to initializeApp() is authorized to access the specified "databaseURL" and is from the correct project.':"serviceAccount"in this.firebaseOptions_?e+='Make sure the "serviceAccount" property provided to initializeApp() is authorized to access the specified "databaseURL" and is from the correct project.':e+='Make sure the "apiKey" and "databaseURL" properties provided to initializeApp() match the values provided for your app at https://console.firebase.google.com/.',Va(e)}}class ol{constructor(e){this.accessToken=e}getToken(e){return Promise.resolve({accessToken:this.accessToken})}addTokenChangeListener(e){e(this.accessToken)}removeTokenChangeListener(e){}notifyForInvalidToken(){}}ol.OWNER="owner";
|
|
1994
1994
|
/**
|
|
1995
1995
|
* @license
|
|
1996
1996
|
* Copyright 2017 Google LLC
|
|
@@ -2024,7 +2024,7 @@ const rl=/(console\.firebase|firebase-console-\w+\.corp|firebase\.corp)\.google\
|
|
|
2024
2024
|
* See the License for the specific language governing permissions and
|
|
2025
2025
|
* limitations under the License.
|
|
2026
2026
|
*/
|
|
2027
|
-
class cl{constructor(e,t,n,i,o=!1,r="",s=!1,a=!1){this.secure=t,this.namespace=n,this.webSocketOnly=i,this.nodeAdmin=o,this.persistenceKey=r,this.includeNamespaceInQueryParams=s,this.isUsingEmulator=a,this._host=e.toLowerCase(),this._domain=this._host.substr(this._host.indexOf(".")+1),this.internalHost=
|
|
2027
|
+
class cl{constructor(e,t,n,i,o=!1,r="",s=!1,a=!1){this.secure=t,this.namespace=n,this.webSocketOnly=i,this.nodeAdmin=o,this.persistenceKey=r,this.includeNamespaceInQueryParams=s,this.isUsingEmulator=a,this._host=e.toLowerCase(),this._domain=this._host.substr(this._host.indexOf(".")+1),this.internalHost=La.get("host:"+e)||this._host}isCacheableHost(){return"s-"===this.internalHost.substr(0,2)}isCustomHost(){return"firebaseio.com"!==this._domain&&"firebaseio-demo.com"!==this._domain}get host(){return this._host}set host(e){e!==this.internalHost&&(this.internalHost=e,this.isCacheableHost()&&La.set("host:"+this._host,this.internalHost))}toString(){let e=this.toURLString();return this.persistenceKey&&(e+="<"+this.persistenceKey+">"),e}toURLString(){const e=this.secure?"https://":"http://",t=this.includeNamespaceInQueryParams?`?ns=${this.namespace}`:"";return`${e}${this.host}/${t}`}}function dl(e,t,n){let i;if(nt("string"==typeof t,"typeof type must == string"),nt("object"==typeof n,"typeof params must == object"),t===al)i=(e.secure?"wss://":"ws://")+e.internalHost+"/.ws?";else{if(t!==ll)throw new Error("Unknown connection type: "+t);i=(e.secure?"https://":"http://")+e.internalHost+"/.lp?"}(function(e){return e.host!==e.internalHost||e.isCustomHost()||e.includeNamespaceInQueryParams})(e)&&(n.ns=e.namespace);const o=[];return Ja(n,((e,t)=>{o.push(e+"="+t)})),i+o.join("&")}
|
|
2028
2028
|
/**
|
|
2029
2029
|
* @license
|
|
2030
2030
|
* Copyright 2017 Google LLC
|
|
@@ -2040,7 +2040,7 @@ class cl{constructor(e,t,n,i,o=!1,r="",s=!1,a=!1){this.secure=t,this.namespace=n
|
|
|
2040
2040
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2041
2041
|
* See the License for the specific language governing permissions and
|
|
2042
2042
|
* limitations under the License.
|
|
2043
|
-
*/class hl{constructor(){this.counters_={}}incrementCounter(e,t=1){
|
|
2043
|
+
*/class hl{constructor(){this.counters_={}}incrementCounter(e,t=1){Rt(this.counters_,e)||(this.counters_[e]=0),this.counters_[e]+=t}get(){return dt(this.counters_)}}
|
|
2044
2044
|
/**
|
|
2045
2045
|
* @license
|
|
2046
2046
|
* Copyright 2017 Google LLC
|
|
@@ -2089,7 +2089,7 @@ class fl{constructor(e){this.onMessage_=e,this.pendingResponses=[],this.currentR
|
|
|
2089
2089
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2090
2090
|
* See the License for the specific language governing permissions and
|
|
2091
2091
|
* limitations under the License.
|
|
2092
|
-
*/const ml="start";class vl{constructor(e,t,n,i,o,r,s){this.connId=e,this.repoInfo=t,this.applicationId=n,this.appCheckToken=i,this.authToken=o,this.transportSessionId=r,this.lastSessionId=s,this.bytesSent=0,this.bytesReceived=0,this.everConnected_=!1,this.log_=za(e),this.stats_=gl(t),this.urlFn=e=>(this.appCheckToken&&(e[sl]=this.appCheckToken),dl(t,ll,e))}open(e,t){this.curSegmentNum=0,this.onDisconnect_=t,this.myPacketOrderer=new fl(e),this.isClosed_=!1,this.connectTimeoutTimer_=setTimeout((()=>{this.log_("Timed out trying to connect."),this.onClosed_(),this.connectTimeoutTimer_=null}),Math.floor(3e4)),function(e){if("complete"===document.readyState)e();else{let t=!1;const n=function(){document.body?t||(t=!0,e()):setTimeout(n,Math.floor(10))};document.addEventListener?(document.addEventListener("DOMContentLoaded",n,!1),window.addEventListener("load",n,!1)):document.attachEvent&&(document.attachEvent("onreadystatechange",(()=>{"complete"===document.readyState&&n()})),window.attachEvent("onload",n))}}((()=>{if(this.isClosed_)return;this.scriptTagHolder=new bl(((...e)=>{const[t,n,i,o,r]=e;if(this.incrementIncomingBytes_(e),this.scriptTagHolder)if(this.connectTimeoutTimer_&&(clearTimeout(this.connectTimeoutTimer_),this.connectTimeoutTimer_=null),this.everConnected_=!0,t===ml)this.id=n,this.password=i;else{if("close"!==t)throw new Error("Unrecognized command received: "+t);n?(this.scriptTagHolder.sendNewPolls=!1,this.myPacketOrderer.closeAfter(n,(()=>{this.onClosed_()}))):this.onClosed_()}}),((...e)=>{const[t,n]=e;this.incrementIncomingBytes_(e),this.myPacketOrderer.handleResponse(t,n)}),(()=>{this.onClosed_()}),this.urlFn);const e={};e[ml]="t",e.ser=Math.floor(1e8*Math.random()),this.scriptTagHolder.uniqueCallbackIdentifier&&(e.cb=this.scriptTagHolder.uniqueCallbackIdentifier),e.v="5",this.transportSessionId&&(e.s=this.transportSessionId),this.lastSessionId&&(e.ls=this.lastSessionId),this.applicationId&&(e.p=this.applicationId),this.appCheckToken&&(e[sl]=this.appCheckToken),"undefined"!=typeof location&&location.hostname&&rl.test(location.hostname)&&(e.r="f");const t=this.urlFn(e);this.log_("Connecting via long-poll to "+t),this.scriptTagHolder.addTag(t,(()=>{}))}))}start(){this.scriptTagHolder.startLongPoll(this.id,this.password),this.addDisconnectPingFrame(this.id,this.password)}static forceAllow(){vl.forceAllow_=!0}static forceDisallow(){vl.forceDisallow_=!0}static isAvailable(){return!!vl.forceAllow_||!(vl.forceDisallow_||"undefined"==typeof document||null==document.createElement||"object"==typeof window&&window.chrome&&window.chrome.extension&&!/^chrome/.test(window.location.href)||"object"==typeof Windows&&"object"==typeof Windows.UI)}markConnectionHealthy(){}shutdown_(){this.isClosed_=!0,this.scriptTagHolder&&(this.scriptTagHolder.close(),this.scriptTagHolder=null),this.myDisconnFrame&&(document.body.removeChild(this.myDisconnFrame),this.myDisconnFrame=null),this.connectTimeoutTimer_&&(clearTimeout(this.connectTimeoutTimer_),this.connectTimeoutTimer_=null)}onClosed_(){this.isClosed_||(this.log_("Longpoll is closing itself"),this.shutdown_(),this.onDisconnect_&&(this.onDisconnect_(this.everConnected_),this.onDisconnect_=null))}close(){this.isClosed_||(this.log_("Longpoll is being closed."),this.shutdown_())}send(e){const t=
|
|
2092
|
+
*/const ml="start";class vl{constructor(e,t,n,i,o,r,s){this.connId=e,this.repoInfo=t,this.applicationId=n,this.appCheckToken=i,this.authToken=o,this.transportSessionId=r,this.lastSessionId=s,this.bytesSent=0,this.bytesReceived=0,this.everConnected_=!1,this.log_=za(e),this.stats_=gl(t),this.urlFn=e=>(this.appCheckToken&&(e[sl]=this.appCheckToken),dl(t,ll,e))}open(e,t){this.curSegmentNum=0,this.onDisconnect_=t,this.myPacketOrderer=new fl(e),this.isClosed_=!1,this.connectTimeoutTimer_=setTimeout((()=>{this.log_("Timed out trying to connect."),this.onClosed_(),this.connectTimeoutTimer_=null}),Math.floor(3e4)),function(e){if("complete"===document.readyState)e();else{let t=!1;const n=function(){document.body?t||(t=!0,e()):setTimeout(n,Math.floor(10))};document.addEventListener?(document.addEventListener("DOMContentLoaded",n,!1),window.addEventListener("load",n,!1)):document.attachEvent&&(document.attachEvent("onreadystatechange",(()=>{"complete"===document.readyState&&n()})),window.attachEvent("onload",n))}}((()=>{if(this.isClosed_)return;this.scriptTagHolder=new bl(((...e)=>{const[t,n,i,o,r]=e;if(this.incrementIncomingBytes_(e),this.scriptTagHolder)if(this.connectTimeoutTimer_&&(clearTimeout(this.connectTimeoutTimer_),this.connectTimeoutTimer_=null),this.everConnected_=!0,t===ml)this.id=n,this.password=i;else{if("close"!==t)throw new Error("Unrecognized command received: "+t);n?(this.scriptTagHolder.sendNewPolls=!1,this.myPacketOrderer.closeAfter(n,(()=>{this.onClosed_()}))):this.onClosed_()}}),((...e)=>{const[t,n]=e;this.incrementIncomingBytes_(e),this.myPacketOrderer.handleResponse(t,n)}),(()=>{this.onClosed_()}),this.urlFn);const e={};e[ml]="t",e.ser=Math.floor(1e8*Math.random()),this.scriptTagHolder.uniqueCallbackIdentifier&&(e.cb=this.scriptTagHolder.uniqueCallbackIdentifier),e.v="5",this.transportSessionId&&(e.s=this.transportSessionId),this.lastSessionId&&(e.ls=this.lastSessionId),this.applicationId&&(e.p=this.applicationId),this.appCheckToken&&(e[sl]=this.appCheckToken),"undefined"!=typeof location&&location.hostname&&rl.test(location.hostname)&&(e.r="f");const t=this.urlFn(e);this.log_("Connecting via long-poll to "+t),this.scriptTagHolder.addTag(t,(()=>{}))}))}start(){this.scriptTagHolder.startLongPoll(this.id,this.password),this.addDisconnectPingFrame(this.id,this.password)}static forceAllow(){vl.forceAllow_=!0}static forceDisallow(){vl.forceDisallow_=!0}static isAvailable(){return!!vl.forceAllow_||!(vl.forceDisallow_||"undefined"==typeof document||null==document.createElement||"object"==typeof window&&window.chrome&&window.chrome.extension&&!/^chrome/.test(window.location.href)||"object"==typeof Windows&&"object"==typeof Windows.UI)}markConnectionHealthy(){}shutdown_(){this.isClosed_=!0,this.scriptTagHolder&&(this.scriptTagHolder.close(),this.scriptTagHolder=null),this.myDisconnFrame&&(document.body.removeChild(this.myDisconnFrame),this.myDisconnFrame=null),this.connectTimeoutTimer_&&(clearTimeout(this.connectTimeoutTimer_),this.connectTimeoutTimer_=null)}onClosed_(){this.isClosed_||(this.log_("Longpoll is closing itself"),this.shutdown_(),this.onDisconnect_&&(this.onDisconnect_(this.everConnected_),this.onDisconnect_=null))}close(){this.isClosed_||(this.log_("Longpoll is being closed."),this.shutdown_())}send(e){const t=Lt(e);this.bytesSent+=t.length,this.stats_.incrementCounter("bytes_sent",t.length);const n=at(t),i=Ya(n,1840);for(let e=0;e<i.length;e++)this.scriptTagHolder.enqueueSegment(this.curSegmentNum,i.length,i[e]),this.curSegmentNum++}addDisconnectPingFrame(e,t){this.myDisconnFrame=document.createElement("iframe");const n={dframe:"t"};n.id=e,n.pw=t,this.myDisconnFrame.src=this.urlFn(n),this.myDisconnFrame.style.display="none",document.body.appendChild(this.myDisconnFrame)}incrementIncomingBytes_(e){const t=Lt(e).length;this.bytesReceived+=t,this.stats_.incrementCounter("bytes_received",t)}}class bl{constructor(e,t,n,i){this.onDisconnect=n,this.urlFn=i,this.outstandingRequests=new Set,this.pendingSegs=[],this.currentSerial=Math.floor(1e8*Math.random()),this.sendNewPolls=!0;{this.uniqueCallbackIdentifier=Na(),window["pLPCommand"+this.uniqueCallbackIdentifier]=e,window["pRTLPCB"+this.uniqueCallbackIdentifier]=t,this.myIFrame=bl.createIFrame_();let n="";if(this.myIFrame.src&&"javascript:"===this.myIFrame.src.substr(0,11)){n='<script>document.domain="'+document.domain+'";<\/script>'}const i="<html><body>"+n+"</body></html>";try{this.myIFrame.doc.open(),this.myIFrame.doc.write(i),this.myIFrame.doc.close()}catch(e){Fa("frame writing exception"),e.stack&&Fa(e.stack),Fa(e)}}}static createIFrame_(){const e=document.createElement("iframe");if(e.style.display="none",!document.body)throw"Document body has not initialized. Wait to initialize Firebase until after the document is ready.";document.body.appendChild(e);try{e.contentWindow.document||Fa("No IE domain setting required")}catch(t){const n=document.domain;e.src="javascript:void((function(){document.open();document.domain='"+n+"';document.close();})())"}return e.contentDocument?e.doc=e.contentDocument:e.contentWindow?e.doc=e.contentWindow.document:e.document&&(e.doc=e.document),e}close(){this.alive=!1,this.myIFrame&&(this.myIFrame.doc.body.textContent="",setTimeout((()=>{null!==this.myIFrame&&(document.body.removeChild(this.myIFrame),this.myIFrame=null)}),Math.floor(0)));const e=this.onDisconnect;e&&(this.onDisconnect=null,e())}startLongPoll(e,t){for(this.myID=e,this.myPW=t,this.alive=!0;this.newRequest_(););}newRequest_(){if(this.alive&&this.sendNewPolls&&this.outstandingRequests.size<(this.pendingSegs.length>0?2:1)){this.currentSerial++;const e={};e.id=this.myID,e.pw=this.myPW,e.ser=this.currentSerial;let t=this.urlFn(e),n="",i=0;for(;this.pendingSegs.length>0;){if(!(this.pendingSegs[0].d.length+30+n.length<=1870))break;{const e=this.pendingSegs.shift();n=n+"&seg"+i+"="+e.seg+"&ts"+i+"="+e.ts+"&d"+i+"="+e.d,i++}}return t+=n,this.addLongPollTag_(t,this.currentSerial),!0}return!1}enqueueSegment(e,t,n){this.pendingSegs.push({seg:e,ts:t,d:n}),this.alive&&this.newRequest_()}addLongPollTag_(e,t){this.outstandingRequests.add(t);const n=()=>{this.outstandingRequests.delete(t),this.newRequest_()},i=setTimeout(n,Math.floor(25e3));this.addTag(e,(()=>{clearTimeout(i),n()}))}addTag(e,t){setTimeout((()=>{try{if(!this.sendNewPolls)return;const n=this.myIFrame.doc.createElement("script");n.type="text/javascript",n.async=!0,n.src=e,n.onload=n.onreadystatechange=function(){const e=n.readyState;e&&"loaded"!==e&&"complete"!==e||(n.onload=n.onreadystatechange=null,n.parentNode&&n.parentNode.removeChild(n),t())},n.onerror=()=>{Fa("Long-poll script failed to load: "+e),this.sendNewPolls=!1,this.close()},this.myIFrame.doc.body.appendChild(n)}catch(e){}}),Math.floor(1))}}
|
|
2093
2093
|
/**
|
|
2094
2094
|
* @license
|
|
2095
2095
|
* Copyright 2017 Google LLC
|
|
@@ -2105,7 +2105,7 @@ class fl{constructor(e){this.onMessage_=e,this.pendingResponses=[],this.currentR
|
|
|
2105
2105
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2106
2106
|
* See the License for the specific language governing permissions and
|
|
2107
2107
|
* limitations under the License.
|
|
2108
|
-
*/let wl=null;"undefined"!=typeof MozWebSocket?wl=MozWebSocket:"undefined"!=typeof WebSocket&&(wl=WebSocket);class xl{constructor(e,t,n,i,o,r,s){this.connId=e,this.applicationId=n,this.appCheckToken=i,this.authToken=o,this.keepaliveTimer=null,this.frames=null,this.totalFrames=0,this.bytesSent=0,this.bytesReceived=0,this.log_=za(this.connId),this.stats_=gl(t),this.connURL=xl.connectionURL_(t,r,s,i,n),this.nodeAdmin=t.nodeAdmin}static connectionURL_(e,t,n,i,o){const r={v:"5"};return"undefined"!=typeof location&&location.hostname&&rl.test(location.hostname)&&(r.r="f"),t&&(r.s=t),n&&(r.ls=n),i&&(r[sl]=i),o&&(r.p=o),dl(e,al,r)}open(e,t){this.onDisconnect=t,this.onMessage=e,this.log_("Websocket connecting to "+this.connURL),this.everConnected_=!1,
|
|
2108
|
+
*/let wl=null;"undefined"!=typeof MozWebSocket?wl=MozWebSocket:"undefined"!=typeof WebSocket&&(wl=WebSocket);class xl{constructor(e,t,n,i,o,r,s){this.connId=e,this.applicationId=n,this.appCheckToken=i,this.authToken=o,this.keepaliveTimer=null,this.frames=null,this.totalFrames=0,this.bytesSent=0,this.bytesReceived=0,this.log_=za(this.connId),this.stats_=gl(t),this.connURL=xl.connectionURL_(t,r,s,i,n),this.nodeAdmin=t.nodeAdmin}static connectionURL_(e,t,n,i,o){const r={v:"5"};return"undefined"!=typeof location&&location.hostname&&rl.test(location.hostname)&&(r.r="f"),t&&(r.s=t),n&&(r.ls=n),i&&(r[sl]=i),o&&(r.p=o),dl(e,al,r)}open(e,t){this.onDisconnect=t,this.onMessage=e,this.log_("Websocket connecting to "+this.connURL),this.everConnected_=!1,La.set("previous_websocket_failure",!0);try{let e;_t(),this.mySock=new wl(this.connURL,[],e)}catch(e){this.log_("Error instantiating WebSocket.");const t=e.message||e.data;return t&&this.log_(t),void this.onClosed_()}this.mySock.onopen=()=>{this.log_("Websocket connected."),this.everConnected_=!0},this.mySock.onclose=()=>{this.log_("Websocket connection was disconnected."),this.mySock=null,this.onClosed_()},this.mySock.onmessage=e=>{this.handleIncomingFrame(e)},this.mySock.onerror=e=>{this.log_("WebSocket error. Closing connection.");const t=e.message||e.data;t&&this.log_(t),this.onClosed_()}}start(){}static forceDisallow(){xl.forceDisallow_=!0}static isAvailable(){let e=!1;if("undefined"!=typeof navigator&&navigator.userAgent){const t=/Android ([0-9]{0,}\.[0-9]{0,})/,n=navigator.userAgent.match(t);n&&n.length>1&&parseFloat(n[1])<4.4&&(e=!0)}return!e&&null!==wl&&!xl.forceDisallow_}static previouslyFailed(){return La.isInMemoryStorage||!0===La.get("previous_websocket_failure")}markConnectionHealthy(){La.remove("previous_websocket_failure")}appendFrame_(e){if(this.frames.push(e),this.frames.length===this.totalFrames){const e=this.frames.join("");this.frames=null;const t=Et(e);this.onMessage(t)}}handleNewFrameCount_(e){this.totalFrames=e,this.frames=[]}extractFrameCount_(e){if(nt(null===this.frames,"We already have a frame buffer"),e.length<=6){const t=Number(e);if(!isNaN(t))return this.handleNewFrameCount_(t),null}return this.handleNewFrameCount_(1),e}handleIncomingFrame(e){if(null===this.mySock)return;const t=e.data;if(this.bytesReceived+=t.length,this.stats_.incrementCounter("bytes_received",t.length),this.resetKeepAlive(),null!==this.frames)this.appendFrame_(t);else{const e=this.extractFrameCount_(t);null!==e&&this.appendFrame_(e)}}send(e){this.resetKeepAlive();const t=Lt(e);this.bytesSent+=t.length,this.stats_.incrementCounter("bytes_sent",t.length);const n=Ya(t,16384);n.length>1&&this.sendString_(String(n.length));for(let e=0;e<n.length;e++)this.sendString_(n[e])}shutdown_(){this.isClosed_=!0,this.keepaliveTimer&&(clearInterval(this.keepaliveTimer),this.keepaliveTimer=null),this.mySock&&(this.mySock.close(),this.mySock=null)}onClosed_(){this.isClosed_||(this.log_("WebSocket is closing itself"),this.shutdown_(),this.onDisconnect&&(this.onDisconnect(this.everConnected_),this.onDisconnect=null))}close(){this.isClosed_||(this.log_("WebSocket is being closed"),this.shutdown_())}resetKeepAlive(){clearInterval(this.keepaliveTimer),this.keepaliveTimer=setInterval((()=>{this.mySock&&this.sendString_("0"),this.resetKeepAlive()}),Math.floor(45e3))}sendString_(e){try{this.mySock.send(e)}catch(e){this.log_("Exception thrown from WebSocket.send():",e.message||e.data,"Closing connection."),setTimeout(this.onClosed_.bind(this),0)}}}xl.responsesRequiredToBeHealthy=2,xl.healthyTimeout=3e4;
|
|
2109
2109
|
/**
|
|
2110
2110
|
* @license
|
|
2111
2111
|
* Copyright 2017 Google LLC
|
|
@@ -2122,7 +2122,7 @@ class fl{constructor(e){this.onMessage_=e,this.pendingResponses=[],this.currentR
|
|
|
2122
2122
|
* See the License for the specific language governing permissions and
|
|
2123
2123
|
* limitations under the License.
|
|
2124
2124
|
*/
|
|
2125
|
-
class yl{static get ALL_TRANSPORTS(){return[vl,xl]}static get IS_TRANSPORT_INITIALIZED(){return this.globalTransportInitialized_}constructor(e){this.initTransports_(e)}initTransports_(e){const t=xl&&xl.isAvailable();let n=t&&!xl.previouslyFailed();if(e.webSocketOnly&&(t||
|
|
2125
|
+
class yl{static get ALL_TRANSPORTS(){return[vl,xl]}static get IS_TRANSPORT_INITIALIZED(){return this.globalTransportInitialized_}constructor(e){this.initTransports_(e)}initTransports_(e){const t=xl&&xl.isAvailable();let n=t&&!xl.previouslyFailed();if(e.webSocketOnly&&(t||Va("wss:// URL used, but browser isn't known to support websockets. Trying anyway."),n=!0),n)this.transports_=[xl];else{const e=this.transports_=[];for(const t of yl.ALL_TRANSPORTS)t&&t.isAvailable()&&e.push(t);yl.globalTransportInitialized_=!0}}initialTransport(){if(this.transports_.length>0)return this.transports_[0];throw new Error("No transports available")}upgradeTransport(){return this.transports_.length>1?this.transports_[1]:null}}yl.globalTransportInitialized_=!1;class _l{constructor(e,t,n,i,o,r,s,a,l,c){this.id=e,this.repoInfo_=t,this.applicationId_=n,this.appCheckToken_=i,this.authToken_=o,this.onMessage_=r,this.onReady_=s,this.onDisconnect_=a,this.onKill_=l,this.lastSessionId=c,this.connectionCount=0,this.pendingDataMessages=[],this.state_=0,this.log_=za("c:"+this.id+":"),this.transportManager_=new yl(t),this.log_("Connection created"),this.start_()}start_(){const e=this.transportManager_.initialTransport();this.conn_=new e(this.nextTransportId_(),this.repoInfo_,this.applicationId_,this.appCheckToken_,this.authToken_,null,this.lastSessionId),this.primaryResponsesRequired_=e.responsesRequiredToBeHealthy||0;const t=this.connReceiver_(this.conn_),n=this.disconnReceiver_(this.conn_);this.tx_=this.conn_,this.rx_=this.conn_,this.secondaryConn_=null,this.isHealthy_=!1,setTimeout((()=>{this.conn_&&this.conn_.open(t,n)}),Math.floor(0));const i=e.healthyTimeout||0;i>0&&(this.healthyTimeout_=tl((()=>{this.healthyTimeout_=null,this.isHealthy_||(this.conn_&&this.conn_.bytesReceived>102400?(this.log_("Connection exceeded healthy timeout but has received "+this.conn_.bytesReceived+" bytes. Marking connection healthy."),this.isHealthy_=!0,this.conn_.markConnectionHealthy()):this.conn_&&this.conn_.bytesSent>10240?this.log_("Connection exceeded healthy timeout but has sent "+this.conn_.bytesSent+" bytes. Leaving connection alive."):(this.log_("Closing unhealthy connection after timeout."),this.close()))}),Math.floor(i)))}nextTransportId_(){return"c:"+this.id+":"+this.connectionCount++}disconnReceiver_(e){return t=>{e===this.conn_?this.onConnectionLost_(t):e===this.secondaryConn_?(this.log_("Secondary connection lost."),this.onSecondaryConnectionLost_()):this.log_("closing an old connection")}}connReceiver_(e){return t=>{2!==this.state_&&(e===this.rx_?this.onPrimaryMessageReceived_(t):e===this.secondaryConn_?this.onSecondaryMessageReceived_(t):this.log_("message on old connection"))}}sendRequest(e){const t={t:"d",d:e};this.sendData_(t)}tryCleanupConnection(){this.tx_===this.secondaryConn_&&this.rx_===this.secondaryConn_&&(this.log_("cleaning up and promoting a connection: "+this.secondaryConn_.connId),this.conn_=this.secondaryConn_,this.secondaryConn_=null)}onSecondaryControl_(e){if("t"in e){const t=e.t;"a"===t?this.upgradeIfSecondaryHealthy_():"r"===t?(this.log_("Got a reset on secondary, closing it"),this.secondaryConn_.close(),this.tx_!==this.secondaryConn_&&this.rx_!==this.secondaryConn_||this.close()):"o"===t&&(this.log_("got pong on secondary."),this.secondaryResponsesRequired_--,this.upgradeIfSecondaryHealthy_())}}onSecondaryMessageReceived_(e){const t=Ga("t",e),n=Ga("d",e);if("c"===t)this.onSecondaryControl_(n);else{if("d"!==t)throw new Error("Unknown protocol layer: "+t);this.pendingDataMessages.push(n)}}upgradeIfSecondaryHealthy_(){this.secondaryResponsesRequired_<=0?(this.log_("Secondary connection is healthy."),this.isHealthy_=!0,this.secondaryConn_.markConnectionHealthy(),this.proceedWithUpgrade_()):(this.log_("sending ping on secondary."),this.secondaryConn_.send({t:"c",d:{t:"p",d:{}}}))}proceedWithUpgrade_(){this.secondaryConn_.start(),this.log_("sending client ack on secondary"),this.secondaryConn_.send({t:"c",d:{t:"a",d:{}}}),this.log_("Ending transmission on primary"),this.conn_.send({t:"c",d:{t:"n",d:{}}}),this.tx_=this.secondaryConn_,this.tryCleanupConnection()}onPrimaryMessageReceived_(e){const t=Ga("t",e),n=Ga("d",e);"c"===t?this.onControl_(n):"d"===t&&this.onDataMessage_(n)}onDataMessage_(e){this.onPrimaryResponse_(),this.onMessage_(e)}onPrimaryResponse_(){this.isHealthy_||(this.primaryResponsesRequired_--,this.primaryResponsesRequired_<=0&&(this.log_("Primary connection is healthy."),this.isHealthy_=!0,this.conn_.markConnectionHealthy()))}onControl_(e){const t=Ga("t",e);if("d"in e){const n=e.d;if("h"===t){const e=Object.assign({},n);this.repoInfo_.isUsingEmulator&&(e.h=this.repoInfo_.host),this.onHandshake_(e)}else if("n"===t){this.log_("recvd end transmission on primary"),this.rx_=this.secondaryConn_;for(let e=0;e<this.pendingDataMessages.length;++e)this.onDataMessage_(this.pendingDataMessages[e]);this.pendingDataMessages=[],this.tryCleanupConnection()}else"s"===t?this.onConnectionShutdown_(n):"r"===t?this.onReset_(n):"e"===t?Ua("Server Error: "+n):"o"===t?(this.log_("got pong on primary."),this.onPrimaryResponse_(),this.sendPingOnPrimaryIfNecessary_()):Ua("Unknown control packet command: "+t)}}onHandshake_(e){const t=e.ts,n=e.v,i=e.h;this.sessionId=e.s,this.repoInfo_.host=i,0===this.state_&&(this.conn_.start(),this.onConnectionEstablished_(this.conn_,t),"5"!==n&&Va("Protocol version mismatch detected"),this.tryStartUpgrade_())}tryStartUpgrade_(){const e=this.transportManager_.upgradeTransport();e&&this.startUpgrade_(e)}startUpgrade_(e){this.secondaryConn_=new e(this.nextTransportId_(),this.repoInfo_,this.applicationId_,this.appCheckToken_,this.authToken_,this.sessionId),this.secondaryResponsesRequired_=e.responsesRequiredToBeHealthy||0;const t=this.connReceiver_(this.secondaryConn_),n=this.disconnReceiver_(this.secondaryConn_);this.secondaryConn_.open(t,n),tl((()=>{this.secondaryConn_&&(this.log_("Timed out trying to upgrade."),this.secondaryConn_.close())}),Math.floor(6e4))}onReset_(e){this.log_("Reset packet received. New host: "+e),this.repoInfo_.host=e,1===this.state_?this.close():(this.closeConnections_(),this.start_())}onConnectionEstablished_(e,t){this.log_("Realtime connection established."),this.conn_=e,this.state_=1,this.onReady_&&(this.onReady_(t,this.sessionId),this.onReady_=null),0===this.primaryResponsesRequired_?(this.log_("Primary connection is healthy."),this.isHealthy_=!0):tl((()=>{this.sendPingOnPrimaryIfNecessary_()}),Math.floor(5e3))}sendPingOnPrimaryIfNecessary_(){this.isHealthy_||1!==this.state_||(this.log_("sending ping on primary."),this.sendData_({t:"c",d:{t:"p",d:{}}}))}onSecondaryConnectionLost_(){const e=this.secondaryConn_;this.secondaryConn_=null,this.tx_!==e&&this.rx_!==e||this.close()}onConnectionLost_(e){this.conn_=null,e||0!==this.state_?1===this.state_&&this.log_("Realtime connection lost."):(this.log_("Realtime connection failed."),this.repoInfo_.isCacheableHost()&&(La.remove("host:"+this.repoInfo_.host),this.repoInfo_.internalHost=this.repoInfo_.host)),this.close()}onConnectionShutdown_(e){this.log_("Connection shutdown command received. Shutting down..."),this.onKill_&&(this.onKill_(e),this.onKill_=null),this.onDisconnect_=null,this.close()}sendData_(e){if(1!==this.state_)throw"Connection is not connected";this.tx_.send(e)}close(){2!==this.state_&&(this.log_("Closing realtime connection."),this.state_=2,this.closeConnections_(),this.onDisconnect_&&(this.onDisconnect_(),this.onDisconnect_=null))}closeConnections_(){this.log_("Shutting down all connections"),this.conn_&&(this.conn_.close(),this.conn_=null),this.secondaryConn_&&(this.secondaryConn_.close(),this.secondaryConn_=null),this.healthyTimeout_&&(clearTimeout(this.healthyTimeout_),this.healthyTimeout_=null)}}
|
|
2126
2126
|
/**
|
|
2127
2127
|
* @license
|
|
2128
2128
|
* Copyright 2017 Google LLC
|
|
@@ -2186,7 +2186,7 @@ class yl{static get ALL_TRANSPORTS(){return[vl,xl]}static get IS_TRANSPORT_INITI
|
|
|
2186
2186
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2187
2187
|
* See the License for the specific language governing permissions and
|
|
2188
2188
|
* limitations under the License.
|
|
2189
|
-
*/class Sl{constructor(e,t){if(void 0===t){this.pieces_=e.split("/");let t=0;for(let e=0;e<this.pieces_.length;e++)this.pieces_[e].length>0&&(this.pieces_[t]=this.pieces_[e],t++);this.pieces_.length=t,this.pieceNum_=0}else this.pieces_=e,this.pieceNum_=t}toString(){let e="";for(let t=this.pieceNum_;t<this.pieces_.length;t++)""!==this.pieces_[t]&&(e+="/"+this.pieces_[t]);return e||"/"}}function Tl(){return new Sl("")}function El(e){return e.pieceNum_>=e.pieces_.length?null:e.pieces_[e.pieceNum_]}function
|
|
2189
|
+
*/class Sl{constructor(e,t){if(void 0===t){this.pieces_=e.split("/");let t=0;for(let e=0;e<this.pieces_.length;e++)this.pieces_[e].length>0&&(this.pieces_[t]=this.pieces_[e],t++);this.pieces_.length=t,this.pieceNum_=0}else this.pieces_=e,this.pieceNum_=t}toString(){let e="";for(let t=this.pieceNum_;t<this.pieces_.length;t++)""!==this.pieces_[t]&&(e+="/"+this.pieces_[t]);return e||"/"}}function Tl(){return new Sl("")}function El(e){return e.pieceNum_>=e.pieces_.length?null:e.pieces_[e.pieceNum_]}function Ll(e){return e.pieces_.length-e.pieceNum_}function Pl(e){let t=e.pieceNum_;return t<e.pieces_.length&&t++,new Sl(e.pieces_,t)}function Rl(e){return e.pieceNum_<e.pieces_.length?e.pieces_[e.pieces_.length-1]:null}function Nl(e,t=0){return e.pieces_.slice(e.pieceNum_+t)}function Al(e){if(e.pieceNum_>=e.pieces_.length)return null;const t=[];for(let n=e.pieceNum_;n<e.pieces_.length-1;n++)t.push(e.pieces_[n]);return new Sl(t,0)}function Dl(e,t){const n=[];for(let t=e.pieceNum_;t<e.pieces_.length;t++)n.push(e.pieces_[t]);if(t instanceof Sl)for(let e=t.pieceNum_;e<t.pieces_.length;e++)n.push(t.pieces_[e]);else{const e=t.split("/");for(let t=0;t<e.length;t++)e[t].length>0&&n.push(e[t])}return new Sl(n,0)}function Ol(e){return e.pieceNum_>=e.pieces_.length}function Ml(e,t){const n=El(e),i=El(t);if(null===n)return t;if(n===i)return Ml(Pl(e),Pl(t));throw new Error("INTERNAL ERROR: innerPath ("+t+") is not within outerPath ("+e+")")}function Fl(e,t){const n=Nl(e,0),i=Nl(t,0);for(let e=0;e<n.length&&e<i.length;e++){const t=$a(n[e],i[e]);if(0!==t)return t}return n.length===i.length?0:n.length<i.length?-1:1}function zl(e,t){if(Ll(e)!==Ll(t))return!1;for(let n=e.pieceNum_,i=t.pieceNum_;n<=e.pieces_.length;n++,i++)if(e.pieces_[n]!==t.pieces_[i])return!1;return!0}function Ul(e,t){let n=e.pieceNum_,i=t.pieceNum_;if(Ll(e)>Ll(t))return!1;for(;n<e.pieces_.length;){if(e.pieces_[n]!==t.pieces_[i])return!1;++n,++i}return!0}class jl{constructor(e,t){this.errorPrefix_=t,this.parts_=Nl(e,0),this.byteLength_=Math.max(1,this.parts_.length);for(let e=0;e<this.parts_.length;e++)this.byteLength_+=qt(this.parts_[e]);Vl(this)}}function Vl(e){if(e.byteLength_>768)throw new Error(e.errorPrefix_+"has a key path longer than 768 bytes ("+e.byteLength_+").");if(e.parts_.length>32)throw new Error(e.errorPrefix_+"path specified exceeds the maximum depth that can be written (32) or object contains a cycle "+ql(e))}function ql(e){return 0===e.parts_.length?"":"in property '"+e.parts_.join(".")+"'"}
|
|
2190
2190
|
/**
|
|
2191
2191
|
* @license
|
|
2192
2192
|
* Copyright 2017 Google LLC
|
|
@@ -2202,7 +2202,7 @@ class yl{static get ALL_TRANSPORTS(){return[vl,xl]}static get IS_TRANSPORT_INITI
|
|
|
2202
2202
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2203
2203
|
* See the License for the specific language governing permissions and
|
|
2204
2204
|
* limitations under the License.
|
|
2205
|
-
*/class
|
|
2205
|
+
*/class Bl extends Cl{static getInstance(){return new Bl}constructor(){let e,t;super(["visible"]),"undefined"!=typeof document&&void 0!==document.addEventListener&&(void 0!==document.hidden?(t="visibilitychange",e="hidden"):void 0!==document.mozHidden?(t="mozvisibilitychange",e="mozHidden"):void 0!==document.msHidden?(t="msvisibilitychange",e="msHidden"):void 0!==document.webkitHidden&&(t="webkitvisibilitychange",e="webkitHidden")),this.visible_=!0,t&&document.addEventListener(t,(()=>{const t=!document[e];t!==this.visible_&&(this.visible_=t,this.trigger("visible",t))}),!1)}getInitialEvent(e){return nt("visible"===e,"Unknown event type: "+e),[this.visible_]}}
|
|
2206
2206
|
/**
|
|
2207
2207
|
* @license
|
|
2208
2208
|
* Copyright 2017 Google LLC
|
|
@@ -2218,7 +2218,7 @@ class yl{static get ALL_TRANSPORTS(){return[vl,xl]}static get IS_TRANSPORT_INITI
|
|
|
2218
2218
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2219
2219
|
* See the License for the specific language governing permissions and
|
|
2220
2220
|
* limitations under the License.
|
|
2221
|
-
*/const Hl=1e3;class $l extends kl{constructor(e,t,n,i,o,r,s,a){if(super(),this.repoInfo_=e,this.applicationId_=t,this.onDataUpdate_=n,this.onConnectStatus_=i,this.onServerInfoUpdate_=o,this.authTokenProvider_=r,this.appCheckTokenProvider_=s,this.authOverride_=a,this.id=$l.nextPersistentConnectionId_++,this.log_=za("p:"+this.id+":"),this.interruptReasons_={},this.listens=new Map,this.outstandingPuts_=[],this.outstandingGets_=[],this.outstandingPutCount_=0,this.outstandingGetCount_=0,this.onDisconnectRequestQueue_=[],this.connected_=!1,this.reconnectDelay_=Hl,this.maxReconnectDelay_=3e5,this.securityDebugCallback_=null,this.lastSessionId=null,this.establishConnectionTimer_=null,this.visible_=!1,this.requestCBHash_={},this.requestNumber_=0,this.realtime_=null,this.authToken_=null,this.appCheckToken_=null,this.forceTokenRefresh_=!1,this.invalidAuthTokenCount_=0,this.invalidAppCheckTokenCount_=0,this.firstConnection_=!0,this.lastConnectionAttemptTime_=null,this.lastConnectionEstablishedTime_=null,a&&!_t())throw new Error("Auth override specified in options, but not supported on non Node.js platforms");Vl.getInstance().on("visible",this.onVisible_,this),-1===e.host.indexOf("fblocal")&&Il.getInstance().on("online",this.onOnline_,this)}sendRequest(e,t,n){const i=++this.requestNumber_,o={r:i,a:e,b:t};this.log_(Pt(o)),nt(this.connected_,"sendRequest call when we're not connected not allowed."),this.realtime_.sendRequest(o),n&&(this.requestCBHash_[i]=n)}get(e){this.initConnection_();const t=new vt,n={action:"g",request:{p:e._path.toString(),q:e._queryObject},onComplete:e=>{const n=e.d;"ok"===e.s?t.resolve(n):t.reject(n)}};this.outstandingGets_.push(n),this.outstandingGetCount_++;const i=this.outstandingGets_.length-1;return this.connected_&&this.sendGet_(i),t.promise}listen(e,t,n,i){this.initConnection_();const o=e._queryIdentifier,r=e._path.toString();this.log_("Listen called for "+r+" "+o),this.listens.has(r)||this.listens.set(r,new Map),nt(e._queryParams.isDefault()||!e._queryParams.loadsAllData(),"listen() called for non-default but complete query"),nt(!this.listens.get(r).has(o),"listen() called twice for same path/queryId.");const s={onComplete:i,hashFn:t,query:e,tag:n};this.listens.get(r).set(o,s),this.connected_&&this.sendListen_(s)}sendGet_(e){const t=this.outstandingGets_[e];this.sendRequest("g",t.request,(n=>{delete this.outstandingGets_[e],this.outstandingGetCount_--,0===this.outstandingGetCount_&&(this.outstandingGets_=[]),t.onComplete&&t.onComplete(n)}))}sendListen_(e){const t=e.query,n=t._path.toString(),i=t._queryIdentifier;this.log_("Listen on "+n+" for "+i);const o={p:n};e.tag&&(o.q=t._queryObject,o.t=e.tag),o.h=e.hashFn(),this.sendRequest("q",o,(o=>{const r=o.d,s=o.s;$l.warnOnListenWarnings_(r,t);(this.listens.get(n)&&this.listens.get(n).get(i))===e&&(this.log_("listen response",o),"ok"!==s&&this.removeListen_(n,i),e.onComplete&&e.onComplete(s,r))}))}static warnOnListenWarnings_(e,t){if(e&&"object"==typeof e&&Lt(e,"w")){const n=Nt(e,"w");if(Array.isArray(n)&&~n.indexOf("no_index")){const e='".indexOn": "'+t._queryParams.getIndex().toString()+'"',n=t._path.toString();qa(`Using an unspecified index. Your data will be downloaded and filtered on the client. Consider adding ${e} at ${n} to your security rules for better performance.`)}}}refreshAuthToken(e){this.authToken_=e,this.log_("Auth token refreshed"),this.authToken_?this.tryAuth():this.connected_&&this.sendRequest("unauth",{},(()=>{})),this.reduceReconnectDelayIfAdminCredential_(e)}reduceReconnectDelayIfAdminCredential_(e){(e&&40===e.length||function(e){const t=Rt(e).claims;return"object"==typeof t&&!0===t.admin}(e))&&(this.log_("Admin auth credential detected. Reducing max reconnect time."),this.maxReconnectDelay_=3e4)}refreshAppCheckToken(e){this.appCheckToken_=e,this.log_("App check token refreshed"),this.appCheckToken_?this.tryAppCheck():this.connected_&&this.sendRequest("unappeck",{},(()=>{}))}tryAuth(){if(this.connected_&&this.authToken_){const e=this.authToken_,t=function(e){const t=Rt(e).claims;return!!t&&"object"==typeof t&&t.hasOwnProperty("iat")}(e)?"auth":"gauth",n={cred:e};null===this.authOverride_?n.noauth=!0:"object"==typeof this.authOverride_&&(n.authvar=this.authOverride_),this.sendRequest(t,n,(t=>{const n=t.s,i=t.d||"error";this.authToken_===e&&("ok"===n?this.invalidAuthTokenCount_=0:this.onAuthRevoked_(n,i))}))}}tryAppCheck(){this.connected_&&this.appCheckToken_&&this.sendRequest("appcheck",{token:this.appCheckToken_},(e=>{const t=e.s,n=e.d||"error";"ok"===t?this.invalidAppCheckTokenCount_=0:this.onAppCheckRevoked_(t,n)}))}unlisten(e,t){const n=e._path.toString(),i=e._queryIdentifier;this.log_("Unlisten called for "+n+" "+i),nt(e._queryParams.isDefault()||!e._queryParams.loadsAllData(),"unlisten() called for non-default but complete query");this.removeListen_(n,i)&&this.connected_&&this.sendUnlisten_(n,i,e._queryObject,t)}sendUnlisten_(e,t,n,i){this.log_("Unlisten on "+e+" for "+t);const o={p:e};i&&(o.q=n,o.t=i),this.sendRequest("n",o)}onDisconnectPut(e,t,n){this.initConnection_(),this.connected_?this.sendOnDisconnect_("o",e,t,n):this.onDisconnectRequestQueue_.push({pathString:e,action:"o",data:t,onComplete:n})}onDisconnectMerge(e,t,n){this.initConnection_(),this.connected_?this.sendOnDisconnect_("om",e,t,n):this.onDisconnectRequestQueue_.push({pathString:e,action:"om",data:t,onComplete:n})}onDisconnectCancel(e,t){this.initConnection_(),this.connected_?this.sendOnDisconnect_("oc",e,null,t):this.onDisconnectRequestQueue_.push({pathString:e,action:"oc",data:null,onComplete:t})}sendOnDisconnect_(e,t,n,i){const o={p:t,d:n};this.log_("onDisconnect "+e,o),this.sendRequest(e,o,(e=>{i&&setTimeout((()=>{i(e.s,e.d)}),Math.floor(0))}))}put(e,t,n,i){this.putInternal("p",e,t,n,i)}merge(e,t,n,i){this.putInternal("m",e,t,n,i)}putInternal(e,t,n,i,o){this.initConnection_();const r={p:t,d:n};void 0!==o&&(r.h=o),this.outstandingPuts_.push({action:e,request:r,onComplete:i}),this.outstandingPutCount_++;const s=this.outstandingPuts_.length-1;this.connected_?this.sendPut_(s):this.log_("Buffering put: "+t)}sendPut_(e){const t=this.outstandingPuts_[e].action,n=this.outstandingPuts_[e].request,i=this.outstandingPuts_[e].onComplete;this.outstandingPuts_[e].queued=this.connected_,this.sendRequest(t,n,(n=>{this.log_(t+" response",n),delete this.outstandingPuts_[e],this.outstandingPutCount_--,0===this.outstandingPutCount_&&(this.outstandingPuts_=[]),i&&i(n.s,n.d)}))}reportStats(e){if(this.connected_){const t={c:e};this.log_("reportStats",t),this.sendRequest("s",t,(e=>{if("ok"!==e.s){const t=e.d;this.log_("reportStats","Error sending stats: "+t)}}))}}onDataMessage_(e){if("r"in e){this.log_("from server: "+Pt(e));const t=e.r,n=this.requestCBHash_[t];n&&(delete this.requestCBHash_[t],n(e.b))}else{if("error"in e)throw"A server-side error has occurred: "+e.error;"a"in e&&this.onDataPush_(e.a,e.b)}}onDataPush_(e,t){this.log_("handleServerMessage",e,t),"d"===e?this.onDataUpdate_(t.p,t.d,!1,t.t):"m"===e?this.onDataUpdate_(t.p,t.d,!0,t.t):"c"===e?this.onListenRevoked_(t.p,t.q):"ac"===e?this.onAuthRevoked_(t.s,t.d):"apc"===e?this.onAppCheckRevoked_(t.s,t.d):"sd"===e?this.onSecurityDebugPacket_(t):Ua("Unrecognized action received from server: "+Pt(e)+"\nAre you using the latest client?")}onReady_(e,t){this.log_("connection ready"),this.connected_=!0,this.lastConnectionEstablishedTime_=(new Date).getTime(),this.handleTimestamp_(e),this.lastSessionId=t,this.firstConnection_&&this.sendConnectStats_(),this.restoreState_(),this.firstConnection_=!1,this.onConnectStatus_(!0)}scheduleConnect_(e){nt(!this.realtime_,"Scheduling a connect when we're already connected/ing?"),this.establishConnectionTimer_&&clearTimeout(this.establishConnectionTimer_),this.establishConnectionTimer_=setTimeout((()=>{this.establishConnectionTimer_=null,this.establishConnection_()}),Math.floor(e))}initConnection_(){!this.realtime_&&this.firstConnection_&&this.scheduleConnect_(0)}onVisible_(e){e&&!this.visible_&&this.reconnectDelay_===this.maxReconnectDelay_&&(this.log_("Window became visible. Reducing delay."),this.reconnectDelay_=Hl,this.realtime_||this.scheduleConnect_(0)),this.visible_=e}onOnline_(e){e?(this.log_("Browser went online."),this.reconnectDelay_=Hl,this.realtime_||this.scheduleConnect_(0)):(this.log_("Browser went offline. Killing connection."),this.realtime_&&this.realtime_.close())}onRealtimeDisconnect_(){if(this.log_("data client disconnected"),this.connected_=!1,this.realtime_=null,this.cancelSentTransactions_(),this.requestCBHash_={},this.shouldReconnect_()){if(this.visible_){if(this.lastConnectionEstablishedTime_){(new Date).getTime()-this.lastConnectionEstablishedTime_>3e4&&(this.reconnectDelay_=Hl),this.lastConnectionEstablishedTime_=null}}else this.log_("Window isn't visible. Delaying reconnect."),this.reconnectDelay_=this.maxReconnectDelay_,this.lastConnectionAttemptTime_=(new Date).getTime();const e=(new Date).getTime()-this.lastConnectionAttemptTime_;let t=Math.max(0,this.reconnectDelay_-e);t=Math.random()*t,this.log_("Trying to reconnect in "+t+"ms"),this.scheduleConnect_(t),this.reconnectDelay_=Math.min(this.maxReconnectDelay_,1.3*this.reconnectDelay_)}this.onConnectStatus_(!1)}async establishConnection_(){if(this.shouldReconnect_()){this.log_("Making a connection attempt"),this.lastConnectionAttemptTime_=(new Date).getTime(),this.lastConnectionEstablishedTime_=null;const e=this.onDataMessage_.bind(this),t=this.onReady_.bind(this),n=this.onRealtimeDisconnect_.bind(this),i=this.id+":"+$l.nextConnectionId_++,o=this.lastSessionId;let r=!1,s=null;const a=function(){s?s.close():(r=!0,n())},l=function(e){nt(s,"sendRequest call when we're not connected not allowed."),s.sendRequest(e)};this.realtime_={close:a,sendRequest:l};const c=this.forceTokenRefresh_;this.forceTokenRefresh_=!1;try{const[a,l]=await Promise.all([this.authTokenProvider_.getToken(c),this.appCheckTokenProvider_.getToken(c)]);r?Fa("getToken() completed but was canceled"):(Fa("getToken() completed. Creating connection."),this.authToken_=a&&a.accessToken,this.appCheckToken_=l&&l.token,s=new _l(i,this.repoInfo_,this.applicationId_,this.appCheckToken_,this.authToken_,e,t,n,(e=>{qa(e+" ("+this.repoInfo_.toString()+")"),this.interrupt("server_kill")}),o))}catch(e){this.log_("Failed to get token: "+e),r||(this.repoInfo_.nodeAdmin&&qa(e),a())}}}interrupt(e){Fa("Interrupting connection for reason: "+e),this.interruptReasons_[e]=!0,this.realtime_?this.realtime_.close():(this.establishConnectionTimer_&&(clearTimeout(this.establishConnectionTimer_),this.establishConnectionTimer_=null),this.connected_&&this.onRealtimeDisconnect_())}resume(e){Fa("Resuming connection for reason: "+e),delete this.interruptReasons_[e],Dt(this.interruptReasons_)&&(this.reconnectDelay_=Hl,this.realtime_||this.scheduleConnect_(0))}handleTimestamp_(e){const t=e-(new Date).getTime();this.onServerInfoUpdate_({serverTimeOffset:t})}cancelSentTransactions_(){for(let e=0;e<this.outstandingPuts_.length;e++){const t=this.outstandingPuts_[e];t&&"h"in t.request&&t.queued&&(t.onComplete&&t.onComplete("disconnect"),delete this.outstandingPuts_[e],this.outstandingPutCount_--)}0===this.outstandingPutCount_&&(this.outstandingPuts_=[])}onListenRevoked_(e,t){let n;n=t?t.map((e=>Ka(e))).join("$"):"default";const i=this.removeListen_(e,n);i&&i.onComplete&&i.onComplete("permission_denied")}removeListen_(e,t){const n=new Sl(e).toString();let i;if(this.listens.has(n)){const e=this.listens.get(n);i=e.get(t),e.delete(t),0===e.size&&this.listens.delete(n)}else i=void 0;return i}onAuthRevoked_(e,t){Fa("Auth token revoked: "+e+"/"+t),this.authToken_=null,this.forceTokenRefresh_=!0,this.realtime_.close(),"invalid_token"!==e&&"permission_denied"!==e||(this.invalidAuthTokenCount_++,this.invalidAuthTokenCount_>=3&&(this.reconnectDelay_=3e4,this.authTokenProvider_.notifyForInvalidToken()))}onAppCheckRevoked_(e,t){Fa("App check token revoked: "+e+"/"+t),this.appCheckToken_=null,this.forceTokenRefresh_=!0,"invalid_token"!==e&&"permission_denied"!==e||(this.invalidAppCheckTokenCount_++,this.invalidAppCheckTokenCount_>=3&&this.appCheckTokenProvider_.notifyForInvalidToken())}onSecurityDebugPacket_(e){this.securityDebugCallback_?this.securityDebugCallback_(e):"msg"in e&&console.log("FIREBASE: "+e.msg.replace("\n","\nFIREBASE: "))}restoreState_(){this.tryAuth(),this.tryAppCheck();for(const e of this.listens.values())for(const t of e.values())this.sendListen_(t);for(let e=0;e<this.outstandingPuts_.length;e++)this.outstandingPuts_[e]&&this.sendPut_(e);for(;this.onDisconnectRequestQueue_.length;){const e=this.onDisconnectRequestQueue_.shift();this.sendOnDisconnect_(e.action,e.pathString,e.data,e.onComplete)}for(let e=0;e<this.outstandingGets_.length;e++)this.outstandingGets_[e]&&this.sendGet_(e)}sendConnectStats_(){const e={};e["sdk.js."+Ia.replace(/\./g,"-")]=1,wt()?e["framework.cordova"]=1:yt()&&(e["framework.reactnative"]=1),this.reportStats(e)}shouldReconnect_(){const e=Il.getInstance().currentlyOnline();return Dt(this.interruptReasons_)&&e}}$l.nextPersistentConnectionId_=0,$l.nextConnectionId_=0;
|
|
2221
|
+
*/const Hl=1e3;class $l extends kl{constructor(e,t,n,i,o,r,s,a){if(super(),this.repoInfo_=e,this.applicationId_=t,this.onDataUpdate_=n,this.onConnectStatus_=i,this.onServerInfoUpdate_=o,this.authTokenProvider_=r,this.appCheckTokenProvider_=s,this.authOverride_=a,this.id=$l.nextPersistentConnectionId_++,this.log_=za("p:"+this.id+":"),this.interruptReasons_={},this.listens=new Map,this.outstandingPuts_=[],this.outstandingGets_=[],this.outstandingPutCount_=0,this.outstandingGetCount_=0,this.onDisconnectRequestQueue_=[],this.connected_=!1,this.reconnectDelay_=Hl,this.maxReconnectDelay_=3e5,this.securityDebugCallback_=null,this.lastSessionId=null,this.establishConnectionTimer_=null,this.visible_=!1,this.requestCBHash_={},this.requestNumber_=0,this.realtime_=null,this.authToken_=null,this.appCheckToken_=null,this.forceTokenRefresh_=!1,this.invalidAuthTokenCount_=0,this.invalidAppCheckTokenCount_=0,this.firstConnection_=!0,this.lastConnectionAttemptTime_=null,this.lastConnectionEstablishedTime_=null,a&&!_t())throw new Error("Auth override specified in options, but not supported on non Node.js platforms");Bl.getInstance().on("visible",this.onVisible_,this),-1===e.host.indexOf("fblocal")&&Il.getInstance().on("online",this.onOnline_,this)}sendRequest(e,t,n){const i=++this.requestNumber_,o={r:i,a:e,b:t};this.log_(Lt(o)),nt(this.connected_,"sendRequest call when we're not connected not allowed."),this.realtime_.sendRequest(o),n&&(this.requestCBHash_[i]=n)}get(e){this.initConnection_();const t=new vt,n={action:"g",request:{p:e._path.toString(),q:e._queryObject},onComplete:e=>{const n=e.d;"ok"===e.s?t.resolve(n):t.reject(n)}};this.outstandingGets_.push(n),this.outstandingGetCount_++;const i=this.outstandingGets_.length-1;return this.connected_&&this.sendGet_(i),t.promise}listen(e,t,n,i){this.initConnection_();const o=e._queryIdentifier,r=e._path.toString();this.log_("Listen called for "+r+" "+o),this.listens.has(r)||this.listens.set(r,new Map),nt(e._queryParams.isDefault()||!e._queryParams.loadsAllData(),"listen() called for non-default but complete query"),nt(!this.listens.get(r).has(o),"listen() called twice for same path/queryId.");const s={onComplete:i,hashFn:t,query:e,tag:n};this.listens.get(r).set(o,s),this.connected_&&this.sendListen_(s)}sendGet_(e){const t=this.outstandingGets_[e];this.sendRequest("g",t.request,(n=>{delete this.outstandingGets_[e],this.outstandingGetCount_--,0===this.outstandingGetCount_&&(this.outstandingGets_=[]),t.onComplete&&t.onComplete(n)}))}sendListen_(e){const t=e.query,n=t._path.toString(),i=t._queryIdentifier;this.log_("Listen on "+n+" for "+i);const o={p:n};e.tag&&(o.q=t._queryObject,o.t=e.tag),o.h=e.hashFn(),this.sendRequest("q",o,(o=>{const r=o.d,s=o.s;$l.warnOnListenWarnings_(r,t);(this.listens.get(n)&&this.listens.get(n).get(i))===e&&(this.log_("listen response",o),"ok"!==s&&this.removeListen_(n,i),e.onComplete&&e.onComplete(s,r))}))}static warnOnListenWarnings_(e,t){if(e&&"object"==typeof e&&Rt(e,"w")){const n=Nt(e,"w");if(Array.isArray(n)&&~n.indexOf("no_index")){const e='".indexOn": "'+t._queryParams.getIndex().toString()+'"',n=t._path.toString();Va(`Using an unspecified index. Your data will be downloaded and filtered on the client. Consider adding ${e} at ${n} to your security rules for better performance.`)}}}refreshAuthToken(e){this.authToken_=e,this.log_("Auth token refreshed"),this.authToken_?this.tryAuth():this.connected_&&this.sendRequest("unauth",{},(()=>{})),this.reduceReconnectDelayIfAdminCredential_(e)}reduceReconnectDelayIfAdminCredential_(e){(e&&40===e.length||function(e){const t=Pt(e).claims;return"object"==typeof t&&!0===t.admin}(e))&&(this.log_("Admin auth credential detected. Reducing max reconnect time."),this.maxReconnectDelay_=3e4)}refreshAppCheckToken(e){this.appCheckToken_=e,this.log_("App check token refreshed"),this.appCheckToken_?this.tryAppCheck():this.connected_&&this.sendRequest("unappeck",{},(()=>{}))}tryAuth(){if(this.connected_&&this.authToken_){const e=this.authToken_,t=function(e){const t=Pt(e).claims;return!!t&&"object"==typeof t&&t.hasOwnProperty("iat")}(e)?"auth":"gauth",n={cred:e};null===this.authOverride_?n.noauth=!0:"object"==typeof this.authOverride_&&(n.authvar=this.authOverride_),this.sendRequest(t,n,(t=>{const n=t.s,i=t.d||"error";this.authToken_===e&&("ok"===n?this.invalidAuthTokenCount_=0:this.onAuthRevoked_(n,i))}))}}tryAppCheck(){this.connected_&&this.appCheckToken_&&this.sendRequest("appcheck",{token:this.appCheckToken_},(e=>{const t=e.s,n=e.d||"error";"ok"===t?this.invalidAppCheckTokenCount_=0:this.onAppCheckRevoked_(t,n)}))}unlisten(e,t){const n=e._path.toString(),i=e._queryIdentifier;this.log_("Unlisten called for "+n+" "+i),nt(e._queryParams.isDefault()||!e._queryParams.loadsAllData(),"unlisten() called for non-default but complete query");this.removeListen_(n,i)&&this.connected_&&this.sendUnlisten_(n,i,e._queryObject,t)}sendUnlisten_(e,t,n,i){this.log_("Unlisten on "+e+" for "+t);const o={p:e};i&&(o.q=n,o.t=i),this.sendRequest("n",o)}onDisconnectPut(e,t,n){this.initConnection_(),this.connected_?this.sendOnDisconnect_("o",e,t,n):this.onDisconnectRequestQueue_.push({pathString:e,action:"o",data:t,onComplete:n})}onDisconnectMerge(e,t,n){this.initConnection_(),this.connected_?this.sendOnDisconnect_("om",e,t,n):this.onDisconnectRequestQueue_.push({pathString:e,action:"om",data:t,onComplete:n})}onDisconnectCancel(e,t){this.initConnection_(),this.connected_?this.sendOnDisconnect_("oc",e,null,t):this.onDisconnectRequestQueue_.push({pathString:e,action:"oc",data:null,onComplete:t})}sendOnDisconnect_(e,t,n,i){const o={p:t,d:n};this.log_("onDisconnect "+e,o),this.sendRequest(e,o,(e=>{i&&setTimeout((()=>{i(e.s,e.d)}),Math.floor(0))}))}put(e,t,n,i){this.putInternal("p",e,t,n,i)}merge(e,t,n,i){this.putInternal("m",e,t,n,i)}putInternal(e,t,n,i,o){this.initConnection_();const r={p:t,d:n};void 0!==o&&(r.h=o),this.outstandingPuts_.push({action:e,request:r,onComplete:i}),this.outstandingPutCount_++;const s=this.outstandingPuts_.length-1;this.connected_?this.sendPut_(s):this.log_("Buffering put: "+t)}sendPut_(e){const t=this.outstandingPuts_[e].action,n=this.outstandingPuts_[e].request,i=this.outstandingPuts_[e].onComplete;this.outstandingPuts_[e].queued=this.connected_,this.sendRequest(t,n,(n=>{this.log_(t+" response",n),delete this.outstandingPuts_[e],this.outstandingPutCount_--,0===this.outstandingPutCount_&&(this.outstandingPuts_=[]),i&&i(n.s,n.d)}))}reportStats(e){if(this.connected_){const t={c:e};this.log_("reportStats",t),this.sendRequest("s",t,(e=>{if("ok"!==e.s){const t=e.d;this.log_("reportStats","Error sending stats: "+t)}}))}}onDataMessage_(e){if("r"in e){this.log_("from server: "+Lt(e));const t=e.r,n=this.requestCBHash_[t];n&&(delete this.requestCBHash_[t],n(e.b))}else{if("error"in e)throw"A server-side error has occurred: "+e.error;"a"in e&&this.onDataPush_(e.a,e.b)}}onDataPush_(e,t){this.log_("handleServerMessage",e,t),"d"===e?this.onDataUpdate_(t.p,t.d,!1,t.t):"m"===e?this.onDataUpdate_(t.p,t.d,!0,t.t):"c"===e?this.onListenRevoked_(t.p,t.q):"ac"===e?this.onAuthRevoked_(t.s,t.d):"apc"===e?this.onAppCheckRevoked_(t.s,t.d):"sd"===e?this.onSecurityDebugPacket_(t):Ua("Unrecognized action received from server: "+Lt(e)+"\nAre you using the latest client?")}onReady_(e,t){this.log_("connection ready"),this.connected_=!0,this.lastConnectionEstablishedTime_=(new Date).getTime(),this.handleTimestamp_(e),this.lastSessionId=t,this.firstConnection_&&this.sendConnectStats_(),this.restoreState_(),this.firstConnection_=!1,this.onConnectStatus_(!0)}scheduleConnect_(e){nt(!this.realtime_,"Scheduling a connect when we're already connected/ing?"),this.establishConnectionTimer_&&clearTimeout(this.establishConnectionTimer_),this.establishConnectionTimer_=setTimeout((()=>{this.establishConnectionTimer_=null,this.establishConnection_()}),Math.floor(e))}initConnection_(){!this.realtime_&&this.firstConnection_&&this.scheduleConnect_(0)}onVisible_(e){e&&!this.visible_&&this.reconnectDelay_===this.maxReconnectDelay_&&(this.log_("Window became visible. Reducing delay."),this.reconnectDelay_=Hl,this.realtime_||this.scheduleConnect_(0)),this.visible_=e}onOnline_(e){e?(this.log_("Browser went online."),this.reconnectDelay_=Hl,this.realtime_||this.scheduleConnect_(0)):(this.log_("Browser went offline. Killing connection."),this.realtime_&&this.realtime_.close())}onRealtimeDisconnect_(){if(this.log_("data client disconnected"),this.connected_=!1,this.realtime_=null,this.cancelSentTransactions_(),this.requestCBHash_={},this.shouldReconnect_()){if(this.visible_){if(this.lastConnectionEstablishedTime_){(new Date).getTime()-this.lastConnectionEstablishedTime_>3e4&&(this.reconnectDelay_=Hl),this.lastConnectionEstablishedTime_=null}}else this.log_("Window isn't visible. Delaying reconnect."),this.reconnectDelay_=this.maxReconnectDelay_,this.lastConnectionAttemptTime_=(new Date).getTime();const e=(new Date).getTime()-this.lastConnectionAttemptTime_;let t=Math.max(0,this.reconnectDelay_-e);t=Math.random()*t,this.log_("Trying to reconnect in "+t+"ms"),this.scheduleConnect_(t),this.reconnectDelay_=Math.min(this.maxReconnectDelay_,1.3*this.reconnectDelay_)}this.onConnectStatus_(!1)}async establishConnection_(){if(this.shouldReconnect_()){this.log_("Making a connection attempt"),this.lastConnectionAttemptTime_=(new Date).getTime(),this.lastConnectionEstablishedTime_=null;const e=this.onDataMessage_.bind(this),t=this.onReady_.bind(this),n=this.onRealtimeDisconnect_.bind(this),i=this.id+":"+$l.nextConnectionId_++,o=this.lastSessionId;let r=!1,s=null;const a=function(){s?s.close():(r=!0,n())},l=function(e){nt(s,"sendRequest call when we're not connected not allowed."),s.sendRequest(e)};this.realtime_={close:a,sendRequest:l};const c=this.forceTokenRefresh_;this.forceTokenRefresh_=!1;try{const[a,l]=await Promise.all([this.authTokenProvider_.getToken(c),this.appCheckTokenProvider_.getToken(c)]);r?Fa("getToken() completed but was canceled"):(Fa("getToken() completed. Creating connection."),this.authToken_=a&&a.accessToken,this.appCheckToken_=l&&l.token,s=new _l(i,this.repoInfo_,this.applicationId_,this.appCheckToken_,this.authToken_,e,t,n,(e=>{Va(e+" ("+this.repoInfo_.toString()+")"),this.interrupt("server_kill")}),o))}catch(e){this.log_("Failed to get token: "+e),r||(this.repoInfo_.nodeAdmin&&Va(e),a())}}}interrupt(e){Fa("Interrupting connection for reason: "+e),this.interruptReasons_[e]=!0,this.realtime_?this.realtime_.close():(this.establishConnectionTimer_&&(clearTimeout(this.establishConnectionTimer_),this.establishConnectionTimer_=null),this.connected_&&this.onRealtimeDisconnect_())}resume(e){Fa("Resuming connection for reason: "+e),delete this.interruptReasons_[e],At(this.interruptReasons_)&&(this.reconnectDelay_=Hl,this.realtime_||this.scheduleConnect_(0))}handleTimestamp_(e){const t=e-(new Date).getTime();this.onServerInfoUpdate_({serverTimeOffset:t})}cancelSentTransactions_(){for(let e=0;e<this.outstandingPuts_.length;e++){const t=this.outstandingPuts_[e];t&&"h"in t.request&&t.queued&&(t.onComplete&&t.onComplete("disconnect"),delete this.outstandingPuts_[e],this.outstandingPutCount_--)}0===this.outstandingPutCount_&&(this.outstandingPuts_=[])}onListenRevoked_(e,t){let n;n=t?t.map((e=>Ka(e))).join("$"):"default";const i=this.removeListen_(e,n);i&&i.onComplete&&i.onComplete("permission_denied")}removeListen_(e,t){const n=new Sl(e).toString();let i;if(this.listens.has(n)){const e=this.listens.get(n);i=e.get(t),e.delete(t),0===e.size&&this.listens.delete(n)}else i=void 0;return i}onAuthRevoked_(e,t){Fa("Auth token revoked: "+e+"/"+t),this.authToken_=null,this.forceTokenRefresh_=!0,this.realtime_.close(),"invalid_token"!==e&&"permission_denied"!==e||(this.invalidAuthTokenCount_++,this.invalidAuthTokenCount_>=3&&(this.reconnectDelay_=3e4,this.authTokenProvider_.notifyForInvalidToken()))}onAppCheckRevoked_(e,t){Fa("App check token revoked: "+e+"/"+t),this.appCheckToken_=null,this.forceTokenRefresh_=!0,"invalid_token"!==e&&"permission_denied"!==e||(this.invalidAppCheckTokenCount_++,this.invalidAppCheckTokenCount_>=3&&this.appCheckTokenProvider_.notifyForInvalidToken())}onSecurityDebugPacket_(e){this.securityDebugCallback_?this.securityDebugCallback_(e):"msg"in e&&console.log("FIREBASE: "+e.msg.replace("\n","\nFIREBASE: "))}restoreState_(){this.tryAuth(),this.tryAppCheck();for(const e of this.listens.values())for(const t of e.values())this.sendListen_(t);for(let e=0;e<this.outstandingPuts_.length;e++)this.outstandingPuts_[e]&&this.sendPut_(e);for(;this.onDisconnectRequestQueue_.length;){const e=this.onDisconnectRequestQueue_.shift();this.sendOnDisconnect_(e.action,e.pathString,e.data,e.onComplete)}for(let e=0;e<this.outstandingGets_.length;e++)this.outstandingGets_[e]&&this.sendGet_(e)}sendConnectStats_(){const e={};e["sdk.js."+Ia.replace(/\./g,"-")]=1,wt()?e["framework.cordova"]=1:yt()&&(e["framework.reactnative"]=1),this.reportStats(e)}shouldReconnect_(){const e=Il.getInstance().currentlyOnline();return At(this.interruptReasons_)&&e}}$l.nextPersistentConnectionId_=0,$l.nextConnectionId_=0;
|
|
2222
2222
|
/**
|
|
2223
2223
|
* @license
|
|
2224
2224
|
* Copyright 2017 Google LLC
|
|
@@ -2251,7 +2251,7 @@ class Wl{constructor(e,t){this.name=e,this.node=t}static Wrap(e,t){return new Wl
|
|
|
2251
2251
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2252
2252
|
* See the License for the specific language governing permissions and
|
|
2253
2253
|
* limitations under the License.
|
|
2254
|
-
*/class Gl{getCompare(){return this.compare.bind(this)}indexedValueChanged(e,t){const n=new Wl(
|
|
2254
|
+
*/class Gl{getCompare(){return this.compare.bind(this)}indexedValueChanged(e,t){const n=new Wl(Ba,e),i=new Wl(Ba,t);return 0!==this.compare(n,i)}minPost(){return Wl.MIN}}
|
|
2255
2255
|
/**
|
|
2256
2256
|
* @license
|
|
2257
2257
|
* Copyright 2017 Google LLC
|
|
@@ -2283,7 +2283,7 @@ class Wl{constructor(e,t){this.name=e,this.node=t}static Wrap(e,t){return new Wl
|
|
|
2283
2283
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2284
2284
|
* See the License for the specific language governing permissions and
|
|
2285
2285
|
* limitations under the License.
|
|
2286
|
-
*/class
|
|
2286
|
+
*/class Zl{constructor(e,t,n,i,o=null){this.isReverse_=i,this.resultGenerator_=o,this.nodeStack_=[];let r=1;for(;!e.isEmpty();)if(r=t?n(e.key,t):1,i&&(r*=-1),r<0)e=this.isReverse_?e.left:e.right;else{if(0===r){this.nodeStack_.push(e);break}this.nodeStack_.push(e),e=this.isReverse_?e.right:e.left}}getNext(){if(0===this.nodeStack_.length)return null;let e,t=this.nodeStack_.pop();if(e=this.resultGenerator_?this.resultGenerator_(t.key,t.value):{key:t.key,value:t.value},this.isReverse_)for(t=t.left;!t.isEmpty();)this.nodeStack_.push(t),t=t.right;else for(t=t.right;!t.isEmpty();)this.nodeStack_.push(t),t=t.left;return e}hasNext(){return this.nodeStack_.length>0}peek(){if(0===this.nodeStack_.length)return null;const e=this.nodeStack_[this.nodeStack_.length-1];return this.resultGenerator_?this.resultGenerator_(e.key,e.value):{key:e.key,value:e.value}}}class Ql{constructor(e,t,n,i,o){this.key=e,this.value=t,this.color=null!=n?n:Ql.RED,this.left=null!=i?i:Xl.EMPTY_NODE,this.right=null!=o?o:Xl.EMPTY_NODE}copy(e,t,n,i,o){return new Ql(null!=e?e:this.key,null!=t?t:this.value,null!=n?n:this.color,null!=i?i:this.left,null!=o?o:this.right)}count(){return this.left.count()+1+this.right.count()}isEmpty(){return!1}inorderTraversal(e){return this.left.inorderTraversal(e)||!!e(this.key,this.value)||this.right.inorderTraversal(e)}reverseTraversal(e){return this.right.reverseTraversal(e)||e(this.key,this.value)||this.left.reverseTraversal(e)}min_(){return this.left.isEmpty()?this:this.left.min_()}minKey(){return this.min_().key}maxKey(){return this.right.isEmpty()?this.key:this.right.maxKey()}insert(e,t,n){let i=this;const o=n(e,i.key);return i=o<0?i.copy(null,null,null,i.left.insert(e,t,n),null):0===o?i.copy(null,t,null,null,null):i.copy(null,null,null,null,i.right.insert(e,t,n)),i.fixUp_()}removeMin_(){if(this.left.isEmpty())return Xl.EMPTY_NODE;let e=this;return e.left.isRed_()||e.left.left.isRed_()||(e=e.moveRedLeft_()),e=e.copy(null,null,null,e.left.removeMin_(),null),e.fixUp_()}remove(e,t){let n,i;if(n=this,t(e,n.key)<0)n.left.isEmpty()||n.left.isRed_()||n.left.left.isRed_()||(n=n.moveRedLeft_()),n=n.copy(null,null,null,n.left.remove(e,t),null);else{if(n.left.isRed_()&&(n=n.rotateRight_()),n.right.isEmpty()||n.right.isRed_()||n.right.left.isRed_()||(n=n.moveRedRight_()),0===t(e,n.key)){if(n.right.isEmpty())return Xl.EMPTY_NODE;i=n.right.min_(),n=n.copy(i.key,i.value,null,null,n.right.removeMin_())}n=n.copy(null,null,null,null,n.right.remove(e,t))}return n.fixUp_()}isRed_(){return this.color}fixUp_(){let e=this;return e.right.isRed_()&&!e.left.isRed_()&&(e=e.rotateLeft_()),e.left.isRed_()&&e.left.left.isRed_()&&(e=e.rotateRight_()),e.left.isRed_()&&e.right.isRed_()&&(e=e.colorFlip_()),e}moveRedLeft_(){let e=this.colorFlip_();return e.right.left.isRed_()&&(e=e.copy(null,null,null,null,e.right.rotateRight_()),e=e.rotateLeft_(),e=e.colorFlip_()),e}moveRedRight_(){let e=this.colorFlip_();return e.left.left.isRed_()&&(e=e.rotateRight_(),e=e.colorFlip_()),e}rotateLeft_(){const e=this.copy(null,null,Ql.RED,null,this.right.left);return this.right.copy(null,null,this.color,e,null)}rotateRight_(){const e=this.copy(null,null,Ql.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,e)}colorFlip_(){const e=this.left.copy(null,null,!this.left.color,null,null),t=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,e,t)}checkMaxDepth_(){const e=this.check_();return Math.pow(2,e)<=this.count()+1}check_(){if(this.isRed_()&&this.left.isRed_())throw new Error("Red node has red child("+this.key+","+this.value+")");if(this.right.isRed_())throw new Error("Right child of ("+this.key+","+this.value+") is red");const e=this.left.check_();if(e!==this.right.check_())throw new Error("Black depths differ");return e+(this.isRed_()?0:1)}}Ql.RED=!0,Ql.BLACK=!1;class Xl{constructor(e,t=Xl.EMPTY_NODE){this.comparator_=e,this.root_=t}insert(e,t){return new Xl(this.comparator_,this.root_.insert(e,t,this.comparator_).copy(null,null,Ql.BLACK,null,null))}remove(e){return new Xl(this.comparator_,this.root_.remove(e,this.comparator_).copy(null,null,Ql.BLACK,null,null))}get(e){let t,n=this.root_;for(;!n.isEmpty();){if(t=this.comparator_(e,n.key),0===t)return n.value;t<0?n=n.left:t>0&&(n=n.right)}return null}getPredecessorKey(e){let t,n=this.root_,i=null;for(;!n.isEmpty();){if(t=this.comparator_(e,n.key),0===t){if(n.left.isEmpty())return i?i.key:null;for(n=n.left;!n.right.isEmpty();)n=n.right;return n.key}t<0?n=n.left:t>0&&(i=n,n=n.right)}throw new Error("Attempted to find predecessor key for a nonexistent key. What gives?")}isEmpty(){return this.root_.isEmpty()}count(){return this.root_.count()}minKey(){return this.root_.minKey()}maxKey(){return this.root_.maxKey()}inorderTraversal(e){return this.root_.inorderTraversal(e)}reverseTraversal(e){return this.root_.reverseTraversal(e)}getIterator(e){return new Zl(this.root_,null,this.comparator_,!1,e)}getIteratorFrom(e,t){return new Zl(this.root_,e,this.comparator_,!1,t)}getReverseIteratorFrom(e,t){return new Zl(this.root_,e,this.comparator_,!0,t)}getReverseIterator(e){return new Zl(this.root_,null,this.comparator_,!0,e)}}
|
|
2287
2287
|
/**
|
|
2288
2288
|
* @license
|
|
2289
2289
|
* Copyright 2017 Google LLC
|
|
@@ -2316,7 +2316,7 @@ function ec(e,t){return $a(e.name,t.name)}function tc(e,t){return $a(e,t)}
|
|
|
2316
2316
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2317
2317
|
* See the License for the specific language governing permissions and
|
|
2318
2318
|
* limitations under the License.
|
|
2319
|
-
*/let nc;
|
|
2319
|
+
*/let nc;Xl.EMPTY_NODE=new class{copy(e,t,n,i,o){return this}insert(e,t,n){return new Ql(e,t,null)}remove(e,t){return this}count(){return 0}isEmpty(){return!0}inorderTraversal(e){return!1}reverseTraversal(e){return!1}minKey(){return null}maxKey(){return null}check_(){return 0}isRed_(){return!1}};const ic=function(e){return"number"==typeof e?"number:"+Za(e):"string:"+e},oc=function(e){if(e.isLeafNode()){const t=e.val();nt("string"==typeof t||"number"==typeof t||"object"==typeof t&&Rt(t,".sv"),"Priority must be a string or number.")}else nt(e===nc||e.isEmpty(),"priority of unexpected type.");nt(e===nc||e.getPriority().isEmpty(),"Priority nodes can't have a priority of their own.")};
|
|
2320
2320
|
/**
|
|
2321
2321
|
* @license
|
|
2322
2322
|
* Copyright 2017 Google LLC
|
|
@@ -2333,7 +2333,7 @@ function ec(e,t){return $a(e.name,t.name)}function tc(e,t){return $a(e,t)}
|
|
|
2333
2333
|
* See the License for the specific language governing permissions and
|
|
2334
2334
|
* limitations under the License.
|
|
2335
2335
|
*/
|
|
2336
|
-
let rc,sc,ac;class lc{static set __childrenNodeConstructor(e){rc=e}static get __childrenNodeConstructor(){return rc}constructor(e,t=lc.__childrenNodeConstructor.EMPTY_NODE){this.value_=e,this.priorityNode_=t,this.lazyHash_=null,nt(void 0!==this.value_&&null!==this.value_,"LeafNode shouldn't be created with null/undefined value."),oc(this.priorityNode_)}isLeafNode(){return!0}getPriority(){return this.priorityNode_}updatePriority(e){return new lc(this.value_,e)}getImmediateChild(e){return".priority"===e?this.priorityNode_:lc.__childrenNodeConstructor.EMPTY_NODE}getChild(e){return Ol(e)?this:".priority"===El(e)?this.priorityNode_:lc.__childrenNodeConstructor.EMPTY_NODE}hasChild(){return!1}getPredecessorChildName(e,t){return null}updateImmediateChild(e,t){return".priority"===e?this.updatePriority(t):t.isEmpty()&&".priority"!==e?this:lc.__childrenNodeConstructor.EMPTY_NODE.updateImmediateChild(e,t).updatePriority(this.priorityNode_)}updateChild(e,t){const n=El(e);return null===n?t:t.isEmpty()&&".priority"!==n?this:(nt(".priority"!==n||1===
|
|
2336
|
+
let rc,sc,ac;class lc{static set __childrenNodeConstructor(e){rc=e}static get __childrenNodeConstructor(){return rc}constructor(e,t=lc.__childrenNodeConstructor.EMPTY_NODE){this.value_=e,this.priorityNode_=t,this.lazyHash_=null,nt(void 0!==this.value_&&null!==this.value_,"LeafNode shouldn't be created with null/undefined value."),oc(this.priorityNode_)}isLeafNode(){return!0}getPriority(){return this.priorityNode_}updatePriority(e){return new lc(this.value_,e)}getImmediateChild(e){return".priority"===e?this.priorityNode_:lc.__childrenNodeConstructor.EMPTY_NODE}getChild(e){return Ol(e)?this:".priority"===El(e)?this.priorityNode_:lc.__childrenNodeConstructor.EMPTY_NODE}hasChild(){return!1}getPredecessorChildName(e,t){return null}updateImmediateChild(e,t){return".priority"===e?this.updatePriority(t):t.isEmpty()&&".priority"!==e?this:lc.__childrenNodeConstructor.EMPTY_NODE.updateImmediateChild(e,t).updatePriority(this.priorityNode_)}updateChild(e,t){const n=El(e);return null===n?t:t.isEmpty()&&".priority"!==n?this:(nt(".priority"!==n||1===Ll(e),".priority must be the last token in a path"),this.updateImmediateChild(n,lc.__childrenNodeConstructor.EMPTY_NODE.updateChild(Pl(e),t)))}isEmpty(){return!1}numChildren(){return 0}forEachChild(e,t){return!1}val(e){return e&&!this.getPriority().isEmpty()?{".value":this.getValue(),".priority":this.getPriority().val()}:this.getValue()}hash(){if(null===this.lazyHash_){let e="";this.priorityNode_.isEmpty()||(e+="priority:"+ic(this.priorityNode_.val())+":");const t=typeof this.value_;e+=t+":",e+="number"===t?Za(this.value_):this.value_,this.lazyHash_=Aa(e)}return this.lazyHash_}getValue(){return this.value_}compareTo(e){return e===lc.__childrenNodeConstructor.EMPTY_NODE?1:e instanceof lc.__childrenNodeConstructor?-1:(nt(e.isLeafNode(),"Unknown node type"),this.compareToLeafNode_(e))}compareToLeafNode_(e){const t=typeof e.value_,n=typeof this.value_,i=lc.VALUE_TYPE_ORDER.indexOf(t),o=lc.VALUE_TYPE_ORDER.indexOf(n);return nt(i>=0,"Unknown leaf type: "+t),nt(o>=0,"Unknown leaf type: "+n),i===o?"object"===n?0:this.value_<e.value_?-1:this.value_===e.value_?0:1:o-i}withIndex(){return this}isIndexed(){return!0}equals(e){if(e===this)return!0;if(e.isLeafNode()){const t=e;return this.value_===t.value_&&this.priorityNode_.equals(t.priorityNode_)}return!1}}lc.VALUE_TYPE_ORDER=["object","boolean","number","string"];const cc=new class extends Gl{compare(e,t){const n=e.node.getPriority(),i=t.node.getPriority(),o=n.compareTo(i);return 0===o?$a(e.name,t.name):o}isDefinedOn(e){return!e.getPriority().isEmpty()}indexedValueChanged(e,t){return!e.getPriority().equals(t.getPriority())}minPost(){return Wl.MIN}maxPost(){return new Wl(Ha,new lc("[PRIORITY-POST]",ac))}makePost(e,t){const n=sc(e);return new Wl(t,new lc("[PRIORITY-POST]",n))}toString(){return".priority"}},dc=Math.log(2);
|
|
2337
2337
|
/**
|
|
2338
2338
|
* @license
|
|
2339
2339
|
* Copyright 2017 Google LLC
|
|
@@ -2349,7 +2349,7 @@ let rc,sc,ac;class lc{static set __childrenNodeConstructor(e){rc=e}static get __
|
|
|
2349
2349
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2350
2350
|
* See the License for the specific language governing permissions and
|
|
2351
2351
|
* limitations under the License.
|
|
2352
|
-
*/class hc{constructor(e){var t;this.count=(t=e+1,parseInt(Math.log(t)/dc,10)),this.current_=this.count-1;const n=(i=this.count,parseInt(Array(i+1).join("1"),2));var i;this.bits_=e+1&n}nextBitIsOne(){const e=!(this.bits_&1<<this.current_);return this.current_--,e}}const uc=function(e,t,n,i){e.sort(t);const o=function(t,i){const r=i-t;let s,a;if(0===r)return null;if(1===r)return s=e[t],a=n?n(s):s,new
|
|
2352
|
+
*/class hc{constructor(e){var t;this.count=(t=e+1,parseInt(Math.log(t)/dc,10)),this.current_=this.count-1;const n=(i=this.count,parseInt(Array(i+1).join("1"),2));var i;this.bits_=e+1&n}nextBitIsOne(){const e=!(this.bits_&1<<this.current_);return this.current_--,e}}const uc=function(e,t,n,i){e.sort(t);const o=function(t,i){const r=i-t;let s,a;if(0===r)return null;if(1===r)return s=e[t],a=n?n(s):s,new Ql(a,s.node,Ql.BLACK,null,null);{const l=parseInt(r/2,10)+t,c=o(t,l),d=o(l+1,i);return s=e[l],a=n?n(s):s,new Ql(a,s.node,Ql.BLACK,c,d)}},r=function(t){let i=null,r=null,s=e.length;const a=function(t,i){const r=s-t,a=s;s-=t;const c=o(r+1,a),d=e[r],h=n?n(d):d;l(new Ql(h,d.node,i,null,c))},l=function(e){i?(i.left=e,i=e):(r=e,i=e)};for(let e=0;e<t.count;++e){const n=t.nextBitIsOne(),i=Math.pow(2,t.count-(e+1));n?a(i,Ql.BLACK):(a(i,Ql.BLACK),a(i,Ql.RED))}return r}(new hc(e.length));return new Xl(i||t,r)};
|
|
2353
2353
|
/**
|
|
2354
2354
|
* @license
|
|
2355
2355
|
* Copyright 2017 Google LLC
|
|
@@ -2365,7 +2365,7 @@ let rc,sc,ac;class lc{static set __childrenNodeConstructor(e){rc=e}static get __
|
|
|
2365
2365
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2366
2366
|
* See the License for the specific language governing permissions and
|
|
2367
2367
|
* limitations under the License.
|
|
2368
|
-
*/let pc;const gc={};class fc{static get Default(){return nt(gc&&cc,"ChildrenNode.ts has not been loaded"),pc=pc||new fc({".priority":gc},{".priority":cc}),pc}constructor(e,t){this.indexes_=e,this.indexSet_=t}get(e){const t=Nt(this.indexes_,e);if(!t)throw new Error("No index defined for "+e);return t instanceof
|
|
2368
|
+
*/let pc;const gc={};class fc{static get Default(){return nt(gc&&cc,"ChildrenNode.ts has not been loaded"),pc=pc||new fc({".priority":gc},{".priority":cc}),pc}constructor(e,t){this.indexes_=e,this.indexSet_=t}get(e){const t=Nt(this.indexes_,e);if(!t)throw new Error("No index defined for "+e);return t instanceof Xl?t:null}hasIndex(e){return Rt(this.indexSet_,e.toString())}addIndex(e,t){nt(e!==Jl,"KeyIndex always exists and isn't meant to be added to the IndexMap.");const n=[];let i=!1;const o=t.getIterator(Wl.Wrap);let r,s=o.getNext();for(;s;)i=i||e.isDefinedOn(s.node),n.push(s),s=o.getNext();r=i?uc(n,e.getCompare()):gc;const a=e.toString(),l=Object.assign({},this.indexSet_);l[a]=e;const c=Object.assign({},this.indexes_);return c[a]=r,new fc(c,l)}addToIndexes(e,t){const n=Dt(this.indexes_,((n,i)=>{const o=Nt(this.indexSet_,i);if(nt(o,"Missing index implementation for "+i),n===gc){if(o.isDefinedOn(e.node)){const n=[],i=t.getIterator(Wl.Wrap);let r=i.getNext();for(;r;)r.name!==e.name&&n.push(r),r=i.getNext();return n.push(e),uc(n,o.getCompare())}return gc}{const i=t.get(e.name);let o=n;return i&&(o=o.remove(new Wl(e.name,i))),o.insert(e,e.node)}}));return new fc(n,this.indexSet_)}removeFromIndexes(e,t){const n=Dt(this.indexes_,(n=>{if(n===gc)return n;{const i=t.get(e.name);return i?n.remove(new Wl(e.name,i)):n}}));return new fc(n,this.indexSet_)}}
|
|
2369
2369
|
/**
|
|
2370
2370
|
* @license
|
|
2371
2371
|
* Copyright 2017 Google LLC
|
|
@@ -2381,7 +2381,7 @@ let rc,sc,ac;class lc{static set __childrenNodeConstructor(e){rc=e}static get __
|
|
|
2381
2381
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2382
2382
|
* See the License for the specific language governing permissions and
|
|
2383
2383
|
* limitations under the License.
|
|
2384
|
-
*/let mc;class vc{static get EMPTY_NODE(){return mc||(mc=new vc(new
|
|
2384
|
+
*/let mc;class vc{static get EMPTY_NODE(){return mc||(mc=new vc(new Xl(tc),null,fc.Default))}constructor(e,t,n){this.children_=e,this.priorityNode_=t,this.indexMap_=n,this.lazyHash_=null,this.priorityNode_&&oc(this.priorityNode_),this.children_.isEmpty()&&nt(!this.priorityNode_||this.priorityNode_.isEmpty(),"An empty node cannot have a priority")}isLeafNode(){return!1}getPriority(){return this.priorityNode_||mc}updatePriority(e){return this.children_.isEmpty()?this:new vc(this.children_,e,this.indexMap_)}getImmediateChild(e){if(".priority"===e)return this.getPriority();{const t=this.children_.get(e);return null===t?mc:t}}getChild(e){const t=El(e);return null===t?this:this.getImmediateChild(t).getChild(Pl(e))}hasChild(e){return null!==this.children_.get(e)}updateImmediateChild(e,t){if(nt(t,"We should always be passing snapshot nodes"),".priority"===e)return this.updatePriority(t);{const n=new Wl(e,t);let i,o;t.isEmpty()?(i=this.children_.remove(e),o=this.indexMap_.removeFromIndexes(n,this.children_)):(i=this.children_.insert(e,t),o=this.indexMap_.addToIndexes(n,this.children_));const r=i.isEmpty()?mc:this.priorityNode_;return new vc(i,r,o)}}updateChild(e,t){const n=El(e);if(null===n)return t;{nt(".priority"!==El(e)||1===Ll(e),".priority must be the last token in a path");const i=this.getImmediateChild(n).updateChild(Pl(e),t);return this.updateImmediateChild(n,i)}}isEmpty(){return this.children_.isEmpty()}numChildren(){return this.children_.count()}val(e){if(this.isEmpty())return null;const t={};let n=0,i=0,o=!0;if(this.forEachChild(cc,((r,s)=>{t[r]=s.val(e),n++,o&&vc.INTEGER_REGEXP_.test(r)?i=Math.max(i,Number(r)):o=!1})),!e&&o&&i<2*n){const e=[];for(const n in t)e[n]=t[n];return e}return e&&!this.getPriority().isEmpty()&&(t[".priority"]=this.getPriority().val()),t}hash(){if(null===this.lazyHash_){let e="";this.getPriority().isEmpty()||(e+="priority:"+ic(this.getPriority().val())+":"),this.forEachChild(cc,((t,n)=>{const i=n.hash();""!==i&&(e+=":"+t+":"+i)})),this.lazyHash_=""===e?"":Aa(e)}return this.lazyHash_}getPredecessorChildName(e,t,n){const i=this.resolveIndex_(n);if(i){const n=i.getPredecessorKey(new Wl(e,t));return n?n.name:null}return this.children_.getPredecessorKey(e)}getFirstChildName(e){const t=this.resolveIndex_(e);if(t){const e=t.minKey();return e&&e.name}return this.children_.minKey()}getFirstChild(e){const t=this.getFirstChildName(e);return t?new Wl(t,this.children_.get(t)):null}getLastChildName(e){const t=this.resolveIndex_(e);if(t){const e=t.maxKey();return e&&e.name}return this.children_.maxKey()}getLastChild(e){const t=this.getLastChildName(e);return t?new Wl(t,this.children_.get(t)):null}forEachChild(e,t){const n=this.resolveIndex_(e);return n?n.inorderTraversal((e=>t(e.name,e.node))):this.children_.inorderTraversal(t)}getIterator(e){return this.getIteratorFrom(e.minPost(),e)}getIteratorFrom(e,t){const n=this.resolveIndex_(t);if(n)return n.getIteratorFrom(e,(e=>e));{const n=this.children_.getIteratorFrom(e.name,Wl.Wrap);let i=n.peek();for(;null!=i&&t.compare(i,e)<0;)n.getNext(),i=n.peek();return n}}getReverseIterator(e){return this.getReverseIteratorFrom(e.maxPost(),e)}getReverseIteratorFrom(e,t){const n=this.resolveIndex_(t);if(n)return n.getReverseIteratorFrom(e,(e=>e));{const n=this.children_.getReverseIteratorFrom(e.name,Wl.Wrap);let i=n.peek();for(;null!=i&&t.compare(i,e)>0;)n.getNext(),i=n.peek();return n}}compareTo(e){return this.isEmpty()?e.isEmpty()?0:-1:e.isLeafNode()||e.isEmpty()?1:e===bc?-1:0}withIndex(e){if(e===Jl||this.indexMap_.hasIndex(e))return this;{const t=this.indexMap_.addIndex(e,this.children_);return new vc(this.children_,this.priorityNode_,t)}}isIndexed(e){return e===Jl||this.indexMap_.hasIndex(e)}equals(e){if(e===this)return!0;if(e.isLeafNode())return!1;{const t=e;if(this.getPriority().equals(t.getPriority())){if(this.children_.count()===t.children_.count()){const e=this.getIterator(cc),n=t.getIterator(cc);let i=e.getNext(),o=n.getNext();for(;i&&o;){if(i.name!==o.name||!i.node.equals(o.node))return!1;i=e.getNext(),o=n.getNext()}return null===i&&null===o}return!1}return!1}}resolveIndex_(e){return e===Jl?null:this.indexMap_.get(e.toString())}}vc.INTEGER_REGEXP_=/^(0|[1-9]\d*)$/;const bc=new class extends vc{constructor(){super(new Xl(tc),vc.EMPTY_NODE,fc.Default)}compareTo(e){return e===this?0:1}equals(e){return e===this}getPriority(){return this}getImmediateChild(e){return vc.EMPTY_NODE}isEmpty(){return!1}};Object.defineProperties(Wl,{MIN:{value:new Wl(Ba,vc.EMPTY_NODE)},MAX:{value:new Wl(Ha,bc)}}),Yl.__EMPTY_NODE=vc.EMPTY_NODE,lc.__childrenNodeConstructor=vc,nc=bc,function(e){ac=e}(bc);function wc(e,t=null){if(null===e)return vc.EMPTY_NODE;if("object"==typeof e&&".priority"in e&&(t=e[".priority"]),nt(null===t||"string"==typeof t||"number"==typeof t||"object"==typeof t&&".sv"in t,"Invalid priority type found: "+typeof t),"object"==typeof e&&".value"in e&&null!==e[".value"]&&(e=e[".value"]),"object"!=typeof e||".sv"in e){return new lc(e,wc(t))}if(e instanceof Array){let n=vc.EMPTY_NODE;return Ja(e,((t,i)=>{if(Rt(e,t)&&"."!==t.substring(0,1)){const e=wc(i);!e.isLeafNode()&&e.isEmpty()||(n=n.updateImmediateChild(t,e))}})),n.updatePriority(wc(t))}{const n=[];let i=!1;if(Ja(e,((e,t)=>{if("."!==e.substring(0,1)){const o=wc(t);o.isEmpty()||(i=i||!o.getPriority().isEmpty(),n.push(new Wl(e,o)))}})),0===n.length)return vc.EMPTY_NODE;const o=uc(n,ec,(e=>e.name),tc);if(i){const e=uc(n,cc.getCompare());return new vc(o,wc(t),new fc({".priority":e},{".priority":cc}))}return new vc(o,wc(t),fc.Default)}}!function(e){sc=e}(wc);
|
|
2385
2385
|
/**
|
|
2386
2386
|
* @license
|
|
2387
2387
|
* Copyright 2017 Google LLC
|
|
@@ -2495,7 +2495,7 @@ class Sc{constructor(e){this.index_=e}updateChild(e,t,n,i,o,r){nt(e.isIndexed(th
|
|
|
2495
2495
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2496
2496
|
* See the License for the specific language governing permissions and
|
|
2497
2497
|
* limitations under the License.
|
|
2498
|
-
*/class
|
|
2498
|
+
*/class Lc{constructor(){this.limitSet_=!1,this.startSet_=!1,this.startNameSet_=!1,this.startAfterSet_=!1,this.endSet_=!1,this.endNameSet_=!1,this.endBeforeSet_=!1,this.limit_=0,this.viewFrom_="",this.indexStartValue_=null,this.indexStartName_="",this.indexEndValue_=null,this.indexEndName_="",this.index_=cc}hasStart(){return this.startSet_}isViewFromLeft(){return""===this.viewFrom_?this.startSet_:"l"===this.viewFrom_}getIndexStartValue(){return nt(this.startSet_,"Only valid if start has been set"),this.indexStartValue_}getIndexStartName(){return nt(this.startSet_,"Only valid if start has been set"),this.startNameSet_?this.indexStartName_:Ba}hasEnd(){return this.endSet_}getIndexEndValue(){return nt(this.endSet_,"Only valid if end has been set"),this.indexEndValue_}getIndexEndName(){return nt(this.endSet_,"Only valid if end has been set"),this.endNameSet_?this.indexEndName_:Ha}hasLimit(){return this.limitSet_}hasAnchoredLimit(){return this.limitSet_&&""!==this.viewFrom_}getLimit(){return nt(this.limitSet_,"Only valid if limit has been set"),this.limit_}getIndex(){return this.index_}loadsAllData(){return!(this.startSet_||this.endSet_||this.limitSet_)}isDefault(){return this.loadsAllData()&&this.index_===cc}copy(){const e=new Lc;return e.limitSet_=this.limitSet_,e.limit_=this.limit_,e.startSet_=this.startSet_,e.startAfterSet_=this.startAfterSet_,e.indexStartValue_=this.indexStartValue_,e.startNameSet_=this.startNameSet_,e.indexStartName_=this.indexStartName_,e.endSet_=this.endSet_,e.endBeforeSet_=this.endBeforeSet_,e.indexEndValue_=this.indexEndValue_,e.endNameSet_=this.endNameSet_,e.indexEndName_=this.indexEndName_,e.index_=this.index_,e.viewFrom_=this.viewFrom_,e}}function Pc(e){const t={};if(e.isDefault())return t;let n;if(e.index_===cc?n="$priority":e.index_===yc?n="$value":e.index_===Jl?n="$key":(nt(e.index_ instanceof xc,"Unrecognized index type!"),n=e.index_.toString()),t.orderBy=Lt(n),e.startSet_){const n=e.startAfterSet_?"startAfter":"startAt";t[n]=Lt(e.indexStartValue_),e.startNameSet_&&(t[n]+=","+Lt(e.indexStartName_))}if(e.endSet_){const n=e.endBeforeSet_?"endBefore":"endAt";t[n]=Lt(e.indexEndValue_),e.endNameSet_&&(t[n]+=","+Lt(e.indexEndName_))}return e.limitSet_&&(e.isViewFromLeft()?t.limitToFirst=e.limit_:t.limitToLast=e.limit_),t}function Rc(e){const t={};if(e.startSet_&&(t.sp=e.indexStartValue_,e.startNameSet_&&(t.sn=e.indexStartName_),t.sin=!e.startAfterSet_),e.endSet_&&(t.ep=e.indexEndValue_,e.endNameSet_&&(t.en=e.indexEndName_),t.ein=!e.endBeforeSet_),e.limitSet_){t.l=e.limit_;let n=e.viewFrom_;""===n&&(n=e.isViewFromLeft()?"l":"r"),t.vf=n}return e.index_!==cc&&(t.i=e.index_.toString()),t}
|
|
2499
2499
|
/**
|
|
2500
2500
|
* @license
|
|
2501
2501
|
* Copyright 2017 Google LLC
|
|
@@ -2511,7 +2511,7 @@ class Sc{constructor(e){this.index_=e}updateChild(e,t,n,i,o,r){nt(e.isIndexed(th
|
|
|
2511
2511
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2512
2512
|
* See the License for the specific language governing permissions and
|
|
2513
2513
|
* limitations under the License.
|
|
2514
|
-
*/class Nc extends kl{reportStats(e){throw new Error("Method not implemented.")}static getListenId_(e,t){return void 0!==t?"tag$"+t:(nt(e._queryParams.isDefault(),"should have a tag if it's not a default query."),e._path.toString())}constructor(e,t,n,i){super(),this.repoInfo_=e,this.onDataUpdate_=t,this.authTokenProvider_=n,this.appCheckTokenProvider_=i,this.log_=za("p:rest:"),this.listens_={}}listen(e,t,n,i){const o=e._path.toString();this.log_("Listen called for "+o+" "+e._queryIdentifier);const r=Nc.getListenId_(e,n),s={};this.listens_[r]=s;const a=
|
|
2514
|
+
*/class Nc extends kl{reportStats(e){throw new Error("Method not implemented.")}static getListenId_(e,t){return void 0!==t?"tag$"+t:(nt(e._queryParams.isDefault(),"should have a tag if it's not a default query."),e._path.toString())}constructor(e,t,n,i){super(),this.repoInfo_=e,this.onDataUpdate_=t,this.authTokenProvider_=n,this.appCheckTokenProvider_=i,this.log_=za("p:rest:"),this.listens_={}}listen(e,t,n,i){const o=e._path.toString();this.log_("Listen called for "+o+" "+e._queryIdentifier);const r=Nc.getListenId_(e,n),s={};this.listens_[r]=s;const a=Pc(e._queryParams);this.restRequest_(o+".json",a,((e,t)=>{let a=t;if(404===e&&(a=null,e=null),null===e&&this.onDataUpdate_(o,a,!1,n),Nt(this.listens_,r)===s){let t;t=e?401===e?"permission_denied":"rest_error:"+e:"ok",i(t,null)}}))}unlisten(e,t){const n=Nc.getListenId_(e,t);delete this.listens_[n]}get(e){const t=Pc(e._queryParams),n=e._path.toString(),i=new vt;return this.restRequest_(n+".json",t,((e,t)=>{let o=t;404===e&&(o=null,e=null),null===e?(this.onDataUpdate_(n,o,!1,null),i.resolve(o)):i.reject(new Error(o))})),i.promise}refreshAuthToken(e){}restRequest_(e,t={},n){return t.format="export",Promise.all([this.authTokenProvider_.getToken(!1),this.appCheckTokenProvider_.getToken(!1)]).then((([i,o])=>{i&&i.accessToken&&(t.auth=i.accessToken),o&&o.token&&(t.ac=o.token);const r=(this.repoInfo_.secure?"https://":"http://")+this.repoInfo_.host+e+"?ns="+this.repoInfo_.namespace+Ft(t);this.log_("Sending REST request for "+r);const s=new XMLHttpRequest;s.onreadystatechange=()=>{if(n&&4===s.readyState){this.log_("REST Response for "+r+" received. status:",s.status,"response:",s.responseText);let e=null;if(s.status>=200&&s.status<300){try{e=Et(s.responseText)}catch(e){Va("Failed to parse JSON response for "+r+": "+s.responseText)}n(null,e)}else 401!==s.status&&404!==s.status&&Va("Got unsuccessful REST response for "+r+" Status: "+s.status),n(s.status);n=null}},s.open("GET",r,!0),s.send()}))}}
|
|
2515
2515
|
/**
|
|
2516
2516
|
* @license
|
|
2517
2517
|
* Copyright 2017 Google LLC
|
|
@@ -2527,7 +2527,7 @@ class Sc{constructor(e){this.index_=e}updateChild(e,t,n,i,o,r){nt(e.isIndexed(th
|
|
|
2527
2527
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2528
2528
|
* See the License for the specific language governing permissions and
|
|
2529
2529
|
* limitations under the License.
|
|
2530
|
-
*/class
|
|
2530
|
+
*/class Ac{constructor(){this.rootNode_=vc.EMPTY_NODE}getNode(e){return this.rootNode_.getChild(e)}updateSnapshot(e,t){this.rootNode_=this.rootNode_.updateChild(e,t)}}
|
|
2531
2531
|
/**
|
|
2532
2532
|
* @license
|
|
2533
2533
|
* Copyright 2017 Google LLC
|
|
@@ -2543,7 +2543,7 @@ class Sc{constructor(e){this.index_=e}updateChild(e,t,n,i,o,r){nt(e.isIndexed(th
|
|
|
2543
2543
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2544
2544
|
* See the License for the specific language governing permissions and
|
|
2545
2545
|
* limitations under the License.
|
|
2546
|
-
*/function
|
|
2546
|
+
*/function Dc(){return{value:null,children:new Map}}function Oc(e,t,n){if(Ol(t))e.value=n,e.children.clear();else if(null!==e.value)e.value=e.value.updateChild(t,n);else{const i=El(t);e.children.has(i)||e.children.set(i,Dc());Oc(e.children.get(i),t=Pl(t),n)}}function Mc(e,t){if(Ol(t))return e.value=null,e.children.clear(),!0;if(null!==e.value){if(e.value.isLeafNode())return!1;{const n=e.value;return e.value=null,n.forEachChild(cc,((t,n)=>{Oc(e,new Sl(t),n)})),Mc(e,t)}}if(e.children.size>0){const n=El(t);if(t=Pl(t),e.children.has(n)){Mc(e.children.get(n),t)&&e.children.delete(n)}return 0===e.children.size}return!0}function Fc(e,t,n){null!==e.value?n(t,e.value):function(e,t){e.children.forEach(((e,n)=>{t(n,e)}))}
|
|
2547
2547
|
/**
|
|
2548
2548
|
* @license
|
|
2549
2549
|
* Copyright 2017 Google LLC
|
|
@@ -2575,7 +2575,7 @@ class Sc{constructor(e){this.index_=e}updateChild(e,t,n,i,o,r){nt(e.isIndexed(th
|
|
|
2575
2575
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2576
2576
|
* See the License for the specific language governing permissions and
|
|
2577
2577
|
* limitations under the License.
|
|
2578
|
-
*/class Uc{constructor(e,t){this.server_=t,this.statsToReport_={},this.statsListener_=new zc(e);const n=1e4+2e4*Math.random();tl(this.reportStats_.bind(this),Math.floor(n))}reportStats_(){const e=this.statsListener_.get(),t={};let n=!1;Ja(e,((e,i)=>{i>0&&
|
|
2578
|
+
*/class Uc{constructor(e,t){this.server_=t,this.statsToReport_={},this.statsListener_=new zc(e);const n=1e4+2e4*Math.random();tl(this.reportStats_.bind(this),Math.floor(n))}reportStats_(){const e=this.statsListener_.get(),t={};let n=!1;Ja(e,((e,i)=>{i>0&&Rt(this.statsToReport_,e)&&(t[e]=i,n=!0)})),n&&this.server_.reportStats(t),tl(this.reportStats_.bind(this),Math.floor(2*Math.random()*3e5))}}
|
|
2579
2579
|
/**
|
|
2580
2580
|
* @license
|
|
2581
2581
|
* Copyright 2017 Google LLC
|
|
@@ -2591,7 +2591,7 @@ class Sc{constructor(e){this.index_=e}updateChild(e,t,n,i,o,r){nt(e.isIndexed(th
|
|
|
2591
2591
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2592
2592
|
* See the License for the specific language governing permissions and
|
|
2593
2593
|
* limitations under the License.
|
|
2594
|
-
*/var jc;function
|
|
2594
|
+
*/var jc;function Vc(e){return{fromUser:!1,fromServer:!0,queryId:e,tagged:!0}}
|
|
2595
2595
|
/**
|
|
2596
2596
|
* @license
|
|
2597
2597
|
* Copyright 2017 Google LLC
|
|
@@ -2607,7 +2607,7 @@ class Sc{constructor(e){this.index_=e}updateChild(e,t,n,i,o,r){nt(e.isIndexed(th
|
|
|
2607
2607
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2608
2608
|
* See the License for the specific language governing permissions and
|
|
2609
2609
|
* limitations under the License.
|
|
2610
|
-
*/!function(e){e[e.OVERWRITE=0]="OVERWRITE",e[e.MERGE=1]="MERGE",e[e.ACK_USER_WRITE=2]="ACK_USER_WRITE",e[e.LISTEN_COMPLETE=3]="LISTEN_COMPLETE"}(jc||(jc={}));class
|
|
2610
|
+
*/!function(e){e[e.OVERWRITE=0]="OVERWRITE",e[e.MERGE=1]="MERGE",e[e.ACK_USER_WRITE=2]="ACK_USER_WRITE",e[e.LISTEN_COMPLETE=3]="LISTEN_COMPLETE"}(jc||(jc={}));class qc{constructor(e,t,n){this.path=e,this.affectedTree=t,this.revert=n,this.type=jc.ACK_USER_WRITE,this.source={fromUser:!0,fromServer:!1,queryId:null,tagged:!1}}operationForChild(e){if(Ol(this.path)){if(null!=this.affectedTree.value)return nt(this.affectedTree.children.isEmpty(),"affectedTree should not have overlapping affected paths."),this;{const t=this.affectedTree.subtree(new Sl(e));return new qc(Tl(),t,this.revert)}}return nt(El(this.path)===e,"operationForChild called for unrelated child."),new qc(Pl(this.path),this.affectedTree,this.revert)}}
|
|
2611
2611
|
/**
|
|
2612
2612
|
* @license
|
|
2613
2613
|
* Copyright 2017 Google LLC
|
|
@@ -2623,7 +2623,7 @@ class Sc{constructor(e){this.index_=e}updateChild(e,t,n,i,o,r){nt(e.isIndexed(th
|
|
|
2623
2623
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2624
2624
|
* See the License for the specific language governing permissions and
|
|
2625
2625
|
* limitations under the License.
|
|
2626
|
-
*/class
|
|
2626
|
+
*/class Bc{constructor(e,t){this.source=e,this.path=t,this.type=jc.LISTEN_COMPLETE}operationForChild(e){return Ol(this.path)?new Bc(this.source,Tl()):new Bc(this.source,Pl(this.path))}}
|
|
2627
2627
|
/**
|
|
2628
2628
|
* @license
|
|
2629
2629
|
* Copyright 2017 Google LLC
|
|
@@ -2639,7 +2639,7 @@ class Sc{constructor(e){this.index_=e}updateChild(e,t,n,i,o,r){nt(e.isIndexed(th
|
|
|
2639
2639
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2640
2640
|
* See the License for the specific language governing permissions and
|
|
2641
2641
|
* limitations under the License.
|
|
2642
|
-
*/class Hc{constructor(e,t,n){this.source=e,this.path=t,this.snap=n,this.type=jc.OVERWRITE}operationForChild(e){return Ol(this.path)?new Hc(this.source,Tl(),this.snap.getImmediateChild(e)):new Hc(this.source,
|
|
2642
|
+
*/class Hc{constructor(e,t,n){this.source=e,this.path=t,this.snap=n,this.type=jc.OVERWRITE}operationForChild(e){return Ol(this.path)?new Hc(this.source,Tl(),this.snap.getImmediateChild(e)):new Hc(this.source,Pl(this.path),this.snap)}}
|
|
2643
2643
|
/**
|
|
2644
2644
|
* @license
|
|
2645
2645
|
* Copyright 2017 Google LLC
|
|
@@ -2655,7 +2655,7 @@ class Sc{constructor(e){this.index_=e}updateChild(e,t,n,i,o,r){nt(e.isIndexed(th
|
|
|
2655
2655
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2656
2656
|
* See the License for the specific language governing permissions and
|
|
2657
2657
|
* limitations under the License.
|
|
2658
|
-
*/class $c{constructor(e,t,n){this.source=e,this.path=t,this.children=n,this.type=jc.MERGE}operationForChild(e){if(Ol(this.path)){const t=this.children.subtree(new Sl(e));return t.isEmpty()?null:t.value?new Hc(this.source,Tl(),t.value):new $c(this.source,Tl(),t)}return nt(El(this.path)===e,"Can't get a merge for a child not on the path of the operation"),new $c(this.source,
|
|
2658
|
+
*/class $c{constructor(e,t,n){this.source=e,this.path=t,this.children=n,this.type=jc.MERGE}operationForChild(e){if(Ol(this.path)){const t=this.children.subtree(new Sl(e));return t.isEmpty()?null:t.value?new Hc(this.source,Tl(),t.value):new $c(this.source,Tl(),t)}return nt(El(this.path)===e,"Can't get a merge for a child not on the path of the operation"),new $c(this.source,Pl(this.path),this.children)}toString(){return"Operation("+this.path+": "+this.source.toString()+" merge: "+this.children.toString()+")"}}
|
|
2659
2659
|
/**
|
|
2660
2660
|
* @license
|
|
2661
2661
|
* Copyright 2017 Google LLC
|
|
@@ -2703,7 +2703,7 @@ class Sc{constructor(e){this.index_=e}updateChild(e,t,n,i,o,r){nt(e.isIndexed(th
|
|
|
2703
2703
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2704
2704
|
* See the License for the specific language governing permissions and
|
|
2705
2705
|
* limitations under the License.
|
|
2706
|
-
*/(e,t,n))),s.forEach((n=>{const i=function(e,t,n){return"value"===t.type||"child_removed"===t.type||(t.prevName=n.getPredecessorChildName(t.childName,t.snapshotNode,e.index_)),t}(e,n,r);o.forEach((o=>{o.respondsTo(n.type)&&t.push(o.createEvent(i,e.query_))}))}))}function Yc(e,t){return{eventCache:e,serverCache:t}}function Jc(e,t,n,i){return Yc(new Wc(t,n,i),e.serverCache)}function
|
|
2706
|
+
*/(e,t,n))),s.forEach((n=>{const i=function(e,t,n){return"value"===t.type||"child_removed"===t.type||(t.prevName=n.getPredecessorChildName(t.childName,t.snapshotNode,e.index_)),t}(e,n,r);o.forEach((o=>{o.respondsTo(n.type)&&t.push(o.createEvent(i,e.query_))}))}))}function Yc(e,t){return{eventCache:e,serverCache:t}}function Jc(e,t,n,i){return Yc(new Wc(t,n,i),e.serverCache)}function Zc(e,t,n,i){return Yc(e.eventCache,new Wc(t,n,i))}function Qc(e){return e.eventCache.isFullyInitialized()?e.eventCache.getNode():null}function Xc(e){return e.serverCache.isFullyInitialized()?e.serverCache.getNode():null}
|
|
2707
2707
|
/**
|
|
2708
2708
|
* @license
|
|
2709
2709
|
* Copyright 2017 Google LLC
|
|
@@ -2719,7 +2719,7 @@ class Sc{constructor(e){this.index_=e}updateChild(e,t,n,i,o,r){nt(e.isIndexed(th
|
|
|
2719
2719
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2720
2720
|
* See the License for the specific language governing permissions and
|
|
2721
2721
|
* limitations under the License.
|
|
2722
|
-
*/let ed;class td{static fromObject(e){let t=new td(null);return Ja(e,((e,n)=>{t=t.set(new Sl(e),n)})),t}constructor(e,t=(()=>(ed||(ed=new
|
|
2722
|
+
*/let ed;class td{static fromObject(e){let t=new td(null);return Ja(e,((e,n)=>{t=t.set(new Sl(e),n)})),t}constructor(e,t=(()=>(ed||(ed=new Xl(Wa)),ed))()){this.value=e,this.children=t}isEmpty(){return null===this.value&&this.children.isEmpty()}findRootMostMatchingPathAndValue(e,t){if(null!=this.value&&t(this.value))return{path:Tl(),value:this.value};if(Ol(e))return null;{const n=El(e),i=this.children.get(n);if(null!==i){const o=i.findRootMostMatchingPathAndValue(Pl(e),t);if(null!=o){return{path:Dl(new Sl(n),o.path),value:o.value}}return null}return null}}findRootMostValueAndPath(e){return this.findRootMostMatchingPathAndValue(e,(()=>!0))}subtree(e){if(Ol(e))return this;{const t=El(e),n=this.children.get(t);return null!==n?n.subtree(Pl(e)):new td(null)}}set(e,t){if(Ol(e))return new td(t,this.children);{const n=El(e),i=(this.children.get(n)||new td(null)).set(Pl(e),t),o=this.children.insert(n,i);return new td(this.value,o)}}remove(e){if(Ol(e))return this.children.isEmpty()?new td(null):new td(null,this.children);{const t=El(e),n=this.children.get(t);if(n){const i=n.remove(Pl(e));let o;return o=i.isEmpty()?this.children.remove(t):this.children.insert(t,i),null===this.value&&o.isEmpty()?new td(null):new td(this.value,o)}return this}}get(e){if(Ol(e))return this.value;{const t=El(e),n=this.children.get(t);return n?n.get(Pl(e)):null}}setTree(e,t){if(Ol(e))return t;{const n=El(e),i=(this.children.get(n)||new td(null)).setTree(Pl(e),t);let o;return o=i.isEmpty()?this.children.remove(n):this.children.insert(n,i),new td(this.value,o)}}fold(e){return this.fold_(Tl(),e)}fold_(e,t){const n={};return this.children.inorderTraversal(((i,o)=>{n[i]=o.fold_(Dl(e,i),t)})),t(e,this.value,n)}findOnPath(e,t){return this.findOnPath_(e,Tl(),t)}findOnPath_(e,t,n){const i=!!this.value&&n(t,this.value);if(i)return i;if(Ol(e))return null;{const i=El(e),o=this.children.get(i);return o?o.findOnPath_(Pl(e),Dl(t,i),n):null}}foreachOnPath(e,t){return this.foreachOnPath_(e,Tl(),t)}foreachOnPath_(e,t,n){if(Ol(e))return this;{this.value&&n(t,this.value);const i=El(e),o=this.children.get(i);return o?o.foreachOnPath_(Pl(e),Dl(t,i),n):new td(null)}}foreach(e){this.foreach_(Tl(),e)}foreach_(e,t){this.children.inorderTraversal(((n,i)=>{i.foreach_(Dl(e,n),t)})),this.value&&t(e,this.value)}foreachChild(e){this.children.inorderTraversal(((t,n)=>{n.value&&e(t,n.value)}))}}
|
|
2723
2723
|
/**
|
|
2724
2724
|
* @license
|
|
2725
2725
|
* Copyright 2017 Google LLC
|
|
@@ -2735,7 +2735,7 @@ class Sc{constructor(e){this.index_=e}updateChild(e,t,n,i,o,r){nt(e.isIndexed(th
|
|
|
2735
2735
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2736
2736
|
* See the License for the specific language governing permissions and
|
|
2737
2737
|
* limitations under the License.
|
|
2738
|
-
*/class nd{constructor(e){this.writeTree_=e}static empty(){return new nd(new td(null))}}function id(e,t,n){if(Ol(t))return new nd(new td(n));{const i=e.writeTree_.findRootMostValueAndPath(t);if(null!=i){const o=i.path;let r=i.value;const s=Ml(o,t);return r=r.updateChild(s,n),new nd(e.writeTree_.set(o,r))}{const i=new td(n),o=e.writeTree_.setTree(t,i);return new nd(o)}}}function od(e,t,n){let i=e;return Ja(n,((e,n)=>{i=id(i,
|
|
2738
|
+
*/class nd{constructor(e){this.writeTree_=e}static empty(){return new nd(new td(null))}}function id(e,t,n){if(Ol(t))return new nd(new td(n));{const i=e.writeTree_.findRootMostValueAndPath(t);if(null!=i){const o=i.path;let r=i.value;const s=Ml(o,t);return r=r.updateChild(s,n),new nd(e.writeTree_.set(o,r))}{const i=new td(n),o=e.writeTree_.setTree(t,i);return new nd(o)}}}function od(e,t,n){let i=e;return Ja(n,((e,n)=>{i=id(i,Dl(t,e),n)})),i}function rd(e,t){if(Ol(t))return nd.empty();{const n=e.writeTree_.setTree(t,new td(null));return new nd(n)}}function sd(e,t){return null!=ad(e,t)}function ad(e,t){const n=e.writeTree_.findRootMostValueAndPath(t);return null!=n?e.writeTree_.get(n.path).getChild(Ml(n.path,t)):null}function ld(e){const t=[],n=e.writeTree_.value;return null!=n?n.isLeafNode()||n.forEachChild(cc,((e,n)=>{t.push(new Wl(e,n))})):e.writeTree_.children.inorderTraversal(((e,n)=>{null!=n.value&&t.push(new Wl(e,n.value))})),t}function cd(e,t){if(Ol(t))return e;{const n=ad(e,t);return new nd(null!=n?new td(n):e.writeTree_.subtree(t))}}function dd(e){return e.writeTree_.isEmpty()}function hd(e,t){return ud(Tl(),e.writeTree_,t)}function ud(e,t,n){if(null!=t.value)return n.updateChild(e,t.value);{let i=null;return t.children.inorderTraversal(((t,o)=>{".priority"===t?(nt(null!==o.value,"Priority writes must always be leaf nodes"),i=o.value):n=ud(Dl(e,t),o,n)})),n.getChild(e).isEmpty()||null===i||(n=n.updateChild(Dl(e,".priority"),i)),n}}
|
|
2739
2739
|
/**
|
|
2740
2740
|
* @license
|
|
2741
2741
|
* Copyright 2017 Google LLC
|
|
@@ -2751,7 +2751,7 @@ class Sc{constructor(e){this.index_=e}updateChild(e,t,n,i,o,r){nt(e.isIndexed(th
|
|
|
2751
2751
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2752
2752
|
* See the License for the specific language governing permissions and
|
|
2753
2753
|
* limitations under the License.
|
|
2754
|
-
*/function pd(e,t){return Sd(t,e)}function gd(e,t){const n=e.allWrites.findIndex((e=>e.writeId===t));nt(n>=0,"removeWrite called with nonexistent writeId.");const i=e.allWrites[n];e.allWrites.splice(n,1);let o=i.visible,r=!1,s=e.allWrites.length-1;for(;o&&s>=0;){const t=e.allWrites[s];t.visible&&(s>=n&&fd(t,i.path)?o=!1:Ul(i.path,t.path)&&(r=!0)),s--}if(o){if(r)return function(e){e.visibleWrites=vd(e.allWrites,md,Tl()),e.allWrites.length>0?e.lastWriteId=e.allWrites[e.allWrites.length-1].writeId:e.lastWriteId=-1}(e),!0;if(i.snap)e.visibleWrites=rd(e.visibleWrites,i.path);else{Ja(i.children,(t=>{e.visibleWrites=rd(e.visibleWrites,
|
|
2754
|
+
*/function pd(e,t){return Sd(t,e)}function gd(e,t){const n=e.allWrites.findIndex((e=>e.writeId===t));nt(n>=0,"removeWrite called with nonexistent writeId.");const i=e.allWrites[n];e.allWrites.splice(n,1);let o=i.visible,r=!1,s=e.allWrites.length-1;for(;o&&s>=0;){const t=e.allWrites[s];t.visible&&(s>=n&&fd(t,i.path)?o=!1:Ul(i.path,t.path)&&(r=!0)),s--}if(o){if(r)return function(e){e.visibleWrites=vd(e.allWrites,md,Tl()),e.allWrites.length>0?e.lastWriteId=e.allWrites[e.allWrites.length-1].writeId:e.lastWriteId=-1}(e),!0;if(i.snap)e.visibleWrites=rd(e.visibleWrites,i.path);else{Ja(i.children,(t=>{e.visibleWrites=rd(e.visibleWrites,Dl(i.path,t))}))}return!0}return!1}function fd(e,t){if(e.snap)return Ul(e.path,t);for(const n in e.children)if(e.children.hasOwnProperty(n)&&Ul(Dl(e.path,n),t))return!0;return!1}function md(e){return e.visible}function vd(e,t,n){let i=nd.empty();for(let o=0;o<e.length;++o){const r=e[o];if(t(r)){const e=r.path;let t;if(r.snap)Ul(n,e)?(t=Ml(n,e),i=id(i,t,r.snap)):Ul(e,n)&&(t=Ml(e,n),i=id(i,Tl(),r.snap.getChild(t)));else{if(!r.children)throw it("WriteRecord should have .snap or .children");if(Ul(n,e))t=Ml(n,e),i=od(i,t,r.children);else if(Ul(e,n))if(t=Ml(e,n),Ol(t))i=od(i,Tl(),r.children);else{const e=Nt(r.children,El(t));if(e){const n=e.getChild(Pl(t));i=id(i,Tl(),n)}}}}}return i}function bd(e,t,n,i,o){if(i||o){const r=cd(e.visibleWrites,t);if(!o&&dd(r))return n;if(o||null!=n||sd(r,Tl())){const r=function(e){return(e.visible||o)&&(!i||!~i.indexOf(e.writeId))&&(Ul(e.path,t)||Ul(t,e.path))};return hd(vd(e.allWrites,r,t),n||vc.EMPTY_NODE)}return null}{const i=ad(e.visibleWrites,t);if(null!=i)return i;{const i=cd(e.visibleWrites,t);if(dd(i))return n;if(null!=n||sd(i,Tl())){return hd(i,n||vc.EMPTY_NODE)}return null}}}function wd(e,t,n,i){return bd(e.writeTree,e.treePath,t,n,i)}function xd(e,t){return function(e,t,n){let i=vc.EMPTY_NODE;const o=ad(e.visibleWrites,t);if(o)return o.isLeafNode()||o.forEachChild(cc,((e,t)=>{i=i.updateImmediateChild(e,t)})),i;if(n){const o=cd(e.visibleWrites,t);return n.forEachChild(cc,((e,t)=>{const n=hd(cd(o,new Sl(e)),t);i=i.updateImmediateChild(e,n)})),ld(o).forEach((e=>{i=i.updateImmediateChild(e.name,e.node)})),i}return ld(cd(e.visibleWrites,t)).forEach((e=>{i=i.updateImmediateChild(e.name,e.node)})),i}(e.writeTree,e.treePath,t)}function yd(e,t,n,i){return function(e,t,n,i,o){nt(i||o,"Either existingEventSnap or existingServerSnap must exist");const r=Dl(t,n);if(sd(e.visibleWrites,r))return null;{const t=cd(e.visibleWrites,r);return dd(t)?o.getChild(n):hd(t,o.getChild(n))}}(e.writeTree,e.treePath,t,n,i)}function _d(e,t){return function(e,t){return ad(e.visibleWrites,t)}(e.writeTree,Dl(e.treePath,t))}function kd(e,t,n,i,o,r){return function(e,t,n,i,o,r,s){let a;const l=cd(e.visibleWrites,t),c=ad(l,Tl());if(null!=c)a=c;else{if(null==n)return[];a=hd(l,n)}if(a=a.withIndex(s),a.isEmpty()||a.isLeafNode())return[];{const e=[],t=s.getCompare(),n=r?a.getReverseIteratorFrom(i,s):a.getIteratorFrom(i,s);let l=n.getNext();for(;l&&e.length<o;)0!==t(l,i)&&e.push(l),l=n.getNext();return e}}(e.writeTree,e.treePath,t,n,i,o,r)}function Cd(e,t,n){return function(e,t,n,i){const o=Dl(t,n),r=ad(e.visibleWrites,o);if(null!=r)return r;if(i.isCompleteForChild(n))return hd(cd(e.visibleWrites,o),i.getNode().getImmediateChild(n));return null}(e.writeTree,e.treePath,t,n)}function Id(e,t){return Sd(Dl(e.treePath,t),e.writeTree)}function Sd(e,t){return{treePath:e,writeTree:t}}
|
|
2755
2755
|
/**
|
|
2756
2756
|
* @license
|
|
2757
2757
|
* Copyright 2017 Google LLC
|
|
@@ -2783,7 +2783,7 @@ class Sc{constructor(e){this.index_=e}updateChild(e,t,n,i,o,r){nt(e.isIndexed(th
|
|
|
2783
2783
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2784
2784
|
* See the License for the specific language governing permissions and
|
|
2785
2785
|
* limitations under the License.
|
|
2786
|
-
*/const Ed=new class{getCompleteChild(e){return null}getChildAfterChild(e,t,n){return null}};class
|
|
2786
|
+
*/const Ed=new class{getCompleteChild(e){return null}getChildAfterChild(e,t,n){return null}};class Ld{constructor(e,t,n=null){this.writes_=e,this.viewCache_=t,this.optCompleteServerCache_=n}getCompleteChild(e){const t=this.viewCache_.eventCache;if(t.isCompleteForChild(e))return t.getNode().getImmediateChild(e);{const t=null!=this.optCompleteServerCache_?new Wc(this.optCompleteServerCache_,!0,!1):this.viewCache_.serverCache;return Cd(this.writes_,e,t)}}getChildAfterChild(e,t,n){const i=null!=this.optCompleteServerCache_?this.optCompleteServerCache_:Xc(this.viewCache_),o=kd(this.writes_,i,t,1,n,e);return 0===o.length?null:o[0]}}
|
|
2787
2787
|
/**
|
|
2788
2788
|
* @license
|
|
2789
2789
|
* Copyright 2017 Google LLC
|
|
@@ -2799,7 +2799,7 @@ class Sc{constructor(e){this.index_=e}updateChild(e,t,n,i,o,r){nt(e.isIndexed(th
|
|
|
2799
2799
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2800
2800
|
* See the License for the specific language governing permissions and
|
|
2801
2801
|
* limitations under the License.
|
|
2802
|
-
*/function
|
|
2802
|
+
*/function Pd(e,t,n,i,o){const r=new Td;let s,a;if(n.type===jc.OVERWRITE){const l=n;l.source.fromUser?s=Ad(e,t,l.path,l.snap,i,o,r):(nt(l.source.fromServer,"Unknown source."),a=l.source.tagged||t.serverCache.isFiltered()&&!Ol(l.path),s=Nd(e,t,l.path,l.snap,i,o,a,r))}else if(n.type===jc.MERGE){const l=n;l.source.fromUser?s=function(e,t,n,i,o,r,s){let a=t;return i.foreach(((i,l)=>{const c=Dl(n,i);Dd(t,El(c))&&(a=Ad(e,a,c,l,o,r,s))})),i.foreach(((i,l)=>{const c=Dl(n,i);Dd(t,El(c))||(a=Ad(e,a,c,l,o,r,s))})),a}(e,t,l.path,l.children,i,o,r):(nt(l.source.fromServer,"Unknown source."),a=l.source.tagged||t.serverCache.isFiltered(),s=Md(e,t,l.path,l.children,i,o,a,r))}else if(n.type===jc.ACK_USER_WRITE){const a=n;s=a.revert?function(e,t,n,i,o,r){let s;if(null!=_d(i,n))return t;{const a=new Ld(i,t,o),l=t.eventCache.getNode();let c;if(Ol(n)||".priority"===El(n)){let n;if(t.serverCache.isFullyInitialized())n=wd(i,Xc(t));else{const e=t.serverCache.getNode();nt(e instanceof vc,"serverChildren would be complete if leaf node"),n=xd(i,e)}c=e.filter.updateFullNode(l,n,r)}else{const o=El(n);let d=Cd(i,o,t.serverCache);null==d&&t.serverCache.isCompleteForChild(o)&&(d=l.getImmediateChild(o)),c=null!=d?e.filter.updateChild(l,o,d,Pl(n),a,r):t.eventCache.getNode().hasChild(o)?e.filter.updateChild(l,o,vc.EMPTY_NODE,Pl(n),a,r):l,c.isEmpty()&&t.serverCache.isFullyInitialized()&&(s=wd(i,Xc(t)),s.isLeafNode()&&(c=e.filter.updateFullNode(c,s,r)))}return s=t.serverCache.isFullyInitialized()||null!=_d(i,Tl()),Jc(t,c,s,e.filter.filtersNodes())}}
|
|
2803
2803
|
/**
|
|
2804
2804
|
* @license
|
|
2805
2805
|
* Copyright 2017 Google LLC
|
|
@@ -2815,7 +2815,7 @@ class Sc{constructor(e){this.index_=e}updateChild(e,t,n,i,o,r){nt(e.isIndexed(th
|
|
|
2815
2815
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2816
2816
|
* See the License for the specific language governing permissions and
|
|
2817
2817
|
* limitations under the License.
|
|
2818
|
-
*/(e,t,a.path,i,o,r):function(e,t,n,i,o,r,s){if(null!=_d(o,n))return t;const a=t.serverCache.isFiltered(),l=t.serverCache;if(null!=i.value){if(Ol(n)&&l.isFullyInitialized()||l.isCompleteForPath(n))return Nd(e,t,n,l.getNode().getChild(n),o,r,a,s);if(Ol(n)){let i=new td(null);return l.getNode().forEachChild(Jl,((e,t)=>{i=i.set(new Sl(e),t)})),Md(e,t,n,i,o,r,a,s)}return t}{let c=new td(null);return i.foreach(((e,t)=>{const i=
|
|
2818
|
+
*/(e,t,a.path,i,o,r):function(e,t,n,i,o,r,s){if(null!=_d(o,n))return t;const a=t.serverCache.isFiltered(),l=t.serverCache;if(null!=i.value){if(Ol(n)&&l.isFullyInitialized()||l.isCompleteForPath(n))return Nd(e,t,n,l.getNode().getChild(n),o,r,a,s);if(Ol(n)){let i=new td(null);return l.getNode().forEachChild(Jl,((e,t)=>{i=i.set(new Sl(e),t)})),Md(e,t,n,i,o,r,a,s)}return t}{let c=new td(null);return i.foreach(((e,t)=>{const i=Dl(n,e);l.isCompleteForPath(i)&&(c=c.set(e,l.getNode().getChild(i)))})),Md(e,t,n,c,o,r,a,s)}}(e,t,a.path,a.affectedTree,i,o,r)}else{if(n.type!==jc.LISTEN_COMPLETE)throw it("Unknown operation type: "+n.type);s=function(e,t,n,i,o){const r=t.serverCache,s=Zc(t,r.getNode(),r.isFullyInitialized()||Ol(n),r.isFiltered());return Rd(e,s,n,i,Ed,o)}(e,t,n.path,i,r)}const l=r.getChanges();return function(e,t,n){const i=t.eventCache;if(i.isFullyInitialized()){const o=i.getNode().isLeafNode()||i.getNode().isEmpty(),r=Qc(e);(n.length>0||!e.eventCache.isFullyInitialized()||o&&!i.getNode().equals(r)||!i.getNode().getPriority().equals(r.getPriority()))&&n.push(_c(Qc(t)))}}(t,s,l),{viewCache:s,changes:l}}function Rd(e,t,n,i,o,r){const s=t.eventCache;if(null!=_d(i,n))return t;{let a,l;if(Ol(n))if(nt(t.serverCache.isFullyInitialized(),"If change path is empty, we must have complete server data"),t.serverCache.isFiltered()){const n=Xc(t),o=xd(i,n instanceof vc?n:vc.EMPTY_NODE);a=e.filter.updateFullNode(t.eventCache.getNode(),o,r)}else{const n=wd(i,Xc(t));a=e.filter.updateFullNode(t.eventCache.getNode(),n,r)}else{const c=El(n);if(".priority"===c){nt(1===Ll(n),"Can't have a priority with additional path components");const o=s.getNode();l=t.serverCache.getNode();const r=yd(i,n,o,l);a=null!=r?e.filter.updatePriority(o,r):s.getNode()}else{const d=Pl(n);let h;if(s.isCompleteForChild(c)){l=t.serverCache.getNode();const e=yd(i,n,s.getNode(),l);h=null!=e?s.getNode().getImmediateChild(c).updateChild(d,e):s.getNode().getImmediateChild(c)}else h=Cd(i,c,t.serverCache);a=null!=h?e.filter.updateChild(s.getNode(),c,h,d,o,r):s.getNode()}}return Jc(t,a,s.isFullyInitialized()||Ol(n),e.filter.filtersNodes())}}function Nd(e,t,n,i,o,r,s,a){const l=t.serverCache;let c;const d=s?e.filter:e.filter.getIndexedFilter();if(Ol(n))c=d.updateFullNode(l.getNode(),i,null);else if(d.filtersNodes()&&!l.isFiltered()){const e=l.getNode().updateChild(n,i);c=d.updateFullNode(l.getNode(),e,null)}else{const e=El(n);if(!l.isCompleteForPath(n)&&Ll(n)>1)return t;const o=Pl(n),r=l.getNode().getImmediateChild(e).updateChild(o,i);c=".priority"===e?d.updatePriority(l.getNode(),r):d.updateChild(l.getNode(),e,r,o,Ed,null)}const h=Zc(t,c,l.isFullyInitialized()||Ol(n),d.filtersNodes());return Rd(e,h,n,o,new Ld(o,h,r),a)}function Ad(e,t,n,i,o,r,s){const a=t.eventCache;let l,c;const d=new Ld(o,t,r);if(Ol(n))c=e.filter.updateFullNode(t.eventCache.getNode(),i,s),l=Jc(t,c,!0,e.filter.filtersNodes());else{const o=El(n);if(".priority"===o)c=e.filter.updatePriority(t.eventCache.getNode(),i),l=Jc(t,c,a.isFullyInitialized(),a.isFiltered());else{const r=Pl(n),c=a.getNode().getImmediateChild(o);let h;if(Ol(r))h=i;else{const e=d.getCompleteChild(o);h=null!=e?".priority"===Rl(r)&&e.getChild(Al(r)).isEmpty()?e:e.updateChild(r,i):vc.EMPTY_NODE}if(c.equals(h))l=t;else{l=Jc(t,e.filter.updateChild(a.getNode(),o,h,r,d,s),a.isFullyInitialized(),e.filter.filtersNodes())}}}return l}function Dd(e,t){return e.eventCache.isCompleteForChild(t)}function Od(e,t,n){return n.foreach(((e,n)=>{t=t.updateChild(e,n)})),t}function Md(e,t,n,i,o,r,s,a){if(t.serverCache.getNode().isEmpty()&&!t.serverCache.isFullyInitialized())return t;let l,c=t;l=Ol(n)?i:new td(null).setTree(n,i);const d=t.serverCache.getNode();return l.children.inorderTraversal(((n,i)=>{if(d.hasChild(n)){const l=Od(0,t.serverCache.getNode().getImmediateChild(n),i);c=Nd(e,c,new Sl(n),l,o,r,s,a)}})),l.children.inorderTraversal(((n,i)=>{const l=!t.serverCache.isCompleteForChild(n)&&null===i.value;if(!d.hasChild(n)&&!l){const l=Od(0,t.serverCache.getNode().getImmediateChild(n),i);c=Nd(e,c,new Sl(n),l,o,r,s,a)}})),c}let Fd,zd,Ud=class{constructor(e,t){this.query_=e,this.eventRegistrations_=[];const n=this.query_._queryParams,i=new Sc(n.getIndex()),o=(r=n).loadsAllData()?new Sc(r.getIndex()):r.hasLimit()?new Ec(r):new Tc(r);var r;this.processor_=function(e){return{filter:e}}(o);const s=t.serverCache,a=t.eventCache,l=i.updateFullNode(vc.EMPTY_NODE,s.getNode(),null),c=o.updateFullNode(vc.EMPTY_NODE,a.getNode(),null),d=new Wc(l,s.isFullyInitialized(),i.filtersNodes()),h=new Wc(c,a.isFullyInitialized(),o.filtersNodes());this.viewCache_=Yc(h,d),this.eventGenerator_=new Gc(this.query_)}get query(){return this.query_}};function jd(e,t){const n=Xc(e.viewCache_);return n&&(e.query._queryParams.loadsAllData()||!Ol(t)&&!n.getImmediateChild(El(t)).isEmpty())?n.getChild(t):null}function Vd(e){return 0===e.eventRegistrations_.length}function qd(e,t,n){const i=[];if(n){nt(null==t,"A cancel should cancel all event registrations.");const o=e.query._path;e.eventRegistrations_.forEach((e=>{const t=e.createCancelEvent(n,o);t&&i.push(t)}))}if(t){let n=[];for(let i=0;i<e.eventRegistrations_.length;++i){const o=e.eventRegistrations_[i];if(o.matches(t)){if(t.hasAnyCallback()){n=n.concat(e.eventRegistrations_.slice(i+1));break}}else n.push(o)}e.eventRegistrations_=n}else e.eventRegistrations_=[];return i}function Bd(e,t,n,i){t.type===jc.MERGE&&null!==t.source.queryId&&(nt(Xc(e.viewCache_),"We should always have a full cache before handling merges"),nt(Qc(e.viewCache_),"Missing event cache, even though we have a server cache"));const o=e.viewCache_,r=Pd(e.processor_,o,t,n,i);var s,a;return s=e.processor_,a=r.viewCache,nt(a.eventCache.getNode().isIndexed(s.filter.getIndex()),"Event snap not indexed"),nt(a.serverCache.getNode().isIndexed(s.filter.getIndex()),"Server snap not indexed"),nt(r.viewCache.serverCache.isFullyInitialized()||!o.serverCache.isFullyInitialized(),"Once a server snap is complete, it should never go back"),e.viewCache_=r.viewCache,Hd(e,r.changes,r.viewCache.eventCache.getNode(),null)}function Hd(e,t,n,i){const o=i?[i]:e.eventRegistrations_;return function(e,t,n,i){const o=[],r=[];return t.forEach((t=>{var n;"child_changed"===t.type&&e.index_.indexedValueChanged(t.oldSnap,t.snapshotNode)&&r.push((n=t.childName,{type:"child_moved",snapshotNode:t.snapshotNode,childName:n}))})),Kc(e,o,"child_removed",t,i,n),Kc(e,o,"child_added",t,i,n),Kc(e,o,"child_moved",r,i,n),Kc(e,o,"child_changed",t,i,n),Kc(e,o,"value",t,i,n),o}(e.eventGenerator_,t,n,o)}
|
|
2819
2819
|
/**
|
|
2820
2820
|
* @license
|
|
2821
2821
|
* Copyright 2017 Google LLC
|
|
@@ -2831,7 +2831,7 @@ class Sc{constructor(e){this.index_=e}updateChild(e,t,n,i,o,r){nt(e.isIndexed(th
|
|
|
2831
2831
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2832
2832
|
* See the License for the specific language governing permissions and
|
|
2833
2833
|
* limitations under the License.
|
|
2834
|
-
*/class $d{constructor(){this.views=new Map}}function Wd(e,t,n,i){const o=t.source.queryId;if(null!==o){const r=e.views.get(o);return nt(null!=r,"SyncTree gave us an op for an invalid query."),
|
|
2834
|
+
*/class $d{constructor(){this.views=new Map}}function Wd(e,t,n,i){const o=t.source.queryId;if(null!==o){const r=e.views.get(o);return nt(null!=r,"SyncTree gave us an op for an invalid query."),Bd(r,t,n,i)}{let o=[];for(const r of e.views.values())o=o.concat(Bd(r,t,n,i));return o}}function Gd(e,t,n,i,o,r){const s=function(e,t,n,i,o){const r=t._queryIdentifier,s=e.views.get(r);if(!s){let e=wd(n,o?i:null),r=!1;e?r=!0:i instanceof vc?(e=xd(n,i),r=!1):(e=vc.EMPTY_NODE,r=!1);const s=Yc(new Wc(e,r,!1),new Wc(i,o,!1));return new Ud(t,s)}return s}(e,t,i,o,r);return e.views.has(t._queryIdentifier)||e.views.set(t._queryIdentifier,s),function(e,t){e.eventRegistrations_.push(t)}(s,n),function(e,t){const n=e.viewCache_.eventCache,i=[];n.getNode().isLeafNode()||n.getNode().forEachChild(cc,((e,t)=>{i.push(kc(e,t))}));return n.isFullyInitialized()&&i.push(_c(n.getNode())),Hd(e,i,n.getNode(),t)}(s,n)}function Kd(e,t,n,i){const o=t._queryIdentifier,r=[];let s=[];const a=Xd(e);if("default"===o)for(const[t,o]of e.views.entries())s=s.concat(qd(o,n,i)),Vd(o)&&(e.views.delete(t),o.query._queryParams.loadsAllData()||r.push(o.query));else{const t=e.views.get(o);t&&(s=s.concat(qd(t,n,i)),Vd(t)&&(e.views.delete(o),t.query._queryParams.loadsAllData()||r.push(t.query)))}return a&&!Xd(e)&&r.push(new(nt(Fd,"Reference.ts has not been loaded"),Fd)(t._repo,t._path)),{removed:r,events:s}}function Yd(e){const t=[];for(const n of e.views.values())n.query._queryParams.loadsAllData()||t.push(n);return t}function Jd(e,t){let n=null;for(const i of e.views.values())n=n||jd(i,t);return n}function Zd(e,t){if(t._queryParams.loadsAllData())return eh(e);{const n=t._queryIdentifier;return e.views.get(n)}}function Qd(e,t){return null!=Zd(e,t)}function Xd(e){return null!=eh(e)}function eh(e){for(const t of e.views.values())if(t.query._queryParams.loadsAllData())return t;return null}
|
|
2835
2835
|
/**
|
|
2836
2836
|
* @license
|
|
2837
2837
|
* Copyright 2017 Google LLC
|
|
@@ -2847,7 +2847,7 @@ class Sc{constructor(e){this.index_=e}updateChild(e,t,n,i,o,r){nt(e.isIndexed(th
|
|
|
2847
2847
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2848
2848
|
* See the License for the specific language governing permissions and
|
|
2849
2849
|
* limitations under the License.
|
|
2850
|
-
*/let th=1;class nh{constructor(e){this.listenProvider_=e,this.syncPointTree_=new td(null),this.pendingWriteTree_={visibleWrites:nd.empty(),allWrites:[],lastWriteId:-1},this.tagToQueryMap=new Map,this.queryToTagMap=new Map}}function ih(e,t,n,i,o){return function(e,t,n,i,o){nt(i>e.lastWriteId,"Stacking an older write on top of newer ones"),void 0===o&&(o=!0),e.allWrites.push({path:t,snap:n,writeId:i,visible:o}),o&&(e.visibleWrites=id(e.visibleWrites,t,n)),e.lastWriteId=i}(e.pendingWriteTree_,t,n,i,o),o?ch(e,new Hc({fromUser:!0,fromServer:!1,queryId:null,tagged:!1},t,n)):[]}function oh(e,t,n=!1){const i=function(e,t){for(let n=0;n<e.allWrites.length;n++){const i=e.allWrites[n];if(i.writeId===t)return i}return null}(e.pendingWriteTree_,t);if(gd(e.pendingWriteTree_,t)){let t=new td(null);return null!=i.snap?t=t.set(Tl(),!0):Ja(i.children,(e=>{t=t.set(new Sl(e),!0)})),ch(e,new
|
|
2850
|
+
*/let th=1;class nh{constructor(e){this.listenProvider_=e,this.syncPointTree_=new td(null),this.pendingWriteTree_={visibleWrites:nd.empty(),allWrites:[],lastWriteId:-1},this.tagToQueryMap=new Map,this.queryToTagMap=new Map}}function ih(e,t,n,i,o){return function(e,t,n,i,o){nt(i>e.lastWriteId,"Stacking an older write on top of newer ones"),void 0===o&&(o=!0),e.allWrites.push({path:t,snap:n,writeId:i,visible:o}),o&&(e.visibleWrites=id(e.visibleWrites,t,n)),e.lastWriteId=i}(e.pendingWriteTree_,t,n,i,o),o?ch(e,new Hc({fromUser:!0,fromServer:!1,queryId:null,tagged:!1},t,n)):[]}function oh(e,t,n=!1){const i=function(e,t){for(let n=0;n<e.allWrites.length;n++){const i=e.allWrites[n];if(i.writeId===t)return i}return null}(e.pendingWriteTree_,t);if(gd(e.pendingWriteTree_,t)){let t=new td(null);return null!=i.snap?t=t.set(Tl(),!0):Ja(i.children,(e=>{t=t.set(new Sl(e),!0)})),ch(e,new qc(i.path,t,n))}return[]}function rh(e,t,n){return ch(e,new Hc({fromUser:!1,fromServer:!0,queryId:null,tagged:!1},t,n))}function sh(e,t,n,i,o=!1){const r=t._path,s=e.syncPointTree_.get(r);let a=[];if(s&&("default"===t._queryIdentifier||Qd(s,t))){const l=Kd(s,t,n,i);0===s.views.size&&(e.syncPointTree_=e.syncPointTree_.remove(r));const c=l.removed;if(a=l.events,!o){const n=-1!==c.findIndex((e=>e._queryParams.loadsAllData())),o=e.syncPointTree_.findOnPath(r,((e,t)=>Xd(t)));if(n&&!o){const t=e.syncPointTree_.subtree(r);if(!t.isEmpty()){const n=function(e){return e.fold(((e,t,n)=>{if(t&&Xd(t)){return[eh(t)]}{let e=[];return t&&(e=Yd(t)),Ja(n,((t,n)=>{e=e.concat(n)})),e}}))}(t);for(let t=0;t<n.length;++t){const i=n[t],o=i.query,r=uh(e,i);e.listenProvider_.startListening(bh(o),ph(e,o),r.hashFn,r.onComplete)}}}if(!o&&c.length>0&&!i)if(n){const n=null;e.listenProvider_.stopListening(bh(t),n)}else c.forEach((t=>{const n=e.queryToTagMap.get(gh(t));e.listenProvider_.stopListening(bh(t),n)}))}!function(e,t){for(let n=0;n<t.length;++n){const i=t[n];if(!i._queryParams.loadsAllData()){const t=gh(i),n=e.queryToTagMap.get(t);e.queryToTagMap.delete(t),e.tagToQueryMap.delete(n)}}}(e,c)}return a}function ah(e,t,n,i=!1){const o=t._path;let r=null,s=!1;e.syncPointTree_.foreachOnPath(o,((e,t)=>{const n=Ml(e,o);r=r||Jd(t,n),s=s||Xd(t)}));let a,l=e.syncPointTree_.get(o);if(l?(s=s||Xd(l),r=r||Jd(l,Tl())):(l=new $d,e.syncPointTree_=e.syncPointTree_.set(o,l)),null!=r)a=!0;else{a=!1,r=vc.EMPTY_NODE;e.syncPointTree_.subtree(o).foreachChild(((e,t)=>{const n=Jd(t,Tl());n&&(r=r.updateImmediateChild(e,n))}))}const c=Qd(l,t);if(!c&&!t._queryParams.loadsAllData()){const n=gh(t);nt(!e.queryToTagMap.has(n),"View does not exist, but we have a tag");const i=th++;e.queryToTagMap.set(n,i),e.tagToQueryMap.set(i,n)}let d=Gd(l,t,n,pd(e.pendingWriteTree_,o),r,a);if(!c&&!s&&!i){const n=Zd(l,t);d=d.concat(function(e,t,n){const i=t._path,o=ph(e,t),r=uh(e,n),s=e.listenProvider_.startListening(bh(t),o,r.hashFn,r.onComplete),a=e.syncPointTree_.subtree(i);if(o)nt(!Xd(a.value),"If we're adding a query, it shouldn't be shadowed");else{const t=a.fold(((e,t,n)=>{if(!Ol(e)&&t&&Xd(t))return[eh(t).query];{let e=[];return t&&(e=e.concat(Yd(t).map((e=>e.query)))),Ja(n,((t,n)=>{e=e.concat(n)})),e}}));for(let n=0;n<t.length;++n){const i=t[n];e.listenProvider_.stopListening(bh(i),ph(e,i))}}return s}
|
|
2851
2851
|
/**
|
|
2852
2852
|
* @license
|
|
2853
2853
|
* Copyright 2017 Google LLC
|
|
@@ -2863,7 +2863,7 @@ class Sc{constructor(e){this.index_=e}updateChild(e,t,n,i,o,r){nt(e.isIndexed(th
|
|
|
2863
2863
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2864
2864
|
* See the License for the specific language governing permissions and
|
|
2865
2865
|
* limitations under the License.
|
|
2866
|
-
*/(e,t,n))}return d}function lh(e,t,n){const i=e.pendingWriteTree_,o=e.syncPointTree_.findOnPath(t,((e,n)=>{const i=Jd(n,Ml(e,t));if(i)return i}));return bd(i,t,o,n,!0)}function ch(e,t){return dh(t,e.syncPointTree_,null,pd(e.pendingWriteTree_,Tl()))}function dh(e,t,n,i){if(Ol(e.path))return hh(e,t,n,i);{const o=t.get(Tl());null==n&&null!=o&&(n=Jd(o,Tl()));let r=[];const s=El(e.path),a=e.operationForChild(s),l=t.children.get(s);if(l&&a){const e=n?n.getImmediateChild(s):null,t=Id(i,s);r=r.concat(dh(a,l,e,t))}return o&&(r=r.concat(Wd(o,e,i,n))),r}}function hh(e,t,n,i){const o=t.get(Tl());null==n&&null!=o&&(n=Jd(o,Tl()));let r=[];return t.children.inorderTraversal(((t,o)=>{const s=n?n.getImmediateChild(t):null,a=Id(i,t),l=e.operationForChild(t);l&&(r=r.concat(hh(l,o,s,a)))})),o&&(r=r.concat(Wd(o,e,i,n))),r}function uh(e,t){const n=t.query,i=ph(e,n);return{hashFn:()=>{const e=function(e){return e.viewCache_.serverCache.getNode()}(t)||vc.EMPTY_NODE;return e.hash()},onComplete:t=>{if("ok"===t)return i?function(e,t,n){const i=fh(e,n);if(i){const n=mh(i),o=n.path,r=n.queryId,s=Ml(o,t);return vh(e,o,new Vc(
|
|
2866
|
+
*/(e,t,n))}return d}function lh(e,t,n){const i=e.pendingWriteTree_,o=e.syncPointTree_.findOnPath(t,((e,n)=>{const i=Jd(n,Ml(e,t));if(i)return i}));return bd(i,t,o,n,!0)}function ch(e,t){return dh(t,e.syncPointTree_,null,pd(e.pendingWriteTree_,Tl()))}function dh(e,t,n,i){if(Ol(e.path))return hh(e,t,n,i);{const o=t.get(Tl());null==n&&null!=o&&(n=Jd(o,Tl()));let r=[];const s=El(e.path),a=e.operationForChild(s),l=t.children.get(s);if(l&&a){const e=n?n.getImmediateChild(s):null,t=Id(i,s);r=r.concat(dh(a,l,e,t))}return o&&(r=r.concat(Wd(o,e,i,n))),r}}function hh(e,t,n,i){const o=t.get(Tl());null==n&&null!=o&&(n=Jd(o,Tl()));let r=[];return t.children.inorderTraversal(((t,o)=>{const s=n?n.getImmediateChild(t):null,a=Id(i,t),l=e.operationForChild(t);l&&(r=r.concat(hh(l,o,s,a)))})),o&&(r=r.concat(Wd(o,e,i,n))),r}function uh(e,t){const n=t.query,i=ph(e,n);return{hashFn:()=>{const e=function(e){return e.viewCache_.serverCache.getNode()}(t)||vc.EMPTY_NODE;return e.hash()},onComplete:t=>{if("ok"===t)return i?function(e,t,n){const i=fh(e,n);if(i){const n=mh(i),o=n.path,r=n.queryId,s=Ml(o,t);return vh(e,o,new Bc(Vc(r),s))}return[]}(e,n._path,i):function(e,t){return ch(e,new Bc({fromUser:!1,fromServer:!0,queryId:null,tagged:!1},t))}(e,n._path);{const i=function(e,t){let n="Unknown Error";"too_big"===e?n="The data requested exceeds the maximum size that can be accessed with a single request.":"permission_denied"===e?n="Client doesn't have permission to access the desired data.":"unavailable"===e&&(n="The service is unavailable");const i=new Error(e+" at "+t._path.toString()+": "+n);return i.code=e.toUpperCase(),i}(t,n);return sh(e,n,null,i)}}}}function ph(e,t){const n=gh(t);return e.queryToTagMap.get(n)}function gh(e){return e._path.toString()+"$"+e._queryIdentifier}function fh(e,t){return e.tagToQueryMap.get(t)}function mh(e){const t=e.indexOf("$");return nt(-1!==t&&t<e.length-1,"Bad queryKey."),{queryId:e.substr(t+1),path:new Sl(e.substr(0,t))}}function vh(e,t,n){const i=e.syncPointTree_.get(t);nt(i,"Missing sync point for query tag that we're tracking");return Wd(i,n,pd(e.pendingWriteTree_,t),null)}function bh(e){return e._queryParams.loadsAllData()&&!e._queryParams.isDefault()?new(nt(zd,"Reference.ts has not been loaded"),zd)(e._repo,e._path):e}class wh{constructor(e){this.node_=e}getImmediateChild(e){const t=this.node_.getImmediateChild(e);return new wh(t)}node(){return this.node_}}class xh{constructor(e,t){this.syncTree_=e,this.path_=t}getImmediateChild(e){const t=Dl(this.path_,e);return new xh(this.syncTree_,t)}node(){return lh(this.syncTree_,this.path_)}}const yh=function(e,t,n){return e&&"object"==typeof e?(nt(".sv"in e,"Unexpected leaf node or priority contents"),"string"==typeof e[".sv"]?_h(e[".sv"],t,n):"object"==typeof e[".sv"]?kh(e[".sv"],t):void nt(!1,"Unexpected server value: "+JSON.stringify(e,null,2))):e},_h=function(e,t,n){if("timestamp"===e)return n.timestamp;nt(!1,"Unexpected server value: "+e)},kh=function(e,t,n){e.hasOwnProperty("increment")||nt(!1,"Unexpected server value: "+JSON.stringify(e,null,2));const i=e.increment;"number"!=typeof i&&nt(!1,"Unexpected increment value: "+i);const o=t.node();if(nt(null!=o,"Expected ChildrenNode.EMPTY_NODE for nulls"),!o.isLeafNode())return i;const r=o.getValue();return"number"!=typeof r?i:r+i},Ch=function(e,t,n){return Ih(e,new wh(t),n)};function Ih(e,t,n){const i=e.getPriority().val(),o=yh(i,t.getImmediateChild(".priority"),n);let r;if(e.isLeafNode()){const i=e,r=yh(i.getValue(),t,n);return r!==i.getValue()||o!==i.getPriority().val()?new lc(r,wc(o)):e}{const i=e;return r=i,o!==i.getPriority().val()&&(r=r.updatePriority(new lc(o))),i.forEachChild(cc,((e,i)=>{const o=Ih(i,t.getImmediateChild(e),n);o!==i&&(r=r.updateImmediateChild(e,o))})),r}}
|
|
2867
2867
|
/**
|
|
2868
2868
|
* @license
|
|
2869
2869
|
* Copyright 2017 Google LLC
|
|
@@ -2879,7 +2879,7 @@ class Sc{constructor(e){this.index_=e}updateChild(e,t,n,i,o,r){nt(e.isIndexed(th
|
|
|
2879
2879
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2880
2880
|
* See the License for the specific language governing permissions and
|
|
2881
2881
|
* limitations under the License.
|
|
2882
|
-
*/class Sh{constructor(e="",t=null,n={children:{},childCount:0}){this.name=e,this.parent=t,this.node=n}}function Th(e,t){let n=t instanceof Sl?t:new Sl(t),i=e,o=El(n);for(;null!==o;){const e=Nt(i.node.children,o)||{children:{},childCount:0};i=new Sh(o,i,e),n=
|
|
2882
|
+
*/class Sh{constructor(e="",t=null,n={children:{},childCount:0}){this.name=e,this.parent=t,this.node=n}}function Th(e,t){let n=t instanceof Sl?t:new Sl(t),i=e,o=El(n);for(;null!==o;){const e=Nt(i.node.children,o)||{children:{},childCount:0};i=new Sh(o,i,e),n=Pl(n),o=El(n)}return i}function Eh(e){return e.node.value}function Lh(e,t){e.node.value=t,Dh(e)}function Ph(e){return e.node.childCount>0}function Rh(e,t){Ja(e.node.children,((n,i)=>{t(new Sh(n,e,i))}))}function Nh(e,t,n,i){n&&!i&&t(e),Rh(e,(e=>{Nh(e,t,!0,i)})),n&&i&&t(e)}function Ah(e){return new Sl(null===e.parent?e.name:Ah(e.parent)+"/"+e.name)}function Dh(e){null!==e.parent&&function(e,t,n){const i=function(e){return void 0===Eh(e)&&!Ph(e)}(n),o=Rt(e.node.children,t);i&&o?(delete e.node.children[t],e.node.childCount--,Dh(e)):i||o||(e.node.children[t]=n.node,e.node.childCount++,Dh(e))}
|
|
2883
2883
|
/**
|
|
2884
2884
|
* @license
|
|
2885
2885
|
* Copyright 2017 Google LLC
|
|
@@ -2895,7 +2895,7 @@ class Sc{constructor(e){this.index_=e}updateChild(e,t,n,i,o,r){nt(e.isIndexed(th
|
|
|
2895
2895
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2896
2896
|
* See the License for the specific language governing permissions and
|
|
2897
2897
|
* limitations under the License.
|
|
2898
|
-
*/(e.parent,e.name,e)}const Oh=/[\[\].#$\/\u0000-\u001F\u007F]/,Mh=/[\[\].#$\u0000-\u001F\u007F]/,Fh=10485760,zh=function(e){return"string"==typeof e&&0!==e.length&&!Oh.test(e)},Uh=function(e){return"string"==typeof e&&0!==e.length&&!Mh.test(e)},jh=function(e){return null===e||"string"==typeof e||"number"==typeof e&&!
|
|
2898
|
+
*/(e.parent,e.name,e)}const Oh=/[\[\].#$\/\u0000-\u001F\u007F]/,Mh=/[\[\].#$\u0000-\u001F\u007F]/,Fh=10485760,zh=function(e){return"string"==typeof e&&0!==e.length&&!Oh.test(e)},Uh=function(e){return"string"==typeof e&&0!==e.length&&!Mh.test(e)},jh=function(e){return null===e||"string"==typeof e||"number"==typeof e&&!qa(e)||e&&"object"==typeof e&&Rt(e,".sv")},Vh=function(e,t,n,i){i&&void 0===t||qh(Vt(e,"value"),t,n)},qh=function(e,t,n){const i=n instanceof Sl?new jl(n,e):n;if(void 0===t)throw new Error(e+"contains undefined "+ql(i));if("function"==typeof t)throw new Error(e+"contains a function "+ql(i)+" with contents = "+t.toString());if(qa(t))throw new Error(e+"contains "+t.toString()+" "+ql(i));if("string"==typeof t&&t.length>Fh/3&&qt(t)>Fh)throw new Error(e+"contains a string greater than "+Fh+" utf8 bytes "+ql(i)+" ('"+t.substring(0,50)+"...')");if(t&&"object"==typeof t){let n=!1,o=!1;if(Ja(t,((t,r)=>{if(".value"===t)n=!0;else if(".priority"!==t&&".sv"!==t&&(o=!0,!zh(t)))throw new Error(e+" contains an invalid key ("+t+") "+ql(i)+'. Keys must be non-empty strings and can\'t contain ".", "#", "$", "/", "[", or "]"');!function(e,t){e.parts_.length>0&&(e.byteLength_+=1),e.parts_.push(t),e.byteLength_+=qt(t),Vl(e)}(i,t),qh(e,r,i),function(e){const t=e.parts_.pop();e.byteLength_-=qt(t),e.parts_.length>0&&(e.byteLength_-=1)}(i)})),n&&o)throw new Error(e+' contains ".value" child '+ql(i)+" in addition to actual children.")}},Bh=function(e,t,n,i){const o=Vt(e,"values");if(!t||"object"!=typeof t||Array.isArray(t))throw new Error(o+" must be an object containing the children to replace.");const r=[];Ja(t,((e,t)=>{const i=new Sl(e);if(qh(o,t,Dl(n,i)),".priority"===Rl(i)&&!jh(t))throw new Error(o+"contains an invalid value for '"+i.toString()+"', which must be a valid Firebase priority (a string, finite number, server value, or null).");r.push(i)})),function(e,t){let n,i;for(n=0;n<t.length;n++){i=t[n];const o=Nl(i);for(let t=0;t<o.length;t++)if(".priority"===o[t]&&t===o.length-1);else if(!zh(o[t]))throw new Error(e+"contains an invalid key ("+o[t]+") in path "+i.toString()+'. Keys must be non-empty strings and can\'t contain ".", "#", "$", "/", "[", or "]"')}t.sort(Fl);let o=null;for(n=0;n<t.length;n++){if(i=t[n],null!==o&&Ul(o,i))throw new Error(e+"contains a path "+o.toString()+" that is ancestor of another path "+i.toString());o=i}}(o,r)},Hh=function(e,t,n,i){if(!Uh(n))throw new Error(Vt(e,t)+'was an invalid path = "'+n+'". Paths must be non-empty strings and can\'t contain ".", "#", "$", "[", or "]"')},$h=function(e,t){if(".info"===El(t))throw new Error(e+" failed = Can't modify data under /.info/")},Wh=function(e,t){const n=t.path.toString();if("string"!=typeof t.repoInfo.host||0===t.repoInfo.host.length||!zh(t.repoInfo.namespace)&&"localhost"!==t.repoInfo.host.split(":")[0]||0!==n.length&&!function(e){return e&&(e=e.replace(/^\/*\.info(\/|$)/,"/")),Uh(e)}(n))throw new Error(Vt(e,"url")+'must be a valid firebase URL and the path can\'t contain ".", "#", "$", "[", or "]".')};
|
|
2899
2899
|
/**
|
|
2900
2900
|
* @license
|
|
2901
2901
|
* Copyright 2017 Google LLC
|
|
@@ -2912,7 +2912,7 @@ class Sc{constructor(e){this.index_=e}updateChild(e,t,n,i,o,r){nt(e.isIndexed(th
|
|
|
2912
2912
|
* See the License for the specific language governing permissions and
|
|
2913
2913
|
* limitations under the License.
|
|
2914
2914
|
*/
|
|
2915
|
-
class Gh{constructor(){this.eventLists_=[],this.recursionDepth_=0}}function Kh(e,t){let n=null;for(let i=0;i<t.length;i++){const o=t[i],r=o.getPath();null===n||zl(r,n.path)||(e.eventLists_.push(n),n=null),null===n&&(n={events:[],path:r}),n.events.push(o)}n&&e.eventLists_.push(n)}function Yh(e,t,n){Kh(e,n),
|
|
2915
|
+
class Gh{constructor(){this.eventLists_=[],this.recursionDepth_=0}}function Kh(e,t){let n=null;for(let i=0;i<t.length;i++){const o=t[i],r=o.getPath();null===n||zl(r,n.path)||(e.eventLists_.push(n),n=null),null===n&&(n={events:[],path:r}),n.events.push(o)}n&&e.eventLists_.push(n)}function Yh(e,t,n){Kh(e,n),Zh(e,(e=>zl(e,t)))}function Jh(e,t,n){Kh(e,n),Zh(e,(e=>Ul(e,t)||Ul(t,e)))}function Zh(e,t){e.recursionDepth_++;let n=!0;for(let i=0;i<e.eventLists_.length;i++){const o=e.eventLists_[i];if(o){t(o.path)?(Qh(e.eventLists_[i]),e.eventLists_[i]=null):n=!1}}n&&(e.eventLists_=[]),e.recursionDepth_--}function Qh(e){for(let t=0;t<e.events.length;t++){const n=e.events[t];if(null!==n){e.events[t]=null;const i=n.getEventRunner();Oa&&Fa("event: "+n.toString()),el(i)}}}
|
|
2916
2916
|
/**
|
|
2917
2917
|
* @license
|
|
2918
2918
|
* Copyright 2017 Google LLC
|
|
@@ -2928,7 +2928,7 @@ class Gh{constructor(){this.eventLists_=[],this.recursionDepth_=0}}function Kh(e
|
|
|
2928
2928
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2929
2929
|
* See the License for the specific language governing permissions and
|
|
2930
2930
|
* limitations under the License.
|
|
2931
|
-
*/class
|
|
2931
|
+
*/class Xh{constructor(e,t,n,i){this.repoInfo_=e,this.forceRestClient_=t,this.authTokenProvider_=n,this.appCheckProvider_=i,this.dataUpdateCount=0,this.statsListener_=null,this.eventQueue_=new Gh,this.nextWriteId_=1,this.interceptServerDataCallback_=null,this.onDisconnect_=Dc(),this.transactionQueueTree_=new Sh,this.persistentConnection_=null,this.key=this.repoInfo_.toURLString()}toString(){return(this.repoInfo_.secure?"https://":"http://")+this.repoInfo_.host}}function eu(e,t,n){if(e.stats_=gl(e.repoInfo_),e.forceRestClient_||("object"==typeof window&&window.navigator&&window.navigator.userAgent||"").search(/googlebot|google webmaster tools|bingbot|yahoo! slurp|baiduspider|yandexbot|duckduckbot/i)>=0)e.server_=new Nc(e.repoInfo_,((t,n,i,o)=>{iu(e,t,n,i,o)}),e.authTokenProvider_,e.appCheckProvider_),setTimeout((()=>ou(e,!0)),0);else{if(null!=n){if("object"!=typeof n)throw new Error("Only objects are supported for option databaseAuthVariableOverride");try{Lt(n)}catch(e){throw new Error("Invalid authOverride provided: "+e)}}e.persistentConnection_=new $l(e.repoInfo_,t,((t,n,i,o)=>{iu(e,t,n,i,o)}),(t=>{ou(e,t)}),(t=>{!function(e,t){Ja(t,((t,n)=>{ru(e,t,n)}))}(e,t)}),e.authTokenProvider_,e.appCheckProvider_,n),e.server_=e.persistentConnection_}e.authTokenProvider_.addTokenChangeListener((t=>{e.server_.refreshAuthToken(t)})),e.appCheckProvider_.addTokenChangeListener((t=>{e.server_.refreshAppCheckToken(t.token)})),e.statsReporter_=function(e,t){const n=e.toString();return pl[n]||(pl[n]=t()),pl[n]}(e.repoInfo_,(()=>new Uc(e.stats_,e.server_))),e.infoData_=new Ac,e.infoSyncTree_=new nh({startListening:(t,n,i,o)=>{let r=[];const s=e.infoData_.getNode(t._path);return s.isEmpty()||(r=rh(e.infoSyncTree_,t._path,s),setTimeout((()=>{o("ok")}),0)),r},stopListening:()=>{}}),ru(e,"connected",!1),e.serverSyncTree_=new nh({startListening:(t,n,i,o)=>(e.server_.listen(t,i,n,((n,i)=>{const r=o(n,i);Jh(e.eventQueue_,t._path,r)})),[]),stopListening:(t,n)=>{e.server_.unlisten(t,n)}})}function tu(e){const t=e.infoData_.getNode(new Sl(".info/serverTimeOffset")).val()||0;return(new Date).getTime()+t}function nu(e){return(t=(t={timestamp:tu(e)})||{}).timestamp=t.timestamp||(new Date).getTime(),t;var t}function iu(e,t,n,i,o){e.dataUpdateCount++;const r=new Sl(t);n=e.interceptServerDataCallback_?e.interceptServerDataCallback_(t,n):n;let s=[];if(o)if(i){const t=Dt(n,(e=>wc(e)));s=function(e,t,n,i){const o=fh(e,i);if(o){const i=mh(o),r=i.path,s=i.queryId,a=Ml(r,t),l=td.fromObject(n);return vh(e,r,new $c(Vc(s),a,l))}return[]}(e.serverSyncTree_,r,t,o)}else{const t=wc(n);s=function(e,t,n,i){const o=fh(e,i);if(null!=o){const i=mh(o),r=i.path,s=i.queryId,a=Ml(r,t);return vh(e,r,new Hc(Vc(s),a,n))}return[]}(e.serverSyncTree_,r,t,o)}else if(i){const t=Dt(n,(e=>wc(e)));s=function(e,t,n){const i=td.fromObject(n);return ch(e,new $c({fromUser:!1,fromServer:!0,queryId:null,tagged:!1},t,i))}(e.serverSyncTree_,r,t)}else{const t=wc(n);s=rh(e.serverSyncTree_,r,t)}let a=r;s.length>0&&(a=gu(e,r)),Jh(e.eventQueue_,a,s)}function ou(e,t){ru(e,"connected",t),!1===t&&function(e){du(e,"onDisconnectEvents");const t=nu(e),n=Dc();Fc(e.onDisconnect_,Tl(),((i,o)=>{const r=function(e,t,n,i){return Ih(t,new xh(n,e),i)}(i,o,e.serverSyncTree_,t);Oc(n,i,r)}));let i=[];Fc(n,Tl(),((t,n)=>{i=i.concat(rh(e.serverSyncTree_,t,n));const o=wu(e,t);gu(e,o)})),e.onDisconnect_=Dc(),Jh(e.eventQueue_,Tl(),i)}(e)}function ru(e,t,n){const i=new Sl("/.info/"+t),o=wc(n);e.infoData_.updateSnapshot(i,o);const r=rh(e.infoSyncTree_,i,o);Jh(e.eventQueue_,i,r)}function su(e){return e.nextWriteId_++}function au(e,t,n){e.server_.onDisconnectCancel(t.toString(),((i,o)=>{"ok"===i&&Mc(e.onDisconnect_,t),hu(e,n,i,o)}))}function lu(e,t,n,i){const o=wc(n);e.server_.onDisconnectPut(t.toString(),o.val(!0),((n,r)=>{"ok"===n&&Oc(e.onDisconnect_,t,o),hu(e,i,n,r)}))}function cu(e,t,n){let i;i=".info"===El(t._path)?sh(e.infoSyncTree_,t,n):sh(e.serverSyncTree_,t,n),Yh(e.eventQueue_,t._path,i)}function du(e,...t){let n="";e.persistentConnection_&&(n=e.persistentConnection_.id+":"),Fa(n,...t)}function hu(e,t,n,i){t&&el((()=>{if("ok"===n)t(null);else{const e=(n||"error").toUpperCase();let o=e;i&&(o+=": "+i);const r=new Error(o);r.code=e,t(r)}}))}function uu(e,t,n){return lh(e.serverSyncTree_,t,n)||vc.EMPTY_NODE}function pu(e,t=e.transactionQueueTree_){if(t||bu(e,t),Eh(t)){const n=mu(e,t);nt(n.length>0,"Sending zero length transaction queue");n.every((e=>0===e.status))&&function(e,t,n){const i=n.map((e=>e.currentWriteId)),o=uu(e,t,i);let r=o;const s=o.hash();for(let e=0;e<n.length;e++){const i=n[e];nt(0===i.status,"tryToSendTransactionQueue_: items in queue should all be run."),i.status=1,i.retryCount++;const o=Ml(t,i.path);r=r.updateChild(o,i.currentOutputSnapshotRaw)}const a=r.val(!0),l=t;e.server_.put(l.toString(),a,(i=>{du(e,"transaction put response",{path:l.toString(),status:i});let o=[];if("ok"===i){const i=[];for(let t=0;t<n.length;t++)n[t].status=2,o=o.concat(oh(e.serverSyncTree_,n[t].currentWriteId)),n[t].onComplete&&i.push((()=>n[t].onComplete(null,!0,n[t].currentOutputSnapshotResolved))),n[t].unwatcher();bu(e,Th(e.transactionQueueTree_,t)),pu(e,e.transactionQueueTree_),Jh(e.eventQueue_,t,o);for(let e=0;e<i.length;e++)el(i[e])}else{if("datastale"===i)for(let e=0;e<n.length;e++)3===n[e].status?n[e].status=4:n[e].status=0;else{Va("transaction at "+l.toString()+" failed: "+i);for(let e=0;e<n.length;e++)n[e].status=4,n[e].abortReason=i}gu(e,t)}}),s)}(e,Ah(t),n)}else Ph(t)&&Rh(t,(t=>{pu(e,t)}))}function gu(e,t){const n=fu(e,t),i=Ah(n);return function(e,t,n){if(0===t.length)return;const i=[];let o=[];const r=t.filter((e=>0===e.status)),s=r.map((e=>e.currentWriteId));for(let r=0;r<t.length;r++){const l=t[r],c=Ml(n,l.path);let d,h=!1;if(nt(null!==c,"rerunTransactionsUnderNode_: relativePath should not be null."),4===l.status)h=!0,d=l.abortReason,o=o.concat(oh(e.serverSyncTree_,l.currentWriteId,!0));else if(0===l.status)if(l.retryCount>=25)h=!0,d="maxretry",o=o.concat(oh(e.serverSyncTree_,l.currentWriteId,!0));else{const n=uu(e,l.path,s);l.currentInputSnapshot=n;const i=t[r].update(n.val());if(void 0!==i){qh("transaction failed: Data returned ",i,l.path);let t=wc(i);"object"==typeof i&&null!=i&&Rt(i,".priority")||(t=t.updatePriority(n.getPriority()));const r=l.currentWriteId,a=nu(e),c=Ch(t,n,a);l.currentOutputSnapshotRaw=t,l.currentOutputSnapshotResolved=c,l.currentWriteId=su(e),s.splice(s.indexOf(r),1),o=o.concat(ih(e.serverSyncTree_,l.path,c,l.currentWriteId,l.applyLocally)),o=o.concat(oh(e.serverSyncTree_,r,!0))}else h=!0,d="nodata",o=o.concat(oh(e.serverSyncTree_,l.currentWriteId,!0))}Jh(e.eventQueue_,n,o),o=[],h&&(t[r].status=2,a=t[r].unwatcher,setTimeout(a,Math.floor(0)),t[r].onComplete&&("nodata"===d?i.push((()=>t[r].onComplete(null,!1,t[r].currentInputSnapshot))):i.push((()=>t[r].onComplete(new Error(d),!1,null)))))}var a;bu(e,e.transactionQueueTree_);for(let e=0;e<i.length;e++)el(i[e]);pu(e,e.transactionQueueTree_)}(e,mu(e,n),i),i}function fu(e,t){let n,i=e.transactionQueueTree_;for(n=El(t);null!==n&&void 0===Eh(i);)i=Th(i,n),n=El(t=Pl(t));return i}function mu(e,t){const n=[];return vu(e,t,n),n.sort(((e,t)=>e.order-t.order)),n}function vu(e,t,n){const i=Eh(t);if(i)for(let e=0;e<i.length;e++)n.push(i[e]);Rh(t,(t=>{vu(e,t,n)}))}function bu(e,t){const n=Eh(t);if(n){let e=0;for(let t=0;t<n.length;t++)2!==n[t].status&&(n[e]=n[t],e++);n.length=e,Lh(t,n.length>0?n:void 0)}Rh(t,(t=>{bu(e,t)}))}function wu(e,t){const n=Ah(fu(e,t)),i=Th(e.transactionQueueTree_,t);return function(e,t){let n=e.parent;for(;null!==n;){if(t(n))return!0;n=n.parent}}(i,(t=>{xu(e,t)})),xu(e,i),Nh(i,(t=>{xu(e,t)})),n}function xu(e,t){const n=Eh(t);if(n){const i=[];let o=[],r=-1;for(let t=0;t<n.length;t++)3===n[t].status||(1===n[t].status?(nt(r===t-1,"All SENT items should be at beginning of queue."),r=t,n[t].status=3,n[t].abortReason="set"):(nt(0===n[t].status,"Unexpected transaction status in abort"),n[t].unwatcher(),o=o.concat(oh(e.serverSyncTree_,n[t].currentWriteId,!0)),n[t].onComplete&&i.push(n[t].onComplete.bind(null,new Error("set"),!1,null))));-1===r?Lh(t,void 0):n.length=r+1,Jh(e.eventQueue_,Ah(t),o);for(let e=0;e<i.length;e++)el(i[e])}}
|
|
2932
2932
|
/**
|
|
2933
2933
|
* @license
|
|
2934
2934
|
* Copyright 2017 Google LLC
|
|
@@ -2944,7 +2944,7 @@ class Gh{constructor(){this.eventLists_=[],this.recursionDepth_=0}}function Kh(e
|
|
|
2944
2944
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2945
2945
|
* See the License for the specific language governing permissions and
|
|
2946
2946
|
* limitations under the License.
|
|
2947
|
-
*/const yu=function(e,t){const n=_u(e),i=n.namespace;"firebase.com"===n.domain&&ja(n.host+" is no longer supported. Please use <YOUR FIREBASE>.firebaseio.com instead"),i&&"undefined"!==i||"localhost"===n.domain||ja("Cannot parse Firebase url. Please use https://<YOUR FIREBASE>.firebaseio.com"),n.secure||"undefined"!=typeof window&&window.location&&window.location.protocol&&-1!==window.location.protocol.indexOf("https:")&&
|
|
2947
|
+
*/const yu=function(e,t){const n=_u(e),i=n.namespace;"firebase.com"===n.domain&&ja(n.host+" is no longer supported. Please use <YOUR FIREBASE>.firebaseio.com instead"),i&&"undefined"!==i||"localhost"===n.domain||ja("Cannot parse Firebase url. Please use https://<YOUR FIREBASE>.firebaseio.com"),n.secure||"undefined"!=typeof window&&window.location&&window.location.protocol&&-1!==window.location.protocol.indexOf("https:")&&Va("Insecure Firebase access from a secure page. Please use https in calls to new Firebase().");const o="ws"===n.scheme||"wss"===n.scheme;return{repoInfo:new cl(n.host,n.secure,i,o,t,"",i!==n.subdomain),path:new Sl(n.pathString)}},_u=function(e){let t="",n="",i="",o="",r="",s=!0,a="https",l=443;if("string"==typeof e){let c=e.indexOf("//");c>=0&&(a=e.substring(0,c-1),e=e.substring(c+2));let d=e.indexOf("/");-1===d&&(d=e.length);let h=e.indexOf("?");-1===h&&(h=e.length),t=e.substring(0,Math.min(d,h)),d<h&&(o=function(e){let t="";const n=e.split("/");for(let e=0;e<n.length;e++)if(n[e].length>0){let i=n[e];try{i=decodeURIComponent(i.replace(/\+/g," "))}catch(e){}t+="/"+i}return t}(e.substring(d,h)));const u=function(e){const t={};"?"===e.charAt(0)&&(e=e.substring(1));for(const n of e.split("&")){if(0===n.length)continue;const i=n.split("=");2===i.length?t[decodeURIComponent(i[0])]=decodeURIComponent(i[1]):Va(`Invalid query segment '${n}' in query '${e}'`)}return t}(e.substring(Math.min(e.length,h)));c=t.indexOf(":"),c>=0?(s="https"===a||"wss"===a,l=parseInt(t.substring(c+1),10)):c=t.length;const p=t.slice(0,c);if("localhost"===p.toLowerCase())n="localhost";else if(p.split(".").length<=2)n=p;else{const e=t.indexOf(".");i=t.substring(0,e).toLowerCase(),n=t.substring(e+1),r=i}"ns"in u&&(r=u.ns)}return{host:t,port:l,domain:n,subdomain:i,secure:s,scheme:a,pathString:o,namespace:r}},ku="-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz",Cu=function(){let e=0;const t=[];return function(n){const i=n===e;let o;e=n;const r=new Array(8);for(o=7;o>=0;o--)r[o]=ku.charAt(n%64),n=Math.floor(n/64);nt(0===n,"Cannot push at time == 0");let s=r.join("");if(i){for(o=11;o>=0&&63===t[o];o--)t[o]=0;t[o]++}else for(o=0;o<12;o++)t[o]=Math.floor(64*Math.random());for(o=0;o<12;o++)s+=ku.charAt(t[o]);return nt(20===s.length,"nextPushId: Length should be 20."),s}}();
|
|
2948
2948
|
/**
|
|
2949
2949
|
* @license
|
|
2950
2950
|
* Copyright 2017 Google LLC
|
|
@@ -2961,7 +2961,7 @@ class Gh{constructor(){this.eventLists_=[],this.recursionDepth_=0}}function Kh(e
|
|
|
2961
2961
|
* See the License for the specific language governing permissions and
|
|
2962
2962
|
* limitations under the License.
|
|
2963
2963
|
*/
|
|
2964
|
-
class Iu{constructor(e,t,n,i){this.eventType=e,this.eventRegistration=t,this.snapshot=n,this.prevName=i}getPath(){const e=this.snapshot.ref;return"value"===this.eventType?e._path:e.parent._path}getEventType(){return this.eventType}getEventRunner(){return this.eventRegistration.getEventRunner(this)}toString(){return this.getPath().toString()+":"+this.eventType+":"+
|
|
2964
|
+
class Iu{constructor(e,t,n,i){this.eventType=e,this.eventRegistration=t,this.snapshot=n,this.prevName=i}getPath(){const e=this.snapshot.ref;return"value"===this.eventType?e._path:e.parent._path}getEventType(){return this.eventType}getEventRunner(){return this.eventRegistration.getEventRunner(this)}toString(){return this.getPath().toString()+":"+this.eventType+":"+Lt(this.snapshot.exportVal())}}class Su{constructor(e,t,n){this.eventRegistration=e,this.error=t,this.path=n}getPath(){return this.path}getEventType(){return"cancel"}getEventRunner(){return this.eventRegistration.getEventRunner(this)}toString(){return this.path.toString()+":cancel"}}
|
|
2965
2965
|
/**
|
|
2966
2966
|
* @license
|
|
2967
2967
|
* Copyright 2017 Google LLC
|
|
@@ -2993,7 +2993,7 @@ class Iu{constructor(e,t,n,i){this.eventType=e,this.eventRegistration=t,this.sna
|
|
|
2993
2993
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2994
2994
|
* See the License for the specific language governing permissions and
|
|
2995
2995
|
* limitations under the License.
|
|
2996
|
-
*/class Eu{constructor(e,t){this._repo=e,this._path=t}cancel(){const e=new vt;return au(this._repo,this._path,e.wrapCallback((()=>{}))),e.promise}remove(){$h("OnDisconnect.remove",this._path);const e=new vt;return lu(this._repo,this._path,null,e.wrapCallback((()=>{}))),e.promise}set(e){$h("OnDisconnect.set",this._path),
|
|
2996
|
+
*/class Eu{constructor(e,t){this._repo=e,this._path=t}cancel(){const e=new vt;return au(this._repo,this._path,e.wrapCallback((()=>{}))),e.promise}remove(){$h("OnDisconnect.remove",this._path);const e=new vt;return lu(this._repo,this._path,null,e.wrapCallback((()=>{}))),e.promise}set(e){$h("OnDisconnect.set",this._path),Vh("OnDisconnect.set",e,this._path,!1);const t=new vt;return lu(this._repo,this._path,e,t.wrapCallback((()=>{}))),t.promise}setWithPriority(e,t){$h("OnDisconnect.setWithPriority",this._path),Vh("OnDisconnect.setWithPriority",e,this._path,!1),function(e,t){if(qa(t))throw new Error(Vt(e,"priority")+"is "+t.toString()+", but must be a valid Firebase priority (a string, finite number, server value, or null).");if(!jh(t))throw new Error(Vt(e,"priority")+"must be a valid Firebase priority (a string, finite number, server value, or null).")}("OnDisconnect.setWithPriority",t);const n=new vt;return function(e,t,n,i,o){const r=wc(n,i);e.server_.onDisconnectPut(t.toString(),r.val(!0),((n,i)=>{"ok"===n&&Oc(e.onDisconnect_,t,r),hu(0,o,n,i)}))}(this._repo,this._path,e,t,n.wrapCallback((()=>{}))),n.promise}update(e){$h("OnDisconnect.update",this._path),Bh("OnDisconnect.update",e,this._path);const t=new vt;return function(e,t,n,i){if(At(n))return Fa("onDisconnect().update() called with empty data. Don't do anything."),void hu(0,i,"ok",void 0);e.server_.onDisconnectMerge(t.toString(),n,((o,r)=>{"ok"===o&&Ja(n,((n,i)=>{const o=wc(i);Oc(e.onDisconnect_,Dl(t,n),o)})),hu(0,i,o,r)}))}(this._repo,this._path,e,t.wrapCallback((()=>{}))),t.promise}}
|
|
2997
2997
|
/**
|
|
2998
2998
|
* @license
|
|
2999
2999
|
* Copyright 2020 Google LLC
|
|
@@ -3009,7 +3009,7 @@ class Iu{constructor(e,t,n,i){this.eventType=e,this.eventRegistration=t,this.sna
|
|
|
3009
3009
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
3010
3010
|
* See the License for the specific language governing permissions and
|
|
3011
3011
|
* limitations under the License.
|
|
3012
|
-
*/class
|
|
3012
|
+
*/class Lu{constructor(e,t,n,i){this._repo=e,this._path=t,this._queryParams=n,this._orderByCalled=i}get key(){return Ol(this._path)?null:Rl(this._path)}get ref(){return new Pu(this._repo,this._path)}get _queryIdentifier(){const e=Rc(this._queryParams),t=Ka(e);return"{}"===t?"default":t}get _queryObject(){return Rc(this._queryParams)}isEqual(e){if(!((e=Ht(e))instanceof Lu))return!1;const t=this._repo===e._repo,n=zl(this._path,e._path),i=this._queryIdentifier===e._queryIdentifier;return t&&n&&i}toJSON(){return this.toString()}toString(){return this._repo.toString()+function(e){let t="";for(let n=e.pieceNum_;n<e.pieces_.length;n++)""!==e.pieces_[n]&&(t+="/"+encodeURIComponent(String(e.pieces_[n])));return t||"/"}(this._path)}}class Pu extends Lu{constructor(e,t){super(e,t,new Lc,!1)}get parent(){const e=Al(this._path);return null===e?null:new Pu(this._repo,e)}get root(){let e=this;for(;null!==e.parent;)e=e.parent;return e}}class Ru{constructor(e,t,n){this._node=e,this.ref=t,this._index=n}get priority(){return this._node.getPriority().val()}get key(){return this.ref.key}get size(){return this._node.numChildren()}child(e){const t=new Sl(e),n=Au(this.ref,e);return new Ru(this._node.getChild(t),n,cc)}exists(){return!this._node.isEmpty()}exportVal(){return this._node.val(!0)}forEach(e){if(this._node.isLeafNode())return!1;return!!this._node.forEachChild(this._index,((t,n)=>e(new Ru(n,Au(this.ref,t),cc))))}hasChild(e){const t=new Sl(e);return!this._node.getChild(t).isEmpty()}hasChildren(){return!this._node.isLeafNode()&&!this._node.isEmpty()}toJSON(){return this.exportVal()}val(){return this._node.val()}}function Nu(e,t){return(e=Ht(e))._checkNotDeleted("ref"),void 0!==t?Au(e._root,t):e._root}function Au(e,t){var n,i,o;return null===El((e=Ht(e))._path)?(n="child",i="path",(o=t)&&(o=o.replace(/^\/*\.info(\/|$)/,"/")),Hh(n,i,o)):Hh("child","path",t),new Pu(e._repo,Dl(e._path,t))}function Du(e,t){e=Ht(e),$h("set",e._path),Vh("set",t,e._path,!1);const n=new vt;return function(e,t,n,i,o){du(e,"set",{path:t.toString(),value:n,priority:i});const r=nu(e),s=wc(n,i),a=lh(e.serverSyncTree_,t),l=Ch(s,a,r),c=su(e),d=ih(e.serverSyncTree_,t,l,c,!0);Kh(e.eventQueue_,d),e.server_.put(t.toString(),s.val(!0),((n,i)=>{const r="ok"===n;r||Va("set at "+t+" failed: "+n);const s=oh(e.serverSyncTree_,c,!r);Jh(e.eventQueue_,t,s),hu(0,o,n,i)}));const h=wu(e,t);gu(e,h),Jh(e.eventQueue_,h,[])}(e._repo,e._path,t,null,n.wrapCallback((()=>{}))),n.promise}class Ou{constructor(e){this.callbackContext=e}respondsTo(e){return"value"===e}createEvent(e,t){const n=t._queryParams.getIndex();return new Iu("value",this,new Ru(e.snapshotNode,new Pu(t._repo,t._path),n))}getEventRunner(e){return"cancel"===e.getEventType()?()=>this.callbackContext.onCancel(e.error):()=>this.callbackContext.onValue(e.snapshot,null)}createCancelEvent(e,t){return this.callbackContext.hasCancelCallback?new Su(this,e,t):null}matches(e){return e instanceof Ou&&(!e.callbackContext||!this.callbackContext||e.callbackContext.matches(this.callbackContext))}hasAnyCallback(){return null!==this.callbackContext}}function Mu(e,t,n,i,o){const r=new Tu(n,void 0),s=new Ou(r);return function(e,t,n){let i;i=".info"===El(t._path)?ah(e.infoSyncTree_,t,n):ah(e.serverSyncTree_,t,n),Yh(e.eventQueue_,t._path,i)}(e._repo,e,s),()=>cu(e._repo,e,s)}function Fu(e,t,n,i){return Mu(e,0,t)}!function(e){nt(!Fd,"__referenceConstructor has already been defined"),Fd=e}(Pu),function(e){nt(!zd,"__referenceConstructor has already been defined"),zd=e}(Pu);
|
|
3013
3013
|
/**
|
|
3014
3014
|
* @license
|
|
3015
3015
|
* Copyright 2020 Google LLC
|
|
@@ -3026,7 +3026,7 @@ class Iu{constructor(e,t,n,i){this.eventType=e,this.eventRegistration=t,this.sna
|
|
|
3026
3026
|
* See the License for the specific language governing permissions and
|
|
3027
3027
|
* limitations under the License.
|
|
3028
3028
|
*/
|
|
3029
|
-
const zu={};let Uu,ju,qu,Bu
|
|
3029
|
+
const zu={};let Uu,ju,Vu,qu,Bu=!1;function Hu(e,t,n,i,o){let r=i||e.options.databaseURL;void 0===r&&(e.options.projectId||ja("Can't determine Firebase Database URL. Be sure to include a Project ID when calling firebase.initializeApp()."),Fa("Using default host for project ",e.options.projectId),r=`${e.options.projectId}-default-rtdb.firebaseio.com`);let s,a=yu(r,o),l=a.repoInfo;"undefined"!=typeof process&&process.env&&(s=process.env.FIREBASE_DATABASE_EMULATOR_HOST),s?(r=`http://${s}?ns=${l.namespace}`,a=yu(r,o),l=a.repoInfo):a.repoInfo.secure;const c=new il(e.name,e.options,t);Wh("Invalid Firebase Database URL",a),Ol(a.path)||ja("Database URL must point to the root of a Firebase Database (not including a child path).");const d=function(e,t,n,i){let o=zu[t.name];o||(o={},zu[t.name]=o);let r=o[e.toURLString()];r&&ja("Database initialized multiple times. Please make sure the format of the database URL matches with each database() call.");return r=new Xh(e,Bu,n,i),o[e.toURLString()]=r,r}(l,e,c,new nl(e.name,n));return new $u(d,e)}class $u{constructor(e,t){this._repoInternal=e,this.app=t,this.type="database",this._instanceStarted=!1}get _repo(){return this._instanceStarted||(eu(this._repoInternal,this.app.options.appId,this.app.options.databaseAuthVariableOverride),this._instanceStarted=!0),this._repoInternal}get _root(){return this._rootInternal||(this._rootInternal=new Pu(this._repo,Tl())),this._rootInternal}_delete(){return null!==this._rootInternal&&(!function(e,t){const n=zu[t];n&&n[e.key]===e||ja(`Database ${t}(${e.repoInfo_}) has already been deleted.`),function(e){e.persistentConnection_&&e.persistentConnection_.interrupt("repo_interrupt")}(e),delete n[e.key]}(this._repo,this.app.name),this._repoInternal=null,this._rootInternal=null),Promise.resolve()}_checkNotDeleted(e){null===this._rootInternal&&ja("Cannot call "+e+" on a deleted database.")}}function Wu(e=li(),t){const n=ni(e,"database").getImmediate({identifier:t});if(!n._instanceStarted){const e=(e=>{const t=gt(e);if(!t)return;const n=t.lastIndexOf(":");if(n<=0||n+1===t.length)throw new Error(`Invalid host ${t} with no separate hostname and port!`);const i=parseInt(t.substring(n+1),10);return"["===t[0]?[t.substring(1,n-1),i]:[t.substring(0,n),i]})("database");e&&function(e,t,n,i={}){e=Ht(e),e._checkNotDeleted("useEmulator"),e._instanceStarted&&ja("Cannot call useEmulator() after instance has already been initialized.");const o=e._repoInternal;let r;if(o.repoInfo_.nodeAdmin)i.mockUserToken&&ja('mockUserToken is not supported by the Admin SDK. For client access with mock users, please use the "firebase" package instead of "firebase-admin".'),r=new ol(ol.OWNER);else if(i.mockUserToken){const t="string"==typeof i.mockUserToken?i.mockUserToken:function(e,t){if(e.uid)throw new Error('The "uid" field is no longer supported by mockUserToken. Please use "sub" instead for Firebase Auth User ID.');const n=t||"demo-project",i=e.iat||0,o=e.sub||e.user_id;if(!o)throw new Error("mockUserToken must contain 'sub' or 'user_id' field!");const r=Object.assign({iss:`https://securetoken.google.com/${n}`,aud:n,iat:i,exp:i+3600,auth_time:i,sub:o,user_id:o,firebase:{sign_in_provider:"custom",identities:{}}},e);return[lt(JSON.stringify({alg:"none",type:"JWT"})),lt(JSON.stringify(r)),""].join(".")}(i.mockUserToken,e.app.options.projectId);r=new ol(t)}!function(e,t,n,i){e.repoInfo_=new cl(`${t}:${n}`,!1,e.repoInfo_.namespace,e.repoInfo_.webSocketOnly,e.repoInfo_.nodeAdmin,e.repoInfo_.persistenceKey,e.repoInfo_.includeNamespaceInQueryParams,!0),i&&(e.authTokenProvider_=i)}(o,t,n,r)}
|
|
3030
3030
|
/**
|
|
3031
3031
|
* @license
|
|
3032
3032
|
* Copyright 2021 Google LLC
|
|
@@ -3042,5 +3042,5 @@ const zu={};let Uu,ju,qu,Bu,Vu=!1;function Hu(e,t,n,i,o){let r=i||e.options.data
|
|
|
3042
3042
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
3043
3043
|
* See the License for the specific language governing permissions and
|
|
3044
3044
|
* limitations under the License.
|
|
3045
|
-
*/(n,...e)}return n}async function Gu(e,t,n){if(Uu||function(e){try{const t=e.projectId,n={projectId:t,apiKey:e.firebaseAPIKey,authDomain:`${t}.firebaseapp.com`,databaseURL:e.databaseURL,storageBucket:`${t}.firebasestorage.app`,messagingSenderId:e.firebaseSenderId,appId:e.firebaseAppId,measurementId:e.measurementId};Uu=ai(n,"netskrafl"),Uu||console.error("Failed to initialize Firebase")}catch(e){console.error("Failed to initialize Firebase",e)}}(e),!Uu)return;const i=e.userId,o=e.locale;ju=xa(Uu),ju?function(e,t,n,i){Ht(e).onAuthStateChanged(t,n,i)}(ju,(t=>{null!==t&&(e.newUser&&Ju("sign_up",{locale:e.locale,method:e.loginMethod,userid:e.userId}),Ju("login",{locale:e.locale,method:e.loginMethod,userid:e.userId}))})):console.error("Failed to initialize Firebase Auth"),await ds(ju,t),qu=Wu(Uu),qu||console.error("Failed to initialize Firebase Database"),Bu=No(Uu),Bu||console.error("Failed to initialize Firebase Analytics"),function(e,t,n){if(!qu)return;const i=Nu(qu,".info/connected"),o="netskrafl"===e?`connection/${t}`:`connection/${n}/${t}`,r=function(e,t){e=Ht(e),$h("push",e._path),qh("push",t,e._path,!0);const n=tu(e._repo),i=Cu(n),o=Du(e,i),r=Du(e,i);let s;return s=Promise.resolve(r),o.then=s.then.bind(s),o.catch=s.then.bind(s,void 0),o}(Nu(qu,o));Fu(i,(e=>{e.val()?(function(e){return e=Ht(e),new Eu(e._repo,e._path)}(r).remove(),Au(r,!0)):function(e){$h("remove",e._path),Au(e,null)}(r)}))}(e.projectId,i,o)}function Ku(e,t){if(!qu)return;let n=0;Fu(Nu(qu,e),(function(e){n++;const i=e.val();i&&t(i,1==n)}))}function Yu(e){if(!qu)return;const t=Nu(qu,e);var n;cu((n=t)._repo,n,null)}function Ju(e,t){Bu&&Do(Bu,e,t)}$l.prototype.simpleListen=function(e,t){this.sendRequest("q",{p:e},t)},$l.prototype.echo=function(e,t){this.sendRequest("echo",{d:e},t)},function(e){!function(e){Ia=e}(si),ti(new $t("database",((e,{instanceIdentifier:t})=>Hu(e.getProvider("app").getImmediate(),e.getProvider("auth-internal"),e.getProvider("app-check-internal"),t)),"PUBLIC").setMultipleInstances(!0)),ci(ka,Ca,e),ci(ka,Ca,"esm2017")}();const Qu=new class{constructor(){this.wordCheckCache={}}ingestTwoLetterWords(e,t){var n;const i=null!==(n=this.wordCheckCache[e])&&void 0!==n?n:this.wordCheckCache[e]={};for(const[,e]of t)for(const t of e)i[t]=!0}async checkWords(e,t){let n=this.wordCheckCache[e];if(n){let e=!0;for(const i of t){if(void 0===n[i]){if(2===i.length)return!1;e=!1;break}if(!1===n[i])return!1}if(e)return!0}try{const i=await we({url:"/wordcheck",body:{locale:e,word:t[0],words:t}});if((null==i?void 0:i.word)===t[0]&&(null==i?void 0:i.valid)){n||(n=this.wordCheckCache[e]={});for(const[e,t]of i.valid)n[e]=t}return!!i.ok}catch(e){}return!1}};let Xu=null;class Zu{constructor(e){this._prefix=`game.${e}`}getLocalTile(e){return window.localStorage[`${this._prefix}.tile.${e}.t`]}getLocalTileSq(e){return window.localStorage[`${this._prefix}.tile.${e}.sq`]}setLocalTile(e,t){window.localStorage[`${this._prefix}.tile.${e}.t`]=t}setLocalTileSq(e,t){window.localStorage[`${this._prefix}.tile.${e}.sq`]=t}clearTiles(){try{const e=window.localStorage;for(let t=1;t<=7;t++)e.removeItem(`${this._prefix}.tile.${t}.sq`),e.removeItem(`${this._prefix}.tile.${t}.t`)}catch(e){}}saveTiles(e){let t;for(t=0;t<e.length;t++){const n=e[t].sq,i=e[t].tile;this.setLocalTileSq(t+1,n),this.setLocalTile(t+1,i)}for(;t<7;t++)this.setLocalTileSq(t+1,""),this.setLocalTile(t+1,"")}loadTiles(){let e,t,n=[];for(let i=0;i<7;i++)e=this.getLocalTileSq(i+1),t=this.getLocalTile(i+1),e&&t&&n.push({sq:e,tile:t});return n}}class ep{constructor(){}getLocalTile(e){return""}getLocalTileSq(e){return""}setLocalTile(e,t){}setLocalTileSq(e,t){}clearTiles(){}saveTiles(e){}loadTiles(){return[]}}const tp=e=>function(){if(null===Xu)try{Xu="localStorage"in window&&null!==window.localStorage&&void 0!==window.localStorage}catch(e){Xu=!1}return Xu}()?new Zu(e):new ep,np={explo:"D4",standard:"H8"},ip={explo:[3,3],standard:[7,7]},op={standard:{WORDSCORE:["3 3 3"," 2 2 "," 2 2 "," 2 2 "," 2 2 "," "," ","3 2 3"," "," "," 2 2 "," 2 2 "," 2 2 "," 2 2 ","3 3 3"],LETTERSCORE:[" 2 2 "," 3 3 "," 2 2 ","2 2 2"," "," 3 3 3 3 "," 2 2 2 2 "," 2 2 "," 2 2 2 2 "," 3 3 3 3 "," ","2 2 2"," 2 2 "," 3 3 "," 2 2 "]},explo:{WORDSCORE:["3 3 3"," 2 "," 2 "," 2 "," 2 "," 2 2 "," 2 2 ","3 2 3"," 2 2 "," 2 2 "," 2 "," 2 "," 2 "," 2 ","3 3 3"],LETTERSCORE:[" 2 2 "," 3 2 3 "," 2 3 2 "," 2 3 2","2 3 "," 2 2 "," 3 2 "," 2 2 "," 2 3 "," 2 2 "," 3 2","2 3 2 "," 2 3 2 "," 3 2 3 "," 2 2 "]}};class rp{constructor(e,t,n,i){this.locale="is_IS",this.alphabet="",this.tile_scores={},this.board_type="standard",this.startSquare="H8",this.startCoord=[7,7],this.two_letter_words=[[],[]],this.userid=["",""],this.nickname=["",""],this.fullname=["",""],this.autoplayer=[!1,!1],this.maxOvertime=600,this.scores=[0,0],this.moves=[],this.newmoves=[],this.lastmove=void 0,this.tiles={},this.rack=[],this.racks=[],this.num_moves=0,this.bag="",this.newbag=!0,this.localturn=!1,this.player=null,this.stats=null,this.over=!1,this.manual=!1,this.fairplay=!1,this.zombie=!1,this.overdue=!1,this.currentScore=void 0,this.messages=null,this.wordBad=!1,this.wordGood=!1,this.xchg=!1,this.chall=!1,this.last_chall=!1,this.succ_chall=!1,this.showingDialog=null,this.moveInProgress=!1,this.askingForBlank=null,this.currentError=null,this.currentMessage=null,this.isFresh=!1,this.numTileMoves=0,this.chatLoading=!1,this.chatSeen=!0,this.congratulate=!1,this.selectedSq=null,this.sel="movelist",this.interval=null,this.time_info=null,this.penalty0=0,this.penalty1=0,this.timeBase=null,this.runningOut0=!1,this.runningOut1=!1,this.blinking0=!1,this.blinking1=!1,this.clockText0="",this.clockText1="",this.localStorage=null,this.uuid=e,this.moveListener=n,void 0!==i&&(this.maxOvertime=i),this.localStorage=tp(e);let o=this.localStorage.loadTiles();this.init(t),this.restoreTiles(o),!this.over&&this.isTimed()&&this.startClock(),this.autoplayer[0]||this.autoplayer[1]||this.loadMessages()}init(e){if(this.over=99===e.result,!this.over&&0!==e.result)return this.currentError=e.result||"server",void(this.currentMessage=e.msg||"");this.currentError=this.currentMessage=null,Object.assign(this,e),e.newmoves&&(this.moves=this.moves.concat(e.newmoves)),this.newmoves=[],this.localturn=!this.over&&this.moves.length%2===this.player,this.isFresh=!0,this.startSquare=np[this.board_type],this.startCoord=ip[this.board_type],this.congratulate=this.over&&null!==this.player&&this.scores[this.player]>this.scores[1-this.player],null===this.currentError&&this.placeTiles(),Qu.ingestTwoLetterWords(this.locale,this.two_letter_words[0])}update(e){for(let e in this.tiles)this.tiles.hasOwnProperty(e)&&(this.tiles[e].freshtile=!1);this.init(e),null===this.currentError&&(this.succ_chall?this.resetRack():this.updateScore()),this.saveTiles(),this.isTimed()&&this.resetClock()}async refresh(){try{if(!this.uuid)return;const e=await be({method:"POST",url:"/gamestate",body:{game:this.uuid}});(null==e?void 0:e.ok)&&this.update(e.game)}catch(e){}finally{this.moveInProgress=!1}}notifyUserChange(e){null!==this.player&&(this.nickname[this.player]=e)}buttonState(){let e={};return e.tilesPlaced=this.tilesPlaced().length>0,e.gameOver=this.over,e.congratulate=this.congratulate,e.localTurn=this.localturn,e.gameIsManual=this.manual,e.challengeAllowed=this.chall,e.lastChallenge=this.last_chall,e.showingDialog=null!==this.showingDialog,e.exchangeAllowed=this.xchg,e.wordGood=this.wordGood,e.wordBad=this.wordBad,e.canPlay=!1,e.tardyOpponent=!e.localTurn&&!e.gameOver&&this.overdue,e.showResign=!1,e.showExchange=!1,e.showPass=!1,e.showRecall=!1,e.showScramble=!1,e.showMove=!1,e.showMoveMobile=!1,e.showForceResignMobile=!1,e.showChallenge=!1,e.showChallengeInfo=!1,this.moveInProgress||(e.localTurn&&!e.gameOver&&(e.lastChallenge?(e.showChallenge=!0,e.showPass=!0,e.showChallengeInfo=!0):(e.showMove=e.tilesPlaced,e.showExchange=!e.tilesPlaced,e.showPass=!e.tilesPlaced,e.showResign=!e.tilesPlaced,e.showChallenge=!e.tilesPlaced&&e.gameIsManual&&e.challengeAllowed)),e.showMove&&(e.wordGood||e.gameIsManual)&&(e.canPlay=!0),e.gameOver||(e.tilesPlaced?(e.showRecall=!0,e.showMoveMobile=!0):(e.showScramble=!0,e.tardyOpponent&&(e.showForceResignMobile=!0)))),e}setSelectedTab(e){return this.sel!=e&&(this.sel=e,!0)}tilescore(e){return this.tile_scores[e]}twoLetterWords(){return this.two_letter_words}isTimed(){return null!==this.time_info&&this.time_info.duration>=1}showClock(){return!!this.isTimed()&&(!this.over||(!!this.clockText0||!!this.clockText1))}updateClock(){var e=this.calcTimeToGo(0),t=this.calcTimeToGo(1);this.clockText0=e,this.clockText1=t,this.runningOut0="-"==e[0]||e<="02:00",this.runningOut1="-"==t[0]||t<="02:00",this.blinking0=this.runningOut0&&e>="00:00"&&e<="00:30"&&0===this.player,this.blinking1=this.runningOut1&&t>="00:00"&&t<="00:30"&&1===this.player,pe.redraw()}resetClock(){this.timeBase=new Date,this.updateClock(),this.over&&(this.interval&&(window.clearInterval(this.interval),this.interval=null),this.blinking0=!1,this.blinking1=!1,this.runningOut0=!1,this.runningOut1=!1)}startClock(){this.resetClock(),this.interval||(this.interval=window.setInterval((()=>{this.updateClock()}),500))}cleanup(){this.interval&&(window.clearInterval(this.interval),this.interval=null)}calcTimeToGo(e){let t=this.time_info;if(null===t||null===this.timeBase)return"";let n=t.elapsed[e],i=this.over;if(!i&&this.moves.length%2===e){n+=((new Date).getTime()-this.timeBase.getTime())/1e3,n-60*t.duration>this.maxOvertime&&(this.moveInProgress||(this.moveInProgress=!0,window.setTimeout((()=>{this.refresh()}),500)))}const o=Math.max(60*t.duration-n,-this.maxOvertime),r=Math.abs(o),s=Math.floor(r/60),a=Math.floor(r-60*s);return i?(this.penalty0=0,this.penalty1=0):o<0&&(0===e?this.penalty0=-10*Math.floor((60*s+a+59)/60):this.penalty1=-10*Math.floor((60*s+a+59)/60)),(o<0?"-":"")+("0"+s.toString()).slice(-2)+":"+("0"+a.toString()).slice(-2)}displayScore(e){return Math.max(this.scores[e]+(0===e?this.penalty0:this.penalty1),0)}async loadMessages(){if(!this.chatLoading){this.chatLoading=!0,this.messages=[];try{const e=await be({method:"POST",url:"/chatload",body:{channel:"game:"+this.uuid}});e.ok?this.messages=e.messages||[]:this.messages=[],void 0===e.seen?this.chatSeen=!0:this.chatSeen=e.seen}catch(e){}finally{this.chatLoading=!1}}}async loadStats(){this.stats=void 0;try{const e=await be({method:"POST",url:"/gamestats",body:{game:this.uuid}});if(!e||void 0===e.result)return;if(0!==e.result&&99!==e.result)return;this.stats=e}catch(e){}}async sendMessage(e){try{await be({method:"POST",url:"/chatmsg",body:{channel:"game:"+this.uuid,msg:e}})}catch(e){}}sendChatSeenMarker(){this.sendMessage(""),this.chatSeen=!0}addChatMessage(e,t,n,i){this.chatLoading||""===t||(null===this.messages&&(this.messages=[]),this.messages.push({from_userid:e,msg:t,ts:n}),"chat"==this.sel?this.sendChatSeenMarker():i||(this.chatSeen=!1))}markChatShown(){return!this.chatSeen&&(this.sendChatSeenMarker(),!0)}placeMove(e,t,n,i){const o=Xe(t);let r=o.col,s=o.row,a=!1,l=0;for(let t=0;t<n.length;t++){let c=n[t];if("?"==c){a=!0;continue}const d=Qe(s,r);if(null===d)continue;let h=c;a&&(c="?");const u=this.tilescore(c);d in this.tiles||(this.tiles[d]={player:e,tile:c,letter:h,score:u,draggable:!1,freshtile:!1,index:l,xchg:!1},i&&(e===this.player?this.tiles[d].highlight=0:1-e===this.player&&(this.tiles[d].highlight=1),l++)),r+=o.dx,s+=o.dy,a=!1}}setRack(e){this.rack=e}rackAtMove(e){var t;const n=(null===(t=this.racks)||void 0===t?void 0:t.length)||0;return n?this.racks[e>=n?n-1:e]:""}isFinalMove(e){return e>=this.num_moves}boardAsStrings(){const e=[];for(const t of Le){let n="";for(let e=0;e<15;e++){let i=`${t}${e+1}`;if(i in this.tiles){const{tile:e,letter:t}=this.tiles[i];n+="?"===e?t.toLocaleUpperCase():t}else n+="."}e.push(n)}return e}placeTiles(e,t){this.tiles={},this.numTileMoves=0;const n=this.moves,i=void 0!==e,o=!i&&!this.lastmove&&this.localturn,r=!t&&(o||i),s=void 0!==e?e:n.length;function a(e){if(e+2>=s)return!1;let[t,[i,o,r]]=n[e+2];return""===i&&("RESP"===o&&r<0)}for(let e=0;e<s;e++){let[t,[i,o]]=n[e];""==i||a(e)||(this.placeMove(t,i,o,e===s-1&&r),this.numTileMoves++)}let l=this.lastmove;if(l&&this.localturn)for(let e=0;e<l.length;e++){let t=l[e][0];if(!(t in this.tiles))throw"Tile from lastmove not in square "+t;this.tiles[t].freshtile=!0,this.tiles[t].index=e}for(let e=0;e<this.rack.length;e++){const t="R"+(e+1),[n,i]=this.rack[e],o="?"===n?" ":n;this.tiles[t]={player:this.player?1:0,tile:n,letter:o,score:i,draggable:!0,freshtile:!1,index:0,xchg:!1}}}_moveTile(e,t){if(e==t)return;let n=this.tiles[e];if(void 0===n)throw"Moving from an empty square";if(delete this.tiles[e],t in this.tiles){if("R"!=t.charAt(0))throw"Dropping to an occupied square";let e=parseInt(t.slice(1)),n=e+1;for(;"R"+n in this.tiles;)n++;if(n<=7)for(let t=n;t>e;t--)this.tiles["R"+t]=this.tiles["R"+(t-1)];else{for(n=e-1;"R"+n in this.tiles;)n--;if(n<1)throw"No place in rack to drop tile";for(let t=n;t<e;t++)this.tiles["R"+t]=this.tiles["R"+(t+1)]}}"R"==t[0]&&"?"==n.tile&&(n.letter=" "),this.tiles[t]=n}moveTile(e,t){this._moveTile(e,t),this.currentError=this.currentMessage=null,this.updateScore(),this.saveTiles()}attemptMove(e,t){if(t==e)return;if(t in this.tiles&&"R"!=t[0])throw"Square "+t+" occupied";if(!(e in this.tiles))throw"No tile at "+e;const n=this.tiles[e];"R"==t[0]||"?"!=n.tile||" "!=n.letter?this.moveTile(e,t):this.askingForBlank={from:e,to:t}}cancelBlankDialog(){this.askingForBlank=null}placeBlank(e){if(null===this.askingForBlank)return;const{from:t,to:n}=this.askingForBlank;this.tiles[t].letter=e,this.moveTile(t,n),this.askingForBlank=null}tilesPlaced(){const e=[];for(let t in this.tiles)this.tiles.hasOwnProperty(t)&&"R"!=t[0]&&this.tiles[t].draggable&&e.push(t);return e}async sendMove(e){this.moveInProgress=!0;try{const t=await be({method:"POST",url:"/submitmove",body:{moves:e,mcount:this.moves.length,uuid:this.uuid}});this.update(t),this.moveListener&&this.moveListener.notifyMove()}catch(e){this.currentError="server",e instanceof Error?this.currentMessage=e.message:this.currentMessage=String(e)}finally{this.moveInProgress=!1}}async forceResign(){this.moveInProgress=!0;try{const e=await be({method:"POST",url:"/forceresign",body:{mcount:this.moves.length,game:this.uuid}});this.update(e)}catch(e){this.currentError="server",e instanceof Error?this.currentMessage=e.message:this.currentMessage=String(e)}finally{this.moveInProgress=!1}}submitMove(){const e=this.tilesPlaced();let t=[];this.selectedSq=null;for(let n=0;n<e.length;n++){const i=e[n],{tile:o,letter:r}=this.tiles[i];t.push(i+"="+o+("?"===o?r:""))}t.length>0&&this.sendMove(t)}submitPass(){this.showingDialog="pass",this.selectedSq=null}submitChallenge(){this.showingDialog="chall",this.selectedSq=null}submitExchange(){this.showingDialog="exchange",this.selectedSq=null;for(let e=1;e<=7;e++){const t="R"+e;t in this.tiles&&(this.tiles[t].xchg=!1)}}submitResign(){this.showingDialog="resign",this.selectedSq=null}confirmPass(e){this.showingDialog=null,e&&this.sendMove(["pass"])}confirmChallenge(e){this.showingDialog=null,e&&this.sendMove(["chall"])}confirmExchange(e){let t="";this.showingDialog=null;for(let e=1;e<=7;e++){const n="R"+e;n in this.tiles&&this.tiles[n].xchg&&(t+=this.tiles[n].tile,this.tiles[n].xchg=!1)}e&&t.length>0&&this.sendMove(["exch="+t])}confirmResign(e){this.showingDialog=null,e&&this.sendMove(["rsgn"])}rescrambleRack(){if(this.selectedSq=null,null!==this.showingDialog)return;this._resetRack();const e=[];for(let t=1;t<=7;t++){const n="R"+t;n in this.tiles?e.push(this.tiles[n]):e.push(null)}let t=e.length;for(;0!==t;){const n=Math.floor(Math.random()*t);t-=1;const i=e[t];e[t]=e[n],e[n]=i}let n=0;for(let t=1;t<=7;t++){const i=e[t-1];null!==i?this.tiles["R"+(t-n)]=i:(delete this.tiles["R"+(7-n)],n++)}this.saveTiles()}saveTiles(){var e;let t=[];const n=this.tilesPlaced();for(const e of n){const{tile:n,letter:i}=this.tiles[e];t.push({sq:e,tile:"?"===n?n+i:n})}for(let e=1;e<=7;e++){const n=`R${e}`;n in this.tiles&&t.push({sq:n,tile:this.tiles[n].tile})}null===(e=this.localStorage)||void 0===e||e.saveTiles(t)}restoreTiles(e){if(!e.length)return;let t=[],n=[],i={};for(let n=0;n<e.length;n++)t.push(e[n].tile.charAt(0));for(let e=1;e<=7;e++)"R"+e in this.tiles&&n.push(this.tiles["R"+e].tile.charAt(0));if(t.sort(),n.sort(),!function(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0}(t,n))return;for(let e=1;e<=7;e++)"R"+e in this.tiles&&(i["R"+e]=this.tiles["R"+e],delete this.tiles["R"+e]);for(let t=0;t<e.length;t++){const n=e[t].sq;if(!(n in this.tiles)){const o=e[t].tile;for(let e in i)if(i.hasOwnProperty(e)&&i[e].tile==o.charAt(0)){"?"===o.charAt(0)&&("R"===n.charAt(0)?i[e].letter=" ":i[e].letter=o.charAt(1)),this.tiles[n]=i[e],delete i[e];break}}}let o=1;for(let e in i)if(i.hasOwnProperty(e)){for(;"R"+o in this.tiles;)o++;o<=7&&(this.tiles["R"+o]=i[e])}this.saveTiles(),this.updateScore()}_resetRack(){const e=this.tilesPlaced();if(e.length){let t=1;for(let n=0;n<e.length;n++){for(;"R"+t in this.tiles;)t++;const i="R"+t;this.tiles[i]=this.tiles[e[n]],delete this.tiles[e[n]],"?"===this.tiles[i].tile&&(this.tiles[i].letter=" "),t++}this.updateScore()}this.currentError=null}resetError(){this.currentError=this.currentMessage=null}resetRack(){this.selectedSq=null,this._resetRack(),this.saveTiles()}async updateScore(){const e=this.calcScore();if(this.wordGood=!1,this.wordBad=!1,void 0!==e&&e.word){if(this.currentScore=e.score,!this.manual){const t=await Qu.checkWords(this.locale,e.words);this.wordGood=t,this.wordBad=!t}}else this.currentScore=void 0}wordScore(e,t){const n=op[this.board_type].WORDSCORE;return parseInt(n[e].charAt(t))||1}letterScore(e,t){const n=op[this.board_type].LETTERSCORE;return parseInt(n[e].charAt(t))||1}squareType(e,t){const n=this.wordScore(e,t);if(2===n)return"dw";if(3===n)return"tw";const i=this.letterScore(e,t);return 2===i?"dl":3===i?"tl":""}squareClass(e){if(!e||"R"===e[0])return;const{row:t,col:n}=Xe(e);return this.squareType(t,n)||void 0}tileAt(e,t){const n=Qe(e,t);return n&&this.tiles[n]||null}calcScore(){let e=0,t=0,n=1,i=15,o=15,r=0,s=0,a=0,l=0,c="",d=[];if(this.tilesPlaced().forEach((t=>{const l=Le.indexOf(t.charAt(0)),c=parseInt(t.slice(1))-1,d=this.tiles[t];e+=d.score*this.letterScore(l,c),a++,n*=this.wordScore(l,c),l<i&&(i=l),c<o&&(o=c),l>r&&(r=l),c>s&&(s=c)})),!a)return;if(i!==r&&o!==s)return;let h,u=o,p=i,g=0,f=0;for(i!==r?f=1:o!==s||null===this.tileAt(i-1,o)&&null===this.tileAt(i+1,o)?g=1:f=1;null!==this.tileAt(p-f,u-g);)u-=g,p-=f;for(;null!==(h=this.tileAt(p,u));){if(h.draggable){const e=this.calcCrossScore(p,u,1-f,1-g);e.score>=0&&(t+=e.score,l++,d.push(e.word))}else e+=h.score,l++;c+=h.letter,u+=g,p+=f}if(0===this.numTileMoves){const e=this.startCoord;if(null===this.tileAt(e[0],e[1]))return}else if(!l)return;return g&&u<=s||f&&p<=r?void 0:(d.push(c),{word:c,words:d,score:e*n+t+(7===a?50:0)})}calcCrossScore(e,t,n,i){let o,r=0,s=!1,a=t,l=e,c="";for(;null!==this.tileAt(l-n,a-i);)a-=i,l-=n;for(;null!==(o=this.tileAt(l,a));){let d=o.score;a===t&&l===e?d*=this.letterScore(l,a):s=!0,c+=o.letter,r+=d,a+=i,l+=n}return s?{score:r*this.wordScore(e,t),word:c}:{score:-1,word:""}}}class sp{constructor(e,t){this.state=null,this.paths=[],this.routeName=void 0,this.params=void 0,this.game=null,this.gameList=null,this.numGames=0,this.loadingGameList=!1,this.challengeList=null,this.numChallenges=0,this.loadingChallengeList=!1,this.oppReady=0,this.recentList=null,this.loadingRecentList=!1,this.userListCriteria=null,this.userList=null,this.loadingUserList=!1,this.eloRatingList=null,this.eloRatingSpec=null,this.ownStats=null,this.user=null,this.userErrors=null,this.userLoadError=!1,this.helpHTML=null,this.friendHTML=null,this.spinners=0,this.reviewMove=null,this.bestMoves=null,this.highlightedMove=null,this.maxFreeGames=0,this.isExplo=!1,this.paths=e.paths.slice(),this.state=t,this.isExplo=t.isExplo,this.maxFreeGames=t.isExplo?3:8,async function(e){try{Se(e,await be({method:"GET",url:"/static/assets/messages.json"}))}catch(t){Se(e,{})}}(t.locale)}async loadGame(e,t,n=!1){var i,o;try{if(null!==this.game&&this.game.cleanup(),this.game=null,this.reviewMove=null,this.bestMoves=null,this.highlightedMove=null,!e)return;const r=await be({method:"POST",url:"/gamestate",body:{game:e,delete_zombie:n}});(null==r?void 0:r.ok)&&(this.game=new rp(e,r.game,this,(null===(i=this.state)||void 0===i?void 0:i.runningLocal)?60:600),void 0!==t&&t(),(null===(o=this.state)||void 0===o?void 0:o.uiFullscreen)||this.game.setSelectedTab("board"))}catch(e){}}async loadGameList(e=!0){if(!this.loadingGameList){this.loadingGameList=!0,this.gameList=[],this.numGames=0,this.spinners++;try{const t=await be({method:"POST",url:"/gamelist",body:{zombie:e}});if(!t||0!==t.result)return void(this.gameList=[]);this.gameList=t.gamelist||[],this.gameList&&(this.numGames=this.gameList.reduce(((e,t)=>e+(t.my_turn||t.zombie?1:0)),0))}catch(e){this.gameList=[]}finally{this.loadingGameList=!1,this.spinners&&this.spinners--}}}async loadChallengeList(){if(!this.loadingChallengeList){this.loadingChallengeList=!0,this.challengeList=[],this.numChallenges=0,this.oppReady=0;try{const e=await be({method:"POST",url:"/challengelist"});if(!e||0!==e.result)return void(this.challengeList=[]);this.challengeList=e.challengelist||[];for(let e of this.challengeList)e.opp_ready&&this.oppReady++;this.numChallenges=this.oppReady,this.challengeList&&(this.numChallenges+=this.challengeList.reduce(((e,t)=>e+(t.received?1:0)),0))}catch(e){this.challengeList=[]}finally{this.loadingChallengeList=!1}}}async loadRecentList(){if(!this.loadingRecentList){this.loadingRecentList=!0,this.recentList=[];try{const e=await be({method:"POST",url:"/recentlist",body:{versus:null,count:40}});if(!e||0!==e.result)return void(this.recentList=[]);this.recentList=e.recentlist||[]}catch(e){this.recentList=[]}finally{this.loadingRecentList=!1}}}async loadUserRecentList(e,t,n){n(await be({method:"POST",url:"/recentlist",body:{user:e,versus:t,count:40}}))}async loadUserList(e,t){if("search"===e.query&&""===e.spec)return this.userList=[],this.userListCriteria=e,void pe.redraw();this.userList=void 0,this.userListCriteria=void 0,t&&this.spinners++;const n=e;try{const t=await be({method:"POST",url:"/userlist",body:n});if(!t||0!==t.result)return this.userList=[],void(this.userListCriteria=e);this.userList=t.userlist,this.userListCriteria=e}catch(t){this.userList=[],this.userListCriteria=e}finally{t&&this.spinners&&this.spinners--}}async loadEloRatingList(e,t){this.eloRatingList=void 0,this.eloRatingSpec=void 0,t&&this.spinners++;const n={kind:e};try{const t=await be({method:"POST",url:"/rating",body:n});if(!t||0!==t.result)return this.eloRatingList=[],void(this.eloRatingSpec=e);this.eloRatingList=t.rating,this.eloRatingSpec=e}catch(t){this.eloRatingList=[],this.eloRatingSpec=e}finally{t&&this.spinners&&this.spinners--}}async loadOwnStats(){this.ownStats={};try{const e=await be({method:"POST",url:"/userstats",body:{}});if(!e||0!==e.result)return;this.ownStats=e}catch(e){}}async loadUserStats(e,t){try{t(await be({method:"POST",url:"/userstats",body:{user:e}}))}catch(e){}}async loadPromoContent(e,t){try{t(await be({method:"POST",url:"/promo",body:{key:e},responseType:"text",deserialize:e=>e}))}catch(e){}}async loadBestMoves(e){if(!this.game||!this.game.uuid)return;if(!e)return this.reviewMove=0,this.bestMoves=null,this.highlightedMove=null,this.game.setRack([]),void this.game.placeTiles(0);const t=this.game.tile_scores,n=this.game.rackAtMove(e-1);if(!n||this.game.isFinalMove(e-1))return this.reviewMove=e,this.bestMoves=[],this.highlightedMove=null,n?this.game.setRack(n.split("").map((e=>[e,t[e]]))):this.game.setRack([]),void this.game.placeTiles(e);this.reviewMove=null,this.spinners++;try{const i={locale:this.game.locale,board_type:this.isExplo?"explo":"standard",board:this.game.boardAsStrings(),rack:n,limit:19},o=await we({method:"POST",url:"/moves",body:i});if(this.highlightedMove=null,!o||void 0===o.moves)return this.reviewMove=null,void(this.bestMoves=null);this.reviewMove=e,this.bestMoves=o.moves.map((t=>[(e-1)%2,[t.co,t.w,t.sc],!1])),this.game.setRack(n.split("").map((e=>[e,t[e]]))),this.game.placeTiles(e)}catch(e){this.highlightedMove=null,this.reviewMove=null,this.bestMoves=null}finally{this.spinners&&this.spinners--}}async loadHelp(){var e;if(null===this.helpHTML)try{const t=(null===(e=this.state)||void 0===e?void 0:e.locale)||"is_IS",n=await be({method:"GET",url:"/rawhelp?version=malstadur&locale="+t,responseType:"text",deserialize:e=>e});this.helpHTML=n}catch(e){this.helpHTML=""}}async loadFriendPromo(){var e;if(null===this.friendHTML)try{const t=(null===(e=this.state)||void 0===e?void 0:e.locale)||"is_IS",n=await be({method:"GET",url:"/friend?locale="+t,responseType:"text",deserialize:e=>e});this.friendHTML=n}catch(e){this.friendHTML=""}}async loadUser(e){this.user=void 0,e&&this.spinners++;try{const e=await be({method:"POST",url:"/loaduserprefs"});e&&e.ok?(this.user=e.userprefs,this.userErrors=null):(this.user=null,this.userErrors=null,this.userLoadError=!0)}catch(e){this.user=null,this.userErrors=null,this.userLoadError=!0}finally{e&&this.spinners&&this.spinners--}}async saveUser(e){const t=this.user;if(t)try{const n=await be({method:"POST",url:"/saveuserprefs",body:t});if(null==n?void 0:n.ok){const n=this.state;null!==n&&(n.userNick=t.nickname,n.beginner=t.beginner,n.fairPlay=t.fairplay),null!==this.game&&this.game.notifyUserChange(t.nickname),void 0!==e&&e(),this.userErrors=null,this.user=null}else this.userErrors=n.err||null}catch(e){this.userErrors=null}}async setUserPref(e){try{await be({method:"POST",url:"/setuserpref",body:e})}catch(e){}}async newGame(e,t){var n;try{const i={opp:e,rev:t};this.isExplo&&(i.board_type="explo");const o={method:"POST",url:"/initgame",body:i},r=await be(o);if(null==r?void 0:r.ok){const e=(null===(n=this.state)||void 0===n?void 0:n.locale)||"is_IS";Ju("new_game",{uuid:r.uuid,timed:t,locale:e}),pe.route.set("/game/"+r.uuid)}}catch(e){}}async modifyChallenge(e){var t;try{const i=await be({method:"POST",url:"/challenge",body:e});if(0===(null==i?void 0:i.result)){var n={locale:(null===(t=this.state)||void 0===t?void 0:t.locale)||"is_IS"};void 0!==e.duration&&(n.duration=e.duration),void 0!==e.fairplay&&(n.fairplay=e.fairplay),void 0!==e.manual&&(n.manual=e.manual),Ju("challenge_"+e.action,n),this.loadChallengeList(),this.userListCriteria&&this.loadUserList(this.userListCriteria,!1)}}catch(e){}}async markFavorite(e,t){try{await be({method:"POST",url:"/favorite",body:{destuser:e,action:t?"add":"delete"}})}catch(e){}}async cancelFriendship(){const e=this.user,t=this.state;if(e&&t){try{const n=await be({method:"POST",url:"/cancelplan",body:{}});if(null==n?void 0:n.ok)return e.friend=!1,t.hasPaid=!1,t.plan="",Ju("cancel_plan",{userid:t.userId,locale:t.locale,plan:"friend"}),!0}catch(e){}return!1}}addChatMessage(e,t,n,i){var o,r;if(this.game&&this.game.uuid==e){const e=null!==(r=null===(o=this.state)||void 0===o?void 0:o.userId)&&void 0!==r?r:"";return this.game.addChatMessage(t,n,i,t==e),!0}return!1}handleUserMessage(e,t){var n;if(t||!this.state)return;let i=!1;if(void 0!==e.friend){const t=!!e.friend;this.user&&this.user.friend!=t&&(this.user.friend=t,i=!0)}if(void 0!==e.plan&&(this.state.plan!=e.plan&&(this.state.plan=e.plan,i=!0),this.user&&!this.user.friend&&"friend"==this.state.plan&&(this.user.friend=!0,i=!0),""==this.state.plan&&(null===(n=this.user)||void 0===n?void 0:n.friend)&&(this.user.friend=!1,i=!0)),void 0!==e.hasPaid){const t=!(""==this.state.plan||!e.hasPaid);this.state.hasPaid!=t&&(this.state.hasPaid=t,i=!0)}let o=!1;e.challenge?(this.loadChallengeList(),this.userListCriteria&&this.loadUserList(this.userListCriteria,!1),o=!0):e.move&&(o=!0),o&&!this.loadingGameList&&(this.gameList=null,i=!0),i&&pe.redraw()}handleMoveMessage(e,t){!t&&this.game&&(this.game.update(e),pe.redraw())}notifyMove(){this.loadingGameList||(this.gameList=null)}moreGamesAllowed(){if(!this.state)return!1;if(this.loadingGameList)return!1;if(!this.gameList)return!0;return!(this.gameList.length>=50)&&(!!this.state.hasPaid||this.gameList.length<this.maxFreeGames)}}class ap{constructor(e,t){this.model=e,this.view=t,this.initMediaListener()}onNavigateTo(e,t){var n,i,o;const r=this.model;this.view.boardScale=1,r.routeName=e,r.params=t;const s=null!==(n=t.uuid)&&void 0!==n?n:"";if("game"==e){null!==r.game&&this.detachListenerFromGame(r.game.uuid);const e="1"===t.zombie;r.loadGame(s,(()=>{this.attachListenerToGame(s),setTimeout(Je)}),e),null!==r.game&&void 0!==r.game&&Ju("game_open",{locale:r.game.locale,uuid:t.uuid})}else if("review"==e){null!==r.game&&this.detachListenerFromGame(r.game.uuid);let e=t.move||"0",n=parseInt(e);(isNaN(n)||!n||n<0)&&(n=0),null===r.game||r.game.uuid!=t.uuid?r.loadGame(s,(()=>{r.loadBestMoves(n),setTimeout(Je)})):null!==r.game&&r.loadBestMoves(n)}else{null!==r.game&&(this.detachListenerFromGame(r.game.uuid),r.game.cleanup(),r.game=null);const t=(null===(i=r.state)||void 0===i?void 0:i.locale)||"is_IS";"help"==e?(r.loadHelp(),Ju("help",{locale:t})):"thanks"==e?(null===(o=r.state)||void 0===o?void 0:o.userId)&&Ju("init_plan",{userid:r.state.userId,locale:t,plan:"friend"}):"main"==e&&(r.gameList=null,r.userListCriteria=null,r.userList=null,r.challengeList=null,r.recentList=null)}}onMoveMessage(e,t){console.log("Move message received: "+JSON.stringify(e)),this.model.handleMoveMessage(e,t)}onUserMessage(e,t){console.log("User message received: "+JSON.stringify(e)),this.model.handleUserMessage(e,t)}onChatMessage(e,t){t?console.log("First attach of chat: "+JSON.stringify(e)):(console.log("Chat message received: "+JSON.stringify(e)),this.model.addChatMessage(e.game,e.from_userid,e.msg,e.ts)&&this.view.notifyChatMessage())}onFullScreen(){const e=this.model.state;e&&!e.uiFullscreen&&(e.uiFullscreen=!0,this.view.notifyMediaChange(),pe.redraw())}onMobileScreen(){const e=this.model.state;e&&!1!==e.uiFullscreen&&(e.uiFullscreen=!1,this.view.notifyMediaChange(),pe.redraw())}onLandscapeScreen(){const e=this.model.state;e&&!e.uiLandscape&&(e.uiLandscape=!0,this.view.notifyMediaChange(),pe.redraw())}onPortraitScreen(){const e=this.model.state;e&&!1!==e.uiLandscape&&(e.uiLandscape=!1,this.view.notifyMediaChange(),pe.redraw())}mediaMinWidth667(e){e.matches?this.onLandscapeScreen():this.onPortraitScreen()}mediaMinWidth768(e){e.matches?this.onFullScreen():this.onMobileScreen()}initMediaListener(){function e(e,t){try{e.addEventListener("change",t,{passive:!0})}catch(n){try{e.addListener(t)}catch(e){console.error(e)}}}let t=window.matchMedia("(min-width: 667px)"),n=this;t&&(this.mediaMinWidth667(t),e(t,(()=>n.mediaMinWidth667(t)))),t=window.matchMedia("(min-width: 768px)"),t&&(this.mediaMinWidth768(t),e(t,(()=>n.mediaMinWidth768(t))))}attachListenerToUser(){const e=this.model.state;e&&e.userId&&Ku("user/"+e.userId,((e,t)=>this.onUserMessage(e,t)))}detachListenerFromUser(){const e=this.model.state;e&&e.userId&&Yu("user/"+e.userId)}attachListenerToGame(e){const t=this.model.state;if(!e||!t)return;const n="game/"+e+"/"+t.userId+"/";Ku(n+"move",((e,t)=>this.onMoveMessage(e,t))),Ku(n+"chat",((e,t)=>this.onChatMessage(e,t)))}detachListenerFromGame(e){const t=this.model.state;if(!e||!t)return;const n="game/"+e+"/"+t.userId+"/";Yu(n+"move"),Yu(n+"chat")}}const lp=[['<path d="M65.2672 12.542L54.3998 18.813L43.5323 25.146L32.6649 18.813L21.7354 12.542L43.5323 0L65.2672 12.542Z" fill="#FDC12C"/>','<path d="M43.5323 25.1457V37.6877L21.7354 25.1457V12.5416L43.5323 25.1457Z" fill="#E69419"/>','<path d="M65.2661 12.5416V25.1457L43.5312 37.6877V25.1457L65.2661 12.5416Z" fill="#F8DA95"/>'],['<path d="M43.5318 37.6847L32.6644 43.9557L21.7349 50.2267L10.8674 43.9557L0 37.6847L21.7349 25.1427L43.5318 37.6847Z" fill="#AA3731"/>','<path d="M21.7349 50.23V62.7719L0 50.23V37.688L21.7349 50.23Z" fill="#721D19"/>'],['<path d="M65.2672 50.23L54.3998 56.501L43.5323 62.7719L32.6028 56.501L21.7354 50.23L43.5323 37.688L65.2672 50.23Z" fill="#669256"/>','<path d="M43.5323 62.7716V75.3756L21.7354 62.7716V50.2296L43.5323 62.7716Z" fill="#496A38"/>','<path d="M65.2661 50.2296V62.7716L43.5312 75.3756V62.7716L65.2661 50.2296Z" fill="#B7C7AD"/>'],['<path d="M43.5318 75.3754L32.6644 81.6464L21.7349 87.9174L10.8674 81.6464L0 75.3754L21.7349 62.7714L43.5318 75.3754Z" fill="#83C8CE"/>','<path d="M21.7349 87.918V100.46L0 87.918V75.376L21.7349 87.918Z" fill="#5699A5"/>'],['<path d="M65.2672 87.918L54.3998 94.1889L43.5323 100.46L32.6649 94.1889L21.7354 87.918L43.5323 75.376L65.2672 87.918Z" fill="#E39FA5"/>','<path d="M43.5323 100.46V113.002L21.7354 100.46V87.9177L43.5323 100.46Z" fill="#B6676D"/>','<path d="M65.2661 87.9177V100.46L43.5312 113.002V100.46L65.2661 87.9177Z" fill="#EACFD1"/>']],cp=[['<path fill="#514c4c"',' d="M1728.66,1133.94a1.85,1.85,0,0,1-2-2v-54.59c0-10.41-4.91-17.28-14.73-17.28-9.43,0-14.93,6.87-14.93,17.28V1132a1.85,1.85,0,0,1-2,2h-23.56a1.86,1.86,0,0,1-2-2v-91.12a1.86,1.86,0,0,1,2-2h23.56a1.85,1.85,0,0,1,2,2v6.68h.2c4.32-5.89,12.37-10.8,24.55-10.8,21,0,32.4,14.53,32.4,35.34V1132a1.86,1.86,0,0,1-2,2Z"',' transform="translate(-1401.69 -918.27)"/>'],['<path fill="#514c4c"',' d="M1769.19,1109a68.34,68.34,0,0,1-3.34-22.58c0-10,1.18-16.89,3.14-22.78,5.5-17.08,20.62-26.9,40.84-26.9,21,0,35.55,10,41,26.71,2,6.28,3.15,13.15,3.15,29.25a1.92,1.92,0,0,1-2.16,2h-57.54a1,1,0,0,0-1.18,1.18,21.17,21.17,0,0,0,1.18,5.3c2.55,8.24,9.82,12.56,19.64,12.56a30.5,30.5,0,0,0,21.79-8.44c1-.78,2-1,2.75,0l13,12.18a1.77,1.77,0,0,1,.2,2.75c-9,9.62-23,15.9-40.45,15.9C1789.61,1136.1,1774.69,1126.09,1769.19,1109Zm56.55-32.59a1,1,0,0,0,1.18-1.18,23.82,23.82,0,0,0-1-7.07c-2.16-6.48-8-10.41-15.91-10.41s-13.75,3.93-15.91,10.41a23.82,23.82,0,0,0-1,7.07,1,1,0,0,0,1.18,1.18Z"',' transform="translate(-1401.69 -918.27)"/>'],['<path fill="#514c4c"',' d="M1898.61,1135.12c-22,0-30.24-9.82-30.24-31.62v-43.2a1,1,0,0,0-1.18-1.18h-5.89a1.85,1.85,0,0,1-2-2v-16.3a1.85,1.85,0,0,1,2-2h5.89a1,1,0,0,0,1.18-1.18v-25.53a1.85,1.85,0,0,1,2-2h23.37a1.85,1.85,0,0,1,2,2v25.53a1,1,0,0,0,1.18,1.18H1909a1.86,1.86,0,0,1,2,2v16.3a1.85,1.85,0,0,1-2,2h-12.18a1,1,0,0,0-1.18,1.18v42c0,7.06,2.36,9.42,8.64,9.42H1909a1.86,1.86,0,0,1,2,2v19.45a1.86,1.86,0,0,1-2,2Z"',' transform="translate(-1401.69 -918.27)"/>'],['<path fill="#514c4c"',' d="M1919.28,1121.37a1.91,1.91,0,0,1,0-2.75l12.77-14.33a1.89,1.89,0,0,1,2.75,0c8.44,6.48,19.24,10.41,29.06,10.41,10,0,14.73-3.73,14.73-9,0-4.51-2.56-7.26-13.55-8.24l-10.61-1.18c-20-2-31-12-31-29.06,0-18.66,14.33-30.44,39.07-30.44,16.11,0,29.66,5.1,38.49,11.78a2.14,2.14,0,0,1,.2,3l-11,13.55a1.92,1.92,0,0,1-2.75.39,49.74,49.74,0,0,0-25.72-7.66c-8,0-12,3.14-12,7.86,0,4.32,2.36,6.87,13.16,7.85l10.4,1.18c22.39,2.16,31.62,13,31.62,28.86-.2,19.44-15.32,32.6-42.42,32.6C1942.65,1136.1,1928.32,1129.23,1919.28,1121.37Z"',' transform="translate(-1401.69 -918.27)"/>'],['<path fill="#514c4c"',' d="M2077.79,1133.94c-1.38,0-2.16-.59-2.95-2l-21.21-38.29-9.81,12.17V1132a1.86,1.86,0,0,1-2,2h-23.56a1.85,1.85,0,0,1-2-2v-129.6a1.86,1.86,0,0,1,2-2h23.56a1.86,1.86,0,0,1,2,2v72.06l27.29-33.58a4.5,4.5,0,0,1,3.73-2H2100a1.1,1.1,0,0,1,.78,2l-29.06,33.58,33.19,57.54a1.2,1.2,0,0,1-1,2Z"',' transform="translate(-1401.69 -918.27)"/>'],['<path fill="#514c4c"',' d="M2115.68,1133.94a1.85,1.85,0,0,1-2-2v-91.12a1.85,1.85,0,0,1,2-2h23.57a1.85,1.85,0,0,1,2,2v8.05h.2c4.51-7.65,13.15-12.17,24.74-12.17,6.28,0,12.57,2.16,16.69,5.69a1.93,1.93,0,0,1,.59,2.75l-11,20c-.78,1-1.57,1-2.75.4-4.51-2.95-9-4.52-13.74-4.32-10.21.39-14.73,7.85-14.73,20.61V1132a1.85,1.85,0,0,1-2,2Z"',' transform="translate(-1401.69 -918.27)"/>'],['<path fill="#514c4c"',' d="M2246.58,1133.94a1.86,1.86,0,0,1-2-2v-6.29h-.19c-4.91,6.29-13.16,10.41-26.12,10.41-16.89,0-31.61-8.84-31.61-29.06,0-21,15.9-30.63,39.47-30.63H2243a1,1,0,0,0,1.18-1.18v-3.54c0-8.83-4.32-13-19.44-13-9.62,0-16.69,2.75-21.21,6.09a1.56,1.56,0,0,1-2.55-.39l-8.84-15.52a1.89,1.89,0,0,1,.59-2.74c8.06-5.7,19.64-9.43,35.35-9.43,31,0,42.22,10.6,42.22,34.36V1132a1.85,1.85,0,0,1-2,2Zm-2.36-31.61v-6.48a1,1,0,0,0-1.18-1.18h-13.35c-11.58,0-16.89,3.34-16.89,10.8,0,6.67,4.72,10,13.75,10C2238.33,1115.48,2244.22,1111.16,2244.22,1102.33Z"',' transform="translate(-1401.69 -918.27)"/>'],['<path fill="#514c4c"',' d="M2291.92,1133.94a1.86,1.86,0,0,1-2-2V1060.3a1,1,0,0,0-1.17-1.18h-5.89a1.86,1.86,0,0,1-2-2v-16.3a1.86,1.86,0,0,1,2-2h5.89a1,1,0,0,0,1.17-1.18v-4.51c0-23.18,10.8-32.8,33.39-32.8h10.8a1.86,1.86,0,0,1,2,2v18.45a1.86,1.86,0,0,1-2,2h-6.09c-8.64,0-10.8,2.16-10.8,10.21v4.71a1,1,0,0,0,1.18,1.18h15.51a1.85,1.85,0,0,1,2,2v16.3a1.85,1.85,0,0,1-2,2h-15.51a1,1,0,0,0-1.18,1.18V1132a1.85,1.85,0,0,1-2,2Zm90.13,1.18c-21,0-29.46-9.23-29.46-30.24v-102.5a1.86,1.86,0,0,1,2-2h23.56a1.86,1.86,0,0,1,2,2v100.34c0,6.48,2.55,9,8.24,9h4.13a1.85,1.85,0,0,1,2,2v19.45a1.85,1.85,0,0,1-2,2Z"',' transform="translate(-1401.69 -918.27)"/>']],dp="</svg>",hp=lp.length,up=e=>{const t=e.attrs.msStepTime||0,n=e.attrs.width/134,i=e.attrs.withCircle||!1,o=!!e.attrs.once,r=e.attrs.className;let s=1,a=t?0:hp,l=0;function c(){s<0&&0==a?s=1:s>0&&a==hp&&(o?(s=0,clearInterval(l),l=0):s=-1),a+=s,pe.redraw()}return{oninit:()=>{t&&(l=setInterval(c,t))},onremove:()=>{0!=l&&(clearInterval(l),l=0)},view:()=>{let e=['<svg width="134" height="134" viewBox="-32 -8 134 134" fill="none" xmlns="http://www.w3.org/2000/svg">'];i&&e.push('<circle class="shadow" cx="35" cy="59" r="63" fill="#ffffff"/>');for(let t=0;t<a;t++)for(let n of lp[t])e.push(n);e.push(dp);let t={style:{transform:`scale(${n})`,"transform-origin":"left top"}};return null!=r&&(t.class=r),pe("div",t,pe.trust(e.join("\n")))}}},pp=cp.length,gp=e=>{const t=e.attrs.msStepTime||0,n=e.attrs.width/992.73,i=e.attrs.className;let o=1,r=t?0:pp,s=0;function a(){o<0&&0==r?o=1:o>0&&r==pp&&(o=-1),r+=o,pe.redraw()}return{oninit:()=>{t&&(s=setInterval(a,t))},onremove:()=>{0!=s&&(clearInterval(s),s=0)},view:()=>{let e=['<svg viewBox="0 0 992.73 323.47" fill="none" xmlns="http://www.w3.org/2000/svg">'];for(let t=0;t<r;t++)for(let n of cp[t])e.push(n);e.push(dp);const t={style:{transform:`scale(${n})`,"transform-origin":"left top"}};return i&&(t.class=i),pe("div",t,pe.trust(e.join("\n")))}}},fp=e=>{const t=void 0!==e.attrs.scale?e.attrs.scale:void 0!==e.attrs.width?e.attrs.width/23:void 0!==e.attrs.height?e.attrs.height/40:1;return{view:()=>pe("div",{style:{transform:`scale(${t})`,"transform-origin":"left top"}},pe.trust('\n<svg width="23" height="40" viewBox="0 0 23 40" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M22.7373 4.36927L18.9514 6.55391L15.1655 8.76018L11.3796 6.55391L7.57202 4.36927L15.1655 0L22.7373 4.36927Z" fill="#FDC12C"/>\n<path d="M22.7369 4.36923V8.76014L15.165 13.1294V8.76014L22.7369 4.36923Z" fill="#F8DA95"/>\n<path d="M15.1655 8.76014V13.1294L7.57202 8.76014V4.36923L15.1655 8.76014Z" fill="#E69419"/>\n<path d="M15.1653 13.1295L11.3794 15.3141L7.57182 17.4988L3.78591 15.3141L0 13.1295L7.57182 8.76022L15.1653 13.1295Z" fill="#AA3731"/>\n<path d="M7.57182 17.4987V21.868L0 17.4987V13.1295L7.57182 17.4987Z" fill="#721D19"/>\n<path d="M15.1653 26.2589L11.3794 28.4435L7.57182 30.6282L3.78591 28.4435L0 26.2589L7.57182 21.868L15.1653 26.2589Z" fill="#83C8CE"/>\n<path d="M7.57182 30.6282V34.9974L0 30.6282V26.2589L7.57182 30.6282Z" fill="#5699A5"/>\n<path d="M22.7373 17.4987L18.9514 19.6834L15.1655 21.868L11.3579 19.6834L7.57202 17.4987L15.1655 13.1295L22.7373 17.4987Z" fill="#669256"/>\n<path d="M22.7369 17.4987V21.8679L15.165 26.2588V21.8679L22.7369 17.4987Z" fill="#B7C7AD"/>\n<path d="M15.1655 21.8679V26.2588L7.57202 21.8679V17.4987L15.1655 21.8679Z" fill="#496A38"/>\n<path d="M22.7373 30.6282L18.9514 32.8128L15.1655 34.9974L11.3796 32.8128L7.57202 30.6282L15.1655 26.2589L22.7373 30.6282Z" fill="#E39FA5"/>\n<path d="M22.7369 30.6282V34.9975L15.165 39.3668V34.9975L22.7369 30.6282Z" fill="#EACFD1"/>\n<path d="M15.1655 34.9975V39.3668L7.57202 34.9975V30.6282L15.1655 34.9975Z" fill="#B6676D"/>\n</svg>\n'))}},mp={oninit:e=>{e.state.show=!1,e.state.ival=setTimeout((()=>{e.state.show=!0,e.state.ival=0,pe.redraw()}),800)},onremove:e=>{e.state.ival&&clearTimeout(e.state.ival),e.state.ival=0},view:e=>{if(e.state.show)return pe(".modal-dialog",{id:"spinner-dialog",style:{visibility:"visible"}},pe("div.animated-spinner",pe(up,{msStepTime:200,width:120,withCircle:!0})))}},vp=()=>{let e="",t="";return{oninit:n=>{e=n.attrs.initialValue+"",t=n.attrs.class,t=t?"."+t.split(" ").join("."):""},view:n=>{const{id:i,maxlength:o,tabindex:r,autocomplete:s}=n.attrs;return pe("input.text"+t,{id:i,name:i,maxlength:o,tabindex:r,autocomplete:s,value:e,oninput:t=>{e=t.target.value+""}})}}},bp={view:e=>{const t={onmouseout:Be,onmouseover:qe};return Object.assign(t,e.attrs),pe(".modal-close",t,e.children)}},wp={view:e=>{const t=e.attrs.item,n=e.attrs.view,i=n.model,o=0===t.userid.indexOf("robot-");return pe("span.list-ch",{title:Ee("Skora á"),onclick:e=>{t.chall?(t.chall=!1,i.modifyChallenge({destuser:t.userid,action:"retract"})):o?i.newGame(t.userid,!1):n.pushDialog("challenge",t),e.preventDefault()}},Ve("hand-right",void 0,!t.chall))}},xp={view:e=>{const t=e.attrs.item,n=e.attrs.view,i=!t.userid||0===t.userid.indexOf("robot-");return pe("span.list-info",{title:Ee("Skoða feril"),onclick:e=>{i||n.showUserInfo(t.userid,t.nick,t.fullname),e.preventDefault()}},i?"":pe("span.usr-info"))}},yp=e=>{const t=e.attrs;let n=!!t.online;const i=void 0===t.online,o=t.id,r=t.userId;return{oninit:async function(){if(i){const e=await be({method:"POST",url:"/onlinecheck",body:{user:r}});n=e&&e.online}},view:e=>{var t,r;return i||(n=null!==(r=null===(t=e.attrs)||void 0===t?void 0:t.online)&&void 0!==r&&r),pe("span",{id:o,title:Ee(n?"Er álínis":"Álínis?"),class:n?"online":""})}}},_p={view:e=>{var t;const n=e.attrs.view,i=n.model;return(null===(t=i.state)||void 0===t?void 0:t.userId)?pe(".userid",{title:Ee("player_info"),onclick:e=>{n.pushDialog("userprefs"),e.preventDefault()}},[Ve("address-book"),$e(),i.state.userNick]):""}},kp=e=>{var t,n;let i=null!==(t=e.attrs.initialSelection)&&void 0!==t?t:0;const o=null!==(n=e.attrs.defaultClass)&&void 0!==n?n:"",r=e.attrs.selectedClass||"selected";return{view:e=>{const t=e.children;if(Array.isArray(t))return pe("div",{onclick:e=>{const n=t.map((e=>e.dom));for(let t=0;t<n.length;t++)n[t].contains(e.target)&&(i=t);e.stopPropagation()}},t.map(((e,t)=>{const n=e;return n.attrs.className=t===i?o+" "+r:o,e})))}}},Cp={view:()=>pe(".info",{title:Ee("Upplýsingar og hjálp")},pe(pe.route.Link,{href:"/help",class:"iconlink"},Ve("info-sign")))},Ip={view:()=>pe(".logo",pe(pe.route.Link,{href:"/main",class:"nodecorate"},pe(fp,{scale:1.6})))},Sp=()=>{function e(e,t){var n,i;const o=null===(n=document.querySelector("#"+e+" #opt1"))||void 0===n?void 0:n.classList,r=null===(i=document.querySelector("#"+e+" #opt2"))||void 0===i?void 0:i.classList;o&&o.toggle("selected"),r&&r.toggle("selected"),void 0!==t&&r&&t(r.contains("selected"))}return{view:({attrs:{id:t,small:n,funcToggle:i,state:o,tabindex:r,title:s,opt1:a,opt2:l}})=>{const c=t+"-toggler",d=".option"+(n?".small":"");return pe.fragment({},[pe("input.checkbox."+t,{type:"checkbox",id:t,name:t,checked:o,value:"True"}),pe(".toggler",{id:c,tabindex:r,title:s,onclick:t=>{e(c,i),t.preventDefault()},onkeypress:t=>{" "==t.key&&(e(c,i),t.preventDefault())}},[pe(d+(o?"":".selected"),{id:"opt1"},a),pe(d+(o?".selected":""),{id:"opt2"},l)])])}}},Tp=e=>{const t=e.attrs.view.model;function n(e){t.state&&(t.state.ready=e,t.setUserPref({ready:e}))}return{view:()=>{var e,i;return pe(Sp,{id:"ready",state:null!==(i=null===(e=t.state)||void 0===e?void 0:e.ready)&&void 0!==i&&i,tabindex:2,opt1:$e(),opt2:Ve("thumbs-up"),funcToggle:n,small:!0,title:Ee("Tek við áskorunum!")})}}},Ep=e=>{const t=e.attrs.view.model;function n(e){t.state&&(t.state.readyTimed=e,t.setUserPref({ready_timed:e}))}return{view:()=>{var e,i;return pe(Sp,{id:"timed",state:null!==(i=null===(e=t.state)||void 0===e?void 0:e.readyTimed)&&void 0!==i&&i,tabindex:3,opt1:$e(),opt2:Ve("time"),funcToggle:n,small:!0,title:Ee("Til í viðureign með klukku!")})}}},Pp=()=>{function e(e){e&&Ke("your-turn")}return{view:({attrs:{state:t,tabindex:n}})=>pe(Sp,{id:"audio",state:t,tabindex:n,opt1:Ve("volume-off"),opt2:Ve("volume-up"),funcToggle:e,small:!0,title:Ee("Hljóð á/af")})}},Rp=()=>{function e(e){e&&Ke("you-win")}return{view:({attrs:{state:t,tabindex:n}})=>pe(Sp,{id:"fanfare",state:t,tabindex:n,opt1:Ve("volume-off"),opt2:Ve("volume-up"),funcToggle:e,small:!0,title:Ee("Lúðraþytur á/af")})}},Lp=()=>({view:({attrs:{state:e,tabindex:t}})=>pe(Sp,{id:"beginner",state:e,tabindex:t,opt1:$e(),opt2:Ve("ok"),small:!0})}),Np=()=>({view:({attrs:{state:e,tabindex:t}})=>pe(Sp,{id:"fairplay",state:e,tabindex:t,opt1:$e(),opt2:Ve("edit"),small:!0})}),Dp=e=>{var t,n;const i=e.attrs,o=i.view,r=o.model,s=i.duration,a=i.oppId,l=i.challengeKey;let c=i.oppNick,d=i.oppName,h=!1;const u=null!==(n=null===(t=r.state)||void 0===t?void 0:t.userId)&&void 0!==n?n:"",p="user/"+u+"/wait/"+a;let g=!1;return{oninit:()=>{u&&a&&(!async function(){try{if(!a||!l)return;const e=await be({method:"POST",url:"/initwait",body:{opp:a,key:l}});e&&e.online&&e.waiting&&(h=!0)}catch(e){}}(),Ku(p,(e=>{!0!==e&&e.game&&(g=!0,Yu(p),pe.route.set("/game/"+e.game))})))},view:()=>pe(".modal-dialog",{id:"wait-dialog",style:{visibility:"visible"}},pe(".ui-widget.ui-widget-content.ui-corner-all",{id:"wait-form"},[pe(".chall-hdr",pe("table",pe("tbody",pe("tr",[pe("td",pe("h1.chall-icon",Ve("time"))),pe("td.l-border",[pe(yp,{id:"chall-online",userId:a,online:h}),pe("h1",c),pe("h2",d)])])))),pe(".wait-explain",[Pe("p",["Þú ert reiðubúin(n) að taka áskorun um viðureign með klukku, ",pe("strong",["2 x ",s.toString(),Ee(" mínútur.")])]),Pe("p",["Beðið er eftir að áskorandinn ",pe("strong",c)," sé ",h?"":Pe("span#chall-is-online","álínis og "),"til í tuskið."]),Pe("p","Leikur hefst um leið og áskorandinn bregst við. Handahóf ræður hvor byrjar."),Pe("p","Ef þér leiðist biðin geturðu hætt við og reynt aftur síðar.")]),pe(bp,{id:"wait-cancel",title:Ee("Hætta við"),onclick:e=>{g||(Yu(p),async function(){try{await be({method:"POST",url:"/cancelwait",body:{user:u,opp:a,key:l}})}catch(e){}}(),o.popDialog()),e.preventDefault()}},Ve("remove"))]))}},Ap=e=>{const t=e.attrs,n=t.view,i=n.model,o=t.oppId,r=t.challengeKey;let s=t.oppNick,a=!0;return{oninit:()=>async function(){try{const e=await be({method:"POST",url:"/waitcheck",body:{user:o,key:r}});(null==e?void 0:e.waiting)?i.newGame(o,!0):a=!1}catch(e){}}(),view:()=>pe(".modal-dialog",{id:"accept-dialog",style:{visibility:"visible"}},pe(".ui-widget.ui-widget-content.ui-corner-all",{id:"accept-form"},[pe(".chall-hdr",pe("table",pe("tbody",pe("tr",[pe("td",pe("h1.chall-icon",Ve("time"))),pe("td.l-border",pe("h1",s))])))),pe("div",{style:{"text-align":"center","padding-top":"32px"}},[pe("p",Pe("strong","Viðureign með klukku")),Pe("p",a?"Athuga hvort andstæðingur er reiðubúinn...":["Andstæðingurinn ",pe("strong",s)," er ekki reiðubúinn"])]),pe(bp,{id:"accept-cancel",title:Ee("Reyna síðar"),onclick:e=>{n.popDialog(),e.preventDefault()}},Ve("remove"))]))}},Op=e=>{const t=e.attrs.view,n=t.model;function i(e){if(!e||!e.dom)return;const n=e.dom.getElementsByClassName("btn-promo-no");if(n)for(let e of n)e.onclick=e=>{t.popDialog(),e.preventDefault()},e.onmouseover=qe,e.onmouseout=Be;const i=e.dom.getElementsByClassName("btn-promo-yes");if(i){for(let e of i)e.onmouseover=qe,e.onmouseout=Be;Ze()}}return n.loadFriendPromo(),{view:()=>pe(".modal-dialog",{id:"promo-dialog",style:{visibility:"visible"}},pe(".ui-widget.ui-widget-content.ui-corner-all",{id:"promo-form"},pe(".promo-content",{oncreate:e=>i(e),onupdate:e=>i(e)},pe.trust(n.friendHTML||"<p>Sæki texta...</p>"))))}},Mp=e=>({view:()=>pe(".modal-dialog",{id:"thanks-dialog",style:{visibility:"visible"}},pe(".ui-widget.ui-widget-content.ui-corner-all",{id:"thanks-form"},[pe(".thanks-content",[pe("h3","Frábært!"),pe("p",["Bestu þakkir fyrir að gerast ",Ve("coffee-cup"),$e(),pe("b","Vinur Netskrafls"),"."]),pe("p",["Fríðindi þín virkjast um leið og greiðsla hefur verið staðfest. ",pe("b","Það getur tekið nokkrar mínútur.")," Þú færð staðfestingu og kvittun í tölvupósti."])]),pe(bp,{id:"btn-thanks",title:"Áfram",onclick:e=>{pe.route.set("/main"),e.preventDefault()}},Ve("ok"))]))}),Fp=e=>{const t=e.attrs.view;return{view:()=>pe(".modal-dialog",{id:"cancel-dialog",style:{visibility:"visible"}},pe(".ui-widget.ui-widget-content.ui-corner-all",{id:"cancel-form"},[pe("div",{id:"cancel-content"},[pe("h3","Hætta sem vinur Netskrafls?"),pe("p",["Viltu hætta sem ",Ve("coffee-cup"),$e(),pe("b","vinur Netskrafls")," og missa þar með þau fríðindi sem því tengjast?"]),pe("p","Fríðindin eru:"),pe("ul",[pe("li",[pe("b","Ótakmarkaður fjöldi viðureigna")," í gangi samtímis",pe("br"),"(í stað 8 að hámarki)"]),pe("li",["Aðgangur að ",pe("b","yfirliti")," í lok viðureignar"]),pe("li",[pe("b","Keppnishamur"),' án "græna þumalsins"'])]),pe(bp,{id:"btn-cancel-no",title:"Nei",onclick:e=>{e.preventDefault(),t.popDialog()}},[Ve("remove")," Nei"]),pe(bp,{id:"btn-cancel-yes",title:"Já",onclick:e=>{e.preventDefault(),t.popDialog(),t.cancelFriendship()}},[Ve("ok")," Já, vil hætta"])])]))}},zp=e=>{const t=e.attrs.view;return{view:()=>pe(".modal-dialog",{id:"confirm-dialog",style:{visibility:"visible"}},pe(".ui-widget.ui-widget-content.ui-corner-all",{id:"confirm-form"},[pe(".confirm-content",[pe("h3","Staðfesting"),pe("p",["Þú ert ekki lengur skráð(ur) sem ",Ve("coffee-cup"),$e(),pe("b","vinur Netskrafls"),"."])]),pe(bp,{id:"btn-thanks",title:"Áfram",onclick:e=>{e.preventDefault(),t.popDialog()}},Ve("ok"))]))}},Up={view:e=>{var t;return pe("div.error",{style:{visibility:"visible"}},(null===(t=e.attrs)||void 0===t?void 0:t.message)||"Error logging in")}},jp=e=>{const t=e.attrs.loginUrl;let n=!1;function i(e){n=!0,e.preventDefault(),window.location.href=t}return{view:()=>pe.fragment({},[pe("div.loginform-large",[pe(up,{className:"login-logo",width:200,withCircle:!1,msStepTime:150,once:!0}),pe(gp,{className:"login-legend",width:600,msStepTime:0}),Pe("div.welcome","welcome_0"),Pe("div.welcome","welcome_1"),Pe("div.welcome","welcome_2"),pe("div.login-btn-large",{onclick:i},n?Te("Skrái þig inn..."):[Te("Innskrá")+" ",pe("span.glyphicon.glyphicon-play")])]),pe("div.loginform-small",[pe(up,{className:"login-logo",width:160,withCircle:!1,msStepTime:150,once:!0}),pe(gp,{className:"login-legend",width:650,msStepTime:0}),pe("div.login-btn-small",{onclick:i},Te(n?"Skrái þig inn...":"Innskrá"))])])}},qp=()=>{let e=!1;return{view:t=>{const{view:n,item:i}=t.attrs,o=n.model,r=o.state;if(!r)return;const s=""!==r.plan,a=i.fairplay&&r.fairPlay;return pe(".modal-dialog",{id:"chall-dialog",style:{visibility:"visible"}},pe(".ui-widget.ui-widget-content.ui-corner-all",{id:"chall-form"},[pe(".chall-hdr",pe("table",pe("tbody",pe("tr",[pe("td",pe("h1.chall-icon",Ve("hand-right"))),pe("td.l-border",[pe(yp,{id:"chall-online",userId:i.userid}),pe("h1",i.nick),pe("h2",i.fullname)])])))),pe("div",{style:{"text-align":"center"}},[pe(".promo-fullscreen",[Pe("p",[Pe("strong","Ný áskorun")," - veldu lengd viðureignar:"]),pe(kp,{initialSelection:0,defaultClass:"chall-time"},[pe("div",{id:"chall-none",tabindex:1},Te("Viðureign án klukku")),pe("div",{id:"chall-10",tabindex:2},[Ve("time"),Te("2 x 10 mínútur")]),pe("div",{id:"chall-15",tabindex:3},[Ve("time"),Te("2 x 15 mínútur")]),pe("div",{id:"chall-20",tabindex:4},[Ve("time"),Te("2 x 20 mínútur")]),pe("div",{id:"chall-25",tabindex:5},[Ve("time"),Te("2 x 25 mínútur")]),(null==r?void 0:r.runningLocal)?pe("div",{id:"chall-3",tabindex:6},[Ve("time"),Te("2 x 3 mínútur")]):pe("div",{id:"chall-30",tabindex:6},[Ve("time"),Te("2 x 30 mínútur")])])]),pe(".promo-mobile",[pe("p",Pe("strong","Ný áskorun")),pe(".chall-time.selected",{id:"extra-none",tabindex:1},Te("Viðureign án klukku"))])]),s?pe("div",{id:"chall-manual"},[Pe("span.caption.wide",["Nota ",Pe("strong","handvirka véfengingu"),pe("br"),'("keppnishamur")']),pe(".toggler[id='manual-toggler'][tabindex='7']",{onclick:t=>{e=!e,t.preventDefault()}},[pe(".option"+(e?"":".selected"),pe("span",$e())),pe(".option"+(e?".selected":""),Ve("lightbulb"))])]):"",a?pe("div",{id:"chall-fairplay"},[Te("Báðir leikmenn lýsa því yfir að þeir skrafla "),pe("br"),Pe("strong","án stafrænna hjálpartækja"),Te(" af nokkru tagi"),"."]):"",pe(bp,{id:"chall-cancel",title:Ee("Hætta við"),tabindex:8,onclick:e=>{n.popDialog(),e.preventDefault()}},Ve("remove")),pe(bp,{id:"chall-ok",title:Ee("Skora á"),tabindex:9,onclick:t=>{var r,s;let l=null!==(s=null===(r=document.querySelector("div.chall-time.selected"))||void 0===r?void 0:r.id.slice(6))&&void 0!==s?s:"0";l="none"===l?0:parseInt(l),i.chall=!0,o.modifyChallenge({destuser:i.userid,action:"issue",duration:l,fairplay:a,manual:e}),n.popDialog(),t.preventDefault()}},Ve("ok"))]))}}},Bp=()=>{function e(e,t){let n=e.elo_adj?e.elo_adj.toString():"",i=e.human_elo_adj?e.human_elo_adj.toString():"",o="",r="";return null!==e.elo_adj&&(e.elo_adj>0?(n="+"+n,o="elo-win"):e.elo_adj<0?o="elo-loss":(o="elo-neutral",n=Ve("stroller",{title:"Byrjandi"})),null!==e.human_elo_adj&&(e.human_elo_adj>0?(i="+"+i,r="elo-win"):e.human_elo_adj<0?r="elo-loss":(r="elo-neutral",i=Ve("stroller",{title:"Byrjandi"})))),n=pe("span",{class:"elo-btn right "+o+(""==n?" invisible":"")},n),i=pe("span",{class:"elo-btn left "+r+(""==i?" invisible":"")},i),pe(".listitem"+(t%2==0?".oddlist":".evenlist"),pe(pe.route.Link,{href:Ye(e.url)},[pe("span.list-win",e.sc0>=e.sc1?Ve("bookmark",{title:e.sc0==e.sc1?Ee("Jafntefli"):Ee("Sigur")}):He("bookmark",{title:Ee("Tap")})),pe("span.list-ts-short",e.ts_last_move),pe("span.list-nick",e.opp_is_robot?[Ve("cog"),$e(),e.opp]:e.opp),pe("span.list-s0",e.sc0),pe("span.list-colon",":"),pe("span.list-s1",e.sc1),pe("div.list-elo-adj",i),pe("div.list-elo-adj",n),pe("span.list-duration",function(){let t="";return e.duration?t=[pe("span.timed-btn",{title:Ee("Viðureign með klukku")})," 2 x "+e.duration+Ee(" mínútur")]:(e.days||e.hours||e.minutes)&&(e.days>1?t=e.days.toString()+Ee(" dagar"):1==e.days&&(t=Ee("1 dagur")),e.hours>0&&(t.length&&(t+=Ee(" og ")),1==e.hours?t+=Ee("1 klst"):t+=e.hours.toString()+Ee(" klst")),0===e.days&&(t.length&&(t+=Ee(" og ")),1==e.minutes?t+=Ee("1 mínúta"):t+=e.minutes.toString()+Ee(" mínútur"))),t}()),pe("span.list-manual",e.manual?{title:Ee("Keppnishamur")}:{},Ve("lightbulb",void 0,!e.manual))]))}return{view:t=>{const n=t.attrs.recentList;return pe("div",{id:t.attrs.id},n?n.map(e):"")}}},Vp={oninit:e=>{e.state.sel=e.attrs.sel},view:e=>pe(".toggler[id='elo-toggler']",{title:Ee("elo_list_choice")},[pe(".option.x-small",{className:"human"===e.state.sel?"selected":"",onclick:t=>{e.state.sel="human",e.attrs.onchange(e.state.sel),t.preventDefault()}},Ve("user")),pe(".option.x-small",{className:"all"===e.state.sel?"selected":"",onclick:t=>{e.state.sel="all",e.attrs.onchange(e.state.sel),t.preventDefault()}},Ve("cog")),pe(".option.x-small",{className:"manual"===e.state.sel?"selected":"",onclick:t=>{e.state.sel="manual",e.attrs.onchange(e.state.sel),t.preventDefault()}},Ve("lightbulb"))])},Hp=e=>{const{spec:t,view:n}=e.attrs;return{view:e=>pe("div",[pe(".listitem.listheader",[pe("span.list-ch",He("hand-right",{title:Ee("Skora á")})),Pe("span.list-rank","Röð"),pe("span.list-rank-no-mobile",{title:Ee("Röð í gær")},Ee("1d")),pe("span.list-rank-no-mobile",{title:Ee("Röð fyrir viku")},Ee("7d")),Pe("span.list-nick-elo","Einkenni"),pe("span.list-elo",{title:Ee("Elo-stig")},Ee("Elo")),pe("span.list-elo-no-mobile",{title:Ee("Elo-stig í gær")},Ee("1d")),pe("span.list-elo-no-mobile",{title:Ee("Elo-stig fyrir viku")},Ee("7d")),pe("span.list-elo-no-mobile",{title:Ee("Elo-stig fyrir mánuði")},Ee("30d")),pe("span.list-games",{title:Ee("Fjöldi viðureigna")},Ve("th")),pe("span.list-ratio",{title:Ee("Vinningshlutfall")},Ve("bookmark")),pe("span.list-avgpts",{title:Ee("Meðalstigafjöldi")},Ve("dashboard")),Pe("span.list-info-hdr","Ferill"),pe(Vp,{sel:t||"human",onchange:e=>{n.model.loadEloRatingList(e,!0)}})]),pe($p,{id:e.attrs.id,sel:t,view:e.attrs.view})])}},$p=e=>{const t=e.attrs.view,n=t.model,i=n.state;return{view:e=>{const o=n.eloRatingList||[];return pe("div",{id:e.attrs.id},o.map((function(n,o){var r;const s=0===n.userid.indexOf("robot-");function a(e,t){return 0===e||void 0!==t&&0===t?"--":e.toString()}let l=n.nick,c=pe("span.list-ch",$e());const d=null!==(r=null==i?void 0:i.userId)&&void 0!==r?r:"";return n.userid==d||n.inactive||(c=pe(wp,{view:t,item:n})),s&&(l=pe("span",[Ve("cog"),$e(),l])),n.fairplay&&!s&&(l=pe("span",[pe("span.fairplay-btn",{title:Ee("Skraflar án hjálpartækja")}),l])),pe(".listitem",{key:(e.attrs.sel||"sel")+o,className:o%2==0?"oddlist":"evenlist"},[c,pe("span.list-rank.bold",a(n.rank)),pe("span.list-rank-no-mobile",a(n.rank_yesterday)),pe("span.list-rank-no-mobile",a(n.rank_week_ago)),pe("span.list-nick-elo",{title:n.fullname},l),pe("span.list-elo.bold",n.elo),pe("span.list-elo-no-mobile",a(n.elo_yesterday,n.games_yesterday)),pe("span.list-elo-no-mobile",a(n.elo_week_ago,n.games_week_ago)),pe("span.list-elo-no-mobile",a(n.elo_month_ago,n.games_month_ago)),pe("span.list-games.bold",n.games>=1e5?Math.round(n.games/1e3)+"K":n.games),pe("span.list-ratio",n.ratio+"%"),pe("span.list-avgpts",n.avgpts),n.userid===d?$e():pe(xp,{view:t,item:n})])})))}}},Wp=()=>{let e=1;function t(e,t,n){var i=void 0===e?"":function(e,t=1e4){const n=e<0?"-":"";return(e=Math.abs(e))<t?`${n}${e}`:`${n}${e=Math.round(e/1e3)}K`}(e);return void 0!==n&&(i+=n),t?[Ve(t),$e(),i]:i}return{view:n=>{var i,o,r=n.attrs.ownStats,s=0,a=0,l=0,c=0;return void 0!==r&&void 0!==r.games&&void 0!==r.human_games&&(r.games>0&&(s=Math.round(100*r.wins/r.games),l=Math.round(r.score/r.games)),r.human_games>0&&(a=Math.round(100*r.human_wins/r.human_games),c=Math.round(r.human_score/r.human_games))),pe("div",{id:n.attrs.id},[pe(".toggler",{id:"own-toggler",title:Ee("stats_choice"),onclick:t=>{e=3-e,t.preventDefault()}},[pe(".option.small"+(1===e?".selected":""),{id:"opt1"},Ve("user")),pe(".option.small"+(2===e?".selected":""),{id:"opt2"},Ve("cog"))]),1===e?pe("div",{id:"own-stats-human",className:"stats-box",style:{display:"inline-block"}},[pe(".stats-fig",{title:Ee("Elo-stig")},r?t(null===(i=r.locale_elo)||void 0===i?void 0:i.human_elo,"crown"):""),pe(".stats-fig.stats-games",{title:Ee("Fjöldi viðureigna")},r?t(r.human_games,"th"):""),pe(".stats-fig.stats-win-ratio",{title:Ee("Vinningshlutfall")},t(a,"bookmark","%")),pe(".stats-fig.stats-avg-score",{title:Ee("Meðalstigafjöldi")},t(c,"dashboard"))]):"",2===e?pe("div",{id:"own-stats-all",className:"stats-box",style:{display:"inline-block"}},[pe(".stats-fig",{title:Ee("Elo-stig")},r?t(null===(o=r.locale_elo)||void 0===o?void 0:o.elo,"crown"):""),pe(".stats-fig.stats-games",{title:Ee("Fjöldi viðureigna")},r?t(r.games,"th"):""),pe(".stats-fig.stats-win-ratio",{title:Ee("Vinningshlutfall")},t(s,"bookmark","%")),pe(".stats-fig.stats-avg-score",{title:Ee("Meðalstigafjöldi")},t(l,"dashboard"))]):""])}}},Gp=e=>{const t=e.attrs.view.model;let n,i="";function o(){var e,o;if(void 0!==n&&(n.result=!1,n=void 0),"search"!==((null===(e=t.userListCriteria)||void 0===e?void 0:e.query)||"robots"))return void t.loadUserList({query:"search",spec:i},!0);if(i===(null===(o=t.userListCriteria)||void 0===o?void 0:o.spec))return;let r={result:!0,p:new Promise((e=>{setTimeout((()=>{e(r.result)}),800)}))};n=r,n.p.then((e=>{e&&(t.loadUserList({query:"search",spec:i},!0),n=void 0)}))}return{view:()=>{var e;const n=(null===(e=t.userListCriteria)||void 0===e?void 0:e.query)||"robots";return pe(".user-cat[id='user-search']",[Ve("search",{id:"search",className:"search"==n?"shown":"",onclick:()=>{var e;i="",o(),null===(e=document.getElementById("search-id"))||void 0===e||e.focus()}}),$e(),pe("input.text.userid",{type:"text",id:"search-id",name:"search-id",maxlength:16,placeholder:Ee("Einkenni eða nafn"),value:i,onfocus:()=>o(),oninput:e=>{i=e.target.value+"",o()}})])}}},Kp="/page#!";function Yp(e,t,n,i,o){let r=document.getElementById(t);if(!r)return;r.setAttribute("class","ui-tabs ui-widget ui-widget-content ui-corner-all");const s=document.querySelector("#"+t+" > ul");s&&(s.setAttribute("class","ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all"),s.setAttribute("role","tablist"));let a=document.querySelectorAll("#"+t+" > ul > li > a"),l=document.querySelectorAll("#"+t+" > ul > li"),c=[],d=[];for(let e=0;e<a.length;e++){const t=a[e].getAttribute("href");if(!t)continue;c.push(t.slice(1)),a[e].onclick=t=>{Qp(o,e),t.preventDefault()},a[e].removeAttribute("href"),a[e].setAttribute("class","ui-tabs-anchor sp"),a[e].setAttribute("role","presentation"),d.push(l[e]),l[e].setAttribute("class","ui-state-default ui-corner-top"),l[e].setAttribute("role","tab"),l[e].onmouseover=e=>{e.currentTarget.classList.toggle("ui-state-hover",!0)},l[e].onmouseout=e=>{e.currentTarget.classList.toggle("ui-state-hover",!1)};const n=document.getElementById(c[e]);n&&(n.setAttribute("class","ui-tabs-panel ui-widget-content ui-corner-bottom"),n.setAttribute("role","tabpanel"))}if(o.state.ids=c,o.state.lis=d,o.state.selected=0,i){const t=e.model,n=(e,t)=>{let n=t.slice(7),i=n.indexOf("?"),o=i>=0?n.slice(0,i):n,r=n.slice(o.length+1),s=r.length?function(e){const t=e.split("&"),n={};for(let e=0;e<t.length;e++){const i=t[e].split("=");2==i.length&&(n[i[0]]=decodeURIComponent(i[1]))}return n}(r):{};pe.route.set(o,s),window.history&&window.history.pushState({},"",t),e.preventDefault()},i=n=>{var i;(null===(i=null==t?void 0:t.state)||void 0===i?void 0:i.userId)&&e.pushDialog("userprefs"),n.preventDefault()},s=e=>{Qp(o,2),e.preventDefault()},a=e=>{Qp(o,3),e.preventDefault()};let l=r.querySelectorAll("a");for(let e=0;e<l.length;e++){let t=l[e],o=t.getAttribute("href");o&&o.slice(0,7)==Kp?t.onclick=e=>n(e,o):o&&"$$userprefs$$"===o?t.onclick=i:o&&"$$twoletter$$"===o?t.onclick=s:o&&"$$newbag$$"===o&&(t.onclick=a)}}n&&n(o),Jp(o)}function Jp(e){const t=e.state.selected,n=e.state.lis;e.state.ids.map(((e,i)=>{var o;null===(o=document.getElementById(e))||void 0===o||o.setAttribute("style","display: "+(i==t?"block":"none")),n[i].classList.toggle("ui-tabs-active",i===t),n[i].classList.toggle("ui-state-active",i===t)}))}function Qp(e,t){e.state.selected=t,Jp(e)}function Xp(e){var t=pe.route.param("tab");void 0!==t&&Qp(e,parseInt(t)||0)}const Zp=()=>({view:e=>{const t=e.attrs.ownStats||{},n=[];if(t.highest_score&&(n.push(Ee("Hæsta skor ")),n.push(pe("b",pe(pe.route.Link,{href:"/game/"+t.highest_score_game},t.highest_score)))),t.best_word){n.length&&(e.attrs.myself?n.push(pe("br")):n.push(" | "));let i=t.best_word,o=[];for(let e=0;e<i.length;e++)"?"==i[e]?(o.push(pe("span.blanktile",i[e+1])),e+=1):o.push(i[e]);n.push(Ee("Besta orð ")),n.push(pe("span.best-word",o)),n.push(", "),n.push(pe("b",pe(pe.route.Link,{href:"/game/"+t.best_word_game},t.best_word_score))),n.push(Ee(" stig"))}return pe("p",{id:e.attrs.id},n)}}),eg=()=>{function e(e){const t=e.model;function n(n){const i=function(){if(!t.state)return;const i=t.state;let o=[];return t.challengeList&&(o=n?t.challengeList.filter((e=>e.received)):t.challengeList.filter((e=>!e.received))),pe("div",{id:n?"chall-received":"chall-sent",oninit:()=>{null===t.challengeList&&t.loadChallengeList()}},o.map((function(n,o){const r=!n.received&&n.opp_ready&&n.prefs&&void 0!==n.prefs.duration&&n.prefs.duration>0,s=n.received||r,a=(l=n.prefs)&&void 0!==l.duration&&0!==l.duration?Te("with_clock",{duration:l.duration.toString()}):Te("Venjuleg ótímabundin viðureign");var l;return pe(".listitem"+(o%2==0?".oddlist":".evenlist"),[pe("span.list-ch",{onclick:function(e){const i=n.received?"decline":"retract",o={destuser:n.userid,action:i,key:n.key};t.modifyChallenge(o),e.preventDefault()}},n.received?Ve("thumbs-down",{title:Ee("Hafna")}):Ve("hand-right",{title:Ee("Afturkalla")})),pe(s?"a":"span",s?{href:"#",onclick:function(o){if(o.preventDefault(),!t.moreGamesAllowed())return Ju("hit_game_limit",{userid:i.userId,locale:i.locale,limit:t.maxFreeGames}),void e.showFriendPromo();n.received?n.prefs&&void 0!==n.prefs.duration&&n.prefs.duration>0?e.pushDialog("wait",{oppId:n.userid,oppNick:n.opp,oppName:n.fullname,duration:n.prefs.duration,challengeKey:n.key}):t.newGame(n.userid,!1):e.showAcceptDialog(n.userid,n.opp,n.key)},class:r?"opp-ready":""}:{},[pe("span.list-ts",n.ts),pe("span.list-nick",{title:n.fullname},n.opp),pe("span.list-chall",[n.prefs.fairplay?pe("span.fairplay-btn",{title:Ee("Án hjálpartækja")}):"",n.prefs.manual?pe("span.manual-btn",{title:Ee("Keppnishamur")}):"",a])]),pe(xp,{view:e,item:{userid:n.userid,nick:n.opp,fullname:n.fullname}})])})))}();return i?n?[pe(".listitem.listheader",[pe("span.list-icon",He("thumbs-down",{title:Ee("Hafna")})),Pe("span.list-ts","Hvenær"),Pe("span.list-nick","Áskorandi"),Pe("span.list-chall","Hvernig"),Pe("span.list-info-hdr","Ferill")]),i]:[pe(".listitem.listheader",[pe("span.list-icon",He("hand-right",{title:Ee("Afturkalla")})),Pe("span.list-ts","Hvenær"),Pe("span.list-nick","Andstæðingur"),Pe("span.list-chall","Hvernig"),Pe("span.list-info-hdr","Ferill")]),i]:[]}function i(e,n,i){var o;const r=(null===(o=t.userListCriteria)||void 0===o?void 0:o.query)||"robots";return pe("span",{className:e===r?"shown":"",id:e,onclick:n=>{"elo"===e?(t.userListCriteria={query:"elo",spec:"human"},t.userList=null,t.loadEloRatingList("human",!0)):(t.loadUserList({query:e,spec:""},!0),t.eloRatingSpec=null,t.eloRatingList=null),n.preventDefault()}},[Ve(n,{style:{padding:0}}),$e(),i])}function o(){var n,i,o,r,s;const a=null!==(i=null===(n=t.userListCriteria)||void 0===n?void 0:n.query)&&void 0!==i?i:"",l=null!==(r=null===(o=t.userListCriteria)||void 0===o?void 0:o.spec)&&void 0!==r?r:"",c=void 0===t.eloRatingSpec,d=a||"robots";if("elo"===d||c)return[pe(Hp,{id:"elolist",view:e,spec:null!==(s=t.eloRatingSpec)&&void 0!==s?s:null,key:"elopage"})];let h=[];void 0===t.userList||(null===t.userList||a!==d?t.loadUserList({query:d,spec:""},!0):h=t.userList);const u=0===h.length&&"search"===d&&""!==l,p="robots"===d;return[pe(".listitem.listheader",[pe("span.list-ch",He("hand-right",{title:Ee("Skora á")})),pe("span.list-fav",Ve("star-empty",{title:Ee("Uppáhald")})),Pe("span.list-nick","Einkenni"),Pe("span.list-fullname","Nafn og merki"),p?"":Pe("span.list-human-elo[id='usr-list-elo']","Elo"),p?"":Pe("span.list-info-hdr[id='usr-list-info']","Ferill")]),function(n){return pe("div",{id:"userlist"},n.map((function(n,i){const o=0===n.userid.indexOf("robot-");let r=[];return n.ready&&!o&&(r.push(pe("span.ready-btn",{title:Ee("Álínis og tekur við áskorunum")})),r.push($e())),n.ready_timed&&(r.push(pe("span.timed-btn",{title:Ee("Til í viðureign með klukku")})),r.push($e())),n.fairplay&&(r.push(pe("span.fairplay-btn",{title:Ee("Skraflar án hjálpartækja")})),r.push($e())),r.push(n.fullname),pe(".listitem"+(i%2==0?".oddlist":".evenlist"),[pe(wp,{view:e,item:n}),o?pe("span.list-fav",{style:{cursor:"default"}},Ve("star-empty")):pe("span.list-fav",{title:Ee("Uppáhald"),onclick:e=>{n.fav=!n.fav,t.markFavorite(n.userid,n.fav),e.preventDefault()}},Ve(n.fav?"star":"star-empty")),o?pe("a",{href:"",onclick:e=>{t.newGame(n.userid,!1),e.preventDefault()}},[pe("span.list-nick",[Ve("cog"),$e(),n.nick]),pe("span.list-fullname-robot",r)]):pe.fragment({},[pe("span.list-nick",n.nick),pe("span.list-fullname",r),pe("span.list-human-elo",n.human_elo)]),pe(xp,{view:e,item:n})])})))}(h),u?pe("div",{id:"user-no-match",style:{display:"block"}},[Ve("search")," ",pe("span",{id:"search-prefix"},l),Te(" finnst ekki")]):void 0]}function r(){const n=t.ownStats;return null===n&&t.loadOwnStats(),n&&pe(Wp,{view:e,id:"own-stats",ownStats:n})}function s(){const e=t.ownStats;return null===e&&t.loadOwnStats(),e&&pe(Zp,{id:"own-best",ownStats:e,myself:!0})}return pe(".tabbed-page",pe("div",{id:"main-tabs"},[function(){const e=t.numGames,n=t.numChallenges;return[pe(".header-logo",pe(pe.route.Link,{href:"/page",class:"backlink"},pe(fp))),pe("ul",[pe("li",pe("a[href='#tabs-1']",[Ve("th"),pe("span.tab-legend",Te("Viðureignir")),pe("span",{id:"numgames",style:e?"display: inline-block":""},e)])),pe("li",pe("a[href='#tabs-2']",[Ve("hand-right"),pe("span.tab-legend",Te("Áskoranir")),pe("span"+(t.oppReady?".opp-ready":""),{id:"numchallenges",style:n?"display: inline-block":""},n)])),pe("li",pe("a[href='#tabs-3']",[Ve("user"),pe("span.tab-legend",Te("Andstæðingar"))])),pe("li.no-mobile-list",pe("a[href='#tabs-4']",[Ve("bookmark"),pe("span.tab-legend",Te("Ferill"))]))])]}(),pe("div.tab-scroll-area",[pe("div",{id:"tabs-1"},[Pe("p.no-mobile-block",[Pe("strong","Viðureignir sem standa yfir"),"click_on_game",Ve("flag")," þú átt leik"]),[pe(".listitem.listheader",[pe("span.list-myturn",He("flag",{title:Ee("Átt þú leik?")})),pe("span.list-overdue",He("hourglass",{title:Ee("Langt frá síðasta leik?")})),Pe("span.list-ts-short","Síðasti leikur"),Pe("span.list-opp","Andstæðingur"),Pe("span.list-info-hdr","Ferill"),Pe("span.list-scorehdr","Staða"),Pe("span.list-tc","Framvinda"),pe("span.list-manual",He("lightbulb",{title:Ee("Keppnishamur")}))]),(null===t.gameList&&t.loadGameList(),pe("div",{id:"gamelist"},t.gameList?t.gameList.map(((t,n)=>pe(".listitem"+(n%2==0?".oddlist":".evenlist"),[pe(pe.route.Link,{href:Ye(t.url)},[function(){let e="",n="";return t.my_turn?e=Ee("Þú átt leik"):t.zombie?(e=Ee("Viðureign lokið"),n=".zombie"):(e=Ee("opp_move",{opponent:t.opp}),n=".grayed"),pe("span.list-myturn",pe("span.glyphicon.glyphicon-flag"+n,{title:e}))}(),pe("span.list-overdue",t.overdue?Ve("hourglass",{title:t.my_turn?"Er að renna út á tíma":"Getur þvingað fram uppgjöf"}):He("hourglass")),pe("span.list-ts-short",t.ts),function(){let e=null===t.oppid?[Ve("cog"),$e(),t.opp]:t.opp;return pe("span.list-opp",{title:t.fullname},e)}()]),pe(xp,{view:e,item:{userid:t.oppid,nick:t.opp,fullname:t.fullname}}),pe("span.list-s0",t.sc0),pe("span.list-colon",":"),pe("span.list-s1",t.sc1),pe("span.list-tc",function(){const e=t.sc0<t.sc1?".losing":"";return pe(".tilecount",pe(".tc"+e,{style:{width:t.tile_count.toString()+"%"}}))}()),pe("span.list-manual",t.manual?Ve("lightbulb",{title:Ee("Keppnishamur")}):He("lightbulb"))]))):"")),t.loadingGameList||void 0===t.gameList||null!==t.gameList&&t.gameList.length>0?"":pe(".hint",{style:{display:"block"}},[pe("p",["Ef þig vantar einhvern til að skrafla við, veldu flipann ",pe(pe.route.Link,{href:"/main?tab=2"},[Ve("user"),$e(),"Andstæðingar"])," og skoraðu á tölvuþjarka - ",Ve("cog"),$e(),pe("b","Amlóða"),", ",Ve("cog"),$e(),pe("b","Miðlung")," eða ",Ve("cog"),$e(),pe("b","Fullsterkan")," - eða veldu þér annan leikmann úr stafrófslistunum sem þar er að finna til að skora á."]),pe("p",["Þú stofnar áskorun með því að smella á bendi-teiknið ",Ve("hand-right",{style:{"margin-left":"6px","margin-right":"6px"}})," vinstra megin við nafn andstæðingsins."]),pe("p","Tölvuþjarkarnir eru ætíð reiðubúnir að skrafla og viðureign við þá hefst strax. Aðrir leikmenn þurfa að samþykkja áskorun áður en viðureign hefst."),pe("p.no-mobile-block",[pe(pe.route.Link,{href:"/help"},"Hjálp")," má fá með því að smella á bláa ",Ve("info-sign"),$e(),"-",$e(),"teiknið hér til vinstri."]),pe("p.no-mobile-block","Þú kemst alltaf aftur í þessa aðalsíðu með því að smella á örvarmerkið efst vinstra megin við skraflborðið.")])]]),pe("div",{id:"tabs-2"},[Pe("p.no-mobile-block",[Pe("strong","Skorað á þig"),"click_on_challenge",Ve("thumbs-down",{style:{"margin-left":"6px","margin-right":"6px"}})," til að hafna henni"]),n(!0),Pe("p.no-mobile-block",[Pe("strong","Þú skorar á aðra")," - smelltu á ",Ve("hand-right",{style:{"margin-left":"6px","margin-right":"6px"}})," til að afturkalla áskorun"]),n(!1)]),pe("div",{id:"tabs-4"},[r(),s(),Pe("p.no-mobile-block",[Pe("strong","Nýlegar viðureignir þínar"),"click_to_review"]),[pe(".listitem.listheader",[pe("span.list-win",He("bookmark",{title:Ee("Sigur")})),Pe("span.list-ts-short","Viðureign lauk"),Pe("span.list-nick","Andstæðingur"),Pe("span.list-scorehdr","Úrslit"),pe("span.list-elo-hdr",[pe("span.glyphicon.glyphicon-user.elo-hdr-left",{title:Ee("Mennskir andstæðingar")}),Te("Elo"),pe("span.glyphicon.glyphicon-cog.elo-hdr-right",{title:Ee("Allir andstæðingar")})]),Pe("span.list-duration","Lengd"),pe("span.list-manual",He("lightbulb",{title:Ee("Keppnishamur")}))]),(null===t.recentList&&t.loadRecentList(),pe(Bp,{view:e,id:"recentlist",recentList:t.recentList||[]}))]]),pe("div",{id:"tabs-3"},[pe("div",{id:"initials"},[pe(".user-cat[id='user-headings']",[i("robots","cog",Ee("Þjarkar"))," ",i("fav","star",Ee("Uppáhalds"))," ",i("live","flash",Ee("Álínis"))," ",i("alike","resize-small",Ee("Svipaðir"))," ",i("elo","crown",Ee("Topp 100"))]),pe(Gp,{view:e})]),o()])])]))}return{view:t=>{const n=t.attrs.view;return pe.fragment({},[pe(Ip),pe(_p,{view:n}),pe(Cp),pe(Tp,{view:n}),pe(Ep,{view:n}),pe("div",{oncreate:e=>{Yp(n,"main-tabs",void 0,!1,e)},onupdate:Xp},e(n))])}}},tg=e=>{const t=e.attrs.view,n=t.model;let i="";return{oninit:function(e){n.loadPromoContent(e.attrs.kind,(e=>{i=e}))},view:e=>{let n=e.attrs.initFunc;return pe(".modal-dialog",{id:"promo-dialog",style:{visibility:"visible"}},pe(".ui-widget.ui-widget-content.ui-corner-all",{id:"promo-form",className:"promo-"+e.attrs.kind},pe("div",{id:"promo-content",onupdate:e=>function(e,n){var i=e.dom.getElementsByClassName("btn-promo-no");for(let e=0;e<i.length;e++)i[e].onclick=()=>t.popDialog(),i[e].onmouseover=qe,i[e].onmouseout=Be;var o=e.dom.getElementsByClassName("btn-promo-yes");for(let e=0;e<o.length;e++)o[e].onmouseover=qe,o[e].onmouseout=Be;void 0!==n&&n()}(e,n)},pe.trust(i))))}}},ng=e=>{const t=e.attrs.view,n=t.model;let i={},o=[],r=!0;function s(e){var t,i;n.loadUserRecentList(e.attrs.userid,r?null:null!==(i=null===(t=n.state)||void 0===t?void 0:t.userId)&&void 0!==i?i:"",(e=>{o=e&&0===e.result?e.recentlist:[]}))}function a(e,t){r!=t&&(r=t,s(e))}return{oninit:e=>{s(e),function(e){n.loadUserStats(e.attrs.userid,(e=>{i=e&&0===e.result?e:{}}))}(e)},view:e=>pe(".modal-dialog",{id:"usr-info-dialog",style:{visibility:"visible"}},pe(".ui-widget.ui-widget-content.ui-corner-all",{id:"usr-info-form"},[pe(".usr-info-hdr",[pe("h1.usr-info-icon",[i.friend?Ve("coffee-cup",{title:Ee("Vinur Netskrafls")}):Ve("user"),$e()]),pe("h1[id='usr-info-nick']",e.attrs.nick),pe("span.vbar","|"),pe("h2[id='usr-info-fullname']",e.attrs.fullname),pe(".usr-info-fav",{title:Ee("Uppáhald"),onclick:t=>{t.preventDefault(),i.favorite=!i.favorite,n.markFavorite(e.attrs.userid,i.favorite)}},i.favorite?Ve("star"):Ve("star-empty"))]),pe("p",[pe("strong",Te("Nýjustu viðureignir")),$e(),pe("span.versus-cat",[pe("span",{class:r?"shown":"",onclick:()=>{a(e,!0)}},Te(" gegn öllum ")),pe("span",{class:r?"":"shown",onclick:()=>{a(e,!1)}},Te(" gegn þér "))])]),pe(".listitem.listheader",[pe("span.list-win",He("bookmark",{title:Ee("Sigur")})),Pe("span.list-ts-short","Viðureign lauk"),Pe("span.list-nick","Andstæðingur"),Pe("span.list-scorehdr","Úrslit"),pe("span.list-elo-hdr",[pe("span.glyphicon.glyphicon-user.elo-hdr-left",{title:Ee("Mennskir andstæðingar")}),"Elo",pe("span.glyphicon.glyphicon-cog.elo-hdr-right",{title:Ee("Allir andstæðingar")})]),Pe("span.list-duration","Lengd"),pe("span.list-manual",He("lightbulb",{title:Ee("Keppnishamur")}))]),pe(Bp,{view:t,id:"usr-recent",recentList:o}),pe(Wp,{view:t,id:"usr-stats",ownStats:i}),pe(Zp,{id:"usr-best",ownStats:i,myself:!1}),pe(bp,{id:"usr-info-close",title:Ee("Loka"),onclick:e=>{t.popDialog(),e.preventDefault()}},Ve("ok"))]))}},ig=e=>{const t=e.attrs.view.model;function n(e){let t=e.alphabet,n=t.length,i=0,o=[];for(;n>0;){let r=[];for(let o=0;o<6&&n>0;o++){let o=t[i++];r.push(pe("td",{onclick:t=>{e.placeBlank(o),t.preventDefault()},onmouseover:qe,onmouseout:Be},pe(".blank-choice.tile.racktile",o))),n--}o.push(pe("tr",r))}return o}return{view:()=>{const e=t.game;if(e)return pe(".modal-dialog",{id:"blank-dialog",style:{visibility:"visible"}},pe(".ui-widget.ui-widget-content.ui-corner-all",{id:"blank-form"},[Pe("p","Hvaða staf táknar auða flísin?"),pe(".rack.blank-rack",pe("table.board",{id:"blank-meaning"},n(e))),pe(bp,{id:"blank-close",title:Ee("Hætta við"),onclick:t=>{t.preventDefault(),e.cancelBlankDialog()}},Ve("remove"))]))}}},og=()=>({view:e=>{const{bag:t,newbag:n}=e.attrs;let i="";return t.length<=7?i+=".empty":n&&(i+=".new"),pe(".bag",{title:Ee("Flísar sem eftir eru")},pe("table.bag-content"+i,function(e){let t=[],n=0,i=e.length;for(;i>0;){let o=[];for(let t=0;t<19&&i>0;t++){let t=e[n++];"?"==t&&(t=" "),o.push(pe("td",pe.trust(t))),i--}t.push(pe("tr",o))}return t}(t)))}});function rg(e,t,n,i,o,r){const s={onmouseout:Be,onmouseover:qe};return i&&(s.title=i),r&&(s.id=r),s.onclick=t?e=>e.preventDefault():e=>{n&&n(),e.preventDefault()},pe("."+e+(t?".disabled":""),s,o)}const sg={view:e=>{const{game:t}=e.attrs;let n=[".score"];t.manual?n.push("manual"):t.wordGood&&(n.push("word-good"),void 0!==t.currentScore&&t.currentScore>=50&&n.push("word-great"));let i=void 0===t.currentScore?"?":t.currentScore.toString();return pe(n.join("."),{title:i},i)}},ag={view:e=>{const{view:t,disabled:n}=e.attrs,i=t.model.game;if(i)return rg("recallbtn",!!n,(()=>{i.resetRack(),t.updateScale()}),Ee("Færa stafi aftur í rekka"),Ve("down-arrow"))}},lg={view:e=>{const{view:t,disabled:n}=e.attrs,i=t.model.game;if(i)return rg("scramblebtn",!!n,(()=>i.rescrambleRack()),Ee("Stokka upp rekka"),Ve("random"))}},cg={view:e=>{const{view:t}=e.attrs,n=t.model.game;if(!n)return;const i=n.buttonState();return i.showRecall&&!i.showingDialog?pe(ag,{view:t}):i.showScramble&&!i.showingDialog?pe(lg,{view:t}):void 0}},dg=e=>{const t=e.attrs.view,n=t.model;return{view:()=>{const e=n.game;let i=[];if(!e)return;const o=e.buttonState();if(i.push(pe(".word-check"+(o.wordGood?".word-good":"")+(o.wordBad?".word-bad":""))),o.showChallenge){const t=(o.tilesPlaced||o.showingDialog)&&!o.lastChallenge;i.push(rg("challenge",t,(()=>e.submitChallenge()),"Véfenging (röng kostar 10 stig)",Ve("ban-circle")))}if(o.showRecall&&i.push(pe(ag,{view:t,disabled:o.showingDialog})),o.showScramble&&i.push(pe(lg,{view:t,disabled:o.showingDialog})),o.showMove){const n=Ee("submit_move");i.push(rg("submitmove",!o.tilesPlaced||o.showingDialog,(()=>{e.submitMove(),t.updateScale()}),n,[n,Ve("play")]))}if(o.showMoveMobile){let n=["submitmove"],r=void 0!==e.currentScore;e.manual?n.push("manual"):o.wordGood?(n.push("word-good"),void 0!==e.currentScore&&e.currentScore>=50&&n.push("word-great")):o.wordBad&&(n.push("word-bad"),r=!1);const s=void 0===e.currentScore?"?":e.currentScore.toString();let a,l=[pe("span.score-mobile",s)];o.canPlay&&r?l.push(Ve("play")):l.push(Ve("remove")),a=o.canPlay?r?()=>{e.submitMove(),t.updateScale()}:()=>{}:()=>{const e=document.querySelector("div.opp-turn");e&&(e.classList.toggle("flashing",!0),setTimeout((()=>e.classList.toggle("flashing",!1)),1200))},i.push(rg(n.join("."),o.showingDialog,a,s,l,"move-mobile"))}if(o.showForceResignMobile){const t=Ee("Þvinga til uppgjafar");i.push(rg("force-resign",o.showingDialog,(()=>e.forceResign()),t,t))}if(o.showPass&&i.push(rg("submitpass",(o.tilesPlaced||o.showingDialog)&&!o.lastChallenge,(()=>e.submitPass()),Ee("Pass"),Ve("forward"))),o.showExchange&&i.push(rg("submitexchange",o.tilesPlaced||o.showingDialog||!o.exchangeAllowed,(()=>e.submitExchange()),Ee("Skipta stöfum"),Ve("refresh"))),o.showResign&&i.push(rg("submitresign",o.showingDialog,(()=>e.submitResign()),Ee("Gefa viðureign"),Ve("fire"))),o.gameOver||o.localTurn||e.moveInProgress||null===e.player||i.push(pe(".opp-turn",{style:{visibility:"visible"}},[pe("span.move-indicator"),$e(),pe("strong",e.nickname[1-e.player]),Ee(" á leik"),$e(),o.tardyOpponent?pe("span.yesnobutton",{id:"force-resign",onclick:t=>{t.preventDefault(),e.forceResign()},onmouseout:Be,onmouseover:qe,title:Ee("14 dagar liðnir án leiks")},Ee("Þvinga til uppgjafar")):""])),o.tilesPlaced){const t=pe(sg,{game:e});t&&i.push(t)}return(null==e?void 0:e.moveInProgress)&&i.push(pe(".waitmove",pe(".animated-waitmove",pe(up,{msStepTime:100,width:38,withCircle:!1})))),pe(".buttons",i)}}};class hg{getEventCoordinates(e){if(e instanceof MouseEvent)return{x:e.clientX,y:e.clientY};if(e instanceof TouchEvent){const t=e.touches[0];return t?{x:t.clientX,y:t.clientY}:{x:this.lastX,y:this.lastY}}return{x:0,y:0}}static rectContains(e,t){return t.x>=e.left&&t.x<e.right&&t.y>=e.top&&t.y<e.bottom}constructor(e,t){var n,i;this.parentElement=null,this.parentRect=null,this.offsetX=0,this.offsetY=0,this.centerX=0,this.centerY=0,this.lastX=0,this.lastY=0,this.currentDropTarget=null,e.preventDefault();const o=e.currentTarget,r=this.getEventCoordinates(e);this.lastX=r.x,this.lastY=r.y,this.draggedElement=o,this.dropHandler=t,this.parentElement=o.parentElement,this.parentRect=null!==(i=null===(n=this.parentElement)||void 0===n?void 0:n.getBoundingClientRect())&&void 0!==i?i:null;const s=o.getBoundingClientRect(),{offsetWidth:a,offsetHeight:l}=o;o.classList.add("dragging"),document.body.appendChild(o);const{offsetWidth:c,offsetHeight:d}=o;this.offsetX=r.x-s.left+(c-a)/2,this.offsetY=r.y-s.top+(d-l)/2,this.centerX=c/2,this.centerY=d/2,this.boundEventHandlers={drag:this.drag.bind(this),endDrag:this.endDrag.bind(this)};const{drag:h,endDrag:u}=this.boundEventHandlers;e instanceof MouseEvent?(document.addEventListener("mousemove",h),document.addEventListener("mouseup",u)):e instanceof TouchEvent&&(document.addEventListener("touchmove",h,{passive:!1}),document.addEventListener("touchend",u)),this.updatePosition(r.x,r.y)}removeDragListeners(){const{drag:e,endDrag:t}=this.boundEventHandlers;document.removeEventListener("mousemove",e),document.removeEventListener("mouseup",t),document.removeEventListener("touchmove",e),document.removeEventListener("touchend",t)}elementCenter(e,t){return{x:e-this.offsetX+this.centerX,y:t-this.offsetY+this.centerY}}findDropTargetAtPoint(e,t){const{x:n,y:i}=this.elementCenter(e,t);for(const e of document.elementsFromPoint(n,i)){if(e.classList.contains("drop-target"))return e;if(e.classList.contains("not-target"))return null}return null}updatePosition(e,t){this.lastX=e,this.lastY=t,this.draggedElement.style.left=e-this.offsetX+"px",this.draggedElement.style.top=t-this.offsetY+"px"}updateDropTarget(e,t){const n=this.findDropTargetAtPoint(e,t);n!==this.currentDropTarget&&(this.currentDropTarget&&this.currentDropTarget.classList.remove("over"),n&&n.classList.add("over"),this.currentDropTarget=n)}drag(e){e.preventDefault();const t=this.getEventCoordinates(e);this.updatePosition(t.x,t.y),this.updateDropTarget(t.x,t.y);const n=null!==this.currentDropTarget||this.parentRect&&hg.rectContains(this.parentRect,t);this.draggedElement.classList.toggle("no-drop",!n)}resetPosition(){this.draggedElement.style.left="",this.draggedElement.style.top="",this.draggedElement.classList.remove("dragging","no-drop"),this.parentElement&&this.parentElement.appendChild(this.draggedElement)}endDrag(e){e.preventDefault();const t=this.getEventCoordinates(e),n=this.findDropTargetAtPoint(t.x,t.y);this.currentDropTarget&&this.currentDropTarget.classList.remove("over"),this.removeDragListeners(),this.draggedElement.style.visibility="hidden",this.resetPosition(),n&&this.dropHandler(this.draggedElement,n),setTimeout((()=>{this.draggedElement.style.visibility="visible"}))}}const ug=e=>{const{view:t,coord:n,opponent:i}=e.attrs,o=t.model,r=e=>{var i;return i=(e,i)=>{const r=o.game;if(!r)return;const s=i.id;if(!s)return;let a="";if("board-background"===s?a="R1":s.startsWith("sq_")&&(a=s.slice(3)),a)try{r.attemptMove(n,a),t.updateScale(),pe.redraw()}catch(e){console.error(e)}},new hg(e,i),e.redraw=!1,!1};return{view:()=>{const e=o.game;if(!e)return;const t="R"===n[0],s=e.tiles[n];let a=[".tile"],l={};if("?"===s.tile&&a.push("blanktile"),"q".includes(s.letter)?a.push("extra-wide"):"zxmæ".includes(s.letter)&&a.push("wide"),(t||s.draggable)&&(a.push(i?"freshtile":"racktile"),t&&"exchange"===e.showingDialog&&(s.xchg&&a.push("xchgsel"),l.onclick=e=>{s.xchg=!s.xchg,e.preventDefault()})),s.freshtile&&a.push("freshtile"),s.index){const e=150,t=(s.index*e).toString()+"ms";l.style=`animation-delay: ${t}`}return n===e.selectedSq&&a.push("sel"),void 0!==s.highlight&&a.push("highlight"+s.highlight),null!==e.showingDialog||e.over||s.draggable&&(l.onmousedown=r,l.ontouchstart=r),pe(a.join("."),l,[" "===s.letter?$e():s.letter,pe(".letterscore",s.score)])}}},pg={view:e=>{const{game:t}=e.attrs;return t.congratulate?pe("div",{id:"congrats"},[Ve("bookmark")," ",Pe("strong","Til hamingju með sigurinn!")]):t.over?pe("div",{id:"gameover"},[Ve("info-sign")," ",Pe("strong","Viðureigninni er lokið")]):void 0}},gg={view:e=>{const{game:t}=e.attrs,n=t.currentError||"";if(n&&n in Ne){const e=t.currentMessage||"",i=Ee(Ne[n]),o=i.indexOf("{word}");let r;return r=o>=0?[i.slice(0,o),pe("span.errword",e),i.slice(o+6)]:[i],pe(".error",{style:{visibility:"visible"},onclick:e=>{t.resetError(),e.preventDefault()}},[Ve("exclamation-sign"),...r])}}},fg=e=>{const t=e.attrs.view,n=t.model;return{view:()=>{const e=n.game;let i=[];return e&&(i=[pe(wg,{view:t,review:!1}),pe(xg,{view:t,review:!1}),pe(dg,{view:t}),pe(gg,{game:e}),pe(pg,{game:e})],i=i.concat(t.vwDialogs())),pe(".board-area",i)}}},mg=e=>{const t=e.attrs.view,n=t.model;return{view:e=>{const i=e.attrs.coord,o=n.game;if(o)return pe("td.not-target",{id:"sq_"+i,class:o.squareClass(i)},pe(ug,{view:t,coord:i,opponent:!1}))}}},vg=e=>{const t=e.attrs.view.model;return{view:e=>{const n=t.game;if(!n)return;const i=e.attrs.coord;let o=n.squareClass(i)||"";return o&&(o="."+o),e.attrs.opponent&&(o+=".opp"),pe("td"+o,{id:"sq_"+i},e.children)}}},bg=e=>{const t=e.attrs.view,n=t.model;return{view:e=>{const i=n.game;if(!i)return;const o=e.attrs.coord;let r=i.squareClass(o)||"";return r&&(r="."+r),null!==i.askingForBlank&&i.askingForBlank.to==o&&(r+=".blinking"),o==i.startSquare&&i.localturn&&(r+=".center"),pe("td.drop-target"+r,{id:"sq_"+o,onclick:e=>{if(null!==i.selectedSq)return e.stopPropagation(),i.attemptMove(i.selectedSq,o),i.selectedSq=null,e.currentTarget.classList.remove("sel"),t.updateScale(),!1},onmouseover:e=>{null!==i.selectedSq&&e.currentTarget.classList.add("sel")},onmouseout:e=>{e.currentTarget.classList.remove("sel")}},e.children)}}},wg=e=>{const{view:t,review:n}=e.attrs,i=t.model;function o(e){let o=[];const r=i.game;o.push(pe("td.rowid",{key:"R"+e},e));for(let i=1;i<=15;i++){const s=e+i.toString();r&&s in r.tiles?o.push(pe(mg,{view:t,key:s,coord:s,opponent:!1})):n?o.push(pe(vg,{view:t,key:s,coord:s,opponent:!1})):o.push(pe(bg,{view:t,key:s,coord:s}))}return pe("tr",o)}function r(){let e=[];e.push(function(){let e=[];e.push(pe("td"));for(let t=1;t<=15;t++)e.push(pe("td",t.toString()));return pe("tr.colid",e)}());for(const t of"ABCDEFGHIJKLMNO")e.push(o(t));return e}function s(){t.boardScale=1.5}function a(){1!=t.boardScale&&(t.boardScale=1,setTimeout(t.resetScale))}return{view:e=>{const n=t.boardScale||1;let i={};return Fe(i,s,a),1!=n&&(i.style=`transform: scale(${n})`),pe(".board",{id:"board-parent"},pe("table.board",i,pe("tbody",r())))}}},xg=e=>{const{view:t,review:n}=e.attrs,i=t.model;return{view:()=>{var e;const o=i.game;if(!o)return;let r=[];const s=null!==(e=i.reviewMove)&&void 0!==e?e:0,a=n&&s>0&&s%2===o.player;for(let e=1;e<=7;e++){const i="R"+e.toString();o&&i in o.tiles?n?r.push(pe(vg,{view:t,coord:i,opponent:a},pe(ug,{view:t,coord:i,opponent:a}))):r.push(pe(bg,{view:t,coord:i},pe(ug,{view:t,coord:i,opponent:!1}))):n?r.push(pe(vg,{view:t,coord:i,opponent:!1})):r.push(pe(bg,{view:t,coord:i}))}return pe(".rack-row",[pe(".rack-left",pe(cg,{view:t})),pe(".rack",pe("table.board",pe("tbody",pe("tr",r))))])}}},yg=e=>{const{view:t}=e.attrs,n=t.model;function i(e,i,o,r){var s;(null===(s=n.state)||void 0===s?void 0:s.uiFullscreen)&&(o===r?t.pushDialog("userprefs"):e.autoplayer[r]||t.showUserInfo(e.userid[r],e.nickname[r],e.fullname[r]),i.stopPropagation(),i.preventDefault())}return{view:e=>{const t=n.game;if(!t)return;const o=t.autoplayer[0],r=t.autoplayer[1],s=t.nickname[0],a=t.nickname[1],l=t.player,c=t.localturn,d=t.over;if("left"==e.attrs.side){if(o)return pe(".robot-btn.left",[Ve("cog"),$e(),s]);return pe(".player-btn.left"+(d||c!==(0===l)?"":".tomove"),{id:"player-0",onclick:e=>i(t,e,l,0)},[pe("span.left-to-move"),s])}if(r)return pe(".robot-btn.right",[Ve("cog"),$e(),a]);return pe(".player-btn.right"+(d||c!==(1===l)?"":".tomove"),{id:"player-1",onclick:e=>i(t,e,l,1)},[pe("span.right-to-move"),a])}}},_g=e=>{const t=e.attrs.view.model;let n=0;return{view:()=>{if(!t.game)return;const e=t.game,i=e.twoLetterWords()[n],o=[];for(const e of i){const t=e[1],i=[];for(let e=0;e<t.length;e++)i.push((r=0==e,s=t[e],pe(".twoletter-word",r?0==n?[pe("b",s[0]),s[1]]:[s[0],pe("b",s[1])]:s)));o.push(pe(".twoletter-group",i))}var r,s;return pe(".twoletter",{onclick:()=>{n=1-n},style:"z-index: 6"},pe(".twoletter-area"+(e.showClock()?".with-clock":""),{title:Ee(0==n?"Smelltu til að raða eftir seinni staf":"Smelltu til að raða eftir fyrri staf")},o))}}},kg=[{icon:":-)",image:"/static/icontexto_emoticons_03.png"},{icon:":-D",image:"/static/icontexto_emoticons_02.png"},{icon:";-)",image:"/static/icontexto_emoticons_04.png"},{icon:":-(",image:"/static/icontexto_emoticons_12.png"},{icon:":-o",image:"/static/icontexto_emoticons_10.png"},{icon:":-O",image:"/static/icontexto_emoticons_10.png"},{icon:":-p",image:"/static/icontexto_emoticons_14.png"},{icon:":-P",image:"/static/icontexto_emoticons_14.png"},{icon:"B-)",image:"/static/icontexto_emoticons_16.png"},{icon:":)",image:"/static/icontexto_emoticons_03.png"},{icon:":D",image:"/static/icontexto_emoticons_02.png"},{icon:";)",image:"/static/icontexto_emoticons_04.png"},{icon:":(",image:"/static/icontexto_emoticons_12.png"},{icon:":o",image:"/static/icontexto_emoticons_10.png"},{icon:":O",image:"/static/icontexto_emoticons_10.png"},{icon:":p",image:"/static/icontexto_emoticons_14.png"},{icon:":P",image:"/static/icontexto_emoticons_14.png"},{icon:"(y)",image:"/static/thumb-up.png"}],Cg=e=>{const{view:t}=e.attrs,n=t.model,i=n.game;function o(e){var t=function(e){return{year:parseInt(e.slice(0,4)),month:parseInt(e.slice(5,7)),day:parseInt(e.slice(8,10)),hour:parseInt(e.slice(11,13)),minute:parseInt(e.slice(14,16)),second:parseInt(e.slice(17,19))}}(e);return Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,t.second)}n.state;let r=null;function s(e,t){let n=o(e),i=null;if(null===r||(s=r,a=n,Math.round((a-s)/1e3)>=300)){const o=864e5,r=(new Date).getTime();let s,a=r-r%o;s=n<a-o?e.slice(0,-3):n<a?"Í gær "+e.slice(11,16):e.slice(11,16),i=pe(".chat-ts",{key:t},s)}var s,a;return r=n,i}const a=i?i.player:null;function l(e){for(const t of kg)if(e.indexOf(t.icon)>=0){const n=`<img src='${ve(t.image)}' height='32' width='32'>`;e=e.split(t.icon).join(n)}return e}function c(){var e,t;let o=[];if((null==i?void 0:i.chatLoading)||!(null==i?void 0:i.messages))return o;var r=0;const c=null!==(t=null===(e=n.state)||void 0===e?void 0:e.userId)&&void 0!==t?t:"";for(const e of i.messages){let t=null!=a?a:0;e.from_userid!=c&&(t=1-t);const n=s(e.ts,r);null!==n&&(o.push(n),r++);let i=We(e.msg);i=l(i),o.push(pe(".chat-msg"+(0===t?".left":".right")+(t===a?".local":".remote"),{key:r++},pe.trust(i)))}return o}function d(){const e=document.querySelectorAll("#chat-area .chat-msg");if(!e.length)return;const t=e[e.length-1];t.parentNode.scrollTop=t.offsetTop}function h(e){t.isDialogShown()||e.dom.focus()}function u(){let e=Ge("msg").trim();i&&e.length>0&&(i.sendMessage(e),function(e,t){document.getElementById(e).value=t}("msg",""))}const p=(null==i?void 0:i.messages)?i.messages.length:0;return{view:()=>pe(".chat",{style:"z-index: 6"},[pe(".chat-area"+((null==i?void 0:i.showClock())?".with-clock":""),{id:"chat-area",oncreate:d,onupdate:d},c()),pe(".chat-input",[pe("input.chat-txt",{type:"text",id:"msg",name:"msg",maxlength:254,disabled:p>=250,oncreate:e=>{h(e)},onupdate:e=>{h(e)},onkeypress:e=>{"Enter"==e.key&&(u(),e.preventDefault())}}),pe(bp,{id:"chat-send",title:Ee("Senda"),onclick:e=>{u(),e.preventDefault()}},Ve("chat"))])])}},Ig=e=>{const{view:t}=e.attrs,n=t.model,i=n.game,o=n.state;function r(e,t,n,o){const r=Xe(e);let s=r.col,a=r.row;for(const e of t){if("?"==e)continue;const t=Qe(a,s);t&&i.tiles.hasOwnProperty(t)&&(i.tiles[t].highlight=o?n:void 0),s+=r.dx,a+=r.dy}}function s(e,n){const{leftTotal:s,rightTotal:a,player:l}=n;let{co:c,tiles:d}=n,h=n.score,u="wordmove",p=c,g=0;if(""===c)if(u="othermove","PASS"==d)d=" "+Ee("Pass")+" ",h="";else if(0===d.indexOf("EXCH")){let e=d.slice(5).length;const t=Ee(1==e?"letter":"letters");d=" "+Ee("exchanged",{numtiles:e.toString(),letters:t})+" ",h=""}else"RSGN"==d?d=" "+Ee("Gaf viðureign")+" ":"CHALL"==d?(d=" "+Ee("Véfengdi lögn")+" ",h=""):"RESP"==d?h<0?(d=" "+Ee("Óleyfileg lögn")+" ",g=-1):d=" "+Ee("Röng véfenging")+" ":"TIME"==d?d=" "+Ee("Umframtími")+" ":"OVER"==d?(d=Ee("Viðureign lokið"),u="gameover"):u="wordmove";else c="("+c+")",d=d.split("?").join(""),g=1;if("gameover"==u)return function(e){return pe(".move.gameover",[pe("span.gameovermsg",e),pe("span.statsbutton",{onclick:e=>{e.preventDefault(),o.hasPaid?(pe.route.set("/review/"+i.uuid),null!=i&&Ju("game_review",{locale:i.locale,uuid:i.uuid})):(Ju("click_review",{userid:o.userId,locale:o.locale}),t.showFriendPromo())}},Te("Skoða yfirlit"))])}(d);let f,m=g>0&&!i.manual?Ee("Smelltu til að fletta upp"):"",v=0,b=i.player;l===b||null===b&&0===l?f="humangrad"+(0===l?"_left":"_right"):(f="autoplayergrad"+(0===l?"_left":"_right"),v=1);const w={};return o.uiFullscreen&&g>0&&(i.manual||"is_IS"==i.locale&&(w.onclick=()=>{window.open("https://malid.is/leit/"+d,"malid")},w.title=m),w.onmouseout=()=>{e[2]=!1,r(p,d,v,!1)},w.onmouseover=()=>{e[2]=!0,r(p,d,v,!0)}),0===l?pe(".move.leftmove."+f,w,[pe("span.total"+(l==b?".human":".autoplayer"),s),pe("span.score"+(e[2]?".highlight":""),h),pe("span."+u,[pe("i",d),$e(),c])]):pe(".move.rightmove."+f,w,[pe("span."+u,[c,$e(),pe("i",d)]),pe("span.score"+(e[2]?".highlight":""),h),pe("span.total"+(l==b?".human":".autoplayer"),a)])}return{view:e=>{const{move:t,info:n}=e.attrs;return s(t,n)}}},Sg=e=>{const t=e.attrs.view,n=t.model,i=n.game,o=n.state;function r(){let e=i?i.moves:[],n=[],o=0,r=0;for(let i=0;i<e.length;i++){let s=e[i],[a,[l,c,d]]=s;0===a?o=Math.max(o+d,0):r=Math.max(r+d,0);const h=pe(Ig,{view:t,move:s,info:{key:i.toString(),leftTotal:o,rightTotal:r,player:a,co:l,tiles:c,score:d}});n.push(h)}return n}const s=i?i.bag:"",a=!i||i.newbag;return{view:()=>pe(".movelist-container",[pe(".movelist",{onupdate:()=>{setTimeout(Je)}},r()),(null==o?void 0:o.uiFullscreen)?"":pe(og,{bag:s,newbag:a})])}},Tg=e=>{const t=e.attrs.view.model;return{view:()=>pe(".games",{style:"z-index: 6"},function(){let e=[];if(t.loadingGameList)return e;let n=t.gameList;if(void 0===n)return e;if(null===n)return t.loadGameList(),e;const i=t.game,o=i?i.uuid:"";for(let t of n){if(t.uuid==o)continue;if(!t.my_turn&&!t.zombie)continue;let n;n=null===t.oppid?[Ve("cog"),$e(),t.opp]:[t.opp];let i=t.sc0<t.sc1?".losing":"",r="Staðan er "+t.sc0+":"+t.sc1;e.push(pe(".games-item"+(t.timed?".game-timed":""),{key:t.uuid,title:r},pe(pe.route.Link,{href:Ye(t.url)},[pe(".at-top-left",pe(".tilecount",pe(".oc",n))),pe(".at-top-left",pe(".tilecount.trans",pe(".tc"+i,{style:{width:t.tile_count.toString()+"%"}},n)))])))}return e}())}},Eg=e=>{const t=e.attrs.game;return{view:e=>{const{tabid:n,title:i,icon:o,alert:r,funcSel:s}=e.attrs,a=(null==t?void 0:t.sel)||"movelist";return pe(".right-tab"+(a===n?".selected":""),{id:"tab-"+n,className:r?"alert":"",title:i,onclick:e=>{t&&null===t.showingDialog&&t.setSelectedTab(n)&&(s&&s(),"movelist"===n&&setTimeout(Je)),e.preventDefault()}},Ve(o))}}},Pg=()=>({view:e=>{const t=e.attrs.game;let n=!(t.autoplayer[0]||t.autoplayer[1]);const i=[pe(Eg,{game:t,tabid:"board",title:Ee("Borðið"),icon:"grid"}),pe(Eg,{game:t,tabid:"movelist",title:Ee("Leikir"),icon:"show-lines"}),pe(Eg,{game:t,tabid:"twoletter",title:Ee("Tveggja stafa orð"),icon:"life-preserver"}),pe(Eg,{game:t,tabid:"games",title:Ee("Viðureignir"),icon:"flag"})];return n&&i.push(pe(Eg,{game:t,tabid:"chat",title:Ee("Spjall"),icon:"conversation",funcSel:()=>{t.markChatShown()&&pe.redraw()},alert:!t.chatSeen&&"chat"!=t.sel})),pe.fragment({},i)}}),Rg=e=>{const t=e.attrs.view,n=t.model.game;function i(){if(!n||!n.showClock())return pe.fragment({},[]);function e(e,t,n,i){return pe("h3."+e+(n?".running-out":"")+(i?".blink":""),t)}return pe.fragment({},[e("clockleft",n.clockText0,n.runningOut0,n.blinking0),e("clockright",n.clockText1,n.runningOut1,n.blinking1),pe(".clockface",Ve("time"))])}function o(){const e=!!n&&n.fairplay,o=n?n.player:null,r=n?n.displayScore(0).toString():"",s=n?n.displayScore(1).toString():"";return pe(".heading",[pe(".logowrapper",pe(".header-logo",pe(pe.route.Link,{href:"/page",class:"backlink"},pe(fp)))),pe(".playerwrapper",[pe(".leftplayer"+(1===o?".autoplayercolor":".humancolor"),[pe(".player",pe(yg,{view:t,side:"left"})),pe(".scorewrapper",pe(".scoreleft",r))]),pe(".rightplayer"+(1===o?".humancolor":".autoplayercolor"),[pe(".player",pe(yg,{view:t,side:"right"})),pe(".scorewrapper",pe(".scoreright",s))]),pe(".fairplay",{style:{visibility:e?"visible":"hidden"}},pe("span.fairplay-btn.large",{title:Ee("Skraflað án hjálpartækja")}))]),i()])}function r(){if(!n)return;let e;switch(n.sel||"movelist"){case"movelist":e=pe(Sg,{view:t});break;case"twoletter":e=pe(_g,{view:t});break;case"chat":e=pe(Cg,{view:t});break;case"games":e=pe(Tg,{view:t})}const i=pe(Pg,{game:n});return pe(".right-area"+((null==n?void 0:n.showClock())?".with-clock":""),e?[i,e]:[i])}return{view:()=>pe(".rightcol",[o(),r()])}},Lg=e=>{const t=e.attrs.view.model,n=t.state;return{view:()=>pe(".board-help",{title:Ee("Hvernig reitirnir margfalda stigin")},[pe(".board-help-close",{title:Ee("Loka þessari hjálp"),onclick:e=>{n&&(n.beginner=!1,t.setUserPref({beginner:!1})),e.preventDefault()}},Ve("remove")),pe(".board-colors",[pe(".board-color[id='triple-word']",["3 x",pe("br"),Te("orð")]),pe(".board-color[id='double-word']",["2 x",pe("br"),Te("orð")]),pe(".board-color[id='triple-letter']",["3 x",pe("br"),Te("stafur")]),pe(".board-color[id='double-letter']",["2 x",pe("br"),Te("stafur")]),pe(".board-color[id='single-letter']",["1 x",pe("br"),Te("stafur")])])])}},Ng=()=>({view:e=>{const t=e.attrs.view,n=t.model,i=n.game;if(!i)return pe("div",[pe(".game-container"),pe(Ip)]);const o=i.bag,r=i.newbag,s=n.state;return pe("div.drop-target",{id:"board-background"},[pe(".game-container",[pe(Rg,{view:t}),pe(fg,{view:t}),(null==s?void 0:s.uiFullscreen)?pe(og,{bag:o,newbag:r}):"",i.askingForBlank?pe(ig,{view:t}):""]),pe(Ip),(null==s?void 0:s.beginner)?pe(Lg,{view:t}):"",pe(Cp)])}}),Dg=(e,t,n)=>{const i=e.model.game;function o(e,n,i){let o,r="wordmove";if(e.length>0)o=[pe("i",n.split("?").join(""))," ("+e+")"];else if(r="othermove","PASS"==n)o=Ee("Pass");else if(0===n.indexOf("EXCH")){let e=n.slice(5).length;const t=Ee(1==e?"letter":"letters");o=Ee("exchanged",{numtiles:e.toString(),letters:t})}else"RSGN"==n?o=Ee("Gaf viðureign"):"CHALL"==n?o=Ee("Véfengdi lögn"):"RESP"==n?o=Ee(i<0?"Óleyfileg lögn":"Röng véfenging"):"TIME"==n?o=Ee("Umframtími"):"OVER"==n?(o=Ee("Viðureign lokið"),r="gameover"):(r="othermove",o="--"==n?Ee("Stafaleif: (engin)"):[Ee("Stafaleif: "),pe("i.upper",n)]);return pe(".reviewhdr",[pe("span.movenumber","#"+t),pe("span",{class:r},o)])}return pe(".movelist-container",[pe(".movelist.bestmoves",function(){let r=[];if(!i||!t||t>i.moves.length)return r;const s=i.moves[t-1],[a,l,c]=s[1];r.push(o(a,l,c));const d=n;for(let n=0;n<d.length;n++){const[i,[o,s,a]]=d[n],l=Ag(e,t,n,d[n],{player:i,co:o,tiles:s,score:a});l&&r.push(l)}return r}())])},Ag=(e,t,n,i,o)=>{const r=e.model;if(!r.game)return;const s=r.game,{player:a,co:l,tiles:c,score:d}=o;function h(e,i,o,l){const c=Xe(e);let d=c.col,h=c.row,u=!1;l&&(r.highlightedMove=n,s.placeTiles(t-1,!0));for(let e of i){if("?"===e){u=!0;continue}const t=Qe(h,d);if(null===t)continue;const n=e;u&&(e="?");const i=s.tilescore(e);l&&(t in s.tiles?s.tiles[t].highlight=o:s.tiles[t]={player:a,tile:e,letter:n,score:i,draggable:!1,freshtile:!1,index:0,xchg:!1,review:!0,highlight:o}),d+=c.dx,h+=c.dy,u=!1}l||(r.highlightedMove=null,null!==r.reviewMove&&s.placeTiles(r.reviewMove))}const u="("+l+")",p=c.split("?").join("");let g=0;const f=s.player;let m;a===f||null===f&&0===a?m="humangrad"+(0===a?"_left":"_right"):(m="autoplayergrad"+(0===a?"_left":"_right"),g=1);const v={title:"Smelltu til að fletta upp"};return"is_IS"===s.locale&&(v.onclick=()=>{window.open("https://malid.is/leit/"+p,"malid")}),v.onmouseover=()=>{i[2]=!0,h(l,c,g,!0)},v.onmouseout=()=>{i[2]=!1,h(l,c,g,!1)},0===a?pe(".move.leftmove."+m,v,[pe("span.score"+(i[2]?".highlight":""),d),pe("span.wordmove",[pe("i",p),$e(),u])]):pe(".move.rightmove."+m,v,[pe("span.wordmove",[u,$e(),pe("i",p)]),pe("span.score"+(i[2]?".highlight":""),d)])},Og=e=>{if(null===e.model.game)return;const t=e.model.game;function n(e,n,i){let o=i;return void 0===o&&t.stats&&(o=t.stats[e]),void 0===o?"":("number"==typeof o&&(o=void 0!==n&&n>0?o.toFixed(n).replace(".",","):o.toString()),o)}let i,o;return null===t.stats&&t.loadStats(),1===t.player?(o="humancolor",i="autoplayercolor"):(i="humancolor",o="autoplayercolor"),pe(".gamestats",{style:{visibility:"visible"}},[pe("div",{style:{position:"relative",width:"100%"}},[pe(".player",{class:i,style:{width:"50%"}},pe(".robot-btn.left",t.autoplayer[0]?[Ve("cog"),$e(),t.nickname[0]]:t.nickname[0])),pe(".player",{class:o,style:{width:"50%","text-align":"right"}},pe(".robot-btn.right",t.autoplayer[1]?[Ve("cog"),$e(),t.nickname[1]]:t.nickname[1]))]),pe("div",{id:"gamestarted"},[pe("p",["Viðureignin hófst ",pe("span",n("gamestart")),pe("br"),"og henni lauk ",pe("span",n("gameend"))]),t.manual?pe("p","Leikið var í keppnisham"):""]),pe(".statscol",{style:{clear:"left"}},[pe("p",["Fjöldi leikja: ",pe("span",n("moves0"))]),pe("p",["Fjöldi bingóa: ",pe("span",n("bingoes0"))," (bónus ",pe("span",n("bingopoints0",0,t.stats?50*t.stats.bingoes0:0))," stig)"]),pe("p",["Stafir lagðir niður: ",pe("span",n("tiles0"))," (þar af ",pe("span",n("blanks0"))," auðir)"]),pe("p",["Meðalstig stafa (án auðra): ",pe("span",n("average0",2))]),pe("p",["Samanlögð stafastig: ",pe("span",n("letterscore0"))]),pe("p",["Margföldun stafastiga: ",pe("span",n("multiple0",2))]),pe("p",["Stig án stafaleifar í lok: ",pe("span",n("cleantotal0"))]),pe("p",["Meðalstig hvers leiks: ",pe("span",n("avgmove0",2))]),t.manual?pe("p",["Rangar véfengingar andstæðings x 10: ",pe("span",n("wrongchall0"))]):"",pe("p",["Stafaleif og frádráttur í lok: ",pe("span",n("remaining0"))]),pe("p",["Umframtími: ",pe("span",n("overtime0"))]),pe("p",["Stig: ",pe("span",n("total0",0,t.stats?t.stats.scores[0]:0))," (",pe("span",n("ratio0",1)),"%)"])]),pe(".statscol",[pe("p",["Fjöldi leikja: ",pe("span",n("moves1"))]),pe("p",["Fjöldi bingóa: ",pe("span",n("bingoes1"))," (bónus ",pe("span",n("bingopoints0",0,t.stats?50*t.stats.bingoes1:0))," stig)"]),pe("p",["Stafir lagðir niður: ",pe("span",n("tiles1"))," (þar af ",pe("span",n("blanks1"))," auðir)"]),pe("p",["Meðalstig stafa (án auðra): ",pe("span",n("average1",2))]),pe("p",["Samanlögð stafastig: ",pe("span",n("letterscore1"))]),pe("p",["Margföldun stafastiga: ",pe("span",n("multiple1",2))]),pe("p",["Stig án stafaleifar í lok: ",pe("span",n("cleantotal1"))]),pe("p",["Meðalstig hvers leiks: ",pe("span",n("avgmove1",2))]),t.manual?pe("p",["Rangar véfengingar andstæðings x 10: ",pe("span",n("wrongchall1"))]):"",pe("p",["Stafaleif og frádráttur í lok: ",pe("span",n("remaining1"))]),pe("p",["Umframtími: ",pe("span",n("overtime1"))]),pe("p",["Stig: ",pe("span",n("total1",0,t.stats?t.stats.scores[1]:0))," (",pe("span",n("ratio1",1)),"%)"])]),pe(".closebtn",{id:"review-close",onclick:e=>{setTimeout((()=>{pe.route.set("/review/"+t.uuid,{move:1})})),e.preventDefault()},onmouseover:qe,onmouseout:Be},[Ve("play")," Rekja"])])},Mg=(e,t)=>{var n,i;const o=e.model,r=o.game,s=null!==(n=null==r?void 0:r.moves.length)&&void 0!==n?n:0;let a=[];if(!(null!==(i=null==r?void 0:r.uuid)&&void 0!==i?i:""))return a;if(a.push(rg("navbtn",!t,(()=>{o.loadBestMoves(t?t-1:0)}),"Sjá fyrri leik",pe("span",{id:"nav-prev-visible"},[Ve("chevron-left")," Fyrri"]),"navprev")),a.push(rg("navbtn",!t||t>=s,(()=>{o.loadBestMoves(t+1)}),"Sjá næsta leik",pe("span",{id:"nav-next-visible"},["Næsti ",Ve("chevron-right")]),"navnext")),null!==o.highlightedMove){const n=((e,t)=>{const n=e.model,i=n.game;if(!i)return;let o=[".scorediff"];const r=t?i.moves[t-1]:void 0;let s=r?r[1][2]:void 0,a="";if(void 0===s||null===n.bestMoves||null===n.highlightedMove);else{const e=n.bestMoves[n.highlightedMove][1][2];a=(s-e).toString(),"-"!=a[0]&&"0"!=a[0]&&(a="+"+a),s>=e&&o.push("posdiff")}return pe(o.join("."),{style:{visibility:"visible"}},a)})(e,t);void 0!==n&&a.push(n)}const l=((e,t)=>{var n;const i=e.model.game;if(!i)return;const o=t?i.moves[t-1]:void 0;if(void 0===o)return;const[r,[s,a,l]]=o;if(void 0===l||""===s&&"OVER"===a)return;let c=[".score"];return t>0&&(t%2===(null!==(n=i.player)&&void 0!==n?n:0)?c.push("opponent"):c.push("localplayer")),pe(c.join("."),l.toString())})(e,t);return void 0!==l&&a.push(l),a},Fg=e=>{const t=e.attrs.view,n=t.model;return{view:e=>{let i=[];if(n.game){i=[pe(wg,{view:t,review:!0}),pe(xg,{view:t,review:!0})];const n=e.attrs.moveIndex;null!==n&&(i=i.concat(Mg(t,n)))}return pe(".board-area",i)}}};async function zg(e,t){if(!t)return console.error("No container element found"),"error";((e,t,n)=>{const i=e=>(e.length>0&&"/"===e[e.length-1]&&(e=e.slice(0,-1)),e);e&&(ge=i(e)),t&&(fe=i(t)),n&&(me=n)})(e.serverUrl,e.movesUrl,e.movesAccessKey),function(e){const t=document.styleSheets;for(const n of t)for(const t of n.cssRules)t instanceof CSSFontFaceRule&&t.style.getPropertyValue("src").includes("glyphicons-")&&t.style.setProperty("src",`\n url('${e}/static/glyphicons-regular.eot') format('embedded-opentype'),\n url('${e}/static/glyphicons-regular.woff') format('woff'),\n url('${e}/static/glyphicons-regular.ttf') format('truetype')\n `)}(e.serverUrl);try{const n=await(async(e,t,n,i)=>be({method:"POST",url:"/login_malstadur",body:{email:e,nickname:t,fullname:n,token:i}}))(e.userEmail,e.userNick,e.userFullname,e.token);if("expired"===n.status)return"expired";if("success"===n.status){e.userId=n.user_id,await Gu(e,n.firebase_token);const i=function(){const e=[{name:"main",route:"/main",mustLogin:!0},{name:"help",route:"/help",mustLogin:!1},{name:"thanks",route:"/thanks",mustLogin:!0},{name:"cancel",route:"/cancel",mustLogin:!0},{name:"confirm",route:"/confirm",mustLogin:!0},{name:"game",route:"/game/:uuid",mustLogin:!0},{name:"review",route:"/review/:uuid",mustLogin:!0},{name:"login",route:"/login",mustLogin:!1},{name:"loginerror",route:"/loginerror",mustLogin:!1}];return{paths:e,defaultRoute:e[0].route}}(),o=new sp(i,e),r=new Ug(o),s=function(e){let t=e.model,n=e.view;return t.paths.reduce(((t,i)=>(t[i.route]={onmatch:t=>{n.popAllDialogs(),e.onNavigateTo(i.name,t)},render:()=>n.appView(i.name)},t)),{})}(new ap(o,r));return pe.route(t,i.defaultRoute,s),"success"}}catch(e){console.error("Exception during login: ",e)}return pe.mount(t,Up),"error"}class Ug{constructor(e){this.dialogStack=[],this.boardScale=1,this.model=e,window.setInterval(this.blinker,500)}appView(e){const t=this.model;let n=[];switch(e){case"login":n.push(this.vwLogin());break;case"loginerror":n.push(pe(Up));break;case"main":n.push(pe(eg,{view:this}));break;case"game":n.push(pe(Ng,{view:this}));break;case"review":const e=(e=>{var t;const n=e.model;if(!n.game)return;const i=n.game;let o=null!==(t=n.reviewMove)&&void 0!==t?t:0,r=n.bestMoves||[],s=[];if(i&&(s.push(pe(".rightcol",[function(){const t=i.fairplay,n=i.player;let r="",s="";if(o){let e=0,t=0;for(let n=0;n<o;n++){let o=i.moves[n];n%2==0?e+=o[1][2]:t+=o[1][2]}r=e.toString(),s=t.toString()}return pe(".heading",[pe(".logowrapper",pe(".header-logo",pe(pe.route.Link,{href:"/page",class:"backlink"},pe(fp)))),pe(".playerwrapper",[pe(".leftplayer"+(1===n?".autoplayercolor":".humancolor"),[pe(".player",pe(yg,{view:e,side:"left"})),pe(".scorewrapper",pe(".scoreleft",r))]),pe(".rightplayer"+(1===n?".humancolor":".autoplayercolor"),[pe(".player",pe(yg,{view:e,side:"right"})),pe(".scorewrapper",pe(".scoreright",s))]),pe(".fairplay",{style:{visibility:t?"visible":"hidden"}},pe("span.fairplay-btn.large",{title:Ee("Skraflað án hjálpartækja")}))])])}(),pe(".right-area",Dg(e,o,r))])),s.push(pe(Fg,{view:e,moveIndex:o})),null!==n.reviewMove&&0===o)){const t=Og(e);t&&s.push(t)}return pe("div",[pe(".game-container",s),pe(Ip),pe(Cp)])})(this);e&&n.push(e);break;case"thanks":n.push(pe(eg,{view:this})),this.dialogStack.length||this.showThanks();break;case"help":n.push(this.vwHelp(parseInt(pe.route.param("tab")||""),parseInt(pe.route.param("faq")||"")));break;default:return[pe("div",Te("Þessi vefslóð er ekki rétt"))]}for(const e of this.dialogStack){const t=Ug.dialogViews[e.name];if(void 0===t)console.error("Unknown dialog name: "+e.name);else{const i=t(this,e.args);i&&n.push(i)}}return t.spinners&&n.push(pe(mp)),n}pushDialog(e,t){this.dialogStack.push({name:e,args:t}),pe.redraw()}popDialog(){this.dialogStack.length>0&&(this.dialogStack.pop(),pe.redraw())}popAllDialogs(){this.dialogStack.length>0&&(this.dialogStack=[],pe.redraw())}isDialogShown(){return this.dialogStack.length>0}startSpinner(){this.model.spinners++}stopSpinner(){this.model.spinners&&this.model.spinners--}async cancelFriendship(){let e=!0;try{this.startSpinner(),await this.model.cancelFriendship()&&(this.stopSpinner(),e=!1,this.pushDialog("confirm",{}))}catch(e){}finally{e&&this.stopSpinner()}}notifyMediaChange(){var e,t;const n=this.model;n.game&&((null===(e=n.state)||void 0===e?void 0:e.uiFullscreen)||(null===(t=n.state)||void 0===t?void 0:t.uiLandscape)?n.game.setSelectedTab("movelist")&&setTimeout(Je):n.game.setSelectedTab("board")),this.popAllDialogs()}notifyChatMessage(){pe.redraw()}resetScale(){this.boardScale=1;const e=document.getElementById("board-parent"),t=null==e?void 0:e.children[0];t&&t.setAttribute("style","transform: scale(1.0)"),e&&e.scrollTo(0,0)}updateScale(){var e;const t=this.model,n=t.game;if(!n||(null===(e=t.state)||void 0===e?void 0:e.uiFullscreen)||n.moveInProgress)return this.boardScale=1,void setTimeout(this.resetScale);const i=n.tilesPlaced(),o=i.length;1===o&&1===this.boardScale?(this.boardScale=1.5,setTimeout((()=>function(e){const t=Xe(e),n=Qe(Math.max(0,t.row-3),Math.max(0,t.col-3)),i=document.getElementById("board-parent"),o=null==i?void 0:i.children[0];o&&o.setAttribute("style","transform: scale(1.5)");const r=document.getElementById("sq_"+n),s=null==r?void 0:r.getBoundingClientRect(),a=null==i?void 0:i.getBoundingClientRect();i&&s&&a&&i.scrollTo({left:s.left-a.left,top:s.top-a.top,behavior:"smooth"})}(i[0])))):0===o&&this.boardScale>1&&(this.boardScale=1,setTimeout((()=>this.resetScale())))}showUserInfo(e,t,n){this.pushDialog("userinfo",{userid:e,nick:t,fullname:n})}showFriendPromo(){this.pushDialog("friend",{})}showThanks(){this.pushDialog("thanks",{})}showFriendCancel(){this.pushDialog("cancel",{})}showAcceptDialog(e,t,n){this.pushDialog("accept",{oppId:e,oppNick:t,challengeKey:n})}vwDialogButton(e,t,n,i,o){return pe(bp,{id:e,onclick:n,title:t,tabindex:o},i)}blinker(){const e=document.getElementsByClassName("blinking");for(let t of e)t.classList.toggle("over")}vwTabsFromHtml(e,t,n,i){return e?pe("div",{oninit:e=>{e.state.selected=n||1},oncreate:e=>{Yp(this,t,i,!0,e)}},pe.trust(e)):""}vwHelp(e,t){const n=this.model;return pe.fragment({},[pe(Ip),pe(_p,{view:this}),this.vwTabsFromHtml(n.helpHTML||"","tabs",e,(function(e){var n;function i(t,n){var i;e.state.selected=1,null===(i=e.dom.querySelector(n))||void 0===i||i.scrollIntoView(),t.preventDefault()}const o=e.dom.querySelectorAll("a");for(const e of o){const t=e.getAttribute("href");t&&"#faq-"==t.slice(0,5)&&(e.onclick=e=>{i(e,t)})}void 0===t||isNaN(t)||(Qp(e,1),e.state.selected=1,null===(n=e.dom.querySelector("#faq-"+t.toString()))||void 0===n||n.scrollIntoView())}))])}vwUserPrefsDialog(){const e=this.model;if(!e.user)return;const t=e.user;if(!e.state)return;const n=e.state,i=e.userErrors||{},o=this;function r(e){return i.hasOwnProperty(e)?pe(".errinput",[Ve("arrow-up"),$e(),i[e]||""]):""}function s(e){var t;const n=null===(t=document.querySelector("#"+e+"-toggler #opt2"))||void 0===t?void 0:t.classList;return!!n&&n.contains("selected")}return pe(".modal-dialog",{id:"user-dialog",oncreate:function(e){e.dom.querySelector("#nickname").focus()}},pe(".ui-widget.ui-widget-content.ui-corner-all",{id:"user-form"},[pe(".loginhdr",[Ve("address-book")," "+Ee("player_info")]),pe("div",pe("form",{action:"",id:"frm1",method:"post",name:"frm1"},[pe(".dialog-spacer",[pe("span.caption",Te("Einkenni:")),pe(vp,{initialValue:t.nickname||"",class:"username",maxlength:15,id:"nickname"}),$e(),pe("span.asterisk","*")]),pe(".explain",Te("Verður að vera útfyllt")),r("nickname"),pe(".dialog-spacer",[pe("span.caption",Te("Fullt nafn:")),pe(vp,{initialValue:t.full_name||"",class:"fullname",maxlength:32,id:"full_name",autocomplete:"name"})]),pe(".explain",Te("Valfrjálst - sýnt í notendalistum Netskrafls")),r("full_name"),pe(".dialog-spacer",[pe("span.caption.sub",Te("Hljóðmerki:")),pe(Pp,{view:o,state:t.audio,tabindex:4}),pe("span.subcaption",Te("Lúðraþytur eftir sigur:")),pe(Rp,{view:o,state:t.fanfare,tabindex:5})]),pe(".explain",Te("explain_sound")),pe(".dialog-spacer",[pe("span.caption.sub",Te("Sýna reitagildi:")),pe(Lp,{view:o,state:t.beginner,tabindex:6}),Pe(".subexplain",["Stillir hvort ",Pe("strong","minnismiði")," um margföldunargildi reita er sýndur við borðið"])]),pe(".dialog-spacer",[pe("span.caption.sub",Te("Án hjálpartækja:")),pe(Np,{view:o,state:t.fairplay,tabindex:7}),Pe(".subexplain",["no_helpers",Pe("strong","án stafrænna hjálpartækja")," af nokkru tagi"])])])),this.vwDialogButton("user-ok",Ee("Vista"),(function(){t.nickname=Ge("nickname"),t.full_name=Ge("full_name"),t.audio=s("audio"),t.fanfare=s("fanfare"),t.beginner=s("beginner"),t.fairplay=s("fairplay"),e.saveUser((()=>{o.popDialog()}))}),Ve("ok"),8),this.vwDialogButton("user-cancel",Ee("Hætta við"),(e=>{this.popDialog(),e.preventDefault()}),Ve("remove"),9),t.friend?this.vwDialogButton("user-unfriend",Ee("Hætta sem vinur"),(e=>{e.preventDefault(),o.showFriendCancel()}),[Ve("coffee-cup"),$e(),$e(),Ee("Þú ert vinur Netskrafls!")],10):this.vwDialogButton("user-friend",Ee("Gerast vinur"),(e=>{e.preventDefault(),Ju("click_friend",{userid:n.userId,locale:n.locale}),o.showFriendPromo()}),[Ve("coffee-cup"),$e(),$e(),Ee("Gerast vinur Netskrafls")],11)]))}vwUserPrefs(){const e=this.model;return null!==e.user||e.userLoadError||e.loadUser(!0),e.user?this.vwUserPrefsDialog():pe.fragment({},[])}vwUserInfo(e){return pe(ng,{view:this,userid:e.userid,nick:e.nick,fullname:e.fullname})}vwPromo(e){return pe(tg,{view:this,kind:e.kind,initFunc:e.initFunc})}vwWait(e){return pe(Dp,{view:this,oppId:e.oppId,oppNick:e.oppNick,oppName:e.oppName,duration:e.duration,challengeKey:e.challengeKey})}vwAccept(e){return pe(Ap,{view:this,oppId:e.oppId,oppNick:e.oppNick,challengeKey:e.challengeKey})}vwLogin(){var e;const t=(null===(e=this.model.state)||void 0===e?void 0:e.loginUrl)||"";return pe(jp,{loginUrl:t})}vwDialogs(){const e=this.model.game;let t=[];return!e||null===e.showingDialog&&!e.last_chall||(e.last_chall&&t.push(pe(".chall-info",{style:{visibility:"visible"}},[Ve("info-sign"),$e(),Pe("span.pass-explain","opponent_emptied_rack")])),"resign"==e.showingDialog&&t.push(pe(".resign",{style:{visibility:"visible"}},[Ve("exclamation-sign"),$e(),Ee("Viltu gefa leikinn?"),$e(),pe("span.mobile-break",pe("br")),pe("span.yesnobutton",{onclick:()=>e.confirmResign(!0)},[Ve("ok"),Ee(" Já")]),pe("span.mobile-space"),pe("span.yesnobutton",{onclick:()=>e.confirmResign(!1)},[Ve("remove"),Ee(" Nei")])])),"pass"==e.showingDialog&&(e.last_chall?t.push(pe(".pass-last",{style:{visibility:"visible"}},[Ve("forward"),$e(),Ee("Segja pass?"),Pe("span.pass-explain","Viðureign lýkur þar með"),$e(),pe("span.mobile-break",pe("br")),pe("span.yesnobutton",{onclick:()=>e.confirmPass(!0)},[Ve("ok"),Ee(" Já")]),pe("span.mobile-space"),pe("span.yesnobutton",{onclick:()=>e.confirmPass(!1)},[Ve("remove"),Ee(" Nei")])])):t.push(pe(".pass",{style:{visibility:"visible"}},[Ve("forward"),$e(),Ee("Segja pass?"),Pe("span.pass-explain","2x3 pöss í röð ljúka viðureign"),$e(),pe("span.mobile-break",pe("br")),pe("span.yesnobutton",{onclick:()=>e.confirmPass(!0)},[Ve("ok"),Ee(" Já")]),pe("span.mobile-space"),pe("span.yesnobutton",{onclick:()=>e.confirmPass(!1)},[Ve("remove"),Ee(" Nei")])]))),"exchange"==e.showingDialog&&t.push(pe(".exchange",{style:{visibility:"visible"}},[Ve("refresh"),$e(),Ee("Smelltu á flísarnar sem þú vilt skipta"),$e(),pe("span.mobile-break",pe("br")),pe("span.yesnobutton",{title:Ee("Skipta"),onclick:()=>e.confirmExchange(!0)},Ve("ok")),pe("span.mobile-space"),pe("span.yesnobutton",{title:Ee("Hætta við"),onclick:()=>e.confirmExchange(!1)},Ve("remove"))])),"chall"==e.showingDialog&&t.push(pe(".chall",{style:{visibility:"visible"}},[Ve("ban-circle"),$e(),Ee("Véfengja lögn?"),Pe("span.pass-explain","Röng véfenging kostar 10 stig"),$e(),pe("span.mobile-break",pe("br")),pe("span.yesnobutton",{onclick:()=>e.confirmChallenge(!0)},[Ve("ok"),Ee(" Já")]),pe("span.mobile-space"),pe("span.yesnobutton",{onclick:()=>e.confirmChallenge(!1)},[Ve("remove"),Ee(" Nei")])]))),t}}function jg(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var i=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===n&&i.firstChild?i.insertBefore(o,i.firstChild):i.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}Ug.dialogViews={userprefs:e=>e.vwUserPrefs(),userinfo:(e,t)=>e.vwUserInfo(t),challenge:(e,t)=>pe(qp,{view:e,item:t}),promo:(e,t)=>e.vwPromo(t),friend:e=>pe(Op,{view:e}),thanks:e=>pe(Mp,{view:e}),cancel:e=>pe(Fp,{view:e}),confirm:e=>pe(zp,{view:e}),wait:(e,t)=>e.vwWait(t),accept:(e,t)=>e.vwAccept(t)};jg("\n@import url('https://fonts.googleapis.com/css2?family=Barlow:ital,wght@0,400;0,700;1,400;1,700&display=swap');\n@import url('https://fonts.googleapis.com/css2?family=Lato:ital,wght@0,400;0,700;1,400;1,700&display=swap');\n@import url('https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,400;0,700;1,400;1,700&display=swap');\n");jg('/*\n\n Glyphs.css\n\n Style support for Glyphicons\n\n Copyright © 2024 Miðeind ehf.\n Author: Vilhjalmur Thorsteinsson\n\n The Creative Commons Attribution-NonCommercial 4.0\n International Public License (CC-BY-NC 4.0) applies to this software.\n For further information, see https://github.com/mideind/Netskrafl\n\n*/\n\n@font-face {\n font-family: \'Glyphicons Regular\';\n /* The following source URLs are patched up at run-time\n to point to the backend server */\n src: url(\'../fonts/glyphicons-regular.eot\') format(\'embedded-opentype\'),\n url(\'../fonts/glyphicons-regular.woff\') format(\'woff\'),\n url(\'../fonts/glyphicons-regular.ttf\') format(\'truetype\');\n}\n\n.glyphicon {\n position: relative;\n top: 2px;\n display: inline-block;\n font-family: \'Glyphicons Regular\';\n font-style: normal;\n font-weight: normal;\n line-height: 1;\n}\n\n.glyphicon-play:before {\n content: "\\E174";\n}\n.glyphicon-exclamation-sign:before {\n content: "\\E197";\n}\n.glyphicon-log-in:before {\n content: "\\E387";\n}\n.glyphicon-log-out:before {\n content: "\\E388";\n}\n.glyphicon-screenshot:before {\n content: "\\E186";\n}\n.glyphicon-refresh:before {\n content: "\\E082";\n}\n.glyphicon-forward:before {\n content: "\\E177";\n}\n.glyphicon-fire:before {\n content: "\\E023";\n}\n.glyphicon-ok:before {\n content: "\\E207";\n}\n.glyphicon-remove:before {\n content: "\\E208";\n}\n.glyphicon-info-sign:before {\n content: "\\E196";\n}\n.glyphicon-cog:before {\n content: "\\E137";\n}\n.glyphicon-chevron-left:before {\n content: "\\E225";\n}\n.glyphicon-chevron-right:before {\n content: "\\E224";\n}\n.glyphicon-circle-arrow-down:before {\n content: "\\E220";\n}\n.glyphicon-download:before {\n content: "\\E201";\n}\n.glyphicon-star:before {\n content: "\\E050";\n}\n.glyphicon-flag:before {\n content: "\\E267";\n}\n.glyphicon-flag-after:after {\n content: "\\E267";\n}\n.glyphicon-bookmark:before {\n content: "\\E073";\n}\n.glyphicon-star-empty:before {\n content: "\\E049";\n}\n.glyphicon-hand-right:before {\n content: "\\E346";\n}\n.glyphicon-hand-left:before {\n content: "\\E347";\n}\n.glyphicon-thumbs-up:before {\n content: "\\E344";\n}\n.glyphicon-thumbs-down:before {\n content: "\\E345";\n}\n.glyphicon-remove-circle:before {\n content: "\\E198";\n}\n.glyphicon-th:before {\n content: "\\E157";\n}\n.glyphicon-user:before {\n content: "\\E004";\n}\n.glyphicon-comment:before {\n content: "\\E310";\n}\n.glyphicon-eye-open:before {\n content: "\\E052";\n}\n.glyphicon-paperclip:before {\n content: "\\E063";\n}\n.glyphicon-link:before {\n content: "\\E051";\n}\n.glyphicon-arrow-up:before {\n content: "\\E214";\n}\n.glyphicon-flash:before {\n content: "\\E242";\n}\n.glyphicon-time:before {\n content: "\\E055";\n}\n.glyphicon-volume-off:before {\n content: "\\E183";\n}\n.glyphicon-volume-up:before {\n content: "\\E185";\n}\n.glyphicon-hourglass:before {\n content: "\\231B";\n}\n.glyphicon-random:before {\n content: "\\E084";\n}\n.glyphicon-down-arrow:before {\n content: "\\E213";\n}\n.glyphicon-signal:before {\n content: "\\E080";\n}\n.glyphicon-crown:before {\n content: "\\E362";\n}\n.glyphicon-dashboard:before {\n content: "\\E332";\n}\n.glyphicon-show-lines:before {\n content: "\\E159";\n}\n.glyphicon-user-conversation:before {\n content: "\\E527";\n}\n.glyphicon-life-preserver:before {\n content: "\\E308";\n}\n.glyphicon-conversation:before {\n content: "\\E245";\n}\n.glyphicon-chat:before {\n content: "\\E246";\n}\n.glyphicon-baby-formula:before {\n content: "\\E492";\n}\n.glyphicon-stroller:before {\n content: "\\E076";\n}\n.glyphicon-edit:before {\n content: "\\E151";\n}\n.glyphicon-circle-question-mark:before {\n content: "\\E195";\n}\n.glyphicon-resize-small:before {\n content: "\\E215";\n}\n.glyphicon-shopping-bag:before {\n content: "\\E351";\n}\n.glyphicon-address-book:before {\n content: "\\E089";\n}\n.glyphicon-search:before {\n content: "\\E028";\n}\n.glyphicon-lightbulb:before {\n content: "\\E065";\n}\n.glyphicon-coffee-cup:before {\n content: "\\E295";\n}\n.glyphicon-grid:before {\n content: "\\E157";\n}\n.glyphicon-home:before {\n content: "\\E021";\n}\n.glyphicon-target:before {\n content: "\\E473";\n}\n.glyphicon-ban-circle:before {\n content: "\\E200";\n}\n.glyphicon-right-arrow:before {\n content: "\\E212";\n}\n\n');jg("/*\n\n Skrafl-explo.css\n\n Explo theme template for netskrafl.is\n\n Copyright © 2025 Miðeind ehf.\n Author: Vilhjalmur Thorsteinsson\n\n The Creative Commons Attribution-NonCommercial 4.0\n International Public License (CC-BY-NC 4.0) applies to this software.\n For further information, see https://github.com/mideind/Netskrafl\n\n*/\ndiv.netskrafl-container {\n --container-bg-color: #f8f8f8;\n --dark-bg-color: #222222;\n --light-header-color: #eaf5f7;\n --header-hover-color: #59b2c0;\n --link-hover-color: #006db8;\n --double-word-color: #f8D992;\n --triple-word-color: #F9B32D;\n --double-letter-color: #9ED5DA;\n --triple-letter-color: #21A4B6;\n --tile-background: #F9E5E6;\n --board-background: #E4EAF0;\n --tab-background: #f3f3f6;\n --header-background: #dde1e4;\n --ok-button: #72a55f;\n --cancel-button: #B6676D;\n --two-letter-background: #D8E3D2;\n --dark-shadow: rgba(0, 0, 0, 0.5);\n --light-shadow: #666666;\n --rack-shadow: #afb7cad0;\n --focus-border: var(--triple-word-color);\n --light-background: #B9D9DC;\n --stats-foreground: #197d8b;\n --human-color: #208C9F;\n --blank-tile: #999999;\n --list-header-background: #fff1d0;\n --list-header-bottom: #ffc559;\n --primary-font: 'Lato', 'Open Sans', 'Arial', sans-serif;\n --number-font: 'Open Sans', 'Lato', 'Arial', sans-serif;\n}\n\ndiv.netskrafl-container {\n position: relative;\n top: 0;\n left: 0;\n background-color: var(--container-bg-color);\n font-family: var(--primary-font);\n width: 375px;\n /* Full height is 667px - we subtract 115px for browser chrome, top and bottom */\n height: 552px;\n overflow-x: hidden;\n overflow-y: auto;\n margin: 0 auto;\n user-select: none;\n touch-action: none;\n}\ndiv.netskrafl-container * {\n box-sizing: content-box;\n}\ndiv.netskrafl-container ol, div.netskrafl-container ul {\n list-style: initial;\n}\ndiv.netskrafl-container h1,\ndiv.netskrafl-container h2,\ndiv.netskrafl-container h3 {\n font-size: revert;\n font-weight: revert;\n}\nbody div.netskrafl-loading,\nbody div.netskrafl-user {\n display: none;\n}\ndiv.netskrafl-container div.netskrafl-user {\n display: block;\n}\ndiv#board-background {\n height: 100%;\n}\ndiv.game-container {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n overflow-x: hidden;\n overflow-y: hidden;\n}\ndiv.netskrafl-container p {\n margin-top: 12px;\n margin-bottom: 12px;\n}\ninput,\ntextarea {\n user-select: text;\n}\np a img {\n display: inline;\n vertical-align: text-bottom;\n}\n.ui-helper-reset {\n margin: 0;\n padding: 0;\n border: 0;\n outline: 0;\n line-height: 50px;\n /* This determines the height of the tab row */\n text-decoration: none;\n font-size: 100%;\n list-style: none;\n}\n.ui-helper-clearfix:before,\n.ui-helper-clearfix:after {\n content: \"\";\n display: table;\n border-collapse: collapse;\n}\n.ui-helper-clearfix:after {\n clear: both;\n}\n.ui-helper-clearfix {\n min-height: 0;\n /* support: IE7 */\n}\n.ui-tabs {\n position: relative;\n /* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as \"fixed\") */\n padding: 3px;\n border-width: 0;\n}\n.ui-tabs .ui-tabs-nav {\n margin: 0;\n padding: 3px 3px 0;\n}\n.ui-tabs .ui-tabs-nav li {\n list-style: none;\n float: left;\n position: relative;\n top: 0;\n margin: 1px 0 0 6px;\n border-bottom-width: 0;\n padding: 0;\n white-space: nowrap;\n box-shadow: 1px 2px 4px 1px #afb7cad0;\n}\n.ui-tabs .ui-tabs-nav .ui-tabs-anchor {\n float: left;\n text-decoration: none;\n min-width: 91px;\n padding-left: 12px;\n padding-right: 12px;\n text-align: center;\n}\n.ui-tabs .ui-tabs-nav .ui-tabs-anchor.sp {\n /* Single page version */\n min-width: 51px;\n}\n.ui-tabs .ui-tabs-nav li.ui-tabs-active {\n margin-bottom: -1px;\n padding-bottom: 0px;\n background-color: var(--container-bg-color);\n}\n.ui-tabs .ui-tabs-panel {\n display: block;\n border-width: 0;\n padding-left: 6px;\n padding-right: 6px;\n padding-top: 4px;\n padding-bottom: 4px;\n background-color: var(--container-bg-color);\n}\n.ui-widget {\n font-family: var(--primary-font);\n font-size: 1.2em;\n}\n.ui-widget input,\n.ui-widget select,\n.ui-widget textarea,\n.ui-widget button {\n font-family: var(--primary-font);\n font-size: 1em;\n}\n.ui-widget-content {\n color: var(--dark-bg-color);\n}\n.ui-widget-content a {\n color: var(--dark-bg-color);\n}\n.ui-widget-header {\n color: var(--light-header-color);\n font-weight: bold;\n cursor: pointer;\n}\n.ui-widget-header a {\n color: var(--light-header-color);\n}\n.ui-state-default,\n.ui-widget-content .ui-state-default {\n background-color: #afb8bf;\n font-weight: bold;\n color: #ffffff;\n}\n.ui-widget-header .ui-state-default {\n background-color: #a9d0d6;\n font-weight: bold;\n color: #ffffff;\n}\n.ui-state-default a,\n.ui-state-default a:link,\n.ui-state-default a:visited {\n color: #ffffff;\n text-decoration: none;\n}\n.ui-state-hover,\n.ui-widget-content .ui-state-hover,\n.ui-state-focus,\n.ui-widget-content .ui-state-focus {\n background-color: var(--header-hover-color);\n font-weight: bold;\n color: #ffffff;\n}\n.ui-widget-header .ui-state-hover,\n.ui-widget-header .ui-state-focus {\n background-color: var(--header-hover-color);\n font-weight: bold;\n color: #ffffff;\n}\n.ui-state-hover a,\n.ui-state-hover a:hover,\n.ui-state-hover a:link,\n.ui-state-hover a:visited,\n.ui-state-focus a,\n.ui-state-focus a:hover,\n.ui-state-focus a:link,\n.ui-state-focus a:visited {\n color: var(--link-hover-color);\n text-decoration: none;\n}\n.ui-widget-header .ui-state-hover a,\n.ui-widget-header .ui-state-hover a:hover,\n.ui-widget-header .ui-state-hover a:link,\n.ui-widget-header .ui-state-hover a:visited,\n.ui-widget-header .ui-state-focus a,\n.ui-widget-header .ui-state-focus a:hover,\n.ui-widget-header .ui-state-focus a:link,\n.ui-widget-header .ui-state-focus a:visited {\n color: #ffffff;\n /* Pantone 300 U */\n /* #026890; */\n text-decoration: none;\n}\n.ui-widget-header .ui-state-focus a:focus {\n outline: 0;\n}\n.ui-state-active,\n.ui-widget-content .ui-state-active {\n background-color: var(--container-bg-color);\n font-weight: bold;\n color: #000000;\n /* #ffffff; */\n}\n.ui-widget-header .ui-state-active {\n background-color: var(--container-bg-color);\n font-weight: bold;\n color: #000000;\n /* #ffffff; */\n}\n.ui-state-active a,\n.ui-state-active a:link,\n.ui-state-active a:visited {\n color: var(--container-bg-color);\n text-decoration: none;\n}\n.ui-widget-header .ui-state-active a,\n.ui-widget-header .ui-state-active a:link,\n.ui-widget-header .ui-state-active a:hover,\n.ui-widget-header .ui-state-active a:visited {\n color: #000000;\n text-decoration: none;\n}\n.ui-corner-all,\n.ui-corner-left,\n.ui-corner-tl {\n border-top-left-radius: 4px;\n}\n.ui-corner-all,\n.ui-corner-right,\n.ui-corner-tr {\n border-top-right-radius: 4px;\n}\n.ui-corner-all,\n.ui-corner-bottom,\n.ui-corner-left,\n.ui-corner-bl {\n border-bottom-left-radius: 4px;\n}\n.ui-corner-all,\n.ui-corner-bottom,\n.ui-corner-right,\n.ui-corner-br {\n border-bottom-right-radius: 4px;\n}\n.ui-corner-top {\n border-top-left-radius: 6px;\n border-top-right-radius: 6px;\n}\nul.ui-tabs-nav.ui-corner-all {\n border-bottom-left-radius: 0px;\n border-bottom-right-radius: 0px;\n}\n/* Default media: small screen, i.e. mobile */\nspan.mobile-space {\n display: inline;\n padding-left: 32px;\n padding-right: 32px;\n}\n.no-mobile-block {\n display: none;\n}\n.no-mobile-inline {\n display: none;\n}\n.no-mobile-inline-block {\n display: none;\n}\n.no-mobile-list {\n display: none;\n}\n.upper {\n text-transform: uppercase;\n}\n@media all and (max-width: 360px) {\n /* Hack to squeeze the content on 360 pixel wide phones */\n div.netskrafl-container {\n transform: scale(0.96, 1);\n /* 0.96 = 360/375 */\n transform-origin: center top;\n }\n}\ndiv.header-logo {\n display: block;\n float: left;\n padding-left: 5px;\n padding-top: 14px;\n}\ndiv.header-button {\n display: block;\n float: right;\n}\ndiv.logo {\n display: none;\n position: absolute;\n top: 28px;\n left: 28px;\n width: 46px;\n}\ndiv.logo:hover {\n animation: expand 0.4s;\n}\ndiv.rightcol {\n position: relative;\n width: 362px;\n left: 6px;\n}\ndiv.logowrapper {\n display: inline-block;\n width: 11%;\n vertical-align: top;\n}\ndiv.playerwrapper {\n display: inline-block;\n position: relative;\n width: 89%;\n padding-top: 4px;\n}\ndiv.bag {\n position: absolute;\n right: 12px;\n width: 304px;\n height: 100px;\n /* Content is 97px max */\n font-size: 11px;\n font-weight: 700;\n text-transform: uppercase;\n text-align: center;\n margin: 0;\n padding: 0;\n opacity: 0.75;\n}\ntable.bag-content {\n border-collapse: separate;\n}\ntable.bag-content td {\n width: 12px;\n height: 17px;\n background-color: var(--double-letter-color);\n /* Color for old bag - seldom used */\n overflow: hidden;\n cursor: default;\n}\ntable.bag-content.new td {\n background-color: var(--tile-background);\n}\ntable.bag-content.empty td {\n background-color: var(--cancel-button);\n /* Opponent's color */\n color: white;\n}\ntd.over {\n outline: var(--focus-border) solid 3px;\n}\ntd.highlight {\n outline: var(--focus-border) solid 2px;\n}\ntr.colid td {\n height: 24px;\n width: 32px;\n margin: 0;\n padding: 0;\n overflow: hidden;\n background-color: transparent;\n text-align: center;\n font-size: 14px;\n line-height: 14px;\n font-weight: 400;\n border-color: transparent;\n box-shadow: none;\n}\n/* Board layout */\n#H8,\n#B2,\n#C3,\n#D4,\n#E5,\n#B14,\n#C13,\n#D12,\n#E11,\n#K5,\n#L4,\n#M3,\n#N2,\n#K11,\n#L12,\n#M13,\n#N14 {\n background-color: var(--double-word-color);\n}\n#A1,\n#A8,\n#A15,\n#H1,\n#H15,\n#O1,\n#O8,\n#O15 {\n background-color: var(--triple-word-color);\n}\n#A4,\n#A12,\n#C7,\n#C9,\n#D1,\n#D8,\n#D15,\n#G3,\n#G7,\n#G9,\n#G13,\n#H4,\n#H12,\n#I3,\n#I7,\n#I9,\n#I13,\n#O4,\n#O12,\n#M7,\n#M9,\n#L1,\n#L8,\n#L15 {\n background-color: var(--double-letter-color);\n}\n#B6,\n#B10,\n#F2,\n#F6,\n#F10,\n#F14,\n#N6,\n#N10,\n#J2,\n#J6,\n#J10,\n#J14 {\n background-color: var(--triple-letter-color);\n}\ntable.board td.dw:empty {\n /* Double word score */\n background-color: var(--double-word-color);\n}\ntable.board td.tw:empty {\n /* Triple word score */\n background-color: var(--triple-word-color);\n}\ntable.board td.dl:empty {\n /* Double letter score */\n background-color: var(--double-letter-color);\n}\ntable.board td.tl:empty {\n /* Triple letter score */\n background-color: var(--triple-letter-color);\n}\ntable.board td.center:empty {\n font-family: 'Glyphicons Regular';\n text-align: center;\n font-size: 17px;\n line-height: 21px;\n color: white;\n}\ntable.board td.center:empty::before {\n content: \"\\E473\";\n /* Target */\n animation: opacityBlink 1.5s infinite;\n}\ntable.board {\n margin-left: auto;\n margin-right: auto;\n padding: 0;\n border-spacing: 0;\n border-collapse: separate;\n table-layout: fixed;\n}\ndiv.board table.board {\n transform: scale(1);\n transform-origin: 0 0;\n transform-box: view-box;\n touch-action: pan-x pan-y;\n /*\n !!! Scrolling into view doesn't seem to work with this transition enabled\n transition: transform .2s ease-in-out;\n */\n}\ntable.board tr {\n height: 24px;\n}\n.rack table.board {\n border-spacing: 8px;\n margin-left: auto;\n margin-right: auto;\n}\n.rack table.board tr {\n height: 36px;\n}\ndiv.info {\n display: none;\n}\ndiv.board-help {\n display: none;\n}\ndiv.bag {\n display: none;\n}\ndiv.board-area {\n position: absolute;\n margin-left: 8px;\n top: 68px;\n padding-top: 6px;\n background-color: var(--container-bg-color);\n}\ndiv.board {\n background-color: var(--container-bg-color);\n overflow: hidden;\n width: 361px;\n}\ndiv.tile {\n position: relative;\n background-color: var(--tile-background);\n font-family: 'Open Sans', 'Arial', sans-serif;\n font-size: 17px;\n line-height: 21px;\n font-weight: 700;\n text-align: center;\n text-transform: uppercase;\n height: 21px;\n width: 21px;\n overflow: hidden;\n margin: 0;\n padding: 0;\n margin-left: -1px;\n padding-right: 1px;\n vertical-align: top;\n cursor: default;\n}\ndiv.tile.wide,\ndiv.tile.extra-wide {\n /* Wide tile in the rack */\n text-indent: -6px;\n}\ndiv.board div.tile.wide,\ndiv.board div.tile.extra-wide {\n /* Wide letter tile on the board */\n text-indent: -2px;\n}\n/* On small form factors, we have bigger tiles in the rack than on the board */\n.rack div.tile {\n font-size: 26px;\n line-height: 33px;\n height: 36px;\n width: 36px;\n margin-left: -2px;\n padding-right: 2px;\n}\n/* While dragging a tile, show it in the rack form factor */\ndiv.tile.dragging {\n position: fixed;\n z-index: 10;\n /* Note: We can't use variables here because this element\n becomes a child of the document body element when dragging, and\n the style variables are not in scope at the body level. */\n box-shadow: 3px 3px 3px 0 rgba(0, 0, 0, 0.2);\n border-color: #72a55f;\n border-radius: 5px;\n border-width: 3px;\n border-style: solid;\n overflow: visible;\n color: black;\n background-color: white;\n font-size: 26px;\n line-height: 33px;\n padding-top: 1px;\n height: 38px;\n width: 38px;\n /* The following is necessary as the tile is a child of the body,\n not of the netskrafl-container div */\n box-sizing: content-box;\n}\ndiv.tile.dragging.no-drop {\n border-color: #B6676D;\n}\n.board td {\n min-width: 21px;\n overflow: hidden;\n background-color: var(--board-background);\n padding: 0;\n border-style: solid;\n border-color: white;\n border-width: 1.5px;\n border-radius: 2.5px;\n}\n.rack td {\n min-width: 36px;\n width: 36px;\n border-width: 0px;\n box-shadow: 2px 2px 4px 0 var(--rack-shadow);\n}\ntr.colid {\n display: none;\n}\ntd.rowid {\n display: none;\n}\ndiv.rack-row {\n display: block;\n width: 100%;\n margin-top: 8px;\n height: 52px;\n}\ndiv.rack-left {\n display: block;\n width: 14%;\n height: 1px;\n float: left;\n}\ndiv.rack-right {\n display: block;\n width: 0%;\n height: 1px;\n float: left;\n}\ndiv.rack {\n display: block;\n position: relative;\n padding: 0;\n width: 86%;\n float: left;\n top: -6px;\n left: -3px;\n}\ndiv.letterscore {\n position: absolute;\n bottom: 0px;\n right: 1px;\n height: 9px;\n width: 9px;\n font-size: 6px;\n line-height: 9px;\n text-align: right;\n font-weight: 400;\n padding: 0;\n background-color: transparent;\n vertical-align: bottom;\n}\ndiv.tile.wide div.letterscore,\ndiv.tile.extra-wide div.letterscore {\n /* Adjust letter score tracking for wide tiles */\n letter-spacing: -0.5px;\n}\n.rack div.letterscore {\n right: 2px;\n bottom: 3px;\n font-size: 9px;\n line-height: 9px;\n}\ndiv.tile.dragging div.letterscore {\n bottom: 5px;\n right: 1.75px;\n font-size: 9px;\n line-height: 9px;\n}\ndiv.word-check {\n display: none;\n position: absolute;\n width: 44px;\n height: 44px;\n text-align: center;\n vertical-align: middle;\n top: 460px;\n left: 259px;\n background-color: transparent;\n font-family: 'Glyphicons Regular';\n font-style: normal;\n font-weight: normal;\n font-size: 22px;\n line-height: 42px;\n visibility: hidden;\n border: 1.5px solid;\n border-radius: 4px;\n}\ndiv.score {\n display: none;\n position: absolute;\n width: 44px;\n height: 44px;\n text-align: center;\n vertical-align: middle;\n top: 460px;\n left: 318px;\n background-color: transparent;\n font-size: 20px;\n font-weight: 700;\n line-height: 42px;\n color: var(--blank-tile);\n border: 1.5px solid;\n border-radius: 4px;\n border-color: var(--blank-tile);\n}\n.standard-button {\n text-align: center;\n font-size: 18px;\n font-weight: 700;\n color: white;\n margin: 0;\n padding: 6px;\n padding-top: 9px;\n border-radius: 5px;\n cursor: pointer;\n}\n.submitbutton {\n text-align: center;\n font-size: 18px;\n font-weight: 700;\n color: white;\n margin: 0;\n padding: 6px;\n padding-top: 9px;\n border-radius: 5px;\n cursor: pointer;\n width: 32px;\n height: 26px;\n background-color: var(--ok-button);\n}\ndiv.submitnewgame {\n text-align: center;\n font-size: 18px;\n font-weight: 700;\n color: white;\n margin: 0;\n padding: 6px;\n padding-top: 9px;\n border-radius: 5px;\n cursor: pointer;\n width: 32px;\n height: 26px;\n background-color: var(--ok-button);\n display: none;\n}\ndiv.fb-share {\n text-align: center;\n font-size: 18px;\n font-weight: 700;\n color: white;\n margin: 0;\n padding: 6px;\n padding-top: 9px;\n border-radius: 5px;\n cursor: pointer;\n width: 32px;\n height: 26px;\n background-color: var(--ok-button);\n display: none;\n /* Don't display on mobile */\n}\ndiv.fb-share:hover {\n outline: var(--focus-border) solid 3px;\n}\ndiv.waitmove {\n text-align: center;\n font-size: 18px;\n font-weight: 700;\n color: white;\n margin: 0;\n padding: 6px;\n padding-top: 9px;\n border-radius: 5px;\n cursor: pointer;\n width: 32px;\n height: 26px;\n background-color: var(--ok-button);\n z-index: 10;\n border-style: solid;\n border-width: 1px;\n border-color: var(--ok-button);\n background-color: white;\n margin-right: 1px;\n float: right;\n width: 96px;\n}\ndiv.animated-waitmove {\n position: relative;\n display: inline-block;\n width: 40px;\n top: -4px;\n}\ndiv.login-buttons {\n position: relative;\n}\ndiv.login-padding {\n min-height: 60px;\n}\ndiv.try-again {\n text-align: center;\n font-size: 18px;\n font-weight: 700;\n color: white;\n margin: 0;\n padding: 6px;\n padding-top: 9px;\n border-radius: 5px;\n cursor: pointer;\n width: 32px;\n height: 26px;\n background-color: var(--ok-button);\n display: block;\n position: absolute;\n width: 128px;\n top: 12px;\n left: auto;\n right: 0;\n padding: 10px;\n font-size: 16px;\n}\ndiv.get-help {\n text-align: center;\n font-size: 18px;\n font-weight: 700;\n color: white;\n margin: 0;\n padding: 6px;\n padding-top: 9px;\n border-radius: 5px;\n cursor: pointer;\n width: 32px;\n height: 26px;\n background-color: var(--ok-button);\n display: block;\n position: absolute;\n top: 12px;\n left: 0;\n right: auto;\n width: 128px;\n padding: 10px;\n font-size: 16px;\n background-color: var(--triple-letter-color);\n}\ndiv.get-help span.glyphicon {\n padding-right: 6px;\n}\ndiv.try-again span.glyphicon {\n padding-right: 6px;\n}\ndiv.recallbtn {\n text-align: center;\n font-size: 18px;\n font-weight: 700;\n color: white;\n margin: 0;\n padding: 6px;\n padding-top: 9px;\n border-radius: 5px;\n cursor: pointer;\n width: 33px;\n height: 26px;\n background-color: var(--triple-word-color);\n display: none;\n}\ndiv.rack-left div.recallbtn {\n display: block;\n margin-right: auto;\n /* Left-align the button */\n}\ndiv.scramblebtn {\n text-align: center;\n font-size: 18px;\n font-weight: 700;\n color: white;\n margin: 0;\n padding: 6px;\n padding-top: 9px;\n border-radius: 5px;\n cursor: pointer;\n width: 33px;\n height: 26px;\n background-color: var(--double-letter-color);\n display: none;\n}\ndiv.rack-left div.scramblebtn {\n display: block;\n margin-right: auto;\n /* Left-align the button */\n}\ndiv.buttons {\n position: relative;\n height: 54px;\n}\ndiv.buttons .glyphicon {\n top: 0;\n}\n.bottom-button {\n text-align: center;\n font-size: 18px;\n font-weight: 700;\n color: white;\n margin: 0;\n padding: 6px;\n padding-top: 9px;\n border-radius: 5px;\n cursor: pointer;\n position: absolute;\n top: 0;\n padding-top: 8px;\n background-color: #fcfcfc;\n border: 1.5px solid #dddddd;\n width: 66px;\n height: 23px;\n}\ndiv.submitresign {\n text-align: center;\n font-size: 18px;\n font-weight: 700;\n margin: 0;\n padding: 6px;\n padding-top: 9px;\n border-radius: 5px;\n cursor: pointer;\n position: absolute;\n top: 0;\n padding-top: 8px;\n background-color: #fcfcfc;\n border: 1.5px solid #dddddd;\n width: 66px;\n height: 23px;\n color: var(--cancel-button);\n left: 0px;\n}\ndiv.submitexchange {\n text-align: center;\n font-size: 18px;\n font-weight: 700;\n margin: 0;\n padding: 6px;\n padding-top: 9px;\n border-radius: 5px;\n cursor: pointer;\n position: absolute;\n top: 0;\n left: 93px;\n padding-top: 8px;\n background-color: #fcfcfc;\n border: 1.5px solid #dddddd;\n width: 66px;\n height: 23px;\n color: var(--ok-button);\n}\ndiv.submitexchange.disabled {\n color: #888888;\n}\ndiv.submitpass {\n text-align: center;\n font-size: 18px;\n font-weight: 700;\n margin: 0;\n padding: 6px;\n padding-top: 9px;\n border-radius: 5px;\n cursor: pointer;\n position: absolute;\n top: 0;\n padding-top: 8px;\n background-color: #fcfcfc;\n border: 1.5px solid #dddddd;\n width: 66px;\n height: 23px;\n color: var(--triple-word-color);\n left: 186px;\n}\ndiv.challenge {\n text-align: center;\n font-size: 18px;\n font-weight: 700;\n margin: 0;\n padding: 6px;\n padding-top: 9px;\n border-radius: 5px;\n cursor: pointer;\n position: absolute;\n top: 0;\n padding-top: 8px;\n background-color: var(--container-bg-color);\n border: 1.5px solid #dddddd;\n width: 66px;\n height: 23px;\n left: 279px;\n color: var(--triple-letter-color);\n}\ndiv.challenge.disabled {\n border-color: var(--board-background);\n}\ndiv.submitmove {\n text-align: center;\n font-size: 18px;\n font-weight: 700;\n color: white;\n margin: 0;\n padding: 6px;\n padding-top: 9px;\n border-radius: 5px;\n cursor: pointer;\n width: 32px;\n height: 26px;\n background-color: var(--ok-button);\n display: none;\n}\ndiv.rack-right div.submitmove {\n display: block;\n margin-left: auto;\n /* Right-align the button */\n}\ndiv.submitmove.error-shown {\n display: none;\n}\ndiv.submitmove span.glyphicon {\n margin-left: 8px;\n}\ndiv.player {\n display: block;\n padding-left: 4px;\n padding-right: 4px;\n height: 30px;\n min-height: 30px;\n font-size: 14px;\n font-weight: 400;\n color: white;\n}\ndiv.scorewrapper {\n font-family: var(--number-font);\n background-color: transparent;\n width: 100%;\n}\ndiv.scoreleft {\n display: block;\n width: 42px;\n height: 26px;\n padding-left: 4px;\n font-size: 22px;\n line-height: 27px;\n font-weight: 400;\n text-align: left;\n color: white;\n overflow: hidden;\n position: absolute;\n top: 4px;\n left: 0;\n}\ndiv.scoreright {\n display: block;\n width: 42px;\n height: 26px;\n padding-right: 4px;\n font-size: 22px;\n line-height: 27px;\n font-weight: 400;\n text-align: right;\n color: white;\n overflow: hidden;\n position: absolute;\n top: 4px;\n right: 0;\n}\ndiv.robot-btn {\n display: block;\n position: absolute;\n margin-left: 0px;\n margin-right: 2px;\n padding-top: 3px;\n height: 30px;\n min-height: 30px;\n line-height: 22px;\n border-width: 0px;\n white-space: nowrap;\n overflow: hidden;\n background-color: transparent;\n}\ndiv.robot-btn span.glyphicon-cog {\n margin-right: 2px;\n}\ndiv.gamestats div.robot-btn {\n width: 100%;\n margin: 0;\n padding-top: 6px;\n}\ndiv.player-btn {\n display: block;\n position: absolute;\n margin-left: 2px;\n margin-right: 2px;\n padding-top: 3px;\n height: 30px;\n min-height: 30px;\n line-height: 22px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n background-color: transparent;\n color: white;\n border-width: 0;\n border-radius: 5px;\n}\ndiv.player-btn.left,\ndiv.robot-btn.left {\n padding-left: 38px;\n padding-right: 12px;\n}\ndiv.player-btn.right,\ndiv.robot-btn.right {\n padding-left: 10px;\n /* Note: purposefully a bit asymmetric with the left button */\n padding-right: 38px;\n}\ndiv.player-btn.left.tomove,\ndiv.player-btn.right.tomove {\n color: white;\n}\ndiv.player-btn.left.tomove:hover,\ndiv.player-btn.right.tomove:hover {\n color: black;\n}\ndiv.heading {\n position: relative;\n width: 100%;\n /* background-color: @container; */\n top: 0;\n left: 0;\n padding-left: 0;\n padding-right: 0;\n height: 38px;\n}\ndiv.tabbed-page {\n position: absolute;\n left: 0;\n top: 0;\n width: 375px;\n height: 552px;\n overflow: hidden;\n font-size: 13px;\n line-height: 23px;\n}\ndiv.tab-scroll-area {\n position: relative;\n}\ndiv.loginform-small {\n display: block;\n position: absolute;\n width: 375px;\n padding-top: 0;\n padding-left: 0;\n padding-right: 0;\n}\ndiv.loginform-large {\n display: none;\n position: absolute;\n left: 220px;\n right: 120px;\n top: 24px;\n width: auto;\n max-width: 740px;\n padding: 0;\n}\ndiv.login-logo {\n margin-top: 120px;\n margin-left: 100px;\n}\ndiv.login-legend {\n margin-left: 50px;\n margin-top: 40px;\n}\ndiv#logo-pic {\n text-align: center;\n padding-top: 32px;\n padding-bottom: 16px;\n}\ndiv.loginform-small div#logo-pic {\n padding-top: 0;\n}\n@keyframes expand {\n 0% {\n transform: scale(1);\n }\n 40% {\n transform: scale(1.05);\n }\n 100% {\n transform: scale(1);\n }\n}\n@-webkit-keyframes expand {\n 0% {\n transform: scale(1);\n }\n 40% {\n transform: scale(1.05);\n }\n 100% {\n transform: scale(1);\n }\n}\n@keyframes slidein {\n 0% {\n transform: scale(0);\n }\n 100% {\n transform: scale(1);\n }\n}\n@-webkit-keyframes slidein {\n 0% {\n transform: scale(0);\n }\n 100% {\n transform: scale(1);\n }\n}\ndiv.login-btn-large {\n text-align: center;\n font-size: 19px;\n font-weight: 400;\n width: 160px;\n color: white;\n background-color: var(--header-hover-color);\n margin: 0;\n margin-top: 24px;\n margin-left: 6px;\n padding: 6px;\n padding-top: 8px;\n padding-bottom: 12px;\n border-radius: 5px;\n cursor: pointer;\n float: right;\n}\ndiv.login-btn-large:hover {\n background-color: var(--triple-word-color);\n animation: expand 0.4s;\n}\ndiv.login-btn-large span {\n padding-left: 18px;\n}\ndiv.login-btn-small {\n width: 60%;\n text-align: center;\n font-size: 19px;\n font-weight: 400;\n color: white;\n background-color: var(--ok-button);\n margin-left: auto;\n margin-right: auto;\n margin-top: 60px;\n padding: 6px;\n padding-top: 9px;\n padding-bottom: 9px;\n border-radius: 5px;\n vertical-align: middle;\n cursor: pointer;\n}\ndiv.login-btn-small:hover {\n background-color: var(--triple-word-color);\n}\ndiv.blurb {\n font-size: 16px;\n font-weight: bold;\n padding-bottom: 24px;\n text-align: center;\n}\ndiv.login-error {\n padding: 12px;\n margin-top: 160px;\n margin-left: 8px;\n margin-right: 16px;\n background-color: white;\n color: black;\n border-style: solid;\n border-width: 0px;\n border-radius: 5px;\n font-size: 15px;\n box-shadow: 3px 3px 5px 2px var(--dark-shadow);\n}\np.login-sorry {\n font-weight: bold;\n}\np.login-error-icon {\n margin-top: 8px;\n margin-bottom: 8px;\n font-size: 34px;\n color: var(--triple-word-color);\n}\ndiv.leftplayer {\n display: inline-block;\n width: 50%;\n text-align: left;\n border-radius: 4px 0 0 4px;\n}\ndiv.rightplayer {\n display: inline-block;\n width: 50%;\n text-align: right;\n border-radius: 0 4px 4px 0;\n}\ndiv.right-tab {\n position: absolute;\n top: -28px;\n height: 34px;\n min-height: 34px;\n width: 55px;\n min-width: 55px;\n overflow: visible;\n visibility: visible;\n text-align: center;\n vertical-align: middle;\n padding-top: 4px;\n font-size: 16px;\n line-height: 18px;\n border-radius: 5px;\n opacity: 0.6;\n z-index: 0;\n cursor: pointer;\n box-shadow: 2px 2px 4px 0 #afb7cad0;\n}\ndiv.right-tab#tab-board {\n left: 41px;\n background-color: var(--container-bg-color);\n}\ndiv.right-tab#tab-movelist {\n left: 106px;\n background-color: var(--board-background);\n}\ndiv.right-tab#tab-twoletter {\n left: 171px;\n background-color: var(--two-letter-background);\n}\ndiv.right-tab#tab-games {\n left: 236px;\n background-color: var(--tile-background);\n}\ndiv.right-tab#tab-chat {\n left: 301px;\n background-color: #F7F0DE;\n}\ndiv.right-tab.selected {\n opacity: 1;\n}\ndiv.right-tab:hover {\n opacity: 1;\n}\ndiv.right-tab.alert > span.glyphicon {\n color: var(--cancel-button);\n animation: redBlink 1s infinite;\n -webkit-animation: redBlink 1s infinite;\n}\ndiv.right-area {\n /* display: none; */\n position: relative;\n top: 30px;\n left: 0;\n height: 464px;\n width: 100%;\n font-size: 16px;\n line-height: 16px;\n font-weight: 400;\n color: black;\n cursor: default;\n}\ndiv.right-area.with-clock {\n height: 380px;\n margin-top: 48px;\n}\ndiv.message {\n text-align: center;\n font-size: 14px;\n line-height: 26px;\n height: 28px;\n background-color: var(--light-background);\n font-weight: 400;\n}\ndiv.message strong {\n text-transform: uppercase;\n}\ndiv.movelist-container {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 458px;\n background-color: var(--board-background);\n padding-top: 8px;\n padding-bottom: 0;\n z-index: 6;\n border-radius: 4px 4px 0 0;\n}\ndiv.movelist {\n font-family: var(--number-font);\n margin: 0;\n padding: 0;\n overflow: auto;\n width: 100%;\n height: 350px;\n}\ndiv.movelist.bestmoves {\n overflow-y: hidden;\n}\ndiv.movelist-container div.bag {\n display: block;\n background-color: var(--container-bg-color);\n position: relative;\n left: 0;\n margin: 0;\n padding-top: 4px;\n padding-left: 27px;\n width: 100%;\n height: 104px;\n}\ndiv.game-timed {\n display: none;\n}\ndiv.modal-dialog {\n visibility: hidden;\n position: fixed;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n z-index: 10;\n background-color: rgba(32, 32, 32, 0.2);\n}\ndiv.modal-dialog#spinner-dialog {\n background-color: rgba(255, 255, 255, 0.4);\n}\ndiv.animated-spinner {\n position: absolute;\n left: 141.5px;\n top: 271.5px;\n}\nsvg circle.shadow {\n filter: drop-shadow(0px 3px 3px rgba(0, 0, 0, 0.4));\n}\n.std-form {\n position: absolute;\n padding-left: 12px;\n padding-right: 12px;\n padding-top: 6px;\n padding-bottom: 6px;\n box-shadow: 3px 3px 5px 2px var(--dark-shadow);\n font-size: 1em;\n z-index: 20;\n background-color: var(--container-bg-color);\n}\ndiv#blank-form {\n position: absolute;\n padding-left: 12px;\n padding-right: 12px;\n padding-top: 6px;\n padding-bottom: 6px;\n box-shadow: 3px 3px 5px 2px var(--dark-shadow);\n font-size: 1em;\n z-index: 20;\n background-color: var(--container-bg-color);\n top: 124px;\n right: 36.5px;\n width: 274px;\n height: 400px;\n background-color: var(--board-background);\n}\n.bottom-message {\n position: absolute;\n text-align: right;\n display: block;\n bottom: 0;\n left: 0;\n width: 352px;\n height: 52px;\n font-size: 14px;\n line-height: 26px;\n margin: 0;\n padding-top: 0px;\n padding-left: 4px;\n padding-right: 4px;\n padding-bottom: 4px;\n visibility: hidden;\n transform-origin: left top;\n animation: slidein 0.4s;\n}\n.bold-bottom-message {\n position: absolute;\n text-align: right;\n display: block;\n bottom: 0;\n left: 0;\n width: 352px;\n height: 52px;\n font-size: 14px;\n line-height: 26px;\n margin: 0;\n padding-top: 0px;\n padding-left: 4px;\n padding-right: 4px;\n padding-bottom: 4px;\n visibility: hidden;\n transform-origin: left top;\n animation: slidein 0.4s;\n text-align: center;\n color: white;\n border-radius: 4px;\n}\ndiv.error {\n position: absolute;\n text-align: right;\n display: block;\n bottom: 0;\n left: 0;\n width: 352px;\n height: 52px;\n font-size: 14px;\n line-height: 26px;\n margin: 0;\n padding-top: 0px;\n padding-left: 4px;\n padding-right: 4px;\n padding-bottom: 4px;\n visibility: hidden;\n transform-origin: left top;\n animation: slidein 0.4s;\n text-align: center;\n color: white;\n border-radius: 4px;\n background-color: var(--cancel-button);\n cursor: pointer;\n}\ndiv.opp-turn {\n display: block;\n padding-top: 10px;\n width: 246px;\n}\ndiv.opp-turn.flashing {\n color: var(--cancel-button);\n transition: 0.1s;\n transform: scale(1.1);\n transform-origin: center left;\n animation: redBlink 0.4s;\n animation-iteration-count: 2;\n}\ndiv#congrats,\ndiv#gameover {\n position: absolute;\n text-align: right;\n display: block;\n bottom: 0;\n left: 0;\n width: 352px;\n height: 52px;\n font-size: 14px;\n line-height: 26px;\n margin: 0;\n padding-top: 0px;\n padding-left: 4px;\n padding-right: 4px;\n padding-bottom: 4px;\n visibility: hidden;\n transform-origin: left top;\n animation: slidein 0.4s;\n visibility: visible;\n font-size: 16px;\n width: 100%;\n text-align: center;\n padding-bottom: 0px;\n}\ndiv#congrats span.glyphicon-bookmark {\n padding-right: 2px;\n color: var(--ok-button);\n}\ndiv#gameover span.glyphicon-info-sign {\n padding-right: 4px;\n color: var(--triple-letter-color);\n}\ndiv.resign {\n position: absolute;\n text-align: right;\n display: block;\n bottom: 0;\n left: 0;\n width: 352px;\n height: 52px;\n font-size: 14px;\n line-height: 26px;\n margin: 0;\n padding-top: 0px;\n padding-left: 4px;\n padding-right: 4px;\n padding-bottom: 4px;\n visibility: hidden;\n transform-origin: left top;\n animation: slidein 0.4s;\n text-align: center;\n color: white;\n border-radius: 4px;\n background-color: var(--cancel-button);\n}\ndiv.pass {\n position: absolute;\n text-align: right;\n display: block;\n bottom: 0;\n left: 0;\n width: 352px;\n height: 52px;\n font-size: 14px;\n line-height: 26px;\n margin: 0;\n padding-top: 0px;\n padding-left: 4px;\n padding-right: 4px;\n padding-bottom: 4px;\n visibility: hidden;\n transform-origin: left top;\n animation: slidein 0.4s;\n text-align: center;\n color: white;\n border-radius: 4px;\n background-color: var(--triple-word-color);\n}\ndiv.pass-last {\n position: absolute;\n text-align: right;\n display: block;\n bottom: 0;\n left: 0;\n width: 352px;\n height: 52px;\n font-size: 14px;\n line-height: 26px;\n margin: 0;\n padding-top: 0px;\n padding-left: 4px;\n padding-right: 4px;\n padding-bottom: 4px;\n visibility: hidden;\n transform-origin: left top;\n animation: slidein 0.4s;\n text-align: center;\n color: white;\n border-radius: 4px;\n background-color: var(--triple-word-color);\n}\ndiv.chall {\n position: absolute;\n text-align: right;\n display: block;\n bottom: 0;\n left: 0;\n width: 352px;\n height: 52px;\n font-size: 14px;\n line-height: 26px;\n margin: 0;\n padding-top: 0px;\n padding-left: 4px;\n padding-right: 4px;\n padding-bottom: 4px;\n visibility: hidden;\n transform-origin: left top;\n animation: slidein 0.4s;\n text-align: center;\n color: white;\n border-radius: 4px;\n background-color: var(--triple-letter-color);\n}\ndiv.chall-info {\n position: absolute;\n text-align: right;\n display: block;\n bottom: 0;\n left: 0;\n width: 352px;\n height: 52px;\n font-size: 14px;\n line-height: 26px;\n margin: 0;\n padding-top: 0px;\n padding-left: 4px;\n padding-right: 4px;\n padding-bottom: 4px;\n visibility: hidden;\n transform-origin: left top;\n animation: slidein 0.4s;\n text-align: center;\n color: white;\n border-radius: 4px;\n background-color: var(--ok-button);\n bottom: 60px;\n line-height: 20px;\n width: 311px;\n padding: 2px 24px 0px;\n}\ndiv.exchange {\n position: absolute;\n text-align: right;\n display: block;\n bottom: 0;\n left: 0;\n width: 352px;\n height: 52px;\n font-size: 14px;\n line-height: 26px;\n margin: 0;\n padding-top: 0px;\n padding-left: 4px;\n padding-right: 4px;\n padding-bottom: 4px;\n visibility: hidden;\n transform-origin: left top;\n animation: slidein 0.4s;\n text-align: center;\n color: white;\n border-radius: 4px;\n background-color: var(--ok-button);\n}\ndiv.submitmove#move-mobile {\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n float: right;\n margin-right: 1px;\n width: 96px;\n font-weight: 700;\n color: black;\n background-color: var(--tile-background);\n padding-left: 10px;\n padding-right: 10px;\n padding-top: 6px;\n}\ndiv.submitmove#move-mobile.manual {\n background-color: var(--double-letter-color);\n color: white;\n}\ndiv.submitmove#move-mobile.word-good {\n background-color: var(--ok-button);\n color: white;\n}\n@keyframes colorPulseMobile {\n 0% {\n transform: scale(1);\n }\n 40% {\n transform: scale(1.3);\n }\n 60% {\n transform: scale(1.3);\n }\n 100% {\n transform: scale(1);\n }\n}\n@-webkit-keyframes colorPulseMobile {\n 0% {\n transform: scale(1);\n }\n 40% {\n transform: scale(1.3);\n }\n 60% {\n transform: scale(1.3);\n }\n 100% {\n transform: scale(1);\n }\n}\nspan.score-mobile {\n display: inline-block;\n font-weight: 400;\n font-size: 22px;\n line-height: 22px;\n}\ndiv.submitmove#move-mobile.word-great span.score-mobile {\n animation: colorPulseMobile 1.5s infinite;\n -webkit-animation: colorPulseMobile 1.5s infinite;\n}\ndiv.submitmove#move-mobile span.glyphicon {\n top: 0px;\n margin-top: 2px;\n}\ndiv.force-resign {\n font-size: 18px;\n font-weight: 700;\n margin: 0;\n padding: 6px;\n padding-top: 9px;\n border-radius: 5px;\n cursor: pointer;\n width: 32px;\n height: 26px;\n background-color: var(--ok-button);\n display: block;\n float: right;\n padding-top: 3px;\n padding-bottom: 12px;\n margin-right: 1px;\n width: 96px;\n text-align: center;\n font-weight: normal;\n font-size: 13px;\n color: white;\n background-color: var(--cancel-button);\n}\ndiv.gameinfo {\n position: absolute;\n text-align: right;\n display: block;\n bottom: 0;\n left: 0;\n width: 352px;\n height: 52px;\n font-size: 14px;\n line-height: 26px;\n margin: 0;\n padding-top: 0px;\n padding-left: 4px;\n padding-right: 4px;\n padding-bottom: 4px;\n visibility: hidden;\n transform-origin: left top;\n animation: slidein 0.4s;\n bottom: 56px;\n height: 34px;\n background-color: var(--board-background);\n font-weight: normal;\n color: white;\n padding-top: 10px;\n}\ninput.chat-txt {\n font-family: var(--primary-font);\n width: 276px;\n font-size: 18px;\n height: 24px;\n font-weight: normal;\n border-style: solid;\n border-color: var(--ok-button);\n border-width: 1px;\n border-radius: 3px;\n margin-top: 1px;\n padding-top: 4px;\n padding-bottom: 3px;\n padding-left: 6px;\n padding-right: 6px;\n}\ndiv.chat-area {\n position: absolute;\n top: 6px;\n left: 6px;\n height: 402px;\n width: 336px;\n padding: 6px;\n overflow: auto;\n}\ndiv.modal-close#chat-send {\n display: inline-block;\n position: relative;\n font-size: 18px;\n line-height: 18px;\n height: 28px;\n bottom: 2px;\n right: 0;\n margin: 0 0 2px 8px;\n padding-top: 4px;\n padding-bottom: 0;\n background-color: var(--triple-letter-color);\n color: white;\n}\ndiv.twoletter {\n position: absolute;\n top: 0px;\n left: 0px;\n width: 100%;\n height: 466px;\n background-color: var(--two-letter-background);\n overflow: hidden;\n z-index: 3;\n border-radius: 4px 4px 0 0;\n}\ndiv.twoletter-area {\n position: absolute;\n top: 0;\n right: 0;\n height: 100%;\n font-size: 18px;\n line-height: 25px;\n text-align: right;\n padding-left: 14px;\n padding-right: 10px;\n margin-top: 12px;\n cursor: pointer;\n}\ndiv.twoletter-area#two-2 {\n visibility: hidden;\n}\ndiv.twoletter-group {\n display: inline-block;\n margin-right: 5px;\n}\ndiv.twoletter-word {\n display: inline-block;\n padding-right: 4px;\n}\ndiv.twoletter-word b {\n background-color: var(--ok-button);\n color: white;\n padding-left: 2px;\n padding-right: 2px;\n border-radius: 2px;\n}\nspan.statsbutton {\n display: none;\n}\ndiv#ready-toggler {\n display: none;\n}\ndiv#timed-toggler {\n display: none;\n}\ndiv.help-container img {\n /* On mobile, scale images in help text down to fit the column width */\n max-width: 100%;\n height: auto;\n object-fit: scale-down;\n display: inline;\n}\ndiv#tabs,\ndiv#main-tabs {\n border-width: 0;\n padding: 0;\n}\ndiv#tabs > div[role=tabpanel],\ndiv#main-tabs > div[role=tabpanel] {\n position: relative;\n top: -8px;\n height: 504px;\n}\ndiv#main-tabs div.header-logo {\n padding-left: 14px;\n padding-right: 8px;\n padding-top: 7px;\n}\ndiv#tabs {\n background-color: transparent;\n}\ndiv.userid {\n display: none;\n}\nspan.list-ts {\n display: none;\n width: 164px;\n max-width: 164px;\n}\nspan.list-ts-short {\n display: none;\n padding-left: 4px;\n width: 144px;\n max-width: 144px;\n}\nspan.list-chall {\n display: inline-block;\n width: 184px;\n max-width: 184px;\n overflow: hidden;\n text-overflow: ellipsis;\n}\nspan.list-s0 {\n display: inline-block;\n width: 38px;\n max-width: 38px;\n text-align: right;\n}\nspan.list-s1 {\n display: inline-block;\n width: 38px;\n max-width: 38px;\n text-align: left;\n}\nspan.list-colon {\n display: inline-block;\n text-align: center;\n width: 8px;\n max-width: 8px;\n}\nspan.list-scorehdr {\n display: inline-block;\n width: 84px;\n /* list-s0 + list-colon + list-s1 */\n max-width: 84px;\n text-align: center;\n}\ndiv.list-elo-adj {\n display: inline-flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n width: 52px;\n max-width: 52px;\n text-align: center;\n text-overflow: clip;\n}\nspan.list-elo-hdr {\n display: inline-block;\n width: 104px;\n /* list-elo-adj * 2 */\n max-width: 104px;\n text-align: center;\n}\nspan.list-tc {\n display: inline-block;\n width: 84px;\n max-width: 84px;\n text-align: left;\n padding-right: 0;\n}\ndiv.tilecount {\n display: inline-block;\n vertical-align: middle;\n font-size: 12px;\n line-height: 12px;\n margin-bottom: 2px;\n width: 92px;\n min-width: 92px;\n text-align: left;\n background-color: #ffffff;\n border-radius: 6px;\n overflow: hidden;\n}\ndiv.tc {\n display: inline-block;\n text-align: left;\n background-color: var(--ok-button);\n}\ndiv.tc.losing {\n background-color: var(--cancel-button);\n}\ndiv.tc:before {\n content: \"\\A0\";\n /* Invisible space */\n}\ndiv#userlist span.list-ch,\ndiv#elolist span.list-ch,\ndiv#chall-received span.list-ch,\ndiv#chall-sent span.list-ch,\ndiv#userlist span.list-fav {\n cursor: pointer;\n}\nspan.list-ch,\nspan.list-fav,\nspan.list-icon,\nspan.list-myturn,\nspan.list-overdue {\n display: inline-block;\n font-size: 18px;\n width: 26px;\n min-width: 26px;\n overflow: hidden;\n margin-left: 2px;\n}\nspan.list-overdue,\nspan.list-fav {\n display: none;\n}\nspan.list-newbag {\n display: none;\n font-size: 18px;\n color: var(--triple-word-color);\n width: 22px;\n max-width: 22px;\n margin-left: 14px;\n}\nspan.list-manual {\n display: none;\n font-size: 18px;\n color: var(--triple-word-color);\n /* width: 26px; */\n max-width: 26px;\n margin-left: 14px;\n}\nspan.list-win {\n display: inline-block;\n font-size: 18px;\n width: 26px;\n max-width: 26px;\n margin-left: 0;\n}\nspan.list-nick {\n display: inline-block;\n width: 140px;\n min-width: 140px;\n overflow: hidden;\n}\nspan.list-nick-elo {\n display: inline-block;\n width: 150px;\n max-width: 150px;\n}\nspan.list-opp {\n display: inline-block;\n width: 150px;\n max-width: 150px;\n}\nspan.list-fullname {\n display: inline-block;\n width: 400px;\n min-width: 400px;\n overflow: hidden;\n}\nspan.list-fullname-robot {\n display: inline-block;\n font-size: 14px;\n width: 188px;\n min-width: 188px;\n font-style: italic;\n /* Robot description doesn't fit into the column on mobile */\n overflow: hidden;\n text-overflow: ellipsis;\n}\nspan.list-human-elo {\n display: inline-block;\n width: 40px;\n max-width: 40px;\n text-align: center;\n margin-right: 6px;\n}\nspan.list-duration {\n display: none;\n width: 192px;\n max-width: 192px;\n text-align: right;\n}\nspan.list-info-hdr {\n display: none;\n width: 52px;\n max-width: 52px;\n text-align: center;\n}\nspan.list-info {\n display: none;\n width: 52px;\n top: -3px;\n text-align: center;\n height: 24px;\n line-height: 20px;\n}\nspan.list-rank {\n display: inline-block;\n width: 36px;\n max-width: 36px;\n text-align: center;\n margin-right: 8px;\n}\nspan.list-rank-no-mobile {\n display: none;\n width: 32px;\n max-width: 32px;\n text-align: center;\n margin-right: 10px;\n}\nspan.list-elo {\n display: inline-block;\n width: 40px;\n max-width: 40px;\n text-align: center;\n margin-right: 10px;\n}\nspan.list-elo-no-mobile {\n display: none;\n width: 40px;\n max-width: 40px;\n text-align: center;\n margin-right: 10px;\n}\nspan.list-games {\n display: none;\n width: 48px;\n max-width: 48px;\n text-align: right;\n margin-right: 10px;\n}\nspan.list-ratio {\n display: none;\n width: 40px;\n max-width: 40px;\n text-align: right;\n margin-right: 10px;\n}\nspan.list-avgpts {\n display: none;\n width: 36px;\n max-width: 36px;\n text-align: right;\n margin-right: 16px;\n}\nspan.mobile-break {\n display: inline;\n}\n.tab-legend {\n display: none;\n font-weight: normal;\n}\ndiv.user-cat span#break {\n display: inline;\n}\ndiv.user-cat#user-headings {\n line-height: 32px;\n}\ndiv.user-cat#user-search {\n display: none;\n}\ndiv#chall-form {\n position: absolute;\n padding-left: 12px;\n padding-right: 12px;\n padding-top: 6px;\n padding-bottom: 6px;\n box-shadow: 3px 3px 5px 2px var(--dark-shadow);\n font-size: 1em;\n z-index: 20;\n background-color: var(--container-bg-color);\n position: relative;\n padding-top: 8px;\n /* left: @margin-small; */\n left: auto;\n right: auto;\n margin-left: auto;\n margin-right: auto;\n top: 48px;\n width: 327px;\n height: 352px;\n font-size: 0.85em;\n}\ndiv#chall-fairplay {\n margin-top: 10px;\n padding-left: 0;\n padding-right: 0;\n font-size: 14px;\n text-align: right;\n}\ndiv#chall-oldbag {\n position: absolute;\n bottom: 16px;\n font-size: 14px;\n}\ndiv#chall-oldbag td span.glyphicon-exclamation-sign {\n color: var(--cancel-button);\n padding-right: 8px;\n}\nspan.caption.wide {\n width: 200px;\n}\ndiv#manual-toggler {\n display: inline-block;\n}\ndiv#chall-ok {\n right: 12px;\n width: 72px;\n /* Override */\n background-color: var(--ok-button);\n}\ndiv#chall-cancel {\n right: 108px;\n /* 12 + 72 + 12 + 12 */\n width: 72px;\n /* Override */\n background-color: var(--cancel-button);\n}\ndiv.user-cat#user-headings span {\n white-space: nowrap;\n}\ndiv#user-load {\n display: none;\n position: absolute;\n top: 321.5px;\n left: 175.5px;\n width: 24px;\n height: 24px;\n z-index: 10;\n background-image: url('user-loader.gif');\n background-repeat: no-repeat;\n background-size: 24px 24px;\n}\ndiv#promo-form {\n position: absolute;\n padding-left: 12px;\n padding-right: 12px;\n padding-top: 6px;\n padding-bottom: 6px;\n box-shadow: 3px 3px 5px 2px var(--dark-shadow);\n font-size: 1em;\n z-index: 20;\n background-color: var(--container-bg-color);\n top: 64px;\n left: 12px;\n width: 327px;\n height: 364px;\n line-height: 1.5em;\n}\ndiv.promo-content {\n margin-top: 16px;\n margin-left: 16px;\n margin-right: 16px;\n}\ndiv.promo-fullscreen {\n display: none;\n}\ndiv.promo-mobile {\n display: block;\n}\ndiv.btn-promo-yes {\n text-align: center;\n font-size: 18px;\n font-weight: 700;\n color: white;\n margin: 0;\n padding: 6px;\n padding-top: 9px;\n border-radius: 5px;\n cursor: pointer;\n position: absolute;\n width: 200px;\n height: 28px;\n bottom: 48px;\n right: 232px;\n top: auto;\n background-color: var(--ok-button);\n}\ndiv.btn-promo-no {\n text-align: center;\n font-size: 18px;\n font-weight: 700;\n color: white;\n margin: 0;\n padding: 6px;\n padding-top: 9px;\n border-radius: 5px;\n cursor: pointer;\n position: absolute;\n width: 80px;\n height: 28px;\n bottom: 24px;\n right: 24px;\n top: auto;\n background-color: var(--ok-button);\n}\ndiv #userlist,\ndiv #elolist {\n height: 396px;\n /* 11 lines @ 36px each */\n overflow-y: auto;\n overflow-x: hidden;\n}\ndiv #gamelist {\n height: 468px;\n /* 13 lines @ 36px each */\n overflow-y: auto;\n overflow-x: hidden;\n}\ndiv #recentlist {\n height: 396px;\n /* 11 lines @ 36px each */\n overflow-y: auto;\n overflow-x: hidden;\n}\ndiv #usr-recent {\n height: 432px;\n /* 12 lines @ 36px each */\n overflow-y: auto;\n overflow-x: hidden;\n}\ndiv #chall-sent,\ndiv #chall-received {\n height: 216px;\n /* 6 lines @ 36px each */\n overflow-y: auto;\n overflow-x: hidden;\n}\ndiv.games {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 442px;\n background-color: var(--tile-background);\n overflow: auto;\n z-index: 2;\n padding-top: 12px;\n padding-bottom: 12px;\n border-radius: 4px 4px 0 0;\n}\ndiv#wait-form {\n position: absolute;\n padding-left: 12px;\n padding-right: 12px;\n padding-top: 6px;\n padding-bottom: 6px;\n box-shadow: 3px 3px 5px 2px var(--dark-shadow);\n font-size: 1em;\n z-index: 20;\n background-color: var(--container-bg-color);\n top: 8px;\n left: 4px;\n width: 335px;\n height: 488px;\n}\nspan.move-indicator {\n position: relative;\n top: 2px;\n display: inline-block;\n font-family: 'Glyphicons Regular';\n font-style: normal;\n font-weight: normal;\n line-height: 1;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n color: var(--triple-word-color);\n margin-right: 4px;\n}\nspan.move-indicator:before {\n content: \"\\E267\";\n}\ndiv.hint {\n display: none;\n position: absolute;\n top: 136px;\n font-style: italic;\n font-size: 1em;\n z-index: 10;\n color: var(--light-shadow);\n margin-left: 12px;\n margin-right: 12px;\n}\ndiv.stats-box {\n font-family: var(--number-font);\n width: 224px;\n position: absolute;\n top: 0px;\n right: -62px;\n}\ndiv.stats-fig {\n display: inline-block;\n width: 68px;\n height: 24px;\n padding: 3px;\n background-color: transparent;\n color: var(--stats-foreground);\n border-style: solid;\n border-width: 2px;\n border-radius: 4px;\n border-color: var(--stats-foreground);\n text-align: center;\n font-weight: 700;\n font-size: 16px;\n line-height: 21px;\n vertical-align: middle;\n margin-top: 4px;\n margin-right: 2px;\n margin-left: 2px;\n cursor: default;\n}\ndiv#own-toggler {\n position: absolute;\n top: 2px;\n margin-top: 0;\n margin-right: 8px;\n}\np#own-best {\n display: inline-block;\n position: absolute;\n left: auto;\n right: 174px;\n top: 26px;\n text-align: right;\n font-size: 0.85em;\n}\ndiv#own-stats {\n position: relative;\n margin-top: 2px;\n margin-bottom: 32px;\n height: 48px;\n width: 100%;\n vertical-align: top;\n}\n/* Paragraphs of help text that should be centered on screens that are wide enough */\np.help-center {\n text-align: left;\n}\ndiv.racktile {\n cursor: pointer;\n background-color: white;\n}\n@keyframes selBlink {\n 0% {\n color: white;\n background-color: var(--cancel-button);\n }\n 45% {\n color: white;\n background-color: var(--cancel-button);\n }\n 50% {\n color: black;\n background-color: white;\n }\n 95% {\n color: black;\n background-color: white;\n }\n 100% {\n color: white;\n background-color: var(--cancel-button);\n }\n}\n@-webkit-keyframes selBlink {\n 0% {\n color: white;\n background-color: var(--cancel-button);\n }\n 45% {\n color: white;\n background-color: var(--cancel-button);\n }\n 50% {\n color: black;\n background-color: white;\n }\n 95% {\n color: black;\n background-color: white;\n }\n 100% {\n color: white;\n background-color: var(--cancel-button);\n }\n}\n@keyframes selBlank {\n 0% {\n color: white;\n background-color: var(--cancel-button);\n }\n 45% {\n color: white;\n background-color: var(--cancel-button);\n }\n 50% {\n color: var(--blank-tile);\n background-color: white;\n }\n 95% {\n color: var(--blank-tile);\n background-color: white;\n }\n 100% {\n color: white;\n background-color: var(--cancel-button);\n }\n}\n@-webkit-keyframes selBlank {\n 0% {\n color: white;\n background-color: var(--cancel-button);\n }\n 45% {\n color: white;\n background-color: var(--cancel-button);\n }\n 50% {\n color: var(--blank-tile);\n background-color: white;\n }\n 95% {\n color: var(--blank-tile);\n background-color: white;\n }\n 100% {\n color: white;\n background-color: var(--cancel-button);\n }\n}\n@keyframes redBlink {\n 0% {\n opacity: 1;\n }\n 30% {\n opacity: 1;\n }\n 50% {\n opacity: 0;\n }\n 70% {\n opacity: 1;\n }\n 100% {\n opacity: 1;\n }\n}\n@-webkit-keyframes redBlink {\n 0% {\n opacity: 1;\n }\n 30% {\n opacity: 1;\n }\n 50% {\n opacity: 0;\n }\n 70% {\n opacity: 1;\n }\n 100% {\n opacity: 1;\n }\n}\n@keyframes opacityBlink {\n 0% {\n opacity: 1;\n }\n 25% {\n opacity: 1;\n }\n 75% {\n opacity: 1;\n }\n 80% {\n opacity: 0.1;\n }\n 100% {\n opacity: 0.1;\n }\n}\n@-webkit-keyframes opacityBlink {\n 0% {\n opacity: 1;\n }\n 25% {\n opacity: 1;\n }\n 75% {\n opacity: 1;\n }\n 80% {\n opacity: 0.1;\n }\n 100% {\n opacity: 0.1;\n }\n}\ndiv.sel {\n animation: selBlink 1.2s infinite;\n -webkit-animation: selBlink 1.2s infinite;\n}\ndiv.blanktile.sel {\n animation: selBlank 1.2s infinite;\n -webkit-animation: selBlank 1.2s infinite;\n}\ntd.sel {\n outline: var(--cancel-button) solid 3px;\n}\ndiv.xchg {\n cursor: pointer;\n}\ndiv.xchgsel {\n color: white;\n background-color: var(--ok-button);\n}\n.blanktile {\n color: var(--blank-tile);\n}\n@keyframes fresh-appear {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n}\n@-webkit-keyframes fresh-appear {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n}\ndiv.freshtile {\n color: white;\n background-color: var(--cancel-button);\n opacity: 0;\n animation-name: fresh-appear;\n animation-duration: 100ms;\n animation-delay: 0s;\n animation-fill-mode: forwards;\n -webkit-animation-name: fresh-appear;\n -webkit-animation-duration: 100ms;\n -webkit-animation-delay: 0s;\n -webkit-animation-fill-mode: forwards;\n}\ndiv.highlight0 {\n /* Human (local) player */\n color: black;\n background-color: white;\n}\ndiv.highlight1 {\n /* Computer (remote) player */\n color: white;\n background-color: var(--cancel-button);\n}\ndiv.highlight0.blanktile {\n /* Human (local) player */\n color: var(--blank-tile);\n}\ndiv.highlight1.blanktile {\n /* Computer (remote) player */\n color: #f3d6d8;\n}\ndiv.highlight0.dim {\n background-color: #fbedee;\n}\ndiv.highlight1.dim {\n background-color: #deb3b6;\n}\n.clock {\n display: inline-block;\n position: absolute;\n top: 82px;\n width: 147px;\n font-size: 28px;\n line-height: 28px;\n font-weight: 700;\n color: #202020;\n overflow: hidden;\n margin-top: 4px;\n margin-bottom: 4px;\n}\nh3.clockleft {\n display: inline-block;\n position: absolute;\n top: 82px;\n width: 147px;\n font-size: 28px;\n line-height: 28px;\n font-weight: 700;\n color: #202020;\n overflow: hidden;\n margin-top: 4px;\n margin-bottom: 4px;\n left: 0;\n text-align: left;\n}\nh3.clockright {\n display: inline-block;\n position: absolute;\n top: 82px;\n width: 147px;\n font-size: 28px;\n line-height: 28px;\n font-weight: 700;\n color: #202020;\n overflow: hidden;\n margin-top: 4px;\n margin-bottom: 4px;\n right: 0;\n text-align: right;\n}\nh3.clockleft.running-out {\n color: var(--cancel-button);\n}\nh3.clockright.running-out {\n color: var(--cancel-button);\n}\ndiv.clockface {\n display: block;\n position: absolute;\n top: 84px;\n width: 100%;\n text-align: center;\n font-size: 28px;\n line-height: 28px;\n color: var(--triple-word-color);\n}\ndiv.fairplay {\n position: absolute;\n top: 10px;\n width: 100%;\n text-align: center;\n color: var(--ok-button);\n}\ndiv.games-item {\n position: relative;\n height: 24px;\n margin-left: 32px;\n margin-right: 32px;\n margin-top: 2px;\n margin-bottom: 2px;\n padding-left: 4px;\n padding-right: 4px;\n padding-top: 7px;\n padding-bottom: 5px;\n overflow: hidden;\n vertical-align: top;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\ndiv.games-item a:link,\ndiv.games-item a:visited {\n color: black;\n text-decoration: none;\n}\ndiv.games-item a:hover {\n color: black;\n}\ndiv.games-item:hover {\n border-radius: 5px;\n background-color: rgba(86, 153, 165, 0.5);\n}\ndiv.at-top-left {\n position: absolute;\n top: 6px;\n left: 10px;\n height: 24px;\n font-size: 16px;\n line-height: 20px;\n font-weight: bold;\n}\ndiv.at-top-left div.tilecount {\n width: 276px;\n min-width: 276px;\n height: 24px;\n border-radius: 10px;\n border-width: 0;\n overflow: hidden;\n background-color: #ccd5de;\n}\ndiv.at-top-left div.tilecount.trans {\n background-color: transparent;\n}\ndiv.at-top-left div.tilecount div.tc {\n color: var(--container-bg-color);\n padding-left: 4px;\n margin-left: 0;\n overflow: hidden;\n border-radius: 10px;\n border-width: 0;\n font-size: 16px;\n line-height: 20px;\n font-weight: bold;\n padding-top: 2px;\n padding-bottom: 2px;\n}\ndiv.at-top-left div.tilecount div.oc {\n color: #202020;\n padding-left: 8px;\n margin-left: 0;\n overflow: hidden;\n font-size: 16px;\n line-height: 20px;\n font-weight: bold;\n padding-top: 2px;\n padding-bottom: 2px;\n background-color: transparent;\n}\ndiv.chat {\n position: absolute;\n top: 0px;\n left: 0px;\n width: 100%;\n height: 466px;\n background-color: #F7F0DE;\n z-index: 1;\n border-radius: 4px 4px 0 0;\n}\ndiv.chat-area.with-clock {\n height: 310px;\n}\ndiv.chat-ts {\n clear: both;\n display: inline-block;\n color: var(--dark-shadow);\n font-size: 12px;\n line-height: 12px;\n text-align: center;\n margin-top: 12px;\n margin-bottom: 8px;\n width: 100%;\n}\ndiv.chat-msg {\n display: inline-block;\n border-radius: 8px;\n padding-top: 6px;\n padding-bottom: 6px;\n padding-left: 10px;\n padding-right: 10px;\n color: black;\n font-size: 15px;\n line-height: 20px;\n max-width: 80%;\n margin-bottom: 6px;\n}\ndiv.chat-msg.left {\n float: left;\n clear: both;\n text-align: left;\n}\ndiv.chat-msg.right {\n float: right;\n clear: both;\n text-align: right;\n}\ndiv.chat-msg.local {\n background-color: var(--board-background);\n}\ndiv.chat-msg.remote {\n background-color: #F1DBDA;\n}\ndiv.chat-msg img {\n /* Emoticon alignment to baseline */\n vertical-align: -10px;\n display: inline;\n margin-left: 2px;\n margin-right: 2px;\n}\ndiv.chat-input {\n position: absolute;\n bottom: 0px;\n left: 0px;\n height: 36px;\n padding: 6px;\n vertical-align: bottom;\n}\ndiv.movelist.noscroll {\n overflow-y: hidden;\n}\ndiv.leftmove {\n text-align: left;\n padding-left: 0px;\n height: 20px;\n line-height: 18px;\n}\ndiv.rightmove {\n text-align: right;\n padding-right: 0px;\n height: 20px;\n line-height: 18px;\n}\ndiv.reviewhdr {\n height: 18px;\n text-align: left;\n padding: 11px;\n background-color: var(--ok-button);\n color: white;\n font-weight: 400;\n font-size: 18px;\n line-height: 18px;\n}\nspan.movenumber {\n background-color: white;\n color: var(--ok-button);\n text-align: center;\n font-size: 18px;\n font-weight: 700;\n margin-top: 0;\n margin-bottom: 0;\n margin-left: 0px;\n margin-right: 8px;\n padding-top: 2px;\n padding-bottom: 2px;\n padding-left: 12px;\n padding-right: 12px;\n}\ndiv.gameover {\n text-align: center;\n margin-top: 6px;\n padding: 10px;\n background-color: var(--triple-word-color);\n color: white;\n font-weight: 700;\n}\nspan.gameovermsg {\n margin-right: 6px;\n}\ndiv.gamestats {\n visibility: hidden;\n color: black;\n background-color: white;\n z-index: 20;\n position: absolute;\n width: 724px;\n height: 580px;\n left: 150px;\n top: 64px;\n padding: 12px;\n border-radius: 5px;\n box-shadow: 3px 3px 5px 2px var(--dark-shadow);\n}\ndiv.statscol {\n display: block;\n float: left;\n width: 50%;\n padding-top: 24px;\n}\ndiv.statscol p {\n margin-top: 0.85em;\n margin-bottom: 0.8em;\n}\ndiv.gamestats p span {\n font-weight: 700;\n}\ndiv #gamestarted {\n width: 100%;\n text-align: center;\n position: relative;\n top: 42px;\n margin-bottom: 24px;\n}\n#gamestarted p {\n font-style: italic;\n margin-top: 4px;\n margin-bottom: 8px;\n}\n.humancolor {\n background-color: var(--human-color);\n}\n.autoplayercolor {\n background-color: var(--cancel-button);\n}\n/* Scores in move list */\n.humangrad_left {\n color: #208C9F;\n}\n.autoplayergrad_right {\n color: var(--cancel-button);\n}\n.humangrad_right {\n color: #208C9F;\n}\n.autoplayergrad_left {\n color: var(--cancel-button);\n}\nspan.score {\n display: inline-block;\n width: 28px;\n padding-left: 2px;\n margin-left: 2px;\n padding-right: 2px;\n margin-right: 2px;\n font-weight: 700;\n text-align: right;\n line-height: 20px;\n}\nspan.total {\n display: inline-block;\n width: 28px;\n padding-left: 3px;\n margin-left: 0px;\n padding-right: 6px;\n margin-right: 0px;\n font-weight: 700;\n text-align: right;\n color: white;\n line-height: 20px;\n}\ndiv.leftmove span.total {\n border-left-width: 0px;\n border-left-style: solid;\n border-top-right-radius: 2.5px;\n border-bottom-right-radius: 2.5px;\n margin-right: 2px;\n}\ndiv.rightmove span.total {\n border-right-width: 0px;\n border-right-style: solid;\n border-top-left-radius: 2.5px;\n border-bottom-left-radius: 2.5px;\n margin-left: 2px;\n}\nspan.total.human {\n background-color: #aad1d4;\n}\ndiv.leftmove span.total.human {\n border-left-color: #208C9F;\n}\ndiv.rightmove span.total.human {\n border-right-color: #208C9F;\n}\nspan.total.autoplayer {\n background-color: #d3c0c7;\n}\ndiv.leftmove span.total.autoplayer {\n border-left-color: var(--cancel-button);\n}\ndiv.rightmove span.total.autoplayer {\n border-right-color: var(--cancel-button);\n}\nspan.highlight {\n background-color: var(--ok-button);\n color: white;\n}\nspan.wordmove {\n text-transform: uppercase;\n padding-left: 3px;\n padding-right: 3px;\n font-size: 12px;\n}\nspan.wordmove i {\n font-weight: bold;\n padding-left: 3px;\n padding-right: 3px;\n font-size: 16px;\n}\nspan.othermove {\n text-transform: none;\n padding-left: 3px;\n font-size: 14px;\n}\ndiv.error p {\n display: inline;\n position: relative;\n top: 0;\n left: 0;\n margin: 0;\n padding: 0;\n}\ndiv.error span.glyphicon {\n padding-right: 6px;\n}\nspan.pass-explain {\n font-weight: normal;\n font-style: italic;\n padding-left: 3px;\n padding-right: 3px;\n}\nspan.yesnobutton {\n height: 20px;\n text-align: center;\n background-color: white;\n font-size: 16px;\n font-weight: 700;\n margin-top: 0;\n margin-bottom: 0;\n margin-left: 4px;\n margin-right: 4px;\n padding-top: 2px;\n padding-bottom: 2px;\n padding-left: 12px;\n padding-right: 12px;\n border-radius: 5px;\n cursor: pointer;\n}\ndiv.resign span.yesnobutton {\n color: var(--cancel-button);\n}\ndiv.pass span.yesnobutton,\ndiv.pass-last span.yesnobutton {\n color: var(--triple-word-color);\n}\ndiv.exchange span.yesnobutton {\n color: var(--ok-button);\n}\ndiv.chall span.yesnobutton {\n color: var(--triple-letter-color);\n}\nspan.closebtn {\n color: var(--triple-word-color);\n}\nspan.yesnobutton#force-resign {\n display: none;\n}\ndiv.score.word-good {\n color: var(--ok-button);\n border-color: var(--ok-button);\n}\ndiv.score.manual {\n color: var(--triple-letter-color);\n border-color: var(--triple-letter-color);\n}\n@keyframes colorPulse {\n 0% {\n color: var(--ok-button);\n }\n 40% {\n color: var(--cancel-button);\n transform: scale(1.05);\n }\n 60% {\n color: var(--cancel-button);\n transform: scale(1.05);\n }\n 100% {\n color: var(--ok-button);\n }\n}\n@-webkit-keyframes colorPulse {\n 0% {\n color: var(--ok-button);\n }\n 40% {\n color: var(--cancel-button);\n transform: scale(1.05);\n }\n 60% {\n color: var(--cancel-button);\n transform: scale(1.05);\n }\n 100% {\n color: var(--ok-button);\n }\n}\ndiv.score.word-great {\n animation: colorPulse 1.5s infinite;\n -webkit-animation: colorPulse 1.5s infinite;\n border-color: var(--ok-button);\n}\ndiv.score.opponent {\n color: white;\n background-color: var(--cancel-button);\n border: none;\n}\ndiv.score.localplayer {\n color: white;\n background-color: var(--human-color);\n border: none;\n}\ndiv.channel {\n position: absolute;\n width: 32px;\n height: 32px;\n text-align: center;\n bottom: 40px;\n left: 32px;\n background-color: transparent;\n font-family: 'Glyphicons Regular';\n font-style: normal;\n font-weight: normal;\n font-size: 20px;\n overflow: hidden;\n visibility: hidden;\n}\ndiv.channel:before {\n content: \"\\E051\";\n /* glyphicon-link */\n}\ndiv.word-check.word-good {\n color: var(--ok-button);\n border-color: var(--ok-button);\n visibility: visible;\n}\ndiv.word-check.word-good:before {\n content: \"\\E344\";\n /* glyphicon-thumbs-up */\n}\ndiv.word-check.word-bad {\n color: var(--cancel-button);\n border-color: var(--cancel-button);\n visibility: visible;\n}\ndiv.word-check.word-bad:before {\n content: \"\\E200\";\n /* glyphicon-ban-circle */\n}\ndiv.board-help {\n position: absolute;\n z-index: 2;\n left: 22px;\n top: 160px;\n width: 54px;\n background-color: white;\n padding: 2px;\n border-radius: 5px;\n cursor: default;\n}\ndiv.board-help-close {\n width: 50px;\n text-align: right;\n background-color: white;\n margin: 2px;\n}\ndiv.board-help-close span {\n background-color: var(--cancel-button);\n color: white;\n padding: 1px;\n padding-top: 2px;\n padding-left: 2px;\n cursor: pointer;\n}\ndiv.board-help-close span:hover {\n background-color: var(--triple-word-color);\n}\ndiv.board-colors {\n margin: 0;\n padding: 0;\n}\ndiv.board-color {\n width: 44px;\n text-align: center;\n font-size: 12px;\n line-height: 15px;\n padding-left: 3px;\n padding-right: 3px;\n padding-top: 4px;\n padding-bottom: 4px;\n font-weight: 400;\n border: solid 2px white;\n border-collapse: collapse;\n}\ndiv.board-color#triple-word {\n background-color: var(--triple-word-color);\n color: white;\n border-bottom: none;\n}\ndiv.board-color#double-word {\n background-color: var(--double-word-color);\n border-bottom: none;\n}\ndiv.board-color#triple-letter {\n background-color: var(--triple-letter-color);\n color: white;\n border-bottom: none;\n}\ndiv.board-color#double-letter {\n background-color: var(--double-letter-color);\n border-bottom: none;\n}\ndiv.board-color#single-letter {\n background-color: var(--board-background);\n color: black;\n}\ndiv.scorediff {\n position: absolute;\n width: 50px;\n height: 28px;\n text-align: center;\n vertical-align: middle;\n bottom: 272px;\n left: 643px;\n background-color: var(--cancel-button);\n font-size: 18px;\n font-weight: normal;\n color: white;\n visibility: hidden;\n padding-top: 3px;\n padding-bottom: 2px;\n font-family: 'Open Sans', 'Arial', sans-serif;\n}\ndiv.posdiff {\n background-color: var(--ok-button);\n}\ndiv.navbtn {\n text-align: center;\n font-size: 18px;\n font-weight: 700;\n color: white;\n margin: 0;\n padding: 6px;\n padding-top: 9px;\n border-radius: 5px;\n cursor: pointer;\n top: auto;\n width: 90px;\n height: 30px;\n bottom: 136px;\n line-height: 24px;\n background-color: var(--ok-button);\n}\ndiv.navbtn#navnext {\n position: absolute;\n left: 550px;\n font-weight: normal;\n}\ndiv.navbtn#navprev {\n position: absolute;\n left: 110px;\n font-weight: normal;\n}\nspan#nav-prev-visible {\n display: inline;\n}\nspan#nav-prev-waiting {\n display: none;\n}\nspan#nav-next-visible {\n display: inline;\n}\nspan#nav-next-waiting {\n display: none;\n}\ndiv.closebtn {\n text-align: center;\n font-size: 18px;\n font-weight: 700;\n color: white;\n margin: 0;\n padding: 6px;\n padding-top: 9px;\n border-radius: 5px;\n cursor: pointer;\n width: 100px;\n height: 28px;\n bottom: 12px;\n background-color: var(--ok-button);\n}\n#review-close {\n position: absolute;\n right: 12px;\n}\nspan#total0,\nspan#total1 {\n font-size: 28px;\n margin-left: 8px;\n margin-right: 8px;\n}\ndiv.promo-content h2 {\n color: var(--ok-button);\n font-size: 24px;\n line-height: 30px;\n font-weight: bold;\n}\ndiv.promo-content h2 span.glyphicon-coffee-cup,\ndiv.help-container span.glyphicon-coffee-cup {\n color: var(--triple-word-color);\n}\ndiv.promo-krafla {\n background-color: var(--board-background);\n}\ndiv.btn-krafla-yes {\n text-align: center;\n font-size: 18px;\n font-weight: 700;\n color: white;\n margin: 0;\n padding: 6px;\n padding-top: 9px;\n border-radius: 5px;\n cursor: pointer;\n width: 80px;\n height: 28px;\n bottom: 48px;\n right: 48px;\n top: auto;\n background-color: var(--ok-button);\n}\ndiv#btn-thanks {\n text-align: center;\n font-size: 18px;\n font-weight: 700;\n color: white;\n margin: 0;\n padding: 6px;\n padding-top: 9px;\n border-radius: 5px;\n cursor: pointer;\n position: absolute;\n width: 96px;\n height: 28px;\n bottom: 24px;\n right: 24px;\n top: auto;\n background-color: var(--ok-button);\n}\ndiv#btn-cancel-yes {\n text-align: center;\n font-size: 18px;\n font-weight: 700;\n color: white;\n margin: 0;\n padding: 6px;\n padding-top: 9px;\n border-radius: 5px;\n cursor: pointer;\n width: 160px;\n height: 28px;\n bottom: 24px;\n right: 24px;\n top: auto;\n background-color: var(--cancel-button);\n}\ndiv#btn-cancel-no {\n text-align: center;\n font-size: 18px;\n font-weight: 700;\n color: white;\n margin: 0;\n padding: 6px;\n padding-top: 9px;\n border-radius: 5px;\n cursor: pointer;\n width: 160px;\n height: 28px;\n bottom: 24px;\n right: 208px;\n top: auto;\n background-color: var(--ok-button);\n}\n.tabbed-page a:link,\n.tabbed-page a:visited {\n text-decoration: none;\n color: #5699A5;\n}\n.tabbed-page a:hover {\n text-decoration: none;\n color: var(--triple-word-color);\n}\na.ui-tabs-anchor:link,\na.ui-tabs-anchor:visited {\n color: white;\n}\n.notifier {\n display: none;\n /* Set to inline-block by the script if shown */\n background-color: var(--cancel-button);\n color: white;\n border-radius: 9px;\n height: 18px;\n font-size: 13px;\n line-height: 18px;\n font-weight: 700;\n margin-left: 6px;\n padding-left: 5px;\n padding-right: 5px;\n margin-top: 16px;\n vertical-align: top;\n}\nspan#numgames {\n display: none;\n /* Set to inline-block by the script if shown */\n background-color: var(--cancel-button);\n color: white;\n border-radius: 9px;\n height: 18px;\n font-size: 13px;\n line-height: 18px;\n font-weight: 700;\n margin-left: 6px;\n padding-left: 5px;\n padding-right: 5px;\n margin-top: 16px;\n vertical-align: top;\n}\nspan#numchallenges {\n display: none;\n /* Set to inline-block by the script if shown */\n background-color: var(--cancel-button);\n color: white;\n border-radius: 9px;\n height: 18px;\n font-size: 13px;\n line-height: 18px;\n font-weight: 700;\n margin-left: 6px;\n padding-left: 5px;\n padding-right: 5px;\n margin-top: 16px;\n vertical-align: top;\n}\ndiv.smallprint {\n font-size: 12px;\n padding-top: 6px;\n}\ndiv.userid {\n position: absolute;\n top: 22px;\n right: 26px;\n max-width: 210px;\n height: 22px;\n text-align: right;\n font-size: 16px;\n line-height: 16px;\n font-weight: 700;\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n padding: 6px 10px 4px 6px;\n margin: 0;\n z-index: 5;\n color: #5699A5;\n background-color: white;\n border-radius: 5px;\n cursor: pointer;\n}\ndiv.userid:hover {\n background-color: #5699A5;\n color: white;\n}\ndiv.listitem {\n display: flex;\n flex-direction: row;\n align-items: center;\n height: 28px;\n padding-left: 4px;\n padding-right: 4px;\n padding-top: 4px;\n padding-bottom: 4px;\n white-space: nowrap;\n justify-items: center;\n}\n.listheader > span {\n top: 0;\n}\n.listitem a {\n cursor: pointer;\n}\n.listitem a:link,\n.listitem a:visited {\n color: black;\n text-decoration: none;\n}\n.listitem a:hover {\n color: var(--triple-word-color);\n}\ndiv.oddlist {\n background-color: var(--board-background);\n}\ndiv.evenlist {\n background-color: #F7F0DE;\n}\ndiv.listheader {\n background-color: var(--list-header-background);\n font-weight: 400;\n border-bottom-width: 2px;\n border-bottom-color: var(--list-header-bottom);\n border-bottom-style: solid;\n}\ndiv#elo-hdr span {\n cursor: default;\n}\ndiv#elo-toggler {\n display: inline-block;\n position: absolute;\n top: 38px;\n bottom: auto;\n left: auto;\n right: 6px;\n z-index: 10;\n}\nspan.bold {\n font-weight: 700;\n}\ndiv#initials {\n margin-top: 8px;\n margin-bottom: 14px;\n padding: 0;\n}\ndiv.user-cat {\n display: inline-block;\n vertical-align: middle;\n}\ndiv.user-cat#user-search {\n float: right;\n}\ndiv.user-cat span {\n font-size: 16px;\n cursor: pointer;\n padding-left: 4px;\n padding-top: 1px;\n padding-bottom: 4px;\n padding-right: 6px;\n margin: 2px;\n}\ndiv.user-cat span.shown {\n background-color: rgba(158, 213, 218, 0.3);\n border-radius: 5px;\n}\ndiv.user-cat span:hover {\n color: white;\n background-color: var(--header-hover-color);\n border-radius: 5px;\n}\ndiv.user-cat#user-search span.glyphicon-search {\n padding-top: 6px;\n padding-bottom: 6px;\n top: 0;\n}\nspan.versus-cat span {\n font-size: 16px;\n cursor: pointer;\n padding-left: 6px;\n padding-top: 1px;\n padding-bottom: 4px;\n padding-right: 6px;\n margin: 2px;\n}\nspan.versus-cat span.shown {\n background-color: rgba(158, 213, 218, 0.2);\n border-radius: 5px;\n}\nspan.versus-cat span:hover {\n color: white;\n background-color: var(--double-letter-color);\n border-radius: 5px;\n}\nspan.ready-btn {\n position: relative;\n top: 2px;\n display: inline-block;\n font-family: 'Glyphicons Regular';\n font-style: normal;\n font-weight: normal;\n line-height: 1;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n font-size: 15px;\n line-height: 15px;\n top: 0;\n cursor: default; /* Not a pushable button even though it looks like one */\n color: white;\n background-color: var(--triple-letter-color);\n border-radius: 5px;\n padding: 4px;\n margin: 0 4px 0 0;\n}\nspan.ready-btn:before {\n content: \"\\E344\";\n /* thumbs-up */\n}\nspan.timed-btn {\n position: relative;\n top: 2px;\n display: inline-block;\n font-family: 'Glyphicons Regular';\n font-style: normal;\n font-weight: normal;\n line-height: 1;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n font-size: 15px;\n line-height: 15px;\n top: 0px;\n cursor: default;\n color: white;\n background-color: #f5c862;\n border-radius: 5px;\n padding: 4px;\n margin: 0 4px 0 0;\n}\nspan.timed-btn:before {\n content: \"\\E055\";\n /* time */\n}\nspan.fairplay-btn {\n position: relative;\n top: 2px;\n display: inline-block;\n font-family: 'Glyphicons Regular';\n font-style: normal;\n font-weight: normal;\n line-height: 1;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n font-size: 15px;\n line-height: 15px;\n top: 0px;\n cursor: default;\n color: white;\n background-color: var(--ok-button);\n border-radius: 5px;\n padding: 4px;\n margin: 0 4px 0 0;\n}\nspan.fairplay-btn:before {\n content: \"\\E151\";\n /* edit */\n}\nspan.fairplay-btn.large {\n /* This is shown in the board header */\n top: 0;\n font-size: 16px;\n border-width: 1px;\n border-color: white;\n border-style: solid;\n padding: 2px;\n padding-bottom: 4px;\n}\nspan.manual-btn {\n position: relative;\n top: 2px;\n display: inline-block;\n font-family: 'Glyphicons Regular';\n font-style: normal;\n font-weight: normal;\n line-height: 1;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n font-size: 15px;\n line-height: 15px;\n top: 0px;\n cursor: default;\n color: white;\n background-color: var(--cancel-button);\n border-radius: 5px;\n padding: 4px;\n margin: 0 4px 0 0;\n}\nspan.manual-btn:before {\n content: \"\\E065\";\n /* lightbulb */\n}\nspan.elo-btn {\n display: inline-block;\n width: 30px;\n min-width: 30px;\n font-size: 15px;\n line-height: 16px;\n text-align: center;\n font-weight: bold;\n color: white;\n border-radius: 5px;\n padding: 5px 6px;\n margin: 0;\n}\nspan.elo-btn .glyphicon {\n font-size: 15px;\n line-height: 12px;\n}\nspan.elo-btn.left {\n margin-left: 6px;\n margin-right: 4px;\n}\nspan.elo-btn.right {\n margin-left: 4px;\n margin-right: 6px;\n}\nspan.elo-btn.invisible {\n visibility: hidden;\n}\nspan.elo-btn.elo-win {\n background-color: var(--ok-button);\n}\nspan.elo-btn.elo-loss {\n background-color: var(--cancel-button);\n}\nspan.elo-btn.elo-neutral {\n background-color: var(--double-letter-color);\n}\nspan.elo-hdr-left {\n background-color: var(--triple-letter-color);\n color: white;\n border-radius: 5px;\n padding: 4px;\n padding-left: 6px;\n padding-right: 6px;\n margin-left: 6px;\n margin-right: 6px;\n top: 0px;\n}\nspan.elo-hdr-right {\n background-color: var(--triple-letter-color);\n color: white;\n border-radius: 5px;\n padding: 4px;\n padding-left: 6px;\n padding-right: 6px;\n margin-left: 6px;\n margin-right: 6px;\n top: 0px;\n}\nspan.usr-info {\n position: relative;\n top: 2px;\n display: inline-block;\n font-family: 'Glyphicons Regular';\n font-style: normal;\n font-weight: normal;\n line-height: 1;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n font-size: 15px;\n line-height: 15px;\n top: 0px;\n cursor: pointer;\n color: white;\n background-color: var(--ok-button);\n border-radius: 5px;\n padding: 4px;\n margin: 0;\n}\nspan.usr-info:before {\n content: \"\\E028\";\n /* Search */\n}\nspan.usr-info:hover {\n background-color: var(--triple-word-color);\n}\n#userlist span.glyphicon.glyphicon-star {\n color: var(--triple-letter-color);\n}\n#userlist span.glyphicon.glyphicon-hand-right,\n#elolist span.glyphicon.glyphicon-hand-right,\n#chall-sent span.glyphicon.glyphicon-hand-right,\n#chall-received span.glyphicon.glyphicon-thumbs-down,\np span.glyphicon.glyphicon-flag,\n#gamelist span.glyphicon.glyphicon-flag,\n#gamelist span.glyphicon.glyphicon-hourglass {\n color: var(--triple-word-color);\n}\n#recentlist span.glyphicon.glyphicon-bookmark,\n#usr-recent span.glyphicon.glyphicon-bookmark,\n#gamelist span.glyphicon.glyphicon-bookmark {\n color: var(--ok-button);\n}\nspan.glyphicon.glyphicon-lightbulb.grayed {\n color: rgba(0, 0, 0, 0.2);\n}\n.listheader span.glyphicon.glyphicon-star-empty,\n.listheader span.glyphicon.glyphicon-hand-right.grayed,\n.listheader span.glyphicon.glyphicon-thumbs-down.grayed,\n.listheader span.glyphicon.glyphicon-flag.grayed,\n#gamelist span.glyphicon.glyphicon-flag.grayed,\n#userlist span.glyphicon.glyphicon-star-empty,\n#userlist span.glyphicon.glyphicon-hand-right.grayed,\n#elolist span.glyphicon.glyphicon-hand-right.grayed {\n color: rgba(0, 0, 0, 0.15);\n}\nspan.glyphicon.glyphicon-hourglass.grayed,\nspan.glyphicon.glyphicon-shopping-bag.grayed {\n color: rgba(0, 0, 0, 0.1);\n}\n.listheader span.glyphicon.glyphicon-bookmark.grayed,\n#recentlist span.glyphicon.glyphicon-bookmark.grayed,\n#usr-recent span.glyphicon.glyphicon-bookmark.grayed,\n#gamelist span.glyphicon.glyphicon-bookmark.grayed,\n#gamelist span.glyphicon.glyphicon-hourglass.grayed {\n color: rgba(0, 0, 0, 0.06);\n}\n#gamelist span.glyphicon.glyphicon-flag.zombie {\n color: var(--double-letter-color);\n}\ndiv#user-no-match {\n display: none;\n position: absolute;\n top: 220px;\n left: 140px;\n width: 600px;\n z-index: 10;\n text-align: center;\n}\ndiv#user-no-match span#search-prefix {\n font-weight: bold;\n}\ndiv.modal-close {\n text-align: center;\n font-size: 18px;\n font-weight: 700;\n color: white;\n margin: 0;\n padding: 6px;\n padding-top: 9px;\n border-radius: 5px;\n cursor: pointer;\n position: absolute;\n width: 36px;\n height: 28px;\n bottom: 12px;\n right: 12px;\n top: auto;\n}\ndiv#usr-info-close {\n width: 72px;\n /* Override */\n background-color: var(--ok-button);\n}\ndiv#load-game {\n width: 72px;\n /* Override */\n background-color: var(--ok-button);\n}\ndiv#wait-cancel {\n right: 12px;\n width: 72px;\n /* Override */\n background-color: var(--cancel-button);\n}\ndiv#accept-cancel {\n right: 12px;\n width: 72px;\n /* Override */\n background-color: var(--cancel-button);\n}\ndiv#blank-close,\ndiv#promo-close {\n background-color: var(--cancel-button);\n}\ndiv#thanks-form {\n position: absolute;\n padding-left: 12px;\n padding-right: 12px;\n padding-top: 6px;\n padding-bottom: 6px;\n box-shadow: 3px 3px 5px 2px var(--dark-shadow);\n font-size: 1em;\n z-index: 20;\n background-color: var(--container-bg-color);\n top: 212px;\n right: 224px;\n width: 460px;\n height: 248px;\n line-height: 1.62em;\n}\ndiv#cancel-form {\n position: absolute;\n padding-left: 12px;\n padding-right: 12px;\n padding-top: 6px;\n padding-bottom: 6px;\n box-shadow: 3px 3px 5px 2px var(--dark-shadow);\n font-size: 1em;\n z-index: 20;\n background-color: var(--container-bg-color);\n top: 150px;\n right: 200px;\n width: 508px;\n height: 372px;\n line-height: 1.62em;\n}\ndiv#confirm-form {\n position: absolute;\n padding-left: 12px;\n padding-right: 12px;\n padding-top: 6px;\n padding-bottom: 6px;\n box-shadow: 3px 3px 5px 2px var(--dark-shadow);\n font-size: 1em;\n z-index: 20;\n background-color: var(--container-bg-color);\n top: 236px;\n right: 224px;\n width: 460px;\n height: 200px;\n line-height: 1.62em;\n}\ndiv#conditions-form {\n position: absolute;\n padding-left: 12px;\n padding-right: 12px;\n padding-top: 6px;\n padding-bottom: 6px;\n box-shadow: 3px 3px 5px 2px var(--dark-shadow);\n font-size: 1em;\n z-index: 20;\n background-color: var(--container-bg-color);\n top: 80px;\n right: 124px;\n width: 660px;\n height: 536px;\n line-height: 1.62em;\n padding-left: 24px;\n padding-right: 24px;\n}\ndiv#usr-info-form {\n position: absolute;\n padding-left: 12px;\n padding-right: 12px;\n padding-top: 6px;\n padding-bottom: 6px;\n box-shadow: 3px 3px 5px 2px var(--dark-shadow);\n font-size: 1em;\n z-index: 20;\n background-color: var(--container-bg-color);\n top: 16px;\n right: 12px;\n width: 884px;\n height: 644px;\n}\ndiv.thanks-content,\ndiv#cancel-content,\ndiv#confirm-content {\n margin-top: 24px;\n margin-left: 24px;\n margin-right: 24px;\n}\ndiv.usr-info-hdr {\n font-size: 18px;\n margin-top: 0px;\n margin-bottom: 0px;\n}\ndiv.usr-info-hdr h1 {\n display: inline;\n font-size: 36px;\n font-weight: bold;\n}\ndiv.usr-info-hdr h2 {\n display: inline;\n font-size: 24px;\n font-weight: bold;\n}\nspan.vbar {\n color: var(--light-background);\n font-size: 2em;\n padding-left: 10px;\n padding-right: 10px;\n}\nh1.usr-info-icon {\n color: var(--light-background);\n}\nh1.usr-info-icon span.glyphicon-coffee-cup {\n color: var(--ok-button);\n}\ndiv.usr-info-fav {\n display: inline-block;\n position: absolute;\n top: 26px;\n right: 20px;\n color: var(--triple-letter-color);\n font-size: 26px;\n cursor: pointer;\n}\ndiv.usr-info-fav span.glyphicon-star-empty {\n color: rgba(0, 0, 0, 0.15);\n}\ndiv#usr-info-chall {\n display: inline-block;\n position: absolute;\n top: 68px;\n right: 20px;\n}\ndiv#usr-info-chall.chall span.glyphicon-hand-right {\n font-size: 26px;\n color: var(--triple-word-color);\n}\ndiv#usr-info-chall.no-chall span.glyphicon-hand-right {\n font-size: 26px;\n color: rgba(0, 0, 0, 0.15);\n}\nspan.best-word {\n text-transform: uppercase;\n font-weight: bold;\n font-style: italic;\n}\np#usr-best {\n display: inline-block;\n position: absolute;\n right: 16px;\n top: 50px;\n text-align: right;\n}\np#usr-best a:link,\np#usr-best a:visited {\n text-decoration: none;\n color: #5699A5;\n}\np#usr-best a:hover {\n text-decoration: none;\n color: var(--triple-word-color);\n}\ndiv#stats-toggler {\n margin-top: 7px;\n margin-right: 8px;\n}\ndiv#usr-stats {\n position: absolute;\n height: 48px;\n width: 680px;\n bottom: 12px;\n left: 12px;\n vertical-align: top;\n}\ndiv#usr-stats-human {\n display: inline-block;\n vertical-align: top;\n}\ndiv#usr-stats-all {\n display: none;\n vertical-align: top;\n}\ndiv#own-stats-human {\n display: inline-block;\n vertical-align: top;\n}\ndiv#own-stats-all {\n display: none;\n vertical-align: top;\n}\ndiv.stats-games {\n color: #ec9d07;\n border-color: #ec9d07;\n}\ndiv.stats-win-ratio {\n color: var(--ok-button);\n border-color: var(--ok-button);\n}\ndiv.stats-avg-score {\n color: #ec9d07;\n border-color: #ec9d07;\n}\ndiv.chall-hdr {\n font-size: 18px;\n margin-top: 6px;\n margin-bottom: 15px;\n overflow-x: hidden;\n}\ndiv.chall-hdr table {\n border-spacing: 0;\n margin: 0;\n padding: 0;\n vertical-align: top;\n}\ntd.l-border {\n border-left-style: solid;\n border-left-color: black;\n border-left-width: 2px;\n padding-left: 12px;\n white-space: nowrap;\n}\ndiv.chall-hdr h1 {\n display: inline-block;\n font-size: 28px;\n line-height: 30px;\n margin-left: 6px;\n margin-top: 0;\n margin-bottom: 8px;\n font-weight: bold;\n}\ndiv.chall-hdr h2 {\n display: block;\n font-size: 22px;\n line-height: 24px;\n margin-top: 6px;\n margin-bottom: 4px;\n color: #208C9F;\n}\nh1.chall-icon {\n display: block;\n color: #208C9F;\n margin-right: 12px;\n margin-top: 0;\n margin-bottom: 0;\n}\ndiv.chall-time {\n display: inline-block;\n width: 300px;\n left: 66px;\n height: 32px;\n padding-top: 8px;\n padding-bottom: 1px;\n padding-left: 12px;\n padding-right: 12px;\n margin-top: 7px;\n margin-bottom: 4px;\n text-align: center;\n font-size: 20px;\n font-weight: 700;\n line-height: 22px;\n background-color: #cccccc;\n color: white;\n cursor: pointer;\n border-radius: 4px;\n}\ndiv.chall-time.selected {\n background-color: var(--triple-word-color);\n color: black;\n}\ndiv.chall-time:hover {\n background-color: var(--double-letter-color);\n}\ndiv.chall-time.selected:hover {\n background-color: var(--double-word-color);\n}\ndiv.chall-time span.glyphicon-time {\n margin-right: 8px;\n}\nspan#chall-online {\n position: relative;\n top: 2px;\n font-family: 'Glyphicons Regular';\n font-style: normal;\n font-weight: normal;\n line-height: 1;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n display: inline-block;\n top: 0px;\n color: white;\n background-color: rgba(228, 234, 240, 0.65);\n border-radius: 5px;\n padding: 5px;\n margin: 0;\n}\nspan#chall-online:before {\n content: \"\\E242\";\n /* Flash */\n}\nspan#chall-online.online {\n background-color: var(--ok-button);\n}\ndiv#chall-newbag {\n margin-top: 24px;\n padding-left: 6px;\n padding-right: 152px;\n font-size: 14px;\n text-align: left;\n}\ndiv#chall-newbag td {\n vertical-align: middle;\n padding-right: 12px;\n}\ndiv#chall-manual {\n margin-top: 4px;\n font-size: 14px;\n}\ndiv#manual-toggler {\n margin-top: 12px;\n margin-bottom: 0;\n}\ndiv.wait-explain {\n padding-left: 48px;\n padding-right: 12px;\n padding-top: 24px;\n padding-bottom: 24px;\n}\ndiv#user-dialog {\n visibility: visible;\n}\ndiv#user-form {\n position: absolute;\n padding-left: 12px;\n padding-right: 12px;\n padding-top: 6px;\n padding-bottom: 6px;\n box-shadow: 3px 3px 5px 2px var(--dark-shadow);\n font-size: 1em;\n z-index: 20;\n background-color: var(--container-bg-color);\n top: 40px;\n right: 64px;\n width: 736px;\n height: 582px;\n}\ndiv#user-logout {\n left: 12px;\n width: 144px;\n /* Override */\n background-color: var(--triple-word-color);\n}\ndiv#user-friend {\n left: 180px;\n width: 280px;\n /* Override */\n background-color: var(--ok-button);\n}\ndiv#user-unfriend {\n left: 180px;\n width: 280px;\n /* Override */\n padding-top: 6px;\n border-style: solid;\n border-width: 2px;\n border-color: var(--ok-button);\n background-color: white;\n color: var(--ok-button);\n line-height: 24px;\n}\ndiv#user-unfriend span.glyphicon-coffee-cup {\n color: var(--triple-word-color);\n}\ndiv#user-cancel {\n right: 108px;\n /* 12 + 72 + 12 + 12 */\n width: 72px;\n /* Override */\n background-color: var(--cancel-button);\n}\ndiv#user-ok {\n right: 12px;\n /* 12 */\n width: 72px;\n /* Override */\n background-color: var(--ok-button);\n}\ndiv#accept-form {\n position: absolute;\n padding-left: 12px;\n padding-right: 12px;\n padding-top: 6px;\n padding-bottom: 6px;\n box-shadow: 3px 3px 5px 2px var(--dark-shadow);\n font-size: 1em;\n z-index: 20;\n background-color: var(--container-bg-color);\n top: 8px;\n left: 4px;\n width: 335px;\n height: 488px;\n}\nh1#accept-nick {\n display: inline-block;\n font-size: 28px;\n line-height: 30px;\n margin-left: 6px;\n margin-top: 0;\n margin-bottom: 8px;\n}\n.blink {\n animation: opacityBlink 1s infinite;\n -webkit-animation: opacityBlink 1s infinite;\n}\n.opp-ready {\n animation: opacityBlink 1s infinite;\n -webkit-animation: opacityBlink 1s infinite;\n}\na.opp-ready:link,\na.opp-ready:visited {\n color: var(--cancel-button);\n}\na.opp-ready:hover {\n color: var(--triple-word-color);\n}\ndiv.blank-rack {\n position: relative;\n top: 0;\n left: 0;\n}\n.blank-rack table.board {\n border-spacing: 8px;\n}\ndiv.welcome {\n font-size: 15px;\n line-height: 20px;\n font-weight: normal;\n padding-bottom: 12px;\n}\n.welcome a:link,\n.welcome a:visited {\n text-decoration: none;\n color: #5699A5;\n}\n.welcome a:hover {\n text-decoration: none;\n color: var(--triple-word-color);\n}\ndiv.dialog-spacer {\n margin-top: 2px;\n margin-bottom: 4px;\n}\nspan.caption {\n display: inline-block;\n position: relative;\n vertical-align: top;\n top: 10px;\n width: 140px;\n margin-right: 12px;\n overflow: hidden;\n text-align: right;\n}\nspan.subcaption {\n display: inline-block;\n position: relative;\n vertical-align: top;\n top: 16px;\n margin-left: 18px;\n margin-right: 6px;\n}\nspan.caption.sub {\n top: 16px;\n}\nspan.asterisk {\n color: red;\n font-size: 1.4em;\n font-weight: bold;\n margin-left: 4px;\n}\ndiv.explain {\n margin-left: 158px;\n margin-bottom: 12px;\n font-size: 14px;\n text-align: left;\n font-style: italic;\n color: var(--light-shadow);\n}\ndiv.subexplain {\n display: inline-block;\n width: 420px;\n vertical-align: top;\n margin-top: 11px;\n margin-left: 18px;\n margin-right: 6px;\n font-size: 14px;\n color: var(--light-shadow);\n}\ndiv.errinput {\n margin-left: 158px;\n margin-bottom: 10px;\n font-size: 16px;\n text-align: left;\n font-weight: bold;\n color: var(--cancel-button);\n}\ninput.text {\n font-family: var(--primary-font);\n font-size: 20px;\n font-weight: 700;\n height: 32px;\n border-style: solid;\n border-color: var(--ok-button);\n border-width: 2px;\n border-radius: 5px;\n margin-bottom: 4px;\n padding-top: 2px;\n padding-bottom: 2px;\n padding-left: 8px;\n padding-right: 8px;\n}\ninput.text:focus {\n background-color: #ffffc8;\n border-style: solid;\n border-color: var(--ok-button);\n border-width: 2px;\n border-radius: 5px;\n outline-style: none;\n}\ninput.username {\n width: 300px;\n}\ninput.fullname {\n width: 450px;\n}\ninput.email {\n width: 400px;\n}\ninput.text#search-id {\n font-weight: normal;\n height: 28px;\n font-size: 18px;\n border-color: var(--double-letter-color);\n margin-top: 0px;\n margin-bottom: 0px;\n}\ndiv.netskrafl-container button[type=\"submit\"] {\n font-family: var(--primary-font);\n font-size: 20px;\n font-weight: 400;\n height: 40px;\n color: white;\n text-align: center;\n width: 322px;\n border-width: 0;\n border-radius: 5px;\n background-color: var(--ok-button);\n margin-top: 20px;\n margin-left: 0;\n margin-right: 0;\n margin-bottom: 0;\n padding-top: 4px;\n padding-bottom: 4px;\n padding-left: 8px;\n padding-right: 8px;\n cursor: pointer;\n}\ndiv.netskrafl-container button[type=\"submit\"]:focus,\ndiv.netskrafl-container button[type=\"submit\"]:hover {\n outline: var(--focus-border) solid 3px;\n}\ndiv.netskrafl-container button.login {\n margin-top: 24px;\n}\ndiv.netskrafl-container button.logout {\n margin-top: 80px;\n background-color: var(--cancel-button);\n}\ndiv.netskrafl-container input[type=\"checkbox\"] {\n display: none;\n}\ndiv.toggler {\n background-color: var(--light-background);\n color: white;\n margin-top: 9px;\n margin-bottom: 3px;\n border-radius: 10px;\n cursor: pointer;\n overflow: hidden;\n border: white solid 3px;\n}\ndiv.toggler:focus, div.toggler:hover {\n outline-style: none;\n border: var(--focus-border) solid 3px;\n}\ndiv.toggler div.option {\n display: inline-block;\n width: 46px;\n height: 28px;\n line-height: 28px;\n font-size: 21px;\n padding-top: 3px;\n padding-bottom: 3px;\n text-align: center;\n border-style: none;\n}\ndiv.toggler div.option.small {\n width: 36px;\n height: 24px;\n line-height: 22px;\n font-size: 18px;\n padding-top: 3px;\n padding-bottom: 2px;\n}\ndiv.toggler div.option.x-small {\n width: 30px;\n height: 20px;\n line-height: 20px;\n font-size: 15px;\n padding-top: 1px;\n padding-bottom: 3px;\n}\ndiv.toggler div.option.selected {\n background-color: var(--triple-letter-color);\n}\ndiv#fairplay-toggler div.option.selected {\n background-color: var(--ok-button);\n}\ndiv#fairplay-toggler span.glyphicon-edit {\n top: 0;\n}\ndiv #radioset {\n padding-top: 6px;\n padding-bottom: 24px;\n}\ndiv.disabled {\n background-color: var(--board-background);\n}\na.nodecorate:link {\n text-decoration: none;\n color: black;\n}\na.nodecorate:visited {\n text-decoration: none;\n color: black;\n}\na.nodecorate:hover {\n text-decoration: none;\n color: var(--triple-letter-color);\n}\na.iconlink:link {\n text-decoration: none;\n color: var(--triple-letter-color);\n}\na.iconlink:visited {\n text-decoration: none;\n color: var(--triple-letter-color);\n}\na.iconlink:hover {\n text-decoration: none;\n color: var(--triple-word-color);\n}\na.backlink:link {\n text-decoration: none;\n color: var(--board-background);\n}\na.backlink:visited {\n text-decoration: none;\n color: var(--board-background);\n}\na.backlink:hover {\n text-decoration: none;\n color: var(--triple-word-color);\n}\ndiv#tabs-1 p {\n line-height: 1.6em;\n}\ndiv#tabs-1 p img,\ndiv#tabs-3 p img {\n margin-left: 3px;\n margin-right: 2px;\n vertical-align: -3px;\n display: inline;\n}\ndiv#tabs-3 p,\ndiv#tabs-3 ol li,\ndiv#tabs-3 ol p,\ndiv#tabs-3 ol ul li {\n line-height: 1.65em;\n}\ndiv#tabs-3 ol {\n list-style-type: decimal;\n margin: auto;\n padding-inline-start: 40px;\n}\ndiv#tabs-3 li {\n display: list-item;\n margin: auto;\n padding: auto;\n}\ndiv.help-container ol li {\n font-weight: bold;\n}\ndiv.help-container ul li {\n font-weight: normal;\n list-style-type: disc;\n}\ndiv.help-container table {\n border-spacing: 0;\n border-collapse: collapse;\n}\ndiv.help-container td {\n margin: 0;\n padding: 4px;\n padding-left: 8px;\n padding-right: 8px;\n text-align: right;\n border-width: 1px;\n border-style: solid;\n width: 80px;\n}\ndiv.help-container td.row-caption {\n text-align: left;\n font-weight: bold;\n width: 120px;\n}\ndiv.help-container span.glyphicon-hourglass {\n color: var(--cancel-button);\n}\ndiv.help-container p {\n font-weight: normal;\n}\ndiv.help-container img.browserlogo {\n height: 28px;\n width: auto;\n object-fit: scale-down;\n margin-right: 8px;\n}\ndiv.help-container b.vcenter {\n position: relative;\n top: -8px;\n}\ndiv.twolist {\n -webkit-column-count: 2;\n -moz-column-count: 2;\n column-count: 2;\n font-size: 18px;\n line-height: 30px;\n padding-bottom: 12px;\n}\nspan.twoword {\n font-weight: bold;\n padding-right: 3px;\n}\nspan.errword {\n text-transform: uppercase;\n}\ndiv#emoticons-div {\n padding-bottom: 24px;\n}\ntable#emoticons td {\n font-family: 'Courier', sans-serif;\n font-size: 20px;\n text-align: center;\n}\nimg#villi {\n float: right;\n margin-left: 12px;\n margin-top: 18px;\n margin-bottom: 12px;\n}\ndiv.signup-header {\n position: absolute;\n top: 12px;\n left: 110px;\n width: 900px;\n}\n\n/* ================= MOBILE PORTRAIT UI, LARGE ENOUGH TO BE NON-SCROLLABLE =============== */\n\n@media all and (max-width: 1023px) and (min-height: 552px) {\n /* On sufficiently large mobile screens, keep the body fixed (unscrollable) */\n div.netskrafl-container {\n /* position: fixed; */\n overflow: hidden;\n }\n}\n\n/* ================= MOBILE PORTRAIT UI, EXTRA TALL =============== */\n\n@media all and (max-width: 1023px) and (min-height: 632px) {\n /* iPhone X or taller */\n /* Tall mobile phones: use two lines to display the header */\n div.tabbed-page {\n height: 605px;\n overflow: hidden;\n }\n div#tabs > div[role=tabpanel],\n div#main-tabs > div[role=tabpanel] {\n height: 556px;\n }\n div.scoreleft {\n display: inline-block;\n position: relative;\n left: auto;\n top: -4px;\n padding-left: 10px;\n }\n div.scoreright {\n display: inline-block;\n position: relative;\n right: auto;\n top: -4px;\n padding-right: 10px;\n }\n div.player-btn {\n display: inline-block;\n position: relative;\n top: 0;\n left: 0;\n padding-top: 4px;\n width: 128px;\n }\n div.robot-btn {\n display: inline-block;\n position: relative;\n top: 0;\n left: 0;\n padding-top: 4px;\n width: 128px;\n }\n div.player-btn.left,\n div.robot-btn.left {\n padding-left: 4px;\n }\n div.player-btn.right,\n div.robot-btn.right {\n padding-right: 4px;\n }\n div.heading {\n height: auto;\n }\n div.fairplay {\n top: 21px;\n }\n span.fairplay-btn.large {\n /* This is shown in the board header */\n font-size: 18px;\n padding: 4px;\n padding-bottom: 6px;\n }\n div.right-area {\n top: 37px;\n }\n div.right-tab {\n top: -32px;\n width: 64px;\n min-width: 64px;\n padding-top: 6px;\n font-size: 18px;\n }\n div.right-tab#tab-board {\n left: 8px;\n }\n div.right-tab#tab-movelist {\n left: 78px;\n }\n div.right-tab#tab-twoletter {\n left: 148px;\n }\n div.right-tab#tab-games {\n left: 218px;\n }\n div.right-tab#tab-chat {\n left: 288px;\n }\n div.board-area {\n top: 103px;\n }\n div #userlist,\n div #elolist {\n height: 424px;\n /* 14 lines @ 36px each */\n }\n div #gamelist {\n height: 576px;\n /* 16 lines @ 36px each */\n }\n div #recentlist {\n height: 504px;\n /* 14 lines @ 36px each */\n }\n div #usr-recent {\n height: 540px;\n /* 15 lines @ 36px each */\n }\n div #chall-sent,\n div #chall-received {\n height: 288px;\n /* 8 lines @ 36px each */\n }\n div.chat,\n div.twoletter {\n height: 474px;\n }\n div.games {\n height: 450px;\n }\n div.movelist-container {\n height: 466px;\n }\n div.movelist {\n height: 358px;\n }\n div.rack-row {\n margin-top: 12px;\n }\n}\n\n/* iPhone 11 or larger: scale the UI to appear larger on the screen */\n@media all and (min-width: 414px) and (max-width: 1023px) and (min-height: 652px) {\n div.netskrafl-container {\n /*\n transform: scale(1.1);\n transform-origin: center top;\n */\n margin-top: 4px;\n height: 652px;\n }\n}\n\n/* ================= MOBILE LANDSCAPE UI ====================== */\n\n@media all and (min-width: 667px) {\n /* Mobile screen, landscape mode */\n div.netskrafl-container {\n /* Reference width */\n width: 667px;\n /* Reference height */\n height: 375px;\n overflow-y: hidden;\n }\n div.tabbed-page {\n width: 100%;\n }\n .tab-legend {\n display: inline;\n padding-left: 12px;\n }\n div.help-container {\n width: 100%;\n }\n /* Paragraphs of help text that should be centered on screens that are wide enough */\n p.help-center {\n text-align: center;\n }\n div.heading div.header-logo {\n display: none;\n }\n div.logowrapper {\n width: 0%;\n }\n div.playerwrapper {\n width: 100%;\n padding-top: 0;\n }\n div.fairplay {\n top: 8px;\n }\n div.login-btn-small {\n position: fixed;\n top: 128px;\n left: 50%;\n width: 50%;\n }\n div.board-area {\n position: absolute;\n top: 0;\n padding-top: 6px;\n }\n div.board {\n top: 8px;\n padding-top: 1px;\n background-color: transparent;\n }\n div.rightcol {\n width: 283px;\n top: 8px;\n left: 376px;\n height: 70px;\n }\n div.rack-row {\n display: none;\n }\n div.recallbtn {\n left: 376px;\n top: 158px;\n }\n div.rack-left div.recallbtn {\n display: none;\n }\n div.scramblebtn {\n left: 376px;\n top: 158px;\n }\n .bottom-btn-landscape {\n top: 158px;\n display: none;\n border-width: 0;\n color: white;\n }\n div.submitexchange {\n top: 158px;\n display: none;\n border-width: 0;\n color: white;\n left: 441px;\n background-color: var(--ok-button);\n }\n div.submitpass {\n top: 158px;\n display: none;\n border-width: 0;\n color: white;\n left: 506px;\n background-color: var(--triple-word-color);\n }\n div.submitresign {\n top: 158px;\n display: none;\n border-width: 0;\n color: white;\n left: 571px;\n background-color: var(--cancel-button);\n }\n div.submitmove {\n left: 551px;\n top: 158px;\n }\n div.submitmove#move-mobile {\n display: none;\n }\n div.waitmove {\n left: 551px;\n top: 158px;\n }\n div.submitnewgame {\n left: 551px;\n top: 158px;\n }\n div.player {\n min-height: 36px;\n }\n div.player-btn {\n width: 84px;\n padding-top: 6px;\n }\n div.robot-btn {\n width: 84px;\n padding-top: 6px;\n }\n div.scoreleft,\n div.scoreright {\n top: 3px;\n }\n div.right-tab {\n display: none;\n }\n div.opp-turn {\n display: none;\n }\n div.movelist-container {\n height: 300px;\n padding-top: 0px;\n padding-bottom: 0px;\n }\n div.movelist {\n height: 100%;\n }\n div.right-area.with-clock div.movelist-container {\n /* If in a clock game, reduce the movelist height by two lines (2 * 20px) */\n height: 260px;\n }\n div.movelist-container div.bag {\n display: none;\n }\n div#gameover {\n display: none;\n }\n div.stats-box {\n width: 448px;\n left: 90px;\n }\n div#own-stats {\n height: 16px;\n }\n p#own-best {\n left: auto;\n right: 6px;\n top: 0px;\n text-align: right;\n font-size: 0.85em;\n line-height: 1.4em;\n }\n div #chall-sent,\n div #chall-received {\n height: 108px;\n /* 3 lines @ 36px each */\n }\n div.games,\n div.twoletter,\n div.chat {\n display: none;\n }\n div.right-area {\n top: 8px;\n height: 316px;\n }\n span.list-chall {\n width: 240px;\n max-width: 240px;\n }\n span.list-fullname-robot {\n width: 320px;\n max-width: 320px;\n }\n span.list-opp {\n width: 180px;\n max-width: 180px;\n }\n div#tabs > div[role=tabpanel],\n div#main-tabs > div[role=tabpanel] {\n height: 326px;\n }\n div#tabs-1 span.list-ts-short,\n div#tabs-1 span.list-manual,\n div#tabs-4 span.list-ts-short {\n display: inline-block;\n }\n div#tabs-2 span.list-ts {\n display: inline-block;\n }\n div#tabs-3 span.list-nick {\n width: 180px;\n max-width: 180px;\n }\n div#tabs-4 span.list-nick {\n width: 220px;\n max-width: 220px;\n }\n div#blank-form {\n display: none;\n }\n}\n\n@media all and (min-width: 667px) and (max-height: 360px) {\n div.board {\n transform: scale(0.96);\n transform-origin: top left;\n }\n}\n\n/* fullscreen.css */\n\n@media all and (min-width: 1024px) {\n\n .ui-helper-reset {\n line-height: 36px;\n }\n .ui-tabs .ui-tabs-panel {\n background-color: var(--tab-background);\n padding: 1em 1.4em;\n }\n .ui-widget-content {\n border: 2px solid var(--container-bg-color);\n background-color: var(--tab-background);\n }\n .ui-widget-header {\n background-color: var(--header-background);\n }\n .ui-widget-header .ui-state-active {\n background-color: var(--tab-background);\n }\n .ui-state-default,\n .ui-widget-content .ui-state-default {\n border: 2px solid var(--container-bg-color);\n }\n .ui-state-active,\n .ui-widget-content .ui-state-active {\n border: 2px solid var(--container-bg-color);\n background-color: var(--tab-background);\n }\n .ui-state-hover,\n .ui-widget-content .ui-state-hover,\n .ui-state-focus,\n .ui-widget-content .ui-state-focus {\n border: 2px solid var(--container-bg-color);\n }\n .ui-tabs .ui-tabs-nav .ui-tabs-anchor {\n min-width: auto;\n padding-left: 1em;\n padding-right: 1em;\n text-align: left;\n }\n .ui-tabs .ui-tabs-nav .ui-tabs-anchor.sp {\n /* Override tab width */\n min-width: 82px;\n }\n .ui-tabs .ui-tabs-nav li {\n box-shadow: none;\n }\n .ui-tabs .ui-tabs-nav li.ui-tabs-active {\n padding-bottom: 1px;\n background-color: var(--tab-background);\n }\n /* Large screen (iPad and larger) */\n div.netskrafl-container {\n width: 1024px;\n height: 768px;\n /* Was 748 */\n overflow-y: hidden;\n }\n div.game-container {\n height: 768px;\n }\n div.heading {\n height: auto;\n /* background-color: @heading-background; */\n }\n div.logo {\n display: block;\n }\n div#main-tabs div.header-logo {\n display: none;\n }\n div.circle {\n height: 38px;\n width: 38px;\n background-color: #80aede;\n border-radius: 50%;\n display: inline-block;\n position: relative;\n top: -6px;\n }\n div.circle span.glyphicon {\n top: 8px;\n }\n div.info {\n display: block;\n position: absolute;\n bottom: 148px;\n top: auto;\n left: 28px;\n width: 50px;\n height: 50px;\n font-size: 40px;\n text-align: center;\n }\n div.info:hover {\n animation: expand 0.4s;\n }\n div.login-error {\n position: absolute;\n padding-left: 12px;\n padding-right: 12px;\n padding-top: 6px;\n padding-bottom: 6px;\n box-shadow: 3px 3px 5px 2px var(--dark-shadow);\n font-size: 1em;\n z-index: 20;\n background-color: var(--container-bg-color);\n top: 96px;\n left: auto;\n right: 202px;\n width: 504px;\n height: 276px;\n }\n div.try-again {\n width: auto;\n }\n div.get-help {\n width: auto;\n }\n div.board-help {\n display: block;\n z-index: 2;\n }\n ul.ui-tabs-nav {\n display: block;\n }\n div.rightcol {\n position: absolute;\n width: 302px;\n top: 38px;\n right: 12px;\n height: auto;\n left: auto;\n }\n div.right-area {\n display: block;\n top: 0;\n margin-top: 12px;\n height: 420px;\n }\n div.games,\n div.twoletter,\n div.chat {\n display: block;\n border-radius: 0;\n }\n div.twoletter,\n div.chat {\n height: 420px;\n }\n div.board-area {\n margin: 0;\n /* width should not be set here */\n height: 750px;\n }\n div.board {\n position: absolute;\n top: 0;\n padding-top: 0;\n left: 93px;\n width: auto;\n height: auto;\n margin: 0;\n }\n .board td {\n min-height: 30px;\n min-width: 30px;\n height: 30px;\n width: 30px;\n border-width: 2px;\n border-radius: 3.5px;\n box-shadow: none;\n }\n table.board td.center:empty {\n font-size: 23px;\n line-height: 23px;\n }\n table.board tr {\n height: 34px;\n /* 32px + 2 * 1.0px */\n }\n .rack table.board {\n border-spacing: 4px;\n }\n .blank-rack table.board {\n border-spacing: 8px;\n }\n .rack table.board tr {\n height: 34px;\n /* 32px + 2 * 1.0px */\n }\n div.tile {\n font-size: 24px;\n line-height: 25px;\n height: 28px;\n width: 28px;\n margin: 0;\n padding-top: 2px;\n padding-right: 2px;\n }\n .rack div.tile {\n font-size: 24px;\n line-height: 25px;\n height: 28px;\n width: 28px;\n padding-top: 2px;\n margin-left: 0;\n }\n div.tile.wide,\n div.tile.extra-wide {\n /* Wide character tile */\n text-indent: -6px;\n margin-left: 0;\n padding-right: 2px;\n }\n div.tile.extra-wide {\n /* Extra wide character tile: Q */\n text-indent: -8px;\n }\n div.board div.tile.wide,\n div.board div.tile.extra-wide {\n /* Wide letter tile on the board */\n text-indent: -3.5px;\n }\n /* On large UIs, tile size doesn't change while dragging */\n div.tile.dragging {\n font-size: 30px;\n line-height: 30px;\n height: 36px;\n width: 36px;\n padding-top: 3px;\n margin-left: 0;\n }\n div.letterscore {\n bottom: 2px;\n right: 1px;\n font-size: 9px;\n line-height: 9px;\n }\n .rack div.letterscore {\n left: auto;\n right: 0px;\n bottom: 1px;\n }\n div.tile.wide div.letterscore,\n div.tile.extra-wide div.letterscore {\n /* Adjust letter score position for wide tiles */\n right: 1px;\n left: auto;\n }\n .rack div.tile.wide div.letterscore,\n .rack div.tile.extra-wide div.letterscore {\n /* Adjust letter score position for wide tiles */\n right: 1px;\n left: auto;\n }\n div.tile.dragging div.letterscore {\n bottom: 3px;\n right: 2px;\n font-size: 10px;\n line-height: 10px;\n }\n tr.colid {\n display: table-row;\n }\n td.rowid {\n display: table-cell;\n overflow: hidden;\n font-size: 14px;\n line-height: 14px;\n text-align: center;\n font-weight: 400;\n background-color: transparent;\n border-color: transparent;\n box-shadow: none;\n }\n div.bag {\n display: block;\n bottom: 108px;\n }\n div.rack-row {\n display: block;\n height: auto;\n margin: 0;\n }\n div.rack {\n position: absolute;\n display: block;\n width: auto;\n float: none;\n top: auto;\n bottom: 132px;\n left: 241px;\n padding: 6px;\n border-width: 0;\n border-radius: 5px;\n margin: 0;\n background-color: var(--board-background);\n }\n div.rack-left {\n display: none;\n }\n div.rack-right {\n display: none;\n }\n .rack td {\n min-height: 30px;\n min-width: 30px;\n max-height: 30px;\n max-width: 30px;\n height: 30px;\n width: 30px;\n border-color: white;\n background-color: white;\n box-shadow: 2px 2px 4px 0 #afb7cad0;\n }\n .rack td.opp {\n border-color: var(--cancel-button);\n background-color: var(--cancel-button);\n }\n .rack td:empty {\n border-color: #dddddd;\n background-color: #f4f4f4;\n box-shadow: none;\n }\n div.buttons {\n position: static;\n height: auto;\n }\n div.buttons div.challenge .glyphicon {\n top: 3px;\n }\n span.yesnobutton#force-resign {\n display: inline;\n background-color: var(--cancel-button);\n color: white;\n padding-bottom: 4px;\n }\n div.force-resign {\n display: none;\n }\n div.word-check {\n display: block;\n width: 50px;\n height: 46px;\n font-size: 26px;\n line-height: 46px;\n top: auto;\n bottom: 273px;\n left: 643px;\n border-radius: 5px;\n }\n div.score {\n display: block;\n width: 50px;\n height: 46px;\n font-size: 24px;\n line-height: 46px;\n top: auto;\n bottom: 211px;\n left: 643px;\n border-radius: 5px;\n font-family: 'Open Sans', 'Arial', sans-serif;\n }\n .standard-button {\n position: absolute;\n top: 528px;\n text-align: center;\n font-size: 19px;\n font-weight: 700;\n color: white;\n margin: 0;\n padding: 6px;\n padding-top: 9px;\n border-radius: 5px;\n cursor: pointer;\n }\n .submitbutton {\n position: absolute;\n top: 528px;\n text-align: center;\n font-size: 19px;\n font-weight: 700;\n color: white;\n margin: 0;\n padding: 6px;\n padding-top: 9px;\n border-radius: 5px;\n cursor: pointer;\n width: 78px;\n height: 30px;\n top: auto;\n bottom: 136px;\n left: 546px;\n background-color: var(--ok-button);\n font-size: 18px;\n line-height: 24px;\n font-weight: normal;\n }\n div.submitnewgame {\n position: absolute;\n top: 528px;\n text-align: center;\n font-size: 19px;\n font-weight: 700;\n color: white;\n margin: 0;\n padding: 6px;\n padding-top: 9px;\n border-radius: 5px;\n cursor: pointer;\n width: 78px;\n height: 30px;\n top: auto;\n bottom: 136px;\n left: 546px;\n background-color: var(--ok-button);\n font-size: 18px;\n line-height: 24px;\n font-weight: normal;\n top: 464px;\n }\n div.fb-share {\n position: absolute;\n top: 528px;\n text-align: center;\n font-size: 19px;\n font-weight: 700;\n color: white;\n margin: 0;\n padding: 6px;\n padding-top: 9px;\n border-radius: 5px;\n cursor: pointer;\n width: 78px;\n height: 30px;\n top: auto;\n bottom: 136px;\n left: 546px;\n background-color: var(--ok-button);\n font-size: 18px;\n line-height: 24px;\n font-weight: normal;\n left: 122px;\n height: 60px;\n /* bottom: 104px; */\n }\n div.waitmove {\n position: absolute;\n top: 528px;\n text-align: center;\n font-size: 19px;\n font-weight: 700;\n color: white;\n margin: 0;\n padding: 6px;\n padding-top: 9px;\n border-radius: 5px;\n cursor: pointer;\n width: 78px;\n height: 30px;\n top: auto;\n bottom: 136px;\n left: 546px;\n background-color: var(--ok-button);\n font-size: 18px;\n line-height: 24px;\n font-weight: normal;\n float: none;\n border-style: solid;\n border-width: 1px;\n border-color: var(--ok-button);\n background-color: white;\n }\n div.submitmove {\n position: absolute;\n top: 528px;\n text-align: center;\n font-size: 19px;\n font-weight: 700;\n color: white;\n margin: 0;\n padding: 6px;\n padding-top: 9px;\n border-radius: 5px;\n cursor: pointer;\n width: 78px;\n height: 30px;\n top: auto;\n bottom: 136px;\n left: 546px;\n background-color: var(--ok-button);\n font-size: 18px;\n line-height: 24px;\n font-weight: normal;\n display: block;\n }\n div.submitmove span.glyphicon-play {\n top: 3px;\n left: 2px;\n }\n div.submitmove.error-shown {\n display: block;\n }\n /* To the left of the rack */\n .bottom-button {\n display: block;\n position: absolute;\n top: auto;\n bottom: 136px;\n }\n div.submitresign {\n display: block;\n position: absolute;\n top: auto;\n bottom: 136px;\n font-size: 22px;\n width: 40px;\n height: 30px;\n left: 101px;\n }\n div.submitresign.disabled {\n background-color: var(--board-background);\n }\n div.submitexchange {\n display: block;\n position: absolute;\n top: auto;\n bottom: 136px;\n font-size: 22px;\n width: 40px;\n height: 30px;\n left: 167px;\n }\n div.submitexchange.disabled {\n background-color: var(--board-background);\n }\n div.recallbtn {\n display: block;\n position: absolute;\n top: auto;\n bottom: 136px;\n background-color: var(--triple-word-color);\n font-size: 22px;\n width: 40px;\n height: 30px;\n left: 167px;\n }\n /* To the right of the rack */\n div.scramblebtn {\n display: block;\n position: absolute;\n top: auto;\n bottom: 136px;\n font-size: 22px;\n width: 40px;\n height: 30px;\n left: 546px;\n }\n div.submitpass {\n display: block;\n position: absolute;\n top: auto;\n bottom: 136px;\n font-size: 22px;\n width: 40px;\n height: 30px;\n left: 612px;\n }\n div.submitpass.disabled {\n background-color: var(--board-background);\n }\n div.fb-share {\n position: absolute;\n top: 528px;\n text-align: center;\n font-size: 19px;\n font-weight: 700;\n margin: 0;\n padding: 6px;\n padding-top: 9px;\n border-radius: 5px;\n cursor: pointer;\n width: 78px;\n height: 30px;\n top: auto;\n bottom: 136px;\n left: 546px;\n background-color: var(--ok-button);\n font-size: 18px;\n line-height: 24px;\n font-weight: normal;\n display: block;\n left: 144px;\n height: 60px;\n /* bottom: 104px; */\n color: white;\n background-color: var(--double-letter-color);\n visibility: hidden;\n }\n div.player {\n display: inline-block;\n height: 36px;\n font-size: 16px;\n line-height: 24px;\n width: 100%;\n padding-left: 0;\n padding-right: 0;\n }\n div.gamestats div.player {\n padding: 0;\n display: inline-block;\n width: auto;\n }\n div.gamestats div.player div.robot-btn {\n display: inline;\n position: relative;\n line-height: 34px;\n top: 0px;\n }\n div.gamestats div.player div.robot-btn.left {\n padding-left: 12px;\n }\n div.gamestats div.player div.robot-btn.right {\n padding-right: 12px;\n }\n div.gamestats div.player.humancolor {\n color: white;\n }\n div.scorewrapper {\n background-color: #aad1d4;\n min-height: 32px;\n }\n div.scoreleft {\n position: relative;\n width: 144px;\n padding-left: 6px;\n height: auto;\n top: auto;\n left: auto;\n font-size: 24px;\n line-height: 32px;\n font-weight: 700;\n color: white;\n }\n div.scoreright {\n position: relative;\n width: 144px;\n height: auto;\n top: auto;\n left: auto;\n font-size: 24px;\n line-height: 32px;\n font-weight: 700;\n color: white;\n }\n div.player-btn {\n position: relative;\n margin-top: 4px;\n padding-top: 4px;\n width: auto;\n color: white;\n cursor: pointer;\n }\n div.player-btn:hover {\n background-color: white;\n color: black;\n }\n div.player-btn.left {\n padding-left: 2px;\n padding-right: 2px;\n }\n div.player-btn.right {\n padding-left: 2px;\n padding-right: 6px;\n }\n div.robot-btn {\n position: relative;\n margin-top: 4px;\n padding-top: 4px;\n width: auto;\n }\n div.robot-btn.left {\n padding-left: 6px;\n padding-right: 2px;\n }\n div.robot-btn.right {\n padding-left: 2px;\n padding-right: 4px;\n }\n div.gamestats div.robot-btn {\n width: 100%;\n }\n div.loginform-large {\n display: block;\n }\n div.loginform-small {\n display: none;\n }\n div.login-logo {\n margin-top: 16px;\n margin-left: auto;\n }\n div.login-legend {\n margin-left: 58px;\n margin-top: auto;\n height: 160px;\n }\n div.welcome {\n margin-left: 100px;\n }\n div.loginhdr {\n font-size: 34px;\n font-weight: 700;\n padding-top: 12px;\n padding-bottom: 24px;\n text-align: left;\n }\n div#board-pic {\n text-align: left;\n float: left;\n padding-right: 24px;\n padding-top: 0;\n padding-bottom: 0;\n }\n div.blurb {\n font-size: 22px;\n font-weight: bold;\n padding-bottom: 22px;\n text-align: left;\n }\n div.right-tab {\n display: block;\n height: 38px;\n min-height: 38px;\n width: 38px;\n min-width: 38px;\n top: auto;\n text-align: left;\n padding-top: 14px;\n padding-left: 10px;\n font-size: 20px;\n line-height: 20px;\n z-index: 2;\n box-shadow: none;\n }\n div.right-tab#tab-board {\n display: none;\n }\n div.right-tab#tab-movelist {\n top: 0;\n left: -40px;\n }\n div.right-tab#tab-twoletter {\n top: 58px;\n left: -40px;\n }\n div.right-tab#tab-games {\n top: 116px;\n left: -40px;\n }\n div.right-tab#tab-chat {\n top: 174px;\n left: -40px;\n }\n div.movelist-container {\n padding-top: 0;\n padding-bottom: 0;\n height: 420px;\n border-radius: 0;\n }\n div.movelist {\n height: 420px;\n }\n div.message {\n display: none;\n }\n div.right-area.with-clock {\n margin-top: 52px;\n }\n div.right-area.with-clock div.movelist-container {\n /* If in a clock game, reduce the movelist height by two lines (2 * 20px) */\n height: 380px;\n }\n div.right-area.with-clock div.movelist {\n /* If in a clock game, reduce the movelist height by two lines (2 * 20px) */\n height: 380px;\n }\n div.right-area.with-clock div.twoletter,\n div.right-area.with-clock div.chat {\n /* Timed game */\n height: 380px;\n }\n h3.clockleft,\n h3.clockright {\n margin-top: 2px;\n margin-bottom: 0;\n }\n div.movelist-container div.bag {\n display: none;\n padding: 4px 28px 0 27px;\n width: auto;\n }\n div.game-timed {\n display: block;\n }\n div#blank-form {\n display: block;\n right: 12px;\n }\n div#blank-form p {\n padding-left: 15px;\n }\n div.blank-rack {\n top: 56px;\n left: auto;\n background-color: transparent;\n }\n div.modal-dialog {\n position: absolute;\n }\n .bottom-message {\n position: absolute;\n text-align: center;\n bottom: 83px;\n left: 84px;\n width: 596px;\n height: 28px;\n font-size: 16px;\n line-height: 24px;\n padding: 4px 0 0;\n margin: 0;\n }\n .bold-bottom-message {\n position: absolute;\n text-align: center;\n bottom: 83px;\n left: 84px;\n width: 596px;\n height: 28px;\n font-size: 16px;\n line-height: 24px;\n padding: 4px 0 0;\n margin: 0;\n font-weight: 700;\n border-radius: 0;\n }\n div.error {\n position: absolute;\n text-align: center;\n bottom: 83px;\n left: 84px;\n width: 596px;\n height: 28px;\n font-size: 16px;\n line-height: 24px;\n padding: 4px 0 0;\n margin: 0;\n font-weight: 700;\n border-radius: 0;\n }\n div.opp-turn {\n position: absolute;\n text-align: center;\n bottom: 83px;\n left: 84px;\n width: 596px;\n height: 28px;\n font-size: 16px;\n line-height: 24px;\n padding: 4px 0 0;\n margin: 0;\n display: block;\n }\n div#congrats {\n position: absolute;\n text-align: center;\n bottom: 83px;\n left: 84px;\n width: 596px;\n height: 28px;\n font-size: 16px;\n line-height: 24px;\n padding: 4px 0 0;\n margin: 0;\n display: block;\n }\n div.resign {\n position: absolute;\n text-align: center;\n bottom: 83px;\n left: 84px;\n width: 596px;\n height: 28px;\n font-size: 16px;\n line-height: 24px;\n padding: 4px 0 0;\n margin: 0;\n font-weight: 700;\n border-radius: 0;\n }\n div.pass {\n position: absolute;\n text-align: center;\n bottom: 83px;\n left: 84px;\n width: 596px;\n height: 28px;\n font-size: 16px;\n line-height: 24px;\n padding: 4px 0 0;\n margin: 0;\n font-weight: 700;\n border-radius: 0;\n }\n div.pass-last {\n position: absolute;\n text-align: center;\n bottom: 83px;\n left: 84px;\n width: 596px;\n height: 28px;\n font-size: 16px;\n line-height: 24px;\n padding: 4px 0 0;\n margin: 0;\n font-weight: 700;\n border-radius: 0;\n }\n div.chall {\n position: absolute;\n text-align: center;\n bottom: 83px;\n left: 84px;\n width: 596px;\n height: 28px;\n font-size: 16px;\n line-height: 24px;\n padding: 4px 0 0;\n margin: 0;\n font-weight: 700;\n border-radius: 0;\n }\n div.chall-info {\n position: absolute;\n text-align: center;\n bottom: 83px;\n left: 84px;\n width: 596px;\n height: 28px;\n font-size: 16px;\n line-height: 24px;\n padding: 4px 0 0;\n margin: 0;\n font-weight: 700;\n border-radius: 0;\n }\n div.exchange {\n position: absolute;\n text-align: center;\n bottom: 83px;\n left: 84px;\n width: 596px;\n height: 28px;\n font-size: 16px;\n line-height: 24px;\n padding: 4px 0 0;\n margin: 0;\n font-weight: 700;\n border-radius: 0;\n }\n div.gameinfo {\n position: absolute;\n text-align: center;\n bottom: 83px;\n left: 84px;\n width: 596px;\n height: 28px;\n font-size: 16px;\n line-height: 24px;\n padding: 4px 0 0;\n margin: 0;\n }\n input.chat-txt {\n width: 218px;\n height: 22px;\n font-size: 15px;\n }\n div.chat-area {\n height: 350px;\n width: 278px;\n }\n div.modal-close#chat-send {\n height: 25px;\n bottom: 0;\n }\n span.statsbutton {\n display: inline;\n text-align: center;\n background-color: white;\n font-size: 16px;\n font-weight: 700;\n color: var(--triple-word-color);\n margin-left: 4px;\n margin-right: 4px;\n padding-top: 2px;\n padding-bottom: 4px;\n padding-left: 12px;\n padding-right: 12px;\n border-radius: 5px;\n cursor: pointer;\n }\n div.toggler {\n display: inline-block;\n }\n div.toggler div.option.small {\n width: 40px;\n height: 26px;\n line-height: 26px;\n font-size: 20px;\n padding-top: 4px;\n padding-bottom: 2px;\n }\n div.toggler div.option.x-small {\n width: 32px;\n }\n div.tabbed-page {\n overflow: hidden;\n left: 110px;\n top: 12px;\n width: 900px;\n height: 673px;\n font-size: 13px;\n line-height: 23px;\n }\n div.help-container img {\n max-width: 640px;\n height: auto;\n }\n div#tabs,\n div#main-tabs {\n padding: 0.2em;\n border: 2px solid var(--tab-background);\n }\n div#tabs {\n background-color: var(--tab-background);\n }\n div#tabs > div[role=tabpanel],\n div#main-tabs > div[role=tabpanel] {\n height: 657px;\n top: 0;\n }\n div.userid {\n display: block;\n }\n .no-mobile-block {\n display: block;\n }\n .no-mobile-inline {\n display: inline;\n }\n .no-mobile-inline-block {\n display: inline-block;\n }\n .no-mobile-list {\n display: list-item;\n }\n .tab-legend {\n font-weight: bold;\n }\n span#numgames,\n span#numchallenges {\n margin-top: 10px;\n }\n div.fairplay {\n top: 41px;\n font-size: 28px;\n line-height: 28px;\n display: block;\n text-indent: 4px;\n }\n span.list-opp {\n width: 290px;\n max-width: 290px;\n }\n span.list-nick,\n span.list-nick-elo,\n div#tabs-3 span.list-nick {\n width: 220px;\n max-width: 220px;\n }\n span.list-fullname-robot {\n width: 486px;\n /* list-fullname + list-human-elo (+6 for margin-right) + list-info-hdr */\n max-width: 486px;\n font-size: 1em;\n }\n span.list-chall {\n width: 315px;\n max-width: 315px;\n }\n span.list-ts,\n span.list-ts-short,\n span.list-info-hdr,\n span.list-info,\n span.list-games,\n span.list-ratio,\n span.list-avgpts,\n span.list-manual,\n span.list-fav,\n span.list-overdue,\n span.list-newbag,\n span.list-duration,\n span.list-rank-no-mobile,\n span.list-elo-no-mobile {\n display: inline-block;\n }\n span.list-tc {\n width: 100px;\n max-width: 100px;\n padding-right: 6px;\n }\n span.list-ch,\n span.list-fav,\n span.list-icon,\n span.list-myturn,\n span.list-overdue {\n font-size: 20px;\n width: 32px;\n max-width: 32px;\n }\n span.list-newbag {\n font-size: 20px;\n width: 32px;\n max-width: 32px;\n }\n span.list-s0 {\n width: 40px;\n max-width: 40px;\n }\n span.list-s1 {\n width: 40px;\n max-width: 40px;\n }\n span.list-scorehdr {\n width: 88px;\n /* list-s0 + list-colon + list-s1 */\n max-width: 88px;\n }\n div#elo-toggler {\n top: 64px;\n bottom: auto;\n left: 272px;\n right: auto;\n }\n div#user-ok,\n div#user-cancel,\n div#user-logout,\n div#user-friend {\n position: absolute;\n }\n div.user-cat span#break {\n display: none;\n }\n div.user-cat#user-headings {\n line-height: 32px;\n }\n div.user-cat#user-search {\n display: block;\n }\n div#chall-form {\n position: absolute;\n padding-top: 12px;\n left: auto;\n right: 300px;\n top: 48px;\n width: 428px;\n height: 618px;\n font-size: 1em;\n }\n div#chall-fairplay {\n margin-top: 15px;\n padding-left: 52px;\n padding-right: 52px;\n }\n div#ready-toggler {\n display: block;\n position: absolute;\n left: 10px;\n top: 440px;\n }\n div#timed-toggler {\n display: block;\n position: absolute;\n left: 10px;\n top: 490px;\n }\n span.caption.wide {\n width: 264px;\n }\n div#chall-ok {\n right: 66px;\n /* 12 + 54 */\n }\n div#chall-cancel {\n right: 162px;\n /* 12 + 72 + 12 + 12 + 54 */\n }\n span.mobile-break,\n span.mobile-space {\n display: none;\n }\n div#user-load {\n top: 320px;\n left: 406px;\n width: 48px;\n height: 48px;\n background-size: 48px 48px;\n }\n div#spinner-dialog div#user-load {\n top: 360px;\n left: 488px;\n width: 48px;\n height: 48px;\n background-size: 48px 48px;\n }\n div.animated-spinner {\n left: 472px;\n top: 272px;\n }\n div#promo-form {\n left: auto;\n top: 60px;\n right: 48px;\n width: 812px;\n height: 628px;\n line-height: 1.62em;\n }\n div.promo-content {\n margin-top: 32px;\n margin-left: 48px;\n margin-right: 48px;\n }\n div.promo-fullscreen {\n display: block;\n }\n div.promo-mobile {\n display: none;\n }\n div.btn-promo-no {\n width: 160px;\n height: 28px;\n bottom: 48px;\n right: 48px;\n top: auto;\n background-color: var(--light-shadow);\n }\n div.challenge {\n width: 48px;\n height: 48px;\n top: auto;\n bottom: 212px;\n left: 646px;\n text-align: center;\n font-size: 26px;\n line-height: 48px;\n font-weight: 700;\n color: white;\n background-color: var(--triple-letter-color);\n padding: 0;\n border: 0px;\n cursor: pointer;\n }\n div.over {\n outline: var(--focus-border) solid 3px;\n }\n span.over {\n outline: var(--focus-border) solid 3px;\n }\n div #userlist,\n div #gamelist,\n div #elolist {\n height: 504px;\n /* 14 lines @ 36px each */\n }\n div #recentlist {\n height: 432px;\n /* 12 lines @ 36px each */\n }\n div #usr-recent {\n height: 432px;\n /* 12 lines @ 36px each */\n }\n div #chall-sent,\n div #chall-received {\n height: 216px;\n /* 6 lines @ 36px each */\n }\n span.list-win {\n width: 32px;\n max-width: 32px;\n margin-left: 2px;\n }\n div.games {\n height: 100%;\n padding: 0px;\n }\n div.games-item {\n margin-left: 4px;\n margin-right: 4px;\n }\n div#wait-form {\n position: absolute;\n padding-left: 12px;\n padding-right: 12px;\n padding-top: 6px;\n padding-bottom: 6px;\n box-shadow: 3px 3px 5px 2px var(--dark-shadow);\n font-size: 1em;\n z-index: 20;\n background-color: var(--container-bg-color);\n top: 160px;\n padding-top: 16px;\n left: auto;\n right: 202px;\n width: 504px;\n height: 400px;\n }\n div#accept-form {\n top: 220px;\n right: 300px;\n width: 428px;\n height: 292px;\n padding-top: 12px;\n /* Override */\n }\n span.left-to-move,\n span.right-to-move {\n position: relative;\n top: 2px;\n font-family: 'Glyphicons Regular';\n font-style: normal;\n font-weight: normal;\n color: var(--triple-word-color);\n padding-right: 4px;\n }\n /* Show red flag by the id of the player whose move it is */\n div.player-btn.tomove span.left-to-move:before {\n content: \"\\E267\";\n }\n div.player-btn.tomove span.right-to-move:before {\n content: \"\\E267\";\n }\n div.hint {\n top: 180px;\n margin-left: 60px;\n margin-right: 160px;\n font-size: inherit;\n }\n div.stats-box {\n width: auto;\n position: static;\n top: auto;\n left: auto;\n }\n div.stats-fig {\n width: 80px;\n height: 27px;\n padding: 6px;\n border-radius: 5px;\n border-width: 2px;\n font-size: 20px;\n line-height: 20px;\n margin-top: 4px;\n margin-right: 8px;\n margin-left: 8px;\n }\n div#own-toggler {\n position: relative;\n margin-top: 7px;\n margin-right: 8px;\n top: auto;\n }\n p#own-best {\n left: auto;\n right: 30px;\n top: 26px;\n font-size: 1em;\n }\n div#own-stats {\n margin-top: 16px;\n margin-bottom: 24px;\n height: 48px;\n }\n div.help-container {\n width: 828px;\n height: 612px;\n overflow: auto;\n padding-right: 24px;\n }\n div.twoletter-area {\n font-size: 16px;\n line-height: 23px;\n }\n div.twoletter-area.with-clock {\n font-size: 15px;\n line-height: 24px;\n margin-top: 3px;\n }\n div.twoletter-word {\n padding-right: 3px;\n }\n}\n");const qg={projectId:"netskrafl",firebaseAPIKey:"",databaseURL:"",firebaseSenderId:"",firebaseAppId:"",measurementId:"",userEmail:"",userId:"",userNick:"",userFullname:"",locale:"is_IS",isExplo:!1,serverUrl:"",movesUrl:"",movesAccessKey:"",token:"",loginUrl:"",loginMethod:"",newUser:!1,beginner:!1,fairPlay:!0,plan:"",hasPaid:!1,ready:!1,readyTimed:!1,uiFullscreen:!0,uiLandscape:!1,runningLocal:!1},Bg=G.memo((({state:e,tokenExpired:t})=>{const n=G.createRef(),i={...qg,...e},{userEmail:o}=i;return G.useEffect((()=>{var e;if(!o)return;const r=n.current;if(!r)return;const s=`netskrafl-user-${o}`;if((null===(e=r.firstElementChild)||void 0===e?void 0:e.id)!==s){try{(async(e,t)=>{const{userEmail:n}=e;if(!n)throw new Error("No user specified for Netskrafl UI");const i=`netskrafl-user-${n}`,o=document.getElementById(i);if(o)return o;const r=document.createElement("div");r.id=i,r.className="netskrafl-loading",document.body.appendChild(r);const s=await zg(e,r);if("success"===s)return r.className="netskrafl-user",r;if("expired"===s)return r.className="netskrafl-expired",t&&t(),r;throw new Error("Failed to mount Netskrafl UI")})(i,t).then((e=>{const t=n.current;t&&(t.innerHTML="",t.appendChild(e))}))}catch(e){const t=document.getElementById("netskrafl-container");t&&(t.innerHTML="")}return()=>{const e=document.getElementById("netskrafl-container"),t=null==e?void 0:e.firstElementChild;(null==t?void 0:t.id)===s&&document.body.appendChild(t)}}}),[o]),W.jsx("div",{className:"netskrafl",children:W.jsx("div",{className:"netskrafl-container",id:"netskrafl-container",ref:n})})}));exports.Netskrafl=Bg;
|
|
3045
|
+
*/(n,...e)}return n}async function Gu(e,t,n){if(Uu||function(e){try{const t=e.projectId,n={projectId:t,apiKey:e.firebaseAPIKey,authDomain:`${t}.firebaseapp.com`,databaseURL:e.databaseURL,storageBucket:`${t}.firebasestorage.app`,messagingSenderId:e.firebaseSenderId,appId:e.firebaseAppId,measurementId:e.measurementId};Uu=ai(n,"netskrafl"),Uu||console.error("Failed to initialize Firebase")}catch(e){console.error("Failed to initialize Firebase",e)}}(e),!Uu)return;const i=e.userId,o=e.locale;ju=xa(Uu),ju?function(e,t,n,i){Ht(e).onAuthStateChanged(t,n,i)}(ju,(t=>{null!==t&&(e.newUser&&Ju("sign_up",{locale:e.locale,method:e.loginMethod,userid:e.userId}),Ju("login",{locale:e.locale,method:e.loginMethod,userid:e.userId}))})):console.error("Failed to initialize Firebase Auth"),await ds(ju,t),Vu=Wu(Uu),Vu||console.error("Failed to initialize Firebase Database"),qu=No(Uu),qu||console.error("Failed to initialize Firebase Analytics"),function(e,t,n){if(!Vu)return;const i=Nu(Vu,".info/connected"),o="netskrafl"===e?`connection/${t}`:`connection/${n}/${t}`,r=function(e,t){e=Ht(e),$h("push",e._path),Vh("push",t,e._path,!0);const n=tu(e._repo),i=Cu(n),o=Au(e,i),r=Au(e,i);let s;return s=Promise.resolve(r),o.then=s.then.bind(s),o.catch=s.then.bind(s,void 0),o}(Nu(Vu,o));Fu(i,(e=>{e.val()?(function(e){return e=Ht(e),new Eu(e._repo,e._path)}(r).remove(),Du(r,!0)):function(e){$h("remove",e._path),Du(e,null)}(r)}))}(e.projectId,i,o)}function Ku(e,t){if(!Vu)return;let n=0;Fu(Nu(Vu,e),(function(e){n++;const i=e.val();i&&t(i,1==n)}))}function Yu(e){if(!Vu)return;const t=Nu(Vu,e);var n;cu((n=t)._repo,n,null)}function Ju(e,t){qu&&Ao(qu,e,t)}$l.prototype.simpleListen=function(e,t){this.sendRequest("q",{p:e},t)},$l.prototype.echo=function(e,t){this.sendRequest("echo",{d:e},t)},function(e){!function(e){Ia=e}(si),ti(new $t("database",((e,{instanceIdentifier:t})=>Hu(e.getProvider("app").getImmediate(),e.getProvider("auth-internal"),e.getProvider("app-check-internal"),t)),"PUBLIC").setMultipleInstances(!0)),ci(ka,Ca,e),ci(ka,Ca,"esm2017")}();const Zu=new class{constructor(){this.wordCheckCache={}}ingestTwoLetterWords(e,t){var n;const i=null!==(n=this.wordCheckCache[e])&&void 0!==n?n:this.wordCheckCache[e]={};for(const[,e]of t)for(const t of e)i[t]=!0}async checkWords(e,t){let n=this.wordCheckCache[e];if(n){let e=!0;for(const i of t){if(void 0===n[i]){if(2===i.length)return!1;e=!1;break}if(!1===n[i])return!1}if(e)return!0}try{const i=await we({url:"/wordcheck",body:{locale:e,word:t[0],words:t}});if((null==i?void 0:i.word)===t[0]&&(null==i?void 0:i.valid)){n||(n=this.wordCheckCache[e]={});for(const[e,t]of i.valid)n[e]=t}return!!i.ok}catch(e){}return!1}};let Qu=null;class Xu{constructor(e){this._prefix=`game.${e}`}getLocalTile(e){return window.localStorage[`${this._prefix}.tile.${e}.t`]}getLocalTileSq(e){return window.localStorage[`${this._prefix}.tile.${e}.sq`]}setLocalTile(e,t){window.localStorage[`${this._prefix}.tile.${e}.t`]=t}setLocalTileSq(e,t){window.localStorage[`${this._prefix}.tile.${e}.sq`]=t}clearTiles(){try{const e=window.localStorage;for(let t=1;t<=7;t++)e.removeItem(`${this._prefix}.tile.${t}.sq`),e.removeItem(`${this._prefix}.tile.${t}.t`)}catch(e){}}saveTiles(e){let t;for(t=0;t<e.length;t++){const n=e[t].sq,i=e[t].tile;this.setLocalTileSq(t+1,n),this.setLocalTile(t+1,i)}for(;t<7;t++)this.setLocalTileSq(t+1,""),this.setLocalTile(t+1,"")}loadTiles(){let e,t,n=[];for(let i=0;i<7;i++)e=this.getLocalTileSq(i+1),t=this.getLocalTile(i+1),e&&t&&n.push({sq:e,tile:t});return n}}class ep{constructor(){}getLocalTile(e){return""}getLocalTileSq(e){return""}setLocalTile(e,t){}setLocalTileSq(e,t){}clearTiles(){}saveTiles(e){}loadTiles(){return[]}}const tp=e=>function(){if(null===Qu)try{Qu="localStorage"in window&&null!==window.localStorage&&void 0!==window.localStorage}catch(e){Qu=!1}return Qu}()?new Xu(e):new ep,np={explo:"D4",standard:"H8"},ip={explo:[3,3],standard:[7,7]},op={standard:{WORDSCORE:["3 3 3"," 2 2 "," 2 2 "," 2 2 "," 2 2 "," "," ","3 2 3"," "," "," 2 2 "," 2 2 "," 2 2 "," 2 2 ","3 3 3"],LETTERSCORE:[" 2 2 "," 3 3 "," 2 2 ","2 2 2"," "," 3 3 3 3 "," 2 2 2 2 "," 2 2 "," 2 2 2 2 "," 3 3 3 3 "," ","2 2 2"," 2 2 "," 3 3 "," 2 2 "]},explo:{WORDSCORE:["3 3 3"," 2 "," 2 "," 2 "," 2 "," 2 2 "," 2 2 ","3 2 3"," 2 2 "," 2 2 "," 2 "," 2 "," 2 "," 2 ","3 3 3"],LETTERSCORE:[" 2 2 "," 3 2 3 "," 2 3 2 "," 2 3 2","2 3 "," 2 2 "," 3 2 "," 2 2 "," 2 3 "," 2 2 "," 3 2","2 3 2 "," 2 3 2 "," 3 2 3 "," 2 2 "]}};class rp{constructor(e,t,n,i){this.locale="is_IS",this.alphabet="",this.tile_scores={},this.board_type="standard",this.startSquare="H8",this.startCoord=[7,7],this.two_letter_words=[[],[]],this.userid=["",""],this.nickname=["",""],this.fullname=["",""],this.autoplayer=[!1,!1],this.maxOvertime=600,this.scores=[0,0],this.moves=[],this.newmoves=[],this.lastmove=void 0,this.tiles={},this.rack=[],this.racks=[],this.num_moves=0,this.bag="",this.newbag=!0,this.localturn=!1,this.player=null,this.stats=null,this.over=!1,this.manual=!1,this.fairplay=!1,this.zombie=!1,this.overdue=!1,this.currentScore=void 0,this.messages=null,this.wordBad=!1,this.wordGood=!1,this.xchg=!1,this.chall=!1,this.last_chall=!1,this.succ_chall=!1,this.showingDialog=null,this.moveInProgress=!1,this.askingForBlank=null,this.currentError=null,this.currentMessage=null,this.isFresh=!1,this.numTileMoves=0,this.chatLoading=!1,this.chatSeen=!0,this.congratulate=!1,this.selectedSq=null,this.sel="movelist",this.interval=null,this.time_info=null,this.penalty0=0,this.penalty1=0,this.timeBase=null,this.runningOut0=!1,this.runningOut1=!1,this.blinking0=!1,this.blinking1=!1,this.clockText0="",this.clockText1="",this.localStorage=null,this.uuid=e,this.moveListener=n,void 0!==i&&(this.maxOvertime=i),this.localStorage=tp(e);let o=this.localStorage.loadTiles();this.init(t),this.restoreTiles(o),!this.over&&this.isTimed()&&this.startClock(),this.autoplayer[0]||this.autoplayer[1]||this.loadMessages()}init(e){if(this.over=99===e.result,!this.over&&0!==e.result)return this.currentError=e.result||"server",void(this.currentMessage=e.msg||"");this.currentError=this.currentMessage=null,Object.assign(this,e),e.newmoves&&(this.moves=this.moves.concat(e.newmoves)),this.newmoves=[],this.localturn=!this.over&&this.moves.length%2===this.player,this.isFresh=!0,this.startSquare=np[this.board_type],this.startCoord=ip[this.board_type],this.congratulate=this.over&&null!==this.player&&this.scores[this.player]>this.scores[1-this.player],null===this.currentError&&this.placeTiles(),Zu.ingestTwoLetterWords(this.locale,this.two_letter_words[0])}update(e){for(let e in this.tiles)this.tiles.hasOwnProperty(e)&&(this.tiles[e].freshtile=!1);this.init(e),null===this.currentError&&(this.succ_chall?this.resetRack():this.updateScore()),this.saveTiles(),this.isTimed()&&this.resetClock()}async refresh(){try{if(!this.uuid)return;const e=await be({method:"POST",url:"/gamestate",body:{game:this.uuid}});(null==e?void 0:e.ok)&&this.update(e.game)}catch(e){}finally{this.moveInProgress=!1}}notifyUserChange(e){null!==this.player&&(this.nickname[this.player]=e)}buttonState(){let e={};return e.tilesPlaced=this.tilesPlaced().length>0,e.gameOver=this.over,e.congratulate=this.congratulate,e.localTurn=this.localturn,e.gameIsManual=this.manual,e.challengeAllowed=this.chall,e.lastChallenge=this.last_chall,e.showingDialog=null!==this.showingDialog,e.exchangeAllowed=this.xchg,e.wordGood=this.wordGood,e.wordBad=this.wordBad,e.canPlay=!1,e.tardyOpponent=!e.localTurn&&!e.gameOver&&this.overdue,e.showResign=!1,e.showExchange=!1,e.showPass=!1,e.showRecall=!1,e.showScramble=!1,e.showMove=!1,e.showMoveMobile=!1,e.showForceResignMobile=!1,e.showChallenge=!1,e.showChallengeInfo=!1,this.moveInProgress||(e.localTurn&&!e.gameOver&&(e.lastChallenge?(e.showChallenge=!0,e.showPass=!0,e.showChallengeInfo=!0):(e.showMove=e.tilesPlaced,e.showExchange=!e.tilesPlaced,e.showPass=!e.tilesPlaced,e.showResign=!e.tilesPlaced,e.showChallenge=!e.tilesPlaced&&e.gameIsManual&&e.challengeAllowed)),e.showMove&&(e.wordGood||e.gameIsManual)&&(e.canPlay=!0),e.gameOver||(e.tilesPlaced?(e.showRecall=!0,e.showMoveMobile=!0):(e.showScramble=!0,e.tardyOpponent&&(e.showForceResignMobile=!0)))),e}setSelectedTab(e){return this.sel!=e&&(this.sel=e,!0)}tilescore(e){return this.tile_scores[e]}twoLetterWords(){return this.two_letter_words}isTimed(){return null!==this.time_info&&this.time_info.duration>=1}showClock(){return!!this.isTimed()&&(!this.over||(!!this.clockText0||!!this.clockText1))}updateClock(){var e=this.calcTimeToGo(0),t=this.calcTimeToGo(1);this.clockText0=e,this.clockText1=t,this.runningOut0="-"==e[0]||e<="02:00",this.runningOut1="-"==t[0]||t<="02:00",this.blinking0=this.runningOut0&&e>="00:00"&&e<="00:30"&&0===this.player,this.blinking1=this.runningOut1&&t>="00:00"&&t<="00:30"&&1===this.player,pe.redraw()}resetClock(){this.timeBase=new Date,this.updateClock(),this.over&&(this.interval&&(window.clearInterval(this.interval),this.interval=null),this.blinking0=!1,this.blinking1=!1,this.runningOut0=!1,this.runningOut1=!1)}startClock(){this.resetClock(),this.interval||(this.interval=window.setInterval((()=>{this.updateClock()}),500))}cleanup(){this.interval&&(window.clearInterval(this.interval),this.interval=null)}calcTimeToGo(e){let t=this.time_info;if(null===t||null===this.timeBase)return"";let n=t.elapsed[e],i=this.over;if(!i&&this.moves.length%2===e){n+=((new Date).getTime()-this.timeBase.getTime())/1e3,n-60*t.duration>this.maxOvertime&&(this.moveInProgress||(this.moveInProgress=!0,window.setTimeout((()=>{this.refresh()}),500)))}const o=Math.max(60*t.duration-n,-this.maxOvertime),r=Math.abs(o),s=Math.floor(r/60),a=Math.floor(r-60*s);return i?(this.penalty0=0,this.penalty1=0):o<0&&(0===e?this.penalty0=-10*Math.floor((60*s+a+59)/60):this.penalty1=-10*Math.floor((60*s+a+59)/60)),(o<0?"-":"")+("0"+s.toString()).slice(-2)+":"+("0"+a.toString()).slice(-2)}displayScore(e){return Math.max(this.scores[e]+(0===e?this.penalty0:this.penalty1),0)}async loadMessages(){if(!this.chatLoading){this.chatLoading=!0,this.messages=[];try{const e=await be({method:"POST",url:"/chatload",body:{channel:"game:"+this.uuid}});e.ok?this.messages=e.messages||[]:this.messages=[],void 0===e.seen?this.chatSeen=!0:this.chatSeen=e.seen}catch(e){}finally{this.chatLoading=!1}}}async loadStats(){this.stats=void 0;try{const e=await be({method:"POST",url:"/gamestats",body:{game:this.uuid}});if(!e||void 0===e.result)return;if(0!==e.result&&99!==e.result)return;this.stats=e}catch(e){}}async sendMessage(e){try{await be({method:"POST",url:"/chatmsg",body:{channel:"game:"+this.uuid,msg:e}})}catch(e){}}sendChatSeenMarker(){this.sendMessage(""),this.chatSeen=!0}addChatMessage(e,t,n,i){this.chatLoading||""===t||(null===this.messages&&(this.messages=[]),this.messages.push({from_userid:e,msg:t,ts:n}),"chat"==this.sel?this.sendChatSeenMarker():i||(this.chatSeen=!1))}markChatShown(){return!this.chatSeen&&(this.sendChatSeenMarker(),!0)}placeMove(e,t,n,i){const o=Qe(t);let r=o.col,s=o.row,a=!1,l=0;for(let t=0;t<n.length;t++){let c=n[t];if("?"==c){a=!0;continue}const d=Ze(s,r);if(null===d)continue;let h=c;a&&(c="?");const u=this.tilescore(c);d in this.tiles||(this.tiles[d]={player:e,tile:c,letter:h,score:u,draggable:!1,freshtile:!1,index:l,xchg:!1},i&&(e===this.player?this.tiles[d].highlight=0:1-e===this.player&&(this.tiles[d].highlight=1),l++)),r+=o.dx,s+=o.dy,a=!1}}setRack(e){this.rack=e}rackAtMove(e){var t;const n=(null===(t=this.racks)||void 0===t?void 0:t.length)||0;return n?this.racks[e>=n?n-1:e]:""}isFinalMove(e){return e>=this.num_moves}boardAsStrings(){const e=[];for(const t of Re){let n="";for(let e=0;e<15;e++){let i=`${t}${e+1}`;if(i in this.tiles){const{tile:e,letter:t}=this.tiles[i];n+="?"===e?t.toLocaleUpperCase():t}else n+="."}e.push(n)}return e}placeTiles(e,t){this.tiles={},this.numTileMoves=0;const n=this.moves,i=void 0!==e,o=!i&&!this.lastmove&&this.localturn,r=!t&&(o||i),s=void 0!==e?e:n.length;function a(e){if(e+2>=s)return!1;let[t,[i,o,r]]=n[e+2];return""===i&&("RESP"===o&&r<0)}for(let e=0;e<s;e++){let[t,[i,o]]=n[e];""==i||a(e)||(this.placeMove(t,i,o,e===s-1&&r),this.numTileMoves++)}let l=this.lastmove;if(l&&this.localturn)for(let e=0;e<l.length;e++){let t=l[e][0];if(!(t in this.tiles))throw"Tile from lastmove not in square "+t;this.tiles[t].freshtile=!0,this.tiles[t].index=e}for(let e=0;e<this.rack.length;e++){const t="R"+(e+1),[n,i]=this.rack[e],o="?"===n?" ":n;this.tiles[t]={player:this.player?1:0,tile:n,letter:o,score:i,draggable:!0,freshtile:!1,index:0,xchg:!1}}}_moveTile(e,t){if(e==t)return;let n=this.tiles[e];if(void 0===n)throw"Moving from an empty square";if(delete this.tiles[e],t in this.tiles){if("R"!=t.charAt(0))throw"Dropping to an occupied square";let e=parseInt(t.slice(1)),n=e+1;for(;"R"+n in this.tiles;)n++;if(n<=7)for(let t=n;t>e;t--)this.tiles["R"+t]=this.tiles["R"+(t-1)];else{for(n=e-1;"R"+n in this.tiles;)n--;if(n<1)throw"No place in rack to drop tile";for(let t=n;t<e;t++)this.tiles["R"+t]=this.tiles["R"+(t+1)]}}"R"==t[0]&&"?"==n.tile&&(n.letter=" "),this.tiles[t]=n}moveTile(e,t){this._moveTile(e,t),this.currentError=this.currentMessage=null,this.updateScore(),this.saveTiles()}attemptMove(e,t){if(t==e)return;if(t in this.tiles&&"R"!=t[0])throw"Square "+t+" occupied";if(!(e in this.tiles))throw"No tile at "+e;const n=this.tiles[e];"R"==t[0]||"?"!=n.tile||" "!=n.letter?this.moveTile(e,t):this.askingForBlank={from:e,to:t}}cancelBlankDialog(){this.askingForBlank=null}placeBlank(e){if(null===this.askingForBlank)return;const{from:t,to:n}=this.askingForBlank;this.tiles[t].letter=e,this.moveTile(t,n),this.askingForBlank=null}tilesPlaced(){const e=[];for(let t in this.tiles)this.tiles.hasOwnProperty(t)&&"R"!=t[0]&&this.tiles[t].draggable&&e.push(t);return e}async sendMove(e){this.moveInProgress=!0;try{const t=await be({method:"POST",url:"/submitmove",body:{moves:e,mcount:this.moves.length,uuid:this.uuid}});this.update(t),this.moveListener&&this.moveListener.notifyMove()}catch(e){this.currentError="server",e instanceof Error?this.currentMessage=e.message:this.currentMessage=String(e)}finally{this.moveInProgress=!1}}async forceResign(){this.moveInProgress=!0;try{const e=await be({method:"POST",url:"/forceresign",body:{mcount:this.moves.length,game:this.uuid}});this.update(e)}catch(e){this.currentError="server",e instanceof Error?this.currentMessage=e.message:this.currentMessage=String(e)}finally{this.moveInProgress=!1}}submitMove(){const e=this.tilesPlaced();let t=[];this.selectedSq=null;for(let n=0;n<e.length;n++){const i=e[n],{tile:o,letter:r}=this.tiles[i];t.push(i+"="+o+("?"===o?r:""))}t.length>0&&this.sendMove(t)}submitPass(){this.showingDialog="pass",this.selectedSq=null}submitChallenge(){this.showingDialog="chall",this.selectedSq=null}submitExchange(){this.showingDialog="exchange",this.selectedSq=null;for(let e=1;e<=7;e++){const t="R"+e;t in this.tiles&&(this.tiles[t].xchg=!1)}}submitResign(){this.showingDialog="resign",this.selectedSq=null}confirmPass(e){this.showingDialog=null,e&&this.sendMove(["pass"])}confirmChallenge(e){this.showingDialog=null,e&&this.sendMove(["chall"])}confirmExchange(e){let t="";this.showingDialog=null;for(let e=1;e<=7;e++){const n="R"+e;n in this.tiles&&this.tiles[n].xchg&&(t+=this.tiles[n].tile,this.tiles[n].xchg=!1)}e&&t.length>0&&this.sendMove(["exch="+t])}confirmResign(e){this.showingDialog=null,e&&this.sendMove(["rsgn"])}rescrambleRack(){if(this.selectedSq=null,null!==this.showingDialog)return;this._resetRack();const e=[];for(let t=1;t<=7;t++){const n="R"+t;n in this.tiles?e.push(this.tiles[n]):e.push(null)}let t=e.length;for(;0!==t;){const n=Math.floor(Math.random()*t);t-=1;const i=e[t];e[t]=e[n],e[n]=i}let n=0;for(let t=1;t<=7;t++){const i=e[t-1];null!==i?this.tiles["R"+(t-n)]=i:(delete this.tiles["R"+(7-n)],n++)}this.saveTiles()}saveTiles(){var e;let t=[];const n=this.tilesPlaced();for(const e of n){const{tile:n,letter:i}=this.tiles[e];t.push({sq:e,tile:"?"===n?n+i:n})}for(let e=1;e<=7;e++){const n=`R${e}`;n in this.tiles&&t.push({sq:n,tile:this.tiles[n].tile})}null===(e=this.localStorage)||void 0===e||e.saveTiles(t)}restoreTiles(e){if(!e.length)return;let t=[],n=[],i={};for(let n=0;n<e.length;n++)t.push(e[n].tile.charAt(0));for(let e=1;e<=7;e++)"R"+e in this.tiles&&n.push(this.tiles["R"+e].tile.charAt(0));if(t.sort(),n.sort(),!function(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0}(t,n))return;for(let e=1;e<=7;e++)"R"+e in this.tiles&&(i["R"+e]=this.tiles["R"+e],delete this.tiles["R"+e]);for(let t=0;t<e.length;t++){const n=e[t].sq;if(!(n in this.tiles)){const o=e[t].tile;for(let e in i)if(i.hasOwnProperty(e)&&i[e].tile==o.charAt(0)){"?"===o.charAt(0)&&("R"===n.charAt(0)?i[e].letter=" ":i[e].letter=o.charAt(1)),this.tiles[n]=i[e],delete i[e];break}}}let o=1;for(let e in i)if(i.hasOwnProperty(e)){for(;"R"+o in this.tiles;)o++;o<=7&&(this.tiles["R"+o]=i[e])}this.saveTiles(),this.updateScore()}_resetRack(){const e=this.tilesPlaced();if(e.length){let t=1;for(let n=0;n<e.length;n++){for(;"R"+t in this.tiles;)t++;const i="R"+t;this.tiles[i]=this.tiles[e[n]],delete this.tiles[e[n]],"?"===this.tiles[i].tile&&(this.tiles[i].letter=" "),t++}this.updateScore()}this.currentError=null}resetError(){this.currentError=this.currentMessage=null}resetRack(){this.selectedSq=null,this._resetRack(),this.saveTiles()}async updateScore(){const e=this.calcScore();if(this.wordGood=!1,this.wordBad=!1,void 0!==e&&e.word){if(this.currentScore=e.score,!this.manual){const t=await Zu.checkWords(this.locale,e.words);this.wordGood=t,this.wordBad=!t}}else this.currentScore=void 0}wordScore(e,t){const n=op[this.board_type].WORDSCORE;return parseInt(n[e].charAt(t))||1}letterScore(e,t){const n=op[this.board_type].LETTERSCORE;return parseInt(n[e].charAt(t))||1}squareType(e,t){const n=this.wordScore(e,t);if(2===n)return"dw";if(3===n)return"tw";const i=this.letterScore(e,t);return 2===i?"dl":3===i?"tl":""}squareClass(e){if(!e||"R"===e[0])return;const{row:t,col:n}=Qe(e);return this.squareType(t,n)||void 0}tileAt(e,t){const n=Ze(e,t);return n&&this.tiles[n]||null}calcScore(){let e=0,t=0,n=1,i=15,o=15,r=0,s=0,a=0,l=0,c="",d=[];if(this.tilesPlaced().forEach((t=>{const l=Re.indexOf(t.charAt(0)),c=parseInt(t.slice(1))-1,d=this.tiles[t];e+=d.score*this.letterScore(l,c),a++,n*=this.wordScore(l,c),l<i&&(i=l),c<o&&(o=c),l>r&&(r=l),c>s&&(s=c)})),!a)return;if(i!==r&&o!==s)return;let h,u=o,p=i,g=0,f=0;for(i!==r?f=1:o!==s||null===this.tileAt(i-1,o)&&null===this.tileAt(i+1,o)?g=1:f=1;null!==this.tileAt(p-f,u-g);)u-=g,p-=f;for(;null!==(h=this.tileAt(p,u));){if(h.draggable){const e=this.calcCrossScore(p,u,1-f,1-g);e.score>=0&&(t+=e.score,l++,d.push(e.word))}else e+=h.score,l++;c+=h.letter,u+=g,p+=f}if(0===this.numTileMoves){const e=this.startCoord;if(null===this.tileAt(e[0],e[1]))return}else if(!l)return;return g&&u<=s||f&&p<=r?void 0:(d.push(c),{word:c,words:d,score:e*n+t+(7===a?50:0)})}calcCrossScore(e,t,n,i){let o,r=0,s=!1,a=t,l=e,c="";for(;null!==this.tileAt(l-n,a-i);)a-=i,l-=n;for(;null!==(o=this.tileAt(l,a));){let d=o.score;a===t&&l===e?d*=this.letterScore(l,a):s=!0,c+=o.letter,r+=d,a+=i,l+=n}return s?{score:r*this.wordScore(e,t),word:c}:{score:-1,word:""}}}class sp{constructor(e,t){this.state=null,this.paths=[],this.routeName=void 0,this.params=void 0,this.game=null,this.gameList=null,this.numGames=0,this.loadingGameList=!1,this.challengeList=null,this.numChallenges=0,this.loadingChallengeList=!1,this.oppReady=0,this.recentList=null,this.loadingRecentList=!1,this.userListCriteria=null,this.userList=null,this.loadingUserList=!1,this.eloRatingList=null,this.eloRatingSpec=null,this.ownStats=null,this.user=null,this.userErrors=null,this.userLoadError=!1,this.helpHTML=null,this.friendHTML=null,this.spinners=0,this.reviewMove=null,this.bestMoves=null,this.highlightedMove=null,this.maxFreeGames=0,this.isExplo=!1,this.paths=e.paths.slice(),this.state=t,this.isExplo=t.isExplo,this.maxFreeGames=t.isExplo?3:8,async function(e){try{Se(e,await be({method:"GET",url:"/static/assets/messages.json"}))}catch(t){Se(e,{})}}(t.locale)}async loadGame(e,t,n=!1){var i,o;try{if(null!==this.game&&this.game.cleanup(),this.game=null,this.reviewMove=null,this.bestMoves=null,this.highlightedMove=null,!e)return;const r=await be({method:"POST",url:"/gamestate",body:{game:e,delete_zombie:n}});(null==r?void 0:r.ok)&&(this.game=new rp(e,r.game,this,(null===(i=this.state)||void 0===i?void 0:i.runningLocal)?60:600),void 0!==t&&t(),(null===(o=this.state)||void 0===o?void 0:o.uiFullscreen)||this.game.setSelectedTab("board"))}catch(e){}}async loadGameList(e=!0){if(!this.loadingGameList){this.loadingGameList=!0,this.gameList=[],this.numGames=0,this.spinners++;try{const t=await be({method:"POST",url:"/gamelist",body:{zombie:e}});if(!t||0!==t.result)return void(this.gameList=[]);this.gameList=t.gamelist||[],this.gameList&&(this.numGames=this.gameList.reduce(((e,t)=>e+(t.my_turn||t.zombie?1:0)),0))}catch(e){this.gameList=[]}finally{this.loadingGameList=!1,this.spinners&&this.spinners--}}}async loadChallengeList(){if(!this.loadingChallengeList){this.loadingChallengeList=!0,this.challengeList=[],this.numChallenges=0,this.oppReady=0;try{const e=await be({method:"POST",url:"/challengelist"});if(!e||0!==e.result)return void(this.challengeList=[]);this.challengeList=e.challengelist||[];for(let e of this.challengeList)e.opp_ready&&this.oppReady++;this.numChallenges=this.oppReady,this.challengeList&&(this.numChallenges+=this.challengeList.reduce(((e,t)=>e+(t.received?1:0)),0))}catch(e){this.challengeList=[]}finally{this.loadingChallengeList=!1}}}async loadRecentList(){if(!this.loadingRecentList){this.loadingRecentList=!0,this.recentList=[];try{const e=await be({method:"POST",url:"/recentlist",body:{versus:null,count:40}});if(!e||0!==e.result)return void(this.recentList=[]);this.recentList=e.recentlist||[]}catch(e){this.recentList=[]}finally{this.loadingRecentList=!1}}}async loadUserRecentList(e,t,n){n(await be({method:"POST",url:"/recentlist",body:{user:e,versus:t,count:40}}))}async loadUserList(e,t){if("search"===e.query&&""===e.spec)return this.userList=[],this.userListCriteria=e,void pe.redraw();this.userList=void 0,this.userListCriteria=void 0,t&&this.spinners++;const n=e;try{const t=await be({method:"POST",url:"/userlist",body:n});if(!t||0!==t.result)return this.userList=[],void(this.userListCriteria=e);this.userList=t.userlist,this.userListCriteria=e}catch(t){this.userList=[],this.userListCriteria=e}finally{t&&this.spinners&&this.spinners--}}async loadEloRatingList(e,t){this.eloRatingList=void 0,this.eloRatingSpec=void 0,t&&this.spinners++;const n={kind:e};try{const t=await be({method:"POST",url:"/rating",body:n});if(!t||0!==t.result)return this.eloRatingList=[],void(this.eloRatingSpec=e);this.eloRatingList=t.rating,this.eloRatingSpec=e}catch(t){this.eloRatingList=[],this.eloRatingSpec=e}finally{t&&this.spinners&&this.spinners--}}async loadOwnStats(){this.ownStats={};try{const e=await be({method:"POST",url:"/userstats",body:{}});if(!e||0!==e.result)return;this.ownStats=e}catch(e){}}async loadUserStats(e,t){try{t(await be({method:"POST",url:"/userstats",body:{user:e}}))}catch(e){}}async loadPromoContent(e,t){try{t(await be({method:"POST",url:"/promo",body:{key:e},responseType:"text",deserialize:e=>e}))}catch(e){}}async loadBestMoves(e){if(!this.game||!this.game.uuid)return;if(!e)return this.reviewMove=0,this.bestMoves=null,this.highlightedMove=null,this.game.setRack([]),void this.game.placeTiles(0);const t=this.game.tile_scores,n=this.game.rackAtMove(e-1);if(!n||this.game.isFinalMove(e-1))return this.reviewMove=e,this.bestMoves=[],this.highlightedMove=null,n?this.game.setRack(n.split("").map((e=>[e,t[e]]))):this.game.setRack([]),void this.game.placeTiles(e);this.reviewMove=null,this.spinners++;try{const i={locale:this.game.locale,board_type:this.isExplo?"explo":"standard",board:this.game.boardAsStrings(),rack:n,limit:19},o=await we({method:"POST",url:"/moves",body:i});if(this.highlightedMove=null,!o||void 0===o.moves)return this.reviewMove=null,void(this.bestMoves=null);this.reviewMove=e,this.bestMoves=o.moves.map((t=>[(e-1)%2,[t.co,t.w,t.sc],!1])),this.game.setRack(n.split("").map((e=>[e,t[e]]))),this.game.placeTiles(e)}catch(e){this.highlightedMove=null,this.reviewMove=null,this.bestMoves=null}finally{this.spinners&&this.spinners--}}async loadHelp(){var e;if(null===this.helpHTML)try{const t=(null===(e=this.state)||void 0===e?void 0:e.locale)||"is_IS",n=await be({method:"GET",url:"/rawhelp?version=malstadur&locale="+t,responseType:"text",deserialize:e=>e});this.helpHTML=n}catch(e){this.helpHTML=""}}async loadFriendPromo(){var e;if(null===this.friendHTML)try{const t=(null===(e=this.state)||void 0===e?void 0:e.locale)||"is_IS",n=await be({method:"GET",url:"/friend?locale="+t,responseType:"text",deserialize:e=>e});this.friendHTML=n}catch(e){this.friendHTML=""}}async loadUser(e){this.user=void 0,e&&this.spinners++;try{const e=await be({method:"POST",url:"/loaduserprefs"});e&&e.ok?(this.user=e.userprefs,this.userErrors=null):(this.user=null,this.userErrors=null,this.userLoadError=!0)}catch(e){this.user=null,this.userErrors=null,this.userLoadError=!0}finally{e&&this.spinners&&this.spinners--}}async saveUser(e){const t=this.user;if(t)try{const n=await be({method:"POST",url:"/saveuserprefs",body:t});if(null==n?void 0:n.ok){const n=this.state;null!==n&&(n.userNick=t.nickname,n.beginner=t.beginner,n.fairPlay=t.fairplay),null!==this.game&&this.game.notifyUserChange(t.nickname),void 0!==e&&e(),this.userErrors=null,this.user=null}else this.userErrors=n.err||null}catch(e){this.userErrors=null}}async setUserPref(e){try{await be({method:"POST",url:"/setuserpref",body:e})}catch(e){}}async newGame(e,t){var n;try{const i={opp:e,rev:t};this.isExplo&&(i.board_type="explo");const o={method:"POST",url:"/initgame",body:i},r=await be(o);if(null==r?void 0:r.ok){const e=(null===(n=this.state)||void 0===n?void 0:n.locale)||"is_IS";Ju("new_game",{uuid:r.uuid,timed:t,locale:e}),pe.route.set("/game/"+r.uuid)}}catch(e){}}async modifyChallenge(e){var t;try{const i=await be({method:"POST",url:"/challenge",body:e});if(0===(null==i?void 0:i.result)){var n={locale:(null===(t=this.state)||void 0===t?void 0:t.locale)||"is_IS"};void 0!==e.duration&&(n.duration=e.duration),void 0!==e.fairplay&&(n.fairplay=e.fairplay),void 0!==e.manual&&(n.manual=e.manual),Ju("challenge_"+e.action,n),this.loadChallengeList(),this.userListCriteria&&this.loadUserList(this.userListCriteria,!1)}}catch(e){}}async markFavorite(e,t){try{await be({method:"POST",url:"/favorite",body:{destuser:e,action:t?"add":"delete"}})}catch(e){}}async cancelFriendship(){const e=this.user,t=this.state;if(e&&t){try{const n=await be({method:"POST",url:"/cancelplan",body:{}});if(null==n?void 0:n.ok)return e.friend=!1,t.hasPaid=!1,t.plan="",Ju("cancel_plan",{userid:t.userId,locale:t.locale,plan:"friend"}),!0}catch(e){}return!1}}addChatMessage(e,t,n,i){var o,r;if(this.game&&this.game.uuid==e){const e=null!==(r=null===(o=this.state)||void 0===o?void 0:o.userId)&&void 0!==r?r:"";return this.game.addChatMessage(t,n,i,t==e),!0}return!1}handleUserMessage(e,t){var n;if(t||!this.state)return;let i=!1;if(void 0!==e.friend){const t=!!e.friend;this.user&&this.user.friend!=t&&(this.user.friend=t,i=!0)}if(void 0!==e.plan&&(this.state.plan!=e.plan&&(this.state.plan=e.plan,i=!0),this.user&&!this.user.friend&&"friend"==this.state.plan&&(this.user.friend=!0,i=!0),""==this.state.plan&&(null===(n=this.user)||void 0===n?void 0:n.friend)&&(this.user.friend=!1,i=!0)),void 0!==e.hasPaid){const t=!(""==this.state.plan||!e.hasPaid);this.state.hasPaid!=t&&(this.state.hasPaid=t,i=!0)}let o=!1;e.challenge?(this.loadChallengeList(),this.userListCriteria&&this.loadUserList(this.userListCriteria,!1),o=!0):e.move&&(o=!0),o&&!this.loadingGameList&&(this.gameList=null,i=!0),i&&pe.redraw()}handleMoveMessage(e,t){!t&&this.game&&(this.game.update(e),pe.redraw())}notifyMove(){this.loadingGameList||(this.gameList=null)}moreGamesAllowed(){if(!this.state)return!1;if(this.loadingGameList)return!1;if(!this.gameList)return!0;return!(this.gameList.length>=50)&&(!!this.state.hasPaid||this.gameList.length<this.maxFreeGames)}}class ap{constructor(e,t){this.model=e,this.view=t,this.initMediaListener()}onNavigateTo(e,t){var n,i,o;const r=this.model;this.view.boardScale=1,r.routeName=e,r.params=t;const s=null!==(n=t.uuid)&&void 0!==n?n:"";if("game"==e){null!==r.game&&this.detachListenerFromGame(r.game.uuid);const e="1"===t.zombie;r.loadGame(s,(()=>{this.attachListenerToGame(s),setTimeout(Je)}),e),null!==r.game&&void 0!==r.game&&Ju("game_open",{locale:r.game.locale,uuid:t.uuid})}else if("review"==e){null!==r.game&&this.detachListenerFromGame(r.game.uuid);let e=t.move||"0",n=parseInt(e);(isNaN(n)||!n||n<0)&&(n=0),null===r.game||r.game.uuid!=t.uuid?r.loadGame(s,(()=>{r.loadBestMoves(n),setTimeout(Je)})):null!==r.game&&r.loadBestMoves(n)}else{null!==r.game&&(this.detachListenerFromGame(r.game.uuid),r.game.cleanup(),r.game=null);const t=(null===(i=r.state)||void 0===i?void 0:i.locale)||"is_IS";"help"==e?(r.loadHelp(),Ju("help",{locale:t})):"thanks"==e?(null===(o=r.state)||void 0===o?void 0:o.userId)&&Ju("init_plan",{userid:r.state.userId,locale:t,plan:"friend"}):"main"==e&&(r.gameList=null,r.userListCriteria=null,r.userList=null,r.challengeList=null,r.recentList=null)}}onMoveMessage(e,t){console.log("Move message received: "+JSON.stringify(e)),this.model.handleMoveMessage(e,t)}onUserMessage(e,t){console.log("User message received: "+JSON.stringify(e)),this.model.handleUserMessage(e,t)}onChatMessage(e,t){t?console.log("First attach of chat: "+JSON.stringify(e)):(console.log("Chat message received: "+JSON.stringify(e)),this.model.addChatMessage(e.game,e.from_userid,e.msg,e.ts)&&this.view.notifyChatMessage())}onFullScreen(){const e=this.model.state;e&&!e.uiFullscreen&&(e.uiFullscreen=!0,this.view.notifyMediaChange(),pe.redraw())}onMobileScreen(){const e=this.model.state;e&&!1!==e.uiFullscreen&&(e.uiFullscreen=!1,this.view.notifyMediaChange(),pe.redraw())}onLandscapeScreen(){const e=this.model.state;e&&!e.uiLandscape&&(e.uiLandscape=!0,this.view.notifyMediaChange(),pe.redraw())}onPortraitScreen(){const e=this.model.state;e&&!1!==e.uiLandscape&&(e.uiLandscape=!1,this.view.notifyMediaChange(),pe.redraw())}mediaMinWidth667(e){e.matches?this.onLandscapeScreen():this.onPortraitScreen()}mediaMinWidth768(e){e.matches?this.onFullScreen():this.onMobileScreen()}initMediaListener(){function e(e,t){try{e.addEventListener("change",t,{passive:!0})}catch(n){try{e.addListener(t)}catch(e){console.error(e)}}}let t=window.matchMedia("(min-width: 667px)"),n=this;t&&(this.mediaMinWidth667(t),e(t,(()=>n.mediaMinWidth667(t)))),t=window.matchMedia("(min-width: 768px)"),t&&(this.mediaMinWidth768(t),e(t,(()=>n.mediaMinWidth768(t))))}attachListenerToUser(){const e=this.model.state;e&&e.userId&&Ku("user/"+e.userId,((e,t)=>this.onUserMessage(e,t)))}detachListenerFromUser(){const e=this.model.state;e&&e.userId&&Yu("user/"+e.userId)}attachListenerToGame(e){const t=this.model.state;if(!e||!t)return;const n="game/"+e+"/"+t.userId+"/";Ku(n+"move",((e,t)=>this.onMoveMessage(e,t))),Ku(n+"chat",((e,t)=>this.onChatMessage(e,t)))}detachListenerFromGame(e){const t=this.model.state;if(!e||!t)return;const n="game/"+e+"/"+t.userId+"/";Yu(n+"move"),Yu(n+"chat")}}const lp=[['<path d="M65.2672 12.542L54.3998 18.813L43.5323 25.146L32.6649 18.813L21.7354 12.542L43.5323 0L65.2672 12.542Z" fill="#FDC12C"/>','<path d="M43.5323 25.1457V37.6877L21.7354 25.1457V12.5416L43.5323 25.1457Z" fill="#E69419"/>','<path d="M65.2661 12.5416V25.1457L43.5312 37.6877V25.1457L65.2661 12.5416Z" fill="#F8DA95"/>'],['<path d="M43.5318 37.6847L32.6644 43.9557L21.7349 50.2267L10.8674 43.9557L0 37.6847L21.7349 25.1427L43.5318 37.6847Z" fill="#AA3731"/>','<path d="M21.7349 50.23V62.7719L0 50.23V37.688L21.7349 50.23Z" fill="#721D19"/>'],['<path d="M65.2672 50.23L54.3998 56.501L43.5323 62.7719L32.6028 56.501L21.7354 50.23L43.5323 37.688L65.2672 50.23Z" fill="#669256"/>','<path d="M43.5323 62.7716V75.3756L21.7354 62.7716V50.2296L43.5323 62.7716Z" fill="#496A38"/>','<path d="M65.2661 50.2296V62.7716L43.5312 75.3756V62.7716L65.2661 50.2296Z" fill="#B7C7AD"/>'],['<path d="M43.5318 75.3754L32.6644 81.6464L21.7349 87.9174L10.8674 81.6464L0 75.3754L21.7349 62.7714L43.5318 75.3754Z" fill="#83C8CE"/>','<path d="M21.7349 87.918V100.46L0 87.918V75.376L21.7349 87.918Z" fill="#5699A5"/>'],['<path d="M65.2672 87.918L54.3998 94.1889L43.5323 100.46L32.6649 94.1889L21.7354 87.918L43.5323 75.376L65.2672 87.918Z" fill="#E39FA5"/>','<path d="M43.5323 100.46V113.002L21.7354 100.46V87.9177L43.5323 100.46Z" fill="#B6676D"/>','<path d="M65.2661 87.9177V100.46L43.5312 113.002V100.46L65.2661 87.9177Z" fill="#EACFD1"/>']],cp=[['<path fill="#514c4c"',' d="M1728.66,1133.94a1.85,1.85,0,0,1-2-2v-54.59c0-10.41-4.91-17.28-14.73-17.28-9.43,0-14.93,6.87-14.93,17.28V1132a1.85,1.85,0,0,1-2,2h-23.56a1.86,1.86,0,0,1-2-2v-91.12a1.86,1.86,0,0,1,2-2h23.56a1.85,1.85,0,0,1,2,2v6.68h.2c4.32-5.89,12.37-10.8,24.55-10.8,21,0,32.4,14.53,32.4,35.34V1132a1.86,1.86,0,0,1-2,2Z"',' transform="translate(-1401.69 -918.27)"/>'],['<path fill="#514c4c"',' d="M1769.19,1109a68.34,68.34,0,0,1-3.34-22.58c0-10,1.18-16.89,3.14-22.78,5.5-17.08,20.62-26.9,40.84-26.9,21,0,35.55,10,41,26.71,2,6.28,3.15,13.15,3.15,29.25a1.92,1.92,0,0,1-2.16,2h-57.54a1,1,0,0,0-1.18,1.18,21.17,21.17,0,0,0,1.18,5.3c2.55,8.24,9.82,12.56,19.64,12.56a30.5,30.5,0,0,0,21.79-8.44c1-.78,2-1,2.75,0l13,12.18a1.77,1.77,0,0,1,.2,2.75c-9,9.62-23,15.9-40.45,15.9C1789.61,1136.1,1774.69,1126.09,1769.19,1109Zm56.55-32.59a1,1,0,0,0,1.18-1.18,23.82,23.82,0,0,0-1-7.07c-2.16-6.48-8-10.41-15.91-10.41s-13.75,3.93-15.91,10.41a23.82,23.82,0,0,0-1,7.07,1,1,0,0,0,1.18,1.18Z"',' transform="translate(-1401.69 -918.27)"/>'],['<path fill="#514c4c"',' d="M1898.61,1135.12c-22,0-30.24-9.82-30.24-31.62v-43.2a1,1,0,0,0-1.18-1.18h-5.89a1.85,1.85,0,0,1-2-2v-16.3a1.85,1.85,0,0,1,2-2h5.89a1,1,0,0,0,1.18-1.18v-25.53a1.85,1.85,0,0,1,2-2h23.37a1.85,1.85,0,0,1,2,2v25.53a1,1,0,0,0,1.18,1.18H1909a1.86,1.86,0,0,1,2,2v16.3a1.85,1.85,0,0,1-2,2h-12.18a1,1,0,0,0-1.18,1.18v42c0,7.06,2.36,9.42,8.64,9.42H1909a1.86,1.86,0,0,1,2,2v19.45a1.86,1.86,0,0,1-2,2Z"',' transform="translate(-1401.69 -918.27)"/>'],['<path fill="#514c4c"',' d="M1919.28,1121.37a1.91,1.91,0,0,1,0-2.75l12.77-14.33a1.89,1.89,0,0,1,2.75,0c8.44,6.48,19.24,10.41,29.06,10.41,10,0,14.73-3.73,14.73-9,0-4.51-2.56-7.26-13.55-8.24l-10.61-1.18c-20-2-31-12-31-29.06,0-18.66,14.33-30.44,39.07-30.44,16.11,0,29.66,5.1,38.49,11.78a2.14,2.14,0,0,1,.2,3l-11,13.55a1.92,1.92,0,0,1-2.75.39,49.74,49.74,0,0,0-25.72-7.66c-8,0-12,3.14-12,7.86,0,4.32,2.36,6.87,13.16,7.85l10.4,1.18c22.39,2.16,31.62,13,31.62,28.86-.2,19.44-15.32,32.6-42.42,32.6C1942.65,1136.1,1928.32,1129.23,1919.28,1121.37Z"',' transform="translate(-1401.69 -918.27)"/>'],['<path fill="#514c4c"',' d="M2077.79,1133.94c-1.38,0-2.16-.59-2.95-2l-21.21-38.29-9.81,12.17V1132a1.86,1.86,0,0,1-2,2h-23.56a1.85,1.85,0,0,1-2-2v-129.6a1.86,1.86,0,0,1,2-2h23.56a1.86,1.86,0,0,1,2,2v72.06l27.29-33.58a4.5,4.5,0,0,1,3.73-2H2100a1.1,1.1,0,0,1,.78,2l-29.06,33.58,33.19,57.54a1.2,1.2,0,0,1-1,2Z"',' transform="translate(-1401.69 -918.27)"/>'],['<path fill="#514c4c"',' d="M2115.68,1133.94a1.85,1.85,0,0,1-2-2v-91.12a1.85,1.85,0,0,1,2-2h23.57a1.85,1.85,0,0,1,2,2v8.05h.2c4.51-7.65,13.15-12.17,24.74-12.17,6.28,0,12.57,2.16,16.69,5.69a1.93,1.93,0,0,1,.59,2.75l-11,20c-.78,1-1.57,1-2.75.4-4.51-2.95-9-4.52-13.74-4.32-10.21.39-14.73,7.85-14.73,20.61V1132a1.85,1.85,0,0,1-2,2Z"',' transform="translate(-1401.69 -918.27)"/>'],['<path fill="#514c4c"',' d="M2246.58,1133.94a1.86,1.86,0,0,1-2-2v-6.29h-.19c-4.91,6.29-13.16,10.41-26.12,10.41-16.89,0-31.61-8.84-31.61-29.06,0-21,15.9-30.63,39.47-30.63H2243a1,1,0,0,0,1.18-1.18v-3.54c0-8.83-4.32-13-19.44-13-9.62,0-16.69,2.75-21.21,6.09a1.56,1.56,0,0,1-2.55-.39l-8.84-15.52a1.89,1.89,0,0,1,.59-2.74c8.06-5.7,19.64-9.43,35.35-9.43,31,0,42.22,10.6,42.22,34.36V1132a1.85,1.85,0,0,1-2,2Zm-2.36-31.61v-6.48a1,1,0,0,0-1.18-1.18h-13.35c-11.58,0-16.89,3.34-16.89,10.8,0,6.67,4.72,10,13.75,10C2238.33,1115.48,2244.22,1111.16,2244.22,1102.33Z"',' transform="translate(-1401.69 -918.27)"/>'],['<path fill="#514c4c"',' d="M2291.92,1133.94a1.86,1.86,0,0,1-2-2V1060.3a1,1,0,0,0-1.17-1.18h-5.89a1.86,1.86,0,0,1-2-2v-16.3a1.86,1.86,0,0,1,2-2h5.89a1,1,0,0,0,1.17-1.18v-4.51c0-23.18,10.8-32.8,33.39-32.8h10.8a1.86,1.86,0,0,1,2,2v18.45a1.86,1.86,0,0,1-2,2h-6.09c-8.64,0-10.8,2.16-10.8,10.21v4.71a1,1,0,0,0,1.18,1.18h15.51a1.85,1.85,0,0,1,2,2v16.3a1.85,1.85,0,0,1-2,2h-15.51a1,1,0,0,0-1.18,1.18V1132a1.85,1.85,0,0,1-2,2Zm90.13,1.18c-21,0-29.46-9.23-29.46-30.24v-102.5a1.86,1.86,0,0,1,2-2h23.56a1.86,1.86,0,0,1,2,2v100.34c0,6.48,2.55,9,8.24,9h4.13a1.85,1.85,0,0,1,2,2v19.45a1.85,1.85,0,0,1-2,2Z"',' transform="translate(-1401.69 -918.27)"/>']],dp="</svg>",hp=lp.length,up=e=>{const t=e.attrs.msStepTime||0,n=e.attrs.width/134,i=e.attrs.withCircle||!1,o=!!e.attrs.once,r=e.attrs.className;let s=1,a=t?0:hp,l=0;function c(){s<0&&0==a?s=1:s>0&&a==hp&&(o?(s=0,clearInterval(l),l=0):s=-1),a+=s,pe.redraw()}return{oninit:()=>{t&&(l=setInterval(c,t))},onremove:()=>{0!=l&&(clearInterval(l),l=0)},view:()=>{let e=['<svg width="134" height="134" viewBox="-32 -8 134 134" fill="none" xmlns="http://www.w3.org/2000/svg">'];i&&e.push('<circle class="shadow" cx="35" cy="59" r="63" fill="#ffffff"/>');for(let t=0;t<a;t++)for(let n of lp[t])e.push(n);e.push(dp);let t={style:{transform:`scale(${n})`,"transform-origin":"left top"}};return null!=r&&(t.class=r),pe("div",t,pe.trust(e.join("\n")))}}},pp=cp.length,gp=e=>{const t=e.attrs.msStepTime||0,n=e.attrs.width/992.73,i=e.attrs.className;let o=1,r=t?0:pp,s=0;function a(){o<0&&0==r?o=1:o>0&&r==pp&&(o=-1),r+=o,pe.redraw()}return{oninit:()=>{t&&(s=setInterval(a,t))},onremove:()=>{0!=s&&(clearInterval(s),s=0)},view:()=>{let e=['<svg viewBox="0 0 992.73 323.47" fill="none" xmlns="http://www.w3.org/2000/svg">'];for(let t=0;t<r;t++)for(let n of cp[t])e.push(n);e.push(dp);const t={style:{transform:`scale(${n})`,"transform-origin":"left top"}};return i&&(t.class=i),pe("div",t,pe.trust(e.join("\n")))}}},fp=()=>({view:e=>{const{width:t,height:n}=e.attrs,i=[t?`width: ${t}px;`:"",n?`height: ${n}px;`:""].filter(Boolean).join(" ");return pe(".netskrafl-logo",{style:i},pe.trust('\n<svg width="182" height="210" viewBox="0 0 182 210" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M50.0335 81.1768V58.6393C50.0335 56.9025 48.7821 54.7618 47.2876 53.8732L27.7859 42.6044C26.2932 41.7158 23.7887 41.7158 22.296 42.6044L2.75319 53.8732C1.2587 54.7618 0.00732422 56.9025 0.00732422 58.6393V81.1768C0.00732422 82.9136 1.2587 85.0543 2.75319 85.9428L16.3591 93.7785C18.6617 95.0306 20.2366 97.4944 20.2366 100.322V115.145C20.2366 117.972 18.6617 120.436 16.3591 121.688L7.35643 126.898L2.79251 129.524C1.29981 130.412 0.0484453 132.553 0.0484453 134.29V156.827C0.0484453 158.564 1.29981 160.705 2.79251 161.593L22.296 172.862C23.7887 173.751 26.2932 173.751 27.7859 172.862L47.2876 161.593C48.7821 160.705 50.0335 158.564 50.0335 156.827V134.29C50.0335 132.553 48.7821 130.412 47.2876 129.524L33.6817 121.688C31.3791 120.436 29.806 117.972 29.806 115.145V100.322C29.806 97.4944 31.3791 95.0306 33.6817 93.7785L47.2876 85.9428C48.8232 85.0543 50.0335 82.9136 50.0335 81.1768Z" fill="#F17736"/>\n<path d="M25.0401 73.1002C25.0401 71.3633 23.7887 69.2227 22.296 68.3341L2.75319 57.0653C1.2587 56.1767 0.00732422 56.9037 0.00732422 58.6404V81.1782C0.00732422 82.9149 1.2587 85.0556 2.75319 85.9441L22.2549 97.2129C23.7494 98.1015 25.0007 97.3745 25.0007 95.6377L25.0401 73.1002Z" fill="#FFAA88"/>\n<path d="M73.9793 88.4472L68.2856 91.7188C66.9126 92.5267 65.7417 94.3846 65.5397 96.0405V96.0809V96.2021V96.4848V103.028C65.4986 100.524 64.1668 98.0601 61.7838 96.6868L48.9859 89.2954C46.5225 87.8818 43.6157 88.003 41.3543 89.3762L27.7466 97.2118C26.2539 98.0601 25.0007 97.3734 25.0007 95.6367V73.0989C25.0007 71.3622 26.2539 69.2217 27.7466 68.333L47.2483 57.0642C47.6934 56.8219 48.0974 56.7007 48.4603 56.7007C49.3488 56.7007 49.9941 57.4277 49.9941 58.6393V74.351C49.9137 76.9764 51.2866 79.6018 53.7089 81.0155L66.5086 88.4068C68.972 89.7801 71.7572 89.6993 73.9793 88.4472Z" fill="#C94314"/>\n<path d="M25.0401 148.791C25.0401 147.054 23.7887 144.913 22.296 144.024L2.75319 132.756C1.2587 131.867 0.00732422 132.594 0.00732422 134.331V156.869C0.00732422 158.605 1.2587 160.746 2.75319 161.634L22.2549 172.903C23.7494 173.792 25.0007 173.065 25.0007 171.328L25.0401 148.791Z" fill="#FFAA88"/>\n<path d="M50.035 156.869C50.035 158.605 48.7837 160.746 47.2892 161.634L27.7875 172.903C26.293 173.792 25.0416 173.065 25.0416 171.328V148.791C25.0416 147.054 26.293 144.913 27.7875 144.024L47.2892 132.756C48.7837 131.867 50.035 132.594 50.035 134.331V156.869Z" fill="#C94314"/>\n<path d="M115.566 96.4844V119.022C115.566 120.759 114.313 122.899 112.821 123.788L93.3189 135.057C91.9853 135.824 89.9258 135.905 88.392 135.34C88.3116 135.299 88.2311 135.299 88.1507 135.259C88.1096 135.218 88.0685 135.218 87.988 135.178C87.9487 135.138 87.8665 135.138 87.8271 135.097L68.3254 123.828C68.1234 123.707 67.9608 123.586 67.7587 123.424C67.5979 123.263 67.3959 123.101 67.235 122.94C66.266 121.89 65.5385 120.355 65.5385 119.062V103.351C65.5385 103.229 65.5385 103.149 65.5385 103.028V96.4844C65.5385 96.4036 65.5385 96.3228 65.5385 96.2018C65.5385 96.1614 65.5385 96.121 65.5385 96.0806V96.0402C65.7011 94.3843 66.872 92.5261 68.2843 91.7185L73.9781 88.4468L87.786 80.4497C89.3198 79.561 91.7832 79.561 93.2777 80.4497L112.779 91.7185C114.354 92.6069 115.566 94.7477 115.566 96.4844Z" fill="#F17736"/>\n<path d="M90.573 133.482C90.573 135.097 89.5218 135.824 88.1489 135.259C88.1096 135.219 88.0684 135.219 87.988 135.178C87.9487 135.138 87.8664 135.138 87.8271 135.097L68.3254 123.829C68.1234 123.707 67.9608 123.586 67.7587 123.425C67.5979 123.263 67.3958 123.102 67.235 122.94C66.266 121.89 65.5385 120.355 65.5385 119.063V103.351C65.5385 103.23 65.5385 103.149 65.5385 103.028V96.4847C65.5385 96.4039 65.5385 96.3231 65.5385 96.2019C65.5385 96.1615 65.5385 96.1211 65.5385 96.0807V96.0403C65.7405 94.6268 66.872 94.1016 68.2843 94.9094L76.6828 99.7561L87.8271 106.178C89.3609 107.067 90.573 109.207 90.573 110.944V133.482Z" fill="#FFAA88"/>\n<path d="M139.467 126.291L138.418 126.896L133.855 129.522C132.482 130.33 131.312 132.188 131.11 133.844V134.005V134.248V140.791C131.068 138.286 129.737 135.823 127.354 134.449L114.554 127.058C112.092 125.644 109.184 125.766 106.924 127.139L93.3164 134.974C91.7826 135.823 90.5706 135.136 90.5706 133.359V110.821C90.5706 109.084 91.8219 106.944 93.3164 106.055L112.818 94.7864C114.313 93.898 115.564 94.6248 115.564 96.3617V112.073C115.484 114.699 116.856 117.324 119.279 118.738L132.078 126.129C134.46 127.583 137.247 127.543 139.467 126.291Z" fill="#C94314"/>\n<path d="M160.869 100.362V115.145C160.869 117.972 162.444 120.436 164.745 121.688L178.353 129.524C179.845 130.412 181.099 132.553 181.099 134.29V156.827C181.099 158.564 179.845 160.705 178.353 161.593L158.851 172.862C157.478 173.629 155.338 173.71 153.844 173.104C153.763 173.064 153.722 173.064 153.642 173.024C153.561 172.983 153.44 172.943 153.359 172.862L133.858 161.593C133.493 161.391 133.13 161.068 132.808 160.745C131.837 159.695 131.112 158.16 131.112 156.827V141.156C131.112 141.035 131.112 140.954 131.112 140.833V134.29C131.112 134.209 131.112 134.128 131.112 134.047C131.112 134.007 131.112 133.926 131.112 133.886C131.273 132.23 132.444 130.331 133.858 129.564L138.42 126.939L139.469 126.333L140.803 125.565L147.424 121.728C147.585 121.647 147.707 121.567 147.868 121.486C149.927 120.153 151.3 117.851 151.3 115.185V100.402C151.3 97.5752 149.725 95.1114 147.424 93.8593L133.858 86.0236C132.363 85.135 131.112 82.9944 131.112 81.2577V58.6393C131.112 56.9025 132.363 54.7618 133.858 53.8732L153.359 42.6044C154.893 41.7158 157.356 41.7158 158.851 42.6044L178.353 53.8732C179.886 54.7618 181.099 56.9025 181.099 58.6393V81.1769C181.099 82.0653 180.775 83.0348 180.291 83.8829C179.806 84.7311 179.12 85.4986 178.353 85.9428L164.745 93.7785C162.444 95.071 160.869 97.5348 160.869 100.362Z" fill="#F17736"/>\n<path d="M156.105 73.1002C156.105 71.3633 154.854 69.2227 153.359 68.3341L133.858 57.0653C132.363 56.1767 131.112 56.9037 131.112 58.6404V81.1782C131.112 82.9149 132.363 85.0556 133.858 85.9441L153.359 97.2129C154.854 98.1015 156.105 97.3745 156.105 95.6377V73.1002Z" fill="#FFAA88"/>\n<path d="M181.096 81.1782C181.096 82.9149 179.845 85.0556 178.35 85.9441L158.849 97.2129C157.356 98.1015 156.103 97.3745 156.103 95.6377V73.1002C156.103 71.3633 157.356 69.2227 158.849 68.3341L178.35 57.0653C179.845 56.1767 181.096 56.9037 181.096 58.6404V81.1782Z" fill="#C94314"/>\n<path d="M156.105 171.328C156.105 172.903 155.136 173.63 153.844 173.145C153.763 173.105 153.722 173.105 153.642 173.064C153.561 173.024 153.44 172.984 153.359 172.903L133.857 161.634C133.493 161.432 133.13 161.109 132.808 160.786C131.837 159.736 131.112 158.201 131.112 156.868V141.197C131.112 141.076 131.112 140.995 131.112 140.874V134.331C131.112 134.25 131.112 134.169 131.112 134.088C131.112 134.048 131.112 133.967 131.112 133.927C131.314 132.513 132.443 131.988 133.857 132.796L142.215 137.642L153.359 144.064C154.893 144.953 156.105 147.094 156.105 148.83V171.328Z" fill="#FFAA88"/>\n<path d="M181.096 156.869C181.096 158.605 179.845 160.746 178.35 161.634L158.849 172.903C157.356 173.792 156.103 173.065 156.103 171.328V148.791C156.103 147.054 157.356 144.913 158.849 144.024L178.35 132.756C179.845 131.867 181.096 132.594 181.096 134.331V156.869Z" fill="#C94314"/>\n<path d="M50.0335 81.1768V58.6393C50.0335 56.9025 48.7821 54.7618 47.2876 53.8732L27.7859 42.6044C26.2932 41.7158 23.7887 41.7158 22.296 42.6044L2.75319 53.8732C1.2587 54.7618 0.00732422 56.9025 0.00732422 58.6393V81.1768C0.00732422 82.9136 1.2587 85.0543 2.75319 85.9428L16.3591 93.7785C18.6617 95.0306 20.2366 97.4944 20.2366 100.322V115.145C20.2366 117.972 18.6617 120.436 16.3591 121.688L7.35643 126.898L2.79251 129.524C1.29981 130.412 0.0484453 132.553 0.0484453 134.29V156.827C0.0484453 158.564 1.29981 160.705 2.79251 161.593L22.296 172.862C23.7887 173.751 26.2932 173.751 27.7859 172.862L47.2876 161.593C48.7821 160.705 50.0335 158.564 50.0335 156.827V134.29C50.0335 132.553 48.7821 130.412 47.2876 129.524L33.6817 121.688C31.3791 120.436 29.806 117.972 29.806 115.145V100.322C29.806 97.4944 31.3791 95.0306 33.6817 93.7785L47.2876 85.9428C48.8232 85.0543 50.0335 82.9136 50.0335 81.1768Z" fill="#F17736"/>\n<path d="M25.0401 73.1002C25.0401 71.3633 23.7887 69.2227 22.296 68.3341L2.75319 57.0653C1.2587 56.1767 0.00732422 56.9037 0.00732422 58.6404V81.1782C0.00732422 82.9149 1.2587 85.0556 2.75319 85.9441L22.2549 97.2129C23.7494 98.1015 25.0007 97.3745 25.0007 95.6377L25.0401 73.1002Z" fill="#FFAA88"/>\n<path d="M73.9793 88.4472L68.2856 91.7188C66.9126 92.5267 65.7417 94.3846 65.5397 96.0405V96.0809V96.2021V96.4848V103.028C65.4986 100.524 64.1668 98.0601 61.7838 96.6868L48.9859 89.2954C46.5225 87.8818 43.6157 88.003 41.3543 89.3762L27.7466 97.2118C26.2539 98.0601 25.0007 97.3734 25.0007 95.6367V73.0989C25.0007 71.3622 26.2539 69.2217 27.7466 68.333L47.2483 57.0642C47.6934 56.8219 48.0974 56.7007 48.4603 56.7007C49.3488 56.7007 49.9941 57.4277 49.9941 58.6393V74.351C49.9137 76.9764 51.2866 79.6018 53.7089 81.0155L66.5086 88.4068C68.972 89.7801 71.7572 89.6993 73.9793 88.4472Z" fill="#C94314"/>\n<path d="M25.0401 148.791C25.0401 147.054 23.7887 144.913 22.296 144.024L2.75319 132.756C1.2587 131.867 0.00732422 132.594 0.00732422 134.331V156.869C0.00732422 158.605 1.2587 160.746 2.75319 161.634L22.2549 172.903C23.7494 173.792 25.0007 173.065 25.0007 171.328L25.0401 148.791Z" fill="#FFAA88"/>\n<path d="M50.035 156.869C50.035 158.605 48.7837 160.746 47.2892 161.634L27.7875 172.903C26.293 173.792 25.0416 173.065 25.0416 171.328V148.791C25.0416 147.054 26.293 144.913 27.7875 144.024L47.2892 132.756C48.7837 131.867 50.035 132.594 50.035 134.331V156.869Z" fill="#C94314"/>\n<path d="M115.566 96.4844V119.022C115.566 120.759 114.313 122.899 112.821 123.788L93.3189 135.057C91.9853 135.824 89.9258 135.905 88.392 135.34C88.3116 135.299 88.2311 135.299 88.1507 135.259C88.1096 135.218 88.0685 135.218 87.988 135.178C87.9487 135.138 87.8665 135.138 87.8271 135.097L68.3254 123.828C68.1234 123.707 67.9608 123.586 67.7587 123.424C67.5979 123.263 67.3959 123.101 67.235 122.94C66.266 121.89 65.5385 120.355 65.5385 119.062V103.351C65.5385 103.229 65.5385 103.149 65.5385 103.028V96.4844C65.5385 96.4036 65.5385 96.3228 65.5385 96.2018C65.5385 96.1614 65.5385 96.121 65.5385 96.0806V96.0402C65.7011 94.3843 66.872 92.5261 68.2843 91.7185L73.9781 88.4468L87.786 80.4497C89.3198 79.561 91.7832 79.561 93.2777 80.4497L112.779 91.7185C114.354 92.6069 115.566 94.7477 115.566 96.4844Z" fill="#F17736"/>\n<path d="M90.573 133.482C90.573 135.097 89.5218 135.824 88.1489 135.259C88.1096 135.219 88.0684 135.219 87.988 135.178C87.9487 135.138 87.8664 135.138 87.8271 135.097L68.3254 123.829C68.1234 123.707 67.9608 123.586 67.7587 123.425C67.5979 123.263 67.3958 123.102 67.235 122.94C66.266 121.89 65.5385 120.355 65.5385 119.063V103.351C65.5385 103.23 65.5385 103.149 65.5385 103.028V96.4847C65.5385 96.4039 65.5385 96.3231 65.5385 96.2019C65.5385 96.1615 65.5385 96.1211 65.5385 96.0807V96.0403C65.7405 94.6268 66.872 94.1016 68.2843 94.9094L76.6828 99.7561L87.8271 106.178C89.3609 107.067 90.573 109.207 90.573 110.944V133.482Z" fill="#FFAA88"/>\n<path d="M115.566 16.7012V39.2388C115.566 40.9757 114.313 43.1162 112.821 44.0049L93.3189 55.2737C91.9853 56.0411 89.9258 56.1219 88.392 55.5563C88.3116 55.5159 88.2311 55.5159 88.1507 55.4757C88.1096 55.4353 88.0685 55.4353 87.988 55.3949C87.9487 55.3545 87.8665 55.3545 87.8271 55.3141L68.3254 44.0453C68.1234 43.9241 67.9608 43.8029 67.7587 43.6413C67.5979 43.4798 67.3959 43.3182 67.235 43.1566C66.266 42.1066 65.5385 40.5717 65.5385 39.2792V23.5675C65.5385 23.4463 65.5385 23.3657 65.5385 23.2444V16.7012C65.5385 16.6204 65.5385 16.5396 65.5385 16.4186C65.5385 16.3782 65.5385 16.3378 65.5385 16.2974V16.257C65.7011 14.601 66.872 12.7429 68.2843 11.9353L73.9781 8.66365L87.786 0.666489C89.3198 -0.222163 91.7832 -0.222163 93.2777 0.666489L112.779 11.9353C114.354 12.8237 115.566 14.9645 115.566 16.7012Z" fill="#F17736"/>\n<path d="M89.6624 31.5736C89.6624 29.9159 88.4316 27.8729 86.9616 27.0247L67.7803 16.2696C66.3104 15.4216 65.0796 16.1154 65.0796 17.773V39.2833C65.0796 40.9409 66.3104 42.9841 67.7803 43.832L86.9616 54.5871C88.4316 55.4353 89.6624 54.7414 89.6624 53.0838V31.5736Z" fill="#FFAA88"/>\n<path d="M115.691 38.9886C115.691 40.7689 114.388 42.9634 112.831 43.8742L92.5219 55.426C90.9673 56.3369 89.6622 55.5916 89.6622 53.8113V30.7077C89.6622 28.9272 90.9673 26.7329 92.5219 25.8219L112.831 14.2702C114.388 13.3593 115.691 14.1045 115.691 15.8848V38.9886Z" fill="#C94314"/>\n<path d="M115.566 169.984V192.521C115.566 194.258 114.313 196.399 112.821 197.288L93.3189 208.556C91.9853 209.324 89.9258 209.405 88.392 208.839C88.3116 208.799 88.2311 208.799 88.1507 208.758C88.1096 208.718 88.0685 208.718 87.988 208.678C87.9487 208.637 87.8665 208.637 87.8271 208.597L68.3254 197.328C68.1234 197.207 67.9608 197.086 67.7587 196.924C67.5979 196.763 67.3959 196.601 67.235 196.439C66.266 195.389 65.5385 193.854 65.5385 192.562V176.85C65.5385 176.729 65.5385 176.648 65.5385 176.527V169.984C65.5385 169.903 65.5385 169.822 65.5385 169.701C65.5385 169.661 65.5385 169.62 65.5385 169.58V169.54C65.7011 167.884 66.872 166.026 68.2843 165.218L73.9781 161.946L87.786 153.949C89.3198 153.061 91.7832 153.061 93.2777 153.949L112.779 165.218C114.354 166.106 115.566 168.247 115.566 169.984Z" fill="#F17736"/>\n<path d="M90.573 206.981C90.573 208.596 89.5218 209.323 88.1489 208.758C88.1096 208.718 88.0684 208.718 87.988 208.677C87.9487 208.637 87.8664 208.637 87.8271 208.596L68.3254 197.328C68.1234 197.206 67.9608 197.085 67.7587 196.924C67.5979 196.762 67.3958 196.601 67.235 196.439C66.266 195.389 65.5385 193.854 65.5385 192.562V176.85C65.5385 176.729 65.5385 176.648 65.5385 176.527V169.984C65.5385 169.903 65.5385 169.822 65.5385 169.701C65.5385 169.661 65.5385 169.62 65.5385 169.58V169.539C65.7405 168.126 66.872 167.601 68.2843 168.408L76.6828 173.255L87.8271 179.677C89.3609 180.566 90.573 182.706 90.573 184.443V206.981Z" fill="#FFAA88"/>\n<path d="M116.102 192.239C116.102 193.975 114.851 196.116 113.356 197.005L93.8544 208.273C92.3617 209.162 91.1085 208.435 91.1085 206.698V184.161C91.1085 182.424 92.3617 180.283 93.8544 179.395L113.356 168.126C114.851 167.237 116.102 167.964 116.102 169.701V192.239Z" fill="#C94314"/>\n<path d="M139.467 126.291L138.418 126.896L133.855 129.522C132.482 130.33 131.312 132.188 131.11 133.844V134.005V134.248V140.791C131.068 138.286 129.737 135.823 127.354 134.449L114.554 127.058C112.092 125.644 109.184 125.766 106.924 127.139L93.3164 134.974C91.7826 135.823 90.5706 135.136 90.5706 133.359V110.821C90.5706 109.084 91.8219 106.944 93.3164 106.055L112.818 94.7864C114.313 93.898 115.564 94.6248 115.564 96.3617V112.073C115.484 114.699 116.856 117.324 119.279 118.738L132.078 126.129C134.46 127.583 137.247 127.543 139.467 126.291Z" fill="#C94314"/>\n<path d="M160.869 100.362V115.145C160.869 117.972 162.444 120.436 164.745 121.688L178.353 129.524C179.845 130.412 181.099 132.553 181.099 134.29V156.827C181.099 158.564 179.845 160.705 178.353 161.593L158.851 172.862C157.478 173.629 155.338 173.71 153.844 173.104C153.763 173.064 153.722 173.064 153.642 173.024C153.561 172.983 153.44 172.943 153.359 172.862L133.858 161.593C133.493 161.391 133.13 161.068 132.808 160.745C131.837 159.695 131.112 158.16 131.112 156.827V141.156C131.112 141.035 131.112 140.954 131.112 140.833V134.29C131.112 134.209 131.112 134.128 131.112 134.047C131.112 134.007 131.112 133.926 131.112 133.886C131.273 132.23 132.444 130.331 133.858 129.564L138.42 126.939L139.469 126.333L140.803 125.565L147.424 121.728C147.585 121.647 147.707 121.567 147.868 121.486C149.927 120.153 151.3 117.851 151.3 115.185V100.402C151.3 97.5752 149.725 95.1114 147.424 93.8593L133.858 86.0236C132.363 85.135 131.112 82.9944 131.112 81.2577V58.6393C131.112 56.9025 132.363 54.7618 133.858 53.8732L153.359 42.6044C154.893 41.7158 157.356 41.7158 158.851 42.6044L178.353 53.8732C179.886 54.7618 181.099 56.9025 181.099 58.6393V81.1769C181.099 82.0653 180.775 83.0348 180.291 83.8829C179.806 84.7311 179.12 85.4986 178.353 85.9428L164.745 93.7785C162.444 95.071 160.869 97.5348 160.869 100.362Z" fill="#F17736"/>\n<path d="M156.105 73.1002C156.105 71.3633 154.854 69.2227 153.359 68.3341L133.858 57.0653C132.363 56.1767 131.112 56.9037 131.112 58.6404V81.1782C131.112 82.9149 132.363 85.0556 133.858 85.9441L153.359 97.2129C154.854 98.1015 156.105 97.3745 156.105 95.6377V73.1002Z" fill="#FFAA88"/>\n<path d="M181.096 81.1782C181.096 82.9149 179.845 85.0556 178.35 85.9441L158.849 97.2129C157.356 98.1015 156.103 97.3745 156.103 95.6377V73.1002C156.103 71.3633 157.356 69.2227 158.849 68.3341L178.35 57.0653C179.845 56.1767 181.096 56.9037 181.096 58.6404V81.1782Z" fill="#C94314"/>\n<path d="M156.105 171.328C156.105 172.903 155.136 173.63 153.844 173.145C153.763 173.105 153.722 173.105 153.642 173.064C153.561 173.024 153.44 172.984 153.359 172.903L133.857 161.634C133.493 161.432 133.13 161.109 132.808 160.786C131.837 159.736 131.112 158.201 131.112 156.868V141.197C131.112 141.076 131.112 140.995 131.112 140.874V134.331C131.112 134.25 131.112 134.169 131.112 134.088C131.112 134.048 131.112 133.967 131.112 133.927C131.314 132.513 132.443 131.988 133.857 132.796L142.215 137.642L153.359 144.064C154.893 144.953 156.105 147.094 156.105 148.83V171.328Z" fill="#FFAA88"/>\n<path d="M181.096 156.869C181.096 158.605 179.845 160.746 178.35 161.634L158.849 172.903C157.356 173.792 156.103 173.065 156.103 171.328V148.791C156.103 147.054 157.356 144.913 158.849 144.024L178.35 132.756C179.845 131.867 181.096 132.594 181.096 134.331V156.869Z" fill="#C94314"/>\n</svg>\n'))}}),mp={oninit:e=>{e.state.show=!1,e.state.ival=setTimeout((()=>{e.state.show=!0,e.state.ival=0,pe.redraw()}),800)},onremove:e=>{e.state.ival&&clearTimeout(e.state.ival),e.state.ival=0},view:e=>{if(e.state.show)return pe(".modal-dialog",{id:"spinner-dialog",style:{visibility:"visible"}},pe("div.animated-spinner",pe(up,{msStepTime:200,width:120,withCircle:!0})))}},vp=()=>{let e="",t="";return{oninit:n=>{e=n.attrs.initialValue+"",t=n.attrs.class,t=t?"."+t.split(" ").join("."):""},view:n=>{const{id:i,maxlength:o,tabindex:r,autocomplete:s}=n.attrs;return pe("input.text"+t,{id:i,name:i,maxlength:o,tabindex:r,autocomplete:s,value:e,oninput:t=>{e=t.target.value+""}})}}},bp={view:e=>{const t={onmouseout:qe,onmouseover:Ve};return Object.assign(t,e.attrs),pe(".modal-close",t,e.children)}},wp={view:e=>{const t=e.attrs.item,n=e.attrs.view,i=n.model,o=0===t.userid.indexOf("robot-");return pe("span.list-ch",{title:Ee("Skora á"),onclick:e=>{t.chall?(t.chall=!1,i.modifyChallenge({destuser:t.userid,action:"retract"})):o?i.newGame(t.userid,!1):n.pushDialog("challenge",t),e.preventDefault()}},Be("hand-right",void 0,!t.chall))}},xp={view:e=>{const t=e.attrs.item,n=e.attrs.view,i=!t.userid||0===t.userid.indexOf("robot-");return pe("span.list-info",{title:Ee("Skoða feril"),onclick:e=>{i||n.showUserInfo(t.userid,t.nick,t.fullname),e.preventDefault()}},i?"":pe("span.usr-info"))}},yp=e=>{const t=e.attrs;let n=!!t.online;const i=void 0===t.online,o=t.id,r=t.userId;return{oninit:async function(){if(i){const e=await be({method:"POST",url:"/onlinecheck",body:{user:r}});n=e&&e.online}},view:e=>{var t,r;return i||(n=null!==(r=null===(t=e.attrs)||void 0===t?void 0:t.online)&&void 0!==r&&r),pe("span",{id:o,title:Ee(n?"Er álínis":"Álínis?"),class:n?"online":""})}}},_p={view:e=>{var t;const n=e.attrs.view,i=n.model;return(null===(t=i.state)||void 0===t?void 0:t.userId)?pe(".userid",{title:Ee("player_info"),onclick:e=>{n.pushDialog("userprefs"),e.preventDefault()}},[Be("address-book"),$e(),i.state.userNick]):""}},kp=e=>{var t,n;let i=null!==(t=e.attrs.initialSelection)&&void 0!==t?t:0;const o=null!==(n=e.attrs.defaultClass)&&void 0!==n?n:"",r=e.attrs.selectedClass||"selected";return{view:e=>{const t=e.children;if(Array.isArray(t))return pe("div",{onclick:e=>{const n=t.map((e=>e.dom));for(let t=0;t<n.length;t++)n[t].contains(e.target)&&(i=t);e.stopPropagation()}},t.map(((e,t)=>{const n=e;return n.attrs.className=t===i?o+" "+r:o,e})))}}},Cp={view:()=>pe(".info",{title:Ee("Upplýsingar og hjálp")},pe(pe.route.Link,{href:"/help",class:"iconlink"},Be("info-sign")))},Ip={view:()=>pe(".logo",pe(pe.route.Link,{href:"/main",class:"nodecorate"},pe(fp,{width:24,height:46})))},Sp=()=>{function e(e,t){var n,i;const o=null===(n=document.querySelector("#"+e+" #opt1"))||void 0===n?void 0:n.classList,r=null===(i=document.querySelector("#"+e+" #opt2"))||void 0===i?void 0:i.classList;o&&o.toggle("selected"),r&&r.toggle("selected"),void 0!==t&&r&&t(r.contains("selected"))}return{view:({attrs:{id:t,small:n,funcToggle:i,state:o,tabindex:r,title:s,opt1:a,opt2:l}})=>{const c=t+"-toggler",d=".option"+(n?".small":"");return pe.fragment({},[pe("input.checkbox."+t,{type:"checkbox",id:t,name:t,checked:o,value:"True"}),pe(".toggler",{id:c,tabindex:r,title:s,onclick:t=>{e(c,i),t.preventDefault()},onkeypress:t=>{" "==t.key&&(e(c,i),t.preventDefault())}},[pe(d+(o?"":".selected"),{id:"opt1"},a),pe(d+(o?".selected":""),{id:"opt2"},l)])])}}},Tp=e=>{const t=e.attrs.view.model;function n(e){t.state&&(t.state.ready=e,t.setUserPref({ready:e}))}return{view:()=>{var e,i;return pe(Sp,{id:"ready",state:null!==(i=null===(e=t.state)||void 0===e?void 0:e.ready)&&void 0!==i&&i,tabindex:2,opt1:$e(),opt2:Be("thumbs-up"),funcToggle:n,small:!0,title:Ee("Tek við áskorunum!")})}}},Ep=e=>{const t=e.attrs.view.model;function n(e){t.state&&(t.state.readyTimed=e,t.setUserPref({ready_timed:e}))}return{view:()=>{var e,i;return pe(Sp,{id:"timed",state:null!==(i=null===(e=t.state)||void 0===e?void 0:e.readyTimed)&&void 0!==i&&i,tabindex:3,opt1:$e(),opt2:Be("time"),funcToggle:n,small:!0,title:Ee("Til í viðureign með klukku!")})}}},Lp=()=>{function e(e){e&&Ke("your-turn")}return{view:({attrs:{state:t,tabindex:n}})=>pe(Sp,{id:"audio",state:t,tabindex:n,opt1:Be("volume-off"),opt2:Be("volume-up"),funcToggle:e,small:!0,title:Ee("Hljóð á/af")})}},Pp=()=>{function e(e){e&&Ke("you-win")}return{view:({attrs:{state:t,tabindex:n}})=>pe(Sp,{id:"fanfare",state:t,tabindex:n,opt1:Be("volume-off"),opt2:Be("volume-up"),funcToggle:e,small:!0,title:Ee("Lúðraþytur á/af")})}},Rp=()=>({view:({attrs:{state:e,tabindex:t}})=>pe(Sp,{id:"beginner",state:e,tabindex:t,opt1:$e(),opt2:Be("ok"),small:!0})}),Np=()=>({view:({attrs:{state:e,tabindex:t}})=>pe(Sp,{id:"fairplay",state:e,tabindex:t,opt1:$e(),opt2:Be("edit"),small:!0})}),Ap=e=>{var t,n;const i=e.attrs,o=i.view,r=o.model,s=i.duration,a=i.oppId,l=i.challengeKey;let c=i.oppNick,d=i.oppName,h=!1;const u=null!==(n=null===(t=r.state)||void 0===t?void 0:t.userId)&&void 0!==n?n:"",p="user/"+u+"/wait/"+a;let g=!1;return{oninit:()=>{u&&a&&(!async function(){try{if(!a||!l)return;const e=await be({method:"POST",url:"/initwait",body:{opp:a,key:l}});e&&e.online&&e.waiting&&(h=!0)}catch(e){}}(),Ku(p,(e=>{!0!==e&&e.game&&(g=!0,Yu(p),pe.route.set("/game/"+e.game))})))},view:()=>pe(".modal-dialog",{id:"wait-dialog",style:{visibility:"visible"}},pe(".ui-widget.ui-widget-content.ui-corner-all",{id:"wait-form"},[pe(".chall-hdr",pe("table",pe("tbody",pe("tr",[pe("td",pe("h1.chall-icon",Be("time"))),pe("td.l-border",[pe(yp,{id:"chall-online",userId:a,online:h}),pe("h1",c),pe("h2",d)])])))),pe(".wait-explain",[Le("p",["Þú ert reiðubúin(n) að taka áskorun um viðureign með klukku, ",pe("strong",["2 x ",s.toString(),Ee(" mínútur.")])]),Le("p",["Beðið er eftir að áskorandinn ",pe("strong",c)," sé ",h?"":Le("span#chall-is-online","álínis og "),"til í tuskið."]),Le("p","Leikur hefst um leið og áskorandinn bregst við. Handahóf ræður hvor byrjar."),Le("p","Ef þér leiðist biðin geturðu hætt við og reynt aftur síðar.")]),pe(bp,{id:"wait-cancel",title:Ee("Hætta við"),onclick:e=>{g||(Yu(p),async function(){try{await be({method:"POST",url:"/cancelwait",body:{user:u,opp:a,key:l}})}catch(e){}}(),o.popDialog()),e.preventDefault()}},Be("remove"))]))}},Dp=e=>{const t=e.attrs,n=t.view,i=n.model,o=t.oppId,r=t.challengeKey;let s=t.oppNick,a=!0;return{oninit:()=>async function(){try{const e=await be({method:"POST",url:"/waitcheck",body:{user:o,key:r}});(null==e?void 0:e.waiting)?i.newGame(o,!0):a=!1}catch(e){}}(),view:()=>pe(".modal-dialog",{id:"accept-dialog",style:{visibility:"visible"}},pe(".ui-widget.ui-widget-content.ui-corner-all",{id:"accept-form"},[pe(".chall-hdr",pe("table",pe("tbody",pe("tr",[pe("td",pe("h1.chall-icon",Be("time"))),pe("td.l-border",pe("h1",s))])))),pe("div",{style:{"text-align":"center","padding-top":"32px"}},[pe("p",Le("strong","Viðureign með klukku")),Le("p",a?"Athuga hvort andstæðingur er reiðubúinn...":["Andstæðingurinn ",pe("strong",s)," er ekki reiðubúinn"])]),pe(bp,{id:"accept-cancel",title:Ee("Reyna síðar"),onclick:e=>{n.popDialog(),e.preventDefault()}},Be("remove"))]))}},Op=e=>{const t=e.attrs.view,n=t.model;function i(e){if(!e||!e.dom)return;const n=e.dom.getElementsByClassName("btn-promo-no");if(n)for(let e of n)e.onclick=e=>{t.popDialog(),e.preventDefault()},e.onmouseover=Ve,e.onmouseout=qe;const i=e.dom.getElementsByClassName("btn-promo-yes");if(i){for(let e of i)e.onmouseover=Ve,e.onmouseout=qe;Xe()}}return n.loadFriendPromo(),{view:()=>pe(".modal-dialog",{id:"promo-dialog",style:{visibility:"visible"}},pe(".ui-widget.ui-widget-content.ui-corner-all",{id:"promo-form"},pe(".promo-content",{oncreate:e=>i(e),onupdate:e=>i(e)},pe.trust(n.friendHTML||"<p>Sæki texta...</p>"))))}},Mp=e=>({view:()=>pe(".modal-dialog",{id:"thanks-dialog",style:{visibility:"visible"}},pe(".ui-widget.ui-widget-content.ui-corner-all",{id:"thanks-form"},[pe(".thanks-content",[pe("h3","Frábært!"),pe("p",["Bestu þakkir fyrir að gerast ",Be("coffee-cup"),$e(),pe("b","Vinur Netskrafls"),"."]),pe("p",["Fríðindi þín virkjast um leið og greiðsla hefur verið staðfest. ",pe("b","Það getur tekið nokkrar mínútur.")," Þú færð staðfestingu og kvittun í tölvupósti."])]),pe(bp,{id:"btn-thanks",title:"Áfram",onclick:e=>{pe.route.set("/main"),e.preventDefault()}},Be("ok"))]))}),Fp=e=>{const t=e.attrs.view;return{view:()=>pe(".modal-dialog",{id:"cancel-dialog",style:{visibility:"visible"}},pe(".ui-widget.ui-widget-content.ui-corner-all",{id:"cancel-form"},[pe("div",{id:"cancel-content"},[pe("h3","Hætta sem vinur Netskrafls?"),pe("p",["Viltu hætta sem ",Be("coffee-cup"),$e(),pe("b","vinur Netskrafls")," og missa þar með þau fríðindi sem því tengjast?"]),pe("p","Fríðindin eru:"),pe("ul",[pe("li",[pe("b","Ótakmarkaður fjöldi viðureigna")," í gangi samtímis",pe("br"),"(í stað 8 að hámarki)"]),pe("li",["Aðgangur að ",pe("b","yfirliti")," í lok viðureignar"]),pe("li",[pe("b","Keppnishamur"),' án "græna þumalsins"'])]),pe(bp,{id:"btn-cancel-no",title:"Nei",onclick:e=>{e.preventDefault(),t.popDialog()}},[Be("remove")," Nei"]),pe(bp,{id:"btn-cancel-yes",title:"Já",onclick:e=>{e.preventDefault(),t.popDialog(),t.cancelFriendship()}},[Be("ok")," Já, vil hætta"])])]))}},zp=e=>{const t=e.attrs.view;return{view:()=>pe(".modal-dialog",{id:"confirm-dialog",style:{visibility:"visible"}},pe(".ui-widget.ui-widget-content.ui-corner-all",{id:"confirm-form"},[pe(".confirm-content",[pe("h3","Staðfesting"),pe("p",["Þú ert ekki lengur skráð(ur) sem ",Be("coffee-cup"),$e(),pe("b","vinur Netskrafls"),"."])]),pe(bp,{id:"btn-thanks",title:"Áfram",onclick:e=>{e.preventDefault(),t.popDialog()}},Be("ok"))]))}},Up={view:e=>{var t;return pe("div.error",{style:{visibility:"visible"}},(null===(t=e.attrs)||void 0===t?void 0:t.message)||"Error logging in")}},jp=e=>{const t=e.attrs.loginUrl;let n=!1;function i(e){n=!0,e.preventDefault(),window.location.href=t}return{view:()=>pe.fragment({},[pe("div.loginform-large",[pe(up,{className:"login-logo",width:200,withCircle:!1,msStepTime:150,once:!0}),pe(gp,{className:"login-legend",width:600,msStepTime:0}),Le("div.welcome","welcome_0"),Le("div.welcome","welcome_1"),Le("div.welcome","welcome_2"),pe("div.login-btn-large",{onclick:i},n?Te("Skrái þig inn..."):[Te("Innskrá")+" ",pe("span.glyphicon.glyphicon-play")])]),pe("div.loginform-small",[pe(up,{className:"login-logo",width:160,withCircle:!1,msStepTime:150,once:!0}),pe(gp,{className:"login-legend",width:650,msStepTime:0}),pe("div.login-btn-small",{onclick:i},Te(n?"Skrái þig inn...":"Innskrá"))])])}},Vp=()=>{let e=!1;return{view:t=>{const{view:n,item:i}=t.attrs,o=n.model,r=o.state;if(!r)return;const s=""!==r.plan,a=i.fairplay&&r.fairPlay;return pe(".modal-dialog",{id:"chall-dialog",style:{visibility:"visible"}},pe(".ui-widget.ui-widget-content.ui-corner-all",{id:"chall-form"},[pe(".chall-hdr",pe("table",pe("tbody",pe("tr",[pe("td",pe("h1.chall-icon",Be("hand-right"))),pe("td.l-border",[pe(yp,{id:"chall-online",userId:i.userid}),pe("h1",i.nick),pe("h2",i.fullname)])])))),pe("div",{style:{"text-align":"center"}},[pe(".promo-fullscreen",[Le("p",[Le("strong","Ný áskorun")," - veldu lengd viðureignar:"]),pe(kp,{initialSelection:0,defaultClass:"chall-time"},[pe("div",{id:"chall-none",tabindex:1},Te("Viðureign án klukku")),pe("div",{id:"chall-10",tabindex:2},[Be("time"),Te("2 x 10 mínútur")]),pe("div",{id:"chall-15",tabindex:3},[Be("time"),Te("2 x 15 mínútur")]),pe("div",{id:"chall-20",tabindex:4},[Be("time"),Te("2 x 20 mínútur")]),pe("div",{id:"chall-25",tabindex:5},[Be("time"),Te("2 x 25 mínútur")]),(null==r?void 0:r.runningLocal)?pe("div",{id:"chall-3",tabindex:6},[Be("time"),Te("2 x 3 mínútur")]):pe("div",{id:"chall-30",tabindex:6},[Be("time"),Te("2 x 30 mínútur")])])]),pe(".promo-mobile",[pe("p",Le("strong","Ný áskorun")),pe(".chall-time.selected",{id:"extra-none",tabindex:1},Te("Viðureign án klukku"))])]),s?pe("div",{id:"chall-manual"},[Le("span.caption.wide",["Nota ",Le("strong","handvirka véfengingu"),pe("br"),'("keppnishamur")']),pe(".toggler[id='manual-toggler'][tabindex='7']",{onclick:t=>{e=!e,t.preventDefault()}},[pe(".option"+(e?"":".selected"),pe("span",$e())),pe(".option"+(e?".selected":""),Be("lightbulb"))])]):"",a?pe("div",{id:"chall-fairplay"},[Te("Báðir leikmenn lýsa því yfir að þeir skrafla "),pe("br"),Le("strong","án stafrænna hjálpartækja"),Te(" af nokkru tagi"),"."]):"",pe(bp,{id:"chall-cancel",title:Ee("Hætta við"),tabindex:8,onclick:e=>{n.popDialog(),e.preventDefault()}},Be("remove")),pe(bp,{id:"chall-ok",title:Ee("Skora á"),tabindex:9,onclick:t=>{var r,s;let l=null!==(s=null===(r=document.querySelector("div.chall-time.selected"))||void 0===r?void 0:r.id.slice(6))&&void 0!==s?s:"0";l="none"===l?0:parseInt(l),i.chall=!0,o.modifyChallenge({destuser:i.userid,action:"issue",duration:l,fairplay:a,manual:e}),n.popDialog(),t.preventDefault()}},Be("ok"))]))}}},qp=()=>{function e(e,t){let n=e.elo_adj?e.elo_adj.toString():"",i=e.human_elo_adj?e.human_elo_adj.toString():"",o="",r="";return null!==e.elo_adj&&(e.elo_adj>0?(n="+"+n,o="elo-win"):e.elo_adj<0?o="elo-loss":(o="elo-neutral",n=Be("stroller",{title:"Byrjandi"})),null!==e.human_elo_adj&&(e.human_elo_adj>0?(i="+"+i,r="elo-win"):e.human_elo_adj<0?r="elo-loss":(r="elo-neutral",i=Be("stroller",{title:"Byrjandi"})))),n=pe("span",{class:"elo-btn right "+o+(""==n?" invisible":"")},n),i=pe("span",{class:"elo-btn left "+r+(""==i?" invisible":"")},i),pe(".listitem"+(t%2==0?".oddlist":".evenlist"),pe(pe.route.Link,{href:Ye(e.url)},[pe("span.list-win",e.sc0>=e.sc1?Be("bookmark",{title:e.sc0==e.sc1?Ee("Jafntefli"):Ee("Sigur")}):He("bookmark",{title:Ee("Tap")})),pe("span.list-ts-short",e.ts_last_move),pe("span.list-nick",e.opp_is_robot?[Be("cog"),$e(),e.opp]:e.opp),pe("span.list-s0",e.sc0),pe("span.list-colon",":"),pe("span.list-s1",e.sc1),pe("div.list-elo-adj",i),pe("div.list-elo-adj",n),pe("span.list-duration",function(){let t="";return e.duration?t=[pe("span.timed-btn",{title:Ee("Viðureign með klukku")})," 2 x "+e.duration+Ee(" mínútur")]:(e.days||e.hours||e.minutes)&&(e.days>1?t=e.days.toString()+Ee(" dagar"):1==e.days&&(t=Ee("1 dagur")),e.hours>0&&(t.length&&(t+=Ee(" og ")),1==e.hours?t+=Ee("1 klst"):t+=e.hours.toString()+Ee(" klst")),0===e.days&&(t.length&&(t+=Ee(" og ")),1==e.minutes?t+=Ee("1 mínúta"):t+=e.minutes.toString()+Ee(" mínútur"))),t}()),pe("span.list-manual",e.manual?{title:Ee("Keppnishamur")}:{},Be("lightbulb",void 0,!e.manual))]))}return{view:t=>{const n=t.attrs.recentList;return pe("div",{id:t.attrs.id},n?n.map(e):"")}}},Bp={oninit:e=>{e.state.sel=e.attrs.sel},view:e=>pe(".toggler[id='elo-toggler']",{title:Ee("elo_list_choice")},[pe(".option.x-small",{className:"human"===e.state.sel?"selected":"",onclick:t=>{e.state.sel="human",e.attrs.onchange(e.state.sel),t.preventDefault()}},Be("user")),pe(".option.x-small",{className:"all"===e.state.sel?"selected":"",onclick:t=>{e.state.sel="all",e.attrs.onchange(e.state.sel),t.preventDefault()}},Be("cog")),pe(".option.x-small",{className:"manual"===e.state.sel?"selected":"",onclick:t=>{e.state.sel="manual",e.attrs.onchange(e.state.sel),t.preventDefault()}},Be("lightbulb"))])},Hp=e=>{const{spec:t,view:n}=e.attrs;return{view:e=>pe("div",[pe(".listitem.listheader",[pe("span.list-ch",He("hand-right",{title:Ee("Skora á")})),Le("span.list-rank","Röð"),pe("span.list-rank-no-mobile",{title:Ee("Röð í gær")},Ee("1d")),pe("span.list-rank-no-mobile",{title:Ee("Röð fyrir viku")},Ee("7d")),Le("span.list-nick-elo","Einkenni"),pe("span.list-elo",{title:Ee("Elo-stig")},Ee("Elo")),pe("span.list-elo-no-mobile",{title:Ee("Elo-stig í gær")},Ee("1d")),pe("span.list-elo-no-mobile",{title:Ee("Elo-stig fyrir viku")},Ee("7d")),pe("span.list-elo-no-mobile",{title:Ee("Elo-stig fyrir mánuði")},Ee("30d")),pe("span.list-games",{title:Ee("Fjöldi viðureigna")},Be("th")),pe("span.list-ratio",{title:Ee("Vinningshlutfall")},Be("bookmark")),pe("span.list-avgpts",{title:Ee("Meðalstigafjöldi")},Be("dashboard")),Le("span.list-info-hdr","Ferill"),pe(Bp,{sel:t||"human",onchange:e=>{n.model.loadEloRatingList(e,!0)}})]),pe($p,{id:e.attrs.id,sel:t,view:e.attrs.view})])}},$p=e=>{const t=e.attrs.view,n=t.model,i=n.state;return{view:e=>{const o=n.eloRatingList||[];return pe("div",{id:e.attrs.id},o.map((function(n,o){var r;const s=0===n.userid.indexOf("robot-");function a(e,t){return 0===e||void 0!==t&&0===t?"--":e.toString()}let l=n.nick,c=pe("span.list-ch",$e());const d=null!==(r=null==i?void 0:i.userId)&&void 0!==r?r:"";return n.userid==d||n.inactive||(c=pe(wp,{view:t,item:n})),s&&(l=pe("span",[Be("cog"),$e(),l])),n.fairplay&&!s&&(l=pe("span",[pe("span.fairplay-btn",{title:Ee("Skraflar án hjálpartækja")}),l])),pe(".listitem",{key:(e.attrs.sel||"sel")+o,className:o%2==0?"oddlist":"evenlist"},[c,pe("span.list-rank.bold",a(n.rank)),pe("span.list-rank-no-mobile",a(n.rank_yesterday)),pe("span.list-rank-no-mobile",a(n.rank_week_ago)),pe("span.list-nick-elo",{title:n.fullname},l),pe("span.list-elo.bold",n.elo),pe("span.list-elo-no-mobile",a(n.elo_yesterday,n.games_yesterday)),pe("span.list-elo-no-mobile",a(n.elo_week_ago,n.games_week_ago)),pe("span.list-elo-no-mobile",a(n.elo_month_ago,n.games_month_ago)),pe("span.list-games.bold",n.games>=1e5?Math.round(n.games/1e3)+"K":n.games),pe("span.list-ratio",n.ratio+"%"),pe("span.list-avgpts",n.avgpts),n.userid===d?$e():pe(xp,{view:t,item:n})])})))}}},Wp=()=>{let e=1;function t(e,t,n){var i=void 0===e?"":function(e,t=1e4){const n=e<0?"-":"";return(e=Math.abs(e))<t?`${n}${e}`:`${n}${e=Math.round(e/1e3)}K`}(e);return void 0!==n&&(i+=n),t?[Be(t),$e(),i]:i}return{view:n=>{var i,o,r=n.attrs.ownStats,s=0,a=0,l=0,c=0;return void 0!==r&&void 0!==r.games&&void 0!==r.human_games&&(r.games>0&&(s=Math.round(100*r.wins/r.games),l=Math.round(r.score/r.games)),r.human_games>0&&(a=Math.round(100*r.human_wins/r.human_games),c=Math.round(r.human_score/r.human_games))),pe("div",{id:n.attrs.id},[pe(".toggler",{id:"own-toggler",title:Ee("stats_choice"),onclick:t=>{e=3-e,t.preventDefault()}},[pe(".option.small"+(1===e?".selected":""),{id:"opt1"},Be("user")),pe(".option.small"+(2===e?".selected":""),{id:"opt2"},Be("cog"))]),1===e?pe("div",{id:"own-stats-human",className:"stats-box",style:{display:"inline-block"}},[pe(".stats-fig",{title:Ee("Elo-stig")},r?t(null===(i=r.locale_elo)||void 0===i?void 0:i.human_elo,"crown"):""),pe(".stats-fig.stats-games",{title:Ee("Fjöldi viðureigna")},r?t(r.human_games,"th"):""),pe(".stats-fig.stats-win-ratio",{title:Ee("Vinningshlutfall")},t(a,"bookmark","%")),pe(".stats-fig.stats-avg-score",{title:Ee("Meðalstigafjöldi")},t(c,"dashboard"))]):"",2===e?pe("div",{id:"own-stats-all",className:"stats-box",style:{display:"inline-block"}},[pe(".stats-fig",{title:Ee("Elo-stig")},r?t(null===(o=r.locale_elo)||void 0===o?void 0:o.elo,"crown"):""),pe(".stats-fig.stats-games",{title:Ee("Fjöldi viðureigna")},r?t(r.games,"th"):""),pe(".stats-fig.stats-win-ratio",{title:Ee("Vinningshlutfall")},t(s,"bookmark","%")),pe(".stats-fig.stats-avg-score",{title:Ee("Meðalstigafjöldi")},t(l,"dashboard"))]):""])}}},Gp=e=>{const t=e.attrs.view.model;let n,i="";function o(){var e,o;if(void 0!==n&&(n.result=!1,n=void 0),"search"!==((null===(e=t.userListCriteria)||void 0===e?void 0:e.query)||"robots"))return void t.loadUserList({query:"search",spec:i},!0);if(i===(null===(o=t.userListCriteria)||void 0===o?void 0:o.spec))return;let r={result:!0,p:new Promise((e=>{setTimeout((()=>{e(r.result)}),800)}))};n=r,n.p.then((e=>{e&&(t.loadUserList({query:"search",spec:i},!0),n=void 0)}))}return{view:()=>{var e;const n=(null===(e=t.userListCriteria)||void 0===e?void 0:e.query)||"robots";return pe(".user-cat[id='user-search']",[Be("search",{id:"search",className:"search"==n?"shown":"",onclick:()=>{var e;i="",o(),null===(e=document.getElementById("search-id"))||void 0===e||e.focus()}}),$e(),pe("input.text.userid",{type:"text",id:"search-id",name:"search-id",maxlength:16,placeholder:Ee("Einkenni eða nafn"),value:i,onfocus:()=>o(),oninput:e=>{i=e.target.value+"",o()}})])}}},Kp="/page#!";function Yp(e,t,n,i,o){let r=document.getElementById(t);if(!r)return;r.setAttribute("class","ui-tabs ui-widget ui-widget-content ui-corner-all");const s=document.querySelector("#"+t+" > ul");s&&(s.setAttribute("class","ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all"),s.setAttribute("role","tablist"));let a=document.querySelectorAll("#"+t+" > ul > li > a"),l=document.querySelectorAll("#"+t+" > ul > li"),c=[],d=[];for(let e=0;e<a.length;e++){const t=a[e].getAttribute("href");if(!t)continue;c.push(t.slice(1)),a[e].onclick=t=>{Zp(o,e),t.preventDefault()},a[e].removeAttribute("href"),a[e].setAttribute("class","ui-tabs-anchor sp"),a[e].setAttribute("role","presentation"),d.push(l[e]),l[e].setAttribute("class","ui-state-default ui-corner-top"),l[e].setAttribute("role","tab"),l[e].onmouseover=e=>{e.currentTarget.classList.toggle("ui-state-hover",!0)},l[e].onmouseout=e=>{e.currentTarget.classList.toggle("ui-state-hover",!1)};const n=document.getElementById(c[e]);n&&(n.setAttribute("class","ui-tabs-panel ui-widget-content ui-corner-bottom"),n.setAttribute("role","tabpanel"))}if(o.state.ids=c,o.state.lis=d,o.state.selected=0,i){const t=e.model,n=(e,t)=>{let n=t.slice(7),i=n.indexOf("?"),o=i>=0?n.slice(0,i):n,r=n.slice(o.length+1),s=r.length?function(e){const t=e.split("&"),n={};for(let e=0;e<t.length;e++){const i=t[e].split("=");2==i.length&&(n[i[0]]=decodeURIComponent(i[1]))}return n}(r):{};pe.route.set(o,s),window.history&&window.history.pushState({},"",t),e.preventDefault()},i=n=>{var i;(null===(i=null==t?void 0:t.state)||void 0===i?void 0:i.userId)&&e.pushDialog("userprefs"),n.preventDefault()},s=e=>{Zp(o,2),e.preventDefault()},a=e=>{Zp(o,3),e.preventDefault()};let l=r.querySelectorAll("a");for(let e=0;e<l.length;e++){let t=l[e],o=t.getAttribute("href");o&&o.slice(0,7)==Kp?t.onclick=e=>n(e,o):o&&"$$userprefs$$"===o?t.onclick=i:o&&"$$twoletter$$"===o?t.onclick=s:o&&"$$newbag$$"===o&&(t.onclick=a)}}n&&n(o),Jp(o)}function Jp(e){const t=e.state.selected,n=e.state.lis;e.state.ids.map(((e,i)=>{var o;null===(o=document.getElementById(e))||void 0===o||o.setAttribute("style","display: "+(i==t?"block":"none")),n[i].classList.toggle("ui-tabs-active",i===t),n[i].classList.toggle("ui-state-active",i===t)}))}function Zp(e,t){e.state.selected=t,Jp(e)}function Qp(e){var t=pe.route.param("tab");void 0!==t&&Zp(e,parseInt(t)||0)}const Xp=()=>({view:e=>{const t=e.attrs.ownStats||{},n=[];if(t.highest_score&&(n.push(Ee("Hæsta skor ")),n.push(pe("b",pe(pe.route.Link,{href:"/game/"+t.highest_score_game},t.highest_score)))),t.best_word){n.length&&(e.attrs.myself?n.push(pe("br")):n.push(" | "));let i=t.best_word,o=[];for(let e=0;e<i.length;e++)"?"==i[e]?(o.push(pe("span.blanktile",i[e+1])),e+=1):o.push(i[e]);n.push(Ee("Besta orð ")),n.push(pe("span.best-word",o)),n.push(", "),n.push(pe("b",pe(pe.route.Link,{href:"/game/"+t.best_word_game},t.best_word_score))),n.push(Ee(" stig"))}return pe("p",{id:e.attrs.id},n)}}),eg=()=>{function e(e){const t=e.model;function n(n){const i=function(){if(!t.state)return;const i=t.state;let o=[];return t.challengeList&&(o=n?t.challengeList.filter((e=>e.received)):t.challengeList.filter((e=>!e.received))),pe("div",{id:n?"chall-received":"chall-sent",oninit:()=>{null===t.challengeList&&t.loadChallengeList()}},o.map((function(n,o){const r=!n.received&&n.opp_ready&&n.prefs&&void 0!==n.prefs.duration&&n.prefs.duration>0,s=n.received||r,a=(l=n.prefs)&&void 0!==l.duration&&0!==l.duration?Te("with_clock",{duration:l.duration.toString()}):Te("Venjuleg ótímabundin viðureign");var l;return pe(".listitem"+(o%2==0?".oddlist":".evenlist"),[pe("span.list-ch",{onclick:function(e){const i=n.received?"decline":"retract",o={destuser:n.userid,action:i,key:n.key};t.modifyChallenge(o),e.preventDefault()}},n.received?Be("thumbs-down",{title:Ee("Hafna")}):Be("hand-right",{title:Ee("Afturkalla")})),pe(s?"a":"span",s?{href:"#",onclick:function(o){if(o.preventDefault(),!t.moreGamesAllowed())return Ju("hit_game_limit",{userid:i.userId,locale:i.locale,limit:t.maxFreeGames}),void e.showFriendPromo();n.received?n.prefs&&void 0!==n.prefs.duration&&n.prefs.duration>0?e.pushDialog("wait",{oppId:n.userid,oppNick:n.opp,oppName:n.fullname,duration:n.prefs.duration,challengeKey:n.key}):t.newGame(n.userid,!1):e.showAcceptDialog(n.userid,n.opp,n.key)},class:r?"opp-ready":""}:{},[pe("span.list-ts",n.ts),pe("span.list-nick",{title:n.fullname},n.opp),pe("span.list-chall",[n.prefs.fairplay?pe("span.fairplay-btn",{title:Ee("Án hjálpartækja")}):"",n.prefs.manual?pe("span.manual-btn",{title:Ee("Keppnishamur")}):"",a])]),pe(xp,{view:e,item:{userid:n.userid,nick:n.opp,fullname:n.fullname}})])})))}();return i?n?[pe(".listitem.listheader",[pe("span.list-icon",He("thumbs-down",{title:Ee("Hafna")})),Le("span.list-ts","Hvenær"),Le("span.list-nick","Áskorandi"),Le("span.list-chall","Hvernig"),Le("span.list-info-hdr","Ferill")]),i]:[pe(".listitem.listheader",[pe("span.list-icon",He("hand-right",{title:Ee("Afturkalla")})),Le("span.list-ts","Hvenær"),Le("span.list-nick","Andstæðingur"),Le("span.list-chall","Hvernig"),Le("span.list-info-hdr","Ferill")]),i]:[]}function i(e,n,i){var o;const r=(null===(o=t.userListCriteria)||void 0===o?void 0:o.query)||"robots";return pe("span",{className:e===r?"shown":"",id:e,onclick:n=>{"elo"===e?(t.userListCriteria={query:"elo",spec:"human"},t.userList=null,t.loadEloRatingList("human",!0)):(t.loadUserList({query:e,spec:""},!0),t.eloRatingSpec=null,t.eloRatingList=null),n.preventDefault()}},[Be(n,{style:{padding:0}}),$e(),i])}function o(){var n,i,o,r,s;const a=null!==(i=null===(n=t.userListCriteria)||void 0===n?void 0:n.query)&&void 0!==i?i:"",l=null!==(r=null===(o=t.userListCriteria)||void 0===o?void 0:o.spec)&&void 0!==r?r:"",c=void 0===t.eloRatingSpec,d=a||"robots";if("elo"===d||c)return[pe(Hp,{id:"elolist",view:e,spec:null!==(s=t.eloRatingSpec)&&void 0!==s?s:null,key:"elopage"})];let h=[];void 0===t.userList||(null===t.userList||a!==d?t.loadUserList({query:d,spec:""},!0):h=t.userList);const u=0===h.length&&"search"===d&&""!==l,p="robots"===d;return[pe(".listitem.listheader",[pe("span.list-ch",He("hand-right",{title:Ee("Skora á")})),pe("span.list-fav",Be("star-empty",{title:Ee("Uppáhald")})),Le("span.list-nick","Einkenni"),Le("span.list-fullname","Nafn og merki"),p?"":Le("span.list-human-elo[id='usr-list-elo']","Elo"),p?"":Le("span.list-info-hdr[id='usr-list-info']","Ferill")]),function(n){return pe("div",{id:"userlist"},n.map((function(n,i){const o=0===n.userid.indexOf("robot-");let r=[];return n.ready&&!o&&(r.push(pe("span.ready-btn",{title:Ee("Álínis og tekur við áskorunum")})),r.push($e())),n.ready_timed&&(r.push(pe("span.timed-btn",{title:Ee("Til í viðureign með klukku")})),r.push($e())),n.fairplay&&(r.push(pe("span.fairplay-btn",{title:Ee("Skraflar án hjálpartækja")})),r.push($e())),r.push(n.fullname),pe(".listitem"+(i%2==0?".oddlist":".evenlist"),[pe(wp,{view:e,item:n}),o?pe("span.list-fav",{style:{cursor:"default"}},Be("star-empty")):pe("span.list-fav",{title:Ee("Uppáhald"),onclick:e=>{n.fav=!n.fav,t.markFavorite(n.userid,n.fav),e.preventDefault()}},Be(n.fav?"star":"star-empty")),o?pe("a",{href:"",onclick:e=>{t.newGame(n.userid,!1),e.preventDefault()}},[pe("span.list-nick",[Be("cog"),$e(),n.nick]),pe("span.list-fullname-robot",r)]):pe.fragment({},[pe("span.list-nick",n.nick),pe("span.list-fullname",r),pe("span.list-human-elo",n.human_elo)]),pe(xp,{view:e,item:n})])})))}(h),u?pe("div",{id:"user-no-match",style:{display:"block"}},[Be("search")," ",pe("span",{id:"search-prefix"},l),Te(" finnst ekki")]):void 0]}function r(){const n=t.ownStats;return null===n&&t.loadOwnStats(),n&&pe(Wp,{view:e,id:"own-stats",ownStats:n})}function s(){const e=t.ownStats;return null===e&&t.loadOwnStats(),e&&pe(Xp,{id:"own-best",ownStats:e,myself:!0})}return pe(".tabbed-page",pe("div",{id:"main-tabs"},[function(){const e=t.numGames,n=t.numChallenges;return[pe(".header-logo",pe(pe.route.Link,{href:"/page",class:"backlink"},pe(fp,{width:24,height:46}))),pe("ul",[pe("li",pe("a[href='#tabs-1']",[Be("th"),pe("span.tab-legend",Te("Viðureignir")),pe("span",{id:"numgames",style:e?"display: inline-block":""},e)])),pe("li",pe("a[href='#tabs-2']",[Be("hand-right"),pe("span.tab-legend",Te("Áskoranir")),pe("span"+(t.oppReady?".opp-ready":""),{id:"numchallenges",style:n?"display: inline-block":""},n)])),pe("li",pe("a[href='#tabs-3']",[Be("user"),pe("span.tab-legend",Te("Andstæðingar"))])),pe("li.no-mobile-list",pe("a[href='#tabs-4']",[Be("bookmark"),pe("span.tab-legend",Te("Ferill"))]))])]}(),pe("div.tab-scroll-area",[pe("div",{id:"tabs-1"},[Le("p.no-mobile-block",[Le("strong","Viðureignir sem standa yfir"),"click_on_game",Be("flag")," þú átt leik"]),[pe(".listitem.listheader",[pe("span.list-myturn",He("flag",{title:Ee("Átt þú leik?")})),pe("span.list-overdue",He("hourglass",{title:Ee("Langt frá síðasta leik?")})),Le("span.list-ts-short","Síðasti leikur"),Le("span.list-opp","Andstæðingur"),Le("span.list-info-hdr","Ferill"),Le("span.list-scorehdr","Staða"),Le("span.list-tc","Framvinda"),pe("span.list-manual",He("lightbulb",{title:Ee("Keppnishamur")}))]),(null===t.gameList&&t.loadGameList(),pe("div",{id:"gamelist"},t.gameList?t.gameList.map(((t,n)=>pe(".listitem"+(n%2==0?".oddlist":".evenlist"),[pe(pe.route.Link,{href:Ye(t.url)},[function(){let e="",n="";return t.my_turn?e=Ee("Þú átt leik"):t.zombie?(e=Ee("Viðureign lokið"),n=".zombie"):(e=Ee("opp_move",{opponent:t.opp}),n=".grayed"),pe("span.list-myturn",pe("span.glyphicon.glyphicon-flag"+n,{title:e}))}(),pe("span.list-overdue",t.overdue?Be("hourglass",{title:t.my_turn?"Er að renna út á tíma":"Getur þvingað fram uppgjöf"}):He("hourglass")),pe("span.list-ts-short",t.ts),function(){let e=null===t.oppid?[Be("cog"),$e(),t.opp]:t.opp;return pe("span.list-opp",{title:t.fullname},e)}()]),pe(xp,{view:e,item:{userid:t.oppid,nick:t.opp,fullname:t.fullname}}),pe("span.list-s0",t.sc0),pe("span.list-colon",":"),pe("span.list-s1",t.sc1),pe("span.list-tc",function(){const e=t.sc0<t.sc1?".losing":"";return pe(".tilecount",pe(".tc"+e,{style:{width:t.tile_count.toString()+"%"}}))}()),pe("span.list-manual",t.manual?Be("lightbulb",{title:Ee("Keppnishamur")}):He("lightbulb"))]))):"")),t.loadingGameList||void 0===t.gameList||null!==t.gameList&&t.gameList.length>0?"":pe(".hint",{style:{display:"block"}},[pe("p",["Ef þig vantar einhvern til að skrafla við, veldu flipann ",pe(pe.route.Link,{href:"/main?tab=2"},[Be("user"),$e(),"Andstæðingar"])," og skoraðu á tölvuþjarka - ",Be("cog"),$e(),pe("b","Amlóða"),", ",Be("cog"),$e(),pe("b","Miðlung")," eða ",Be("cog"),$e(),pe("b","Fullsterkan")," - eða veldu þér annan leikmann úr stafrófslistunum sem þar er að finna til að skora á."]),pe("p",["Þú stofnar áskorun með því að smella á bendi-teiknið ",Be("hand-right",{style:{"margin-left":"6px","margin-right":"6px"}})," vinstra megin við nafn andstæðingsins."]),pe("p","Tölvuþjarkarnir eru ætíð reiðubúnir að skrafla og viðureign við þá hefst strax. Aðrir leikmenn þurfa að samþykkja áskorun áður en viðureign hefst."),pe("p.no-mobile-block",[pe(pe.route.Link,{href:"/help"},"Hjálp")," má fá með því að smella á bláa ",Be("info-sign"),$e(),"-",$e(),"teiknið hér til vinstri."]),pe("p.no-mobile-block","Þú kemst alltaf aftur í þessa aðalsíðu með því að smella á örvarmerkið efst vinstra megin við skraflborðið.")])]]),pe("div",{id:"tabs-2"},[Le("p.no-mobile-block",[Le("strong","Skorað á þig"),"click_on_challenge",Be("thumbs-down",{style:{"margin-left":"6px","margin-right":"6px"}})," til að hafna henni"]),n(!0),Le("p.no-mobile-block",[Le("strong","Þú skorar á aðra")," - smelltu á ",Be("hand-right",{style:{"margin-left":"6px","margin-right":"6px"}})," til að afturkalla áskorun"]),n(!1)]),pe("div",{id:"tabs-4"},[r(),s(),Le("p.no-mobile-block",[Le("strong","Nýlegar viðureignir þínar"),"click_to_review"]),[pe(".listitem.listheader",[pe("span.list-win",He("bookmark",{title:Ee("Sigur")})),Le("span.list-ts-short","Viðureign lauk"),Le("span.list-nick","Andstæðingur"),Le("span.list-scorehdr","Úrslit"),pe("span.list-elo-hdr",[pe("span.glyphicon.glyphicon-user.elo-hdr-left",{title:Ee("Mennskir andstæðingar")}),Te("Elo"),pe("span.glyphicon.glyphicon-cog.elo-hdr-right",{title:Ee("Allir andstæðingar")})]),Le("span.list-duration","Lengd"),pe("span.list-manual",He("lightbulb",{title:Ee("Keppnishamur")}))]),(null===t.recentList&&t.loadRecentList(),pe(qp,{view:e,id:"recentlist",recentList:t.recentList||[]}))]]),pe("div",{id:"tabs-3"},[pe("div",{id:"initials"},[pe(".user-cat[id='user-headings']",[i("robots","cog",Ee("Þjarkar"))," ",i("fav","star",Ee("Uppáhalds"))," ",i("live","flash",Ee("Álínis"))," ",i("alike","resize-small",Ee("Svipaðir"))," ",i("elo","crown",Ee("Topp 100"))]),pe(Gp,{view:e})]),o()])])]))}return{view:t=>{const n=t.attrs.view;return pe.fragment({},[pe(Ip),pe(_p,{view:n}),pe(Cp),pe(Tp,{view:n}),pe(Ep,{view:n}),pe("div",{oncreate:e=>{Yp(n,"main-tabs",void 0,!1,e)},onupdate:Qp},e(n))])}}},tg=e=>{const t=e.attrs.view,n=t.model;let i="";return{oninit:function(e){n.loadPromoContent(e.attrs.kind,(e=>{i=e}))},view:e=>{let n=e.attrs.initFunc;return pe(".modal-dialog",{id:"promo-dialog",style:{visibility:"visible"}},pe(".ui-widget.ui-widget-content.ui-corner-all",{id:"promo-form",className:"promo-"+e.attrs.kind},pe("div",{id:"promo-content",onupdate:e=>function(e,n){var i=e.dom.getElementsByClassName("btn-promo-no");for(let e=0;e<i.length;e++)i[e].onclick=()=>t.popDialog(),i[e].onmouseover=Ve,i[e].onmouseout=qe;var o=e.dom.getElementsByClassName("btn-promo-yes");for(let e=0;e<o.length;e++)o[e].onmouseover=Ve,o[e].onmouseout=qe;void 0!==n&&n()}(e,n)},pe.trust(i))))}}},ng=e=>{const t=e.attrs.view,n=t.model;let i={},o=[],r=!0;function s(e){var t,i;n.loadUserRecentList(e.attrs.userid,r?null:null!==(i=null===(t=n.state)||void 0===t?void 0:t.userId)&&void 0!==i?i:"",(e=>{o=e&&0===e.result?e.recentlist:[]}))}function a(e,t){r!=t&&(r=t,s(e))}return{oninit:e=>{s(e),function(e){n.loadUserStats(e.attrs.userid,(e=>{i=e&&0===e.result?e:{}}))}(e)},view:e=>pe(".modal-dialog",{id:"usr-info-dialog",style:{visibility:"visible"}},pe(".ui-widget.ui-widget-content.ui-corner-all",{id:"usr-info-form"},[pe(".usr-info-hdr",[pe("h1.usr-info-icon",[i.friend?Be("coffee-cup",{title:Ee("Vinur Netskrafls")}):Be("user"),$e()]),pe("h1[id='usr-info-nick']",e.attrs.nick),pe("span.vbar","|"),pe("h2[id='usr-info-fullname']",e.attrs.fullname),pe(".usr-info-fav",{title:Ee("Uppáhald"),onclick:t=>{t.preventDefault(),i.favorite=!i.favorite,n.markFavorite(e.attrs.userid,i.favorite)}},i.favorite?Be("star"):Be("star-empty"))]),pe("p",[pe("strong",Te("Nýjustu viðureignir")),$e(),pe("span.versus-cat",[pe("span",{class:r?"shown":"",onclick:()=>{a(e,!0)}},Te(" gegn öllum ")),pe("span",{class:r?"":"shown",onclick:()=>{a(e,!1)}},Te(" gegn þér "))])]),pe(".listitem.listheader",[pe("span.list-win",He("bookmark",{title:Ee("Sigur")})),Le("span.list-ts-short","Viðureign lauk"),Le("span.list-nick","Andstæðingur"),Le("span.list-scorehdr","Úrslit"),pe("span.list-elo-hdr",[pe("span.glyphicon.glyphicon-user.elo-hdr-left",{title:Ee("Mennskir andstæðingar")}),"Elo",pe("span.glyphicon.glyphicon-cog.elo-hdr-right",{title:Ee("Allir andstæðingar")})]),Le("span.list-duration","Lengd"),pe("span.list-manual",He("lightbulb",{title:Ee("Keppnishamur")}))]),pe(qp,{view:t,id:"usr-recent",recentList:o}),pe(Wp,{view:t,id:"usr-stats",ownStats:i}),pe(Xp,{id:"usr-best",ownStats:i,myself:!1}),pe(bp,{id:"usr-info-close",title:Ee("Loka"),onclick:e=>{t.popDialog(),e.preventDefault()}},Be("ok"))]))}},ig=e=>{const t=e.attrs.view.model;function n(e){let t=e.alphabet,n=t.length,i=0,o=[];for(;n>0;){let r=[];for(let o=0;o<6&&n>0;o++){let o=t[i++];r.push(pe("td",{onclick:t=>{e.placeBlank(o),t.preventDefault()},onmouseover:Ve,onmouseout:qe},pe(".blank-choice.tile.racktile",o))),n--}o.push(pe("tr",r))}return o}return{view:()=>{const e=t.game;if(e)return pe(".modal-dialog",{id:"blank-dialog",style:{visibility:"visible"}},pe(".ui-widget.ui-widget-content.ui-corner-all",{id:"blank-form"},[Le("p","Hvaða staf táknar auða flísin?"),pe(".rack.blank-rack",pe("table.board",{id:"blank-meaning"},n(e))),pe(bp,{id:"blank-close",title:Ee("Hætta við"),onclick:t=>{t.preventDefault(),e.cancelBlankDialog()}},Be("remove"))]))}}},og=()=>({view:e=>{const{bag:t,newbag:n}=e.attrs;let i="";return t.length<=7?i+=".empty":n&&(i+=".new"),pe(".bag",{title:Ee("Flísar sem eftir eru")},pe("table.bag-content"+i,function(e){let t=[],n=0,i=e.length;for(;i>0;){let o=[];for(let t=0;t<19&&i>0;t++){let t=e[n++];"?"==t&&(t=" "),o.push(pe("td",pe.trust(t))),i--}t.push(pe("tr",o))}return t}(t)))}});function rg(e,t,n,i,o,r){const s={onmouseout:qe,onmouseover:Ve};return i&&(s.title=i),r&&(s.id=r),s.onclick=t?e=>e.preventDefault():e=>{n&&n(),e.preventDefault()},pe("."+e+(t?".disabled":""),s,o)}const sg={view:e=>{const{game:t}=e.attrs;let n=[".score"];t.manual?n.push("manual"):t.wordGood&&(n.push("word-good"),void 0!==t.currentScore&&t.currentScore>=50&&n.push("word-great"));let i=void 0===t.currentScore?"?":t.currentScore.toString();return pe(n.join("."),{title:i},i)}},ag={view:e=>{const{view:t,disabled:n}=e.attrs,i=t.model.game;if(i)return rg("recallbtn",!!n,(()=>{i.resetRack(),t.updateScale()}),Ee("Færa stafi aftur í rekka"),Be("down-arrow"))}},lg={view:e=>{const{view:t,disabled:n}=e.attrs,i=t.model.game;if(i)return rg("scramblebtn",!!n,(()=>i.rescrambleRack()),Ee("Stokka upp rekka"),Be("random"))}},cg={view:e=>{const{view:t}=e.attrs,n=t.model.game;if(!n)return;const i=n.buttonState();return i.showRecall&&!i.showingDialog?pe(ag,{view:t}):i.showScramble&&!i.showingDialog?pe(lg,{view:t}):void 0}},dg=e=>{const t=e.attrs.view,n=t.model;return{view:()=>{const e=n.game;let i=[];if(!e)return;const o=e.buttonState();if(i.push(pe(".word-check"+(o.wordGood?".word-good":"")+(o.wordBad?".word-bad":""))),o.showChallenge){const t=(o.tilesPlaced||o.showingDialog)&&!o.lastChallenge;i.push(rg("challenge",t,(()=>e.submitChallenge()),"Véfenging (röng kostar 10 stig)",Be("ban-circle")))}if(o.showRecall&&i.push(pe(ag,{view:t,disabled:o.showingDialog})),o.showScramble&&i.push(pe(lg,{view:t,disabled:o.showingDialog})),o.showMove){const n=Ee("submit_move");i.push(rg("submitmove",!o.tilesPlaced||o.showingDialog,(()=>{e.submitMove(),t.updateScale()}),n,[n,Be("play")]))}if(o.showMoveMobile){let n=["submitmove"],r=void 0!==e.currentScore;e.manual?n.push("manual"):o.wordGood?(n.push("word-good"),void 0!==e.currentScore&&e.currentScore>=50&&n.push("word-great")):o.wordBad&&(n.push("word-bad"),r=!1);const s=void 0===e.currentScore?"?":e.currentScore.toString();let a,l=[pe("span.score-mobile",s)];o.canPlay&&r?l.push(Be("play")):l.push(Be("remove")),a=o.canPlay?r?()=>{e.submitMove(),t.updateScale()}:()=>{}:()=>{const e=document.querySelector("div.opp-turn");e&&(e.classList.toggle("flashing",!0),setTimeout((()=>e.classList.toggle("flashing",!1)),1200))},i.push(rg(n.join("."),o.showingDialog,a,s,l,"move-mobile"))}if(o.showForceResignMobile){const t=Ee("Þvinga til uppgjafar");i.push(rg("force-resign",o.showingDialog,(()=>e.forceResign()),t,t))}if(o.showPass&&i.push(rg("submitpass",(o.tilesPlaced||o.showingDialog)&&!o.lastChallenge,(()=>e.submitPass()),Ee("Pass"),Be("forward"))),o.showExchange&&i.push(rg("submitexchange",o.tilesPlaced||o.showingDialog||!o.exchangeAllowed,(()=>e.submitExchange()),Ee("Skipta stöfum"),Be("refresh"))),o.showResign&&i.push(rg("submitresign",o.showingDialog,(()=>e.submitResign()),Ee("Gefa viðureign"),Be("fire"))),o.gameOver||o.localTurn||e.moveInProgress||null===e.player||i.push(pe(".opp-turn",{style:{visibility:"visible"}},[pe("span.move-indicator"),$e(),pe("strong",e.nickname[1-e.player]),Ee(" á leik"),$e(),o.tardyOpponent?pe("span.yesnobutton",{id:"force-resign",onclick:t=>{t.preventDefault(),e.forceResign()},onmouseout:qe,onmouseover:Ve,title:Ee("14 dagar liðnir án leiks")},Ee("Þvinga til uppgjafar")):""])),o.tilesPlaced){const t=pe(sg,{game:e});t&&i.push(t)}return(null==e?void 0:e.moveInProgress)&&i.push(pe(".waitmove",pe(".animated-waitmove",pe(up,{msStepTime:100,width:38,withCircle:!1})))),pe(".buttons",i)}}};class hg{getEventCoordinates(e){if(e instanceof MouseEvent)return{x:e.clientX,y:e.clientY};if(e instanceof TouchEvent){const t=e.touches[0];return t?{x:t.clientX,y:t.clientY}:{x:this.lastX,y:this.lastY}}return{x:0,y:0}}static rectContains(e,t){return t.x>=e.left&&t.x<e.right&&t.y>=e.top&&t.y<e.bottom}constructor(e,t){var n,i;this.parentElement=null,this.parentRect=null,this.offsetX=0,this.offsetY=0,this.centerX=0,this.centerY=0,this.lastX=0,this.lastY=0,this.currentDropTarget=null,e.preventDefault();const o=e.currentTarget,r=this.getEventCoordinates(e);this.lastX=r.x,this.lastY=r.y,this.draggedElement=o,this.dropHandler=t,this.parentElement=o.parentElement,this.parentRect=null!==(i=null===(n=this.parentElement)||void 0===n?void 0:n.getBoundingClientRect())&&void 0!==i?i:null;const s=o.getBoundingClientRect(),{offsetWidth:a,offsetHeight:l}=o;o.classList.add("dragging"),document.body.appendChild(o);const{offsetWidth:c,offsetHeight:d}=o;this.offsetX=r.x-s.left+(c-a)/2,this.offsetY=r.y-s.top+(d-l)/2,this.centerX=c/2,this.centerY=d/2,this.boundEventHandlers={drag:this.drag.bind(this),endDrag:this.endDrag.bind(this)};const{drag:h,endDrag:u}=this.boundEventHandlers;e instanceof MouseEvent?(document.addEventListener("mousemove",h),document.addEventListener("mouseup",u)):e instanceof TouchEvent&&(document.addEventListener("touchmove",h,{passive:!1}),document.addEventListener("touchend",u)),this.updatePosition(r.x,r.y)}removeDragListeners(){const{drag:e,endDrag:t}=this.boundEventHandlers;document.removeEventListener("mousemove",e),document.removeEventListener("mouseup",t),document.removeEventListener("touchmove",e),document.removeEventListener("touchend",t)}elementCenter(e,t){return{x:e-this.offsetX+this.centerX,y:t-this.offsetY+this.centerY}}findDropTargetAtPoint(e,t){const{x:n,y:i}=this.elementCenter(e,t);for(const e of document.elementsFromPoint(n,i)){if(e.classList.contains("drop-target"))return e;if(e.classList.contains("not-target"))return null}return null}updatePosition(e,t){this.lastX=e,this.lastY=t,this.draggedElement.style.left=e-this.offsetX+"px",this.draggedElement.style.top=t-this.offsetY+"px"}updateDropTarget(e,t){const n=this.findDropTargetAtPoint(e,t);n!==this.currentDropTarget&&(this.currentDropTarget&&this.currentDropTarget.classList.remove("over"),n&&n.classList.add("over"),this.currentDropTarget=n)}drag(e){e.preventDefault();const t=this.getEventCoordinates(e);this.updatePosition(t.x,t.y),this.updateDropTarget(t.x,t.y);const n=null!==this.currentDropTarget||this.parentRect&&hg.rectContains(this.parentRect,t);this.draggedElement.classList.toggle("no-drop",!n)}resetPosition(){this.draggedElement.style.left="",this.draggedElement.style.top="",this.draggedElement.classList.remove("dragging","no-drop"),this.parentElement&&this.parentElement.appendChild(this.draggedElement)}endDrag(e){e.preventDefault();const t=this.getEventCoordinates(e),n=this.findDropTargetAtPoint(t.x,t.y);this.currentDropTarget&&this.currentDropTarget.classList.remove("over"),this.removeDragListeners(),this.draggedElement.style.visibility="hidden",this.resetPosition(),n&&this.dropHandler(this.draggedElement,n),setTimeout((()=>{this.draggedElement.style.visibility="visible"}))}}const ug=e=>{const{view:t,coord:n}=e.attrs,i=t.model,o=e=>{var o;return o=(e,o)=>{const r=i.game;if(!r)return;const s=o.id;if(!s)return;let a="";if("board-background"===s?a="R1":s.startsWith("sq_")&&(a=s.slice(3)),a)try{r.attemptMove(n,a),t.updateScale(),pe.redraw()}catch(e){console.error(e)}},new hg(e,o),e.redraw=!1,!1};return{view:e=>{const{opponent:t}=e.attrs,r=i.game;if(!r)return;const s="R"===n[0],a=r.tiles[n];let l=[".tile"],c={};if("?"===a.tile&&l.push("blanktile"),"q".includes(a.letter)?l.push("extra-wide"):"zxmæ".includes(a.letter)&&l.push("wide"),s||a.draggable?(l.push(t?"freshtile":"racktile"),s&&"exchange"===r.showingDialog&&(a.xchg&&l.push("xchgsel"),c.onclick=e=>{a.xchg=!a.xchg,e.preventDefault()})):a.freshtile&&l.push("freshtile"),a.index){const e=150,t=(a.index*e).toString()+"ms";c.style=`animation-delay: ${t}`}return n===r.selectedSq&&l.push("sel"),void 0!==a.highlight&&l.push("highlight"+a.highlight),null!==r.showingDialog||r.over||a.draggable&&(c.onmousedown=o,c.ontouchstart=o),pe(l.join("."),c,[" "===a.letter?$e():a.letter,pe(".letterscore",a.score)])}}},pg={view:e=>{const{game:t}=e.attrs;return t.congratulate?pe("div",{id:"congrats"},[Be("bookmark")," ",Le("strong","Til hamingju með sigurinn!")]):t.over?pe("div",{id:"gameover"},[Be("info-sign")," ",Le("strong","Viðureigninni er lokið")]):void 0}},gg={view:e=>{const{game:t}=e.attrs,n=t.currentError||"";if(n&&n in Ne){const e=t.currentMessage||"",i=Ee(Ne[n]),o=i.indexOf("{word}");let r;return r=o>=0?[i.slice(0,o),pe("span.errword",e),i.slice(o+6)]:[i],pe(".error",{style:{visibility:"visible"},onclick:e=>{t.resetError(),e.preventDefault()}},[Be("exclamation-sign"),...r])}}},fg=e=>{const t=e.attrs.view,n=t.model;return{view:()=>{const e=n.game;let i=[];return e&&(i=[pe(wg,{view:t,review:!1}),pe(xg,{view:t,review:!1}),pe(dg,{view:t}),pe(gg,{game:e}),pe(pg,{game:e})],i=i.concat(t.vwDialogs())),pe(".board-area",i)}}},mg=e=>{const t=e.attrs.view,n=t.model;return{view:e=>{const i=e.attrs.coord,o=n.game;if(o)return pe("td.not-target",{id:"sq_"+i,class:o.squareClass(i)},pe(ug,{view:t,coord:i,opponent:!1}))}}},vg=e=>{const t=e.attrs.view.model;return{view:e=>{const n=t.game;if(!n)return;const i=e.attrs.coord;let o=n.squareClass(i)||"";return o&&(o="."+o),o+=e.attrs.opponent?".opp":".local",pe("td"+o,{id:"sq_"+i},e.children)}}},bg=e=>{const t=e.attrs.view,n=t.model;return{view:e=>{const i=n.game;if(!i)return;const o=e.attrs.coord;let r=i.squareClass(o)||"";return r&&(r="."+r),null!==i.askingForBlank&&i.askingForBlank.to==o&&(r+=".blinking"),o==i.startSquare&&i.localturn&&(r+=".center"),pe("td.drop-target"+r,{id:"sq_"+o,onclick:e=>{if(null!==i.selectedSq)return e.stopPropagation(),i.attemptMove(i.selectedSq,o),i.selectedSq=null,e.currentTarget.classList.remove("sel"),t.updateScale(),!1},onmouseover:e=>{null!==i.selectedSq&&e.currentTarget.classList.add("sel")},onmouseout:e=>{e.currentTarget.classList.remove("sel")}},e.children)}}},wg=e=>{const{view:t,review:n}=e.attrs,i=t.model;function o(e){let o=[];const r=i.game;o.push(pe("td.rowid",{key:"R"+e},e));for(let i=1;i<=15;i++){const s=e+i.toString();r&&s in r.tiles?o.push(pe(mg,{view:t,key:s,coord:s,opponent:!1})):n?o.push(pe(vg,{view:t,key:s,coord:s,opponent:!1})):o.push(pe(bg,{view:t,key:s,coord:s}))}return pe("tr",o)}function r(){let e=[];e.push(function(){let e=[];e.push(pe("td"));for(let t=1;t<=15;t++)e.push(pe("td",t.toString()));return pe("tr.colid",e)}());for(const t of"ABCDEFGHIJKLMNO")e.push(o(t));return e}function s(){t.boardScale=1.5}function a(){1!=t.boardScale&&(t.boardScale=1,setTimeout(t.resetScale))}return{view:e=>{const n=t.boardScale||1;let i={};return Fe(i,s,a),1!=n&&(i.style=`transform: scale(${n})`),pe(".board",{id:"board-parent"},pe("table.board",i,pe("tbody",r())))}}},xg=()=>({view:e=>{var t;const{view:n,review:i}=e.attrs,o=n.model,r=o.game;if(!r)return;let s=[];const a=null!==(t=o.reviewMove)&&void 0!==t?t:0,l=i&&0===a,c=i&&a>0&&a%2===r.player;for(let e=1;e<=7;e++){const t=`R${e}`;!l&&r&&t in r.tiles?i?s.push(pe(vg,{key:t,view:n,coord:t,opponent:c},pe(ug,{view:n,coord:t,opponent:c}))):s.push(pe(bg,{key:t,view:n,coord:t},pe(ug,{view:n,coord:t,opponent:!1}))):i?s.push(pe(vg,{key:t,view:n,coord:t,opponent:!1})):s.push(pe(bg,{key:t,view:n,coord:t}))}return pe(".rack-row",[pe(".rack-left",pe(cg,{view:n})),pe(".rack",pe("table.board",pe("tbody",pe("tr",s))))])}}),yg=e=>{const{view:t}=e.attrs,n=t.model;function i(e,i,o,r){var s;(null===(s=n.state)||void 0===s?void 0:s.uiFullscreen)&&(o===r?t.pushDialog("userprefs"):e.autoplayer[r]||t.showUserInfo(e.userid[r],e.nickname[r],e.fullname[r]),i.stopPropagation(),i.preventDefault())}return{view:e=>{const t=n.game;if(!t)return;const o=t.autoplayer[0],r=t.autoplayer[1],s=t.nickname[0],a=t.nickname[1],l=t.player,c=t.localturn,d=t.over;if("left"==e.attrs.side){if(o)return pe(".robot-btn.left",[Be("cog"),$e(),s]);return pe(".player-btn.left"+(d||c!==(0===l)?"":".tomove"),{id:"player-0",onclick:e=>i(t,e,l,0)},[pe("span.left-to-move"),s])}if(r)return pe(".robot-btn.right",[Be("cog"),$e(),a]);return pe(".player-btn.right"+(d||c!==(1===l)?"":".tomove"),{id:"player-1",onclick:e=>i(t,e,l,1)},[pe("span.right-to-move"),a])}}},_g=e=>{const t=e.attrs.view.model;let n=0;return{view:()=>{if(!t.game)return;const e=t.game,i=e.twoLetterWords()[n],o=[];for(const e of i){const t=e[1],i=[];for(let e=0;e<t.length;e++)i.push((r=0==e,s=t[e],pe(".twoletter-word",r?0==n?[pe("b",s[0]),s[1]]:[s[0],pe("b",s[1])]:s)));o.push(pe(".twoletter-group",i))}var r,s;return pe(".twoletter",{onclick:()=>{n=1-n},style:"z-index: 6"},pe(".twoletter-area"+(e.showClock()?".with-clock":""),{title:Ee(0==n?"Smelltu til að raða eftir seinni staf":"Smelltu til að raða eftir fyrri staf")},o))}}},kg=[{icon:":-)",image:"/static/icontexto_emoticons_03.png"},{icon:":-D",image:"/static/icontexto_emoticons_02.png"},{icon:";-)",image:"/static/icontexto_emoticons_04.png"},{icon:":-(",image:"/static/icontexto_emoticons_12.png"},{icon:":-o",image:"/static/icontexto_emoticons_10.png"},{icon:":-O",image:"/static/icontexto_emoticons_10.png"},{icon:":-p",image:"/static/icontexto_emoticons_14.png"},{icon:":-P",image:"/static/icontexto_emoticons_14.png"},{icon:"B-)",image:"/static/icontexto_emoticons_16.png"},{icon:":)",image:"/static/icontexto_emoticons_03.png"},{icon:":D",image:"/static/icontexto_emoticons_02.png"},{icon:";)",image:"/static/icontexto_emoticons_04.png"},{icon:":(",image:"/static/icontexto_emoticons_12.png"},{icon:":o",image:"/static/icontexto_emoticons_10.png"},{icon:":O",image:"/static/icontexto_emoticons_10.png"},{icon:":p",image:"/static/icontexto_emoticons_14.png"},{icon:":P",image:"/static/icontexto_emoticons_14.png"},{icon:"(y)",image:"/static/thumb-up.png"}],Cg=e=>{const{view:t}=e.attrs,n=t.model,i=n.game;function o(e){var t=function(e){return{year:parseInt(e.slice(0,4)),month:parseInt(e.slice(5,7)),day:parseInt(e.slice(8,10)),hour:parseInt(e.slice(11,13)),minute:parseInt(e.slice(14,16)),second:parseInt(e.slice(17,19))}}(e);return Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,t.second)}n.state;let r=null;function s(e,t){let n=o(e),i=null;if(null===r||(s=r,a=n,Math.round((a-s)/1e3)>=300)){const o=864e5,r=(new Date).getTime();let s,a=r-r%o;s=n<a-o?e.slice(0,-3):n<a?"Í gær "+e.slice(11,16):e.slice(11,16),i=pe(".chat-ts",{key:t},s)}var s,a;return r=n,i}const a=i?i.player:null;function l(e){for(const t of kg)if(e.indexOf(t.icon)>=0){const n=`<img src='${ve(t.image)}' height='32' width='32'>`;e=e.split(t.icon).join(n)}return e}function c(){var e,t;let o=[];if((null==i?void 0:i.chatLoading)||!(null==i?void 0:i.messages))return o;var r=0;const c=null!==(t=null===(e=n.state)||void 0===e?void 0:e.userId)&&void 0!==t?t:"";for(const e of i.messages){let t=null!=a?a:0;e.from_userid!=c&&(t=1-t);const n=s(e.ts,r);null!==n&&(o.push(n),r++);let i=We(e.msg);i=l(i),o.push(pe(".chat-msg"+(0===t?".left":".right")+(t===a?".local":".remote"),{key:r++},pe.trust(i)))}return o}function d(){const e=document.querySelectorAll("#chat-area .chat-msg");if(!e.length)return;const t=e[e.length-1];t.parentNode.scrollTop=t.offsetTop}function h(e){t.isDialogShown()||e.dom.focus()}function u(){let e=Ge("msg").trim();i&&e.length>0&&(i.sendMessage(e),function(e,t){document.getElementById(e).value=t}("msg",""))}const p=(null==i?void 0:i.messages)?i.messages.length:0;return{view:()=>pe(".chat-container",{style:"z-index: 6"},[pe(".chat-area"+((null==i?void 0:i.showClock())?".with-clock":""),{id:"chat-area",oncreate:d,onupdate:d},c()),pe(".chat-input",[pe("input.chat-txt",{type:"text",id:"msg",name:"msg",maxlength:254,disabled:p>=250,oncreate:e=>{h(e)},onupdate:e=>{h(e)},onkeypress:e=>{"Enter"==e.key&&(u(),e.preventDefault())}}),pe(bp,{id:"chat-send",title:Ee("Senda"),onclick:e=>{u(),e.preventDefault()}},Be("chat"))])])}},Ig=e=>{const{view:t}=e.attrs,n=t.model,i=n.game,o=n.state;function r(e,t,n,o){const r=Qe(e);let s=r.col,a=r.row;for(const e of t){if("?"==e)continue;const t=Ze(a,s);t&&i.tiles.hasOwnProperty(t)&&(i.tiles[t].highlight=o?n:void 0),s+=r.dx,a+=r.dy}}function s(e,n){const{leftTotal:s,rightTotal:a,player:l}=n;let{co:c,tiles:d}=n,h=n.score,u="wordmove",p=c,g=0;if(""===c)if(u="othermove","PASS"==d)d=" "+Ee("Pass")+" ",h="";else if(0===d.indexOf("EXCH")){let e=d.slice(5).length;const t=Ee(1==e?"letter":"letters");d=" "+Ee("exchanged",{numtiles:e.toString(),letters:t})+" ",h=""}else"RSGN"==d?d=" "+Ee("Gaf viðureign")+" ":"CHALL"==d?(d=" "+Ee("Véfengdi lögn")+" ",h=""):"RESP"==d?h<0?(d=" "+Ee("Óleyfileg lögn")+" ",g=-1):d=" "+Ee("Röng véfenging")+" ":"TIME"==d?d=" "+Ee("Umframtími")+" ":"OVER"==d?(d=Ee("Viðureign lokið"),u="gameover"):u="wordmove";else c="("+c+")",d=d.split("?").join(""),g=1;if("gameover"==u)return function(e){return pe(".move.gameover",[pe("span.gameovermsg",e),pe("span.statsbutton",{onclick:e=>{e.preventDefault(),o.hasPaid?(pe.route.set("/review/"+i.uuid),null!=i&&Ju("game_review",{locale:i.locale,uuid:i.uuid})):(Ju("click_review",{userid:o.userId,locale:o.locale}),t.showFriendPromo())}},Te("Skoða yfirlit"))])}(d);let f,m=g>0&&!i.manual?Ee("Smelltu til að fletta upp"):"",v=0,b=i.player;l===b||null===b&&0===l?f="humangrad"+(0===l?"_left":"_right"):(f="autoplayergrad"+(0===l?"_left":"_right"),v=1);const w={};return o.uiFullscreen&&g>0&&(i.manual||"is_IS"==i.locale&&(w.onclick=()=>{window.open("https://malid.is/leit/"+d,"malid")},w.title=m),w.onmouseout=()=>{e[2]=!1,r(p,d,v,!1)},w.onmouseover=()=>{e[2]=!0,r(p,d,v,!0)}),0===l?pe(".move.leftmove."+f,w,[pe("span.total"+(l==b?".human":".autoplayer"),s),pe("span.score"+(e[2]?".highlight":""),h),pe("span."+u,[pe("i",d),$e(),c])]):pe(".move.rightmove."+f,w,[pe("span."+u,[c,$e(),pe("i",d)]),pe("span.score"+(e[2]?".highlight":""),h),pe("span.total"+(l==b?".human":".autoplayer"),a)])}return{view:e=>{const{move:t,info:n}=e.attrs;return s(t,n)}}},Sg=e=>{const t=e.attrs.view,n=t.model,i=n.game,o=n.state;function r(){let e=i?i.moves:[],n=[],o=0,r=0;for(let i=0;i<e.length;i++){let s=e[i],[a,[l,c,d]]=s;0===a?o=Math.max(o+d,0):r=Math.max(r+d,0);const h=pe(Ig,{view:t,move:s,info:{key:i.toString(),leftTotal:o,rightTotal:r,player:a,co:l,tiles:c,score:d}});n.push(h)}return n}const s=i?i.bag:"",a=!i||i.newbag;return{view:()=>pe(".movelist-container",[pe(".movelist",{onupdate:()=>{setTimeout(Je)}},r()),(null==o?void 0:o.uiFullscreen)?"":pe(og,{bag:s,newbag:a})])}},Tg=e=>{const t=e.attrs.view.model;return{view:()=>pe(".games",{style:"z-index: 6"},function(){let e=[];if(t.loadingGameList)return e;let n=t.gameList;if(void 0===n)return e;if(null===n)return t.loadGameList(),e;const i=t.game,o=i?i.uuid:"";for(let t of n){if(t.uuid==o)continue;if(!t.my_turn&&!t.zombie)continue;let n;n=null===t.oppid?[Be("cog"),$e(),t.opp]:[t.opp];let i=t.sc0<t.sc1?".losing":"",r="Staðan er "+t.sc0+":"+t.sc1;e.push(pe(".games-item"+(t.timed?".game-timed":""),{key:t.uuid,title:r},pe(pe.route.Link,{href:Ye(t.url)},[pe(".at-top-left",pe(".tilecount",pe(".oc",n))),pe(".at-top-left",pe(".tilecount.trans",pe(".tc"+i,{style:{width:t.tile_count.toString()+"%"}},n)))])))}return e}())}},Eg=e=>{const t=e.attrs.game;return{view:e=>{const{tabid:n,title:i,icon:o,alert:r,funcSel:s}=e.attrs,a=(null==t?void 0:t.sel)||"movelist";return pe(".right-tab"+(a===n?".selected":""),{id:"tab-"+n,className:r?"alert":"",title:i,onclick:e=>{t&&null===t.showingDialog&&t.setSelectedTab(n)&&(s&&s(),"movelist"===n&&setTimeout(Je)),e.preventDefault()}},Be(o))}}},Lg=()=>({view:e=>{const t=e.attrs.game;let n=!(t.autoplayer[0]||t.autoplayer[1]);const i=[pe(Eg,{game:t,tabid:"board",title:Ee("Borðið"),icon:"grid"}),pe(Eg,{game:t,tabid:"movelist",title:Ee("Leikir"),icon:"show-lines"}),pe(Eg,{game:t,tabid:"twoletter",title:Ee("Tveggja stafa orð"),icon:"life-preserver"}),pe(Eg,{game:t,tabid:"games",title:Ee("Viðureignir"),icon:"flag"})];return n&&i.push(pe(Eg,{game:t,tabid:"chat",title:Ee("Spjall"),icon:"conversation",funcSel:()=>{t.markChatShown()&&pe.redraw()},alert:!t.chatSeen&&"chat"!=t.sel})),pe.fragment({},i)}}),Pg=e=>{const t=e.attrs.view,n=t.model.game;function i(){if(!n||!n.showClock())return pe.fragment({},[]);function e(e,t,n,i){return pe("h3."+e+(n?".running-out":"")+(i?".blink":""),t)}return pe.fragment({},[e("clockleft",n.clockText0,n.runningOut0,n.blinking0),e("clockright",n.clockText1,n.runningOut1,n.blinking1),pe(".clockface",Be("time"))])}function o(){const e=!!n&&n.fairplay,o=n?n.player:null,r=n?n.displayScore(0).toString():"",s=n?n.displayScore(1).toString():"";return pe(".heading",[pe(".logowrapper",pe(".header-logo",pe(pe.route.Link,{href:"/page",class:"backlink"},pe(fp,{width:24,height:46})))),pe(".playerwrapper",[pe(".leftplayer"+(1===o?".autoplayercolor":".humancolor"),[pe(".player",pe(yg,{view:t,side:"left"})),pe(".scorewrapper",pe(".scoreleft",r))]),pe(".rightplayer"+(1===o?".humancolor":".autoplayercolor"),[pe(".player",pe(yg,{view:t,side:"right"})),pe(".scorewrapper",pe(".scoreright",s))]),pe(".fairplay",{style:{visibility:e?"visible":"hidden"}},pe("span.fairplay-btn.large",{title:Ee("Skraflað án hjálpartækja")}))]),i()])}function r(){if(!n)return;let e;switch(n.sel||"movelist"){case"movelist":e=pe(Sg,{view:t});break;case"twoletter":e=pe(_g,{view:t});break;case"chat":e=pe(Cg,{view:t});break;case"games":e=pe(Tg,{view:t})}const i=pe(Lg,{game:n});return pe(".right-area"+((null==n?void 0:n.showClock())?".with-clock":""),e?[i,e]:[i])}return{view:()=>pe(".rightcol",[o(),r()])}},Rg=e=>{const t=e.attrs.view.model,n=t.state;return{view:()=>pe(".board-help",{title:Ee("Hvernig reitirnir margfalda stigin")},[pe(".board-help-close",{title:Ee("Loka þessari hjálp"),onclick:e=>{n&&(n.beginner=!1,t.setUserPref({beginner:!1})),e.preventDefault()}},Be("remove")),pe(".board-colors",[pe(".board-color[id='triple-word']",["3 x",pe("br"),Te("orð")]),pe(".board-color[id='double-word']",["2 x",pe("br"),Te("orð")]),pe(".board-color[id='triple-letter']",["3 x",pe("br"),Te("stafur")]),pe(".board-color[id='double-letter']",["2 x",pe("br"),Te("stafur")]),pe(".board-color[id='single-letter']",["1 x",pe("br"),Te("stafur")])])])}},Ng=()=>({view:e=>{const t=e.attrs.view,n=t.model,i=n.game;if(!i)return pe("div",[pe(".game-container"),pe(Ip)]);const o=i.bag,r=i.newbag,s=n.state;return pe("div.drop-target",{id:"board-background"},[pe(".game-container",[pe(Pg,{view:t}),pe(fg,{view:t}),(null==s?void 0:s.uiFullscreen)?pe(og,{bag:o,newbag:r}):"",i.askingForBlank?pe(ig,{view:t}):""]),pe(Ip),(null==s?void 0:s.beginner)?pe(Rg,{view:t}):"",pe(Cp)])}}),Ag=(e,t,n)=>{const i=e.model.game;function o(e,n,i){let o,r="wordmove";if(e.length>0)o=[pe("i",n.split("?").join(""))," ("+e+")"];else if(r="othermove","PASS"==n)o=Ee("Pass");else if(0===n.indexOf("EXCH")){let e=n.slice(5).length;const t=Ee(1==e?"letter":"letters");o=Ee("exchanged",{numtiles:e.toString(),letters:t})}else"RSGN"==n?o=Ee("Gaf viðureign"):"CHALL"==n?o=Ee("Véfengdi lögn"):"RESP"==n?o=Ee(i<0?"Óleyfileg lögn":"Röng véfenging"):"TIME"==n?o=Ee("Umframtími"):"OVER"==n?(o=Ee("Viðureign lokið"),r="gameover"):(r="othermove",o="--"==n?Ee("Stafaleif: (engin)"):[Ee("Stafaleif: "),pe("i.upper",n)]);return pe(".reviewhdr",[pe("span.movenumber","#"+t),pe("span",{class:r},o)])}return pe(".movelist-container",[pe(".movelist.bestmoves",function(){let r=[];if(!i||!t||t>i.moves.length)return r;const s=i.moves[t-1],[a,l,c]=s[1];r.push(o(a,l,c));const d=n;for(let n=0;n<d.length;n++){const[i,[o,s,a]]=d[n],l=Dg(e,t,n,d[n],{player:i,co:o,tiles:s,score:a});l&&r.push(l)}return r}())])},Dg=(e,t,n,i,o)=>{const r=e.model;if(!r.game)return;const s=r.game,{player:a,co:l,tiles:c,score:d}=o;function h(e,i,o,l){const c=Qe(e);let d=c.col,h=c.row,u=!1;l&&(r.highlightedMove=n,s.placeTiles(t-1,!0));for(let e of i){if("?"===e){u=!0;continue}const t=Ze(h,d);if(null===t)continue;const n=e;u&&(e="?");const i=s.tilescore(e);l&&(t in s.tiles?s.tiles[t].highlight=o:s.tiles[t]={player:a,tile:e,letter:n,score:i,draggable:!1,freshtile:!1,index:0,xchg:!1,review:!0,highlight:o}),d+=c.dx,h+=c.dy,u=!1}l||(r.highlightedMove=null,null!==r.reviewMove&&s.placeTiles(r.reviewMove))}const u="("+l+")",p=c.split("?").join("");let g=0;const f=s.player;let m;a===f||null===f&&0===a?m="humangrad"+(0===a?"_left":"_right"):(m="autoplayergrad"+(0===a?"_left":"_right"),g=1);const v={title:"Smelltu til að fletta upp"};return"is_IS"===s.locale&&(v.onclick=()=>{window.open("https://malid.is/leit/"+p,"malid")}),v.onmouseover=()=>{i[2]=!0,h(l,c,g,!0)},v.onmouseout=()=>{i[2]=!1,h(l,c,g,!1)},0===a?pe(".move.leftmove."+m,v,[pe("span.score"+(i[2]?".highlight":""),d),pe("span.wordmove",[pe("i",p),$e(),u])]):pe(".move.rightmove."+m,v,[pe("span.wordmove",[u,$e(),pe("i",p)]),pe("span.score"+(i[2]?".highlight":""),d)])},Og=e=>{if(null===e.model.game)return;const t=e.model.game;function n(e,n,i){let o=i;return void 0===o&&t.stats&&(o=t.stats[e]),void 0===o?"":("number"==typeof o&&(o=void 0!==n&&n>0?o.toFixed(n).replace(".",","):o.toString()),o)}let i,o;return null===t.stats&&t.loadStats(),1===t.player?(o="humancolor",i="autoplayercolor"):(i="humancolor",o="autoplayercolor"),pe(".gamestats",{style:{visibility:"visible"}},[pe("div",{style:{position:"relative",width:"100%"}},[pe(".player",{class:i,style:{width:"50%"}},pe(".robot-btn.left",t.autoplayer[0]?[Be("cog"),$e(),t.nickname[0]]:t.nickname[0])),pe(".player",{class:o,style:{width:"50%","text-align":"right"}},pe(".robot-btn.right",t.autoplayer[1]?[Be("cog"),$e(),t.nickname[1]]:t.nickname[1]))]),pe("div",{id:"gamestarted"},[pe("p",["Viðureignin hófst ",pe("span",n("gamestart")),pe("br"),"og henni lauk ",pe("span",n("gameend"))]),t.manual?pe("p","Leikið var í keppnisham"):""]),pe(".statscol",{style:{clear:"left"}},[pe("p",["Fjöldi leikja: ",pe("span",n("moves0"))]),pe("p",["Fjöldi bingóa: ",pe("span",n("bingoes0"))," (bónus ",pe("span",n("bingopoints0",0,t.stats?50*t.stats.bingoes0:0))," stig)"]),pe("p",["Stafir lagðir niður: ",pe("span",n("tiles0"))," (þar af ",pe("span",n("blanks0"))," auðir)"]),pe("p",["Meðalstig stafa (án auðra): ",pe("span",n("average0",2))]),pe("p",["Samanlögð stafastig: ",pe("span",n("letterscore0"))]),pe("p",["Margföldun stafastiga: ",pe("span",n("multiple0",2))]),pe("p",["Stig án stafaleifar í lok: ",pe("span",n("cleantotal0"))]),pe("p",["Meðalstig hvers leiks: ",pe("span",n("avgmove0",2))]),t.manual?pe("p",["Rangar véfengingar andstæðings x 10: ",pe("span",n("wrongchall0"))]):"",pe("p",["Stafaleif og frádráttur í lok: ",pe("span",n("remaining0"))]),pe("p",["Umframtími: ",pe("span",n("overtime0"))]),pe("p",["Stig: ",pe("span",n("total0",0,t.stats?t.stats.scores[0]:0))," (",pe("span",n("ratio0",1)),"%)"])]),pe(".statscol",[pe("p",["Fjöldi leikja: ",pe("span",n("moves1"))]),pe("p",["Fjöldi bingóa: ",pe("span",n("bingoes1"))," (bónus ",pe("span",n("bingopoints0",0,t.stats?50*t.stats.bingoes1:0))," stig)"]),pe("p",["Stafir lagðir niður: ",pe("span",n("tiles1"))," (þar af ",pe("span",n("blanks1"))," auðir)"]),pe("p",["Meðalstig stafa (án auðra): ",pe("span",n("average1",2))]),pe("p",["Samanlögð stafastig: ",pe("span",n("letterscore1"))]),pe("p",["Margföldun stafastiga: ",pe("span",n("multiple1",2))]),pe("p",["Stig án stafaleifar í lok: ",pe("span",n("cleantotal1"))]),pe("p",["Meðalstig hvers leiks: ",pe("span",n("avgmove1",2))]),t.manual?pe("p",["Rangar véfengingar andstæðings x 10: ",pe("span",n("wrongchall1"))]):"",pe("p",["Stafaleif og frádráttur í lok: ",pe("span",n("remaining1"))]),pe("p",["Umframtími: ",pe("span",n("overtime1"))]),pe("p",["Stig: ",pe("span",n("total1",0,t.stats?t.stats.scores[1]:0))," (",pe("span",n("ratio1",1)),"%)"])]),pe(".closebtn",{id:"review-close",onclick:e=>{setTimeout((()=>{pe.route.set("/review/"+t.uuid,{move:1})})),e.preventDefault()},onmouseover:Ve,onmouseout:qe},[Be("play")," Rekja"])])},Mg=(e,t)=>{var n,i;const o=e.model,r=o.game,s=null!==(n=null==r?void 0:r.moves.length)&&void 0!==n?n:0;let a=[];if(!(null!==(i=null==r?void 0:r.uuid)&&void 0!==i?i:""))return a;if(a.push(rg("navbtn",!t,(()=>{o.loadBestMoves(t?t-1:0)}),"Sjá fyrri leik",pe("span",{id:"nav-prev-visible"},[Be("chevron-left")," Fyrri"]),"navprev")),a.push(rg("navbtn",!t||t>=s,(()=>{o.loadBestMoves(t+1)}),"Sjá næsta leik",pe("span",{id:"nav-next-visible"},["Næsti ",Be("chevron-right")]),"navnext")),null!==o.highlightedMove){const n=((e,t)=>{const n=e.model,i=n.game;if(!i)return;let o=[".scorediff"];const r=t?i.moves[t-1]:void 0;let s=r?r[1][2]:void 0,a="";if(void 0===s||null===n.bestMoves||null===n.highlightedMove);else{const e=n.bestMoves[n.highlightedMove][1][2];a=(s-e).toString(),"-"!=a[0]&&"0"!=a[0]&&(a="+"+a),s>=e&&o.push("posdiff")}return pe(o.join("."),{style:{visibility:"visible"}},a)})(e,t);void 0!==n&&a.push(n)}const l=((e,t)=>{var n;const i=e.model.game;if(!i)return;const o=t?i.moves[t-1]:void 0;if(void 0===o)return;const[r,[s,a,l]]=o;if(void 0===l||""===s&&"OVER"===a)return;let c=[".score"];return t>0&&(t%2===(null!==(n=i.player)&&void 0!==n?n:0)?c.push("opponent"):c.push("localplayer")),pe(c.join("."),l.toString())})(e,t);return void 0!==l&&a.push(l),a},Fg=e=>{const t=e.attrs.view,n=t.model;return{view:e=>{let i=[];if(n.game){i=[pe(wg,{view:t,review:!0}),pe(xg,{view:t,review:!0})];const n=e.attrs.moveIndex;null!==n&&(i=i.concat(Mg(t,n)))}return pe(".board-area",i)}}};async function zg(e,t){if(!t)return console.error("No container element found"),"error";((e,t,n)=>{const i=e=>(e.length>0&&"/"===e[e.length-1]&&(e=e.slice(0,-1)),e);e&&(ge=i(e)),t&&(fe=i(t)),n&&(me=n)})(e.serverUrl,e.movesUrl,e.movesAccessKey),function(e){try{const t=document.styleSheets;for(const n of t)for(const t of n.cssRules)t instanceof CSSFontFaceRule&&t.style.getPropertyValue("src").includes("glyphicons-")&&t.style.setProperty("src",`\n url('${e}/static/glyphicons-regular.eot') format('embedded-opentype'),\n url('${e}/static/glyphicons-regular.woff') format('woff'),\n url('${e}/static/glyphicons-regular.ttf') format('truetype')\n `)}catch(e){console.error("Error when updating font face URLs: ",e)}}(e.serverUrl);try{const n=await(async(e,t,n,i)=>be({method:"POST",url:"/login_malstadur",body:{email:e,nickname:t,fullname:n,token:i}}))(e.userEmail,e.userNick,e.userFullname,e.token);if("expired"===n.status)return"expired";if("success"===n.status){e.userId=n.user_id,await Gu(e,n.firebase_token);const i=function(){const e=[{name:"main",route:"/main",mustLogin:!0},{name:"help",route:"/help",mustLogin:!1},{name:"thanks",route:"/thanks",mustLogin:!0},{name:"cancel",route:"/cancel",mustLogin:!0},{name:"confirm",route:"/confirm",mustLogin:!0},{name:"game",route:"/game/:uuid",mustLogin:!0},{name:"review",route:"/review/:uuid",mustLogin:!0},{name:"login",route:"/login",mustLogin:!1},{name:"loginerror",route:"/loginerror",mustLogin:!1}];return{paths:e,defaultRoute:e[0].route}}(),o=new sp(i,e),r=new Ug(o),s=function(e){let t=e.model,n=e.view;return t.paths.reduce(((t,i)=>(t[i.route]={onmatch:t=>{n.popAllDialogs(),e.onNavigateTo(i.name,t)},render:()=>n.appView(i.name)},t)),{})}(new ap(o,r));return pe.route(t,i.defaultRoute,s),"success"}}catch(e){console.error("Exception during login: ",e)}return pe.mount(t,Up),"error"}class Ug{constructor(e){this.dialogStack=[],this.boardScale=1,this.model=e,window.setInterval(this.blinker,500)}appView(e){const t=this.model;let n=[];switch(e){case"login":n.push(this.vwLogin());break;case"loginerror":n.push(pe(Up));break;case"main":n.push(pe(eg,{view:this}));break;case"game":n.push(pe(Ng,{view:this}));break;case"review":const e=(e=>{var t;const n=e.model;if(!n.game)return;const i=n.game;let o=null!==(t=n.reviewMove)&&void 0!==t?t:0,r=n.bestMoves||[],s=[];if(i&&(s.push(pe(".rightcol",[function(){const t=i.fairplay,n=i.player;let r="",s="";if(o){let e=0,t=0;for(let n=0;n<o;n++){let o=i.moves[n];n%2==0?e+=o[1][2]:t+=o[1][2]}r=e.toString(),s=t.toString()}return pe(".heading",[pe(".logowrapper",pe(".header-logo",pe(pe.route.Link,{href:"/page",class:"backlink"},pe(fp,{width:24,height:46})))),pe(".playerwrapper",[pe(".leftplayer"+(1===n?".autoplayercolor":".humancolor"),[pe(".player",pe(yg,{view:e,side:"left"})),pe(".scorewrapper",pe(".scoreleft",r))]),pe(".rightplayer"+(1===n?".humancolor":".autoplayercolor"),[pe(".player",pe(yg,{view:e,side:"right"})),pe(".scorewrapper",pe(".scoreright",s))]),pe(".fairplay",{style:{visibility:t?"visible":"hidden"}},pe("span.fairplay-btn.large",{title:Ee("Skraflað án hjálpartækja")}))])])}(),pe(".right-area",Ag(e,o,r))])),s.push(pe(Fg,{view:e,moveIndex:o})),null!==n.reviewMove&&0===o)){const t=Og(e);t&&s.push(t)}return pe("div",[pe(".game-container",s),pe(Ip),pe(Cp)])})(this);e&&n.push(e);break;case"thanks":n.push(pe(eg,{view:this})),this.dialogStack.length||this.showThanks();break;case"help":n.push(this.vwHelp(parseInt(pe.route.param("tab")||""),parseInt(pe.route.param("faq")||"")));break;default:return[pe("div",Te("Þessi vefslóð er ekki rétt"))]}for(const e of this.dialogStack){const t=Ug.dialogViews[e.name];if(void 0===t)console.error("Unknown dialog name: "+e.name);else{const i=t(this,e.args);i&&n.push(i)}}return t.spinners&&n.push(pe(mp)),n}pushDialog(e,t){this.dialogStack.push({name:e,args:t}),pe.redraw()}popDialog(){this.dialogStack.length>0&&(this.dialogStack.pop(),pe.redraw())}popAllDialogs(){this.dialogStack.length>0&&(this.dialogStack=[],pe.redraw())}isDialogShown(){return this.dialogStack.length>0}startSpinner(){this.model.spinners++}stopSpinner(){this.model.spinners&&this.model.spinners--}async cancelFriendship(){let e=!0;try{this.startSpinner(),await this.model.cancelFriendship()&&(this.stopSpinner(),e=!1,this.pushDialog("confirm",{}))}catch(e){}finally{e&&this.stopSpinner()}}notifyMediaChange(){var e,t;const n=this.model;n.game&&((null===(e=n.state)||void 0===e?void 0:e.uiFullscreen)||(null===(t=n.state)||void 0===t?void 0:t.uiLandscape)?n.game.setSelectedTab("movelist")&&setTimeout(Je):n.game.setSelectedTab("board")),this.popAllDialogs()}notifyChatMessage(){pe.redraw()}resetScale(){this.boardScale=1;const e=document.getElementById("board-parent"),t=null==e?void 0:e.children[0];t&&t.setAttribute("style","transform: scale(1.0)"),e&&e.scrollTo(0,0)}updateScale(){var e;const t=this.model,n=t.game;if(!n||(null===(e=t.state)||void 0===e?void 0:e.uiFullscreen)||n.moveInProgress)return this.boardScale=1,void setTimeout(this.resetScale);const i=n.tilesPlaced(),o=i.length;1===o&&1===this.boardScale?(this.boardScale=1.5,setTimeout((()=>function(e){const t=Qe(e),n=Ze(Math.max(0,t.row-3),Math.max(0,t.col-3)),i=document.getElementById("board-parent"),o=null==i?void 0:i.children[0];o&&o.setAttribute("style","transform: scale(1.5)");const r=document.getElementById("sq_"+n),s=null==r?void 0:r.getBoundingClientRect(),a=null==i?void 0:i.getBoundingClientRect();i&&s&&a&&i.scrollTo({left:s.left-a.left,top:s.top-a.top,behavior:"smooth"})}(i[0])))):0===o&&this.boardScale>1&&(this.boardScale=1,setTimeout((()=>this.resetScale())))}showUserInfo(e,t,n){this.pushDialog("userinfo",{userid:e,nick:t,fullname:n})}showFriendPromo(){this.pushDialog("friend",{})}showThanks(){this.pushDialog("thanks",{})}showFriendCancel(){this.pushDialog("cancel",{})}showAcceptDialog(e,t,n){this.pushDialog("accept",{oppId:e,oppNick:t,challengeKey:n})}vwDialogButton(e,t,n,i,o){return pe(bp,{id:e,onclick:n,title:t,tabindex:o},i)}blinker(){const e=document.getElementsByClassName("blinking");for(let t of e)t.classList.toggle("over")}vwTabsFromHtml(e,t,n,i){return e?pe("div",{oninit:e=>{e.state.selected=n||1},oncreate:e=>{Yp(this,t,i,!0,e)}},pe.trust(e)):""}vwHelp(e,t){const n=this.model;return pe.fragment({},[pe(Ip),pe(_p,{view:this}),this.vwTabsFromHtml(n.helpHTML||"","tabs",e,(function(e){var n;function i(t,n){var i;e.state.selected=1,null===(i=e.dom.querySelector(n))||void 0===i||i.scrollIntoView(),t.preventDefault()}const o=e.dom.querySelectorAll("a");for(const e of o){const t=e.getAttribute("href");t&&"#faq-"==t.slice(0,5)&&(e.onclick=e=>{i(e,t)})}void 0===t||isNaN(t)||(Zp(e,1),e.state.selected=1,null===(n=e.dom.querySelector("#faq-"+t.toString()))||void 0===n||n.scrollIntoView())}))])}vwUserPrefsDialog(){const e=this.model;if(!e.user)return;const t=e.user;if(!e.state)return;const n=e.state,i=e.userErrors||{},o=this;function r(e){return i.hasOwnProperty(e)?pe(".errinput",[Be("arrow-up"),$e(),i[e]||""]):""}function s(e){var t;const n=null===(t=document.querySelector("#"+e+"-toggler #opt2"))||void 0===t?void 0:t.classList;return!!n&&n.contains("selected")}return pe(".modal-dialog",{id:"user-dialog",oncreate:function(e){e.dom.querySelector("#nickname").focus()}},pe(".ui-widget.ui-widget-content.ui-corner-all",{id:"user-form"},[pe(".loginhdr",[Be("address-book")," "+Ee("player_info")]),pe("div",pe("form",{action:"",id:"frm1",method:"post",name:"frm1"},[pe(".dialog-spacer",[pe("span.caption",Te("Einkenni:")),pe(vp,{initialValue:t.nickname||"",class:"username",maxlength:15,id:"nickname"}),$e(),pe("span.asterisk","*")]),pe(".explain",Te("Verður að vera útfyllt")),r("nickname"),pe(".dialog-spacer",[pe("span.caption",Te("Fullt nafn:")),pe(vp,{initialValue:t.full_name||"",class:"fullname",maxlength:32,id:"full_name",autocomplete:"name"})]),pe(".explain",Te("Valfrjálst - sýnt í notendalistum Netskrafls")),r("full_name"),pe(".dialog-spacer",[pe("span.caption.sub",Te("Hljóðmerki:")),pe(Lp,{view:o,state:t.audio,tabindex:4}),pe("span.subcaption",Te("Lúðraþytur eftir sigur:")),pe(Pp,{view:o,state:t.fanfare,tabindex:5})]),pe(".explain",Te("explain_sound")),pe(".dialog-spacer",[pe("span.caption.sub",Te("Sýna reitagildi:")),pe(Rp,{view:o,state:t.beginner,tabindex:6}),Le(".subexplain",["Stillir hvort ",Le("strong","minnismiði")," um margföldunargildi reita er sýndur við borðið"])]),pe(".dialog-spacer",[pe("span.caption.sub",Te("Án hjálpartækja:")),pe(Np,{view:o,state:t.fairplay,tabindex:7}),Le(".subexplain",["no_helpers",Le("strong","án stafrænna hjálpartækja")," af nokkru tagi"])])])),this.vwDialogButton("user-ok",Ee("Vista"),(function(){t.nickname=Ge("nickname"),t.full_name=Ge("full_name"),t.audio=s("audio"),t.fanfare=s("fanfare"),t.beginner=s("beginner"),t.fairplay=s("fairplay"),e.saveUser((()=>{o.popDialog()}))}),Be("ok"),8),this.vwDialogButton("user-cancel",Ee("Hætta við"),(e=>{this.popDialog(),e.preventDefault()}),Be("remove"),9),t.friend?this.vwDialogButton("user-unfriend",Ee("Hætta sem vinur"),(e=>{e.preventDefault(),o.showFriendCancel()}),[Be("coffee-cup"),$e(),$e(),Ee("Þú ert vinur Netskrafls!")],10):this.vwDialogButton("user-friend",Ee("Gerast vinur"),(e=>{e.preventDefault(),Ju("click_friend",{userid:n.userId,locale:n.locale}),o.showFriendPromo()}),[Be("coffee-cup"),$e(),$e(),Ee("Gerast vinur Netskrafls")],11)]))}vwUserPrefs(){const e=this.model;return null!==e.user||e.userLoadError||e.loadUser(!0),e.user?this.vwUserPrefsDialog():pe.fragment({},[])}vwUserInfo(e){return pe(ng,{view:this,userid:e.userid,nick:e.nick,fullname:e.fullname})}vwPromo(e){return pe(tg,{view:this,kind:e.kind,initFunc:e.initFunc})}vwWait(e){return pe(Ap,{view:this,oppId:e.oppId,oppNick:e.oppNick,oppName:e.oppName,duration:e.duration,challengeKey:e.challengeKey})}vwAccept(e){return pe(Dp,{view:this,oppId:e.oppId,oppNick:e.oppNick,challengeKey:e.challengeKey})}vwLogin(){var e;const t=(null===(e=this.model.state)||void 0===e?void 0:e.loginUrl)||"";return pe(jp,{loginUrl:t})}vwDialogs(){const e=this.model.game;let t=[];return!e||null===e.showingDialog&&!e.last_chall||(e.last_chall&&t.push(pe(".chall-info",{style:{visibility:"visible"}},[Be("info-sign"),$e(),Le("span.pass-explain","opponent_emptied_rack")])),"resign"==e.showingDialog&&t.push(pe(".resign",{style:{visibility:"visible"}},[Be("exclamation-sign"),$e(),Ee("Viltu gefa leikinn?"),$e(),pe("span.mobile-break",pe("br")),pe("span.yesnobutton",{onclick:()=>e.confirmResign(!0)},[Be("ok"),Ee(" Já")]),pe("span.mobile-space"),pe("span.yesnobutton",{onclick:()=>e.confirmResign(!1)},[Be("remove"),Ee(" Nei")])])),"pass"==e.showingDialog&&(e.last_chall?t.push(pe(".pass-last",{style:{visibility:"visible"}},[Be("forward"),$e(),Ee("Segja pass?"),Le("span.pass-explain","Viðureign lýkur þar með"),$e(),pe("span.mobile-break",pe("br")),pe("span.yesnobutton",{onclick:()=>e.confirmPass(!0)},[Be("ok"),Ee(" Já")]),pe("span.mobile-space"),pe("span.yesnobutton",{onclick:()=>e.confirmPass(!1)},[Be("remove"),Ee(" Nei")])])):t.push(pe(".pass",{style:{visibility:"visible"}},[Be("forward"),$e(),Ee("Segja pass?"),Le("span.pass-explain","2x3 pöss í röð ljúka viðureign"),$e(),pe("span.mobile-break",pe("br")),pe("span.yesnobutton",{onclick:()=>e.confirmPass(!0)},[Be("ok"),Ee(" Já")]),pe("span.mobile-space"),pe("span.yesnobutton",{onclick:()=>e.confirmPass(!1)},[Be("remove"),Ee(" Nei")])]))),"exchange"==e.showingDialog&&t.push(pe(".exchange",{style:{visibility:"visible"}},[Be("refresh"),$e(),Ee("Smelltu á flísarnar sem þú vilt skipta"),$e(),pe("span.mobile-break",pe("br")),pe("span.yesnobutton",{title:Ee("Skipta"),onclick:()=>e.confirmExchange(!0)},Be("ok")),pe("span.mobile-space"),pe("span.yesnobutton",{title:Ee("Hætta við"),onclick:()=>e.confirmExchange(!1)},Be("remove"))])),"chall"==e.showingDialog&&t.push(pe(".chall",{style:{visibility:"visible"}},[Be("ban-circle"),$e(),Ee("Véfengja lögn?"),Le("span.pass-explain","Röng véfenging kostar 10 stig"),$e(),pe("span.mobile-break",pe("br")),pe("span.yesnobutton",{onclick:()=>e.confirmChallenge(!0)},[Be("ok"),Ee(" Já")]),pe("span.mobile-space"),pe("span.yesnobutton",{onclick:()=>e.confirmChallenge(!1)},[Be("remove"),Ee(" Nei")])]))),t}}function jg(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var i=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===n&&i.firstChild?i.insertBefore(o,i.firstChild):i.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}Ug.dialogViews={userprefs:e=>e.vwUserPrefs(),userinfo:(e,t)=>e.vwUserInfo(t),challenge:(e,t)=>pe(Vp,{view:e,item:t}),promo:(e,t)=>e.vwPromo(t),friend:e=>pe(Op,{view:e}),thanks:e=>pe(Mp,{view:e}),cancel:e=>pe(Fp,{view:e}),confirm:e=>pe(zp,{view:e}),wait:(e,t)=>e.vwWait(t),accept:(e,t)=>e.vwAccept(t)};jg("\n@import url('https://fonts.googleapis.com/css2?family=Barlow:ital,wght@0,400;0,700;1,400;1,700&display=swap');\n@import url('https://fonts.googleapis.com/css2?family=Lato:ital,wght@0,400;0,700;1,400;1,700&display=swap');\n@import url('https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,400;0,700;1,400;1,700&display=swap');\n");jg('/*\n\n Glyphs.css\n\n Style support for Glyphicons\n\n Copyright © 2024 Miðeind ehf.\n Author: Vilhjalmur Thorsteinsson\n\n The Creative Commons Attribution-NonCommercial 4.0\n International Public License (CC-BY-NC 4.0) applies to this software.\n For further information, see https://github.com/mideind/Netskrafl\n\n*/\n\n@font-face {\n font-family: \'Glyphicons Regular\';\n /* The following source URLs are patched up at run-time\n to point to the backend server */\n src: url(\'../fonts/glyphicons-regular.eot\') format(\'embedded-opentype\'),\n url(\'../fonts/glyphicons-regular.woff\') format(\'woff\'),\n url(\'../fonts/glyphicons-regular.ttf\') format(\'truetype\');\n}\n\n.glyphicon {\n position: relative;\n top: 2px;\n display: inline-block;\n font-family: \'Glyphicons Regular\';\n font-style: normal;\n font-weight: normal;\n line-height: 1;\n}\n\n.glyphicon-play:before {\n content: "\\E174";\n}\n.glyphicon-exclamation-sign:before {\n content: "\\E197";\n}\n.glyphicon-log-in:before {\n content: "\\E387";\n}\n.glyphicon-log-out:before {\n content: "\\E388";\n}\n.glyphicon-screenshot:before {\n content: "\\E186";\n}\n.glyphicon-refresh:before {\n content: "\\E082";\n}\n.glyphicon-forward:before {\n content: "\\E177";\n}\n.glyphicon-fire:before {\n content: "\\E023";\n}\n.glyphicon-ok:before {\n content: "\\E207";\n}\n.glyphicon-remove:before {\n content: "\\E208";\n}\n.glyphicon-info-sign:before {\n content: "\\E196";\n}\n.glyphicon-cog:before {\n content: "\\E137";\n}\n.glyphicon-chevron-left:before {\n content: "\\E225";\n}\n.glyphicon-chevron-right:before {\n content: "\\E224";\n}\n.glyphicon-circle-arrow-down:before {\n content: "\\E220";\n}\n.glyphicon-download:before {\n content: "\\E201";\n}\n.glyphicon-star:before {\n content: "\\E050";\n}\n.glyphicon-flag:before {\n content: "\\E267";\n}\n.glyphicon-flag-after:after {\n content: "\\E267";\n}\n.glyphicon-bookmark:before {\n content: "\\E073";\n}\n.glyphicon-star-empty:before {\n content: "\\E049";\n}\n.glyphicon-hand-right:before {\n content: "\\E346";\n}\n.glyphicon-hand-left:before {\n content: "\\E347";\n}\n.glyphicon-thumbs-up:before {\n content: "\\E344";\n}\n.glyphicon-thumbs-down:before {\n content: "\\E345";\n}\n.glyphicon-remove-circle:before {\n content: "\\E198";\n}\n.glyphicon-th:before {\n content: "\\E157";\n}\n.glyphicon-user:before {\n content: "\\E004";\n}\n.glyphicon-comment:before {\n content: "\\E310";\n}\n.glyphicon-eye-open:before {\n content: "\\E052";\n}\n.glyphicon-paperclip:before {\n content: "\\E063";\n}\n.glyphicon-link:before {\n content: "\\E051";\n}\n.glyphicon-arrow-up:before {\n content: "\\E214";\n}\n.glyphicon-flash:before {\n content: "\\E242";\n}\n.glyphicon-time:before {\n content: "\\E055";\n}\n.glyphicon-volume-off:before {\n content: "\\E183";\n}\n.glyphicon-volume-up:before {\n content: "\\E185";\n}\n.glyphicon-hourglass:before {\n content: "\\231B";\n}\n.glyphicon-random:before {\n content: "\\E084";\n}\n.glyphicon-down-arrow:before {\n content: "\\E213";\n}\n.glyphicon-signal:before {\n content: "\\E080";\n}\n.glyphicon-crown:before {\n content: "\\E362";\n}\n.glyphicon-dashboard:before {\n content: "\\E332";\n}\n.glyphicon-show-lines:before {\n content: "\\E159";\n}\n.glyphicon-user-conversation:before {\n content: "\\E527";\n}\n.glyphicon-life-preserver:before {\n content: "\\E308";\n}\n.glyphicon-conversation:before {\n content: "\\E245";\n}\n.glyphicon-chat:before {\n content: "\\E246";\n}\n.glyphicon-baby-formula:before {\n content: "\\E492";\n}\n.glyphicon-stroller:before {\n content: "\\E076";\n}\n.glyphicon-edit:before {\n content: "\\E151";\n}\n.glyphicon-circle-question-mark:before {\n content: "\\E195";\n}\n.glyphicon-resize-small:before {\n content: "\\E215";\n}\n.glyphicon-shopping-bag:before {\n content: "\\E351";\n}\n.glyphicon-address-book:before {\n content: "\\E089";\n}\n.glyphicon-search:before {\n content: "\\E028";\n}\n.glyphicon-lightbulb:before {\n content: "\\E065";\n}\n.glyphicon-coffee-cup:before {\n content: "\\E295";\n}\n.glyphicon-grid:before {\n content: "\\E157";\n}\n.glyphicon-home:before {\n content: "\\E021";\n}\n.glyphicon-target:before {\n content: "\\E473";\n}\n.glyphicon-ban-circle:before {\n content: "\\E200";\n}\n.glyphicon-right-arrow:before {\n content: "\\E212";\n}\n\n');jg("/*\n\n Skrafl-explo.css\n\n Explo theme template for netskrafl.is\n\n Copyright © 2025 Miðeind ehf.\n Author: Vilhjalmur Thorsteinsson\n\n The Creative Commons Attribution-NonCommercial 4.0\n International Public License (CC-BY-NC 4.0) applies to this software.\n For further information, see https://github.com/mideind/Netskrafl\n\n*/\n/*\n*/\ndiv.netskrafl-container {\n --logo-primary: #C94314;\n --logo-secondary: #FFAA88;\n --logo-accent: #F17736;\n --svarkur-primary: #066960;\n --svarkur-secondary: #0a574f;\n --svarkur-accent: #008b7c;\n --malfridur-primary: #FF7C24;\n --malfridur-secondary: #ffb400;\n --malfridur-accent: #0788C0;\n --malfridur-green: #09814A;\n --dark-bg-color: #222222;\n --light-shadow: #666666;\n --blank-tile: #999999;\n --middle-shadow: #cccccc;\n --container-bg-color: #f8f8f8;\n --light-header-color: #eaf5f7;\n --header-color: hsl(from var(--malfridur-accent) h 50% 60%);\n --header-hover-color: hsl(from var(--malfridur-accent) h 50% 70%);\n --humangrad-color: hsl(from var(--malfridur-accent) h 55% 65%);\n --stats-foreground: hsl(from var(--malfridur-accent) h 45% 45%);\n --link-hover-color: #006db8;\n --double-word-color: hsl(from var(--malfridur-secondary) h 85% 80%); /* #f8D992; */\n --triple-word-color: hsl(from var(--malfridur-secondary) h 90% 55%); /* #F9B32D; */\n --double-letter-color: hsl(from var(--svarkur-accent) h 55% 65%); /* #9ED5DA; */\n --triple-letter-color: hsl(from var(--svarkur-secondary) h 70% 40%); /* #21A4B6; */\n --chat-background: hsl(from var(--malfridur-secondary) h 65% 92%);\n --ok-button: var(--malfridur-green);\n --cancel-button: hsl(from var(--logo-primary) h 70% 45%); /* #B6676D; */\n --human-color: hsl(from var(--svarkur-secondary) h s 35%); /* #208C9F; */\n --list-header-background: hsl(from var(--malfridur-secondary) h 85% 90%); /* #fff1d0; */\n --list-header-bottom: hsl(from var(--malfridur-secondary) h 90% 55%); /* #ffc559; */\n --tile-background: hsl(from var(--logo-secondary) h 70% 92%);\n --board-background: #E4EAF0;\n --tab-background: #f3f3f6;\n --header-background: #dde1e4;\n --two-letter-background: hsl(from var(--malfridur-green) h 20% 90%);\n --dark-shadow: rgba(0, 0, 0, 0.5);\n --rack-shadow: #afb7cad0;\n --focus-border: var(--triple-word-color);\n --light-background: #B9D9DC;\n --primary-font: 'Lato', 'Open Sans', 'Arial', sans-serif;\n --number-font: 'Open Sans', 'Lato', 'Arial', sans-serif;\n}\n\ndiv.netskrafl-container {\n position: relative;\n top: 0;\n left: 0;\n background-color: var(--container-bg-color);\n font-family: var(--primary-font);\n width: 375px;\n /* Full height is 667px - we subtract 115px for browser chrome, top and bottom */\n height: 552px;\n overflow-x: hidden;\n overflow-y: auto;\n margin: 0 auto;\n user-select: none;\n touch-action: none;\n}\ndiv.netskrafl-container * {\n box-sizing: content-box;\n}\ndiv.netskrafl-container ol, div.netskrafl-container ul {\n list-style: initial;\n}\ndiv.netskrafl-container h1,\ndiv.netskrafl-container h2,\ndiv.netskrafl-container h3 {\n font-size: revert;\n font-weight: revert;\n}\nbody div.netskrafl-loading,\nbody div.netskrafl-user {\n display: none;\n}\ndiv.netskrafl-container div.netskrafl-user {\n display: block;\n}\ndiv#board-background {\n height: 100%;\n}\ndiv.game-container {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n overflow-x: hidden;\n overflow-y: hidden;\n}\ndiv.netskrafl-container p {\n margin-top: 12px;\n margin-bottom: 12px;\n}\ninput,\ntextarea {\n user-select: text;\n}\np a img {\n display: inline;\n vertical-align: text-bottom;\n}\n.ui-helper-reset {\n margin: 0;\n padding: 0;\n border: 0;\n outline: 0;\n line-height: 50px;\n /* This determines the height of the tab row */\n text-decoration: none;\n font-size: 100%;\n list-style: none;\n}\n.ui-helper-clearfix:before,\n.ui-helper-clearfix:after {\n content: \"\";\n display: table;\n border-collapse: collapse;\n}\n.ui-helper-clearfix:after {\n clear: both;\n}\n.ui-helper-clearfix {\n min-height: 0;\n /* support: IE7 */\n}\n.ui-tabs {\n position: relative;\n /* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as \"fixed\") */\n padding: 3px;\n border-width: 0;\n}\n.ui-tabs .ui-tabs-nav {\n margin: 0;\n padding: 3px 3px 0;\n}\n.ui-tabs .ui-tabs-nav li {\n list-style: none;\n float: left;\n position: relative;\n top: 0;\n margin: 1px 0 0 6px;\n border-bottom-width: 0;\n padding: 0;\n white-space: nowrap;\n box-shadow: 1px 2px 4px 1px #afb7cad0;\n}\n.ui-tabs .ui-tabs-nav .ui-tabs-anchor {\n float: left;\n text-decoration: none;\n min-width: 91px;\n padding-left: 12px;\n padding-right: 12px;\n text-align: center;\n}\n.ui-tabs .ui-tabs-nav .ui-tabs-anchor.sp {\n /* Single page version */\n min-width: 51px;\n}\n.ui-tabs .ui-tabs-nav li.ui-tabs-active {\n margin-bottom: -1px;\n padding-bottom: 0px;\n background-color: var(--container-bg-color);\n}\n.ui-tabs .ui-tabs-panel {\n display: block;\n border-width: 0;\n padding-left: 6px;\n padding-right: 6px;\n padding-top: 4px;\n padding-bottom: 4px;\n background-color: var(--container-bg-color);\n}\n.ui-widget {\n font-family: var(--primary-font);\n font-size: 1.2em;\n}\n.ui-widget input,\n.ui-widget select,\n.ui-widget textarea,\n.ui-widget button {\n font-family: var(--primary-font);\n font-size: 1em;\n}\n.ui-widget-content {\n color: var(--dark-bg-color);\n}\n.ui-widget-content a {\n color: var(--dark-bg-color);\n}\n.ui-widget-header {\n color: var(--light-header-color);\n font-weight: bold;\n cursor: pointer;\n}\n.ui-widget-header a {\n color: var(--light-header-color);\n}\n.ui-state-default {\n background-color: var(--header-color);\n font-weight: bold;\n color: white;\n}\n.ui-state-default a,\n.ui-state-default a:link,\n.ui-state-default a:visited {\n color: white;\n text-decoration: none;\n}\n.ui-state-hover,\n.ui-state-focus {\n background-color: var(--header-hover-color);\n font-weight: bold;\n color: white;\n}\n.ui-state-hover a,\n.ui-state-hover a:hover,\n.ui-state-hover a:link,\n.ui-state-hover a:visited,\n.ui-state-focus a,\n.ui-state-focus a:hover,\n.ui-state-focus a:link,\n.ui-state-focus a:visited {\n color: white;\n text-decoration: none;\n}\n.ui-state-focus a:focus {\n outline: 0;\n}\n.ui-state-active,\n.ui-widget-content .ui-state-active {\n background-color: var(--container-bg-color);\n font-weight: bold;\n color: black;\n /* white; */\n}\n.ui-widget-header .ui-state-active {\n background-color: var(--container-bg-color);\n font-weight: bold;\n color: black;\n /* white; */\n}\n.ui-state-active a,\n.ui-state-active a:link,\n.ui-state-active a:hover,\n.ui-state-active a:visited {\n color: black;\n text-decoration: none;\n}\n.ui-corner-all,\n.ui-corner-left,\n.ui-corner-tl {\n border-top-left-radius: 4px;\n}\n.ui-corner-all,\n.ui-corner-right,\n.ui-corner-tr {\n border-top-right-radius: 4px;\n}\n.ui-corner-all,\n.ui-corner-bottom,\n.ui-corner-left,\n.ui-corner-bl {\n border-bottom-left-radius: 4px;\n}\n.ui-corner-all,\n.ui-corner-bottom,\n.ui-corner-right,\n.ui-corner-br {\n border-bottom-right-radius: 4px;\n}\n.ui-corner-top {\n border-top-left-radius: 6px;\n border-top-right-radius: 6px;\n}\nul.ui-tabs-nav.ui-corner-all {\n border-bottom-left-radius: 0px;\n border-bottom-right-radius: 0px;\n}\n/* Default media: small screen, i.e. mobile */\nspan.mobile-space {\n display: inline;\n padding-left: 32px;\n padding-right: 32px;\n}\n.no-mobile-block {\n display: none;\n}\n.no-mobile-inline {\n display: none;\n}\n.no-mobile-inline-block {\n display: none;\n}\n.no-mobile-list {\n display: none;\n}\n.upper {\n text-transform: uppercase;\n}\n@media all and (max-width: 360px) {\n /* Hack to squeeze the content on 360 pixel wide phones */\n div.netskrafl-container {\n transform: scale(0.96, 1);\n /* 0.96 = 360/375 */\n transform-origin: center top;\n }\n}\ndiv.header-logo {\n display: block;\n float: left;\n padding-left: 5px;\n padding-top: 14px;\n}\ndiv.header-button {\n display: block;\n float: right;\n}\ndiv.logo {\n display: none;\n position: absolute;\n top: 28px;\n left: 28px;\n width: 46px;\n}\ndiv.logo:hover {\n animation: expand 0.4s;\n}\ndiv.netskrafl-logo {\n display: flex;\n align-items: center;\n justify-content: center;\n}\ndiv.rightcol {\n position: relative;\n width: 362px;\n left: 6px;\n}\ndiv.logowrapper {\n display: inline-block;\n width: 11%;\n vertical-align: top;\n}\ndiv.playerwrapper {\n display: inline-block;\n position: relative;\n width: 89%;\n padding-top: 4px;\n}\ndiv.bag {\n position: absolute;\n right: 12px;\n width: 304px;\n height: 100px;\n /* Content is 97px max */\n font-size: 11px;\n font-weight: 700;\n text-transform: uppercase;\n text-align: center;\n margin: 0;\n padding: 0;\n opacity: 0.75;\n}\ntable.bag-content {\n border-collapse: separate;\n}\ntable.bag-content td {\n width: 12px;\n height: 17px;\n background-color: var(--double-letter-color);\n /* Color for old bag - seldom used */\n overflow: hidden;\n cursor: default;\n}\ntable.bag-content.new td {\n background-color: var(--tile-background);\n}\ntable.bag-content.empty td {\n background-color: var(--cancel-button);\n /* Opponent's color */\n color: white;\n}\ntd.over {\n outline: var(--focus-border) solid 3px;\n}\ntd.highlight {\n outline: var(--focus-border) solid 2px;\n}\ntr.colid td {\n height: 24px;\n width: 32px;\n margin: 0;\n padding: 0;\n overflow: hidden;\n background-color: transparent;\n text-align: center;\n font-size: 14px;\n line-height: 14px;\n font-weight: 400;\n border-color: transparent;\n box-shadow: none;\n}\n/* Board layout */\n#H8,\n#B2,\n#C3,\n#D4,\n#E5,\n#B14,\n#C13,\n#D12,\n#E11,\n#K5,\n#L4,\n#M3,\n#N2,\n#K11,\n#L12,\n#M13,\n#N14 {\n background-color: var(--double-word-color);\n}\n#A1,\n#A8,\n#A15,\n#H1,\n#H15,\n#O1,\n#O8,\n#O15 {\n background-color: var(--triple-word-color);\n}\n#A4,\n#A12,\n#C7,\n#C9,\n#D1,\n#D8,\n#D15,\n#G3,\n#G7,\n#G9,\n#G13,\n#H4,\n#H12,\n#I3,\n#I7,\n#I9,\n#I13,\n#O4,\n#O12,\n#M7,\n#M9,\n#L1,\n#L8,\n#L15 {\n background-color: var(--double-letter-color);\n}\n#B6,\n#B10,\n#F2,\n#F6,\n#F10,\n#F14,\n#N6,\n#N10,\n#J2,\n#J6,\n#J10,\n#J14 {\n background-color: var(--triple-letter-color);\n}\ntable.board td.dw:empty {\n /* Double word score */\n background-color: var(--double-word-color);\n}\ntable.board td.tw:empty {\n /* Triple word score */\n background-color: var(--triple-word-color);\n}\ntable.board td.dl:empty {\n /* Double letter score */\n background-color: var(--double-letter-color);\n}\ntable.board td.tl:empty {\n /* Triple letter score */\n background-color: var(--triple-letter-color);\n}\ntable.board td.center:empty {\n font-family: 'Glyphicons Regular';\n text-align: center;\n font-size: 17px;\n line-height: 21px;\n color: white;\n}\ntable.board td.center:empty::before {\n content: \"\\E473\";\n /* Target */\n animation: opacityBlink 1.5s infinite;\n}\ntable.board {\n margin-left: auto;\n margin-right: auto;\n padding: 0;\n border-spacing: 0;\n border-collapse: separate;\n table-layout: fixed;\n}\ndiv.board table.board {\n transform: scale(1);\n transform-origin: 0 0;\n transform-box: view-box;\n touch-action: pan-x pan-y;\n /*\n !!! Scrolling into view doesn't seem to work with this transition enabled\n transition: transform .2s ease-in-out;\n */\n}\ntable.board tr {\n height: 24px;\n}\n.rack table.board {\n border-spacing: 8px;\n margin-left: auto;\n margin-right: auto;\n}\n.rack table.board tr {\n height: 36px;\n}\ndiv.info {\n display: none;\n}\ndiv.board-help {\n display: none;\n}\ndiv.bag {\n display: none;\n}\ndiv.board-area {\n position: absolute;\n margin-left: 8px;\n top: 68px;\n padding-top: 6px;\n background-color: var(--container-bg-color);\n}\ndiv.board {\n background-color: var(--container-bg-color);\n overflow: hidden;\n width: 361px;\n}\ndiv.tile {\n position: relative;\n background-color: var(--tile-background);\n font-family: 'Open Sans', 'Arial', sans-serif;\n font-size: 17px;\n line-height: 21px;\n font-weight: 700;\n text-align: center;\n text-transform: uppercase;\n height: 21px;\n width: 21px;\n overflow: hidden;\n margin: 0;\n padding: 0;\n margin-left: -1px;\n padding-right: 1px;\n vertical-align: top;\n cursor: default;\n}\ndiv.tile.wide,\ndiv.tile.extra-wide {\n /* Wide tile in the rack */\n text-indent: -6px;\n}\ndiv.board div.tile.wide,\ndiv.board div.tile.extra-wide {\n /* Wide letter tile on the board */\n text-indent: -2px;\n}\n/* On small form factors, we have bigger tiles in the rack than on the board */\n.rack div.tile {\n font-size: 26px;\n line-height: 33px;\n height: 36px;\n width: 36px;\n margin-left: -2px;\n padding-right: 2px;\n}\n/* While dragging a tile, show it in the rack form factor */\ndiv.tile.dragging {\n position: fixed;\n z-index: 10;\n /* Note: We can't use variables here because this element\n becomes a child of the document body element when dragging, and\n the style variables are not in scope at the body level. */\n box-shadow: 3px 3px 3px 0 rgba(0, 0, 0, 0.2);\n border-color: var(--ok-button);\n border-radius: 5px;\n border-width: 3px;\n border-style: solid;\n overflow: visible;\n color: black;\n background-color: white;\n font-size: 26px;\n line-height: 33px;\n padding-top: 1px;\n height: 38px;\n width: 38px;\n /* The following is necessary as the tile is a child of the body,\n not of the netskrafl-container div */\n box-sizing: content-box;\n}\ndiv.tile.dragging.no-drop {\n border-color: var(--cancel-button);\n}\n.board td {\n min-width: 21px;\n overflow: hidden;\n background-color: var(--board-background);\n padding: 0;\n border-style: solid;\n border-color: white;\n border-width: 1.5px;\n border-radius: 2.5px;\n}\n.rack td {\n min-width: 36px;\n width: 36px;\n border-width: 0px;\n box-shadow: 2px 2px 4px 0 var(--rack-shadow);\n}\ntr.colid {\n display: none;\n}\ntd.rowid {\n display: none;\n}\ndiv.rack-row {\n display: block;\n width: 100%;\n margin-top: 8px;\n height: 52px;\n}\ndiv.rack-left {\n display: block;\n width: 14%;\n height: 1px;\n float: left;\n}\ndiv.rack-right {\n display: block;\n width: 0%;\n height: 1px;\n float: left;\n}\ndiv.rack {\n display: block;\n position: relative;\n padding: 0;\n width: 86%;\n float: left;\n top: -6px;\n left: -3px;\n}\ndiv.letterscore {\n position: absolute;\n bottom: 0px;\n right: 1px;\n height: 9px;\n width: 9px;\n font-size: 6px;\n line-height: 9px;\n text-align: right;\n font-weight: 400;\n padding: 0;\n background-color: transparent;\n vertical-align: bottom;\n}\ndiv.tile.wide div.letterscore,\ndiv.tile.extra-wide div.letterscore {\n /* Adjust letter score tracking for wide tiles */\n letter-spacing: -0.5px;\n}\n.rack div.letterscore {\n right: 2px;\n bottom: 3px;\n font-size: 9px;\n line-height: 9px;\n}\ndiv.tile.dragging div.letterscore {\n bottom: 5px;\n right: 1.75px;\n font-size: 9px;\n line-height: 9px;\n}\ndiv.word-check {\n display: none;\n position: absolute;\n width: 44px;\n height: 44px;\n text-align: center;\n vertical-align: middle;\n top: 460px;\n left: 259px;\n background-color: transparent;\n font-family: 'Glyphicons Regular';\n font-style: normal;\n font-weight: normal;\n font-size: 22px;\n line-height: 42px;\n visibility: hidden;\n border: 1.5px solid;\n border-radius: 5px;\n}\ndiv.score {\n display: none;\n position: absolute;\n width: 44px;\n height: 44px;\n text-align: center;\n vertical-align: middle;\n top: 460px;\n left: 318px;\n background-color: transparent;\n font-size: 20px;\n font-weight: 700;\n line-height: 42px;\n color: var(--blank-tile);\n border: 1.5px solid;\n border-radius: 5px;\n border-color: var(--blank-tile);\n}\n.standard-button {\n text-align: center;\n font-size: 18px;\n font-weight: 700;\n color: white;\n margin: 0;\n padding: 6px;\n padding-top: 9px;\n border-radius: 5px;\n cursor: pointer;\n}\n.submitbutton {\n text-align: center;\n font-size: 18px;\n font-weight: 700;\n color: white;\n margin: 0;\n padding: 6px;\n padding-top: 9px;\n border-radius: 5px;\n cursor: pointer;\n width: 32px;\n height: 26px;\n background-color: var(--ok-button);\n}\ndiv.submitnewgame {\n text-align: center;\n font-size: 18px;\n font-weight: 700;\n color: white;\n margin: 0;\n padding: 6px;\n padding-top: 9px;\n border-radius: 5px;\n cursor: pointer;\n width: 32px;\n height: 26px;\n background-color: var(--ok-button);\n display: none;\n}\ndiv.fb-share {\n text-align: center;\n font-size: 18px;\n font-weight: 700;\n color: white;\n margin: 0;\n padding: 6px;\n padding-top: 9px;\n border-radius: 5px;\n cursor: pointer;\n width: 32px;\n height: 26px;\n background-color: var(--ok-button);\n display: none;\n /* Don't display on mobile */\n}\ndiv.fb-share:hover {\n outline: var(--focus-border) solid 3px;\n}\ndiv.waitmove {\n text-align: center;\n font-size: 18px;\n font-weight: 700;\n color: white;\n margin: 0;\n padding: 6px;\n padding-top: 9px;\n border-radius: 5px;\n cursor: pointer;\n width: 32px;\n height: 26px;\n background-color: var(--ok-button);\n z-index: 10;\n border-style: solid;\n border-width: 1px;\n border-color: var(--ok-button);\n background-color: white;\n margin-right: 1px;\n float: right;\n width: 96px;\n}\ndiv.animated-waitmove {\n position: relative;\n display: inline-block;\n width: 40px;\n top: -4px;\n}\ndiv.login-buttons {\n position: relative;\n}\ndiv.login-padding {\n min-height: 60px;\n}\ndiv.try-again {\n text-align: center;\n font-size: 18px;\n font-weight: 700;\n color: white;\n margin: 0;\n padding: 6px;\n padding-top: 9px;\n border-radius: 5px;\n cursor: pointer;\n width: 32px;\n height: 26px;\n background-color: var(--ok-button);\n display: block;\n position: absolute;\n width: 128px;\n top: 12px;\n left: auto;\n right: 0;\n padding: 10px;\n font-size: 16px;\n}\ndiv.get-help {\n text-align: center;\n font-size: 18px;\n font-weight: 700;\n color: white;\n margin: 0;\n padding: 6px;\n padding-top: 9px;\n border-radius: 5px;\n cursor: pointer;\n width: 32px;\n height: 26px;\n background-color: var(--ok-button);\n display: block;\n position: absolute;\n top: 12px;\n left: 0;\n right: auto;\n width: 128px;\n padding: 10px;\n font-size: 16px;\n background-color: var(--triple-letter-color);\n}\ndiv.get-help span.glyphicon {\n padding-right: 6px;\n}\ndiv.try-again span.glyphicon {\n padding-right: 6px;\n}\ndiv.recallbtn {\n text-align: center;\n font-size: 18px;\n font-weight: 700;\n color: white;\n margin: 0;\n padding: 6px;\n padding-top: 9px;\n border-radius: 5px;\n cursor: pointer;\n width: 33px;\n height: 26px;\n background-color: var(--triple-word-color);\n display: none;\n}\ndiv.rack-left div.recallbtn {\n display: block;\n margin-right: auto;\n /* Left-align the button */\n}\ndiv.scramblebtn {\n text-align: center;\n font-size: 18px;\n font-weight: 700;\n color: white;\n margin: 0;\n padding: 6px;\n padding-top: 9px;\n border-radius: 5px;\n cursor: pointer;\n width: 33px;\n height: 26px;\n background-color: var(--malfridur-accent);\n display: none;\n}\ndiv.rack-left div.scramblebtn {\n display: block;\n margin-right: auto;\n /* Left-align the button */\n}\ndiv.buttons {\n position: relative;\n height: 54px;\n}\ndiv.buttons .glyphicon {\n top: 0;\n}\n.bottom-button {\n text-align: center;\n font-size: 18px;\n font-weight: 700;\n color: white;\n margin: 0;\n padding: 6px;\n padding-top: 9px;\n border-radius: 5px;\n cursor: pointer;\n position: absolute;\n top: 0;\n padding-top: 8px;\n background-color: var(--tab-background);\n border: 1.5px solid var(--header-background);\n width: 66px;\n height: 23px;\n}\ndiv.submitresign {\n text-align: center;\n font-size: 18px;\n font-weight: 700;\n margin: 0;\n padding: 6px;\n padding-top: 9px;\n border-radius: 5px;\n cursor: pointer;\n position: absolute;\n top: 0;\n padding-top: 8px;\n background-color: var(--tab-background);\n border: 1.5px solid var(--header-background);\n width: 66px;\n height: 23px;\n color: var(--cancel-button);\n left: 0px;\n}\ndiv.submitexchange {\n text-align: center;\n font-size: 18px;\n font-weight: 700;\n margin: 0;\n padding: 6px;\n padding-top: 9px;\n border-radius: 5px;\n cursor: pointer;\n position: absolute;\n top: 0;\n left: 93px;\n padding-top: 8px;\n background-color: var(--tab-background);\n border: 1.5px solid var(--header-background);\n width: 66px;\n height: 23px;\n color: var(--ok-button);\n}\ndiv.submitexchange.disabled {\n color: var(--blank-tile);\n}\ndiv.submitpass {\n text-align: center;\n font-size: 18px;\n font-weight: 700;\n margin: 0;\n padding: 6px;\n padding-top: 9px;\n border-radius: 5px;\n cursor: pointer;\n position: absolute;\n top: 0;\n padding-top: 8px;\n background-color: var(--tab-background);\n border: 1.5px solid var(--header-background);\n width: 66px;\n height: 23px;\n color: var(--triple-word-color);\n left: 186px;\n}\ndiv.challenge {\n text-align: center;\n font-size: 18px;\n font-weight: 700;\n margin: 0;\n padding: 6px;\n padding-top: 9px;\n border-radius: 5px;\n cursor: pointer;\n position: absolute;\n top: 0;\n padding-top: 8px;\n background-color: var(--tab-background);\n border: 1.5px solid var(--header-background);\n width: 66px;\n height: 23px;\n left: 279px;\n color: var(--triple-letter-color);\n}\ndiv.challenge.disabled {\n border-color: var(--board-background);\n}\ndiv.submitmove {\n text-align: center;\n font-size: 18px;\n font-weight: 700;\n color: white;\n margin: 0;\n padding: 6px;\n padding-top: 9px;\n border-radius: 5px;\n cursor: pointer;\n width: 32px;\n height: 26px;\n background-color: var(--ok-button);\n display: none;\n}\ndiv.rack-right div.submitmove {\n display: block;\n margin-left: auto;\n /* Right-align the button */\n}\ndiv.submitmove.error-shown {\n display: none;\n}\ndiv.submitmove span.glyphicon {\n margin-left: 8px;\n}\ndiv.player {\n display: block;\n padding-left: 4px;\n padding-right: 4px;\n height: 30px;\n min-height: 30px;\n font-size: 14px;\n font-weight: 400;\n color: white;\n}\ndiv.scorewrapper {\n font-family: var(--number-font);\n background-color: transparent;\n width: 100%;\n}\ndiv.scoreleft {\n display: block;\n width: 42px;\n height: 26px;\n padding-left: 4px;\n font-size: 22px;\n line-height: 27px;\n font-weight: 400;\n text-align: left;\n color: white;\n overflow: hidden;\n position: absolute;\n top: 4px;\n left: 0;\n}\ndiv.scoreright {\n display: block;\n width: 42px;\n height: 26px;\n padding-right: 4px;\n font-size: 22px;\n line-height: 27px;\n font-weight: 400;\n text-align: right;\n color: white;\n overflow: hidden;\n position: absolute;\n top: 4px;\n right: 0;\n}\ndiv.robot-btn {\n display: block;\n position: absolute;\n margin-left: 0px;\n margin-right: 2px;\n padding-top: 4px;\n height: 30px;\n min-height: 30px;\n line-height: 22px;\n border-width: 0px;\n white-space: nowrap;\n overflow: hidden;\n background-color: transparent;\n}\ndiv.robot-btn span.glyphicon-cog {\n margin-right: 2px;\n}\ndiv.gamestats div.robot-btn {\n width: 100%;\n margin: 0;\n padding-top: 6px;\n}\ndiv.player-btn {\n display: block;\n position: absolute;\n margin-left: 4px;\n margin-right: 4px;\n padding-top: 4px;\n height: 30px;\n min-height: 30px;\n line-height: 22px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n background-color: transparent;\n color: white;\n border-width: 0;\n border-radius: 5px;\n}\ndiv.player-btn.left,\ndiv.robot-btn.left {\n padding-left: 38px;\n padding-right: 12px;\n}\ndiv.player-btn.right,\ndiv.robot-btn.right {\n padding-left: 10px;\n /* Note: purposefully a bit asymmetric with the left button */\n padding-right: 38px;\n}\ndiv.player-btn.left.tomove,\ndiv.player-btn.right.tomove {\n color: white;\n}\ndiv.player-btn.left.tomove:hover,\ndiv.player-btn.right.tomove:hover {\n color: black;\n}\ndiv.heading {\n position: relative;\n width: 100%;\n /* background-color: @container; */\n top: 0;\n left: 0;\n padding-left: 0;\n padding-right: 0;\n height: 38px;\n}\ndiv.tabbed-page {\n position: absolute;\n left: 0;\n top: 0;\n width: 375px;\n height: 552px;\n overflow: hidden;\n font-size: 13px;\n line-height: 23px;\n}\ndiv.tab-scroll-area {\n position: relative;\n}\ndiv.loginform-small {\n display: block;\n position: absolute;\n width: 375px;\n padding-top: 0;\n padding-left: 0;\n padding-right: 0;\n}\ndiv.loginform-large {\n display: none;\n position: absolute;\n left: 220px;\n right: 120px;\n top: 24px;\n width: auto;\n max-width: 740px;\n padding: 0;\n}\ndiv.login-logo {\n margin-top: 120px;\n margin-left: 100px;\n}\ndiv.login-legend {\n margin-left: 50px;\n margin-top: 40px;\n}\ndiv#logo-pic {\n text-align: center;\n padding-top: 32px;\n padding-bottom: 16px;\n}\ndiv.loginform-small div#logo-pic {\n padding-top: 0;\n}\n@keyframes expand {\n 0% {\n transform: scale(1);\n }\n 40% {\n transform: scale(1.05);\n }\n 100% {\n transform: scale(1);\n }\n}\n@-webkit-keyframes expand {\n 0% {\n transform: scale(1);\n }\n 40% {\n transform: scale(1.05);\n }\n 100% {\n transform: scale(1);\n }\n}\n@keyframes slidein {\n 0% {\n transform: scale(0);\n }\n 100% {\n transform: scale(1);\n }\n}\n@-webkit-keyframes slidein {\n 0% {\n transform: scale(0);\n }\n 100% {\n transform: scale(1);\n }\n}\ndiv.login-btn-large {\n text-align: center;\n font-size: 19px;\n font-weight: 400;\n width: 160px;\n color: white;\n background-color: var(--header-hover-color);\n margin: 0;\n margin-top: 24px;\n margin-left: 6px;\n padding: 6px;\n padding-top: 8px;\n padding-bottom: 12px;\n border-radius: 5px;\n cursor: pointer;\n float: right;\n}\ndiv.login-btn-large:hover {\n background-color: var(--triple-word-color);\n animation: expand 0.4s;\n}\ndiv.login-btn-large span {\n padding-left: 18px;\n}\ndiv.login-btn-small {\n width: 60%;\n text-align: center;\n font-size: 19px;\n font-weight: 400;\n color: white;\n background-color: var(--ok-button);\n margin-left: auto;\n margin-right: auto;\n margin-top: 60px;\n padding: 6px;\n padding-top: 9px;\n padding-bottom: 9px;\n border-radius: 5px;\n vertical-align: middle;\n cursor: pointer;\n}\ndiv.login-btn-small:hover {\n background-color: var(--triple-word-color);\n}\ndiv.blurb {\n font-size: 16px;\n font-weight: bold;\n padding-bottom: 24px;\n text-align: center;\n}\ndiv.login-error {\n padding: 12px;\n margin-top: 160px;\n margin-left: 8px;\n margin-right: 16px;\n background-color: white;\n color: black;\n border-style: solid;\n border-width: 0px;\n border-radius: 5px;\n font-size: 15px;\n box-shadow: 3px 3px 5px 2px var(--dark-shadow);\n}\np.login-sorry {\n font-weight: bold;\n}\np.login-error-icon {\n margin-top: 8px;\n margin-bottom: 8px;\n font-size: 34px;\n color: var(--triple-word-color);\n}\ndiv.leftplayer {\n display: inline-block;\n width: 50%;\n text-align: left;\n border-radius: 4px 0 0 4px;\n}\ndiv.rightplayer {\n display: inline-block;\n width: 50%;\n text-align: right;\n border-radius: 0 4px 4px 0;\n}\ndiv.right-tab {\n position: absolute;\n top: -28px;\n height: 34px;\n min-height: 34px;\n width: 55px;\n min-width: 55px;\n overflow: visible;\n visibility: visible;\n text-align: center;\n vertical-align: middle;\n padding-top: 4px;\n font-size: 16px;\n line-height: 18px;\n border-radius: 5px;\n opacity: 0.6;\n z-index: 0;\n cursor: pointer;\n box-shadow: 2px 2px 4px 0 #afb7cad0;\n}\ndiv.right-tab#tab-board {\n left: 41px;\n background-color: var(--container-bg-color);\n}\ndiv.right-tab#tab-movelist {\n left: 106px;\n background-color: var(--board-background);\n}\ndiv.right-tab#tab-twoletter {\n left: 171px;\n background-color: var(--two-letter-background);\n}\ndiv.right-tab#tab-games {\n left: 236px;\n background-color: var(--tile-background);\n}\ndiv.right-tab#tab-chat {\n left: 301px;\n background-color: var(--chat-background);\n}\ndiv.right-tab.selected {\n opacity: 1;\n}\ndiv.right-tab:hover {\n opacity: 1;\n}\ndiv.right-tab.alert > span.glyphicon {\n color: var(--cancel-button);\n animation: redBlink 1s infinite;\n -webkit-animation: redBlink 1s infinite;\n}\ndiv.right-area {\n /* display: none; */\n position: relative;\n top: 30px;\n left: 0;\n height: 464px;\n width: 100%;\n font-size: 16px;\n line-height: 16px;\n font-weight: 400;\n color: black;\n cursor: default;\n}\ndiv.right-area.with-clock {\n height: 380px;\n margin-top: 48px;\n}\ndiv.message {\n text-align: center;\n font-size: 14px;\n line-height: 26px;\n height: 28px;\n background-color: var(--light-background);\n font-weight: 400;\n}\ndiv.message strong {\n text-transform: uppercase;\n}\ndiv.movelist-container {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 458px;\n background-color: var(--board-background);\n padding-top: 8px;\n padding-bottom: 0;\n z-index: 6;\n border-radius: 4px 4px 0 0;\n}\ndiv.movelist {\n font-family: var(--number-font);\n margin: 0;\n padding: 0;\n overflow: auto;\n width: 100%;\n height: 350px;\n}\ndiv.movelist.bestmoves {\n overflow-y: hidden;\n}\ndiv.movelist-container div.bag {\n display: block;\n background-color: var(--container-bg-color);\n position: relative;\n left: 0;\n margin: 0;\n padding-top: 4px;\n padding-left: 27px;\n width: 100%;\n height: 104px;\n}\ndiv.game-timed {\n display: none;\n}\ndiv.modal-dialog {\n visibility: hidden;\n position: fixed;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n z-index: 10;\n background-color: rgba(32, 32, 32, 0.2);\n}\ndiv.modal-dialog#spinner-dialog {\n background-color: rgba(255, 255, 255, 0.4);\n}\ndiv.animated-spinner {\n position: absolute;\n left: 50%;\n top: 271.5px;\n}\nsvg circle.shadow {\n filter: drop-shadow(0px 3px 3px rgba(0, 0, 0, 0.4));\n}\n.std-form {\n position: absolute;\n padding-left: 12px;\n padding-right: 12px;\n padding-top: 6px;\n padding-bottom: 6px;\n box-shadow: 3px 3px 5px 2px var(--dark-shadow);\n font-size: 1em;\n z-index: 20;\n background-color: var(--container-bg-color);\n}\ndiv#blank-form {\n position: absolute;\n padding-left: 12px;\n padding-right: 12px;\n padding-top: 6px;\n padding-bottom: 6px;\n box-shadow: 3px 3px 5px 2px var(--dark-shadow);\n font-size: 1em;\n z-index: 20;\n background-color: var(--container-bg-color);\n top: 124px;\n right: 36.5px;\n width: 274px;\n height: 400px;\n background-color: var(--board-background);\n}\n.bottom-message {\n position: absolute;\n text-align: right;\n display: block;\n bottom: 0;\n left: 0;\n width: 352px;\n height: 52px;\n font-size: 14px;\n line-height: 26px;\n margin: 0;\n padding-top: 0px;\n padding-left: 4px;\n padding-right: 4px;\n padding-bottom: 4px;\n visibility: hidden;\n transform-origin: left top;\n animation: slidein 0.4s;\n}\n.bold-bottom-message {\n position: absolute;\n text-align: right;\n display: block;\n bottom: 0;\n left: 0;\n width: 352px;\n height: 52px;\n font-size: 14px;\n line-height: 26px;\n margin: 0;\n padding-top: 0px;\n padding-left: 4px;\n padding-right: 4px;\n padding-bottom: 4px;\n visibility: hidden;\n transform-origin: left top;\n animation: slidein 0.4s;\n text-align: center;\n color: white;\n border-radius: 4px;\n}\ndiv.error {\n position: absolute;\n text-align: right;\n display: block;\n bottom: 0;\n left: 0;\n width: 352px;\n height: 52px;\n font-size: 14px;\n line-height: 26px;\n margin: 0;\n padding-top: 0px;\n padding-left: 4px;\n padding-right: 4px;\n padding-bottom: 4px;\n visibility: hidden;\n transform-origin: left top;\n animation: slidein 0.4s;\n text-align: center;\n color: white;\n border-radius: 4px;\n background-color: var(--cancel-button);\n cursor: pointer;\n}\ndiv.opp-turn {\n display: inline-block;\n padding-top: 10px;\n padding-left: 10px;\n width: 220px;\n text-align: right;\n}\ndiv.opp-turn.flashing {\n color: var(--cancel-button);\n transition: 0.1s;\n transform: scale(1.1);\n transform-origin: center left;\n animation: redBlink 0.4s;\n animation-iteration-count: 2;\n}\ndiv#congrats,\ndiv#gameover {\n position: absolute;\n text-align: right;\n display: block;\n bottom: 0;\n left: 0;\n width: 352px;\n height: 52px;\n font-size: 14px;\n line-height: 26px;\n margin: 0;\n padding-top: 0px;\n padding-left: 4px;\n padding-right: 4px;\n padding-bottom: 4px;\n visibility: hidden;\n transform-origin: left top;\n animation: slidein 0.4s;\n visibility: visible;\n font-size: 16px;\n width: 100%;\n text-align: center;\n padding-bottom: 0px;\n}\ndiv#congrats span.glyphicon-bookmark {\n padding-right: 2px;\n color: var(--ok-button);\n}\ndiv#gameover span.glyphicon-info-sign {\n padding-right: 4px;\n color: var(--triple-letter-color);\n}\ndiv.resign {\n position: absolute;\n text-align: right;\n display: block;\n bottom: 0;\n left: 0;\n width: 352px;\n height: 52px;\n font-size: 14px;\n line-height: 26px;\n margin: 0;\n padding-top: 0px;\n padding-left: 4px;\n padding-right: 4px;\n padding-bottom: 4px;\n visibility: hidden;\n transform-origin: left top;\n animation: slidein 0.4s;\n text-align: center;\n color: white;\n border-radius: 4px;\n background-color: var(--cancel-button);\n}\ndiv.pass {\n position: absolute;\n text-align: right;\n display: block;\n bottom: 0;\n left: 0;\n width: 352px;\n height: 52px;\n font-size: 14px;\n line-height: 26px;\n margin: 0;\n padding-top: 0px;\n padding-left: 4px;\n padding-right: 4px;\n padding-bottom: 4px;\n visibility: hidden;\n transform-origin: left top;\n animation: slidein 0.4s;\n text-align: center;\n color: white;\n border-radius: 4px;\n background-color: var(--triple-word-color);\n}\ndiv.pass-last {\n position: absolute;\n text-align: right;\n display: block;\n bottom: 0;\n left: 0;\n width: 352px;\n height: 52px;\n font-size: 14px;\n line-height: 26px;\n margin: 0;\n padding-top: 0px;\n padding-left: 4px;\n padding-right: 4px;\n padding-bottom: 4px;\n visibility: hidden;\n transform-origin: left top;\n animation: slidein 0.4s;\n text-align: center;\n color: white;\n border-radius: 4px;\n background-color: var(--triple-word-color);\n}\ndiv.chall {\n position: absolute;\n text-align: right;\n display: block;\n bottom: 0;\n left: 0;\n width: 352px;\n height: 52px;\n font-size: 14px;\n line-height: 26px;\n margin: 0;\n padding-top: 0px;\n padding-left: 4px;\n padding-right: 4px;\n padding-bottom: 4px;\n visibility: hidden;\n transform-origin: left top;\n animation: slidein 0.4s;\n text-align: center;\n color: white;\n border-radius: 4px;\n background-color: var(--triple-letter-color);\n}\ndiv.chall-info {\n position: absolute;\n text-align: right;\n display: block;\n bottom: 0;\n left: 0;\n width: 352px;\n height: 52px;\n font-size: 14px;\n line-height: 26px;\n margin: 0;\n padding-top: 0px;\n padding-left: 4px;\n padding-right: 4px;\n padding-bottom: 4px;\n visibility: hidden;\n transform-origin: left top;\n animation: slidein 0.4s;\n text-align: center;\n color: white;\n border-radius: 4px;\n background-color: var(--ok-button);\n bottom: 60px;\n line-height: 20px;\n width: 311px;\n padding: 2px 24px 0px;\n}\ndiv.exchange {\n position: absolute;\n text-align: right;\n display: block;\n bottom: 0;\n left: 0;\n width: 352px;\n height: 52px;\n font-size: 14px;\n line-height: 26px;\n margin: 0;\n padding-top: 0px;\n padding-left: 4px;\n padding-right: 4px;\n padding-bottom: 4px;\n visibility: hidden;\n transform-origin: left top;\n animation: slidein 0.4s;\n text-align: center;\n color: white;\n border-radius: 4px;\n background-color: var(--ok-button);\n}\ndiv.submitmove#move-mobile {\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n float: right;\n margin-right: 1px;\n width: 96px;\n font-weight: 700;\n color: black;\n background-color: var(--tile-background);\n padding-left: 10px;\n padding-right: 10px;\n padding-top: 6px;\n}\ndiv.submitmove#move-mobile.manual {\n background-color: var(--double-letter-color);\n color: white;\n}\ndiv.submitmove#move-mobile.word-good {\n background-color: var(--ok-button);\n color: white;\n}\n@keyframes colorPulseMobile {\n 0% {\n transform: scale(1);\n }\n 40% {\n transform: scale(1.3);\n }\n 60% {\n transform: scale(1.3);\n }\n 100% {\n transform: scale(1);\n }\n}\n@-webkit-keyframes colorPulseMobile {\n 0% {\n transform: scale(1);\n }\n 40% {\n transform: scale(1.3);\n }\n 60% {\n transform: scale(1.3);\n }\n 100% {\n transform: scale(1);\n }\n}\nspan.score-mobile {\n display: inline-block;\n font-weight: 400;\n font-size: 22px;\n line-height: 22px;\n}\ndiv.submitmove#move-mobile.word-great span.score-mobile {\n animation: colorPulseMobile 1.5s infinite;\n -webkit-animation: colorPulseMobile 1.5s infinite;\n}\ndiv.submitmove#move-mobile span.glyphicon {\n top: 0px;\n margin-top: 2px;\n}\ndiv.force-resign {\n display: inline-flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n font-weight: normal;\n font-size: 13px;\n margin: 0;\n padding: 6px;\n cursor: pointer;\n height: 26px;\n width: 122px;\n margin-right: 1px;\n color: white;\n background-color: var(--cancel-button);\n border-radius: 5px;\n}\ndiv.gameinfo {\n position: absolute;\n text-align: right;\n display: block;\n bottom: 0;\n left: 0;\n width: 352px;\n height: 52px;\n font-size: 14px;\n line-height: 26px;\n margin: 0;\n padding-top: 0px;\n padding-left: 4px;\n padding-right: 4px;\n padding-bottom: 4px;\n visibility: hidden;\n transform-origin: left top;\n animation: slidein 0.4s;\n bottom: 56px;\n height: 34px;\n background-color: var(--board-background);\n font-weight: normal;\n color: white;\n padding-top: 10px;\n}\ninput.chat-txt {\n box-sizing: border-box;\n font-family: var(--primary-font);\n width: 276px;\n font-size: 18px;\n height: 24px;\n font-weight: normal;\n border-style: solid;\n border-color: var(--ok-button);\n border-width: 1px;\n border-radius: 3px;\n margin-top: 1px;\n padding-top: 4px;\n padding-bottom: 3px;\n padding-left: 6px;\n padding-right: 6px;\n}\ninput.chat-txt:focus {\n border-color: var(--ok-button);\n border-width: 2px;\n padding-left: 5px;\n padding-right: 5px;\n outline-style: none;\n}\ndiv.chat-area {\n position: absolute;\n top: 6px;\n left: 6px;\n height: 402px;\n width: 336px;\n padding: 6px;\n overflow: auto;\n}\ndiv.modal-close#chat-send {\n display: inline-block;\n position: relative;\n font-size: 18px;\n line-height: 18px;\n height: 28px;\n bottom: 2px;\n right: 0;\n margin: 0 0 2px 8px;\n padding-top: 4px;\n padding-bottom: 0;\n background-color: var(--ok-button);\n color: white;\n}\ndiv.twoletter {\n position: absolute;\n top: 0px;\n left: 0px;\n width: 100%;\n height: 466px;\n background-color: var(--two-letter-background);\n overflow: hidden;\n z-index: 3;\n border-radius: 4px 4px 0 0;\n}\ndiv.twoletter-area {\n position: absolute;\n top: 0;\n right: 0;\n height: 100%;\n font-size: 18px;\n line-height: 25px;\n text-align: right;\n padding-left: 14px;\n padding-right: 10px;\n margin-top: 12px;\n cursor: pointer;\n}\ndiv.twoletter-area#two-2 {\n visibility: hidden;\n}\ndiv.twoletter-group {\n display: inline-block;\n margin-right: 5px;\n}\ndiv.twoletter-word {\n display: inline-block;\n padding-right: 4px;\n}\ndiv.twoletter-word b {\n background-color: var(--ok-button);\n color: white;\n padding-left: 2px;\n padding-right: 2px;\n border-radius: 2px;\n}\nspan.statsbutton {\n display: none;\n}\ndiv#ready-toggler {\n display: none;\n}\ndiv#timed-toggler {\n display: none;\n}\ndiv.help-container img {\n /* On mobile, scale images in help text down to fit the column width */\n max-width: 100%;\n height: auto;\n object-fit: scale-down;\n display: inline;\n}\ndiv#tabs,\ndiv#main-tabs {\n border-width: 0;\n padding: 0;\n}\ndiv#tabs > div[role=tabpanel],\ndiv#main-tabs > div[role=tabpanel] {\n position: relative;\n top: -8px;\n height: 504px;\n}\ndiv#main-tabs div.header-logo {\n padding-left: 14px;\n padding-right: 8px;\n padding-top: 7px;\n}\ndiv#tabs {\n background-color: transparent;\n}\ndiv.userid {\n display: none;\n}\nspan.list-ts {\n display: none;\n width: 164px;\n max-width: 164px;\n}\nspan.list-ts-short {\n display: none;\n padding-left: 4px;\n width: 144px;\n max-width: 144px;\n}\nspan.list-chall {\n display: inline-block;\n width: 184px;\n max-width: 184px;\n overflow: hidden;\n text-overflow: ellipsis;\n}\nspan.list-s0 {\n width: 38px;\n max-width: 38px;\n text-align: right;\n justify-content: flex-end;\n}\nspan.list-s1 {\n width: 38px;\n max-width: 38px;\n text-align: left;\n justify-content: flex-start;\n}\nspan.list-colon {\n justify-content: center;\n text-align: center;\n width: 8px;\n max-width: 8px;\n}\nspan.list-scorehdr {\n display: inline-block;\n width: 84px;\n /* list-s0 + list-colon + list-s1 */\n max-width: 84px;\n text-align: center;\n}\ndiv.list-elo-adj {\n display: inline-flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n width: 52px;\n max-width: 52px;\n text-align: center;\n text-overflow: clip;\n}\nspan.list-elo-hdr {\n display: inline-block;\n width: 104px;\n /* list-elo-adj * 2 */\n max-width: 104px;\n text-align: center;\n}\nspan.list-tc {\n display: inline-block;\n width: 84px;\n max-width: 84px;\n text-align: left;\n padding-right: 0;\n}\ndiv.tilecount {\n display: inline-block;\n vertical-align: middle;\n font-size: 12px;\n line-height: 12px;\n margin-bottom: 2px;\n width: 92px;\n min-width: 92px;\n text-align: left;\n background-color: white;\n border-radius: 6px;\n overflow: hidden;\n}\ndiv.tc {\n display: inline-block;\n text-align: left;\n background-color: var(--ok-button);\n}\ndiv.tc.losing {\n background-color: var(--cancel-button);\n}\ndiv.tc:before {\n content: \"\\A0\";\n /* Invisible space */\n}\ndiv#userlist span.list-ch,\ndiv#elolist span.list-ch,\ndiv#chall-received span.list-ch,\ndiv#chall-sent span.list-ch,\ndiv#userlist span.list-fav {\n cursor: pointer;\n}\nspan.list-ch,\nspan.list-fav,\nspan.list-icon,\nspan.list-myturn,\nspan.list-overdue {\n display: inline-block;\n font-size: 18px;\n width: 26px;\n min-width: 26px;\n overflow: hidden;\n margin-left: 2px;\n}\nspan.list-overdue,\nspan.list-fav {\n display: none;\n}\nspan.list-newbag {\n display: none;\n font-size: 18px;\n color: var(--triple-word-color);\n width: 22px;\n max-width: 22px;\n margin-left: 14px;\n}\nspan.list-manual {\n display: none;\n font-size: 18px;\n color: var(--triple-word-color);\n /* width: 26px; */\n max-width: 26px;\n margin-left: 14px;\n}\nspan.list-win {\n display: inline-block;\n font-size: 18px;\n width: 26px;\n max-width: 26px;\n margin-left: 0;\n}\nspan.list-nick {\n display: inline-block;\n width: 140px;\n min-width: 140px;\n overflow: hidden;\n}\nspan.list-nick-elo {\n display: inline-block;\n width: 150px;\n max-width: 150px;\n}\nspan.list-opp {\n display: inline-block;\n width: 150px;\n max-width: 150px;\n}\nspan.list-fullname {\n display: inline-block;\n width: 400px;\n min-width: 400px;\n overflow: hidden;\n}\nspan.list-fullname-robot {\n display: inline-block;\n font-size: 14px;\n width: 188px;\n min-width: 188px;\n font-style: italic;\n /* Robot description doesn't fit into the column on mobile */\n overflow: hidden;\n text-overflow: ellipsis;\n}\nspan.list-human-elo {\n display: inline-block;\n width: 40px;\n max-width: 40px;\n text-align: center;\n margin-right: 6px;\n}\nspan.list-duration {\n display: none;\n width: 192px;\n max-width: 192px;\n text-align: right;\n}\nspan.list-info-hdr {\n display: none;\n width: 52px;\n max-width: 52px;\n text-align: center;\n}\nspan.list-info {\n display: none;\n width: 52px;\n top: -3px;\n text-align: center;\n height: 24px;\n line-height: 20px;\n}\nspan.list-rank {\n display: inline-block;\n width: 36px;\n max-width: 36px;\n text-align: center;\n margin-right: 8px;\n}\nspan.list-rank-no-mobile {\n display: none;\n width: 32px;\n max-width: 32px;\n text-align: center;\n margin-right: 10px;\n}\nspan.list-elo {\n display: inline-block;\n width: 40px;\n max-width: 40px;\n text-align: center;\n margin-right: 10px;\n}\nspan.list-elo-no-mobile {\n display: none;\n width: 40px;\n max-width: 40px;\n text-align: center;\n margin-right: 10px;\n}\nspan.list-games {\n display: none;\n width: 48px;\n max-width: 48px;\n text-align: right;\n margin-right: 10px;\n}\nspan.list-ratio {\n display: none;\n width: 40px;\n max-width: 40px;\n text-align: right;\n margin-right: 10px;\n}\nspan.list-avgpts {\n display: none;\n width: 36px;\n max-width: 36px;\n text-align: right;\n margin-right: 16px;\n}\nspan.mobile-break {\n display: inline;\n}\n.tab-legend {\n display: none;\n font-weight: normal;\n}\ndiv.user-cat span#break {\n display: inline;\n}\ndiv.user-cat#user-headings {\n line-height: 32px;\n}\ndiv.user-cat#user-search {\n display: none;\n}\ndiv#chall-form {\n position: absolute;\n padding-left: 12px;\n padding-right: 12px;\n padding-top: 6px;\n padding-bottom: 6px;\n box-shadow: 3px 3px 5px 2px var(--dark-shadow);\n font-size: 1em;\n z-index: 20;\n background-color: var(--container-bg-color);\n position: relative;\n padding-top: 8px;\n /* left: @margin-small; */\n left: auto;\n right: auto;\n margin-left: auto;\n margin-right: auto;\n top: 48px;\n width: 327px;\n height: 352px;\n font-size: 0.85em;\n}\ndiv#chall-fairplay {\n margin-top: 10px;\n padding-left: 0;\n padding-right: 0;\n font-size: 14px;\n text-align: right;\n}\ndiv#chall-oldbag {\n position: absolute;\n bottom: 16px;\n font-size: 14px;\n}\ndiv#chall-oldbag td span.glyphicon-exclamation-sign {\n color: var(--cancel-button);\n padding-right: 8px;\n}\nspan.caption.wide {\n width: 200px;\n}\ndiv#manual-toggler {\n display: inline-block;\n}\ndiv#chall-ok {\n right: 12px;\n width: 72px;\n /* Override */\n background-color: var(--ok-button);\n}\ndiv#chall-cancel {\n right: 108px;\n /* 12 + 72 + 12 + 12 */\n width: 72px;\n /* Override */\n background-color: var(--cancel-button);\n}\ndiv.user-cat#user-headings span {\n white-space: nowrap;\n}\ndiv#user-load {\n display: none;\n position: absolute;\n top: 321.5px;\n left: 175.5px;\n width: 24px;\n height: 24px;\n z-index: 10;\n background-image: url('user-loader.gif');\n background-repeat: no-repeat;\n background-size: 24px 24px;\n}\ndiv#promo-form {\n position: absolute;\n padding-left: 12px;\n padding-right: 12px;\n padding-top: 6px;\n padding-bottom: 6px;\n box-shadow: 3px 3px 5px 2px var(--dark-shadow);\n font-size: 1em;\n z-index: 20;\n background-color: var(--container-bg-color);\n top: 64px;\n left: 12px;\n width: 327px;\n height: 364px;\n line-height: 1.5em;\n}\ndiv.promo-content {\n margin-top: 16px;\n margin-left: 16px;\n margin-right: 16px;\n}\ndiv.promo-fullscreen {\n display: none;\n}\ndiv.promo-mobile {\n display: block;\n}\ndiv.btn-promo-yes {\n text-align: center;\n font-size: 18px;\n font-weight: 700;\n color: white;\n margin: 0;\n padding: 6px;\n padding-top: 9px;\n border-radius: 5px;\n cursor: pointer;\n position: absolute;\n width: 200px;\n height: 28px;\n bottom: 48px;\n right: 232px;\n top: auto;\n background-color: var(--ok-button);\n}\ndiv.btn-promo-no {\n text-align: center;\n font-size: 18px;\n font-weight: 700;\n color: white;\n margin: 0;\n padding: 6px;\n padding-top: 9px;\n border-radius: 5px;\n cursor: pointer;\n position: absolute;\n width: 80px;\n height: 28px;\n bottom: 24px;\n right: 24px;\n top: auto;\n background-color: var(--ok-button);\n}\ndiv #userlist,\ndiv #elolist {\n height: 396px;\n /* 11 lines @ 36px each */\n overflow-y: auto;\n overflow-x: hidden;\n}\ndiv #gamelist {\n height: 468px;\n /* 13 lines @ 36px each */\n overflow-y: auto;\n overflow-x: hidden;\n}\ndiv #recentlist {\n height: 396px;\n /* 11 lines @ 36px each */\n overflow-y: auto;\n overflow-x: hidden;\n}\ndiv #usr-recent {\n height: 432px;\n /* 12 lines @ 36px each */\n overflow-y: auto;\n overflow-x: hidden;\n}\ndiv #chall-sent,\ndiv #chall-received {\n height: 216px;\n /* 6 lines @ 36px each */\n overflow-y: auto;\n overflow-x: hidden;\n}\ndiv.games {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 442px;\n background-color: var(--tile-background);\n overflow: auto;\n z-index: 2;\n padding-top: 12px;\n padding-bottom: 12px;\n border-radius: 4px 4px 0 0;\n}\ndiv#wait-form {\n position: absolute;\n padding-left: 12px;\n padding-right: 12px;\n padding-top: 6px;\n padding-bottom: 6px;\n box-shadow: 3px 3px 5px 2px var(--dark-shadow);\n font-size: 1em;\n z-index: 20;\n background-color: var(--container-bg-color);\n top: 8px;\n left: 4px;\n width: 335px;\n height: 488px;\n}\nspan.move-indicator {\n position: relative;\n top: 2px;\n display: inline-block;\n font-family: 'Glyphicons Regular';\n font-style: normal;\n font-weight: normal;\n line-height: 1;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n color: var(--triple-word-color);\n margin-right: 4px;\n}\nspan.move-indicator:before {\n content: \"\\E267\";\n}\ndiv.hint {\n display: none;\n position: absolute;\n top: 136px;\n font-style: italic;\n font-size: 1em;\n z-index: 10;\n color: var(--light-shadow);\n margin-left: 12px;\n margin-right: 12px;\n}\ndiv.stats-box {\n font-family: var(--number-font);\n width: 224px;\n position: absolute;\n top: 0px;\n right: -62px;\n}\ndiv.stats-fig {\n display: inline-block;\n width: 68px;\n height: 24px;\n padding: 3px;\n background-color: transparent;\n color: var(--stats-foreground);\n border-style: solid;\n border-width: 2px;\n border-radius: 4px;\n border-color: var(--stats-foreground);\n text-align: center;\n font-weight: 700;\n font-size: 16px;\n line-height: 21px;\n vertical-align: middle;\n margin-top: 4px;\n margin-right: 2px;\n margin-left: 2px;\n cursor: default;\n}\ndiv#own-toggler {\n position: absolute;\n top: 2px;\n margin-top: 0;\n margin-right: 8px;\n}\np#own-best {\n display: inline-block;\n position: absolute;\n left: auto;\n right: 174px;\n top: 26px;\n text-align: right;\n font-size: 0.85em;\n}\ndiv#own-stats {\n position: relative;\n margin-top: 2px;\n margin-bottom: 32px;\n height: 48px;\n width: 100%;\n vertical-align: top;\n}\n/* Paragraphs of help text that should be centered on screens that are wide enough */\np.help-center {\n text-align: left;\n}\ndiv.racktile {\n cursor: pointer;\n background-color: white;\n}\n@keyframes selBlink {\n 0% {\n color: white;\n background-color: var(--cancel-button);\n }\n 45% {\n color: white;\n background-color: var(--cancel-button);\n }\n 50% {\n color: black;\n background-color: white;\n }\n 95% {\n color: black;\n background-color: white;\n }\n 100% {\n color: white;\n background-color: var(--cancel-button);\n }\n}\n@-webkit-keyframes selBlink {\n 0% {\n color: white;\n background-color: var(--cancel-button);\n }\n 45% {\n color: white;\n background-color: var(--cancel-button);\n }\n 50% {\n color: black;\n background-color: white;\n }\n 95% {\n color: black;\n background-color: white;\n }\n 100% {\n color: white;\n background-color: var(--cancel-button);\n }\n}\n@keyframes selBlank {\n 0% {\n color: white;\n background-color: var(--cancel-button);\n }\n 45% {\n color: white;\n background-color: var(--cancel-button);\n }\n 50% {\n color: var(--blank-tile);\n background-color: white;\n }\n 95% {\n color: var(--blank-tile);\n background-color: white;\n }\n 100% {\n color: white;\n background-color: var(--cancel-button);\n }\n}\n@-webkit-keyframes selBlank {\n 0% {\n color: white;\n background-color: var(--cancel-button);\n }\n 45% {\n color: white;\n background-color: var(--cancel-button);\n }\n 50% {\n color: var(--blank-tile);\n background-color: white;\n }\n 95% {\n color: var(--blank-tile);\n background-color: white;\n }\n 100% {\n color: white;\n background-color: var(--cancel-button);\n }\n}\n@keyframes redBlink {\n 0% {\n opacity: 1;\n }\n 30% {\n opacity: 1;\n }\n 50% {\n opacity: 0;\n }\n 70% {\n opacity: 1;\n }\n 100% {\n opacity: 1;\n }\n}\n@-webkit-keyframes redBlink {\n 0% {\n opacity: 1;\n }\n 30% {\n opacity: 1;\n }\n 50% {\n opacity: 0;\n }\n 70% {\n opacity: 1;\n }\n 100% {\n opacity: 1;\n }\n}\n@keyframes opacityBlink {\n 0% {\n opacity: 1;\n }\n 25% {\n opacity: 1;\n }\n 75% {\n opacity: 1;\n }\n 80% {\n opacity: 0.1;\n }\n 100% {\n opacity: 0.1;\n }\n}\n@-webkit-keyframes opacityBlink {\n 0% {\n opacity: 1;\n }\n 25% {\n opacity: 1;\n }\n 75% {\n opacity: 1;\n }\n 80% {\n opacity: 0.1;\n }\n 100% {\n opacity: 0.1;\n }\n}\ndiv.sel {\n animation: selBlink 1.2s infinite;\n -webkit-animation: selBlink 1.2s infinite;\n}\ndiv.blanktile.sel {\n animation: selBlank 1.2s infinite;\n -webkit-animation: selBlank 1.2s infinite;\n}\ntd.sel {\n outline: var(--cancel-button) solid 3px;\n}\ndiv.xchg {\n cursor: pointer;\n}\ndiv.xchgsel {\n color: white;\n background-color: var(--ok-button);\n}\n.blanktile {\n color: var(--blank-tile);\n}\n@keyframes fresh-appear {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n}\n@-webkit-keyframes fresh-appear {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n}\ndiv.freshtile {\n color: white;\n background-color: var(--cancel-button);\n opacity: 0;\n animation-name: fresh-appear;\n animation-duration: 100ms;\n animation-delay: 0s;\n animation-fill-mode: forwards;\n -webkit-animation-name: fresh-appear;\n -webkit-animation-duration: 100ms;\n -webkit-animation-delay: 0s;\n -webkit-animation-fill-mode: forwards;\n}\ndiv.highlight0 {\n /* Human (local) player */\n color: black;\n background-color: white;\n}\ndiv.highlight1 {\n /* Computer (remote) player */\n color: white;\n background-color: var(--cancel-button);\n}\ndiv.highlight0.blanktile {\n /* Human (local) player */\n color: var(--blank-tile);\n}\ndiv.highlight1.blanktile {\n /* Computer (remote) player */\n color: #f3d6d8;\n}\ndiv.highlight0.dim {\n background-color: #fbedee;\n}\ndiv.highlight1.dim {\n background-color: #deb3b6;\n}\n.clock {\n display: inline-block;\n position: absolute;\n top: 82px;\n width: 147px;\n font-size: 28px;\n line-height: 28px;\n font-weight: 700;\n color: var(--dark-bg-color);\n overflow: hidden;\n margin-top: 4px;\n margin-bottom: 4px;\n}\nh3.clockleft {\n display: inline-block;\n position: absolute;\n top: 82px;\n width: 147px;\n font-size: 28px;\n line-height: 28px;\n font-weight: 700;\n color: var(--dark-bg-color);\n overflow: hidden;\n margin-top: 4px;\n margin-bottom: 4px;\n left: 0;\n text-align: left;\n}\nh3.clockright {\n display: inline-block;\n position: absolute;\n top: 82px;\n width: 147px;\n font-size: 28px;\n line-height: 28px;\n font-weight: 700;\n color: var(--dark-bg-color);\n overflow: hidden;\n margin-top: 4px;\n margin-bottom: 4px;\n right: 0;\n text-align: right;\n}\nh3.clockleft.running-out {\n color: var(--cancel-button);\n}\nh3.clockright.running-out {\n color: var(--cancel-button);\n}\ndiv.clockface {\n display: block;\n position: absolute;\n top: 84px;\n width: 100%;\n text-align: center;\n font-size: 28px;\n line-height: 28px;\n color: var(--triple-word-color);\n}\ndiv.fairplay {\n position: absolute;\n top: 10px;\n width: 100%;\n text-align: center;\n color: var(--ok-button);\n}\ndiv.games-item {\n position: relative;\n height: 24px;\n margin-left: 32px;\n margin-right: 32px;\n margin-top: 2px;\n margin-bottom: 2px;\n padding-left: 4px;\n padding-right: 4px;\n padding-top: 7px;\n padding-bottom: 5px;\n overflow: hidden;\n vertical-align: top;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\ndiv.games-item a:link,\ndiv.games-item a:visited {\n color: black;\n text-decoration: none;\n}\ndiv.games-item a:hover {\n color: black;\n}\ndiv.games-item:hover {\n border-radius: 5px;\n background-color: rgba(86, 153, 165, 0.5);\n}\ndiv.at-top-left {\n position: absolute;\n top: 6px;\n left: 10px;\n height: 24px;\n font-size: 16px;\n line-height: 20px;\n font-weight: bold;\n}\ndiv.at-top-left div.tilecount {\n width: 276px;\n min-width: 276px;\n height: 24px;\n border-radius: 10px;\n border-width: 0;\n overflow: hidden;\n background-color: var(--header-background);\n}\ndiv.at-top-left div.tilecount.trans {\n background-color: transparent;\n}\ndiv.at-top-left div.tilecount div.tc {\n color: var(--container-bg-color);\n padding-left: 4px;\n margin-left: 0;\n overflow: hidden;\n border-radius: 10px;\n border-width: 0;\n font-size: 16px;\n line-height: 20px;\n font-weight: bold;\n padding-top: 2px;\n padding-bottom: 2px;\n}\ndiv.at-top-left div.tilecount div.oc {\n color: var(--dark-bg-color);\n padding-left: 8px;\n margin-left: 0;\n overflow: hidden;\n font-size: 16px;\n line-height: 20px;\n font-weight: bold;\n padding-top: 2px;\n padding-bottom: 2px;\n background-color: transparent;\n}\ndiv.chat-container {\n position: absolute;\n top: 0px;\n left: 0px;\n width: 100%;\n height: 466px;\n background-color: var(--chat-background);\n z-index: 1;\n border-radius: 4px 4px 0 0;\n}\ndiv.chat-area.with-clock {\n height: 310px;\n}\ndiv.chat-ts {\n clear: both;\n display: inline-block;\n color: var(--dark-shadow);\n font-size: 12px;\n line-height: 12px;\n text-align: center;\n margin-top: 12px;\n margin-bottom: 8px;\n width: 100%;\n}\ndiv.chat-msg {\n display: inline-block;\n border-radius: 8px;\n padding-top: 6px;\n padding-bottom: 6px;\n padding-left: 10px;\n padding-right: 10px;\n color: black;\n font-size: 15px;\n line-height: 20px;\n max-width: 80%;\n margin-bottom: 6px;\n}\ndiv.chat-msg.left {\n float: left;\n clear: both;\n text-align: left;\n}\ndiv.chat-msg.right {\n float: right;\n clear: both;\n text-align: right;\n}\ndiv.chat-msg.local {\n background-color: var(--board-background);\n}\ndiv.chat-msg.remote {\n background-color: #F1DBDA;\n}\ndiv.chat-msg img {\n /* Emoticon alignment to baseline */\n vertical-align: -10px;\n display: inline;\n margin-left: 2px;\n margin-right: 2px;\n}\ndiv.chat-input {\n position: absolute;\n bottom: 0px;\n left: 0px;\n height: 36px;\n padding: 6px;\n vertical-align: bottom;\n}\ndiv.movelist.noscroll {\n overflow-y: hidden;\n}\ndiv.leftmove {\n text-align: left;\n padding-left: 0px;\n height: 20px;\n line-height: 18px;\n}\ndiv.rightmove {\n text-align: right;\n padding-right: 0px;\n height: 20px;\n line-height: 18px;\n}\ndiv.reviewhdr {\n height: 18px;\n text-align: left;\n padding: 11px;\n background-color: var(--ok-button);\n color: white;\n font-weight: 400;\n font-size: 18px;\n line-height: 18px;\n}\nspan.movenumber {\n background-color: white;\n color: var(--ok-button);\n text-align: center;\n font-size: 18px;\n font-weight: 700;\n margin-top: 0;\n margin-bottom: 0;\n margin-left: 0px;\n margin-right: 8px;\n padding-top: 2px;\n padding-bottom: 2px;\n padding-left: 12px;\n padding-right: 12px;\n}\ndiv.gameover {\n text-align: center;\n margin-top: 6px;\n padding: 10px;\n background-color: var(--triple-word-color);\n color: white;\n font-weight: 700;\n}\nspan.gameovermsg {\n margin-right: 6px;\n}\ndiv.gamestats {\n visibility: hidden;\n color: black;\n background-color: white;\n z-index: 20;\n position: absolute;\n width: 724px;\n height: 580px;\n left: 150px;\n top: 24px;\n padding: 12px;\n border-radius: 5px;\n box-shadow: 3px 3px 5px 2px var(--dark-shadow);\n}\ndiv.statscol {\n display: block;\n float: left;\n width: 50%;\n}\ndiv.statscol p {\n margin-top: 0;\n margin-bottom: 12px;\n}\ndiv.gamestats p span {\n font-weight: 700;\n}\ndiv#gamestarted {\n width: 100%;\n text-align: center;\n position: relative;\n margin-top: 16px;\n margin-bottom: 16px;\n}\n#gamestarted p {\n font-style: italic;\n margin-top: 4px;\n margin-bottom: 8px;\n}\n.humancolor {\n background-color: var(--human-color);\n}\n.autoplayercolor {\n background-color: var(--cancel-button);\n}\n/* Scores in move list */\n.humangrad_left {\n color: var(--human-color);\n}\n.autoplayergrad_right {\n color: var(--cancel-button);\n}\n.humangrad_right {\n color: var(--human-color);\n}\n.autoplayergrad_left {\n color: var(--cancel-button);\n}\nspan.score {\n display: inline-block;\n width: 28px;\n padding-left: 2px;\n margin-left: 2px;\n padding-right: 2px;\n margin-right: 2px;\n font-weight: 700;\n text-align: right;\n line-height: 20px;\n}\nspan.total {\n display: inline-block;\n width: 28px;\n padding-left: 3px;\n margin-left: 0px;\n padding-right: 6px;\n margin-right: 0px;\n font-weight: 700;\n text-align: right;\n color: white;\n line-height: 20px;\n}\ndiv.leftmove span.total {\n border-left-width: 0px;\n border-left-style: solid;\n border-top-right-radius: 2.5px;\n border-bottom-right-radius: 2.5px;\n margin-right: 2px;\n}\ndiv.rightmove span.total {\n border-right-width: 0px;\n border-right-style: solid;\n border-top-left-radius: 2.5px;\n border-bottom-left-radius: 2.5px;\n margin-left: 2px;\n}\nspan.total.human {\n background-color: var(--human-color);\n}\ndiv.leftmove span.total.human {\n border-left-color: var(--svarkur-secondary);\n}\ndiv.rightmove span.total.human {\n border-right-color: var(--svarkur-secondary);\n}\nspan.total.autoplayer {\n background-color: var(--cancel-button);\n}\ndiv.leftmove span.total.autoplayer {\n border-left-color: var(--cancel-button);\n}\ndiv.rightmove span.total.autoplayer {\n border-right-color: var(--cancel-button);\n}\nspan.highlight {\n background-color: var(--ok-button);\n color: white;\n}\nspan.wordmove {\n text-transform: uppercase;\n padding-left: 3px;\n padding-right: 3px;\n font-size: 12px;\n}\nspan.wordmove i {\n font-weight: bold;\n padding-left: 3px;\n padding-right: 3px;\n font-size: 16px;\n}\nspan.othermove {\n text-transform: none;\n padding-left: 3px;\n font-size: 14px;\n}\ndiv.error p {\n display: inline;\n position: relative;\n top: 0;\n left: 0;\n margin: 0;\n padding: 0;\n}\ndiv.error span.glyphicon {\n padding-right: 6px;\n}\nspan.pass-explain {\n font-weight: normal;\n font-style: italic;\n padding-left: 3px;\n padding-right: 3px;\n}\nspan.yesnobutton {\n height: 20px;\n text-align: center;\n background-color: white;\n font-size: 16px;\n font-weight: 700;\n margin-top: 0;\n margin-bottom: 0;\n margin-left: 4px;\n margin-right: 4px;\n padding-top: 2px;\n padding-bottom: 2px;\n padding-left: 12px;\n padding-right: 12px;\n border-radius: 5px;\n cursor: pointer;\n}\ndiv.resign span.yesnobutton {\n color: var(--cancel-button);\n}\ndiv.pass span.yesnobutton,\ndiv.pass-last span.yesnobutton {\n color: var(--triple-word-color);\n}\ndiv.exchange span.yesnobutton {\n color: var(--ok-button);\n}\ndiv.chall span.yesnobutton {\n color: var(--triple-letter-color);\n}\nspan.closebtn {\n color: var(--triple-word-color);\n}\nspan.yesnobutton#force-resign {\n display: none;\n}\ndiv.score.word-good {\n color: var(--ok-button);\n border-color: var(--ok-button);\n}\ndiv.score.manual {\n color: var(--triple-letter-color);\n border-color: var(--triple-letter-color);\n}\n@keyframes colorPulse {\n 0% {\n color: var(--ok-button);\n }\n 40% {\n color: var(--cancel-button);\n transform: scale(1.05);\n }\n 60% {\n color: var(--cancel-button);\n transform: scale(1.05);\n }\n 100% {\n color: var(--ok-button);\n }\n}\n@-webkit-keyframes colorPulse {\n 0% {\n color: var(--ok-button);\n }\n 40% {\n color: var(--cancel-button);\n transform: scale(1.05);\n }\n 60% {\n color: var(--cancel-button);\n transform: scale(1.05);\n }\n 100% {\n color: var(--ok-button);\n }\n}\ndiv.score.word-great {\n animation: colorPulse 1.5s infinite;\n -webkit-animation: colorPulse 1.5s infinite;\n border-color: var(--ok-button);\n}\ndiv.score.opponent {\n color: white;\n background-color: var(--cancel-button);\n border: none;\n}\ndiv.score.localplayer {\n color: white;\n background-color: var(--human-color);\n border: none;\n}\ndiv.channel {\n position: absolute;\n width: 32px;\n height: 32px;\n text-align: center;\n bottom: 40px;\n left: 32px;\n background-color: transparent;\n font-family: 'Glyphicons Regular';\n font-style: normal;\n font-weight: normal;\n font-size: 20px;\n overflow: hidden;\n visibility: hidden;\n}\ndiv.channel:before {\n content: \"\\E051\";\n /* glyphicon-link */\n}\ndiv.word-check.word-good {\n color: var(--ok-button);\n border-color: var(--ok-button);\n visibility: visible;\n}\ndiv.word-check.word-good:before {\n content: \"\\E344\";\n /* glyphicon-thumbs-up */\n}\ndiv.word-check.word-bad {\n color: var(--cancel-button);\n border-color: var(--cancel-button);\n visibility: visible;\n}\ndiv.word-check.word-bad:before {\n content: \"\\E200\";\n /* glyphicon-ban-circle */\n}\ndiv.board-help {\n position: absolute;\n z-index: 2;\n left: 22px;\n top: 160px;\n width: 54px;\n background-color: white;\n padding: 2px;\n border-radius: 5px;\n cursor: default;\n}\ndiv.board-help-close {\n width: 50px;\n text-align: right;\n background-color: white;\n margin: 2px;\n}\ndiv.board-help-close span {\n background-color: var(--cancel-button);\n color: white;\n padding: 1px;\n padding-top: 2px;\n padding-left: 2px;\n cursor: pointer;\n}\ndiv.board-help-close span:hover {\n background-color: var(--triple-word-color);\n}\ndiv.board-colors {\n margin: 0;\n padding: 0;\n}\ndiv.board-color {\n width: 44px;\n text-align: center;\n font-size: 12px;\n line-height: 15px;\n padding-left: 3px;\n padding-right: 3px;\n padding-top: 4px;\n padding-bottom: 4px;\n font-weight: 400;\n border: solid 2px white;\n border-collapse: collapse;\n}\ndiv.board-color#triple-word {\n background-color: var(--triple-word-color);\n color: white;\n border-bottom: none;\n}\ndiv.board-color#double-word {\n background-color: var(--double-word-color);\n border-bottom: none;\n}\ndiv.board-color#triple-letter {\n background-color: var(--triple-letter-color);\n color: white;\n border-bottom: none;\n}\ndiv.board-color#double-letter {\n background-color: var(--double-letter-color);\n border-bottom: none;\n}\ndiv.board-color#single-letter {\n background-color: var(--board-background);\n color: black;\n}\ndiv.scorediff {\n position: absolute;\n width: 50px;\n height: 28px;\n text-align: center;\n vertical-align: middle;\n bottom: 272px;\n left: 643px;\n background-color: var(--cancel-button);\n font-size: 18px;\n font-weight: normal;\n color: white;\n visibility: hidden;\n padding-top: 3px;\n padding-bottom: 2px;\n font-family: 'Open Sans', 'Arial', sans-serif;\n}\ndiv.posdiff {\n background-color: var(--ok-button);\n}\ndiv.navbtn {\n text-align: center;\n font-size: 18px;\n font-weight: 700;\n color: white;\n margin: 0;\n padding: 6px;\n padding-top: 9px;\n border-radius: 5px;\n cursor: pointer;\n top: auto;\n width: 90px;\n height: 30px;\n bottom: 136px;\n line-height: 24px;\n background-color: var(--ok-button);\n}\ndiv.navbtn#navnext {\n position: absolute;\n left: 550px;\n font-weight: normal;\n}\ndiv.navbtn#navprev {\n position: absolute;\n left: 110px;\n font-weight: normal;\n}\nspan#nav-prev-visible {\n display: inline;\n}\nspan#nav-prev-waiting {\n display: none;\n}\nspan#nav-next-visible {\n display: inline;\n}\nspan#nav-next-waiting {\n display: none;\n}\ndiv.closebtn {\n text-align: center;\n font-size: 18px;\n font-weight: 700;\n color: white;\n margin: 0;\n padding: 6px;\n padding-top: 9px;\n border-radius: 5px;\n cursor: pointer;\n width: 100px;\n height: 28px;\n bottom: 12px;\n background-color: var(--ok-button);\n}\n#review-close {\n position: absolute;\n right: 12px;\n}\nspan#total0,\nspan#total1 {\n font-size: 28px;\n margin-left: 8px;\n margin-right: 8px;\n}\ndiv.promo-content h2 {\n color: var(--ok-button);\n font-size: 24px;\n line-height: 30px;\n font-weight: bold;\n}\ndiv.promo-content h2 span.glyphicon-coffee-cup,\ndiv.help-container span.glyphicon-coffee-cup {\n color: var(--triple-word-color);\n}\ndiv.promo-krafla {\n background-color: var(--board-background);\n}\ndiv.btn-krafla-yes {\n text-align: center;\n font-size: 18px;\n font-weight: 700;\n color: white;\n margin: 0;\n padding: 6px;\n padding-top: 9px;\n border-radius: 5px;\n cursor: pointer;\n width: 80px;\n height: 28px;\n bottom: 48px;\n right: 48px;\n top: auto;\n background-color: var(--ok-button);\n}\ndiv#btn-thanks {\n text-align: center;\n font-size: 18px;\n font-weight: 700;\n color: white;\n margin: 0;\n padding: 6px;\n padding-top: 9px;\n border-radius: 5px;\n cursor: pointer;\n position: absolute;\n width: 96px;\n height: 28px;\n bottom: 24px;\n right: 24px;\n top: auto;\n background-color: var(--ok-button);\n}\ndiv#btn-cancel-yes {\n text-align: center;\n font-size: 18px;\n font-weight: 700;\n color: white;\n margin: 0;\n padding: 6px;\n padding-top: 9px;\n border-radius: 5px;\n cursor: pointer;\n width: 160px;\n height: 28px;\n bottom: 24px;\n right: 24px;\n top: auto;\n background-color: var(--cancel-button);\n}\ndiv#btn-cancel-no {\n text-align: center;\n font-size: 18px;\n font-weight: 700;\n color: white;\n margin: 0;\n padding: 6px;\n padding-top: 9px;\n border-radius: 5px;\n cursor: pointer;\n width: 160px;\n height: 28px;\n bottom: 24px;\n right: 208px;\n top: auto;\n background-color: var(--ok-button);\n}\n.tabbed-page a:link,\n.tabbed-page a:visited {\n text-decoration: none;\n color: var(--humangrad-color);\n}\n.tabbed-page a:hover {\n text-decoration: none;\n color: var(--triple-word-color);\n}\na.ui-tabs-anchor:link,\na.ui-tabs-anchor:visited {\n color: white;\n}\n.notifier {\n display: none;\n /* Set to inline-block by the script if shown */\n background-color: var(--cancel-button);\n color: white;\n border-radius: 9px;\n height: 18px;\n font-size: 13px;\n line-height: 18px;\n font-weight: 700;\n margin-left: 6px;\n padding-left: 5px;\n padding-right: 5px;\n margin-top: 16px;\n vertical-align: top;\n}\nspan#numgames {\n display: none;\n /* Set to inline-block by the script if shown */\n background-color: var(--cancel-button);\n color: white;\n border-radius: 9px;\n height: 18px;\n font-size: 13px;\n line-height: 18px;\n font-weight: 700;\n margin-left: 6px;\n padding-left: 5px;\n padding-right: 5px;\n margin-top: 16px;\n vertical-align: top;\n}\nspan#numchallenges {\n display: none;\n /* Set to inline-block by the script if shown */\n background-color: var(--cancel-button);\n color: white;\n border-radius: 9px;\n height: 18px;\n font-size: 13px;\n line-height: 18px;\n font-weight: 700;\n margin-left: 6px;\n padding-left: 5px;\n padding-right: 5px;\n margin-top: 16px;\n vertical-align: top;\n}\ndiv.smallprint {\n font-size: 12px;\n padding-top: 6px;\n}\ndiv.userid {\n position: absolute;\n top: 22px;\n right: 26px;\n max-width: 210px;\n height: 22px;\n text-align: right;\n font-size: 16px;\n line-height: 16px;\n font-weight: 700;\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n padding: 6px 10px 4px 6px;\n margin: 0;\n z-index: 5;\n color: #5699A5;\n background-color: white;\n border-radius: 5px;\n cursor: pointer;\n}\ndiv.userid:hover {\n background-color: var(--humangrad-color);\n color: white;\n}\ndiv.listitem {\n display: flex;\n flex-direction: row;\n align-items: center;\n height: 28px;\n padding-left: 4px;\n padding-right: 4px;\n padding-top: 4px;\n padding-bottom: 4px;\n white-space: nowrap;\n justify-items: center;\n}\n.listheader > span {\n top: 0;\n}\n.listitem a {\n display: flex;\n cursor: pointer;\n}\n.listitem a:link,\n.listitem a:visited {\n color: black;\n text-decoration: none;\n}\n.listitem a:hover {\n color: var(--triple-word-color);\n}\n.listitem span {\n display: flex;\n align-items: center;\n}\ndiv.oddlist {\n background-color: var(--board-background);\n}\ndiv.evenlist {\n background-color: #F7F0DE;\n}\ndiv.listheader {\n background-color: var(--list-header-background);\n font-weight: 400;\n border-bottom-width: 2px;\n border-bottom-color: var(--list-header-bottom);\n border-bottom-style: solid;\n}\ndiv#elo-hdr span {\n cursor: default;\n}\ndiv#elo-toggler {\n display: inline-block;\n position: absolute;\n top: 38px;\n bottom: auto;\n left: auto;\n right: 6px;\n z-index: 10;\n}\nspan.bold {\n font-weight: 700;\n}\ndiv#initials {\n margin-top: 8px;\n margin-bottom: 14px;\n padding: 0;\n}\ndiv.user-cat {\n display: inline-block;\n vertical-align: middle;\n}\ndiv.user-cat#user-search {\n float: right;\n}\ndiv.user-cat span {\n font-size: 16px;\n cursor: pointer;\n padding-left: 4px;\n padding-top: 1px;\n padding-bottom: 4px;\n padding-right: 6px;\n margin: 2px;\n}\ndiv.user-cat span.shown {\n background-color: rgba(158, 213, 218, 0.3);\n border-radius: 5px;\n}\ndiv.user-cat span:hover {\n color: white;\n background-color: var(--header-hover-color);\n border-radius: 5px;\n}\ndiv.user-cat#user-search span.glyphicon-search {\n padding-top: 6px;\n padding-bottom: 6px;\n top: 0;\n}\nspan.versus-cat span {\n font-size: 16px;\n cursor: pointer;\n padding-left: 6px;\n padding-top: 1px;\n padding-bottom: 4px;\n padding-right: 6px;\n margin: 2px;\n}\nspan.versus-cat span.shown {\n background-color: rgba(158, 213, 218, 0.2);\n border-radius: 5px;\n}\nspan.versus-cat span:hover {\n color: white;\n background-color: var(--double-letter-color);\n border-radius: 5px;\n}\nspan.ready-btn {\n position: relative;\n top: 2px;\n display: inline-block;\n font-family: 'Glyphicons Regular';\n font-style: normal;\n font-weight: normal;\n line-height: 1;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n font-size: 15px;\n line-height: 15px;\n top: 0;\n cursor: default; /* Not a pushable button even though it looks like one */\n color: white;\n background-color: var(--triple-letter-color);\n border-radius: 5px;\n padding: 4px;\n margin: 0 4px 0 0;\n}\nspan.ready-btn:before {\n content: \"\\E344\";\n /* thumbs-up */\n}\nspan.timed-btn {\n position: relative;\n top: 2px;\n display: inline-block;\n font-family: 'Glyphicons Regular';\n font-style: normal;\n font-weight: normal;\n line-height: 1;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n font-size: 15px;\n line-height: 15px;\n top: 0px;\n cursor: default;\n color: white;\n background-color: var(--triple-word-color);\n border-radius: 5px;\n padding: 4px;\n margin: 0 4px 0 0;\n}\nspan.timed-btn:before {\n content: \"\\E055\";\n /* time */\n}\nspan.fairplay-btn {\n position: relative;\n top: 2px;\n display: inline-block;\n font-family: 'Glyphicons Regular';\n font-style: normal;\n font-weight: normal;\n line-height: 1;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n font-size: 15px;\n line-height: 15px;\n top: 0px;\n cursor: default;\n color: white;\n background-color: var(--ok-button);\n border-radius: 5px;\n padding: 4px;\n margin: 0 4px 0 0;\n}\nspan.fairplay-btn:before {\n content: \"\\E151\";\n /* edit */\n}\nspan.fairplay-btn.large {\n /* This is shown in the board header */\n top: 0;\n font-size: 16px;\n border-width: 1px;\n border-color: white;\n border-style: solid;\n padding: 2px;\n padding-bottom: 4px;\n}\nspan.manual-btn {\n position: relative;\n top: 2px;\n display: inline-block;\n font-family: 'Glyphicons Regular';\n font-style: normal;\n font-weight: normal;\n line-height: 1;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n font-size: 15px;\n line-height: 15px;\n top: 0px;\n cursor: default;\n color: white;\n background-color: var(--cancel-button);\n border-radius: 5px;\n padding: 4px;\n margin: 0 4px 0 0;\n}\nspan.manual-btn:before {\n content: \"\\E065\";\n /* lightbulb */\n}\nspan.elo-btn {\n display: inline-block;\n width: 30px;\n min-width: 30px;\n font-size: 15px;\n line-height: 16px;\n text-align: center;\n font-weight: bold;\n color: white;\n border-radius: 5px;\n padding: 5px 6px;\n margin: 0;\n}\nspan.elo-btn .glyphicon {\n font-size: 15px;\n line-height: 12px;\n}\nspan.elo-btn.left {\n margin-left: 6px;\n margin-right: 4px;\n}\nspan.elo-btn.right {\n margin-left: 4px;\n margin-right: 6px;\n}\nspan.elo-btn.invisible {\n visibility: hidden;\n}\nspan.elo-btn.elo-win {\n background-color: var(--ok-button);\n}\nspan.elo-btn.elo-loss {\n background-color: var(--cancel-button);\n}\nspan.elo-btn.elo-neutral {\n background-color: var(--double-letter-color);\n}\nspan.elo-hdr-left {\n background-color: var(--header-color);\n color: white;\n border-radius: 5px;\n padding: 4px;\n padding-left: 6px;\n padding-right: 6px;\n margin-left: 6px;\n margin-right: 6px;\n top: 0px;\n}\nspan.elo-hdr-right {\n background-color: var(--header-color);\n color: white;\n border-radius: 5px;\n padding: 4px;\n padding-left: 6px;\n padding-right: 6px;\n margin-left: 6px;\n margin-right: 6px;\n top: 0px;\n}\nspan.usr-info {\n position: relative;\n top: 2px;\n display: inline-block;\n font-family: 'Glyphicons Regular';\n font-style: normal;\n font-weight: normal;\n line-height: 1;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n font-size: 15px;\n line-height: 15px;\n top: 0px;\n cursor: pointer;\n color: white;\n background-color: var(--ok-button);\n border-radius: 5px;\n padding: 4px;\n margin: 0;\n}\nspan.usr-info:before {\n content: \"\\E028\";\n /* Search */\n}\nspan.usr-info:hover {\n background-color: var(--triple-word-color);\n}\n#userlist span.glyphicon.glyphicon-star {\n color: var(--triple-letter-color);\n}\n#userlist span.glyphicon.glyphicon-hand-right,\n#elolist span.glyphicon.glyphicon-hand-right,\n#chall-sent span.glyphicon.glyphicon-hand-right,\n#chall-received span.glyphicon.glyphicon-thumbs-down,\np span.glyphicon.glyphicon-flag,\n#gamelist span.glyphicon.glyphicon-flag,\n#gamelist span.glyphicon.glyphicon-hourglass {\n color: var(--triple-word-color);\n}\n#recentlist span.glyphicon.glyphicon-bookmark,\n#usr-recent span.glyphicon.glyphicon-bookmark,\n#gamelist span.glyphicon.glyphicon-bookmark {\n color: var(--ok-button);\n}\nspan.glyphicon.glyphicon-lightbulb.grayed {\n color: rgba(0, 0, 0, 0.2);\n}\n.listheader span.glyphicon.glyphicon-star-empty,\n.listheader span.glyphicon.glyphicon-hand-right.grayed,\n.listheader span.glyphicon.glyphicon-thumbs-down.grayed,\n.listheader span.glyphicon.glyphicon-flag.grayed,\n#gamelist span.glyphicon.glyphicon-flag.grayed,\n#userlist span.glyphicon.glyphicon-star-empty,\n#userlist span.glyphicon.glyphicon-hand-right.grayed,\n#elolist span.glyphicon.glyphicon-hand-right.grayed {\n color: rgba(0, 0, 0, 0.15);\n}\nspan.glyphicon.glyphicon-hourglass.grayed,\nspan.glyphicon.glyphicon-shopping-bag.grayed {\n color: rgba(0, 0, 0, 0.1);\n}\n.listheader span.glyphicon.glyphicon-bookmark.grayed,\n#recentlist span.glyphicon.glyphicon-bookmark.grayed,\n#usr-recent span.glyphicon.glyphicon-bookmark.grayed,\n#gamelist span.glyphicon.glyphicon-bookmark.grayed,\n#gamelist span.glyphicon.glyphicon-hourglass.grayed {\n color: rgba(0, 0, 0, 0.06);\n}\n#gamelist span.glyphicon.glyphicon-flag.zombie {\n color: var(--double-letter-color);\n}\ndiv#user-no-match {\n display: none;\n position: absolute;\n top: 220px;\n left: 140px;\n width: 600px;\n z-index: 10;\n text-align: center;\n}\ndiv#user-no-match span#search-prefix {\n font-weight: bold;\n}\ndiv.modal-close {\n text-align: center;\n font-size: 18px;\n font-weight: 700;\n color: white;\n margin: 0;\n padding: 6px;\n padding-top: 9px;\n border-radius: 5px;\n cursor: pointer;\n position: absolute;\n width: 36px;\n height: 28px;\n bottom: 12px;\n right: 12px;\n top: auto;\n}\ndiv#usr-info-close {\n width: 72px;\n /* Override */\n background-color: var(--ok-button);\n}\ndiv#load-game {\n width: 72px;\n /* Override */\n background-color: var(--ok-button);\n}\ndiv#wait-cancel {\n right: 12px;\n width: 72px;\n /* Override */\n background-color: var(--cancel-button);\n}\ndiv#accept-cancel {\n right: 12px;\n width: 72px;\n /* Override */\n background-color: var(--cancel-button);\n}\ndiv#blank-close,\ndiv#promo-close {\n background-color: var(--cancel-button);\n}\ndiv#thanks-form {\n position: absolute;\n padding-left: 12px;\n padding-right: 12px;\n padding-top: 6px;\n padding-bottom: 6px;\n box-shadow: 3px 3px 5px 2px var(--dark-shadow);\n font-size: 1em;\n z-index: 20;\n background-color: var(--container-bg-color);\n top: 212px;\n right: 224px;\n width: 460px;\n height: 248px;\n line-height: 1.62em;\n}\ndiv#cancel-form {\n position: absolute;\n padding-left: 12px;\n padding-right: 12px;\n padding-top: 6px;\n padding-bottom: 6px;\n box-shadow: 3px 3px 5px 2px var(--dark-shadow);\n font-size: 1em;\n z-index: 20;\n background-color: var(--container-bg-color);\n top: 150px;\n right: 200px;\n width: 508px;\n height: 372px;\n line-height: 1.62em;\n}\ndiv#confirm-form {\n position: absolute;\n padding-left: 12px;\n padding-right: 12px;\n padding-top: 6px;\n padding-bottom: 6px;\n box-shadow: 3px 3px 5px 2px var(--dark-shadow);\n font-size: 1em;\n z-index: 20;\n background-color: var(--container-bg-color);\n top: 236px;\n right: 224px;\n width: 460px;\n height: 200px;\n line-height: 1.62em;\n}\ndiv#conditions-form {\n position: absolute;\n padding-left: 12px;\n padding-right: 12px;\n padding-top: 6px;\n padding-bottom: 6px;\n box-shadow: 3px 3px 5px 2px var(--dark-shadow);\n font-size: 1em;\n z-index: 20;\n background-color: var(--container-bg-color);\n top: 80px;\n right: 124px;\n width: 660px;\n height: 536px;\n line-height: 1.62em;\n padding-left: 24px;\n padding-right: 24px;\n}\ndiv#usr-info-form {\n position: absolute;\n padding-left: 12px;\n padding-right: 12px;\n padding-top: 6px;\n padding-bottom: 6px;\n box-shadow: 3px 3px 5px 2px var(--dark-shadow);\n font-size: 1em;\n z-index: 20;\n background-color: var(--container-bg-color);\n top: 16px;\n right: 12px;\n width: 884px;\n height: 644px;\n}\ndiv.thanks-content,\ndiv#cancel-content,\ndiv#confirm-content {\n margin-top: 24px;\n margin-left: 24px;\n margin-right: 24px;\n}\ndiv.usr-info-hdr {\n font-size: 18px;\n margin-top: 0px;\n margin-bottom: 0px;\n}\ndiv.usr-info-hdr h1 {\n display: inline;\n font-size: 36px;\n font-weight: bold;\n}\ndiv.usr-info-hdr h2 {\n display: inline;\n font-size: 24px;\n font-weight: bold;\n}\nspan.vbar {\n color: var(--light-background);\n font-size: 2em;\n padding-left: 10px;\n padding-right: 10px;\n}\nh1.usr-info-icon {\n color: var(--light-background);\n}\nh1.usr-info-icon span.glyphicon-coffee-cup {\n color: var(--ok-button);\n}\ndiv.usr-info-fav {\n display: inline-block;\n position: absolute;\n top: 16px;\n right: 20px;\n color: var(--triple-letter-color);\n font-size: 26px;\n cursor: pointer;\n}\ndiv.usr-info-fav span.glyphicon-star-empty {\n color: rgba(0, 0, 0, 0.15);\n}\ndiv#usr-info-chall {\n display: inline-block;\n position: absolute;\n top: 68px;\n right: 20px;\n}\ndiv#usr-info-chall.chall span.glyphicon-hand-right {\n font-size: 26px;\n color: var(--triple-word-color);\n}\ndiv#usr-info-chall.no-chall span.glyphicon-hand-right {\n font-size: 26px;\n color: rgba(0, 0, 0, 0.15);\n}\nspan.best-word {\n text-transform: uppercase;\n font-weight: bold;\n font-style: italic;\n}\np#usr-best {\n display: inline-block;\n position: absolute;\n right: 16px;\n top: 50px;\n text-align: right;\n}\np#usr-best a:link,\np#usr-best a:visited {\n text-decoration: none;\n color: var(--stats-foreground);\n}\np#usr-best a:hover {\n text-decoration: none;\n color: var(--logo-accent);\n}\ndiv#stats-toggler {\n margin-top: 7px;\n margin-right: 8px;\n}\ndiv#usr-stats {\n position: absolute;\n height: 48px;\n width: 680px;\n bottom: 12px;\n left: 12px;\n vertical-align: top;\n}\ndiv#usr-stats-human {\n display: inline-block;\n vertical-align: top;\n}\ndiv#usr-stats-all {\n display: none;\n vertical-align: top;\n}\ndiv#own-stats-human {\n display: inline-block;\n vertical-align: top;\n}\ndiv#own-stats-all {\n display: none;\n vertical-align: top;\n}\ndiv.stats-games {\n color: var(--malfridur-secondary);\n border-color: var(--malfridur-secondary);\n}\ndiv.stats-win-ratio {\n color: var(--ok-button);\n border-color: var(--ok-button);\n}\ndiv.stats-avg-score {\n color: var(--logo-accent);\n border-color: var(--logo-accent);\n}\ndiv.chall-hdr {\n font-size: 18px;\n margin-top: 6px;\n margin-bottom: 15px;\n overflow-x: hidden;\n}\ndiv.chall-hdr table {\n border-spacing: 0;\n margin: 0;\n padding: 0;\n vertical-align: top;\n}\ntd.l-border {\n border-left-style: solid;\n border-left-color: black;\n border-left-width: 2px;\n padding-left: 12px;\n white-space: nowrap;\n}\ndiv.chall-hdr h1 {\n display: inline-block;\n font-size: 28px;\n line-height: 30px;\n margin-left: 6px;\n margin-top: 0;\n margin-bottom: 8px;\n font-weight: bold;\n}\ndiv.chall-hdr h2 {\n display: block;\n font-size: 22px;\n line-height: 24px;\n margin-top: 6px;\n margin-bottom: 4px;\n color: var(--humangrad-color);\n}\nh1.chall-icon {\n display: block;\n color: var(--humangrad-color);\n margin-right: 12px;\n margin-top: 0;\n margin-bottom: 0;\n}\ndiv.chall-time {\n display: inline-block;\n width: 300px;\n left: 66px;\n height: 32px;\n padding-top: 8px;\n padding-bottom: 1px;\n padding-left: 12px;\n padding-right: 12px;\n margin-top: 7px;\n margin-bottom: 4px;\n text-align: center;\n font-size: 20px;\n font-weight: 700;\n line-height: 22px;\n background-color: var(--middle-shadow);\n color: white;\n cursor: pointer;\n border-radius: 4px;\n}\ndiv.chall-time.selected {\n background-color: var(--triple-word-color);\n color: black;\n}\ndiv.chall-time:hover {\n background-color: var(--double-letter-color);\n}\ndiv.chall-time.selected:hover {\n background-color: var(--double-word-color);\n}\ndiv.chall-time span.glyphicon-time {\n margin-right: 8px;\n}\nspan#chall-online {\n position: relative;\n top: 2px;\n font-family: 'Glyphicons Regular';\n font-style: normal;\n font-weight: normal;\n line-height: 1;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n display: inline-block;\n top: 0px;\n color: white;\n background-color: rgba(228, 234, 240, 0.65);\n border-radius: 5px;\n padding: 5px;\n margin: 0;\n}\nspan#chall-online:before {\n content: \"\\E242\";\n /* Flash */\n}\nspan#chall-online.online {\n background-color: var(--ok-button);\n}\ndiv#chall-newbag {\n margin-top: 24px;\n padding-left: 6px;\n padding-right: 152px;\n font-size: 14px;\n text-align: left;\n}\ndiv#chall-newbag td {\n vertical-align: middle;\n padding-right: 12px;\n}\ndiv#chall-manual {\n margin-top: 4px;\n font-size: 14px;\n}\ndiv#manual-toggler {\n margin-top: 12px;\n margin-bottom: 0;\n}\ndiv.wait-explain {\n padding-left: 48px;\n padding-right: 12px;\n padding-top: 24px;\n padding-bottom: 24px;\n}\ndiv#user-dialog {\n visibility: visible;\n}\ndiv#user-form {\n position: absolute;\n padding-left: 12px;\n padding-right: 12px;\n padding-top: 6px;\n padding-bottom: 6px;\n box-shadow: 3px 3px 5px 2px var(--dark-shadow);\n font-size: 1em;\n z-index: 20;\n background-color: var(--container-bg-color);\n top: 40px;\n right: 64px;\n width: 736px;\n height: 582px;\n}\ndiv#user-logout {\n left: 12px;\n width: 144px;\n /* Override */\n background-color: var(--triple-word-color);\n}\ndiv#user-friend {\n left: 180px;\n width: 280px;\n /* Override */\n background-color: var(--ok-button);\n}\ndiv#user-unfriend {\n left: 180px;\n width: 280px;\n /* Override */\n padding-top: 6px;\n border-style: solid;\n border-width: 2px;\n border-color: var(--ok-button);\n background-color: white;\n color: var(--ok-button);\n line-height: 24px;\n}\ndiv#user-unfriend span.glyphicon-coffee-cup {\n color: var(--triple-word-color);\n}\ndiv#user-cancel {\n right: 108px;\n /* 12 + 72 + 12 + 12 */\n width: 72px;\n /* Override */\n background-color: var(--cancel-button);\n}\ndiv#user-ok {\n right: 12px;\n /* 12 */\n width: 72px;\n /* Override */\n background-color: var(--ok-button);\n}\ndiv#accept-form {\n position: absolute;\n padding-left: 12px;\n padding-right: 12px;\n padding-top: 6px;\n padding-bottom: 6px;\n box-shadow: 3px 3px 5px 2px var(--dark-shadow);\n font-size: 1em;\n z-index: 20;\n background-color: var(--container-bg-color);\n top: 8px;\n left: 4px;\n width: 335px;\n height: 488px;\n}\nh1#accept-nick {\n display: inline-block;\n font-size: 28px;\n line-height: 30px;\n margin-left: 6px;\n margin-top: 0;\n margin-bottom: 8px;\n}\n.blink {\n animation: opacityBlink 1s infinite;\n -webkit-animation: opacityBlink 1s infinite;\n}\n.opp-ready {\n animation: opacityBlink 1s infinite;\n -webkit-animation: opacityBlink 1s infinite;\n}\na.opp-ready:link,\na.opp-ready:visited {\n color: var(--cancel-button);\n}\na.opp-ready:hover {\n color: var(--triple-word-color);\n}\ndiv.blank-rack {\n position: relative;\n top: 0;\n left: 0;\n}\n.blank-rack table.board {\n border-spacing: 8px;\n}\ndiv.welcome {\n font-size: 15px;\n line-height: 20px;\n font-weight: normal;\n padding-bottom: 12px;\n}\n.welcome a:link,\n.welcome a:visited {\n text-decoration: none;\n color: var(--humangrad-color);\n}\n.welcome a:hover {\n text-decoration: none;\n color: var(--triple-word-color);\n}\ndiv.dialog-spacer {\n margin-top: 2px;\n margin-bottom: 4px;\n}\nspan.caption {\n display: inline-block;\n position: relative;\n vertical-align: top;\n top: 10px;\n width: 140px;\n margin-right: 12px;\n overflow: hidden;\n text-align: right;\n}\nspan.subcaption {\n display: inline-block;\n position: relative;\n vertical-align: top;\n top: 16px;\n margin-left: 18px;\n margin-right: 6px;\n}\nspan.caption.sub {\n top: 16px;\n}\nspan.asterisk {\n color: red;\n font-size: 1.4em;\n font-weight: bold;\n margin-left: 4px;\n}\ndiv.explain {\n margin-left: 158px;\n margin-bottom: 12px;\n font-size: 14px;\n text-align: left;\n font-style: italic;\n color: var(--light-shadow);\n}\ndiv.subexplain {\n display: inline-block;\n width: 420px;\n vertical-align: top;\n margin-top: 11px;\n margin-left: 18px;\n margin-right: 6px;\n font-size: 14px;\n color: var(--light-shadow);\n}\ndiv.errinput {\n margin-left: 158px;\n margin-bottom: 10px;\n font-size: 16px;\n text-align: left;\n font-weight: bold;\n color: var(--cancel-button);\n}\ninput.text {\n font-family: var(--primary-font);\n font-size: 20px;\n font-weight: 700;\n height: 32px;\n border-style: solid;\n border-color: var(--ok-button);\n border-width: 2px;\n border-radius: 5px;\n margin-bottom: 4px;\n padding-top: 2px;\n padding-bottom: 2px;\n padding-left: 8px;\n padding-right: 8px;\n}\ninput.text:focus {\n background-color: hsl(from var(--malfridur-secondary) h 85% 90%);\n border-style: solid;\n border-color: var(--ok-button);\n border-width: 2px;\n border-radius: 5px;\n outline-style: none;\n}\ninput.username {\n width: 300px;\n}\ninput.fullname {\n width: 450px;\n}\ninput.email {\n width: 400px;\n}\ninput.text#search-id {\n font-weight: normal;\n height: 28px;\n font-size: 18px;\n border-color: var(--header-color);\n margin-top: 0px;\n margin-bottom: 0px;\n}\ndiv.netskrafl-container button[type=\"submit\"] {\n font-family: var(--primary-font);\n font-size: 20px;\n font-weight: 400;\n height: 40px;\n color: white;\n text-align: center;\n width: 322px;\n border-width: 0;\n border-radius: 5px;\n background-color: var(--ok-button);\n margin-top: 20px;\n margin-left: 0;\n margin-right: 0;\n margin-bottom: 0;\n padding-top: 4px;\n padding-bottom: 4px;\n padding-left: 8px;\n padding-right: 8px;\n cursor: pointer;\n}\ndiv.netskrafl-container button[type=\"submit\"]:focus,\ndiv.netskrafl-container button[type=\"submit\"]:hover {\n outline: var(--focus-border) solid 3px;\n}\ndiv.netskrafl-container button.login {\n margin-top: 24px;\n}\ndiv.netskrafl-container button.logout {\n margin-top: 80px;\n background-color: var(--cancel-button);\n}\ndiv.netskrafl-container input[type=\"checkbox\"] {\n display: none;\n}\ndiv.toggler {\n background-color: var(--light-background);\n color: white;\n margin-top: 9px;\n margin-bottom: 3px;\n border-radius: 10px;\n cursor: pointer;\n overflow: hidden;\n border: white solid 3px;\n}\ndiv.toggler:focus, div.toggler:hover {\n outline-style: none;\n border: var(--focus-border) solid 3px;\n}\ndiv.toggler div.option {\n display: inline-block;\n width: 46px;\n height: 28px;\n line-height: 28px;\n font-size: 21px;\n padding-top: 3px;\n padding-bottom: 3px;\n text-align: center;\n border-style: none;\n}\ndiv.toggler div.option.small {\n width: 36px;\n height: 24px;\n line-height: 22px;\n font-size: 18px;\n padding-top: 3px;\n padding-bottom: 2px;\n}\ndiv.toggler div.option.x-small {\n width: 30px;\n height: 20px;\n line-height: 22px;\n font-size: 15px;\n padding-top: 1px;\n padding-bottom: 3px;\n}\ndiv.toggler div.option.selected {\n background-color: var(--triple-letter-color);\n}\ndiv#fairplay-toggler div.option.selected {\n background-color: var(--ok-button);\n}\ndiv#fairplay-toggler span.glyphicon-edit {\n top: 0;\n}\ndiv #radioset {\n padding-top: 6px;\n padding-bottom: 24px;\n}\ndiv.disabled {\n background-color: var(--board-background);\n}\na.nodecorate:link {\n text-decoration: none;\n color: black;\n}\na.nodecorate:visited {\n text-decoration: none;\n color: black;\n}\na.nodecorate:hover {\n text-decoration: none;\n color: var(--triple-letter-color);\n}\na.iconlink:link {\n text-decoration: none;\n color: var(--triple-letter-color);\n}\na.iconlink:visited {\n text-decoration: none;\n color: var(--triple-letter-color);\n}\na.iconlink:hover {\n text-decoration: none;\n color: var(--triple-word-color);\n}\na.backlink:link {\n text-decoration: none;\n color: var(--board-background);\n}\na.backlink:visited {\n text-decoration: none;\n color: var(--board-background);\n}\na.backlink:hover {\n text-decoration: none;\n color: var(--triple-word-color);\n}\ndiv#tabs-1 p {\n line-height: 1.6em;\n}\ndiv#tabs-1 p img,\ndiv#tabs-3 p img {\n margin-left: 3px;\n margin-right: 2px;\n vertical-align: -3px;\n display: inline;\n}\ndiv#tabs-3 p,\ndiv#tabs-3 ol li,\ndiv#tabs-3 ol p,\ndiv#tabs-3 ol ul li {\n line-height: 1.65em;\n}\ndiv#tabs-3 ol {\n list-style-type: decimal;\n margin: auto;\n padding-inline-start: 40px;\n}\ndiv#tabs-3 li {\n display: list-item;\n margin: auto;\n padding: auto;\n}\ndiv.help-container ol li {\n font-weight: bold;\n}\ndiv.help-container ul li {\n font-weight: normal;\n list-style-type: disc;\n}\ndiv.help-container table {\n border-spacing: 0;\n border-collapse: collapse;\n}\ndiv.help-container td {\n margin: 0;\n padding: 4px;\n padding-left: 8px;\n padding-right: 8px;\n text-align: right;\n border-width: 1px;\n border-style: solid;\n width: 80px;\n}\ndiv.help-container td.row-caption {\n text-align: left;\n font-weight: bold;\n width: 120px;\n}\ndiv.help-container span.glyphicon-hourglass {\n color: var(--cancel-button);\n}\ndiv.help-container p {\n font-weight: normal;\n}\ndiv.help-container img.browserlogo {\n height: 28px;\n width: auto;\n object-fit: scale-down;\n margin-right: 8px;\n}\ndiv.help-container b.vcenter {\n position: relative;\n top: -8px;\n}\ndiv.twolist {\n -webkit-column-count: 2;\n -moz-column-count: 2;\n column-count: 2;\n font-size: 18px;\n line-height: 30px;\n padding-bottom: 12px;\n}\nspan.twoword {\n font-weight: bold;\n padding-right: 3px;\n}\nspan.errword {\n text-transform: uppercase;\n}\ndiv#emoticons-div {\n padding-bottom: 24px;\n}\ntable#emoticons td {\n font-family: 'Courier', sans-serif;\n font-size: 20px;\n text-align: center;\n}\nimg#villi {\n float: right;\n margin-left: 12px;\n margin-top: 18px;\n margin-bottom: 12px;\n}\ndiv.signup-header {\n position: absolute;\n top: 12px;\n left: 110px;\n width: 900px;\n}\n\n/* ================= MOBILE PORTRAIT UI, LARGE ENOUGH TO BE NON-SCROLLABLE =============== */\n\n@media all and (max-width: 1023px) and (min-height: 552px) {\n /* On sufficiently large mobile screens, keep the body fixed (unscrollable) */\n div.netskrafl-container {\n /* position: fixed; */\n overflow: hidden;\n }\n}\n\n/* ================= MOBILE PORTRAIT UI, EXTRA TALL =============== */\n\n@media all and (max-width: 1023px) and (min-height: 632px) {\n /* iPhone X or taller */\n /* Tall mobile phones: use two lines to display the header */\n div.tabbed-page {\n height: 605px;\n overflow: hidden;\n }\n div#tabs > div[role=tabpanel],\n div#main-tabs > div[role=tabpanel] {\n height: 556px;\n }\n div.scoreleft {\n display: inline-block;\n position: relative;\n left: auto;\n top: -4px;\n padding-left: 10px;\n }\n div.scoreright {\n display: inline-block;\n position: relative;\n right: auto;\n top: -4px;\n padding-right: 10px;\n }\n div.player-btn {\n display: inline-block;\n position: relative;\n top: 0;\n left: 0;\n padding-top: 4px;\n width: 128px;\n }\n div.robot-btn {\n display: inline-block;\n position: relative;\n top: 0;\n left: 0;\n padding-top: 4px;\n width: 128px;\n }\n div.player-btn.left,\n div.robot-btn.left {\n padding-left: 4px;\n }\n div.player-btn.right,\n div.robot-btn.right {\n padding-right: 4px;\n }\n div.heading {\n height: auto;\n }\n div.fairplay {\n top: 21px;\n }\n span.fairplay-btn.large {\n /* This is shown in the board header */\n font-size: 18px;\n padding: 4px;\n padding-bottom: 6px;\n }\n div.right-area {\n top: 37px;\n }\n div.right-tab {\n top: -32px;\n width: 64px;\n min-width: 64px;\n padding-top: 6px;\n font-size: 18px;\n }\n div.right-tab#tab-board {\n left: 8px;\n }\n div.right-tab#tab-movelist {\n left: 78px;\n }\n div.right-tab#tab-twoletter {\n left: 148px;\n }\n div.right-tab#tab-games {\n left: 218px;\n }\n div.right-tab#tab-chat {\n left: 288px;\n }\n div.board-area {\n top: 103px;\n }\n div #userlist,\n div #elolist {\n height: 424px;\n /* 14 lines @ 36px each */\n }\n div #gamelist {\n height: 576px;\n /* 16 lines @ 36px each */\n }\n div #recentlist {\n height: 504px;\n /* 14 lines @ 36px each */\n }\n div #usr-recent {\n height: 540px;\n /* 15 lines @ 36px each */\n }\n div #chall-sent,\n div #chall-received {\n height: 288px;\n /* 8 lines @ 36px each */\n }\n div.chat-container,\n div.twoletter {\n height: 474px;\n }\n div.games {\n height: 450px;\n }\n div.movelist-container {\n height: 466px;\n }\n div.movelist {\n height: 358px;\n }\n div.rack-row {\n margin-top: 12px;\n }\n}\n\n/* iPhone 11 or larger: scale the UI to appear larger on the screen */\n@media all and (min-width: 414px) and (max-width: 1023px) and (min-height: 652px) {\n div.netskrafl-container {\n /*\n transform: scale(1.1);\n transform-origin: center top;\n */\n margin-top: 4px;\n height: 652px;\n }\n}\n\n/* ================= MOBILE LANDSCAPE UI ====================== */\n\n@media all and (min-width: 667px) {\n /* Mobile screen, landscape mode */\n div.netskrafl-container {\n /* Reference width */\n width: 667px;\n /* Reference height */\n height: 375px;\n overflow-y: hidden;\n }\n div.tabbed-page {\n width: 100%;\n }\n .tab-legend {\n display: inline;\n padding-left: 12px;\n }\n div.help-container {\n width: 100%;\n }\n /* Paragraphs of help text that should be centered on screens that are wide enough */\n p.help-center {\n text-align: center;\n }\n div.heading div.header-logo {\n display: none;\n }\n div.logowrapper {\n width: 0%;\n }\n div.playerwrapper {\n width: 100%;\n padding-top: 0;\n }\n div.fairplay {\n top: 8px;\n }\n div.login-btn-small {\n position: fixed;\n top: 128px;\n left: 50%;\n width: 50%;\n }\n div.board-area {\n position: absolute;\n top: 0;\n padding-top: 6px;\n }\n div.board {\n top: 8px;\n padding-top: 1px;\n background-color: transparent;\n }\n div.rightcol {\n width: 283px;\n top: 8px;\n left: 376px;\n height: 70px;\n }\n div.rack-row {\n display: none;\n }\n div.recallbtn {\n left: 376px;\n top: 158px;\n }\n div.rack-left div.recallbtn {\n display: none;\n }\n div.force-resign {\n display: none;\n }\n div.scramblebtn {\n left: 376px;\n top: 158px;\n }\n .bottom-btn-landscape {\n top: 158px;\n display: none;\n border-width: 0;\n color: white;\n }\n div.submitexchange {\n top: 158px;\n display: none;\n border-width: 0;\n color: white;\n left: 441px;\n background-color: var(--ok-button);\n }\n div.submitpass {\n top: 158px;\n display: none;\n border-width: 0;\n color: white;\n left: 506px;\n background-color: var(--triple-word-color);\n }\n div.submitresign {\n top: 158px;\n display: none;\n border-width: 0;\n color: white;\n left: 571px;\n background-color: var(--cancel-button);\n }\n div.submitmove {\n left: 551px;\n top: 158px;\n }\n div.submitmove#move-mobile {\n display: none;\n }\n div.waitmove {\n left: 551px;\n top: 158px;\n }\n div.submitnewgame {\n left: 551px;\n top: 158px;\n }\n div.player {\n min-height: 36px;\n }\n div.player-btn {\n width: 84px;\n padding-top: 6px;\n }\n div.robot-btn {\n width: 84px;\n padding-top: 6px;\n }\n div.scoreleft,\n div.scoreright {\n top: 3px;\n }\n div.right-tab {\n display: none;\n }\n div.opp-turn {\n display: none;\n }\n div.movelist-container {\n height: 300px;\n padding-top: 0px;\n padding-bottom: 0px;\n }\n div.movelist {\n height: 100%;\n }\n div.right-area.with-clock div.movelist-container {\n /* If in a clock game, reduce the movelist height by two lines (2 * 20px) */\n height: 260px;\n }\n div.movelist-container div.bag {\n display: none;\n }\n div#gameover {\n display: none;\n }\n div.stats-box {\n width: 448px;\n left: 90px;\n }\n div#own-stats {\n height: 16px;\n }\n p#own-best {\n left: auto;\n right: 6px;\n top: 0px;\n text-align: right;\n font-size: 0.85em;\n line-height: 1.4em;\n }\n div #chall-sent,\n div #chall-received {\n height: 108px;\n /* 3 lines @ 36px each */\n }\n div.games,\n div.twoletter,\n div.chat-container {\n display: none;\n }\n div.right-area {\n top: 8px;\n height: 316px;\n }\n span.list-chall {\n width: 240px;\n max-width: 240px;\n }\n span.list-fullname-robot {\n width: 320px;\n max-width: 320px;\n }\n span.list-opp {\n width: 180px;\n max-width: 180px;\n }\n div#tabs > div[role=tabpanel],\n div#main-tabs > div[role=tabpanel] {\n height: 326px;\n }\n div#tabs-1 span.list-ts-short,\n div#tabs-1 span.list-manual,\n div#tabs-4 span.list-ts-short {\n display: inline-block;\n }\n div#tabs-2 span.list-ts {\n display: inline-block;\n }\n div#tabs-3 span.list-nick {\n width: 180px;\n max-width: 180px;\n }\n div#tabs-4 span.list-nick {\n width: 220px;\n max-width: 220px;\n }\n div#blank-form {\n display: none;\n }\n}\n\n@media all and (min-width: 667px) and (max-height: 360px) {\n div.board {\n transform: scale(0.96);\n transform-origin: top left;\n }\n}\n\n/* fullscreen.css */\n\n@media all and (min-width: 1024px) {\n\n .ui-helper-reset {\n line-height: 36px;\n }\n .ui-tabs .ui-tabs-panel {\n background-color: var(--tab-background);\n padding: 1em 1.4em;\n }\n .ui-widget-content {\n border: 2px solid var(--container-bg-color);\n background-color: var(--tab-background);\n }\n .ui-widget-header {\n background-color: var(--header-background);\n }\n .ui-widget-header .ui-state-active {\n background-color: var(--tab-background);\n }\n .ui-state-default,\n .ui-widget-content .ui-state-default {\n border: 2px solid var(--container-bg-color);\n }\n .ui-state-active,\n .ui-widget-content .ui-state-active {\n border: 2px solid var(--container-bg-color);\n background-color: var(--tab-background);\n }\n .ui-state-hover,\n .ui-widget-content .ui-state-hover,\n .ui-state-focus,\n .ui-widget-content .ui-state-focus {\n border: 2px solid var(--container-bg-color);\n }\n .ui-tabs .ui-tabs-nav .ui-tabs-anchor {\n min-width: auto;\n padding-left: 1em;\n padding-right: 1em;\n text-align: left;\n }\n .ui-tabs .ui-tabs-nav .ui-tabs-anchor.sp {\n /* Override tab width */\n min-width: 82px;\n }\n .ui-tabs .ui-tabs-nav li {\n box-shadow: none;\n }\n .ui-tabs .ui-tabs-nav li.ui-tabs-active {\n padding-bottom: 1px;\n background-color: var(--tab-background);\n }\n /* Large screen (iPad and larger) */\n div.netskrafl-container {\n width: 1024px;\n height: 768px;\n /* Was 748 */\n overflow-y: hidden;\n }\n div.game-container {\n height: 768px;\n }\n div.heading {\n height: auto;\n /* background-color: @heading-background; */\n }\n div.logo {\n display: block;\n }\n div#main-tabs div.header-logo {\n display: none;\n }\n div.circle {\n height: 38px;\n width: 38px;\n background-color: var(--header-hover-color);\n border-radius: 50%;\n display: inline-block;\n position: relative;\n top: -6px;\n }\n div.circle span.glyphicon {\n top: 8px;\n }\n div.info {\n display: block;\n position: absolute;\n bottom: 148px;\n top: auto;\n left: 28px;\n width: 50px;\n height: 50px;\n font-size: 40px;\n text-align: center;\n }\n div.info:hover {\n animation: expand 0.4s;\n }\n div.login-error {\n position: absolute;\n padding-left: 12px;\n padding-right: 12px;\n padding-top: 6px;\n padding-bottom: 6px;\n box-shadow: 3px 3px 5px 2px var(--dark-shadow);\n font-size: 1em;\n z-index: 20;\n background-color: var(--container-bg-color);\n top: 96px;\n left: auto;\n right: 202px;\n width: 504px;\n height: 276px;\n }\n div.try-again {\n width: auto;\n }\n div.get-help {\n width: auto;\n }\n div.board-help {\n display: block;\n z-index: 2;\n }\n ul.ui-tabs-nav {\n display: block;\n }\n div.rightcol {\n position: absolute;\n width: 302px;\n top: 38px;\n right: 12px;\n height: auto;\n left: auto;\n }\n div.right-area {\n display: block;\n top: 0;\n margin-top: 12px;\n height: 420px;\n }\n div.games,\n div.twoletter,\n div.chat-container {\n display: block;\n border-radius: 0;\n }\n div.twoletter,\n div.chat-container {\n height: 420px;\n }\n div.board-area {\n margin: 0;\n /* width should not be set here */\n height: 750px;\n }\n div.board {\n position: absolute;\n top: 0;\n padding-top: 0;\n left: 93px;\n width: auto;\n height: auto;\n margin: 0;\n }\n .board td {\n min-height: 30px;\n min-width: 30px;\n height: 30px;\n width: 30px;\n border-width: 2px;\n border-radius: 3.5px;\n box-shadow: none;\n }\n table.board td.center:empty {\n font-size: 23px;\n line-height: 23px;\n }\n table.board tr {\n height: 34px;\n /* 32px + 2 * 1.0px */\n }\n .rack table.board {\n border-spacing: 4px;\n }\n .blank-rack table.board {\n border-spacing: 8px;\n }\n .rack table.board tr {\n height: 34px;\n /* 32px + 2 * 1.0px */\n }\n div.tile {\n font-size: 24px;\n line-height: 25px;\n height: 28px;\n width: 28px;\n margin: 0;\n padding-top: 2px;\n padding-right: 2px;\n }\n .rack div.tile {\n font-size: 24px;\n line-height: 25px;\n height: 28px;\n width: 28px;\n padding-top: 2px;\n margin-left: 0;\n }\n div.tile.wide,\n div.tile.extra-wide {\n /* Wide character tile */\n text-indent: -6px;\n margin-left: 0;\n padding-right: 2px;\n }\n div.tile.extra-wide {\n /* Extra wide character tile: Q */\n text-indent: -8px;\n }\n div.board div.tile.wide,\n div.board div.tile.extra-wide {\n /* Wide letter tile on the board */\n text-indent: -3.5px;\n }\n /* On large UIs, tile size doesn't change while dragging */\n div.tile.dragging {\n font-size: 30px;\n line-height: 30px;\n height: 36px;\n width: 36px;\n padding-top: 3px;\n margin-left: 0;\n }\n div.letterscore {\n bottom: 2px;\n right: 1px;\n font-size: 9px;\n line-height: 9px;\n }\n .rack div.letterscore {\n left: auto;\n right: 0px;\n bottom: 1px;\n }\n div.tile.wide div.letterscore,\n div.tile.extra-wide div.letterscore {\n /* Adjust letter score position for wide tiles */\n right: 1px;\n left: auto;\n }\n .rack div.tile.wide div.letterscore,\n .rack div.tile.extra-wide div.letterscore {\n /* Adjust letter score position for wide tiles */\n right: 1px;\n left: auto;\n }\n div.tile.dragging div.letterscore {\n bottom: 3px;\n right: 2px;\n font-size: 10px;\n line-height: 10px;\n }\n tr.colid {\n display: table-row;\n }\n td.rowid {\n display: table-cell;\n overflow: hidden;\n font-size: 14px;\n line-height: 14px;\n text-align: center;\n font-weight: 400;\n background-color: transparent;\n border-color: transparent;\n box-shadow: none;\n }\n div.bag {\n display: block;\n bottom: 108px;\n }\n div.rack-row {\n display: block;\n height: auto;\n margin: 0;\n }\n div.rack {\n position: absolute;\n display: block;\n width: auto;\n float: none;\n top: auto;\n bottom: 132px;\n left: 241px;\n padding: 6px;\n border-width: 0;\n border-radius: 5px;\n margin: 0;\n background-color: var(--board-background);\n }\n div.rack-left {\n display: none;\n }\n div.rack-right {\n display: none;\n }\n .rack td {\n min-height: 30px;\n min-width: 30px;\n max-height: 30px;\n max-width: 30px;\n height: 30px;\n width: 30px;\n border-color: white;\n background-color: white;\n box-shadow: 2px 2px 4px 0 #afb7cad0;\n }\n .rack td.opp {\n border-color: var(--cancel-button);\n background-color: var(--cancel-button);\n }\n .rack td:empty {\n border-color: var(--middle-shadow);\n background-color: var(--tab-background);\n box-shadow: none;\n }\n div.buttons {\n position: static;\n height: auto;\n }\n div.buttons div.challenge .glyphicon {\n top: 3px;\n }\n span.yesnobutton#force-resign {\n display: inline;\n background-color: var(--cancel-button);\n color: white;\n padding-bottom: 4px;\n }\n div.force-resign {\n display: none;\n }\n div.word-check {\n display: block;\n width: 50px;\n height: 46px;\n font-size: 26px;\n line-height: 46px;\n top: auto;\n bottom: 273px;\n left: 643px;\n border-radius: 5px;\n }\n div.score {\n display: block;\n width: 50px;\n height: 46px;\n font-size: 24px;\n line-height: 46px;\n top: auto;\n bottom: 211px;\n left: 643px;\n border-radius: 5px;\n font-family: 'Open Sans', 'Arial', sans-serif;\n }\n .standard-button {\n position: absolute;\n top: 528px;\n text-align: center;\n font-size: 19px;\n font-weight: 700;\n color: white;\n margin: 0;\n padding: 6px;\n padding-top: 9px;\n border-radius: 5px;\n cursor: pointer;\n }\n .submitbutton {\n position: absolute;\n top: 528px;\n text-align: center;\n font-size: 19px;\n font-weight: 700;\n color: white;\n margin: 0;\n padding: 6px;\n padding-top: 9px;\n border-radius: 5px;\n cursor: pointer;\n width: 78px;\n height: 30px;\n top: auto;\n bottom: 136px;\n left: 546px;\n background-color: var(--ok-button);\n font-size: 18px;\n line-height: 24px;\n font-weight: normal;\n }\n div.submitnewgame {\n position: absolute;\n top: 528px;\n text-align: center;\n font-size: 19px;\n font-weight: 700;\n color: white;\n margin: 0;\n padding: 6px;\n padding-top: 9px;\n border-radius: 5px;\n cursor: pointer;\n width: 78px;\n height: 30px;\n top: auto;\n bottom: 136px;\n left: 546px;\n background-color: var(--ok-button);\n font-size: 18px;\n line-height: 24px;\n font-weight: normal;\n top: 464px;\n }\n div.fb-share {\n position: absolute;\n top: 528px;\n text-align: center;\n font-size: 19px;\n font-weight: 700;\n color: white;\n margin: 0;\n padding: 6px;\n padding-top: 9px;\n border-radius: 5px;\n cursor: pointer;\n width: 78px;\n height: 30px;\n top: auto;\n bottom: 136px;\n left: 546px;\n background-color: var(--ok-button);\n font-size: 18px;\n line-height: 24px;\n font-weight: normal;\n left: 122px;\n height: 60px;\n /* bottom: 104px; */\n }\n div.waitmove {\n position: absolute;\n top: 528px;\n text-align: center;\n font-size: 19px;\n font-weight: 700;\n color: white;\n margin: 0;\n padding: 6px;\n padding-top: 9px;\n border-radius: 5px;\n cursor: pointer;\n width: 78px;\n height: 30px;\n top: auto;\n bottom: 136px;\n left: 546px;\n background-color: var(--ok-button);\n font-size: 18px;\n line-height: 24px;\n font-weight: normal;\n float: none;\n border-style: solid;\n border-width: 1px;\n border-color: var(--ok-button);\n background-color: white;\n }\n div.submitmove {\n position: absolute;\n top: 528px;\n text-align: center;\n font-size: 19px;\n font-weight: 700;\n color: white;\n margin: 0;\n padding: 6px;\n padding-top: 9px;\n border-radius: 5px;\n cursor: pointer;\n width: 78px;\n height: 30px;\n top: auto;\n bottom: 136px;\n left: 546px;\n background-color: var(--ok-button);\n font-size: 18px;\n line-height: 24px;\n font-weight: normal;\n display: block;\n }\n div.submitmove span.glyphicon-play {\n top: 3px;\n left: 2px;\n }\n div.submitmove.error-shown {\n display: block;\n }\n /* To the left of the rack */\n .bottom-button {\n display: block;\n position: absolute;\n top: auto;\n bottom: 136px;\n }\n div.submitresign {\n display: block;\n position: absolute;\n top: auto;\n bottom: 136px;\n font-size: 22px;\n width: 40px;\n height: 30px;\n left: 101px;\n }\n div.submitresign.disabled {\n background-color: var(--board-background);\n }\n div.submitexchange {\n display: block;\n position: absolute;\n top: auto;\n bottom: 136px;\n font-size: 22px;\n width: 40px;\n height: 30px;\n left: 167px;\n }\n div.submitexchange.disabled {\n background-color: var(--board-background);\n }\n div.recallbtn {\n display: block;\n position: absolute;\n top: auto;\n bottom: 136px;\n background-color: var(--triple-word-color);\n font-size: 22px;\n width: 40px;\n height: 30px;\n left: 167px;\n }\n /* To the right of the rack */\n div.scramblebtn {\n display: block;\n position: absolute;\n top: auto;\n bottom: 136px;\n font-size: 22px;\n width: 40px;\n height: 30px;\n left: 546px;\n }\n div.submitpass {\n display: block;\n position: absolute;\n top: auto;\n bottom: 136px;\n font-size: 22px;\n width: 40px;\n height: 30px;\n left: 612px;\n }\n div.submitpass.disabled {\n background-color: var(--board-background);\n }\n div.fb-share {\n position: absolute;\n top: 528px;\n text-align: center;\n font-size: 19px;\n font-weight: 700;\n margin: 0;\n padding: 6px;\n padding-top: 9px;\n border-radius: 5px;\n cursor: pointer;\n width: 78px;\n height: 30px;\n top: auto;\n bottom: 136px;\n left: 546px;\n background-color: var(--ok-button);\n font-size: 18px;\n line-height: 24px;\n font-weight: normal;\n display: block;\n left: 144px;\n height: 60px;\n /* bottom: 104px; */\n color: white;\n background-color: var(--double-letter-color);\n visibility: hidden;\n }\n div.player {\n display: inline-block;\n height: 36px;\n font-size: 16px;\n line-height: 24px;\n width: 100%;\n padding-left: 0;\n padding-right: 0;\n }\n div.gamestats div.player {\n padding: 0;\n display: inline-block;\n width: auto;\n }\n div.gamestats div.player div.robot-btn {\n display: inline;\n position: relative;\n line-height: 34px;\n top: 0px;\n }\n div.gamestats div.player div.robot-btn.left {\n padding-left: 12px;\n }\n div.gamestats div.player div.robot-btn.right {\n padding-right: 12px;\n }\n div.gamestats div.player.humancolor {\n color: white;\n }\n div.scorewrapper {\n background-color: var(--humangrad-color);\n min-height: 32px;\n }\n div.scoreleft {\n position: relative;\n width: 144px;\n padding-left: 6px;\n height: auto;\n top: auto;\n left: auto;\n font-size: 24px;\n line-height: 32px;\n font-weight: 700;\n color: white;\n }\n div.scoreright {\n position: relative;\n width: 144px;\n height: auto;\n top: auto;\n left: auto;\n font-size: 24px;\n line-height: 32px;\n font-weight: 700;\n color: white;\n }\n div.player-btn {\n position: relative;\n margin-top: 4px;\n padding-top: 4px;\n width: auto;\n color: white;\n cursor: pointer;\n }\n div.player-btn:hover {\n background-color: white;\n color: black;\n }\n div.player-btn.left {\n padding-left: 2px;\n padding-right: 2px;\n }\n div.player-btn.right {\n padding-left: 2px;\n padding-right: 6px;\n }\n div.robot-btn {\n position: relative;\n margin-top: 4px;\n padding-top: 4px;\n width: auto;\n }\n div.robot-btn.left {\n padding-left: 6px;\n padding-right: 2px;\n }\n div.robot-btn.right {\n padding-left: 2px;\n padding-right: 4px;\n }\n div.gamestats div.robot-btn {\n width: 100%;\n }\n div.loginform-large {\n display: block;\n }\n div.loginform-small {\n display: none;\n }\n div.login-logo {\n margin-top: 16px;\n margin-left: auto;\n }\n div.login-legend {\n margin-left: 58px;\n margin-top: auto;\n height: 160px;\n }\n div.welcome {\n margin-left: 100px;\n }\n div.loginhdr {\n font-size: 34px;\n font-weight: 700;\n padding-top: 12px;\n padding-bottom: 24px;\n text-align: left;\n }\n div#board-pic {\n text-align: left;\n float: left;\n padding-right: 24px;\n padding-top: 0;\n padding-bottom: 0;\n }\n div.blurb {\n font-size: 22px;\n font-weight: bold;\n padding-bottom: 22px;\n text-align: left;\n }\n div.right-tab {\n display: block;\n height: 38px;\n min-height: 38px;\n width: 38px;\n min-width: 38px;\n top: auto;\n text-align: left;\n padding-top: 14px;\n padding-left: 10px;\n font-size: 20px;\n line-height: 20px;\n z-index: 2;\n box-shadow: none;\n }\n div.right-tab#tab-board {\n display: none;\n }\n div.right-tab#tab-movelist {\n top: 0;\n left: -40px;\n }\n div.right-tab#tab-twoletter {\n top: 58px;\n left: -40px;\n }\n div.right-tab#tab-games {\n top: 116px;\n left: -40px;\n }\n div.right-tab#tab-chat {\n top: 174px;\n left: -40px;\n }\n div.movelist-container {\n padding-top: 0;\n padding-bottom: 0;\n height: 420px;\n border-radius: 0;\n }\n div.movelist {\n height: 420px;\n }\n div.message {\n display: none;\n }\n div.right-area.with-clock {\n margin-top: 52px;\n }\n div.right-area.with-clock div.movelist-container {\n /* If in a clock game, reduce the movelist height by two lines (2 * 20px) */\n height: 380px;\n }\n div.right-area.with-clock div.movelist {\n /* If in a clock game, reduce the movelist height by two lines (2 * 20px) */\n height: 380px;\n }\n div.right-area.with-clock div.twoletter,\n div.right-area.with-clock div.chat-container {\n /* Timed game */\n height: 380px;\n }\n h3.clockleft,\n h3.clockright {\n margin-top: 2px;\n margin-bottom: 0;\n }\n div.movelist-container div.bag {\n display: none;\n padding: 4px 28px 0 27px;\n width: auto;\n }\n div.game-timed {\n display: block;\n }\n div#blank-form {\n display: block;\n right: 12px;\n }\n div#blank-form p {\n padding-left: 15px;\n }\n div.blank-rack {\n top: 56px;\n left: auto;\n background-color: transparent;\n }\n div.modal-dialog {\n position: absolute;\n }\n .bottom-message {\n position: absolute;\n text-align: center;\n bottom: 83px;\n left: 84px;\n width: 596px;\n height: 28px;\n font-size: 16px;\n line-height: 24px;\n padding: 4px 0 0;\n margin: 0;\n }\n .bold-bottom-message {\n position: absolute;\n text-align: center;\n bottom: 83px;\n left: 84px;\n width: 596px;\n height: 28px;\n font-size: 16px;\n line-height: 24px;\n padding: 4px 0 0;\n margin: 0;\n font-weight: 700;\n border-radius: 0;\n }\n div.error {\n position: absolute;\n text-align: center;\n bottom: 83px;\n left: 84px;\n width: 596px;\n height: 28px;\n font-size: 16px;\n line-height: 24px;\n padding: 4px 0 0;\n margin: 0;\n font-weight: 700;\n border-radius: 0;\n }\n div.opp-turn {\n display: block;\n position: absolute;\n text-align: center;\n bottom: 83px;\n left: 84px;\n width: 596px;\n height: 28px;\n font-size: 16px;\n line-height: 24px;\n padding: 4px 0 0;\n margin: 0;\n }\n div#congrats {\n position: absolute;\n text-align: center;\n bottom: 83px;\n left: 84px;\n width: 596px;\n height: 28px;\n font-size: 16px;\n line-height: 24px;\n padding: 4px 0 0;\n margin: 0;\n display: block;\n }\n div.resign {\n position: absolute;\n text-align: center;\n bottom: 83px;\n left: 84px;\n width: 596px;\n height: 28px;\n font-size: 16px;\n line-height: 24px;\n padding: 4px 0 0;\n margin: 0;\n font-weight: 700;\n border-radius: 0;\n }\n div.pass {\n position: absolute;\n text-align: center;\n bottom: 83px;\n left: 84px;\n width: 596px;\n height: 28px;\n font-size: 16px;\n line-height: 24px;\n padding: 4px 0 0;\n margin: 0;\n font-weight: 700;\n border-radius: 0;\n }\n div.pass-last {\n position: absolute;\n text-align: center;\n bottom: 83px;\n left: 84px;\n width: 596px;\n height: 28px;\n font-size: 16px;\n line-height: 24px;\n padding: 4px 0 0;\n margin: 0;\n font-weight: 700;\n border-radius: 0;\n }\n div.chall {\n position: absolute;\n text-align: center;\n bottom: 83px;\n left: 84px;\n width: 596px;\n height: 28px;\n font-size: 16px;\n line-height: 24px;\n padding: 4px 0 0;\n margin: 0;\n font-weight: 700;\n border-radius: 0;\n }\n div.chall-info {\n position: absolute;\n text-align: center;\n bottom: 83px;\n left: 84px;\n width: 596px;\n height: 28px;\n font-size: 16px;\n line-height: 24px;\n padding: 4px 0 0;\n margin: 0;\n font-weight: 700;\n border-radius: 0;\n }\n div.exchange {\n position: absolute;\n text-align: center;\n bottom: 83px;\n left: 84px;\n width: 596px;\n height: 28px;\n font-size: 16px;\n line-height: 24px;\n padding: 4px 0 0;\n margin: 0;\n font-weight: 700;\n border-radius: 0;\n }\n div.gameinfo {\n position: absolute;\n text-align: center;\n bottom: 83px;\n left: 84px;\n width: 596px;\n height: 28px;\n font-size: 16px;\n line-height: 24px;\n padding: 4px 0 0;\n margin: 0;\n }\n input.chat-txt {\n width: 234px;\n height: 32px;\n font-size: 15px;\n }\n div.chat-area {\n height: 350px;\n width: 278px;\n }\n div.modal-close#chat-send {\n height: 26px;\n bottom: 0;\n }\n span.statsbutton {\n display: inline;\n text-align: center;\n background-color: white;\n font-size: 16px;\n font-weight: 700;\n color: var(--triple-word-color);\n margin-left: 4px;\n margin-right: 4px;\n padding-top: 2px;\n padding-bottom: 4px;\n padding-left: 12px;\n padding-right: 12px;\n border-radius: 5px;\n cursor: pointer;\n }\n div.toggler {\n display: inline-block;\n }\n div.toggler div.option.small {\n width: 40px;\n height: 26px;\n line-height: 26px;\n font-size: 20px;\n padding-top: 4px;\n padding-bottom: 2px;\n }\n div.toggler div.option.x-small {\n width: 32px;\n }\n div.tabbed-page {\n overflow: hidden;\n left: 110px;\n top: 12px;\n width: 900px;\n height: 673px;\n font-size: 13px;\n line-height: 23px;\n }\n div.help-container img {\n max-width: 640px;\n height: auto;\n }\n div#tabs,\n div#main-tabs {\n padding: 0.2em;\n border: 2px solid var(--tab-background);\n }\n div#tabs {\n background-color: var(--tab-background);\n }\n div#tabs > div[role=tabpanel],\n div#main-tabs > div[role=tabpanel] {\n height: 657px;\n top: 0;\n }\n div.userid {\n display: block;\n }\n .no-mobile-block {\n display: block;\n }\n .no-mobile-inline {\n display: inline;\n }\n .no-mobile-inline-block {\n display: inline-block;\n }\n .no-mobile-list {\n display: list-item;\n }\n .tab-legend {\n font-weight: bold;\n }\n span#numgames,\n span#numchallenges {\n margin-top: 10px;\n }\n div.fairplay {\n top: 41px;\n font-size: 28px;\n line-height: 28px;\n display: block;\n text-indent: 4px;\n }\n span.list-opp {\n width: 290px;\n max-width: 290px;\n }\n span.list-nick,\n span.list-nick-elo,\n div#tabs-3 span.list-nick {\n width: 220px;\n max-width: 220px;\n }\n span.list-fullname-robot {\n width: 486px;\n /* list-fullname + list-human-elo (+6 for margin-right) + list-info-hdr */\n max-width: 486px;\n font-size: 1em;\n }\n span.list-chall {\n width: 315px;\n max-width: 315px;\n }\n span.list-ts,\n span.list-ts-short,\n span.list-info-hdr,\n span.list-info,\n span.list-games,\n span.list-ratio,\n span.list-avgpts,\n span.list-manual,\n span.list-fav,\n span.list-overdue,\n span.list-newbag,\n span.list-duration,\n span.list-rank-no-mobile,\n span.list-elo-no-mobile {\n display: inline-block;\n }\n span.list-tc {\n width: 100px;\n max-width: 100px;\n padding-right: 6px;\n }\n span.list-ch,\n span.list-fav,\n span.list-icon,\n span.list-myturn,\n span.list-overdue {\n font-size: 20px;\n width: 32px;\n max-width: 32px;\n }\n span.list-newbag {\n font-size: 20px;\n width: 32px;\n max-width: 32px;\n }\n span.list-s0 {\n display: inline-block;\n width: 40px;\n max-width: 40px;\n }\n span.list-s1 {\n display: inline-block;\n width: 40px;\n max-width: 40px;\n }\n span.list-scorehdr {\n width: 88px;\n /* list-s0 + list-colon + list-s1 */\n max-width: 88px;\n }\n div#elo-toggler {\n top: 64px;\n bottom: auto;\n left: 272px;\n right: auto;\n }\n div#user-ok,\n div#user-cancel,\n div#user-logout,\n div#user-friend {\n position: absolute;\n }\n div.user-cat span#break {\n display: none;\n }\n div.user-cat#user-headings {\n line-height: 32px;\n }\n div.user-cat#user-search {\n display: block;\n }\n div#chall-form {\n position: absolute;\n padding-top: 12px;\n left: auto;\n right: 300px;\n top: 48px;\n width: 428px;\n height: 618px;\n font-size: 1em;\n }\n div#chall-fairplay {\n margin-top: 15px;\n padding-left: 52px;\n padding-right: 52px;\n }\n div#ready-toggler {\n display: block;\n position: absolute;\n left: 10px;\n top: 440px;\n }\n div#timed-toggler {\n display: block;\n position: absolute;\n left: 10px;\n top: 490px;\n }\n span.caption.wide {\n width: 264px;\n }\n div#chall-ok {\n right: 66px;\n /* 12 + 54 */\n }\n div#chall-cancel {\n right: 162px;\n /* 12 + 72 + 12 + 12 + 54 */\n }\n span.mobile-break,\n span.mobile-space {\n display: none;\n }\n div#user-load {\n top: 320px;\n left: 406px;\n width: 48px;\n height: 48px;\n background-size: 48px 48px;\n }\n div#spinner-dialog div#user-load {\n top: 360px;\n left: 488px;\n width: 48px;\n height: 48px;\n background-size: 48px 48px;\n }\n div.animated-spinner {\n left: 472px;\n top: 272px;\n }\n div#promo-form {\n left: auto;\n top: 60px;\n right: 48px;\n width: 812px;\n height: 628px;\n line-height: 1.62em;\n }\n div.promo-content {\n margin-top: 32px;\n margin-left: 48px;\n margin-right: 48px;\n }\n div.promo-fullscreen {\n display: block;\n }\n div.promo-mobile {\n display: none;\n }\n div.btn-promo-no {\n width: 160px;\n height: 28px;\n bottom: 48px;\n right: 48px;\n top: auto;\n background-color: var(--light-shadow);\n }\n div.challenge {\n width: 48px;\n height: 48px;\n top: auto;\n bottom: 212px;\n left: 646px;\n text-align: center;\n font-size: 26px;\n line-height: 48px;\n font-weight: 700;\n color: white;\n background-color: var(--triple-letter-color);\n padding: 0;\n border: 0px;\n cursor: pointer;\n }\n div.over {\n outline: var(--focus-border) solid 3px;\n }\n span.over {\n outline: var(--focus-border) solid 3px;\n }\n div #userlist,\n div #gamelist,\n div #elolist {\n height: 504px;\n /* 14 lines @ 36px each */\n }\n div #recentlist {\n height: 432px;\n /* 12 lines @ 36px each */\n }\n div #usr-recent {\n height: 432px;\n /* 12 lines @ 36px each */\n }\n div #chall-sent,\n div #chall-received {\n height: 216px;\n /* 6 lines @ 36px each */\n }\n span.list-win {\n width: 32px;\n max-width: 32px;\n margin-left: 2px;\n }\n div.games {\n height: 100%;\n padding: 0px;\n }\n div.games-item {\n margin-left: 4px;\n margin-right: 4px;\n }\n div#wait-form {\n position: absolute;\n padding-left: 12px;\n padding-right: 12px;\n padding-top: 6px;\n padding-bottom: 6px;\n box-shadow: 3px 3px 5px 2px var(--dark-shadow);\n font-size: 1em;\n z-index: 20;\n background-color: var(--container-bg-color);\n top: 160px;\n padding-top: 16px;\n left: auto;\n right: 202px;\n width: 504px;\n height: 400px;\n }\n div#accept-form {\n top: 220px;\n right: 300px;\n width: 428px;\n height: 292px;\n padding-top: 12px;\n /* Override */\n }\n span.left-to-move,\n span.right-to-move {\n position: relative;\n top: 2px;\n font-family: 'Glyphicons Regular';\n font-style: normal;\n font-weight: normal;\n color: var(--triple-word-color);\n padding-right: 4px;\n }\n /* Show red flag by the id of the player whose move it is */\n div.player-btn.tomove span.left-to-move:before {\n content: \"\\E267\";\n }\n div.player-btn.tomove span.right-to-move:before {\n content: \"\\E267\";\n }\n div.hint {\n top: 180px;\n margin-left: 60px;\n margin-right: 160px;\n font-size: inherit;\n }\n div.stats-box {\n width: auto;\n position: static;\n top: auto;\n left: auto;\n }\n div.stats-fig {\n width: 80px;\n height: 27px;\n padding: 6px;\n border-radius: 5px;\n border-width: 2px;\n font-size: 20px;\n line-height: 20px;\n margin-top: 4px;\n margin-right: 8px;\n margin-left: 8px;\n }\n div#own-toggler {\n position: relative;\n margin-top: 7px;\n margin-right: 8px;\n top: auto;\n }\n p#own-best {\n left: auto;\n right: 30px;\n top: 26px;\n font-size: 1em;\n }\n div#own-stats {\n margin-top: 16px;\n margin-bottom: 24px;\n height: 48px;\n }\n div.help-container {\n width: 828px;\n height: 612px;\n overflow: auto;\n padding-right: 24px;\n }\n div.twoletter-area {\n font-size: 16px;\n line-height: 23px;\n }\n div.twoletter-area.with-clock {\n font-size: 15px;\n line-height: 24px;\n margin-top: 3px;\n }\n div.twoletter-word {\n padding-right: 3px;\n }\n}\n");const Vg={projectId:"netskrafl",firebaseAPIKey:"",databaseURL:"",firebaseSenderId:"",firebaseAppId:"",measurementId:"",userEmail:"",userId:"",userNick:"",userFullname:"",locale:"is_IS",isExplo:!1,serverUrl:"",movesUrl:"",movesAccessKey:"",token:"",loginUrl:"",loginMethod:"",newUser:!1,beginner:!1,fairPlay:!0,plan:"",hasPaid:!1,ready:!1,readyTimed:!1,uiFullscreen:!0,uiLandscape:!1,runningLocal:!1},qg=G.memo((({state:e,tokenExpired:t})=>{const n=G.createRef(),i={...Vg,...e},{userEmail:o}=i;return G.useEffect((()=>{var e;if(!o)return;const r=n.current;if(!r)return void console.error("No container for Netskrafl UI");const s=`netskrafl-user-${o}`;if((null===(e=r.firstElementChild)||void 0===e?void 0:e.id)!==s){try{(async(e,t)=>{const{userEmail:n}=e;if(!n)throw new Error("No user specified for Netskrafl UI");const i=`netskrafl-user-${n}`,o=document.getElementById(i);if(o)return o;const r=document.createElement("div");r.id=i,r.className="netskrafl-loading",document.body.appendChild(r);const s=await zg(e,r);if("success"===s)return r.className="netskrafl-user",r;if("expired"===s)return r.className="netskrafl-expired",t&&t(),r;throw new Error("Failed to mount Netskrafl UI")})(i,t).then((e=>{const t=n.current;t&&(t.innerHTML="",t.appendChild(e))}))}catch(e){console.error("Failed to mount Netskrafl UI for user",o);const t=document.getElementById("netskrafl-container");t&&(t.innerHTML="")}return()=>{const e=document.getElementById("netskrafl-container"),t=null==e?void 0:e.firstElementChild;(null==t?void 0:t.id)===s&&document.body.appendChild(t)}}}),[o]),W.jsx("div",{className:"netskrafl",children:W.jsx("div",{className:"netskrafl-container",id:"netskrafl-container",ref:n})})}));exports.Netskrafl=qg;
|
|
3046
3046
|
//# sourceMappingURL=index.js.map
|