import { navigate } from '../router.js'; function escapeHtml(text) { return String(text || '') .replaceAll('&', '&') .replaceAll('<', '<') .replaceAll('>', '>') .replaceAll('"', '"') .replaceAll("'", '''); } export function openAuthRequiredModal({ title = 'Нужен вход', text = 'Эта часть доступна после входа в систему.', startRoute = 'start-view', } = {}) { const root = document.getElementById('modal-root'); if (!(root instanceof HTMLElement)) { window.alert(`${title}\n\n${text}`); return; } root.innerHTML = `