
    q"h+              
       F   S SK r S SKJr  S SKJrJrJrJrJrJ	r	J
r
JrJrJr  S SKJr  S SKJr  SSKJrJrJr  SSKJr  SS	KJr  SS
KJr  \(       a  S SKJr  S SKJr  \\\4   r\\\\ 4   r!O\r!\" S5      r"\" S5      r#S\\ \#4   S\ S\"S\\"\#4   4S jr$ " S S\!5      r%g)    N)	lru_cache)
TYPE_CHECKINGDictIterableIteratorMappingOptionalSequenceTupleTypeVarUnion)AbstractProvider)InstallRequirement   )	Candidate
ConstraintRequirement)REQUIRES_PYTHON_IDENTIFIER)Factory)ExplicitRequirement)
Preference)RequirementInformationDVmapping
identifierdefaultreturnc                 `    X;   a  X   $ UR                  S5      u  p4nU(       a	  X0;   a  X   $ U$ )aU  Get item from a package name lookup mapping with a resolver identifier.

This extra logic is needed when the target mapping is keyed by package
name, which cannot be directly looked up with an identifier (which may
contain requested extras). Additional logic is added to also look up a value
by "cleaning up" the extras from the identifier.
[)	partition)r   r   r   nameopen_bracket_s         ^/var/www/html/env/lib/python3.13/site-packages/pip/_internal/resolution/resolvelib/provider.py_get_with_identifierr&   :   s>     "" '005D}N    c                      \ rS rSrSrS\S\\\4   S\	S\S\\\
4   SS	4S
 jrS\\\4   S\4S jrS\\   S\\\4   S\\\\   4   S\\\S   4   S\S   S\\   4S jrS\S\\\4   S\\\\   4   S\\\S   4   S\S   SS4S jrS\S\\\\   4   S\\\\   4   S\\   4S jr\\" S	S9S\S\S\	4S j5       5       rS\S\\   4S jrSrg	) PipProviderS   a  Pip's provider implementation for resolvelib.

:params constraints: A mapping of constraints specified by the user. Keys
    are canonicalized project names.
:params ignore_dependencies: Whether the user specified ``--no-deps``.
:params upgrade_strategy: The user-specified upgrade strategy.
:params user_requested: A set of canonicalized package names that the user
    supplied for pip to install/upgrade.
factoryconstraintsignore_dependenciesupgrade_strategyuser_requestedr   Nc                 @    Xl         X l        X0l        X@l        XPl        g N)_factory_constraints_ignore_dependencies_upgrade_strategy_user_requested)selfr+   r,   r-   r.   r/   s         r%   __init__PipProvider.__init__^   s!      '$7!!1-r'   requirement_or_candidatec                     UR                   $ r1   )r"   )r7   r:   s     r%   identifyPipProvider.identifyl   s    ',,,r'   identifiersresolutions
candidatesinformationPreferenceInformationbacktrack_causesc                 T   [        5       nU H\  nUR                  UR                  R                  5        UR                  c  M7  UR                  UR                  R                  5        M^     / nU H*  n	U	[
        :X  a  U	/s  $ X;   d  M  UR                  U	5        M,     U(       a  U$ U$ )a9  Produce a subset of identifiers that should be considered before others.

Currently pip narrows the following selection:
    * Requires-Python, if present is always returned by itself
    * Backtrack causes are considered next because they can be identified
      in linear time here, whereas because get_preference() is called
      for each identifier, it would be quadratic to check for them there.
      Further, the current backtrack causes likely need to be resolved
      before other requirements as a resolution can't be found while
      there is a conflict.
)setaddrequirementr"   parentr   append)
r7   r>   r?   r@   rA   rC   backtrack_identifiersinfocurrent_backtrack_causesr   s
             r%   narrow_requirement_selection(PipProvider.narrow_requirement_selectiono   s    & !$$D!%%d&6&6&;&;<{{&%))$++*:*:; %
 $& %J 77"|# 2(//
; & $++r'   r   r   c                     [        [        XA   5      5        SnU(       d  SnSnO[        S XA    5       6 u  p[	        U	5      nS U 5        V
Vs/ s H%  n
U
  H  nUR
                  UR                  4PM     M'     nn
n[	        S U 5       5      n[	        S U 5       5      n[        U5      nU R                  R                  U[        R                  5      nU(       + U(       + U(       + UU(       + U4$ ! [         a    Sn Nf = fs  snn
f )a  Produce a sort key for given requirement based on preference.

The lower the return value is, the more preferred this group of
arguments is.

Currently pip considers the following in order:

* Any requirement that is "direct", e.g., points to an explicit URL.
* Any requirement that is "pinned", i.e., contains the operator ``===``
  or ``==`` without a wildcard.
* Any requirement that imposes an upper version limit, i.e., contains the
  operator ``<``, ``<=``, ``~=``, or ``==`` with a wildcard. Because
  pip prioritizes the latest version, preferring explicit upper bounds
  can rule out infeasible candidates sooner. This does not imply that
  upper bounds are good practice; they can make dependency management
  and resolution harder.
* Order user-specified requirements as they are specified, placing
  other requirements afterward.
* Any "non-free" requirement, i.e., one that contains at least one
  operator, such as ``>=`` or ``!=``.
* Alphabetical order for consistency (aids debuggability).
TF c              3   l   #    U  H*  u  p[        U[        5      UR                  5       S    4v   M,     g7f)r   N)
isinstancer   get_candidate_lookup).0rr$   s      r%   	<genexpr>-PipProvider.get_preference.<locals>.<genexpr>   s5       7  #679O9O9QRS9TU 7s   24c              3   J   #    U  H  o(       d  M  UR                   v   M     g 7fr1   )	specifier)rT   ireqs     r%   rV   rW      s     !KUTd.$..Us   
##c              3   N   #    U  H  u  pUS S S:H  =(       a    SU;  v   M     g 7f)N   ==*rP   rT   opvers      r%   rV   rW      s(     VIr"1v~;CsN;Is   #%c              3   `   #    U  H$  u  pUS ;   =(       d    US:H  =(       a    SU;   v   M&     g7f))<z<=z~=r]   r^   NrP   r_   s      r%   rV   rW      s4      
$ %%E2:+D#*E$s   ,.)nextiterStopIterationzipanyoperatorversionboolr6   getmathinf)r7   r   r?   r@   rA   rC   has_informationdirectireqsdirectsspecifier_setrY   	operatorspinnedupper_boundedunfreerequested_orders                    r%   get_preferencePipProvider.get_preference   s.   <	#k-./ #OF>@E
 ! + 7NG \F "LU!K,
!K*	 !2!23* 4!K 	 ,
 VIVV 
$
 
 i..22:txxH JJJ
 	
I  	$ $O	$,,
s   C4 ,D4DDrequirementsincompatibilitiesc           	         ^  S[         S[        4U 4S jjn[        T R                  U[        R
                  " 5       S9nT R                  R                  UUUU" U5      (       + UT R                  S9$ )Nr   r   c                 z   > TR                   S:X  a  gTR                   S:X  a  [        TR                  U SS9nUSL$ g)a  Are upgrades allowed for this project?

This checks the upgrade strategy, and whether the project was one
that the user specified in the command line, in order to decide
whether we should upgrade if there's a newer version available.

(Note that we don't need access to the `--upgrade` flag, because
an upgrade strategy of "to-satisfy-only" means that `--upgrade`
was not specified).
eagerTzonly-if-neededNr   F)r5   r&   r6   )r   
user_orderr7   s     r%   _eligible_for_upgrade7PipProvider.find_matches.<locals>._eligible_for_upgrade   sN     %%0''+;;1(( 

 "--r'   r   )r   r{   
constraintprefers_installedr|   is_satisfied_by)	strrk   r&   r3   r   emptyr2   find_candidatesr   )r7   r   r{   r|   r   r   s   `     r%   find_matchesPipProvider.find_matches   sx    	c 	d 	, *$$&


 }},,!%!#8#DD/ 00 - 
 	
r'   )maxsizerG   	candidatec                 $    U R                  U5      $ r1   )r   )rG   r   s     r%   r   PipProvider.is_satisfied_by  s     **955r'   c                 T    U R                   (       + nS UR                  U5       5       $ )Nc              3   .   #    U  H  oc  M  Uv   M     g 7fr1   rP   )rT   rU   s     r%   rV   /PipProvider.get_dependencies.<locals>.<genexpr>  s     WEaEs   	)r4   iter_dependencies)r7   r   with_requiress      r%   get_dependenciesPipProvider.get_dependencies  s&     555W966}EWWr'   )r3   r2   r4   r5   r6   )__name__
__module____qualname____firstlineno____doc__r   r   r   r   rk   intr8   r   r   r   r<   r   r   r   r
   rM   ry   r   staticmethodr   r   r   __static_attributes__rP   r'   r%   r)   r)   S   s    .. #z/*. "	.
 . S#X. 
.-{I7M1N -SV -)c]) S)^,) C)!445	)
 S(+B"CCD) ##:;) 
#)VK
K
 S)^,K
 C)!445	K

 S(+B"CCDK
 ##:;K
 
K
Z(
(
 c8K#889(
 #3(;#;<	(

 
)	(
T t6[ 6Y 64 6  6X) X8M Xr'   r)   )&rm   	functoolsr   typingr   r   r   r   r   r	   r
   r   r   r    pip._vendor.resolvelib.providersr   pip._internal.req.req_installr   baser   r   r   r@   r   r+   r   r{   r   r    pip._vendor.resolvelib.resolversr   rB   r   _ProviderBaser   r   r&   r)   rP   r'   r%   <module>r      s        > < 4 4 2  -;G2;	3IJ$[)S%@AM$M* CLCLS!V_  1a4[	2FX- FXr'   