
    q"h              	           S r SSKrSSKrSSKrSSKJr  SSKJrJrJ	r	J
r
  SSKJr  SSKJrJr  SSKJr  SS	 jrS
\	\   S\S\\   S\
\   4S jrS\S\S\\   4S jrg)zALogic that powers autocompletion installed by ``pip completion``.    N)chain)AnyIterableListOptional)create_main_parser)commands_dictcreate_command)get_default_environmentreturnc            
      &
   S[         R                  ;  a  g[         R                  R                  S5      (       a$  [         R                  R                  S5      (       d  g[         R                  S   R                  5       SS n [	        [         R                  S   5      n XS-
     n[        5       n[        [        5      n/ nSnU  H  nXt;   d  M
  Un  O   UGb  US:X  a  [        R                  " S5        UR                  S5      (       + =(       a    US	;   nU(       a  [        5       n	UR                  5       n
U	R                  S
S9 Vs/ s HF  nUR                  R                  U
5      (       d  M%  UR                  U SS ;  d  M:  UR                  PMH     nnU(       a*  U H  n[!        U5        M     [        R                  " S5        UR                  S5      (       + =(       a    US:H  nU(       a4  [#        US5       H  n[!        U5        M     [        R                  " S5        [%        U5      nUR&                  R(                   H\  nUR*                  [,        R.                  :w  d  M#  UUR0                  UR2                  -    Vs/ s H  nUUR4                  4PM     sn-  nM^     U SUS-
    Vs/ s H  nUR                  S5      S   PM     nnU VVs/ s H  u  nnUU;  d  M  UU4PM     nnnU VVs/ s H"  u  nnUR                  U5      (       d  M  UU4PM$     nnn[7        U UUR&                  R(                  5      nU(       a  [#        UU5      nU Vs/ s H  oS4PM     nnU H.  nUS   nUS   (       a  US   SS S:X  a  US-  n[!        U5        M0     GOUR8                   Vs/ s H  nUR:                  PM     nnUR=                  UR:                  5        [>        R@                  " U5      nUR                  S5      (       aF  U H?  nUR*                  [,        R.                  :w  d  M#  UUR0                  UR2                  -   -  nMA     O([7        XU5      nU(       a  [        [#        UU5      5      n[!        SRC                  U Vs/ s H  nUR                  U5      (       d  M  UPM     sn5      5        [        R                  " S5        g! [
         a    Sn GN>f = fs  snf s  snf s  snf s  snnf s  snnf s  snf s  snf s  snf )z:Entry Point for completion of main and subcommand options.PIP_AUTO_COMPLETEN
COMP_WORDS
COMP_CWORD    help-)show	uninstallT)
local_onlyinstallpath=r      z-- )"osenvirongetsplitint
IndexErrorr   listr	   sysexit
startswithr   loweriter_installed_distributionscanonical_nameprintauto_complete_pathsr
   parseroption_list_allr   optparseSUPPRESS_HELP
_long_opts_short_optsnargsget_path_completion_typeoption_groupsoption_listappendr   from_iterablejoin)cwordscwordcurrentr,   subcommandsoptionssubcommand_namewordshould_list_installedenvlcdist	installedshould_list_installablesr   
subcommandoptopt_strx	prev_optsvkcompletion_typepathsoption	opt_labelioptsflattened_optss                                R/var/www/html/env/lib/python3.13/site-packages/pip/_internal/cli/autocompletion.pyautocompleterU      sj    "**, ::>>,''rzz~~l/K/KZZ%++-ab1F

<()E#  !F}%KG &*O"O 
 "f$HHQK$+$6$6s$; ; !
 T
 A
 !)+CB  <<<MMD&&11"5 $ ''vabz9 $##M   %D$K & ""3''HOy,H 	! $+GV<d =HHQK#O4
$$44Cxx81118;8X8XWWcii(8X  5 /5Q.CD.CQWWS\!_.C	D(/Ffq!1I3E6Aq6F&-Ggdag1F6Aq6gG2--
 'AE-23UTayUG3Fq	IayVAYr]d2S 	)  (.';';<';!';<F&&',,T2c""%88x5553>>COO#CCK &
 7vnUO"#6w#PQchh;H;a!,,w2G;HIJHHQK{  40
 EFG 4 = Is`    S 
$S)2S)S)S.2S3S8(S88S>S>T/T	T.TS&%S&r9   r:   rR   c                    US:  d  XS-
     R                  S5      (       d  gU H  nUR                  [        R                  :X  a  M#  [	        U5      R                  S5       Hs  nXS-
     R                  S5      S   U:X  d  M"  UR                  (       a2  [        S UR                  R                  S5       5       5      (       d  Me  UR                  s  s  $    M     g)a8  Get the type of path completion (``file``, ``dir``, ``path`` or None)

:param cwords: same as the environmental variable ``COMP_WORDS``
:param cword: same as the environmental variable ``COMP_CWORD``
:param opts: The available options to check
:return: path completion type (``file``, ``dir``, ``path`` or None)
r   r   N/r   r   c              3   *   #    U  H	  oS ;   v   M     g7f))r   filedirN ).0rI   s     rT   	<genexpr>+get_path_completion_type.<locals>.<genexpr>   s      *:PQ00:Ps   )r&   r   r.   r/   strr    metavarany)r9   r:   rR   rG   os        rT   r3   r3   {   s     qyqy)44S9988x---S$Aai &&s+A.!3{{c *:=++:K:KC:P* ' ' ;;& %      r;   rM   c              #     ^#    [         R                  R                  U 5      u  nm[         R                  R                  U5      n[         R                  " U[         R
                  5      (       d  g[         R                  R                  T5      mU4S j[         R                  " U5       5       nU H  n[         R                  R                  X55      n[         R                  R                  [         R                  R                  X%5      5      nUS:w  a*  [         R                  R                  U5      (       a  Uv   M  [         R                  R                  U5      (       d  M  [         R                  R                  US5      v   M     g7f)a\  If ``completion_type`` is ``file`` or ``path``, list all regular files
and directories starting with ``current``; otherwise only list directories
starting with ``current``.

:param current: The word to be completed
:param completion_type: path completion type(``file``, ``path`` or ``dir``)
:return: A generator of regular files and/or directories
Nc              3      >#    U  H<  n[         R                  R                  U5      R                  T5      (       d  M8  Uv   M>     g 7f)N)r   r   normcaser&   )r\   rI   filenames     rT   r]   &auto_complete_paths.<locals>.<genexpr>   s3      +arww/?/?/B/M/Mh/W+s
   7A	ArZ   r   )r   r   r    abspathaccessR_OKrf   listdirr8   isfileisdir)	r;   rM   	directorycurrent_path	file_listfrG   	comp_filerg   s	           @rT   r+   r+      s      ''--0Ix77??9-L99\277++ww)H::l+I ggll<+GG$$RWW\\)%?@	 e#s(;(;OWW]]3'',,y"-- s   EF%'F)r   N)__doc__r.   r   r$   	itertoolsr   typingr   r   r   r   pip._internal.cli.main_parserr   pip._internal.commandsr	   r
   pip._internal.metadatar   rU   r_   r!   r3   r+   r[   rc   rT   <module>rz      sy    G  	 
  0 0 < @ :jZI!)1#c]0. .s .x} .rc   