a
    hbòf(  ã                   @   sx   d dl mZmZmZ d dlZddlmZ ee Zeegef Z	ee	egef Z
de d¡jfeee e
edœdd„ZdS )	é    )ÚCallableÚMatchÚOptionalNé   )ÚEMOJIz!(:(\S*?)(?:(?:\-)(emoji|text))?:))ÚtextÚdefault_variantÚ
_emoji_subÚreturnc                    sP   t j‰dddœ}|j‰|r&| |d¡nd‰ tt tdœ‡ ‡‡fdd„}||| ƒS )zReplace emoji code in text.u   ï¸Žu   ï¸�)r   ÚemojiÚ )Úmatchr
   c                    sB   |   ¡ \}}}zˆ| ¡ ƒˆ|ˆ ƒ W S  ty<   | Y S 0 d S )N)ÚgroupsÚlowerÚKeyError)r   Ú
emoji_codeÚ
emoji_nameÚvariant©Údefault_variant_codeÚ	get_emojiÚget_variant© ú\/home/httpd/docs/test/DocsMgr/lib/python3.9/site-packages/pip/_vendor/rich/_emoji_replace.pyÚ
do_replace   s    ÿz"_emoji_replace.<locals>.do_replace)r   Ú__getitem__Úgetr   Ústr)r   r   r	   Úvariantsr   r   r   r   Ú_emoji_replace   s    
	r   )Útypingr   r   r   ÚreÚ_emoji_codesr   r   Ú_ReStringMatchÚ_ReSubCallableÚ_EmojiSubMethodÚcompileÚsubr   r   r   r   r   Ú<module>   s   
ýü