tMindmap
                .topic
                .replace(/[^a-z0-9]/gi, '_')
                .toLowerCase()}-mindmap.svg`;
            a.click();

            URL.revokeObjectURL(url);
        }
    }

    function clearHistory() {
        const history = JSON.parse(localStorage.getItem('mindmap-history') || '[]');
        if (history.length === 0) 
            return;
        
        const clearPopup = document.createElement('div');
        clearPopup.className = 'delete-popup';
        clearPopup.innerHT