import { t, th } from '../i18n/index.js'; import { navigate } from '../router.js'; function escapeHtml(text) { return String(text || '') .replaceAll('&', '&') .replaceAll('<', '<') .replaceAll('>', '>') .replaceAll('"', '"') .replaceAll("'", '''); } export function openAuthRequiredModal({ title = t('remaining.auth_required.sign_in_required'), text = t('remaining.auth_required.this_section_is_available_after_you_sign_in'), } = {}) { const root = document.getElementById('modal-root'); if (!(root instanceof HTMLElement)) { window.alert(`${title}\n\n${text}`); return; } root.innerHTML = `