jQuery(function(t){function a(a,n,e,s,i,l){var r='<span class="rt-icon-spinner animate-spin"></span> '+e;i.html(r).prop("disabled",!0),console.log("rtrsOurPlugins.ajaxurl",rtrsOurPlugins.ajaxurl),t.ajax({url:rtrsOurPlugins.ajaxurl,type:"POST",data:{action:a,slug:n,nonce:rtrsOurPlugins.nonce},success:function(t){if(t.success){if("function"==typeof l)return void l(t);i.removeClass("not-activated install-plugins").addClass("success-class").text(s)}else alert(t.data.message||"Something went wrong"),i.text(i.data("default-text")).prop("disabled",!1)},error:function(){alert("Request failed"),i.text(i.data("default-text")).prop("disabled",!1)}})}t(document).on("click",".rtrs-admin-btn.not-activated",function(n){n.preventDefault();var e=t(this);e.data("default-text","Activate Now"),a("rtrs_activate_plugin",e.data("slug"),"Activating...","Activated",e)}),t(document).on("click",".rtrs-admin-btn.install-plugins",function(n){n.preventDefault();var e=t(this),s=e.data("slug");e.data("default-text","Install Now"),a("rtrs_install_plugin",s,"Installing...","Installed",e,function(){a("rtrs_activate_plugin",s,"Activating...","Activated",e)})})});