o
    Mf7                     @   sf   d dl mZmZ ddlmZ ddlmZ ddlmZ er*ddl	m
Z
mZmZmZmZ G dd dZd	S )
    )OptionalTYPE_CHECKING   )Segment)	StyleType)	loop_last)ConsoleConsoleOptionsRenderResultRenderableTypeGroupc                	   @   sV   e Zd ZU dZded< ddddddee d	ed
dfddZ					
	dddZ	dS )ScreenzA renderable that fills the terminal screen and crops excess.

    Args:
        renderable (RenderableType): Child renderable.
        style (StyleType, optional): Optional background style. Defaults to None.
    r   
renderableNF)styleapplication_moderenderablesr   r   returnc                G   s&   ddl m} || | _|| _|| _d S )Nr   )r   )pip._vendor.rich.consoler   r   r   r   )selfr   r   r   r    r   Y/var/www/html/analyze/labelStudio/lib/python3.10/site-packages/pip/_vendor/rich/screen.py__init__   s   

zScreen.__init__consoler   optionsr	   r
   c                 c   s    |j \}}| jr|| jnd }|j||d}|j| jpd||dd}tj||||d}| jr4tdnt	 }t
|D ]\}	}
|
E d H  |	sJ|V  q<d S )N)widthheight T)r   pad)r   z
)sizer   	get_styleupdaterender_linesr   r   	set_shaper   liner   )r   r   r   r   r   r   render_optionslinesnew_linelastr#   r   r   r   __rich_console__(   s   

zScreen.__rich_console__)r   r   r   r	   r   r
   )
__name__
__module____qualname____doc____annotations__r   r   boolr   r(   r   r   r   r   r      s*   
 
r   N)typingr   r   segmentr   r   r   _loopr   r   r   r	   r
   r   r   r   r   r   r   r   <module>   s    	