
    i                         d Z ddlmZ ddlmZ 	 ddddded	ed
eded         dedefdZ	 ddddded	ed
eded         dedefdZ	 ddddded	ed
eded         dedefdZ	dS )zBPython grapheme, emoji, and sequence-aware ljust, rjust, center().    )Literal   )width parsecontrol_codesambiguous_widthtext
dest_widthfillcharr	   )r   strictignorer
   returnc                    |                                  r$|                                 rt          |           }nt          | ||          }t	          d||z
            }| ||z  z   S )u)  
    Return text left-justified in a string of given display width.

    :param text: String to justify, may contain terminal sequences.
    :param dest_width: Total display width of result in terminal cells.
    :param fillchar: Single character for padding (default space). Must have
        display width of 1 (not wide, not zero-width, not combining). Unicode
        characters like ``'·'`` are acceptable. The width is not validated.
    :param control_codes: How to handle control sequences when measuring.
        Passed to :func:`width` for measurement.
    :param ambiguous_width: Width to use for East Asian Ambiguous (A)
        characters. Default is ``1`` (narrow). Set to ``2`` for CJK contexts.
    :returns: Text padded on the right to reach ``dest_width``.

    .. versionadded:: 0.3.0

    Example::

        >>> wcwidth.ljust('hi', 5)
        'hi   '
        >>> wcwidth.ljust('\x1b[31mhi\x1b[0m', 5)
        '\x1b[31mhi\x1b[0m   '
        >>> wcwidth.ljust('\U0001F468\u200D\U0001F469\u200D\U0001F467', 6)
        '👨‍👩‍👧    '
    r   r   isasciiisprintablelenr   maxr   r   r   r	   r
   
text_widthpadding_cellss          T/home/piyush/.hermes/hermes-agent/venv/lib/python3.11/site-packages/wcwidth/align.pyljustr      so    B ||~~ _$**,, _YY

4}o^^^
:
233M(]***    c                    |                                  r$|                                 rt          |           }nt          | ||          }t	          d||z
            }||z  | z   S )u)  
    Return text right-justified in a string of given display width.

    :param text: String to justify, may contain terminal sequences.
    :param dest_width: Total display width of result in terminal cells.
    :param fillchar: Single character for padding (default space). Must have
        display width of 1 (not wide, not zero-width, not combining). Unicode
        characters like ``'·'`` are acceptable. The width is not validated.
    :param control_codes: How to handle control sequences when measuring.
        Passed to :func:`width` for measurement.
    :param ambiguous_width: Width to use for East Asian Ambiguous (A)
        characters. Default is ``1`` (narrow). Set to ``2`` for CJK contexts.
    :returns: Text padded on the left to reach ``dest_width``.

    .. versionadded:: 0.3.0

    Example::

        >>> wcwidth.rjust('hi', 5)
        '   hi'
        >>> wcwidth.rjust('\x1b[31mhi\x1b[0m', 5)
        '   \x1b[31mhi\x1b[0m'
        >>> wcwidth.rjust('\U0001F468\u200D\U0001F469\u200D\U0001F467', 6)
        '    👨‍👩‍👧'
    r   r   r   r   s          r   rjustr   1   so    B ||~~ _$**,, _YY

4}o^^^
:
233Mm#d**r   c                    |                                  r$|                                 rt          |           }nt          | ||          }t	          d||z
            }|dz  ||z  dz  z   }||z
  }||z  | z   ||z  z   S )u^  
    Return text centered in a string of given display width.

    :param text: String to center, may contain terminal sequences.
    :param dest_width: Total display width of result in terminal cells.
    :param fillchar: Single character for padding (default space). Must have
        display width of 1 (not wide, not zero-width, not combining). Unicode
        characters like ``'·'`` are acceptable. The width is not validated.
    :param control_codes: How to handle control sequences when measuring.
        Passed to :func:`width` for measurement.
    :param ambiguous_width: Width to use for East Asian Ambiguous (A)
        characters. Default is ``1`` (narrow). Set to ``2`` for CJK contexts.
    :returns: Text padded on both sides to reach ``dest_width``.

    For odd-width padding, the extra cell fills in the same cell position as
    Python's :meth:`str.center` behavior (the left side when ``dest_width`` is
    odd, the right side when ``dest_width`` is even).
    See `the eccentric str.center <https://jazcap53.github.io/pythons-eccentric-strcenter.html>`_.

    .. versionadded:: 0.3.0

    Example::

        >>> wcwidth.center('hi', 6)
        '  hi  '
        >>> wcwidth.center('\x1b[31mhi\x1b[0m', 6)
        '  \x1b[31mhi\x1b[0m  '
        >>> wcwidth.center('\U0001F468\u200D\U0001F469\u200D\U0001F467', 6)
        '  👨‍👩‍👧  '
    r   r      r   r   )	r   r   r   r	   r
   r   total_paddingleft_pad	right_pads	            r   centerr$   Z   s    L ||~~ _$**,, _YY

4}o^^^
:
233M!]Z%?!%CDH(Ih%9(<<<r   N)r   )
__doc__typingr   _widthr   strintr   r   r$    r   r   <module>r+      s   H H             &+
 ;B&+ &+ &+
&+&+ &+
 67&+ &+ 	&+ &+ &+ &+X &+
 ;B&+ &+ &+
&+&+ &+
 67&+ &+ 	&+ &+ &+ &+X .=
 ;B.= .= .=
.=.= .=
 67.= .= 	.= .= .= .= .= .=r   