/** * Continuità con il vecchio sito (brief §5.3): i link del tipo /servizi#contenzioso-tributario-3 * atterrano già sulla card giusta (stesso `id`); con JavaScript il visitatore viene portato * direttamente alla pagina di dettaglio del servizio. */ function redirectLegacyAnchor(): void { const hash = window.location.hash.slice(1); if (!hash) return; let id: string; try { id = decodeURIComponent(hash); } catch { return; } const target = document.getElementById(id); const href = target?.dataset.legacyHref; if (href && href.startsWith('/servizi/')) window.location.replace(href); } redirectLegacyAnchor(); window.addEventListener('hashchange', redirectLegacyAnchor); export {};