/** * Helpers for rendering AI-generated HTML inside a sandboxed ``: * - {@link injectKaTeX} ensures the page can render `$...$` / `$$...$$` * even if the model didn't include KaTeX itself. * - {@link injectColorScheme} themes the widget canvas to match the app's * resolved palette, so an HTML widget is never an opaque light panel * inside a dark card (#2600). * - {@link sanitizeIframeHtml} strips navigation escapes while leaving * interactive scripts isolated by the caller's sandboxed iframe. * * These were originally written for the (now-deprecated) Guided Learning * page; the visualize capability now reuses them for `render_mode=html`. */ const KATEX_RESOURCES = [ '', '