$(document).ready((function(){const e=$("#mailList"),i=$("#mailPreview"),t=$("#closeReadEmail"),c=$("#messageCount");function s(){const e=$(window).width();return e>=1200?"27rem":e>=992?"21rem":e>=768?"22rem":"0rem"}function n(){$(window).width()<768&&i.is(":visible")?(i.css({"background-color":"#fff","z-index":"99"}),e.css("z-index","0")):(i.css({"background-color":"","z-index":""}),e.css("z-index",""))}i.hide(),$(document).on("click",".rich-list-item",(function(t){if($(t.target).is("input, label, .checkbox"))return;t.preventDefault();const o=$(this);i.show(),e.css("max-width",s()),c.hide(),$(".rich-list-item").removeClass("active"),o.addClass("active"),o.find('input[type="checkbox"]').prop("checked",!0),n()})),t.on("click",(function(t){t.preventDefault(),i.hide(),e.css("max-width",""),c.show(),$(".rich-list-item").removeClass("active"),$('.rich-list-item input[type="checkbox"]').prop("checked",!1),n()})),$(window).on("resize",(function(){i.is(":visible")&&(e.css("max-width",s()),n())})),$(document).on("click",'.text-danger, .dropdown-item[href="#"]',(function(t){t.preventDefault();const s=e.find('.rich-list-item input[type="checkbox"]:checked').closest(".rich-list-item");0!==s.length?(s.remove(),0===e.find(".rich-list-item.active").length&&(i.hide(),e.css("max-width",""),c.show(),n())):alert("Please select email(s) to delete.")}))}));