from base64 import urlsafe_b64encode


def encode_payload(payload: str) -> str:
    """ Encode payload with URL-safe base64url. """
    result: bytes = urlsafe_b64encode(payload.encode())
    return result.decode()