a
    ýÓEbT= ã                   @   sD  U d dl Z d dlZd dlZd dlZd dl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 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 d dlmZ d dlmZmZmZ d dlmZmZmZmZm Z m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z* ej+dk�r$d dlm,Z,m-Z-m.Z. nd dl/m,Z,m-Z-m.Z. ddl0m1Z1m2Z2 ddl3m3Z3 ddl4m5Z5m6Z6 ddl7m8Z8m9Z9 ddl:m;Z; ddl<m=Z= ddl>m?Z? ddl@mAZAmBZB ddlCmDZE ddlFmGZGmHZH ddlImJZJmKZK ddlLmMZMmNZN ddlOmPZP ddlQmRZR ddlSmTZT dd lUmVZV dd!lWmXZX dd"lYmZZZm[Z[ dd#l\m]Z] dd$l^m_Z_m`Z` dd%lambZbmcZc dd&ldmeZemfZf e�r–dd'lgmhZh dd(limjZj dd)lkmlZl e m¡ d*kZnee)eod+f gd+f Zpe,d, Zqe,d- ZrG d.d/„ d/ƒZsesƒ Ztd0Zue;jve;jwd1œZxG d2d3„ d3e$ƒZye	G d4d5„ d5ƒƒZze.G d6d7„ d7e-ƒƒZ{e.G d8d9„ d9e-ƒƒZ|e)e|e{eof Z}e!e)e}eXf  Z~eAƒ ZG d:d;„ d;e€ƒZ�G d<d=„ d=ƒZ‚G d>d?„ d?ƒZƒG d@dA„ dAƒZ„G dBdC„ dCƒZ…G dDdE„ dEƒZ†G dFdG„ dGƒZ‡G dHdI„ dIƒZˆd€e‰edKedKeˆf f dLœdMdN„ZŠe‰dOœdPdQ„Z‹e;jwe;jve;jŒe;jndRœZ�dSdT„ e� Ž¡ D ƒZ�e	G dUdV„ dVej�ƒƒZ‘G dWdX„ dXeƒZ’da“e%dY e”dZ< dYdOœd[d\„Z•e‰dOœd]d^„Z–e–ƒ �r–d d_l—m˜Z˜ e˜d`da� G dbdc„ dcƒZ™ešddk�r@e™ƒ Z›e› œdedfdgdJd`ddhdidjdkdlœdmdnœ¡ e› œdodpe�e›ƒ¡ e› ždg dJdqg dr¢dsdtœduœd`dvg dw¢dxdtœdyg dz¢d{dtœd|œd}œd~œ¡ e› œd¡ dS )�é    N)ÚABCÚabstractmethod)Ú	dataclassÚfield)Údatetime)Úwraps)Úgetpass)Úescape)Úisclass)Úislice)ÚRLock)Ú	monotonic)Ú	FrameTypeÚ
ModuleTypeÚTracebackType)ÚIOÚTYPE_CHECKINGÚAnyÚCallableÚDictÚIterableÚListÚMappingÚ
NamedTupleÚOptionalÚTextIOÚTupleÚTypeÚUnionÚcast)é   é   )ÚLiteralÚProtocolÚruntime_checkableé   )ÚerrorsÚthemes)Ú_emoji_replace)ÚFormatTimeCallableÚ	LogRender)ÚAlignÚAlignMethod)ÚColorSystem)ÚControl)ÚEmojiVariant)ÚNullHighlighterÚReprHighlighter©Úrender)ÚMeasurementÚmeasure_renderables)ÚPagerÚSystemPager)ÚPrettyÚis_expandable)Ú	rich_cast)ÚRegion)Úrender_scope)ÚScreen)ÚSegment)ÚStyleÚ	StyleType©ÚStyled)ÚDEFAULT_TERMINAL_THEMEÚTerminalTheme)ÚTextÚTextType)ÚThemeÚ
ThemeStack)ÚWindowsConsoleFeatures)ÚLive©ÚStatusÚWindowsrE   )ÚdefaultÚleftÚcenterÚrightÚfull)ÚfoldÚcropZellipsisÚignorec                   @   s   e Zd ZdS )ÚNoChangeN)Ú__name__Ú
__module__Ú__qualname__© rZ   rZ   úX/home/ja/django-apps/lartica_env/lib/python3.9/site-packages/pip/_vendor/rich/console.pyrV   O   s   rV   a9  <!DOCTYPE html>
<head>
<meta charset="UTF-8">
<style>
{stylesheet}
body {{
    color: {foreground};
    background-color: {background};
}}
</style>
</head>
<html>
<body>
    <code>
        <pre style="font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace">{code}</pre>
    </code>
</body>
</html>
)Z256colorZ16colorc                   @   s"   e Zd ZU dZeed< eed< dS )ÚConsoleDimensionszSize of the terminal.ÚwidthÚheightN)rW   rX   rY   Ú__doc__ÚintÚ__annotations__rZ   rZ   rZ   r[   r\   n   s   
r\   c                   @   s’  e Zd ZU dZeed< eed< eed< eed< eed< eed< eed< d	Z	e
e ed
< d	Ze
e ed< dZe
e ed< d	Ze
e ed< d	Ze
e ed< d	Ze
e ed< eedœdd„ƒZd dœdd„Zeeeeeeeeedœ	eeef eeef eeef ee
e ef ee
e ef ee
e ef ee
e ef ee
e ef ee
e ef d dœ
dd„Zed dœdd„Zed dœdd„Zeed d œd!d"„Zd	S )#ÚConsoleOptionsz$Options for __rich_console__ method.ÚsizeÚlegacy_windowsÚ	min_widthÚ	max_widthÚis_terminalÚencodingÚ
max_heightNÚjustifyÚoverflowFÚno_wrapÚ	highlightÚmarkupr^   ©Úreturnc                 C   s   | j  d¡ S )z+Check if renderables should use ascii only.Úutf)rh   Ú
startswith©ÚselfrZ   rZ   r[   Ú
ascii_only•   s    zConsoleOptions.ascii_onlyc                 C   s   t  t ¡}| j ¡ |_|S )zdReturn a copy of the options.

        Returns:
            ConsoleOptions: a copy of self.
        )rb   Ú__new__Ú__dict__Úcopy)rt   ÚoptionsrZ   rZ   r[   rx   š   s    
zConsoleOptions.copy)	r]   re   rf   rj   rk   rl   rm   rn   r^   )
r]   re   rf   rj   rk   rl   rm   rn   r^   rp   c       	         C   sÈ   |   ¡ }
t|tƒs$td|ƒ |
_|
_t|tƒs4||
_t|tƒsD||
_t|tƒsT||
_t|tƒsd||
_t|tƒst||
_t|tƒs„||
_	t|tƒs”||
_
t|	tƒsÄ|	dur¬|	|
_|	du r¸dntd|	ƒ|
_|
S )zUpdate values, return a copy.r   N)rx   Ú
isinstancerV   Úmaxre   rf   rj   rk   rl   rm   rn   ri   r^   )rt   r]   re   rf   rj   rk   rl   rm   rn   r^   ry   rZ   rZ   r[   Úupdate¤   s,    








zConsoleOptions.update©r]   rp   c                 C   s   |   ¡ }td|ƒ |_|_|S )zÑUpdate just the width, return a copy.

        Args:
            width (int): New width (sets both min_width and max_width)

        Returns:
            ~ConsoleOptions: New console options instance.
        r   )rx   r{   re   rf   )rt   r]   ry   rZ   rZ   r[   Úupdate_widthÉ   s    	zConsoleOptions.update_width©r^   rp   c                 C   s   |   ¡ }| |_|_|S )z¯Update the height, and return a copy.

        Args:
            height (int): New height

        Returns:
            ~ConsoleOptions: New Console options instance.
        )rx   ri   r^   )rt   r^   ry   rZ   rZ   r[   Úupdate_heightÖ   s    	zConsoleOptions.update_height)r]   r^   rp   c                 C   s*   |   ¡ }td|ƒ |_|_| |_|_|S )a  Update the width and height, and return a copy.

        Args:
            width (int): New width (sets both min_width and max_width).
            height (int): New height.

        Returns:
            ~ConsoleOptions: New console options instance.
        r   )rx   r{   re   rf   r^   ri   )rt   r]   r^   ry   rZ   rZ   r[   Úupdate_dimensionsã   s    
z ConsoleOptions.update_dimensions)rW   rX   rY   r_   r\   ra   Úboolr`   Ústrrj   r   ÚJustifyMethodrk   ÚOverflowMethodrl   rm   rn   r^   Úpropertyru   rx   Ú	NO_CHANGEr   rV   r|   r~   r€   r�   rZ   rZ   rZ   r[   rb   w   sR   
õ


ô%rb   c                   @   s&   e Zd ZdZedef dœdd„ZdS )ÚRichCastz5An object that may be 'cast' to a console renderable.ÚConsoleRenderablero   c                 C   s   d S ©NrZ   rs   rZ   rZ   r[   Ú__rich__÷   s    zRichCast.__rich__N)rW   rX   rY   r_   r   rƒ   r‹   rZ   rZ   rZ   r[   rˆ   ó   s   rˆ   c                   @   s"   e Zd ZdZddddœdd„ZdS )	r‰   z-An object that supports the console protocol.ÚConsolerb   ÚRenderResult©Úconsolery   rp   c                 C   s   d S rŠ   rZ   ©rt   r�   ry   rZ   rZ   r[   Ú__rich_console__ÿ   s    z"ConsoleRenderable.__rich_console__N)rW   rX   rY   r_   r‘   rZ   rZ   rZ   r[   r‰   û   s   þr‰   c                   @   s   e Zd ZdZdS )ÚCaptureErrorz(An error in the Capture context manager.N)rW   rX   rY   r_   rZ   rZ   rZ   r[   r’     s   r’   c                   @   s8   e Zd ZdZdeddœdd„Zddee d	œd
d„ZdS )ÚNewLinez$A renderable to generate new line(s)r%   N©Úcountrp   c                 C   s
   || _ d S rŠ   )r•   ©rt   r•   rZ   rZ   r[   Ú__init__  s    zNewLine.__init__rŒ   rb   rŽ   c                 c   s   t d| j ƒV  d S )NÚ
)r>   r•   r�   rZ   rZ   r[   r‘     s    zNewLine.__rich_console__)r%   )	rW   rX   rY   r_   r`   r—   r   r>   r‘   rZ   rZ   rZ   r[   r“     s
   þr“   c                   @   s>   e Zd ZdZeee  eeddœdd„Zdee	dœdd	„Z
dS )
ÚScreenUpdatez)Render a list of lines at a given offset.N©ÚlinesÚxÚyrp   c                 C   s   || _ || _|| _d S rŠ   )Ú_linesrœ   r�   )rt   r›   rœ   r�   rZ   rZ   r[   r—   #  s    zScreenUpdate.__init__rŒ   rŽ   c                 c   s>   | j }tj}t| j| jƒD ]\}}|||ƒV  |E d H  qd S rŠ   )rœ   r.   Úmove_toÚ	enumeraterž   r�   )rt   r�   ry   rœ   rŸ   ÚoffsetÚlinerZ   rZ   r[   r‘   (  s
    zScreenUpdate.__rich_console__)rW   rX   rY   r_   r   r>   r`   r—   rb   r�   r‘   rZ   rZ   rZ   r[   r™      s
   þr™   c                   @   s`   e Zd ZdZdddœdd„Zd dœdd	„Zeee  ee ee	 dd
œdd„Z
edœdd„ZdS )ÚCapturezÐContext manager to capture the result of printing to the console.
    See :meth:`~rich.console.Console.capture` for how to use.

    Args:
        console (Console): A console instance to capture output.
    rŒ   N)r�   rp   c                 C   s   || _ d | _d S rŠ   )Ú_consoleÚ_result)rt   r�   rZ   rZ   r[   r—   :  s    zCapture.__init__ro   c                 C   s   | j  ¡  | S rŠ   )r¤   Úbegin_capturers   rZ   rZ   r[   Ú	__enter__>  s    
zCapture.__enter__©Úexc_typeÚexc_valÚexc_tbrp   c                 C   s   | j  ¡ | _d S rŠ   )r¤   Úend_capturer¥   ©rt   r©   rª   r«   rZ   rZ   r[   Ú__exit__B  s    zCapture.__exit__c                 C   s   | j du rtdƒ‚| j S )zGet the result of the capture.Nz<Capture result is not available until context manager exits.)r¥   r’   rs   rZ   rZ   r[   ÚgetJ  s
    
ÿzCapture.get)rW   rX   rY   r_   r—   r§   r   r   ÚBaseExceptionr   r®   rƒ   r¯   rZ   rZ   rZ   r[   r£   2  s   
ûr£   c                   @   sX   e Zd ZdZddeeddœdd„Zd dœd	d
„Zee	e
  ee
 ee ddœdd„ZdS )ÚThemeContextzbA context manager to use a temporary theme. See :meth:`~rich.console.Console.use_theme` for usage.TrŒ   N)r�   ÚthemeÚinheritrp   c                 C   s   || _ || _|| _d S rŠ   )r�   r²   r³   )rt   r�   r²   r³   rZ   rZ   r[   r—   V  s    zThemeContext.__init__ro   c                 C   s   | j  | j¡ | S rŠ   )r�   Ú
push_themer²   rs   rZ   rZ   r[   r§   [  s    zThemeContext.__enter__r¨   c                 C   s   | j  ¡  d S rŠ   )r�   Ú	pop_themer­   rZ   rZ   r[   r®   _  s    zThemeContext.__exit__)T)rW   rX   rY   r_   rG   r‚   r—   r§   r   r   r°   r   r®   rZ   rZ   rZ   r[   r±   S  s   
ûr±   c                   @   s^   e Zd ZdZddee eeddœdd„Zd dœd	d
„Zee	e
  ee
 ee ddœdd„ZdS )ÚPagerContextzZA context manager that 'pages' content. See :meth:`~rich.console.Console.pager` for usage.NFrŒ   )r�   ÚpagerÚstylesÚlinksrp   c                 C   s*   || _ |d u rtƒ n|| _|| _|| _d S rŠ   )r¤   r7   r·   r¸   r¹   )rt   r�   r·   r¸   r¹   rZ   rZ   r[   r—   k  s    zPagerContext.__init__ro   c                 C   s   | j  ¡  | S rŠ   )r¤   Ú_enter_bufferrs   rZ   rZ   r[   r§   w  s    
zPagerContext.__enter__r¨   c                 C   sš   |d u rŒ| j j�` | j jd d … }| j jd d …= |}| jsFt |¡}n| jsVt |¡}| j  |¡}W d   ƒ n1 sv0    Y  | j	 
|¡ | j  ¡  d S rŠ   )r¤   Ú_lockÚ_bufferr¸   r>   Zstrip_stylesr¹   Zstrip_linksÚ_render_bufferr·   ÚshowÚ_exit_buffer)rt   r©   rª   r«   ÚbufferÚsegmentsÚcontentrZ   rZ   r[   r®   {  s    

*zPagerContext.__exit__)NFF)rW   rX   rY   r_   r   r6   r‚   r—   r§   r   r°   r   r®   rZ   rZ   rZ   r[   r¶   h  s"      ûú
ûr¶   c                   @   st   e Zd ZdZddeeddœdd„Zddœeee dd	œd
d„Z	d dœdd„Z
eee  ee ee ddœdd„ZdS )ÚScreenContextziA context manager that enables an alternative screen. See :meth:`~rich.console.Console.screen` for usage.Ú rŒ   N)r�   Úhide_cursorÚstylerp   c                 C   s"   || _ || _t|d�| _d| _d S )N©rÆ   F)r�   rÅ   r=   ÚscreenÚ_changed)rt   r�   rÅ   rÆ   rZ   rZ   r[   r—   ’  s    zScreenContext.__init__rÇ   )ÚrenderablesrÆ   rp   c                G   sJ   |r$t |ƒdkrt|Ž n|d | j_|dur4|| j_| jj| jdd� dS )a+  Update the screen.

        Args:
            renderable (RenderableType, optional): Optional renderable to replace current renderable,
                or None for no change. Defaults to None.
            style: (Style, optional): Replacement style, or None for no change. Defaults to None.
        r%   r   NrÄ   )Úend)ÚlenÚGrouprÈ   Ú
renderablerÆ   r�   Úprint)rt   rÆ   rÊ   rZ   rZ   r[   r|   š  s    
ÿzScreenContext.updatero   c                 C   s*   | j  d¡| _| jr&| jr&| j  d¡ | S )NTF)r�   Úset_alt_screenrÉ   rÅ   Úshow_cursorrs   rZ   rZ   r[   r§   ¬  s    zScreenContext.__enter__r¨   c                 C   s(   | j r$| j d¡ | jr$| j d¡ d S )NFT)rÉ   r�   rÐ   rÅ   rÑ   r­   rZ   rZ   r[   r®   ²  s    zScreenContext.__exit__)rÄ   )rW   rX   rY   r_   r‚   r@   r—   ÚRenderableTyper   r|   r§   r   r°   r   r®   rZ   rZ   rZ   r[   rÃ   �  s"    ÿþ	ÿþ
ûrÃ   c                   @   sb   e Zd ZdZddœdeddœdd„Zeed d	œd
d„ƒZddddœdd„Z	dde
dœdd„ZdS )rÍ   a$  Takes a group of renderables and returns a renderable object that renders the group.

    Args:
        renderables (Iterable[RenderableType]): An iterable of renderable objects.
        fit (bool, optional): Fit dimension of group to contents, or fill available space. Defaults to True.
    T©ÚfitrÒ   N)rÊ   rÔ   rp   c                G   s   || _ || _d | _d S rŠ   )Ú_renderablesrÔ   Ú_render)rt   rÔ   rÊ   rZ   rZ   r[   r—   Æ  s    zGroup.__init__ro   c                 C   s   | j d u rt| jƒ| _ | j S rŠ   )rÖ   ÚlistrÕ   rs   rZ   rZ   r[   rÊ   Ë  s    
zGroup.renderablesrŒ   rb   r4   rŽ   c                 C   s&   | j rt||| jƒS t|j|jƒS d S rŠ   )rÔ   r5   rÊ   r4   rf   r�   rZ   rZ   r[   Ú__rich_measure__Ñ  s    zGroup.__rich_measure__c                 c   s   | j E d H  d S rŠ   )rÊ   r�   rZ   rZ   r[   r‘   Ù  s    zGroup.__rich_console__)rW   rX   rY   r_   r‚   r—   r†   r   rÊ   rØ   r�   r‘   rZ   rZ   rZ   r[   rÍ   ¾  s   þ	þrÍ   T.)rÔ   rp   c                    s,   t dtt f t dtf dœ‡ fdd„}|S )z½A decorator that turns an iterable of renderables in to a group.

    Args:
        fit (bool, optional): Fit dimension of group to contents, or fill available space. Defaults to True.
    .)Úmethodrp   c                    s$   t ˆ ƒtttdœ‡‡ fdd„ƒ}|S )zGConvert a method that returns an iterable of renderables in to a Group.)ÚargsÚkwargsrp   c                     s   ˆ| i |¤Ž}t |dˆ iŽS )NrÔ   )rÍ   )rÚ   rÛ   rÊ   )rÔ   rÙ   rZ   r[   Ú_replaceë  s    z*group.<locals>.decorator.<locals>._replace)r   r   rÍ   )rÙ   rÜ   rÓ   )rÙ   r[   Ú	decoratoræ  s    zgroup.<locals>.decorator)r   r   rÒ   rÍ   )rÔ   rÝ   rZ   rÓ   r[   Úgroupß  s    
þrÞ   ro   c                  C   sZ   zt  W n ty   Y dS 0 t ƒ } | jj}dt| jƒv sB|dkrFdS |dkrRdS dS dS )z-Check if we're running in a Jupyter notebook.Fzgoogle.colabZZMQInteractiveShellTZTerminalInteractiveShellN)Zget_ipythonÚ	NameErrorÚ	__class__rW   rƒ   )ZipythonÚshellrZ   rZ   r[   Ú_is_jupyterõ  s    râ   )ÚstandardÚ256Ú	truecolorÚwindowsc                 C   s   i | ]\}}||“qS rZ   rZ   )Ú.0ÚnameÚsystemrZ   rZ   r[   Ú
<dictcomp>  ó    rê   c                   @   s<   e Zd ZU dZeed< eed�Ze	e
 ed< dZeed< dS )ÚConsoleThreadLocalsz(Thread local values for Console context.Útheme_stack)Údefault_factoryrÀ   r   Úbuffer_indexN)rW   rX   rY   r_   rH   ra   r   r×   rÀ   r   r>   rï   r`   rZ   rZ   rZ   r[   rì     s   
rì   c                   @   s,   e Zd ZdZeee ee dœdd„ƒZdS )Ú
RenderHookz(Provides hooks in to the render process.)rÊ   rp   c                 C   s   dS )aL  Called with a list of objects to render.

        This method can return a new list of renderables, or modify and return the same list.

        Args:
            renderables (List[ConsoleRenderable]): A number of renderable objects.

        Returns:
            List[ConsoleRenderable]: A replacement list of renderables.
        NrZ   )rt   rÊ   rZ   rZ   r[   Úprocess_renderables  s    zRenderHook.process_renderablesN)rW   rX   rY   r_   r   r   r‰   rñ   rZ   rZ   rZ   r[   rð     s
   þrð   rI   Ú_windows_console_featuresc                  C   s"   t d urt S ddlm}  | ƒ a t S )Nr%   ©Úget_windows_console_features)rò   Ú_windowsrô   ró   rZ   rZ   r[   rô   /  s
    rô   c                   C   s   t otƒ j S )zDetect legacy Windows.)ÚWINDOWSrô   ZvtrZ   rZ   rZ   r[   Údetect_legacy_windows9  s    r÷   )ÚinitF)Ústripc                    @   s~  e Zd ZU dZejZeeef e	d< dddddddddddddddddddddde
ƒ dddddd	œeed
  ee ee ee eee eeee  eee ee ee ee eeeeee eeeeeef ed ee eeeg ef  eeg ef  eeeef  d	œdd„Zedœdd„Zeee dœdd„ƒZejee ddœdd„ƒZeee dœdd„ƒZeedœdd„ƒZ e jeddœdd„ƒZ ee!dœdd„ƒZ"ee# dœdd„Z$ddœdd „Z%ddœd!d"„Z&d#dd$œd%d&„Z'ddœd'd(„Z(e)dd)œd*d+„Z*ddœd,d-„Z+d dœd.d/„Z,e-e-e-dd0œd1d2„Z.ddœd3d4„Z/edœd5d6„Z0dd7œeedd8œd9d:„Z1ddœd;d<„Z2dd7œeee3d8œd=d>„Z4eee dœd?d@„ƒZ5eedœdAdB„ƒZ6eedœdCdD„ƒZ7eedœdEdF„ƒZ8ee9dœdGdH„ƒZ:ee;dœdIdJ„ƒZ<e<je=eef ddKœdLdJ„ƒZ<eedœdMdN„ƒZ>e>jeddOœdPdN„ƒZ>eedœdQdR„ƒZ?e?jeddSœdTdR„ƒZ?ddœdUdV„Z@eAdœdWdX„ZBdÖeeC eeeDdYœdZd[„ZEd×edd]œd^d_„ZFdØedd`œdadb„ZGdcdddedfdgœeHeeeedhdiœdjdk„ZIdÙeedlœdmdn„ZJdÚeedoœdpdq„ZKeedœdrds„ƒZLdÛeee dtduœdvdw„ZMddxœeHee9 eNdyœdzd{„ZOdÜeHee9 ePe dyœd|d}„ZQdÝdddd~œeHee9 eeR eeeee  dœd€d�„ZSd‚dddddddƒœeeeeRf eeT eeU ee ee ee eeV d„d…œ	d†d‡„ZWddˆœeeeRf eeeRef  eRd‰œdŠd‹„ZXdddddŒœePe- eeeeT ee ee ee eeY d�œdŽd�„ZZdÞd�d‘d’d“œe[eeeeRf e\dd”œd•d–„Z]e^dd—œd˜d™„Z_dšd›dddœœe-eeeeeeRf  ee dd�œdždŸ„Z`dšd›ddddddddddddd œe-eeeeeeRf  eeT eeU ee ee ee ee ee ee eee edd¡œd¢d£„Zadßdd¤dddddddd¥œ	ee e-edeef eeeeeeee-ge-f  edd¦œd§d¨„Zbddd©œeHeec ee9 ddªœd«d¬„Zddàeee  eedd®œd¯d°„Zed±d²dddd³d±d´œee eee eeePeeeff  eddµœd¶d·„Zgeheijjfeeg eek f e=eeelee-f f d¸œd¹dº„ƒZmdšd›ddddddd\d»œ	e-eeeeeeRf  eeT ee ee ee eedd¼œd½d¾„Znddœd¿dÀ„ZoePe edÁœdÂdÃ„ZpdádddddÄœe[eeeeeq edÅœdÆdÇ„ZrdddÈœeeedÉœdÊdË„ZsdddÈœeeeddÌœdÍdÎ„ZtdddddÏœeeu eee eedÐœdÑdÒ„ZvddewddÏœeeeu eeeddÓœdÔdÕ„ZxdS )ârŒ   a]  A high level console interface.

    Args:
        color_system (str, optional): The color system supported by your terminal,
            either ``"standard"``, ``"256"`` or ``"truecolor"``. Leave as ``"auto"`` to autodetect.
        force_terminal (Optional[bool], optional): Enable/disable terminal control codes, or None to auto-detect terminal. Defaults to None.
        force_jupyter (Optional[bool], optional): Enable/disable Jupyter rendering, or None to auto-detect Jupyter. Defaults to None.
        force_interactive (Optional[bool], optional): Enable/disable interactive mode, or None to auto detect. Defaults to None.
        soft_wrap (Optional[bool], optional): Set soft wrap default on print method. Defaults to False.
        theme (Theme, optional): An optional style theme object, or ``None`` for default theme.
        stderr (bool, optional): Use stderr rather than stdout if ``file`` is not specified. Defaults to False.
        file (IO, optional): A file object where the console should write to. Defaults to stdout.
        quiet (bool, Optional): Boolean to suppress all output. Defaults to False.
        width (int, optional): The width of the terminal. Leave as default to auto-detect width.
        height (int, optional): The height of the terminal. Leave as default to auto-detect height.
        style (StyleType, optional): Style to apply to all output, or None for no style. Defaults to None.
        no_color (Optional[bool], optional): Enabled no color mode, or None to auto detect. Defaults to None.
        tab_size (int, optional): Number of spaces used to replace a tab character. Defaults to 8.
        record (bool, optional): Boolean to enable recording of terminal output,
            required to call :meth:`export_html` and :meth:`export_text`. Defaults to False.
        markup (bool, optional): Boolean to enable :ref:`console_markup`. Defaults to True.
        emoji (bool, optional): Enable emoji code. Defaults to True.
        emoji_variant (str, optional): Optional emoji variant, either "text" or "emoji". Defaults to None.
        highlight (bool, optional): Enable automatic highlighting. Defaults to True.
        log_time (bool, optional): Boolean to enable logging of time by :meth:`log` methods. Defaults to True.
        log_path (bool, optional): Boolean to enable the logging of the caller by :meth:`log`. Defaults to True.
        log_time_format (Union[str, TimeFormatterCallable], optional): If ``log_time`` is enabled, either string for strftime or callable that formats the time. Defaults to "[%X] ".
        highlighter (HighlighterType, optional): Default highlighter.
        legacy_windows (bool, optional): Enable legacy Windows mode, or ``None`` to auto detect. Defaults to ``None``.
        safe_box (bool, optional): Restrict box options that don't render on legacy Windows.
        get_datetime (Callable[[], datetime], optional): Callable that gets the current time as a datetime.datetime object (used by Console.log),
            or None for datetime.now.
        get_time (Callable[[], time], optional): Callable that gets the current time in seconds, default uses time.monotonic.
    Ú_environÚautoNFr!   Tz[%X])Úcolor_systemÚforce_terminalÚforce_jupyterÚforce_interactiveÚ	soft_wrapr²   ÚstderrÚfileÚquietr]   r^   rÆ   Úno_colorÚtab_sizeÚrecordrn   ÚemojiÚemoji_variantrm   Úlog_timeÚlog_pathÚlog_time_formatÚhighlighterrd   Úsafe_boxÚget_datetimeÚget_timerú   )rû   rã   rä   rå   ræ   ÚHighlighterTypec                C   s  |d ur|| _ |d u rtƒ n|| _| jr8|
p.d}
|p6d}|| _|
| _|| _|| _|| _|| _|| _	|| _
|| _|d u r„tƒ o†| j n|| _|
d u r¼| j  d¡}|d ur¼| ¡ r¼t|ƒ| j }
|d u rè| j  d¡}|d urè| ¡ rèt|ƒ}|| _|
| _|| _|  || _|| _|	| _|| _|d u �r(d | _n |dk�r>|  ¡ | _n
t| | _t ¡ | _t|||d�| _|�pjt| _|| _|�p~t j!| _"|�pŠt#| _$|| _%|d u�r¢|nd| j v | _&|d u �rÈ| j'�oÊ| j( n|| _)t ¡ | _*t+t,|d u �rìt-j.n|ƒd�| _/g | _0g | _1d | _2d	| _3d S )
Né]   éd   ÚCOLUMNSÚLINESrû   )Z	show_timeZ	show_pathÚtime_formatZNO_COLOR)rí   F)4rú   râ   Ú
is_jupyterr   Ú_widthÚ_heightr  r  Ú_markupÚ_emojiÚ_emoji_variantÚ
_highlightr÷   rd   r¯   Úisdigitr`   Ú_force_terminalÚ_filer  r  Ú_color_systemÚ_detect_color_systemÚCOLOR_SYSTEMSÚ	threadingr   r»   r*   Ú_log_renderÚ_null_highlighterr  r  r   Únowr  r   r  rÆ   r  rg   Úis_dumb_terminalZis_interactiveÚ_record_buffer_lockrì   rH   r'   ÚDEFAULTÚ_thread_localsÚ_record_bufferÚ_render_hooksÚ_liveÚ_is_alt_screen)rt   rü   rý   rþ   rÿ   r   r²   r  r  r  r]   r^   rÆ   r  r  r  rn   r  r  rm   r	  r
  r  r  rd   r  r  r  rú   Úcolumnsr›   rZ   rZ   r[   r—   j  s‚    #ÿý



ýÿÿý
ÿzConsole.__init__ro   c                 C   s   d| j › dt| jƒ› d�S )Nz<console width=ú ú>)r]   rƒ   r   rs   rZ   rZ   r[   Ú__repr__Ú  s    zConsole.__repr__c                 C   s(   | j p| jrtjntj}t|d|ƒ}|S )z Get the file object to write to.Zrich_proxied_file)r  r  ÚsysÚstdoutÚgetattr)rt   r  rZ   rZ   r[   r  Ý  s    zConsole.file)Únew_filerp   c                 C   s
   || _ dS )zSet a new file object.N)r  )rt   r6  rZ   rZ   r[   r  ä  s    c                 C   s   | j jS ©zGet a thread local buffer.)r*  rÀ   rs   rZ   rZ   r[   r¼   é  s    zConsole._bufferc                 C   s   | j jS r7  ©r*  rï   rs   rZ   rZ   r[   Ú_buffer_indexî  s    zConsole._buffer_index)Úvaluerp   c                 C   s   || j _d S rŠ   r8  )rt   r:  rZ   rZ   r[   r9  ó  s    c                 C   s   | j jS )z!Get the thread local theme stack.)r*  rí   rs   rZ   rZ   r[   Ú_theme_stack÷  s    zConsole._theme_stackc                 C   s¤   | j rtjS | jr| jrdS trD| jr,tjS tƒ }|jr>tjS tj	S | j
 dd¡ ¡  ¡ }|dv rhtjS | j
 dd¡ ¡  ¡ }| d¡\}}}t |tj¡}|S dS )z"Detect color system from env vars.NZ	COLORTERMrÄ   )rå   Z24bitÚTERMú-)r  r-   Ú	TRUECOLORrg   r'  rö   rd   rô   rå   Ú	EIGHT_BITrú   r¯   rù   ÚlowerÚ
rpartitionÚ_TERM_COLORSÚSTANDARD)rt   Zwindows_console_featuresZ
color_termZtermZ
_term_nameZ_hyphenZcolorsrü   rZ   rZ   r[   r!  ü  s&    ÿýzConsole._detect_color_systemc                 C   s   |  j d7  _ dS )z4Enter in to a buffer context, and buffer all output.r%   N)r9  rs   rZ   rZ   r[   rº     s    zConsole._enter_bufferc                 C   s   |  j d8  _ |  ¡  dS )z5Leave buffer context, and render content if required.r%   N)r9  Ú_check_bufferrs   rZ   rZ   r[   r¿     s    zConsole._exit_bufferrJ   )Úliverp   c                 C   sD   | j �* | jdurt d¡‚|| _W d  ƒ n1 s60    Y  dS )zçSet Live instance. Used by Live context manager.

        Args:
            live (Live): Live instance using this Console.

        Raises:
            errors.LiveError: If this Console has a Live context currently active.
        Nz+Only one live display may be active at once)r»   r-  r&   Z	LiveError)rt   rE  rZ   rZ   r[   Úset_live  s    	

zConsole.set_livec                 C   s0   | j � d| _W d  ƒ n1 s"0    Y  dS )zClear the Live instance.N)r»   r-  rs   rZ   rZ   r[   Ú
clear_live+  s    zConsole.clear_live)Úhookrp   c                 C   s6   | j � | j |¡ W d  ƒ n1 s(0    Y  dS )zpAdd a new render hook to the stack.

        Args:
            hook (RenderHook): Render hook instance.
        N)r»   r,  Úappend)rt   rH  rZ   rZ   r[   Úpush_render_hook0  s    zConsole.push_render_hookc                 C   s4   | j � | j ¡  W d  ƒ n1 s&0    Y  dS )z'Pop the last renderhook from the stack.N)r»   r,  Úpoprs   rZ   rZ   r[   Úpop_render_hook9  s    zConsole.pop_render_hookc                 C   s   |   ¡  | S )z,Own context manager to enter buffer context.©rº   rs   rZ   rZ   r[   r§   >  s    zConsole.__enter__)r©   Ú	exc_valueÚ	tracebackrp   c                 C   s   |   ¡  dS )zExit buffer context.N)r¿   )rt   r©   rN  rO  rZ   rZ   r[   r®   C  s    zConsole.__exit__c                 C   s   |   ¡  dS )z`Begin capturing console output. Call :meth:`end_capture` to exit capture mode and return output.NrM  rs   rZ   rZ   r[   r¦   G  s    zConsole.begin_capturec                 C   s$   |   | j¡}| jdd…= |  ¡  |S )zhEnd capture mode and return captured string.

        Returns:
            str: Console output.
        N)r½   r¼   r¿   )rt   Zrender_resultrZ   rZ   r[   r¬   K  s    zConsole.end_capture©r³   )r²   r³   rp   c                C   s   | j j||d� dS )a�  Push a new theme on to the top of the stack, replacing the styles from the previous theme.
        Generally speaking, you should call :meth:`~rich.console.Console.use_theme` to get a context manager, rather
        than calling this method directly.

        Args:
            theme (Theme): A theme instance.
            inherit (bool, optional): Inherit existing styles. Defaults to True.
        rP  N)r;  r´   ©rt   r²   r³   rZ   rZ   r[   r´   V  s    	zConsole.push_themec                 C   s   | j  ¡  dS )z9Remove theme from top of stack, restoring previous theme.N)r;  rµ   rs   rZ   rZ   r[   rµ   a  s    zConsole.pop_themec                C   s   t | ||ƒS )a  Use a different theme for the duration of the context manager.

        Args:
            theme (Theme): Theme instance to user.
            inherit (bool, optional): Inherit existing console styles. Defaults to True.

        Returns:
            ThemeContext: [description]
        )r±   rQ  rZ   rZ   r[   Ú	use_themee  s    
zConsole.use_themec                 C   s   | j durt| j  S dS dS )zpGet color system string.

        Returns:
            Optional[str]: "standard", "256" or "truecolor".
        N)r   Ú_COLOR_SYSTEMS_NAMESrs   rZ   rZ   r[   rü   q  s    

zConsole.color_systemc                 C   s   t | jddƒpd ¡ S )zGet the encoding of the console file, e.g. ``"utf-8"``.

        Returns:
            str: A standard encoding string.
        rh   úutf-8)r5  r  r@  rs   rZ   rZ   r[   rh   ~  s    zConsole.encodingc                 C   sL   | j dur| j S t| jddƒ}z|du r,dn|ƒ W S  tyF   Y dS 0 dS )zÉCheck if the console is writing to a terminal.

        Returns:
            bool: True if the console writing to a device capable of
            understanding terminal codes, otherwise False.
        NÚisattyF)r  r5  r  Ú
ValueError)rt   rU  rZ   rZ   r[   rg   ‡  s    
zConsole.is_terminalc                 C   s$   | j  dd¡}| ¡ dv }| jo"|S )zxDetect dumb terminal.

        Returns:
            bool: True if writing to a dumb terminal, otherwise False.

        r<  rÄ   )ZdumbÚunknown)rú   r¯   r@  rg   )rt   Z_termZis_dumbrZ   rZ   r[   r'  š  s    zConsole.is_dumb_terminalc              	   C   s$   t | jj| j| jd| j| j| jd�S )zGet default console options.r%   )ri   rc   rd   re   rf   rh   rg   )rb   rc   r^   rd   r]   rh   rg   rs   rZ   rZ   r[   ry   ¦  s    ùzConsole.optionsc                 C   sb  | j dur(| jdur(t| j | j | jƒS | jr8tddƒS d}d}trjzt ¡ \}}W qÎ tyf   Y qÎ0 ndzt t	j
 ¡ ¡\}}W nJ tttfyÌ   zt t	j ¡ ¡\}}W n tttfyÆ   Y n0 Y n0 | j d¡}|durò| ¡ ròt|ƒ}| j d¡}|du�r| ¡ �rt|ƒ}|�p"d}|�p,d}t| j du �rF|| j n| j | jdu �rZ|n| jƒS )zGet the size of the console.

        Returns:
            ConsoleDimensions: A named tuple containing the dimensions.
        NéP   é   r  r  )r  r  r\   rd   r'  rö   ÚosÚget_terminal_sizeÚOSErrorr3  Ú	__stdin__ÚfilenoÚAttributeErrorrV  Ú
__stdout__rú   r¯   r  r`   )rt   r]   r^   r/  r›   rZ   rZ   r[   rc   ³  s<    


þzConsole.size)Únew_sizerp   c                 C   s   |\}}|| _ || _dS )zvSet a new size for the terminal.

        Args:
            new_size (Tuple[int, int]): New width and height.
        N)r  r  )rt   ra  r]   r^   rZ   rZ   r[   rc   á  s    c                 C   s   | j jS )zsGet the width of the console.

        Returns:
            int: The width (in characters) of the console.
        )rc   r]   rs   rZ   rZ   r[   r]   ì  s    zConsole.widthr}   c                 C   s
   || _ dS )zFSet width.

        Args:
            width (int): New width.
        N)r  )rt   r]   rZ   rZ   r[   r]   õ  s    c                 C   s   | j jS )zpGet the height of the console.

        Returns:
            int: The height (in lines) of the console.
        )rc   r^   rs   rZ   rZ   r[   r^   þ  s    zConsole.heightr   c                 C   s
   || _ dS )zISet height.

        Args:
            height (int): new height.
        N)r  )rt   r^   rZ   rZ   r[   r^     s    c                 C   s   |   t ¡ ¡ dS )z3Play a 'bell' sound (if supported by the terminal).N)Úcontrolr.   Úbellrs   rZ   rZ   r[   rc    s    zConsole.bellc                 C   s   t | ƒ}|S )aá  A context manager to *capture* the result of print() or log() in a string,
        rather than writing it to the console.

        Example:
            >>> from rich.console import Console
            >>> console = Console()
            >>> with console.capture() as capture:
            ...     console.print("[bold magenta]Hello World[/]")
            >>> print(capture.get())

        Returns:
            Capture: Context manager with disables writing to the terminal.
        )r£   )rt   ÚcapturerZ   rZ   r[   rd    s    zConsole.capture)r·   r¸   r¹   rp   c                 C   s   t | |||d�S )a  A context manager to display anything printed within a "pager". The pager application
        is defined by the system and will typically support at least pressing a key to scroll.

        Args:
            pager (Pager, optional): A pager object, or None to use :class:`~rich.pager.SystemPager`. Defaults to None.
            styles (bool, optional): Show styles in pager. Defaults to False.
            links (bool, optional): Show links in pager. Defaults to False.

        Example:
            >>> from rich.console import Console
            >>> from rich.__main__ import make_test_card
            >>> console = Console()
            >>> with console.pager():
                    console.print(make_test_card())

        Returns:
            PagerContext: A context manager.
        )r·   r¸   r¹   )r¶   )rt   r·   r¸   r¹   rZ   rZ   r[   r·   %  s    zConsole.pagerr%   r”   c                 C   s"   |dksJ dƒ‚|   t|ƒ¡ dS )zqWrite new line(s).

        Args:
            count (int, optional): Number of new lines. Defaults to 1.
        r   zcount must be >= 0N)rÏ   r“   r–   rZ   rZ   r[   r¢   <  s    zConsole.line)Úhomerp   c                 C   s,   |r|   t ¡ t ¡ ¡ n|   t ¡ ¡ dS )z‡Clear the screen.

        Args:
            home (bool, optional): Also move the cursor to 'home' position. Defaults to True.
        N)rb  r.   Úclearre  )rt   re  rZ   rZ   r[   rf  F  s    zConsole.clearÚdotszstatus.spinnerg      ð?g      )@)ÚspinnerÚspinner_styleÚspeedÚrefresh_per_secondrL   )Ústatusrh  ri  rj  rk  rp   c                C   s$   ddl m} ||| ||||d�}|S )at  Display a status and spinner.

        Args:
            status (RenderableType): A status renderable (str or Text typically).
            spinner (str, optional): Name of spinner animation (see python -m rich.spinner). Defaults to "dots".
            spinner_style (StyleType, optional): Style of spinner. Defaults to "status.spinner".
            speed (float, optional): Speed factor for spinner animation. Defaults to 1.0.
            refresh_per_second (float, optional): Number of refreshes per second. Defaults to 12.5.

        Returns:
            Status: A Status object that may be used as a context manager.
        r%   rK   )r�   rh  ri  rj  rk  )rl  rL   )rt   rl  rh  ri  rj  rk  rL   Zstatus_renderablerZ   rZ   r[   rl  Q  s    úzConsole.status)r¾   rp   c                 C   s$   | j r | js |  t |¡¡ dS dS )zqShow or hide the cursor.

        Args:
            show (bool, optional): Set visibility of the cursor.
        TF)rg   rd   rb  r.   rÑ   )rt   r¾   rZ   rZ   r[   rÑ   r  s    zConsole.show_cursor)Úenablerp   c                 C   s.   d}| j r*| js*|  t |¡¡ d}|| _|S )aº  Enables alternative screen mode.

        Note, if you enable this mode, you should ensure that is disabled before
        the application exits. See :meth:`~rich.Console.screen` for a context manager
        that handles this for you.

        Args:
            enable (bool, optional): Enable (True) or disable (False) alternate screen. Defaults to True.

        Returns:
            bool: True if the control codes were written.

        FT)rg   rd   rb  r.   Z
alt_screenr.  )rt   rm  ÚchangedrZ   rZ   r[   rÐ   }  s    zConsole.set_alt_screenc                 C   s   | j S )z†Check if the alt screen was enabled.

        Returns:
            bool: True if the alt screen was enabled, otherwise False.
        )r.  rs   rZ   rZ   r[   Úis_alt_screen’  s    zConsole.is_alt_screenrÃ   )rÅ   rÆ   rp   c                 C   s   t | ||pdd�S )au  Context manager to enable and disable 'alternative screen' mode.

        Args:
            hide_cursor (bool, optional): Also hide the cursor. Defaults to False.
            style (Style, optional): Optional style for screen. Defaults to None.

        Returns:
            ~ScreenContext: Context which enables alternate screen on enter, and disables it on exit.
        rÄ   )rÅ   rÆ   )rÃ   )rt   rÅ   rÆ   rZ   rZ   r[   rÈ   ›  s    zConsole.screen©ry   )rÎ   ry   rp   c                C   s   t  | |p| j|¡}|S )aó  Measure a renderable. Returns a :class:`~rich.measure.Measurement` object which contains
        information regarding the number of characters required to print the renderable.

        Args:
            renderable (RenderableType): Any renderable or string.
            options (Optional[ConsoleOptions], optional): Options to use when measuring, or None
                to use default options. Defaults to None.

        Returns:
            Measurement: A measurement of the renderable.
        )r4   r¯   ry   )rt   rÎ   ry   ZmeasurementrZ   rZ   r[   Úmeasure©  s    zConsole.measurec           	      c   sæ   |p| j }|jdk rdS t|ƒ}t|dƒr@t|ƒs@| | |¡}n>t|tƒrl| j||j	|j
d�}| | |¡}nt d|›d�¡‚zt|ƒ}W n$ ty®   t d|›d�¡‚Y n0 t}|D ](}t||ƒrÎ|V  q¸|  ||¡E dH  q¸dS )	ak  Render an object in to an iterable of `Segment` instances.

        This method contains the logic for rendering objects with the console protocol.
        You are unlikely to need to use it directly, unless you are extending the library.

        Args:
            renderable (RenderableType): An object supporting the console protocol, or
                an object that may be converted to a string.
            options (ConsoleOptions, optional): An options object, or None to use self.options. Defaults to None.

        Returns:
            Iterable[Segment]: An iterable of segments that may be rendered.
        r%   Nr‘   )rm   rn   zUnable to render zC; A str, Segment or object with __rich_console__ method is requiredzobject z is not renderable)ry   rf   r:   Úhasattrr
   r‘   rz   rƒ   Ú
render_strrm   rn   r&   ZNotRenderableErrorÚiterÚ	TypeErrorr>   r3   )	rt   rÎ   ry   Ú_optionsZrender_iterableZtext_renderableZiter_renderZ_SegmentZrender_outputrZ   rZ   r[   r3   º  s2    



ÿ
ÿ
ÿ

zConsole.render)rÆ   ÚpadÚ	new_lines)rÎ   ry   rÆ   rw  rx  rp   c             	   C   sÔ   | j �º |p| j}|  ||¡}|r.t ||¡}tttj||j||d�d|j	ƒƒ}|j	dur®|j	t
|ƒ }	|	dkr®|rŒtd|j |ƒtdƒgntd|j |ƒgg}
| |
|	 ¡ |W  d  ƒ S 1 sÆ0    Y  dS )aG  Render objects in to a list of lines.

        The output of render_lines is useful when further formatting of rendered console text
        is required, such as the Panel class which draws a border around any renderable object.

        Args:
            renderable (RenderableType): Any object renderable in the console.
            options (Optional[ConsoleOptions], optional): Console options, or None to use self.options. Default to ``None``.
            style (Style, optional): Optional style to apply to renderables. Defaults to ``None``.
            pad (bool, optional): Pad lines shorter than render width. Defaults to ``True``.
            new_lines (bool, optional): Include "
" characters at end of lines.

        Returns:
            List[List[Segment]]: A list of lines, where a line is a list of Segment objects.
        )Zinclude_new_linesrw  Nr   r0  r˜   )r»   ry   r3   r>   Úapply_styler×   r   Úsplit_and_crop_linesrf   r^   rÌ   Úextend)rt   rÎ   ry   rÆ   rw  rx  Úrender_optionsZ	_renderedr›   Úextra_linesZpad_linerZ   rZ   r[   Úrender_linesì  s4    
üøÿ
ÿýzConsole.render_linesrÄ   )rÆ   rj   rk   r  rn   rm   r  rE   )	ÚtextrÆ   rj   rk   r  rn   rm   r  rp   c                C   s´   |p|du o| j }	|p"|du o"| j}
|p4|du o4| j}|
rZt|||	| jd�}||_||_n"t|	rnt|| jd�n||||d�}|rŠ|pŒ| j	nd}|dur°|t
|ƒƒ}| |¡ |S |S )a©  Convert a string to a Text instance. This is is called automatically if
        you print or log a string.

        Args:
            text (str): Text to render.
            style (Union[str, Style], optional): Style to apply to rendered text.
            justify (str, optional): Justify method: "default", "left", "center", "full", or "right". Defaults to ``None``.
            overflow (str, optional): Overflow method: "crop", "fold", or "ellipsis". Defaults to ``None``.
            emoji (Optional[bool], optional): Enable emoji, or ``None`` to use Console default.
            markup (Optional[bool], optional): Enable markup, or ``None`` to use Console default.
            highlight (Optional[bool], optional): Enable highlighting, or ``None`` to use Console default.
            highlighter (HighlighterType, optional): Optional highlighter to apply.
        Returns:
            ConsoleRenderable: Renderable object.

        N)rÆ   r  r  )Zdefault_variant)rj   rk   rÆ   )r  r  r  Úrender_markupr  rj   rk   rE   r(   r  rƒ   Zcopy_styles)rt   r  rÆ   rj   rk   r  rn   rm   r  Zemoji_enabledZmarkup_enabledZhighlight_enabledZ	rich_textÚ_highlighterZhighlight_textrZ   rZ   r[   rs  !  s4    üÿú	
zConsole.render_str)rN   )rè   rN   rp   c             
   C   s¢   t |tƒr|S z2| j |¡}|du r.t |¡}|jr<| ¡ n|W S  tjyœ } zB|durp|  	|¡W  Y d}~S t 
d|›d|› �¡d‚W Y d}~n
d}~0 0 dS )a!  Get a Style instance by it's theme name or parse a definition.

        Args:
            name (str): The name of a style or a style definition.

        Returns:
            Style: A Style object.

        Raises:
            MissingStyle: If no style could be parsed from name.

        NzFailed to get style z; )rz   r?   r;  r¯   ÚparseÚlinkrx   r&   ZStyleSyntaxErrorÚ	get_styleZMissingStyle)rt   rè   rN   rÆ   ÚerrorrZ   rZ   r[   r„  \  s    

ÿþzConsole.get_style©rj   r  rn   rm   )ÚobjectsÚseprË   rj   r  rn   rm   rp   c                   s6  g }|j ‰ g ‰ˆj }	ˆ ‰ˆdv r:tddœ‡ ‡fdd„}
|
‰t}|sP|du rV| jrV| j}ddœ‡‡‡‡‡fdd„}|D ]Œ}t|ƒ}t|tƒr¢|	| j||||d	�ƒ qtt|t	ƒr¶|	|ƒ qtt|t
ƒrÐ|ƒ  ˆ|ƒ qtt|ƒrð|ƒ  ˆt||d
�ƒ qt|	|t|ƒƒƒ qt|ƒ  | jdu�r2|  | j¡‰‡fdd„|D ƒ}|S )a  Combine a number of renderables and text into one renderable.

        Args:
            objects (Iterable[Any]): Anything that Rich can render.
            sep (str): String to write between print data.
            end (str): String to write at end of print data.
            justify (str, optional): One of "left", "right", "center", or "full". Defaults to ``None``.
            emoji (Optional[bool], optional): Enable emoji code, or ``None`` to use console default.
            markup (Optional[bool], optional): Enable markup, or ``None`` to use console default.
            highlight (Optional[bool], optional): Enable automatic highlighting, or ``None`` to use console default.

        Returns:
            List[ConsoleRenderable]: A list of things to render.
        )rO   rP   rQ   N)rÎ   rp   c                    s   ˆ t | ttˆƒƒƒ d S rŠ   )r+   r   r,   )rÎ   )Ú_appendrj   rZ   r[   Úalign_append›  s    z2Console._collect_renderables.<locals>.align_appendro   c                     s.   ˆr*t ˆˆˆd�} ˆ |  ˆ¡ƒ ˆd d …= d S )N)rj   rË   )rE   Újoin)Zsep_text)rI  rË   rj   rˆ  r  rZ   r[   Ú
check_text¤  s    z0Console._collect_renderables.<locals>.check_text)r  rn   r  )r  c                    s   g | ]}t |ˆ ƒ‘qS rZ   rA   ©rç   rÎ   rÇ   rZ   r[   Ú
<listcomp>Á  rë   z0Console._collect_renderables.<locals>.<listcomp>)rI  rÒ   r%  r  r  r:   rz   rƒ   rs  rE   r‰   r9   r8   rÆ   r„  )rt   r‡  rˆ  rË   rj   r  rn   rm   rÊ   Zappend_textrŠ  r�  rŒ  rÎ   rZ   )r‰  rI  rË   rj   rˆ  rÆ   r  r[   Ú_collect_renderablesz  sD    
ÿÿ



zConsole._collect_renderablesu   â”€z	rule.linerP   )Ú
charactersrÆ   Úalign)Útitler�  rÆ   r‘  rp   c                C   s*   ddl m} |||||d�}|  |¡ dS )u­  Draw a line with optional centered title.

        Args:
            title (str, optional): Text to render over the rule. Defaults to "".
            characters (str, optional): Character(s) to form the line. Defaults to "â”€".
            style (str, optional): Style of line. Defaults to "rule.line".
            align (str, optional): How to align the title, one of "left", "center", or "right". Defaults to "center".
        r%   )ÚRule)r’  r�  rÆ   r‘  N)Úruler“  rÏ   )rt   r’  r�  rÆ   r‘  r“  r”  rZ   rZ   r[   r”  Å  s    zConsole.rule)rb  rp   c                 G   sD   | j s@| �& | j dd„ |D ƒ¡ W d  ƒ n1 s60    Y  dS )z’Insert non-printing control codes.

        Args:
            control_codes (str): Control codes, such as those that may move the cursor.
        c                 s   s   | ]}|j V  qd S rŠ   )Úsegment)rç   Z_controlrZ   rZ   r[   Ú	<genexpr>â  rë   z"Console.control.<locals>.<genexpr>N)r'  r¼   r{  )rt   rb  rZ   rZ   r[   rb  Ú  s    zConsole.controlr0  r˜   )rˆ  rË   rÆ   rm   )r‡  rˆ  rË   rÆ   rm   rp   c                G   s4   |  dd„ |D ƒ¡}| j|||ddddd|d�	 dS )a·  Output to the terminal. This is a low-level way of writing to the terminal which unlike
        :meth:`~rich.console.Console.print` won't pretty print, wrap text, or apply markup, but will
        optionally apply highlighting and a basic style.

        Args:
            sep (str, optional): String to write between print data. Defaults to " ".
            end (str, optional): String to write at end of print data. Defaults to "\\n".
            style (Union[str, Style], optional): A style to apply to output. Defaults to None.
            highlight (Optional[bool], optional): Enable automatic highlighting, or ``None`` to use
                console default. Defaults to ``None``.
        c                 s   s   | ]}t |ƒV  qd S rŠ   )rƒ   )rç   Z_objectrZ   rZ   r[   r–  ÷  rë   zConsole.out.<locals>.<genexpr>FTrU   )rÆ   rm   r  rn   rl   rk   rT   rË   N)r‹  rÏ   )rt   rˆ  rË   rÆ   rm   r‡  Z
raw_outputrZ   rZ   r[   Úoutä  s    ÷zConsole.out)rˆ  rË   rÆ   rj   rk   rl   r  rn   rm   r]   r^   rT   r   Únew_line_start)r‡  rˆ  rË   rÆ   rj   rk   rl   r  rn   rm   r]   r^   rT   r   r˜  rp   c             
   G   sœ  |st ƒ f}|du r| j}|r:|du r*d}|du r6d}d}| jdd… }| ��8 | j|||||||	d�}|D ]}| |¡}ql| jj|||
duršt|
| jƒnt	||||	d�}g }|j
}| j}|du rÜ|D ]}||||ƒƒ qÆn&|D ] }|t |||ƒ|  |¡¡ƒ qà|�r:td dd	„ |D ƒ¡ ¡ ƒd
k�r:| dt ¡ ¡ |�rl| jj
}tj|| jdd�D ]}||ƒ �qZn| j 
|¡ W d  ƒ n1 �sŽ0    Y  dS )a[  Print to the console.

        Args:
            objects (positional args): Objects to log to the terminal.
            sep (str, optional): String to write between print data. Defaults to " ".
            end (str, optional): String to write at end of print data. Defaults to "\\n".
            style (Union[str, Style], optional): A style to apply to output. Defaults to None.
            justify (str, optional): Justify method: "default", "left", "right", "center", or "full". Defaults to ``None``.
            overflow (str, optional): Overflow method: "ignore", "crop", "fold", or "ellipsis". Defaults to None.
            no_wrap (Optional[bool], optional): Disable word wrapping. Defaults to None.
            emoji (Optional[bool], optional): Enable emoji code, or ``None`` to use console default. Defaults to ``None``.
            markup (Optional[bool], optional): Enable markup, or ``None`` to use console default. Defaults to ``None``.
            highlight (Optional[bool], optional): Enable automatic highlighting, or ``None`` to use console default. Defaults to ``None``.
            width (Optional[int], optional): Width of output, or ``None`` to auto-detect. Defaults to ``None``.
            crop (Optional[bool], optional): Crop output to width of terminal. Defaults to True.
            soft_wrap (bool, optional): Enable soft wrap mode which disables word wrapping and cropping of text or ``None`` for
                Console default. Defaults to ``None``.
            new_line_start (bool, False): Insert a new line at the start if the output contains more than one line. Defaults to ``False``.
        NTrU   Fr†  )rj   rk   r]   r^   rl   rn   rm   rÄ   c                 s   s   | ]}|j V  qd S rŠ   )r  ©rç   r•  rZ   rZ   r[   r–  Z  rë   z Console.print.<locals>.<genexpr>r%   r   ©rw  )r“   r   r,  r�  rñ   ry   r|   Úminr]   r‡   r{  r3   r>   ry  r„  rÌ   r‹  Ú
splitlinesÚinsertr¢   r¼   rz  )rt   rˆ  rË   rÆ   rj   rk   rl   r  rn   rm   r]   r^   rT   r   r˜  r‡  Úrender_hooksrÊ   rH  r|  Únew_segmentsr{  r3   rÎ   Úbuffer_extendr¢   rZ   rZ   r[   rÏ     sr    %ù	ù
ÿÿÿÿÿ
zConsole.printé   )	ÚdataÚindentrm   Ú	skip_keysÚensure_asciiÚcheck_circularÚ	allow_nanrN   Ú	sort_keys)Újsonr¢  r£  rm   r¤  r¥  r¦  r§  rN   r¨  rp   c       	         C   sx   ddl m} |du r2|j||||||||	|
d�	}n4t|tƒsLtd|›d�ƒ‚|||||||||	|
d�	}| j|dd� dS )	aó  Pretty prints JSON. Output will be valid JSON.

        Args:
            json (Optional[str]): A string containing JSON.
            data (Any): If json is not supplied, then encode this data.
            indent (Union[None, int, str], optional): Number of spaces to indent. Defaults to 2.
            highlight (bool, optional): Enable highlighting of output: Defaults to True.
            skip_keys (bool, optional): Skip keys not of a basic type. Defaults to False.
            ensure_ascii (bool, optional): Escape all non-ascii characters. Defaults to False.
            check_circular (bool, optional): Check for circular references. Defaults to True.
            allow_nan (bool, optional): Allow NaN and Infinity values. Defaults to True.
            default (Callable, optional): A callable that converts values that can not be encoded
                in to something that can be JSON encoded. Defaults to None.
            sort_keys (bool, optional): Sort dictionary keys. Defaults to False.
        r   )ÚJSONN)r£  rm   r¤  r¥  r¦  r§  rN   r¨  z/json must be str. Did you mean print_json(data=z) ?T)r   )Zpip._vendor.rich.jsonrª  Z	from_datarz   rƒ   ru  rÏ   )rt   r©  r¢  r£  rm   r¤  r¥  r¦  r§  rN   r¨  rª  Zjson_renderablerZ   rZ   r[   Ú
print_jsong  s:    ÷

ÿ÷zConsole.print_json)Úregionry   )rÎ   r¬  ry   rp   c          
      C   sz   | j st d¡‚|p| j}|du rBd }}| |j|jp<| j¡}n|\}}}}| ||¡}| j||d�}	|  |	||¡ dS )a³  Update the screen at a given offset.

        Args:
            renderable (RenderableType): A Rich renderable.
            region (Region, optional): Region of screen to update, or None for entire screen. Defaults to None.
            x (int, optional): x offset. Defaults to 0.
            y (int, optional): y offset. Defaults to 0.

        Raises:
            errors.NoAltScreen: If the Console isn't in alt screen mode.

        ú0Alt screen must be enabled to call update_screenNr   rp  )	ro  r&   ÚNoAltScreenry   r�   rf   r^   r~  Úupdate_screen_lines)
rt   rÎ   r¬  ry   r|  rœ   r�   r]   r^   r›   rZ   rZ   r[   Úupdate_screen¤  s    

ÿzConsole.update_screenr   rš   c                 C   s>   | j st d¡‚t|||ƒ}|  |¡}| j |¡ |  ¡  dS )a”  Update lines of the screen at a given offset.

        Args:
            lines (List[List[Segment]]): Rendered lines (as produced by :meth:`~rich.Console.render_lines`).
            x (int, optional): x offset (column no). Defaults to 0.
            y (int, optional): y offset (column no). Defaults to 0.

        Raises:
            errors.NoAltScreen: If the Console isn't in alt screen mode.
        r­  N)ro  r&   r®  r™   r3   r¼   r{  rD  )rt   r›   rœ   r�   Zscreen_updaterÁ   rZ   rZ   r[   r¯  Æ  s    

zConsole.update_screen_linesr  r    rZ   ©r]   r}  r²   Ú	word_wrapÚshow_localsÚsuppressÚ
max_frames)r]   r}  r²   r²  r³  r´  rµ  rp   c          
   	   C   s0   ddl m} ||||||||d�}	|  |	¡ dS )a  Prints a rich render of the last exception and traceback.

        Args:
            width (Optional[int], optional): Number of characters used to render code. Defaults to 88.
            extra_lines (int, optional): Additional lines of code to render. Defaults to 3.
            theme (str, optional): Override pygments theme used in traceback
            word_wrap (bool, optional): Enable word wrapping of long lines. Defaults to False.
            show_locals (bool, optional): Enable display of local variables. Defaults to False.
            suppress (Iterable[Union[str, ModuleType]]): Optional sequence of modules or paths to exclude from traceback.
            max_frames (int): Maximum number of frames to show in a traceback, 0 for no maximum. Defaults to 100.
        r%   )Ú	Tracebackr±  N)rO  r¶  rÏ   )
rt   r]   r}  r²   r²  r³  r´  rµ  r¶  rO  rZ   rZ   r[   Úprint_exceptionÚ  s    ù	zConsole.print_exception)r¡   Úcurrentframerp   c                 C   sn   | d7 } |ƒ }|durL| r.|r.|j }| d8 } q|dus:J ‚|jj|j|jfS t ¡ |  }|j|j|j	jfS dS )aE  Get caller frame information.

        Args:
            offset (int): the caller offset within the current frame stack.
            currentframe (Callable[[], Optional[FrameType]], optional): the callable to use to
                retrieve the current frame. Defaults to ``inspect.currentframe``.

        Returns:
            Tuple[str, int, Dict[str, Any]]: A tuple containing the filename, the line number and
                the dictionary of local variables associated with the caller frame.

        Raises:
            RuntimeError: If the stack offset is invalid.
        r%   N)
Úf_backÚf_codeÚco_filenameÚf_linenoÚf_localsÚinspectÚstackÚfilenameÚlinenoÚframe)r¡   r¸  rÂ  Z
frame_inforZ   rZ   r[   Ú_caller_frame_infoý  s    
zConsole._caller_frame_info)	rˆ  rË   rÆ   rj   r  rn   rm   Ú
log_localsÚ_stack_offset)r‡  rˆ  rË   rÆ   rj   r  rn   rm   rÄ  rÅ  rp   c       	      
      sd  |
st ƒ f}
| jdd… }| ��. | j|
||||||d�}ˆ durT‡ fdd„|D ƒ}|  |	¡\}}}| d¡rrdn
tj |¡}| tj	¡d }|r¶dd„ | 
¡ D ƒ}| t|d	d
�¡ | j| ||  ¡ |||d�g}|D ]}| |¡}qÖg }|j}| j}| j}|D ]}||||ƒƒ �q | jj}tj|| jdd�D ]}||ƒ �q0W d  ƒ n1 �sV0    Y  dS )aÀ  Log rich content to the terminal.

        Args:
            objects (positional args): Objects to log to the terminal.
            sep (str, optional): String to write between print data. Defaults to " ".
            end (str, optional): String to write at end of print data. Defaults to "\\n".
            style (Union[str, Style], optional): A style to apply to output. Defaults to None.
            justify (str, optional): One of "left", "right", "center", or "full". Defaults to ``None``.
            overflow (str, optional): Overflow method: "crop", "fold", or "ellipsis". Defaults to None.
            emoji (Optional[bool], optional): Enable emoji code, or ``None`` to use console default. Defaults to None.
            markup (Optional[bool], optional): Enable markup, or ``None`` to use console default. Defaults to None.
            highlight (Optional[bool], optional): Enable automatic highlighting, or ``None`` to use console default. Defaults to None.
            log_locals (bool, optional): Boolean to enable logging of locals where ``log()``
                was called. Defaults to False.
            _stack_offset (int, optional): Offset of caller from end of call stack. Defaults to 1.
        Nr†  c                    s   g | ]}t |ˆ ƒ‘qS rZ   rA   r�  rÇ   rZ   r[   rŽ  M  rë   zConsole.log.<locals>.<listcomp>ú<éÿÿÿÿc                 S   s    i | ]\}}|  d ¡s||“qS )Ú__)rr   )rç   Úkeyr:  rZ   rZ   r[   rê   S  s   
þzConsole.log.<locals>.<dictcomp>z	[i]locals)r’  )r	  ÚpathÚline_noÚ	link_pathFrš  )r“   r,  r�  rÃ  rr   rZ  rÊ  ÚabspathrA  rˆ  ÚitemsrI  r<   r$  r  rñ   r{  r3   ry   r¼   r>   rz  r]   )rt   rˆ  rË   rÆ   rj   r  rn   rm   rÄ  rÅ  r‡  rž  rÊ   rÀ  rË  ÚlocalsrÌ  rÊ  Z
locals_maprH  rŸ  r{  r3   r|  rÎ   r   r¢   rZ   rÇ   r[   Úlog   sZ    ù	þúÿ
ÿ
zConsole.logc                 C   s"  | j r| jdd…= dS | j�ð | jdkrþ| jrdddlm} || j|  | jdd… ¡ƒ | jdd…= nš|  | jdd… ¡}| jdd…= |rþz@tr°| j	j
}| d¡D ]}||ƒ q n| j	 
|¡ | j	 ¡  W n4 tyü } z|j› d�|_‚ W Y d}~n
d}~0 0 W d  ƒ n1 �s0    Y  dS )z$Check if the buffer may be rendered.Nr   r%   )ÚdisplayTzG
*** You may need to add PYTHONIOENCODING=utf-8 to your environment ***)r  r¼   r»   r9  r  ZjupyterrÑ  r½   rö   r  Úwriterœ  ÚflushÚUnicodeEncodeErrorÚreason)rt   rÑ  r  rÒ  r¢   r…  rZ   rZ   r[   rD  r  s,    
zConsole._check_buffer)rÀ   rp   c                 C   s²   g }|j }| j}| j}| jrN| j� | j |¡ W d  ƒ n1 sD0    Y  | j }| jrj|rjt	 
|¡}|D ]4\}}}	|r’||j|||d�ƒ qn|rš|	sn||ƒ qnd |¡}
|
S )z)Render buffered output, and clear buffer.N)rü   rd   rÄ   )rI  r   rd   r  r(  r+  r{  rg   r  r>   Zremove_colorr3   r‹  )rt   rÀ   ÚoutputrI  rü   rd   Znot_terminalr  rÆ   rb  ZrenderedrZ   rZ   r[   r½   �  s.    *

ýÿ

zConsole._render_buffer)rn   r  ÚpasswordÚstream)Úpromptrn   r  r×  rØ  rp   c          	      C   s˜   d}|rJ|   ¡ �"}| j|||dd� W d  ƒ n1 s80    Y  | ¡ }| jr`| j |¡ d}|rrt||d�}n"|rŒ| j |¡ | ¡ }nt|ƒ}|S )a5  Displays a prompt and waits for input from the user. The prompt may contain color / style.

        It works in the same way as Python's builtin :func:`input` function and provides elaborate line editing and history features if Python's builtin :mod:`readline` module is previously loaded.

        Args:
            prompt (Union[str, Text]): Text to render in the prompt.
            markup (bool, optional): Enable console markup (requires a str prompt). Defaults to True.
            emoji (bool, optional): Enable emoji (requires a str prompt). Defaults to True.
            password: (bool, optional): Hide typed text. Defaults to False.
            stream: (TextIO, optional): Optional file to read input from (rather than stdin). Defaults to None.

        Returns:
            str: Text read from stdin.
        rÄ   )rn   r  rË   N)rØ  )	rd  rÏ   r¯   rd   r  rÒ  r   ÚreadlineÚinput)	rt   rÙ  rn   r  r×  rØ  Z
prompt_strrd  ÚresultrZ   rZ   r[   rÛ  ª  s    
0
zConsole.input©rf  r¸   )rf  r¸   rp   c                C   sz   | j sJ dƒ‚| j�R |r2d dd„ | jD ƒ¡}nd dd„ | jD ƒ¡}|rX| jdd…= W d  ƒ n1 sl0    Y  |S )a©  Generate text from console contents (requires record=True argument in constructor).

        Args:
            clear (bool, optional): Clear record buffer after exporting. Defaults to ``True``.
            styles (bool, optional): If ``True``, ansi escape codes will be included. ``False`` for plain text.
                Defaults to ``False``.

        Returns:
            str: String containing console contents.

        úITo export console contents set record=True in the constructor or instancerÄ   c                 s   s&   | ]\}}}|r|  |¡n|V  qd S rŠ   r2   )rç   r  rÆ   Ú_rZ   rZ   r[   r–  æ  s   ÿz&Console.export_text.<locals>.<genexpr>c                 s   s   | ]}|j s|jV  qd S rŠ   )rb  r  r™  rZ   rZ   r[   r–  ë  s   þN)r  r(  r‹  r+  )rt   rf  r¸   r  rZ   rZ   r[   Úexport_textÔ  s    ÿþ
þ

þ*zConsole.export_text)rÊ  rf  r¸   rp   c                C   sJ   | j ||d�}t|ddd��}| |¡ W d  ƒ n1 s<0    Y  dS )a§  Generate text from console and save to a given location (requires record=True argument in constructor).

        Args:
            path (str): Path to write text files.
            clear (bool, optional): Clear record buffer after exporting. Defaults to ``True``.
            styles (bool, optional): If ``True``, ansi style codes will be included. ``False`` for plain text.
                Defaults to ``False``.

        rÝ  ÚwtrT  ©rh   N)rà  ÚopenrÒ  )rt   rÊ  rf  r¸   r  Ú
write_filerZ   rZ   r[   Ú	save_textô  s    
zConsole.save_text©r²   rf  Úcode_formatÚinline_styles)r²   rf  rç  rè  rp   c             	   C   sÚ  | j sJ dƒ‚g }|j}|pt}d}|du r0tn|}	| j��ˆ |r´t t | j¡¡D ]\\}
}}t	|
ƒ}
|r¨| 
|¡}|jrŽd|j› d|
› d�}
|r¤d|› d|
› d�n|
}
||
ƒ qTnÐi }t t | j¡¡D ]t\}
}}t	|
ƒ}
|�r6| 
|¡}| |t|ƒd	 ¡}|j�r$d
|› d|j› d|
› d�}
nd|› d|
› d�}
||
ƒ qÊg }|j}| ¡ D ]&\}}|�rR|d|› d|› d�ƒ �qRd |¡}|	jd |¡||jj|jjd�}|�r¶| jdd…= W d  ƒ n1 �sÌ0    Y  |S )a  Generate HTML from console contents (requires record=True argument in constructor).

        Args:
            theme (TerminalTheme, optional): TerminalTheme object containing console colors.
            clear (bool, optional): Clear record buffer after exporting. Defaults to ``True``.
            code_format (str, optional): Format string to render HTML, should contain {foreground}
                {background} and {code}.
            inline_styles (bool, optional): If ``True`` styles will be inlined in to spans, which makes files
                larger but easier to cut and paste markup. If ``False``, styles will be embedded in a style tag.
                Defaults to False.

        Returns:
            str: String containing console contents as HTML.
        rÞ  rÄ   Nz	<a href="z">z</a>z<span style="z</span>r%   z<a class="rz" href="z<span class="rz.rz {ú}r˜   )ÚcodeÚ
stylesheetZ
foregroundZ
background)r  rI  rC   ÚCONSOLE_HTML_FORMATr(  r>   Zfilter_controlZsimplifyr+  r	   Zget_html_stylerƒ  Ú
setdefaultrÌ   rÎ  r‹  ÚformatZforeground_colorÚhexZbackground_color)rt   r²   rf  rç  rè  Z	fragmentsrI  Z_themerë  Zrender_code_formatr  rÆ   rß  r”  r¸   Zstyle_numberZstylesheet_rulesZstylesheet_appendZ
style_ruleZrendered_coderZ   rZ   r[   Úexport_html  s`    ÿþ

ÿ

ÿ


ü,zConsole.export_html)rÊ  r²   rf  rç  rè  rp   c                C   sN   | j ||||d�}t|ddd��}| |¡ W d  ƒ n1 s@0    Y  dS )aû  Generate HTML from console contents and write to a file (requires record=True argument in constructor).

        Args:
            path (str): Path to write html file.
            theme (TerminalTheme, optional): TerminalTheme object containing console colors.
            clear (bool, optional): Clear record buffer after exporting. Defaults to ``True``.
            code_format (str, optional): Format string to render HTML, should contain {foreground}
                {background} and {code}.
            inline_styles (bool, optional): If ``True`` styles will be inlined in to spans, which makes files
                larger but easier to cut and paste markup. If ``False``, styles will be embedded in a style tag.
                Defaults to False.

        ræ  rá  rT  râ  N)rð  rã  rÒ  )rt   rÊ  r²   rf  rç  rè  Úhtmlrä  rZ   rZ   r[   Ú	save_htmlM  s    üzConsole.save_html)NFF)r%   )T)T)T)TN)N)N)rÄ   )N)r   r   )rÄ   )yrW   rX   rY   r_   rZ  Úenvironrú   r   rƒ   ra   r1   r   r"   r‚   rG   r   r`   r@   r/   r   r)   r   r   Úfloatr—   r2  r†   r  Úsetterr   r>   r¼   r9  rH   r;  r-   r!  rº   r¿   rF  rG  rð   rJ  rL  r§   r   r®   r¦   r¬   r´   rµ   r±   rR  rü   rh   rg   r'  rb   ry   r\   rc   r   r]   r^   rc  r£   rd  r6   r¶   r·   r¢   rf  rÒ   rl  rÑ   rÐ   ro  rÈ   r4   rq  r   r3   r?   r~  r„   r…   r  rs  r„  r‰   r�  rF   r,   r”  r.   rb  r—  rÏ   r«  r;   r°  r¯  r   r·  Ústaticmethodr¾  r¸  r   r   rÃ  rÐ  rD  r½   r   rÛ  rà  rå  rD   rð  rì  rò  rZ   rZ   rZ   r[   rŒ   D  sü  
#àÿ

àp	-
 ÿ
þ
ùø!	 ÿþÿþ ÿþ5 ýù
ø9ö
õ<ÿþ$÷öM þú
ùúù#ðïe þôóAûú# ÿþ÷ö#þý%õôR þùø* úùOùørŒ   Ú__main__zJSONRPC [i]request[/i]é   gÍÌÌÌÌÌô?z2.0Úsubtracté*   é   )ÚminuendÚ
subtrahendr    )ZjsonrpcrÙ   ÚparamsÚidzHello, World!z{'a': 1}z&Which one is correct team name in NBA?)zNew York BullszLos Angeles KingszGolden State WarriorsúHuston Rocketr   )Zquestionry   Zanswer)ÚansweredÚq1z	5 + 7 = ?)é
   é   é   é   r  z
12 - 8 = ?)r%   r¡  r    é   r  )r  r  Zq2)ZsportZmaths)rè   ÚemptyZquizZfoo)T)Ÿr¾  rZ  Úplatformr3  r#  Úabcr   r   Zdataclassesr   r   r   Ú	functoolsr   r   rñ  r	   r
   Ú	itertoolsr   r   Útimer   Útypesr   r   r   Útypingr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   Úversion_infor"   r#   r$   Zpip._vendor.typing_extensionsrÄ   r&   r'   r(   r$  r)   r*   r‘  r+   r,   Zcolorr-   rb  r.   r  r/   r  r0   r1   rn   r3   r€  rq  r4   r5   r·   r6   r7   Zprettyr8   r9   Úprotocolr:   r¬  r;   Zscoper<   rÈ   r=   r•  r>   rÆ   r?   r@   ZstyledrB   Zterminal_themerC   rD   r  rE   rF   r²   rG   rH   rõ   rI   rE  rJ   rl  rL   ré   rö   rƒ   r  r„   r…   rV   r‡   rì  r?  rC  rB  r\   rb   rˆ   r‰   rÒ   r�   r%  Ú	Exceptionr’   r“   r™   r£   r±   r¶   rÃ   rÍ   r‚   rÞ   râ   r>  r"  rÎ  rS  Úlocalrì   rð   rò   ra   rô   r÷   Zpip._vendor.coloramarø   rŒ   rW   r�   rÐ  ÚreprrÏ   rZ   rZ   rZ   r[   Ú<module>   s  
D	{
!'/!"ü

            5
üùøþýýùòýÿ"