if(typeof Solo=="undefined"){var Solo={}}if(typeof Solo.Restore=="undefined"){Solo.Restore={errorCallback:null,statistics:{inbytes:0,outbytes:0,files:0},factory:null,password:null,ajaxURL:null,mainURL:null,translations:{}}}(function(a){Solo.Restore.errorCallbackDefault=function(b){a("#restoration-progress").hide();a("#restoration-error").show();a("#backup-error-message").html(b)};Solo.Restore.doAjax=function(h,b,e){json=JSON.stringify(h);if(Solo.Restore.password.length>0){json=AesCtr.encrypt(json,Solo.Restore.password,128)}var i={json:json};var f=new Date().getTime()/1000;var g=parseInt(f,10);var d=Math.round((f-g)*1000)/1000;i._cacheBustingJunk=d;var c={type:"POST",url:Solo.Restore.ajaxURL,cache:false,data:i,timeout:600000,success:function(o){var n=null;var l="";var j=o.indexOf("###");if(j==-1){o="Invalid AJAX data: "+o;if(e==null){if(Solo.Restore.errorCallback!=null){Solo.Restore.errorCallback(o)}}else{e(o)}return}else{if(j!=0){n=o.substr(0,j);l=o.substr(j)}else{l=o}}l=l.substr(3);j=l.lastIndexOf("###");l=l.substr(0,j);if(Solo.Restore.password.length>0){l=AesCtr.decrypt(l,Solo.Restore.password,128)}try{var m=JSON.parse(l)}catch(k){errorMessage=k.message+"\n
\n
\n"+l+"\n
";if(e==null){if(Solo.Restore.errorCallback!=null){Solo.Restore.errorCallback(errorMessage)}}else{e(errorMessage)}return}b(m)},error:function(j,m,l){var k="AJAX Loading Error: "+m;if(e==null){if(Solo.Restore.errorCallback!=null){Solo.Restore.errorCallback(k)}}else{e(k)}}};a.ajax(c)};Solo.Restore.startTimeoutBar=function(c,b){var d=0;a("#response-timer div.text").everyTime(1000,"lastReponse",function(){d++;var e=Solo.Restore.translations["UI-LASTRESPONSE"].replace("%s",d.toFixed(0));a("#response-timer div.text").html(e)})};Solo.Restore.resetTimeoutBar=function(){a("#response-timer div.text").stopTime();var b=Solo.Restore.translations["UI-LASTRESPONSE"].replace("%s","0");a("#response-timer div.text").html(b)};Solo.Restore.pingRestoration=function(){Solo.Restore.statistics.inbytes=0;Solo.Restore.statistics.outbytes=0;Solo.Restore.statistics.files=0;var b={task:"ping"};Solo.Restore.startTimeoutBar(5000,80);Solo.Restore.doAjax(b,function(c){Solo.Restore.start(c)})};Solo.Restore.start=function(){Solo.Restore.statistics.inbytes=0;Solo.Restore.statistics.outbytes=0;Solo.Restore.statistics.files=0;var b={task:"startRestore"};Solo.Restore.startTimeoutBar(5000,80);Solo.Restore.doAjax(b,function(c){Solo.Restore.step(c)})};Solo.Restore.step=function(b){Solo.Restore.resetTimeoutBar();if(b.status==false){Solo.Restore.errorCallbackDefault(b.message)}else{if(b.done){Solo.Restore.factory=b.factory;a("#restoration-progress").hide();a("#restoration-extract-ok").show()}else{Solo.Restore.statistics.inbytes+=b.bytesIn;Solo.Restore.statistics.outbytes+=b.bytesOut;Solo.Restore.statistics.files+=b.files;a("#extbytesin").html(Solo.Restore.statistics.inbytes);a("#extbytesout").html(Solo.Restore.statistics.outbytes);a("#extfiles").html(Solo.Restore.statistics.files);post={task:"stepRestore",factory:b.factory};Solo.Restore.startTimeoutBar(5000,80);Solo.Restore.doAjax(post,function(c){Solo.Restore.step(c)})}}};Solo.Restore.finalize=function(){var b={task:"finalizeRestore",factory:Solo.Restore.factory};Solo.Restore.startTimeoutBar(5000,80);Solo.Restore.doAjax(b,function(c){Solo.Restore.finished(c)})};Solo.Restore.finished=function(){window.location=Solo.Restore.mainURL};Solo.Restore.runInstaller=function(b){window.open(b+"/installation/index.php","solo_angie_window")}}(akeeba.jQuery));