
    hI                     D   S r SSKrSSKrSSKrSSKrSSKJr  SSKJr  SSKJ	r	  SSKJ
r
  SSKJr  SSKJr  S	S
KJr  S	SKJr  S	SKJr  S	SKJr  S	SKJr  S	SKJr  S	SKJr  S	SKJr  S	SKJr  S	SKJr  S	SKJr  S	SKJr  S	SKJr  S	SKJr  S	SKJ r   S	SKJ!r!  S	SKJ"r"  S	SKJ#r#  S	SKJ$r$  S	SK%J&r&  S	SK%J'r'  S	SK%J(r(  S	S K%J)r)  S	S!K%J*r*  S	S"K+J,r,  S	S#K+J-r-  S	S$K+J.r.  S	S%KJ/r/  S	S&K0J1r1  S	S'K2J3r3  S	S(K2J4r4  S	S)K2J5r5  S	S*K6J7r7  S	S+K6J8r8  S	S,K6J9r9  S	S-K6J:r:  S	S.K6J;r;  S	S/K6J<r<  S	S0K6J=r=  \R|                  (       a  SSK?r@S	S1KAJBrB  S	S2KCJDrD  S	S3KEJFrF  \R                  " S4S5S69rH\" S7S89S9\R                  \H   S:\R                  S;\H4S< j5       rKS=\LS;\R                  \R                  \R                  S>\P4   S?4      4S@ jrQSA\R                  \R                  \R                  \R                  4      S;\R                  \R                  \R                  S>\P4   S?4      4SB jrRSCS5SD\R                  \R                  \P\R                  SE   4      S;\R                  \PSE4   4SF jrVSC\HS;\H4SG jrW " SH S55      rX " SI S?5      rY " SJ SK5      rZ " SL SM5      r[ " SN SO5      r\\Y\Xl]        g)PzKClasses for managing templates and their runtime and compile time
options.
    N)ChainMap)	lru_cache)partial)reduce)CodeType)Markup   )nodes)CodeGenerator)generate)BLOCK_END_STRING)BLOCK_START_STRING)COMMENT_END_STRING)COMMENT_START_STRING)DEFAULT_FILTERS)DEFAULT_NAMESPACE)DEFAULT_POLICIES)DEFAULT_TESTS)KEEP_TRAILING_NEWLINE)LINE_COMMENT_PREFIX)LINE_STATEMENT_PREFIX)LSTRIP_BLOCKS)NEWLINE_SEQUENCE)TRIM_BLOCKS)VARIABLE_END_STRING)VARIABLE_START_STRING)TemplateNotFound)TemplateRuntimeError)TemplatesNotFound)TemplateSyntaxError)UndefinedError	get_lexer)Lexer)TokenStream)EvalContext)Parser)Context)new_context)	Undefined)_PassArg)concat)consume)import_string)internalcodeLRUCache)missing)BytecodeCache)	Extension)
BaseLoader
_env_boundEnvironment)bound
   )maxsizeclsargsreturnc                     U " U6 nSUl         U$ )zReturn a new spontaneous environment. A spontaneous environment
is used for templates created directly rather than through an
existing environment.

:param cls: Environment class to create.
:param args: Positional arguments passed to environment.
T)shared)r;   r<   envs      J/var/www/auris/envauris/lib/python3.13/site-packages/jinja2/environment.pyget_spontaneous_environmentrB   D   s     t*CCJJ    sizezweakref.ref[t.Any]Templatec                 6    U S:X  a  gU S:  a  0 $ [        U 5      $ )z*Return the cache class for the given size.r   Nr0   )rD   s    rA   create_cacherG   R   s$     qyax	D>rC   cachec                 \    U c  g[        U 5      [        L a  0 $ [        U R                  5      $ )z(Create an empty copy of the given cache.N)typedictr1   capacity)rH   s    rA   
copy_cacherM   _   s,     }E{d	ENN##rC   environment
extensionsr4   c                     0 nU H]  n[        U[        5      (       a1  [        R                  " [        R                  S   [        U5      5      nU" U 5      X#R                  '   M_     U$ )zmLoad the extensions from the list and bind it to the environment.
Returns a dict of instantiated extensions.
r4   )
isinstancestrtcastTyper.   
identifier)rN   rO   result	extensions       rA   load_extensionsrY   l   sX     F	i%%qvvk2M)4LMI'0'=##$	   MrC   c                     [        U R                  [        5      (       d   S5       eU R                  U R                  s=:w  a  U R
                  :w  d    S5       e   S5       eU R                  S;   d   S5       eU $ )z*Perform a sanity check on the environment.z5'undefined' must be a subclass of 'jinja2.Undefined'.z<block, variable and comment start strings must be different.>   

z8'newline_sequence' must be one of '\n', '\r\n', or '\r'.)
issubclass	undefinedr*   block_start_stringvariable_start_stringcomment_start_stringnewline_sequence)rN   s    rA   _environment_config_checkrd   ~   s    y  ?>?  	&&,,	,++	,F F	F	,F F	F	, '' ,  F F	F 
 rC   c            /          \ rS rSr% SrSrSrSr\R                  S    \
S'   Sr\r\R                  S   \
S'   SR                  r\r\R                  \   \
S	'   \R                  S
   \
S'   \\\\\\\\\\\\SS\SSSSSSS4S\ S\ S\ S\ S\ S\ S\R                  \    S\R                  \    S\!S\!SSS\!S\RD                  \RF                  \ \R                  S   4      S\!S\R                  \   S \R                  \RH                  S!\RJ                  4      S"\RF                  \!\RH                  \R                  \    /\!4   4   S#\R                  S$   S%\&S&\!S'\R                  S(   S)\!4,S* jjr'S+\RF                  \ \R                  S   4   S,S4S- jr(S.\RJ                  S,S4S/ jr)\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*4S\ S\ S\ S\ S\ S\ S\R                  \    S\R                  \    S\!S\!SSS\!S\RD                  \RF                  \ \R                  S   4      S\!S\R                  \   S \R                  \RH                  S!\RJ                  4      S"\RF                  \!\RH                  \R                  \    /\!4   4   S#\R                  S$   S%\&S&\!S'\R                  S(   S)\!S,S04.S1 jjr+\,S,\-4S2 j5       r.S,\R^                  S   4S3 jr0S4\RJ                  S5\RF                  \ \RJ                  4   S,\RF                  \RJ                  \4   4S6 jr1S4\RJ                  S7\ S,\RJ                  4S8 jr2S9\RF                  \ \4   S:\RJ                  S;\R                  \RD                  \RJ                        S<\R                  \Rf                  \ \RJ                  4      S=\R                  \   S>\R                  \4   S?\!S,\RJ                  4S@ jr5    SoS9\ S:\RJ                  S;\R                  \RD                  \RJ                        S<\R                  \Rf                  \ \RJ                  4      S=\R                  \   S>\R                  \4   S,\RJ                  4SA jjr6    SoS9\ S:\RJ                  S;\R                  \RD                  \RJ                        S<\R                  \Rf                  \ \RJ                  4      S=\R                  \   S>\R                  \4   S,\RJ                  4SB jjr7\8  SpSC\ S9\R                  \    SD\R                  \    S,\9Rt                  4SE jj5       r;SC\ S9\R                  \    SD\R                  \    S,\9Rt                  4SF jr<  SpSC\ S9\R                  \    SD\R                  \    S,\R^                  \Rz                  \&\ \ 4      4SG jjr>  SpSC\ S9\R                  \    SD\R                  \    S,\ 4SH jjr?  SpSC\ S9\R                  \    SD\R                  \    SI\R                  \    S,\@4
SJ jjrA SqSC\9Rt                  S9\R                  \    SD\R                  \    SK\!S,\ 4
SL jjrBSC\ SD\ S,\C4SM jrD\ER                      SrSC\RF                  \ \9Rt                  4   S9\R                  \    SD\R                  \    SNSOSK\!S,\C4SP jj5       rG\ER                      SsSC\RF                  \ \9Rt                  4   S9\R                  \    SD\R                  \    SNSQSK\!S,\ 4SR jj5       rG\8    SrSC\RF                  \ \9Rt                  4   S9\R                  \    SD\R                  \    SN\!SK\!S,\RF                  \ \C4   4SS jj5       rG StSC\ ST\!S,SU4SV jjrH     SuSW\RF                  \ SX4   S\R                  \R                  \       SY\R                  \RH                  \ /\!4      SZ\R                  \    S[\R                  \RH                  \ /S4      S\\!S,S4S] jjrJ  SpS\R                  \R                  \       SY\R                  \RH                  \ /\!4      S,\R                  \    4S^ jjrLSvSC\R                  \    S,S_4S` jjrMSa\ Sb\ S,\ 4Sc jrN\8S9\ Sd\R                  \R                  \ \RJ                  4      S,S
4Se j5       rP\8  SpS9\RF                  \ S
4   Sb\R                  \    Sd\R                  \R                  \ \RJ                  4      S,S
4Sf jj5       rQ\8  SpSg\R                  \RF                  \ S
4      Sb\R                  \    Sd\R                  \R                  \ \RJ                  4      S,S
4Sh jj5       rS\8  SpSi\RF                  \ S
\R                  \RF                  \ S
4      4   Sb\R                  \    Sd\R                  \R                  \ \RJ                  4      S,S
4Sj jj5       rT  SpSC\RF                  \ \9Rt                  4   Sd\R                  \R                  \ \RJ                  4      S\R                  \R                  S
      S,S
4Sk jjrUSl\R                  \R                  \ \RJ                  4      S,\R                  \ \RJ                  4   4Sm jrVSnrWg)wr7      a8  The core component of Jinja is the `Environment`.  It contains
important shared variables like configuration, filters, tests,
globals and others.  Instances of this class may be modified if
they are not shared and if no template was loaded so far.
Modifications on environments after the first template was loaded
will lead to surprising effects and undefined behavior.

Here are the possible initialization parameters:

    `block_start_string`
        The string marking the beginning of a block.  Defaults to ``'{%'``.

    `block_end_string`
        The string marking the end of a block.  Defaults to ``'%}'``.

    `variable_start_string`
        The string marking the beginning of a print statement.
        Defaults to ``'{{'``.

    `variable_end_string`
        The string marking the end of a print statement.  Defaults to
        ``'}}'``.

    `comment_start_string`
        The string marking the beginning of a comment.  Defaults to ``'{#'``.

    `comment_end_string`
        The string marking the end of a comment.  Defaults to ``'#}'``.

    `line_statement_prefix`
        If given and a string, this will be used as prefix for line based
        statements.  See also :ref:`line-statements`.

    `line_comment_prefix`
        If given and a string, this will be used as prefix for line based
        comments.  See also :ref:`line-statements`.

        .. versionadded:: 2.2

    `trim_blocks`
        If this is set to ``True`` the first newline after a block is
        removed (block, not variable tag!).  Defaults to `False`.

    `lstrip_blocks`
        If this is set to ``True`` leading spaces and tabs are stripped
        from the start of a line to a block.  Defaults to `False`.

    `newline_sequence`
        The sequence that starts a newline.  Must be one of ``'\r'``,
        ``'\n'`` or ``'\r\n'``.  The default is ``'\n'`` which is a
        useful default for Linux and OS X systems as well as web
        applications.

    `keep_trailing_newline`
        Preserve the trailing newline when rendering templates.
        The default is ``False``, which causes a single newline,
        if present, to be stripped from the end of the template.

        .. versionadded:: 2.7

    `extensions`
        List of Jinja extensions to use.  This can either be import paths
        as strings or extension classes.  For more information have a
        look at :ref:`the extensions documentation <jinja-extensions>`.

    `optimized`
        should the optimizer be enabled?  Default is ``True``.

    `undefined`
        :class:`Undefined` or a subclass of it that is used to represent
        undefined values in the template.

    `finalize`
        A callable that can be used to process the result of a variable
        expression before it is output.  For example one can convert
        ``None`` implicitly into an empty string here.

    `autoescape`
        If set to ``True`` the XML/HTML autoescaping feature is enabled by
        default.  For more details about autoescaping see
        :class:`~markupsafe.Markup`.  As of Jinja 2.4 this can also
        be a callable that is passed the template name and has to
        return ``True`` or ``False`` depending on autoescape should be
        enabled by default.

        .. versionchanged:: 2.4
           `autoescape` can now be a function

    `loader`
        The template loader for this environment.

    `cache_size`
        The size of the cache.  Per default this is ``400`` which means
        that if more than 400 templates are loaded the loader will clean
        out the least recently used template.  If the cache size is set to
        ``0`` templates are recompiled all the time, if the cache size is
        ``-1`` the cache will not be cleaned.

        .. versionchanged:: 2.8
           The cache size was increased to 400 from a low 50.

    `auto_reload`
        Some loaders load templates from locations where the template
        sources may change (ie: file system or database).  If
        ``auto_reload`` is set to ``True`` (default) every time a template is
        requested the loader checks if the source changed and if yes, it
        will reload the template.  For higher performance it's possible to
        disable that.

    `bytecode_cache`
        If set to a bytecode cache object, this object will provide a
        cache for the internal Jinja bytecode so that templates don't
        have to be parsed if they were not changed.

        See :ref:`bytecode-cache` for more information.

    `enable_async`
        If set to true this enables async template execution which
        allows using async functions and generators.
FN	linked_tor   code_generator_class context_classrE   template_class Ti  r`   block_end_stringra   variable_end_stringrb   comment_end_stringline_statement_prefixline_comment_prefixtrim_blockslstrip_blocksrc   te.Literal['\n', '\r\n', '\r']keep_trailing_newlinerO   r4   	optimizedr_   finalize.
autoescapeloaderr5   
cache_sizeauto_reloadbytecode_cacher3   enable_asyncc                 &   Xl         X l        X0l        X@l        XPl        X`l        Xpl        Xl        Xl        Xl	        Xl
        Xl        Xl        Xl        UU l        UU l        [         R"                  " 5       U l        [&        R"                  " 5       U l        [*        R"                  " 5       U l        UU l        [1        U5      U l        UU l        UU l        [8        R"                  " 5       U l        [=        X5      U l        UU l         [C        U 5        g N)"r`   rm   ra   rn   rb   ro   rp   rq   rr   rs   rc   ru   r_   rv   rw   rx   r   copyfiltersr   testsr   globalsry   rG   rH   r|   r{   r   policiesrY   rO   is_asyncrd   )selfr`   rm   ra   rn   rb   ro   rp   rq   rr   rs   rc   ru   rO   rv   r_   rw   rx   ry   rz   r{   r|   r}   s                          rA   __init__Environment.__init__&  s    J #5 0%:"#6 $8!"4%:"#6 &* 0%:" -6" $ '++-"'')
(--/ !*-
,& )--/ *$;$!$'rC   rX   r=   c                 N    U R                   R                  [        X/5      5        g)zLAdds an extension after the environment was created.

.. versionadded:: 2.5
N)rO   updaterY   )r   rX   s     rA   add_extensionEnvironment.add_extensionr  s    
 	t[ABrC   
attributesc                 r    UR                  5        H#  u  p#[        X5      (       a  M  [        XU5        M%     g)zAdd the items to the instance of the environment if they do not exist
yet.  This is used by :ref:`extensions <writing-extensions>` to register
callbacks and configuration values without breaking inheritance.
N)itemshasattrsetattr)r   r   keyvalues       rA   extendEnvironment.extendy  s.    
 %**,JC4%%5) -rC   zte.Selfc                    [        [        5       5      nUS	 US	 US	 US	 [        R                  U R                  5      nUR
                  R                  U R
                  5        SUl        U Ul        UR                  5        H  u  nnU[        Ld  M  [        UUU5        M      U[        La  [        U5      Ul        O[        U R                  5      Ul        0 Ul        U R                  R                  5        H$  u  nnUR!                  U5      UR                  U'   M&     U[        La%  UR                  R                  [#        UU5      5        U[        La  UUl        ['        U5      $ )a  Create a new overlay environment that shares all the data with the
current environment except for cache and the overridden attributes.
Extensions cannot be removed for an overlayed environment.  An overlayed
environment automatically gets all the extensions of the environment it
is linked to plus optional extra extensions.

Creating overlays should happen after the initial environment was set
up completely.  Not all attributes are truly linked, some are just
copied over so modifications on the original environment may not shine
through.

.. versionchanged:: 3.1.5
    ``enable_async`` is applied correctly.

.. versionchanged:: 3.1.2
    Added the ``newline_sequence``, ``keep_trailing_newline``,
    and ``enable_async`` parameters to match ``__init__``.
r   rz   rO   r}   T)rK   localsobject__new__	__class____dict__r   	overlayedrg   r   r2   r   rG   rH   rM   rO   bindrY   r   rd   )r   r`   rm   ra   rn   rb   ro   rp   rq   rr   rs   rc   ru   rO   rv   r_   rw   rx   ry   rz   r{   r|   r}   r<   rvr   r   s                              rA   overlayEnvironment.overlay  s#   V FH~L$|,d<.@$~BV^^DNN+
4==)**,JCG#C' ' W$#J/BH!$**-BH////1JC!&BBMM# 2W$MM  Z!@Aw&&BK(,,rC   c                     [        U 5      $ )zThe lexer for this environment.r"   r   s    rA   lexerEnvironment.lexer  s     rC   c                 Z    [        [        U R                  R                  5       S S95      $ )z)Iterates over the extensions by priority.c                     U R                   $ r   )priorityxs    rA   <lambda>-Environment.iter_extensions.<locals>.<lambda>  s    1::rC   )r   )itersortedrO   valuesr   s    rA   iter_extensionsEnvironment.iter_extensions  s"    F4??1139MNOOrC   objargumentc                      X   $ ! [         [        [        4 aa    [        U[        5      (       a:   [	        U5      n [        X5      s $ ! [          a     Of = f! [         a     Of = fU R                  XS9s $ f = f)z:Get an item or attribute of an object but prefer the item.r   name)AttributeError	TypeErrorLookupErrorrQ   rR   getattr	Exceptionr_   )r   r   r   attrs       rA   getitemEnvironment.getitem  s    	:= 	;7 	:(C((x=D&s11)  !  >>c>99	:sO    *A<A
A
A<

AA<AA<
A'$A<&A''A<;A<	attributec                      [        X5      $ ! [         a     Of = f X   $ ! [        [        [        4 a    U R	                  XS9s $ f = f)zyGet an item or attribute of an object but prefer the attribute.
Unlike :meth:`getitem` the attribute *must* be a string.
r   )r   r   r   r   r_   )r   r   r   s      rA   r   Environment.getattr  sX    	3** 			;>!;7 	;>>c>::	;s   
 
" $A	A	r   r   r<   kwargscontexteval_ctx	is_filterc                    U(       a  U R                   nSn	OU R                  nSn	UR                  U5      n
U
c;  SU	 SU< S3n[        U[        5      (       a   UR                  5         [        U5      eU/Ub  UOSQnUb  UO0 n[        R                  " U
5      nU[        R                  L a%  Uc  [        S	U	 S
35      eUR                  SU5        OiU[        R                  L a1  Uc  Ub  UR                  nO[        U 5      nUR                  SU5        O%U[        R                  L a  UR                  SU 5        U
" U0 UD6$ ! [         a  nU SU S3n S nANS nAff = f)NfiltertestzNo z named .z (z-; did you forget to quote the callable name?)rl   zAttempted to invoke a context z without context.r   )r   r   getrQ   r*   _fail_with_undefined_errorr   r   r+   from_objr   inserteval_contextr   r&   rN   )r   r   r   r<   r   r   r   r   env_map	type_namefuncmsgepass_args                 rA   _filter_test_commonEnvironment._filter_test_common  ss    llG IjjGI{{4 <	{'$3C$	**U335 's++;!1r;!-2$$T*x'''*4YK?PQ  KK7#...&&//H*40HKK8$---KK4 T$V$$7 ! U EA3&STCUs   E 
E EE c           	      *    U R                  XX4XVS5      $ )a  Invoke a filter on a value the same way the compiler does.

This might return a coroutine if the filter is running from an
environment in async mode and the filter supports async
execution. It's your responsibility to await this if needed.

.. versionadded:: 2.7
Tr   r   r   r   r<   r   r   r   s          rA   call_filterEnvironment.call_filter(  s     " ''w$
 	
rC   c           	      *    U R                  XX4XVS5      $ )a  Invoke a test on a value the same way the compiler does.

This might return a coroutine if the test is running from an
environment in async mode and the test supports async execution.
It's your responsibility to await this if needed.

.. versionchanged:: 3.0
    Tests support ``@pass_context``, etc. decorators. Added
    the ``context`` and ``eval_ctx`` parameters.

.. versionadded:: 2.7
Fr   r   s          rA   	call_testEnvironment.call_test=  s     * ''w%
 	
rC   sourcefilenamec                 f     U R                  XU5      $ ! [         a    U R                  US9   gf = f)aj  Parse the sourcecode and return the abstract syntax tree.  This
tree of nodes is used by the compiler to convert the template into
executable source- or bytecode.  This is useful for debugging or to
extract information from templates.

If you are :ref:`developing Jinja extensions <writing-extensions>`
this gives you a good overview of the node tree generated.
r   N)_parser    handle_exceptionr   r   r   r   s       rA   parseEnvironment.parseV  s8    	1;;vX66" 	1!!!0	1s    00c                 6    [        XX#5      R                  5       $ )z8Internal parsing function used by `parse` and `compile`.)r'   r   r   s       rA   r   Environment._parsej  s     dD399;;rC   c                     [        U5      n U R                  R                  XU5      $ ! [         a    U R	                  US9   gf = f)a  Lex the given sourcecode and return a generator that yields
tokens as tuples in the form ``(lineno, token_type, value)``.
This can be useful for :ref:`extension development <writing-extensions>`
and debugging templates.

This does not perform preprocessing.  If you want the preprocessing
of the extensions to be applied you have to filter source through
the :meth:`preprocess` method.
r   N)rR   r   	tokeniterr    r   r   s       rA   lexEnvironment.lexp  sI     V	1::''h??" 	1!!!0	1s   ) AAc                 X   ^^ [        UU4S jU R                  5       [        U5      5      $ )zPreprocesses the source with all extensions.  This is automatically
called for all parsing and compiling methods but *not* for :meth:`lex`
because there you usually only want the actual source tokenized.
c                 *   > UR                  U TT5      $ r   )
preprocess)sr   r   r   s     rA   r   (Environment.preprocess.<locals>.<lambda>  s    ax8rC   )r   r   rR   r   s     ``rA   r   Environment.preprocess  s(     8  "K
 	
rC   statec                     U R                  XU5      nU R                  R                  XX45      nU R                  5        H7  nUR	                  U5      n[        U[        5      (       a  M+  [        XRU5      nM9     U$ )zCalled by the parser to do the preprocessing and filtering
for all the extensions.  Returns a :class:`~jinja2.lexer.TokenStream`.
)r   r   tokenizer   filter_streamrQ   r%   )r   r   r   r   r   streamexts          rA   	_tokenizeEnvironment._tokenize  sm     x8$$V8C'')C&&v.Ffk22$V8<	 * rC   
defer_initc           	      2    [        UU UUUU R                  S9$ )zdInternal hook that can be overridden to hook a different generate
method in.

.. versionadded:: 2.5
)r   rv   )r   rv   )r   r   r   r   r   s        rA   	_generateEnvironment._generate  s'     !nn
 	
rC   c                     [        XS5      $ )zcInternal hook that can be overridden to hook a different compile
method in.

.. versionadded:: 2.5
exec)compile)r   r   r   s      rA   _compileEnvironment._compile  s     v00rC   rawzte.Literal[False]c                     g r   rl   r   r   r   r   r  r   s         rA   r  Environment.compile  s     rC   zte.Literal[True]c                     g r   rl   r  s         rA   r  r    s     rC   c                     Sn [        U[        5      (       a  UnU R                  XU5      nU R                  XX5S9nU(       a  U$ Uc  SnU R	                  X5      $ ! [
         a    U R                  US9   gf = f)a"  Compile a node or template source code.  The `name` parameter is
the load name of the template after it was joined using
:meth:`join_path` if necessary, not the filename on the file system.
the `filename` parameter is the estimated filename of the template on
the file system.  If the template came from a database or memory this
can be omitted.

The return value of this method is a python code object.  If the `raw`
parameter is `True` the return value will be a string with python
code equivalent to the bytecode returned otherwise.  This method is
mainly used internally.

`defer_init` is use internally to aid the module code generator.  This
causes the generated code to be able to import without the global
environment variable to be set.

.. versionadded:: 2.4
   `defer_init` parameter added.
N)r   z
<template>r   )rQ   rR   r   r   r  r    r   )r   r   r   r   r  r   source_hints          rA   r  r    s    8 	6&#&&$V8<^^F(^RF'==22" 	6!!!5	6s   AA A A87A8undefined_to_noneTemplateExpressionc                    [        XSS9n UR                  5       nUR                  R                  (       d,  [	        SUR                  R
                  R                  SS5      eUR                  U 5        [        R                  " [        R                  " SS5      WSS	9/nU R                  [        R                  " USS	95      n[        Xb5      $ ! [         a    U R                  US9   Nvf = f)
a  A handy helper method that returns a callable that accepts keyword
arguments that appear as variables in the expression.  If called it
returns the result of the expression.

This is useful if applications want to use the same rules as Jinja
in template "configuration files" or similar situations.

Example usage:

>>> env = Environment()
>>> expr = env.compile_expression('foo == 42')
>>> expr(foo=23)
False
>>> expr(foo=42)
True

Per default the return value is converted to `None` if the
expression returns an undefined value.  This can be changed
by setting `undefined_to_none` to `False`.

>>> env.compile_expression('var')() is None
True
>>> env.compile_expression('var', undefined_to_none=False)()
Undefined

.. versionadded:: 2.1
variable)r   zchunk after expressionNr   rW   storer	   )lineno)r'   parse_expressionr   eosr    currentr  set_environmentr   r
   AssignNamefrom_stringrE   r  )r   r   r  parserexprbodytemplates          rA   compile_expressionEnvironment.compile_expression  s    < J7	1**,D==$$),fmm.C.C.J.JDRV    & UZZ':DKL##ENN4$BC!(>> # 	1!!!0	1s   A(C C+*C+targetzos.PathLike[str]filter_funcziplog_functionignore_errorsc           	      \  ^^^^ SSK Jn  Uc  S[        SS4S jnUc   eU R                  c   S5       eS[        S	[        SS4UUUU4S
 jjnTb9  SSKJn	  SSKJn
  SSKJn  SSKJm  U" TS[        XS9T   5      mU" ST< 35        OF[        R                  R                  T5      (       d  [        R                  " T5        U" ST< 35         U R                  X#5       H^  nU R                  R                  X5      u  pn U R!                  XUSS5      nUR%                  U5      nU" UU5        U" SU SU 35        M`     T(       a  TR'                  5         U" S5        g! ["         a!  nU(       d  e U" SU SU 35         SnAM  SnAff = f! T(       a  TR'                  5         f f = f)a  Finds all the templates the loader can find, compiles them
and stores them in `target`.  If `zip` is `None`, instead of in a
zipfile, the templates will be stored in a directory.
By default a deflate zip algorithm is used. To switch to
the stored algorithm, `zip` can be set to ``'stored'``.

`extensions` and `filter_func` are passed to :meth:`list_templates`.
Each template returned will be compiled to the target folder or
zipfile.

By default template compilation errors are ignored.  In case a
log function is provided, errors are logged.  If you want template
syntax errors to abort the compilation you can set `ignore_errors`
to `False` and you will get an exception on syntax errors.

.. versionadded:: 2.4
r	   )ModuleLoaderNr   r=   c                     g r   rl   r   s    rA   r!  3Environment.compile_templates.<locals>.log_functionP  s    rC   No loader configured.r   datac                   > T(       a!  T" U 5      nSUl         TR                  X!5        g [        [        R                  R                  TU 5      S5       nUR                  UR                  S5      5        S S S 5        g ! , (       d  f       g = f)Ni  wbutf8)external_attrwritestropenospathjoinwriteencode)r   r(  infofZipInfor  r   zip_files       rA   
write_file1Environment.compile_templates.<locals>.write_fileV  sc    x(%0"!!$-"'',,vx8$?1GGDKK/0 @??s   !A>>
Br   )ZIP_DEFLATED)
ZIP_STORED)ZipFile)r6  w)deflatedstoredzCompiling into Zip archive zCompiling into folder TzCould not compile "z": z
Compiled "z" as zFinished compiling templates)loadersr$  rR   ry   zipfiler:  r;  r<  r6  rK   r/  r0  isdirmakedirslist_templates
get_sourcer  r    get_module_filenameclose)r   r  rO   r  r   r!  r"  r$  r8  r:  r;  r<  r   r   r   _coder   r6  r7  s    `  `             @@rA   compile_templatesEnvironment.compile_templates2  s   4 	*   '''{{&?(??&	1 	1C 	1D 	1 	1 ?,*''T<KCPH 6vjAB77==((F#1&<=	!++JD&*kk&<&<T&H#!<<hdKD (;;DA8T*z$uXJ?@ E  34 + ( #6tfCs!CD	   s6   2F E#,F #
F-F	F 	FF F+c                    ^ U R                   c   S5       eU R                   R                  5       nTb"  Ub  [        S5      eS[        S[        4U4S jjnUb   U Vs/ s H  oB" U5      (       d  M  UPM     nnU$ s  snf )aR  Returns a list of templates for this environment.  This requires
that the loader supports the loader's
:meth:`~BaseLoader.list_templates` method.

If there are other files in the template folder besides the
actual templates, the returned list can be filtered.  There are two
ways: either `extensions` is set to a list of file extensions for
templates, or a `filter_func` can be provided which is a callable that
is passed a template name and should return `True` if it should end up
in the result list.

If the loader does not support that, a :exc:`TypeError` is raised.

.. versionadded:: 2.4
r'  z<either extensions or filter_func can be passed, but not bothr   r=   c                 L   > SU ;   =(       a    U R                  SS5      S   T;   $ )Nr   r	   )rsplit)r   rO   s    rA   r  /Environment.list_templates.<locals>.filter_func  s'    axEAHHS!$4Q$7:$EErC   )ry   rD  r   rR   bool)r   rO   r  namesr   s    `   rA   rD  Environment.list_templates  s    ( {{&?(??&**,!&R Fs Ft F "&+Aed{4/@TeEA Bs   A:0A:zte.NoReturnc                     SSK Jn  U" US9e)zException handling helper.  This is used internally to either raise
rewritten exceptions or return a rendered traceback for the template.
r	   )rewrite_traceback_stackr   )debugrT  )r   r   rT  s      rA   r   Environment.handle_exception  s     	3%V44rC   r  parentc                     U$ )ab  Join a template with the parent.  By default all the lookups are
relative to the loader root so this method returns the `template`
parameter unchanged, but if the paths should be relative to the
parent template, this function can be used to calculate the real
template name.

Subclasses may override this method and implement template path
joining here.
rl   )r   r  rW  s      rA   	join_pathEnvironment.join_path  s	     rC   r   c                    U R                   c  [        S5      e[        R                  " U R                   5      U4nU R                  bd  U R                  R                  U5      nUbF  U R                  (       a  UR                  (       a$  U(       a  UR                  R                  U5        U$ U R                   R                  XU R                  U5      5      nU R                  b  X@R                  U'   U$ )Nz(no loader for this environment specified)ry   r   weakrefrefrH   r   r{   is_up_to_dater   r   loadmake_globals)r   r   r   	cache_keyr  s        rA   _load_templateEnvironment._load_template  s     ;;FGG[[-t4	::!zz~~i0H#$$(>(> $$++G4;;##D0A0A'0JK::!$,JJy!rC   c                 z    [        U[        5      (       a  U$ Ub  U R                  X5      nU R                  X5      $ )a  Load a template by name with :attr:`loader` and return a
:class:`Template`. If the template does not exist a
:exc:`TemplateNotFound` exception is raised.

:param name: Name of the template to load. When loading
    templates from the filesystem, "/" is used as the path
    separator, even on Windows.
:param parent: The name of the parent template importing this
    template. :meth:`join_path` can be used to implement name
    transformations with this.
:param globals: Extend the environment :attr:`globals` with
    these extra variables available for all renders of this
    template. If the template has already been loaded and
    cached, its globals are updated with any new items.

.. versionchanged:: 3.0
    If a template is loaded from cache, ``globals`` will update
    the template's globals instead of ignoring the new values.

.. versionchanged:: 2.4
    If ``name`` is a :class:`Template` object it is returned
    unchanged.
)rQ   rE   rY  rb  )r   r   rW  r   s       rA   get_templateEnvironment.get_template  s;    < dH%%K>>$/D""411rC   rQ  c                 @   [        U[        5      (       a  UR                  5         U(       d	  [        SS9eU HB  n[        U[        5      (       a  Us  $ Ub  U R                  XB5      n U R                  XC5      s  $    [        U5      e! [        [        4 a     Md  f = f)aH  Like :meth:`get_template`, but tries loading multiple names.
If none of the names can be loaded a :exc:`TemplatesNotFound`
exception is raised.

:param names: List of template names to try loading in order.
:param parent: The name of the parent template importing this
    template. :meth:`join_path` can be used to implement name
    transformations with this.
:param globals: Extend the environment :attr:`globals` with
    these extra variables available for all renders of this
    template. If the template has already been loaded and
    cached, its globals are updated with any new items.

.. versionchanged:: 3.0
    If a template is loaded from cache, ``globals`` will update
    the template's globals instead of ignoring the new values.

.. versionchanged:: 2.11
    If ``names`` is :class:`Undefined`, an :exc:`UndefinedError`
    is raised instead. If no templates were found and ``names``
    contains :class:`Undefined`, the message is more helpful.

.. versionchanged:: 2.4
    If ``names`` contains a :class:`Template` object it is
    returned unchanged.

.. versionadded:: 2.3
z0Tried to select from an empty list of templates.)message)	rQ   r*   r   r   rE   rY  rb  r   r!   )r   rQ  rW  r   r   s        rA   select_templateEnvironment.select_template  s    F eY'',,.#J  D$))!~~d3**499   && %n5 s   )B		BBtemplate_name_or_listc                     [        U[        [        45      (       a  U R                  XU5      $ [        U[        5      (       a  U$ U R                  XU5      $ )zUse :meth:`select_template` if an iterable of template names
is given, or :meth:`get_template` if one name is given.

.. versionadded:: 2.3
)rQ   rR   r*   re  rE   ri  )r   rk  rW  r   s       rA   get_or_select_template"Environment.get_or_select_template0  sS     +c9-=>>$$%:GLL-x88((##$97KKrC   c                     U R                  U5      nU=(       d    U R                  nUR                  X R                  U5      US5      $ )a  Load a template from a source string without using
:attr:`loader`.

:param source: Jinja source to compile into a template.
:param globals: Extend the environment :attr:`globals` with
    these extra variables available for all renders of this
    template. If the template has already been loaded and
    cached, its globals are updated with any new items.
:param template_class: Return an instance of this
    :class:`Template` class.
N)r`  rk   	from_coder  )r   r   r   rk   gsr;   s         rA   r  Environment.from_stringD  s@    " w'3 3 3}}T<<#7TBBrC   dc                 6    Uc  0 n[        XR                  5      $ )a  Make the globals map for a template. Any given template
globals overlay the environment :attr:`globals`.

Returns a :class:`collections.ChainMap`. This allows any changes
to a template's globals to only affect that template, while
changes to the environment's globals are still reflected.
However, avoid modifying any globals after a template is loaded.

:param d: Dict of template-specific globals.

.. versionchanged:: 3.0
    Use :class:`collections.ChainMap` to always prevent mutating
    environment globals.
)r   r   )r   rs  s     rA   r`  Environment.make_globalsY  s    " 9A<<((rC   )r{   rx   rm   r`   r|   rH   ro   rb   rO   r   rw   r   r   ru   rq   rp   ry   rs   rc   rv   r   r   rr   r_   rn   ra   )NNNN)NN)F)NNFF)NN.F)T)NNr>  NTr   )X__name__
__module____qualname____firstlineno____doc__	sandboxedr   rg   rS   Optional__annotations__r?   r   rh   rU   r1  r,   r(   rj   r   r   r   r   r   r   r   r   r   r   r   r   r*   rR   rP  SequenceUnionCallableAnyintr   r   r   r2   r   propertyr$   r   Iteratorr   r   r   Mappingr&   r   r   r   r/   r
   rE   r   r   Tupler   r   r%   r   r   r   r  typingoverloadr  r  
CollectionrJ  ListrD  r   rY  MutableMappingrb  re  Iterableri  rm  r  r`  __static_attributes__rl   rC   rA   r7   r7      sM   wz I I ,0Iqzz-(/ F 5B!&&1AWWF &-M166'?,FF:&& #5 0%:#6$8"41F/B'+AQ&;DF'07;IN+/ 6:"/J(J( J(  #	J(
 !J( "J(  J(  !zz#J( ZZ_J( J( J( ?J(  $J( JJqwwsAFF;,?'?@AJ( J(  66)$!J(" **QZZQUU
34#J($ GGD!**ajjo->-D"EEF%J(& 

<('J(( )J(* +J(, 

?3-J(. /J(XCqwwsAFF;4G/G'H CT C*155 *T * #* '%,#*$+")18/6#%AH&-DK!'.7>IP+2!#6=$/E-E- E-  #	E-
 !E- "E-  E-  !zz#E- ZZ_E- E- E- ?E-  $E- JJqwwsAFF;,?'?@AE- E-  66)$!E-" **QZZQUU
34#E-$ GGD!**ajjo->-D"EEF%E-& 

<('E-( )E-* +E-, 

?3-E-. /E-0 
1E-N u  PK!8 P:55:$%GGCJ$7:	
	!	":&;155 ;S ;QUU ;4%ggc9n%4% uu4% jjAEE*+	4%
 

199S!%%Z014% G$4% **[)4% 4% 
4%t /348'+,0

 uu
 jjAEE*+	

 

199S!%%Z01
 G$
 **[)
 

2 /348'+,0

 uu
 jjAEE*+	

 

199S!%%Z01
 G$
 **[)
 

2  !%$(	11 jjo1 **S/	1
 
1 1&<<!"C<<=JJsO<	< !%$(	11 jjo1 **S/	1
 
AGGCcM*	+10 !%$(	

 jjo
 **S/	

 

( %)!% jjo **S/	
 zz# 
4 !

 jjo
 **S/	

 
 

*1s 1c 1h 1 __ !%$(#( U^^+, jjo **S/	
 !  
  __ !%$("% U^^+, jjo **S/	
    
   !%$( '6U^^+,'6 jjo'6 **S/	'6
 '6 '6 
h	'6 '6T 6:+?+?.2+?	+?` 59;?)<@"O5//0O5 JJq||C01O5 ZZ

C5$; 78	O5
 ZZ_O5 jjSE4K!89O5 O5 
O5f 59;?#JJq||C01# ZZ

C5$; 78# 
	#J5qzz# 5- 5
# 
s 
s 
 "#**Q-=-=c155j-I"J	 0  #'<@	"2ggc:o&"2 

3"2 A,,S!%%Z89	"2
 
"2 "2H  #'<@	3'zz!''#z/233' 

33' A,,S!%%Z89	3'
 
3' 3'j  #'<@L wwQVVAGGCO$<== 
L
 

3L A,,S!%%Z89L 
L L, =A9=	CU^^+,C A,,S!%%Z89C 

166*#56	C
 
C*)A,,S!%%Z89)	
		#quu*	%)rC   c            )       D
   \ rS rSr% Sr\r\R                  \   \	S'   \\	S'   \R                  \\R                  4   \	S'   \R                  \   \	S'   \R                  \   \	S'   \R                  \\R                  \/\R"                  \   4   4   \	S'   \R                  \/\R"                  \   4   \	S	'   \R                  S
   \	S'   \\	S'   \R                  \R                  / \4      \	S'   \\\\\\\\\\\\SS\SSS4S\R@                  \\!RD                  4   S\S\S\S\S\S\S\R                  \   S\R                  \   S\S\SSS\S \RF                  \R@                  \\R                  S!   4      S"\S#\R                  \   S$\R                  \R                  S%\R                  4      S&\R@                  \\R                  \R                  \   /\4   4   S'\S(\R                  4(S) jjr$\% SIS\S*\&S\R                  \\R                  4   S+\R                  \R                  / \4      S(S 4
S, jj5       r'\%S\S-\R                  \\R                  4   S\R                  \\R                  4   S(S 4S. j5       r(\%S\S/\R                  \\R                  4   S\R                  \\R                  4   S(S 4S0 j5       r)S1\R                  S2\R                  S(\4S3 jr*S1\R                  S2\R                  S(\4S4 jr+S1\R                  S2\R                  S(S54S6 jr,S1\R                  S2\R                  S(\R"                  \   4S7 jr-S1\R                  S2\R                  S(\R\                  \\/4   4S8 jr0   SJS9\R                  \R                  \\R                  4      S:\S;\R                  \Rb                  \\R                  4      S(\4S< jjr2   SJS9\R                  \R                  \\R                  4      S:\S;\R                  \Rb                  \\R                  4      S(S
4S= jjr3   SJS9\R                  \R                  \\R                  4      S:\S;\R                  \Rb                  \\R                  4      S(S
4S> jjr4\5SIS?\R                  \   S(S
4S@ jj5       r6 SIS?\R                  \   S(S
4SA jjr7\8SKSB j5       r9SC\:S(\:4SD jr;\8S(\4SE j5       r<\8S(\Rz                  \R|                  \:\:4      4SF j5       r?S(\4SG jr@SHrAg)LrE   ip  aC  A compiled template that can be rendered.

Use the methods on :class:`Environment` to create or load templates.
The environment is used to configure how templates are compiled and
behave.

It is also possible to create a template object directly. This is
not usually recommended. The constructor takes most of the same
arguments as :class:`Environment`. All templates created with the
same environment arguments share the same ephemeral ``Environment``
instance behind the scenes.

A template object should be considered immutable. Modifications on
the object are not supported.
environment_classrN   r   r   r   blocksroot_render_funcTemplateModule_module_debug_info	_uptodaterl   TNFr   r`   rm   ra   rn   rb   ro   rp   rq   rr   rs   rc   rt   ru   rO   r4   rv   r_   rw   .rx   r}   r=   c                     [        U R                  UUUUUUUU	U
UUU[        U5      UUUUS SSS U5      nUR                  XS9$ )Nr   F)rk   )rB   r  	frozensetr  )r;   r   r`   rm   ra   rn   rb   ro   rp   rq   rr   rs   rc   ru   rO   rv   r_   rw   rx   r}   r@   s                        rA   r   Template.__new__  sq    , *!!! !!j!/
2 v::rC   rI  uptodatec                 h    XR                   S.n[        X%5        U R                  XU5      nXFl        U$ )zCreates a template object from compiled code and the globals.  This
is used by the loaders and environment to create a template object.
)rN   __file__)co_filenamer   _from_namespacer  )r;   rN   rI  r   r  	namespacer   s          rA   rp  Template.from_code  s6     %0=M=MN	T  A	rC   module_dictc                 &    U R                  XU5      $ )zCreates a template object from a module.  This is used by the
module loader to create a template object.

.. versionadded:: 2.4
)r  )r;   rN   r  r   s       rA   from_module_dictTemplate.from_module_dict  s     "";WEErC   r  c                     [         R                  U 5      nXl        X4l        US   Ul        US   Ul        US   Ul        US   Ul        S Ul        US   Ul	        S Ul
        XS'   XBS'   U$ )Nr   r  r  root
debug_inforN   __jinja_template__)r   r   rN   r   r   r   r  r  r  r  r  )r;   rN   r  r   rS   s        rA   r  Template._from_namespace  s     nnS)#	6"z*
X& 'v.	 ",/ $/- *+&'rC   r<   r   c                 `   U R                   R                  (       a%  SSKnUR                  U R                  " U0 UD65      $ U R                  [        U0 UD65      n U R                   R                  U R                  U5      5      $ ! [         a    U R                   R                  5          gf = f)a]  This method accepts the same arguments as the `dict` constructor:
A dict, a dict subclass or some keyword arguments.  If no arguments
are given the context will be empty.  These two calls do the same::

    template.render(knights='that say nih')
    template.render({'knights': 'that say nih'})

This will return the rendered template as a string.
r   N)rN   r   asynciorunrender_asyncr)   rK   r,   r  r   r   )r   r<   r   r  ctxs        rA   renderTemplate.render  s     $$;;t00$A&ABBtT4V45	0##**4+@+@+EFF 	0--/	0s   )B $B-,B-c                 l  #    U R                   R                  (       d  [        S5      eU R                  [	        U0 UD65      n U R                   R                  U R                  U5       Vs/ s Sh  vN oDPM   N
 Os  snf sn5      $ ! [         a    U R                   R                  5       s $ f = f7f)a  This works similar to :meth:`render` but returns a coroutine
that when awaited returns the entire rendered template string.  This
requires the async feature to be enabled.

Example usage::

    await template.render_async(knights='that say nih; asynchronously')
8The environment was not created with async mode enabled.N)	rN   r   RuntimeErrorr)   rK   r,   r  r   r   )r   r<   r   r  ns        rA   r  Template.render_async  s      ((J  tT4V45	7##**"&"7"7"<==Q==   	7##4466	7sZ   AB4(B
 ,A>.A<
2A:3A<
6A>:A<
<A>=B
 	B4
$B1.B40B11B4TemplateStreamc                 8    [        U R                  " U0 UD65      $ )zKWorks exactly like :meth:`generate` but returns a
:class:`TemplateStream`.
)r  r   )r   r<   r   s      rA   r   Template.stream(  s     dmmT<V<==rC   c              /     ^ ^^#    T R                   R                  (       aD  SSKnS[        R                  [
           4UUU 4S jjnUR                  U" 5       5       Sh  vN   gT R                  [        T0 TD65      n T R                  U5       Sh  vN   g N: N! [         a    T R                   R                  5       v    gf = f7f)a:  For very large templates it can be useful to not render the whole
template at once but evaluate each statement after another and yield
piece for piece.  This method basically does exactly that and returns
a generator that yields one item after another as strings.

It accepts the same arguments as :meth:`render`.
r   Nr=   c                  f   >#    TR                   " T0 TD6 V s/ s S h  vN o PM   N
 sn $ s  sn f 7fr   )generate_async)r   r<   r   r   s    rA   to_list"Template.generate.<locals>.to_list9  s-     )-)<)<d)Mf)MNNANNNs$   1,(&
(,(,1)rN   r   r  rS   r  rR   r  r)   rK   r  r   r   )r   r<   r   r  r  r  s   ```   rA   r   Template.generate.  s      $$O166#; O O {{79---tT4V45	6,,S111 . 2 	6""3355	6sH   AC
B C
 B BB C
B &CC
CC
c                  #    U R                   R                  (       d  [        S5      eU R                  [	        U0 UD65      n U R                  U5      n U  Sh  vN nU7v   M   N
 UR                  5       I Sh  vN    g! UR                  5       I Sh  vN    f = f! [         a     U R                   R                  5       7v    gf = f7f)zcAn async version of :meth:`generate`.  Works very similarly but
returns an async iterator instead.
r  N)	rN   r   r  r)   rK   r  acloser   r   )r   r<   r   r  agenevents         rA   r  Template.generate_asyncF  s      ((J  tT4V45
	6((-D$#'  %K 4
 kkm##dkkm## 	6""3355	6s~   ACB# B A*A(A* B (A**B +B# >B?B# CB BB  B# #'C
CCCvarsr?   r   c           	      r    [        U R                  U R                  U R                  XU R                  U5      $ )a6  Create a new :class:`Context` for this template.  The vars
provided will be passed to the template.  Per default the globals
are added to the context.  If shared is set to `True` the data
is passed as is to the context without adding the globals.

`locals` can be a dict of local variables for internal usage.
)r)   rN   r   r  r   )r   r  r?   r   s       rA   r)   Template.new_context_  s1     diidDLLRX
 	
rC   c                 <    U R                  XU5      n[        X5      $ )a"  This method works like the :attr:`module` attribute when called
without arguments but it will evaluate the template on every call
rather than caching it.  It's also possible to provide
a dict which is then used as context.  The arguments are the same
as for the :meth:`new_context` method.
)r)   r  )r   r  r?   r   r  s        rA   make_moduleTemplate.make_modulep  s!     tV4d((rC   c           
         #    U R                  XU5      n[        U UU R                  U5       Vs/ s Sh  vN oUPM   N
 sn5      $ s  snf 7f)zAs template module creation can invoke template code for
asynchronous executions this method must be used instead of the
normal :meth:`make_module` one.  Likewise the module attribute
becomes unavailable in async mode.
N)r)   r  r  )r   r  r?   r   r  r   s         rA   make_module_asyncTemplate.make_module_async  sM      tV4"33C899Q9
 	
 :s*   -AA?=?A?A Ar  c                 t   U R                   R                  (       a  [        S5      eUb]  UR                  U R                  R                  5       -
  nU(       a/  U R                  U Vs0 s H  o3UR                  U   _M     sn5      $ U R                  c  U R                  5       U l        U R                  $ s  snf )a  If a context is passed in, this means that the template was
imported. Imported templates have access to the current
template's globals by default, but they can only be accessed via
the context during runtime.

If there are new globals, we need to create a new module because
the cached module is already rendered and will not have access
to globals from the current context. This new module is not
cached because the template can be imported elsewhere, and it
should have access to only the current template's globals.
z&Module is not available in async mode.)	rN   r   r  globals_keysr   keysr  rW  r  r   r  r  ks       rA   _get_default_moduleTemplate._get_default_module  s     $$GHH?##dll&7&7&99D''4(H4aCJJqM)94(HII<<++-DL|| )Is   'B5c                 X  #    Ube  UR                   U R                  R                  5       -
  nU(       a7  U R                  U Vs0 s H  o3UR                  U   _M     sn5      I S h  vN $ U R
                  c  U R                  5       I S h  vN U l        U R
                  $ s  snf  N? N7fr   )r  r   r  r  rW  r  r  s       rA   _get_default_module_async"Template._get_default_module_async  s      ?##dll&7&7&99D!33t4Tt!

15Et4TUUU<<!%!7!7!99DL|| 5UU :s0   AB*B!
B*&B&'$B*B(B*(B*c                 "    U R                  5       $ )aS  The template as module.  This is used for imports in the
template runtime but is also useful if one wants to access
exported template variables from the Python layer:

>>> t = Template('{% macro foo() %}42{% endmacro %}23')
>>> str(t.module)
'23'
>>> t.module.foo() == u'42'
True

This attribute is not available if async mode is enabled.
)r  r   s    rA   moduleTemplate.module  s     ''))rC   r  c                 R    [        U R                  5       H  u  p#X1::  d  M  Us  $    g)zbReturn the source line number of a line number in the
generated bytecode as they are not in sync.
r	   )reversedr  )r   r  template_line	code_lines       rA   get_corresponding_lineno!Template.get_corresponding_lineno  s,     )1(A$M"$$ )B rC   c                 >    U R                   c  gU R                  5       $ )z?If this variable is `False` there is a newer version available.T)r  r   s    rA   r^  Template.is_up_to_date  s     >>!~~rC   c                     U R                   (       aR  U R                   R                  S5       Vs/ s H+  n[        [        [        UR                  S5      5      5      PM-     sn$ / $ s  snf )zThe debug info mapping.&=)r  splittuplemapr  )r   r   s     rA   r  Template.debug_info  s`      ))//44A c#qwws|,-4 
 	s   2A&c                     U R                   c  S[        U 5      S 3nO[        U R                   5      nS[        U 5      R                   SU S3$ Nzmemory:r   < >)r   idreprrJ   rv  r   r   s     rA   __repr__Template.__repr__  sK    99RXaL)D		?D4:&&'qa00rC   )r  r   )NFN)r=   r  )Brv  rw  rx  ry  rz  r7   r  rS   rU   r}  r  rR   r  r|  Dictr  r(   r  rP  r   r   r   r   r   r   r   r   r   r   r   r   r*   r  r
   rE   r~  r   classmethodr   rp  r  r  r  r  r   r   AsyncGeneratorr   r  r  r)   r  r  r/   r  r  r  r  r  r  r^  r  r  r  r  r  rl   rC   rA   rE   rE   p  sq   $ .9qvvk*8c155j))
**S/jjoFF3

G9ajjo#=>>??jj'AJJsO!;<<ZZ())zz!**RX.//
 #5 0%:#6$8"41F/B'+AQ&;DF'07;IN")/;U^^+,/;  /; 	/;
  #/; !/; "/;  /;  !zz#/; ZZ_/; /; /; ?/;  $/; JJqwwsAFF;,?'?@A/;  !/;" 66)$#/;$ **QZZQUU
34%/;& GGD!**ajjo->-D"EEF'/;( )/;* 
+/;b  6:   !!#quu*-	
 **QZZD12 
   F F %%c155j1F !!#quu*-	F
 
F F   ##CJ/ !!#quu*-	
 
 60AEE 0QUU 0s 0,7 7 73 7.>AEE >QUU >7G >6aee 6quu 6C 606UU6&'ee6	
		#v+	&66 0448	
jjQUU
+,
 
 

199S!%%Z01	

 

& 0448	)jjQUU
+,) ) 

199S!%%Z01	)
 
)" 0448	
jjQUU
+,
 
 

199S!%%Z01	

 

$ qzz'': FV  6 *.::g&	 * *s s   t     AFF17738#45  1# 1rC   c            	           \ rS rSrSr SS\S\S\R                  \R                  \
      SS4S jjrS\4S	 jrS\
4S
 jrS\
4S jrSrg)r  i  zRepresents an imported template.  All the exported names of the
template are available as attributes on this object.  Additionally
converting it into a string renders the contents.
Nr  r   body_streamr=   c                 
   Uc@  UR                   R                  (       a  [        S5      e[        UR	                  U5      5      nX0l        U R                  R                  UR                  5       5        UR                  U l
        g )NztAsync mode requires a body stream to be passed to a template module. Use the async methods of the API you are using.)rN   r   r  listr  _body_streamr   r   get_exportedr   rv  )r   r  r   r  s       rA   r   TemplateModule.__init__  sn     ""++"*  x88ABK'W1134 rC   c                 >    [        [        U R                  5      5      $ r   )r   r,   r  r   s    rA   __html__TemplateModule.__html__  s    fT../00rC   c                 ,    [        U R                  5      $ r   )r,   r  r   s    rA   __str__TemplateModule.__str__
  s    d''((rC   c                     U R                   c  S[        U 5      S 3nO[        U R                   5      nS[        U 5      R                    SU S3$ r  )rv  r  r  rJ   r  s     rA   r  TemplateModule.__repr__  sL    == RXaL)D&D4:&&'qa00rC   )rv  r  r   )rv  rw  rx  ry  rz  rE   r(   rS   r|  r  rR   r   r   r  r   r  r  rl   rC   rA   r  r    sl     48	&& & ZZ

30	&
 
&(1& 1) )1# 1rC   r  c                       \ rS rSrSrS\S\SS4S jrS\R                  S	\R                  S\R                  \R                     4S
 jrSrg)r  i  zThe :meth:`jinja2.Environment.compile_expression` method returns an
instance of this object.  It encapsulates the expression-like access
to the template with an expression it wraps.
r  r  r=   Nc                     Xl         X l        g r   	_template_undefined_to_none)r   r  r  s      rA   r   TemplateExpression.__init__  s    !"3rC   r<   r   c                    U R                   R                  [        U0 UD65      n[        U R                   R	                  U5      5        UR
                  S   nU R                  (       a  [        U[        5      (       a  S nU$ )NrW   )	r  r)   rK   r-   r  r  r  rQ   r*   )r   r<   r   r   r   s        rA   __call__TemplateExpression.__call__  sd    ..,,T4-B6-BC//89\\(#""z"i'@'@B	rC   r  )rv  rw  rx  ry  rz  rE   rP  r   rS   r  r|  r  r  rl   rC   rA   r  r    sP    
4 4d 4t 4aee quu AEE9J rC   r  c            	       6   \ rS rSrSrS\R                  \   SS4S jr  SS\R                  \\R                  \   4   S\R                  \   S	\R                  \   SS4S
 jjrSS jrS\S\R                  \   4S jrSS\SS4S jjrSS jrS\4S jrSrg)r  i(  a  A template stream works pretty much like an ordinary python generator
but it can buffer multiple items to reduce the number of total iterations.
Per default the output is unbuffered which means that for every unbuffered
instruction in the template one string is yielded.

If buffering is enabled with a buffer size of 5, five items are combined
into a new string.  This is mainly useful if you are streaming
big templates to a client via WSGI which flushes after each iteration.
genr=   Nc                 0    Xl         U R                  5         g r   )_gendisable_buffering)r   r  s     rA   r   TemplateStream.__init__3  s    	 rC   fpencodingerrorsc                 n  ^^ Sn[        U[        5      (       a  Tc  Sm[        US5      nSnOUn Tb  UU4S jU  5       nOU n[        US5      (       a  UR	                  U5        OU H  nUR                  U5        M     U(       a  UR                  5         gg! U(       a  UR                  5         f f = f)zDump the complete stream into a file or file-like object.
Per default strings are written, if you want to encode
before writing specify an `encoding`.

Example usage::

    Template('Hello {{ name }}!').stream(name='foo').dump('hello.html')
FNzutf-8r*  Tc              3   F   >#    U  H  oR                  TT5      v   M     g 7fr   )r3  ).0r   r  r  s     rA   	<genexpr>&TemplateStream.dump.<locals>.<genexpr>R  s     E1HHXv66s   !
writelines)rQ   rR   r.  r   r  r2  rG  )r   r  r  r  rG  real_fpiterableitems     ``    rA   dumpTemplateStream.dump7  s     b#"#'D>GEG	 #EEw--""8,$DMM$' %  u s   AB B4c                 P    [        [        U R                  5      U l        SU l        g)zDisable the output buffering.FN)r   nextr  _nextbufferedr   s    rA   r   TemplateStream.disable_buffering_  s    T499-
rC   rD   c              #      #    / nSnUR                   n  X1:  a0  [        U R                  5      nU" U5        U(       a  US-  nX1:  a  M0  [	        U5      v   US S 2	 SnML  ! [         a    U(       d   g  N+f = f7f)Nr   r	   )appendr"  r  StopIterationr,   )r   rD   bufc_sizepushcs         rA   _buffered_generator"TemplateStream._buffered_generatord  s     zzmTYYAG!	 m +AF  !  s(   A93A  
A9 A61A95A66A9c                 |    US::  a  [        S5      eSU l        [        [        U R	                  U5      5      U l        g)z<Enable buffering.  Buffer `size` items before yielding them.r	   zbuffer size too smallTN)
ValueErrorr$  r   r"  r-  r#  )r   rD   s     rA   enable_bufferingTemplateStream.enable_bufferingw  s5    19455T4#;#;D#AB
rC   c                     U $ r   rl   r   s    rA   __iter__TemplateStream.__iter__  s    rC   c                 "    U R                  5       $ r   )r#  r   s    rA   __next__TemplateStream.__next__  s    zz|rC   )r  r#  r$  )Nstrict)r=   N)   )r=   r  )rv  rw  rx  ry  rz  rS   r  rR   r   r  IObytesr|  r  r  r  r-  r1  r4  r7  r  rl   rC   rA   r  r  (  s    !AJJsO ! ! %)"*	& GGCe$%&  **S/&  

3	& 
 
& P
 

3 &CS C C# rC   r  )^rz  r/  r  rS   r\  collectionsr   	functoolsr   r   r   typesr   
markupsafer   ri   r
   compilerr   r   defaultsr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   
exceptionsr   r   r   r    r!   r   r#   r$   r%   r&   r  r'   runtimer(   r)   r*   utilsr+   r,   r-   r.   r/   r1   r2   TYPE_CHECKINGtyping_extensionstebccacher3   r   r4   r@  r5   TypeVarr6   rU   r  rB   r  r|  r  r  rR   rG   rM   r~  r  r  rY   rd   r7   rE   r  r  r  rk   rl   rC   rA   <module>rK     s=   
            #  & ( ( * % ' & # + ) + # & ! ) + ( , ) + &                 ??"&#YY|=9
 2
QVVJ%7 
 
* 
 



ZZ  )=s)B!CZ!OPQ

$::a&&quuaee|45
$ZZ  )=s)B!CZ!OPQ
$

1773{(;#;<= VVC$: * $]) ])@z1 z1z%1 %1P &[ [@ & rC   