
    ]j                     N    d dl mZ d dlmZ d dlmZ d dlmZmZ  G d de      Z	y)    )absolute_import)nodes)	Extension)SCRIPT_ATTRSbuild_script_tagc                   *    e Zd Z edg      Zd Zd Zy)NoncedScriptscriptc                    t        |j                        j                  }t        j                  dt        j
                               g}|j                  j                  j                  t        v r|j                  j                  j                  }|j                  j                  d       |j                  t        j                  ||j                                      |j                  j                  j                  t        v r|j                  dgd      }t        j                  | j                  d|      g g |      j                  |      S )Nctx   zname:endscriptT)drop_needle_render_script)kwargs)nextstreamlinenor   KeywordContextReferencecurrentvaluer   skipappendparse_expressionparse_statements	CallBlockcall_method
set_lineno)selfparserr   r   	attr_namebodys         A/root/env/lib/python3.12/site-packages/csp/extensions/__init__.pyparsezNoncedScript.parse   s   
 fmm$++ --u'='='?@A mm##))\9--33IMMq!MMi)@)@)BCE mm##))\9 &&(8'9t&L -f=D$*V,	-    c                     |j                  d      }|j                  d      }|j                  |d<    |       j                         |d<   t	        di |S )Nr   requestnoncecontent )popget	csp_noncestripr   )r   callerr   r   r'   s        r#   r   zNoncedScript._render_script(   sN    jj'')$!++w"HNN,y)&))r%   N)__name__
__module____qualname__settagsr$   r   r*   r%   r#   r	   r	   	   s    z?D-6*r%   r	   N)

__future__r   jinja2r   
jinja2.extr   	csp.utilsr   r   r	   r*   r%   r#   <module>r9      s    &    4%*9 %*r%   