8fL ddlmZddlZddlmZddlmZddlmZm Z ej dZ dd Z dddZ edkrddlmZedZedee ddedZeedeeddSdS) ) annotationsN)Iterable) loop_last)cell_len chop_cellsz \s*\S+\s*textstrreturnIterable[tuple[int, int, str]]c#Kd}t||}|R|\}}|d}|||fVt||}|PdSdS)zYields each word from the text as a tuple containing (start_index, end_index, word). A "word" in this context may include the actual word and any whitespace to the right. rN)re_wordmatchspangroup)r position word_matchstartendwords v/builddir/build/BUILD/imunify360-venv-2.3.5/opt/imunify360/venv/lib/python3.11/site-packages/pip/_vendor/rich/_wrap.pywordsr s HtX..J  __&& s""S$]]4--  Twidthintfoldbool list[int]cg}|j}d}t}t|D]\}}} || } ||z } | | k} | r||| z }?| |kro|rTt | |} t | D]2\}}|r |||r ||} |t |z }3|r |||| }|r|r|||| }|S)aGiven a string of text, and a width (measured in cells), return a list of cell offsets which the string should be split at in order for it to fit within the given width. Args: text: The text to examine. width: The available cell width. fold: If True, words longer than `width` will be folded onto a new line. Returns: A list of indices to break the line at. rr)appendrrrstriprrlen)r rrbreak_positionsr! cell_offset _cell_lenr_endr word_lengthremaining_spaceword_fits_remaining_space folded_wordlastlines r divide_liner.s^"$O  #FKI"4[[ . .tTi .. +-$3{$B! $ . 99T?? *KKU""2",T"?"?"?K&/ &<&<// d *"F5MMM/*3)D//KK!SYY.EE /&u "+)D//KK . .u 'ioo r__main__)Console r z@12345 abcdefghijklmnopqrstuvwyxzABCDEFGHIJKLMNOPQRSTUVWXYZ 12345abcdefghijklmnopqrstuvwxyzuRTextualはPythonの高速アプリケーション開発フレームワークですu4アプリケーションは1670万色を使用でき)r r r r )T)r r rrrrr r) __future__rretypingr_looprcellsrrcompilerrr.__name__consoler0printrulerrr?s\"""""" '''''''' "*\ " " . . . .44444n z      gBG MMTUUU E**12 6 6777gBG LLNNN MMfggg LLNNN MMHIIIIIr