(()=>{var o,t;o=jQuery,t={init:function(){o(".dokan-modules").on("change","input.dokan-toggle-module",this.toggleModule),o("body").on("click",".shipment-item-details-tab-toggle",function(){var t=o(this).data("shipment_id");return o(".shipment_body_"+t).toggle(),o(".shipment_footer_"+t).toggle(),o(".shipment_notes_area_"+t).toggle(),o(this).find("span").toggleClass("dashicons-arrow-down-alt2 dashicons-arrow-up-alt2"),!1}),o("body").on("click",".shipment-notes-details-tab-toggle",function(t){t.preventDefault();var e=o(this).data("shipment_id");o(".shipment-list-notes-inner-area"+e).toggle(),o(this).find("span").toggleClass("dashicons-arrow-down-alt2 dashicons-arrow-up-alt2")})},toggleModule:function(t){var e=o(this);if(e.is(":checked"))var n=dokan_admin.activating,a={action:"dokan-toggle-module",type:"activate",module:e.closest("li").data("module"),nonce:dokan_admin.nonce};else n=dokan_admin.deactivating,a={action:"dokan-toggle-module",type:"deactivate",module:e.closest("li").data("module"),nonce:dokan_admin.nonce};e.closest(".plugin-card").block({message:n,overlayCSS:{background:"#222",opacity:.7},css:{fontSize:"19px",color:"#fff",border:"none",backgroundColor:"none",cursor:"wait"}}),wp.ajax.send("dokan-toggle-module",{data:a,success:function(o){},error:function(o){"plugin-exists"===o.error&&wp.ajax.send("dokan-toggle-module",{data:a})},complete:function(t){o(".blockMsg").text(t.data),setTimeout(function(){e.closest(".plugin-card").unblock()},1e3)}})}},o(document).ready(function(){t.init()})})();