(()=>{"use strict";const e=e=>{const t=e.classList[1].replace("ablocks-block-","");e.classList.remove("ablocks-block-modal-panel-visibility--open"),"true"===e.dataset.autoShowOnce&&localStorage.setItem(`ablocks-modal-${t}`,"true")};document.addEventListener("DOMContentLoaded",()=>{document.querySelectorAll(":not(.block-editor-block-list__block).ablocks-block--modal").forEach(t=>{(t=>{const o=()=>(e=>{e.classList.add("ablocks-block-modal-panel-visibility--open")})(t),a=t.classList.contains("ablocks-trigger-on-hover"),c=t.querySelector(".ablocks-modal-trigger-wrap");if(c&&(a?c.addEventListener("mouseenter",o):c.addEventListener("click",e=>{e.preventDefault(),o()})),"true"===t.getAttribute("data-show-on-mouse-out")){const e="true"===t?.dataset?.autoShowOnce;document.addEventListener("mouseout",a=>{if(!t.classList.contains("ablocks-block-modal-panel-visibility--open")&&a.clientY<0){if(e&&localStorage.getItem(`ablocks-modal-${t.classList[1].replace("ablocks-block-","")}`))return;o()}})}const s=t?.dataset?.autoTriggerTime;if(s){if("true"===t?.dataset?.autoShowOnce&&localStorage.getItem(`ablocks-modal-${t.classList[1].replace("ablocks-block-","")}`))return;setTimeout(o,1e3*parseInt(s))}const l=t.querySelector(".ablocks-modal-popup-close");l&&l.addEventListener("click",()=>e(t));const n=t.querySelector(".ablocks-modal-popup-content-wrap");document.addEventListener("click",o=>{n.contains(o.target)||c.contains(o.target)||e(t)})})(t)})})})();