Guest User

Untitled

a guest
Jul 31st, 2017
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 141.32 KB | None | 0 0
  1. (function(){function g(a,h,m){return a.call.apply(a.bind,arguments)}function d(a,h,m){if(!a)throw Error();if(2<arguments.length){var H=Array.prototype.slice.call(arguments,2);return function(){var m=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(m,H);return a.apply(h,m)}}return function(){return a.apply(h,arguments)}}function b(a,h,m){b=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?g:d;return b.apply(null,arguments)}function c(a,h){this.a=
  2. a;this.o=h||a;this.c=this.o.document}function a(a,h,m,H){h=a.c.createElement(h);if(m)for(var b in m)m.hasOwnProperty(b)&&("style"==b?h.style.cssText=m[b]:h.setAttribute(b,m[b]));H&&h.appendChild(a.c.createTextNode(H));return h}function e(a,h,m){(a=a.c.getElementsByTagName(h)[0])||(a=document.documentElement);a.insertBefore(m,a.lastChild)}function k(a){a.parentNode&&a.parentNode.removeChild(a)}function f(a,h,m){h=h||[];m=m||[];for(var H=a.className.split(/\s+/),b=0;b<h.length;b+=1){for(var e=!1,f=
  3. 0;f<H.length;f+=1)if(h[b]===H[f]){e=!0;break}e||H.push(h[b])}h=[];for(b=0;b<H.length;b+=1){e=!1;for(f=0;f<m.length;f+=1)if(H[b]===m[f]){e=!0;break}e||h.push(H[b])}a.className=h.join(" ").replace(/\s+/g," ").replace(/^\s+|\s+$/,"")}function n(a,h){for(var m=a.className.split(/\s+/),H=0,b=m.length;H<b;H++)if(m[H]==h)return!0;return!1}function l(a){return a.o.location.hostname||a.a.location.hostname}function p(b,h,m){function H(){d&&f&&c&&(d(k),d=null)}h=a(b,"link",{rel:"stylesheet",href:h,media:"all"});
  4. var f=!1,c=!0,k=null,d=m||null;aa?(h.onload=function(){f=!0;H()},h.onerror=function(){f=!0;k=Error("Stylesheet failed to load");H()}):setTimeout(function(){f=!0;H()},0);e(b,"head",h)}function A(b,h,m,H){var e=b.c.getElementsByTagName("head")[0];if(e){var f=a(b,"script",{src:h}),c=!1;f.onload=f.onreadystatechange=function(){c||this.readyState&&"loaded"!=this.readyState&&"complete"!=this.readyState||(c=!0,m&&m(null),f.onload=f.onreadystatechange=null,"HEAD"==f.parentNode.tagName&&e.removeChild(f))};
  5. e.appendChild(f);setTimeout(function(){c||(c=!0,m&&m(Error("Script load timeout")))},H||5E3);return f}return null}function u(){this.a=0;this.c=null}function w(a){a.a++;return function(){a.a--;y(a)}}function I(a,h){a.c=h;y(a)}function y(a){0==a.a&&a.c&&(a.c(),a.c=null)}function F(a){this.a=a||"-"}function x(a,h){this.c=a;this.f=4;this.a="n";var m=(h||"n4").match(/^([nio])([1-9])$/i);m&&(this.a=m[1],this.f=parseInt(m[2],10))}function M(a){return ba(a)+" "+(a.f+"00")+" 300px "+L(a.c)}function L(a){var h=
  6. [];a=a.split(/,\s*/);for(var m=0;m<a.length;m++){var b=a[m].replace(/['"]/g,"");-1!=b.indexOf(" ")||/^\d/.test(b)?h.push("'"+b+"'"):h.push(b)}return h.join(",")}function B(a){return a.a+a.f}function ba(a){var h="normal";"o"===a.a?h="oblique":"i"===a.a&&(h="italic");return h}function r(a){var h=4,m="n",b=null;a&&((b=a.match(/(normal|oblique|italic)/i))&&b[1]&&(m=b[1].substr(0,1).toLowerCase()),(b=a.match(/([1-9]00|normal|bold)/i))&&b[1]&&(/bold/i.test(b[1])?h=7:/[1-9]00/.test(b[1])&&(h=parseInt(b[1].substr(0,
  7. 1),10))));return m+h}function S(a,h){this.c=a;this.f=a.o.document.documentElement;this.h=h;this.a=new F("-");this.j=!1!==h.events;this.g=!1!==h.classes}function v(a){a.g&&f(a.f,[a.a.c("wf","loading")]);T(a,"loading")}function z(a){if(a.g){var h=n(a.f,a.a.c("wf","active")),m=[],b=[a.a.c("wf","loading")];h||m.push(a.a.c("wf","inactive"));f(a.f,m,b)}T(a,"inactive")}function T(a,h,m){if(a.j&&a.h[h])if(m)a.h[h](m.c,B(m));else a.h[h]()}function ca(){this.c={}}function ja(a,h,m){var b=[],e;for(e in h)if(h.hasOwnProperty(e)){var f=
  8. a.c[e];f&&b.push(f(h[e],m))}return b}function W(b,h){this.c=b;this.f=h;this.a=a(this.c,"span",{"aria-hidden":"true"},this.f)}function Z(a){e(a.c,"body",a.a)}function N(a){return"display:block;position:absolute;top:-9999px;left:-9999px;font-size:300px;width:auto;height:auto;line-height:normal;margin:0;padding:0;font-variant:normal;white-space:nowrap;font-family:"+L(a.c)+";"+("font-style:"+ba(a)+";font-weight:"+(a.f+"00")+";")}function pa(a,h,m,b,e,f){this.g=a;this.j=h;this.a=b;this.c=m;this.f=e||3E3;
  9. this.h=f||void 0}function q(a,h,m,b,e,f,c){this.v=a;this.B=h;this.c=m;this.a=b;this.s=c||"BESbswy";this.f={};this.w=e||3E3;this.u=f||null;this.g=new W(this.c,this.s);this.h=new W(this.c,this.s);this.j=new W(this.c,this.s);this.m=new W(this.c,this.s);a=new x(this.a.c+",serif",B(this.a));a=N(a);this.g.a.style.cssText=a;a=new x(this.a.c+",sans-serif",B(this.a));a=N(a);this.h.a.style.cssText=a;a=new x("serif",B(this.a));a=N(a);this.j.a.style.cssText=a;a=new x("sans-serif",B(this.a));a=N(a);this.m.a.style.cssText=
  10. a;Z(this.g);Z(this.h);Z(this.j);Z(this.m)}function P(){if(null===G){var a=/AppleWebKit\/([0-9]+)(?:\.([0-9]+))/.exec(window.navigator.userAgent);G=!!a&&(536>parseInt(a[1],10)||536===parseInt(a[1],10)&&11>=parseInt(a[2],10))}return G}function C(a,h,m){for(var b in U)if(U.hasOwnProperty(b)&&h===a.f[U[b]]&&m===a.f[U[b]])return!0;return!1}function J(a){var h=a.g.a.offsetWidth,m=a.h.a.offsetWidth,b;(b=h===a.f.serif&&m===a.f["sans-serif"])||(b=P()&&C(a,h,m));b?X()-a.A>=a.w?P()&&C(a,h,m)&&(null===a.u||a.u.hasOwnProperty(a.a.c))?
  11. da(a,a.v):da(a,a.B):oa(a):da(a,a.v)}function oa(a){setTimeout(b(function(){J(this)},a),50)}function da(a,h){setTimeout(b(function(){k(this.g.a);k(this.h.a);k(this.j.a);k(this.m.a);h(this.a)},a),0)}function D(a,h,m){this.c=a;this.a=h;this.f=0;this.m=this.j=!1;this.s=m}function ka(a){0==--a.f&&a.j&&(a.m?(a=a.a,a.g&&f(a.f,[a.a.c("wf","active")],[a.a.c("wf","loading"),a.a.c("wf","inactive")]),T(a,"active")):z(a.a))}function t(a){this.j=a;this.a=new ca;this.h=0;this.f=this.g=!0}function ea(a,h,m,H,e){var c=
  12. 0==--a.h;(a.f||a.g)&&setTimeout(function(){var a=e||null,k=H||null||{};if(0===m.length&&c)z(h.a);else{h.f+=m.length;c&&(h.j=c);var d,g=[];for(d=0;d<m.length;d++){var sa=m[d],n=k[sa.c],l=h.a;var p=sa;l.g&&f(l.f,[l.a.c("wf",p.c,B(p).toString(),"loading")]);T(l,"fontloading",p);l=null;if(null===fa)if(window.FontFace){p=/Gecko.*Firefox\/(\d+)/.exec(window.navigator.userAgent);var za=/OS X.*Version\/10\..*Safari/.exec(window.navigator.userAgent)&&/Apple/.exec(window.navigator.vendor);fa=p?42<parseInt(p[1],
  13. 10):za?!1:!0}else fa=!1;fa?l=new pa(b(h.g,h),b(h.h,h),h.c,sa,h.s,n):l=new q(b(h.g,h),b(h.h,h),h.c,sa,h.s,a,n);g.push(l)}for(d=0;d<g.length;d++)g[d].start()}},0)}function la(a,h,m){var b=[],e=m.timeout;v(h);var b=ja(a.a,m,a.c),f=new D(a.c,h,e);a.h=b.length;h=0;for(m=b.length;h<m;h++)b[h].load(function(h,m,b){ea(a,f,h,m,b)})}function K(a,h){this.c=a;this.a=h}function ma(a,h){this.c=a;this.a=h}function Q(a,h){a?this.c=a:this.c=ga;this.a=[];this.f=[];this.g=h||""}function R(a,h){for(var m=h.length,b=
  14. 0;b<m;b++){var e=h[b].split(":");3==e.length&&a.f.push(e.pop());var f="";2==e.length&&""!=e[1]&&(f=":");a.a.push(e.join(f))}}function na(a){if(0==a.a.length)throw Error("No fonts to load!");if(-1!=a.c.indexOf("kit="))return a.c;for(var h=a.a.length,m=[],b=0;b<h;b++)m.push(a.a[b].replace(/ /g,"+"));h=a.c+"?family="+m.join("%7C");0<a.f.length&&(h+="&subset="+a.f.join(","));0<a.g.length&&(h+="&text="+encodeURIComponent(a.g));return h}function E(a){this.f=a;this.a=[];this.c={}}function V(a){for(var h,
  15. m=a.f.length,b=0;b<m;b++){var e=a.f[b].split(":"),f=e[0].replace(/\+/g," "),c=["n4"];if(2<=e.length){var k=e[1];var d=[];if(k)for(var k=k.split(","),g=k.length,n=0;n<g;n++){var l=k[n];if(l.match(/^[\w-]+$/))if(h=ta.exec(l.toLowerCase()),null==h)l="";else{l=h[2];l=null==l||""==l?"n":xa[l];h=h[1];if(null==h||""==h)h="4";else{var p=ya[h];h=p?p:isNaN(h)?"4":h.substr(0,1)}l=[l,h].join("")}else l="";l&&d.push(l)}0<d.length&&(c=d);3==e.length&&(e=e[2],d=[],e=e?e.split(","):d,0<e.length&&(e=ua[e[0]])&&(a.c[f]=
  16. e))}a.c[f]||(e=ua[f])&&(a.c[f]=e);for(e=0;e<c.length;e+=1)a.a.push(new x(f,c[e]))}}function O(a,h){this.c=a;this.a=h}function ha(a,h){this.c=a;this.a=h}function ia(a,h){this.c=a;this.f=h;this.a=[]}var X=Date.now||function(){return+new Date},aa=!!window.FontFace;F.prototype.c=function(a){for(var h=[],m=0;m<arguments.length;m++)h.push(arguments[m].replace(/[\W_]+/g,"").toLowerCase());return h.join(this.a)};pa.prototype.start=function(){var a=this.c.o.document,h=this,m=X(),b=new Promise(function(b,e){function f(){X()-
  17. m>=h.f?e():a.fonts.load(M(h.a),h.h).then(function(h){1<=h.length?b():setTimeout(f,25)},function(){e()})}f()}),e=null,f=new Promise(function(a,m){e=setTimeout(m,h.f)});Promise.race([f,b]).then(function(){e&&(clearTimeout(e),e=null);h.g(h.a)},function(){h.j(h.a)})};var U={D:"serif",C:"sans-serif"},G=null;q.prototype.start=function(){this.f.serif=this.j.a.offsetWidth;this.f["sans-serif"]=this.m.a.offsetWidth;this.A=X();J(this)};var fa=null;D.prototype.g=function(a){var h=this.a;h.g&&f(h.f,[h.a.c("wf",
  18. a.c,B(a).toString(),"active")],[h.a.c("wf",a.c,B(a).toString(),"loading"),h.a.c("wf",a.c,B(a).toString(),"inactive")]);T(h,"fontactive",a);this.m=!0;ka(this)};D.prototype.h=function(a){var h=this.a;if(h.g){var m=n(h.f,h.a.c("wf",a.c,B(a).toString(),"active")),b=[],e=[h.a.c("wf",a.c,B(a).toString(),"loading")];m||b.push(h.a.c("wf",a.c,B(a).toString(),"inactive"));f(h.f,b,e)}T(h,"fontinactive",a);ka(this)};t.prototype.load=function(a){this.c=new c(this.j,a.context||this.j);this.g=!1!==a.events;this.f=
  19. !1!==a.classes;la(this,new S(this.c,a),a)};K.prototype.load=function(a){function h(){if(f["__mti_fntLst"+b]){var m=f["__mti_fntLst"+b](),e=[],H;if(m)for(var c=0;c<m.length;c++){var k=m[c].fontfamily;void 0!=m[c].fontStyle&&void 0!=m[c].fontWeight?(H=m[c].fontStyle+m[c].fontWeight,e.push(new x(k,H))):e.push(new x(k))}a(e)}else setTimeout(function(){h()},50)}var m=this,b=m.a.projectId,e=m.a.version;if(b){var f=m.c.o;A(this.c,(m.a.api||"https://fast.fonts.net/jsapi")+"/"+b+".js"+(e?"?v="+e:""),function(e){e?
  20. a([]):(f["__MonotypeConfiguration__"+b]=function(){return m.a},h())}).id="__MonotypeAPIScript__"+b}else a([])};ma.prototype.load=function(a){var h,m=this.a.urls||[],b=this.a.families||[],e=this.a.testStrings||{},f=new u;var c=0;for(h=m.length;c<h;c++)p(this.c,m[c],w(f));var k=[];c=0;for(h=b.length;c<h;c++)if(m=b[c].split(":"),m[1])for(var d=m[1].split(","),g=0;g<d.length;g+=1)k.push(new x(m[0],d[g]));else k.push(new x(m[0]));I(f,function(){a(k,e)})};var ga="https://fonts.googleapis.com/css",ua={latin:"BESbswy",
  21. "latin-ext":"\u00e7\u00f6\u00fc\u011f\u015f",cyrillic:"\u0439\u044f\u0416",greek:"\u03b1\u03b2\u03a3",khmer:"\u1780\u1781\u1782",Hanuman:"\u1780\u1781\u1782"},ya={thin:"1",extralight:"2","extra-light":"2",ultralight:"2","ultra-light":"2",light:"3",regular:"4",book:"4",medium:"5","semi-bold":"6",semibold:"6","demi-bold":"6",demibold:"6",bold:"7","extra-bold":"8",extrabold:"8","ultra-bold":"8",ultrabold:"8",black:"9",heavy:"9",l:"3",r:"4",b:"7"},xa={i:"i",italic:"i",n:"n",normal:"n"},ta=/^(thin|(?:(?:extra|ultra)-?)?light|regular|book|medium|(?:(?:semi|demi|extra|ultra)-?)?bold|black|heavy|l|r|b|[1-9]00)?(n|i|normal|italic)?$/,
  22. va={Arimo:!0,Cousine:!0,Tinos:!0};O.prototype.load=function(a){var h=new u,m=this.c,b=new Q(this.a.api,this.a.text),e=this.a.families;R(b,e);var f=new E(e);V(f);p(m,na(b),w(h));I(h,function(){a(f.a,f.c,va)})};ha.prototype.load=function(a){var h=this.a.id,m=this.c.o;h?A(this.c,(this.a.api||"https://use.typekit.net")+"/"+h+".js",function(h){if(h)a([]);else if(m.Typekit&&m.Typekit.config&&m.Typekit.config.fn){h=m.Typekit.config.fn;for(var b=[],e=0;e<h.length;e+=2)for(var f=h[e],c=h[e+1],H=0;H<c.length;H++)b.push(new x(f,
  23. c[H]));try{m.Typekit.load({events:!1,classes:!1,async:!0})}catch(Aa){}a(b)}},2E3):a([])};ia.prototype.load=function(a){var h=this.f.id,m=this.c.o,b=this;h?(m.__webfontfontdeckmodule__||(m.__webfontfontdeckmodule__={}),m.__webfontfontdeckmodule__[h]=function(h,m){for(var e=0,f=m.fonts.length;e<f;++e){var c=m.fonts[e];b.a.push(new x(c.name,r("font-weight:"+c.weight+";font-style:"+c.style)))}a(b.a)},A(this.c,(this.f.api||"https://f.fontdeck.com/s/css/js/")+l(this.c)+"/"+h+".js",function(h){h&&a([])})):
  24. a([])};var Y=new t(window);Y.a.c.custom=function(a,h){return new ma(h,a)};Y.a.c.fontdeck=function(a,h){return new ia(h,a)};Y.a.c.monotype=function(a,h){return new K(h,a)};Y.a.c.typekit=function(a,h){return new ha(h,a)};Y.a.c.google=function(a,h){return new O(h,a)};var qa={load:b(Y.load,Y)};"function"===typeof define&&define.amd?define(function(){return qa}):"undefined"!==typeof module&&module.exports?module.exports=qa:(window.WebFont=qa,window.WebFontConfig&&Y.load(window.WebFontConfig))})();
  25. var $jscomp={scope:{}};$jscomp.defineProperty="function"==typeof Object.defineProperties?Object.defineProperty:function(g,d,b){if(b.get||b.set)throw new TypeError("ES3 does not support getters and setters.");g!=Array.prototype&&g!=Object.prototype&&(g[d]=b.value)};$jscomp.getGlobal=function(g){return"undefined"!=typeof window&&window===g?g:"undefined"!=typeof global&&null!=global?global:g};$jscomp.global=$jscomp.getGlobal(this);
  26. $jscomp.polyfill=function(g,d,b,c){if(d){b=$jscomp.global;g=g.split(".");for(c=0;c<g.length-1;c++){var a=g[c];a in b||(b[a]={});b=b[a]}g=g[g.length-1];c=b[g];d=d(c);d!=c&&null!=d&&$jscomp.defineProperty(b,g,{configurable:!0,writable:!0,value:d})}};$jscomp.SYMBOL_PREFIX="jscomp_symbol_";$jscomp.initSymbol=function(){$jscomp.initSymbol=function(){};$jscomp.global.Symbol||($jscomp.global.Symbol=$jscomp.Symbol)};$jscomp.symbolCounter_=0;
  27. $jscomp.Symbol=function(g){return $jscomp.SYMBOL_PREFIX+(g||"")+$jscomp.symbolCounter_++};$jscomp.initSymbolIterator=function(){$jscomp.initSymbol();var g=$jscomp.global.Symbol.iterator;g||(g=$jscomp.global.Symbol.iterator=$jscomp.global.Symbol("iterator"));"function"!=typeof Array.prototype[g]&&$jscomp.defineProperty(Array.prototype,g,{configurable:!0,writable:!0,value:function(){return $jscomp.arrayIterator(this)}});$jscomp.initSymbolIterator=function(){}};
  28. $jscomp.arrayIterator=function(g){var d=0;return $jscomp.iteratorPrototype(function(){return d<g.length?{done:!1,value:g[d++]}:{done:!0}})};$jscomp.iteratorPrototype=function(g){$jscomp.initSymbolIterator();g={next:g};g[$jscomp.global.Symbol.iterator]=function(){return this};return g};$jscomp.array=$jscomp.array||{};
  29. $jscomp.iteratorFromArray=function(g,d){$jscomp.initSymbolIterator();g instanceof String&&(g+="");var b=0,c={next:function(){if(b<g.length){var a=b++;return{value:d(a,g[a]),done:!1}}c.next=function(){return{done:!0,value:void 0}};return c.next()}};c[Symbol.iterator]=function(){return c};return c};$jscomp.polyfill("Array.prototype.entries",function(g){return g?g:function(){return $jscomp.iteratorFromArray(this,function(d,b){return[d,b]})}},"es6-impl","es3");
  30. $jscomp.polyfill("Math.trunc",function(g){return g?g:function(d){d=Number(d);if(isNaN(d)||Infinity===d||-Infinity===d||0===d)return d;var b=Math.floor(Math.abs(d));return 0>d?-b:b}},"es6-impl","es3");"undefined"==typeof _pio&&(_pio={});
  31. (function(){_pio.channel=function(){};_pio.channel.prototype.call=function(g,d,b,c,a){var e="undefined"!=typeof PLAYERIO_API_HOST?PLAYERIO_API_HOST:(PlayerIO.useSecureApiRequests?"https":"http")+"://api.playerio.com/json/",k=new XMLHttpRequest;"withCredentials"in k?k.open("post",e,!0):"undefined"!=typeof XDomainRequest?(k=new XDomainRequest,k.open("post",e)):k=new _pio.flashWebRequest("post",e);var f=Error();null!=k?(k.send("["+g+"|"+(this.token||"")+"]"+JSON.stringify(d)),k.onload=function(){var e=
  32. null;try{var d=k.response||k.responseText;if("["==d[0]){var g=d.indexOf("]");this.token=d.substring(1,g);d=d.substring(g+1)}e=JSON.parse(d)}catch(A){_pio.handleError(f,c,PlayerIOErrorCode.GeneralError,"Error decoding response from webservice: "+A);return}if("undefined"==typeof e.errorcode&&"undefined"==typeof e.message){d=e;if(a)try{d=a(e)}catch(A){_pio.handleError(f,c,A.code,A.message)}b&&b(d)}else _pio.handleError(f,c,e.errorcode,e.message)},k.onerror=function(a){_pio.handleError(f,c,PlayerIOErrorCode.GeneralError,
  33. "Error talking to webservice: "+JSON.stringify(a))}):_pio.handleError(f,c,PlayerIOErrorCode.GeneralError,"Need to implement flash calling")};_pio.runCallback=function(g,d,b){try{g&&g(d)}catch(c){g="Unhandled error in callback: "+c.message,g=g+"\nStack:\n"+(c.stack||c.stacktrace||c.StackTrace),b&&(g=g+"\nCallsite stack:\n"+(b.stack||b.stacktrace||b.StackTrace)),console.log(g)}};_pio.handleError=function(g,d,b,c){b=_pio.error(b,c);g&&(g.stack&&(b.stack=g.stack),g.stacktrace&&(b.stacktrace=g.stacktrace),
  34. g.StackTrace&&(b.StackTrace=g.StackTrace));d?_pio.runCallback(d,b,g):"undefined"!=typeof console?console.log("No error callback specified for: "+b.code+": "+b.message+"\n"+(b.stack||b.stacktrace||b.StackTrace)):alert("No error callback specified for: "+b.code+": "+b.message+"\n"+(b.stack||b.stacktrace||b.StackTrace))};_pio.error=function(g,d){1==arguments.length&&(d=g,g=PlayerIOErrorCode.GeneralError);"number"==typeof g&&(g=PlayerIOErrorCode.codes[g]);if("string"!=typeof g)throw console.log(g,d,Error().stack),
  35. "Code must be a string!";var b=Error();return new PlayerIOError(g,d,b.stack||b.stacktrace||b.StackTrace)};_pio.debugLog=function(g){"undefined"!=typeof console&&console.log(g)};_pio.convertToKVArray=function(g){var d=[];if(g)for(var b in g)d.push({key:""+b,value:""+g[b]});return d};_pio.convertFromKVArray=function(g){var d={};if(g&&g.length)for(var b in g)d[g[b].key]=g[b].value;return d};_pio.convertToSegmentArray=function(g){var d=[];if(g)for(var b in g)d.push(b+":"+g[b]);return d}})();
  36. PlayerIO={useSecureApiRequests:!1,authenticate:function(g,d,b,c,a,e){if("auto"==b.publishingnetworklogin)"undefined"==typeof window.PublishingNetwork?e(new PlayerIOError(PlayerIOErrorCode.GeneralError,"Could not find the PublishingNetwork object on the current page. Did you include the PublishingNetwork.js script?")):PublishingNetwork.dialog("login",{gameId:g,connectionId:d,__use_usertoken__:!0},function(b){b.error?e(new PlayerIOError(PlayerIOErrorCode.GeneralError,b.error)):"undefined"==typeof b.userToken?
  37. e(new PlayerIOError(PlayerIOErrorCode.GeneralError,"Missing userToken value in result, but no error message given.")):PlayerIO.authenticate(g,d,{userToken:b.userToken},c,a,e)});else{var k=new _pio.channel;k.authenticate(g,d,_pio.convertToKVArray(b),_pio.convertToSegmentArray(c),"javascript",_pio.convertToKVArray({}),null,a,e,function(a){k.token=a.token;return new _pio.client(k,g,a.gamefsredirectmap,a.userid)})}},quickConnect:null,gameFS:function(g){return new _pio.gameFS(g)}};var JSON;
  38. JSON||(JSON={});
  39. (function(){function g(a){return 10>a?"0"+a:a}function d(b){a.lastIndex=0;return a.test(b)?'"'+b.replace(a,function(a){var b=f[a];return"string"===typeof b?b:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+b+'"'}function b(a,f){var c,g,l=e,p=f[a];p&&"object"===typeof p&&"function"===typeof p.toJSON&&(p=p.toJSON(a));"function"===typeof n&&(p=n.call(f,a,p));switch(typeof p){case "string":return d(p);case "number":return isFinite(p)?String(p):"null";case "boolean":case "null":return String(p);case "object":if(!p)return"null";
  40. e+=k;var y=[];if("[object Array]"===Object.prototype.toString.apply(p)){var F=p.length;for(c=0;c<F;c+=1)y[c]=b(c,p)||"null";var x=0===y.length?"[]":e?"[\n"+e+y.join(",\n"+e)+"\n"+l+"]":"["+y.join(",")+"]";e=l;return x}if(n&&"object"===typeof n)for(F=n.length,c=0;c<F;c+=1)"string"===typeof n[c]&&(g=n[c],(x=b(g,p))&&y.push(d(g)+(e?": ":":")+x));else for(g in p)Object.prototype.hasOwnProperty.call(p,g)&&(x=b(g,p))&&y.push(d(g)+(e?": ":":")+x);x=0===y.length?"{}":e?"{\n"+e+y.join(",\n"+e)+"\n"+l+"}":
  41. "{"+y.join(",")+"}";e=l;return x}}"function"!==typeof Date.prototype.toJSON&&(Date.prototype.toJSON=function(a){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+g(this.getUTCMonth()+1)+"-"+g(this.getUTCDate())+"T"+g(this.getUTCHours())+":"+g(this.getUTCMinutes())+":"+g(this.getUTCSeconds())+"Z":null},String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(a){return this.valueOf()});var c=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
  42. a=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,e,k,f={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},n;"function"!==typeof JSON.stringify&&(JSON.stringify=function(a,f,c){var d;k=e="";if("number"===typeof c)for(d=0;d<c;d+=1)k+=" ";else"string"===typeof c&&(k=c);if((n=f)&&"function"!==typeof f&&("object"!==typeof f||"number"!==typeof f.length))throw Error("JSON.stringify");return b("",{"":a})});
  43. "function"!==typeof JSON.parse&&(JSON.parse=function(a,b){function e(a,f){var c,k,d=a[f];if(d&&"object"===typeof d)for(c in d)Object.prototype.hasOwnProperty.call(d,c)&&(k=e(d,c),void 0!==k?d[c]=k:delete d[c]);return b.call(a,f,d)}var f;a=String(a);c.lastIndex=0;c.test(a)&&(a=a.replace(c,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)}));if(/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
  44. "]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return f=eval("("+a+")"),"function"===typeof b?e({"":f},""):f;throw new SyntaxError("JSON.parse");})})();
  45. (function(){function g(b){if(null!=a)b(a);else if(e)b(null);else if(null==k){k=[b];var f=setInterval(function(){var a=d();null!=a&&c(a)},50);setTimeout(function(){null==a&&c(null)},3E4);var c=function(b){a=b;e=null==b;clearInterval(f);for(var c=0;c!=k.length;c++)k[c](b)}}else k.push(b)}function d(){var a='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="10" height="10" style="$style$" id="$id$">\t<param name="movie" value="$src$" />\t<param name="allowNetworking" value="all" />\t<param name="allowScriptAccess" value="always" />\t\x3c!--[if !IE]>--\x3e\t<object type="application/x-shockwave-flash" data="$src$" width="10" height="10" style="$style$">\t\t<param name="allowNetworking" value="all" />\t\t<param name="allowScriptAccess" value="always" />\t</object>\t\x3c!--<![endif]--\x3e</object>'.replace(/\$id\$/gi,"__pio_flashfallback__");
  46. a=a.replace(/\$src\$/gi,"http://192.168.30.154/html5client/FlashFallback/bin-debug/FlashFallback.swf");a=a.replace(/\$style\$/gi,"width:10px;height:10px");var b=document.getElementById("containerId");if(!b){var e=document.createElement("div");e.setAttribute("id",b);e.setAttribute("style","position:absolute;top:-20px;left:-20px");e.innerHTML=a;try{document.body.appendChild(e)}catch(p){}}a=function(a){a=document.getElementsByTagName(a);for(var b=0;b!=a.length;b++)if(a[b].ping&&"pong"==a[b].ping())return a[b]};
  47. return a("embed")||a("object")}var b={},c=0;__pio_flashfallback_callback__=function(){var a=b[arguments[0]];if(a){for(var e=[],c=1;c!=arguments.length;c++)e[c-1]=arguments[c];a.apply(null,e)}};_pio.flashWebRequest=function(a,e){var f=this;this.response=null;this.onload=function(){};this.onerror=function(){};this.send=function(k){g(function(d){if(null==d)f.onerror("Browser does not support Cross-Origin (CORS) webrequest or Flash as a fallback method");else{var g="cb"+c++;b[g]=function(a,e){delete b[g];
  48. if(a)f.response=e,f.onload();else f.onerror(e)};d.webrequest(g,a,e,k)}})}};_pio.flashSocketConnection=function(a,e,k,d,A){var f="cb"+c++,n=this,l=new _pio.messageSerializer,p=!1,F=!1,x=setTimeout(function(){p||(p=!0,k(!1,"Connect attempt timed out"))},e);this.disconnect=function(){console.log("... this shouldn't happen")};this.sendMessage=function(a){console.log("... send msg. this shouldn't happen")};g(function(e){null==e?(p=!0,k(!1,"Browser does not support WebSocket connections and the Flash fallback failed.")):
  49. (b[f]=function(a,b){switch(a){case "onopen":p||(clearTimeout(x),F=p=!0,e.socketSend(f,[0]),k(F));break;case "onclose":n.disconnect();break;case "onerror":n.disconnect();break;case "onmessage":A(l.deserializeMessage(b,0,b.length))}},n.disconnect=function(){if(F){F=!1;d();try{e.socketClose(f)}catch(L){_pio.debugLog(L)}}},n.sendMessage=function(a){a=l.serializeMessage(a);e.socketSend(f,a)},e.socketConnection(f,a))})};_pio.isFlashFallbackEnabled=function(a){g(function(b){a(null!=b)})};var a=null,e=!1,
  50. k=null})();
  51. (function(){var g=_pio.channel.prototype;g.connect=function(d,b,c,a,e,k,f,g,l,p,A){this.call(10,{gameid:d,connectionid:b,userid:c,auth:a,partnerid:e,playerinsightsegments:k,clientapi:f,clientinfo:g},l,p,A)};_pio.ApiSecurityRule={RespectClientSetting:0,UseHttp:1,UseHttps:2};g.authenticate=function(d,b,c,a,e,k,f,g,l,p){this.call(13,{gameid:d,connectionid:b,authenticationarguments:c,playerinsightsegments:a,clientapi:e,clientinfo:k,playcodes:f},g,l,p)};g.createRoom=function(d,b,c,a,e,k,f,g){this.call(21,{roomid:d,
  52. roomtype:b,visible:c,roomdata:a,isdevroom:e},k,f,g)};g.joinRoom=function(d,b,c,a,e,k){this.call(24,{roomid:d,joindata:b,isdevroom:c},a,e,k)};g.createJoinRoom=function(d,b,c,a,e,k,f,g,l){this.call(27,{roomid:d,roomtype:b,visible:c,roomdata:a,joindata:e,isdevroom:k},f,g,l)};g.listRooms=function(d,b,c,a,e,k,f,g){this.call(30,{roomtype:d,searchcriteria:b,resultlimit:c,resultoffset:a,onlydevrooms:e},k,f,g)};g.userLeftRoom=function(d,b,c,a,e,k){this.call(40,{extendedroomid:d,newplayercount:b,closed:c},
  53. a,e,k)};g.writeError=function(d,b,c,a,e,k,f,g){this.call(50,{source:d,error:b,details:c,stacktrace:a,extradata:e},k,f,g)};g.updateRoom=function(d,b,c,a,e,k){this.call(53,{extendedroomid:d,visible:b,roomdata:c},a,e,k)};_pio.ValueType={String:0,Int:1,UInt:2,Long:3,Bool:4,Float:5,Double:6,ByteArray:7,DateTime:8,Array:9,Obj:10};g.createObjects=function(d,b,c,a,e){this.call(82,{objects:d,loadexisting:b},c,a,e)};g.loadObjects=function(d,b,c,a){this.call(85,{objectids:d},b,c,a)};_pio.LockType={NoLocks:0,
  54. LockIndividual:1,LockAll:2};g.saveObjectChanges=function(d,b,c,a,e,k){this.call(88,{locktype:d,changesets:b,createifmissing:c},a,e,k)};g.deleteObjects=function(d,b,c,a){this.call(91,{objectids:d},b,c,a)};g.loadMatchingObjects=function(d,b,c,a,e,k,f){this.call(94,{table:d,index:b,indexvalue:c,limit:a},e,k,f)};g.loadIndexRange=function(d,b,c,a,e,k,f,g){this.call(97,{table:d,index:b,startindexvalue:c,stopindexvalue:a,limit:e},k,f,g)};g.deleteIndexRange=function(d,b,c,a,e,k,f){this.call(100,{table:d,
  55. index:b,startindexvalue:c,stopindexvalue:a},e,k,f)};g.loadMyPlayerObject=function(d,b,c){this.call(103,{},d,b,c)};g.payVaultReadHistory=function(d,b,c,a,e,k){this.call(160,{page:d,pagesize:b,targetuserid:c},a,e,k)};g.payVaultRefresh=function(d,b,c,a,e){this.call(163,{lastversion:d,targetuserid:b},c,a,e)};g.payVaultConsume=function(d,b,c,a,e){this.call(166,{ids:d,targetuserid:b},c,a,e)};g.payVaultCredit=function(d,b,c,a,e,k){this.call(169,{amount:d,reason:b,targetuserid:c},a,e,k)};g.payVaultDebit=
  56. function(d,b,c,a,e,k){this.call(172,{amount:d,reason:b,targetuserid:c},a,e,k)};g.payVaultBuy=function(d,b,c,a,e,k){this.call(175,{items:d,storeitems:b,targetuserid:c},a,e,k)};g.payVaultGive=function(d,b,c,a,e){this.call(178,{items:d,targetuserid:b},c,a,e)};g.payVaultPaymentInfo=function(d,b,c,a,e,k){this.call(181,{provider:d,purchasearguments:b,items:c},a,e,k)};g.payVaultUsePaymentInfo=function(d,b,c,a,e){this.call(184,{provider:d,providerarguments:b},c,a,e)};g.partnerPayTrigger=function(d,b,c,a,
  57. e){this.call(200,{key:d,count:b},c,a,e)};g.partnerPaySetTag=function(d,b,c,a){this.call(203,{partnerid:d},b,c,a)};g.notificationsRefresh=function(d,b,c,a){this.call(213,{lastversion:d},b,c,a)};g.notificationsRegisterEndpoints=function(d,b,c,a,e){this.call(216,{lastversion:d,endpoints:b},c,a,e)};g.notificationsSend=function(d,b,c,a){this.call(219,{notifications:d},b,c,a)};g.notificationsToggleEndpoints=function(d,b,c,a,e,k){this.call(222,{lastversion:d,endpoints:b,enabled:c},a,e,k)};g.notificationsDeleteEndpoints=
  58. function(d,b,c,a,e){this.call(225,{lastversion:d,endpoints:b},c,a,e)};g.gameRequestsSend=function(d,b,c,a,e,k){this.call(241,{requesttype:d,requestdata:b,requestrecipients:c},a,e,k)};g.gameRequestsRefresh=function(d,b,c,a){this.call(244,{playcodes:d},b,c,a)};g.gameRequestsDelete=function(d,b,c,a){this.call(247,{requestids:d},b,c,a)};g.achievementsRefresh=function(d,b,c,a){this.call(271,{lastversion:d},b,c,a)};g.achievementsLoad=function(d,b,c,a){this.call(274,{userids:d},b,c,a)};g.achievementsProgressSet=
  59. function(d,b,c,a,e){this.call(277,{achievementid:d,progress:b},c,a,e)};g.achievementsProgressAdd=function(d,b,c,a,e){this.call(280,{achievementid:d,progressdelta:b},c,a,e)};g.achievementsProgressMax=function(d,b,c,a,e){this.call(283,{achievementid:d,progress:b},c,a,e)};g.achievementsProgressComplete=function(d,b,c,a){this.call(286,{achievementid:d},b,c,a)};g.playerInsightRefresh=function(d,b,c){this.call(301,{},d,b,c)};g.playerInsightSetSegments=function(d,b,c,a){this.call(304,{segments:d},b,c,a)};
  60. g.playerInsightTrackInvitedBy=function(d,b,c,a,e){this.call(307,{invitinguserid:d,invitationchannel:b},c,a,e)};g.playerInsightTrackEvents=function(d,b,c,a){this.call(311,{events:d},b,c,a)};g.playerInsightTrackExternalPayment=function(d,b,c,a,e){this.call(314,{currency:d,amount:b},c,a,e)};g.playerInsightSessionKeepAlive=function(d,b,c){this.call(317,{},d,b,c)};g.playerInsightSessionStop=function(d,b,c){this.call(320,{},d,b,c)};g.oneScoreLoad=function(d,b,c,a){this.call(351,{userids:d},b,c,a)};g.oneScoreSet=
  61. function(d,b,c,a){this.call(354,{score:d},b,c,a)};g.oneScoreAdd=function(d,b,c,a){this.call(357,{score:d},b,c,a)};g.oneScoreRefresh=function(d,b,c){this.call(360,{},d,b,c)};g.simpleConnect=function(d,b,c,a,e,k,f,g,l){this.call(400,{gameid:d,usernameoremail:b,password:c,playerinsightsegments:a,clientapi:e,clientinfo:k},f,g,l)};g.simpleRegister=function(d,b,c,a,e,k,f,g,l,p,A,u,w,I){this.call(403,{gameid:d,username:b,password:c,email:a,captchakey:e,captchavalue:k,extradata:f,partnerid:g,playerinsightsegments:l,
  62. clientapi:p,clientinfo:A},u,w,I)};g.simpleRecoverPassword=function(d,b,c,a,e){this.call(406,{gameid:d,usernameoremail:b},c,a,e)};g.kongregateConnect=function(d,b,c,a,e,k,f,g,l){this.call(412,{gameid:d,userid:b,gameauthtoken:c,playerinsightsegments:a,clientapi:e,clientinfo:k},f,g,l)};g.simpleGetCaptcha=function(d,b,c,a,e,k){this.call(415,{gameid:d,width:b,height:c},a,e,k)};g.facebookOAuthConnect=function(d,b,c,a,e,k,f,g,l){this.call(418,{gameid:d,accesstoken:b,partnerid:c,playerinsightsegments:a,clientapi:e,
  63. clientinfo:k},f,g,l)};g.steamConnect=function(d,b,c,a,e,k,f,g,l){this.call(421,{gameid:d,steamappid:b,steamsessionticket:c,playerinsightsegments:a,clientapi:e,clientinfo:k},f,g,l)};g.simpleUserGetSecureLoginInfo=function(d,b,c){this.call(424,{},d,b,c)};g.joinCluster=function(d,b,c,a,e,k,f,g,l,p,A,u,w,I,y,F,x){this.call(504,{clusteraccesskey:d,isdevelopmentserver:b,ports:c,machinename:a,version:e,machineid:k,os:f,cpu:g,cpucores:l,cpulogicalcores:p,cpuaddresswidth:A,cpumaxclockspeed:u,rammegabytes:w,
  64. ramspeed:I},y,F,x)};g.serverHeartbeat=function(d,b,c,a,e,k,f,g,l,p,A,u,w,I,y,F,x,M,L,B){this.call(510,{serverid:d,appdomains:b,servertypes:c,machinecpu:a,processcpu:e,memoryusage:k,avaliablememory:f,freememory:g,runningrooms:l,usedresources:p,apirequests:A,apirequestserror:u,apirequestsfailed:w,apirequestsexecuting:I,apirequestsqueued:y,apirequeststime:F,serverunixtimeutc:x},M,L,B)};g.getGameAssemblyUrl=function(d,b,c,a,e,k){this.call(513,{clusteraccesskey:d,gamecodeid:b,machineid:c},a,e,k)};g.devServerLogin=
  65. function(d,b,c,a,e){this.call(524,{username:d,password:b},c,a,e)};g.webserviceOnlineTest=function(d,b,c){this.call(533,{},d,b,c)};g.getServerInfo=function(d,b,c,a){this.call(540,{machineid:d},b,c,a)};g.socialRefresh=function(d,b,c){this.call(601,{},d,b,c)};g.socialLoadProfiles=function(d,b,c,a){this.call(604,{userids:d},b,c,a)}})();
  66. PlayerIOError=function(g,d,b){this.code=g;this.message=d;(this.stack=b)||(b=Error(),this.stack=b.stack||b.stacktrace||b.StackTrace);this.toString=function(){return"PlayerIOError["+g+"]: "+d}};PlayerIOError.prototype=Error();
  67. PlayerIOErrorCode={UnsupportedMethod:"UnsupportedMethod",GeneralError:"GeneralError",InternalError:"InternalError",AccessDenied:"AccessDenied",InvalidMessageFormat:"InvalidMessageFormat",MissingValue:"MissingValue",GameRequired:"GameRequired",ExternalError:"ExternalError",ArgumentOutOfRange:"ArgumentOutOfRange",GameDisabled:"GameDisabled",UnknownGame:"UnknownGame",UnknownConnection:"UnknownConnection",InvalidAuth:"InvalidAuth",NoServersAvailable:"NoServersAvailable",RoomDataTooLarge:"RoomDataTooLarge",
  68. RoomAlreadyExists:"RoomAlreadyExists",UnknownRoomType:"UnknownRoomType",UnknownRoom:"UnknownRoom",MissingRoomId:"MissingRoomId",RoomIsFull:"RoomIsFull",NotASearchColumn:"NotASearchColumn",QuickConnectMethodNotEnabled:"QuickConnectMethodNotEnabled",UnknownUser:"UnknownUser",InvalidPassword:"InvalidPassword",InvalidRegistrationData:"InvalidRegistrationData",InvalidBigDBKey:"InvalidBigDBKey",BigDBObjectTooLarge:"BigDBObjectTooLarge",BigDBObjectDoesNotExist:"BigDBObjectDoesNotExist",UnknownTable:"UnknownTable",
  69. UnknownIndex:"UnknownIndex",InvalidIndexValue:"InvalidIndexValue",NotObjectCreator:"NotObjectCreator",KeyAlreadyUsed:"KeyAlreadyUsed",StaleVersion:"StaleVersion",CircularReference:"CircularReference",HeartbeatFailed:"HeartbeatFailed",InvalidGameCode:"InvalidGameCode",VaultNotLoaded:"VaultNotLoaded",UnknownPayVaultProvider:"UnknownPayVaultProvider",DirectPurchaseNotSupportedByProvider:"DirectPurchaseNotSupportedByProvider",BuyingCoinsNotSupportedByProvider:"BuyingCoinsNotSupportedByProvider",NotEnoughCoins:"NotEnoughCoins",
  70. ItemNotInVault:"ItemNotInVault",InvalidPurchaseArguments:"InvalidPurchaseArguments",InvalidPayVaultProviderSetup:"InvalidPayVaultProviderSetup",UnknownPartnerPayAction:"UnknownPartnerPayAction",InvalidType:"InvalidType",IndexOutOfBounds:"IndexOutOfBounds",InvalidIdentifier:"InvalidIdentifier",InvalidArgument:"InvalidArgument",LoggedOut:"LoggedOut",InvalidSegment:"InvalidSegment",GameRequestsNotLoaded:"GameRequestsNotLoaded",AchievementsNotLoaded:"AchievementsNotLoaded",UnknownAchievement:"UnknownAchievement",
  71. NotificationsNotLoaded:"NotificationsNotLoaded",InvalidNotificationsEndpoint:"InvalidNotificationsEndpoint",NetworkIssue:"NetworkIssue",OneScoreNotLoaded:"OneScoreNotLoaded",PublishingNetworkNotAvailable:"PublishingNetworkNotAvailable",PublishingNetworkNotLoaded:"PublishingNetworkNotLoaded",DialogClosed:"DialogClosed",AdTrackCheckCookie:"AdTrackCheckCookie",codes:{0:"UnsupportedMethod",1:"GeneralError",2:"InternalError",3:"AccessDenied",4:"InvalidMessageFormat",5:"MissingValue",6:"GameRequired",7:"ExternalError",
  72. 8:"ArgumentOutOfRange",9:"GameDisabled",10:"UnknownGame",11:"UnknownConnection",12:"InvalidAuth",13:"NoServersAvailable",14:"RoomDataTooLarge",15:"RoomAlreadyExists",16:"UnknownRoomType",17:"UnknownRoom",18:"MissingRoomId",19:"RoomIsFull",20:"NotASearchColumn",21:"QuickConnectMethodNotEnabled",22:"UnknownUser",23:"InvalidPassword",24:"InvalidRegistrationData",25:"InvalidBigDBKey",26:"BigDBObjectTooLarge",27:"BigDBObjectDoesNotExist",28:"UnknownTable",29:"UnknownIndex",30:"InvalidIndexValue",31:"NotObjectCreator",
  73. 32:"KeyAlreadyUsed",33:"StaleVersion",34:"CircularReference",40:"HeartbeatFailed",41:"InvalidGameCode",50:"VaultNotLoaded",51:"UnknownPayVaultProvider",52:"DirectPurchaseNotSupportedByProvider",54:"BuyingCoinsNotSupportedByProvider",55:"NotEnoughCoins",56:"ItemNotInVault",57:"InvalidPurchaseArguments",58:"InvalidPayVaultProviderSetup",70:"UnknownPartnerPayAction",80:"InvalidType",81:"IndexOutOfBounds",82:"InvalidIdentifier",83:"InvalidArgument",84:"LoggedOut",90:"InvalidSegment",100:"GameRequestsNotLoaded",
  74. 110:"AchievementsNotLoaded",111:"UnknownAchievement",120:"NotificationsNotLoaded",121:"InvalidNotificationsEndpoint",130:"NetworkIssue",131:"OneScoreNotLoaded",200:"PublishingNetworkNotAvailable",201:"PublishingNetworkNotLoaded",301:"DialogClosed",302:"AdTrackCheckCookie"}};
  75. (function(){_pio.client=function(g,d,b,c){this.connectUserId=c;this.gameId=d;this.gameFS=new _pio.gameFS(d,b);this.errorLog=new _pio.errorLog(g);this.payVault=new _pio.payVault(g);this.bigDB=new _pio.bigDB(g);this.multiplayer=new _pio.multiplayer(g);this.gameRequests=new _pio.gameRequests(g);this.achievements=new _pio.achievements(g);this.playerInsight=new _pio.playerInsight(g);this.oneScore=new _pio.oneScore(g);this.notifications=new _pio.notifications(g);this.publishingNetwork=new _pio.publishingNetwork(g,
  76. this.connectUserId)}})();
  77. (function(){var g={};_pio.gameFS=function(d,b){if("string"==typeof b&&0<b.length){var c=(b||"").split("|");if(1<=c.length)for(var a=g[d.toLowerCase()]={},e=0;e!=c.length;e++){var k=c[e];"alltoredirect"==k||"cdnmap"==k?a.baseUrl=c[e+1]:"alltoredirectsecure"==k||"cdnmapsecure"==k?a.secureBaseUrl=c[e+1]:a["."+k]=c[e+1]}}this.getUrl=function(a,b){if("/"==!a[0])throw _pio.error("The path given to getUrl must start with a slash, like: '/myfile.swf' or '/folder/file.jpg'");var e=g[d];return e?(b?e.secureBaseUrl:
  78. e.baseUrl)+(e["."+a]||a):(b?"https":"http")+"://r.playerio.com/r/"+d+a}}})();
  79. (function(){_pio.gameRequests=function(g){function d(a){if(null==a||0==a.length)return[];for(var b=[],c=0;c!=a.length;c++){var f=a[c];b.push(new _pio.gameRequest(f.id,f.type,f.senderuserid,f.created,f.data))}return b}var b=[];this.waitingRequests="[ERROR: You tried to access gameRequests.waitingRequests before loading waiting requests. You have to call the refresh method first.]";var c=this;this.send=function(a,b,c,f,d){g.gameRequestsSend(a,_pio.convertToKVArray(b),c,f,d,function(a){})};this.refresh=
  80. function(a,e){g.gameRequestsRefresh(b,a,e,function(a){c._playCodes=a.newplaycodes;c.waitingRequests=d(a.requests)})};this["delete"]=function(a,b,k){if("object"==typeof a||a.length){for(var e=[],n=0;n!=a.length;n++){var l=a[n].id;if(l)e.push(l);else{a=_pio.error("No GameRequest id found on item#"+n+". You have to use requests from the gameRequests.waitingRequests array. For instance: client.gameRequests.delete(client.gameRequests.waitingRequests, ...)");_pio.handleError(a,k,a.code,a.message);return}}g.gameRequestsDelete(e,
  81. b,k,function(a){c.waitingRequests=d(a.requests)})}else a=_pio.error("The first argument to delete should be an array: client.gameRequests.delete([requests], ...)"),_pio.handleError(a,k,a.code,a.message)}};_pio.gameRequest=function(g,d,b,c,a){this.id=g;this.type=d;this.senderUserId=b;this.created=new Date(c);this.data=_pio.convertFromKVArray(a)}})();(function(){_pio.errorLog=function(g){this.writeError=function(d,b,c,a){g.writeError("Javascript",d,b,c,_pio.convertToKVArray(a))}}})();
  82. (function(){_pio.quickConnect=function(){this.simpleGetCaptcha=function(g,d,b,c,a){(new _pio.channel).simpleGetCaptcha(g,d,b,c,a,function(a){return new _pio.simpleGetCaptchaOutput(a.captchakey,a.captchaimageurl)})};this.simpleRecoverPassword=function(g,d,b,c){(new _pio.channel).simpleRecoverPassword(g,d,b,c,function(a){})}};_pio.simpleGetCaptchaOutput=function(g,d){this.captchaKey=g;this.captchaImageUrl=d};PlayerIO.quickConnect=new _pio.quickConnect})();
  83. (function(){_pio.payVault=function(g){function d(a){if(null!=a&&(b=a.version,c.coins=a.coins||0,c.items=[],a.items&&a.items.length))for(var e=0;e!=a.items.length;e++){var k=a.items[e],f=c.items[e]=new _pio.vaultItem(k.id,k.itemkey,(new Date).setTime(k.purchasedate));_pio.bigDBDeserialize(k.properties,f,!0)}}var b=null;this.coins="[ERROR: you tried to access payVault.coins before the vault was loaded. You have to refresh the vault before the .coins property is set to the right value]";this.items="[ERROR: you tried to access payVault.items before the vault was loaded. You have to refresh the vault before the .items property is set to the right value]";
  84. this.has=function(a){if(null==b)throw new PlayerIOError(PlayerIOErrorCode.VaultNotLoaded,"Cannot access items before vault has been loaded. Please refresh the vault first");for(var e=0;e!=this.items.length;e++)if(this.items[e].itemKey==a)return!0;return!1};this.first=function(a){if(null==b)throw new PlayerIOError(PlayerIOErrorCode.VaultNotLoaded,"Cannot access items before vault has been loaded. Please refresh the vault first");for(var e=0;e!=this.items.length;e++)if(this.items[e].itemKey==a)return this.items[e];
  85. return null};this.count=function(a){if(null==b)throw new PlayerIOError(PlayerIOErrorCode.VaultNotLoaded,"Cannot access items before vault has been loaded. Please refresh the vault first");for(var e=0,c=0;c!=this.items.length;c++)this.items[c].itemKey==a&&e++;return e};this.refresh=function(a,e){g.payVaultRefresh(b,null,a,e,function(a){d(a.vaultcontents)})};this.readHistory=function(a,b,c,f){g.payVaultReadHistory(a,b,null,c,f,function(a){for(var b=[],e=0;e!=a.entries.length;e++){var c=a.entries[e];
  86. b.push(new _pio.payVaultHistoryEntry(c.type,c.amount,c.timestamp,c.itemkeys||[],c.reason,c.providertransactionid,c.providerprice))}return b})};this.credit=function(a,b,c,f){g.payVaultCredit(a,b,null,c,f,function(a){d(a.vaultcontents)})};this.debit=function(a,b,c,f){g.payVaultDebit(a,b,null,c,f,function(a){d(a.vaultcontents)})};this.consume=function(a,b,c){if("object"==typeof a||a.length){for(var e=[],k=0;k!=a.length;k++){var l=a[k].id;if(l)e.push(l);else{a=_pio.error("No PayVault item id found on item#"+
  87. k+". You have to use items from the payVault.items array. For instance: client.payVault.consume([client.payVault.first('sportscar')], ...)");_pio.handleError(a,c,a.code,a.message);return}}g.payVaultConsume(e,null,b,c,function(a){d(a.vaultcontents)})}else a=_pio.error("The first argument to consume should be an array: client.payVault.consume([item], ...)"),_pio.handleError(a,c,a.code,a.message)};this.buy=function(a,b,c,f){g.payVaultBuy(_pio.convertBuyItems(a),b,null,c,f,function(a){d(a.vaultcontents)})};
  88. this.give=function(a,b,c){g.payVaultGive(_pio.convertBuyItems(a),null,b,c,function(a){d(a.vaultcontents)})};this.getBuyCoinsInfo=function(a,b,c,f){g.payVaultPaymentInfo(a,_pio.convertToKVArray(b),null,c,f,function(a){return _pio.convertFromKVArray(a.providerarguments)})};this.getBuyDirectInfo=function(a,b,c,f,d){g.payVaultPaymentInfo(a,_pio.convertToKVArray(b),_pio.convertBuyItems(c),f,d,function(a){return _pio.convertFromKVArray(a.providerarguments)})};var c=this};_pio.convertBuyItems=function(g){if(null==
  89. g)return[];for(var d=[],b=0;b!=g.length;b++){var c=g[b].itemkey;if(!c)throw _pio.error("You have to specify an itemkey for the payvault item. Example: {itemkey:'car'}");d.push({itemkey:c,payload:_pio.compareForChanges({itemkey:c},g[b],!0,!0)})}return d};_pio.vaultItem=function(g,d,b){this.id=g;this.itemKey=d;this.purchaseDate=b};_pio.payVaultHistoryEntry=function(g,d,b,c,a,e,k){this.type=g;this.amount=d;this.timestamp=(new Date).setTime(b);this.itemKeys=c;this.reason=a;this.providerTransactionId=
  90. e;this.providerPrice=k}})();
  91. (function(){_pio.bigDB=function(g){function d(){for(var b=0;b<a.length;b++){var c=a[b],f=!0,d;for(d in c.objects)if(c.objects[d]._internal_("get-is-saving")){f=!1;break}if(f){for(d in c.objects)for(f=b+1;f<a.length;f++){futureSave=a[f];for(var g=0;g<futureSave.objects.length;g++)futureSave.objects[g]==c.objects[d]&&futureSave.fullOverwrite==c.fullOverwrite&&futureSave.useOptimisticLock==c.useOptimisticLock&&(c.changesets[d]=futureSave.changesets[g],c.futureSaves.push(futureSave))}a.splice(b,1);b--;
  92. c.execute()}}}function b(a,b){null==a?a=[]:a instanceof Array||(a=[a]);null!=b&&(a=a.concat([b]));for(var c=[],e=0;e!=a.length;e++){var k=a[e];switch(typeof k){case "boolean":c.push({valuetype:_pio.ValueType.Bool,bool:k});break;case "string":c.push({valuetype:_pio.ValueType.String,string:k});break;case "number":0!=k%1?c.push({valuetype:_pio.ValueType.Double,"double":k}):-2147483648<k&&2147483647>k?c.push({valuetype:_pio.ValueType.Int,"int":k}):0<k&&4294967295>k?c.push({valuetype:_pio.ValueType.UInt,
  93. uint:k}):c.push({valuetype:_pio.ValueType.Long,"long":k});break;case "object":if(k.getTime&&k.getMilliseconds)c.push({valuetype:_pio.ValueType.DateTime,datetime:k.getTime()});else throw Error("Don't know how to serialize type '"+typeof k+"' for BigDB");break;default:throw Error("Don't know how to serialize type '"+typeof k+"' for BigDB");}}return c}var c=this,a=[];this.createObject=function(a,b,f,d,l){var e=_pio.compareForChanges({},f||{},!0,!0);g.createObjects([{key:b,table:a,properties:e}],!1,d,
  94. l,function(b){if(1==b.objects.length)return new _pio.databaseobject(c,a,b.objects[0].key,b.objects[0].version,!1,e);throw new PlayerIOError(PlayerIOErrorCode.GeneralError,"Error creating object");})};this.loadMyPlayerObject=function(a,b){g.loadMyPlayerObject(a,b,function(a){return new _pio.databaseobject(c,"PlayerObjects",a.playerobject.key,a.playerobject.version,!0,a.playerobject.properties)})};this.load=function(a,b,f,d){g.loadObjects([{table:a,keys:[b]}],f,d,function(b){if(1==b.objects.length)return null==
  95. b.objects[0]?null:new _pio.databaseobject(c,a,b.objects[0].key,b.objects[0].version,!1,b.objects[0].properties);throw new PlayerIOError(PlayerIOErrorCode.GeneralError,"Error loading object");})};this.loadKeys=function(a,b,f,d){g.loadObjects([{table:a,keys:b}],f,d,function(b){for(var e=[],f=0;f!=b.objects.length;f++){var k=b.objects[f];e[f]=null==k?null:new _pio.databaseobject(c,a,k.key,k.version,!1,k.properties)}return e})};this.loadOrCreate=function(a,b,f,d){g.createObjects([{key:b,table:a,properties:[]}],
  96. !0,f,d,function(b){if(1==b.objects.length)return new _pio.databaseobject(c,a,b.objects[0].key,b.objects[0].version,!1,b.objects[0].properties);throw new PlayerIOError(PlayerIOErrorCode.GeneralError,"Error creating object");})};this.deleteKeys=function(a,b,c,d){g.deleteObjects([{table:a,keys:b}],c,d,function(a){return null})};this.loadKeysOrCreate=function(a,b,f,d){for(var e=[],k=0;k!=b.length;k++)e.push({key:b[k],table:a,properties:[]});g.createObjects(e,!0,f,d,function(b){for(var e=[],f=0;f!=b.objects.length;f++){var k=
  97. b.objects[f];e[f]=new _pio.databaseobject(c,a,k.key,k.version,!1,k.properties)}return e})};this.loadSingle=function(a,k,f,d,l){g.loadMatchingObjects(a,k,b(f),1,d,l,function(b){return 0==b.objects.length?null:new _pio.databaseobject(c,a,b.objects[0].key,b.objects[0].version,!1,b.objects[0].properties)})};this.loadRange=function(a,k,f,d,l,p,A,u){g.loadIndexRange(a,k,b(f,d),b(f,l),p,A,u,function(b){for(var e=[],f=0;f!=b.objects.length;f++){var k=b.objects[f];e[f]=null==k?null:new _pio.databaseobject(c,
  98. a,k.key,k.version,!1,k.properties)}return e})};this.deleteRange=function(a,c,f,d,l,p,A){g.deleteIndexRange(a,c,b(f,d),b(f,l),p,A,function(){})};this.saveChanges=function(b,c,f,n,l,p){var e=1==p;p=[];for(var k in f){var w=f[k];if(!(w.existsInDatabase&&w.key&&w.table&&w._internal_&&w.save)){b=_pio.error("You can only save database objects that exist in the database");_pio.handleError(b,l,b.code,b.message);return}var I=_pio.compareForChanges(c?{}:w._internal_("get-dbCurrent"),w,!0,!0);(c||0<I.length)&&
  99. p.push({key:w._internal_("get-key"),table:w._internal_("get-table"),fulloverwrite:c,onlyifversion:b?w._internal_("get-version"):null,changes:I})}a.push({objects:f,changesets:p,fullOverwrite:c,useOptimisticLock:b,futureSaves:[],setIsSavingOnAll:function(a){for(var b=0;b!=this.objects.length;b++)this.objects[b]._internal_("set-is-saving",a)},done:function(){this.setIsSavingOnAll(!1);d()},execute:function(){var a=this;a.setIsSavingOnAll(!0);0<a.changesets.length?g.saveObjectChanges(_pio.LockType.LockAll,
  100. a.changesets,e,n,function(b){a.done();_pio.handleError(b,l,b.code,b.message)},function(b){for(var c=0;c!=a.objects.length;c++){var e=a.objects[c];e._internal_("set-version",b.versions[c]);e._internal_("change-dbCurrent",a.changesets[c].changes);for(var f=0;f!=a.futureSaves.length;f++)for(var d=a.futureSaves[f],k=0;k<d.objects.length;k++)d.objects[k]==e&&(d.changesets.splice(k,1),d.objects.splice(k,1),k--)}a.done()}):(a.done(),setTimeout(n,1))}});d()}};_pio.databaseobject=function(g,d,b,c,a,e){var k=
  101. {},f=!1;_pio.bigDBDeserialize(e,k,!0);this.table=d;this.key=b;this.existsInDatabase=!0;this.save=function(b,c,e,f){g.saveChanges(b,c,[this],e,f,a)};this._internal_=function(a,e){switch(a){case "get-table":return d;case "get-key":return b;case "set-is-saving":f=e;case "get-is-saving":return f;case "get-version":return c;case "set-version":c=e;case "get-dbCurrent":return k;case "change-dbCurrent":_pio.bigDBDeserialize(e,k,!0)}};_pio.bigDBDeserialize(e,this,!0)};_pio.compareForChanges=function(g,d,b,
  102. c){var a=[],e;for(e in d){var k=d[e],f=g?g[e]:null;switch(e){case "table":if(c)continue;case "key":if(c)continue;case "save":if(c)continue;case "existsInDatabase":if(c)continue;case "_internal_":if(c)continue;case "_circular_reference_finder_":continue}if(null!=k){var n=b?{name:e}:{index:parseInt(e)};switch(typeof k){case "boolean":k!=f&&(n.value={valuetype:_pio.ValueType.Bool,bool:k},a.push(n));break;case "number":k!=f&&(isFinite(k)&&Math.floor(k)===k?n.value=-2147483648<=k&&2147483647>=k?{valuetype:_pio.ValueType.Int,
  103. "int":k}:0<k&&4294967295>=k?{valuetype:_pio.ValueType.UInt,uint:k}:-0x7ffffffffffffc00<=k&&0x7ffffffffffffc00>=k?{valuetype:_pio.ValueType.Long,"long":k}:0<k&&1.844674407370955E19>=k?{valuetype:_pio.ValueType.ULong,ulong:k}:{valuetype:_pio.ValueType.Double,"double":k}:n.value={valuetype:_pio.ValueType.Double,"double":k},a.push(n));break;case "string":k!=f&&(n.value={valuetype:_pio.ValueType.String,string:k},a.push(n));break;case "object":if(k.getTime&&k.getMilliseconds)k+""!=f+""&&(n.value={valuetype:_pio.ValueType.DateTime,
  104. datetime:k.getTime()},a.push(n));else{if(k._circular_reference_finder_)throw new PlayerIOError(PlayerIOErrorCode.CircularReference,"The object you're trying to save contains a circular reference for "+(b?"a property named":"the array entry")+"): "+e);k._circular_reference_finder_=!0;var l=k instanceof Array;if(l&&k.bytearray){l=Array(k.length);for(f=0;f!=l.length;f++){var p=k[f];if(0<=p&&255>=p)l[f]=p;else throw new PlayerIOError(PlayerIOErrorCode.GeneralError,"The bytearray property '"+e+"' was supposed to only contain byte (0-255) values, but contained the value: "+
  105. p);}n.value={valuetype:_pio.ValueType.ByteArray,bytearray:l}}else f=_pio.compareForChanges(f,k,!l,!1),n.value=l?{valuetype:_pio.ValueType.Array,arrayproperties:f}:{valuetype:_pio.ValueType.Obj,objectproperties:f};a.push(n);delete k._circular_reference_finder_}break;case "undefined":break;case "function":break;default:throw Error("Don't know how to serialize type '"+typeof k+"' for BigDB");}}}for(e in g)null!=d[e]&&"undefined"!=typeof d[e]||a.push(b?{name:e}:{index:parseInt(e)});return a};_pio.bigDBDeserialize=
  106. function(g,d,b){for(var c in g){var a=g[c],e=b?a.name:a.index||0;if(a=a.value)switch(a.valuetype||0){case _pio.ValueType.String:d[e]=a.string||"";break;case _pio.ValueType.Int:d[e]=a["int"]||0;break;case _pio.ValueType.UInt:d[e]=a.uint||0;break;case _pio.ValueType.Long:d[e]=a["long"]||0;break;case _pio.ValueType.Bool:d[e]=a.bool||0;break;case _pio.ValueType.Float:d[e]=a["float"]||0;break;case _pio.ValueType.Double:d[e]=a["double"]||0;break;case _pio.ValueType.ByteArray:d[e]=a.bytearray;d[e].bytearray=
  107. !0;break;case _pio.ValueType.DateTime:d[e]=new Date(a.datetime||0);break;case _pio.ValueType.Array:var k=d[e]instanceof Array?d[e]:[];_pio.bigDBDeserialize(a.arrayproperties,k,!1);d[e]=k;break;case _pio.ValueType.Obj:k="object"==typeof d[e]?d[e]:{},_pio.bigDBDeserialize(a.objectproperties,k,!0),d[e]=k}else delete d[e]}}})();
  108. (function(){_pio.multiplayer=function(b){var c=this;this.developmentServer=null;this.useSecureConnections=!1;this.createRoom=function(a,e,k,f,d,g){b.createRoom(a,e,k,_pio.convertToKVArray(f),null!=c.developmentServer,d,g,function(a){return a.roomid})};this.joinRoom=function(a,e,d,f){clearTimeout(setTimeout(function(){d(new _pio.connection)},1E4));var k=Error();b.joinRoom(a,_pio.convertToKVArray(e),null!=c.developmentServer,function(){},f,function(a){return new _pio.connection(k,c.developmentServer,
  109. c.useSecureConnections,a.endpoints,a.joinkey,e||{},d,f)})};this.createJoinRoom=function(a,e,d,f,g,l,p){clearTimeout(setTimeout(function(){l(new _pio.connection)},1E4));var k=Error();b.createJoinRoom(a,e,d,_pio.convertToKVArray(f),_pio.convertToKVArray(g),null!=c.developmentServer,function(){},p,function(a){return new _pio.connection(k,c.developmentServer,c.useSecureConnections,a.endpoints,a.joinkey,g||{},l,p)})};this.listRooms=function(a,e,d,f,g,l){b.listRooms(a,_pio.convertToKVArray(e),d,f,null!=
  110. c.developmentServer,g,l,function(a){var b=[];if(a.rooms&&0<a.rooms.length)for(var c=0;c!=a.rooms.length;c++){var e=a.rooms[c];b.push(new _pio.roomInfo(e.id,e.roomtype,e.onlineusers,_pio.convertFromKVArray(e.roomdata)))}return b})}};_pio.websocketConnection=function(b,c,a,e,d,f,g){var k=this,p=!1,n=new _pio.messageSerializer,u=!1,w=null;c=(c?"wss://":"ws://")+a+"/";try{w="undefined"!=typeof MozWebSocket?new MozWebSocket(c):new WebSocket(c)}catch(y){d(!1,""+y);return}var I=setTimeout(function(){p||
  111. (p=!0,d(!1,"Connect attempt timed out"))},e);w.onopen=function(){p||(clearTimeout(I),u=p=!0,d(u))};w.onclose=function(a){k.disconnect()};w.onerror=function(a){k.disconnect()};w.onmessage=function(a){if(u)if(b){var c=new FileReader;c.onloadend=function(){for(var a=new Uint8Array(c.result),b=Array(a.length),e=0;e!=a.length;e++)b[e]=a[e];g(n.deserializeMessage(b,0,b.length))};c.readAsArrayBuffer(a.data)}else a=_pio.base64decode(a.data),g(n.deserializeMessage(a,0,a.length))};this.disconnect=function(){if(u){u=
  112. !1;f();try{w.close()}catch(y){_pio.debugLog(y)}}};this.sendMessage=function(a){a=n.serializeMessage(a);if(b){for(var c=new Uint8Array(a.length),e=0;e<a.length;e++)c[e]=a[e];w.send(c.buffer)}else a=_pio.base64encode(a),w.send(a)}};_pio.connection=function(b,c,a,e,d,f,g,l){function k(k){function p(){if(0<r.length){var c=r[0];r.splice(0,1);var e=k(a,c,4E3,function(a,b){if(a){F=e;n.connected=!0;var k=n.createMessage("join");k.addString(d);if(null!=f)for(var g in f)k.addString(g),k.addString(""+f[g]);
  113. n.sendMessage(k)}else _pio.debugLog("Unable to connect to endpoint: "+c+'. reason: "'+b+(0<r.length?'". Trying next endpoint.':'". No more endpoints to try.')),p()},function(a){n.connected&&(n.connected=!1,setTimeout(function(){for(var a=0;a!=w.length;a++)_pio.runCallback(w[a].callback,n,w[a].stackSource)},100))},function(a){u?"playerio.joinresult"==a.type?(u=!1,a.getBoolean(0)?_pio.runCallback(g,n,null):_pio.handleError(b,l,a.getInt(1),a.getString(2))):_pio.handleError(b,l,PlayerIOErrorCode.GeneralError,
  114. "The expected inital messagetype is: playerio.joinresult, received: "+joinResult.getType()):(A(a.type,a),A("*",a))})}else _pio.handleError(b,l,PlayerIOErrorCode.GeneralError,"Could not establish a socket connection to any of the given endpoints for the room")}function A(a,b){var c=I[a];if(c)for(var e=0;e<c.length;e++)_pio.runCallback(c[e].callback,b,c[e].stackSource)}var r=[];if(c)r.push(c);else for(var x=0;x!=e.length;x++)r.push(e[x].address+":"+e[x].port);p()}var n=this,u=!0,w=[],I={},y=[],F=null,
  115. x=/(WebKit|Firefox|Trident)\/([0-9]+)/gi.exec(navigator.userAgent),M=x&&3<=x.length?x[1]:null,x=x&&3<=x.length?parseInt(x[2]):null;window.FileReader&&"WebKit"==M&&535<=x||"Firefox"==M&&11<=x||"Trident"==M&&6<=x?k(function(a,b,c,e,f,d){return new _pio.websocketConnection(!0,a,b,c,e,f,d)}):_pio.isFlashFallbackEnabled(function(a){a?k(function(a,b,c,e,f,d){return new _pio.flashSocketConnection(b,c,e,f,d)}):k(function(a,b,c,e,f,d){return new _pio.websocketConnection(!1,a,b,c,e,f,d)})});this.connected=
  116. !1;this.addDisconnectCallback=function(a){w.push({callback:a,stackSourc:Error()})};this.addMessageCallback=function(a,b){null==a&&(a="*");var c=I[a];c||(I[a]=c=[]);c.push({callback:b,stackSource:Error()})};this.removeDisconnectCallback=function(a){for(var b=0;b<w.length;b++)w[b].callback==a&&(w.splice(b,1),b--)};this.removeMessageCallback=function(a){for(var b in I)for(var c=I[b],e=0;e<c.length;e++)c[e].callback==a&&(c.splice(e,1),e--)};this.createMessage=function(a){for(var b=new _pio.message(a),
  117. c=1;c<arguments.length;c++)b.add(arguments[c]);return b};this.send=function(a){var b=this.createMessage.apply(this,arguments);this.sendMessage(b)};this.sendMessage=function(a){n.connected?F.sendMessage(a):y.push(a)};this.disconnect=function(){n.connected&&F.disconnect()}};_pio.message=function(b){function c(a,b,c,e){if(a)l.push(b),g.push(c),f.length=l.length;else throw _pio.error("The given value ("+b+") is not "+e);}function a(a,b){if(a>l.length)throw _pio.error("this message ("+f.type+") only has "+
  118. l.length+" entries");if(g[a]==b)return l[a];throw _pio.error("Value at index:"+a+" is a "+e(g[a])+" and not a "+e(b)+" as requested. The value is: "+l[a]);}function e(a){return{0:"Integer",1:"Unsigned Integer",2:"Long",3:"Unsigned Long",4:"Double",5:"Float",6:"String",7:"ByteArray",8:"Boolean"}[a]}function d(a){var b="object"==typeof a&&"undefined"!=typeof a.length;if(b)for(var c=0;c!=a.length;c++)if(255<a[c]||0>a[c]){b=!1;break}return b}var f=this,g=[],l=[];this.type=b;this.length=0;this.add=function(){for(var a=
  119. 0;a<arguments.length;a++){var b=arguments[a];switch(typeof b){case "string":f.addString(b);break;case "boolean":f.addBoolean(b);break;case "number":if(isFinite(b)&&Math.floor(b)===b)if(-2147483648<=b&&2147483647>=b){f.addInt(b);break}else if(0<b&&4294967295>=b){f.addUInt(b);break}else if(-0x7ffffffffffffc00<=b&&0x7ffffffffffffc00>=b){f.addLong(b);break}else if(0<b&&1.844674407370955E19>=b){f.addULong(b);break}f.addDouble(b);break;case "object":if(d(b)){this.addByteArray(b);break}default:throw _pio.error("The type of the value ("+
  120. b+") cannot be inferred");}}};this.addInt=function(a){c(-2147483648<=a&&2147483647>=a,Math.trunc(a),0,"an integer (32bit)")};this.addUInt=function(a){c(0<=a&&4294967295>=a,Math.trunc(a),1,"an unsigned integer (32bit)")};this.addLong=function(a){c(-0x7ffffffffffffc00<=a&&0x7ffffffffffffc00>=a,Math.trunc(a),2,"a long (64bit)")};this.addULong=function(a){c(0<=a&&1.844674407370955E19>=a,a,3,"an unsigned long (64bit)")};this.addBoolean=function(a){c(!0,a?!0:!1,8,"a boolean value")};this.addFloat=function(a){c(!0,
  121. Number(a),5,"a floating point value (32bit)")};this.addDouble=function(a){c(!0,Number(a),4,"a double floating point value (64bit)")};this.addByteArray=function(a){c(d(a),a,7,"a bytearray")};this.addString=function(a){c(!0,a+"",6,"a string")};this.getInt=function(b){return a(b,0)};this.getUInt=function(b){return a(b,1)};this.getLong=function(b){return a(b,2)};this.getULong=function(b){return a(b,3)};this.getBoolean=function(b){return a(b,8)};this.getDouble=function(b){return a(b,4)};this.getFloat=
  122. function(b){return a(b,5)};this.getByteArray=function(b){return a(b,7)};this.getString=function(b){return a(b,6)};this.toString=function(){for(var a="msg.Type = "+this.type+"",b=0;b!=this.length;b++)a+=", msg["+b+"] = "+l[b]+" ("+e(g[b])+")";return a};this._internal_=function(a,b){switch(a){case "get-objects":return l;case "get-types":return g}}};_pio.roomInfo=function(b,c,a,e){this.id=b;this.roomType=c;this.onlineUsers=a;this.roomData=e};_pio.byteWriter=function(){this.bytes=[];this.writeByte=function(b){if(0<=
  123. b&&255>=b)this.bytes.push(b);else throw Error("This is not a byte value: "+b);};this.writeBytes=function(b){for(var c=0;c!=b.length;c++)this.writeByte(b[c])};this.writeTagWithLength=function(b,c,a){63<b||0>b?this.writeBottomPatternAndBytes(a,_pio.binaryserializer.bytesFromInt(b)):this.writeByte(c|b)};this.writeBottomPatternAndBytes=function(b,c){var a=0;0!=c[0]?a=3:0!=c[1]?a=2:0!=c[2]&&(a=1);this.writeByte(b|a);for(a=c.length-a-1;a!=c.length;a++)this.writeByte(c[a])};this.writeLongPattern=function(b,
  124. c,a){for(var e=0,d=0;7!=d;d++)if(0!=a[d]){e=7-d;break}3<e?this.writeByte(c|e-4):this.writeByte(b|e);for(d=a.length-e-1;d!=a.length;d++)this.writeByte(a[d])}};_pio.messageSerializer=function(){this.serializeMessage=function(b){var c=new _pio.byteWriter;c.writeTagWithLength(b.length,128,4);var a=_pio.binaryserializer.bytesFromString(b.type);c.writeTagWithLength(a.length,192,12);c.writeBytes(a);for(var e=0;e!=b.length;e++)switch(a=b._internal_("get-objects")[e],b._internal_("get-types")[e]){case 6:a=
  125. _pio.binaryserializer.bytesFromString(a);c.writeTagWithLength(a.length,192,12);c.writeBytes(a);break;case 0:c.writeTagWithLength(a,128,4);break;case 1:c.writeBottomPatternAndBytes(8,_pio.binaryserializer.bytesFromUInt(a));break;case 2:c.writeLongPattern(48,52,_pio.binaryserializer.bytesFromLong(a));break;case 3:c.writeLongPattern(56,60,_pio.binaryserializer.bytesFromULong(a));break;case 7:c.writeTagWithLength(a.length,64,16);c.writeBytes(a);break;case 4:c.writeByte(3);c.writeBytes(_pio.binaryserializer.bytesFromDouble(a));
  126. break;case 5:c.writeByte(2);a=_pio.binaryserializer.bytesFromFloat(a);c.writeBytes(a);break;case 8:c.writeByte(a?1:0)}return c.bytes};this.deserializeMessage=function(b,c,a){var e=c;c+=a;a=null;for(var d=0;e<c;){var f=0,g=0,l=b[e];e++;var p=l&192;0==p&&(p=l&60,0==p&&(p=l));switch(p){case 12:case 16:f=(l&3)+1;if(e+f>c)throw Error("Unexpected: Unfinished message");l=f;f=_pio.binaryserializer.intFromBytes(b,e,f);e+=l;break;case 192:f=l&63;break;case 128:g=l&63;break;case 64:f=l&63;break;case 4:case 8:case 48:case 56:f=
  127. (l&3)+1;break;case 52:case 60:f=(l&3)+5;break;case 3:f=8;break;case 2:f=4}if(e+f>c)throw Error("Unexpected: Unfinished message");switch(p){case 12:case 192:null==a?(a=new _pio.message(_pio.binaryserializer.stringFromBytes(b,e,f)),d++):a.addString(_pio.binaryserializer.stringFromBytes(b,e,f));break;case 4:g=_pio.binaryserializer.intFromBytes(b,e,f);case 128:0==d?d=g:a.addInt(g);break;case 16:case 64:a.addByteArray(b.slice(e,e+f));break;case 8:a.addUInt(_pio.binaryserializer.uintFromBytes(b,e,f));break;
  128. case 48:case 52:a.addLong(_pio.binaryserializer.longFromBytes(b,e,f));break;case 56:case 60:a.addULong(_pio.binaryserializer.ulongFromBytes(b,e,f));break;case 3:a.addDouble(_pio.binaryserializer.doubleFromBytes(b,e,f));break;case 2:a.addFloat(_pio.binaryserializer.floatFromBytes(b,e,f));break;case 1:a.addBoolean(!0);break;case 0:a.addBoolean(!1)}e+=f;if(null!=a&&0==--d)return a}throw Error("Unexpected: Misaligned message");}};_pio.binaryserializer={pow2:function(b){return 0<=b&&31>b?1<<b:this.pow2[b]||
  129. (this.pow2[b]=Math.pow(2,b))},_intEncode:function(b,c){if(4==c)var a=[b>>>24&255,b>>>16&255,b>>>8&255,b&255];else{if(0<=b){a=Math.floor(b/this.pow2(32));var e=b-a*this.pow2(32)}else a=Math.floor(b/this.pow2(32)),e=b-a*this.pow2(32),a+=this.pow2(32);a=[a>>>24&255,a>>>16&255,a>>>8&255,a&255,e>>>24&255,e>>>16&255,e>>>8&255,e&255]}return a},_floatEncode:function(b,c,a){var e=0>b?1:0,d,f=~(-1<<a-1),g=1-f;0>b&&(b=-b);0===b?b=d=0:isNaN(b)?(d=2*f+1,b=1):Infinity===b?(d=2*f+1,b=0):(d=Math.floor(Math.log(b)/
  130. Math.LN2),d>=g&&d<=f?(b=Math.floor((b*this.pow2(-d)-1)*this.pow2(c)),d+=f):(b=Math.floor(b/this.pow2(g-c)),d=0));for(f=[];8<=c;)f.push(b%256),b=Math.floor(b/256),c-=8;d=d<<c|b;for(a+=c;8<=a;)f.push(d&255),d>>>=8,a-=8;f.push(e<<a|d);f.reverse();return f},bytesFromString:function(b){for(var c=[],a=0;a<b.length;a++)if(127>=b.charCodeAt(a))c.push(b.charCodeAt(a));else for(var e=encodeURIComponent(b.charAt(a)).substr(1).split("%"),d=0;d<e.length;d++)c.push(parseInt(e[d],16));return c},bytesFromInt:function(b){return this._intEncode(b,
  131. 4)},bytesFromUInt:function(b){return this._intEncode(b,4)},bytesFromLong:function(b){return this._intEncode(b,8)},bytesFromULong:function(b){return this._intEncode(b,8)},bytesFromFloat:function(b){return this._floatEncode(b,23,8)},bytesFromDouble:function(b){return this._floatEncode(b,52,11)},_intDecode:function(b,c,a,e,d){var f=c+a-1;c=d&&a==e&&b[c]&128;e=0;d=1;for(var g=0;g<a;g++){var k=b[f-g];c&&(k=(k^255)+d,d=k>>8,k&=255);e+=k*this.pow2(8*g)}return c?-e:e},_float32Decode:function(b,c){var a=b.slice(c,
  132. c+4).reverse(),e=1-2*(a[3]>>7),d=(a[3]<<1&255|a[2]>>7)-127,a=(a[2]&127)<<16|a[1]<<8|a[0];return 128===d?0!==a?NaN:Infinity*e:-127===d?e*a*this.pow2(-149):e*(1+a*this.pow2(-23))*this.pow2(d)},_float64Decode:function(b,c){var a=b.slice(c,c+8).reverse(),e=1-2*(a[7]>>7),d=((a[7]<<1&255)<<3|a[6]>>4)-1023,a=(a[6]&15)*this.pow2(48)+a[5]*this.pow2(40)+a[4]*this.pow2(32)+a[3]*this.pow2(24)+a[2]*this.pow2(16)+a[1]*this.pow2(8)+a[0];return 1024===d?0!==a?NaN:Infinity*e:-1023===d?e*a*this.pow2(-1074):e*(1+a*
  133. this.pow2(-52))*this.pow2(d)},stringFromBytes:function(b,c,a){for(var e="",d=c;d<c+a;d++)e+=127>=b[d]?37===b[d]?"%25":String.fromCharCode(b[d]):"%"+b[d].toString(16).toUpperCase();return decodeURIComponent(e)},intFromBytes:function(b,c,a){return this._intDecode(b,c,a,4,!0)},uintFromBytes:function(b,c,a){return this._intDecode(b,c,a,4,!1)},longFromBytes:function(b,c,a){return this._intDecode(b,c,a,8,!0)},ulongFromBytes:function(b,c,a){return this._intDecode(b,c,a,8,!1)},floatFromBytes:function(b,c,
  134. a){return 4==a?this._float32Decode(b,c):NaN},doubleFromBytes:function(b,c,a){return 8==a?this._float64Decode(b,c):NaN}};for(var g=[],d=0;65!=d;d++)g["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charCodeAt(d)]=d;_pio.base64encode=function(b){for(var c=[],a=0;a<b.length;a++){var e=b[a],d=++a<=b.length?b[a]:NaN,f=++a<=b.length?b[a]:NaN,g=e>>2,e=(e&3)<<4|d>>4,l=(d&15)<<2|f>>6,p=f&63;isNaN(d)?l=p=64:isNaN(f)&&(p=64);c.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(g));
  135. c.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(e));c.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(l));c.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(p))}return c.join("")};_pio.base64decode=function(b){for(var c=[],a=0;a<b.length;a++){var e=g[b.charCodeAt(a)],d=++a<b.length?g[b.charCodeAt(a)]:64,f=++a<b.length?g[b.charCodeAt(a)]:64,n=++a<b.length?g[b.charCodeAt(a)]:64,l=(d&15)<<4|f>>2,p=(f&3)<<
  136. 6|n;c.push(e<<2|d>>4);64!=f&&(c.push(l),64!=n&&c.push(p))}return c}})();
  137. (function(){_pio.achievements=function(g){function d(a,b){var e=new _pio.achievement(a.identifier,a.title,a.description,a.imageurl,a.progress,a.progressgoal,a.lastupdated);if("string"!==typeof c.myAchievements)for(var d=0;d<c.myAchievements.length;d++)c.myAchievements[d].id==e.id&&(c.myAchievements[d]=e,c.currentVersion=null);if(b)for(d=0;d<c.onCompleteHandlers.length;d++)(0,c.onCompleteHandlers[d])(e);return e}var b=null;this.myAchievements="[ERROR: You tried to access achievements.myAchievements before loading them. You have to call the refresh method first.]";
  138. this.onCompleteHandlers=[];var c=this;this.addOnComplete=function(a){if("function"===typeof a&&1==a.length)c.onCompleteHandlers.push(a);else throw new PlayerIOError(PlayerIOErrorCode.InvalidArgument,"Expects argument to be a function that takes an achievement as an argument.");};this.get=function(a){if("string"===typeof c.myAchievements)return null;for(var b=0;b<c.myAchievements.length;b++)if(c.myAchievements[b].id==a)return c.myAchievements[b];return null};this.refresh=function(a,e){g.achievementsRefresh(b,
  139. a,e,function(a){if(b!=a.version)if(b=a.version,null==a.achievements||0==a.achievements.length)c.myAchievements=[];else{for(var e=[],d=0;d<a.achievements.length;d++){var g=a.achievements[d];e.push(new _pio.achievement(g.identifier,g.title,g.description,g.imageurl,g.progress,g.progressgoal,g.lastupdated))}c.myAchievements=e}})};this.load=function(a,b,c){"object"==typeof a||requests.length?g.achievementsLoad(a,b,c,function(a){if(null==a||0==a.length)return{};for(var b={},c=0;c<a.userachievements.length;c++){for(var e=
  140. a.userachievements[c],d=[],f=0;f<e.achievements.length;f++){var g=e.achievements[f];d.push(new _pio.achievement(g.identifier,g.title,g.description,g.imageurl,g.progress,g.progressgoal,g.lastupdated))}b[e.userid]=d}return b}):(a=_pio.error("The first argument to load should be an array: client.achievements.load(['user1', 'user2', ...], ...)"),_pio.handleError(a,c,a.code,a.message))};this.progressSet=function(a,b,c,f){g.achievementsProgressSet(a,b,c,f,function(a){return d(a.achievement,a.completednow)})};
  141. this.progressAdd=function(a,b,c,f){g.achievementsProgressAdd(a,b,c,f,function(a){return d(a.achievement,a.completednow)})};this.progressMax=function(a,b,c,f){g.achievementsProgressMax(a,b,c,f,function(a){return d(a.achievement,a.completednow)})};this.progressComplete=function(a,b,c){g.achievementsProgressComplete(a,b,c,function(a){return d(a.achievement,a.completednow)})}};_pio.achievement=function(g,d,b,c,a,e,k){this.id=g;this.title=d;this.description=b;this.imageUrl=c;this.progress="undefined"===
  142. typeof a?0:a;this.progressGoal=e;this.lastUpdated=new Date(1E3*k);this.progressRatio=this.progress/this.progressGoal;this.completed=this.progress==this.progressGoal}})();
  143. (function(){_pio.playerInsight=function(g){function d(c){b.playersOnline=-1==c.playersonline?"[ERROR: The current connection does not have the rights required to read the playersonline variable.]":c.playersonline;b.segments=_pio.convertFromKVArray(c.segments)}this.playersOnline="[ERROR: You tried to access playerInsight.playersOnline before loading it. You have to call the refresh method first.]";this.segments={};var b=this;this.refresh=function(b,a){g.playerInsightRefresh(b,a,function(a){d(a.state)})};
  144. this.setSegments=function(b,a,e){g.playerInsightSetSegments(_pio.convertToSegmentArray(b),a,e,function(a){d(a.state)})};this.trackInvitedBy=function(b,a,e,d){g.playerInsightTrackInvitedBy(b,a,e,d,function(a){})};this.trackEvent=function(b,a,e,d){g.playerInsightTrackEvents([{eventtype:b,value:a}],e,d,function(a){})};this.trackExternalPayment=function(b,a,e,d){g.playerInsightTrackExternalPayment(b,a,e,d,function(a){})};this.sessionKeepAlive=function(b,a){g.playerInsightSessionKeepAlive(b,a,function(a){})}}})();
  145. (function(){_pio.oneScore=function(g){this.percentile="[ERROR: You tried to access oneScore.percentile before loading the OneScore. You have to call the refresh method first.]";this.score="[ERROR: You tried to access oneScore.score before loading the OneScore. You have to call the refresh method first.]";this.topRank="[ERROR: You tried to access oneScore.topRank before loading the OneScore. You have to call the refresh method first.]";var d=this;this.refresh=function(b,c){g.oneScoreRefresh(b,c,function(a){a=
  146. new _pio.oneScoreValue(a.onescore.percentile,a.onescore.score,a.onescore.toprank);d.percentile=a.percentile;d.score=a.score;d.topRank=a.toprank})};this.set=function(b,c,a){g.oneScoreSet(b,c,a,function(a){a=new _pio.oneScoreValue(a.onescore.percentile,a.onescore.score,a.onescore.toprank);d.percentile=a.percentile;d.score=a.score;d.topRank=a.toprank;return a})};this.add=function(b,c,a){g.oneScoreAdd(b,c,a,function(a){a=new _pio.oneScoreValue(a.onescore.percentile,a.onescore.score,a.onescore.toprank);
  147. d.percentile=a.percentile;d.score=a.score;d.topRank=a.toprank;return a})};this.load=function(b,c,a){if("object"==typeof b||requests.length)g.oneScoreLoad(b,c,a,function(a){if(null==a||null==a.onescores||0==a.onescores.length)return[];for(var c=[],e=0,d=0;d<b.length;d++){var g=a.onescores[e];g&&b[d]==g.userid?(c.push(new _pio.oneScoreValue(g.percentile,g.score,g.toprank)),e++):c.push(null)}return c});else c=_pio.error("The first argument to load should be an array: client.oneScore.load(['user1', 'user2', ...], ...)"),
  148. _pio.handleError(c,a,c.code,c.message)}};_pio.oneScoreValue=function(g,d,b){this.percentile="undefined"===typeof g?0:g;this.score="undefined"===typeof d?0:d;this.topRank="undefined"===typeof b?0:b}})();
  149. (function(){_pio.notifications=function(g){function d(b){if(b.version!=a){var e=[];if(b.endpoints)for(var d=0;d!=b.endpoints.length;d++){var g=b.endpoints[d];e[d]=new _pio.notificationEndpoint(g.type,g.identifier,_pio.convertFromKVArray(g.configuration),g.enabled?!0:!1)}a=b.version;c.myEndpoints=e}}function b(a){var b=[];if(a&&0<a.length)for(var c=0;c!=a.length;c++){var e=a[c];e.type&&e.identifier&&b.push({type:e.type,identifier:e.identifier})}return b}this.myEndpoints="[ERROR: You tried to access notifications.myEndpoints before calling refresh.]";
  150. var c=this,a="";this.refresh=function(b,c){g.notificationsRefresh(a,b,c,d)};this.registerEndpoint=function(b,k,f,n,l,p){var e;a:{if(""!=a)for(e=0;e!=c.myEndpoints.length;e++){var u=c.myEndpoints[e];if(u.type==b&&u.identifier==k){e=u;break a}}e=null}(u=null==e||e.enabled!=n)||(u=JSON.stringify(e.configuration)!=JSON.stringify(f));u?g.notificationsRegisterEndpoints(a,[{type:b,identifier:k,configuration:_pio.convertToKVArray(f),enabled:n}],l,p,d):l&&l()};this.toggleEndpoints=function(c,k,f,n){c=b(c);
  151. 0<c.length?g.notificationsToggleEndpoints(a,c,k?!0:!1,f,n,d):f&&f()};this.deleteEndpoints=function(c,k,f){c=b(c);0<c.length?g.notificationsDeleteEndpoints(a,c,k,f,d):k&&k()};this.send=function(a,b,c){for(var e=[],d=0;d!=a.length;d++){var f=a[d],k={recipient:f.recipientUserId,endpointtype:f.endpointType,data:{}};0!=(k.recipient+"").length&&0!=(k.endpointtype+"").length||console.log("error");for(var u in f)"recipientUserId"!=u&&"endpointType"!=u&&(k.data[u]=f[u]);e[d]=k}0<e.length?g.notificationsSend(e,
  152. b,c,null):b&&b()}};_pio.notificationEndpoint=function(g,d,b,c){this.type=g;this.identifier=d;this.configuration=b;this.enabled=c}})();
  153. (function(){_pio.publishingNetwork=function(g,d){var b=this;this.profiles=new _pio.publishingNetworkProfiles(g);this.payments=new _pio.publishingNetworkPayments(g);this.relations=new _pio.publishingNetworkRelations(g,d,this);this.userToken="[ERROR: you tried to access publishingNetwork.userToken before calling publishingNetwork.refresh(callback)]";this.refresh=function(c,a){g.socialRefresh(c,a,function(a){b.userToken=a.myprofile.usertoken;b.profiles.myProfile=new _pio.publishingNetworkProfile(a.myprofile);
  154. "undefined"==typeof _pio.friendLookup&&(_pio.friendLookup={},_pio.blockedLookup={});var c=_pio.friendLookup[b.profiles.myProfile.userId],d=_pio.blockedLookup[b.profiles.myProfile.userId];c||d||(c=_pio.friendLookup[b.profiles.myProfile.userId]={},d=_pio.blockedLookup[b.profiles.myProfile.userId]={});b.relations.friends=[];for(var e=0;e!=a.friends.length;e++){var g=new _pio.publishingNetworkProfile(a.friends[e]);b.relations.friends.push(g);c[g.userId]=!0}for(e=0;e!=a.blocked.length;e++)d[a.blocked[e]]=
  155. !0})}};_pio.showDialog=function(g,d,b,c){if("undefined"==typeof window.PublishingNetwork)throw new PlayerIOError(PlayerIOErrorCode.PublishingNetworkNotAvailable,"PublishingNetwork.js was not found on the current page. You have to include the 'piocdn.com/publishingnetwork.js' on the containing page to show dialogs. See http://playerio.com/documentation/ for more information.");b.__apitoken__=d.token;window.PublishingNetwork.dialog(g,b,c)}})();
  156. (function(){_pio.publishingNetworkPayments=function(g){this.showBuyCoinsDialog=function(d,b,c,a){b||(b={});b.coinamount=d;g.payVaultPaymentInfo("publishingnetwork",_pio.convertToKVArray(b),null,function(b){_pio.showDialog("buy",g,b,function(b){b.error?a(new PlayerIOError(PlayerIOErrorCode.GeneralError,b.error)):c(b)})},a,function(a){return _pio.convertFromKVArray(a.providerarguments)})};this.showBuyItemsDialog=function(d,b,c,a){g.payVaultPaymentInfo("publishingnetwork",_pio.convertToKVArray(b||{}),
  157. _pio.convertBuyItems(d),function(b){_pio.showDialog("buy",g,b,function(b){b.error?a(new PlayerIOError(PlayerIOErrorCode.GeneralError,b.error)):c(b)})},a,function(a){return _pio.convertFromKVArray(a.providerarguments)})}}})();
  158. (function(){_pio.publishingNetworkProfiles=function(g){this.myProfile="[ERROR: you tried to access publishingNetworkProfiles.myProfile before calling publishingNetwork.refresh(callback)]";this.showProfile=function(d,b){_pio.showDialog("profile",g,{userId:d},b)};this.loadProfiles=function(d,b,c){g.socialLoadProfiles(d,b,c,function(a){for(var b=[],c=0;c!=d.length;c++){var f=d[c];b[c]=null;for(var g=0;g!=a.profiles.length;g++){var l=a.profiles[g];if(l&&l.userid==f){b[c]=new _pio.publishingNetworkProfile(a.profiles[g]);
  159. break}}}return b})}};_pio.publishingNetworkProfile=function(g){this.userId=g.userid;this.displayName=g.displayname;this.avatarUrl=g.avatarurl;this.lastOnline=new Date(g.lastonline);this.countryCode=g.countrycode}})();
  160. (function(){_pio.publishingNetworkRelations=function(g,d,b){this.friends="[ERROR: you tried to access publishingNetworkRelations.friends before calling publishingNetwork.refresh(callback)]";this.isFriend=function(b){if("undefined"!=typeof _pio.friendLookup&&"undefined"!=typeof _pio.friendLookup[d])return _pio.friendLookup[d][b]||!1;throw new PlayerIOError(PlayerIOErrorCode.PublishingNetworkNotLoaded,"Cannot access profile, friends, ignored before Publishing Network has been loaded. Please refresh Publishing Network first");
  161. };this.isBlocked=function(b){if("undefined"!=typeof _pio.blockedLookup&&"undefined"!=typeof _pio.blockedLookup[d])return _pio.blockedLookup[d][b]||!1;throw new PlayerIOError(PlayerIOErrorCode.PublishingNetworkNotLoaded,"Cannot access profile, friends, ignored before Publishing Network has been loaded. Please refresh Publishing Network first");};this.showRequestFriendshipDialog=function(b,a){_pio.showDialog("requestfriendship",g,{userId:b},a)};this.showRequestBlockUserDialog=function(c,a){_pio.showDialog("requestblockuser",
  162. g,{userId:c},function(){b.refresh(function(){a&&a()},function(){a&&a()})})};this.showFriendsManager=function(c){_pio.showDialog("friendsmanager",g,{},function(a){a.updated?b.refresh(function(){c&&c()},function(){c&&c()}):c&&c()})};this.showBlockedUsersManager=function(c){_pio.showDialog("blockedusersmanager",g,{},function(a){a.updated?b.refresh(function(){c&&c()},function(){c&&c()}):c&&c()})}}})();
  163. (function(g){function d(h,a){function b(){}b.prototype=h;var m=new b,c;for(c in a)m[c]=a[c];a.toString!==Object.prototype.toString&&(m.toString=a.toString);return m}function b(h,a){if(null==a)return null;null==a.__id__&&(a.__id__=ua++);var b;null==h.hx__closures__?h.hx__closures__={}:b=h.hx__closures__[a.__id__];null==b&&(b=function(){return b.method.apply(b.scope,arguments)},b.scope=h,b.method=a,h.hx__closures__[a.__id__]=b);return b}var c=function(h,a){a=a.split("u").join("");this.r=new RegExp(h,
  164. a)};c.__name__=!0;c.prototype={replace:function(h,a){return h.replace(this.r,a)},__class__:c};var a=function(){};a.__name__=!0;a.cca=function(h,a){var b=h.charCodeAt(a);if(b==b)return b};a.indexOf=function(h,a,b){var m=h.length;0>b&&(b+=m,0>b&&(b=0));for(;b<m;){if(h[b]===a)return b;b++}return-1};a.iter=function(h){return{cur:0,arr:h,hasNext:function(){return this.cur<this.arr.length},next:function(){return this.arr[this.cur++]}}};Math.__name__=!0;var e=function(){};e.__name__=!0;e.string=function(h){return G.__string_rec(h,
  165. "")};e.parseInt=function(h){var b=parseInt(h,10);0!=b||120!=a.cca(h,1)&&88!=a.cca(h,1)||(b=parseInt(h));return isNaN(b)?null:b};var k=function(){this._transforms=[];this._transform=[1,0,0,1,0,0]};k.__name__=!0;k.multiplyTransform=function(h,a){return[h[0]*a[0]+h[2]*a[1],h[1]*a[0]+h[3]*a[1],h[0]*a[2]+h[2]*a[3],h[1]*a[2]+h[3]*a[3],h[0]*a[4]+h[2]*a[5]+h[4],h[1]*a[4]+h[3]*a[5]+h[5]]};k.applyTransform=function(h,a,b){return new L(h[0]*a+h[2]*b+h[4],h[1]*a+h[3]*b+h[5])};k.prototype={getTransform:function(){return this._transform},
  166. setTransform:function(h,a,b,c,d,e){this._transform=[h,a,b,c,d,e]},save:function(){this._transforms.push(this._transform.slice(0))},restore:function(){var h=this._transforms.pop();this._transform=null!=h?h:[1,0,0,1,0,0]},transform:function(h,a,b,c,d,e){this._transform=k.multiplyTransform(this._transform,[h,a,b,c,d,e])},translate:function(a,b){this._transform=k.multiplyTransform(this._transform,[1,0,0,1,a,b])},scale:function(a,b){this._transform=k.multiplyTransform(this._transform,[a,0,0,b,0,0])},rotate:function(a){this._transform=
  167. k.multiplyTransform(this._transform,[Math.cos(a),Math.sin(a),-Math.sin(a),Math.cos(a),0,0])},equals:function(a){var h=this.getTransform();a=a.getTransform();return h[0]==a[0]&&h[1]==a[1]&&h[2]==a[2]&&h[3]==a[3]&&h[4]==a[4]&&h[5]==a[5]},__class__:k};var f=function(){};f.__name__=!0;f.set_stage=function(a){null==a.parent&&(f.stage=a);return f.stage};f.start=function(a,b,c,d,e,g){f.started||(f.width=b,f.height=c,f.background=d,f.loadedCallback=g,window.addEventListener("load",function(){f.setup(a);null!=
  168. e&&e();n.init();f.loop()}),f.started=!0)};f.setup=function(a){null==a&&(a=window.document.body);f.parent=a;var h=window.document.body;h.style.margin=h.style.padding="0";h.style.lineHeight="0";h.style.overflow="hidden";"transparent"!=f.background&&(h.style.background=f.background);f.c=window.document.createElement("canvas");f.c.width=f.width;f.c.height=f.height;a.appendChild(f.c);f.c.style.cursor="default";f.ctx=f.c.getContext("2d",null);f._renderSystem=new T(f.ctx);f._c2=window.document.createElement("canvas");
  169. f._c2.width=f.c.width;f._c2.height=f.c.height;f._ctx2=f._c2.getContext("2d");f.input=new ba(f.c);f.set_stage(new u);v.init();l._reset();f.input.addEventListener("click",f.onClick);f.input.addEventListener("mouseDown",f.onMouseDown);f.input.addEventListener("mouseUp",f.onMouseUp);f.input.addEventListener("move",f.onMouseMove)};f.loop=function(){f.updateMouseSprite();f.c.style.cursor=null!=f.mouseSprite&&f.mouseSprite.buttonMode?"pointer":"default";l._update();n.get_done()&&!f.wasLoaded&&null!=f.loadedCallback&&
  170. f.loadedCallback();f.wasLoaded=n.get_done();f.stage.cascadingCallback(function(a){a.trigger("enterFrame",null)});f.stage.cascadingCallback(function(a){a.trigger("exitFrame",null)});f.render();v.update();f.requestAnimationFrame(f.loop)};f.requestAnimationFrame=function(a){var h=window;(h=h.requestAnimationFrame||h.webkitRequestAnimationFrame||h.mozRequestAnimationFrame||h.oRequestAnimationFrame||h.msRequestAnimationFrame)?h(f.loop):window.setTimeout(a,16)};f.render=function(){f._renderSystem.setTransform(1,
  171. 0,0,1,0,0);f.ctx.clearRect(0,0,f.width,f.height);f.ctx.fillStyle=f.background;f.ctx.fillRect(0,0,f.width,f.height);null!=f.stage&&f.stage._paint(f._renderSystem)};f.updateMouseSprite=function(){if(null!=f.stage){var a=f.updateMouseSpriteStep(new k,f.stage,null);null==a&&(a=f.stage);f.mouseSprite=a;f.mouseSpriteBounds=null!=a?a.getBounds().copy():null;f.mouseSpriteTransform=f.getMouseSpriteTransform()}else f.mouseSprite=null};f.updateMouseSpriteStep=function(a,b,c){a.save();a.translate(b.x,b.y);a.rotate(b.rotation/
  172. 180*Math.PI);a.scale(b.scaleX,b.scaleY);b.mouseEnabled&&p.pointInTransformedBounds(new L(f.input.mouseX,f.input.mouseY),a.getTransform(),b.getBounds())&&(c=b);var h=0;for(b=b.children;h<b.length;){var m=b[h];++h;c=f.updateMouseSpriteStep(a,m,c)}a.restore();return c};f.getMouseSpriteTransform=function(){return null!=f.mouseSprite?f.mouseSprite.getTransform():null};f.onClick=function(a){f.updateMouseSprite();null!=f.clickSprite&&f.mouseSprite==f.clickSprite&&f.triggerMouseEvent(f.clickSprite,a.type,
  173. a)};f.onMouseDown=function(a){f.updateMouseSprite();f.clickSprite=f.mouseSprite;null!=f.mouseSprite&&f.triggerMouseEvent(f.mouseSprite,a.type,a)};f.onMouseUp=function(a){f.updateMouseSprite();null!=f.mouseSprite&&f.triggerMouseEvent(f.mouseSprite,a.type,a)};f.onMouseMove=function(a){f.updateMouseSprite();null!=f.mouseSprite&&f.triggerMouseEvent(f.mouseSprite,a.type,a)};f.triggerMouseEvent=function(a,b,c){for(;null!=a;)a.trigger(c.type,c),a=a.parent};var n=function(){};n.__name__=!0;n.init=function(){n.inited||
  174. (n.inited=!0)};n.createTask=function(){n.tasks.push(!1);return n.tasks.length-1};n.closeTask=function(a){0<=a&&a<n.tasks.length&&(n.tasks[a]=!0)};n.get_done=function(){if(!n.inited)return!1;if(n.finished)return!0;for(var a=0,b=n.tasks.length;a<b;){var c=a++;if(!n.tasks[c])return!1}return n.finished=!0};n.get_progress=function(){if(!n.inited)return 0;if(n.finished)return 1;for(var a=0,b=0,c=n.tasks.length;b<c;){var d=b++;n.tasks[d]&&a++}return a/n.tasks.length};n.loadImage=function(a,b){var h=new Image;
  175. h.src=a;if(!n.finished){var c=n.createTask();h.onload=function(){n.closeTask(c);null!=b&&b(h)}}return h};n.loadWebFonts=function(a,b){var h=n.createTask();a.active=function(){n.closeTask(h);null!=b&&b()};WebFont.load(a)};n.loadTextFile=function(a,b){var h=n.createTask(),c=new XMLHttpRequest;c.open("GET",a);c.onload=function(){n.closeTask(h);null!=b&&b(c.responseText)};c.send()};n.loadBitmapFont=function(){};var l=function(){};l.__name__=!0;l._reset=function(){l.startTime=l.absoluteTime();l.lastTime=
  176. 0};l._update=function(){var a=l.get_currentMS();l.elapsedTime=a-l.lastTime;l.lastTime=a};l.absoluteTime=function(){return(new Date).getTime()};l.get_current=function(){return.001*l.get_currentMS()};l.get_currentMS=function(){return l.absoluteTime()-l.startTime};l.get_elapsed=function(){return.001*l.elapsedTime};l.get_elapsedMS=function(){return l.elapsedTime};var p=function(){};p.__name__=!0;p.getColorString=function(a,b){null==b&&(b=1);return"rgba("+((a&16711680)>>>16)+", "+((a&65280)>>>8)+", "+
  177. (a&255)+", "+b+")"};p.pointInQuad=function(a,b,c,d,e){e=L.subtract(b,c);b=L.subtract(b,a);d=L.subtract(c,d);c=L.subtract(c,a);a=L.dot(e,b);e=L.dot(e,e);c=L.dot(d,c);d=L.dot(d,d);return 0<=a&&a<=e&&0<=c&&c<=d};p.pointInTransformedBounds=function(a,b,c){if(null==a||null==b||6!=b.length||null==c||0==c.width||0==c.height)return!1;var h=k.applyTransform(b,c.get_left(),c.get_top()),m=k.applyTransform(b,c.get_right(),c.get_top()),d=k.applyTransform(b,c.get_right(),c.get_bottom());b=k.applyTransform(b,c.get_left(),
  178. c.get_bottom());return p.pointInQuad(a,h,m,d,b)};p.drawImageClippedSafe=function(a,b,c,d,e){null==e&&(e=0);null==d&&(d=0);if(!(0>=c.width||0>=c.height)){var h=c.get_top(),m=c.get_left(),f=c.get_bottom();c=c.get_right();0>=c||m>=b.width||0>=f||h>=b.height||(m+=0>m?-m:0,h+=0>h?-h:0,c>b.width&&(c=b.width),f>b.height&&(f=b.height),c-=m,f-=h,a.drawImage(b,m,h,c,f,d,e,c,f))}};var A=function(){this.listeners=new N};A.__name__=!0;A.prototype={addEventListener:function(a,b){this.listeners.exists(a)||this.listeners.set(a,
  179. []);this.listeners.get(a).push(b)},removeEventListener:function(h,b){if(this.listeners.exists(h)){var c=this.listeners.get(h),m=a.indexOf(c,b,0);0>m||c.splice(m,1)}},trigger:function(a,b){if(this.listeners.exists(a))for(var h=0,c=this.listeners.get(a);h<c.length;){var m=c[h];++h;m(b)}},__class__:A};var u=function(){this.buttonMode=this.mouseEnabled=!1;this.bounds=new B(0,0,0,0);this.graphics=new I;this.children=[];this.useSimpleComposite=!1;this.alpha=1;this.visible=!0;this.scaleX=this.scaleY=1;this.x=
  180. this.y=this.rotation=0;this.listeners=new N};u.__name__=!0;u.__super__=A;u.prototype=d(A.prototype,{set_alpha:function(a){return this.alpha=0>a?0:1<a?1:a},get_stage:function(){return f.stage},addChild:function(a){null==a.parent&&f.stage!=a&&(this.children.push(a),a.parent=this)},removeChild:function(h){h.parent==this&&(this.children.splice(a.indexOf(this.children,h,0),1),h.parent=null)},getChildAt:function(a){return this.children[a]},getRenderBounds:function(){return B.combineMultiple([this.bounds,
  181. this.graphics.renderBounds])},getBounds:function(){return B.combineMultiple([this.bounds,this.graphics.bounds])},get_width:function(){return this.getBounds().width*this.scaleX},set_width:function(a){this.scaleX=a/this.getBounds().width;return a},get_height:function(){return this.getBounds().height*this.scaleY},set_height:function(a){this.scaleY=a/this.getBounds().height;return a},_paint:function(a){this.visible&&0!=this.alpha&&(a.save(),a.translate(this.x,this.y),a.rotate(this.rotation/180*Math.PI),
  182. a.scale(this.scaleX,this.scaleY),1>this.alpha&&(a.ctx.globalAlpha=this.alpha),this._render(a),a.ctx.globalAlpha=1,a.restore())},_renderSelf:function(a){this.graphics._paint(a)},_render:function(a){this._renderSelf(a);for(var h=0,b=this.children.length;h<b;){var c=h++;this.children[c]._paint(a)}},cascadingCallback:function(a){if(null!=a){a(this);for(var h=0,b=this.children;h<b.length;){var c=b[h];++h;c.cascadingCallback(a)}}},globalToLocal:function(a,b){for(var h=new k,c=this;null!=c;)h.scale(1/c.scaleX,
  183. 1/c.scaleY),h.rotate(-c.rotation/180*Math.PI),h.translate(-c.x,-c.y),c=c.parent;return k.applyTransform(h.getTransform(),a,b)},localToGlobal:function(a,b){var h=this.getTransform();return k.applyTransform(h.getTransform(),a,b)},getTransform:function(){for(var a=new k,b=this;null!=b;)a.translate(b.x,b.y),a.rotate(b.rotation/180*Math.PI),a.scale(b.scaleX,b.scaleY),b=b.parent;return a},__class__:u});var w=function(a,b,c){null==c&&(c=0);this.ready=this.dirty=!1;u.call(this);0<a&&0<b&&(this.create(a,b),
  184. c&=-1,0!=c&&(this.ctx.fillStyle=p.getColorString(c&16777215,((c&-16777216)>>>24)/255),this.ctx.fillRect(0,0,a,b)),this.updateImageData(),this.ready=!0)};w.__name__=!0;w.fromFile=function(a,b){var h=new w(0,0);n.loadImage(a,function(a){h.createFromImage(a);null!=b&&b(a)});return h};w.fromImage=function(a){var h=new w(0,0);h.createFromImage(a);return h};w.__super__=u;w.prototype=d(u.prototype,{get_rect:function(){return new B(0,0,null!=this.clipRect?this.clipRect.width:0,null!=this.clipRect?this.clipRect.height:
  185. 0)},set_clipRect:function(a){this.clipRect=a;this.updateClipRectBounds();return this.clipRect},updateClipRectBounds:function(){null!=this.clipRect&&null!=this.c&&(this.bounds.width=this.clipRect.width+(0>this.clipRect.x?this.clipRect.x:this.clipRect.get_right()>this.c.width?this.c.width-this.clipRect.get_right():0),this.bounds.height=this.clipRect.height+(0>this.clipRect.y?this.clipRect.y:this.clipRect.get_bottom()>this.c.height?this.c.height-this.clipRect.get_bottom():0))},create:function(a,b){this.bounds.width=
  186. a;this.bounds.height=b;this.c=window.document.createElement("canvas");this.c.width=a;this.c.height=b;this.imageWidth=a;this.imageHeight=b;this.ctx=this.c.getContext("2d",null);this.set_clipRect(new B(0,0,a,b))},createFromImage:function(a){this.create(a.width,a.height);this.ctx.drawImage(a,0,0);this.updateImageData();this.ready=!0},_renderSelf:function(a){u.prototype._renderSelf.call(this,a);this.ready&&(this.update(),p.drawImageClippedSafe(a.ctx,this.c,this.clipRect))},getBounds:function(){this.updateClipRectBounds();
  187. return u.prototype.getBounds.call(this)},updateImageData:function(){this.imageData=this.ctx.getImageData(0,0,this.c.width,this.c.height)},update:function(){this.dirty&&(this.ctx.putImageData(this.imageData,0,0),this.dirty=!1)},inBounds:function(a,b){return 0<=a&&0<=b&&a<this.c.width&&b<this.c.height},getDataIndex:function(a,b){return 4*(a+b*this.c.width)},setPixel:function(a,b,c){this.ready&&this.inBounds(a,b)&&(a=this.getDataIndex(a,b),c&=-1,this.imageData.data[a]=(c&16711680)>>>16,this.imageData.data[a+
  188. 1]=(c&65280)>>>8,this.imageData.data[a+2]=c&255,this.imageData.data[a+3]=(c&-16777216)>>>24,this.dirty=!0)},getPixel:function(a,b){if(!this.ready||!this.inBounds(a,b))return 0;var h=this.getDataIndex(a,b);return this.imageData.data[h+3]<<24|this.imageData.data[h]<<16|this.imageData.data[h+1]<<8|this.imageData.data[h+2]},draw:function(a,b,c,d,e){null==e&&(e=1);this.update();var h=this.ctx.globalAlpha;this.ctx.globalAlpha=e;p.drawImageClippedSafe(this.ctx,a,new B(b.x,b.y,b.width,b.height),c,d);this.ctx.globalAlpha=
  189. h},drawBitmap:function(a,b,c,d,e){null==e&&(e=1);this.draw(a.c,b,c,d,e)},fillRect:function(a,b){null==b&&(b=0);a.equals(this.get_rect())||this.update();255>(b&-16777216)>>>24&&this.ctx.clearRect(a.x,a.y,a.width,a.height);this.ctx.fillStyle=p.getColorString(b&16777215,((b&-16777216)>>>24)/255);this.ctx.fillRect(a.x,a.y,a.width,a.height)},__class__:w});var I=function(){this.strokeWidth=1;this.clear()};I.__name__=!0;I.prototype={get_length:function(){return this.items.length},get_skipDraw:function(){return!this.filling&&
  190. !this.stroking},get_strokeOffset:function(){return this.stroking&&0!=this.strokeWidth%2?.5:0},get_strokePadding:function(){return this.stroking?1.5*this.strokeWidth:0},combineBounds:function(a){this.bounds.combine(a);a.x-=this.get_strokePadding();a.y-=this.get_strokePadding();a.width+=2*this.get_strokePadding();a.height+=2*this.get_strokePadding();this.renderBounds.combine(a)},_paint:function(a){for(var h=0,b=this.items;h<b.length;){var c=b[h];++h;c.execute(a)}},clear:function(){this.items=[];this.path=
  191. this.filling=this.stroking=!1;this.bounds=new B(0,0,0,0);this.renderBounds=new B(0,0,0,0)},beginPath:function(){this.path||(this.items.push(z.callCtxFunc("beginPath")),this.path=!0)},closePath:function(a){null==a&&(a=!1);this.path&&(a&&this.items.push(z.callCtxFunc("closePath")),this.path=!1)},applyPath:function(){this.filling&&this.items.push(z.callCtxFunc("fill"));this.stroking&&this.items.push(z.callCtxFunc("stroke"))},beginFill:function(a,b){null==b&&(b=1);null==a&&(a=0);this.items.push(z.setCtxVar("fillStyle",
  192. p.getColorString(a,b)));this.filling=!0},endFill:function(){this.filling=!1},beginStroke:function(a,b,c){null==c&&(c=1);null==b&&(b=0);null==a&&(a=1);this.items.push(z.setCtxVar("strokeStyle",p.getColorString(b,c)));this.items.push(z.setCtxVar("lineWidth",a));this.strokeWidth=a;this.stroking=!0},endStroke:function(){this.stroking=!1},drawRect:function(a,b,c,d){if(!this.get_skipDraw()){var h=this.get_strokeOffset();a+=h;b+=h;this.filling&&this.items.push(z.callCtxFunc("fillRect",[a,b,c,d]));this.stroking&&
  193. this.items.push(z.callCtxFunc("strokeRect",[a,b,c,d]));this.combineBounds(new B(a,b,c,d))}},drawCircle:function(a,b,c){if(!this.get_skipDraw()){var h=this.get_strokeOffset();a+=h;b+=h;this.beginPath();this.items.push(z.callCtxFunc("arc",[a,b,c,.1,I.PI2+.1]));this.closePath();this.applyPath();this.combineBounds(new B(a-c,b-c,2*c,2*c))}},drawEllipse:function(a,b,c,d){if(!this.get_skipDraw()){var h=this.get_strokeOffset();a+=h;b+=h;this.beginPath();this.items.push(z.callCtxFunc("save"));this.items.push(z.callCtxFunc("translate",
  194. [a+c/2,b+d/2]));this.items.push(z.callCtxFunc("scale",[c/d,1]));this.items.push(z.callCtxFunc("arc",[0,0,d/2,.1,I.PI2+.1]));this.items.push(z.callCtxFunc("restore"));this.closePath();this.applyPath();this.combineBounds(new B(a,b,c,d))}},drawPath:function(a){if(!(this.get_skipDraw()||2>a.length)){var b=this.get_strokeOffset();this.beginPath();this.items.push(z.callCtxFunc("moveTo",[a[0].x+b,a[0].y+b]));for(var h=1,c=a.length;h<c;){var d=h++;this.items.push(z.callCtxFunc("lineTo",[a[d].x+b,a[d].y+b]))}this.closePath(!0);
  195. this.applyPath();this.combineBounds(B.containingPoints(a))}},__class__:I};var y=function(a){u.call(this);null!=a&&this.create(a)};y.__name__=!0;y.fromFile=function(a,b){var h=new y(null);n.loadImage(a,function(a){h.create(a);null!=b&&b()});return h};y.__super__=u;y.prototype=d(u.prototype,{get_imageWidth:function(){return null!=this.image?this.image.width:0},get_imageHeight:function(){return null!=this.image?this.image.height:0},get_rect:function(){return new B(0,0,null!=this.clipRect?this.clipRect.width:
  196. 0,null!=this.clipRect?this.clipRect.height:0)},set_clipRect:function(a){this.clipRect=a;this.updateClipRectBounds();return this.clipRect},create:function(a){null==this.image&&(this.image=a,this.bounds.width=a.width,this.bounds.width=a.height,this.set_clipRect(new B(0,0,a.width,a.height)))},updateClipRectBounds:function(){null!=this.clipRect&&null!=this.image&&(this.bounds.width=this.clipRect.width+(0>this.clipRect.x?this.clipRect.x:this.clipRect.get_right()>this.image.width?this.image.width-this.clipRect.get_right():
  197. 0),this.bounds.height=this.clipRect.height+(0>this.clipRect.y?this.clipRect.y:this.clipRect.get_bottom()>this.image.height?this.image.height-this.clipRect.get_bottom():0))},getBounds:function(){this.updateClipRectBounds();return u.prototype.getBounds.call(this)},_renderSelf:function(a){u.prototype._renderSelf.call(this,a);null!=this.image&&p.drawImageClippedSafe(a.ctx,this.image,this.clipRect)},__class__:y});var F=function(a){this.type=a};F.__name__=!0;F.prototype={__class__:F};var x=function(a,b){this.type=
  198. a;this.keyCode=b};x.__name__=!0;x.__super__=F;x.prototype=d(F.prototype,{__class__:x});var M=function(a,b,c,d){null==d&&(d=0);this.type=a;this.x=b;this.y=c;this.which=d};M.__name__=!0;M.__super__=F;M.prototype=d(F.prototype,{__class__:M});var L=function(a,b){this.x=a;this.y=b};L.__name__=!0;L.dot=function(a,b){return a.x*b.x+a.y*b.y};L.subtract=function(a,b){return new L(b.x-a.x,b.y-a.y)};L.prototype={__class__:L};var B=function(a,b,c,d){this.x=a;this.y=b;this.width=c;this.height=d};B.__name__=!0;
  199. B.combineMultiple=function(a){for(var b=0,h=0,c=0,d=0,e=0,f=a.length;e<f;){var g=e++,k=a[g];if(0==g||k.get_top()<b)b=k.get_top();if(0==g||k.get_left()<h)h=k.get_left();if(0==g||k.get_bottom()>c)c=k.get_bottom();if(0==g||k.get_right()>d)d=k.get_right()}return new B(h,b,d-h,c-b)};B.containingPoints=function(a){for(var b=a[0].y,h=a[0].x,c=a[0].y,d=a[0].x,e=0;e<a.length;){var f=a[e];++e;f.y<b?b=f.y:f.y>c&&(c=f.y);f.x<h?h=f.x:f.x>d&&(d=f.x)}return new B(h,b,d-h,c-b)};B.prototype={get_top:function(){return this.y},
  200. set_top:function(a){return this.y=a},get_left:function(){return this.x},set_left:function(a){return this.x=a},get_bottom:function(){return this.y+this.height},set_bottom:function(a){this.height=a-this.y;return a},get_right:function(){return this.x+this.width},set_right:function(a){this.width=a-this.x;return a},intersects:function(a){return a.get_left()<this.get_right()&&a.get_right()>this.get_left()&&a.get_top()<this.get_bottom()&&a.get_bottom()>this.get_top()},equals:function(a){return null!=a&&
  201. a.x==this.x&&a.y==this.y&&a.width==this.width&&a.height==this.height},combine:function(a){var b=a.get_top()<this.get_top()?a.get_top():this.get_top();var h=a.get_left()<this.get_left()?a.get_left():this.get_left();var c=a.get_bottom()>this.get_bottom()?a.get_bottom():this.get_bottom();a=a.get_right()>this.get_right()?a.get_right():this.get_right();this.set_top(b);this.set_left(h);this.set_bottom(c);this.set_right(a)},copy:function(){return new B(this.x,this.y,this.width,this.height)},__class__:B};
  202. var ba=function(a){this.captureKeys=[37,38,39,40,32];this.mouseX=this.mouseY=0;this.isFocused=!1;var h=this;this.listeners=new N;this.c=a;window.addEventListener("focus",b(this,this.onFocus));window.addEventListener("blur",b(this,this.onBlur));window.addEventListener("pagehide",b(this,this.onBlur));window.addEventListener("contextmenu",function(a){h.onMouseUp(a);a.preventDefault();return!1});window.addEventListener("click",b(this,this.onClick));window.addEventListener("mousedown",b(this,this.onMouseDown));
  203. window.addEventListener("mouseup",b(this,this.onMouseUp));window.addEventListener("mousemove",b(this,this.onMouseMove));window.addEventListener("mouseover",b(this,this.onMouseMove));window.addEventListener("keydown",b(this,this.onKeyDown));window.addEventListener("keyup",b(this,this.onKeyUp))};ba.__name__=!0;ba.__super__=A;ba.prototype=d(A.prototype,{set_mouseX:function(a){return this.mouseX=Math.floor(a)},set_mouseY:function(a){return this.mouseY=Math.floor(a)},onFocus:function(){this.isFocused=
  204. !0;this.trigger("focus",null)},onBlur:function(){this.isFocused=!1;this.trigger("blur",null)},onClick:function(a){if(!this.isFocused)this.onFocus();this.set_mouseX(a.pageX);this.set_mouseY(a.pageY);this.trigger("click",this.makeMouseEvent("click",a.which))},onMouseDown:function(a){this.set_mouseX(a.pageX);this.set_mouseY(a.pageY);this.trigger("mouseDown",this.makeMouseEvent("mouseDown",a.which))},onMouseUp:function(a){this.set_mouseX(a.pageX);this.set_mouseY(a.pageY);this.trigger("mouseUp",this.makeMouseEvent("mouseUp",
  205. a.which));3==a.which&&(a=new KeyboardEvent("keyup"),a.initKeyEvent("keyup",!0,!0,window,!1,!1,!1,!1,r.SHIFT,0),this.onKeyUp(a),a.initKeyEvent("keyup",!0,!0,window,!1,!1,!1,!1,r.SHIFT,0),this.onKeyUp(a))},onMouseMove:function(a){this.set_mouseX(a.pageX);this.set_mouseY(a.pageY);this.trigger("move",this.makeMouseEvent("move"))},makeMouseEvent:function(a,b){null==b&&(b=0);return new M(a,this.mouseX,this.mouseY,b)},onKeyDown:function(b){this.trigger("keyDown",new x("keyDown",b.keyCode));this.isFocused&&
  206. -1!=a.indexOf(this.captureKeys,b.keyCode,0)&&b.preventDefault()},onKeyUp:function(b){this.trigger("keyUp",new x("keyUp",b.keyCode));this.isFocused&&-1!=a.indexOf(this.captureKeys,b.keyCode,0)&&b.preventDefault()},__class__:ba});var r=function(){};r.__name__=!0;A=function(){};A.__name__=!0;var S=function(){this.h={}};S.__name__=!0;S.__interfaces__=[A];S.prototype={set:function(a,b){this.h[a]=b},remove:function(a){if(!this.h.hasOwnProperty(a))return!1;delete this.h[a];return!0},keys:function(){var b=
  207. [],c;for(c in this.h)this.h.hasOwnProperty(c)&&b.push(c|0);return a.iter(b)},iterator:function(){return{ref:this.h,it:this.keys(),hasNext:function(){return this.it.hasNext()},next:function(){var a=this.it.next();return this.ref[a]}}},__class__:S};var v=function(){};v.__name__=!0;v.init=function(){v.inited||(f.input.addEventListener("keyDown",v.onKeyDown),f.input.addEventListener("keyUp",v.onKeyUp),f.input.addEventListener("blur",v.reset),v.inited=!0)};v.onKeyDown=function(a){v.keys.h[a.keyCode]=!0};
  208. v.onKeyUp=function(a){v.keys.h[a.keyCode]=!1};v.reset=function(){for(var a=v.keys.keys();a.hasNext();){var b=a.next();v.keys.h[b]=!1}};v.update=function(){v.keysOld=new S;for(var a=v.keys.keys();a.hasNext();){var b=a.next();v.keysOld.h[b]=v.keys.h[b]}};v.keyDown=function(a){return v.keys.h.hasOwnProperty(a)&&v.keys.h[a]};v.keyDownOld=function(a){return v.keysOld.h.hasOwnProperty(a)&&v.keysOld.h[a]};v.keyPressed=function(a){return v.keyDown(a)&&!v.keyDownOld(a)};v.keyReleased=function(a){return!v.keyDown(a)&&
  209. v.keyDownOld(a)};var z=function(a){this.type=a};z.__name__=!0;z.setCtxVar=function(a,b){var h=new z(z.TYPE_CTX_VAR);h.name=a;h.value=b;return h};z.callCtxFunc=function(a,b){var h=new z(z.TYPE_CTX_FUNC);h.name=a;h.params=null==b?[]:b;return h};z.setSysVar=function(a,b){var h=new z(z.TYPE_SYS_VAR);h.name=a;h.value=b;return h};z.callSysFunc=function(a,b){var h=new z(z.TYPE_SYS_FUNC);h.name=a;h.params=null==b?[]:b;return h};z.prototype={execute:function(a){this.type==z.TYPE_CTX_FUNC?a.ctx[this.name].apply(a.ctx,
  210. this.params):this.type==z.TYPE_CTX_VAR?a.ctx[this.name]=this.value:this.type==z.TYPE_SYS_FUNC?a[this.name].apply(a,this.params):this.type==z.TYPE_SYS_VAR&&(a[this.name]=this.value)},__class__:z};var T=function(a){k.call(this);this.ctx=a};T.__name__=!0;T.__super__=k;T.prototype=d(k.prototype,{setTransform:function(a,b,c,d,e,f){k.prototype.setTransform.call(this,a,b,c,d,e,f);this.ctx.setTransform(a,b,c,d,e,f)},save:function(){k.prototype.save.call(this);this.ctx.save()},restore:function(){k.prototype.restore.call(this);
  211. this.ctx.restore()},transform:function(a,b,c,d,e,f){k.prototype.transform.call(this,a,b,c,d,e,f);this.ctx.transform(a,b,c,d,e,f)},translate:function(a,b){k.prototype.translate.call(this,a,b);this.ctx.translate(a,b)},scale:function(a,b){k.prototype.scale.call(this,a,b);this.ctx.scale(a,b)},rotate:function(a){k.prototype.rotate.call(this,a);this.ctx.rotate(a)},__class__:T});var ca=function(){this.loadStep=0};ca.__name__=!0;ca.load=function(a,c){var h=new ca;h.atlas=y.fromFile(a,b(h,h.imageLoaded));
  212. n.loadTextFile(c,b(h,h.jsonLoaded));return h};ca.prototype={get_loaded:function(){return 2<this.loadStep},imageLoaded:function(){1<this.loadStep||(this.loadStep++,this.checkLoading())},jsonLoaded:function(a){1<this.loadStep||(this.jsonText=a,this.loadStep++,this.checkLoading())},checkLoading:function(){if(2==this.loadStep){this.loadStep++;this.data=JSON.parse(this.jsonText).font;this.jsonText=null;this.lineHeight=this.data.common.lineHeight;this.chars=new S;var a=0,b;for(b=G.__cast(this.data.chars,
  213. Array);a<b.length;){var c=b[a];++a;var d=new B(c.x,c.y,c.width,c.height);this.chars.set(c.id,d)}}},__class__:ca};var ja=function(a,b){this.tint=16777215;u.call(this);this.set_text(a);this.set_font(b);this.useSimpleComposite=!0};ja.__name__=!0;ja.__super__=u;ja.prototype=d(u.prototype,{set_text:function(a){null!=a&&(this.text=a);return this.text},set_font:function(a){null!=a&&(this.font=a);return this.font},set_tint:function(a){return this.tint=a&16777215},_renderSelf:function(a){u.prototype._renderSelf.call(this,
  214. a);this.font.get_loaded()&&a.ctx.drawImage(this.getAsTexture(),0,0)},getTextWidth:function(){for(var b=0,c=0,d=this.text.length;c<d;){var e=c++,e=a.cca(this.text,e);this.font.chars.h.hasOwnProperty(e)&&(b+=Math.ceil(this.font.chars.h[e].width))}return b+1},getAsTexture:function(){null==this.c&&(this.c=window.document.createElement("canvas"),this.ctx=this.c.getContext("2d",null));this.c.width=this.getTextWidth();this.c.height=this.font.lineHeight;for(var b=0,c=0,d=this.text.length;c<d;){var e=c++,
  215. e=a.cca(this.text,e);this.font.chars.h.hasOwnProperty(e)&&(e=this.font.chars.h[e],this.ctx.drawImage(this.font.atlas.image,e.x,e.y,e.width,e.height,b,0,e.width,e.height),b+=Math.ceil(e.width))}this.bounds.width=b+1;this.bounds.height=this.font.lineHeight;this.ctx.globalCompositeOperation="source-atop";this.ctx.fillStyle=p.getColorString(this.tint);this.ctx.fillRect(0,0,this.c.width,this.c.height);return this.c},__class__:ja});var W=function(a,b,c,d){null==d&&(d=0);u.call(this);this.set_text(a);this.set_fontName(b);
  216. this.set_fontSize(c);this.set_color(d);this.useSimpleComposite=!0};W.__name__=!0;W.__super__=u;W.prototype=d(u.prototype,{set_text:function(a){null!=a&&(this.text=a);return this.text},set_fontName:function(a){null!=a&&(this.fontName=a);return this.fontName},set_fontSize:function(a){return this.fontSize=0>a?0:a},set_color:function(a){return this.color=a&16777215},getFontString:function(){return this.fontSize+"px "+this.fontName},_renderSelf:function(a){u.prototype._renderSelf.call(this,a);var b=this.getFontString();
  217. a.ctx.font!=b&&(a.ctx.font=b);a.ctx.textBaseline="top";a.ctx.fillStyle=p.getColorString(this.color);a.ctx.fillText(this.text,0,0)},__class__:W});var Z=function(a,b){this.map=a;this.keys=b;this.index=0;this.count=b.length};Z.__name__=!0;Z.prototype={hasNext:function(){return this.index<this.count},next:function(){return this.map.get(this.keys[this.index++])},__class__:Z};var N=function(){this.h={}};N.__name__=!0;N.__interfaces__=[A];N.prototype={set:function(a,b){null!=ra[a]?this.setReserved(a,b):
  218. this.h[a]=b},get:function(a){return null!=ra[a]?this.getReserved(a):this.h[a]},exists:function(a){return null!=ra[a]?this.existsReserved(a):this.h.hasOwnProperty(a)},setReserved:function(a,b){null==this.rh&&(this.rh={});this.rh["$"+a]=b},getReserved:function(a){return null==this.rh?null:this.rh["$"+a]},existsReserved:function(a){return null==this.rh?!1:this.rh.hasOwnProperty("$"+a)},remove:function(a){if(null!=ra[a]){a="$"+a;if(null==this.rh||!this.rh.hasOwnProperty(a))return!1;delete this.rh[a]}else{if(!this.h.hasOwnProperty(a))return!1;
  219. delete this.h[a]}return!0},keys:function(){var b=this.arrayKeys();return a.iter(b)},arrayKeys:function(){var a=[],b;for(b in this.h)this.h.hasOwnProperty(b)&&a.push(b);if(null!=this.rh)for(b in this.rh)36==b.charCodeAt(0)&&a.push(b.substr(1));return a},iterator:function(){return new Z(this,this.arrayKeys())},__class__:N};var pa={__name__:!0,toArray:function(a){for(var b=[],h=a.length,c=0;c<h;){var d=c++;b[d]=a[d]}return b}},q=function(){};q.__name__=!0;var P=function(){this.fps=60;this.frames=this.prevTimer=
  220. this.curTimer=0;this.container=new u};P.__name__=!0;P.main=function(){P.i=new P;f.start(window.document.getElementById("game-frost"),q.game_width,q.game_height,"transparent",(ga=P.i,b(ga,ga.init)),(ga=P.i,b(ga,ga.loaded)))};P.prototype={init:function(){var a=this;this.initFPS();f.stage.addChild(this.container);E.prepare(function(){a.changeScreen(new E)});C.init();n.loadWebFonts({custom:{families:["Asap Medium"],urls:["fonts/fonts.css"]}});P.fontVisitor=ca.load("fonts/visitor/visitor.png","fonts/visitor/visitor-min.json");
  221. t.load();this.lastTick=l.get_currentMS();f.stage.addEventListener("enterFrame",b(this,this.update))},loaded:function(){D.init();t.init();J.initShared();PlayerIO.authenticate(q.playerio_game_id,"public",{userId:"guest"},{},b(this,this.connectCallback),b(this,this.errorCallback))},update:function(a){this.updateFPS();null!=this.currentScreen&&this.currentScreen.update();for(a=0;l.get_currentMS()-this.lastTick>=q.physics_ms_per_tick&&a<=q.physics_max_ticks;)this.lastTick+=q.physics_ms_per_tick,null!=
  222. this.currentScreen&&this.currentScreen.tick(),a++,a==q.physics_max_ticks&&(this.lastTick=l.get_currentMS());null!=this.currentScreen&&this.currentScreen.postUpdate()},changeScreen:function(a,b){this.screenCallback=b;this.setScreen(a)},setScreen:function(a){null!=this.currentScreen&&(this.currentScreen.kill(),this.container.removeChild(this.currentScreen));this.currentScreen=a;this.container.addChild(this.currentScreen);this.currentScreen.init();null!=this.screenCallback&&this.screenCallback();this.screenCallback=
  223. null},connectCallback:function(a){this.client=a;q.use_development_server&&(a.multiplayer.developmentServer=q.developer_server);this.showLobby()},showLobby:function(){var a=this;this.client.multiplayer.listRooms(q.server_type_normalroom,{},0,0,function(c){a.changeScreen(new V(b(a,a.joinRoom)),function(){G.__cast(a.currentScreen,V).refresh(c)})},b(this,this.errorCallback))},joinRoom:function(a,c){var h=this;g.log('Joining level "'+a+'"...');this.changeScreen(new na);this.client.multiplayer.createJoinRoom(a,
  224. q.server_type_normalroom,!0,{},{name:c},function(a){h.con=a;a.addMessageCallback("init",function(b){h.changeScreen(new O(a,b))});a.send("init");a.addDisconnectCallback(b(h,h.showLobby))},function(a){h.errorCallback(a);h.showLobby()})},errorCallback:function(a){g.log(a.message)},initFPS:function(){this.debugText=window.document.createElement("div");this.debugText.style.position="absolute";this.debugText.style.width="50px";this.debugText.style.right="4px";this.debugText.style.top="14px";this.debugText.style.fontSize=
  225. this.debugText.style.lineHeight="12px";this.debugText.style.color="rgba(255, 255, 255, .3)";this.debugText.style.fontFamily="sans-serif";this.debugText.style.setProperty("pointer-events","none");this.debugText.style.setProperty("-webkit-touch-callout","none");this.debugText.style.setProperty("-webkit-user-select","none");this.debugText.style.setProperty("-khtml-user-select","none");this.debugText.style.setProperty("-moz-user-select","none");this.debugText.style.setProperty("-ms-user-select","none");
  226. this.debugText.style.setProperty("user-select","none");this.debugText.style.cursor="default";this.debugText.innerHTML="...";window.document.body.appendChild(this.debugText)},updateFPS:function(){this.frames+=1;this.curTimer=l.get_currentMS();250<=this.curTimer-this.prevTimer&&(this.fps=Math.round(1E3*this.frames/(this.curTimer-this.prevTimer)),this.debugText.innerHTML="FPS: "+this.fps,this.prevTimer=this.curTimer,this.frames=0)},__class__:P};var C=function(){};C.__name__=!0;C.init=function(){C.inited||
  227. (C.lobbyBackground=n.loadImage("img/bg-lobby.png"),C.lobbyArt1=n.loadImage("img/art-lobby-1.png"),C.lobbyLevel=n.loadImage("img/level-state.png"),C.joinBackground=n.loadImage("img/bg-join.png"),C.menubarBackground=n.loadImage("img/ui/menubar.png"),C.menubarLobby=n.loadImage("img/ui/lobby.png"),C.menubarGodMode=n.loadImage("img/ui/godmode.png"),C.menubarMinimap=n.loadImage("img/ui/minimap.png"),C.menubarSelector=n.loadImage("img/ui/selector.png"),C.blocks=n.loadImage("img/blocks.png"),C.player=n.loadImage("img/player.png"),
  228. C.auraGod=n.loadImage("img/aura-god.png"),C.inited=!0)};var J=function(a,b,c,d){this.morx=this.mory=this.mox=this.moy=this.current=this.currentBelow=this.mx=this.my=this.ox=this.oy=this.oh=this.ov=0;this.changed=this.donex=this.doney=!1;this.horizontal=this.vertical=this._speedX=this._speedY=this._modifierX=this._modifierY=0;this.spacedown=this.spacejustdown=!1;this.leftdown=this.rightdown=this.updown=this.downdown=0;this.queue=Array(2);this.face=this.x=this.y=0;this.isMe=this.godmode=!1;this.id=
  229. a;this.name=b;this.world=c;this.screen=d;this.y=this.x=16;this.lastJump=-l.get_currentMS();this.generateNameTag()};J.__name__=!0;J.initShared=function(){J.inited||(J.nameText=new ja("",P.fontVisitor),J.inited=!0)};J.getNameColor=function(a){return(J.isAdmin(a)?q.color_admin:q.color_default)&16777215};J.isAdmin=function(a){a=a.toLowerCase();for(var b=0,c=J.admins.length;b<c;){var h=b++;if(J.admins[h]==a)return!0}return!1};J.prototype={get_speedX:function(){return this._speedX*q.physics_variable_multiplyer},
  230. set_speedX:function(a){this._speedX=a/q.physics_variable_multiplyer;return a},get_speedY:function(){return this._speedY*q.physics_variable_multiplyer},set_speedY:function(a){this._speedY=a/q.physics_variable_multiplyer;return a},get_modifierX:function(){return this._modifierX*q.physics_variable_multiplyer},set_modifierX:function(a){this._modifierX=a/q.physics_variable_multiplyer;return a},get_modifierY:function(){return this._modifierY*q.physics_variable_multiplyer},set_modifierY:function(a){this._modifierY=
  231. a/q.physics_variable_multiplyer;return a},get_rect:function(){return new B(this.x,this.y,16,16)},generateNameTag:function(){J.nameText.set_text(this.name);J.nameText.set_tint(0);var a=J.nameText.getAsTexture();this.nameBM=new w(a.width,a.height);this.nameBM.draw(a,this.nameBM.get_rect(),0,1,.2);this.nameBM.draw(a,this.nameBM.get_rect(),2,1,.2);this.nameBM.draw(a,this.nameBM.get_rect(),1,0,.2);this.nameBM.draw(a,this.nameBM.get_rect(),1,2,.2);this.nameBM.draw(a,this.nameBM.get_rect(),0,0,.2);this.nameBM.draw(a,
  232. this.nameBM.get_rect(),2,0,.2);this.nameBM.draw(a,this.nameBM.get_rect(),2,2,.2);this.nameBM.draw(a,this.nameBM.get_rect(),0,2,.2);J.nameText.set_tint(J.getNameColor(this.name));a=J.nameText.getAsTexture();this.nameBM.draw(a,this.nameBM.get_rect(),1,1)},update:function(){this.isMe&&(v.keyDown(37)||v.keyDown(65)?this.leftdown=-1:this.leftdown=0,v.keyDown(39)||v.keyDown(68)?this.rightdown=1:this.rightdown=0,v.keyDown(38)||v.keyDown(87)?this.updown=-1:this.updown=0,v.keyDown(40)||v.keyDown(83)?this.downdown=
  233. 1:this.downdown=0,this.spacejustdown=v.keyPressed(32),this.spacedown=v.keyDown(32),this.horizontal=this.leftdown+this.rightdown,this.vertical=this.updown+this.downdown)},tick:function(){var a=Math.floor((this.x+8)/16),b=Math.floor((this.y+8)/16),c=this.queueShift();this.current=this.world.getBlock(a,b);this.currentBelow=0;1==this.current&&(this.currentBelow=this.world.getBlock(a-1,b));2==this.current&&(this.currentBelow=this.world.getBlock(a,b-1));this.currentBelow=3==this.current?this.world.getBlock(a+
  234. 1,b):this.world.getBlock(a,b+1);this.queuePush(this.current);4==this.current&&(c=this.queueShift(),this.queuePush(this.current));if(this.godmode)this.moy=this.mox=this.mory=this.morx=0;else{switch(this.current){case 1:this.morx=-q.physics_gravity;this.mory=0;break;case 2:this.morx=0;this.mory=-q.physics_gravity;break;case 3:this.morx=q.physics_gravity;this.mory=0;break;case 4:this.mory=this.morx=0;break;default:this.morx=0,this.mory=q.physics_gravity}switch(c){case 1:this.mox=-q.physics_gravity;this.moy=
  235. 0;break;case 2:this.mox=0;this.moy=-q.physics_gravity;break;case 3:this.mox=q.physics_gravity;this.moy=0;break;case 4:this.moy=this.mox=0;break;default:this.mox=0,this.moy=q.physics_gravity}}0!=this.moy?(this.mx=this.horizontal,this.my=0):(this.mx=0!=this.mox?0:this.horizontal,this.my=this.vertical);this.set_modifierX(this.mox+this.mx);this.set_modifierY(this.moy+this.my);if(0!=this._speedX||0!=this._modifierX){this._speedX+=this._modifierX;this._speedX*=q.physics_base_drag;if(0==this.mx&&0!=this.moy||
  236. 0>this._speedX&&0<this.mx||0<this._speedX&&0>this.mx)this._speedX*=q.physics_no_modifier_drag;16<this._speedX?this._speedX=16:-16>this._speedX?this._speedX=-16:1E-4>this._speedX&&-1E-4<this._speedX&&(this._speedX=0)}if(0!=this._speedY||0!=this._modifierY){this._speedY+=this._modifierY;this._speedY*=q.physics_base_drag;if(0==this.my&&0!=this.mox||0>this._speedY&&0<this.my||0<this._speedY&&0>this.my)this._speedY*=q.physics_no_modifier_drag;16<this._speedY?this._speedY=16:-16>this._speedY?this._speedY=
  237. -16:1E-4>this._speedY&&-1E-4<this._speedY&&(this._speedY=0)}var a=this.x%1,b=this._speedX,c=this.y%1,d=this._speedY;for(this.doney=this.donex=!1;0!=b&&!this.donex||0!=d&&!this.doney;){this.ox=this.x;this.oy=this.y;var e=b;var f=d;0<b?1<=b+a?(this.x+=1-a,this.x=this.chopFloat(this.x),b-=1-a,a=0):(this.x+=b,b=0):0>b&&(0!=a&&0>a+b?(b+=a,this.x-=a,this.x=this.chopFloat(this.x),a=1):(this.x+=b,b=0));this.world.overlaps(this.get_rect(),this.godmode)&&(this.x=this.ox,this._speedX=0,b=e,this.donex=!0);0<
  238. d?1<=d+c?(this.y+=1-c,this.y=this.chopFloat(this.y),d-=1-c,c=0):(this.y+=d,d=0):0>d&&(0!=c&&0>c+d?(this.y-=c,this.y=this.chopFloat(this.y),d+=c,c=1):(this.y+=d,d=0));this.world.overlaps(this.get_rect(),this.godmode)&&(this.y=this.oy,this._speedY=0,d=f,this.doney=!0)}if(this.isMe){a=1;b=!1;this.spacejustdown&&(this.lastJump=-l.get_currentMS(),b=!0,a=-1);this.spacedown&&(0>this.lastJump?750<l.get_currentMS()+this.lastJump&&(b=!0):150<l.get_currentMS()-this.lastJump&&(b=!0));b&&(0!=this.get_speedX()||
  239. 0==this.morx||0==this.mox||0!=this.x%16&&0!=this.x%8||(this.set_speedX(this.get_speedX()-this.morx*q.physics_jump_height),this.changed=!0,this.lastJump=l.get_currentMS()*a),0!=this.get_speedY()||0==this.mory||0==this.moy||0!=this.y%16&&0!=this.y%8||(this.set_speedY(this.get_speedY()-this.mory*q.physics_jump_height),this.changed=!0,this.lastJump=l.get_currentMS()*a));if(this.changed||this.oh!=this.horizontal||this.ov!=this.vertical)this.oh=this.horizontal,this.ov=this.vertical,this.screen.con.connected&&
  240. this.screen.con.send("m",this.x,this.y,this.get_speedX(),this.get_speedY(),this.get_modifierX(),this.get_modifierY(),this.horizontal,this.vertical);this.changed=!1}this.get_speedX();this.get_speedY();.1>this._modifierX&&-.1<this._modifierX&&(a=this.x%16,2>a?this.x=.2>a?this.chopFloat(this.x):this.x-a/15:14<a&&(15.8<a?(this.x=this.chopFloat(this.x),this.x++):this.x+=(a-14)/15));.1>this._modifierY&&-.1<this._modifierY&&(a=this.y%16,2>a?this.y=.2>a?this.chopFloat(this.y):this.y-a/15:14<a&&(15.8<a?(this.y=
  241. this.chopFloat(this.y),this.y++):this.y+=(a-14)/15));this.isMe&&(this.spacejustdown=!1)},queueShift:function(){var a=this.queue[0];this.queue[0]=this.queue[1];this.queue[1]=0;return a},queuePush:function(a){this.queue[1]=a},chopFloat:function(a){return 0>a?Math.ceil(a):Math.floor(a)},render:function(a,b,c){b=Math.floor(this.x+b);c=Math.floor(this.y+c);this.godmode&&a.draw(C.auraGod,new B(0,0,C.auraGod.width,C.auraGod.height),b-8,c-8);a.draw(C.player,new B(16*this.face,0,16,C.player.height),b,c);this.screen.showNames&&
  242. (b=Math.floor(b+8-this.nameBM.get_width()/2),c=Math.floor(c+17),a.drawBitmap(this.nameBM,this.nameBM.get_rect(),b,c))},get_minimapColor:function(){return this.isMe?-16711936:-1},__class__:J};var oa=function(a){this.map=[];a=a.split("\n");this.width=a[0].split(",").length;this.height=a.length;for(var b=0,c=a.length;b<c;){var h=b++,d=a[h].split(",");this.map[h]=[];for(var f=0,g=d.length;f<g;){var k=f++,l=e.parseInt(d[k]);null!=D.getBrickById(l)?this.map[h][k]=l:this.map[h][k]=0}}};oa.__name__=!0;oa.prototype=
  243. {inBounds:function(a,b){return 0<=a&&a<this.width&&0<=b&&b<this.height},setBlock:function(a,b,c){this.inBounds(a,b)&&(this.map[b][a]=c)},getBlock:function(a,b){return this.inBounds(a,b)?this.map[b][a]:-1},overlaps:function(a,b){null==b&&(b=!1);if(0>a.x||0>a.y||a.x+a.width>16*this.width||a.y+a.height>16*this.height)return!0;if(b)return!1;for(var c=Math.floor(a.x/16),h=Math.floor((a.x+a.width-q.E)/16),d=Math.floor(a.y/16),e=Math.floor((a.y+a.height-q.E)/16)+1;d<e;)for(var f=d++,g=c,m=h+1;g<m;){var k=
  244. g++;if(4<this.getBlock(k,f))return!0}return!1},__class__:oa};var da=function(a,b,c){this.id=a;this.hasShadow=b;this.minimapColor=-1==c?-16777216:c};da.__name__=!0;da.prototype={__class__:da};var D=function(){};D.__name__=!0;D.init=function(){D.createBrick(0,!1,-16777216);D.createBrick(1,!1,-16777216);D.createBrick(2,!1,-16777216);D.createBrick(3,!1,-16777216);D.createBrick(4,!1,-16777216);D.createBrick(5,!0,-9539986);D.createBrick(6,!0,-13282648);D.createBrick(7,!0,-6867545);D.createBrick(8,!0,-5753516);
  245. D.createBrick(9,!0,-7100363);D.createBrick(10,!0,-12408778);D.createBrick(11,!0,-13263194);D.createBrick(12,!0,-3174366);D.createBrick(13,!0,-7651831);D.createBrick(14,!0,-14389427);D.createBrick(15,!0,-11656081);D.createBrick(16,!0,-12352752);D.createBrick(17,!0,-6184027);D.createBrick(18,!0,-2131391);D.createBrick(19,!0,-1005273);D.createBrick(20,!0,16777216)};D.createBrick=function(a,b,c){null==c&&(c=-1);b=new da(a,b,c);return D.bricks.h[a]=b};D.getBrickById=function(a){return D.bricks.h[a]};A=
  246. function(){this.m=[];this.identity()};A.__name__=!0;A.prototype={identity:function(){this.m=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]},translate:function(a,b,c){this.m=this.multiplyMatrices(this.m,[1,0,0,0,0,1,0,0,0,0,1,0,a,b,c,1])},multiplyMatrixAndPoint:function(a,b){var c=b[0],h=b[1],d=b[2],e=b[3];return[c*a[0]+h*a[4]+d*a[8]+e*a[12],c*a[1]+h*a[5]+d*a[9]+e*a[13],c*a[2]+h*a[6]+d*a[10]+e*a[14],c*a[3]+h*a[7]+d*a[11]+e*a[15]]},multiplyMatrices:function(a,b){var c=[b[1],b[5],b[9],b[13]],h=[b[2],b[6],b[10],b[14]],
  247. d=[b[3],b[7],b[11],b[15]],e=this.multiplyMatrixAndPoint(a,[b[0],b[4],b[8],b[12]]),c=this.multiplyMatrixAndPoint(a,c),h=this.multiplyMatrixAndPoint(a,h),d=this.multiplyMatrixAndPoint(a,d);return[e[0],c[0],h[0],d[0],e[1],c[1],h[1],d[1],e[2],c[2],h[2],d[2],e[3],c[3],h[3],d[3]]},toArray:function(){return new Float32Array(this.m)},__class__:A};var ka=function(a,b,c){this.vertCounter=0;this.active=!1;this.world=a;this.chunkX=b;this.chunkY=c;0<=b&&0<=c&&b<a.width/q.renderer_chunk_size&&c<a.height/q.renderer_chunk_size&&
  248. this.init()};ka.__name__=!0;ka.prototype={init:function(){this.x=this.chunkX*q.renderer_chunk_size;this.y=this.chunkY*q.renderer_chunk_size;this.cols=Math.min((this.chunkX+1)*q.renderer_chunk_size,this.world.width)-this.x;this.rows=Math.min((this.chunkY+1)*q.renderer_chunk_size,this.world.height)-this.y;this.numBlocks=this.cols*this.rows;this.gl=t.gl;this.positionBuffer=this.gl.createBuffer();this.indexBuffer=this.gl.createBuffer();this.active=!0;this.update()},update:function(){if(this.active){this.verts=
  249. Array(20*this.numBlocks);this.indecies=Array(6*this.numBlocks);this.vertCounter=0;for(var a=this.y,b=this.y+this.rows;a<b;)for(var c=a++,d=this.x,e=this.x+this.cols;d<e;){var f=d++,g=this.world.map[c][f];null!=D.getBrickById(g)&&this.addRect(16*f,16*c,16,16,0,16*g,0,16,16)}this.indexBufferLength=this.indecies.length;this.gl.bindBuffer(34962,this.positionBuffer);this.gl.bufferData(34962,new Float32Array(pa.toArray(this.verts)),35048);this.gl.bindBuffer(34963,this.indexBuffer);this.gl.bufferData(34963,
  250. new Uint16Array(pa.toArray(this.indecies)),35048)}},destroy:function(){this.active&&(this.gl.deleteBuffer(this.positionBuffer),this.gl.deleteBuffer(this.indexBuffer),this.active=!1)},render:function(){this.active&&(this.gl.bindBuffer(34962,this.positionBuffer),this.gl.bindBuffer(34963,this.indexBuffer),this.gl.enableVertexAttribArray(K.basic.aPosition),this.gl.enableVertexAttribArray(K.basic.aTexCoord),this.gl.vertexAttribPointer(K.basic.aPosition,3,5126,!1,20,0),this.gl.vertexAttribPointer(K.basic.aTexCoord,
  251. 2,5126,!1,20,12),this.gl.drawElements(4,this.indexBufferLength,5123,0))},addRect:function(a,b,c,d,e,f,g,k,l){var h=this.vertCounter;c=a+c;d=b+d;var m=f/Q.blocks.width;f=(f+k)/Q.blocks.width;k=g/Q.blocks.height;g=(g+l)/Q.blocks.height;this.placeVert(a,b,e,m,k);this.placeVert(c,b,e,f,k);this.placeVert(c,d,e,f,g);this.placeVert(a,d,e,m,g);a=6*h;this.indecies[a]=h;this.indecies[a+1]=h+1;this.indecies[a+2]=h+2;this.indecies[a+3]=h+2;this.indecies[a+4]=h+3;this.indecies[a+5]=h},placeVert:function(a,b,c,
  252. d,e){var h=5*this.vertCounter;this.verts[h]=a;this.verts[h+1]=b;this.verts[h+2]=c;this.verts[h+3]=d;this.verts[h+4]=e;this.vertCounter++},__class__:ka};var t=function(){};t.__name__=!0;t.load=function(){null==t.gl&&(t.canvas=window.document.createElement("canvas"),t.canvas.width=q.gameplay_width,t.canvas.height=q.gameplay_height,t.container=window.document.getElementById("game-world"),t.gl=fa.getContextWebGL(t.canvas,{antialias:!1,alpha:!1}),K.load())};t.init=function(){null==t.gl||t.inited||(K.init(),
  253. Q.init(),t.gl.clearColor(0,0,0,1),t.gl.enable(2929),t.gl.clear(16640),t.inited=!0)};t.activate=function(a){if(!t.active){t.active=!0;t.container.appendChild(t.canvas);t.world=a;t.chunks=new N;t.toRefresh=new N;for(var b=0,c=a.height/q.renderer_chunk_size;b<c;)for(var h=b++,d=0,e=a.width/q.renderer_chunk_size;d<e;){var f=d++;t.chunks.set(t.getChunkId(f,h),new ka(a,f,h))}t.transform.identity()}};t.getChunkId=function(a,b){return a+"x"+b};t.deactivate=function(){if(t.active){t.active=!1;t.world=null;
  254. for(var a=t.chunks.iterator();a.hasNext();)a.next().destroy();t.chunks=null;t.transform.identity();t.container.removeChild(t.container.firstChild)}};t.update=function(a,b){if(t.active){t.transform.identity();t.transform.translate(a,b,0);for(var c=t.toRefresh.iterator();c.hasNext();)c.next().update();t.render(a,b);for(c=t.toRefresh.keys();c.hasNext();){var h=c.next();t.toRefresh.remove(h)}}};t.refreshBlock=function(a,b){if(t.world.inBounds(a,b)){var c=t.getChunkId(Math.floor(a/q.renderer_chunk_size),
  255. Math.floor(b/q.renderer_chunk_size));t.toRefresh.exists(c)||t.toRefresh.set(c,t.chunks.get(c))}};t.render=function(a,b){t.gl.clear(16640);t.gl.useProgram(K.basic.program);t.gl.uniform2f(K.basic.uResolution,t.gl.drawingBufferWidth,t.gl.drawingBufferHeight);t.gl.uniformMatrix4fv(K.basic.uMatrix,!1,t.transform.toArray());t.gl.bindTexture(3553,Q.blocks.id);for(var c=16*q.renderer_chunk_size,h=Math.floor(-a/c),d=Math.floor((-a+q.gameplay_width-q.E)/c),e=Math.floor(-b/c),c=Math.floor((-b+q.gameplay_height-
  256. q.E)/c)+1;e<c;)for(var f=e++,g=h,k=d+1;g<k;){var m=g++,m=t.chunks.get(t.getChunkId(m,f));null!=m&&m.render()}};var ea=function(){this.sourceVertex=this.sourceFragment=""};ea.__name__=!0;ea.prototype={load:function(){},init:function(){},done:function(){},compile:function(){if(null!=this.program)return!0;var a=this.createShader(t.gl,35633,this.sourceVertex),b=this.createShader(t.gl,35632,this.sourceFragment);return null!=a&&null!=b?(this.program=this.createProgram(t.gl,a,b),null!=this.program&&this.done(),
  257. null!=this.program):!1},createShader:function(a,b,c){b=a.createShader(b);a.shaderSource(b,c);a.compileShader(b);if(a.getShaderParameter(b,35713))return b;g.log(a.getShaderInfoLog(b));a.deleteShader(b);return null},createProgram:function(a,b,c){var d=a.createProgram();a.attachShader(d,b);a.attachShader(d,c);a.linkProgram(d);if(a.getProgramParameter(d,35714))return d;g.log(a.getProgramInfoLog(d));a.deleteProgram(d);return null},__class__:ea};var la=function(){ea.call(this)};la.__name__=!0;la.__super__=
  258. ea;la.prototype=d(ea.prototype,{load:function(){var a=this;n.loadTextFile("shaders/basic-vertex.shader",function(b){a.sourceVertex=b});n.loadTextFile("shaders/basic-fragment.shader",function(b){a.sourceFragment=b})},init:function(){this.compile()},done:function(){this.aPosition=t.gl.getAttribLocation(this.program,"a_position");this.aTexCoord=t.gl.getAttribLocation(this.program,"a_texCoord");this.uResolution=t.gl.getUniformLocation(this.program,"u_resolution");this.uMatrix=t.gl.getUniformLocation(this.program,
  259. "u_matrix")},__class__:la});var K=function(){};K.__name__=!0;K.load=function(){K.loaded||(K.loaded=!0,K.basic.load())};K.init=function(){K.loaded&&!K.inited&&(K.inited=!0,K.basic.init())};var ma=function(a){this.width=a.width;this.height=a.height;this.id=t.gl.createTexture();t.gl.bindTexture(3553,this.id);t.gl.texParameteri(3553,10242,33071);t.gl.texParameteri(3553,10243,33071);t.gl.texParameteri(3553,10241,9728);t.gl.texParameteri(3553,10240,9728);t.gl.texImage2D(3553,0,6408,6408,5121,a)};ma.__name__=
  260. !0;ma.prototype={__class__:ma};var Q=function(){};Q.__name__=!0;Q.init=function(){Q.inited||(Q.inited=!0,Q.blocks=new ma(C.blocks))};var R=function(){u.call(this)};R.__name__=!0;R.__super__=u;R.prototype=d(u.prototype,{init:function(){},update:function(){},tick:function(){},postUpdate:function(){},kill:function(){},__class__:R});var na=function(){u.call(this)};na.__name__=!0;na.__super__=R;na.prototype=d(R.prototype,{init:function(){this.addChild(new y(C.joinBackground))},__class__:na});var E=function(){this.loader=
  261. new u;u.call(this)};E.__name__=!0;E.prepare=function(a){-1<E.step||(E.step++,E.loaderGrey=y.fromFile("img/loader/loader-grey.min.png",E.stepReady),E.loaderColor=y.fromFile("img/loader/loader-color.min.png",E.stepReady),E.readyCallback=a)};E.stepReady=function(){E.step++;2==E.step&&E.readyCallback()};E.__super__=R;E.prototype=d(R.prototype,{init:function(){this.loader.x=f.width/2;this.loader.y=f.height/2;this.loader.scaleX=this.loader.scaleY=.85;this.addChild(this.loader);E.loaderGrey.x=-E.loaderGrey.get_width()/
  262. 2;E.loaderGrey.y=-E.loaderGrey.get_height()/2;this.loader.addChild(E.loaderGrey);E.loaderColor.x=-E.loaderColor.get_width()/2;E.loaderColor.y=-E.loaderColor.get_height()/2;E.loaderColor.clipRect.width=E.loaderColor.get_width()/3;this.loader.addChild(E.loaderColor)},update:function(){E.loaderColor.clipRect.width=E.loaderColor.get_imageWidth()*n.get_progress()},__class__:E});var V=function(a){this.nameDisallow=new c("[^a-z0-9]","g");this.onlineText=new W(". . .","Asap Medium",14,16777215);this.levels=
  263. new N;u.call(this);this.joinCallback=a};V.__name__=!0;V.__super__=R;V.prototype=d(R.prototype,{init:function(){var a=this;this.addChild(new y(C.lobbyArt1));this.addChild(new y(C.lobbyBackground));this.onlineText.x=28;this.onlineText.y=82;this.addChild(this.onlineText);this.nameInput=window.document.createElement("input");this.nameInput.style.position="absolute";this.nameInput.style.left="230px";this.nameInput.style.top="50px";this.nameInput.style.width="180px";this.nameInput.style.height=this.nameInput.style.lineHeight=
  264. "30px";this.nameInput.style.fontFamily="Asap Medium, sans-serif";this.nameInput.style.fontSize="14px";this.nameInput.style.border="1px solid #fff";this.nameInput.style.borderRadius="3px";this.nameInput.style.background="#333";this.nameInput.style.color="#fff";this.nameInput.style.padding="0 4px";this.nameInput.value=V.username;this.nameInput.maxLength=15;this.nameInput.addEventListener("input",function(){a.nameInput.value=a.nameInput.value.toLowerCase();a.nameInput.value=a.nameDisallow.replace(a.nameInput.value,
  265. "");V.username=2<=a.nameInput.value.length?a.nameInput.value:"kekekekekeke"});this.inputContainer=window.document.getElementById("game-input");this.inputContainer.appendChild(this.nameInput);for(var b=0;5>b;)for(var c=b++,d=0;9>d;){var e=d++,f=[e+"x"+c],g=new y(C.lobbyLevel);g.x=16+68*e;g.y=130+68*c;g.addEventListener("click",function(b){return function(c){a.joinCallback(b[0],V.username)}}(f));g.clipRect.width=64;g.mouseEnabled=g.buttonMode=!0;this.levels.set(f[0],g);this.addChild(g)}},refresh:function(a){for(var b=
  266. 0,c=0,d=a.length;c<d;){var h=c++,h=a[h];if(this.levels.exists(h.id)){var e=45<h.onlineUsers?5:30<h.onlineUsers?4:20<h.onlineUsers?3:10<h.onlineUsers?2:0<h.onlineUsers?1:0;b+=h.onlineUsers;this.levels.get(h.id).clipRect.x=64*e}}this.onlineText.set_text(b+" players online")},kill:function(){this.inputContainer.removeChild(this.nameInput)},__class__:V});var O=function(a,b){this.showNamesLastSpeeds=!1;this.showNamesTimer=-1;this.showNames=!1;this.players=new S;this.blockQueue=[];this.erasing=this.drawing=
  267. !1;this.camera=new L(0,0);var c=this;u.call(this);this.con=a;this.world=new oa(b.getString(5));var d=b.getInt(0);this.player=new J(d,b.getString(1),this.world,this);this.player.isMe=!0;this.player.face=b.getInt(2);this.player.x=b.getDouble(3);this.player.y=b.getDouble(4);this.players.h[d]=this.player;this.camera.x=this.player.x;this.camera.y=this.player.y;a.addMessageCallback("m",function(a){var b=a.getInt(0);b!=d&&c.players.h.hasOwnProperty(b)&&(b=c.players.h[b],b.x=a.getDouble(1),b.y=a.getDouble(2),
  268. b.set_speedX(a.getDouble(3)),b.set_speedY(a.getDouble(4)),b.set_modifierX(a.getDouble(5)),b.set_modifierY(a.getDouble(6)),b.horizontal=a.getDouble(7),b.vertical=a.getDouble(8))});a.addMessageCallback("add",function(a){var b=a.getInt(0);if(!c.players.h.hasOwnProperty(b)){var d=new J(b,a.getString(1),c.world,c);0<=a.getInt(2)&&5>=a.getInt(2)?d.face=a.getInt(2):d.face=0;d.x=a.getDouble(3);d.y=a.getDouble(4);d.godmode=a.getBoolean(5);c.players.h[b]=d}});a.addMessageCallback("left",function(a){c.players.remove(a.getInt(0))});
  269. a.addMessageCallback("b",function(a){c.world.inBounds(a.getInt(0),a.getInt(1))&&null!=D.getBrickById(a.getInt(2))&&c.blockQueue.push({x:a.getInt(0),y:a.getInt(1),type:a.getInt(2)})});a.addMessageCallback("face",function(a){var b=a.getInt(0);a=a.getInt(1);!c.players.h.hasOwnProperty(b)||0>a||7<a||(c.players.h[b].face=a,b==d&&c.ui.menubar.selectFace.set_selection(a))});a.addMessageCallback("god",function(a){var b=a.getInt(0);if(c.players.h.hasOwnProperty(b)){var h=c.players.h[b];h.godmode=a.getBoolean(1);
  270. b==d&&(c.ui.menubar.btnGodMode.clipRect.x=h.godmode?c.ui.menubar.btnGodMode.clipRect.width:0)}})};O.__name__=!0;O.__super__=R;O.prototype=d(R.prototype,{init:function(){var a=this;t.activate(this.world);this.renderer=new w(q.gameplay_width,q.gameplay_height);this.renderer.mouseEnabled=!0;this.addChild(this.renderer);this.renderer.addEventListener("mouseDown",function(b){if(1==b.which){b=f.input.mouseX;var c=f.input.mouseY;0<=b&&0<=c&&b<q.gameplay_width&&c<q.gameplay_height&&(a.drawing=!0)}});f.stage.addEventListener("mouseUp",
  271. b(this,this.mouseUp));this.ui=new X(this.world);this.addChild(this.ui);this.ui.menubar.lobbyCallback=function(){a.con.disconnect()};this.ui.menubar.godModeCallback=b(this,this.toggleGodMode);this.ui.menubar.btnMinimap.clipRect.x=O.minimapOpen?this.ui.menubar.btnMinimap.clipRect.width:0;this.ui.menubar.minimapCallback=b(this,this.toggleMinimap);this.ui.menubar.selectFace.callback=function(b){a.con.send("face",b)};this.ui.minimap.visible=O.minimapOpen},mouseUp:function(a){1==a.which&&(this.drawing=
  272. !1)},setTile:function(a,b,c){this.world.inBounds(a,b)&&(this.world.setBlock(a,b,c),this.ui.minimap.updatePixel(a,b),t.refreshBlock(a,b))},toggleGodMode:function(){this.con.send("god",!this.player.godmode)},toggleMinimap:function(){O.minimapOpen=!O.minimapOpen;this.ui.minimap.visible=O.minimapOpen;this.ui.menubar.btnMinimap.clipRect.x=O.minimapOpen?this.ui.menubar.btnMinimap.clipRect.width:0},update:function(){for(var a=0;this.blockQueue.length>a;){for(var b=this.blockQueue[a],c=0;a>c;)this.blockQueue[c].x==
  273. b.x&&this.blockQueue[c].y==b.y?(this.blockQueue.splice(c,1),a--):c++;this.player.godmode||5>b.type||!this.player.get_rect().intersects(new B(16*b.x,16*b.y,16,16))?(this.setTile(b.x,b.y,b.type),this.blockQueue.splice(a,1)):a++}for(a=this.players.iterator();a.hasNext();)a.next().update();v.keyPressed(r.G)&&this.toggleGodMode();v.keyPressed(r.M)&&this.toggleMinimap();this.showNames=v.keyDown(r.SHIFT);if(!this.showNames){if(a=8>Math.abs(this.player.get_speedX())&&8>Math.abs(this.player.get_speedY()))this.showNamesLastSpeeds?
  274. l.get_currentMS()>=this.showNamesTimer+1500&&(this.showNames=!0):(this.showNames=!1,this.showNamesTimer=l.get_currentMS());this.showNamesLastSpeeds=a}a=this.erasing;(this.erasing=v.keyDown(r.SHIFT))&&!a?this.ui.menubar.selectBlocks.selector.x=0:!this.erasing&&a&&(this.ui.menubar.selectBlocks.selector.x=16*this.ui.menubar.selectBlocks.get_selection());this.drawing&&(b=f.input.mouseX,a=f.input.mouseY,0<=b&&0<=a&&b<q.gameplay_width&&a<q.gameplay_height&&(a=Math.floor((a+this.camera.y)/16),b=Math.floor((b+
  275. this.camera.x)/16),c=this.erasing?0:this.ui.menubar.selectBlocks.get_selection(),this.world.inBounds(b,a)&&this.world.map[a][b]!=c&&this.con.send("b",b,a,c)))},tick:function(){for(var a=this.players.iterator();a.hasNext();)a.next().tick();this.camera.x+=(this.player.x-q.game_width/2-this.camera.x)*q.camera_lag;this.camera.y+=(this.player.y-q.game_height/2-this.camera.y)*q.camera_lag},postUpdate:function(){var a=Math.round(-this.camera.x),b=Math.round(-this.camera.y);t.update(a,b);this.render(a,b);
  276. this.ui.minimap.updateMap(this.players)},render:function(a,b){this.renderer.fillRect(this.renderer.get_rect());for(var c=this.players.iterator();c.hasNext();){var d=c.next();d==this.player||d.godmode||d.render(this.renderer,a,b)}for(c=this.players.iterator();c.hasNext();)d=c.next(),d!=this.player&&d.godmode&&d.render(this.renderer,a,b);this.player.render(this.renderer,a,b)},kill:function(){t.deactivate();f.stage.removeEventListener("mouseUp",b(this,this.mouseUp))},__class__:O});var ha=function(){var a=
  277. this;u.call(this);this.bg=new y(C.menubarBackground);this.addChild(this.bg);this.btnLobby=new y(C.menubarLobby);this.btnLobby.x=1;this.btnLobby.y=1;this.btnLobby.mouseEnabled=this.btnLobby.buttonMode=!0;this.btnLobby.addEventListener("click",function(b){null!=a.lobbyCallback&&a.lobbyCallback()});this.addChild(this.btnLobby);this.btnGodMode=new y(C.menubarGodMode);this.btnGodMode.x=30;this.btnGodMode.y=1;this.btnGodMode.mouseEnabled=this.btnGodMode.buttonMode=!0;this.btnGodMode.clipRect.width/=2;this.btnGodMode.addEventListener("click",
  278. function(b){null!=a.godModeCallback&&a.godModeCallback()});this.addChild(this.btnGodMode);this.btnMinimap=new y(C.menubarMinimap);this.btnMinimap.x=611;this.btnMinimap.y=1;this.btnMinimap.mouseEnabled=this.btnMinimap.buttonMode=!0;this.btnMinimap.clipRect.width/=2;this.btnMinimap.addEventListener("click",function(b){null!=a.minimapCallback&&a.minimapCallback()});this.addChild(this.btnMinimap);this.selectFace=new aa(new y(C.player));this.selectFace.x=77;this.selectFace.y=11;this.addChild(this.selectFace);
  279. this.selectBlocks=new aa(new y(C.blocks));this.selectBlocks.x=218;this.selectBlocks.y=11;this.addChild(this.selectBlocks)};ha.__name__=!0;ha.__super__=u;ha.prototype=d(u.prototype,{__class__:ha});var ia=function(a){u.call(this);this.world=a;this.renderer=new w(a.width,a.height);this.addChild(this.renderer);this.blocksBM=new w(a.width,a.height);this.playersBM=new w(a.width,a.height);this.resetMap();this.updateMap(null)};ia.__name__=!0;ia.__super__=u;ia.prototype=d(u.prototype,{updatePixel:function(a,
  280. b){if(this.world.inBounds(a,b)){var c=D.getBrickById(this.world.map[b][a]).minimapColor;this.blocksBM.setPixel(a,b,c)}},resetMap:function(){for(var a=0,b=this.world.height;a<b;)for(var c=a++,d=0,e=this.world.width;d<e;){var f=d++;this.updatePixel(f,c)}},updateMap:function(a){null!=a&&this.renderPlayers(a);this.renderer.fillRect(this.renderer.get_rect());this.blocksBM.update();this.renderer.drawBitmap(this.blocksBM,this.blocksBM.get_rect(),0,0);this.playersBM.update();this.renderer.drawBitmap(this.playersBM,
  281. this.playersBM.get_rect(),0,0)},renderPlayers:function(a){for(var b=0,c=this.world.height;b<c;)for(var d=b++,e=0,h=this.world.width;e<h;){var f=e++,g=this.playersBM.getPixel(f,d);this.playersBM.setPixel(f,d,Math.floor(.984375*((g&-16777216)>>>24))<<24|g&16777215)}b=null;for(a=a.iterator();a.hasNext();)c=a.next(),c.isMe?b=c:this.renderPlayer(c);this.renderPlayer(b)},renderPlayer:function(a){this.playersBM.setPixel(Math.floor(a.x/16),Math.floor(a.y/16),a.get_minimapColor())},__class__:ia});var X=function(a){u.call(this);
  282. this.menubar=new ha;this.menubar.y=q.gameplay_height;this.addChild(this.menubar);this.minimap=new ia(a);this.minimap.x=q.gameplay_width-a.width-2;this.minimap.y=q.gameplay_height-a.height-2;this.addChild(this.minimap)};X.__name__=!0;X.__super__=u;X.prototype=d(u.prototype,{__class__:X});var aa=function(a){this._selection=0;var b=this;u.call(this);this.image=a;a.mouseEnabled=a.buttonMode=!0;a.addEventListener("click",function(c){c=b.globalToLocal(f.input.mouseX,f.input.mouseY);c=Math.max(Math.min(c.x,
  283. a.get_width()-1),0);c=Math.floor(c/16);b.get_selection()!=c&&(b.set_selection(c),null!=b.callback&&b.callback(b.get_selection()))});this.addChild(a);this.selector=new y(C.menubarSelector);this.addChild(this.selector)};aa.__name__=!0;aa.__super__=u;aa.prototype=d(u.prototype,{get_selection:function(){return this._selection},set_selection:function(a){0>a?this._selection=0:a>=this.image.get_width()/16?this._selection=Math.floor(this.image.get_width()/16)-1:this._selection=a;this.selector.x=16*this._selection;
  284. return this._selection},__class__:aa});var U=function(a){Error.call(this);this.val=a;this.message=String(a);Error.captureStackTrace&&Error.captureStackTrace(this,U)};U.__name__=!0;U.__super__=Error;U.prototype=d(Error.prototype,{__class__:U});var G=function(){};G.__name__=!0;G.getClass=function(a){if(a instanceof Array&&null==a.__enum__)return Array;var b=a.__class__;if(null!=b)return b;a=G.__nativeClassName(a);return null!=a?G.__resolveNativeClass(a):null};G.__string_rec=function(a,b){if(null==a)return"null";
  285. if(5<=b.length)return"<...>";var c=typeof a;"function"==c&&(a.__name__||a.__ename__)&&(c="object");switch(c){case "object":if(a instanceof Array){if(a.__enum__){if(2==a.length)return a[0];c=a[0]+"(";b+="\t";for(var d=2,e=a.length;d<e;)var f=d++,c=2!=f?c+(","+G.__string_rec(a[f],b)):c+G.__string_rec(a[f],b);return c+")"}c=a.length;d="[";b+="\t";for(e=0;e<c;)f=e++,d+=(0<f?",":"")+G.__string_rec(a[f],b);return d+"]"}try{d=a.toString}catch(wa){return wa instanceof U&&(wa=wa.val),"???"}if(null!=d&&d!=
  286. Object.toString&&"function"==typeof d&&(c=a.toString(),"[object Object]"!=c))return c;c=null;d="{\n";b+="\t";e=null!=a.hasOwnProperty;for(c in a)e&&!a.hasOwnProperty(c)||"prototype"==c||"__class__"==c||"__super__"==c||"__interfaces__"==c||"__properties__"==c||(2!=d.length&&(d+=", \n"),d+=b+c+" : "+G.__string_rec(a[c],b));b=b.substring(1);return d+("\n"+b+"}");case "function":return"<function>";case "string":return a;default:return String(a)}};G.__interfLoop=function(a,b){if(null==a)return!1;if(a==
  287. b)return!0;var c=a.__interfaces__;if(null!=c)for(var d=0,e=c.length;d<e;){var f=d++,f=c[f];if(f==b||G.__interfLoop(f,b))return!0}return G.__interfLoop(a.__super__,b)};G.__instanceof=function(a,b){if(null==b)return!1;switch(b){case ya:return(a|0)===a;case ta:return"number"==typeof a;case va:return"boolean"==typeof a;case String:return"string"==typeof a;case Array:return a instanceof Array&&null==a.__enum__;case xa:return!0;default:if(null!=a)if("function"==typeof b){if(a instanceof b||G.__interfLoop(G.getClass(a),
  288. b))return!0}else{if("object"==typeof b&&G.__isNativeObj(b)&&a instanceof b)return!0}else return!1;return b==Y&&null!=a.__name__||b==qa&&null!=a.__ename__?!0:a.__enum__==b}};G.__cast=function(a,b){if(G.__instanceof(a,b))return a;throw new U("Cannot cast "+e.string(a)+" to "+e.string(b));};G.__nativeClassName=function(a){a=G.__toStr.call(a).slice(8,-1);return"Object"==a||"Function"==a||"Math"==a||"JSON"==a?null:a};G.__isNativeObj=function(a){return null!=G.__nativeClassName(a)};G.__resolveNativeClass=
  289. function(a){return Function("return typeof "+a+' != "undefined" ? '+a+" : null")()};var fa=function(){};fa.__name__=!0;fa.getContextWebGL=function(a,b){for(var c=0,d=["webgl","experimental-webgl"];c<d.length;){var e=d[c];++c;e=a.getContext(e,b);if(null!=e)return e}return null};var ga,ua=0;Array.prototype.indexOf&&(a.indexOf=function(a,b,c){return Array.prototype.indexOf.call(a,b,c)});String.prototype.__class__=String;String.__name__=!0;Array.__name__=!0;Date.prototype.__class__=Date;Date.__name__=
  290. ["Date"];var ya={__name__:["Int"]},xa={__name__:["Dynamic"]},ta=Number;ta.__name__=["Float"];var va=Boolean;va.__ename__=["Bool"];var Y={__name__:["Class"]},qa={},ra={};f.started=!1;f.wasLoaded=!1;f.mouseSpriteTransform=new k;n.inited=!1;n.finished=!1;n.tasks=[];l.startTime=0;l.lastTime=0;l.elapsedTime=0;I.PI2=2*Math.PI;F.FOCUS="focus";F.BLUR="blur";F.ENTER_FRAME="enterFrame";F.EXIT_FRAME="exitFrame";x.KEY_DOWN="keyDown";x.KEY_UP="keyUp";M.CLICK="click";M.MOUSE_DOWN="mouseDown";M.MOUSE_UP="mouseUp";
  291. M.MOVE="move";r.BACKSPACE=8;r.TAB=9;r.ENTER=13;r.SHIFT=16;r.CTRL=17;r.ALT=18;r.PAUSE=19;r.CAPS_LOCK=20;r.ESC=27;r.SPACE=32;r.PAGE_UP=33;r.PAGE_DOWN=34;r.END=35;r.HOME=36;r.LEFT=37;r.UP=38;r.RIGHT=39;r.DOWN=40;r.PRINT_SCREEN=42;r.INSERT=45;r.DELETE=46;r.ZERO=48;r.ONE=49;r.TWO=50;r.THREE=51;r.FOUR=52;r.FIVE=53;r.SIX=54;r.SEVEN=55;r.EIGHT=56;r.NINE=57;r.A=65;r.B=66;r.C=67;r.D=68;r.E=69;r.F=70;r.G=71;r.H=72;r.I=73;r.J=74;r.K=75;r.L=76;r.M=77;r.N=78;r.O=79;r.P=80;r.Q=81;r.R=82;r.S=83;r.T=84;r.U=85;r.V=
  292. 86;r.W=87;r.X=88;r.Y=89;r.Z=90;r.F1=112;r.F2=113;r.F3=114;r.F4=115;r.F5=116;r.F6=117;r.F7=118;r.F8=119;r.F9=120;r.F10=121;r.F11=122;r.F12=123;r.SEMICOLON=186;r.PLUS=187;r.COMMA=188;r.MINUS=189;r.PERIOD=190;r.FORWAD_SLASH=191;r.BACK_SLASH=220;r.QUOTES=222;v.inited=!1;v.keys=new S;v.keysOld=new S;z.TYPE_CTX_VAR=0;z.TYPE_CTX_FUNC=1;z.TYPE_SYS_VAR=2;z.TYPE_SYS_FUNC=3;q.E=1E-4;q.game_width=640;q.game_height=500;q.gameplay_width=640;q.gameplay_height=470;q.playerio_game_id="haxee-kly8bgop0oow8ymx9kpaw";
  293. q.developer_server="127.0.0.1:8184";q.use_development_server=!1;q.room_prefix="";q.server_type_version=2;q.server_type_normalroom="Play"+q.server_type_version;q.physics_ms_per_tick=10;q.physics_max_ticks=15;q.physics_variable_multiplyer=7.752;q.physics_base_drag=1.00016093*Math.pow(.9981,q.physics_ms_per_tick);q.physics_no_modifier_drag=1.00016093*Math.pow(.99,q.physics_ms_per_tick);q.physics_jump_height=26;q.physics_gravity=2;q.camera_lag=.0625;q.color_default=-1118482;q.color_admin=-19456;q.renderer_chunk_size=
  294. 20;C.inited=!1;J.admins=["joshua"];J.inited=!1;D.bricks=new S;t.active=!1;t.inited=!1;t.transform=new A;K.basic=new la;K.loaded=!1;K.inited=!1;Q.inited=!1;E.step=-1;V.username="guest";O.minimapOpen=!1;G.__toStr={}.toString;P.main()})("undefined"!=typeof console?console:{log:function(){}});
Add Comment
Please, Sign In to add comment