h UddlmZddlmZddlmZddlmZgdZde d<e d eDZ e j Z d e d <ed d&dZefd'dZed d(dZd)dZd*dZedkrdeededd D] Zeeed!dd"D]*Zeeded#zed$ez)d%Sd%S)+) annotations) lru_cache)Callable) CELL_WIDTHS)) ~))i)ipi)i%i%)i(i(zlist[tuple[int, int]]_SINGLE_CELL_UNICODE_RANGESc jg|]0\}}ttt||dzD]}|1S)r)mapchrrange).0_start_end characters v/builddir/build/BUILD/imunify360-venv-2.5.2/opt/imunify360/venv/lib/python3.11/site-packages/pip/_vendor/rich/cells.py rs[ FDS%q"9"9::  zCallable[[str], bool]_is_single_cell_widthsitextstrreturnintct|rt|Sttt|S)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. )rlensumrget_character_cell_size)rs rcached_cell_lenr"!s9d##4yy s*D11 2 22r _cell_lenCallable[[str], int]ct|dkr ||St|rt|Sttt|S)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)rrr rr!)rr#s rcell_lenr&3sV 4yy3yd##4yy s*D11 2 22r)maxsizerct|}t}d}t|dz }||zdz} ||\}}}||kr|dz }n||kr|dz}n |dkrdn|S||krn ||zdz}>dS)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. rrT)ordrr) r codepoint_table lower_bound upper_boundindexstartendwidths rr!r!CsII FKf++/K ; &1 ,E 1"5MsE u  !)KK __!)KK 11 .  $ $ {*q0 1 1rtotalct|r*t|}||kr |d||z zzS|d|S|dkrdSt|}||kr|S||kr |d||z zzSd}t|} ||zdz}|d|dz}t|}||dzkr&t|ddkr |dddzS||kr|S||kr|}n|}g) z?Set the length of a string to fit within given number of cells. NrTr)rr*)rrr&) rr4size cell_sizer1r2posbefore before_lens r set_cell_sizer=`s8d##4yy %<<#.. .FUF| zzrIE 5cUY./// E d))C s{q iaif%%  " "xr ';';q'@'@#2#;$ $   M   CCE rr3 list[str]ct}gg}|j}|dj}d}|D]D}||}||z|k} | r||g|dj}|}4||||z }Ed|DS)ahSplit 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*rc8g|]}d|S)r7)join)rlines rrzchop_cells..s" , , ,dBGGDMM , , ,r)r!append) rr3_get_character_cell_sizelinesappend_new_lineappend_to_last_line total_widthr cell_widthchar_doesnt_fits r chop_cellsrKs 7 TElO)*K & & --i88 % 2U:  & OYK ( ( ("')"2 $KK   * * * : %KK , ,e , , ,,r__main__u😽u]这是对亚洲语言支持的测试。面对模棱两可的想法,拒绝猜测的诱惑。Pr*|xN)rrrr)rrr#r$rr)rrrr)rrr4rrr)rrr3rrr>) __future__r functoolsrtypingr _cell_widthsrr __annotations__ frozenset _SINGLE_CELLS issupersetrr"r&r!r=rK__name__printrBrnrrr]s:"""""""%%%%%%666 7 1>0HHHHH 43333";J 3 3 3 3 3  4    8    F"-"-"-"-J z E ! !& ) )*** ~ABCC d U2q"   mmBCDDGJJ K K K cAg r