/*!
 * KoliBri - The accessible HTML-Standard
 */
const VISIBLE_OVERLAYS = new Set();
let lastOverlay = null;
export function showOverlay(overlay) {
    if (lastOverlay !== overlay) {
        if (lastOverlay) {
            lastOverlay.style.setProperty('z-index', '999');
        }
        VISIBLE_OVERLAYS.delete(overlay);
        VISIBLE_OVERLAYS.add(overlay);
        overlay.style.setProperty('z-index', '1000');
        lastOverlay = overlay;
    }
}
export function hideOverlay(overlay) {
    if (!VISIBLE_OVERLAYS.delete(overlay)) {
        return;
    }
    if (lastOverlay === overlay) {
        lastOverlay = null;
        for (const el of VISIBLE_OVERLAYS) {
            lastOverlay = el;
        }
        if (lastOverlay) {
            lastOverlay.style.setProperty('z-index', '1000');
        }
    }
}
//# sourceMappingURL=overlay.js.map
