jQuery(function(e){e(document).on("click",".sp-pagebuilder-lang-btns .sp-pagebuilder-btn-install, .sp-pagebuilder-lang-btns .sp-pagebuilder-btn-update",function(a){a.preventDefault();var s=e(this),l=s.closest("tr").data("language");e.ajax({type:"POST",url:pagebuilder_base+"index.php?option=com_sppagebuilder&task=languages.install&language="+l,beforeSend:function(){s.html('<i class="fa fa-spinner fa-spin"></i> Installing...')},success:function(a){var l=e.parseJSON(a);l.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">'+l.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(l.message))}})})});