HEX
Server: LiteSpeed
System: Linux php-prod-1.spaceapp.ru 5.15.0-157-generic #167-Ubuntu SMP Wed Sep 17 21:35:53 UTC 2025 x86_64
User: sport3497 (1034)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: //usr/local/lib/python3.10/dist-packages/pip/_vendor/rich/__pycache__/padding.cpython-310.pyc
o

��h,�	@s�ddlmZmZmZmZmZerddlmZmZm	Z	m
Z
ddlmZddl
mZddlmZddlmZeeeeeeefeeeeeffZGdd	�d	e�Zed
kreddlmZeedd
dd��dSdS)�)�
TYPE_CHECKING�List�Optional�Tuple�Union�)�Console�ConsoleOptions�RenderableType�RenderResult)�JupyterMixin)�Measurement)�Segment)�Stylec
@s�eZdZdZ	d!ddd�dddd	d
eeefdefdd
�Ze	ddde
ddfdd��Zedd	de
e
e
e
e
ffdd��Zdefdd�Z						d"dd�Z						d#dd�Zd S)$�Paddinga
Draw space around content.

    Example:
        >>> print(Padding("Hello", (2, 4), style="on blue"))

    Args:
        renderable (RenderableType): String or other renderable.
        pad (Union[int, Tuple[int]]): Padding for top, right, bottom, and left borders.
            May be specified with 1, 2, or 4 integers (CSS style).
        style (Union[str, Style], optional): Style for padding characters. Defaults to "none".
        expand (bool, optional): Expand padding to fit available width. Defaults to True.
    �rrrr�noneT)�style�expand�
renderabler
�pad�PaddingDimensionsrrcCs0||_|�|�\|_|_|_|_||_||_dS)N)r�unpack�top�right�bottom�leftrr)�selfrrrr�r�C/usr/local/lib/python3.10/dist-packages/pip/_vendor/rich/padding.py�__init__!s
zPadding.__init__�level�returncCst|ddd|fdd�S)z�Make padding instance to render an indent.

        Args:
            renderable (RenderableType): String or other renderable.
            level (int): Number of characters to indent.

        Returns:
            Padding: A Padding instance.
        rF)rr)r)�clsrr!rrr�indent.szPadding.indentcCs�t|t�r||||fSt|�dkr|d}||||fSt|�dkr+|\}}||||fSt|�dkr=|\}}}}||||fStdt|��d���)z&Unpack padding specified in CSS style.rr��z)1, 2 or 4 integers required for padding; z given)�
isinstance�int�len�
ValueError)r�_pad�pad_top�	pad_rightrrrrrrrr<s
zPadding.unpackcCs.d|j�d|j�d|j�d|j�d|j�d�S)NzPadding(z, (�,z)))rrrrr)rrrr�__repr__Ls.zPadding.__repr__�consoler�optionsr	rccs��|�|j�}|jr|j}ntt�|||j�j|j	|j
|j�}|�||j	|j
�}|jdur>|j
|j|j|jd�}|j|j||dd�}t}|j	rU|d|j	|�nd}|j
rg|d|j
�|�|��gn|��g}	d}
|jr�|d|�d�|�g}
|
|jEdH|r�|D]}|V|EdH|	EdHq�n|D]}|EdH|	EdHq�|jr�|
p�|d|�d�|�g}
|
|jEdHdSdS)N)�heightT)rr� �
)�	get_stylerr�	max_width�minr
�getr�maximumrr�update_widthr2�
update_heightrr�render_linesr�line)rr0r1r�width�render_options�lines�_Segmentrr�
blank_liner=rrr�__rich_console__OsV����
�
���
�
�zPadding.__rich_console__r
cCs\|j}|j|j}||dkrt||�St�|||j�\}}t||||�}|�|�}|S)Nr)r6rrr
r8r�with_maximum)rr0r1r6�extra_width�measure_min�measure_max�measurementrrr�__rich_measure__}s

zPadding.__rich_measure__N)r)r0rr1r	r"r)r0rr1r	r"r
)�__name__�
__module__�__qualname__�__doc__r�strr�boolr �classmethodr(r$�staticmethodrrr/rCrIrrrrrsD����
�
�

 ��
�.���r�__main__)�printzHello, World)r%r&zon blue)rN)�typingrrrrrr0rr	r
r�jupyterr�measurer
�segmentrrrr(rrrJ�pip._vendor.richrSrrrr�<module>s(w�