+
    j,i/#                       ^ RI Ht ^ RIt^ RIHt ^ RIHtHtHtH	t	 ^ RI
Ht ^ RIHt ^ RIHt ^ RIHt ^ R	IHt ^ R
IHt ^ RIHt ^ RIHtHt ^ RIHt ^ RIHtHt ^ RI H!t! ^ RI"H#t#H$t$ ^ RI%H&t' ^ RI(H)t) ^ RI*H+t+ ^ RI,H-t-H.t.H/t/H0t0H1t1H2t2H3t3H4t4H5t5 . R*Ot6R+R R llt7]	! R4      t8RR. R3R R llt9R,R R llt:R-R R llt;R.R R  llt<R.R! R" llt=RRR# R3R$ R% llt>R& R' lt?R( R) lt@R# )/    )annotationsN)get_running_loop)AnyCallableSequenceTypeVar)Application)get_app)Buffer)	Completerrun_in_executor_with_context)FilterOrBool)AnyFormattedText)
focus_nextfocus_previous)load_key_bindings)KeyBindingsmerge_key_bindings)Layout)AnyContainerHSplit)	Dimension)	BaseStyle)	Validator)	BoxButtonCheckboxListDialogLabelProgressBar	RadioListTextAreaValidationToolbar c               0    V ^8  d   QhRRRRRRRRRRR	R
/# )   titler   textyes_textstrno_textstyleBaseStyle | NonereturnzApplication[bool] )formats   "B/usr/lib/python3/dist-packages/prompt_toolkit/shortcuts/dialogs.py__annotate__r3   -   sD     & &&
& & 	&
 & &    c           
         R R lpR R lp\        V \        VRR7      \        W%R7      \        W6R7      .RR7      p\        Wt4      # )	z,
Display a Yes/No dialog.
Return a boolean.
c                   V ^8  d   QhRR/# r'   r/   Noner0   )r1   s   "r2   r3   #yes_no_dialog.<locals>.__annotate__9   s     $ $ $r4   c                 :    \        4       P                  R R7       R# )TresultNr
   exitr0   r4   r2   yes_handler"yes_no_dialog.<locals>.yes_handler9   s    	d#r4   c                   V ^8  d   QhRR/# r7   r0   )r1   s   "r2   r3   r9   <   s     % % %r4   c                 :    \        4       P                  R R7       R# )Fr;   Nr=   r0   r4   r2   
no_handler!yes_no_dialog.<locals>.no_handler<   s    	e$r4   Tr)   dont_extend_heightr)   handlerr(   bodybuttonswith_background)r   r    r   _create_app)r(   r)   r*   r,   r-   r?   rC   dialogs   &&&&&   r2   yes_no_dialogrO   -   sL    $% 664
 F v%%r4   _Tc          
     ,    V ^8  d   QhRRRRRRRRRR	/# )
r'   r(   r   r)   rK   zlist[tuple[str, _T]]r-   r.   r/   Application[_T]r0   )r1   s   "r2   r3   r3   O   s:     & &&
& "& 	&
 &r4   c                    R R lp\        T \        VRR7      V UUu. uF&  w  rV\        V\        P                  ! WF4      R7      NK(  	  uppRR7      p\        Ws4      # u uppi )zl
Display a dialog with button choices (given as a list of tuples).
Return the value associated with button.
c                    V ^8  d   QhRRRR/# )r'   vrP   r/   r8   r0   )r1   s   "r2   r3   #button_dialog.<locals>.__annotate__Z   s     ! !" ! !r4   c                :    \        4       P                  V R 7       R# r;   Nr=   )rU   s   &r2   button_handler%button_dialog.<locals>.button_handlerZ   s    	a r4   TrE   rG   rI   )r   r    r   	functoolspartialrM   )r(   r)   rK   r-   rY   trU   rN   s   &&&&    r2   button_dialogr^   O   sh    ! 6  
 9#4#4^#GH
 F v%%
s   ,Ac               @    V ^8  d   QhRRRRRRRRRRR	R
RRRRRRRR/
# )r'   r(   r   r)   ok_textr+   cancel_text	completerzCompleter | None	validatorzValidator | Nonepasswordr   r-   r.   defaultr/   zApplication[str]r0   )r1   s   "r2   r3   r3   j   sl     1& 1&1&
1& 1& 	1&
  1&  1& 1& 1& 1& 1&r4   c	                  aa R V3R llp	R V3R llp
\        W*R7      o\        V\        R7      p\        VRVVVV	R7      o\        V \	        \        VRR	7      S\        4       .\        ^^R
7      R7      SV.RR7      p\        W4      # )zJ
Display a text input box.
Return the given text, or None when cancelled.
c                    V ^8  d   QhRRRR/# )r'   bufr   r/   boolr0   )r1   s   "r2   r3   "input_dialog.<locals>.__annotate__z   s      F t r4   c                N   < \        4       P                  P                  S4       R # )T)r
   layoutfocus)rh   	ok_buttons   &r2   acceptinput_dialog.<locals>.acceptz   s    	y)r4   c                   V ^8  d   QhRR/# r7   r0   )r1   s   "r2   r3   rj   ~   s     . . .r4   c                 P   < \        4       P                  S P                  R 7       R# rX   )r
   r>   r)   )	textfields   r2   
ok_handler input_dialog.<locals>.ok_handler~   s    	inn-r4   rG   F)r)   	multilinerd   rb   rc   accept_handlerTrE   )	preferredmaxpaddingrI   )	r   _return_noner#   r   r   r    r$   DrM   )r(   r)   r`   ra   rb   rc   rd   r-   re   ro   rt   cancel_buttonrN   rn   rs   s   &&&&&&&&&    @@r2   input_dialogr   j   s      . . G8I\BMI 4D9!#
 q)
 M*F v%%r4   c          
     ,    V ^8  d   QhRRRRRRRRRR	/# )
r'   r(   r   r)   r`   r+   r-   r.   r/   Application[None]r0   )r1   s   "r2   r3   r3      s:     & &&
& & 	&
 &r4   c           	     l    \        V \        VRR7      \        V\        R7      .RR7      p\	        WC4      # )zE
Display a simple message box and wait until the user presses enter.
TrE   rG   rI   )r   r    r   r|   rM   )r(   r)   r`   r-   rN   s   &&&& r2   message_dialogr      s8     6Wl;<	F v%%r4   c               8    V ^8  d   QhRRRRRRRRRRR	R
RRRR/# )r'   r(   r   r)   r`   r+   ra   values,Sequence[tuple[_T, AnyFormattedText]] | Nonere   z	_T | Noner-   r.   r/   rR   r0   )r1   s   "r2   r3   r3      sX     $& $&$&
$& $& 	$&
 9$& $& $& $&r4   c           
        a	 Vf   . pR V	3R llp\        WER7      o	\        V \        \        VRR7      S	.^R7      \	        W'R7      \	        V\
        R7      .RR7      p\        W4      # )	z
Display a simple list of element the user can choose amongst.

Only one element can be selected at a time using Arrow keys and Enter.
The focus can be moved between the list and the Ok/Cancel button with tab.
c                   V ^8  d   QhRR/# r7   r0   )r1   s   "r2   r3   &radiolist_dialog.<locals>.__annotate__   s     8 8 8r4   c                 P   < \        4       P                  S P                  R 7       R# rX   )r
   r>   current_value)
radio_lists   r2   rt   $radiolist_dialog.<locals>.ok_handler   s    	j667r4   )r   re   TrE   rz   rG   rI   )r"   r   r   r    r   r|   rM   )
r(   r)   r`   ra   r   re   r-   rt   rN   r   s
   &&&&&&&  @r2   radiolist_dialogr      sw     ~8 8 &:J6
C

 4\:
 F v%%r4   c               8    V ^8  d   QhRRRRRRRRRRR	R
RRRR/# )r'   r(   r   r)   r`   r+   ra   r   r   default_valueszSequence[_T] | Noner-   r.   r/   zApplication[list[_T]]r0   )r1   s   "r2   r3   r3      sX     $& $&$&
$& $& 	$&
 9$& ($& $& $&r4   c           
        a	 Vf   . pR V	3R llp\        WER7      o	\        V \        \        VRR7      S	.^R7      \	        W'R7      \	        V\
        R7      .RR7      p\        W4      # )	z
Display a simple list of element the user can choose multiple values amongst.

Several elements can be selected at a time using Arrow keys and Enter.
The focus can be moved between the list and the Ok/Cancel button with tab.
c                   V ^8  d   QhRR/# r7   r0   )r1   s   "r2   r3   )checkboxlist_dialog.<locals>.__annotate__   s     6 6 6r4   c                 P   < \        4       P                  S P                  R 7       R# rX   )r
   r>   current_values)cb_lists   r2   rt   'checkboxlist_dialog.<locals>.ok_handler   s    	g445r4   )r   r   TrE   rz   rG   rI   )r   r   r   r    r   r|   rM   )
r(   r)   r`   ra   r   r   r-   rt   rN   r   s
   &&&&&&&  @r2   checkboxlist_dialogr      sw     ~6 6 &HG6@

 4\:
 F v%%r4   c                     R # Nr0   )as   *r2   <lambda>r     s    4r4   c          
     ,    V ^8  d   QhRRRRRRRRRR	/# )
r'   r(   r   r)   run_callbackz>Callable[[Callable[[int], None], Callable[[str], None]], None]r-   r.   r/   r   r0   )r1   s   "r2   r3   r3      s;     7 77
7 Q7 7 7r4   c                  aaaaa	a
aa \        4       o\        4       o	\        R\        RR7      R7      o\	        \        \        \        VR7      4      \        S\        P                  ! ^4      R7      S	.4      V RR7      p\        WC4      oR VV	3R	 llo
R
 VVV3R lloR VVVV
3R lloR V3R llpSP                  P                  V4       S# )zn
:param run_callback: A function that receives as input a `set_percentage`
    function and it does the work.
F)rx   )	focusableheight)r)   rz   T)rJ   r(   rL   c                    V ^8  d   QhRRRR/# )r'   valueintr/   r8   r0   )r1   s   "r2   r3   %progress_dialog.<locals>.__annotate__!  s      c d r4   c                H   < \        V 4      Sn        SP                  4        R # r   )r   
percentage
invalidate)r   appprogressbars   &r2   set_percentage'progress_dialog.<locals>.set_percentage!  s    !$Ur4   c                    V ^8  d   QhRRRR/# )r'   r)   r+   r/   r8   r0   )r1   s   "r2   r3   r   %  s      s t r4   c                t   < SP                  SP                  P                  V 4       SP                  4        R # r   )call_soon_threadsafebufferinsert_textr   )r)   r   loop	text_areas   &r2   log_text!progress_dialog.<locals>.log_text%  s)    !!)"2"2">">Er4   c                   V ^8  d   QhRR/# r7   r0   )r1   s   "r2   r3   r   +  s      4 r4   c                 f   <  S! SS4       S P                  4        R #   S P                  4        i ; ir   )r>   )r   r   r   r   s   r2   startprogress_dialog.<locals>.start+  s%    	2HHJCHHJs   	 0c                   V ^8  d   QhRR/# r7   r0   )r1   s   "r2   r3   r   1  s     , ,T ,r4   c                    < \        S 4       R # r   r   )r   s   r2   pre_run progress_dialog.<locals>.pre_run1  s    $U+r4   l    d(	 )r   r!   r#   r}   r   r   r   r    exactrM   pre_run_callablesappend)r(   r)   r   r-   rN   r   r   r   r   r   r   r   r   s   &&f&  @@@@@@@r2   progress_dialogr      s     D-K 6"	I Et$%Iqwwqz2
 
F f
$C   , ,   )Jr4   c               $    V ^8  d   QhRRRRRR/# )r'   rN   r   r-   r.   r/   zApplication[Any]r0   )r1   s   "r2   r3   r3   9  s#       -= BR r4   c                    \        4       pVP                  R 4      ! \        4       VP                  R4      ! \        4       \	        \        V 4      \        \        4       V.4      RVRR7      # )tabzs-tabT)rl   key_bindingsmouse_supportr-   full_screen)r   addr   r   r	   r   r   r   )rN   r-   bindingss   && r2   rM   rM   9  sY    }HLL
#LL.)f~'):)<h(GH r4   c                   V ^8  d   QhRR/# r7   r0   )r1   s   "r2   r3   r3   H  s      d r4   c                 6    \        4       P                  4        R# )z!Button handler that returns None.Nr=   r0   r4   r2   r|   r|   H  s    INNr4   )rO   r^   r   r   r   r   r   )r%   r%   YesNoN)	r%   r%   OKCancelNNFNr%   )r%   r%   OkN)r%   r%   r   r   NNN)A
__future__r   r[   asyncior   typingr   r   r   r   prompt_toolkit.applicationr	   "prompt_toolkit.application.currentr
   prompt_toolkit.bufferr   prompt_toolkit.completionr   prompt_toolkit.eventloopr   prompt_toolkit.filtersr   prompt_toolkit.formatted_textr   )prompt_toolkit.key_binding.bindings.focusr   r   #prompt_toolkit.key_binding.defaultsr   'prompt_toolkit.key_binding.key_bindingsr   r   prompt_toolkit.layoutr    prompt_toolkit.layout.containersr   r   prompt_toolkit.layout.dimensionr   r}   prompt_toolkit.stylesr   prompt_toolkit.validationr   prompt_toolkit.widgetsr   r   r   r   r    r!   r"   r#   r$   __all__rO   rP   r^   r   r   r   r   r   rM   r|   r0   r4   r2   <module>r      s    "  $ 3 3 2 6 ( / A / : P A S ( A : + /
 
 
&> T] !$&"	&61&h&&$&N$&P !"7tr4   