Ë
    V.jÖr  ã                  óü  — d Z ddlmZ ddlmZmZmZmZmZ ddl	m
Z
 ddlmZ ddlmZmZmZmZmZ ddlmZ ddlmZ dd	lmZmZ dd
lmZmZ ddlmZ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,m-Z- erddl.m/Z/ ddl0m1Z1 ddgZ2	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 d d„Z3 G d„ de4«      Z5 G d„ dee6e*f   «      Z7 G d„ dee6e8f   «      Z9 G d„ de«      Z: G d„ d«      Z;	 	 d!	 	 	 	 	 	 	 	 	 	 	 d"d„Z<y)#z_
Renders the command line on the console.
(Redraws parts of the input line that were changed.)
é    )Úannotations)ÚFIRST_COMPLETEDÚFutureÚensure_futureÚsleepÚwait)Údeque)ÚEnum)ÚTYPE_CHECKINGÚAnyÚCallableÚDictÚHashable)Úget_app)ÚCursorShape)ÚPointÚSize)ÚFilterOrBoolÚ	to_filter)ÚAnyFormattedTextÚto_formatted_text)ÚMouseHandlers)ÚCharÚScreenÚWritePosition)Ú
ColorDepthÚOutput)ÚAttrsÚ	BaseStyleÚDummyStyleTransformationÚStyleTransformation)ÚApplication)ÚLayoutÚRendererÚprint_formatted_textÚ_StyleStringToAttrsCacheÚ_StyleStringHasStyleCachec                óŒ  ‡‡‡‡	‡
‡‡‡ ‡!‡"‡#‡$‡%— |j                   |j                  cŠ$}|j                  Š%|j                  }|j                  Š"|j
                  Š!|j                  Š|j                  Š |j                  Š|j                  «        dˆ!ˆfd„Š#d	ˆˆˆ ˆˆ#ˆ$ˆ%fd„}d
ˆ"ˆ	ˆˆˆ%fd„}dˆ
fd„}|s ‰#«        |r|s|j                  «        |s|r|‰$k7  r4 |t        dd¬«      «      Š ‰#«        |j                  «        t        «       }t        |j                  |«      }t        t!        |j                  |j                  «      |«      }t#        |«      D �]>  }|j$                  |   }|j$                  |   }|j&                  |   }t        ‰$dz
   ||«      «      }t        ‰$dz
   ||«      «      }d}||k  r¥||   }||   }|j(                  xs d}|j*                  |j*                  k7  s|j,                  |j,                  k7  rN |t        ||¬«      «      Š||v r |||   «        ||«       t        ‰j.                  |z   ‰j0                  ¬«      Š||z  }||k  rŒ¥|s�Œ||k  s�Œ |t        |dz   |¬«      «      Š ‰#«        |j3                  «        �ŒA ||j                  kD  r |t        d|dz
  ¬«      «      Š|r$ |t        d|¬«      «      Š|j                  «        n+ ||j5                  | j6                  j8                  «      «      Š|s|s|j;                  «         ‰#«        |j<                  r|j=                  «        ‰‰fS )aœ  
    Render the diff between this screen and the previous screen.

    This takes two `Screen` instances. The one that represents the output like
    it was during the last rendering and one that represents the current
    output raster. Looking at these two `Screen` instances, this function will
    render the difference by calling the appropriate methods of the `Output`
    object that only paint the changes to the terminal.

    This is some performance-critical code which is heavily optimized.
    Don't change things without profiling first.

    :param current_pos: Current cursor position.
    :param last_style: The style string, used for drawing the last drawn
        character.  (Color/attributes.)
    :param attrs_for_style_string: :class:`._StyleStringToAttrsCache` instance.
    :param width: The width of the terminal.
    :param previous_width: The width of the terminal during the last rendering.
    c                 ó   •—  ‰ «        dŠy)z'Wrapper around Output.reset_attributes.N© )Ú_output_reset_attributesÚ
last_styles   €€úYC:\xampp\htdocs\tradingbinance\backend\.venv\Lib\site-packages\prompt_toolkit/renderer.pyÚreset_attributesz-_output_screen_diff.<locals>.reset_attributesZ   s   ø€ ñ 	!Ô"Ø‰
ó    c                óô  •— ‰j                   ‰j                  }}| j                  |kD  r5 ‰«         ‰	d| j                  |z
  z  «       d} ‰| j                   «       | S | j                  |k  r ‰|| j                  z
  «       |‰dz
  k\  r ‰	d«        ‰| j                   «       | S | j                   |k  s|‰dz
  k\  r ‰|| j                   z
  «       | S | j                   |kD  r ‰| j                   |z
  «       | S )z9Move cursor to this `new` point. Returns the given Point.ú
r   é   Ú©ÚxÚy)
ÚnewÚ	current_xÚ	current_yÚ_output_cursor_backwardÚ_output_cursor_forwardÚ_output_cursor_upÚcurrent_posr.   ÚwidthÚwrites
      €€€€€€€r-   Úmove_cursorz(_output_screen_diff.<locals>.move_cursor`   sì   ø€ à*Ÿ}™}¨k¯m©m�9ˆ	à�5‰5�9Òñ
 ÔÙ�&˜CŸE™E IÑ-Ñ.Ô/ØˆIÙ" 3§5¡5Ô)ØˆJØ�U‰U�YÒÙ˜i¨#¯%©%Ñ/Ô0à˜ ™	Ò!Ù�$ŒKÙ" 3§5¡5Ô)ð ˆ
ð �U‰U�YÒ )¨u°q©yÒ"8Ù# I°·±Ñ$5Ô6ð ˆ
ð �U‰U�YÒÙ" 3§5¡5¨9Ñ#4Ô5àˆ
r/   c                óÊ   •— ‰| j                   k(  r ‰| j                  «       y‰| j                      }‰r|‰‰   k7  r	 ‰|‰«        ‰| j                  «       | j                   Šy)z5
        Write the output of this character.
        N)ÚstyleÚchar)rC   Ú	new_attrsÚ_output_set_attributesÚattrs_for_style_stringÚcolor_depthr,   r?   s     €€€€€r-   Úoutput_charz(_output_screen_diff.<locals>.output_char{   s\   ø€ ð ˜Ÿ™Ò#Ù�$—)‘)Õð /¨t¯z©zÑ:ˆIÙ Ð.DÀZÑ.PÒ!PÙ& y°+Ô>á�$—)‘)ÔØŸ™‰Jr/   c                óP   •— ˆfd„| j                  «       D «       }t        |d¬«      S )a6  
        Return max used column index, ignoring whitespace (without style) at
        the end of the line. This is important for people that copy/paste
        terminal output.

        There are two reasons we are sometimes seeing whitespace at the end:
        - `BufferControl` adds a trailing space to each line, because it's a
          possible cursor position, so that the line wrapping won't change if
          the cursor position moves around.
        - The `Window` adds a style class to the current line for highlighting
          (cursor-line).
        c              3  ód   •K  — | ]'  \  }}|j                   d k7  s‰|j                     r|–— Œ) y­w)Ú N)rC   rB   )Ú.0ÚindexÚcellÚstyle_string_has_styles      €r-   Ú	<genexpr>zD_output_screen_diff.<locals>.get_max_column_index.<locals>.<genexpr>ž   s5   øè ø€ ð 
á*‘��tØ�y‰y˜CÒÐ#9¸$¿*¹*Ò#Eô Ù*ùs   ƒ-0r   )Údefault)ÚitemsÚmax)ÚrowÚnumbersrO   s     €r-   Úget_max_column_indexz1_output_screen_diff.<locals>.get_max_column_index‘   s'   ø€ ó
à"Ÿy™yœ{ó
ˆô
 �7 AÔ&Ð&r/   r   r4   r2   ©ÚreturnÚNone)r7   r   rX   r   )rC   r   rX   rY   )rT   zdict[int, Char]rX   Úint)ÚcolumnsÚrowsr?   Ú	write_rawÚset_attributesr.   Úcursor_forwardÚ	cursor_upÚcursor_backwardÚhide_cursorÚdisable_autowrapr   Ú
erase_downr   ÚminÚheightrS   ÚrangeÚdata_bufferÚzero_width_escapesr>   rC   rB   r5   r6   Úerase_end_of_lineÚget_cursor_positionÚlayoutÚcurrent_windowÚenable_autowrapÚshow_cursor)&ÚappÚoutputÚscreenr=   rG   Úprevious_screenr,   Úis_doneÚfull_screenrF   rO   ÚsizeÚprevious_widthrf   r]   r@   rH   rV   Úcurrent_heightÚ	row_countr6   Únew_rowÚprevious_rowÚzero_width_escapes_rowÚnew_max_line_lenÚprevious_max_line_lenÚcÚnew_charÚold_charÚ
char_widthr:   r;   r<   r+   rE   r.   r>   r?   s&      `` `  ``                   @@@@@@@@r-   Ú_output_screen_diffrƒ   '   s  ÿü€ ðD —L‘L $§)¡)€M€Eˆ6ð �L‰L€EØ× Ñ €Ið $×2Ñ2ÐØ%×6Ñ6ÐØ#×2Ñ2ÐØ×(Ñ(ÐØ$×4Ñ4Ðð ×ÑÔö÷ó ÷6$ñ $õ,'ñ* ÙÔñ ¡+Ø×ÑÔ!ñ
 	‘¨.¸EÒ*Aá!¤%¨!¨q¤/Ó2ˆÙÔØ×ÑÔä ›(ˆô
 ˜Ÿ™¨Ó/€Nô ”C˜Ÿ™ ×'=Ñ'=Ó>ÀÓG€Iä�9×ˆØ×$Ñ$ QÑ'ˆØ&×2Ñ2°1Ñ5ˆØ!'×!:Ñ!:¸1Ñ!=Ðä˜u q™yÑ*>¸wÓ*GÓHÐÜ # E¨A¡IÑ/CÀLÓ/QÓ RÐð ˆØÐ#Ò#Ø˜q‘zˆHØ# A‘ˆHØ!Ÿ™Ò,¨1ˆJð
 �}‰} §¡Ò-°·±À8Ç>Á>Ò1QÙ)¬%°!°q¬/Ó:�ð Ð.Ñ.ÙÐ4°QÑ7Ô8á˜HÔ%Ü# k§m¡m°jÑ&@ÀKÇMÁMÔR�à�‰OˆAð% Ð#Ó#ó* Ð/Ð2GÔGÙ%¤eÐ.>ÀÑ.BÀaÔ&HÓIˆKÙÔØ×$Ñ$Ö&ðE ð\ ˜×.Ñ.Ò.Ù!¤%¨!¨~ÀÑ/AÔ"BÓCˆñ Ù!¤%¨!¨~Ô">Ó?ˆØ×ÑÕá! &×"<Ñ"<¸S¿Z¹Z×=VÑ=VÓ"WÓXˆá‘kØ×ÑÔ ñ Ôà×ÒØ×ÑÔà˜
Ð"Ð"r/   c                  ó   — e Zd ZdZy)ÚHeightIsUnknownErrorz>Information unavailable. Did not yet receive the CPR response.N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r*   r/   r-   r…   r…   
  s   „ ÚDr/   r…   c                  ó,   — e Zd ZdZ	 	 	 	 	 	 dd„Zdd„Zy)r&   zk
    A cache structure that maps style strings to :class:`.Attr`.
    (This is an important speed up.)
    c                ó    — || _         || _        y ©N)Úget_attrs_for_style_strÚstyle_transformation)Úselfr�   rŽ   s      r-   Ú__init__z!_StyleStringToAttrsCache.__init__  s   € ð
 (?ˆÔ$Ø$8ˆÕ!r/   c                óh   — | j                  |«      }| j                  j                  |«      }|| |<   |S rŒ   )r�   rŽ   Útransform_attrs)r�   Ú	style_strÚattrss      r-   Ú__missing__z$_StyleStringToAttrsCache.__missing__  s6   € Ø×,Ñ,¨YÓ7ˆØ×)Ñ)×9Ñ9¸%Ó@ˆàˆˆY‰Øˆr/   N)r�   zCallable[[str], Attrs]rŽ   r!   rX   rY   )r“   ÚstrrX   r   ©r†   r‡   rˆ   r‰   r�   r•   r*   r/   r-   r&   r&     s-   „ ñð
9à!7ð9ð 2ð9ð 
ó	9ôr/   c                  ó    — e Zd ZdZdd„Zdd„Zy)r'   a  
    Cache for remember which style strings don't render the default output
    style (default fg/bg, no underline and no reverse and no blink). That way
    we know that we should render these cells, even when they're empty (when
    they contain a space).

    Note: we don't consider bold/italic/hidden because they don't change the
    output if there's no text in the cell.
    c                ó   — || _         y rŒ   )Ústyle_string_to_attrs)r�   rš   s     r-   r�   z"_StyleStringHasStyleCache.__init__/  s
   € Ø%:ˆÕ"r/   c                óä   — | j                   |   }t        |j                  xsD |j                  xs6 |j                  xs( |j
                  xs |j                  xs |j                  «      }|| |<   |S rŒ   )rš   ÚboolÚcolorÚbgcolorÚ	underlineÚstrikeÚblinkÚreverse)r�   r“   r”   Ú
is_defaults       r-   r•   z%_StyleStringHasStyleCache.__missing__2  sv   € Ø×*Ñ*¨9Ñ5ˆÜØ�K‰Kò Ø�}‰}òà�‰òð �|‰|òð �{‰{ò	ð
 �}‰}ó
ˆ
ð %ˆˆY‰ØÐr/   N)rš   zdict[str, Attrs]rX   rY   )r“   r–   rX   rœ   r—   r*   r/   r-   r'   r'   $  s   „ ñó;ôr/   c                  ó   — e Zd ZdZdZdZdZy)ÚCPR_Supportz&Enum: whether or not CPR is supported.Ú	SUPPORTEDÚNOT_SUPPORTEDÚUNKNOWNN)r†   r‡   rˆ   r‰   r¦   r§   r¨   r*   r/   r-   r¥   r¥   A  s   „ Ù,à€IØ#€MØ�Gr/   r¥   c                  óÒ   — e Zd ZdZdZ	 	 	 d	 	 	 	 	 	 	 	 	 	 	 dd„Zddd„Zedd„«       Zedd„«       Z	edd„«       Z
dd	„Zdd
„Zedd„«       Zddd„Z	 d	 	 	 	 	 	 	 dd„Zddd„Zdd„Zy)r$   zš
    Typical usage:

    ::

        output = Vt100_Output.from_pty(sys.stdout)
        r = Renderer(style, output)
        r.render(app, layout=...)
    é   Nc                óˆ  — || _         || _        || _        t        |«      | _        || _        d| _        d| _        d| _        d| _	        t        «       | _        t        j                  | _        |j                  st        j                   | _        d | _        d | _        d | _        d | _        d | _        | j-                  d¬«       y )NFT)Ú_scroll)rB   rq   ru   r   Úmouse_supportÚcpr_not_supported_callbackÚ_in_alternate_screenÚ_mouse_support_enabledÚ_bracketed_paste_enabledÚ_cursor_key_mode_resetr	   Ú_waiting_for_cpr_futuresr¥   r¨   Úcpr_supportÚresponds_to_cprr§   Ú_attrs_for_styleÚ_style_string_has_styleÚ_last_style_hashÚ_last_transformation_hashÚ_last_color_depthÚreset)r�   rB   rq   ru   r­   r®   s         r-   r�   zRenderer.__init__V  s½   € ð ˆŒ
ØˆŒØ&ˆÔÜ& }Ó5ˆÔØ*DˆÔ'ð %*ˆÔ!Ø&+ˆÔ#Ø(-ˆÔ%Ø&+ˆÔ#ô >C»WˆÔ%Ü&×.Ñ.ˆÔà×%Ò%Ü*×8Ñ8ˆDÔð BFˆÔØIMˆÔ$Ø15ˆÔØ:>ˆÔ&Ø48ˆÔà�
‰
˜4ˆ
Õ r/   c                ór  — t        dd¬«      | _        d | _        d | _        d | _        d | _        t        «       | _        d| _        |r| j                  j                  «        | j                  r#|r!| j                  j                  «        d| _        | j                  r!| j                  j                  «        d| _        | j                  r!| j                  j!                  «        d| _        | j                  j#                  «        | j                  j%                  «        | j                  j'                  «        y )Nr   r4   F)r   Ú_cursor_posÚ_last_screenÚ
_last_sizeÚ_last_styleÚ_last_cursor_shaper   Úmouse_handlersÚ_min_available_heightrq   Úscroll_buffer_to_promptr¯   Úquit_alternate_screenr°   Údisable_mouse_supportr±   Údisable_bracketed_pasteÚreset_cursor_shapero   Úflush)r�   r¬   Úleave_alternate_screens      r-   r»   zRenderer.reset~  sú   € ä  1¨œ?ˆÔð ,0ˆÔØ'+ˆŒØ'+ˆÔØ6:ˆÔô ,›oˆÔð &'ˆÔ"ñ
 Ø�K‰K×/Ñ/Ô1ð ×$Ò$Ñ)?Ø�K‰K×-Ñ-Ô/Ø(-ˆDÔ%ð ×&Ò&Ø�K‰K×-Ñ-Ô/Ø*/ˆDÔ'ð ×(Ò(Ø�K‰K×/Ñ/Ô1Ø,1ˆDÔ)à�‰×&Ñ&Ô(Ø�‰×ÑÔ!ð
 	�‰×ÑÕr/   c                ó   — | j                   S )zn
        The `Screen` class that was generated during the last rendering.
        This can be `None`.
        )r¾   ©r�   s    r-   Úlast_rendered_screenzRenderer.last_rendered_screen¯  s   € ð × Ñ Ð r/   c                óš   — | j                   s| j                  dkD  ry	 | j                  j                  «       | _        y# t        $ r Y yw xY w)zõ
        True when the height from the cursor until the bottom of the terminal
        is known. (It's often nicer to draw bottom toolbars only if the height
        is known, in order to avoid flickering when the CPR response arrives.)
        r   TF)ru   rÃ   rq   Úget_rows_below_cursor_positionÚNotImplementedErrorrÌ   s    r-   Úheight_is_knownzRenderer.height_is_known·  sL   € ð ×Ò˜t×9Ñ9¸AÒ=Øð	Ø)-¯©×)SÑ)SÓ)UˆDÔ&ØøÜ"ò 	Ùð	ús   ž> ¾	A
Á	A
c                ó  — | j                   ry| j                  dkD  ra| j                  j                  «       j                  }| j
                  r| j
                  j                  nd}|t        | j                  |«      z
  S t        d«      ‚)zU
        Return the number of rows visible in the terminal above the layout.
        r   zRows above layout is unknown.)	r¯   rÃ   rq   Úget_sizer\   r¾   rf   rS   r…   )r�   Ú
total_rowsÚlast_screen_heights      r-   Úrows_above_layoutzRenderer.rows_above_layoutÆ  sx   € ð
 ×$Ò$ØØ×'Ñ'¨!Ò+ØŸ™×-Ñ-Ó/×4Ñ4ˆJØ=A×=NÒ=N ×!2Ñ!2×!9Ò!9ÐTUÐØ¤ D×$>Ñ$>Ð@RÓ SÑSÐSä&Ð'FÓGÐGr/   c                ó
  ‡ — ‰ j                   j                  dk(  sJ ‚‰ j                  r*‰ j                  j	                  «       j
                  ‰ _        y	 ‰ j                  j                  «       ‰ _        y# t        $ r Y nw xY w‰ j                  t        j                  k(  rydˆ fd„}‰ j                  t        j                  k(  r |«        y‰ j                  ry |«        dˆ fd„}t        «       j                   |«       «       y)aS  
        Get current cursor position.

        We do this to calculate the minimum available height that we can
        consume for rendering the prompt. This is the available space below te
        cursor.

        For vt100: Do CPR request. (answer will arrive later.)
        For win32: Do API call. (Answer comes immediately.)
        r   Nc                 ó€   •— ‰ j                   j                  t        «       «       ‰ j                  j	                  «        y rŒ   )r³   Úappendr   rq   Úask_for_cprrÌ   s   €r-   Údo_cprz9Renderer.request_absolute_cursor_position.<locals>.do_cprô  s)   ø€ à×)Ñ)×0Ñ0´³Ô:Ø�K‰K×#Ñ#Õ%r/   c               “  óì   •K  — t        ‰ j                  «      ƒ d {  –—†  ‰ j                  t        j                  k(  r3t        j
                  ‰ _        ‰ j                  r‰ j                  «        y y y 7 ŒU­wrŒ   )r   ÚCPR_TIMEOUTr´   r¥   r¨   r§   r®   rÌ   s   €r-   Útimerz8Renderer.request_absolute_cursor_position.<locals>.timer  sc   øè ø€ Ü˜×(Ñ(Ó)×)Ð)ð ×Ñ¤;×#6Ñ#6Ò6Ü#.×#<Ñ#<�Ô à×2Ò2à×3Ñ3Õ5ð 3ð 7ð *ús   ƒA4œA2�AA4rW   )r½   r6   ru   rq   rÓ   r\   rÃ   rÏ   rÐ   r´   r¥   r§   r¦   Úwaiting_for_cprr   Úcreate_background_task)r�   rÛ   rÞ   s   `  r-   Ú request_absolute_cursor_positionz)Renderer.request_absolute_cursor_positionÔ  sß   ø€ ð ×Ñ×!Ñ! QÒ&Ð&Ð&ð ×ÒØ)-¯©×)=Ñ)=Ó)?×)DÑ)DˆDÔ&Øð	Ø)-¯©×)SÑ)SÓ)UˆDÔ&ØøÜ"ò 	Ùð	úð ×Ñœ{×8Ñ8Ò8Øõ	&ð
 ×Ñœ{×4Ñ4Ò4ÙŒHØð ×ÒØáŒõ		6ô 	‹	×(Ñ(©«Õ1s   ÁA4 Á4	B Á?B c                ó
  — t         j                  | _        | j                  j	                  «       j
                  }||z
  dz   }|| _        	 | j                  j                  «       }|j                  d«       y# t        $ r Y yw xY w)z‰
        To be called when we know the absolute cursor position.
        (As an answer of a "Cursor Position Request" response.)
        r2   N)r¥   r¦   r´   rq   rÓ   r\   rÃ   r³   ÚpopleftÚ
set_resultÚ
IndexError)r�   rT   rÔ   Úrows_below_cursorÚfs        r-   Úreport_absolute_cursor_rowz#Renderer.report_absolute_cursor_row  s�   € ô
 '×0Ñ0ˆÔð —[‘[×)Ñ)Ó+×0Ñ0ˆ
Ø&¨Ñ,¨qÑ0Ðð &7ˆÔ"ð	Ø×-Ñ-×5Ñ5Ó7ˆAð �L‰L˜Õøô ò 	Ùð	ús   Á
A6 Á6	BÂBc                ó,   — t        | j                  «      S )zi
        Waiting for CPR flag. True when we send the request, but didn't got a
        response.
        )rœ   r³   rÌ   s    r-   rß   zRenderer.waiting_for_cpr(  s   € ô �D×1Ñ1Ó2Ð2r/   c              ƒ  óB  ‡ ‡‡K  — t        ‰ j                  «      Š‰r‰ j                  t        j                  k(  rydˆfd„}dˆˆ ˆfd„}t         |«       «      t         |«       «      h}t        |t        ¬«      ƒ d{  –—† \  }}|D ]  }|j                  «        Œ y7 Œ­w)z*
        Wait for a CPR response.
        Nc               “  ó4   •K  — ‰D ]  } | ƒ d {  –—†  Œ y 7 Œ­wrŒ   r*   )Ú
response_fÚcpr_futuress    €r-   Úwait_for_responsesz;Renderer.wait_for_cpr_responses.<locals>.wait_for_responses:  s   øè ø€ Û)�
Ø × Ñ ñ *Ø ús   ƒŽ�c               “  ó„   •K  — t        ‰«      ƒ d {  –—†  ‰D ]  } | j                  «        Œ t        «       ‰_        y 7 Œ+­wrŒ   )r   Úcancelr	   r³   )rì   rí   r�   Útimeouts    €€€r-   Úwait_for_timeoutz9Renderer.wait_for_cpr_responses.<locals>.wait_for_timeout>  s;   øè ø€ Ü˜“.× Ð ó *�
Ø×!Ñ!Õ#ð *ä,1«GˆDÕ)ð !ús   ƒA ’>“,A )Úreturn_whenrW   )	Úlistr³   r´   r¥   r§   r   r   r   rð   )	r�   rñ   rî   rò   ÚtasksÚ_ÚpendingÚtaskrí   s	   ``      @r-   Úwait_for_cpr_responseszRenderer.wait_for_cpr_responses0  s�   úè ø€ ô ˜4×8Ñ8Ó9ˆñ ˜d×.Ñ.´+×2KÑ2KÒKØõ	!÷	4ô Ñ,Ó.Ó/ÜÑ*Ó,Ó-ð
ˆô   ´?ÔC×C‰
ˆˆ7ÛˆDØ�K‰K�Mñ ð Dús   …A8BÁ=BÁ> Bc                ó¶	  — | j                   }| j                  r#| j                  sd| _        |j                  «        | j                  s!| j                   j                  «        d| _        | j                  s!| j                   j                  «        d| _        | j                  «       }|r$| j                  s|j                  «        d| _	        n%|s#| j                  r|j                  «        d| _	        |j                  «       }t        «       }d|_        t        «       }| j                  r|j                   }	n°|r;|j"                  j%                  |j&                  |j                   «      j(                  }	ns| j*                  r| j*                  j,                  nd}
t/        | j0                  |
|j"                  j%                  |j&                  |j                   «      j(                  «      }	t3        |	|j                   «      }	| j4                  |k7  rd| _        | j6                  j9                  «       | j:                  k7  s@|j<                  j9                  «       | j>                  k7  s|j@                  | jB                  k7  rd| _        d| _"        d| _#        | jD                  €/tI        | j6                  jJ                  |j<                  «      | _"        | jF                  €tM        | jD                  «      | _#        | j6                  j9                  «       | _        |j<                  j9                  «       | _        |j@                  | _!        |j"                  jO                  ||tQ        dd|j&                  |	¬«      ddd¬«       |jS                  «        |jT                  r|jW                  |jT                  «       tY        |||| jZ                  |j@                  | j*                  | j\                  || j                  | jD                  | jF                  || j4                  r| j4                  j&                  nd¬«      \  | _-        | _.        || _        || _        || _/        |j`                  jc                  |«      }| jd                  �| jd                  |k7  r|jg                  |«       || _2        |ji                  «        |jj                  |jl                  _5        |r| jo                  «        yy)	zÆ
        Render the current interface to the output.

        :param is_done: When True, put the cursor at the end of the interface. We
                won't print any changes to this part.
        TFr   N)ÚxposÚyposr>   rf   Ú )Úparent_styleÚerase_bgÚz_index)ru   rF   rO   rv   rw   )8rq   ru   r¯   Úenter_alternate_screenr±   Úenable_bracketed_paster²   Úreset_cursor_key_moder­   r°   Úenable_mouse_supportrÆ   rÓ   r   ro   r   r\   Ú	containerÚpreferred_heightr[   Ú	preferredr¾   rf   rS   rÃ   re   r¿   rB   Úinvalidation_hashr¸   rŽ   r¹   rG   rº   r¶   r·   r&   r�   r'   Úwrite_to_screenr   Údraw_all_floatsÚ
exit_styleÚappend_style_to_contentrƒ   r½   rÀ   rÂ   ÚcursorÚget_cursor_shaperÁ   Úset_cursor_shaperÉ   Úvisible_windowsrl   r»   )r�   rp   rl   rt   rq   Úneeds_mouse_supportrv   rr   rÂ   rf   Úlast_heightÚnew_cursor_shapes               r-   ÚrenderzRenderer.renderN  s  € ð —‘ˆð ×Ò D×$=Ò$=Ø(,ˆDÔ%Ø×)Ñ)Ô+ð ×,Ò,Ø�K‰K×.Ñ.Ô0Ø,0ˆDÔ)ð ×*Ò*Ø�K‰K×-Ñ-Ô/Ø*.ˆDÔ'ð #×0Ñ0Ó2Ðá t×'BÒ'BØ×'Ñ'Ô)Ø*.ˆDÕ'á$¨×)DÒ)DØ×(Ñ(Ô*Ø*/ˆDÔ'ð �‰Ó ˆÜ“ˆØ"ˆÔä&›ˆð ×ÒØ—Y‘Y‰FÙà×%Ñ%×6Ñ6Ø—‘˜dŸi™ióç‰iñ ð 7;×6GÒ6G˜$×+Ñ+×2Ò2ÈQˆKÜØ×*Ñ*ØØ× Ñ ×1Ñ1°$·,±,ÀÇ	Á	ÓJ×TÑTóˆFô �V˜TŸY™YÓ'ˆð �?‰?˜dÒ"Ø $ˆDÔð �J‰J×(Ñ(Ó*¨d×.CÑ.CÒCØ×'Ñ'×9Ñ9Ó;Ø×-Ñ-ò.à�‰ $×"8Ñ"8Ò8à $ˆDÔØ$(ˆDÔ!Ø+/ˆDÔ(à× Ñ Ð(Ü$<Ø—
‘
×2Ñ2°C×4LÑ4Ló%ˆDÔ!ð ×'Ñ'Ð/Ü+DØ×%Ñ%ó,ˆDÔ(ð !%§
¡
× <Ñ <Ó >ˆÔØ),×)AÑ)A×)SÑ)SÓ)UˆÔ&Ø!$§¡ˆÔà×Ñ×(Ñ(ØØÜ˜q q°·±ÀVÔLØØØð 	)ô 	
ð 	×ÑÔ ð �>Š>Ø×*Ñ*¨3¯>©>Ô:ô .AØØØØ×ÑØ�O‰OØ×ÑØ×ÑØØ×(Ñ(Ø#'×#8Ñ#8Ø#'×#?Ñ#?ØØ7;·²˜DŸO™O×3Ò3ÈAô.
Ñ*ˆÔ˜$Ô*ð #ˆÔØˆŒØ,ˆÔð Ÿ:™:×6Ñ6°sÓ;Ðà×#Ñ#Ð+Ø×&Ñ&Ð*:Ò:à×#Ñ#Ð$4Ô5Ø&6ˆDÔ#ð 	�‰Œð &,×%;Ñ%;ˆ�
‰
Ô"áØ�J‰J�Lð r/   c                óT  — | j                   }|j                  | j                  j                  «       |j	                  | j                  j
                  «       |j                  «        |j                  «        |j                  «        |j                  «        | j                  |¬«       y)aR  
        Hide all output and put the cursor back at the first line. This is for
        instance used for running a system command (while hiding the CLI) and
        later resuming the same CLI.)

        :param leave_alternate_screen: When True, and when inside an alternate
            screen buffer, quit the alternate screen.
        )rÊ   N)rq   ra   r½   r5   r`   r6   rd   r.   rn   rÉ   r»   )r�   rÊ   rq   s      r-   ÚerasezRenderer.eraseÞ  s}   € ð —‘ˆà×Ñ˜t×/Ñ/×1Ñ1Ô2Ø×Ñ˜×)Ñ)×+Ñ+Ô,Ø×ÑÔØ×ÑÔ!Ø×ÑÔ à�‰Œà�
‰
Ð*@ˆ
ÕAr/   c                óÀ   — | j                  «        | j                  }|j                  «        |j                  dd«       |j	                  «        | j                  «        y)z,
        Clear screen and go to 0,0
        r   N)r  rq   Úerase_screenÚcursor_gotorÉ   rá   )r�   rq   s     r-   ÚclearzRenderer.clearó  sI   € ð
 	�
‰
Œð —‘ˆà×ÑÔØ×Ñ˜1˜aÔ Ø�‰Œà×-Ñ-Õ/r/   )FFN)rB   r   rq   r   ru   rœ   r­   r   r®   zCallable[[], None] | NonerX   rY   )FT)r¬   rœ   rÊ   rœ   rX   rY   )rX   úScreen | None)rX   rœ   )rX   rZ   rW   )rT   rZ   rX   rY   )r2   )rñ   rZ   rX   rY   )F)rp   úApplication[Any]rl   r#   rt   rœ   rX   rY   )T)rÊ   rœ   rX   rY   )r†   r‡   rˆ   r‰   rÝ   r�   r»   ÚpropertyrÍ   rÑ   rÖ   rá   rè   rß   rù   r  r  r  r*   r/   r-   r$   r$   I  sþ   „ ñð €Kð "Ø&+Ø@Dð&!àð&!ð ð&!ð ð	&!ð
 $ð&!ð %>ð&!ð 
ó&!ôP/ðb ò!ó ð!ð òó ðð òHó ðHó;2ózð. ò3ó ð3ôð> FKðNØ#ðNØ-3ðNØ>BðNà	óNô`Bô*0r/   Nc                ó  — t        |«      }|xs
 t        «       }|xs | j                  «       }| j                  «        | j	                  «        d}t        |j                  |«      }|D ]�  ^}}	}
||   }||k7  r%|r| j                  ||«       n| j                  «        |}d|v r| j                  |	«       ŒM|	j                  dd«      }	|	j                  dd«      }	| j                  |	«       Œƒ | j                  «        | j                  «        y)zT
    Print a list of (style_str, text) tuples in the given style to the output.
    Nz[ZeroWidthEscape]r3   rý   Ú
r1   )r   r    Úget_default_color_depthr.   rn   r&   r�   r^   r]   Úreplacer?   rÉ   )rq   Úformatted_textrB   rŽ   rG   Ú	fragmentsÚ
last_attrsrF   r“   Útextrö   r”   s               r-   r%   r%     s  € ô " .Ó1€IØ/ÒMÔ3KÓ3MÐØÒA ×!?Ñ!?Ó!A€Kð ×ÑÔØ
×ÑÔØ#€Jô 6Ø×%Ñ%Ð';óÐó  )Ðˆ	�4˜!Ø& yÑ1ˆð �JÒÙØ×%Ñ% e¨[Õ9à×'Ñ'Ô)Øˆ
ð  )Ñ+Ø×Ñ˜TÕ"ð —<‘<  bÓ)ˆDð —<‘<  fÓ-ˆDØ�L‰L˜Õð)  )ð. ×ÑÔØ
‡L�L…Nr/   )rp   r  rq   r   rr   r   r=   r   rG   r   rs   r  r,   z
str | Nonert   rœ   ru   rœ   rF   r&   rO   r'   rv   r   rw   rZ   rX   ztuple[Point, str | None])NN)rq   r   r"  r   rB   r   rŽ   zStyleTransformation | NonerG   zColorDepth | NonerX   rY   )=r‰   Ú
__future__r   Úasyncior   r   r   r   r   Úcollectionsr	   Úenumr
   Útypingr   r   r   r   r   Ú"prompt_toolkit.application.currentr   Úprompt_toolkit.cursor_shapesr   Úprompt_toolkit.data_structuresr   r   Úprompt_toolkit.filtersr   r   Úprompt_toolkit.formatted_textr   r   Ú$prompt_toolkit.layout.mouse_handlersr   Úprompt_toolkit.layout.screenr   r   r   Úprompt_toolkit.outputr   r   Úprompt_toolkit.stylesr   r   r    r!   Úprompt_toolkit.applicationr"   Úprompt_toolkit.layout.layoutr#   Ú__all__rƒ   Ú	Exceptionr…   r–   r&   rœ   r'   r¥   r$   r%   r*   r/   r-   Ú<module>r8     s’  ðñõ
 #ç GÕ GÝ Ý ß ?Õ ?å 6Ý 4ß 6ß :ß MÝ >ß DÑ Dß 4÷ó ñ Ý6Ý3ð Øð€ð`#Ø	ð`#àð`#ð ð`#ð ð	`#ð
 ð`#ð #ð`#ð ð`#ð ð`#ð ð`#ð 5ð`#ð 6ð`#ð ð`#ð ð`#ð ó`#ôFE˜9ô Eô˜t C¨ JÑ/ô ô,  S¨$ Y¡ô ô:�$ô ÷x0ñ x0ð~ 8<Ø%)ð0Øð0à$ð0ð ð0ð 5ð	0ð
 #ð0ð 
ô0r/   