8fe UddlZddlZddlZddlZddlZddlZddlmZmZddl m Z m Z ddl m Z ddl mZddlmZddlmZddlmZdd lmZdd lmZdd lmZdd lmZmZmZdd lmZmZm Z m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,ddl-m.Z.ej/dkr ddlm0Z0m1Z1m2Z2n ddl3m0Z0m1Z1m2Z2ddl4m5Z5m6Z6ddl7m7Z7ddl8m9Z9m:Z:ddl;mZ>m?Z?ddl@mAZAmBZBddlCmDZDmEZEddlFmGZGddlHmIZIddlJmKZKmLZLddlMmNZOddlPmQZQmRZRddlSmTZTmUZUddlVmWZWmXZXdd lYmZZZdd!l[m\Z\dd"l]m^Z^dd#l_m`Z`dd$lambZbdd%lcmdZdmeZedd&lfmgZgdd'lhmiZimjZjmkZkdd(llmmZmmnZndd)lompZpmqZqerdd*lrmsZsdd+ltmuZudd,lvmwZwd-Zxd.Zyejzd/kZ{e!e+e|d0fgd0fZ}e0d1Z~e0d2ZGd3d4ZeZ ejZn #e$rdZYnwxYw ejZn #e$rdZYnwxYw ejZn #e$rd5ZYnwxYweeefZeefZeDjeDjeDjd6ZGd7d8e&Ze Gd9d:Ze2Gd;de1Ze+eee|fZ e#e+eebfZeKZGd?d@eZGdAdBZGdCdDZGdEdFZGdGdHZGdIdJZGdKdLZGdMdNZddPedQe!dRe!dRefffdSZdQefdTZeDjeDjeDjeDj{dUZdVeDZe GdWdXejZGdYdZeZdae'd[ed\<dd]ZdQefd^ZGd_d`Zdae|dQe|fdbZedckredOdZededfdgdOdhddidjdkdldmdndoedpdqeeedgdOdrgdsdtdudvdhdwgdxdydudzgd{d|dud}d~ddSdS)N)ABCabstractmethod) dataclassfield)datetime)wraps)getpass)escape)isclass)islice)ceil) monotonic) FrameType ModuleType TracebackType)IO TYPE_CHECKINGAnyCallableDictIterableListMapping NamedTupleOptionalTextIOTupleTypeUnioncast) NULL_FILE))LiteralProtocolruntime_checkable)errorsthemes)_emoji_replace)CONSOLE_HTML_FORMATCONSOLE_SVG_FORMAT) get_fileno)FormatTimeCallable LogRender)Align AlignMethod) ColorSystem blend_rgb)Control) EmojiVariant)NullHighlighterReprHighlighterrender) Measurementmeasure_renderables)Pager SystemPager)Pretty is_expandable) rich_cast)Region) render_scope)Screen)Segment)Style StyleTypeStyled)DEFAULT_TERMINAL_THEMESVG_EXPORT_THEME TerminalTheme)TextTextType)Theme ThemeStack)WindowsConsoleFeatures)LiveStatussdWindowsrL)defaultleftcenterrightfull)foldcropellipsisignoreceZdZdS)NoChangeN)__name__ __module__ __qualname__x/builddir/build/BUILD/imunify360-venv-2.3.5/opt/imunify360/venv/lib/python3.11/site-packages/pip/_vendor/rich/console.pyraraVsDrfra)kitty256color16colorc*eZdZUdZeed< eed<dS)ConsoleDimensionszSize of the terminal.widthheightN)rbrcrd__doc__int__annotations__rerfrgrmrmts- JJJ. KKK--rfrmceZdZUdZeed< eed< eed< eed< eed< eed< eed< d Z e e ed < d Z e e ed < d Ze eed < d Ze eed< d Ze eed< d Ze eed<edefdZddZeeeeeeeeed deeefdeeefdeeefd ee e efd ee e efd ee eefdee eefdee eefdee eefddfdZdeddfdZdeddfdZddZdededdfdZd S)ConsoleOptionsz$Options for __rich_console__ method.sizelegacy_windows min_width max_width is_terminalencoding max_heightNjustifyoverflowFno_wrap highlightmarkuproreturnc8|jd S)z+Check if renderables should use ascii only.utf)rz startswithselfs rg ascii_onlyzConsoleOptions.ascii_onlys=++E2222rfctt}|j|_|S)zdReturn a copy of the options. Returns: ConsoleOptions: a copy of self. )rt__new____dict__copyroptionss rgrzConsoleOptions.copys2 #1"8"8"H"H=--//rf) rnrwrxr|r}r~rrrornc |} t|tstd|x| _| _t|ts|| _t|ts|| _t|ts|| _t|ts|| _t|ts|| _t|ts|| _ t|ts|| _ t| ts"| | | _ | dntd| | _ | S)zUpdate values, return a copy.rN) r isinstanceramaxrwrxr|r}r~rrr{ro) rrnrwrxr|r}r~rrrors rgupdatezConsoleOptions.updates,))++%** B475MM AG  1)X.. * )G )X.. * )G '8,, &%GO(H-- ('G '8,, &%GO)X.. * )G &(++ $#GN&(++ H!%+"%+^TTQGNrfcf|}td|x|_|_|S)zUpdate just the width, return a copy. Args: width (int): New width (sets both min_width and max_width) Returns: ~ConsoleOptions: New console options instance. r)rrrwrx)rrnrs rg update_widthzConsoleOptions.update_widths.))++03Au =G-rfcJ|}|x|_|_|S)zUpdate the height, and return a copy. Args: height (int): New height Returns: ~ConsoleOptions: New Console options instance. )rr{ro)rrors rg update_heightzConsoleOptions.update_heights%))++.44W^rfc<|}d|_|S)zReturn a copy of the options with height set to ``None``. Returns: ~ConsoleOptions: New console options instance. N)rrors rg reset_heightzConsoleOptions.reset_heights ))++rfc|}td|x|_|_|x|_|_|S)aUpdate the width and height, and return a copy. Args: width (int): New width (sets both min_width and max_width). height (int): New height. Returns: ~ConsoleOptions: New console options instance. r)rrrwrxror{)rrnrors rgupdate_dimensionsz ConsoleOptions.update_dimensionss=))++03Au =G-.44+rf)rrt)rbrcrdrprmrrboolrqstrr|r JustifyMethodr}OverflowMethodr~rrropropertyrr NO_CHANGErrarrrrrrerfrgrtrt}s.. 2NNN&NNN&<MMMOOO2'+GXm $+++0)-Hh~&---1#GXd^###$ $Ix~$$$,!FHTN!!!/ FHSM    3D333X3'0*3*3G3<5>2;1:###S(]##h' # h' # x .89 #0(:;#x~x/0#$12#htnh./#hsmX-.# ####J # *:     C ,<     s C .decorator.._replaces* &$1&11K+/3// /rf)rrr)rrr s` rg decoratorzgroup..decoratorsU v 0C 03 05 0 0 0 0 0 0  0rf)rrr r)r rs` rggrouprsQ h~667  #u*        rfc tn#t$rYdSwxYwt}|jj}dt |jvst jds|dkrdS|dkrdSdS)z-Check if we're running in a Jupyter notebook.Fz google.colabDATABRICKS_RUNTIME_VERSIONZMQInteractiveShellTTerminalInteractiveShell) get_ipython NameError __class__rbrosgetenv)ipythonshells rg _is_jupyterr*s uummG   &E#g/0000 91 2 2 1 ) ) )t , , ,uus  )standard256 truecolorwindowsci|]\}}|| Srere).0namesystems rg r3!sOOOvOOOrfcZeZdZUdZeed<eeZe e ed<dZ e ed<dS)ConsoleThreadLocalsz(Thread local values for Console context. theme_stack)default_factoryrr buffer_indexN) rbrcrdrprOrrrrrrrDr8rqrerfrgr5r5$sU22!E$777FDM777L#rfr5cJeZdZdZedeedeefdZdS) RenderHookz(Provides hooks in to the render process.rrcdS)aLCalled with a list of objects to render. This method can return a new list of renderables, or modify and return the same list. Args: renderables (List[ConsoleRenderable]): A number of renderable objects. Returns: List[ConsoleRenderable]: A replacement list of renderables. Nre)rrs rgprocess_renderableszRenderHook.process_renderables0srfN)rbrcrdrprrrr<rerfrgr:r:-sT22   12       ^    rfr:rP_windows_console_featurescLttSddlm}|atS)Nr'get_windows_console_features)r=_windowsr@r?s rgr@r@Cs5 ,((666666 < < > > $$rfc8totj S)zDetect legacy Windows.)WINDOWSr@vtrerfrgdetect_legacy_windowsrEMs  <799<<e-d?e-d(dfd@Z.ddAZ/d(efdBZ0ddCdedDe d(dfdEZ1ddFZ2ddCdedDe d(e3fdGZ4ed(e efdHZ5ed(efdIZ6ed(e fdJZ7ed(e fdKZ8ed(e9fdLZ:ed(e;fdMZe>jded(dfdQZ>ed(efdRZ?e?jded(dfdSZ?ddTZ@d(eAfdUZB ddVe eCdWe dXe d(eDfdYZEdd[ed(dfd\ZFdd]e d(dfd^ZGd_d`dadbdcddeHdeedfedgedhed(dif djZIddke d(e fdlZJddme d(e fdnZKed(e fdoZLdped(e fdqZM ddre de ed(dsfdtZNddudveHdwe e9d(eOfdxZP ddveHdwe e9d(eQefdyZR dddddzdveHdwe e9de eSd{e d|e d(eeef d}ZTd~ddddddddedeeeSfde eUde eVde e de e de e d!e eWd(dfdZXdddeeeSfde eeSefd(eSfdZYddddddeQe-dedede eUde e de e de e d(eeZfdZ[ ddddddpe\dedeeeSfde]d(df dZ^de_d(dfdZ`dddddde-dedede eeeSfde e d(df dZadddddddddddddddde-dedede eeeSfde eUde eVde e de e de e de e de ede ede de e de d(df dZb ddddddddddd de ede-dedeefde de de de de de ee-ge-fde d(dfdZcddddveHde eddwe e9d(dfdZe ddeeededed(dfdZfddddddddde edede ede de deQeeegfded(dfdZheiejjkfdedege elfd(e=eeemee-fffdZndddddddddZd de-dedede eeeSfde eUde e de e de e de ded(dfdÄZoddĄZpdeQed(efdƄZq ddddddǜde\de de de de erd(ef d˄Zsddd̜de dWe d(efd΄Ztddd̜dede dWe d(dfdЄZudddddќde evde de ede d(ef dԄZwddexddќdede evde dede d(df dՄZydddezddd؜dpede evde dedede ed(efdۄZ{dddezddd؜dedpede evde dedede ed(dfd܄Z|dS)rar A high level console interface. Args: color_system (str, optional): The color system supported by your terminal, either ``"standard"``, ``"256"`` or ``"truecolor"``. Leave as ``"auto"`` to autodetect. force_terminal (Optional[bool], optional): Enable/disable terminal control codes, or None to auto-detect terminal. Defaults to None. force_jupyter (Optional[bool], optional): Enable/disable Jupyter rendering, or None to auto-detect Jupyter. Defaults to None. force_interactive (Optional[bool], optional): Enable/disable interactive mode, or None to auto detect. Defaults to None. soft_wrap (Optional[bool], optional): Set soft wrap default on print method. Defaults to False. theme (Theme, optional): An optional style theme object, or ``None`` for default theme. stderr (bool, optional): Use stderr rather than stdout if ``file`` is not specified. Defaults to False. file (IO, optional): A file object where the console should write to. Defaults to stdout. quiet (bool, Optional): Boolean to suppress all output. Defaults to False. width (int, optional): The width of the terminal. Leave as default to auto-detect width. height (int, optional): The height of the terminal. Leave as default to auto-detect height. style (StyleType, optional): Style to apply to all output, or None for no style. Defaults to None. no_color (Optional[bool], optional): Enabled no color mode, or None to auto detect. Defaults to None. tab_size (int, optional): Number of spaces used to replace a tab character. Defaults to 8. record (bool, optional): Boolean to enable recording of terminal output, required to call :meth:`export_html`, :meth:`export_svg`, and :meth:`export_text`. Defaults to False. markup (bool, optional): Boolean to enable :ref:`console_markup`. Defaults to True. emoji (bool, optional): Enable emoji code. Defaults to True. emoji_variant (str, optional): Optional emoji variant, either "text" or "emoji". Defaults to None. highlight (bool, optional): Enable automatic highlighting. Defaults to True. log_time (bool, optional): Boolean to enable logging of time by :meth:`log` methods. Defaults to True. log_path (bool, optional): Boolean to enable the logging of the caller by :meth:`log`. Defaults to True. log_time_format (Union[str, TimeFormatterCallable], optional): If ``log_time`` is enabled, either string for strftime or callable that formats the time. Defaults to "[%X] ". highlighter (HighlighterType, optional): Default highlighter. legacy_windows (bool, optional): Enable legacy Windows mode, or ``None`` to auto detect. Defaults to ``None``. safe_box (bool, optional): Restrict box options that don't render on legacy Windows. get_datetime (Callable[[], datetime], optional): Callable that gets the current time as a datetime.datetime object (used by Console.log), or None for datetime.now. get_time (Callable[[], time], optional): Callable that gets the current time in seconds, default uses time.monotonic. _environautoNFr#Tz[%X]) color_systemforce_terminal force_jupyterforce_interactive soft_wraprstderrfilequietrnrorno_colortab_sizerecordremoji emoji_variantrlog_timelog_pathlog_time_format highlighterrvsafe_box get_datetimeget_timerGrI)rHr+r,r-r.rJrKrLrMrrNrOrPrnrorrQrRrSrrTrUrrVrWrXrYHighlighterTypervrZr[r\c|||_|tn||_|jr| G|jd}|$|rt |} nt } | G|jd}|$|rt |} nt} ||_||_ ||_ ||_ ||_ ||_ |to|j n||_| G|jd}|+|rt ||jz } | ?|jd} | #| rt | } ||_| |_| |_|d|_|||_||_| |_||_|d|_n2|dkr||_nt2||_t5j|_t;||||_|pt>|_ ||_!|p tDj#|_$|ptJ|_&| |_'| | nd|jv|_(||j)o|j* n||_+t5j|_,t[t]| t^j0n||_1g|_2g|_3d|_4d |_5dS) NJUPYTER_COLUMNS JUPYTER_LINESCOLUMNSLINESrH) show_time show_path time_formatNO_COLOR)r6F)6rGr* is_jupyterrisdigitrqJUPYTER_DEFAULT_COLUMNSJUPYTER_DEFAULT_LINESrRrS_markup_emoji_emoji_variant _highlightrErvrM_width_height_force_terminal_filerPrN _color_system_detect_color_system COLOR_SYSTEMS threadingRLockrr/ _log_render_null_highlighterrYrZrnowr[rr\rrQryis_dumb_terminalis_interactive_record_buffer_lockr5rOr)DEFAULT_thread_locals_record_buffer _render_hooks_live_is_alt_screen)!rrIrJrKrLrMrrNrOrPrnrorrQrRrSrrTrUrrVrWrXrYrvrZr[r\rGjupyter_columns jupyter_linescolumnsrs! rgrzConsole.__init__xsF  $DM+8+@+---m ? 3}"&-"3"34E"F"F".?3J3J3L3L.00EE3E~ $ 1 1/ B B  ,1F1F1H1H, //FF2F     6C#%# $ $ M%%g..E U]]__ U"   1#  %#1D     !%D   V # #!%!:!:!>NN   .0/1'+ #rfrc(d|jd|jdS)Nz)rnrsrs rg__repr__zConsole.__repr__s EEEd.@EEEErfc|jp|jr tjn tj}t |d|}|t }|S)z Get the file object to write to.rich_proxied_file)rrrNsysstdoutgetattrr!)rrOs rgrOz Console.files@zHDKGcjjSZt0$77 <D rfnew_filec||_dS)zSet a new file object.N)rr)rrs rgrOz Console.files rfc|jjSzGet a thread local buffer.)rrrs rgrzConsole._buffers"))rfc|jjSrrr8rs rg _buffer_indexzConsole._buffer_index s"//rfvaluec||j_dSrr)rrs rgrzConsole._buffer_indexs+0(((rfc|jjS)z!Get the thread local theme stack.)rr6rs rg _theme_stackzConsole._theme_stacks"..rfcr|jr tjS|jr|jrdSt r@|jr tjSt}|jr tjn tj S|j dd }|dvr tjS|j dd }|d\}}}t |tj}|S)z"Detect color system from env vars.N COLORTERMr)r-24bitTERM-)rgr2 TRUECOLORryr{rCrvr@r- EIGHT_BITrGrstriplower rpartition _TERM_COLORSSTANDARD)rwindows_console_features color_termterm _term_name_hyphencolorsrIs rgrtzConsole._detect_color_systems" ? )( ( 4#8 4  " +"**'C'E'E $,5+ %% *  **;;;AACCIIKKJ333",,=$$VR006688>>@@D*.//#*>*> 'J'++FK4HIIL rfc&|xjdz c_dS)z4Enter in to a buffer context, and buffer all output.r'N)rrs rgrzConsole._enter_buffer0s arfcN|xjdzc_|dS)z5Leave buffer context, and render content if required.r'N)r _check_bufferrs rgrzConsole._exit_buffer4s. a rfliverQc|j5|jtjd||_ddddS#1swxYwYdS)zSet Live instance. Used by Live context manager. Args: live (Live): Live instance using this Console. Raises: errors.LiveError: If this Console has a Live context currently active. Nz+Only one live display may be active at once)rrr( LiveError)rrs rgset_livezConsole.set_live9sZ  z%&'TUUUDJ                  s #8<<cT|j5d|_ddddS#1swxYwYdS)zClear the Live instance.N)rrrs rg clear_livezConsole.clear_liveGsu Z  DJ                  s !!hookcz|j5|j|ddddS#1swxYwYdS)zpAdd a new render hook to the stack. Args: hook (RenderHook): Render hook instance. N)rrappend)rrs rgpush_render_hookzConsole.push_render_hookLs Z , ,   % %d + + + , , , , , , , , , , , , , , , , , ,s 044cx|j5|jddddS#1swxYwYdS)z'Pop the last renderhook from the stack.N)rrpoprs rgpop_render_hookzConsole.pop_render_hookUs Z % %   " " $ $ $ % % % % % % % % % % % % % % % % % %s /33c.||S)z,Own context manager to enter buffer context.rrs rgrzConsole.__enter__Zs  rfr exc_value tracebackc.|dS)zExit buffer context.N)r)rrrrs rgrzConsole.__exit___s rfc.|dS)z`Begin capturing console output. Call :meth:`end_capture` to exit capture mode and return output.Nrrs rgrzConsole.begin_capturecs rfcv||j}|jdd=||S)zhEnd capture mode and return captured string. Returns: str: Console output. N)rrr)r render_results rgrzConsole.end_capturegs> ++DL99 LO rfrrc>|j||dS)aPush a new theme on to the top of the stack, replacing the styles from the previous theme. Generally speaking, you should call :meth:`~rich.console.Console.use_theme` to get a context manager, rather than calling this method directly. Args: theme (Theme): A theme instance. inherit (bool, optional): Inherit existing styles. Defaults to True. rN)rrrrrs rgrzConsole.push_themers& $$UG$<<<<ED' ' 'DKl*FF    s$A++BBB++CCnew_sizec,|\}}||_||_dS)zvSet a new size for the terminal. Args: new_size (Tuple[int, int]): New width and height. N)rorp)rrrnros rgruz Console.sizes! v  rfc|jjS)zsGet the width of the console. Returns: int: The width (in characters) of the console. )rurnrs rgrnz Console.widthsyrfc||_dS)zFSet width. Args: width (int): New width. N)ro)rrns rgrnz Console.width"s rfc|jjS)zpGet the height of the console. Returns: int: The height (in lines) of the console. )rurors rgrozConsole.height+syrfc||_dS)zISet height. Args: height (int): new height. N)rp)rros rgrozConsole.height4s rfcR|tjdS)z3Play a 'bell' sound (if supported by the terminal).N)controlr4bellrs rgrz Console.bell=s  W\^^$$$$$rfc$t|}|S)aA context manager to *capture* the result of print() or log() in a string, rather than writing it to the console. Example: >>> from rich.console import Console >>> console = Console() >>> with console.capture() as capture: ... console.print("[bold magenta]Hello World[/]") >>> print(capture.get()) Returns: Capture: Context manager with disables writing to the terminal. )r)rcaptures rgrzConsole.captureAs$--rfrrrc(t||||S)aA context manager to display anything printed within a "pager". The pager application is defined by the system and will typically support at least pressing a key to scroll. Args: pager (Pager, optional): A pager object, or None to use :class:`~rich.pager.SystemPager`. Defaults to None. styles (bool, optional): Show styles in pager. Defaults to False. links (bool, optional): Show links in pager. Defaults to False. Example: >>> from rich.console import Console >>> from rich.__main__ import make_test_card >>> console = Console() >>> with console.pager(): console.print(make_test_card()) Returns: PagerContext: A context manager. )rrr)r)rrrrs rgrz Console.pagerRs*DfEJJJJrfr'rcj|dks Jd|t|dS)zqWrite new line(s). Args: count (int, optional): Number of new lines. Defaults to 1. rzcount must be >= 0N)rrrs rgrz Console.lineis6zzz/zzz 75>>"""""rfhomec|r:|tjtjdS|tjdS)zClear the screen. Args: home (bool, optional): Also move the cursor to 'home' position. Defaults to True. N)rr4clearr)rrs rgrz Console.clearssP  * LL',.. 9 9 9 9 9 LL ) ) ) ) )rfdotszstatus.spinnerg?g)@)spinner spinner_stylespeedrefresh_per_secondstatusrrrrrSc4ddlm}|||||||}|S)atDisplay a status and spinner. Args: status (RenderableType): A status renderable (str or Text typically). spinner (str, optional): Name of spinner animation (see python -m rich.spinner). Defaults to "dots". spinner_style (StyleType, optional): Style of spinner. Defaults to "status.spinner". speed (float, optional): Speed factor for spinner animation. Defaults to 1.0. refresh_per_second (float, optional): Number of refreshes per second. Defaults to 12.5. Returns: Status: A Status object that may be used as a context manager. r'rR)rrrrr)rrS)rrrrrrrSstatus_renderables rgrzConsole.status~sG* #""""""F '1    ! rfrcf|jr)|tj|dSdS)zqShow or hide the cursor. Args: show (bool, optional): Set visibility of the cursor. TF)ryrr4r)rrs rgrzConsole.show_cursors6    LL,T22 3 3 34urfenablecd}|jr7|js0|tj|d}||_|S)aEnables alternative screen mode. Note, if you enable this mode, you should ensure that is disabled before the application exits. See :meth:`~rich.Console.screen` for a context manager that handles this for you. Args: enable (bool, optional): Enable (True) or disable (False) alternate screen. Defaults to True. Returns: bool: True if the control codes were written. FT)ryrvrr4 alt_screenr)rrchangeds rgrzConsole.set_alt_screensM   )D$7 ) LL+F33 4 4 4G"(D rfc|jS)zCheck if the alt screen was enabled. Returns: bool: True if the alt screen was enabled, otherwise False. )rrs rg is_alt_screenzConsole.is_alt_screens ""rftitlecf|jr)|tj|dSdS)aSet the title of the console terminal window. Warning: There is no means within Rich of "resetting" the window title to its previous value, meaning the title you set will persist even after your application exits. ``fish`` shell resets the window title before and after each command by default, negating this issue. Windows Terminal and command prompt will also reset the title for you. Most other shells and terminals, however, do not do this. Some terminals may require configuration changes before you can set the title. Some terminals may not support setting the title at all. Other software (including the terminal itself, the shell, custom prompts, plugins, etc.) may also set the terminal window title. This could result in whatever value you write using this method being overwritten. Args: title (str): The new title of the terminal window. Returns: bool: True if the control code to change the terminal title was written, otherwise False. Note that a return value of True does not guarantee that the window title has actually changed, since the feature may be unsupported/disabled in some terminals. TF)ryrr4r)rrs rgset_window_titlezConsole.set_window_titles56    LLu-- . . .4urfrrc*t|||pdS)auContext manager to enable and disable 'alternative screen' mode. Args: hide_cursor (bool, optional): Also hide the cursor. Defaults to False. style (Style, optional): Optional style for screen. Defaults to None. Returns: ~ScreenContext: Context which enables alternate screen on enter, and disables it on exit. r)rr)r)rrrs rgrzConsole.screensT{%+2NNNNrfrrrc@tj||p|j|}|S)aMeasure a renderable. Returns a :class:`~rich.measure.Measurement` object which contains information regarding the number of characters required to print the renderable. Args: renderable (RenderableType): Any renderable or string. options (Optional[ConsoleOptions], optional): Options to use when measuring, or None to use default options. Defaults to None. Returns: Measurement: A measurement of the renderable. )r:rr)rrr measurements rgmeasurezConsole.measures$"odG,Ct|ZPP rfc#K|p|j}|jdkrdSt|}t|dr&t |s|||}nft |tr9|||j |j }|||}ntj d|d t|}n&#t$rtj d|dwxYwt}|}|D]3}t ||r|V|||Ed{V4dS) akRender an object in to an iterable of `Segment` instances. This method contains the logic for rendering objects with the console protocol. You are unlikely to need to use it directly, unless you are extending the library. Args: renderable (RenderableType): An object supporting the console protocol, or an object that may be converted to a string. options (ConsoleOptions, optional): An options object, or None to use self.options. Defaults to None. Returns: Iterable[Segment]: An iterable of segments that may be rendered. r'Nr)rrzUnable to render zC; A str, Segment or object with __rich_console__ method is requiredzobject z is not renderable)rrxr@rr rrr render_strrrr(NotRenderableErroriter TypeErrorrDrr9) rrr_optionsrender_iterabletext_renderable iter_render_Segment render_outputs rgr9zConsole.renders"*dl   ! ! Fz** :1 2 2 7:;N;N (99$IIOO  C ( ( "ooh&8.O.>>tXNNOO+TJTTT   //KK   +?/???  ((**( @ @M-22 @#####;;}h??????????  @ @s C#C8)rpad new_linesrrc X|j5|p|j}|||}|rtj||}|j}|t d|}tttj ||j |||d|} |jx|jt| z } | dkr[|r'td|j z|tdgntd|j z|gg} | | | z| cdddS#1swxYwYdS)aGRender objects in to a list of lines. The output of render_lines is useful when further formatting of rendered console text is required, such as the Panel class which draws a border around any renderable object. Args: renderable (RenderableType): Any object renderable in the console. options (Optional[ConsoleOptions], optional): Console options, or None to use self.options. Default to ``None``. style (Style, optional): Optional style to apply to renderables. Defaults to ``None``. pad (bool, optional): Pad lines shorter than render width. Defaults to ``True``. new_lines (bool, optional): Include " " characters at end of lines. Returns: List[List[Segment]]: A list of lines, where a line is a list of Segment objects. Nr)include_new_linesrrrr) rrr9rD apply_stylerorrr split_and_crop_linesrxrextend) rrrrrrrender_options _rendered render_heightr extra_linespad_lines rg render_lineszConsole.render_lines:s0Z! ! $4 N J??I B#/ 5AA *1M( #A} 5 5 0!&0*3# !    E$0,3c%jj@ ??%N~'?!?GGQUWW%cN,D&DeLLM H LLK!7888C! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! sD DD#&D#r)rr|r}rTrrrYtextr|r}rLcx|p |duo|j} |p |duo|j} |p |duo|j} | r't||| |j} || _|| _n+t| rt||jn||||} | r |p|j nd} | /| t| }| | |S| S)aConvert a string to a Text instance. This is called automatically if you print or log a string. Args: text (str): Text to render. style (Union[str, Style], optional): Style to apply to rendered text. justify (str, optional): Justify method: "default", "left", "center", "full", or "right". Defaults to ``None``. overflow (str, optional): Overflow method: "crop", "fold", or "ellipsis". Defaults to ``None``. emoji (Optional[bool], optional): Enable emoji, or ``None`` to use Console default. markup (Optional[bool], optional): Enable markup, or ``None`` to use Console default. highlight (Optional[bool], optional): Enable highlighting, or ``None`` to use Console default. highlighter (HighlighterType, optional): Optional highlighter to apply. Returns: ConsoleRenderable: Renderable object. N)rrTrU)default_variant)r|r}r) rlrkrn render_markuprmr|r}rLr*rYr copy_styles)rr$rr|r}rTrrrY emoji_enabledmarkup_enabledhighlight_enabled rich_text _highlighterhighlight_texts rgr zConsole.render_strus8@%4-"?DK DFdN$Ct|%P)t*;*O  %#"1 I !(I !)I   tT5HIIII! I=NW 7t'7SW  #)\#i..99N  & &y 1 1 1! !rf)rWr1rWcht|tr|S |j|}|tj|}|jr|n|S#tj$r<}|| |cYd}~Stj d|d|dd}~wwxYw)a Get a Style instance by its theme name or parse a definition. Args: name (str): The name of a style or a style definition. Returns: Style: A Style object. Raises: MissingStyle: If no style could be parsed from name. NzFailed to get style z; ) rrErrparselinkrr(StyleSyntaxError get_style MissingStyle)rr1rWrerrors rgr3zConsole.get_styles dE " " K %))$//E} D))#(:85::<<<5 8&   "~~g........%8t8888  s$A A&&B15B, B1B,,B1r|rTrrobjectsseprc g}|jgj} dvrdtddffd } | t} |s ||jr|j} d fd } |D]} t | } t | tr#| || ||| It | tr | | jt | tr| | t| r%| t| | | | t| | |j (||j fd |D}|S) aCombine a number of renderables and text into one renderable. Args: objects (Iterable[Any]): Anything that Rich can render. sep (str): String to write between print data. end (str): String to write at end of print data. justify (str, optional): One of "left", "right", "center", or "full". Defaults to ``None``. emoji (Optional[bool], optional): Enable emoji code, or ``None`` to use console default. markup (Optional[bool], optional): Enable markup, or ``None`` to use console default. highlight (Optional[bool], optional): Enable automatic highlighting, or ``None`` to use console default. Returns: List[ConsoleRenderable]: A list of things to render. )rXrYrZrrNc `t|ttdSr)r0r r1)r_appendr|s rg align_appendz2Console._collect_renderables..align_appends-j${G*D*DEEFFFFFrfcrFt}|dSdS)N)r|r)rLjoinr)sep_textrrr|r8r$s rg check_textz0Console._collect_renderables..check_textsV W#>>>x}}T**+++   rf)rTrrY)rYc0g|]}t|SrerGr0rrs rg z0Console._collect_renderables..s#SSS6*e44SSSrfrN)rr ryrnrYr@rrr rLrr?r>rr3)rr7r8rr|rTrrr append_textr<r-r@rr;rrr$s ``` @@@@rg_collect_renderableszConsole._collect_renderabless,202 $k  1 1 1 G GD G G G G G G G"F(9  ,*t*+L           " ; ;J":..J*c** ; OO"%L$ J-- ; J''''J(9:: ; z""""z** ; vjlCCCDDDD LLZ99:::: : !NN4:..ESSSS{SSSKrfu─z rule.linerY) charactersralignrGrHcZddlm}|||||}||dS)uDraw a line with optional centered title. Args: title (str, optional): Text to render over the rule. Defaults to "". characters (str, optional): Character(s) to form the line. Defaults to "─". style (str, optional): Style of line. Defaults to "rule.line". align (str, optional): How to align the title, one of "left", "center", or "right". Defaults to "center". r')Rule)rrGrrHN)rulerJr)rrrGrrHrJrKs rgrKz Console.rulesF t%Je5QQQ 4rfrc|jsA|5|jd|DddddS#1swxYwYdSdS)zInsert non-printing control codes. Args: control_codes (str): Control codes, such as those that may move the cursor. c3$K|] }|jV dSr)segment)r0_controls rg z"Console.control..6s%#M#MH$4#M#M#M#M#M#MrfN)r{rr)rrs rgrzConsole.control.s $ N N N ###M#MW#M#M#MMMM N N N N N N N N N N N N N N N N N N N Ns%<AArr)r8rrrc |d|D}||||ddddd| dS)aOutput to the terminal. This is a low-level way of writing to the terminal which unlike :meth:`~rich.console.Console.print` won't pretty print, wrap text, or apply markup, but will optionally apply highlighting and a basic style. Args: sep (str, optional): String to write between print data. Defaults to " ". end (str, optional): String to write at end of print data. Defaults to "\\n". style (Union[str, Style], optional): A style to apply to output. Defaults to None. highlight (Optional[bool], optional): Enable automatic highlighting, or ``None`` to use console default. Defaults to ``None``. c34K|]}t|VdSr)r)r0_objects rgrPzConsole.out..Ks("G"GG3w<<"G"G"G"G"G"GrfFTr_)rrrTrr~r}r]rN)r>r)rr8rrrr7 raw_outputs rgoutz Console.out8sd&(("G"Gw"G"G"GGG    rf)r8rrr|r}r~rTrrrnror]rMnew_line_startr~r]rVc |stf}| |j} | r |d}|d}d} |jdd}|5|||||||| }|D]}||}|j||| t| |jnt| ||| }g}|j }|j }||D]}||||n@|D]=}|tj |||||>|ritdd|Dd kr'|d tj| r7|jj }tj||jd D] }||n|j |ddddS#1swxYwYdS) a[Print to the console. Args: objects (positional args): Objects to log to the terminal. sep (str, optional): String to write between print data. Defaults to " ". end (str, optional): String to write at end of print data. Defaults to "\\n". style (Union[str, Style], optional): A style to apply to output. Defaults to None. justify (str, optional): Justify method: "default", "left", "right", "center", or "full". Defaults to ``None``. overflow (str, optional): Overflow method: "ignore", "crop", "fold", or "ellipsis". Defaults to None. no_wrap (Optional[bool], optional): Disable word wrapping. Defaults to None. emoji (Optional[bool], optional): Enable emoji code, or ``None`` to use console default. Defaults to ``None``. markup (Optional[bool], optional): Enable markup, or ``None`` to use console default. Defaults to ``None``. highlight (Optional[bool], optional): Enable automatic highlighting, or ``None`` to use console default. Defaults to ``None``. width (Optional[int], optional): Width of output, or ``None`` to auto-detect. Defaults to ``None``. crop (Optional[bool], optional): Crop output to width of terminal. Defaults to True. soft_wrap (bool, optional): Enable soft wrap mode which disables word wrapping and cropping of text or ``None`` for Console default. Defaults to ``None``. new_line_start (bool, False): Insert a new line at the start if the output contains more than one line. Defaults to ``False``. NTr_Fr6)r|r}rnror~rrrc3$K|] }|jV dSrr$r0rNs rgrPz Console.print..s$II IIIIIIrfr'rr)rrMrrFr<rrminrnrrr9rDrr3rr> splitlinesinsertrrr)rr8rrr|r}r~rTrrrnror]rMrVr7 render_hooksrrr new_segmentsrr9r buffer_extendrs rgrz Console.printXsJ #yylG  I  #D)!!!, 0 20 233#4K% D D"66{CC !\00!050Ac%,,,y#1N+-L!(F[F}"-??JF66*n==>>>>?#.JF+"F:~>>u@U@U  ;IILIIIIITTVVWW!''7<>>::: 2 $ 3 #8 $*%((D"M$''''(  ##L111a0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2sFG$$G(+G(rh) dataindentr skip_keys ensure_asciicheck_circular allow_nanrW sort_keysjsonrbrcrdrerfrgrhc ddlm} || |||||||| |  } nIA+==(.*?*N4;NN#) Aq%+==eVLLN!!*n!EE   1-----rfrrrrc|jstjdt|||}||}|j||dS)aUpdate lines of the screen at a given offset. Args: lines (List[List[Segment]]): Rendered lines (as produced by :meth:`~rich.Console.render_lines`). x (int, optional): x offset (column no). Defaults to 0. y (int, optional): y offset (column no). Defaults to 0. Raises: errors.NoAltScreen: If the Console isn't in alt screen mode. rrN)rr(rsrr9rrr)rrrr screen_updaters rgrtzConsole.update_screen_linessr! Y$%WXX X$UAq11 ;;}-- H%%% rfrUr"rernr!r word_wrap show_localssuppress max_framesr!ryrzr{r|c `ddlm}||||||||} || dS)a Prints a rich render of the last exception and traceback. Args: width (Optional[int], optional): Number of characters used to render code. Defaults to 100. extra_lines (int, optional): Additional lines of code to render. Defaults to 3. theme (str, optional): Override pygments theme used in traceback word_wrap (bool, optional): Enable word wrapping of long lines. Defaults to False. show_locals (bool, optional): Enable display of local variables. Defaults to False. suppress (Iterable[Union[str, ModuleType]]): Optional sequence of modules or paths to exclude from traceback. max_frames (int): Maximum number of frames to show in a traceback, 0 for no maximum. Defaults to 100. r') TracebackrxN)rr~r) rrnr!rryrzr{r|r~rs rgprint_exceptionzConsole.print_exception.s[, )(((((I##!    9rfr currentframec|dz }|}|1|r||j}|dz}|r||J|jj|j|jfSt j|}|j|j|j jfS)aEGet caller frame information. Args: offset (int): the caller offset within the current frame stack. currentframe (Callable[[], Optional[FrameType]], optional): the callable to use to retrieve the current frame. Defaults to ``inspect.currentframe``. Returns: Tuple[str, int, Dict[str, Any]]: A tuple containing the filename, the line number and the dictionary of local variables associated with the caller frame. Raises: RuntimeError: If the stack offset is invalid. r') f_backf_code co_filenamef_linenof_localsinspectstackfilenamelinenoframe)rrr frame_infos rg_caller_frame_infozConsole._caller_frame_infoQs( !     U. !  U.$$$<+U^U^K K!0J& (9:;K;TT Trf) r8rrr|rTrr log_locals _stack_offsetrrc | stf} |jdd} |5|| ||||||} fd| D} || \} }}| drdnt j| }| t j d}|rBd| D}| t|d| || |||| g} | D]}|| } g}|j}|j}|j}| D]}|||||jj}t)j||jd D] }|| ddddS#1swxYwYdS) aXLog rich content to the terminal. Args: objects (positional args): Objects to log to the terminal. sep (str, optional): String to write between print data. Defaults to " ". end (str, optional): String to write at end of print data. Defaults to "\\n". style (Union[str, Style], optional): A style to apply to output. Defaults to None. justify (str, optional): One of "left", "right", "center", or "full". Defaults to ``None``. emoji (Optional[bool], optional): Enable emoji code, or ``None`` to use console default. Defaults to None. markup (Optional[bool], optional): Enable markup, or ``None`` to use console default. Defaults to None. highlight (Optional[bool], optional): Enable automatic highlighting, or ``None`` to use console default. Defaults to None. log_locals (bool, optional): Boolean to enable logging of locals where ``log()`` was called. Defaults to False. _stack_offset (int, optional): Offset of caller from end of call stack. Defaults to 1. Nr6c0g|]}t|SrerGrBs rgrCzConsole.log..s#WWWZvj%88WWWrf.s@"U>>$//rfz [i]locals)r)rVpathline_no link_pathFr[)rrrFrrr&rabspathrr8itemsrrBrxr[r<rr9rrrDrrn)rr8rrr|rTrrrrr7r_rrrlocalsrr locals_maprr`rr9rrrars ` rglogz Console.logts8 #yylG)!!!, . $. $33#4K WWWW;WWW (,(?(? (N(N %Hgv ( 3 3C 8 8Wbgooh>W>WI&&rv..r2D P&,llnn ""< +#N#N#NOOO  !..00#' ! K% D D"66{CC *,L!(F[F!\N) ; ; vvj.99:::: L/M4dje $ $ d#### $W. $. $. $. $. $. $. $. $. $. $. $. $. $. $. $. $. $. $sFGG  G c N|jr |jdd=dS|j5|jrF|j5|j|jdddddn #1swxYwY|jdkr|jrCddl m }||j| |jdd|jdd=nNtrd}|j rt|j}| |t v}|rfddlm}ddlm}|jdd}|jr(|jr!t/t1j|}||||jn| |jdd}|jj}d} t7|| kr ||ng} | j} d} |d D]k} | t7| z| kr6| r4|d | | d} | | | t7| z } l| r2|d | | n#t@$r}|j!d |_!d}~wwxYw| |jdd} |j|n"#t@$r}|j!d |_!d}~wwxYw|j"|jdd=ddddS#1swxYwYdS) aQCheck if the buffer may be rendered. Render it if it can (e.g. Console.quiet is False) Rendering is supported on Windows, Unix and Jupyter environments. For legacy Windows consoles, the win32 API is called directly. This method will also record what it renders if recording is enabled via Console.record. Nrr')displayF)LegacyWindowsTerm)legacy_windows_renderi TrzG *** You may need to add PYTHONIOENCODING=utf-8 to your environment ***)#rPrrrSr}rrrrgjupyterrrrCrvr-rO_STD_STREAMS_OUTPUTpip._vendor.rich._win32_consoler"pip._vendor.rich._windows_rendererrrQrsrrD remove_colorwriterrr]r>rUnicodeEncodeErrorreasonflush)rruse_legacy_windows_renderfilenorrrr$r MAX_WRITEbatch batch_appendrurr5s rgrzConsole._check_buffers] :  QQQ F ZD (D ({ @-@@'..t|AAA???@@@@@@@@@@@@@@@!Q&&?>(000000GDL$*=*=dl111o*N*NOOO QQQ5"491."%/ %:%:F%1$*.A$A!:5%&YYYYYY``````%)\!!!_F#}L1CL)-g.B6.J.J)K)K11&:K:KDI:V:VWWWW$(#6#6t|AAA#G#GD%)IOE(6I&#&t99 #9#9$)E$KKKK79E38) rroutputrrIrv not_terminalr$rrrendereds rgrzConsole._render_buffers) ,++ = 2\ 2)&11F$*   D% LL%1'5!# w t 776??rf)rrTpasswordstreampromptrrc|r||||d|rtd|}n%|r|}nt}|S)a5Displays a prompt and waits for input from the user. The prompt may contain color / style. It works in the same way as Python's builtin :func:`input` function and provides elaborate line editing and history features if Python's builtin :mod:`readline` module is previously loaded. Args: prompt (Union[str, Text]): Text to render in the prompt. markup (bool, optional): Enable console markup (requires a str prompt). Defaults to True. emoji (bool, optional): Enable emoji (requires a str prompt). Defaults to True. password: (bool, optional): Hide typed text. Defaults to False. stream: (TextIO, optional): Optional file to read input from (rather than stdin). Defaults to None. Returns: str: Text read from stdin. r)rrTr)r)rr readlineinput)rrrrTrrresults rgrz Console.input,sj.  C JJvfErJ B B B  !R///FF !** rfrrrc|js Jd|j5|r%dd|jD}n$dd|jD}|r |jdd=dddn #1swxYwY|S)aGenerate text from console contents (requires record=True argument in constructor). Args: clear (bool, optional): Clear record buffer after exporting. Defaults to ``True``. styles (bool, optional): If ``True``, ansi escape codes will be included. ``False`` for plain text. Defaults to ``False``. Returns: str: String containing console contents. ITo export console contents set record=True in the constructor or instancerc3PK|]!\}}}|r||n|V"dSrr8)r0r$r_s rgrPz&Console.export_text..`sR&eQ,1:U\\$'''drfc32K|]}|j |jVdSr)rr$rZs rgrPz&Console.export_text..es@"?LrfN)rSr}r>r)rrrr$s rg export_textzConsole.export_textNs K W W V W W  % + + ww*.*= ww#'#6  +'* + + + + + + + + + + + + + + + sAA==BBrc|||}t|dd5}||ddddS#1swxYwYdS)aGenerate text from console and save to a given location (requires record=True argument in constructor). Args: path (str): Path to write text files. clear (bool, optional): Clear record buffer after exporting. Defaults to ``True``. styles (bool, optional): If ``True``, ansi style codes will be included. ``False`` for plain text. Defaults to ``False``. rwtrrzN)ropenr)rrrrr$ write_files rg save_textzConsole.save_textnseF;; $w / / / #:   T " " " # # # # # # # # # # # # # # # # # #sA  AArr code_format inline_stylesrrc >|js Jdg}|j}|pt}d}|tn|} |j5|rt jt j|jD]Y\} } } t| } | r7| |} | j rd| j d| d} | r d| d| dn| } || Zni}t jt j|jD]\} } } t| } | r]| |} | | t|d z}| j rd |d | j d| d} n d |d| d} || g}|j}|D]\}}|r|d |d|dd|}| d|||jj|jj}|r |jdd=dddn #1swxYwY|S)aIGenerate HTML from console contents (requires record=True argument in constructor). Args: theme (TerminalTheme, optional): TerminalTheme object containing console colors. clear (bool, optional): Clear record buffer after exporting. Defaults to ``True``. code_format (str, optional): Format string to render HTML. In addition to '{foreground}', '{background}', and '{code}', should contain '{stylesheet}' if inline_styles is ``False``. inline_styles (bool, optional): If ``True`` styles will be inlined in to spans, which makes files larger but easier to cut and paste markup. If ``False``, styles will be embedded in a style tag. Defaults to False. Returns: str: String containing console contents as HTML. rrNz zz formatforeground_colorhexbackground_color)rrrrr fragmentsr_themerrender_code_formatr$rrrKr style_numberstylesheet_rulesstylesheet_append style_rule rendered_codes rg export_htmlzConsole.export_html|s. K W W V W W ! !00 4?4G00[  %( +( + 9&-&<$T%899'' ! !ND%"$<)r css_rulesrrcssr style_caches rg get_svg_stylez)Console.export_svg..get_svg_style sy ##"5))IK'5;+A'''[..v66 M)U]-E)'']0088  } 0!(%wy 7!%#66   1ei11 2 2 2z 6  !4555| 8  !6777 @  !>???| C  !ABBB((9%%C!$K JrfgQ?r'(r#r$cHt|ddS)z.HTML escape text and replace spaces with nbsp.rz )r replacerYs rg escape_textz'Console.export_svg..escape_textA s$<<''X66 6rfNr1rattribsc dtdtfddfd|D}|rd|d|d|d|d nd|d|d S) z.Make a tag from name, content, and attributes.rrcjt|trt|dSt|S)Ng)rfloatrr)rs rg stringifyz7Console.export_svg..make_tag..stringifyJ s0ee--.!%---5zz!rfrc3K|]?\}}|dddd|dV@dS)rrz=""N)lstripr)r0kvrs rgrPz7Console.export_svg..make_tag..O sn##Aq88C==((c22EEiillEEE######rfrrz)objectrr>r)r1rr tag_attribsrs @rgmake_tagz$Console.export_svg..make_tagE s  " "C " " " " ((#####MMOO###K 0;D;;;;;;;D;;;;/// /// rfz terminal-rc34K|]}t|VdSr)reprrZs rgrPz%Console.export_svg..a s(CCwT']]CCCCCCrfrr_)lengthrTrect?? crispEdges)fillrrrnroshape_renderingrrzurl(#-line-))_classrr textLength clip_pathc g|] }|zdz S)rre)r0r line_heights rgrCz&Console.export_svg.. s#LLL+-3LLLrfrc3^K|]'\}}dd|ddd|zdzdV(dS) z rrr)rrrnroz Nre)r0rr char_widthrrrrns rgrPz%Console.export_svg.. s    y     XfV:+=kTXFXYYY         rfc36K|]\}}dd|d|dVdS).z-rz { z }Nre)r0rrule_nors rgrPz%Console.export_svg.. sT  7CsG 2 2 2W 2 2# 2 2 2      rfzrgba(255,255,255,0.35)1)rstroke stroke_widthrrrnrorxz-titlemiddlerh)rr text_anchorrrz )rr! char_heightrterminal_widthterminal_heightrnro terminal_x terminal_yrchrome backgroundsmatrixrr)"pip._vendor.rich.cellsrrErrJrnrr r}rrDrrrzlibadler32r>encoderrrrrrrrrrrrrangerr r)8rrrrrrrrrr, margin_top margin_right margin_bottom margin_left padding_top padding_rightpadding_bottom padding_left padding_widthpadding_height margin_width margin_heighttext_backgrounds text_groupclassesstyle_norrrrrr$rrOrules class_namehas_backgroundrr text_length line_offsetsrrr2r3r-r.r1 title_colorsvgrr!rrrrns8 ` @@@@@@rg export_svgzConsole.export_svgs6 433333(*   3       B**   #44 !D(        $}4 $~5"\1 "]2 &( " "$ 7c 7c 7 7 7 7 15    (  AG      ( % , ,G243FGGHHH ,#))+++ , , , , , , , , , , , , , , ,  #c WWCC(CCCCCKK ll7H55 6''I  !=hu!U!U!UVV4 $4 $GAtA)-2 $2 $%eX(% e,,''%-GENMH111 =%)N!;./33"[66v>>BJ $mG%,D%8%SAS=SN!=0/33"]88@@D 'htnn ! $++ "!+*n+o3",{":#.#5,8   3T?**%% "'K--&/#>#>*#>#>*n+o ;'1CII'=&Ci&C&Cq&C&C&C   XXd^^#e2 $hMLLL588LLL          $-\#:#:          GN}}     gg.// $$ej0=@AAq5K/.@ (,+ "    -1   hh E""#+++ $ A%{*Q. F     !##%-1Uk1A5 </"]2"\1!K/#!  " s3ADDDc|||||||}t|dd5} | |ddddS#1swxYwYdS)a7Generate an SVG file from the console contents (requires record=True in Console constructor). Args: path (str): The path to write the SVG to. title (str, optional): The title of the tab in the output image theme (TerminalTheme, optional): The ``TerminalTheme`` object to use to style the terminal clear (bool, optional): Clear record buffer after exporting. Defaults to ``True`` code_format (str, optional): Format string used to generate the SVG. Rich will inject a number of variables into the string in order to form the final SVG output. The default template used and the variables injected by Rich can be found by inspecting the ``console.CONSOLE_SVG_FORMAT`` variable. font_aspect_ratio (float, optional): The width to height ratio of the font used in the ``code_format`` string. Defaults to 0.61, which is the width to height ratio of Fira Code (the default font). If you aren't specifying a different font inside ``code_format``, you probably don't need this. unique_id (str, optional): unique id that is used as the prefix for various elements (CSS styles, node ids). If not set, this defaults to a computed value based on the recorded content. rrrrN)rPrr) rrrrrrrrrOrs rgsave_svgzConsole.save_svg s6oo#/   $w / / / ":   S ! ! ! " " " " " " " " " " " " " " " " " "sAAArD)rrQrN)rrrrr)TNrr )rr)}rbrcrdrpr&environrGrrrrr7rr$rrNrrqrFr5rr.rrrrrrrOsetterrrDrrrOrr2rtrrrrr:rrrrrrrrrrrrIrzryr{rtrrmrurrnrorrrr<rrrrr rrrrrrr:r rr9rEr#rrr]r r3rrFrMr1rKr4rrUrrorArurtrr staticmethodrrrrrrrrrrrrrKrr+rr,rPrRrerfrgrrRs!!F#%*Hgc3h,,, )-(,,0!%"&# $%)#'04:@3B?3D3D)-9=2604Az$z$z$ E F z$ ! z$ ~z$$D>z$z$z$z$r#wz$z$}z$ z$  "!z$"4.#z$$%z$&'z$()z$*+z$, --z$./z$01z$23z$4s$6675z$6/07z$8!9z$:;z$<xH 56=z$>8BI./?z$@738,-Az$z$z$z$xF#FFFFbgX [RW[*g***X*0s000X013141111/j///X/ h{&;    0         ,Z,D,,,,%%%%   S    ;? = = = =4 =4 = = = =&&&&:> 2 2 2u 2$ 2, 2 2 2 2 hsm   X L#LLLXL!T!!!X!F ,$ , , ,X ,      X  + '+ + + X+ Z [U38_[sX \34\    X  ]ST]%%%%$RWKKe_K59KJNK KKKK.####d#### * *$ *$ * * * *#3$(!!!! ! ! !  !"! !!!!B       TT*#t###X#cdBFJ O O O/7 /B O  O O O ORV(6>~6N $OS1@1@(1@3;N3K1@ ' 1@1@1@1@l-19 "&999"9.)9  9  99 d7m 9999~$&+/-1 $!%$(159999S%Z 9 -( 9 >* 9~99D>9o.9 9999xRV#u*%3;E%*I  IIIIZ #.%   S%Z    *NNDNNNN-1$(        c5j)*  D>       F-1+/-1"& $!%$(# $$($!a2a2a2a2a2 a2 c5j)* a2 -( a2>*a2$a2~a2a2D>a2}a2 a2a2D>a2 !a2" #a2a2a2a2J#;4()"#26;4;4;4sm;4 ;4 dCn% ;4  ;4;4;4;4;4(C5#:./;4;4 ;4;4;4;4B$(,0 . . ." . . .) .  . . . .F@A$w-(-09< . ##!57!!!}! ! } !  !!5j12!! !!!!F;B:N U U Ur8I#667 U sCc3h' ( U U U\ UJ-1+/ $!%$( O$O$O$O$O$ O$ c5j)* O$ -( O$~O$O$D>O$O$O$ O$O$O$O$bM(M(M(M(^Xg%634 #'                D,0D#@59 # # #c #T #$ #SW # # # #"*.%)# III &I I c] I  I IIII^*..##### & #  #  ## ####D)--#'#'yyyy & y  y  y!yC=y yyyy~)--#'#'$"$"$"$" $"  & $"  $"$"!$"C=$" $"$"$"$"$"$"rfr svg_main_codechttj|S)zReturns a unique hash for the given SVG main code. Args: svg_main_code (str): The content we're going to inject in the SVG envelope. Returns: str: a hash of the given content )rr5r6r7)rVs rg _svg_hashrX s( t|M002233 4 44rf__main__)rSzJSONRPC [i]request[/i]g?Fz2.0subtract*)minuend subtrahendr")jsonrpcrparamsidz Hello, World!z{'a': 1}z&Which one is correct team name in NBA?)zNew York BullszLos Angeles KingszGolden State Warriors Huston Rocketrc)questionranswer)answeredq1z 5 + 7 = ?) rjz 12 - 8 = ?)r'rhr"rl)rfrgq2)sportmaths)r1emptyquizr)rrP)rr&platformrrvr5abcrr dataclassesrrr functoolsrr rr r itertoolsr mathr timertypesrrrtypingrrrrrrrrrrrrrrr pip._vendor.rich._null_filer! version_infor$r%r&pip._vendor.typing_extensionsrr(r)r*_export_formatr+r,_filenor-rxr.r/rHr0r1rr2r3rr4rTr5rYr6r7rr9r'r r:r;rr<r=prettyr>r?protocolr@rprAscoperBrrCrNrDrrErFstyledrHterminal_themerIrJrKr$rLrMrrNrOrArPrrQrrSrirjr2rCrr]rrrar __stdin__r _STDIN_FILENO Exception __stdout___STDOUT_FILENO __stderr___STDERR_FILENOrrrrrrmrtrrr rryrrrrrrrrrrr*rrurrlocalr5r:r=rrr@rErrXrbrrrrrerfrgrs%    ########((((((((6666666666$211111v;;;;;;;;;;; ******CCCCCCCC66666666%%%%%%%%))))))))99999999++++++55555555%%%%%%%%))))))))########SSSSSSSSSS $$$$$$$$000000 (/  y (E#v+./78DE =>         HJJ M((**MMMMM^**,,NNNNN^**,,NNNNN~~> %~6 "%# ..... ... BBBBBBB BJ     x           ((C78:ng567 #O%%333339333 ) ) ) ) ) ) ) )$B!!!!!!!!*$%$%$%$%$%$%$%$%N,/,/,/,/,/,/,/,/^$$$$$$$$BtxXc5j-A(AB,T*$  &"  PO9L9L9N9NOOO )/         &AE8$<=DDD%%%%=t==== s"s"s"s"s"s"s"s"l= 5S 5S 5 5 5 5 zgT"""G KK       "$B77       KKTT']];;; MM!%$L$$$ #2    !&$/#3#3#3"$ %1#/<<"#    !!!!!)s6>GG"!G"&HH  H H((H21H2