~95% on SimpleQA (e.g. Qwen3.6-27B on a 3090). Supports all local and cloud LLMs (llama.cpp, Ollama, Google, ...). 10+ search engines - arXiv, PubMed, your private documents. Everything Local & Encrypted.
Python academiaanthropicarxivbravedeep-researchencryptionhome-automationhomeserverlocallocal-deep-researchlocal-llmmistralollamaopenaipubmedresearchresearch-toolretrieval-augmented-generationsearxngself-hosted
/**
* Main application entry point for Vite
* Imports all vendor dependencies and makes them available globally
*/
// Import CSS first
import '@fortawesome/fontawesome-free/css/all.css';
import 'bootstrap/dist/css/bootstrap.min.css';
import 'bootstrap-icons/font/bootstrap-icons.css';
import 'highlight.js/styles/github-dark.css';
import 'katex/dist/katex.min.css';
import '../css/styles.css';
// Import and setup core libraries
import { marked } from 'marked';
import io from 'socket.io-client';
import hljs from 'highlight.js';
import jsPDF from 'jspdf';
import html2canvas from 'html2canvas';
import DOMPurify from 'dompurify';
import markedKatex from 'marked-katex-extension';
// Import Bootstrap JavaScript
import * as bootstrap from 'bootstrap';
// Chart.js and plugins (imported but not attached to window by default)
import Chart from 'chart.js/auto';
import 'chartjs-adapter-date-fns';
import annotationPlugin from 'chartjs-plugin-annotation';
// Register Chart.js plugin
Chart.register(annotationPlugin);
// Make libraries available globally for existing code compatibility
window.marked = marked;
window.io = io;
window.Chart = Chart;
window.hljs = hljs;
window.jsPDF = jsPDF;
window.html2canvas = html2canvas;
window.bootstrap = bootstrap;
window.Chart = Chart;
window.DOMPurify = DOMPurify;
// Non-async module scripts and defer classic scripts run in document order.
// base.html loads this bundle in <head>, before its deferred
// xss-protection.js, so on those pages the call below finds no XSSProtection
// and does nothing: xss-protection.js sees window.DOMPurify and installs the
// same idempotent hook during its own load. The call covers a page that runs
// xss-protection.js before this bundle, where that load-time install found
// no DOMPurify yet.
window.XSSProtection?.ensureDOMPurifyHooks?.();
// Configure marked
marked.setOptions({
headerIds: false,
mangle: false,
smartypants: false,
highlight(code, lang) {
if (lang && hljs.getLanguage(lang)) {
try {
return hljs.highlight(code, { language: lang }).value;
} catch (err) {
SafeLogger.error('Highlight error:', err);
}
}
return code;
}
});
marked.use(markedKatex({
throwOnError: false,
// Let the project's CSS variable (--error-color) govern error styling.
// KaTeX otherwise sets inline `style="color:#cc0000"` which would override
// any selector-based rule (and fail dark-theme WCAG AA contrast).
errorColor: 'currentColor',
}));
// Initialize highlight.js when DOM is ready
document.addEventListener('DOMContentLoaded', () => {
// Highlight all code blocks
document.querySelectorAll('pre code').forEach((block) => {
hljs.highlightElement(block);
});
// Initialize Bootstrap tooltips and popovers if present
const tooltipTriggerList = document.querySelectorAll('[data-bs-toggle="tooltip"]');
[...tooltipTriggerList].map(tooltipTriggerEl => new bootstrap.Tooltip(tooltipTriggerEl));
const popoverTriggerList = document.querySelectorAll('[data-bs-toggle="popover"]');
[...popoverTriggerList].map(popoverTriggerEl => new bootstrap.Popover(popoverTriggerEl));
});
// Log successful initialization
SafeLogger.log('✨ LDR App initialized with Vite');
// Export for potential module usage
export {
marked,
io,
hljs,
jsPDF,
html2canvas,
bootstrap,
Chart,
DOMPurify
};