def map_compat_facility_state(facility_state: str) -> str:
    """
        Maps a current v1 version opennem facility_registry.json state
        to a v3 state

    """
    state = facility_state.lower().strip()

    if state == "commissioned":
        return "operating"

    if state == "decommissioned":
        return "retired"

    return state