"""HTML injection constants for UI initialization.""" from pathlib import Path # Get the directory where this file is located _CURRENT_DIR = Path(__file__).resolve().parent # Load PostHog analytics script from file with open(_CURRENT_DIR / "analytics.js", "r") as f: POSTHOG_SCRIPT = f.read() # Ko-fi widget injection # NOTE: Ko-fi's floating-chat button is rendered inside a same-origin about:blank iframe. # On some systems/browsers (especially with dark mode), the iframe's default background # becomes black (due to `color-scheme: light dark`), causing a black rectangle behind the pill. # We fix that by forcing the iframe document background to transparent after it renders. KOFI_WIDGET = """ """