Ë
     ^ãj  ã                  óè   — d dl mZ d dlZd dlmZmZmZ d dlZd dlm	Z	 ddl
mZ ddlmZ ddlmZ dd	lmZmZmZ dd
lmZmZ ddlmZmZmZ g d¢Z	 	 	 	 	 	 	 	 dd„Zi ddf	 	 	 	 	 	 	 	 	 dd„Zddd„Zy)é    )ÚannotationsN)ÚAnyÚMutableMappingÚcast)ÚInMemoryHistoryé   )ÚClickCompleter)ÚReplContext)Ú	ClickExit)ÚCommandLineParserErrorÚExitReplExceptionÚInvalidGroupFormat)ÚISATTYÚget_current_repl_ctx)Ú_execute_internal_and_sys_cmdsÚ_get_protected_argsÚ_set_protected_args)Úbootstrap_promptÚregister_replÚreplc                óZ   — t        «       t        | |¬«      ddœ}|j                  |«       |S )z®
    Bootstrap prompt_toolkit kwargs or use user defined values.

    :param group: click.MultiCommand object
    :param prompt_kwargs: The user specified prompt kwargs.
    )Úctxz> )ÚhistoryÚ	completerÚmessage)r   r	   Úupdate)ÚgroupÚprompt_kwargsr   Údefaultss       úR/var/www/html/metafoliadorv2/venv/lib/python3.12/site-packages/click_repl/_repl.pyr   r      s1   € ô #Ó$Ü# E¨sÔ3Øñ€Hð ‡O�O�MÔ"Ø€Oó    Tc           
     óÆ  ‡— | }| j                   �0t        | j                  t        j                  «      s| j                   }t        t        j                  |j                  «      }|j                  D ]~  }t        |t        j                  «      sŒ|j                  |j                     �Œ8|j                  rŒEt        t        |«      j                  › d|j                  › d|j                  › d�«      ‚ | j                  j                  }i }t        |t        j                  «      rC|j                  D �	�
ci c]+  }	|	j                  |«      D ]  }
|
|	j!                  ||
«      “Œ Œ- }}	}
n&t        |t        j"                  «      r|j$                  }|j'                  |d«      }t)        |t+        |||«      t-        d¬«      «      Št.        rd	ˆfd„}nd	ˆfd„}‰5  	 	  |«       }|st.        rŒnJ	 t5        |||«      }|€Œ$	 	 t;        |«      }	 t=        ||«       |j?                  |«       t=        ||«       	 Œ\ddd«       |�|||<   yyc c}
}	w # t0        $ r Y Œt2        $ r Y Œ,w xY w# t6        $ r Y Œ˜t8        $ r Y ŒEw xY w# t=        ||«       w xY w# t        j@                  $ r}|jC                  «        Y d}~Œƒd}~wtD        tF        f$ r Y Œ—t8        $ r Y Œ w xY w# 1 sw Y   Œ¥xY w)
a8  
    Start an interactive shell. All subcommands are available in it.

    :param old_ctx: The current Click context.
    :param prompt_kwargs: Parameters passed to
        :py:func:`prompt_toolkit.PromptSession`.

    If stdin is not a TTY, no prompt will be printed, but only commands read
    from stdin.
    Nz 'z+' requires value for an optional argument 'z' in REPL modeT)Úsilentc                 ó8   •— ‰ j                   j                  «       S ©N)ÚsessionÚprompt)Úrepl_ctxs   €r    Úget_commandzrepl.<locals>.get_commandr   s   ø€ Ø×#Ñ#×*Ñ*Ó,Ð,r!   c                 ó–   •— t         j                  j                  «       j                  «       } ‰j                  j                  | «       | S r%   )ÚsysÚstdinÚreadlineÚstripÚ_historyÚappend)Úinpr(   s    €r    r)   zrepl.<locals>.get_commandw   s7   ø€ Ü—)‘)×$Ñ$Ó&×,Ñ,Ó.ˆCØ×Ñ×$Ñ$ SÔ)ØˆJr!   )ÚreturnÚstr)$ÚparentÚ
isinstanceÚcommandÚclickÚMultiCommandr   ÚparamsÚArgumentÚnameÚrequiredr   ÚtypeÚ__name__ÚCommandCollectionÚsourcesÚlist_commandsr)   ÚGroupÚcommandsÚpopr
   r   r   r   ÚKeyboardInterruptÚEOFErrorr   r   r   r   r   ÚinvokeÚClickExceptionÚshowr   Ú
SystemExit)Úold_ctxr   Úallow_system_commandsÚallow_internal_commandsÚ	group_ctxr   ÚparamÚrepl_command_nameÚavailable_commandsÚsourceÚcmd_nameÚoriginal_commandr)   r6   ÚargsÚold_protected_argsÚer(   s                    @r    r   r   -   sê  ø€ ð" €Ið ‡~�~Ð!¬*Ø�‰œ×+Ñ+ô+ð —N‘Nˆ	ä”×#Ñ# Y×%6Ñ%6Ó7€Eð —‘ò 	ˆä�uœeŸn™nÕ-Ø× Ñ  §¡Ñ,Ñ4Ø—N“Nä$Ü˜“;×'Ñ'Ð(¨¨5¯:©:¨,ð 7)Ø).¯©¨°NðDóð ð	ð  Ÿ™×,Ñ,Ðà=?Ðä�%œ×0Ñ0Ô1ð  Ÿ-™-÷
àØ"×0Ñ0°Ó;ò
ð ð �f×(Ñ(¨°HÓ=Ñ=ð
Øð
Ðò 
ô 
�Eœ5Ÿ;™;Ô	'Ø"Ÿ^™^Ðà)×-Ñ-Ð.?ÀÓFÐäØÜ˜ ¨yÓ9Ü DÔ)ó€Hõ ö	-õ
	ð
 
ñ *ØðÙ%›-�ñ ÝØàðÜ5ØÐ4Ð6Kó�ð �<Øð  ðä%8¸Ó%CÐ"ðGÜ'¨	°4Ô8Ø—L‘L Ô+ä'¨	Ð3EÕFðE ÷*ðX Ð#Ø0@ÐÐ,Ò-ð $ùóS
øôB %ò ÙÜò Ùðûô  *ò Ùä$ò Ùðûô (¨	Ð3EÕFûÜ×'Ñ'ò Ø—‘—‘ûÜœzÐ*ò Ùä$ò Ùðú÷S*ð *úsÌ   Ä20IÇKÇI
Ç
KÇ*I#Ç9KÇ<JÈI<È%JÈ1KÉ
	I ÉKÉI ÉKÉI É KÉ#	I9É,KÉ.I9É6KÉ8I9É9KÉ<J
Ê
JÊKÊ J5Ê0KÊ5KËKË	KËKËKËKËK c                ób   —  | j                  |¬«      t        j                  t        «      «       y)z9Register :func:`repl()` as sub-command *name* of *group*.)r;   N)r6   r7   Úpass_contextr   )r   r;   s     r    r   r   ¬   s"   € à€E‡M�M�t€MÓœU×/Ñ/´Ó5Õ6r!   )r   zclick.MultiCommandr   údict[str, Any]r   úclick.Contextr2   rZ   )
rK   r[   r   rZ   rL   ÚboolrM   r\   r2   ÚNone)r   )r   zclick.Groupr2   r]   )Ú
__future__r   r+   Útypingr   r   r   r7   Úprompt_toolkit.historyr   Ú
_completerr	   Úcorer
   Ú
exceptionsr   r   r   r   Úglobals_r   r   Úutilsr   r   r   Ú__all__r   r   r   © r!   r    ú<module>rh      s³   ðÝ "ã 
ß ,Ñ ,ã Ý 2å &Ý Ý !ß UÑ Uß 2÷ñ ò 8€ðØðà!ðð 
ðð ó	ð0 %'Ø"&Ø$(ð	|AØð|Aà!ð|Að  ð|Að "ð	|Að
 
ó|Aõ~7r!   