import { render } from "preact"; import { testControls } from "./app/debug.ts"; import { boot, resumeBrain } from "./app/lifecycle.ts"; import { App } from "./components/App.tsx"; import { initCore } from "./core.ts"; const root = document.getElementById("pet-root"); if (!root) throw new Error("Missing #pet-root mount element"); // The shared rules must load before the save is read or the pet runs. try { await initCore(); } catch (error) { root.textContent = "tokenling could not start in this browser: its rules module did not load."; throw error; } await boot(); render(, root); document.documentElement.classList.add("pet-js"); window.tokenling = testControls(); void resumeBrain();