§
    *" hq  ã                  ó@  — d dl m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	 ddl
mZ dd	l
mZ dd
l
mZ ddl
mZ ddlmZ ddlmZ ddlmZ ej        rddlmZ ddlmZ ddlmZ d*d„Z G d„ de¦  «        Z G d„ de¦  «        Zd+d„Zd,d#„Zd-d%„Zd.d'„Z d/d(„Z!d0d)„Z"dS )1é    )ÚannotationsN)Ú
BaseLoader)ÚEnvironment)ÚTemplate)ÚTemplateNotFoundé   )Ú_cv_app)Ú_cv_request)Úcurrent_app)Úrequest)Ústream_with_context)Úbefore_render_template)Útemplate_rendered)ÚFlask)ÚApp)ÚScaffoldÚreturnúdict[str, t.Any]c                 óž   — t          j        d¦  «        } t          j        d¦  «        }i }| �
| j        |d<   |�|j        |d<   |j        |d<   |S )zSDefault template context processor.  Injects `request`,
    `session` and `g`.
    NÚgr   Úsession)r	   Úgetr
   r   r   r   )ÚappctxÚreqctxÚrvs      úJc:\xampp_lite_8_4\www\timesheet\venv\Lib\site-packages\flask/templating.pyÚ_default_template_ctx_processorr      sY   € õ Œ[˜ÑÔ€FÝŒ_˜TÑ"Ô"€FØ€BØÐØ”(ˆˆ3‰ØÐØœˆˆ9‰Øœˆˆ9‰Ø€Ió    c                  ó   — e Zd ZdZd
d„Zd	S )r   zÌWorks like a regular Jinja2 environment but has some additional
    knowledge of how Flask's blueprint works so that it can prepend the
    name of the blueprint to referenced templates if necessary.
    Úappr   Úoptionsút.Anyr   ÚNonec                ón   — d|vr|                      ¦   «         |d<   t          j        | fi |¤Ž || _        d S )NÚloader)Úcreate_global_jinja_loaderÚBaseEnvironmentÚ__init__r    )Úselfr    r!   s      r   r(   zEnvironment.__init__-   sG   € Ø˜7Ð"Ð"Ø #× >Ò >Ñ @Ô @ˆG�HÑÝÔ  Ð1Ð1¨Ð1Ð1Ð1ØˆŒˆˆr   N)r    r   r!   r"   r   r#   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r(   © r   r   r   r   '   s2   € € € € € ðð ð
ð ð ð ð ð r   r   c                  óB   — 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S )ÚDispatchingJinjaLoaderz\A loader that looks for templates in the application and all
    the blueprint folders.
    r    r   r   r#   c                ó   — || _         d S ©N)r    )r)   r    s     r   r(   zDispatchingJinjaLoader.__init__9   s   € ØˆŒˆˆr   Úenvironmentr'   ÚtemplateÚstrú3tuple[str, str | None, t.Callable[[], bool] | None]c                ó~   — | j         j        d         r|                      ||¦  «        S |                      ||¦  «        S )NÚEXPLAIN_TEMPLATE_LOADING)r    ÚconfigÚ_get_source_explainedÚ_get_source_fast)r)   r3   r4   s      r   Ú
get_sourcez!DispatchingJinjaLoader.get_source<   sC   € ð Œ8Œ?Ð5Ô6ð 	EØ×-Ò-¨k¸8ÑDÔDÐDØ×$Ò$ [°(Ñ;Ô;Ð;r   c                ó"  — g }d }|                       |¦  «        D ]K\  }}	 |                     ||¦  «        }|€|}n# t          $ r d }Y nw xY w|                     |||f¦  «         ŒLddlm}  || j        ||¦  «         |�|S t          |¦  «        ‚)Nr   )Ú!explain_template_loading_attempts)Ú_iter_loadersr<   r   ÚappendÚdebughelpersr>   r    )	r)   r3   r4   ÚattemptsÚtrvÚsrcobjr%   r   r>   s	            r   r:   z,DispatchingJinjaLoader._get_source_explainedC   sÕ   € ð ˆàLPˆà"×0Ò0°Ñ:Ô:ð 	2ð 	2‰NˆF�FðØ×&Ò& {°HÑ=Ô=�Ø�;Ø�CøøÝ#ð ð ð Ø���ðøøøà�OŠO˜V V¨RÐ0Ñ1Ô1Ð1Ð1àCÐCÐCÐCÐCÐCà)Ð)¨$¬(°H¸hÑGÔGÐGàˆ?ØˆJÝ˜xÑ(Ô(Ð(s    ;»A
Á	A
c                ó¦   — |                       |¦  «        D ]-\  }}	 |                     ||¦  «        c S # t          $ r Y Œ*w xY wt          |¦  «        ‚r2   )r?   r<   r   )r)   r3   r4   Ú_srcobjr%   s        r   r;   z'DispatchingJinjaLoader._get_source_fast[   st   € ð  $×1Ò1°(Ñ;Ô;ð 	ð 	‰OˆG�VðØ×(Ò(¨°hÑ?Ô?Ð?Ð?Ð?øÝ#ð ð ð Ø�ðøøøå˜xÑ(Ô(Ð(s   œ4´
AÁ Aú't.Iterator[tuple[Scaffold, BaseLoader]]c              #  ó’   K  — | j         j        }|�| j         |fV — | j                              ¦   «         D ]}|j        }|�||fV — Œd S r2   )r    Újinja_loaderÚiter_blueprints)r)   r4   r%   Ú	blueprints       r   r?   z$DispatchingJinjaLoader._iter_loaderse   sp   è è € Ø”Ô&ˆØÐØ”(˜FÐ"Ð"Ð"Ð"àœ×1Ò1Ñ3Ô3ð 	(ð 	(ˆIØÔ+ˆFØÐ!Ø Ð'Ð'Ð'Ð'øð	(ð 	(r   ú	list[str]c                óH  — t          ¦   «         }| j        j        }|�'|                     |                     ¦   «         ¦  «         | j                             ¦   «         D ]7}|j        }|�,|                     ¦   «         D ]}|                     |¦  «         ŒŒ8t          |¦  «        S r2   )Úsetr    rI   ÚupdateÚlist_templatesrJ   ÚaddÚlist)r)   Úresultr%   rK   r4   s        r   rP   z%DispatchingJinjaLoader.list_templateso   s¡   € Ý‘”ˆØ”Ô&ˆØÐØ�MŠM˜&×/Ò/Ñ1Ô1Ñ2Ô2Ð2àœ×1Ò1Ñ3Ô3ð 	)ð 	)ˆIØÔ+ˆFØÐ!Ø &× 5Ò 5Ñ 7Ô 7ð )ð )�HØ—J’J˜xÑ(Ô(Ð(Ð(øå�F‰|Œ|Ðr   N)r    r   r   r#   )r3   r'   r4   r5   r   r6   )r4   r5   r   rG   )r   rL   )
r*   r+   r,   r-   r(   r<   r:   r;   r?   rP   r.   r   r   r0   r0   4   s–   € € € € € ðð ðð ð ð ð<ð <ð <ð <ð)ð )ð )ð )ð0)ð )ð )ð )ð(ð (ð (ð (ðð ð ð ð ð r   r0   r    r   r4   r   Úcontextr5   c                óÎ   — |                       |¦  «         t          j        | | j        ||¬¦  «         |                     |¦  «        }t          j        | | j        ||¬¦  «         |S ©N©Ú_async_wrapperr4   rT   )Úupdate_template_contextr   ÚsendÚensure_syncÚrenderr   )r    r4   rT   r   s       r   Ú_renderr]   ~   sz   € Ø×Ò Ñ(Ô(Ð(ÝÔØ˜CœO°hÈðñ ô ð ð 
�Š˜Ñ	!Ô	!€BÝÔØ˜CœO°hÈðñ ô ð ð €Ir   Útemplate_name_or_listú%str | Template | list[str | Template]r"   c                ó~   — t          j        ¦   «         }|j                             | ¦  «        }t	          |||¦  «        S )a  Render a template by name with the given context.

    :param template_name_or_list: The name of the template to render. If
        a list is given, the first name to exist will be rendered.
    :param context: The variables to make available in the template.
    )r   Ú_get_current_objectÚ	jinja_envÚget_or_select_templater]   ©r^   rT   r    r4   s       r   Úrender_templatere   Š   s:   € õ Ô
)Ñ
+Ô
+€CØŒ}×3Ò3Ð4IÑJÔJ€HÝ�3˜ 'Ñ*Ô*Ð*r   Úsourcec                ó~   — t          j        ¦   «         }|j                             | ¦  «        }t	          |||¦  «        S )zÓRender a template from the given source string with the given
    context.

    :param source: The source code of the template to render.
    :param context: The variables to make available in the template.
    )r   ra   rb   Úfrom_stringr]   ©rf   rT   r    r4   s       r   Úrender_template_stringrj   ™   s9   € õ Ô
)Ñ
+Ô
+€CØŒ}×(Ò(¨Ñ0Ô0€HÝ�3˜ 'Ñ*Ô*Ð*r   út.Iterator[str]c                óÀ   ‡ ‡‡— ‰                       ‰¦  «         t          j        ‰ ‰ j        ‰‰¬¦  «         dˆ ˆˆfd„} |¦   «         }t          rt          |¦  «        }|S )NrW   r   rk   c               3  ó|   •K  — ‰                      ‰¦  «        E d {V —† t          j        ‰ ‰ j        ‰‰¬¦  «         d S rV   )Úgenerater   rZ   r[   )r    rT   r4   s   €€€r   rn   z_stream.<locals>.generate­   s\   øè è € Ø×$Ò$ WÑ-Ô-Ð-Ð-Ð-Ð-Ð-Ð-Ð-ÝÔØ ¤¸(ÈGð	
ñ 	
ô 	
ð 	
ð 	
ð 	
r   )r   rk   )rY   r   rZ   r[   r   r   )r    r4   rT   rn   r   s   ```  r   Ú_streamro   ¥   s‘   øøø€ ð ×Ò Ñ(Ô(Ð(ÝÔØ˜CœO°hÈðñ ô ð ð
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ˆ‰Œ€Bõ ð %Ý  Ñ$Ô$ˆà€Ir   c                ó~   — t          j        ¦   «         }|j                             | ¦  «        }t	          |||¦  «        S )a“  Render a template by name with the given context as a stream.
    This returns an iterator of strings, which can be used as a
    streaming response from a view.

    :param template_name_or_list: The name of the template to render. If
        a list is given, the first name to exist will be rendered.
    :param context: The variables to make available in the template.

    .. versionadded:: 2.2
    )r   ra   rb   rc   ro   rd   s       r   Ústream_templaterq   ¼   s:   € õ Ô
)Ñ
+Ô
+€CØŒ}×3Ò3Ð4IÑJÔJ€HÝ�3˜ 'Ñ*Ô*Ð*r   c                ó~   — t          j        ¦   «         }|j                             | ¦  «        }t	          |||¦  «        S )aZ  Render a template from the given source string with the given
    context as a stream. This returns an iterator of strings, which can
    be used as a streaming response from a view.

    :param source: The source code of the template to render.
    :param context: The variables to make available in the template.

    .. versionadded:: 2.2
    )r   ra   rb   rh   ro   ri   s       r   Ústream_template_stringrs   Ï   s9   € õ Ô
)Ñ
+Ô
+€CØŒ}×(Ò(¨Ñ0Ô0€HÝ�3˜ 'Ñ*Ô*Ð*r   )r   r   )r    r   r4   r   rT   r   r   r5   )r^   r_   rT   r"   r   r5   )rf   r5   rT   r"   r   r5   )r    r   r4   r   rT   r   r   rk   )r^   r_   rT   r"   r   rk   )rf   r5   rT   r"   r   rk   )#Ú
__future__r   ÚtypingÚtÚjinja2r   r   r'   r   r   Úglobalsr	   r
   r   r   Úhelpersr   Úsignalsr   r   ÚTYPE_CHECKINGr    r   Ú
sansio.appr   Úsansio.scaffoldr   r   r0   r]   re   rj   ro   rq   rs   r.   r   r   ú<module>r~      s  ðØ "Ð "Ð "Ð "Ð "Ð "à Ð Ð Ð à Ð Ð Ð Ð Ð Ø 1Ð 1Ð 1Ð 1Ð 1Ð 1Ø Ð Ð Ð Ð Ð Ø #Ð #Ð #Ð #Ð #Ð #à Ð Ð Ð Ð Ð Ø  Ð  Ð  Ð  Ð  Ð  Ø  Ð  Ð  Ð  Ð  Ð  Ø Ð Ð Ð Ð Ð Ø (Ð (Ð (Ð (Ð (Ð (Ø +Ð +Ð +Ð +Ð +Ð +Ø &Ð &Ð &Ð &Ð &Ð &à„?ð *ØÐÐÐÐÐØÐÐÐÐÐØ)Ð)Ð)Ð)Ð)Ð)ðð ð ð ð
ð 
ð 
ð 
ð 
�/ñ 
ô 
ð 
ðGð Gð Gð Gð G˜Zñ Gô Gð GðT	ð 	ð 	ð 	ð+ð +ð +ð +ð	+ð 	+ð 	+ð 	+ðð ð ð ð.+ð +ð +ð +ð&+ð +ð +ð +ð +ð +r   