U
    ={f                      @   s   d dl mZmZmZ d dlZddlmZmZ ddlm	Z	m
Z
mZmZmZ ddlmZ erjd dlZejjZneZddddddddddd
eeef ee eee ee ee ee ee ee ee ee ed	d
dZdS )    )OptionalUnionTYPE_CHECKINGN   )EmailSyntaxErrorValidatedEmail)split_emailvalidate_email_local_partvalidate_email_domain_namevalidate_email_domain_literalvalidate_email_length)CASE_INSENSITIVE_MAILBOX_NAMESF)
allow_smtputf8allow_empty_localallow_quoted_localallow_domain_literalallow_display_namecheck_deliverabilitytest_environmentglobally_deliverabletimeoutdns_resolver)emailr   r   r   r   r   r   r   r   r   r   returnc      
   !   
   C   s^  ddl m}m}m}m}m}m}m}m} |dkr4|}|dkr@|}|dkrL|}|dkrX|}|dkrd|}|dkrp|}|dkr||}|	dkr|
dkr|}	t	| t
sz| d} W n, tk
r } ztd|W 5 d}~X Y nX t| \}}}}t }|s|n
d| d d | |_||_t||||d}|d	 |_|d
 |_|d |_td|j}||jkrzt||||d W n6 tk
r } ztdt
| |W 5 d}~X Y nX ||_|r|std|jdk	r|j tkr|jdk	r|j |_|j |_d}t|dkrtdn||drt|drtt|dd }|sPtd|d |_|d |_|d |_ d}n"t!|||d}|d |_|d |_|jd |j |_"|js|jst#d|jpdd |j |_$nd|_$t%| |dk	r |s td|rZ|sZ|r|S ddl&m'} ||j|j|	|
}|(d} | dk	rN| |_)|(d |_*|S )!z
    Given an email address, and some options, returns a ValidatedEmail instance
    with information about the address if it is valid or, if the address is not
    valid, raises an EmailNotValidError. This is the main function of the module.
    r   )ALLOW_SMTPUTF8ALLOW_QUOTED_LOCALALLOW_DOMAIN_LITERALALLOW_DISPLAY_NAMEGLOBALLY_DELIVERABLECHECK_DELIVERABILITYTEST_ENVIRONMENTDEFAULT_TIMEOUTNasciiz%The email address is not valid ASCII."@)r   r   Zquoted_local_part
local_partascii_local_partsmtputf8NFCzAfter Unicode normalization: z7Quoting the part before the @-sign is not allowed here.Fr   z)There must be something after the @-sign.[]z<A bracketed IP address after the @-sign is not allowed here.domaindomain_addressT)r   r   ascii_domainzMissing ASCII domain. zRA display name and angle brackets around the email address are not permitted here.)validate_email_deliverabilitymxmx_fallback_type)+r/   r   r   r   r   r   r   r    r!   
isinstancestrdecode
ValueErrorr   r   r   originaldisplay_namer	   r%   r&   r'   unicodedata	normalizelowerr   len
startswithendswithr   r,   r.   r-   r
   
normalized	ExceptionZascii_emailr   Zdeliverabilityr0   getr1   r2   )!r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r    r!   er8   r%   Zdomain_partZis_quoted_local_partretZlocal_part_infoZnormalized_local_partZis_domain_literalZdomain_literal_infoZdomain_name_infor0   Zdeliverability_infor1    rD   ]/var/www/html/Darija-Ai-API/env/lib/python3.8/site-packages/email_validator/validate_email.pyvalidate_email   s    (






$





   

rF   )typingr   r   r   r9   Zexceptions_typesr   r   syntaxr   r	   r
   r   r   Zrfc_constantsr   Zdns.resolverZdnsresolverResolverZ	_Resolverobjectr4   bytesboolintrF   rD   rD   rD   rE   <module>   s@   

