Raw Source
gdmk / AresBot Vanilla Zoom

// ==UserScript==
// @name        AresBot Vanilla Zoom
// @author      Cybernus L.L.C
// @namespace   AresBot Vanilla Zoom
// @include     http://agar.io/*
// @include     https://agar.io/*
// @version     0.1.0
// @updateURL   http://aresbot.com/bot/vanilla_zoom.js
// @grant       none
// @run-at      document-start
// ==/UserScript==

var engine=function(t,e){function n(t,e){if(e){var n=new Date;n.setTime(n.getTime()+864e5*e),n="; expires="+n.toGMTString()}else n="";document.cookie="agario_redirect="+t+n+"; path=/"}function o(){for(var t=document.cookie.split(";"),e=0;e<t.length;e++){for(var n=t[e];" "==n.charAt(0);)n=n.substring(1,n.length);if(0==n.indexOf("agario_redirect="))return n.substring(16,n.length)}return null}function a(){if(pe=!0,Lt.core.init(),s(),setInterval(s,18e4),Pt=wt=document.getElementById("canvas"),null!=Pt){Tt=Pt.getContext("2d"),Pt.onmousedown=function(t){if(Fe){var e=t.clientX-(5+Ct/5/2),n=t.clientY-(5+Ct/5/2);if(Math.sqrt(e*e+n*n)<=Ct/5/2)return void L()}jt=1*t.clientX,Kt=1*t.clientY,l(),A()},Pt.onmousemove=function(t){ze=!1,jt=1*t.clientX,Kt=1*t.clientY,l()},Pt.onmouseup=function(){},/firefox/i.test(navigator.userAgent)?document.addEventListener("DOMMouseScroll",i,!1):document.body.onmousewheel=i;var n=!1,o=!1,a=!1;t.onkeydown=function(t){32!=t.keyCode||n||("nick"!=t.target.id&&t.preventDefault(),L(),n=!0),81!=t.keyCode||o||(P(18),o=!0),87!=t.keyCode||a||(w(),a=!0),27==t.keyCode&&(t.preventDefault(),h(300))},t.onkeyup=function(t){32==t.keyCode&&(n=!1),87==t.keyCode&&(a=!1),81==t.keyCode&&o&&(P(19),o=!1)},t.onblur=function(){P(19),a=o=n=!1},t.onresize=C,t.requestAnimationFrame(qe),setInterval(A,40),ne&&e("#region").val(ne),f(),u(e("#region").val()),0==we&&ne&&m(),h(0),C(),t.location.hash&&6<=t.location.hash.length&&tt(t.location.hash)}}function i(t){t.preventDefault(),Ae*=Math.pow(.9,t.wheelDelta/-120||t.detail||0),!ut&&1>Ae&&(Ae=1),Ae>4/ee&&(Ae=4/ee)}function r(){if(.4>ee)Ft=null;else{for(var t=Number.POSITIVE_INFINITY,e=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY,o=Number.NEGATIVE_INFINITY,a=0;a<Ot.length;a++){var i=Ot[a];!i.O()||i.T||20>=i.size*ee||(t=Math.min(i.x-i.size,t),e=Math.min(i.y-i.size,e),n=Math.max(i.x+i.size,n),o=Math.max(i.y+i.size,o))}for(Ft=on.init({sa:t-10,ta:e-10,qa:n+10,ra:o+10,Da:2,Ea:4}),a=0;a<Ot.length;a++)if(i=Ot[a],i.O()&&!(20>=i.size*ee))for(t=0;t<i.a.length;++t)e=i.a[t].x,n=i.a[t].y,Gt-Ct/2/ee>e||Nt-Mt/2/ee>n||e>Gt+Ct/2/ee||n>Nt+Mt/2/ee||Ft.na(i.a[t])}}function l(){Wt=(jt-Ct/2)/ee+Gt,Vt=(Kt-Mt/2)/ee+Nt}function s(){null==Re&&(Re={},e("#region").children().each(function(){var t=e(this),n=t.val();n&&(Re[n]=t.text())})),e.get(At+"info",function(t){var n,o={};for(n in t.regions){var a=n.split(":")[0];o[a]=o[a]||0,o[a]+=t.regions[n].numPlayers}for(n in o)e('#region option[value="'+n+'"]').text(Re[n]+" ("+o[n]+" players)")},"json")}function c(){e("#adsBottom").hide(),e("#overlays").hide(),e("#stats").hide(),e("#mainPanel").hide(),vn=Le=!1,f(),t.destroyAd(t.adSlots.aa),t.destroyAd(t.adSlots.ac)}function u(n){n&&(n==ne?e(".btn-needs-server").prop("disabled",!1):(e("#region").val()!=n&&e("#region").val(n),ne=t.localStorage.location=n,e(".region-message").hide(),e(".region-message."+n).show(),e(".btn-needs-server").prop("disabled",!1),pe&&m()))}function h(n){Le||vn||(Sn?e(".btn-spectate").prop("disabled",!0):e(".btn-spectate").prop("disabled",!1),Xt=null,Je||(e("#adsBottom").show(),e("#g300x250").hide(),e("#a300x250").show(),e("#g728x90").hide(),e("#a728x90").show()),t.refreshAd(Je?t.adSlots.ac:t.adSlots.aa),Je=!1,1e3>n&&(Ie=1),Le=!0,e("#mainPanel").show(),n>0?e("#overlays").fadeIn(n):e("#overlays").show())}function d(t){e("#helloContainer").attr("data-gamemode",t),fe=t,e("#gamemode").val(t)}function f(){e("#region").val()?t.localStorage.location=e("#region").val():t.localStorage.location&&e("#region").val(t.localStorage.location),e("#region").val()?e("#locationKnown").append(e("#region")):e("#locationUnknown").append(e("#region"))}function g(e){return t.i18n[e]||t.i18n_dict.en[e]||e}function p(){var n=++we;console.log("Find "+ne+fe),v(),e.ajax(At+"findServer",{error:function(){setTimeout(p,3e4)},success:function(e){if(n==we){e.alert&&alert(e.alert);var o=e.ip;void 0!=xt.la&&(o=t.location.hostname+":"+xt.la),S("ws"+(Et?"s":"")+"://"+o,e.token)}},dataType:"json",method:"POST",cache:!1,crossDomain:!0,data:(ne+fe||"?")+"\n2200049715"})}function m(){pe&&ne&&(e("#connecting").show(),p())}function v(){if(Bt){Bt.onopen=null,Bt.onmessage=null,Bt.onclose=null;try{Bt.close()}catch(t){}Bt=null}}function S(t,e){if(v(),pt.ip&&(t="ws"+(Et?"s":"")+"://"+pt.ip),null!=De){var n=De;De=function(){n(e)}}if(Et&&!xt.env_development&&!xt.env_local){var o=t.split(":");t="wss://ip-"+o[1].replace(/\./g,"-").replace(/\//g,"")+".tech.agar.io:"+ +o[2]}zt=[],Rt=[],Jt={},Ot=[],_t=[],Dt=[],Ve=ge=null,le=0,ke=!1,console.log("Connecting to "+t),Lt.cache.sentGameServerLogin=!1,Bt=new WebSocket(t),Bt.binaryType="arraybuffer",Bt.onopen=function(){var t;console.log("socket open"),t=b(5),t.setUint8(0,254),t.setUint32(1,5,!0),y(t),t=b(5),t.setUint8(0,255),t.setUint32(1,2200049715,!0),y(t),t=b(1+e.length),t.setUint8(0,80);for(var n=0;n<e.length;++n)t.setUint8(n+1,e.charCodeAt(n));y(t),"login_info"in Lt.cache&&Lt.I.M(Lt.cache.login_info[0],Lt.cache.login_info[1])},Bt.onmessage=x,Bt.onclose=U,Bt.onerror=function(){console.log("socket error")}}function b(t){return new DataView(new ArrayBuffer(t))}function y(t){Bt.send(t.buffer)}function U(){ke&&(je=500),console.log("socket close"),setTimeout(m,je),je*=2}function x(t){k(new DataView(t.data))}function k(e){function n(){for(var t="";;){var n=e.getUint16(o,!0);if(o+=2,0==n)break;t+=String.fromCharCode(n)}return t}var o=0;switch(240==e.getUint8(o)&&(o+=5),e.getUint8(o++)){case 16:E(e,o);break;case 17:ue=e.getFloat32(o,!0),o+=4,he=e.getFloat32(o,!0),o+=4,de=e.getFloat32(o,!0),o+=4;break;case 20:Rt=[],zt=[];break;case 21:ve=e.getInt16(o,!0),o+=2,Se=e.getInt16(o,!0),o+=2,me||(me=!0,be=ve,ye=Se);break;case 32:zt.push(e.getUint32(o,!0)),o+=4;break;case 49:if(null!=ge)break;var a=e.getUint32(o,!0),o=o+4;Dt=[];for(var i=0;a>i;++i){var r=e.getUint32(o,!0),o=o+4;Dt.push({id:r,name:n()})}R();break;case 50:for(ge=[],a=e.getUint32(o,!0),o+=4,i=0;a>i;++i)ge.push(e.getFloat32(o,!0)),o+=4;R();break;case 64:Zt=e.getFloat64(o,!0),o+=8,Qt=e.getFloat64(o,!0),o+=8,$t=e.getFloat64(o,!0),o+=8,te=e.getFloat64(o,!0),o+=8,ue=($t+Zt)/2,he=(te+Qt)/2,de=1,0==Rt.length&&(Gt=ue,Nt=he,ee=de),e.byteLength>o&&(a=e.getUint32(o,!0),o+=4,Ce=!!(1&a),Pe=n(),t.MC.updateServerVersion(Pe),console.log("Server version "+Pe));break;case 102:a=e.buffer.slice(o),Lt.core.proxy.forwardProtoMessage(a);break;case 104:t.logout()}}function E(n,o){function a(){for(var t="";;){var e=n.getUint16(o,!0);if(o+=2,0==e)break;t+=String.fromCharCode(e)}return t}function i(){for(var t="";;){var e=n.getUint8(o++);if(0==e)break;t+=String.fromCharCode(e)}return t}Ee=Yt=Date.now(),ke||(ke=!0,e("#connecting").hide(),I(),De&&(De(),De=null)),re=!1;var r=n.getUint16(o,!0);o+=2;for(var l=0;r>l;++l){var s=Jt[n.getUint32(o,!0)],c=Jt[n.getUint32(o+4,!0)];o+=8,s&&c&&(c.ba(),c.s=c.x,c.u=c.y,c.o=c.size,c.J=s.x,c.K=s.y,c.g=c.size,c.S=Yt,ot(s,c))}for(l=0;r=n.getUint32(o,!0),o+=4,0!=r;){++l;var u,s=n.getInt32(o,!0);o+=4,c=n.getInt32(o,!0),o+=4,u=n.getInt16(o,!0),o+=2;var h=n.getUint8(o++),d=n.getUint8(o++),f=n.getUint8(o++),d=K(h<<16|d<<8|f),f=n.getUint8(o++),g=!!(1&f),p=!!(16&f),m=null;2&f&&(o+=4+n.getUint32(o,!0)),4&f&&(m=i());var v=a(),h=null;Jt.hasOwnProperty(r)?(h=Jt[r],h.R(),h.s=h.x,h.u=h.y,h.o=h.size,h.color=d):(h=new j(r,s,c,u,d,v),Ot.push(h),Jt[r]=h,h.Y=s,h.Aa=c),h.c=g,h.h=p,h.J=s,h.K=c,h.g=u,h.S=Yt,h.da=f,m&&(h.C=m),v&&h.A(v),-1!=zt.indexOf(r)&&-1==Rt.indexOf(h)&&(Rt.push(h),1==Rt.length&&(Gt=h.x,Nt=h.y,an(),document.getElementById("overlays").style.display="none",gn=[],pn=0,mn=Rt[0].color,Sn=!0,bn=Date.now(),kn=xn=Un=0))}for(s=n.getUint32(o,!0),o+=4,l=0;s>l;l++)r=n.getUint32(o,!0),o+=4,h=Jt[r],null!=h&&h.ba();re&&0==Rt.length&&"1"!=t.storageInfo.userInfo.loggedIn&&nt()}function A(){if(T()){var t=jt-Ct/2,e=Kt-Mt/2;64>t*t+e*e||.01>Math.abs(Ke-Wt)&&.01>Math.abs(We-Vt)||(Ke=Wt,We=Vt,t=b(13),t.setUint8(0,16),t.setInt32(1,Wt,!0),t.setInt32(5,Vt,!0),t.setUint32(9,0,!0),y(t))}}function I(){if(T()&&ke&&null!=Xt){var t=b(1+2*Xt.length);t.setUint8(0,0);for(var e=0;e<Xt.length;++e)t.setUint16(1+2*e,Xt.charCodeAt(e),!0);y(t),Xt=null}}function L(){A(),P(17)}function w(){A(),P(21)}function T(){return null!=Bt&&Bt.readyState==Bt.OPEN}function P(t){if(T()){var e=b(1);e.setUint8(0,t),y(e)}}function C(){Ct=1*t.innerWidth,Mt=1*t.innerHeight,wt.width=Pt.width=Ct,wt.height=Pt.height=Mt;var n=e("#helloContainer");n.css("transform","none");var o=n.height(),a=t.innerHeight;0!=o/2%2&&(o++,n.height(o)),o>a/1.1?n.css("transform","translate(-50%, -50%) scale("+a/o/1.1+")"):n.css("transform","translate(-50%, -50%)"),B()}function M(){var t;return t=1*Math.max(Mt/1080,Ct/1920),t*=Ae}function F(){if(0!=Rt.length){for(var t=0,e=0;e<Rt.length;e++)t+=Rt[e].size;ee=(9*ee+Math.pow(Math.min(64/t,1),.4)*M())/10}}function B(){var t,e=Date.now();if(++Ht,en&&(++tn,tn>180&&(tn=0)),Yt=e,0<Rt.length){F();for(var n=t=0,o=0;o<Rt.length;o++)Rt[o].R(),t+=Rt[o].x/Rt.length,n+=Rt[o].y/Rt.length;ue=t,he=n,de=ee,Gt=(Gt+t)/2,Nt=(Nt+n)/2}else Gt=(29*Gt+ue)/30,Nt=(29*Nt+he)/30,ee=(9*ee+de*M())/10;for(r(),l(),xe||Tt.clearRect(0,0,Ct,Mt),xe?(Tt.fillStyle=se?"#111111":"#F2FBFF",Tt.globalAlpha=.05,Tt.fillRect(0,0,Ct,Mt),Tt.globalAlpha=1):G(),Ot.sort(function(t,e){return t.size==e.size?t.id-e.id:t.size-e.size}),Tt.save(),Tt.translate(Ct/2,Mt/2),Tt.scale(ee,ee),Tt.translate(-Gt,-Nt),o=0;o<_t.length;o++)_t[o].w(Tt);for(o=0;o<Ot.length;o++)Ot[o].w(Tt);if(me){for(be=(3*be+ve)/4,ye=(3*ye+Se)/4,Tt.save(),Tt.strokeStyle="#FFAAAA",Tt.lineWidth=10,Tt.lineCap="round",Tt.lineJoin="round",Tt.globalAlpha=.5,Tt.beginPath(),o=0;o<Rt.length;o++)Tt.moveTo(Rt[o].x,Rt[o].y),Tt.lineTo(be,ye);Tt.stroke(),Tt.restore()}Tt.restore(),Ve&&Ve.width&&Tt.drawImage(Ve,Ct-Ve.width-10,10),le=Math.max(le,z()),0!=le&&(null==Ye&&(Ye=new W(24,"#FFFFFF")),Ye.B(g("score")+": "+~~(le/100)),n=Ye.L(),t=n.width,Tt.globalAlpha=.2,Tt.fillStyle="#000000",Tt.fillRect(10,Mt-10-24-10,t+10,34),Tt.globalAlpha=1,Tt.drawImage(n,15,Mt-10-24-5)),N(),e=Date.now()-e,e>1e3/60?He-=.01:1e3/65>e&&(He+=.01),.4>He&&(He=.4),He>1&&(He=1),e=Yt-qt,!T()||Le||vn?(Ie+=e/2e3,Ie>1&&(Ie=1)):(Ie-=e/300,0>Ie&&(Ie=0)),Ie>0?(Tt.fillStyle="#000000",Te?(Tt.globalAlpha=Ie,Tt.fillRect(0,0,Ct,Mt),Me.complete&&Me.width&&(Me.width/Me.height<Ct/Mt?(e=Ct,t=Me.height*Ct/Me.width):(e=Me.width*Mt/Me.height,t=Mt),Tt.drawImage(Me,(Ct-e)/2,(Mt-t)/2,e,t),Tt.globalAlpha=.5*Ie,Tt.fillRect(0,0,Ct,Mt))):(Tt.globalAlpha=.5*Ie,Tt.fillRect(0,0,Ct,Mt)),Tt.globalAlpha=1):Te=!1,qt=Yt}function G(){Tt.fillStyle=se?"#111111":"#F2FBFF",Tt.fillRect(0,0,Ct,Mt),Tt.save(),Tt.strokeStyle=se?"#AAAAAA":"#000000",Tt.globalAlpha=.2*ee;for(var t=Ct/ee,e=Mt/ee,n=(-Gt+t/2)%50;t>n;n+=50)Tt.beginPath(),Tt.moveTo(n*ee-.5,0),Tt.lineTo(n*ee-.5,e*ee),Tt.stroke();for(n=(-Nt+e/2)%50;e>n;n+=50)Tt.beginPath(),Tt.moveTo(0,n*ee-.5),Tt.lineTo(t*ee,n*ee-.5),Tt.stroke();Tt.restore()}function N(){if(Fe&&Be.width){var t=Ct/5;Tt.drawImage(Be,5,5,t,t)}}function z(){for(var t=0,e=0;e<Rt.length;e++)t+=Rt[e].g*Rt[e].g;return t}function R(){if(Ve=null,(null!=ge||0!=Dt.length)&&(null!=ge||ae)){Ve=document.createElement("canvas");var t=Ve.getContext("2d"),e=60,e=null==ge?e+24*Dt.length:e+180,n=Math.min(200,.3*Ct)/200;if(Ve.width=200*n,Ve.height=e*n,t.scale(n,n),t.globalAlpha=.4,t.fillStyle="#000000",t.fillRect(0,0,200,e),t.globalAlpha=1,t.fillStyle="#FFFFFF",n=null,n=g("leaderboard"),t.font="30px Ubuntu",t.fillText(n,100-t.measureText(n).width/2,40),null==ge)for(t.font="20px Ubuntu",e=0;e<Dt.length;++e)n=Dt[e].name||g("unnamed_cell"),ae||(n=g("unnamed_cell")),-1!=zt.indexOf(Dt[e].id)?(Rt[0].name&&(n=Rt[0].name),t.fillStyle="#FFAAAA"):t.fillStyle="#FFFFFF",n=e+1+". "+n,t.fillText(n,100-t.measureText(n).width/2,70+24*e);else for(e=n=0;e<ge.length;++e){var o=n+ge[e]*Math.PI*2;t.fillStyle=Ue[e+1],t.beginPath(),t.moveTo(100,140),t.arc(100,140,80,n,o,!1),t.fill(),n=o}}}function J(e){if(null==e||0==e.length)return null;if("%"==e[0]){if(!t.MC||!t.MC.getSkinInfo)return null;if(e=t.MC.getSkinInfo("skin_"+e.slice(1)),null==e)return null;for(e=(+e.color).toString(16);6>e.length;)e="0"+e;return"#"+e}return null}function O(e){if(null==e||0==e.length)return null;if(!$e.hasOwnProperty(e)){var n=new Image;if(":"==e[0])n.src=e.slice(1);else if("%"==e[0]){if(!t.MC||!t.MC.getSkinInfo)return null;var o=t.MC.getSkinInfo("skin_"+e.slice(1));if(null==o)return null;n.src=t.ASSETS_ROOT+"skins/premium/"+o.url}$e[e]=n}return 0!=$e[e].width&&$e[e].complete?$e[e]:null}function D(t,e,n,o,a){this.Z=t,this.x=e,this.y=n,this.f=o,this.b=a}function j(t,e,n,o,a,i){this.id=t,this.s=this.x=e,this.u=this.y=n,this.o=this.size=o,this.color=a,this.a=[],this.$(),this.A(i)}function K(t){for(t=t.toString(16);6>t.length;)t="0"+t;return"#"+t}function W(t,e,n,o){t&&(this.v=t),e&&(this.U=e),this.W=!!n,o&&(this.X=o)}function V(t){for(var e,n,o=t.length;o>0;)n=Math.floor(Math.random()*o),o--,e=t[o],t[o]=t[n],t[n]=e}function H(){ln=rn}function Y(t){ln.context="google"==t?"google":"facebook",q()}function q(){t.localStorage.storeObjectInfo=JSON.stringify(ln),ln=JSON.parse(t.localStorage.storeObjectInfo),t.storageInfo=ln,"google"==ln.context?(e("#gPlusShare").show(),e("#fbShare").hide()):(e("#gPlusShare").hide(),e("#fbShare").show())}function X(n){e("#helloContainer").attr("data-has-account-data"),""!=n.displayName&&(n.name=n.displayName),(null==n.name||void 0==n.name)&&(n.name="");var o=n.name.lastIndexOf("_");-1!=o&&(n.name=n.name.substring(0,o)),e("#helloContainer").attr("data-has-account-data","1"),e("#helloContainer").attr("data-logged-in","1"),e(".agario-profile-panel .progress-bar-star").text(n.level),e(".agario-exp-bar .progress-bar-text").text(n.xp+"/"+n.xpNeeded+" XP"),e(".agario-exp-bar .progress-bar").css("width",(88*n.xp/n.xpNeeded).toFixed(2)+"%"),e(".agario-profile-name").text(n.name),""!=n.picture&&e(".agario-profile-picture").attr("src",n.picture),e("#instructions").show(),ln.userInfo.level=n.level,ln.userInfo.xp=n.xp,ln.userInfo.xpNeeded=n.xpNeeded,ln.userInfo.displayName=n.name,ln.userInfo.loggedIn="1",t.updateStorage()}function Z(n,o){if(ln.userInfo.loggedIn){var a=e("#helloContainer").is(":visible")&&"1"==e("#helloContainer").attr("data-has-account-data");if((null==n||void 0==n)&&(n=ln.userInfo),a){var i=+e(".agario-exp-bar .progress-bar-text").first().text().split("/")[0],a=+e(".agario-exp-bar .progress-bar-text").first().text().split("/")[1].split(" ")[0],r=e(".agario-profile-panel .progress-bar-star").first().text();if(r!=n.level)Z({xp:a,xpNeeded:a,level:r},function(){e(".agario-profile-panel .progress-bar-star").text(n.level),e(".agario-exp-bar .progress-bar").css("width","100%"),e(".progress-bar-star").addClass("animated tada").one("webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend",function(){e(".progress-bar-star").removeClass("animated tada")}),setTimeout(function(){e(".agario-exp-bar .progress-bar-text").text(n.xpNeeded+"/"+n.xpNeeded+" XP"),Z({xp:0,xpNeeded:n.xpNeeded,level:n.level},function(){Z(n,null)})},1e3)});else{var l=Date.now(),s=function(){var a;a=(Date.now()-l)/1e3,a=0>a?0:a>1?1:a,a=a*a*(3-2*a),e(".agario-exp-bar .progress-bar-text").text(~~(i+(n.xp-i)*a)+"/"+n.xpNeeded+" XP"),e(".agario-exp-bar .progress-bar").css("width",(88*(i+(n.xp-i)*a)/n.xpNeeded).toFixed(2)+"%"),o&&o(),1>a&&t.requestAnimationFrame(s)};t.requestAnimationFrame(s)}}}}function Q(){"none"==e("#settings").css("display")&&"none"==e("#socialLoginContainer").css("display")&&e("#instructions").show()}function $(n){if("connected"==n.status){var o=n.authResponse.accessToken;null==o||"undefined"==o||""==o?(3>cn&&(cn++,t.facebookRelogin()),t.logout()):(t.MC.doLoginWithFB(o),Lt.cache.login_info=[o,"facebook"],Lt.I.M(o,"facebook"),t.FB.api("/me/picture?width=180&height=180",function(o){ln.userInfo.picture=o.data.url,t.updateStorage(),e(".agario-profile-picture").attr("src",o.data.url),ln.userInfo.socialId=n.authResponse.userID,sn()}),e("#helloContainer").attr("data-logged-in","1"),ln.context="facebook",ln.loginIntent="1",t.updateStorage())}}function tt(n){d(":party"),e("#helloContainer").attr("data-party-state","4"),n=decodeURIComponent(n).replace(/.*#/gim,""),et("#"+t.encodeURIComponent(n)),token=t.encodeURIComponent(n),e.ajax(At+"getToken",{error:function(){e("#helloContainer").attr("data-party-state","6")},success:function(o){o=o.split("\n"),e(".partyToken").val("agar.io/#"+t.encodeURIComponent(n)),token=t.encodeURIComponent(n),e("#helloContainer").attr("data-party-state","5"),d(":party"),S("ws://"+o[0],n)},dataType:"text",method:"POST",cache:!1,crossDomain:!0,data:n})}function et(e){t.history&&t.history.replaceState&&t.history.replaceState({},t.document.title,e)}function nt(){null==t.storageInfo&&t.createDefaultStorage(),yn=Date.now(),Sn=!1,lt()}function ot(t,e){var n=-1!=zt.indexOf(t.id),o=-1!=zt.indexOf(e.id),a=30>e.size;n&&a&&++pn,a||!n||o||32&e.da||++xn}function at(t){t=~~t;var e=(t%60).toString();return t=(~~(t/60)).toString(),2>e.length&&(e="0"+e),t+":"+e}function it(){if(null==Dt)return 0;for(var t=0;t<Dt.length;++t)if(-1!=zt.indexOf(Dt[t].id))return t+1;return 0}function rt(){e(".stats-food-eaten").text(pn),e(".stats-time-alive").text(at((yn-bn)/1e3)),e(".stats-leaderboard-time").text(at(Un)),e(".stats-highest-mass").text(~~(le/100)),e(".stats-cells-eaten").text(xn),e(".stats-top-position").text(0==kn?":(":kn);var t=document.getElementById("statsGraph");if(t){var n=t.getContext("2d"),o=t.width,t=t.height;if(n.clearRect(0,0,o,t),2<gn.length){for(var a=200,i=0;i<gn.length;i++)a=Math.max(gn[i],a);for(n.lineWidth=3,n.lineCap="round",n.lineJoin="round",n.strokeStyle=mn,n.fillStyle=mn,n.beginPath(),n.moveTo(0,t-gn[0]/a*(t-10)+10),i=1;i<gn.length;i+=Math.max(~~(gn.length/o),1)){for(var r=i/(gn.length-1)*o,l=[],s=-20;20>=s;++s)0>i+s||i+s>=gn.length||l.push(gn[i+s]);l=l.reduce(function(t,e){return t+e})/l.length/a,n.lineTo(r,t-l*(t-10)+10)}n.stroke(),n.globalAlpha=.5,n.lineTo(o,t),n.lineTo(0,t),n.fill(),n.globalAlpha=1}}}function lt(){Le||vn||(En?(t.refreshAd(t.adSlots.ab),rt(),vn=!0,setTimeout(function(){e("#overlays").fadeIn(500,function(){Z()}),e("#stats").show();var n=st("g_plus_share_stats");t.fillSocialValues(n,"gPlusShare")},1500)):h(500))}function st(n){var o=e(".stats-time-alive").text();return t.parseString(n,"%@",[o.split(":")[0],o.split(":")[1],e(".stats-highest-mass").text()])}function ct(){t.open("https://plus.google.com/share?url=www.agar.io&hl=en-US","Agar.io","width=484,height=580,menubar=no,toolbar=no,resizable=yes,scrollbars=no,left="+(t.screenX+t.innerWidth/2-242)+",top="+(t.innerHeight-580)/2)}var ut=1,ht=document.createElement("div");ht.id="bots",ht.style.cssText="position: absolute;top: 60px;left: 150px;padding: 0 8px;font-family: 'Ubuntu';color: #fff;background-color: rgba(0, 0, 0, 0.2);z-index:9999";var dt=document.createElement("div");dt.id="sub",dt.style.cssText="position: absolute;top: 10px;left: 150px;padding: 0 8px;font-family: 'Ubuntu';color: #fff;background-color: rgba(0, 0, 0, 0.2);z-index:9999";var ft=document.createElement("div");ft.id="time",ft.style.cssText="position: absolute;top: 30px;left: 150px;padding: 0 8px;font-family: 'Ubuntu';color: #fff;background-color: rgba(0, 0, 0, 0.2);z-index:9999";var gt=document.createElement("canvas");if("undefined"==typeof console||"undefined"==typeof DataView||"undefined"==typeof WebSocket||null==gt||null==gt.getContext||null==t.localStorage)alert("You browser does not support this game, we recommend you to use Firefox to play this");else{var pt={};!function(){var e=t.location.search;"?"==e.charAt(0)&&(e=e.slice(1));for(var e=e.split("&"),n=0;n<e.length;n++){var o=e[n].split("=");pt[o[0]]=o[1]}}(),t.queryString=pt;var mt="fb"in pt,vt="miniclip"in pt,St=function(){n("",-1)},bt="http:"!=t.location.protocol,yt="1"==o(),Ut=!1;if(mt||vt?console.log("in fb and stuff"):bt&&!yt?(console.log("redirecting"),n("1",1),t.location.href="http:"+t.location.href.substring(t.location.protocol.length),Ut=!0):n("",-1),bt||n("",-1),Ut||setTimeout(St,3e3),t.MC=function(){},void 0!=t.EnvConfig){var xt=t.EnvConfig;t.EnvConfig=xt}if(!t.agarioNoInit){var kt=t.location.protocol,Et="https:"==kt;pt.master&&(xt.master_url=pt.master);var At=kt+"//"+xt.master_url+"/",It=t.navigator.userAgent;if(-1!=It.indexOf("Android"))t.ga&&t.ga("send","event","MobileRedirect","PlayStore"),setTimeout(function(){t.location.href="https://play.google.com/store/apps/details?id=com.miniclip.agar.io"},1e3);else if(-1!=It.indexOf("iPhone")||-1!=It.indexOf("iPad")||-1!=It.indexOf("iPod"))t.ga&&t.ga("send","event","MobileRedirect","AppStore"),setTimeout(function(){t.location.href="https://itunes.apple.com/app/agar.io/id995999703?mt=8&at=1l3vajp"},1e3);else{var Lt={};t.agarApp=Lt;var wt,Tt,Pt,Ct,Mt,Ft=null,Bt=null,Gt=0,Nt=0,zt=[],Rt=[],Jt={},Ot=[],_t=[],Dt=[],jt=0,Kt=0,Wt=-1,Vt=-1,Ht=0,Yt=0,qt=0,Xt=null,Zt=0,Qt=0,$t=1e4,te=1e4,ee=1,ne=null,oe=!0,ae=!0,ie=!1,re=!1,le=0,se=!1,ce=!1,ue=Gt=~~((Zt+$t)/2),he=Nt=~~((Qt+te)/2),de=1,fe="",ge=null,pe=!1,me=!1,ve=0,Se=0,be=0,ye=0,Ue=["#333333","#FF3333","#33FF33","#3333FF"],xe=!1,ke=!1,Ee=0,Ae=1,Ie=1,Le=!1,we=0,Te=!0,Pe=null,Ce=!1,Me=new Image;Me.src="/img/background.png";var Fe="ontouchstart"in t&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(t.navigator.userAgent),Be=new Image;Be.src="/img/split.png";var Ge,Ne,ze=!1;"gamepad"in pt&&setInterval(function(){ze&&(jt=nn.fa(jt,Ge),Kt=nn.fa(Kt,Ne))},25),t.gamepadAxisUpdate=function(t,e){var n=.1>e*e;0==t&&(n?Ge=Ct/2:(Ge=(e+1)/2*Ct,ze=!0)),1==t&&(n?Ne=Mt/2:(Ne=(e+1)/2*Mt,ze=!0))};var Re=null;t.setNick=function(e){t.ga&&t.ga("send","event","Nick",e.toLowerCase()),c(),Xt=e,I(),le=0},t.setRegion=u;var Je=!0;t.setSkins=function(t){oe=t},t.setNames=function(t){ae=t},t.setDarkTheme=function(t){se=t},t.setColors=function(t){ie=t},t.setShowMass=function(t){ce=t},t.spectate=function(){Xt=null,P(1),c()},t.setGameMode=function(t){t!=fe&&(":party"==fe&&e("#helloContainer").attr("data-party-state","0"),d(t),":party"!=t&&m())},t.setAcid=function(t){xe=t},e.get(kt+"//gc.agar.io",function(t){var e=t.split(" ");t=e[0],e=e[1]||"",-1==["UA"].indexOf(t)&&Ze.push("ussr"),_e.hasOwnProperty(t)&&("string"==typeof _e[t]?ne||u(_e[t]):_e[t].hasOwnProperty(e)&&(ne||u(_e[t][e])))},"text");var Oe=function(n){var o={};return n.init=function(){Lt.account.init(),Lt.google.oa(),Lt.ea.init()},n.bind=function(t,n){e(o).bind(t,n)},n.unbind=function(t,n){e(o).unbind(t,n)},n.trigger=function(t){e(o).trigger(t)},n.__defineGetter__("proxy",function(){return t.MC}),n}({});Lt.core=Oe,Lt.cache={};var _e={AF:"JP-Tokyo",AX:"EU-London",AL:"EU-London",DZ:"EU-London",AS:"SG-Singapore",AD:"EU-London",AO:"EU-London",AI:"US-Atlanta",AG:"US-Atlanta",AR:"BR-Brazil",AM:"JP-Tokyo",AW:"US-Atlanta",AU:"SG-Singapore",AT:"EU-London",AZ:"JP-Tokyo",BS:"US-Atlanta",BH:"JP-Tokyo",BD:"JP-Tokyo",BB:"US-Atlanta",BY:"EU-London",BE:"EU-London",BZ:"US-Atlanta",BJ:"EU-London",BM:"US-Atlanta",BT:"JP-Tokyo",BO:"BR-Brazil",BQ:"US-Atlanta",BA:"EU-London",BW:"EU-London",BR:"BR-Brazil",IO:"JP-Tokyo",VG:"US-Atlanta",BN:"JP-Tokyo",BG:"EU-London",BF:"EU-London",BI:"EU-London",KH:"JP-Tokyo",CM:"EU-London",CA:"US-Atlanta",CV:"EU-London",KY:"US-Atlanta",CF:"EU-London",TD:"EU-London",CL:"BR-Brazil",CN:"CN-China",CX:"JP-Tokyo",CC:"JP-Tokyo",CO:"BR-Brazil",KM:"EU-London",CD:"EU-London",CG:"EU-London",CK:"SG-Singapore",CR:"US-Atlanta",CI:"EU-London",HR:"EU-London",CU:"US-Atlanta",CW:"US-Atlanta",CY:"JP-Tokyo",CZ:"EU-London",DK:"EU-London",DJ:"EU-London",DM:"US-Atlanta",DO:"US-Atlanta",EC:"BR-Brazil",EG:"EU-London",SV:"US-Atlanta",GQ:"EU-London",ER:"EU-London",EE:"EU-London",ET:"EU-London",FO:"EU-London",FK:"BR-Brazil",FJ:"SG-Singapore",FI:"EU-London",FR:"EU-London",GF:"BR-Brazil",PF:"SG-Singapore",GA:"EU-London",GM:"EU-London",GE:"JP-Tokyo",DE:"EU-London",GH:"EU-London",GI:"EU-London",GR:"EU-London",GL:"US-Atlanta",GD:"US-Atlanta",GP:"US-Atlanta",GU:"SG-Singapore",GT:"US-Atlanta",GG:"EU-London",GN:"EU-London",GW:"EU-London",GY:"BR-Brazil",HT:"US-Atlanta",VA:"EU-London",HN:"US-Atlanta",HK:"JP-Tokyo",HU:"EU-London",IS:"EU-London",IN:"JP-Tokyo",ID:"JP-Tokyo",IR:"JP-Tokyo",IQ:"JP-Tokyo",IE:"EU-London",IM:"EU-London",IL:"JP-Tokyo",IT:"EU-London",JM:"US-Atlanta",JP:"JP-Tokyo",JE:"EU-London",JO:"JP-Tokyo",KZ:"JP-Tokyo",KE:"EU-London",KI:"SG-Singapore",KP:"JP-Tokyo",KR:"JP-Tokyo",KW:"JP-Tokyo",KG:"JP-Tokyo",LA:"JP-Tokyo",LV:"EU-London",LB:"JP-Tokyo",LS:"EU-London",LR:"EU-London",LY:"EU-London",LI:"EU-London",LT:"EU-London",LU:"EU-London",MO:"JP-Tokyo",MK:"EU-London",MG:"EU-London",MW:"EU-London",MY:"JP-Tokyo",MV:"JP-Tokyo",ML:"EU-London",MT:"EU-London",MH:"SG-Singapore",MQ:"US-Atlanta",MR:"EU-London",MU:"EU-London",YT:"EU-London",MX:"US-Atlanta",FM:"SG-Singapore",MD:"EU-London",MC:"EU-London",MN:"JP-Tokyo",ME:"EU-London",MS:"US-Atlanta",MA:"EU-London",MZ:"EU-London",MM:"JP-Tokyo",NA:"EU-London",NR:"SG-Singapore",NP:"JP-Tokyo",NL:"EU-London",NC:"SG-Singapore",NZ:"SG-Singapore",NI:"US-Atlanta",NE:"EU-London",NG:"EU-London",NU:"SG-Singapore",NF:"SG-Singapore",MP:"SG-Singapore",NO:"EU-London",OM:"JP-Tokyo",PK:"JP-Tokyo",PW:"SG-Singapore",PS:"JP-Tokyo",PA:"US-Atlanta",PG:"SG-Singapore",PY:"BR-Brazil",PE:"BR-Brazil",PH:"JP-Tokyo",PN:"SG-Singapore",PL:"EU-London",PT:"EU-London",PR:"US-Atlanta",QA:"JP-Tokyo",RE:"EU-London",RO:"EU-London",RU:"RU-Russia",RW:"EU-London",BL:"US-Atlanta",SH:"EU-London",KN:"US-Atlanta",LC:"US-Atlanta",MF:"US-Atlanta",PM:"US-Atlanta",VC:"US-Atlanta",WS:"SG-Singapore",SM:"EU-London",ST:"EU-London",SA:"EU-London",SN:"EU-London",RS:"EU-London",SC:"EU-London",SL:"EU-London",SG:"JP-Tokyo",SX:"US-Atlanta",SK:"EU-London",SI:"EU-London",SB:"SG-Singapore",SO:"EU-London",ZA:"EU-London",SS:"EU-London",ES:"EU-London",LK:"JP-Tokyo",SD:"EU-London",SR:"BR-Brazil",SJ:"EU-London",SZ:"EU-London",SE:"EU-London",CH:"EU-London",SY:"EU-London",TW:"JP-Tokyo",TJ:"JP-Tokyo",TZ:"EU-London",TH:"JP-Tokyo",TL:"JP-Tokyo",TG:"EU-London",TK:"SG-Singapore",TO:"SG-Singapore",TT:"US-Atlanta",TN:"EU-London",TR:"TK-Turkey",TM:"JP-Tokyo",TC:"US-Atlanta",TV:"SG-Singapore",UG:"EU-London",UA:"EU-London",AE:"EU-London",GB:"EU-London",US:"US-Atlanta",UM:"SG-Singapore",VI:"US-Atlanta",UY:"BR-Brazil",UZ:"JP-Tokyo",VU:"SG-Singapore",VE:"BR-Brazil",VN:"JP-Tokyo",WF:"SG-Singapore",EH:"EU-London",YE:"JP-Tokyo",ZM:"EU-London",ZW:"EU-London"},De=null;t.connect=S;var je=500,Ke=-1,We=-1;t.sendMitosis=L,t.sendEject=w,t.refreshPlayerInfo=function(){P(253)},Lt.I=function(t){var e={GG:"google",FB:"facebook"};return t.Ca=e,t.M=function(t,n){if(T()&&!0!==Lt.cache.sentGameServerLogin){var o=null;switch(n){case e.GG:o=2;break;case e.FB:o=1}if(null!=o){var a=b(2+t.length);for(a.setUint8(0,82),a.setUint8(1,o),o=0;o<t.length;++o)a.setUint8(2+o,t.charCodeAt(o));y(a),Lt.cache.sentGameServerLogin=!0}}},t}({});var Ve=null,He=1,Ye=null,qe=function(){var e=Date.now(),n=1e3/60;return function(){t.requestAnimationFrame(qe);var o=Date.now(),a=o-e;a>n&&(e=o-a%n,!T()||240>Date.now()-Ee?B():console.warn("Skipping draw"),fn())}}(),Xe={},Ze="poland;usa;china;russia;canada;australia;spain;brazil;germany;ukraine;france;sweden;chaplin;north korea;south korea;japan;united kingdom;earth;greece;latvia;lithuania;estonia;finland;norway;cia;maldivas;austria;nigeria;reddit;yaranaika;confederate;9gag;indiana;4chan;italy;bulgaria;tumblr;2ch.hk;hong kong;portugal;jamaica;german empire;mexico;sanik;switzerland;croatia;chile;indonesia;bangladesh;thailand;iran;iraq;peru;moon;botswana;bosnia;netherlands;european union;taiwan;pakistan;hungary;satanist;qing dynasty;matriarchy;patriarchy;feminism;ireland;texas;facepunch;prodota;cambodia;steam;piccolo;ea;india;kc;denmark;quebec;ayy lmao;sealand;bait;tsarist russia;origin;vinesauce;stalin;belgium;luxembourg;stussy;prussia;8ch;argentina;scotland;sir;romania;belarus;wojak;doge;nasa;byzantium;imperial japan;french kingdom;somalia;turkey;mars;pokerface;8;irs;receita federal;facebook;putin;merkel;tsipras;obama;kim jong-un;dilma;hollande;berlusconi;cameron;clinton;hillary;venezuela;blatter;chavez;cuba;fidel;merkel;palin;queen;boris;bush;trump".split(";"),Qe="8;nasa;putin;merkel;tsipras;obama;kim jong-un;dilma;hollande;berlusconi;cameron;clinton;hillary;blatter;chavez;fidel;merkel;palin;queen;boris;bush;trump".split(";"),$e={};D.prototype={Z:null,x:0,y:0,f:0,b:0};var tn=-1,en=!1;j.prototype={id:0,a:null,name:null,i:null,P:null,x:0,y:0,size:0,s:0,u:0,o:0,J:0,K:0,g:0,da:0,S:0,ka:0,G:!1,c:!1,h:!1,T:!0,ca:0,C:null,ha:0,ba:function(){var t;for(t=0;t<Ot.length;t++)if(Ot[t]==this){Ot.splice(t,1);break}delete Jt[this.id],t=Rt.indexOf(this),-1!=t&&(re=!0,Rt.splice(t,1)),t=zt.indexOf(this.id),-1!=t&&zt.splice(t,1),this.G=!0,0<this.ca&&_t.push(this)},m:function(){return Math.max(~~(.3*this.size),24)},A:function(t){(this.name=t)&&(null==this.i?this.i=new W(this.m(),"#FFFFFF",!0,"#000000"):this.i.N(this.m()),this.i.B(this.name))},$:function(){for(var t=this.H();this.a.length>t;){var e=~~(Math.random()*this.a.length);this.a.splice(e,1)}for(0==this.a.length&&t>0&&this.a.push(new D(this,this.x,this.y,this.size,Math.random()-.5));this.a.length<t;)e=~~(Math.random()*this.a.length),e=this.a[e],this.a.push(new D(this,e.x,e.y,e.f,e.b))},H:function(){var t=10;20>this.size&&(t=0),this.c&&(t=30);var e=this.size;return this.c||(e*=ee),e*=He,~~Math.max(e,t)},ua:function(){this.$();for(var t=this.a,e=t.length,n=0;e>n;++n){var o=t[(n-1+e)%e].b,a=t[(n+1)%e].b;t[n].b+=(Math.random()-.5)*(this.h?3:1),t[n].b*=.7,10<t[n].b&&(t[n].b=10),-10>t[n].b&&(t[n].b=-10),t[n].b=(o+a+8*t[n].b)/10}for(var i=this,r=this.c?0:(this.id/1e3+Yt/1e4)%(2*Math.PI),l=0,n=0;e>n;++n){var s=t[n].f,o=t[(n-1+e)%e].f,a=t[(n+1)%e].f;if(15<this.size&&null!=Ft&&20<this.size*ee&&0<this.id){var c=!1,u=t[n].x,h=t[n].y;Ft.xa(u-5,h-5,10,10,function(t){t.Z!=i&&25>(u-t.x)*(u-t.x)+(h-t.y)*(h-t.y)&&(c=!0)}),!c&&(t[n].x<Zt||t[n].y<Qt||t[n].x>$t||t[n].y>te)&&(c=!0),c&&(0<t[n].b&&(t[n].b=0),--t[n].b)}s+=t[n].b,0>s&&(s=0),s=this.h?(19*s+this.size)/20:(12*s+this.size)/13,t[n].f=(o+a+8*s)/10,o=2*Math.PI/e,a=this.a[n].f,this.c&&0==n%2&&(a+=5),t[n].x=this.x+Math.cos(o*n+r)*a,t[n].y=this.y+Math.sin(o*n+r)*a,l=Math.max(l,a)}this.ha=l},R:function(){if(0>=this.id)return 1;var t;t=(Yt-this.S)/120,t=0>t?0:t>1?1:t;var e=0>t?0:t>1?1:t;if(this.G&&e>=1){var n=_t.indexOf(this);-1!=n&&_t.splice(n,1)}return this.x=t*(this.J-this.s)+this.s,this.y=t*(this.K-this.u)+this.u,this.size=e*(this.g-this.o)+this.o,.01>Math.abs(this.size-this.g)&&(this.size=this.g),e},O:function(){return 0>=this.id?!0:this.x+this.size+40<Gt-Ct/2/ee||this.y+this.size+40<Nt-Mt/2/ee||this.x-this.size-40>Gt+Ct/2/ee||this.y-this.size-40>Nt+Mt/2/ee?!1:!0},w:function(e){if(this.O()){++this.ca;var n=0<this.id&&!this.c&&!this.h&&.4>ee;if(5>this.H()&&0<this.id&&(n=!0),this.T&&!n)for(var o=0;o<this.a.length;o++)this.a[o].f=this.size;this.T=n,e.save(),this.ka=Yt;var a=this.R();this.G&&(e.globalAlpha*=1-a),e.lineWidth=10,e.lineCap="round",e.lineJoin=this.c?"miter":"round";var o=this.name.toLowerCase(),i=null,r=null,a=!1,l=this.color;if(this.h||!oe||Ce||(-1!=Ze.indexOf(o)?(Xe.hasOwnProperty(o)||(Xe[o]=new Image,Xe[o].src=t.ASSETS_ROOT+"skins/"+o+".png"),i=0!=Xe[o].width&&Xe[o].complete?Xe[o]:null):i=null,null!=i?-1!=Qe.indexOf(o)&&(a=!0):("%starball"==this.C&&"shenron"==o&&7<=Rt.length&&(en=a=!0,r=O("%starball1")),i=O(this.C),null!=i&&(l=J(this.C)||l))),ie?(e.fillStyle="#FFFFFF",e.strokeStyle="#AAAAAA"):(e.fillStyle=l,e.strokeStyle=l),n)e.beginPath(),e.arc(this.x,this.y,this.size+5,0,2*Math.PI,!1);else for(this.ua(),e.beginPath(),l=this.H(),e.moveTo(this.a[0].x,this.a[0].y),o=1;l>=o;++o){var s=o%l;e.lineTo(this.a[s].x,this.a[s].y)}e.closePath(),n||e.stroke(),e.fill(),null!=i&&(this.ia(e,i),null!=r&&this.ia(e,r,{alpha:Math.sin(.0174*tn)})),(ie||15<this.size)&&!n&&(e.strokeStyle="#000000",e.globalAlpha*=.1,e.stroke()),e.globalAlpha=1,i=-1!=Rt.indexOf(this),n=~~this.y,0!=this.id&&(ae||i)&&this.name&&this.i&&!a&&(r=this.i,r.B(this.name),r.N(this.m()),a=0>=this.id?1:Math.ceil(10*ee)/10,r.ja(a),r=r.L(),o=Math.ceil(r.width/a),l=Math.ceil(r.height/a),e.drawImage(r,~~this.x-~~(o/2),n-~~(l/2),o,l),n+=r.height/2/a+4),0<this.id&&ce&&(i||0==Rt.length&&(!this.c||this.h)&&20<this.size)&&(null==this.P&&(this.P=new W(this.m()/2,"#FFFFFF",!0,"#000000")),i=this.P,i.N(this.m()/2),i.B(~~(this.size*this.size/100)),a=Math.ceil(10*ee)/10,
i.ja(a),r=i.L(),o=Math.ceil(r.width/a),l=Math.ceil(r.height/a),e.drawImage(r,~~this.x-~~(o/2),n-~~(l/2),o,l)),e.restore()}},ia:function(t,e,n){t.save(),t.clip();var o=Math.max(this.size,this.ha);null!=n&&null!=n.alpha&&(t.globalAlpha=n.alpha),t.drawImage(e,this.x-o-5,this.y-o-5,2*o+10,2*o+10),t.restore()}};var nn=function(t){function e(t,e,n){return e>t?e:t>n?n:t}return t.fa=function(t,n){var o;return o=e(.5,0,1),t+o*(n-t)},t.Ba=e,t}({});t.Maths=nn,W.prototype={F:"",U:"#000000",W:!1,X:"#000000",v:16,j:null,V:null,l:!1,D:1,N:function(t){this.v!=t&&(this.v=t,this.l=!0)},ja:function(t){this.D!=t&&(this.D=t,this.l=!0)},B:function(t){t!=this.F&&(this.F=t,this.l=!0)},L:function(){if(null==this.j&&(this.j=document.createElement("canvas"),this.V=this.j.getContext("2d")),this.l){this.l=!1;var t=this.j,e=this.V,n=this.F,o=this.D,a=this.v,i=a+"px Ubuntu";e.font=i;var r=~~(.2*a);t.width=(e.measureText(n).width+6)*o,t.height=(a+r)*o,e.font=i,e.scale(o,o),e.globalAlpha=1,e.lineWidth=3,e.strokeStyle=this.X,e.fillStyle=this.U,this.W&&e.strokeText(n,3,a-r/2),e.fillText(n,3,a-r/2)}return this.j}},Date.now||(Date.now=function(){return(new Date).getTime()}),function(){for(var e=["ms","moz","webkit","o"],n=0;n<e.length&&!t.requestAnimationFrame;++n)t.requestAnimationFrame=t[e[n]+"RequestAnimationFrame"],t.cancelAnimationFrame=t[e[n]+"CancelAnimationFrame"]||t[e[n]+"CancelRequestAnimationFrame"];t.requestAnimationFrame||(t.requestAnimationFrame=function(t){return setTimeout(t,1e3/60)},t.cancelAnimationFrame=function(t){clearTimeout(t)})}();var on={init:function(t){function e(t){return o>t&&(t=o),t>i&&(t=i),~~((t-o)/32)}function n(t){return a>t&&(t=a),t>r&&(t=r),~~((t-a)/32)}var o=t.sa,a=t.ta,i=t.qa,r=t.ra,l=~~((i-o)/32)+1,s=~~((r-a)/32)+1,c=Array(l*s);return{na:function(t){var o=e(t.x)+n(t.y)*l;null==c[o]?c[o]=t:Array.isArray(c[o])?c[o].push(t):c[o]=[c[o],t]},xa:function(t,o,a,i,r){var s=e(t),u=n(o);for(t=e(t+a),o=n(o+i);o>=u;++u)for(i=s;t>=i;++i)if(a=c[i+u*l],null!=a)if(Array.isArray(a))for(var h=0;h<a.length;h++)r(a[h]);else r(a)}}}},an=function(){var t=new j(0,0,0,32,"#ED1C24",""),e=document.createElement("canvas");e.width=32,e.height=32;var n=e.getContext("2d");return function(){0<Rt.length&&(t.color=Rt[0].color,t.A(Rt[0].name)),n.clearRect(0,0,32,32),n.save(),n.translate(16,16),n.scale(.4,.4),t.w(n),n.restore();var o=document.getElementById("favicon"),a=o.cloneNode(!0);a.setAttribute("href",e.toDataURL("image/png")),o.parentNode.replaceChild(a,o)}}();e(function(){an()});var rn={context:null,defaultProvider:"facebook",loginIntent:"0",userInfo:{socialToken:null,tokenExpires:"",level:"",xp:"",xpNeeded:"",name:"",picture:"",displayName:"",loggedIn:"0",socialId:""}},ln=t.defaultSt=rn;t.storageInfo=ln,t.createDefaultStorage=H,t.updateStorage=q,e(function(){null!=t.localStorage.storeObjectInfo&&(ln=JSON.parse(t.localStorage.storeObjectInfo)),"1"==ln.loginIntent&&Y(ln.context),""==ln.userInfo.name&&""==ln.userInfo.displayName||X(ln.userInfo)}),t.checkLoginStatus=function(){"1"==ln.loginIntent&&(sn(),Y(ln.context))};var sn=function(){t.MC.setProfilePicture(ln.userInfo.picture),t.MC.setSocialId(ln.userInfo.socialId)};t.logout=function(){ln=rn,delete t.localStorage.storeObjectInfo,t.localStorage.storeObjectInfo=JSON.stringify(rn),q(),dn(),Lt.cache.sentGameServerLogin=!1,delete Lt.cache.login_info,e("#helloContainer").attr("data-logged-in","0"),e("#helloContainer").attr("data-has-account-data","0"),e(".timer").text(""),e("#gPlusShare").hide(),e("#fbShare").show(),e("#user-id-tag").text(""),m(),t.MC.doLogout()},t.toggleSocialLogin=function(){e("#socialLoginContainer").toggle(),e("#settings").hide(),e("#instructions").hide(),Q()},t.toggleSettings=function(){e("#settings").toggle(),e("#socialLoginContainer").hide(),e("#instructions").hide(),Q()},Lt.account=function(t){function n(){}function o(){console.log("got user login")}return t.init=function(){Lt.core.bind("user_login",o),Lt.core.bind("user_logout",n)},t.setUserData=function(t){X(t)},t.setAccountData=function(t,n){var o=e("#helloContainer").attr("data-has-account-data","1");ln.userInfo.xp=t.xp,ln.userInfo.xpNeeded=t.xpNeeded,ln.userInfo.level=t.level,q(),o&&n?Z(t):(e(".agario-profile-panel .progress-bar-star").text(t.level),e(".agario-exp-bar .progress-bar-text").text(t.xp+"/"+t.xpNeeded+" XP"),e(".agario-exp-bar .progress-bar").css("width",(88*t.xp/t.xpNeeded).toFixed(2)+"%"))},t.za=function(t){Z(t)},t}({});var cn=0;t.fbAsyncInit=function(){function e(){null==t.FB?alert("You seem to have something blocking Facebook on your browser, please check for any extensions"):(ln.loginIntent="1",t.updateStorage(),t.FB.login(function(t){$(t)},{scope:"public_profile, email"}))}t.FB.init({appId:xt.fb_app_id,cookie:!0,xfbml:!0,status:!0,version:"v2.2"}),("1"==t.storageInfo.loginIntent&&"facebook"==t.storageInfo.context||mt)&&t.FB.getLoginStatus(function(n){"connected"===n.status?$(n):"not_authorized"===n.status?(t.logout(),e()):t.logout()}),t.facebookRelogin=e,t.facebookLogin=e};var un=!1;!function(n){function o(){var t=document.createElement("script");t.type="text/javascript",t.async=!0,t.src="//apis.google.com/js/client:platform.js?onload=gapiAsyncInit";var e=document.getElementsByTagName("script")[0];e.parentNode.insertBefore(t,e),i=!0}var a={},i=!1;return t.gapiAsyncInit=function(){e(a).trigger("initialized")},n.google={oa:function(){o()},ma:function(e,n){t.gapi.client.load("plus","v1",function(){console.log("fetching me profile"),gapi.client.plus.people.get({userId:"me"}).execute(function(t){n(t)})})}},n.wa=function(t){i||o(),"undefined"!=typeof gapi?t():e(a).bind("initialized",t)},n}(Lt);var hn=function(n){function o(e){t.MC.doLoginWithGPlus(e),Lt.cache.login_info=[e,"google"],Lt.I.M(e,"google")}function a(t){ln.userInfo.picture=t,e(".agario-profile-picture").attr("src",t)}var i=null,r={client_id:xt.gplus_client_id,cookie_policy:"single_host_origin",scope:"profile email"};return n.ea={Y:function(){return i},init:function(){var e=this,n=ln&&"1"==ln.loginIntent&&"google"==ln.context;Lt.wa(function(){t.gapi.ytsubscribe.go("agarYoutube"),t.gapi.load("auth2",function(){i=t.gapi.auth2.init(r),i.attachClickHandler(document.getElementById("gplusLogin"),{},function(t){console.log("googleUser : "+t)},function(t){console.log("failed to login in google plus: ",JSON.stringify(t,void 0,2))}),i.currentUser.listen(_.bind(e.va,e)),n&&1==i.isSignedIn.get()&&i.signIn()})})},va:function(e){if(i&&e&&i.isSignedIn.get()&&!un){un=!0,ln.loginIntent="1";var n=e.getAuthResponse(),r=n.access_token;t.Y=n,console.log("loggedIn with G+!");var l=e.getBasicProfile();e=l.getImageUrl(),void 0==e?Lt.google.ma(n,function(e){e.result.isPlusUser?(e&&a(e.image.url),o(r),e&&(ln.userInfo.picture=e.image.url),ln.userInfo.socialId=l.getId(),sn()):(alert("Please add Google+ to your Google account and try again.\nOr you can login with another account."),t.logout())}):(a(e),ln.userInfo.picture=e,ln.userInfo.socialId=l.getId(),sn(),o(r)),ln.context="google",t.updateStorage()}},pa:function(){i&&(i.signOut(),un=!1)}},n}(Lt);t.gplusModule=hn;var dn=function(){Lt.ea.pa()};t.logoutGooglePlus=dn;var fn=function(){function t(t,e,n,o,a){var i=e.getContext("2d"),r=e.width;e=e.height,t.color=a,t.A(n),t.size=o,i.save(),i.translate(r/2,e/2),t.w(i),i.restore()}for(var n=new j(-1,0,0,32,"#5bc0de",""),o=new j(-1,0,0,32,"#5bc0de",""),a="#0791ff #5a07ff #ff07fe #ffa507 #ff0774 #077fff #3aff07 #ff07ed #07a8ff #ff076e #3fff07 #ff0734 #07ff20 #ff07a2 #ff8207 #07ff0e".split(" "),i=[],r=0;r<a.length;++r){var l=r/a.length*12,s=30*Math.sqrt(r/a.length);i.push(new j(-1,Math.cos(l)*s,Math.sin(l)*s,10,a[r],""))}V(i);var c=document.createElement("canvas");return c.getContext("2d"),c.width=c.height=70,t(o,c,"",26,"#ebc0de"),function(){e(".cell-spinner").filter(":visible").each(function(){var o=e(this),a=Date.now(),i=this.width,r=this.height,l=this.getContext("2d");l.clearRect(0,0,i,r),l.save(),l.translate(i/2,r/2);for(var s=0;10>s;++s)l.drawImage(c,(.1*a+80*s)%(i+140)-i/2-70-35,r/2*Math.sin((.001*a+s)%Math.PI*2)-35,70,70);l.restore(),(o=o.attr("data-itr"))&&(o=g(o)),t(n,this,o||"",+e(this).attr("data-size"),"#5bc0de")}),e("#statsPellets").filter(":visible").each(function(){e(this);var n=this.width,o=this.height;for(this.getContext("2d").clearRect(0,0,n,o),n=0;n<i.length;n++)t(i[n],this,"",i[n].size,i[n].color)})}}();t.createParty=function(){d(":party"),De=function(n){et("/#"+t.encodeURIComponent(n)),e(".partyToken").val("agar.io/#"+t.encodeURIComponent(n)),e("#helloContainer").attr("data-party-state","1"),token=t.encodeURIComponent(n)},m()},t.joinParty=tt,t.cancelParty=function(){et("/"),e("#helloContainer").attr("data-party-state","0"),d(""),m()};var gn=[],pn=0,mn="#000000",vn=!1,Sn=!1,bn=0,yn=0,Un=0,xn=0,kn=0,En=!0;t.onPlayerDeath=nt,setInterval(function(){Sn&&gn.push(z()/100)},1e3/60),setInterval(function(){var t=it();0!=t&&(++Un,0==kn&&(kn=t),kn=Math.min(kn,t))},1e3),t.closeStats=function(){vn=!1,e("#stats").hide(),t.destroyAd(t.adSlots.ab),h(0)},t.setSkipStats=function(t){En=!t},t.getStatsString=st,t.gPlusShare=ct,t.twitterShareStats=function(){var e=t.getStatsString("g_plus_share_stats");t.open("https://twitter.com/intent/tweet?text="+e,"Agar.io","width=660,height=310,menubar=no,toolbar=no,resizable=yes,scrollbars=no,left="+(t.screenX+t.innerWidth/2-330)+",top="+(t.innerHeight-310)/2)},t.fbShareStats=function(){var e=t.getStatsString("fb_matchresults_subtitle");t.FB.ui({method:"feed",display:"iframe",name:g("fb_matchresults_title"),caption:g("fb_matchresults_description"),description:e,link:"http://agar.io",Fa:"http://static2.miniclipcdn.com/mobile/agar/Agar.io_matchresults_fb_1200x630.png",ya:{name:"play now!",link:"http://agar.io"}})},t.fillSocialValues=function(e,n){1==t.isChrome&&"google"==t.storageInfo.context&&t.gapi.interactivepost.render(n,{contenturl:xt.game_url,clientid:xt.gplus_client_id,cookiepolicy:"http://agar.io",prefilltext:e,calltoactionlabel:"BEAT",calltoactionurl:xt.game_url})},e(function(){e(a),"MAsyncInit"in t&&t.MAsyncInit()})}}}},removed=!1,d=function(t){if(t.src.indexOf("main_out.js")>=0){window.ok=!0,t.parentNode.removeChild(t),removed=!0;var e=document.createElement("script");e.innerHTML=engine(window,window.jQuery),document.head.appendChild(e)}},observer=new window.WebKitMutationObserver(function(t){t.forEach(function(t){for(var e=0;e<t.addedNodes.length;++e)try{d(t.addedNodes[e])}catch(n){}})});observer.observe(window.document,{subtree:!0,childList:!0,attribute:!1});