OwlCyberSecurity - MANAGER
Edit File: segment.cpython-311.pyc
� �������h�`�����������������������D����d�dl�mZ�d�dlmZ�d�dlmZ�d�dlmZ�d�dlm Z �d�dl mZmZm Z mZmZmZmZmZmZmZ�ddlmZmZmZmZmZ�dd lmZmZ�dd lmZ�er ddl m!Z!m"Z"m#Z#��ed������������Z$�G�d ��de������������Z%eee%���������ee%ee&e'f���������f���������ee%e&e&f���������f���������Z(�e���������������G�d��de��������������������������Z)�G�d��d������������Z*�G�d��d������������Z+e,dk�����r?d�dl-m!Z!�d�dl.m/Z/�d�dl0m1Z1�dZ2�e1j3��������d������������Z4�e!��������������Z e �5��������������������d�������������e �6��������������������d�������������e �6��������������������d�������������e �6���������������������e/e2dd� �������������������������e �6�����������������������������������e �6��������������������d!��������������e7e �8��������������������e4������������������������Z9e �6��������������������e9�������������e �6�����������������������������������e �6��������������������d"�������������e �6��������������������e4�������������e �6��������������������d#�������������d$S�d$S�)%�����)�IntEnum)� lru_cache)�filterfalse)� getLogger)� attrgetter) � TYPE_CHECKING�Dict�Iterable�List� NamedTuple�Optional�Sequence�Tuple�Type�Union����)�_is_single_cell_widths�cached_cell_len�cell_len�get_character_cell_size� set_cell_size)�Result� rich_repr)�Style)�Console�ConsoleOptions�RenderResult�richc��������������������R�����e�Zd�ZdZdZdZdZdZdZdZ dZ d Zd ZdZ dZd ZdZdZdZdZdS�)�ControlTypezDNon-printable control codes which typically translate to ANSI codes.r�������������������������������� ���� ������������ ���������������N)�__name__� __module__�__qualname__�__doc__�BELL�CARRIAGE_RETURN�HOME�CLEAR�SHOW_CURSOR�HIDE_CURSOR�ENABLE_ALT_SCREEN�DISABLE_ALT_SCREEN� CURSOR_UP�CURSOR_DOWN�CURSOR_FORWARD�CURSOR_BACKWARD�CURSOR_MOVE_TO_COLUMN�CURSOR_MOVE_TO� ERASE_IN_LINE�SET_WINDOW_TITLE��������x/builddir/build/BUILD/imunify360-venv-2.5.2/opt/imunify360/venv/lib/python3.11/site-packages/pip/_vendor/rich/segment.pyr ���r ���#���sj��������������N�N��D��O��D� �E��K��K������I��K��N��O����N��M����rE���r ���c��������������������X����e�Zd�ZU�dZeed<���dZee���������ed<���dZ ee e������������������ed<���ede fd���������������Zdefd�Zdefd �Zedefd ���������������Ze�ed������������dd�d e ded���������fd�����������������������������Zd e ded���������fd�Zed1d���������������Ze � �d2ded����������dee���������dee���������ded����������fd���������������Ze �d3ded����������deded����������fd���������������Zeded����������deed�������������������fd���������������Ze � � �d4ded����������de dee���������dededeed�������������������fd���������������Ze � �d5ded����������de dee���������deded����������f d���������������Z eded����������de fd ���������������Z!ed!eed�������������������dee e f���������fd"���������������Z"e � � �d6d!eed�������������������d#e d$ee ���������dee���������d%edeed�������������������fd&���������������Z#e �d3d'e$d����������d!eed�������������������d#e d$e ded%edeed�������������������fd(���������������Z%e �d3d'e$d����������d!eed�������������������d#e d$e ded%edeed�������������������fd)���������������Z&e �d3d'e$d����������d!eed�������������������d#e d$e ded%edeed�������������������fd*���������������Z'eded����������ded����������fd+���������������Z(eded����������ded����������fd,���������������Z)eded����������ded����������fd-���������������Z*eded����������ded����������fd.���������������Z+eded����������d/ee ���������deed�������������������fd0���������������Z,dS�)7�Segmenta���A piece of text with associated style. Segments are produced by the Console render process and are ultimately converted in to strings to be written to the terminal. Args: text (str): A piece of text. style (:class:`~rich.style.Style`, optional): An optional style to apply to the text. control (Tuple[ControlCode], optional): Optional sequence of control codes. Attributes: cell_length (int): The cell length of this Segment. �textN�style�control�returnc������������������4�����|�\��}}}|rdnt����������|������������S�)zzThe number of terminal cells required to display self.text. Returns: int: A number of cells. r���)r���)�selfrI����_stylerK���s��� rF����cell_lengthzSegment.cell_lengthQ���s%�������!%���f�g��/�q�q��$���/rE���c��������������#����v���K����|�j���������V���|�j���������|�j���������|�j��������V���d�S�d�S�|�j��������V���|�j��������V���d�S��N)rI���rK���rJ����rN���s��� rF���� __rich_repr__zSegment.__rich_repr__[���sa�����������i�����<���z�%��j� � � � � ��&�%���*�����,�����rE���c������������������*�����t����������|�j��������������������S�)z#Check if the segment contains text.)�boolrI���rS���s��� rF����__bool__zSegment.__bool__d���s�������D�I���rE���c�����������������������|�j���������duS�)z,Check if the segment contains control codes.N)rK���rS���s��� rF���� is_controlzSegment.is_controlh���s��������|�4�'�'rE���i�@���segment�cut)rH���rH���c����������������������|\��}}}t�����������}|j��������}||k����r|�|d||������������fS�t����������}t����������||z��t ����������|������������z��������������} �|d| ����������} t����������| ������������}||z ��}|s"�|| ||�������������||| d����������||������������fS�|dk����rH�||| ���������������������dk����r3�||d| ����������dz���||�������������|d|| dz���d����������z���||������������fS�|dk����rK�||| dz �����������������������dk����r3�||d| dz ������������dz���||�������������|d|| d����������z���||������������fS�||k�����r| dz ��} n| dz��} ��)a\��Split a segment in to two at a given cell position. Note that splitting a double-width character, may result in that character turning into two spaces. Args: segment (Segment): A segment to split. cut (int): A cell position to cut on. Returns: A tuple of two segments. ��TN���r!���� r���)rH���rP���r����int�lenr���) �clsrZ���r[���rI���rJ���rK����_SegmentrP���� cell_size�pos�before�cell_pos�out_bys ��� rF����_split_cellszSegment._split_cellsm���s������� '���e�W����)���+����H�H�R���8�8�8�8�+� ��3��$��D� � �1�2�2�� ��$�3�$�Z�F���'�'�H���^�F��� ��H�V�U�G�4�4��H�T�#�$�$�Z���8�8�������|�|� � �$�s�)� 4� 4�� 9� 9��H�T�$�3�$�Z�#�-�u�g�>�>��H�S�4��a�� � �?�2�E�7�C�C�������|�|� � �$�s�Q�w�-� 8� 8�A� =� =��H�T�)�C�!�G�)�_�s�2�E�7�C�C��H�S�4����:�-�u�g�>�>������#�~�~��q�����q���- rE���c����������������������|�\��}}}|dk����sJ��t����������|������������rX|t����������|������������k����r|�t����������d||������������fS�t����������|d|����������||������������t����������||d����������||������������fS�|����������������������|�|������������S�)ax��Split segment in to two segments at the specified column. If the cut point falls in the middle of a 2-cell wide character then it is replaced by two spaces, to preserve the display width of the parent segment. Args: cut (int): Offset within the segment to cut. Returns: Tuple[Segment, Segment]: Two segments. r���r]���N)r���ra���rH���ri���)rN���r[���rI���rJ���rK���s��� rF����split_cellszSegment.split_cells����s�������� $���e�W��a�x�x�x�x�!�$�'�'�� ��c�$�i�i����W�R���8�8�8�8���T�c�T� �E�7�3�3���S�T�T� �E�7�3�3��� � �� � ��s�+�+�+rE���c������������������������|�d������������S�)zMake a new line segment.� rD���)rb���s��� rF����linezSegment.line����s��������s�4�y�y�rE����segments� post_stylec������������������b���������|}|r|j�������������fd�|D���������������}�r���fd�|D���������������}|S�)a��Apply style(s) to an iterable of segments. Returns an iterable of segments where the style is replaced by ``style + segment.style + post_style``. Args: segments (Iterable[Segment]): Segments to process. style (Style, optional): Base style. Defaults to None. post_style (Style, optional): Style to apply on top of segment style. Defaults to None. Returns: Iterable[Segments]: A new iterable of segments (possibly the same iterable). c��������������3����T����K����|�]"\��}}}��||rd�n ��|������������|������������V����#d�S�rR���rD���)�.0rI���rO���rK����applyrb���s��� ��rF���� <genexpr>z&Segment.apply_style.<locals>.<genexpr>����s\���������������)�D�&�'����D�'�<�$�$�u�u�V�}�}�g�F�F�����������rE���c��������������3����P����K����|�] \��}}}��||rd�n|r|�z���n�|������������V����!d�S�rR���rD���)rs���rI���rO���rK���rb���rp���s��� ��rF���ru���z&Segment.apply_style.<locals>.<genexpr>����sr����������������*�D�&�'������#�M���5;�K�f�z�1�1����������������rE���)�__add__)rb���ro���rJ���rp����result_segmentsrt���s���` ` @rF����apply_stylezSegment.apply_style����s����������&�#���� ��M�E����������-<������O���� �����������.=������O���rE���FrY���c������������������z�����|rt����������t����������d������������|������������S�t����������t����������d������������|������������S�)a2��Filter segments by ``is_control`` attribute. Args: segments (Iterable[Segment]): An iterable of Segment instances. is_control (bool, optional): is_control flag to match in search. Returns: Iterable[Segment]: And iterable of Segment instances. rK���)�filterr���r���)rb���ro���rY���s��� rF����filter_controlzSegment.filter_control����s=��������� @��*�Y�/�/��:�:�:��z�)�4�4�h�?�?�?rE���c��������������#�������K����g�}|j���������}|D�]g}d|j��������v�rQ|j��������sJ|\��}}}|rA|���������������������d������������\��}} }|r�|�|�||�������������������������| r |V���g�}|j���������}|�A�\�||��������������h|r|V���dS�dS�)a���Split a sequence of segments in to a list of lines. Args: segments (Iterable[Segment]): Segments potentially containing line feeds. Yields: Iterable[List[Segment]]: Iterable of segment lists, one per line. rm���N)�appendrI���rK���� partition) rb���ro���rn���r~���rZ���rI���rJ����_�_text�new_lines ��� rF����split_lineszSegment.split_lines����s������������!������� �� �G��w�|�#�#�G�O�#�!(���e�Q���-�,0�N�N�4�,@�,@�)�E�8�T���2���s�s�5�%�0�0�1�1�1���-�"� � � �!��!%������-�����w������� ��J�J�J�J�J� �� rE���T�length�pad�include_new_linesc��������������#������K����g�}|j���������}|�j��������}�|�d������������} |D�]�} d| j��������v�r�| j��������s{| \��}}} |rr|���������������������d������������\��}}}|r�|�|�||�������������������������|r>�|||||�������������}|r|����������������������| �������������|V���|������������������������������������|�r���|| ���������������|r�|||||�������������V���dS�dS�)a���Split segments in to lines, and crop lines greater than a given length. Args: segments (Iterable[Segment]): An iterable of segments, probably generated from console.render. length (int): Desired line length. style (Style, optional): Style to use for any padding. pad (bool): Enable padding of lines that are less than `length`. Returns: Iterable[List[Segment]]: An iterable of lines of segments. rm���)rJ���r����N)r~����adjust_line_lengthrI���rK���r����clear)rb���ro���r����rJ���r����r����rn���r~���r�����new_line_segmentrZ���rI���� segment_styler����r����r�����cropped_lines��� rF����split_and_crop_lineszSegment.split_and_crop_lines��sV���������*�!����� �3���3�t�9�9���� �� �G��w�|�#�#�G�O�#�)0�&��m�Q���%�,0�N�N�4�,@�,@�)�E�8�T���:���s�s�5�-�8�8�9�9�9���%�'9�'9� �&��3�(��(��(���-��B�(�/�/�0@�A�A�A�*�*�*�*�� � �������%�����w������� I�$�$�T�6��C�H�H�H�H�H�H�H�H� I�� IrE���rn���c������������������z����t����������d��|D���������������������������}||k�����r$|r|�|�d||z ��z��|������������gz���}n�|dd����������}nw||k����rgg�}|j��������}d}|D�]X}|j��������} || z���|k�����s|j��������r�||�������������|| z ��}�*|\��} }}t ����������| ||z ��������������} �|�|�| |��������������������������n |dd����������}|S�)a��Adjust a line to a given width (cropping or padding as required). Args: segments (Iterable[Segment]): A list of segments in a single line. length (int): The desired width of the line. style (Style, optional): The style of padding if used (space on the end). Defaults to None. pad (bool, optional): Pad lines with spaces if they are shorter than `length`. Defaults to True. Returns: List[Segment]: A line of segments with the desired length. c��������������3����$���K����|�]}|j���������V����d�S�rR���)rP���)rs���rZ���s��� rF���ru���z-Segment.adjust_line_length.<locals>.<genexpr>X��s%����������B�B�'�'�-�B�B�B�B�B�BrE���r_���Nr���)�sumr~���rP���rK���r���) rb���rn���r����rJ���r�����line_lengthr����r~���rZ����segment_lengthrI���r����r����s ��� rF���r����zSegment.adjust_line_lengthE��s�����&��B�B�T�B�B�B�B�B��������� #��3�3�s�f�{�.B�'C�U�#K�#K�"L�L�������7��� �6� !� !��H��_�F��K��� �� ��!(�!4����/�&�8�8�G�O�8��F�7�O�O�O��>�1�K�K�-4�*�D�-��(��v��/C�D�D�D��F�3�3�t�]�3�3�4�4�4����A�A�A�w�H��rE���c������������������H������t������������t�����������fd�|D���������������������������S�)z�Get the length of list of segments. Args: line (List[Segment]): A line encoded as a list of Segments (assumes no '\\n' characters), Returns: int: The length of the line. c��������������3����:����K����|�]\��}}}|���|������������V����d�S�rR���rD���)rs���rI���rJ���rK���� _cell_lens��� �rF���ru���z*Segment.get_line_length.<locals>.<genexpr>}��s7�����������S�S�';�t�U�G�7�S�9�9�T�?�?�S�S�S�S�S�SrE���)r���r����)rb���rn���r����s��� @rF����get_line_lengthzSegment.get_line_lengthr��s-��������� ��S�S�S�S�t�S�S�S�S�S�SrE����linesc������������������r������|�j����������|rt�����������fd�|D���������������������������nd}|t����������|������������fS�)z�Get the shape (enclosing rectangle) of a list of lines. Args: lines (List[List[Segment]]): A list of lines (no '\\n' characters). Returns: Tuple[int, int]: Width and height in characters. c��������������3����.����K����|�]}��|������������V����d�S�rR���rD���)rs���rn���r����s��� �rF���ru���z$Segment.get_shape.<locals>.<genexpr>���s-�����������@�@�$����-�-�@�@�@�@�@�@rE���r���)r�����maxra���)rb���r����� max_widthr����s��� @rF���� get_shapezSegment.get_shape��sJ���������-��DI�P�C�@�@�@�@�%�@�@�@�@�@�@�q� ��3�u�:�:�&�&rE����width�height� new_linesc������������������<����� ��|pt����������|������������}|r�|�d�z��dz����������������gn�|�d�z���������������g}|�j��������� |d|����������}� ��fd�|D���������������|dd�<���t����������|������������|k�����r)|���������������������|g|t����������|������������z ��z���������������|S�)a���Set the shape of a list of lines (enclosing rectangle). Args: lines (List[List[Segment]]): A list of lines. width (int): Desired width. height (int, optional): Desired height or None for no change. style (Style, optional): Style of any padding added. new_lines (bool, optional): Padded lines should include " ". Defaults to False. Returns: List[List[Segment]]: New list of lines. r_���rm���Nc������������������,������g�|�]}��|������������������S�))rJ���rD���)rs���rn���r����rJ���r����s��� ���rF���� <listcomp>z%Segment.set_shape.<locals>.<listcomp>���s9�������� �� �� �=A���t�U�%�8�8�8� �� �� rE���)ra���r�����extend) rb���r����r����r����rJ���r�����_height�blank�shaped_linesr����s ��� ` ` @rF���� set_shapezSegment.set_shape���s����������*��&�C��J�J���1:�X�S�S��u��t�#�U� +� +�,�,���C�%�K�QV�@W�@W�?X�� ��!�3���X�g�X��� �� �� �� �� �� �EJ� �� �� ��Q�Q�Q����|���w�&�&������7�S��5F�5F�+F� G�H�H�H��rE���rb���c�����������������������|t����������|������������z ��}|s |dd����������S�|d|����������}|r�|�d|z��dz���|������������n�|�d|z��|������������}||gg|z��z���}|S�)a���Aligns lines to top (adds extra lines to bottom as required). Args: lines (List[List[Segment]]): A list of lines. width (int): Desired width. height (int, optional): Desired height or None for no change. style (Style): Style of any padding added. new_lines (bool, optional): Padded lines should include " ". Defaults to False. Returns: List[List[Segment]]: New list of lines. Nr_���rm����ra����rb���r����r����r����rJ���r�����extra_linesr����s��� rF���� align_topzSegment.align_top���s�������*��s�5�z�z�)���� �����8�O��g�v�g���2;�X���C�%�K�$�&��.�.�.���S�5�[�RW�AX�AX���%�� �K�/�/���rE���c�����������������������|t����������|������������z ��}|s |dd����������S�|d|����������}|r�|�d|z��dz���|������������n�|�d|z��|������������}|gg|z��|z���}|S�)a���Aligns render to bottom (adds extra lines above as required). Args: lines (List[List[Segment]]): A list of lines. width (int): Desired width. height (int, optional): Desired height or None for no change. style (Style): Style of any padding added. Defaults to None. new_lines (bool, optional): Padded lines should include " ". Defaults to False. Returns: List[List[Segment]]: New list of lines. Nr_���rm���r����r����s��� rF����align_bottomzSegment.align_bottom���s�������*��s�5�z�z�)���� �����8�O��g�v�g���2;�X���C�%�K�$�&��.�.�.���S�5�[�RW�AX�AX���� �K�'�%�/���rE���c������������������������|t����������|������������z ��}|s |dd����������S�|d|����������}|r�|�d|z��dz���|������������n�|�d|z��|������������}|dz��}||z ��} |gg|z��|z���|gg| z��z���}|S�)a���Aligns lines to middle (adds extra lines to above and below as required). Args: lines (List[List[Segment]]): A list of lines. width (int): Desired width. height (int, optional): Desired height or None for no change. style (Style): Style of any padding added. new_lines (bool, optional): Padded lines should include " ". Defaults to False. Returns: List[List[Segment]]: New list of lines. Nr_���rm���r!���r����) rb���r����r����r����rJ���r����r����r����� top_lines�bottom_liness ��� rF����align_middlezSegment.align_middle���s�������*��s�5�z�z�)���� �����8�O��g�v�g���2;�X���C�%�K�$�&��.�.�.���S�5�[�RW�AX�AX���1�$� �"�Y�.���� �I�%��-�%�� �L�0H�H���rE���c��������������#������K����t����������|������������} �t����������|������������}n#�t����������$�r�Y�dS�w�xY�wt����������}|D�]>}|j��������|j��������k����r&|j��������s�||j��������|j��������z���|j��������������������}�8|V���|}�?|V���dS�)a)��Simplify an iterable of segments by combining contiguous segments with the same style. Args: segments (Iterable[Segment]): An iterable of segments. Returns: Iterable[Segment]: A possibly smaller iterable of segments that will render the same way. N)�iter�next� StopIterationrH���rJ���rK���rI���)rb���ro���� iter_segments�last_segmentrc���rZ���s��� rF����simplifyzSegment.simplify ��s�������������X��� � �� �.�.�L�L���� �� �� ��F�F� �������$�� '�� '�G��!�W�]�2�2�7�?�2�'�x� �%���4�l�6H� �� ����#�"�"�"�&��������s����#�� 1�1c��������������#�������K����|D�]@}|j���������s|j���������|V����|\��}}}�|�||r|���������������������d������������nd������������V����AdS�)z�Remove all links from an iterable of styles. Args: segments (Iterable[Segment]): An iterable segments. Yields: Segment: Segments with link removed. N)rK���rJ����update_link)rb���ro���rZ���rI���rJ����_controls��� rF����strip_linkszSegment.strip_links%��s������������ �� L�� L�G���� L�'�-�"7�� � � � �(/�%��e�X��c�$�5� J�� 1� 1�$� 7� 7� 7�d�K�K�K�K�K�K� L�� LrE���c��������������#����:���K����|D�]\��}}}�|�|d|������������V����dS�)z�Remove all styles from an iterable of segments. Args: segments (Iterable[Segment]): An iterable segments. Yields: Segment: Segments with styles replace with None NrD���)rb���ro���rI���rO���rK���s��� rF����strip_styleszSegment.strip_styles6��sE�����������&.�� +�� +�!�D�&�'��#�d�D�'�*�*�*�*�*�*� +�� +rE���c��������������#�������K����i�}|D�]J\��}}}|r3|����������������������|������������}|�|j��������}|||<����|�|||������������V����;�|�|d|������������V����KdS�)z�Remove all color from an iterable of segments. Args: segments (Iterable[Segment]): An iterable segments. Yields: Segment: Segments with colorless style. N)�get� without_color)rb���ro����cacherI���rJ���rK����colorless_styles��� rF����remove_colorzSegment.remove_colorC��s������������%'��$,�� /�� /� �D�%���� /�"'�)�)�E�"2�"2��"�*�&+�&9�O�#2�E�%�L��c�$���9�9�9�9�9�9��c�$��g�.�.�.�.�.�.� /�� /rE����cutsc��������������#������K����g�}|j���������}t����������|������������} �t����������|d������������}|dk����rdS�|dk����rng�V����$d}|j��������}|j��������} t ����������} |D�]�}|\��}} }|r�|r|n |�| |������������z���}||k�����r�||�������������|}n�||k����rK�||��������������| ��������������V����|���������������|}t����������|d������������}|dk����r|r�| ��������������V����dS�nm|���������������������||z ��������������\��}}|\��}} }�||��������������| ��������������V����|���������������|}t����������|d������������}|dk����r|r�| ��������������V����dS�|����| ��������������V���dS�)z�Divides an iterable of segments in to portions. Args: cuts (Iterable[int]): Cell positions where to divide. Yields: [Iterable[List[Segment]]]: An iterable of Segments in List. Tr^���Nr���)r~���r����r����r�����copyr���rk���)rb���ro���r�����split_segments�add_segment� iter_cutsr[���re����segments_clear� segments_copyr����rZ���rI���rO���rK����end_posrf���s��� rF����dividezSegment.divideY��s����������+-��$�+����J�J� � ��y�"�%�%�C��b�y�y����a�x�x���H�H�H� ����'�-��&�+� �#� ���# ��# �G�$+�!�D�&�'���! �!(�C�#�#�c�I�I�d�O�O�.C���S�=�=��K��(�(�(�!�C���c�>�>��K��(�(�(�'�-�/�/�)�)�)�"�N�$�$�$�!�C��y�"�-�-�C��b�y�y�)��2�"/�-�/�/�1�1�1������'.�&9�&9�#��)�&D�&D�O�F�G�,3�)�D�&�'��K��'�'�'�'�-�/�/�)�)�)�"�N�$�$�$��C��9�b�)�)���"�9�9�%��.�+�m�o�o�-�-�-��F�F�C���! ��F��m�o�o�����rE���)rL���rH���)NN�F)NTT)NT)NNF)-r0���r1���r2���r3����str�__annotations__rJ���r ���r���rK���r����ControlCode�propertyr`���rP���r���rT���rV���rW���rY����classmethodr���r���ri���rk���rn���r ���ry���r|���r���r����r����r����r����r����r����r���r����r����r����r����r����r����r����r����rD���rE���rF���rH���rH���?���s��������������� �� ���I�I�I�!�E�8�E�?�!�!�!�/3�G�X�h�{�+� ,�3�3�3� �0�S��0��0��0���X�0��v����������$�����������(�D��(��(��(���X�(����Y�y���-�9��-�3��-�5�AU�;V��-��-��-������[�-�^,�s��,�u�-A�'B��,��,��,��,�4���������[�����"&�&*� &��&��9�%�&�����&���U�O� &� � �)� �&��&��&���[�&�P��?D�@��@�� �*�@�8<�@� �)� �@��@��@���[�@�$���8�I�#6���8�D��O�;T���������[��8�� �"&��"&� ,I��,I��9�%�,I���,I����� ,I� ��,I�� � ,I�� �$�y�/� "�,I��,I��,I���[�,I�\�� �"&��*��*��9�o�*���*����� *� ��*�� �i�� *��*��*���[�*�X�� T�4� �?�� T�s�� T�� T�� T���[� T���'�d�4� �?�3��'��c�3�h���'��'��'���[�'��� �!%�!%�� !��!��D��O�$�!���!���� � !� ����!��� !�� �d�9�o� �!��!��!���[�!�F��� � ��� �)�_���D��O�$������� � ����� �� �d�9�o� ��������[��8��� � ��� �)�_���D��O�$������� � ����� �� �d�9�o� ��������[��8��� � ��� �)�_���D��O�$������� � ����� �� �d�9�o� ��������[��<����� 3�����8K���������[��4��L�8�I�#6��L�8�I�;N��L��L��L���[�L� �� +�H�Y�$7�� +�H�Y�<O�� +�� +�� +���[� +���/�H�Y�$7��/�H�Y�<O��/��/��/���[�/�*��B�� �*�B�2:�3�-�B� �$�y�/� "�B��B��B���[�B��B��BrE���rH���c��������������������H�����e�Zd�ZdZddee���������deddfd�Z � � � � � �dd �ZdS�)�Segmentsa=��A simple renderable to render an iterable of segments. This class may be useful if you want to print segments outside of a __rich_console__ method. Args: segments (Iterable[Segment]): An iterable of segments. new_lines (bool, optional): Add new lines between segments. Defaults to False. Fro���r����rL���Nc������������������<�����t����������|������������|�_��������||�_��������d�S�rR���)�listro���r����)rN���ro���r����s��� rF����__init__zSegments.__init__���s�������X���� �"����rE����consoler����optionsr���r���c��������������#�������K����|�j���������r-t���������������������������������������������}|�j��������D�] }|V���|V����d�S�|�j��������E�d�{V����d�S�rR���)r����rH���rn���ro���)rN���r����r����rn���rZ���s��� rF����__rich_console__zSegments.__rich_console__���sp������������>�� %��<�<�>�>�D��=�� �� ��� � � �� � � � � �� ���}�$�$�$�$�$�$�$�$�$rE���r�����r����r���r����r���rL���r���) r0���r1���r2���r3���r ���rH���rV���r����r����rD���rE���rF���r����r�������s~�����������������#��#��'�!2��#�t��#�PT��#��#��#��#� %� � %�+;� %� � %�� %�� %�� %�� %�� %rE���r����c��������������������P�����e�Zd�Zd deee������������������deddfd�Z � � � � � �dd�ZdS�)�SegmentLinesFr����r����rL���Nc������������������<�����t����������|������������|�_��������||�_��������dS�)a=��A simple renderable containing a number of lines of segments. May be used as an intermediate in rendering process. Args: lines (Iterable[List[Segment]]): Lists of segments forming lines. new_lines (bool, optional): Insert new lines after each line. Defaults to False. N)r����r����r����)rN���r����r����s��� rF���r����zSegmentLines.__init__���s��������%�[�[�� �"����rE���r����r���r����r���r���c��������������#�������K����|�j���������r1t���������������������������������������������}|�j��������D�]}|E�d�{V����|V����d�S�|�j��������D�] }|E�d�{V�����d�S�rR���)r����rH���rn���r����)rN���r����r����r����rn���s��� rF���r����zSegmentLines.__rich_console__���s�������������>�� ��|�|�~�~�H�� �� �� ��������������� �� ��� �� �� ����������� �� rE���r����r����) r0���r1���r2���r ���r���rH���rV���r����r����rD���rE���rF���r����r�������sx�������������� #�� #�h�t�G�}�5�� #�$�� #�SW�� #�� #�� #�� #� � � �+;� � � �� �� �� �� �� rE���r�����__main__)r���)�Syntax)�Textz�from rich.console import Console console = Console() text = Text.from_markup("Hello, [bold magenta]World[/]!") console.print(text)zHello, [bold magenta]World[/]!zrich.Segmentz]A Segment is the last step in the Rich render process before generating text with ANSI codes.z Consider the following code: �pythonT)�line_numberszRWhen you call [b]print()[/b], Rich [i]renders[/i] the object in to the following: zAThe Segments are then processed to produce the following output: zS You will only need to know this if you are implementing your own Rich renderables.N):�enumr���� functoolsr���� itertoolsr����loggingr����operatorr����typingr���r ���r ���r���r���r ���r���r���r���r����cellsr���r���r���r���r����reprr���r���rJ���r���r����r���r���r����logr ���r`���r����r����rH���r����r����r0����pip._vendor.rich.console�pip._vendor.rich.syntaxr�����pip._vendor.rich.textr�����code�from_markuprI����rule�printr�����render� fragmentsrD���rE���rF����<module>r�������s������������������������������!��!��!��!��!��!����������������������������������������������������������������������������������������������������$��#��#��#��#��#��#��#���������������?�>�>�>�>�>�>�>�>�>�>��i��������������'�������*�� �+�� �+�u�S�#�X�� &�'� �+�s�C� � �"��������\ ��\ ��\ ��\ ��\ �j��\ ��\ �� ��\ �~%��%��%��%��%��%��%��%�2 �� �� �� �� �� �� �� �2��z���0�0�0�0�0�0�.�.�.�.�.�.�*�*�*�*�*�*��D� ��4��<�=�=�D��g�i�i�G��L�L�� � � ��M�M�g��������M�M�4�5�5�5��M�M�&�&��x�d�;�;�;�<�<�<��M�M�O�O�O��M�M�]���������W�^�^�D�)�)�*�*�I��M�M�)�����M�M�O�O�O��M�M�V�W�W�W��M�M�$�����M�M�^����������;��rE���