§
    ùÛgr  ã                   ó�   — d Z ddlmZmZ ddlmZ ddlm	Z	 ddl
mZ  e¦   «         Zd„ Z G d„ d	e¦  «        Z G d
„ de¦  «        ZdS )z¿
    flask.wrappers
    ~~~~~~~~~~~~~~

    Implements the WSGI wrappers (request and response).

    :copyright: (c) 2015 by Armin Ronacher.
    :license: BSD, see LICENSE for more details.
é    )ÚRequestÚResponse)Ú
BadRequesté   )Újson)Ú_request_ctx_stackc                 óN   — t          | dd ¦  «        }|� ||¬¦  «        S | j        S )NÚget_data)Úcache)ÚgetattrÚdata)Úreqr   Úgetters      úD/granary/edev/quantum/lib/python3.11/site-packages/flask/wrappers.pyÚ	_get_datar      s3   € Ý�S˜* dÑ+Ô+€FØÐØˆv˜EÐ"Ñ"Ô"Ð"ØŒ8€Oó    c                   óº   — e Zd ZdZdZdZdZdZed„ ¦   «         Z	ed„ ¦   «         Z
ed„ ¦   «         Zed„ ¦   «         Zed„ ¦   «         Zed	„ ¦   «         Zdd„Zd„ Zd„ ZdS )r   aÎ  The request object used by default in Flask.  Remembers the
    matched endpoint and view arguments.

    It is what ends up as :class:`~flask.request`.  If you want to replace
    the request object used you can subclass this and set
    :attr:`~flask.Flask.request_class` to your subclass.

    The request object is a :class:`~werkzeug.wrappers.Request` subclass and
    provides all of the attributes Werkzeug defines plus a few Flask
    specific ones.
    NFc                 óF   — t           j        }|�|j        j        d         S dS )z8Read-only view of the ``MAX_CONTENT_LENGTH`` config key.NÚMAX_CONTENT_LENGTH)r   ÚtopÚappÚconfig)ÚselfÚctxs     r   Úmax_content_lengthzRequest.max_content_length>   s(   € õ !Ô$ˆØˆ?Ø”7”>Ð"6Ô7Ð7ð ˆ?r   c                 ó,   — | j         �| j         j        S dS )zêThe endpoint that matched the request.  This in combination with
        :attr:`view_args` can be used to reconstruct the same or a
        modified URL.  If an exception happened when matching, this will
        be ``None``.
        N)Úurl_ruleÚendpoint©r   s    r   r   zRequest.endpointE   s   € ð Œ=Ð$Ø”=Ô)Ð)ð %Ð$r   c                 ób   — ddl m}  |t          d¦  «        d¬¦  «         | j        r| j        S dS )z¥The name of the current module if the request was dispatched
        to an actual module.  This is deprecated functionality, use blueprints
        instead.
        r   ©ÚwarnzOmodules were deprecated in favor of blueprints.  Use request.blueprint instead.é   ©Ú
stacklevelN)Úwarningsr"   ÚDeprecationWarningÚ_is_old_moduleÚ	blueprint©r   r"   s     r   ÚmodulezRequest.moduleO   sc   € ð 	"Ð!Ð!Ð!Ð!Ð!ØˆÕð !+ñ ,ô ,à89ð	;ñ 	;ô 	;ð 	;ð Ôð 	"Ø”>Ð!ð	"ð 	"r   c                 ó€   — | j         r4d| j         j        v r(| j         j                             dd¦  «        d         S dS dS )z!The name of the current blueprintú.r   r   N)r   r   Úrsplitr   s    r   r)   zRequest.blueprint\   sM   € ð Œ=ð 	<˜S D¤MÔ$:Ð:Ð:Ø”=Ô)×0Ò0°°aÑ8Ô8¸Ô;Ð;ð	<ð 	<Ð:Ð:r   c                 ój   — ddl m}  |t          d¦  «        d¬¦  «         |                      ¦   «         S )zÇIf the mimetype is :mimetype:`application/json` this will contain the
        parsed JSON data.  Otherwise this will be ``None``.

        The :meth:`get_json` method should be used instead.
        r   r!   z,json is deprecated.  Use get_json() instead.r#   r$   )r&   r"   r'   Úget_jsonr*   s     r   r   zRequest.jsonb   sV   € ð 	"Ð!Ð!Ð!Ð!Ð!ØˆÕð !:ñ ;ô ;ØGHð	Jñ 	Jô 	Jð 	Jà�}Š}‰ŒÐr   c                 ó|   — | j         }|dk    rdS |                     d¦  «        r|                     d¦  «        rdS dS )zîIndicates if this request is JSON or not.  By default a request
        is considered to include JSON data if the mimetype is
        :mimetype:`application/json` or :mimetype:`application/*+json`.

        .. versionadded:: 0.11
        zapplication/jsonTzapplication/z+jsonF)ÚmimetypeÚ
startswithÚendswith)r   Úmts     r   Úis_jsonzRequest.is_jsonn   sM   € ð Œ]ˆØÐ#Ò#Ð#Ø�4Ø�=Š=˜Ñ(Ô(ð 	¨R¯[ª[¸Ñ-AÔ-Að 	Ø�4Øˆur   Tc                 ó„  — t          | dt          ¦  «        }|t          ur|S |s	| j        sdS | j                             d¦  «        }	 t          | |¦  «        }|�t          j        ||¬¦  «        }nt          j        |¦  «        }n1# t          $ r$}|rd}n|  	                    |¦  «        }Y d}~nd}~ww xY w|r|| _
        |S )aŒ  Parses the incoming JSON request data and returns it.  By default
        this function will return ``None`` if the mimetype is not
        :mimetype:`application/json` but this can be overridden by the
        ``force`` parameter. If parsing fails the
        :meth:`on_json_loading_failed` method on the request object will be
        invoked.

        :param force: if set to ``True`` the mimetype is ignored.
        :param silent: if set to ``True`` this method will fail silently
                       and return ``None``.
        :param cache: if set to ``True`` the parsed JSON data is remembered
                      on the request.
        Ú_cached_jsonNÚcharset)Úencoding)r   Ú_missingr6   Úmimetype_paramsÚgetr   r   ÚloadsÚ
ValueErrorÚon_json_loading_failedr8   )r   ÚforceÚsilentr   ÚrvÚrequest_charsetr   Úes           r   r0   zRequest.get_json}   sð   € õ �T˜>­8Ñ4Ô4ˆØ•XÐÐØˆIàð 	˜œð 	Ø�4ð Ô.×2Ò2°9Ñ=Ô=ˆð
	4Ý˜T 5Ñ)Ô)ˆDØÐ*Ý”Z ¨Ð?Ñ?Ô?��å”Z Ñ%Ô%�øøÝð 	4ð 	4ð 	4Øð 4Ø��à×0Ò0°Ñ3Ô3�øøøøøøøøøð		4øøøð
 ð 	#Ø "ˆDÔØˆ	s   Á=B Â
B4ÂB/Â/B4c                 ó¾   — t           j        }|�B|j        j                             dd¦  «        r"t          d                     |¦  «        ¦  «        ‚t          ¦   «         ‚)aÓ  Called if decoding of the JSON data failed.  The return value of
        this method is used by :meth:`get_json` when an error occurred.  The
        default implementation just raises a :class:`BadRequest` exception.

        .. versionchanged:: 0.10
           Removed buggy previous behavior of generating a random JSON
           response.  If you want that behavior back you can trivially
           add it by subclassing.

        .. versionadded:: 0.8
        NÚDEBUGFz!Failed to decode JSON object: {0})r   r   r   r   r=   r   Úformat)r   rE   r   s      r   r@   zRequest.on_json_loading_failed¦   sP   € õ !Ô$ˆØˆ?˜sœwœ~×1Ò1°'¸5ÑAÔAˆ?ÝÐ@×GÒGÈÑJÔJÑKÔKÐKÝ‰lŒlÐr   c                 ó¸   — t          j        | ¦  «         t          j        }|�1|j        j        r'| j        dk    r| j        sddlm	}  || ¦  «         d S d S d S d S d S )Nzmultipart/form-datar   )Úattach_enctype_error_multidict)
ÚRequestBaseÚ_load_form_datar   r   r   Údebugr2   ÚfilesÚdebughelpersrJ   )r   r   rJ   s      r   rL   zRequest._load_form_data·   s   € ÝÔ# DÑ)Ô)Ð)õ !Ô$ˆØˆ?˜sœwœ}ˆ?ØŒ=Ð1Ò1Ð1¸$¼*Ð1ØDÐDÐDÐDÐDÐDØ*Ð*¨4Ñ0Ô0Ð0Ð0Ð0ð ˆ?ˆ?ˆ?Ø1Ð1Ð1Ð1r   )FFT)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   Ú	view_argsÚrouting_exceptionr(   Úpropertyr   r   r+   r)   r   r6   r0   r@   rL   © r   r   r   r      s  € € € € € ð
ð 
ð" €Hð €Ið Ðð €Nàð8ð 8ñ „Xð8ð ð*ð *ñ „Xð*ð ð
"ð 
"ñ „Xð
"ð ð<ð <ñ „Xð<ð
 ð	ð 	ñ „Xð	ð ðð ñ „Xðð'ð 'ð 'ð 'ðRð ð ð"	1ð 	1ð 	1ð 	1ð 	1r   r   c                   ó   — e Zd ZdZdZdS )r   a·  The response object that is used by default in Flask.  Works like the
    response object from Werkzeug but is set to have an HTML mimetype by
    default.  Quite often you don't have to create this object yourself because
    :meth:`~flask.Flask.make_response` will take care of that for you.

    If you want to replace the response object used you can subclass this and
    set :attr:`~flask.Flask.response_class` to your subclass.
    z	text/htmlN)rP   rQ   rR   rS   Údefault_mimetyperW   r   r   r   r   Ã   s"   € € € € € ðð ð #ÐÐÐr   r   N)rS   Úwerkzeug.wrappersr   rK   r   ÚResponseBaseÚwerkzeug.exceptionsr   Ú r   Úglobalsr   Úobjectr;   r   rW   r   r   ú<module>r`      sá   ððð ð OÐ NÐ NÐ NÐ NÐ NÐ NÐ NØ *Ð *Ð *Ð *Ð *Ð *à Ð Ð Ð Ð Ð Ø 'Ð 'Ð 'Ð 'Ð 'Ð 'àˆ6‰8Œ8€ðð ð ðd1ð d1ð d1ð d1ð d1ˆkñ d1ô d1ð d1ðN	#ð 	#ð 	#ð 	#ð 	#ˆ|ñ 	#ô 	#ð 	#ð 	#ð 	#r   