
    *iH                    8   % S SK Jr  S SKrS SKrS SKrS SKrS SKrSrSr\	" S \R                  \R                  R                  4 5       5      rS\S'   SS	S
S1S \" S5       5       kS \" S5       5       krSS jrSS jr S       SS jjrSS jrSS jrg)    )annotationsN>abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789i@B c              #  >   #    U  H  oc  M  US:w  d  M  Uv   M     g 7f)N/ ).0seps     O/var/www/html/ai-backend/venv/lib/python3.13/site-packages/werkzeug/security.py	<genexpr>r      s      +CC3#:CC+s   	z	list[str]_os_alt_sepsCONPRNAUXNULc              #  ,   #    U  H
  nS U 3v   M     g7f)COMNr   r   is     r
   r   r           #AA3i   
   c              #  ,   #    U  H
  nS U 3v   M     g7f)LPTNr   r   s     r
   r   r      r   r   c                f    U S::  a  [        S5      eSR                  S [        U 5       5       5      $ )zAGenerate a random string of SALT_CHARS with specified ``length``.r   zSalt length must be at least 1. c              3  V   #    U  H  n[         R                  " [        5      v   M!     g 7fN)secretschoice
SALT_CHARS)r   _s     r
   r   gen_salt.<locals>.<genexpr>   s     E}!7>>*--}s   '))
ValueErrorjoinrange)lengths    r
   gen_saltr'      s.    {:;;77EuV}EEE    c           	        U R                  S5      tpUR                  5       nUR                  5       nU S:X  a\  U(       d  SnSnSnO [        [        U5      u  pgnSU-  U-  U-  n	[
        R                  " XTXgXS9R                  5       S	U SU SU 34$ U S
:X  a~  [        U5      n
U
S:X  a	  Sn[        nO7U
S:X  a  US   n[        nO%U
S:X  a  US   n[        US   5      nO[	        S5      e[
        R                  " XXL5      R                  5       SU SU 34$ [	        SU  S35      e! [         a    [	        S5      S ef = f)N:scrypti         z'scrypt' takes 3 arguments.   )saltnrpmaxmemzscrypt:pbkdf2r   sha256   z'pbkdf2' takes 2 arguments.zpbkdf2:zInvalid hash method 'z'.)splitencodemapintr#   hashlibr+   hexlenDEFAULT_PBKDF2_ITERATIONSpbkdf2_hmac)methodr/   passwordargs
salt_bytespassword_bytesr0   r1   r2   r3   len_args	hash_name
iterationss                r
   _hash_internalrH   !   sv   LL%MFJ__&NAAAJc4.a q1qNN1QceaS!AaS!	
 	
 
8	t9q= I2J]QI2J]QIT!WJ:;; :cei[*.	
 	
 0;<<A  J !>?TIJs   D( (D?c                H    [        U5      n[        XU 5      u  pEU SU SU 3$ )a  Securely hash a password for storage. A password can be compared to a stored hash
using :func:`check_password_hash`.

The following methods are supported:

-   ``scrypt``, the default. The parameters are ``n``, ``r``, and ``p``, the default
    is ``scrypt:32768:8:1``. See :func:`hashlib.scrypt`.
-   ``pbkdf2``, less secure. The parameters are ``hash_method`` and ``iterations``,
    the default is ``pbkdf2:sha256:600000``. See :func:`hashlib.pbkdf2_hmac`.

Default parameters may be updated to reflect current guidelines, and methods may be
deprecated and removed if they are no longer considered secure. To migrate old
hashes, you may generate a new hash when checking an old hash, or you may contact
users with a link to reset their password.

:param password: The plaintext password.
:param method: The key derivation function and parameters.
:param salt_length: The number of characters to generate for the salt.

.. versionchanged:: 3.1
    The default iterations for pbkdf2 was increased to 1,000,000.

.. versionchanged:: 2.3
    Scrypt support was added.

.. versionchanged:: 2.3
    The default iterations for pbkdf2 was increased to 600,000.

.. versionchanged:: 2.3
    All plain hashes are deprecated and will not be supported in Werkzeug 3.0.
$)r'   rH   )rA   r@   salt_lengthr/   hactual_methods         r
   generate_password_hashrN   Q   s5    D K D%fH=A_AdV1QC((r(   c                     U R                  SS5      u  p#n[        R                  " [	        X#U5      S   U5      $ ! [         a     gf = f)a  Securely check that the given stored password hash, previously generated using
:func:`generate_password_hash`, matches the given password.

Methods may be deprecated and removed if they are no longer considered secure. To
migrate old hashes, you may generate a new hash when checking an old hash, or you
may contact users with a link to reset their password.

:param pwhash: The hashed password.
:param password: The plaintext password.

.. versionchanged:: 2.3
    All plain hashes are deprecated and will not be supported in Werkzeug 3.0.
rJ   r6   Fr   )r7   r#   hmaccompare_digestrH   )pwhashrA   r@   r/   hashvals        r
   check_password_hashrT   x   sQ     &S! 4g ~fHEaH'RR  s   ; 
AAc                2  ^ U (       d  Sn U /nU H  mTS:w  a  [         R                  " T5      m[        U4S j[         5       5      (       d  [        R
                  S:X  a8  [        R                  R                  T5      S   R                  5       [        ;   dV  [        R                  R                  T5      (       d2  TR                  S5      (       d  TS:X  d  TR                  S5      (       a    g	UR                  T5        M     [         R                  " U6 $ )
ai  Safely join zero or more untrusted path components to a base
directory to avoid escaping the base directory.

:param directory: The trusted base directory.
:param pathnames: The untrusted path components relative to the
    base directory.
:return: A safe path, otherwise ``None``.

.. versionchanged:: 3.1.4
    Special device names are disallowed on Windows.
.r   c              3  ,   >#    U  H	  oT;   v   M     g 7fr   r   )r   r	   filenames     r
   r   safe_join.<locals>.<genexpr>   s     8<Cx<s   ntr   r   z..z../N)	posixpathnormpathanyr   osnamepathsplitextupper_windows_device_filesisabs
startswithappendr$   )	directory	pathnamespartsrX   s      @r
   	safe_joinrj      s      	KEr> ))(3H 8<8884GG$$X.q1779=RRww}}X&&""3''4""5))X% ( >>5!!r(   )r&   r:   returnstr)r@   rl   r/   rl   rA   rl   rk   ztuple[str, str])r+      )rA   rl   r@   rl   rK   r:   rk   rl   )rR   rl   rA   rl   rk   bool)rg   rl   rh   rl   rk   z
str | None)
__future__r   r;   rP   r^   r[   r   r    r>   listr	   r`   altsepr   __annotations__r%   rc   r'   rH   rN   rT   rj   r   r(   r
   <module>rs      s    "   	  M
%  FFBGGNN+ i  
				
 $r# $r# F-=b ?A$)$)$)8;$)$)NS,'"r(   