+
    yj                     L    ^ RI Ht ^ RIHt Rt ! R R]4      t ! R R4      tR# )	    )HiddenField)ValidationErrorCSRFTokenFieldCSRFc                   X   a a ] tR t^t oRtRtV 3R ltR tR tR t	V 3R lt
RtVtV ;t# )	r   a)  
A subclass of HiddenField designed for sending the CSRF token that is used
for most CSRF protection schemes.

Notably different from a normal field, this field always renders the
current token regardless of the submitted value, and also will not be
populated over to object data via populate_obj
Nc                T   < VP                  R 4      V n        \        SV `  ! V/ VB  R# )	csrf_implN)popr	   super__init__)selfargskw	__class__s   &*,E/var/www/html/2rare/lib/python3.14/site-packages/wtforms/csrf/core.pyr   CSRFTokenField.__init__   s%    ,$%"%    c                    V P                   # )zm
We want to always return the current token on render, regardless of
whether a good or bad token was passed.
)current_token)r   s   &r   _valueCSRFTokenField._value   s    
 !!!r   c                    R# )z,
Don't populate objects with the CSRF token
N )r   r   s   &*r   populate_objCSRFTokenField.populate_obj   s     	r   c                <    V P                   P                  W4       R# )z(
Handle validation of this token field.
N)r	   validate_csrf_token)r   forms   &&r   pre_validateCSRFTokenField.pre_validate$   s     	**46r   c                h   < \         SV `  ! V/ VB  V P                  P                  V 4      V n        R # )N)r   processr	   generate_csrf_tokenr   )r   r   kwargsr   s   &*,r   r"   CSRFTokenField.process*   s+    ((!^^??Er   )r	   r   )__name__
__module____qualname____firstlineno____doc__r   r   r   r   r   r"   __static_attributes____classdictcell____classcell__)r   __classdict__s   @@r   r   r      s1      M&"7F Fr   c                   6   a  ] tR t^/t o ]tR tR tR tRt	V t
R# )r   c                `    VP                   pVP                  pV P                  RV R7      pW43.# )av  
Receive the form we're attached to and set up fields.

The default implementation creates a single field of
type :attr:`field_class` with name taken from the
``csrf_field_name`` of the class meta.

:param form:
    The form instance we're attaching to.
:return:
    A sequence of `(field_name, unbound_field)` 2-tuples which
    are unbound fields to be added to the form.
z
CSRF Token)labelr	   )metacsrf_field_namefield_class)r   r   r2   
field_nameunbound_fields   &&   r   
setup_formCSRF.setup_form2   s9     yy))
((|t(L+,,r   c                    \        4       h)a  
Implementations must override this to provide a method with which one
can get a CSRF token for this form.

A CSRF token is usually a string that is generated deterministically
based on some sort of user data, though it can be anything which you
can validate on a subsequent request.

:param csrf_token_field:
    The field which is being used for CSRF.
:return:
    A generated CSRF string.
)NotImplementedError)r   csrf_token_fields   &&r   r#   CSRF.generate_csrf_tokenE   s     "##r   c                p    VP                   VP                  8w  d   \        VP                  R4      4      hR# )a  
Override this method to provide custom CSRF validation logic.

The default CSRF validation logic simply checks if the recently
generated token equals the one we received as formdata.

:param form: The form which has this CSRF token.
:param field: The CSRF token field.
zInvalid CSRF Token.N)r   datar   gettext)r   r   fields   &&&r   r   CSRF.validate_csrf_tokenU   s0     %**,!%--0E"FGG -r   r   N)r&   r'   r(   r)   r   r4   r7   r#   r   r+   r,   )r.   s   @r   r   r   /   s       K-&$ H Hr   N)r   r   )wtforms.fieldsr   wtforms.validatorsr   __all__r   r   r   r   r   <module>rE      s+    & .
$%F[ %FP1H 1Hr   