Ë
    òÏj�  ã                  ó–   — d dl mZ d dlmZmZmZ  G d„ de«      Ze G d„ de«      «       Z G d„ de«      Z	 	 	 	 dd	„Z	 G d
„ de«      Z
y)é    )Úannotations)ÚAnyÚProtocolÚruntime_checkablec                  ó    — e Zd ZdZdd„Zdd„Zy)ÚUntypedSerializerProtocolz:Protocol for serialization and deserialization of objects.c                 ó   — y ©N© ©ÚselfÚobjs     ú\/var/www/html/gaurav-v2/venv/lib/python3.12/site-packages/langgraph/checkpoint/serde/base.pyÚdumpszUntypedSerializerProtocol.dumps	   s   € ¨ó    c                 ó   — y r
   r   ©r   Údatas     r   ÚloadszUntypedSerializerProtocol.loads   s   € ¨r   N)r   r   ÚreturnÚbytes)r   r   r   r   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   r   r   r      s   „ ÙDã+ä,r   r   c                  ó    — e Zd ZdZdd„Zdd„Zy)ÚSerializerProtocola  Protocol for serialization and deserialization of objects.

    - `dumps_typed`: Serialize an object to a tuple `(type, bytes)`.
    - `loads_typed`: Deserialize an object from a tuple `(type, bytes)`.

    Valid implementations include the `pickle`, `json` and `orjson` modules.
    c                 ó   — y r
   r   r   s     r   Údumps_typedzSerializerProtocol.dumps_typed   s   € ¸#r   c                 ó   — y r
   r   r   s     r   Úloads_typedzSerializerProtocol.loads_typed   s   € ¸3r   N©r   r   r   útuple[str, bytes]©r   r#   r   r   )r   r   r   r   r   r!   r   r   r   r   r      s   „ ñó >ä>r   r   c                  ó$   — e Zd Zdd„Zdd„Zdd„Zy)ÚSerializerCompatc                ó   — || _         y r
   ©Úserde)r   r)   s     r   Ú__init__zSerializerCompat.__init__   s	   € Øˆ�
r   c                ób   — t        |«      j                  | j                  j                  |«      fS r
   )Útyper   r)   r   r   s     r   r   zSerializerCompat.dumps_typed!   s&   € Ü�C‹y×!Ñ! 4§:¡:×#3Ñ#3°CÓ#8Ð8Ð8r   c                ó>   — | j                   j                  |d   «      S )Né   )r)   r   r   s     r   r!   zSerializerCompat.loads_typed$   s   € Ø�z‰z×Ñ  Q¡Ó(Ð(r   N)r)   r   r   ÚNoner"   r$   )r   r   r   r*   r   r!   r   r   r   r&   r&      s   „ óó9ô)r   r&   c                ó<   — t        | t        «      st        | «      S | S )zmWrap serde old serde implementations in a class with loads_typed and dumps_typed for backwards compatibility.)Ú
isinstancer   r&   r(   s    r   Úmaybe_add_typed_methodsr2   (   s   € ô
 �eÔ/Ô0Ü Ó&Ð&à€Lr   c                  ó    — e Zd ZdZdd„Zdd„Zy)ÚCipherProtocolz~Protocol for encryption and decryption of data.

    - `encrypt`: Encrypt plaintext.
    - `decrypt`: Decrypt ciphertext.
    c                 ó   — y)z?Encrypt plaintext. Returns a tuple `(cipher name, ciphertext)`.Nr   )r   Ú	plaintexts     r   ÚencryptzCipherProtocol.encrypt:   ó   € àr   c                 ó   — y)z*Decrypt ciphertext. Returns the plaintext.Nr   )r   Ú
ciphernameÚ
ciphertexts      r   ÚdecryptzCipherProtocol.decrypt>   r8   r   N)r6   r   r   r#   )r:   Ústrr;   r   r   r   )r   r   r   r   r7   r<   r   r   r   r4   r4   3   s   „ ñóôr   r4   N)r)   z.SerializerProtocol | UntypedSerializerProtocolr   r   )Ú
__future__r   Útypingr   r   r   r   r   r&   r2   r4   r   r   r   Ú<module>r@      sc   ðÝ "ç 3Ñ 3ô- ô -ð ô?˜ó ?ó ð?ô)Ð)ô )ðØ9ðàóô�Xõ r   