/* Official Website : https://OpenSpeedTest.COM | Email: support@openspeedtest.com Developed by : Vishnu | https://Vishnu.Pro | Email : me@vishnu.pro Like this Project? Please Donate NOW & Keep us Alive -> https://go.openspeedtest.com/Donate Speed Test by OpenSpeedTest™️ is Free and Open-Source Software (FOSS) with MIT License. Read full license terms @ http://go.openspeedtest.com/License If you have any Questions, ideas or Comments Please Send it via -> https://go.openspeedtest.com/SendMessage */ window.onload=function(){var X=document.getElementById("OpenSpeedTest-UI");X.parentNode.replaceChild(X.contentDocument.documentElement,X);ostOnload();OpenSpeedTest.Start()}; (function(X){function h(c){if(!(this instanceof h))return new h(c);this.el=document.getElementById(c)}var m,Ma,Na=function(c){c&&"function"===typeof c&&c()};h.prototype.fade=function(c,d,a){var f="in"===c,t=f?0:1,w=14/d,n=this;f&&(n.el.style.display="block",n.el.style.opacity=t);var q=window.setInterval(function(){t=f?t+w:t-w;n.el.style.opacity=t;0>=t&&(n.el.style.display="none");(0>=t||1<=t)&&window.clearInterval(q,Na(a))},14)};var Oa=function(c,d,a,f){c/=f;c--;return a*(c*c*c+1)+d},r=function(){this.YourIP= h("YourIP");this.ipDesk=h("ipDesk");this.ipMob=h("ipMob");this.downSymbolDesk=h("downSymbolDesk");this.upSymbolDesk=h("upSymbolDesk");this.upSymbolMob=h("upSymbolMob");this.downSymbolMob=h("downSymbolMob");this.settingsMob=h("settingsMob");this.settingsDesk=h("settingsDesk");this.oDoLiveStatus=h("oDoLiveStatus");this.ConnectErrorMob=h("ConnectErrorMob");this.ConnectErrorDesk=h("ConnectErrorDesk");this.downResult=h("downResult");this.upRestxt=h("upRestxt");this.pingResult=h("pingResult");this.jitterDesk= h("jitterDesk");this.pingMobres=h("pingMobres");this.JitterResultMon=h("JitterResultMon");this.JitterResultms=h("JitterResultms");this.UI_Desk=h("UI-Desk");this.UI_Mob=h("UI-Mob");this.oDoTopSpeed=h("oDoTopSpeed");this.startButtonMob=h("startButtonMob");this.startButtonDesk=h("startButtonDesk");this.intro_Desk=h("intro-Desk");this.intro_Mob=h("intro-Mob");this.loader=h("loading_app");this.OpenSpeedtest=h("OpenSpeedtest");this.mainGaugebg_Desk=h("mainGaugebg-Desk");this.mainGaugeBlue_Desk=h("mainGaugeBlue-Desk"); this.mainGaugeWhite_Desk=h("mainGaugeWhite-Desk");this.mainGaugebg_Mob=h("mainGaugebg-Mob");this.mainGaugeBlue_Mob=h("mainGaugeBlue-Mob");this.mainGaugeWhite_Mob=h("mainGaugeWhite-Mob");this.oDoLiveSpeed=h("oDoLiveSpeed");this.progressStatus_Mob=h("progressStatus-Mob");this.progressStatus_Desk=h("progressStatus-Desk");this.graphc1=h("graphc1");this.graphc2=h("graphc2");this.graphMob2=h("graphMob2");this.graphMob1=h("graphMob1");this.text=h("text");this.scale=[{degree:680,value:0},{degree:570,value:.5}, {degree:460,value:1},{degree:337,value:10},{degree:220,value:100},{degree:115,value:500},{degree:0,value:1E3}];this.polygon=this.chart=this.element="";this.width=200;this.height=50;this.maxValue=0;this.values=[];this.points=[];this.vSteps=5;this.measurements=[];this.points=[]};r.prototype.reset=function(){this.polygon=this.chart=this.element="";this.width=200;this.height=50;this.maxValue=0;this.values=[];this.points=[];this.vSteps=5;this.measurements=[];this.points=[]};r.prototype.ip=function(){"block"=== this.ipDesk.el.style.display?(this.ipDesk.el.style.display="none",this.ipMob.el.style.display="none"):(this.ipDesk.el.style.display="block",this.ipMob.el.style.display="block")};r.prototype.prePing=function(){this.loader.fade("out",500);this.OpenSpeedtest.fade("in",1E3)};r.prototype.app=function(){this.loader.fade("out",500,this.ShowAppIntro())};r.prototype.ShowAppIntro=function(){this.OpenSpeedtest.fade("in",1E3)};r.prototype.userInterface=function(){this.intro_Desk.fade("out",1E3);this.intro_Mob.fade("out", 1E3,this.ShowUI())};r.prototype.ShowUI=function(){this.UI_Desk.fade("in",1E3);this.UI_Mob.fade("in",1E3,function(c){m="Loaded";console.log("Developed by Vishnu. Email --\x3e me@vishnu.pro")})};r.prototype.Symbol=function(c){0==c&&(this.downSymbolMob.el.style.display="block",this.downSymbolDesk.el.style.display="block",this.upSymbolMob.el.style.display="none",this.upSymbolDesk.el.style.display="none");1==c&&(this.downSymbolMob.el.style.display="none",this.downSymbolDesk.el.style.display="none",this.upSymbolMob.el.style.display= "block",this.upSymbolDesk.el.style.display="block");2==c&&(this.downSymbolMob.el.style.display="none",this.downSymbolDesk.el.style.display="none",this.upSymbolMob.el.style.display="none",this.upSymbolDesk.el.style.display="none")};r.prototype.Graph=function(c,d){function a(q,M){for(n=f.maxValue=0;nf.maxValue&&(f.maxValue=f.values[n]);f.maxValue=Math.ceil(f.maxValue);if(1=d&&(clearInterval(t),Ma="done",a.progressStatus_Desk.el.style.strokeDashoffset=800,a.progressStatus_Mob.el.style.strokeDashoffset=800)},14)};r.prototype.mainGaugeProgress=function(c){var d=c;0>d&&(d=0);var a=this.getNonlinearDegree(d);0=d&&(this.mainGaugeBlue_Mob.el.style.strokeDashoffset=681.1,this.mainGaugeWhite_Mob.el.style.strokeDashoffset=.1,this.mainGaugeWhite_Desk.el.style.strokeDashoffset=.1,this.mainGaugeBlue_Desk.el.style.strokeDashoffset=681.1)};r.prototype.showStatus=function(c){this.oDoLiveStatus.el.textContent=c};r.prototype.ConnectionError=function(){this.ConnectErrorMob.el.style.display= "block";this.ConnectErrorDesk.el.style.display="block"};r.prototype.uploadResult=function(c){1>c&&(this.upRestxt.el.textContent=c.toFixed(3));1<=c&&9999>c&&(this.upRestxt.el.textContent=c.toFixed(1));1E4<=c&&99999>c&&(this.upRestxt.el.textContent=c.toFixed(1),this.upRestxt.el.style.fontSize="20px");1E5<=c&&(this.upRestxt.el.textContent=c.toFixed(1),this.upRestxt.el.style.fontSize="18px")};r.prototype.pingResults=function(c,d){var a=c;"Ping"===d&&(1<=a&&1E4>a?(this.pingResult.el.textContent=Math.floor(a), this.pingMobres.el.textContent=Math.floor(a)):0<=a&&1>a&&(0==a&&(a=0),this.pingResult.el.textContent=a,this.pingMobres.el.textContent=a));"Error"===d&&(this.oDoLiveSpeed.el.textContent=a)};r.prototype.downloadResult=function(c){1>c&&(this.downResult.el.textContent=c.toFixed(3));1<=c&&9999>c&&(this.downResult.el.textContent=c.toFixed(1));1E4<=c&&99999>c&&(this.downResult.el.textContent=c.toFixed(1),this.downResult.el.style.fontSize="20px");1E5<=c&&(this.downResult.el.textContent=c.toFixed(1),this.downResult.el.style.fontSize= "18px")};r.prototype.jitterResult=function(c,d){var a=c;"Jitter"===d&&(1<=a&&1E4>a?(this.jitterDesk.el.textContent=Math.floor(a),1<=a&&100>a&&(this.JitterResultMon.el.textContent=Math.floor(a)),100<=a&&(a=(a/1E3).toFixed(1),this.JitterResultMon.el.textContent=a+"k")):0<=a&&1>a&&(0==a&&(a=0),this.jitterDesk.el.textContent=a,this.JitterResultMon.el.textContent=a))};r.prototype.LiveSpeed=function(c,d){var a=c;if("countDown"===d){var f=a.toFixed(0);this.oDoLiveSpeed.el.textContent=f}else"speedToZero"=== d?("number"==typeof a&&(a=a.toFixed(1)),0>=a&&(a=0),this.oDoLiveSpeed.el.textContent=a,this.oDoTopSpeed.el.textContent="1000+",this.oDoTopSpeed.el.style.fontSize="16.9px",this.oDoTopSpeed.el.style.fill="gray"):"Ping"===d?1<=a&&1E4>a?this.oDoLiveSpeed.el.textContent=Math.floor(a):0<=a&&1>a&&(0==a&&(a=0),this.oDoLiveSpeed.el.textContent=a):(0==a&&(f=a.toFixed(0),this.oDoLiveSpeed.el.textContent=f),1>=a&&0=a&&(this.oDoTopSpeed.el.textContent="1000+",this.oDoTopSpeed.el.style.fontSize="16.9px",this.oDoTopSpeed.el.style.fill="gray"),1010<=a&&(this.oDoTopSpeed.el.textContent=1E3*Math.floor(a/1010)+"+",this.oDoTopSpeed.el.style.fill="gray",this.oDoTopSpeed.el.style.fontSize="17.2px"))};r.prototype.GaugeProgresstoZero=function(c,d){var a=this;if(0<=c)var f=Date.now(),t=0-c,w=setInterval(function(){var n=(Date.now()-f)/1E3;var q=n/3;q--;q=t*(q*q*q*q*q+1)+c;a.LiveSpeed(q,"speedToZero");a.mainGaugeProgress(q); if(3<=n||0>=q)clearInterval(w),a.LiveSpeed(0,"speedToZero"),a.mainGaugeProgress(0),m=d},16)};r.prototype.getNonlinearDegree=function(c){var d=0;if(0==c||0>=c||isNaN(c))return 0;for(;dthis.scale[d].value)d++;else return this.scale[d-1].degree+(c-this.scale[d-1].value)*(this.scale[d].degree-this.scale[d-1].degree)/(this.scale[d].value-this.scale[d-1].value);return this.scale[this.scale.length-1].degree};var O=function(){this.OverAllTimeAvg=window.performance.now();this.SpeedSamples= [];this.FinalSpeed};O.prototype.reset=function(){this.OverAllTimeAvg=window.performance.now();this.SpeedSamples=[];this.FinalSpeed=0};O.prototype.ArraySum=function(c){return c?c.reduce(function(d,a){if("number"===typeof d&&"number"===typeof a)return d+a},0):0};O.prototype.AvgSpeed=function(c,d,a){this.timeNow=(window.performance.now()-this.OverAllTimeAvg)/1E3;this.FinalSpeed;this.timeNow>=a-d&&(0=l&&(clearInterval(g),G=!0,Z=void 0,d())}Pa&&(x.remEvt(e.settingsMob.el,"click",c),x.remEvt(e.settingsDesk.el,"click",c),x.remEvt(e.startButtonDesk.el,"click",d),x.remEvt(e.startButtonMob.el,"click",d),x.remEvt(document,"keypress",a),Pa=!1);if(0<=Z){G=!1;e.userInterface();ua=!1;var l=Math.ceil(Math.abs(Z));e.showStatus("Automatic Test Starts in ...");var g=setInterval(b,1E3)}"fetch"===openSpeedTestServerList&&!0===G&&(G=!1,e.showStatus("Fetching Server Info.."),Y(6));!0===G&&("Ping"=== A?f():"Download"===A?f():"Upload"===A?f():!1===A&&f())}function a(b){"Enter"===b.key&&d()}function f(){ua&&(e.userInterface(),ua=!1);t()}function t(){function b(){va=window.performance.now();n()}"widget"!==openChannel&&"web"!==openChannel||Y(1);var l=setInterval(function(){"Loaded"===m&&(m="busy",Q());"Ping"===m&&(m="busy",e.showStatus("Milliseconds"));"Download"===m&&(e.showStatus("Initializing.."),x.reset(),y=ha=0,e.reset(),wa=window.performance.now(),w(),m="initDown");if("Downloading"===m){e.Symbol(0); if(0==aa){aa=1;e.showStatus("Testing download speed..");var g=(window.performance.now()-wa)/1E3;Qa=g;e.progress(1,dlDuration+2.5);dlDuration+=g}xa=(window.performance.now()-wa)/1E3;q("dl");e.showStatus("Mbps download");e.mainGaugeProgress(y);e.LiveSpeed(y);e.Graph(y,0);R=x.AvgSpeed(y,ya,dlDuration);xa>=dlDuration&&"done"==Ma&&(A?(e.GaugeProgresstoZero(y,"SendR"),e.showStatus("All done"),e.Symbol(2)):e.GaugeProgresstoZero(y,"Upload"),e.downloadResult(R),ia=S,I=1,m="busy",y=ha=0,x.reset())}"Upload"== m&&1===I&&(e.Symbol(1),m="initup",e.showStatus("Initializing.."),e.LiveSpeed("...","speedToZero"),za=x.uRandom(ulDataSize,b),A&&(aa=1));"Uploading"===m&&(1==aa&&(aa=2,e.showStatus("Testing upload speed.."),y=0,x.reset(),e.reset(),Ra=g=(window.performance.now()-va)/1E3,e.progress(!1,ulDuration+2.5),ulDuration+=g),e.showStatus("Mbps upload"),T=(window.performance.now()-va)/1E3,q("up"),e.mainGaugeProgress(y),e.LiveSpeed(y),e.Graph(y,1),U=x.AvgSpeed(y,Aa,ulDuration),T>=ulDuration&&1==I&&(ja=P,e.uploadResult(U), e.GaugeProgresstoZero(y,"SendR"),za=void 0,e.showStatus("All done"),e.Symbol(2),m="busy",I=0));if("Error"===m){e.showStatus("Check your network connection status.");e.ConnectionError();m="busy";clearInterval(l);g=document.createElement("div");g.innerHTML='';var u=g.querySelector("a");e.oDoLiveSpeed.el.textContent="Network Error";var C=document.getElementById("oDoLiveSpeed");u.innerHTML=C.innerHTML; C.innerHTML=g.innerHTML}"SendR"===m&&(e.showStatus("All done"),g=document.createElement("div"),g.innerHTML='',u=g.querySelector("a"),e.oDoLiveSpeed.el.textContent=fb,C=document.getElementById("oDoLiveSpeed"),u.innerHTML=C.innerHTML,C.innerHTML=g.innerHTML,location.hostname!=Ba.toLowerCase()+Sa?(ba="https://"+Ba.toLowerCase()+Sa+"/results/show.php?&d="+R.toFixed(3)+"&u="+U.toFixed(3)+"&p="+ Ca+"&j="+Da+"&dd="+(ia/1048576).toFixed(3)+"&ud="+(ja/1048576).toFixed(3)+"&ua="+Ta,ba=encodeURI(ba),g=document.getElementById("resultsData"),g.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",ba),g.setAttribute("target","_blank"),saveData&&Y(5)):Y(3),m="busy",clearInterval(l))},100)}function w(){for(var b=0;b1E3*Qa+ya/2*1E3&&0===Ua&&(Ua=1,ka*=.01,ca*=.01,la=l+1E4);l>=la&&la=S?0:S-Wa;Wa=S;ca+=Va;Xa=Ea=l-Ea;Ea=l;ka+=Xa;01E3*Ra+Aa/2*1E3&&0===Ya&&(Ya=1,ma*=.1,da*=.1,na=b+1E4),b>=na&&na=P?0:P-$a,$a=P,da+=Za,ab=Fa=b-Fa,Fa=b,ma+=ab,0=g.loaded?0:g.loaded-l;if(isNaN(u)||!isFinite(u)||0>u)return!1;S+=u;l=g.loaded};z[b].onload=function(g){0===l&&(S+=g.total);"initDown"==m&&(m="Downloading");z[b]&&(z[b].abort(),z[b]=null,z[b]=void 0,delete z[b]);0===I&&M(b)};z[b].onerror=function(g){0===I&&M(b)};z[b].responseType="arraybuffer";z[b].send()}function F(b){var l=0;v[b]=new XMLHttpRequest;v[b].open("POST",Ga.Upload+"?n="+Math.random(),!0); v[b].upload.onprogress=function(g){"initup"==m&&void 0===u&&(m="Uploading");if(T>=ulDuration)return v[b].abort(),v[b]=null,v[b]=void 0,delete v[b],!1;var u=0>=g.loaded?0:g.loaded-l;if(isNaN(u)||!isFinite(u)||0>u)return!1;P+=u;l=g.loaded};v[b].onload=function(){if(0===l&&(P+=1048576*ulDataSize,T>=ulDuration))return v[b].abort(),v[b]=null,v[b]=void 0,delete v[b],!1;if("initup"==m&&void 0===g){var g;m="Uploading"}v[b]&&(v[b].abort(),v[b]=null,v[b]=void 0,delete v[b]);1===I&&F(b)};v[b].onerror=function(g){T<= ulDuration&&F(b)};v[b].setRequestHeader("Content-Type","application/octet-stream");0=P||v[b].send(za)}function Q(){bb=openSpeedTestServerList.length;m="Ping";performance.clearResourceTimings();if(Ha=B?J.push(.1):J.push(B);1=ra&&(ulThreads=dlThreads=ra)}if(selectServer&&("string"===typeof k.host||"string"===typeof k.h)){if("undefined"!==typeof k.host)var sa=k.host;else"undefined"!==typeof k.h&&(sa=k.h);/(?:https?):\/\/(\w+:?\w*)?(\S+)(:\d+)?(\/|\/([\w#!:.?+=&%!\-\/]))?/.test(sa)&& (openSpeedTestServerList=[{ServerName:"Home",Download:sa+"/downloading",Upload:sa+"/upload",ServerIcon:"DefaultIcon"}])}E=parseInt(k.stress);W=parseInt(k.s);if("string"===typeof k.stress){var p=k.stress;var H=E}else"string"===typeof k.s&&(p=k.s,H=W);if(p&&stressTest){if("low"===p||"l"===p)ulDuration=dlDuration=300;if("medium"===p||"m"===p)ulDuration=dlDuration=600;if("high"===p||"h"===p)ulDuration=dlDuration=900;if("veryhigh"===p||"v"===p)ulDuration=dlDuration=1800;if("extreme"===p||"e"===p)ulDuration= dlDuration=3600;if("day"===p||"d"===p)ulDuration=dlDuration=86400;if("year"===p||"y"===p)ulDuration=dlDuration=31557600;if(12p||5>H)upAdjust=1+E/100,dlAdjust=1+E/100}else dlAdjust=upAdjust=1;p=parseInt(k.run);H=parseInt(k.r);var Z;!enableRun||"string"!==typeof k.run&&"string"!==typeof k.r||(Z=0