o
    Zzj­  ã                   @   s
  d Z ddl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 ddlmZmZ er<ddlmZ dd	lmZmZ ed
ƒZdee dB deedf fdd„Ze	d,dd„ƒZe	deeB ejB dejfdd„ƒZdeeB ejB dB dejdB fdd„ZdedB dee dee fdd„Zededd�Zedddd�Zer§eG dd„ deƒƒZ dedB de!e d d!dedB fd"d#„Z"dedB de!e d d!d$e#d% dedB f
d&d'„Z$de#e dB de!e d d!deedf fd(d)„Z%de#e dB de!e d d!d$e#d% deedf f
d*d+„Z&dS )-a:  This module contains helper functions related to parsing arguments for classes and methods.

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.
é    N)ÚSequence)ÚTYPE_CHECKINGÚProtocolÚTypeVarÚoverload)ÚLinkPreviewOptions)ÚTelegramObject)ÚJSONDictÚODVInput)Útype_check_only)ÚBotÚFileCredentialsÚTÚargÚreturn.c                 C   s   | rt | ƒS dS )zÇParses an optional sequence into a tuple

    Args:
        arg (:obj:`Sequence`): The sequence to parse.

    Returns:
        :obj:`Tuple`: The sequence converted to a tuple or an empty tuple.
    © )Útuple©r   r   r   úZ/var/www/kodo/tsheker/venv/lib/python3.10/site-packages/telegram/_utils/argumentparsing.pyÚparse_sequence_arg+   s   	r   c                 C   ó   d S ©Nr   r   r   r   r   Úto_timedelta7   s   r   c                 C   r   r   r   r   r   r   r   r   ;   s   c                 C   s*   | du rdS t | ttB ƒrtj| d�S | S )a  Parses an optional time period in seconds into a timedelta

    Args:
        arg (:obj:`int` | :class:`datetime.timedelta`, optional): The time period to parse.

    Returns:
        :obj:`timedelta`: The time period converted to a timedelta object or :obj:`None`.
    N)Úseconds)Ú
isinstanceÚintÚfloatÚdtmÚ	timedeltar   r   r   r   r   C   s
   	Údisable_web_page_previewÚlink_preview_optionsc                 C   s&   | r|rt dƒ‚| durt| d�}|S )zŠWrapper around warn_about_deprecated_arg_return_new_arg. Takes care of converting
    disable_web_page_preview to LinkPreviewOptions.
    zXParameters `disable_web_page_preview` and `link_preview_options` are mutually exclusive.N)Úis_disabled)Ú
ValueErrorr   )r   r    r   r   r   Úparse_lpo_and_dwppS   s   ÿ
r#   ÚTele_coT)ÚboundÚ	covariantÚTeleCrypto_coÚHasDecryptMethodc                   @   sp   e Zd ZdZedee deddded def
d	d
„ƒZ	edee dee ddded de
edf f
dd„ƒZdS )r(   r   ÚclsÚdataÚbotú
Bot | NoneÚcredentialsr   r   c                 C   r   r   r   ©r)   r*   r+   r-   r   r   r   Úde_json_decryptedn   ó   z"HasDecryptMethod.de_json_decrypted.c                 C   r   r   r   r.   r   r   r   Úde_list_decryptedv   r0   z"HasDecryptMethod.de_list_decryptedN)Ú__name__Ú
__module__Ú__qualname__Ú	__slots__ÚclassmethodÚtyper'   r	   Úlistr/   r   r1   r   r   r   r   r(   j   s4    ÿþýüûÿþýü
ûr*   r)   r+   r,   c                 C   s   | du rdS |  | |¡S )z<Wrapper around TO.de_json that returns None if data is None.N)Úde_json©r*   r)   r+   r   r   r   Úde_json_optional   ó   r;   r-   r   c                 C   s   | du rdS |  | ||¡S )zFWrapper around TO.de_json_decrypted that returns None if data is None.N)r/   ©r*   r)   r+   r-   r   r   r   Úde_json_decrypted_optional‰   ó   r>   c                 C   s   | du rdS |  | |¡S )zEWrapper around TO.de_list that returns an empty list if data is None.Nr   )Úde_listr:   r   r   r   Úde_list_optional–   r<   rA   c                 C   s   | du rdS |  | ||¡S )zOWrapper around TO.de_list_decrypted that returns an empty list if data is None.Nr   )r1   r=   r   r   r   Úde_list_decrypted_optional    r?   rB   )r   Nr   N)'Ú__doc__Údatetimer   Úcollections.abcr   Útypingr   r   r   r   Útelegram._linkpreviewoptionsr   Útelegram._telegramobjectr   Útelegram._utils.typesr	   r
   r   Útelegramr   r   r   r   r   r   r   r   r   Úboolr#   r$   r'   r(   r7   r;   r8   r>   rA   rB   r   r   r   r   Ú<module>   s’   "þü&ÿÿ
þÿÿÿ
þ
ÿþýü
û
ÿÿÿ

þ

ÿþýü
û