// Bootstrap the Dioxus WASM UI (external file so CSP can stay strict). function setStatus(text) { const el = document.getElementById("boot-loader"); if (el) { el.innerHTML = "

" + text + "

"; } } setStatus("Loading nx9-auth UI…"); import init from "/nx9_auth_ui.js"; // Call with no args: wasm-bindgen resolves nx9_auth_ui_bg.wasm next to // nx9_auth_ui.js via import.meta.url (avoids the deprecated string form). init() .then(() => { console.info("[nx9-auth-ui] WASM started"); const el = document.getElementById("main"); if (el) el.dataset.dioxusMounted = "1"; const loader = document.getElementById("boot-loader"); if (loader) loader.remove(); }) .catch((err) => { console.error("[nx9-auth-ui] Bootstrap failed", err); const loader = document.getElementById("boot-loader"); if (loader) { loader.innerHTML = `

UI failed to start

Please refresh the page or check the server logs.

${err && err.stack ? err.stack : String(err)}
`; } });