§
    {Øj”*  ã                   ó<   — d dl Z  G d„ d¦  «        Z e¦   «         ZdS )é    Nc                   ó|   — e Zd ZdZd„ Zdd„ZeZd„ ZeZdd„Z	d„ Z
d	„ Zd
defd„Zd„ Zd„ Zdd„Zd„ Zd„ Zd„ Zd„ ZdS )ÚJSONBackendzøManages encoding and decoding using various backends.

    It tries these modules in this order:
        simplejson, json, ujson

    simplejson is a fast and popular backend and is tried first.
    json comes with Python and is tried second.

    c                 ó2   — | j         rdS t          d¦  «        ‚)z4Ensures that we've loaded at least one JSON backend.Nz*jsonpickle could not load any json modules)Ú	_verifiedÚAssertionError)Úselfs    ú‡/Users/tedpeters/Documents/Projects/Claude Projects/Misc Tools/notename-sheets/.venv/lib/python3.11/site-packages/jsonpickle/backend.pyÚ_verifyzJSONBackend._verify   s    € àŒ>ð 	ØˆFÝÐIÑJÔJÐJó    Nc                 óZ  — |                       ¦   «          | j        s&| j        d         }|                      ||||¬¦  «        S t	          | j        ¦  «        D ]T\  }}	 |                      ||||¬¦  «        c S # t
          $ r'}|t          | j        ¦  «        dz
  k    r|‚Y d}~ŒMd}~ww xY wdS )zÂ
        Attempt to encode an object into JSON.

        This tries the loaded backends in order and passes along the last
        exception if no backend is able to encode the object.

        r   )ÚindentÚ
separatorsé   N)r
   Ú_fallthroughÚ_backend_namesÚbackend_encodeÚ	enumerateÚ	ExceptionÚlen)r   Úobjr   r   ÚnameÚidxÚes          r	   ÚencodezJSONBackend.encode   sö   € ð 	�Š‰ŒˆàÔ ð 	XØÔ& qÔ)ˆDØ×&Ò& t¨S¸ÈJÐ&ÑWÔWÐWå" 4Ô#6Ñ7Ô7ð 	ð 	‰IˆC�ðØ×*Ò*Ø˜# f¸ð +ñ ô ð ð ð øõ ð ð ð Ø�#˜dÔ1Ñ2Ô2°QÑ6Ò6Ð6Ø�Gð 7Ð6Ð6Ð6Ð6øøøøðøøøð	ð 	s   ÁA7Á7
B(ÂB#Â#B(c                 óZ  — |                       ¦   «          | j        s#| j        d         }|                      ||¦  «        S t	          | j        ¦  «        D ]W\  }}	 |                      ||¦  «        c S # | j        |         $ r'}|t          | j        ¦  «        dz
  k    r|‚Y d}~ŒPd}~ww xY wdS )zÍ
        Attempt to decode an object from a JSON string.

        This tries the loaded backends in order and passes along the last
        exception if no backends are able to decode the string.

        r   r   N)r
   r   r   Úbackend_decoder   Ú_decoder_exceptionsr   )r   Ústringr   r   r   s        r	   ÚdecodezJSONBackend.decode/   sÚ   € ð 	�Š‰ŒˆàÔ ð 	5ØÔ& qÔ)ˆDØ×&Ò& t¨VÑ4Ô4Ð4å" 4Ô#6Ñ7Ô7ð 	ð 	‰IˆC�ðØ×*Ò*¨4°Ñ8Ô8Ð8Ð8Ð8øØÔ+¨DÔ1ð ð ð Ø�#˜dÔ1Ñ2Ô2°QÑ6Ò6Ð6Ø�Gà�D�D�D�Døøøøð	øøøð	ð 	s   ÁA1Á1B(ÂB#Â#B(Tc                 ó^  — || _         g | _        i | _        i | _        i | _        i | _        i | _        d| _        |                      d¦  «         |                      d¦  «         |                      d¦  «         |                      dddd¬	¦  «        | _	        d
ddif}d
dddœf|||dœ| _        d S )NFÚ
simplejsonÚjsonÚujsonÚyamlÚdumpÚ	safe_loadÚ	YAMLError)ÚdumpsÚloadsÚ	loads_exc© Ú	sort_keys)r,   Úescape_forward_slashes)r#   r"   r!   zdjango.util.simplejson)
r   r   Ú	_encodersÚ	_decodersÚ_encoder_optionsÚ_decoder_optionsr   r   Úload_backendÚ_yaml_registered_by_default)r   ÚfallthroughÚ	json_optss      r	   Ú__init__zJSONBackend.__init__I   sì   € à'ˆÔà ˆÔð ˆŒØˆŒð !#ˆÔð !#ˆÔð $&ˆÔ ð ˆŒà×Ò˜,Ñ'Ô'Ð'Ø×Ò˜&Ñ!Ô!Ð!Ø×Ò˜'Ñ"Ô"Ð"ð ,0×+<Ò+<Ø˜&¨¸{ð ,=ñ ,
ô ,
ˆÔ(ð
 ˜+ uÐ-Ð.ˆ	à¨ÈÐOÐOÐPØØ#Ø&/ð	!
ð !
ˆÔÐÐr   c                 ó   — || _         dS )a  
        Disable jsonpickle's fallthrough-on-error behavior

        By default, jsonpickle tries the next backend when decoding or
        encoding using a backend fails.

        This can make it difficult to force jsonpickle to use a specific
        backend, and catch errors, because the error will be suppressed and
        may not be raised by the subsequent backend.

        Calling `enable_backend(False)` will make jsonpickle immediately
        re-raise any exceptions raised by the backends.

        N)r   )r   Úenables     r	   Úenable_fallthroughzJSONBackend.enable_fallthroughr   s   € ð #ˆÔÐÐr   c                 ó|   — 	 t          ||¦  «        ||<   n&# t          $ r |                      |¦  «         Y dS w xY wdS )NFT)ÚgetattrÚAttributeErrorÚremove_backend)r   ÚdctÚbackendr   r   s        r	   Ú_storezJSONBackend._storeƒ   sY   € ð	Ý" 3¨Ñ-Ô-ˆC�‰LˆLøÝð 	ð 	ð 	Ø×Ò Ñ(Ô(Ð(Ø�5�5ð	øøøð ˆts   ‚ –9¸9r(   r)   c                 ó¨  — |dk    rd| _         	 t          |¦  «        }n# t          $ r Y dS w xY w	 |                     d¦  «        dd…         D ]}t	          ||¦  «        }Œn# t
          $ r Y dS w xY w|                      | j        |||¦  «        r|                      | j        |||¦  «        sdS t          |t          ¦  «        r |                      | j        |||¦  «        sdS n
|| j        |<   | j                             |g i f¦  «         | j                             |g i f¦  «         || j        vr| j                             |¦  «         d| _        dS )aå  Load a JSON backend by name.

        This method loads a backend and sets up references to that
        backend's loads/dumps functions and exception classes.

        :param dumps: is the name of the backend's encode method.
          The method should take an object and return a string.
          Defaults to 'dumps'.
        :param loads: names the backend's method for the reverse
          operation -- returning a Python object from a string.
        :param loads_exc: can be either the name of the exception class
          used to denote decoding errors, or it can be a direct reference
          to the appropriate exception class itself.  If it is a name,
          then the assumption is that an exception class of that name
          can be found in the backend module's namespace.
        :param load: names the backend's 'load' method.
        :param dump: names the backend's 'dump' method.
        :rtype bool: True on success, False if the backend could not be loaded.

        r$   Fú.r   NT)r3   Ú
__import__ÚImportErrorÚsplitr;   r<   r@   r.   r/   Ú
isinstanceÚstrr   r0   Ú
setdefaultr1   r   Úappendr   )r   r   r(   r)   r*   ÚmodÚattrs          r	   r2   zJSONBackend.load_backend‹   sª  € ð* �6Š>ˆ>Ø/4ˆDÔ,ð	å˜TÑ"Ô"ˆCˆCøÝð 	ð 	ð 	Ø�5�5ð	øøøð	ØŸ
š
 3™œ¨¨¨Ô+ð )ð )�Ý˜c 4Ñ(Ô(��ð)øåð 	ð 	ð 	Ø�5�5ð	øøøð �{Š{˜4œ>¨4°°eÑ<Ô<ð 	ÀDÇKÂKØŒN˜D # uñE
ô E
ð 	ð �5å�i¥Ñ%Ô%ð 	7à—;’;˜tÔ7¸¸sÀIÑNÔNð Ø�uðð .7ˆDÔ$ TÑ*ð 	Ô×(Ò(¨°°B¨xÑ8Ô8Ð8ØÔ×(Ò(¨°°B¨xÑ8Ô8Ð8ð �tÔ*Ð*Ð*ØÔ×&Ò& tÑ,Ô,Ð,ð ˆŒØˆts   � Ÿ
-¬-±0A" Á"
A0Á/A0c                 óŒ  — | j                              |d¦  «         | j                             |d¦  «         | j                             |d¦  «         | j                             |d¦  «         | j                             |d¦  «         || j        v r| j                             |¦  «         t          | j        ¦  «        | _	        dS )z,Remove all entries for a particular backend.N)
r.   Úpopr/   r   r1   r0   r   ÚremoveÚboolr   ©r   r   s     r	   r=   zJSONBackend.remove_backendÉ   s¸   € àŒ×Ò˜4 Ñ&Ô&Ð&ØŒ×Ò˜4 Ñ&Ô&Ð&ØÔ ×$Ò$ T¨4Ñ0Ô0Ð0ØÔ×!Ò! $¨Ñ-Ô-Ð-ØÔ×!Ò! $¨Ñ-Ô-Ð-Ø�4Ô&Ð&Ð&ØÔ×&Ò& tÑ,Ô,Ð,Ý˜dÔ1Ñ2Ô2ˆŒˆˆr   c                 ó`   — |dk    r%| j         r t          j        dt          d¬¦  «         d S d S d S )Nr$   z‚The yaml backend will no longer be registered by default in jsonpickle 5.0.0, call jsonpickle.ext.yaml.register() to keep using ité   )Ú
stacklevel)r3   ÚwarningsÚwarnÚDeprecationWarningrP   s     r	   Ú_warn_if_default_yamlz!JSONBackend._warn_if_default_yamlÔ   sM   € Ø�6Š>ˆ>˜dÔ>ˆ>åŒMðõ #Øðñ ô ð ð ð ð ˆ>ˆ>ˆ>r   c                 óü   — |                       |¦  «         | j                             |g i f¦  «        \  }}|                     ¦   «         }|�||d<   |�||d<   |ft	          |¦  «        z   } | j        |         |i |¤ŽS )Nr   r   )rW   r0   ÚgetÚcopyÚtupler.   )	r   r   r   r   r   ÚoptargsÚ	optkwargsÚencoder_kwargsÚencoder_argss	            r	   r   zJSONBackend.backend_encodeß   s”   € Ø×"Ò" 4Ñ(Ô(Ð(Ø!Ô2×6Ò6°t¸bÀ"¸XÑFÔFÑˆ�Ø"ŸšÑ)Ô)ˆØÐØ'-ˆN˜8Ñ$ØÐ!Ø+5ˆN˜<Ñ(Ø�v¥ g¡¤Ñ.ˆØ#ˆtŒ~˜dÔ# \ÐD°^ÐDÐDÐDr   c                 óÂ   — |                       |¦  «         | j                             |di f¦  «        \  }}|                     ¦   «         } | j        |         |g|¢R i |¤ŽS )Nr+   )rW   r1   rY   rZ   r/   )r   r   r   r\   r]   Údecoder_kwargss         r	   r   zJSONBackend.backend_decodeê   sm   € Ø×"Ò" 4Ñ(Ô(Ð(Ø!Ô2×6Ò6°t¸bÀ"¸XÑFÔFÑˆ�Ø"ŸšÑ)Ô)ˆØ#ˆtŒ~˜dÔ# FÐG¨WÐGÐGÐG¸ÐGÐGÐGr   c                 óª   — || j         v r7| j                              |¦  «         | j                              d|¦  «         dS d|z  }t          |¦  «        ‚)aÙ  
        Set the preferred json backend.

        If a preferred backend is set then jsonpickle tries to use it
        before any other backend.

        For example::

            set_preferred_backend('simplejson')

        If the backend is not one of the built-in jsonpickle backends
        (json/simplejson) then you must load the backend
        prior to calling set_preferred_backend.

        AssertionError is raised if the backend has not been loaded.

        r   z%The "%s" backend has not been loaded.N)r   rN   Úinsertr   )r   r   Úerrmsgs      r	   Úset_preferred_backendz!JSONBackend.set_preferred_backendð   s`   € ð$ �4Ô&Ð&Ð&ØÔ×&Ò& tÑ,Ô,Ð,ØÔ×&Ò& q¨$Ñ/Ô/Ð/Ð/Ð/à<¸tÑCˆFÝ  Ñ(Ô(Ð(r   c                 ó   — ||f| j         |<   dS )a‰  
        Associate encoder-specific options with an encoder.

        After calling set_encoder_options, any calls to jsonpickle's
        encode method will pass the supplied args and kwargs along to
        the appropriate backend's encode method.

        For example::

            set_encoder_options('simplejson', sort_keys=True, indent=4)

        See the appropriate encoder's documentation for details about
        the supported arguments and keyword arguments.

        WARNING: If you pass sort_keys=True, and the object to encode
        contains ``__slots__``, and you set ``warn`` to True,
        a TypeError will be raised!
        N)r0   ©r   r   ÚargsÚkwargss       r	   Úset_encoder_optionszJSONBackend.set_encoder_options	  s   € ð& (,¨V nˆÔ˜dÑ#Ð#Ð#r   c                 ó   — ||f| j         |<   dS )aè  
        Associate decoder-specific options with a decoder.

        After calling set_decoder_options, any calls to jsonpickle's
        decode method will pass the supplied args and kwargs along to
        the appropriate backend's decode method.

        For example::

            set_decoder_options('simplejson', encoding='utf8', cls=JSONDecoder)

        See the appropriate decoder's documentation for details about
        the supported arguments and keyword arguments.

        N)r1   rg   s       r	   Úset_decoder_optionszJSONBackend.set_decoder_options  s   € ð  (,¨V nˆÔ˜dÑ#Ð#Ð#r   )NN)T)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r
   r   r(   r   r)   r6   r9   r@   Ú
ValueErrorr2   r=   rW   r   r   re   rj   rl   r+   r   r	   r   r      s'  € € € € € ðð ðKð Kð Kðð ð ð ð0 €Eðð ð ð0 €Eð'
ð '
ð '
ð '
ðR#ð #ð #ð"ð ð ð (/°gÈð <ð <ð <ð <ð|	3ð 	3ð 	3ð	ð 	ð 	ð	Eð 	Eð 	Eð 	EðHð Hð Hð)ð )ð )ð25ð 5ð 5ð*5ð 5ð 5ð 5ð 5r   r   )rT   r   r"   r+   r   r	   ú<module>rr      sP   ðØ €€€ðj5ð j5ð j5ð j5ð j5ñ j5ô j5ð j5ðZ	 €{�}„}€€€r   