""" Animation diagnostic for the shell iframe. Embeds a self-reporting probe inside the iframe srcdoc that: 1. Confirms the iframe document actually rendered (suspect #3) 2. Counts / elements present in the DOM (suspect #2: did Gradio strip them before they reached the iframe?) 3. Uses the SVG SMIL API (svg.getCurrentTime / elem.getStartTime) to check whether the animations are actually RUNNING, not just present (suspect #4) 4. Paints a visible badge in the corner with the verdict, so you SEE the answer on the live Space without opening devtools. This makes the failure point unambiguous: - Badge never appears -> iframe didn't render (suspect #3) OR Gradio didn't even pass the iframe through - Badge: "0 anim elements" -> SMIL stripped before/at the iframe (suspect #2) - Badge: "N present, FROZEN" -> SMIL present but not playing (suspect #4: sandbox) - Badge: "N present, RUNNING" -> animation IS working; the issue is it is too fast/subtle to see, or you looked after it froze """ PROBE_JS = """ """ def inject_probe(iframe_inner_html: str) -> str: """Insert the probe