'use client'; /** * Off-screen Slide → PNG renderer. * * Mounts the given `Slide` into an off-screen container at its native pixel * size, waits for fonts + images to settle, then rasterizes the DOM. Returns the * rendered output as a Blob (default) or a `data:image/png;base64,...` string. * * Rasterization is native-paint-first: `html-to-image` serializes the slide into * an SVG `` that the **same Chrome engine painting the live * classroom** rasterizes — so formulas (KaTeX HTML), CSS `filter`, soft-edge * `mask`, and mixed CJK/Latin text come out exactly as the classroom shows them. * html2canvas-pro, by contrast, re-implements layout/paint and so re-rasterizes * KaTeX's vlist/frac-line/delimiter internals, drops CSS filter/mask, and can't * draw `