"""Parse `surface` field for launcher-style HTTP send routes (UX hint only)."""


def parse_send_surface(value) -> tuple[bool, bool]:
    """Return (quick_panel, dashboard_surface).

    At most one is True. Invalid values map to (False, False).
    ``dashboard`` wins over ``quick`` when both appear — clients must send only one token.
    """
    if not isinstance(value, str):
        return False, False
    s = value.strip().lower()
    if not s:
        return False, False
    if s == "dashboard":
        return False, True
    if s == "quick":
        return True, False
    return False, False
