
    q"h
                       % S SK Jr  S SKJr  S SKJr  SSKJr  / SQrS\	S'   \
" \ V VVs/ s H!  u  p\" \\" XS-   5      5        H  nUPM     M#     snnn 5      r\R                  rS	\	S
'   \" S5      SS j5       r\4SS jjr\" SS9SS j5       rSS jr      SS jr\S:X  aU  \" \" S5      5        \" SS5       H  r\" \5        M     \" SSS5       H   r\" \" S\5      S-   5        \" S\-  5        M"     ggs  snnn f )     )annotations)	lru_cache)Callable   )CELL_WIDTHS))    ~   )      )   i  )ip  i  )i %  i%  )i (  i(  zlist[tuple[int, int]]_SINGLE_CELL_UNICODE_RANGESzCallable[[str], bool]_is_single_cell_widthsi   c                j    [        U 5      (       a  [        U 5      $ [        [        [        U 5      5      $ )a  Get the number of cells required to display text.

This method always caches, which may use up a lot of memory. It is recommended to use
`cell_len` over this method.

Args:
    text (str): Text to display.

Returns:
    int: Get the number of cells required to display text.
)r   lensummapget_character_cell_size)texts    H/var/www/html/env/lib/python3.13/site-packages/pip/_vendor/rich/cells.pycached_cell_lenr   !   s,     d##4ys*D122    c                    [        U 5      S:  a  U" U 5      $ [        U 5      (       a  [        U 5      $ [        [        [        U 5      5      $ )zGet the number of cells required to display text.

Args:
    text (str): Text to display.

Returns:
    int: Get the number of cells required to display text.
i   )r   r   r   r   r   )r   	_cell_lens     r   cell_lenr   3   sA     4y3d##4ys*D122r   )maxsizec                    [        U 5      n[        nSn[        U5      S-
  nX4-   S-  n X%   u  pgnX:  a  US-
  nOX:  a  US-   nO
US:X  a  S$ U$ XC:  a   gX4-   S-  nM7  )zGet the cell size of a character.

Args:
    character (str): A single character.

Returns:
    int: Number of cells (0, 1 or 2) occupied by that character.
r   r      )ordr   r   )		character	codepoint_tablelower_boundupper_boundindexstartendwidths	            r   r   r   C   s     IIFKf+/K&1,E
"ME!)K_!)K1..$ *q0 r   c                j   [        U 5      (       a  [        U 5      nX!:  a
  U SX-
  -  -   $ U SU $ US::  a  g[        U 5      nX1:X  a  U $ X1:  a
  U SX-
  -  -   $ Sn[        U 5      n XE-   S-  nU SUS-    n[        U5      nXS-   :X  a  [        US   5      S:X  a  USS S-   $ X:X  a  U$ X:  a  UnOUnMO  )z?Set the length of a string to fit within given number of cells. Nr    r   r   r   )r   r   r   )	r   totalsize	cell_sizer&   r'   posbefore
before_lens	            r   set_cell_sizer2   `   s     d##4y<#...FU|zIcU.///E
d)C {q iaf%
"xr
';q'@#2;$$MCE r   c                *   [         n/ /nUR                  nUS   R                  nSnU  HA  nU" U5      nXh-   U:  n	U	(       a  U" U/5        US   R                  nUnM5  U" U5        Xh-  nMC     U V
s/ s H  n
SR                  U
5      PM     sn
$ s  sn
f )aL  Split text into lines such that each line fits within the available (cell) width.

Args:
    text: The text to fold such that it fits in the given width.
    width: The width available (number of cells).

Returns:
    A list of strings such that each string in the list has cell width
    less than or equal to the available width.
r   r   r+   )r   appendjoin)r   r(   _get_character_cell_sizelinesappend_new_lineappend_to_last_linetotal_widthr    
cell_widthchar_doesnt_fitlines              r   
chop_cellsr>      s      7 TEllO)**K	-i8
%2U:YK("')"2"2$K	*%K  ',,edBGGDMe,,,s   2B__main__u   😽u]   这是对亚洲语言支持的测试。面对模棱两可的想法，拒绝猜测的诱惑。   P   r   |xN)r   strreturnint)r   rD   r   zCallable[[str], int]rE   rF   )r    rD   rE   rF   )r   rD   r,   rF   rE   rD   )r   rD   r(   rF   rE   z	list[str])
__future__r   	functoolsr   typingr   _cell_widthsr   r   __annotations__	frozensetr   chrrange_SINGLE_CELLS
issupersetr   r   r   r   r2   r>   __name__printr=   n)_start_endr    s   000r   <module>rV      sj   "   %6 2   87LFS%q"9:I 	: 	7 1>0H0H - H 43 3" ;J 3  4 8 F"-
"-"- "-J z	
!&
)*~  AB  Cd C2q"m  BC  D  GJ  J  	KcAg 	 gs   (C?