"""One-off: extract instance_page.css / instance_page_boot.js from gate index.html."""
from __future__ import annotations
import re
from pathlib import Path
ROOT = Path(__file__).resolve().parent.parent
src = ROOT / "crypto_monitor_gate" / "templates" / "index.html"
text = src.read_text(encoding="utf-8")
m = re.search(r"", text, re.S)
if m:
(ROOT / "static" / "instance_page.css").write_text(m.group(1).strip() + "\n", encoding="utf-8")
marker = ''
if marker in text:
part = text.split(marker, 1)[1]
m2 = re.search(r"\s*