Ë
    †j:-  ã                   ó<  — d Z ddlZddlmZ ddlmZmZ ddlm	Z	 ddl
mZ ddlmZ ddlmZ dd	lmZ dd
lmZ ddlmZmZmZmZ ddlmZ ddlmZmZ erddlmZ  G d„ de«      Z G d„ de«      Z  G d„ de«      Z! G d„ de«      Z" G d„ de«      Z# G d„ de«      Z$y)zCThis module contains objects that represent paid media in Telegram.é    N)ÚSequence)ÚTYPE_CHECKINGÚFinal)Ú	constants)Ú	PhotoSize)ÚVideo)ÚTelegramObject)ÚUser)Úenum)Úde_json_optionalÚde_list_optionalÚparse_sequence_argÚto_timedelta)Úget_timedelta_value)ÚJSONDictÚ
TimePeriod)ÚBotc                   ó   ‡ — e Zd ZU dZdZej                  j                  Zee	   e
d<   	 ej                  j                  Zee	   e
d<   	 ej                  j                  Zee	   e
d<   	 ddœde	d	edz  d
dfˆ fd„Zeddeddd
d fˆ fd„«       Zˆ xZS )Ú	PaidMediaaø  Describes the paid media added to a message. Currently, it can be one of:

    * :class:`telegram.PaidMediaPreview`
    * :class:`telegram.PaidMediaPhoto`
    * :class:`telegram.PaidMediaVideo`

    Objects of this class are comparable in terms of equality. Two objects of this class are
    considered equal, if their :attr:`type` is equal.

    .. versionadded:: 21.4

    Args:
        type (:obj:`str`): Type of the paid media.

    Attributes:
        type (:obj:`str`): Type of the paid media.
    )ÚtypeÚPREVIEWÚPHOTOÚVIDEON©Ú
api_kwargsr   r   Úreturnc                ó¾   •— t         ‰| �  |¬«       t        j                  t        j
                  ||«      | _        | j                  f| _        | j                  «        y ©Nr   )	ÚsuperÚ__init__r   Ú
get_memberr   ÚPaidMediaTyper   Ú	_id_attrsÚ_freeze)Úselfr   r   Ú	__class__s      €úR/var/www/html/datingFans/myenv/lib/python3.12/site-packages/telegram/_paidmedia.pyr    zPaidMedia.__init__H   sE   ø€ ô 	‰Ñ JÐÔ/ÜŸ™¬×)@Ñ)@À$ÈÓMˆŒ	àŸ)™)˜ˆŒØ�‰�ó    ÚdataÚbotú
Bot | Nonec                 ó�  •— | j                  |«      }| j                  t        | j                  t        | j
                  t        i}| t        u r8|j                  d«      |v r%||j                  d«         j                  ||¬«      S d|v r.|j                  d«      x}rt        j                  |¬«      nd|d<   t        ‰| �)  ||¬«      S )aX  Converts JSON data to the appropriate :class:`PaidMedia` object, i.e. takes
        care of selecting the correct subclass.

        Args:
            data (dict[:obj:`str`, ...]): The JSON data.
            bot (:class:`telegram.Bot`, optional): The bot associated with this object.

        Returns:
            The Telegram object.

        r   ©r)   r*   Úduration)ÚsecondsN)Ú_parse_datar   ÚPaidMediaPreviewr   ÚPaidMediaPhotor   ÚPaidMediaVideor   ÚgetÚpopÚde_jsonÚdtmÚ	timedeltar   )Úclsr)   r*   Ú_class_mappingÚsr&   s        €r'   r6   zPaidMedia.de_jsonT   sº   ø€ ð �‰˜tÓ$ˆð �K‰KÔ)Ø�I‰I”~Ø�I‰I”~ð6
ˆð ”)Ñ §¡¨Ó 0°NÑ BØ! $§(¡(¨6Ó"2Ñ3×;Ñ;ÀÈ3Ð;ÓOÐOà˜ÑØAEÇÁÈ*ÓAUÐ<U¸AÐ<UœsŸ}™}°QÕ7Ð\`ˆD�Ñä‰w‰ D¨cˆÓ2Ð2r(   ©N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú	__slots__r   r"   r   r   ÚstrÚ__annotations__r   r   r   r    Úclassmethodr6   Ú__classcell__©r&   s   @r'   r   r   ,   s¹   ø… ñð$ €Ià#×1Ñ1×9Ñ9€GˆU�3‰ZÓ9Ø;Ø!×/Ñ/×5Ñ5€Eˆ5�‰:Ó5Ø9Ø!×/Ñ/×5Ñ5€Eˆ5�‰:Ó5Ø9ð '+ò	
àð
ð ˜t‘Oð	
ð
 
õ
ð ñ3˜8ð 3¨,ð 3À+ô 3ó ô3r(   r   c                   ó˜   ‡ — e Zd ZdZdZ	 	 	 dddœdedz  dedz  dedz  dedz  d	df
ˆ fd
„Ze	d	ee
j                  z  dz  fd„«       Zˆ xZS )r1   a·  The paid media isn't available before the payment.

    Objects of this class are comparable in terms of equality. Two objects of this class are
    considered equal, if their :attr:`width`, :attr:`height`, and :attr:`duration`
    are equal.

    .. versionadded:: 21.4

    .. versionchanged:: v22.2
       As part of the migration to representing time periods using ``datetime.timedelta``,
       equality comparison now considers integer durations and equivalent timedeltas as equal.

    Args:
        type (:obj:`str`): Type of the paid media, always :tg-const:`telegram.PaidMedia.PREVIEW`.
        width (:obj:`int`, optional): Media width as defined by the sender.
        height (:obj:`int`, optional): Media height as defined by the sender.
        duration (:obj:`int` | :class:`datetime.timedelta`, optional): Duration of the media in
            seconds as defined by the sender.

            .. versionchanged:: v22.2
                |time-period-input|

    Attributes:
        type (:obj:`str`): Type of the paid media, always :tg-const:`telegram.PaidMedia.PREVIEW`.
        width (:obj:`int`): Optional. Media width as defined by the sender.
        height (:obj:`int`): Optional. Media height as defined by the sender.
        duration (:obj:`int` | :class:`datetime.timedelta`): Optional. Duration of the media in
            seconds as defined by the sender.

            .. deprecated:: v22.2
                |time-period-int-deprecated|
    )Ú	_durationÚheightÚwidthNr   rJ   rI   r.   r   r   c                ó0  •— t         ‰| �  t        j                  |¬«       | j	                  «       5  || _        || _        t        |«      | _        | j                  | j
                  | j                  | j                  f| _
        d d d «       y # 1 sw Y   y xY w©N)r   r   )r   r    r   r   Ú	_unfrozenrJ   rI   r   rH   r   r#   )r%   rJ   rI   r.   r   r&   s        €r'   r    zPaidMediaPreview.__init__–   sz   ø€ ô 	‰Ñœi×/Ñ/¸JÐÔGà�^‰^Óñ 	RØ%*ˆDŒJØ&,ˆDŒKÜ3?ÀÓ3IˆDŒNà"Ÿi™i¨¯©°T·[±[À$Ç.Á.ÐQˆDŒN÷	R÷ 	Rñ 	Rús   ±ABÂBc                 ó0   — t        | j                  d¬«      S )Nr.   )Ú	attribute)r   rH   )r%   s    r'   r.   zPaidMediaPreview.duration§   s   € ä" 4§>¡>¸ZÔHÐHr(   )NNN)r=   r>   r?   r@   rA   Úintr   r   r    Úpropertyr7   r8   r.   rE   rF   s   @r'   r1   r1   r   sž   ø„ ñðB 1€Ið !Ø!Ø&*ð	Rð '+òRà�T‰zðRð �d‘
ðRð ˜tÑ#ð	Rð ˜t‘OðRð 
õRð" ðI˜# §¡Ñ-°Ñ4ò Ió ôIr(   r1   c                   ój   ‡ — e Zd ZdZdZddœded   dedz  ddfˆ fd	„Zedd
edddd fˆ fd„«       Z	ˆ xZ
S )r2   a3  
    The paid media is a photo.

    Objects of this class are comparable in terms of equality. Two objects of this class are
    considered equal, if their :attr:`photo` are equal.

    .. versionadded:: 21.4

    Args:
        type (:obj:`str`): Type of the paid media, always :tg-const:`telegram.PaidMedia.PHOTO`.
        photo (Sequence[:class:`telegram.PhotoSize`]): The photo.

    Attributes:
        type (:obj:`str`): Type of the paid media, always :tg-const:`telegram.PaidMedia.PHOTO`.
        photo (tuple[:class:`telegram.PhotoSize`]): The photo.
    )ÚphotoNr   rS   r   r   r   c                óè   •— t         ‰| �  t        j                  |¬«       | j	                  «       5  t        |«      | _        | j                  | j                  f| _        d d d «       y # 1 sw Y   y xY wrL   )	r   r    r   r   rM   r   rS   r   r#   )r%   rS   r   r&   s      €r'   r    zPaidMediaPhoto.__init__À   sZ   ø€ ô 	‰ÑœiŸo™o¸*ÐÔEà�^‰^Óñ 	5Ü0BÀ5Ó0IˆDŒJà"Ÿi™i¨¯©Ð4ˆDŒN÷	5÷ 	5ñ 	5ús   ±.A(Á(A1r)   r*   r+   c                 óŽ   •— | j                  |«      }t        |j                  d«      t        |«      |d<   t        ‰| �  ||¬«      S )NrS   r-   )r0   r   r4   r   r   r6   ©r9   r)   r*   r&   s      €r'   r6   zPaidMediaPhoto.de_jsonÍ   s?   ø€ à�‰˜tÓ$ˆä(¨¯©°'Ó):¼IÀsÓKˆˆW‰Ü‰w‰ D¨cˆÓ2Ð2r(   r<   )r=   r>   r?   r@   rA   r   r   r    rD   r6   rE   rF   s   @r'   r2   r2   ¬   sh   ø„ ñð" €Ið '+ò	5à˜Ñ$ð5ð ˜t‘Oð	5ð
 
õ5ð ñ3˜8ð 3¨,ð 3ÐBRô 3ó ô3r(   r2   c                   ód   ‡ — e Zd ZdZdZddœdededz  ddfˆ fd„Zedd	ed
ddd fˆ fd„«       Z	ˆ xZ
S )r3   a  
    The paid media is a video.

    Objects of this class are comparable in terms of equality. Two objects of this class are
    considered equal, if their :attr:`video` are equal.

    .. versionadded:: 21.4

    Args:
        type (:obj:`str`): Type of the paid media, always :tg-const:`telegram.PaidMedia.VIDEO`.
        video (:class:`telegram.Video`): The video.

    Attributes:
        type (:obj:`str`): Type of the paid media, always :tg-const:`telegram.PaidMedia.VIDEO`.
        video (:class:`telegram.Video`): The video.
    )ÚvideoNr   rX   r   r   c                óÖ   •— t         ‰| �  t        j                  |¬«       | j	                  «       5  || _        | j                  | j
                  f| _        d d d «       y # 1 sw Y   y xY wrL   )r   r    r   r   rM   rX   r   r#   )r%   rX   r   r&   s      €r'   r    zPaidMediaVideo.__init__é   sU   ø€ ô 	‰ÑœiŸo™o¸*ÐÔEà�^‰^Óñ 	5Ø %ˆDŒJà"Ÿi™i¨¯©Ð4ˆDŒN÷	5÷ 	5ñ 	5ús   ±%AÁA(r)   r*   r+   c                 óŽ   •— | j                  |«      }t        |j                  d«      t        |«      |d<   t        ‰| �  ||¬«      S )NrX   r-   )r0   r   r4   r   r   r6   rV   s      €r'   r6   zPaidMediaVideo.de_jsonö   s?   ø€ à�‰˜tÓ$ˆä(¨¯©°'Ó):¼EÀ3ÓGˆˆW‰Ü‰w‰ D¨cˆÓ2Ð2r(   r<   )r=   r>   r?   r@   rA   r   r   r    rD   r6   rE   rF   s   @r'   r3   r3   Õ   sc   ø„ ñð" €Ið '+ò	5àð5ð ˜t‘Oð	5ð
 
õ5ð ñ3˜8ð 3¨,ð 3ÐBRô 3ó ô3r(   r3   c            	       ón   ‡ — e Zd ZdZdZddœdedee   dedz  ddfˆ fd	„Z	e
dd
edddd fˆ fd„«       Zˆ xZS )ÚPaidMediaInfoaÉ  
    Describes the paid media added to a message.

    Objects of this class are comparable in terms of equality. Two objects of this class are
    considered equal, if their :attr:`star_count` and :attr:`paid_media` are equal.

    .. versionadded:: 21.4

    Args:
        star_count (:obj:`int`): The number of Telegram Stars that must be paid to buy access to
            the media.
        paid_media (Sequence[:class:`telegram.PaidMedia`]): Information about the paid media.

    Attributes:
        star_count (:obj:`int`): The number of Telegram Stars that must be paid to buy access to
            the media.
        paid_media (tuple[:class:`telegram.PaidMedia`]): Information about the paid media.
    )Ú
paid_mediaÚ
star_countNr   r^   r]   r   r   c                ó®   •— t         ‰| �  |¬«       || _        t        |«      | _        | j                  | j                  f| _        | j                  «        y r   )r   r    r^   r   r]   r#   r$   )r%   r^   r]   r   r&   s       €r'   r    zPaidMediaInfo.__init__  sE   ø€ ô 	‰Ñ JÐÔ/Ø)ˆŒÜ1CÀJÓ1OˆŒàŸ/™/¨4¯?©?Ð;ˆŒØ�‰�r(   r)   r*   r+   c                 óŽ   •— | j                  |«      }t        |j                  d«      t        |«      |d<   t        ‰| �  ||¬«      S )Nr]   r-   )r0   r   r4   r   r   r6   rV   s      €r'   r6   zPaidMediaInfo.de_json"  sA   ø€ à�‰˜tÓ$ˆä-¨d¯h©h°|Ó.DÄiÐQTÓUˆˆ\ÑÜ‰w‰ D¨cˆÓ2Ð2r(   r<   )r=   r>   r?   r@   rA   rP   r   r   r   r    rD   r6   rE   rF   s   @r'   r\   r\   þ   sq   ø„ ñð& -€Ið '+òàðð ˜YÑ'ðð
 ˜t‘Oðð 
õð ñ3˜8ð 3¨,ð 3À/ô 3ó ô3r(   r\   c            	       óh   ‡ — e Zd ZdZdZddœdddededz  d	dfˆ fd
„Zeddeddd	d fˆ fd„«       Z	ˆ xZ
S )ÚPaidMediaPurchasedaÁ  This object contains information about a paid media purchase.

    Objects of this class are comparable in terms of equality. Two objects of this class are
    considered equal, if their :attr:`from_user` and :attr:`paid_media_payload` are equal.

    Note:
        In Python :keyword:`from` is a reserved word. Use :paramref:`from_user` instead.

    .. versionadded:: 21.6

    Args:
        from_user (:class:`telegram.User`): User who purchased the media.
        paid_media_payload (:obj:`str`): Bot-specified paid media payload.

    Attributes:
        from_user (:class:`telegram.User`): User who purchased the media.
        paid_media_payload (:obj:`str`): Bot-specified paid media payload.
    )Ú	from_userÚpaid_media_payloadNr   rc   r
   rd   r   r   c                óœ   •— t         ‰| �  |¬«       || _        || _        | j                  | j                  f| _        | j                  «        y r   )r   r    rc   rd   r#   r$   )r%   rc   rd   r   r&   s       €r'   r    zPaidMediaPurchased.__init__@  sC   ø€ ô 	‰Ñ JÐÔ/Ø(ˆŒØ'9ˆÔàŸ.™.¨$×*AÑ*AÐBˆŒØ�‰�r(   r)   r*   r+   c                 óš   •— | j                  |«      }t        j                  |j                  d«      |¬«      |d<   t        ‰| �	  ||¬«      S )NÚfromr-   rc   )r0   r
   r6   r5   r   rV   s      €r'   r6   zPaidMediaPurchased.de_jsonN  sB   ø€ à�‰˜tÓ$ˆä ŸL™L¨d¯h©h°vÓ.>ÀCÔHˆˆ[ÑÜ‰w‰ D¨cˆÓ2Ð2r(   r<   )r=   r>   r?   r@   rA   rB   r   r    rD   r6   rE   rF   s   @r'   rb   rb   *  sm   ø„ ñð& 4€Ið '+òàðð  ðð
 ˜t‘Oðð 
õð ñ3˜8ð 3¨,ð 3ÐBVô 3ó ô3r(   rb   )%r@   Údatetimer7   Úcollections.abcr   Útypingr   r   Útelegramr   Útelegram._files.photosizer   Útelegram._files.videor   Útelegram._telegramobjectr	   Útelegram._userr
   Útelegram._utilsr   Útelegram._utils.argumentparsingr   r   r   r   Útelegram._utils.datetimer   Útelegram._utils.typesr   r   r   r   r1   r2   r3   r\   rb   © r(   r'   ú<module>ru      s�   ðñ& Jã Ý $ß 'å Ý /Ý 'Ý 3Ý Ý  ÷ó õ 9ß 6áÝôC3�ô C3ôL7I�yô 7Iôt&3�Yô &3ôR&3�Yô &3ôR)3�Nô )3ôX)3˜õ )3r(   