(()=>{var e={1669:e=>{"use strict";e.exports=jQuery},3274:()=>{const e=document.getElementById("edd-email-status-filter"),t=document.getElementById("edd-email-recipient-filter"),a=document.getElementById("edd-email-sender-filter"),d=document.getElementById("edd-email-context-filter"),n=document.getElementById("edd-email-clear-filters"),l=document.getElementById("no-items");function s(s){const o=document.querySelectorAll("table.email_templates tbody tr:not(#no-items)");if(!o||!(e||t||a))return;const r=e?e.value:"",c=t?t.value:"",u=a?a.value:"",m=d?d.value:"";n.style.display="none",(r||c||u||m)&&(n.style.display="inline-block"),o.forEach((e=>{e.style="",e.classList.remove("edd-hidden","alternate"),r&&r!==e.getAttribute("data-status")&&i(e),c&&c!==e.getAttribute("data-recipient")&&i(e),u&&u!==e.getAttribute("data-sender")&&i(e),m&&m!==e.getAttribute("data-context")&&i(e)}));let y=document.querySelectorAll('[data-type="item"]:not(.edd-hidden)');y.forEach(((e,t)=>{t%2==0&&e.classList.add("alternate")})),0===y.length?l.style="table-row":l.style.display="none"}function i(e){e.style.display="none",e.classList.add("edd-hidden")}e&&e.addEventListener("change",s),t&&t.addEventListener("change",s),a&&a.addEventListener("change",s),d&&d.addEventListener("change",s),n&&n.addEventListener("click",(n=>{n.preventDefault(),e&&(e.value=""),t&&(t.value=""),a&&(a.value=""),d&&(d.value=""),s()}))},4304:()=>{const e=document.getElementById("edd-emails__add"),t=document.querySelector(".edd-emails__add-new__overlay");e&&(e.addEventListener("click",(e=>{e.preventDefault(),"none"===t.style.display?t.removeAttribute("style"):t.style.display="none"})),document.addEventListener("click",(a=>{e!==a.target&&"none"!==t.style.display&&"none"!==t.style.display&&setTimeout((function(){a.target.closest(".edd-emails__add-new")||a.target.closest(".edd-emails__add-new__overlay")||(t.style.display="none")}),100)})));const a=document.querySelectorAll("button.edd-emails__add-new");a&&a.forEach((e=>{e.addEventListener("click",(a=>{a.preventDefault(),e.classList.contains("edd-promo-notice__trigger")?setTimeout((function(){t.style.display="none"}),5e3):window.location.href=EDDAdminEmails.link+"&email="+e.getAttribute("data-value")}))}))},7341:(e,t,a)=>{var d=a(1669);!function(e,t){"use strict";t(".edd-email-manager__action").on("click",(function(e){e.preventDefault();const a=t(this),d=a.attr("data-action");let n="",l="",s="",i="";if(a.attr("disabled"))return;switch(d){case"enable":l="edd-button-toggle--active",s="disable",i="inactive";break;case"disable":n="edd-button-toggle--active",s="enable",i="active";break;default:return}a.attr("disabled",!0).addClass("edd-updating");const o={action:"edd_update_email_status",nonce:EDDAdminEmails.nonce,email_id:a.attr("data-id"),status:a.attr("data-status"),button:d};t.post(EDDAdminEmails.ajaxurl,o).done((function(e){EDDAdminEmails.debug&&console.log(e),a.attr("disabled",!1).removeClass("edd-updating"),e.success&&(a.removeClass(n).addClass(l),a.attr("data-action",s),a.attr("data-status",i))}))}))}(document,d)}},t={};function a(d){var n=t[d];if(void 0!==n)return n.exports;var l=t[d]={exports:{}};return e[d](l,l.exports,a),l.exports}a.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t},a.d=(e,t)=>{for(var d in t)a.o(t,d)&&!a.o(e,d)&&Object.defineProperty(e,d,{enumerable:!0,get:t[d]})},a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";a(3274),a(4304),a(7341)})()})();