o
    ªZhå  ã                   @   sD   d dl mZ d dlZedƒdedefdd„ƒZdedefd	d
„ZdS )é    )Ú	lru_cacheNéd   ÚcÚreturnc                 C   sª   t | ƒ}d|  krdk rdS  |dks7d|  krdks7n d|  kr)dks7n d	|  kr5d
kr9dS  ndS t | ¡}|dkrDdS |dv rJdS t | ¡dv rSdS dS )z¯Determine how many columns are needed to display a character in a terminal.

    Returns -1 if the character is not printable.
    Returns 0, 1 or 2 for other characters.
    é    é   é   r   i   i   i(   i.   i`   ic   ÚCcéÿÿÿÿ)ZMeZMn)ÚFÚWé   )ÚordÚunicodedataÚcategoryÚeast_asian_width)r   Úor   © r   úJ/var/www/html/lang_env/lib/python3.10/site-packages/_pytest/_io/wcwidth.pyÚwcwidth   s&   ÿþ
r   Úsc                 C   s8   d}t  d| ¡D ]}t|ƒ}|dk r dS ||7 }q|S )zŽDetermine how many columns are needed to display a string in a terminal.

    Returns -1 if the string contains non-printable characters.
    r   ÚNFCr
   )r   Ú	normalizer   )r   Úwidthr   Úwcr   r   r   Úwcswidth,   s   
r   )Ú	functoolsr   r   ÚstrÚintr   r   r   r   r   r   Ú<module>   s
    &