import re

_FIELDS = ("__VIEWSTATE", "__VIEWSTATEGENERATOR", "__EVENTVALIDATION")


def extract_tokens(html: str) -> dict[str, str]:
    """Extract ASP.NET form tokens from HTML."""
    tokens = {}
    for field in _FIELDS:
        m = re.search(rf"""id=["']{field}["']\s+value=["']([^"']*)["']""", html)
        if m:
            tokens[field] = m.group(1)
    return tokens
