# -*- coding: utf-8 -*-

# -----------------------------------------------------------------------------
# Copyright (c) 2016-2017 Anaconda, Inc.
#
# May be copied and distributed freely only as part of an Anaconda or
# Miniconda installation.
# -----------------------------------------------------------------------------
"""Utils for login dialogs."""

# from collections import namedtuple
import typing
from qtpy.QtCore import QRegExp

EMAIL_RE = QRegExp(r'^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$')
USER_RE = QRegExp(r'^[A-Za-z0-9_\.][A-Za-z0-9_\.\-]+$')
FORGOT_LOGIN_URL = 'account/forgot_username'
FORGOT_PASSWORD_URL = 'account/forgot_password'


class TextContainer(typing.NamedTuple):

    title: typing.Optional[str] = None
    header_frame_logo_path: typing.Optional[str] = None
    info_frame_text: typing.Optional[str] = None
    info_frame_logo_path: typing.Optional[str] = None
    form_forgot_links_msg: typing.Optional[str] = None
    form_primary_text: typing.Optional[str] = None
    form_secondary_text: typing.Optional[str] = None
    form_input_label_text: typing.Optional[str] = None
    form_submit_button_text: typing.Optional[str] = None
    message_box_error_text: typing.Optional[str] = None
