Ë
    †j]Y  ã                   ó¨  — d Z ddl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mZ ddlmZ dd	lmZ dd
lmZmZ ddlmZ ddlmZmZmZmZmZmZ dZ dZ! e
de¬«      Z"de#e"   de$e#e"      fd„Z%de#e"   de&de"fd„Z'de"de(ee(e#e"   e&f   f   fd„Z) G d„ dejT                  «      Z+ G d„ dejX                  «      Z- G d„ deeeef   «      Z.y)z1This module contains the PicklePersistence class.é    N)ÚCallable)Údeepcopy)ÚPath)ÚAnyÚTypeVarÚcastÚoverload)ÚBotÚTelegramObject)ÚFilePathInput)Úwarn)ÚBasePersistenceÚPersistenceInput)ÚContextTypes)ÚBDÚCDÚUDÚCDCDataÚConversationDictÚConversationKeyz/a known bot replaced by PTB's PicklePersistencez2an unknown bot replaced by PTB's PicklePersistenceÚTelegramObj)ÚboundÚclsÚreturnc           	      ó¢   — | j                  «       }t        |«      j                  |D ��cg c]  }t        |«      D ]  }|‘Œ Œ c}}«      S c c}}w )zsGets all subclasses of the specified object, recursively. from
    https://stackoverflow.com/a/3862957/9706202
    )Ú__subclasses__ÚsetÚunionÚ_all_subclasses)r   Ú
subclassesÚcÚss       ú^/var/www/html/datingFans/myenv/lib/python3.12/site-packages/telegram/ext/_picklepersistence.pyr   r   (   sG   € ð ×#Ñ#Ó%€JÜˆz‹?× Ñ ¨Z×!T¨ÄÐQRÓASÒ!T¸A¢!Ð!T !Ó!TÓUÐUùÓ!Ts   ªA
Úkwargsc                 óJ   — | j                  | «      }|j                  |«       |S )a�  
    This method is used for unpickling. The data, which is in the form a dictionary, is
    converted back into a class. Works mostly the same as :meth:`TelegramObject.__setstate__`.
    This function should be kept in place for backwards compatibility even if the pickling logic
    is changed, since `_custom_reduction` places references to this function into the pickled data.
    )Ú__new__Ú__setstate__)r   r$   Úobjs      r#   Ú_reconstruct_tor)   0   s%   € ð �+‰+�cÓ
€CØ×Ñ�VÔØ€Jó    c                 óp   — | j                  d¬«      }t        |d   «      |d<   t        | j                  |ffS )z€
    This method is used for pickling. The bot attribute is preserved so _BotPickler().persistent_id
    works as intended.
    T)Úinclude_privateÚ
api_kwargs)Ú
_get_attrsÚdictr)   Ú	__class__)r   Údatas     r#   Ú_custom_reductionr2   <   s>   € ð
 �>‰>¨$ˆ>Ó/€Dô ˜d <Ñ0Ó1€DˆÑÜ˜SŸ]™]¨DÐ1Ð1Ð1r*   c                   óp   ‡ — e Zd ZdZdededefˆ fd„Zdedee	ee
e   ef   f   fd„Zdeded	z  fd
„Zˆ xZS )Ú_BotPickler©Ú_botÚbotÚargsr$   c                 ó2   •— || _         t        ‰| �  |i |¤Ž y ©N©r6   ÚsuperÚ__init__©Úselfr7   r8   r$   r0   s       €r#   r=   z_BotPickler.__init__K   ó   ø€ ØˆŒ	Ü‰Ñ˜$Ð) &Ó)r*   r(   r   c                 óD   — t        |t        «      st        S t        |«      S )zŒ
        This method is used for pickling. The bot attribute is preserved so
        _BotPickler().persistent_id works as intended.
        )Ú
isinstancer   ÚNotImplementedr2   ©r?   r(   s     r#   Úreducer_overridez_BotPickler.reducer_overrideO   s   € ô ˜#œ~Ô.Ü!Ð!ä  Ó%Ð%r*   Nc                 ór   — || j                   u rt        S t        |t        «      rt	        dd¬«       t
        S y)z¢Used to 'mark' the Bot, so it can be replaced later. See
        https://docs.python.org/3/library/pickle.html#pickle.Pickler.persistent_id for more info
        zHUnknown bot instance found. Will be replaced by `None` during unpicklingé   )Ú
stacklevelN)r6   Ú_REPLACED_KNOWN_BOTrB   r
   r   Ú_REPLACED_UNKNOWN_BOTrD   s     r#   Úpersistent_idz_BotPickler.persistent_id[   s9   € ð �$—)‘)ÑÜ&Ð&Ü�cœ3ÔÜØZØõô )Ð(Ør*   )Ú__name__Ú
__module__Ú__qualname__Ú	__slots__r
   r   r=   r   Útupler   Útyper/   rE   ÚobjectÚstrrK   Ú__classcell__©r0   s   @r#   r4   r4   H   sg   ø„ Ø€Ið*˜Cð *¨ð *°sõ *ð
&Øð
&à	ˆx˜˜t KÑ0°$Ð6Ñ7Ð7Ñ	8ó
&ð ð ¨C°$©J÷ r*   r4   c                   óF   ‡ — e Zd ZdZdededefˆ fd„Zdededz  fd	„Zˆ xZ	S )
Ú_BotUnpicklerr5   r7   r8   r$   c                 ó2   •— || _         t        ‰| �  |i |¤Ž y r:   r;   r>   s       €r#   r=   z_BotUnpickler.__init__m   r@   r*   Úpidr   Nc                 ój   — |t         k(  r| j                  S |t        k(  ryt        j                  d«      ‚)zSReplaces the bot with the current bot if known, else it is replaced by :obj:`None`.Nz,Found unknown persistent id when unpickling!)rI   r6   rJ   ÚpickleÚUnpicklingError)r?   rY   s     r#   Úpersistent_loadz_BotUnpickler.persistent_loadq   s3   € àÔ%Ò%Ø—9‘9ÐØÔ'Ò'ØÜ×$Ñ$Ð%SÓTÐTr*   )
rL   rM   rN   rO   r
   r   r=   rS   r]   rT   rU   s   @r#   rW   rW   j   s<   ø„ Ø€Ið*˜Cð *¨ð *°sõ *ðU 3ð U¨3°©:÷ Ur*   rW   c                   óH  ‡ — e Zd ZdZdZe	 	 	 	 d.dddededz  ded	ed
e	fd„«       Z
e	 	 	 	 	 d/dddededz  ded	ed
e	deeeeef   dz  fd„«       Z
	 	 	 	 	 d/dededz  ded	ed
e	deeeeef   dz  fˆ fd„Z
d0d„Zdedefd„Zd0d„Zdededdfd„Zdeeef   fd„Zdeeef   fd„Zdefd„Zdedz  fd„Zdedefd„Zdede dedz  ddfd„Z!dededdfd „Z"d!ededdfd"„Z#deddfd#„Z$deddfd$„Z%d!eddfd%„Z&deddfd&„Z'ded'eddfd(„Z(d!ed)eddfd*„Z)d+eddfd,„Z*d0d-„Z+ˆ xZ,S )1ÚPicklePersistenceaq  Using python's builtin :mod:`pickle` for making your bot persistent.

    Attention:
        The interface provided by this class is intended to be accessed exclusively by
        :class:`~telegram.ext.Application`. Calling any of the methods below manually might
        interfere with the integration of persistence into :class:`~telegram.ext.Application`.

    Note:
        This implementation of :class:`BasePersistence` uses the functionality of the pickle module
        to support serialization of bot instances. Specifically any reference to
        :attr:`~BasePersistence.bot` will be replaced by a placeholder before pickling and
        :attr:`~BasePersistence.bot` will be inserted back when loading the data.

    Examples:
        :any:`Persistent Conversation Bot <examples.persistentconversationbot>`

    .. seealso:: :wiki:`Making Your Bot Persistent <Making-your-bot-persistent>`

    .. versionchanged:: 20.0

        * The parameters and attributes ``store_*_data`` were replaced by :attr:`store_data`.
        * The parameter and attribute ``filename`` were replaced by :attr:`filepath`.
        * :attr:`filepath` now also accepts :obj:`pathlib.Path` as argument.

    Args:
        filepath (:obj:`str` | :obj:`pathlib.Path`): The filepath for storing the pickle files.
            When :attr:`single_file` is :obj:`False` this will be used as a prefix.
        store_data (:class:`~telegram.ext.PersistenceInput`, optional): Specifies which kinds of
            data will be saved by this persistence instance. By default, all available kinds of
            data will be saved.
        single_file (:obj:`bool`, optional): When :obj:`False` will store 5 separate files of
            `filename_user_data`, `filename_bot_data`, `filename_chat_data`,
            `filename_callback_data` and `filename_conversations`. Default is :obj:`True`.
        on_flush (:obj:`bool`, optional): When :obj:`True` will only save to file when
            :meth:`flush` is called and keep data in memory until that happens. When
            :obj:`False` will store data on any transaction *and* on call to :meth:`flush`.
            Default is :obj:`False`.
        context_types (:class:`telegram.ext.ContextTypes`, optional): Pass an instance
            of :class:`telegram.ext.ContextTypes` to customize the types used in the
            ``context`` interface. If not passed, the defaults documented in
            :class:`telegram.ext.ContextTypes` will be used.

            .. versionadded:: 13.6
        update_interval (:obj:`int` | :obj:`float`, optional): The
            :class:`~telegram.ext.Application` will update
            the persistence in regular intervals. This parameter specifies the time (in seconds) to
            wait between two consecutive runs of updating the persistence. Defaults to 60 seconds.

            .. versionadded:: 20.0
    Attributes:
        filepath (:obj:`str` | :obj:`pathlib.Path`): The filepath for storing the pickle files.
            When :attr:`single_file` is :obj:`False` this will be used as a prefix.
        store_data (:class:`~telegram.ext.PersistenceInput`): Specifies which kinds of data will
            be saved by this persistence instance.
        single_file (:obj:`bool`): Optional. When :obj:`False` will store 5 separate files of
            `filename_user_data`, `filename_bot_data`, `filename_chat_data`,
            `filename_callback_data` and `filename_conversations`. Default is :obj:`True`.
        on_flush (:obj:`bool`): Optional. When :obj:`True` will only save to file when
            :meth:`flush` is called and keep data in memory until that happens. When
            :obj:`False` will store data on any transaction *and* on call to :meth:`flush`.
            Default is :obj:`False`.
        context_types (:class:`telegram.ext.ContextTypes`): Container for the types used
            in the ``context`` interface.

            .. versionadded:: 13.6
    )	Úbot_dataÚcallback_dataÚ	chat_dataÚcontext_typesÚconversationsÚfilepathÚon_flushÚsingle_fileÚ	user_dataNr?   zAPicklePersistence[dict[Any, Any], dict[Any, Any], dict[Any, Any]]re   Ú
store_datarg   rf   Úupdate_intervalc                  ó   — y r:   © )r?   re   ri   rg   rf   rj   s         r#   r=   zPicklePersistence.__init__Ê   s   € ð r*   zPicklePersistence[UD, CD, BD]rc   c                  ó   — y r:   rl   )r?   re   ri   rg   rf   rj   rc   s          r#   r=   zPicklePersistence.__init__Ô   s   € ð r*   c                 óä   •— t         ‰| �  ||¬«       t        |«      | _        || _        || _        d | _        d | _        d | _        d | _	        d | _
        t        d|xs
 t        «       «      | _        y )N)ri   rj   zContextTypes[Any, UD, CD, BD])r<   r=   r   re   rg   rf   rh   rb   r`   ra   rd   r   r   rc   )r?   re   ri   rg   rf   rj   rc   r0   s          €r#   r=   zPicklePersistence.__init__ß   so   ø€ ô 	‰Ñ JÀÐÔPÜ" 8›nˆŒØ(3ˆÔØ%-ˆŒØ/3ˆŒØ/3ˆŒØ#'ˆŒØ-1ˆÔØTXˆÔÜ<@Ø+¨]Ò-L¼l»nó=
ˆÕr*   r   c                 óà  — 	 | j                   j                  d«      5 }t        | j                  |«      j	                  «       }d d d «       d   | _        |d   | _        |j                  d| j                  j                  «       «      | _	        |j                  di «      | _
        |d   | _        y # 1 sw Y   ŒnxY w# t        $ r> i | _        i | _        i | _        | j                  j                  «       | _	        d | _
        Y y t        j                  $ r+}| j                   j                  }t!        d|› d�«      |‚d }~wt"        $ r(}t!        d	| j                   j                  › �«      |‚d }~ww xY w)
NÚrbrh   rb   r`   ra   rd   úFile ú# does not contain valid pickle dataú Something went wrong unpickling )re   ÚopenrW   r7   Úloadrh   rb   Úgetrc   r`   ra   rd   ÚOSErrorr[   r\   ÚnameÚ	TypeErrorÚ	Exception)r?   Úfiler1   ÚexcÚfilenames        r#   Ú_load_singlefilez"PicklePersistence._load_singlefileõ   sL  € ð	^Ø—‘×#Ñ# DÓ)ð <¨TÜ$ T§X¡X¨tÓ4×9Ñ9Ó;�÷<ð " +Ñ.ˆDŒNØ! +Ñ.ˆDŒNà ŸH™H Z°×1CÑ1C×1LÑ1LÓ1NÓOˆDŒMØ!%§¡¨/¸2Ó!>ˆDÔØ!% oÑ!6ˆDÕ÷<ð <ûô ò 	&Ø!#ˆDÔØˆDŒNØˆDŒNØ ×.Ñ.×7Ñ7Ó9ˆDŒMØ!%ˆDÖÜ×%Ñ%ò 	\Ø—}‘}×)Ñ)ˆHÜ˜e H :Ð-PÐQÓRÐX[Ð[ûÜò 	^ÜÐ>¸t¿}¹}×?QÑ?QÐ>RÐSÓTÐZ]Ð]ûð	^úsB   ‚B; �%B/ÁA,B; Â/B8Â4B; Â;AE-ÄE-Ä&D9Ä9E-Å#E(Å(E-c                 ób  — 	 |j                  d«      5 }t        | j                  |«      j                  «       cd d d «       S # 1 sw Y   y xY w# t        $ r Y y t
        j                  $ r}t        d|j                  › d�«      |‚d }~wt        $ r}t        d|j                  › �«      |‚d }~ww xY w)Nrp   rq   rr   rs   )
rt   rW   r7   ru   rw   r[   r\   ry   rx   rz   )r?   re   r{   r|   s       r#   Ú
_load_filezPicklePersistence._load_file  s¦   € ð		YØ—‘˜tÓ$ð <¨Ü$ T§X¡X¨tÓ4×9Ñ9Ó;÷<÷ <ò <ûô ò 	ÙÜ×%Ñ%ò 	aÜ˜e H§M¡M ?Ð2UÐVÓWÐ]`Ð`ûÜò 	YÜÐ>¸x¿}¹}¸oÐNÓOÐUXÐXûð	YúsE   ‚A “$A·	A ÁA
ÁA Á
A Á	B.ÁB.Á*BÂB.ÂB)Â)B.c                 óB  — | j                   | j                  | j                  | j                  | j                  dœ}| j
                  j                  d«      5 }t        | j                  |t        j                  ¬«      j                  |«       d d d «       y # 1 sw Y   y xY w)N)rd   rh   rb   r`   ra   Úwb©Úprotocol)rd   rh   rb   r`   ra   re   rt   r4   r7   r[   ÚHIGHEST_PROTOCOLÚdump)r?   r1   r{   s      r#   Ú_dump_singlefilez"PicklePersistence._dump_singlefile  s€   € à!×/Ñ/ØŸ™ØŸ™ØŸ™Ø!×/Ñ/ñ
ˆð �]‰]×Ñ Ó%ð 	U¨Ü˜Ÿ™ $´×1HÑ1HÔI×NÑNÈtÔT÷	U÷ 	Uñ 	Uús   Á6BÂBr1   c                 óº   — |j                  d«      5 }t        | j                  |t        j                  ¬«      j                  |«       d d d «       y # 1 sw Y   y xY w)Nr‚   rƒ   )rt   r4   r7   r[   r…   r†   )r?   re   r1   r{   s       r#   Ú
_dump_filezPicklePersistence._dump_file#  sJ   € Ø�]‰]˜4Ó ð 	U DÜ˜Ÿ™ $´×1HÑ1HÔI×NÑNÈtÔT÷	U÷ 	Uñ 	Uús   ’6AÁAc              ƒ   óì   K  — | j                   rnO| j                  s3| j                  t        | j                  › d�«      «      }|si }|| _         n| j                  «        t        | j                   «      S ­w)z®Returns the user_data from the pickle file if it exists or an empty :obj:`dict`.

        Returns:
            dict[:obj:`int`, :obj:`dict`]: The restored user data.
        Ú
_user_data)rh   rg   r€   r   re   r~   r   ©r?   r1   s     r#   Úget_user_datazPicklePersistence.get_user_data'  óc   è ø€ ð �>Š>ØØ×!Ò!Ø—?‘?¤4¨4¯=©=¨/¸Ð(DÓ#EÓFˆDÙØ�Ø!ˆD�Nà×!Ñ!Ô#Ü˜Ÿ™Ó'Ð'ùó   ‚A2A4c              ƒ   óì   K  — | j                   rnO| j                  s3| j                  t        | j                  › d�«      «      }|si }|| _         n| j                  «        t        | j                   «      S ­w)z®Returns the chat_data from the pickle file if it exists or an empty :obj:`dict`.

        Returns:
            dict[:obj:`int`, :obj:`dict`]: The restored chat data.
        Ú
_chat_data)rb   rg   r€   r   re   r~   r   rŒ   s     r#   Úget_chat_datazPicklePersistence.get_chat_data8  rŽ   r�   c              ƒ   ó  K  — | j                   rng| j                  sK| j                  t        | j                  › d�«      «      }|s| j
                  j                  «       }|| _         n| j                  «        t        | j                   «      S ­w)a  Returns the bot_data from the pickle file if it exists or an empty object of type
        :obj:`dict` | :attr:`telegram.ext.ContextTypes.bot_data`.

        Returns:
            :obj:`dict` | :attr:`telegram.ext.ContextTypes.bot_data`: The restored bot data.
        Ú	_bot_data)r`   rg   r€   r   re   rc   r~   r   rŒ   s     r#   Úget_bot_datazPicklePersistence.get_bot_dataI  sr   è ø€ ð �=Š=ØØ×!Ò!Ø—?‘?¤4¨4¯=©=¨/¸Ð(CÓ#DÓEˆDÙØ×)Ñ)×2Ñ2Ó4�Ø ˆD�Mà×!Ñ!Ô#Ü˜Ÿ™Ó&Ð&ùs   ‚B
Bc              ƒ   ó  K  — | j                   rnO| j                  s3| j                  t        | j                  › d�«      «      }|sd}|| _         n| j                  «        | j                   €yt        | j                   «      S ­w)ad  Returns the callback data from the pickle file if it exists or :obj:`None`.

        .. versionadded:: 13.6

        Returns:
            tuple[list[tuple[:obj:`str`, :obj:`float`, dict[:obj:`str`, :class:`object`]]],
            dict[:obj:`str`, :obj:`str`]] | :obj:`None`: The restored metadata or :obj:`None`,
            if no data was stored.
        Ú_callback_dataN)ra   rg   r€   r   re   r~   r   rŒ   s     r#   Úget_callback_dataz#PicklePersistence.get_callback_data[  sw   è ø€ ð ×ÒØØ×!Ò!Ø—?‘?¤4¨4¯=©=¨/¸Ð(HÓ#IÓJˆDÙØ�Ø!%ˆDÕà×!Ñ!Ô#Ø×ÑÐ%ØÜ˜×*Ñ*Ó+Ð+ùs   ‚A?Brx   c              ƒ   ó  K  — | j                   rnQ| j                  s5| j                  t        | j                  › d�«      «      }|s|i i}|| _         n| j                  «        | j                   j                  |i «      j                  «       S ­w)zîReturns the conversations from the pickle file if it exists or an empty dict.

        Args:
            name (:obj:`str`): The handlers name.

        Returns:
            :obj:`dict`: The restored conversations for the handler.
        Ú_conversations)rd   rg   r€   r   re   r~   rv   Úcopy)r?   rx   r1   s      r#   Úget_conversationsz#PicklePersistence.get_conversationsr  s}   è ø€ ð ×ÒØØ×!Ò!Ø—?‘?¤4¨4¯=©=¨/¸Ð(HÓ#IÓJˆDÙØ˜b�z�Ø!%ˆDÕà×!Ñ!Ô#Ø×!Ñ!×%Ñ% d¨BÓ/×4Ñ4Ó6Ð6ùs   ‚B	BÚkeyÚ	new_statec              ƒ   ól  K  — | j                   si | _         | j                   j                  |i «      j                  |«      |k(  ry|| j                   |   |<   | j                  sP| j                  s3| j                  t        | j                  › d�«      | j                   «       y| j                  «        yy­w)aJ  Will update the conversations for the given handler and depending on :attr:`on_flush`
        save the pickle file.

        Args:
            name (:obj:`str`): The handler's name.
            key (:obj:`tuple`): The key the state is changed for.
            new_state (:class:`object`): The new state for the given key.
        Nrš   )	rd   Ú
setdefaultrv   rf   rg   r‰   r   re   r‡   )r?   rx   r�   rž   s       r#   Úupdate_conversationz%PicklePersistence.update_conversation†  sœ   è ø€ ð ×!Ò!Ø!#ˆDÔØ×Ñ×(Ñ(¨¨rÓ2×6Ñ6°sÓ;¸yÒHØØ(1ˆ×Ñ˜4Ñ  Ñ%Ø�}Š}Ø×#Ò#Ø—‘¤¨¯© °nÐ%EÓ FÈ×HZÑHZÕ[à×%Ñ%Õ'ð	 ùs   ‚B2B4Úuser_idc              ƒ   óF  K  — | j                   €i | _         | j                   j                  |«      |k(  ry|| j                   |<   | j                  sP| j                  s3| j	                  t        | j                  › d�«      | j                   «       y| j                  «        yy­w)a  Will update the user_data and depending on :attr:`on_flush` save the pickle file.

        Args:
            user_id (:obj:`int`): The user the data might have been changed for.
            data (:obj:`dict`): The :attr:`telegram.ext.Application.user_data` ``[user_id]``.
        Nr‹   )rh   rv   rf   rg   r‰   r   re   r‡   )r?   r¢   r1   s      r#   Úupdate_user_dataz"PicklePersistence.update_user_dataœ  ó„   è ø€ ð �>‰>Ð!ØˆDŒNØ�>‰>×Ñ˜gÓ&¨$Ò.ØØ"&ˆ�‰�wÑØ�}Š}Ø×#Ò#Ø—‘¤¨¯© °jÐ%AÓ BÀDÇNÁNÕSà×%Ñ%Õ'ð	 ùó   ‚BB!Úchat_idc              ƒ   óF  K  — | j                   €i | _         | j                   j                  |«      |k(  ry|| j                   |<   | j                  sP| j                  s3| j	                  t        | j                  › d�«      | j                   «       y| j                  «        yy­w)a  Will update the chat_data and depending on :attr:`on_flush` save the pickle file.

        Args:
            chat_id (:obj:`int`): The chat the data might have been changed for.
            data (:obj:`dict`): The :attr:`telegram.ext.Application.chat_data` ``[chat_id]``.
        Nr‘   )rb   rv   rf   rg   r‰   r   re   r‡   )r?   r§   r1   s      r#   Úupdate_chat_dataz"PicklePersistence.update_chat_data®  r¥   r¦   c              ƒ   óò   K  — | j                   |k(  ry|| _         | j                  sP| j                  s3| j                  t	        | j
                  › d�«      | j                   «       y| j                  «        yy­w)zôWill update the bot_data and depending on :attr:`on_flush` save the pickle file.

        Args:
            data (:obj:`dict` | :attr:`telegram.ext.ContextTypes.bot_data`): The
                :attr:`telegram.ext.Application.bot_data`.
        Nr”   )r`   rf   rg   r‰   r   re   r‡   rŒ   s     r#   Úupdate_bot_dataz!PicklePersistence.update_bot_dataÀ  sa   è ø€ ð �=‰=˜DÒ ØØˆŒØ�}Š}Ø×#Ò#Ø—‘¤¨¯© °iÐ%@Ó AÀ4Ç=Á=ÕQà×%Ñ%Õ'ð	 ùó   ‚A5A7c              ƒ   óò   K  — | j                   |k(  ry|| _         | j                  sP| j                  s3| j                  t	        | j
                  › d�«      | j                   «       y| j                  «        yy­w)aŠ  Will update the callback_data (if changed) and depending on :attr:`on_flush` save the
        pickle file.

        .. versionadded:: 13.6

        Args:
            data (tuple[list[tuple[:obj:`str`, :obj:`float`,                 dict[:obj:`str`, :class:`object`]]], dict[:obj:`str`, :obj:`str`]]):
                The relevant data to restore :class:`telegram.ext.CallbackDataCache`.
        Nr—   )ra   rf   rg   r‰   r   re   r‡   rŒ   s     r#   Úupdate_callback_dataz&PicklePersistence.update_callback_dataÐ  sf   è ø€ ð ×Ñ Ò%ØØ!ˆÔØ�}Š}Ø×#Ò#Ø—‘¤¨¯© °nÐ%EÓ FÈ×HZÑHZÕ[à×%Ñ%Õ'ð	 ùr¬   c              ƒ   ó  K  — | j                   €y| j                   j                  |d«       | j                  sP| j                  s3| j	                  t        | j                  › d�«      | j                   «       y| j                  «        yy­w)zúWill delete the specified key from the ``chat_data`` and depending on
        :attr:`on_flush` save the pickle file.

        .. versionadded:: 20.0

        Args:
            chat_id (:obj:`int`): The chat id to delete from the persistence.
        Nr‘   )rb   Úpoprf   rg   r‰   r   re   r‡   )r?   r§   s     r#   Údrop_chat_dataz PicklePersistence.drop_chat_dataä  ól   è ø€ ð �>‰>Ð!ØØ�‰×Ñ˜7 DÔ)à�}Š}Ø×#Ò#Ø—‘¤¨¯© °jÐ%AÓ BÀDÇNÁNÕSà×%Ñ%Õ'ð	 ùó   ‚BB	c              ƒ   ó  K  — | j                   €y| j                   j                  |d«       | j                  sP| j                  s3| j	                  t        | j                  › d�«      | j                   «       y| j                  «        yy­w)zúWill delete the specified key from the ``user_data`` and depending on
        :attr:`on_flush` save the pickle file.

        .. versionadded:: 20.0

        Args:
            user_id (:obj:`int`): The user id to delete from the persistence.
        Nr‹   )rh   r°   rf   rg   r‰   r   re   r‡   )r?   r¢   s     r#   Údrop_user_dataz PicklePersistence.drop_user_data÷  r²   r³   rh   c              ƒ   ó   K  — y­w)z‚Does nothing.

        .. versionadded:: 13.6
        .. seealso:: :meth:`telegram.ext.BasePersistence.refresh_user_data`
        Nrl   )r?   r¢   rh   s      r#   Úrefresh_user_dataz#PicklePersistence.refresh_user_data
  ó   è ø� ùó   ‚rb   c              ƒ   ó   K  — y­w)z‚Does nothing.

        .. versionadded:: 13.6
        .. seealso:: :meth:`telegram.ext.BasePersistence.refresh_chat_data`
        Nrl   )r?   r§   rb   s      r#   Úrefresh_chat_dataz#PicklePersistence.refresh_chat_data  r¸   r¹   r`   c              ƒ   ó   K  — y­w)z�Does nothing.

        .. versionadded:: 13.6
        .. seealso:: :meth:`telegram.ext.BasePersistence.refresh_bot_data`
        Nrl   )r?   r`   s     r#   Úrefresh_bot_dataz"PicklePersistence.refresh_bot_data  r¸   r¹   c              ƒ   ó.  K  — | j                   rN| j                  s0| j                  s$| j                  s| j                  s| j
                  r| j                  «        yy| j                  r2| j                  t        | j                  › d�«      | j                  «       | j                  r2| j                  t        | j                  › d�«      | j                  «       | j                  r2| j                  t        | j                  › d�«      | j                  «       | j                  r2| j                  t        | j                  › d�«      | j                  «       | j
                  r3| j                  t        | j                  › d�«      | j
                  «       yy­w)z/Will save all data in memory to pickle file(s).r‹   r‘   r”   r—   rš   N)
rg   rh   rb   r`   ra   rd   r‡   r‰   r   re   )r?   s    r#   ÚflushzPicklePersistence.flush  s#  è ø€ à×Òà—’Ø—>’>Ø—=’=Ø×%Ò%Ø×%Ò%à×%Ñ%Õ'ð &ð �~Š~Ø—‘¤¨¯© °jÐ%AÓ BÀDÇNÁNÔSØ�~Š~Ø—‘¤¨¯© °jÐ%AÓ BÀDÇNÁNÔSØ�}Š}Ø—‘¤¨¯© °iÐ%@Ó AÀ4Ç=Á=ÔQØ×!Ò!Ø—‘¤¨¯© °nÐ%EÓ FÈ×HZÑHZÔ[Ø×!Ò!Ø—‘¤¨¯© °nÐ%EÓ FÈ×HZÑHZÕ[ð "ùs   ‚FF)NTFé<   )NTFrÀ   N)r   N)-rL   rM   rN   Ú__doc__rO   r	   r   r   ÚboolÚfloatr=   r   r   r   r   r   r~   r   r€   r‡   rR   r‰   r/   Úintr�   r’   r•   r   r˜   rS   r   rœ   r   r¡   r¤   r©   r«   r®   r±   rµ   r·   r»   r½   r¿   rT   rU   s   @r#   r_   r_   z   sã  ø„ ñAðF
€Ið ð /3Ø ØØ!#ñØQðàðð % tÑ+ðð ð	ð
 ðð òó ðð ð /3Ø ØØ!#Ø>BñØ-ðàðð % tÑ+ðð ð	ð
 ðð ðð $ C¨¨R° OÑ4°tÑ;òó ðð /3Ø ØØ!#Ø>Bñ
àð
ð % tÑ+ð
ð ð	
ð
 ð
ð ð
ð $ C¨¨R° OÑ4°tÑ;õ
ó,^ð.
Y 4ð 
Y¨Có 
Yó	UðU 4ð U¨vð U¸$ó Uð( T¨#¨r¨'¡]ó (ð"( T¨#¨r¨'¡]ó (ð"' Bó 'ð$,¨°4©ó ,ð.7¨Cð 7Ð4Dó 7ð((Øð(Ø-ð(Ø:@À4¹-ð(à	ó(ð,(¨cð (¸ð (Àó (ð$(¨cð (¸ð (Àó (ð$(¨"ð (°ó (ð (¨wð (¸4ó (ð((¨Cð (°Dó (ð&(¨Cð (°Dó (ð&¨sð ¸rð Àdó ð¨sð ¸rð Àdó ð¨rð °dó ÷\r*   r_   )/rÁ   r[   Úcollections.abcr   r›   r   Úpathlibr   Útypingr   r   r   r	   Útelegramr
   r   Útelegram._utils.typesr   Útelegram._utils.warningsr   Útelegram.extr   r   Útelegram.ext._contexttypesr   Útelegram.ext._utils.typesr   r   r   r   r   r   rI   rJ   r   rQ   r   r   r/   r)   rP   r2   ÚPicklerr4   Ú	UnpicklerrW   r_   rl   r*   r#   ú<module>rÐ      sú   ðñ& 8ã Ý $Ý Ý ß /Ó /ç (Ý /Ý )ß :Ý 3ß \× \àGÐ ØLÐ á�m¨>Ô:€ðV˜˜kÑ*ð V¨s°4¸Ñ3DÑ/Eó Vð	˜˜kÑ*ð 	°Dð 	¸[ó 	ð	2˜;ð 	2¨5°¸5ÀÀkÑARÐTXÐAXÑ;YÐ1YÑ+Zó 	2ô�&—.‘.ô ôDU�F×$Ñ$ô Uô z\˜¨¨B°¨
Ñ3õ z\r*   