+
    ÁFñj(  ã                   ój   € R t ^ RIt^ RIHt ^ RIHt ^ RIHtHt ^ RI	H
t
 ^ RIHt Rt ! R R	4      tR# )
zDThis module contains an object that represents a Telegram InputFile.N)ÚIO)Úuuid4)Úguess_file_nameÚ	load_file)ÚTextEncoding©Ú
FieldTuplezapplication/octet-streamc                   óv   a € ] tR t^ t o RtR	tR
V 3R lR llt]V 3R lR l4       t]V 3R lR l4       t	R	t
V tR# )Ú	InputFileaØ
  This object represents a Telegram InputFile.

.. versionchanged:: 20.0

    * The former attribute ``attach`` was renamed to :attr:`attach_name`.
    * Method ``is_image`` was removed. If you pass :obj:`bytes` to :paramref:`obj` and would
      like to have the mime type automatically guessed, please pass :paramref:`filename`
      in addition.

Args:
    obj (:term:`file object` | :obj:`bytes` | :obj:`str`): An open file descriptor or the files
        content as bytes or string.

        Note:
            If :paramref:`obj` is a string, it will be encoded as bytes via
            :external:obj:`obj.encode('utf-8') <str.encode>`.

        .. versionchanged:: 20.0
            Accept string input.
    filename (:obj:`str`, optional): Filename for this InputFile.
    attach (:obj:`bool`, optional): Pass :obj:`True` if the parameter this file belongs to in
        the request to Telegram should point to the multipart data via an ``attach://`` URI.
        Defaults to `False`.
    read_file_handle (:obj:`bool`, optional): If :obj:`True` and :paramref:`obj` is a file
        handle, the data will be read from the file handle on initialization of this object.
        If :obj:`False`, the file handle will be passed on to the
        :attr:`networking backend <telegram.request.BaseRequest.do_request>` which will have
        to handle the reading. Defaults to :obj:`True`.

        Tip:
            If you upload extremely large files, you may want to set this to :obj:`False` to
            avoid reading the complete file into memory. Additionally, this may be supported
            better by the networking backend (in particular it is handled better by
            the default :class:`~telegram.request.HTTPXRequest`).

        Important:
            If you set this to :obj:`False`, you have to ensure that the file handle is still
            open when the request is made. In particular, the following snippet can *not* work
            as expected.

            .. code-block:: python

                with open('file.txt', 'rb') as file:
                    input_file = InputFile(file, read_file_handle=False)

                # here the file handle is already closed and the upload will fail
                await bot.send_document(chat_id, input_file)

        .. versionadded:: 21.5


Attributes:
    input_file_content (:obj:`bytes` | :class:`IO`): The binary content of the file to send.
    attach_name (:obj:`str`): Optional. If present, the parameter this file belongs to in
        the request to Telegram should point to the multipart data via a an URI of the form
        ``attach://<attach_name>`` URI.
    filename (:obj:`str`): Filename for the file to be sent.
    mimetype (:obj:`str`): The mimetype inferred from the file to be sent.

Nc                óp   <€ V ^8„  d   QhRS[ S[,          S[,          S[,          RS[R,          RS[RS[/# )é   ÚobjÚfilenameNÚattachÚread_file_handle)r   ÚbytesÚstrÚbool)ÚformatÚ__classdict__s   "€ÚO/opt/hermes-site/venv/lib/python3.14/site-packages/telegram/_files/inputfile.pyÚ__annotate__ÚInputFile.__annotate__`   sK   ø€ ÷ Iñ Iá‘�Y™Õ¡Õ$ðIñ ˜•*ðIñ ð	Iñ
 ñIó    c                óp  € \        V\        4      '       d   Wn        M}\        V\        4      '       d&   VP	                  \
        P                  4      V n        MBV'       d    \        V4      w  qPn        T;'       g    TpMWn        T;'       g    \        V4      pV'       d   R \        4       P                  ,           MRV n        V'       d4   \        P                  ! VRR7      ^ ,          ;'       g    \        V n        M\        V n        T;'       g    V P                  P!                  RR4      V n        R# )ÚattachedNF)ÚstrictÚ/Ú.)Ú
isinstancer   Úinput_file_contentr   Úencoder   ÚUTF_8r   r   r   ÚhexÚattach_nameÚ	mimetypesÚ
guess_typeÚ_DEFAULT_MIME_TYPEÚmimetypeÚreplacer   )Úselfr   r   r   r   Úreported_filenames   &&&&& r   Ú__init__ÚInputFile.__init__`   sÜ   € ô �cœ5×!Ò!Ø9<Õ#Ü˜œS×!Ò!Ø&)§j¡j´×1CÑ1CÓ&DˆDÕ#ßÜ9BÀ3»Ñ6ÐÔ6Ø×4Ð4Ð#4‰Hà&)Ô#Ø×7Ð7¤?°3Ó#7ˆHçCI z´E³G·K±KÖ'?ÈtˆÔçä×$Ò$ X°eÔ<¸QÕ?×UÐUÔCUð �Mô /ˆDŒMà%×HÐH¨¯©×)>Ñ)>¸sÀCÓ)HˆŽr   c                ó    <€ V ^8„  d   QhRS[ /# )r   Úreturnr   )r   r   s   "€r   r   r   ~   s   ø€ ÷ 	Eñ 	E™Zñ 	Er   c                óH   € V P                   V P                  V P                  3# )zßField tuple representing the contents of the file for upload to the Telegram servers.

.. versionchanged:: 21.5
    Content may now be a file handle.

Returns:
    tuple[:obj:`str`, :obj:`bytes` | :class:`IO`, :obj:`str`]:
)r   r    r(   ©r*   s   &r   Úfield_tupleÚInputFile.field_tuple}   s   € ð �}‰}˜d×5Ñ5°t·}±}ÐDÐDr   c                ó.   <€ V ^8„  d   QhRS[ R,          /# )r   r/   N)r   )r   r   s   "€r   r   r   Š   s   ø€ ÷ Lñ L™C $�Jñ Lr   c                óH   € V P                   '       d   RV P                    2# R# )zuURI to insert into the JSON data for uploading the file. Returns :obj:`None`, if
:attr:`attach_name` is :obj:`None`.
z	attach://N)r$   r1   s   &r   Ú
attach_uriÚInputFile.attach_uri‰   s(   € ð
 26×1A×1AÐ1A�˜4×+Ñ+Ð,Ð-ÐKÀtÐKr   )r$   r   r    r(   )NFT)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__Ú	__slots__r,   Úpropertyr2   r6   Ú__static_attributes__Ú__classdictcell__)r   s   @r   r
   r
       sK   ø‡ € ñ;ðz N€I÷Iò Ið: ÷	Eó ð	Eð ÷Ló öLr   r
   )r<   r%   Útypingr   Úuuidr   Útelegram._utils.filesr   r   Útelegram._utils.stringsr   Útelegram._utils.typesr   r'   r
   © r   r   Ú<module>rG      s1   ðñ& Kã Ý Ý ç <Ý 0Ý ,à/Ð ÷nLó nLr   