jQuery(function(l){l(document).on("click",".sp-pagebuilder-lang-btns .sp-pagebuilder-btn-install, .sp-pagebuilder-lang-btns .sp-pagebuilder-btn-update",function(e){e.preventDefault();var s=l(this),a=s.closest("tr").data("language");l.ajax({type:"POST",url:pagebuilder_base+"index.php?option=com_sppagebuilder&task=languages.install&language="+a,beforeSend:function(){s.html('<i class="fa fa-spinner fa-spin"></i> Installing...')},success:function(e){var a=l.parseJSON(e);a.success?(s.find("i").removeAttr("class"),s.html('<i class="fa fa-check"></i> Installed'),s.closest("tr").find(".installed-version").html('<span class="label label-success">'+a.version+"</span>"),setTimeout(function(){s.closest("tr").removeAttr("class").addClass("enabled update-updated")},500)):(s.find("i").removeAttr("class"),s.html('<i class="fa fa-exclamation-triangle"></i> error'),alert(a.message))}})})});