Viewing File: /opt/imunify360/venv/lib/python3.11/site-packages/pip/_vendor/rich/__pycache__/text.cpython-311.pyc



]jvUddlZddlmZmZddlmZddlmZddlm	Z	m
Z
mZmZm
Z
mZmZmZmZmZmZddlmZddlmZdd	lmZdd
lmZddlmZmZddlm Z dd
l!m"Z"ddl#m$Z$ddl%m&Z&ddl'm(Z(ddl)m*Z*ddl+m,Z,m-Z-e	rddl.m/Z/m0Z0m1Z1m2Z2dZ3de4d<dZ5de4d<ej6dZ7ee8dfZ9	ee8gee-fZ:GddeZ;Gdde&Z<e=dkrNdd l>m/Z/e<d!Z?e?@d"gd#e?@d$gd%e/Z.e.Ad&e.Be?d'(e.Be.Ad)e.Be?d*d+,e.Be.Ad-e.Be?d.d/,e.Be.Ad0e.Be?d1d2,e.BdSdS)3N)partialreduce)gcd)
itemgetter)
TYPE_CHECKINGAnyCallableDictIterableList
NamedTupleOptionalPatternTupleUnion)	loop_last)	pick_bool)divide_line)AlignMethod)cell_len
set_cell_size)Lines)strip_control_codes)EmojiVariant)JupyterMixin)Measurement)Segment)Style	StyleType)ConsoleConsoleOptions
JustifyMethodOverflowMethoddefaultr#DEFAULT_JUSTIFYfoldr$DEFAULT_OVERFLOWz\s+$TextceZdZUdZeed<	eed<	eeefed<	defdZ	de
fdZdedede
dffd	Zdeddfd
ZdeddfdZdeddfd
ZdS)Spanz A marked up region in some text.startendstylereturnc8d|jd|jd|jdS)NzSpan(z, ))r,r-r.selfs u/builddir/build/BUILD/imunify360-venv-2.6.3/opt/imunify360/venv/lib/python3.11/site-packages/pip/_vendor/rich/text.py__repr__z
Span.__repr__9s)@tz@@TX@@@@@@c"|j|jkSN)r-r,r2s r4__bool__z
Span.__bool__<sx$*$$r6offsetc||jkr|dfS||jkr|dfS|\}}}t|t|||}t|j||}||fS)z)Split a span in to 2 from a given offset.N)r,r-r+min)r3r:r,r-r.span1span2s       r4splitz
Span.split?svDJ:TX: sEUCV,,e44UYU++e|r6c<|\}}}t||z||z|S)zMove start and end by a given offset.

        Args:
            offset (int): Number of characters to add to start and end.

        Returns:
            TextSpan: A new TextSpan with adjusted position.
        r+r3r:r,r-r.s     r4movez	Span.moveLs*!sEEFNC&L%888r6c\|\}}}||kr|St|t|||S)zCrop the span at the given offset.

        Args:
            offset (int): A value between start and end.

        Returns:
            Span: A new (possibly smaller) span.
        )r+r<rBs     r4
right_cropzSpan.right_cropXs:!sES==KE3vs++U333r6cellsc>|r|\}}}t|||z|S|S)zExtend the span by the given number of cells.

        Args:
            cells (int): Additional space to add to end of span.

        Returns:
            Span: A span.
        rA)r3rFr,r-r.s     r4extendzSpan.extendfs3	 $E3sU{E222Kr6N)__name__
__module____qualname____doc__int__annotations__rstrrr5boolr9rrr?rCrErHr6r4r+r+/s**JJJ	HHHe)A#AAAA%$%%%%CE&(62B*B$C
93
96
9
9
9
9444444
C
F





r6r+ceZdZdZgdZ		dddddddddedeeefd	ed
dedd
ee	dedee
deeeddfdZ
de
fdZde	fdZdefdZdefdZdeddfdZdede	fdZdede	fdZdee
efddfdZede
fdZedefdZeddddddd dedeeefd!e	d"eed	ed
deddeddfd#Zedddddd$d%dedeeefd	ed
dedd
ee	dedee
ddfd&Ze	dddd'dede d	ed
dedddf
d(Z!edddddd$dd)d*eede"ee ffdeeefd	ed
dedd
ee	dede
d+ee#eefddfd,Z$edefd-Z%e%j&d.eddfd/Z%edeefd0Z'e'j&deeddfd1Z'dd2eddfd3Z(dd4Z)		ddeeefd6e
dee
ddfd7Z*		ddeeefd6e
dee
ddfd8Z+	dd+e#eefd6e
dee
ddfd9Z,dd+ee#eefd:eddfd;Z-d<eddfd=Z.d>d?d@e
defdAZ/dBe
ddfdCZ0	dddDdEee1eefdeee2e fdFede
fdGZ3ddHdIe4edeeefdJe	de
fdKZ5ddLZ6dMe
ddfdNZ7dOe
ddfdPZ8d>d?dQdRde4e9fdSZ:d>d?dQdRde;fdTZ<dd>d?dede4dUfdVZ=dWe4dddfdXZ>ddee
ddfdYZ?ddZd[d\e
dedd]e	ddfd^Z@dd_ZAddae
dbeddfdcZBddae
dbeddfddZCddae
dbeddfdeZDddfeEdge
dbeddfdhZF	ddedefdeeedifddfdjZGddkZHdle4e"eee fddfdmZIddnZJ	ddZdZdodpedqe	dre	deKfdsZLdte4e
deKfduZMddwe
ddfdxZNddd$ddyd>d?dge
d	ed
dedde
d
ee	deKfdzZOdge
deKfd{ZPde
fd|ZQ	dd}d~ddee
dbede ddfdZRdS)r)aText with color / style.

    Args:
        text (str, optional): Default unstyled text. Defaults to "".
        style (Union[str, Style], optional): Base style for text. Defaults to "".
        justify (str, optional): Justify method: "left", "center", "full", "right". Defaults to None.
        overflow (str, optional): Overflow method: "crop", "fold", "ellipsis". Defaults to None.
        no_wrap (bool, optional): Disable text wrapping, or None for default. Defaults to None.
        end (str, optional): Character to end text with. Defaults to "\\n".
        tab_size (int): Number of spaces per tab, or ``None`` to use ``console.tab_size``. Defaults to None.
        spans (List[Span], optional). A list of predefined style spans. Defaults to None.
    )	_textr.justifyoverflowno_wrapr-tab_size_spans_lengthN
)rTrUrVr-rWspanstextr.rTr#rUr$rVr-rWr\r/ct|}	|	g|_||_||_||_||_||_||_|pg|_t|	|_
dSr8)rrSr.rTrUrVr-rWrXlenrY)
r3r]r.rTrUrVr-rWr\sanitized_texts
          r4__init__z
Text.__init__sc-T22$%

294<
 
"'+2//r6c|jSr8)rYr2s r4__len__zText.__len__s
|r6c*t|jSr8)rPrYr2s r4r9z
Text.__bool__sDL!!!r6c|jSr8plainr2s r4__str__zText.__str__s
zr6c8d|jd|jd|jdS)Nz<text  >)rgrXr.r2s r4r5z
Text.__repr__s)F
FFt{FFtzFFFFr6otherct|ttfr+|}|||St
Sr8)
isinstancerOr)copyappendNotImplemented)r3rlresults   r4__add__zText.__add__sBec4[))	YY[[FMM%   Mr6czt|tstS|j|jko|j|jkSr8)rnr)rqrgrXr3rls  r4__eq__zText.__eq__s7%&&	"!!zU[(HT[EL-HHr6ct|tr	||jvSt|tr|j|jvSdS)NF)rnrOrgr)rus  r4__contains__zText.__contains__sGeS!!	-DJ&&
t
$
$	-;$*,,ur6slicec dtddffd}t|tr||S|tj\}}}|dkr||g}|dSt
d)Nr:r/r)cxttjfdjDd}|S)NcRg|]#\}}}|cxkr|knn
dd|$S)rrrQ.0r,r-r._Spanr:s    r4
<listcomp>z9Text.__getitem__.<locals>.get_text_at.<locals>.<listcomp>sY)sEV,,,,u,,,,,E!Q&&,,,r6rZ)r\r-)r+r)rgrX)r:r]rr3s` @r4get_text_atz%Text.__getitem__.<locals>.get_text_atsaE
6"-1[
DKr6rz%slices with step!=1 are not supported)rMrnindicesr_rgdivide	TypeError)r3ryrr,stopstepliness`      r4__getitem__zText.__getitem__s								eS!!
	I;u%%% %

c$*oo > >E4qyyUDM22Qx  GHHHr6c*t|jS)z5Get the number of cells required to render this text.)rrgr2s r4rz
Text.cell_lens
###r6cddlm}g}|j}dd|jfgd|jDd|jDt|d|jf}|tddd}|j}|D]C\}}}	||kr||||||}|	r||rd	|	d
nd|	d
Dd	|}
|
S)
z~Get console markup to render this Text.

        Returns:
            str: A string potentially creating markup tags.
        r)escaperFc34K|]}|jd|jfVdSFN)r,r.r~spans  r4	<genexpr>zText.markup.<locals>.<genexpr>s-
F
F$tz5$*-
F
F
F
F
F
Fr6c34K|]}|jd|jfVdSTN)r-r.rs  r4rzText.markup.<locals>.<genexpr>s-
C
Cttxtz*
C
C
C
C
C
Cr6Tkeyz[/][rZ)
markuprrgr.rXr_sortrrpjoin)r3routputrgmarkup_spanspositionrpr:closingr.rs           r4rzText.markupsB	#"""""

tz"

F
F$+
F
F
F
D
Ct{
C
C
C
ZZtz*	
	jA..///&2	C	C"FGU  vveHVO455666!
CA}E}}}}\\\\BBB
r6T)r.emoji
emoji_variantrTrUr-rrcZddlm}|||||}	||	_||	_||	_|	S)aCreate Text instance from markup.

        Args:
            text (str): A string containing console markup.
            style (Union[str, Style], optional): Base style for text. Defaults to "".
            emoji (bool, optional): Also render emoji code. Defaults to True.
            emoji_variant (str, optional): Optional emoji variant, either "text" or "emoji". Defaults to None.
            justify (str, optional): Justify method: "left", "center", "full", "right". Defaults to None.
            overflow (str, optional): Overflow method: "crop", "fold", "ellipsis". Defaults to None.
            end (str, optional): Character to end text with. Defaults to "\\n".

        Returns:
            Text: A Text instance with markup rendered.
        r)render)rr)rrrTrUr-)
clsr]r.rrrTrUr-r
rendered_texts
          r4from_markupzText.from_markupsL4	#"""""tU%}UUU
 '
!)

r6r.rTrUrVr-rWc	ddlm}td||||||}	|}
|	d|
|D}|S)aCreate a Text object from a string containing ANSI escape codes.

        Args:
            text (str): A string containing escape codes.
            style (Union[str, Style], optional): Base style for text. Defaults to "".
            justify (str, optional): Justify method: "left", "center", "full", "right". Defaults to None.
            overflow (str, optional): Overflow method: "crop", "fold", "ellipsis". Defaults to None.
            no_wrap (bool, optional): Disable text wrapping, or None for default. Defaults to None.
            end (str, optional): Character to end text with. Defaults to "\\n".
            tab_size (int): Number of spaces per tab, or ``None`` to use ``console.tab_size``. Defaults to None.
        r)AnsiDecoderr[)rTrUrVr-rWr.c3K|]}|VdSr8rQr~lines  r4rz!Text.from_ansi.<locals>.<genexpr>Hs"CCdTCCCCCCr6)ansirr)rdecode)rr]r.rTrUrVr-rWrjoinerdecoderrrs            r4	from_ansizText.from_ansi%s}.	&%%%%%


+--CCgnnT.B.BCCCCC
r6rTrUcL||||}|||S)aaConstruct a Text instance with a pre-applied styled. A style applied in this way won't be used
        to pad the text when it is justified.

        Args:
            text (str): A string containing console markup.
            style (Union[str, Style]): Style to apply to the text. Defaults to "".
            justify (str, optional): Justify method: "left", "center", "full", "right". Defaults to None.
            overflow (str, optional): Overflow method: "crop", "fold", "ellipsis". Defaults to None.

        Returns:
            Text: A text instance with a style applied to the entire string.
        r)stylize)rr]r.rTrUstyled_texts      r4styledzText.styledKs4*c$(CCCE"""r6)r.rTrUrVr-rWmetapartsrc|||||||}	|	j}
t}|D]*}t||tfr|
|%|
|+|r|	||	S)aConstruct a text instance by combining a sequence of strings with optional styles.
        The positional arguments should be either strings, or a tuple of string + style.

        Args:
            style (Union[str, Style], optional): Base style for text. Defaults to "".
            justify (str, optional): Justify method: "left", "center", "full", "right". Defaults to None.
            overflow (str, optional): Overflow method: "crop", "fold", "ellipsis". Defaults to None.
            no_wrap (bool, optional): Disable text wrapping, or None for default. Defaults to None.
            end (str, optional): Character to end text with. Defaults to "\\n".
            tab_size (int): Number of spaces per tab, or ``None`` to use ``console.tab_size``. Defaults to None.
            meta (Dict[str, Any], optional). Meta data to apply to text, or None for no meta data. Default to None

        Returns:
            Text: A new text instance.
        r)rpr)rnrO
apply_meta)
rr.rTrUrVr-rWrrr]rp_Textparts
             r4assemblez
Text.assembleds6s



		D$--
t


	"OOD!!!r6ct|jdkr%d|jg|jdd<|jdS)z Get the text as a single string.rrZNr)r_rSrr2s r4rgz
Text.plainsCtz??aWWTZ001DJqqqMz!}r6new_textc||jkrXt|}|g|jdd<|j}t	||_||jkr|dSdSdS)zSet the text to a new value.N)rgrrSrYr__trim_spans)r3rr`
old_lengths    r4rgz
Text.plains{tz!!0::N+,DJqqqMJ~..DLDL((  """""
"!
)(r6c|jS)z.Get a reference to the internal list of spans.rXr2s r4r\z
Text.spanss{r6c$|dd|_dS)z
Set spans.Nr)r3r\s  r4r\z
Text.spanssAAAhr6rgc	nt||j|j|j|j|j|j}|S)zNReturn a new Text instance with copied metadata (but not the string or spans).r)r)r.rTrUrVr-rW)r3rg	copy_selfs   r4
blank_copyzText.blank_copys?*L]L]


	r6c	t|j|j|j|j|j|j|j}|j|jdd<|S)zReturn a copy of this instance.rN)	r)rgr.rTrUrVr-rWrX)r3rs  r4roz	Text.copysTJ*L]L]


	#k	r6rr,c	|rpt|}|dkr||z}||}|dkr||z}||ks||krdS|jt|t	|||dSdS)azApply a style to the text, or a portion of the text.

        Args:
            style (Union[str, Style]): Style instance or style definition to apply.
            start (int): Start offset (negative indexing is supported). Defaults to 0.
            end (Optional[int], optional): End offset (negative indexing is supported), or None for end of text. Defaults to None.
        rN)r_rXrpr+r<r3r.r,r-lengths     r4rzText.stylizes	EYYFqyy{Qwwsl#,,KtE3vs+;+;UCCDDDDD	E	Er6c
|rqt|}|dkr||z}||}|dkr||z}||ks||krdS|jdt|t	|||dSdS)aApply a style to the text, or a portion of the text. Styles will be applied before other styles already present.

        Args:
            style (Union[str, Style]): Style instance or style definition to apply.
            start (int): Start offset (negative indexing is supported). Defaults to 0.
            end (Optional[int], optional): End offset (negative indexing is supported), or None for end of text. Defaults to None.
        rN)r_rXinsertr+r<rs     r4stylize_beforezText.stylize_befores	HYYFqyy{Qwwsl#,,Kq$uc&#.>.>"F"FGGGGG	H	Hr6c^tj|}||||dS)agApply metadata to the text, or a portion of the text.

        Args:
            meta (Dict[str, Any]): A dict of meta information.
            start (int): Start offset (negative indexing is supported). Defaults to 0.
            end (Optional[int], optional): End offset (negative indexing is supported), or None for end of text. Defaults to None.

        )r,r-N)r	from_metar)r3rr,r-r.s     r4rzText.apply_metas1%%U%S11111r6handlersc|in|}|d|D|tj||S)aApply event handlers (used by Textual project).

        Example:
            >>> from rich.text import Text
            >>> text = Text("hello world")
            >>> text.on(click="view.toggle('world')")

        Args:
            meta (Dict[str, Any]): Mapping of meta information.
            **handlers: Keyword args are prefixed with "@" to defined handlers.

        Returns:
            Text: Self is returned to method may be chained.
        Nc i|]\}}d||S)@rQ)r~rvalues   r4
<dictcomp>zText.on.<locals>.<dictcomp>s$III*#uYYYIIIr6)updateitemsrrr)r3rrs   r4onzText.ons]\rrtII8H8HIIIJJJU_T**+++r6suffixc|j|r$|t|dSdS)zaRemove a suffix if it exists.

        Args:
            suffix (str): Suffix to remove.
        N)rgendswithrEr_)r3rs  r4
remove_suffixzText.remove_suffixsD:v&&	)OOCKK(((((	)	)r6consoler!r:c|dkrt||z}|j}||j}|jD]&\}}}||cxkr|krn|||dz
}'|S)a
Get the style of a character at give offset.

        Args:
            console (~Console): Console where text will be rendered.
            offset (int): Offset in to text (negative indexing supported)

        Returns:
            Style: A Style instance.
        rrZr%)r_	get_styler.rorX)r3rr:rr.r,r-
span_styles        r4get_style_at_offsetzText.get_style_at_offset(sA::YY'F%		$*%%**,,&*k	;	;"E3
V$$$$u$$$$$:r::::r6spacescdkrdS|j}dz}|rTt|fd|D|jdd<|j||xjz
c_dS|xj|z
c_dS)zExtend the Text given number of spaces where the spaces have the same style as the last character.

        Args:
            spaces (int): Number of spaces to add to the Text.
        rNrjcTg|]$}|jkr|n|%SrQ)r-rH)r~r
end_offsetrs  r4rz%Text.extend_style.<locals>.<listcomp>HsF(,x:'='=F###4r6)r\r_rXrSrprYrg)r3rr\
new_spacesrs `  @r4extend_stylezText.extend_style<sQ;;F
6\
		%TJ!DKN
Jj)))LLF"LLLLJJ*$JJJJr6)style_prefixre_highlightrc
4d}|jj}t}|j}t	|t
rt
j|}||D]}|j	}	|rO|	\}
}t|r|||
|n|}|||
kr|||
|||dz
}|D]6}
|	|
\}
}|
dkr ||
kr|||
|||
7|S)a%Highlight text with a regular expression, where group names are
        translated to styles.

        Args:
            re_highlight (Union[re.Pattern, str]): A regular expression object or string.
            style (Union[GetStyleCallable, StyleType]): Optional style to apply to whole match, or a callable
                which accepts the matched text and returns a style. Defaults to None.
            style_prefix (str, optional): Optional prefix to add to style group names.

        Returns:
            int: Number of regex matches
        rNr)
rXrpr+rgrnrOrecompilefinditerrcallable	groupdictkeys)r3rr.rcountappend_spanrrgmatchget_spanr,r-match_stylenames              r4highlight_regexzText.highlight_regexQs[&k(
lC((	4:l33L!**511	L	LEzH
@%XZZ
s9A%SeeE%)$4555e*sU{{KeS+ > >???QJE))..00
L
L%Xd^^
sB;;3;;KeS\2I42I2I J JKKK
Lr6)case_sensitivewordsrc.dd|D}|jj}d}t}t	j||j|rdntjD]5}|d\}	}
|||	|
||dz
}6|S)aBHighlight words with a style.

        Args:
            words (Iterable[str]): Words to highlight.
            style (Union[str, Style]): Style to apply.
            case_sensitive (bool, optional): Enable case sensitive matching. Defaults to True.

        Returns:
            int: Number of words highlighted.
        |c3>K|]}tj|VdSr8)rrr~words  r4rz'Text.highlight_words.<locals>.<genexpr>s*>>BIdOO>>>>>>r6rflagsr)	rrXrpr+rrrg
IGNORECASEr)r3rr.rre_wordsadd_spanrrrr,r-s           r4highlight_wordszText.highlight_wordsys"88>>>>>>>;%[dj^(N


		EAJE3HUU5#u--...QJEEr6cB|j|_dS)z"Strip whitespace from end of text.N)rgrstripr2s r4r	zText.rstripsZ&&((


r6sizect|}||krm||z
}t|j}|It|d}|t
||dSdSdS)zRemove whitespace beyond a certain width at the end of the text.

        Args:
            size (int): The desired size of the text.
        Nr)r__re_whitespacesearchrggrouprEr<)r3r
text_lengthexcesswhitespace_matchwhitespace_counts      r4
rstrip_endzText.rstrip_ends$ii 4'F-44TZ@@+#&'7'='=a'@'@#A#A $4f = =>>>>>,+r6
new_lengthct|}||kr:||kr|||z
dS|||z
dSdS)z<Set new length of the text, clipping or padding is required.N)r_	pad_rightrE)r3rrs   r4
set_lengthzText.set_lengthseTZ
""zF233333 344444	 r6optionsr"c#K|j|jn|j}|jp
|jpt}|jp
|jpt}|||j|||pdt|j|jd}td
|}|||jEd{VdS)NrFrTrUrWrVr[r-)
rWrTr&rUr(wrap	max_widthrrVr)rrr-)r3rrrWrTrUr	all_liness        r4__rich_console__zText.__rich_console__s-1M,A((t},D'/D_=HG$4H8H		]dlGOUCC


JJOOE**	##G#:::::::::::r6c|j}|}|rtd|Dnd}|}|rtd|Dn|}t	||S)Nc34K|]}t|VdSr8rrs  r4rz(Text.__rich_measure__.<locals>.<genexpr>s(>>Xd^^>>>>>>r6rc34K|]}t|VdSr8r"rs  r4rz(Text.__rich_measure__.<locals>.<genexpr>s(114111111r6)rg
splitlinesmaxr?r)r3rrr]rmax_text_widthrmin_text_widths        r4__rich_measure__zText.__rich_measure__sz!!BGN>>>>>>>>Q

5:NC115111111	>>:::r6rc#NKt}|j}|js"t|V|r
||VdSt|jtjtt|jd}fd|D|j	d<dgd|Dd|Dt|d	df}|tdd
gj
}j}ijt
jdt
ffd}	t#||ddD]J\\}
}}\}
}}|r||n|||
|
kr|||
|
|	VK|r||VdSdS)
aRender the text as Segments.

        Args:
            console (Console): Console instance.
            end (Optional[str], optional): Optional end character.

        Returns:
            Iterable[Segment]: Result of render that may be written to the console.
        Nrrc8i|]\}}||jSrQr.)r~indexrrs   r4rzText.render.<locals>.<dictcomp>s+VVVkeTUIIdj11VVVr6r)rFrc30K|]\}}|jd|fVdSr)r,r~r,rs   r4rzText.render.<locals>.<genexpr>s/
M
M[UDtz5%(
M
M
M
M
M
Mr6c30K|]\}}|jd|fVdSrrr.s   r4rzText.render.<locals>.<genexpr>s/
J
J+%txu%
J
J
J
J
J
Jr6Trr/ctfdtD}|}||S|}||<|S)z#Construct current style from stack.c3(K|]}|V
dSr8rQ)r~	_style_id	style_maps  r4rz9Text.render.<locals>.get_current_style.<locals>.<genexpr>s(OOI9Y/OOOOOOr6)tuplesorted)stylescached_style
current_stylecombinestackstyle_cachestyle_cache_getr3s   r4get_current_stylez&Text.render.<locals>.get_current_stylescOOOOOOOOOF*?622L'###GFOOM"/K  r6)rrgrXrrrnulllist	enumerater.r_rrrpremovegetr9zip)r3rr-_Segmentr]enumerated_spansr\stack_append	stack_popr=r:leavingstyle_idnext_offset_r9rr:r;r<r3s               @@@@@@r4rzText.rendersZz{	$--
$hsmm###FG-uz||DDD		$+q 9 9::VVVVEUVVV	 y,,	!


M
M<L
M
M
M
K
J9I
J
J
J
YYa 	
	

z!Q''
(((|L	68%/-	!5	!	!	!	!	!	!	!	!	!	!ADE5QRQSQS9@U@U	N	N<'VWh)<+q!
'	(####X&&&V##htF;$679J9J9L9LMMMMM	 (3--	 	 r6rc
	}dtdffd}|jj}|jj}|jj}d	t|D]s}||j|jr+|		t|z|j|	fd|jD	t|z
	t	|_	|S)zJoin text together with this instance as the separator.

        Args:
            lines (Iterable[Text]): An iterable of Text instances to join.

        Returns:
            Text: A new text instance containing join text.
        r/r)c3lKjr!tD]\}}|V|sVdSEd{VdSr8)rgr)lastrrr3s  r4	iter_textzText.join.<locals>.iter_textsqz
!"+E"2"2##JD$JJJ#"


##
!         r6rc3FK|]\}}}|z|z|VdSr8rQr}s    r4rzText.join.<locals>.<genexpr>*sS%E3funfslE::r6)
rrrSrHrXrpr+r.r_rY)
r3rrrOextend_textrextend_spansr]rr:s
``      @@r4rz	Text.joins/??$$	!8F+	!	!	!	!	!	!	!n+o,-IKK	 	 DK
###z
KEE&&3t99*<djIIJJJL)-



c$iiFF!r6cd|jvrdS||j}|d}g}|j}|ddD]}d|jvr||d}|dd}|D]}|jdrQ|jdddd	z|jd<||jz
}||z}|r||z
}	||	||	z
}n
||jz
}||td
	|}
|
jg|_t|j|_|
j|jdd<dS)ztConverts tabs to spaces.

        Args:
            tab_size (int, optional): Size of tabs. Defaults to 8.

        	Nrr[T)include_separatorrrrjrZ)
rgrWrpr?rrSrrr)rr_rYrX)r3rWrrpr
cell_positionrr
tab_remainderrrrs           r4expand_tabszText.expand_tabs2stz!!F}HH!JJttJ<<	!	!D4:%%t !


44
@@!!!Dz**400	7)-B)<s)B
2%6
(5(@
(4%-
%=F --f555)V3M%6
F4LLLL!bx((l^
4:AAAr6F)rUpadrrYch|p
|jpt}|dkrt|j}||krA|dkr!t	|j|dz
dz|_nt	|j||_|r<||kr8||z
}|jd|zg|_t
|j|_dSdSdSdS)auTruncate text if it is longer that a given width.

        Args:
            max_width (int): Maximum number of characters in text.
            overflow (str, optional): Overflow method: "crop", "fold", or "ellipsis". Defaults to None, to use self.overflow.
            pad (bool, optional): Pad with spaces if the length is less than max_width. Defaults to False.
        ignoreellipsisru…rjN)rUr(rrgrrSr_rY)r3rrUrY	_overflowrrs       r4truncatez
Text.truncate\sA
A1A	  dj))F	!!
**!.tz9q=!I!IE!QDJJ!.tz9!E!EDJ
/v	))"V+!%;S6\;;<
"4:! 
/
/))r6c|t|jtfd|jD|jdd<dS)z=Remove or modify any spans that are over the end of the text.c	g|]D}|jk
|jkr|n)|jt|j|jESrQr,r-r<r.r~rr
max_offsets  r4rz$Text._trim_spans.<locals>.<listcomp>{f


zJ&&	8j((U4:s:tx'@'@$*MM'&&r6Nr_rgr+rX)r3rrcs @@r4rzText._trim_spanswsU__









AAAr6rjr	characterct|dks
Jdr>|z}||j||_tfd|jD|jdd<dSdS)zPad left and right with a given number of characters.

        Args:
            count (int): Width of padding.
            character (str): The character to pad with. Must be a string of length 1.
        r&Character must be a string of length 1c>g|]\}}}|z|z|SrQrQr~r,r-r.rrs    r4rzText.pad.<locals>.<listcomp>E%E3eemS5[%88r6Nre)r3rrfpad_charactersrs `  @r4rYzText.pads9~~"""$L"""	&.N*HDJHHHDJE)-DKNNN			r6ct|dks
Jdr:|z|j|_tfd|jD|jdd<dSdS)zPad the left with a given character.

        Args:
            count (int): Number of characters to pad.
            character (str, optional): Character to pad with. Defaults to " ".
        rrhc>g|]\}}}|z|z|SrQrQrjs    r4rz!Text.pad_left.<locals>.<listcomp>rkr6Nre)r3rrfrs ` @r4pad_leftz
Text.pad_lefts9~~"""$L"""	%-;tz;;DJE)-DKNNN		r6cnt|dks
Jd|r|j||z|_dSdS)zPad the right with a given character.

        Args:
            count (int): Number of characters to pad.
            character (str, optional): Character to pad with. Defaults to " ".
        rrhN)r_rg)r3rrfs   r4rzText.pad_rightsS9~~"""$L"""	< J;	E(9;;DJJJ	<	<r6alignwidthcF|||t|jz
}|rr|dkr|||dS|dkr6|dz}||||||z
|dS|||dSdS)zAlign text to a given width.

        Args:
            align (AlignMethod): One of "left", "center", or "right".
            width (int): Desired width.
            character (str, optional): Character to pad with. Defaults to " ".
        leftcenterN)r^rrgrro)r3rqrrrfexcess_spacerts      r4rqz
Text.aligns	


ex
333	7|Y77777(""#q(

dI...|d2I>>>>>

lI66666	7	7r6rc	t|ttfstdt	|rt|trt|}|j|t	|}t	||r,|jt||z||xj
z
c_
nt|trt|td|j
|jr:|jt	|z|j|j|j
|jfd|jD|xj
t	|z
c_
|S)zAdd text with an optional style.

        Args:
            text (Union[Text, str]): A str or Text to append.
            style (str, optional): A style name. Defaults to None.

        Returns:
            Text: Returns self for chaining.
        z(Only str or Text can be appended to TextNz2style must not be set when appending Text instancec3FK|]\}}}|z|z|VdSr8rQr~r,r-r.rrs    r4rzText.append.<locals>.<genexpr>sU##)sEE%+-s[/@%HH######r6)rnrOr)rr_rrSrprXr+rY
ValueErrorr.rgrHro)r3r]r.r`r:rrs     @@r4rpzText.appends$d,,	HFGGGt99	*$$$
*!4T!:!:
!!.111T!.11RK&&tFF[4H%'P'PQQQ+D$''
*$$L#l:K&&k;T+BDJOO
!!$*---""#####-1[-=-=-?-?###D		)r6c	t|j|jr:|jt|z|j|j|j|jfd|j	D|xjt|z
c_|S)a
Append another Text instance. This method is more performant that Text.append, but
        only works for Text.

        Args:
            text (Text): The Text instance to append to this instance.

        Returns:
            Text: Returns self for chaining.
        c3FK|]\}}}|z|z|VdSr8rQrzs    r4rz#Text.append_text.<locals>.<genexpr>sU

!sE
E%+%s['8%@@





r6)
r+rYr.rXrpr_rSrgrHro)r3r]rrs  @@r4append_textzText.append_textsl:	XKuu[+D		2I4:VVWWW
$*%%%




%)[%5%5%7%7


	
	
	
	
D		!r6tokensc
(|jj}|jj}t}t	|}|D]Y\}}t|}|||r&||||t	|z||t	|z
}Z||_|S)a)Append iterable of str and style. Style may be a Style instance or a str style definition.

        Args:
            tokens (Iterable[Tuple[str, Optional[StyleType]]]): An iterable of tuples containing str content and style.

        Returns:
            Text: Returns self for chaining.
        )rSrprXr+r_rrY)r3rr~rrr:contentr.s        r4
append_tokenszText.append_tokenssj'k(T$	#	#NGU)'22GK   
IEE&&3w<<*?GGHHHc'll"FFr6cD|j|jdS)zCopy styles from another Text instance.

        Args:
            text (Text): A Text instance to copy styles from, must be the same length.
        N)rXrH)r3r]s  r4copy_styleszText.copy_styless"	
4;'''''r6)rUallow_blank	separatorrUrcs
Jd|jvr"t|gS|rE|dt	jt	jD}nOdttffd}tfd||D}|s)	r|
|S)aSplit rich text in to lines, preserving styles.

        Args:
            separator (str, optional): String to split on. Defaults to "\\n".
            include_separator (bool, optional): Include the separator in the lines. Defaults to False.
            allow_blank (bool, optional): Return a blank line if the text ends with a separator. Defaults to False.

        Returns:
            List[RichText]: A list of rich text, one per line of the original.
        zseparator must not be emptyc3>K|]}|VdSr8rr~rs  r4rzText.split.<locals>.<genexpr>?s;   %		      r6r/c3KtjtjD]!}|\}}|V|V"dSr8)rrrr)rr,r-rr]s   r4
flatten_spansz!Text.split.<locals>.flatten_spansDs[[9)=)=tDDE!&JE3KKKIIIIr6c32K|]}|jk
|VdSr8rf)r~rrs  r4rzText.split.<locals>.<genexpr>Js8yAXAXAXAXAXAXr6)rgrrorrrrrrMrpop)r3rrUrrrr]s `    @r4r?z
Text.split's9"77777yzD  $))++'''	KK  )+RYy5I5I4)P)P   EE

8C=






!%]]__!=!=E	t}}Y77	IIKKKr6offsetsc	t|}|s"t|gS|jt	}dg||}tt||dd}|j|j|jttfd|D}|j
s|Sd|jD}t	|}t}	|j
D]\}
}d}|}
||
zdz}	||\}}|
|kr|dz
}
n
|
|kr|dz}nn	||
zdz}-||kr|}n4|x}}|}
	||\}}||kr|dz
}
n
||kr|dz}nn	||
zdz}-t||dzD]X}||\}}td|
|z
}t||z
||z
}||kr|||	||Y|S)zDivide text in to a number of lines at given offsets.

        Args:
            offsets (Iterable[int]): Offsets used to divide text.

        Returns:
            Lines: New RichText instances between offsets.
        rrNc3LK|]\}}||VdS))r.rTrUNrQ)r~r,r-rrTrUr.r]s   r4rzText.divide.<locals>.<genexpr>jsb

s

EU3Y!	








r6c&g|]}|jjSrQ)rXrprs  r4rzText.divide.<locals>.<listcomp>vsIII+IIIr6rv)r?rrorgr_rCr.rTrUr)rX_linesr+ranger%r<)r3r_offsetsrdivide_offsetsline_ranges	new_lines
_line_appends
line_countr
span_startspan_endlower_boundupper_bound
start_line_no
line_startline_endend_line_noline_no	new_startnew_endrrTrUr.r]s                     @@@@@r4rzText.divideSs==	($))++'''z$ii4h443~~abb/ABBCC
,=







*




	{	II	8HIII
%%
+/;$	M$	M'J%K$K(;61<M
A'2='A$
H
**"/!"3KK(**"/!"3KK!,{!:q @

A(""+,99k(C+6{+C(J*,,&1Ao!H,,&1Ao#.#<"BKC!a@@
M
M'27';$
H:
#:;;	h3X
5JKKY&&*M'*55GU+K+KLLL
Mr6ramountct|j|z
tfd|jD|jdd<|jd|g|_|xj|zc_dS)z7Remove a number of characters from the end of the text.c	g|]D}|jk
|jkr|n)|jt|j|jESrQrarbs  r4rz#Text.right_crop.<locals>.<listcomp>rdr6N)r_rgr+rXrSrY)r3rrrcs  @@r4rEzText.right_crops__v-









AAAj6'*+
r6rc`|p
|jpt}|p
|jpt}t	||jdp|dk}t
}	|dD]}
d|
vr|
||rt
|
g}n8tt|
||dk}|
|}|D]}
|
||r||||||D]}
|

||	|	||	S)
aCWord wrap the text.

        Args:
            console (Console): Console instance.
            width (int): Number of cells available per line.
            justify (str, optional): Justify method: "default", "left", "center", "full", "right". Defaults to "default".
            overflow (str, optional): Overflow method: "crop", "fold", or "ellipsis". Defaults to None.
            tab_size (int, optional): Default tab size. Defaults to 8.
            no_wrap (bool, optional): Disable wrapping, Defaults to False.

        Returns:
            Lines: Number of lines.
        Fr[TrrTr')r'r)rU)rTr&rUr(rrVrr?rXrrOrrr^rH)
r3rrrrTrUrWrVwrap_justify
wrap_overflowrrrrs
             r4rz	Text.wrapsd.A$,A/ EDME5E
GT\599QX=QJJ4J00	$	$Dt||  ***
1!4&MM		%c$ii]f=TUUU KK00	!
'
'&&&&
!!UL=""
=
=

em
<<<<LL####r6ct}|j}|D]"}||||#|S)zFit the text in to given width by chopping in to lines.

        Args:
            width (int): Maximum characters in a line.

        Returns:
            Lines: Lines container.
        )rrpr?r)r3rrrrprs     r4fitzText.fitsQwwJJLL		DOOE"""F4LLLLr6cdtjd|jtjD}	t	t
d|Dpd}n#t$rd}YnwxYw|S)zrAuto-detect indentation of code.

        Returns:
            int: Number of spaces used to indent code.
        cRh|]$}t|d%Sr)r_rrs  r4	<setcomp>z*Text.detect_indentation.<locals>.<setcomp>s:



A


r6
^( *)(.*)$rcg|]	}|dz|
S)rvrQ)r~indents  r4rz+Text.detect_indentation.<locals>.<listcomp>s"RRRvPQzRVRRRr6r)rrrg	MULTILINErrr)r3
_indentationsindentations   r4detect_indentationzText.detect_indentations

]DJblSSS



	sRR-RRRSSXWX
K			KKK	s!AA#"A#u│z	dim green)rfr.indent_sizec||n|}|}||d|dz
z}tjd}g}|j}	d}
|dD]}||j}|r|	ds|
dz
}
9|	d}
tt|
|\}}||zd|z}||jt|dz|_||dt||
r*|
t||	g|
zd}
|	||
r(|
td
|	g|
z|d|}|S)uAdds indent guide lines to text.

        Args:
            indent_size (Optional[int]): Size of indentation, or None to auto detect. Defaults to None.
            character (str, optional): Character to use for indentation. Defaults to "│".
            style (Union[Style, str], optional): Style of indent guides.

        Returns:
            Text: New text with indentation guides.
        NrjrrrTrrvr+rZr[)rrorXrrrpr?rrgrdivmodr_rrHr)rr)r3rrfr._indent_sizer]indent_line	re_indentradd_lineblank_linesrrrfull_indentsremaining_space
new_indentrs                  r4with_indent_guideszText.with_indent_guidess$5@4Gt..000[yy{{">C<!+;$<>>J}--	 "	#JJ4J00
	
	DOODJ//E
A
q [[^^F,23v;;,M,M)L/',6Oo8MOOJ#djZ1B1B&CCDJLL3z??333
   $z"?"?"?!@;!NOOOHTNNNN	Dd2U3334{BCCC??4((--i88r6)rZrZ)rZ)r/r))rNr8)r/N)rj)r]r)r/r))r]r)r/N)r[r)SrIrJrKrL	__slots__rOrrrrPrMrr+rarcr9rhr5rrsobjectrvrxryrpropertyrrclassmethodrrrr rrr
rrgsetterr\rrorrrrrrrrGetStyleCallablerrrr	rrrrrr(rrrXr^rrYrorrrqrpr~rrrr?rrErrrrrQr6r4r)r)vs



I#%0
.2/3"&"&&*0000S%Z 0
/*0+,
0$003-0T
#0
0000."$""""G#GGGGSVIFItIIII
&TIsEz!2IvIIII4$#$$$X$X:
$&04-1/3S%Z 	
 -
/*+,
[B
$&-1/3"&"#####S%Z 	#
/*#+,
#$##3-#
###[#J
.2/3

/*+,

[0$&-1/3"&)-+++c65i#889+S%Z +/*	+
+,+$
+++tCH~&+
+++[+ZsX\#c#d###\#tDzX\4:$\V"!	EES%Z EEc]	E

EEEE:!	HHS%Z HHc]	H

HHHH6JN22cN2+.29A#2	
2222xS#X/CF()C)D))))9ce(%3%4%%%%0?C&
&&&GCL#-.&.	9:;&
&


&&&&Z $}S%Z 



:))))?s?t????5S5T5555; ;+;;	'	;;;;&
; 
;+;
;	
;
;
;
;9 9 i9 c9 8I;N9 9 9 9 v%(6*%v%%%%N('('HSM('T('('('('\04////+,	/
/

////6



t"ccD 	<	<s	<s	<T	<	<	<	<77;7s7s7T7777*PT**&#+&*/7c7l8K/L*	****X,uS(9*=%=>?	0((((*#(!**** 	*
*

****XMhsmMMMMM^T*.2/3"&.....
/*.+,
..$.
....` C.&*.&...c].	.
.

......r6__main__)r!a
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Loremboldipsumitaliczjustify='left'redr+zjustify='center'greenru)r.rTzjustify='right'bluerightzjustify='full'magentafull)Cr	functoolsrrmathroperatorrtypingrrr	r
rrr
rrrr_loopr_pickr_wraprrqrrFrr
containersrcontrolrrrjupyterrmeasurersegmentrr.rr rr!r"r#r$r&rNr(rrrOTextTyperr+r)rIpip._vendor.rich.consoler]rruleprintrQr6r4<module>rs					%%%%%%%%********((((((!!!!!!      ########POOOOOOOOOOOO#,,,,%+"+++G$$f1SE8I#667DDDDD:DDDN<D&z0000004	PD	'F+++'H---giiGLL!"""MM$eM$$$MMOOOLL#$$$MM$gxM888MMOOOLL"###MM$fgM666MMOOOLL!"""MM$iM888MMOOOOO3r6
Back to Directory File Manager