§
    !ß·iø  ã                  ó¾   — d dl mZ d dlZd dlZd dlZd dlZd dlZd dlZd dl	m
Z
 d dlmZ ej        rd dlmZ ddlmZ  G d„ d	¦  «        Zdd„Z G d„ de¦  «        ZdS )é    )ÚannotationsN)Údate)Ú	http_date)ÚResponseé   )ÚAppc                  óJ   — e Zd ZdZdd„Zdd„Zdd„Zdd„Zdd„Zd d„Z	d!d„Z
dS )"ÚJSONProvideraÉ  A standard set of JSON operations for an application. Subclasses
    of this can be used to customize JSON behavior or use different
    JSON libraries.

    To implement a provider for a specific library, subclass this base
    class and implement at least :meth:`dumps` and :meth:`loads`. All
    other methods have default implementations.

    To use a different provider, either subclass ``Flask`` and set
    :attr:`~flask.Flask.json_provider_class` to a provider class, or set
    :attr:`app.json <flask.Flask.json>` to an instance of the class.

    :param app: An application instance. This will be stored as a
        :class:`weakref.proxy` on the :attr:`_app` attribute.

    .. versionadded:: 2.2
    Úappr   ÚreturnÚNonec                ó8   — t          j        |¦  «        | _        d S )N)ÚweakrefÚproxyÚ_app)Úselfr   s     úX/home/mmwave/public_html/mmwave/venv/lib/python3.11/site-packages/flask/json/provider.pyÚ__init__zJSONProvider.__init__&   s   € Ý œ sÑ+Ô+ˆŒ	ˆ	ˆ	ó    Úobjút.AnyÚkwargsÚstrc                ó   — t           ‚)z‘Serialize data as JSON.

        :param obj: The data to serialize.
        :param kwargs: May be passed to the underlying JSON library.
        ©ÚNotImplementedError©r   r   r   s      r   ÚdumpszJSONProvider.dumps)   ó
   € õ "Ð!r   Úfpú	t.IO[str]c                óH   — |                       | j        |fi |¤Ž¦  «         dS )a  Serialize data as JSON and write to a file.

        :param obj: The data to serialize.
        :param fp: A file opened for writing text. Should use the UTF-8
            encoding to be valid JSON.
        :param kwargs: May be passed to the underlying JSON library.
        N)Úwriter   )r   r   r    r   s       r   ÚdumpzJSONProvider.dump1   s0   € ð 	�Š��”˜CÐ*Ð* 6Ð*Ð*Ñ+Ô+Ð+Ð+Ð+r   Úsústr | bytesc                ó   — t           ‚)z�Deserialize data as JSON.

        :param s: Text or UTF-8 bytes.
        :param kwargs: May be passed to the underlying JSON library.
        r   ©r   r%   r   s      r   ÚloadszJSONProvider.loads;   r   r   út.IO[t.AnyStr]c                óB   —  | j         |                     ¦   «         fi |¤ŽS )z»Deserialize data as JSON read from a file.

        :param fp: A file opened for reading text or UTF-8 bytes.
        :param kwargs: May be passed to the underlying JSON library.
        )r)   Úread)r   r    r   s      r   ÚloadzJSONProvider.loadC   s&   € ð ˆtŒz˜"Ÿ'š'™)œ)Ð.Ð. vÐ.Ð.Ð.r   Úargsútuple[t.Any, ...]údict[str, t.Any]c                ór   — |r|rt          d¦  «        ‚|s|sd S t          |¦  «        dk    r|d         S |p|S )Nz9app.json.response() takes either args or kwargs, not bothé   r   )Ú	TypeErrorÚlen)r   r.   r   s      r   Ú_prepare_response_objz"JSONProvider._prepare_response_objK   sZ   € ð ð 	Y�Fð 	YÝÐWÑXÔXÐXàð 	˜Fð 	Ø�4åˆt‰9Œ9˜Š>ˆ>Ø˜”7ˆNàˆ~�vÐr   r   c                óŒ   — |                       ||¦  «        }| j                             |                      |¦  «        d¬¦  «        S )a(  Serialize the given arguments as JSON, and return a
        :class:`~flask.Response` object with the ``application/json``
        mimetype.

        The :func:`~flask.json.jsonify` function calls this method for
        the current application.

        Either positional or keyword arguments can be given, not both.
        If no arguments are given, ``None`` is serialized.

        :param args: A single value to serialize, or multiple values to
            treat as a list to serialize.
        :param kwargs: Treat as a dict to serialize.
        úapplication/json©Úmimetype)r5   r   Úresponse_classr   )r   r.   r   r   s       r   ÚresponsezJSONProvider.responseY   s?   € ð ×(Ò(¨¨vÑ6Ô6ˆØŒy×'Ò'¨¯
ª
°3©¬ÐBTÐ'ÑUÔUÐUr   N)r   r   r   r   ©r   r   r   r   r   r   )r   r   r    r!   r   r   r   r   ©r%   r&   r   r   r   r   )r    r*   r   r   r   r   )r.   r/   r   r0   r   r   ©r.   r   r   r   r   r   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r$   r)   r-   r5   r;   © r   r   r
   r
      s°   € € € € € ðð ð$,ð ,ð ,ð ,ð"ð "ð "ð "ð,ð ,ð ,ð ,ð"ð "ð "ð "ð/ð /ð /ð /ðð ð ð ðVð Vð Vð Vð Vð Vr   r
   Úor   r   c                ó¾  — t          | t          ¦  «        rt          | ¦  «        S t          | t          j        t
          j        f¦  «        rt          | ¦  «        S t          r(t          j	        | ¦  «        rt          j
        | ¦  «        S t          | d¦  «        r!t          |                      ¦   «         ¦  «        S t          dt          | ¦  «        j        › d�¦  «        ‚)NÚ__html__zObject of type z is not JSON serializable)Ú
isinstancer   r   ÚdecimalÚDecimalÚuuidÚUUIDr   ÚdataclassesÚis_dataclassÚasdictÚhasattrrF   r3   Útyper?   )rD   s    r   Ú_defaultrQ   l   s¼   € Ý�!•TÑÔð Ý˜‰|Œ|Ðå�!•g”o¥t¤yÐ1Ñ2Ô2ð Ý�1‰vŒvˆåð %•{Ô/°Ñ2Ô2ð %ÝÔ! !Ñ$Ô$Ð$åˆq�*ÑÔð !Ý�1—:’:‘<”<Ñ Ô Ð å
ÐQ¥d¨1¡g¤gÔ&6ÐQÐQÐQÑ
RÔ
RÐRr   c                  óp   — e Zd ZU dZ ee¦  «        Zded<   	 dZ	 dZ		 dZ
ded<   	 dZ	 dd„Zdd„Zdd„ZdS )ÚDefaultJSONProvidera4  Provide JSON operations using Python's built-in :mod:`json`
    library. Serializes the following additional data types:

    -   :class:`datetime.datetime` and :class:`datetime.date` are
        serialized to :rfc:`822` strings. This is the same as the HTTP
        date format.
    -   :class:`uuid.UUID` is serialized to a string.
    -   :class:`dataclasses.dataclass` is passed to
        :func:`dataclasses.asdict`.
    -   :class:`~markupsafe.Markup` (or any object with a ``__html__``
        method) will call the ``__html__`` method to get a string.
    zt.Callable[[t.Any], t.Any]ÚdefaultTNzbool | NoneÚcompactr7   r   r   r   r   r   c                óÈ   — |                      d| j        ¦  «         |                      d| j        ¦  «         |                      d| j        ¦  «         t	          j        |fi |¤ŽS )aI  Serialize data as JSON to a string.

        Keyword arguments are passed to :func:`json.dumps`. Sets some
        parameter defaults from the :attr:`default`,
        :attr:`ensure_ascii`, and :attr:`sort_keys` attributes.

        :param obj: The data to serialize.
        :param kwargs: Passed to :func:`json.dumps`.
        rT   Úensure_asciiÚ	sort_keys)Ú
setdefaultrT   rW   rX   Újsonr   r   s      r   r   zDefaultJSONProvider.dumps¦   se   € ð 	×Ò˜) T¤\Ñ2Ô2Ð2Ø×Ò˜.¨$Ô*;Ñ<Ô<Ð<Ø×Ò˜+ t¤~Ñ6Ô6Ð6ÝŒz˜#Ð(Ð( Ð(Ð(Ð(r   r%   r&   c                ó&   — t          j        |fi |¤ŽS )z–Deserialize data as JSON from a string or bytes.

        :param s: Text or UTF-8 bytes.
        :param kwargs: Passed to :func:`json.loads`.
        )rZ   r)   r(   s      r   r)   zDefaultJSONProvider.loadsµ   s   € õ Œz˜!Ð&Ð&˜vÐ&Ð&Ð&r   r.   r   c                ó$  — |                       ||¦  «        }i }| j        €| j        j        s	| j        du r|                     dd¦  «         n|                     dd¦  «         | j                              | j        |fi |¤Ž› d�| j        ¬¦  «        S )	a�  Serialize the given arguments as JSON, and return a
        :class:`~flask.Response` object with it. The response mimetype
        will be "application/json" and can be changed with
        :attr:`mimetype`.

        If :attr:`compact` is ``False`` or debug mode is enabled, the
        output will be formatted to be easier to read.

        Either positional or keyword arguments can be given, not both.
        If no arguments are given, ``None`` is serialized.

        :param args: A single value to serialize, or multiple values to
            treat as a list to serialize.
        :param kwargs: Treat as a dict to serialize.
        NFÚindentr   Ú
separators)ú,ú:ú
r8   )r5   rU   r   ÚdebugrY   r:   r   r9   )r   r.   r   r   Ú	dump_argss        r   r;   zDefaultJSONProvider.response½   s­   € ð  ×(Ò(¨¨vÑ6Ô6ˆØ&(ˆ	àŒLÐ  T¤Y¤_Ð ¸¼ÈÐ9NÐ9NØ× Ò  ¨1Ñ-Ô-Ð-Ð-à× Ò  ¨zÑ:Ô:Ð:àŒy×'Ò'ØˆtŒz˜#Ð+Ð+ Ð+Ð+Ð/Ð/Ð/¸$¼-ð (ñ 
ô 
ð 	
r   r<   r=   r>   )r?   r@   rA   rB   ÚstaticmethodrQ   rT   Ú__annotations__rW   rX   rU   r9   r   r)   r;   rC   r   r   rS   rS   |   s¸   € € € € € € ðð ð +7¨,°xÑ*@Ô*@€GÐ@Ð@Ð@Ñ@ðð
 €Lðð
 €Iðð  €GÐÐÐÑðð
 "€HØ/ð)ð )ð )ð )ð'ð 'ð 'ð 'ð
ð 
ð 
ð 
ð 
ð 
r   rS   )rD   r   r   r   )Ú
__future__r   rL   rH   rZ   ÚtypingÚtrJ   r   Údatetimer   Úwerkzeug.httpr   ÚTYPE_CHECKINGÚwerkzeug.sansio.responser   Ú
sansio.appr   r
   rQ   rS   rC   r   r   ú<module>rn      s4  ðØ "Ð "Ð "Ð "Ð "Ð "à Ð Ð Ð Ø €€€Ø €€€Ø Ð Ð Ð Ø €€€Ø €€€Ø Ð Ð Ð Ð Ð à #Ð #Ð #Ð #Ð #Ð #à„?ð !Ø1Ð1Ð1Ð1Ð1Ð1à Ð Ð Ð Ð Ð ðVVð VVð VVð VVð VVñ VVô VVð VVðrSð Sð Sð Sð [
ð [
ð [
ð [
ð [
˜,ñ [
ô [
ð [
ð [
ð [
r   