(()=>{"use strict";class t{constructor(t){this.$element=t,this.key=t.data("key"),this.nonce=t.data("nonce"),this.$element.on("click",".notice-dismiss",(()=>this.onDismissClick()))}onDismissClick(){this.$element.remove(),jQuery.ajax({type:"POST",data:{action:"wpmtst_dismiss_notice",nonce:this.nonce,key:this.key},url:ajaxurl})}}class e{constructor(){jQuery("body").hasClass("wpm-testimonial_page_strong-testimonials-addons")&&(this.reloadButton=jQuery("#wpmtst-reload-extensions"),this.reloadButton.on("click",(t=>this.onReloadExtensionsClick(t))))}onReloadExtensionsClick(t){t.preventDefault(),this.reloadButton.addClass("updating-message"),jQuery.ajax({type:"POST",data:{action:"wpmtst_reload_extensions",nonce:this.reloadButton.data("nonce")},url:ajaxurl,success(t){location.reload()}})}}Array.max=function(t){return Math.max.apply(Math,t)},jQuery(document).ready((function(t){t.fn.showInlineBlock=function(){return this.css("display","inline-block")},t("input[type=url]").on("change",(function(){this.value.length&&!/^https*:\/\//.test(this.value)&&(this.value="http://"+this.value)})),t("ul.ui-tabs-nav li a").on("click",(function(){t(this).trigger("blur")})),t(".focus-next-field").on("change",(function(e){t(e.target).is(":checked")&&t(e.target).parent().next().find("input").focus().trigger("select")})),t("#toggle-screen-options").add("#screenshot-screen-options").on("click",(function(e){t(this).trigger("blur"),t("#screenshot-screen-options").slideToggle()})),t("#toggle-help").on("click",(function(e){t(this).toggleClass("closed open").trigger("blur"),t("#help-section").slideToggle()})),t("table.wpm-testimonial_page_testimonial-views th.manage-column").on("click",(function(e){const s={action:"wpmtst_save_view_list_order",name:t(this).attr("id"),order:t(this).hasClass("asc")?"desc":t(this).hasClass("desc")?"asc":"",nonce:wpmtstAdminScriptNonce};t.post(ajaxurl,s,(function(t){}))})),t("table.wpm-testimonial_page_testimonial-views").on("click",".stickit",(function(e){const s=t(this);s.closest(".wp-list-table-wrap").find(".overlay").fadeIn(200),s.trigger("blur").toggleClass("stuck");const n={action:"wpmtst_save_view_sticky",id:t(this).closest("tr").find("td.id").html(),nonce:wpmtstAdminScriptNonce};t.post(ajaxurl,n,(function(t){t&&window.location.reload()}))}))})),window.wpmtstAdmin=new class{constructor(){this.initNotices(),this.initAddonsPage()}initNotices(e=jQuery("body")){e.find(".wpmtst-notice").each((function(e){new t(jQuery(this))}))}initAddonsPage(){new e(jQuery(this))}}})();