/* eslint-disable */ /** * Gradio app bootstrap. * * The Python side injects window.HY_EXAMPLES / window.HY_I18N before this * script runs. The custom chat renderer (static/chat.js) owns all DOM * mutations under #hy-chat — this file only deals with the surrounding * UX (overlay, scroll, send-button state, copy/preview buttons). * * Responsibilities * ──────────────── * 1. Render the empty-state "What can I help you with?" overlay above the * chat surface, with example prompts that auto-send when clicked. * 2. Add a "▶ html preview" button below every Markdown HTML code block, * and render the code in a sandboxed iframe modal. * 3. Add a "Copy" button to the top-right of every
 code block.
 *   4. Own scroll behaviour: follow-the-tail while streaming, full user
 *      control after streaming ends.
 *   5. OWN the Send-button busy state. The server NEVER toggles the
 *      button. Instead, the streaming generators in chat.py drive a
 *      dedicated hidden ``gr.HTML`` component (``#hy-busy-marker``):
 *      while streaming → it contains a single
 *      ````; on the final yield → it's
 *      idle. We observe that one component and disable Send iff the
 *      marker span is present.
 *
 *      The marker lives in its OWN component (not inside the chat) so
 *      unclosed ``