
    4ՔhL;                    v   % S SK Jr  S SKrS SKJrJrJ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  SSKJr  SSK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   SSK!J"r"J#r#  SSK$J%r%  SSK&J'r'  \(       a  S SK(J)r)   " S S\5      r* " S S\ \5      r+\,S:X  Ga  S SK-r-S SK.r.S SK/J0r0  S SK	J1r1JrJ2r2  SSK3J4r4  SSKJr  SSK5J+r+  SSK6J7r7  SSK8J9r9  SSK:J;r;  SSK<J=r=  \" 5       r\;" SSS S!9r:\=" S"S#S$5      r<\<R}                  S%S&S'5        S(\7" S)5      S*\<S+S,S-S..S/\:\9" S05      /	r?\0" \?5      r@/ S1QrA\+" \S29 rB0 rCS3\DS4'   \E" S55       GHZ  rF\A\F\G" \A5      -     rH\A GHA  rI\I\H:X  a  M  \.R                  " S65        \-R                  " S S75      S:  a  \R                  \M" \@5      5        S8\-RZ                  " 5       S9-  S-   -  \C\H\I4'   \G" \C5      \G" \A5      S-
  :  a(  \CR                  \O" \CR                  5       5      S    5        \=" S:S;9r<\<R                  S<5        \<R                  S=5        \<R                  S>5        \CR                  5        H+  u  u  rSrTrU\<R}                  \S\T\'" \US? \US@:  a  SAOSBSC95        M-     \BR                  \4R                  " \<5      5        GMD     GM]     SSS5        gg! , (       d  f       g= f)D    )annotationsN)EventRLockThread)TracebackType)	IOTYPE_CHECKINGAnyCallableListOptionalTextIOTypecast   )get_console)ConsoleConsoleRenderableGroupRenderableType
RenderHook)Control)	FileProxy)JupyterMixin)
LiveRenderVerticalOverflowMethod)Screen)Text)Selfc                  D   ^  \ rS rSrSrSU 4S jjrSS jrSS jrSrU =r	$ )	_RefreshThread   z3A thread that calls refresh() at regular intervals.c                V   > Xl         X l        [        5       U l        [        TU ]  SS9  g )NT)daemon)liverefresh_per_secondr   donesuper__init__)selfr%   r&   	__class__s      M/var/www/auris/envauris/lib/python3.13/site-packages/pip/_vendor/rich/live.pyr)   _RefreshThread.__init__   s'    	"4G	%    c                8    U R                   R                  5         g N)r'   setr*   s    r,   stop_RefreshThread.stop   s    		r.   c                   U R                   R                  SU R                  -  5      (       d  U R                  R                     U R                   R                  5       (       d  U R                  R                  5         S S S 5        U R                   R                  SU R                  -  5      (       d  M  g g ! , (       d  f       N?= f)Nr   )r'   waitr&   r%   _lockis_setrefreshr2   s    r,   run_RefreshThread.run"   sy    ))..T%<%<!<==yy''))II%%' ! ))..T%<%<!<== s   :B77
C)r'   r%   r&   )r%   z'Live'r&   floatreturnNoner=   r>   )
__name__
__module____qualname____firstlineno____doc__r)   r3   r:   __static_attributes____classcell__)r+   s   @r,   r!   r!      s    =&( (r.   r!   c                     \ rS rSrSr SSSSSSSSSSS.	                     SS	 jjjr\SS
 j5       rSS jrSSS jjr	SS jr
SS jr        S S jrSS jrSS jr\SS j5       rSS.S!S jjrSS jr    S"S jrSrg)#Live)   a  Renders an auto-updating live display of any given renderable.

Args:
    renderable (RenderableType, optional): The renderable to live display. Defaults to displaying nothing.
    console (Console, optional): Optional Console instance. Defaults to an internal Console instance writing to stdout.
    screen (bool, optional): Enable alternate screen mode. Defaults to False.
    auto_refresh (bool, optional): Enable auto refresh. If disabled, you will need to call `refresh()` or `update()` with refresh flag. Defaults to True
    refresh_per_second (float, optional): Number of times per second to refresh the live display. Defaults to 4.
    transient (bool, optional): Clear the renderable on exit (has no effect when screen=True). Defaults to False.
    redirect_stdout (bool, optional): Enable redirection of stdout, so ``print`` may be used. Defaults to True.
    redirect_stderr (bool, optional): Enable redirection of stderr. Defaults to True.
    vertical_overflow (VerticalOverflowMethod, optional): How to handle renderable when it is too tall for the console. Defaults to "ellipsis".
    get_renderable (Callable[[], RenderableType], optional): Optional callable to get renderable. Defaults to None.
NFT   ellipsis)	consolescreenauto_refreshr&   	transientredirect_stdoutredirect_stderrvertical_overflowget_renderablec       	           US:  d   S5       eXl         Ub  UO	[        5       U l        X0l        SU l        Xpl        Xl        S U l        S U l        [        5       U l
        S U l        X@l        SU l        U(       a  SOUU l        S U l        XPl        Xl        Xl        ['        U R)                  5       U	S9U l        SU l        g )Nr   zrefresh_per_second must be > 0FT)rR   )_renderabler   rL   _screen_alt_screen_redirect_stdout_redirect_stderr_restore_stdout_restore_stderrr   r7   
ipy_widgetrN   _startedrO   _refresh_threadr&   rR   _get_renderabler   rS   _live_render_nested)r*   
renderablerL   rM   rN   r&   rO   rP   rQ   rR   rS   s              r,   r)   Live.__init__9   s     "A%G'GG%%")"5w;=  / /2626W
)-(#!'Y9="4!2-&!5F
 r.   c                    U R                   $ )z'Check if live display has been started.)r]   r2   s    r,   
is_startedLive.is_startedb   s     }}r.   c                j    U R                   b  U R                  5       OU R                  nU=(       d    S$ )N )r_   rU   )r*   rb   s     r,   rS   Live.get_renderableg   s9     ##/   "!! 	
 Rr.   c                   U R                      U R                  (       a
   SSS5        gSU l        U R                  R                  U 5      (       d  SU l         SSS5        gU R
                  (       a   U R                  R                  S5      U l        U R                  R                  S5        U R                  5         U R                  R                  U 5        U(       a   U R                  5         U R                  (       a4  [        X R                   5      U l        U R"                  R%                  5         SSS5        g! [         a    U R                  5         e f = f! , (       d  f       g= f)zdStart live rendering display.

Args:
    refresh (bool, optional): Also refresh. Defaults to False.
NTF)r7   r]   rL   set_livera   rV   set_alt_screenrW   show_cursor_enable_redirect_iopush_render_hookr9   	Exceptionr3   rN   r!   r&   r^   start)r*   r9   s     r,   rq   
Live.starto   s
    ZZ}} Z !DM<<((..# Z ||#'<<#>#>t#D LL$$U+$$&LL))$/LLN   '5d<S<S'T$$$**,5 Z" ! 
 IIK# Zs0   E/E!A>E D>0AE>EE
E+c                   U R                      U R                  (       d
   SSS5        gSU l        U R                  R                  5         U R                  (       a@  U R
                  (       d%  U R                  R                  U R                  5         SSS5        gU R                  (       a.  U R                  b!  U R                  R                  5         SU l	        SU l        U R                      U R                  (       d+  U R                  R                  (       d  U R                  5         U R                  5         U R                  R!                  5         U R                  (       d5  U R                  R"                  (       a  U R                  R%                  5         U R                  R'                  S5        U R                  (       a  U R                  R)                  S5        U R
                  (       aD  U R                  (       d3  U R                  R+                  U R,                  R/                  5       5        U R0                  b+  U R
                  (       a  U R0                  R3                  5         SSS5        SSS5        g! U R                  5         U R                  R!                  5         U R                  (       d5  U R                  R"                  (       a  U R                  R%                  5         U R                  R'                  S5        U R                  (       a  U R                  R)                  S5        U R
                  (       aD  U R                  (       d3  U R                  R+                  U R,                  R/                  5       5        U R0                  b-  U R
                  (       a  U R0                  R3                  5         f f f = f! , (       d  f       GNc= f! , (       d  f       g= f)zStop live rendering display.NFvisibleT)r7   r]   rL   
clear_livera   rO   printrb   rN   r^   r3   rR   rW   
is_jupyterr9   _disable_redirect_iopop_render_hookis_terminallinerm   rl   controlr`   restore_cursorr\   closer2   s    r,   r3   	Live.stop   sh   ZZ== Z "DMLL##%||~~LL&&t7 Z   T%9%9%E$$))+'+$%.D"0++DLL4K4K--/LL002++0H0H))+LL,,T2''33E:~~d.>.>,,T->->-M-M-OP2t~~--/  Z( --/LL002++0H0H))+LL,,T2''33E:~~d.>.>,,T->->-M-M-OP2t~~--/ 8F2  ZsJ   OA)OAO-O/<J +EO/O EOO
O	O
O+c                <    U R                  U R                  S LS9  U $ )Nr9   )rq   rU   r2   s    r,   	__enter__Live.__enter__   s     

4++47
8r.   c                $    U R                  5         g r0   )r3   )r*   exc_typeexc_valexc_tbs       r,   __exit__Live.__exit__   s     			r.   c                x   U R                   R                  (       d  U R                   R                  (       Ga  U R                  (       ao  [	        [
        R                  [        5      (       dL  [
        R                  U l        [        S[        U R                   [
        R                  5      5      [
        l        U R                  (       aq  [	        [
        R                  [        5      (       dM  [
        R                  U l        [        S[        U R                   [
        R                  5      5      [
        l        gggg)z&Enable redirecting of stdout / stderr.r   N)rL   rz   rw   rX   
isinstancesysstdoutr   rZ   r   rY   stderrr[   r2   s    r,   rn   Live._enable_redirect_io   s    <<##t||'>'>'>$$Z

I-N-N'*zz$!(IdllCJJ,OP
$$Z

I-N-N'*zz$!(IdllCJJ,OP
 .O$	 (?r.   c                    U R                   (       a&  [        SU R                   5      [        l        SU l         U R                  (       a'  [        SU R                  5      [        l        SU l        gg)z'Disable redirecting of stdout / stderr.r   N)rZ   r   r   r   r[   r   r2   s    r,   rx   Live._disable_redirect_io   sQ    h(<(<=CJ#'D h(<(<=CJ#'D   r.   c                    U R                   R                  nU(       a.  XS   L a'  [        U Vs/ s H  o"R                  5       PM     sn6 nOU R                  5       nU R                  (       a  [        U5      $ U$ s  snf )z_Get the renderable that is being displayed

Returns:
    RenderableType: Displayed renderable.
r   )rL   _live_stackr   rS   rW   r   )r*   
live_stackr%   rb   s       r,   rb   Live.renderable   sk     \\--
$Q-/: N:4!4!4!6: NOJ,,.J%)%5%5vj!E:E !Os   A:r   c                   [        U[        5      (       a  U R                  R                  U5      nU R                     Xl        U(       a  U R                  5         SSS5        g! , (       d  f       g= f)zUpdate the renderable that is being displayed

Args:
    renderable (RenderableType): New renderable to use.
    refresh (bool, optional): Refresh the display. Defaults to False.
N)r   strrL   
render_strr7   rU   r9   )r*   rb   r9   s      r,   updateLive.update   sH     j#&&00<JZZ) ZZs   A$$
A2c                   U R                      U R                  R                  U R                  5        U R                  (       aL  U R
                  R                  (       a'  U R
                  R                  S   R                  5          SSS5        gU R
                  R                  (       a   SSK	J
n  SSKJn  U R                  c  U" 5       U l        U" U R                  5        U R                     U R                  R                  SS9  U R
                  R                  U R                  R                  5        SSS5        OU R
                  R&                  (       aT  U R
                  R(                  (       d9  U R
                     U R
                  R                  [+        5       5        SSS5        OZU R,                  (       dI  U R.                  (       d8  U R
                     U R
                  R                  [+        5       5        SSS5        SSS5        g! , (       d  f       N= f! [          a    SSKnUR%                  S5         N;f = f! , (       d  f       NM= f! , (       d  f       N^= f! , (       d  f       g= f)z&Update the display of the Live Render.r   N)display)OutputT)r6   z(install "ipywidgets" for Jupyter support)r7   r`   set_renderablerb   ra   rL   r   r9   rw   IPython.displayr   
ipywidgetsr   r\   clear_outputrv   ImportErrorwarningswarnrz   is_dumb_terminalr   r]   rO   )r*   r   r   r   s       r,   r9   Live.refresh   s   ZZ,,T__=||<<++LL,,Q/779 Z ||&&I71 .*0(044$4?**4+<+<+G+GH ) ))$,,2O2O\\LL&&wy1 "\ MM$..\\LL&&wy1 "; Z( ) # N#MM"LMN "\
 "\; Zs   A:I+I+,H$87I+/A	H8AI+$I	'7I+$II+
H!	I+$II+II+	
I	I+
I(	$I++
I9c                   U R                   U R                  l         U R                  R                  (       ah  U R                     U R
                  (       a  [        R                  " 5       OU R                  R                  5       nU/UQU R                  PnSSS5        U$ U R                  (       d!  U R                  (       d  / UQU R                  PnU$ ! , (       d  f       U$ = f)z;Process renderables to restore cursor and display progress.N)rR   r`   rL   is_interactiver7   rW   r   homeposition_cursorr]   rO   )r*   renderablesresets      r,   process_renderablesLive.process_renderables  s     /3.D.D+<<&& '' LLN**::< 
  %F{FD4E4EF  	 dnn;K;):):;K  s   AC
C")rW   r_   r`   r7   ra   rY   rX   r^   rU   r[   rZ   rV   r]   rN   rL   r\   r&   rO   rR   r0   )rb   zOptional[RenderableType]rL   zOptional[Console]rM   boolrN   r   r&   r<   rO   r   rP   r   rQ   r   rR   r   rS   z&Optional[Callable[[], RenderableType]]r=   r>   )r=   r   )r=   r   )F)r9   r   r=   r>   r?   )r=   r   )r   zOptional[Type[BaseException]]r   zOptional[BaseException]r   zOptional[TracebackType]r=   r>   )rb   r   r9   r   r=   r>   )r   List[ConsoleRenderable]r=   r   )r@   rA   rB   rC   rD   r)   propertyre   rS   rq   r3   r   r   rn   rx   rb   r   r9   r   rE    r.   r,   rH   rH   )   s=   " 04' &*!$% $ $4>AE',' #	'
 ' ' "' ' ' ' 2' ?' 
'R    -D 0D/ ) (	
 
Q( F F EJ  2D2	 r.   rH   __main__)cycle)Dictr   Tuple)Align)r   )rH   )Panel)Rule)Syntax)Tablea~  def loop_last(values: Iterable[T]) -> Iterable[Tuple[bool, T]]:
    """Iterate and generate a tuple with a flag for last value."""
    iter_values = iter(values)
    try:
        previous_value = next(iter_values)
    except StopIteration:
        return
    for value in iter_values:
        yield False, previous_value
        previous_value = value
    yield True, previous_valuepythonT)line_numbersfoobarbaz123zYou can make the terminal shorter and taller to see the live table hideText may be printed while the progress bars are rendering.z(In fact, [i]any[/i] renderable will workzSuch as [magenta]tables[/]...zPretty printed structures...examplezPretty printed)typetextz	Syntax...zGive it a try!)SGDMYREURUSDAUDJPYCNHHKDCADINRDKKGBPRUBNZDMXNIDRTWDTHBVND)rL   zDict[Tuple[str, str], float]exchange_rate_dictd   g?
      i@  zExchange Rates)titlezSource CurrencyzDestination CurrencyzExchange Ratez.4fg      ?redgreen)style)X
__future__r   r   	threadingr   r   r   typesr   typingr   r	   r
   r   r   r   r   r   r   rh   r   rL   r   r   r   r   r   r|   r   
file_proxyr   jupyterr   live_renderr   r   rM   r   r   r   typing_extensionsr   r!   rH   r@   randomtime	itertoolsr   r   r   alignr   r%   panelr   ruler   syntaxr   tabler   add_rowprogress_renderablesexamples	exchanges
live_tabler   __annotations__rangeindexlenselect_exchangeexchangesleeprandintlognextpoplistkeys
add_columnitemssourcedestexchange_rater   centerr   r.   r,   <module>r
     s   " 
 * *  W W W  R R  ! ! ;  &(V (&|< |~ z(( "iG
	" 	F  %&E	MM#sC 	E89'&$45 )*HI* 
g	*;=8=3ZE'I(>?O%.

3>>!R(1,KKX/BE]]_s*a/C"OX#>? )*S^a-??&**40B0G0G0I+J1+MN$45  !23  !78  15G5M5M5O1NVTMMM,S1+83+>%G 6P !!%,,u"567 &   
	O N 
	s   1E/J**
J8