§
    øÐßi‡  ã                   óŽ   — d Z ddlmZmZmZ ddlmZ dededefd„Z	 dded	ee         d
eee                  deeef         fd„Z	dS )a.  This module contains auxiliary functionality for parsing MessageEntity objects.

Warning:
    Contents of this module are intended to be used internally by the library and *not* by the
    user. Changes to this module are not considered breaking changes and may not be documented in
    the changelog.
é    )ÚDictÚOptionalÚSequence)ÚMessageEntityÚtextÚentityÚreturnc                 óš   — |                       d¦  «        }||j        dz  |j        |j        z   dz  …         }|                     d¦  «        S )a%  Returns the text from a given :class:`telegram.MessageEntity`.

    Args:
        text (:obj:`str`): The text to extract the entity from.
        entity (:class:`telegram.MessageEntity`): The entity to extract the text from.

    Returns:
        :obj:`str`: The text of the given entity.
    z	utf-16-leé   )ÚencodeÚoffsetÚlengthÚdecode)r   r   Úentity_texts      ú^/var/www/html/crypto-bot/backend/venv/lib/python3.11/site-packages/telegram/_utils/entities.pyÚparse_message_entityr      sN   € ð —+’+˜kÑ*Ô*€KØ˜fœm¨aÑ/°6´=À6Ä=Ñ3PÐTUÑ2UÐUÔV€Kà×Ò˜kÑ*Ô*Ð*ó    NÚentitiesÚtypesc                 ó@   ‡ ‡— ‰€t           j        Šˆ ˆfd„|D ¦   «         S )aS  
    Returns a :obj:`dict` that maps :class:`telegram.MessageEntity` to :obj:`str`.
    It contains entities filtered by their ``type`` attribute as
    the key, and the text that each entity belongs to as the value of the :obj:`dict`.

    Args:
        text (:obj:`str`): The text to extract the entity from.
        entities (List[:class:`telegram.MessageEntity`]): The entities to extract the text from.
        types (List[:obj:`str`], optional): List of ``MessageEntity`` types as strings. If the
            ``type`` attribute of an entity is contained in this list, it will be returned.
            Defaults to :attr:`telegram.MessageEntity.ALL_TYPES`.

    Returns:
        Dict[:class:`telegram.MessageEntity`, :obj:`str`]: A dictionary of entities mapped to
        the text that belongs to them, calculated based on UTF-16 codepoints.
    Nc                 óD   •— i | ]}|j         ‰v ¯|t          ‰|¦  «        “ŒS © )Útyper   )Ú.0r   r   r   s     €€r   ú
<dictcomp>z*parse_message_entities.<locals>.<dictcomp>E   s:   ø€ ð ð ð Ø7=ÈVÌ[Ð\aÐMaÐMaˆÕ$ T¨6Ñ2Ô2ÐMaÐMaÐMar   )r   Ú	ALL_TYPES)r   r   r   s   ` `r   Úparse_message_entitiesr   /   sC   øø€ ð& €}ÝÔ'ˆðð ð ð ð ØAIðñ ô ð r   )N)
Ú__doc__Útypingr   r   r   Útelegram._messageentityr   Ústrr   r   r   r   r   ú<module>r"      sÌ   ðð&ð ð ,Ð +Ð +Ð +Ð +Ð +Ð +Ð +Ð +Ð +à 1Ð 1Ð 1Ð 1Ð 1Ð 1ð+˜sð +¨Mð +¸cð +ð +ð +ð +ð" TXðð Ø
ðØ! -Ô0ðØ9AÀ(È3Ä-Ô9Pðà	ˆ-˜Ð
Ôðð ð ð ð ð r   