(function($){$(function(){$(document).on("click",".wpide-notice-action a[data-action]",function(evt){let container=$(this).closest(".nk-notification-item");let notice=$(this).closest(".wpide-notice-action");let ajaxAction=notice.attr("data-action");let nonce=notice.attr("data-nonce");let noticeAction=$(this).attr("data-action");let params=$(this).attr("data-params");params=params?JSON.parse(params):null;if(container.length){let index=container.index();let event=new CustomEvent("wpide_notice_removed",{detail:index});document.body.dispatchEvent(event)}else{container=$(this).closest(".wpide-notice");container.slideUp(function(){$(this).remove()})}evt.preventDefault();$.post(ajaxurl,{action:ajaxAction,notice_action:noticeAction,_nonce:nonce,params:params}).fail(function(error){console.log(error)})})})})(jQuery);