ó
    öÞ j?‘  ã                  ó„  • S r SSKJr  SSKrSSKrSSKJrJr  SSKJ	r	  SSK
Jr  SSKJr  SSKJrJrJrJrJr  S	S
KJr  S	SKJrJr  S	SKJr  S	SKJrJrJrJr   SSKr SSK!r! SSK"r"SSK#J$r$  SSK%J&r&  / SQr'\RP                  S:H  r)Sr*Sr+\)(       a  S;S jr,OS;S jr,S<S jr-\bÝ  \R\                  R^                  r/\R\                  R`                  r0\R\                  Rb                  r1\Rd                  Rf                  r3\Rd                  Rh                  r4\Rd                  Rj                  r5\Rd                  Rl                  r6\Rd                  Rn                  r7\Rd                  Rp                  r8\Rr                  Rf                  r:OSr/Sr0Sr1Sr3Sr4Sr5Sr6Sr7Sr8S r:\)(       + =(       d    \SLr;\;r<\	" S!S"9 " S# S$5      5       r=\=" \/\0\3\3\3\7\8\8\:\1\4\5\6S%9r>\=" S&S&S&S&S&S&S&S&S&S&S&S&S&S%9r?\>r@\?rA " S' S(\5      rB\	 " S) S*5      5       rC\	 " S+ S,5      5       rD " S- S.5      rE\F" 5       rGS=S/ jrH\	 " S0 S15      5       rI\"c  S2 rJ\JrKO\I" 5       rJ \I" SS39rK S=S4 jrL\"b  \JrM\KrNO\!b  \L=rMrN\Rž                  " S5\PS6S79  O\H=rMrN " S8 S95      rQ\F" 5       rR        S>S: jrSg! \  a    Sr GNBf = f! \  a    Sr! GNLf = f! \  a    Sr" GNJf = f)?zz
Helpers that make development with *structlog* more pleasant.

See also the narrative documentation in `console-output`.
é    )ÚannotationsN)ÚCallableÚSequence)Ú	dataclass)ÚStringIO)Ú
ModuleType)ÚAnyÚLiteralÚProtocolÚTextIOÚcasté   )Ú_format_exception)Ú'MultipleConsoleRenderersConfiguredErrorÚ NoConsoleRendererConfiguredError)Ú_figure_out_exc_info)Ú	EventDictÚExceptionRendererÚExcInfoÚWrappedLogger)ÚConsole)Ú	Traceback)ÚConsoleRendererÚRichTracebackFormatterÚbetter_tracebackÚplain_tracebackÚrich_tracebackÚwin32z1{who} requires the {package} package installed.  é   c                óÞ   • [         c   [        [        R                  U S-   SS95      eU(       a*  [         R                  " 5         [         R
                  " SS9  g[         R
                  " 5         g)a  
Initialize colorama on Windows systems for colorful console output.

Args:
    who: The name of the caller for error messages.

    force_colors:
        Force colorful output even in non-interactive environments.

Raises:
    SystemError:
        When colorama is not installed.
Nz with `colors=True` on WindowsÚcolorama)ÚwhoÚpackageF)Ústrip)r!   ÚSystemErrorÚ_MISSINGÚformatÚdeinitÚinit©r"   Úforce_colorss     ÚG/var/www/html/gaurav/venv/lib/python3.13/site-packages/structlog/dev.pyÚ_init_terminalr-   H   sX   € ô ÑÜÜ—‘ØÐ>Ñ>Ø&ð  ð óð ö Ü�OŠOÔÜ�MŠM Ó&ä�MŠM�Oó    c                ó   • g)z7
Currently, nothing to be done on non-Windows systems.
N© r*   s     r,   r-   r-   g   ó   � r.   c                óB   • U[        U 5      -
  nU S[        SU5      -  -   $ )z
Pads *s* to length *length*.
Ú r   )ÚlenÚmax)ÚsÚlengthÚmissings      r,   Ú_padr9   m   s'   € ð ”s˜1“v‰o€Gàˆs”c˜!˜W“oÑ&Ñ&Ð&r.   z[0mz[1mz[2mz[31mz[34mz[36mz[35mz[33mz[32mz[41mT)Úfrozenc                  óœ   • \ rS rSr% SrS\S'   S\S'   S\S'   S\S'   S\S'   S\S	'   S\S
'   S\S'   S\S'   S\S'   S\S'   S\S'   S\S'   Srg)ÚColumnStylesé—   a%  
Column styles settings for console rendering.

These are console ANSI codes that are printed before the respective fields.
This allows for a certain amount of customization if you don't want to
configure your columns.

.. versionadded:: 25.5.0
   It was handled by private structures before.
ÚstrÚresetÚbrightÚlevel_criticalÚlevel_exceptionÚlevel_errorÚ
level_warnÚ
level_infoÚlevel_debugÚlevel_notsetÚ	timestampÚlogger_nameÚkv_keyÚkv_valuer0   N©Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__Ú__annotations__Ú__static_attributes__r0   r.   r,   r<   r<   —   sP   ‡ ñ	ð ƒJØƒKàÓØÓØÓØƒOØƒOØÓØÓàƒNØÓØƒKØ†Mr.   r<   )r?   r@   rA   rB   rC   rD   rE   rF   rG   rH   rI   rJ   rK   Ú c                  ó"   • \ rS rSrSrSS jrSrg)ÚColumnFormatteréÚ   z—
:class:`~typing.Protocol` for column formatters.

See `KeyValueColumnFormatter` and `LogLevelColumnFormatter` for examples.

.. versionadded:: 23.3.0
c                ó   • g)a  
Format *value* for *key*.

This method is responsible for formatting, *key*, the ``=``, and the
*value*. That means that it can use any string instead of the ``=`` and
it can leave out both the *key* or the *value*.

If it returns an empty string, the column is omitted completely.
Nr0   )ÚselfÚkeyÚvalues      r,   Ú__call__ÚColumnFormatter.__call__ã   r1   r.   r0   N©rZ   r>   r[   ÚobjectÚreturnr>   )rM   rN   rO   rP   rQ   r\   rS   r0   r.   r,   rV   rV   Ú   s   † ñ÷	r.   rV   c                  ó.   • \ rS rSr% SrS\S'   S\S'   Srg)	ÚColumnéï   as  
A column defines the way a key-value pair is formatted, and, by it's
position to the *columns* argument of `ConsoleRenderer`, the order in which
it is rendered.

Args:
    key:
        The key for which this column is responsible. Leave empty to define
        it as the default formatter.

    formatter: The formatter for columns with *key*.

.. versionadded:: 23.3.0
r>   rZ   rV   Ú	formatterr0   NrL   r0   r.   r,   rb   rb   ï   s   ‡ ñð 
ƒHØÖr.   rb   c                  óv   • \ rS rSr% SrS\S'   S\S'   S\S'   S\S	'   S
rS\S'   SrS\S'   SrS\S'   SS jr	Sr
g)ÚKeyValueColumnFormatteri  an  
Format a key-value pair.

Args:
    key_style: The style to apply to the key. If None, the key is omitted.

    value_style: The style to apply to the value.

    reset_style: The style to apply whenever a style is no longer needed.

    value_repr:
        A callable that returns the string representation of the value.

    width: The width to pad the value to. If 0, no padding is done.

    prefix:
        A string to prepend to the formatted key-value pair. May contain
        styles.

    postfix:
        A string to append to the formatted key-value pair. May contain
        styles.

.. versionadded:: 23.3.0
ú
str | NoneÚ	key_styler>   Úvalue_styleÚreset_stylezCallable[[object], str]Ú
value_reprr   ÚintÚwidthrT   ÚprefixÚpostfixc                óð  • [        5       nU R                  (       a6  UR                  U R                  5        UR                  U R                  5        U R                  bX  UR                  U R                  5        UR                  U5        UR                  U R                  5        UR                  S5        UR                  U R
                  5        UR                  [        U R                  U5      U R                  5      5        UR                  U R                  5        U R                  (       a6  UR                  U R                  5        UR                  U R                  5        UR                  5       $ )NÚ=)r   rn   Úwriterj   rh   ri   r9   rk   rm   ro   Úgetvalue)rY   rZ   r[   Úsios       r,   r\   Ú KeyValueColumnFormatter.__call__(  sí   € Ü‹jˆà�;�;Ø�I‰I�d—k‘kÔ"Ø�I‰I�d×&Ñ&Ô'à�>‰>Ñ%Ø�I‰I�d—n‘nÔ%Ø�I‰I�cŒNØ�I‰I�d×&Ñ&Ô'Ø�I‰I�cŒNà�	‰	�$×"Ñ"Ô#Ø�	‰	”$�t—‘ uÓ-¨t¯z©zÓ:Ô;Ø�	‰	�$×"Ñ"Ô#à�<�<Ø�I‰I�d—l‘lÔ#Ø�I‰I�d×&Ñ&Ô'à�|‰|‹~Ðr.   r0   Nr^   )rM   rN   rO   rP   rQ   rR   rm   rn   ro   r\   rS   r0   r.   r,   rf   rf     sC   ‡ ñð4 ÓØÓØÓØ'Ó'Ø€Eˆ3ƒNØ€FˆCÓØ€GˆSÓ÷r.   rf   c                  ó`   • \ rS rSr% SrS\S'   S\S'   S\S'    S       SS
 jjrSS jrSrg	)ÚLogLevelColumnFormatteri@  aa  
Format a log level according to *level_styles*.

The width is padded to the longest level name (if *level_styles* is passed
-- otherwise there's no way to know the lengths of all levels).

Args:
    level_styles:
        A dictionary of level names to styles that are applied to it. If
        None, the level is formatted as a plain ``[level]``.

    reset_style:
        What to use to reset the style after the level name. Ignored if
        if *level_styles* is None.

    width:
        The width to pad the level to. If 0, no padding is done.

.. versionadded:: 23.3.0
.. versionadded:: 24.2.0 *width*
údict[str, str] | NoneÚlevel_stylesr>   rj   rl   rm   Nc                óÀ   • Xl         U(       aC  US:X  a  SO.[        [        U R                   R                  5       [        S95      U l        X l        g SU l        SU l        g )Nr   ©rZ   rT   )ry   r4   r5   Úkeysrm   rj   )rY   ry   rj   rm   s       r,   Ú__init__Ú LogLevelColumnFormatter.__init__[  sW   € ð )ÔÞð ˜A“:ñ äœ˜T×.Ñ.×3Ñ3Ó5¼3Ñ?Ó@ð ŒJð
  +ÕàˆDŒJØ!ˆDÕr.   c                óÆ   • [        [        U5      nU R                  c  SOU R                  R                  US5      nSU [	        X0R
                  5       U R                   S3$ )NrT   Ú[Ú])r   r>   ry   Úgetr9   rm   rj   )rY   rZ   r[   ÚlevelÚstyles        r,   r\   Ú LogLevelColumnFormatter.__call__m  sf   € Ü”S˜%Ó ˆð × Ñ Ñ(ñ à×"Ñ"×&Ñ& u¨bÓ1ð 	ð �5�'œ$˜u§j¡jÓ1Ð2°4×3CÑ3CÐ2DÀAÐFÐFr.   )ry   rj   rm   ©N)ry   údict[str, str]rj   r>   rm   ú
int | Noner`   ÚNoner^   )	rM   rN   rO   rP   rQ   rR   r}   r\   rS   r0   r.   r,   rw   rw   @  sP   ‡ ñð, (Ó'ØÓØƒJð !ð	"à$ð"ð ð"ð ð	"ð
 
õ"÷$Gr.   rw   c                ó>   • U R                  S[        U5      -   5        g)zì
"Pretty"-print *exc_info* to *sio* using our own plain formatter.

To be passed into `ConsoleRenderer`'s ``exception_formatter`` argument.

Used by default if neither Rich nor *better-exceptions* are present.

.. versionadded:: 21.2.0
Ú
N)rr   r   ©rt   Úexc_infos     r,   r   r   {  s   € ð ‡I�IˆdÔ& xÓ0Ñ0Õ1r.   c                  óè   • \ rS rSr% SrSrS\S'   SrS\S'   S	rS
\S'   Sr	S\S'   Sr
S\S'   SrS
\S'   SrS\S'   SrS\S'   SrS\S'   SrS
\S'   SrS
\S'   SrS\S'   SrS\S'   SrS\S '   S#S! jrS"rg)$r   iˆ  a™  
A Rich traceback renderer with the given options.

Pass an instance as `ConsoleRenderer`'s ``exception_formatter`` argument.

See :class:`rich.traceback.Traceback` for details on the arguments.

If *width* is `None`, the terminal width is used. If the width can't be
determined, fall back to 80.

.. versionadded:: 23.2.0

.. versionchanged:: 25.4.0
    Default *width* is ``None`` to have full width and reflow support.
    Passing ``-1`` as width is deprecated, use ``None`` instead.
    *word_wrap* is now True by default.

.. versionadded:: 25.4.0 *code_width*

.. versionchanged:: 26.1.0
   ``None`` is now valid for *color_system* and disables color output.
Ú	truecolorzALiteral['auto', 'standard', '256', 'truecolor', 'windows'] | NoneÚcolor_systemTÚboolÚshow_localséd   rl   Ú
max_framesNrg   ÚthemeÚ	word_wrapé   Úextra_linesrˆ   rm   éX   Ú
code_widthÚindent_guidesé
   Úlocals_max_lengthéP   Úlocals_max_stringÚlocals_hide_dunderFÚlocals_hide_sunderr0   zSequence[str | ModuleType]Úsuppressc                ó\  • U R                   S:X  a!  [        R                  " S[        SS9  S U l         UR	                  S5        [        XR                  U R                   S9n[        R                  " UU R                  U R                  U R                  U R                  U R                  U R                   U R                  U R                  U R                   U R"                  U R$                  U R&                  S.6n[)        US5      (       a  U R*                  Ul        UR-                  U5        g )	Néÿÿÿÿz1Use None to use the terminal width instead of -1.é   ©Ú
stacklevelr‹   )Úfiler�   rm   )r’   r”   r•   r–   r˜   rm   r›   r�   rŸ   r    r¡   r¢   rš   )rm   ÚwarningsÚwarnÚDeprecationWarningrr   r   r�   r   Úfrom_exceptionr’   r”   r•   r–   r˜   r›   r�   rŸ   r    r¡   r¢   Úhasattrrš   Úprint)rY   rt   r�   ÚconsoleÚtbs        r,   r\   ÚRichTracebackFormatter.__call__²  sí   € Ø�:‰:˜ÓÜ�MŠMØCÜ"Øòð
 ˆDŒJà�	‰	�$ŒäØ×#4Ñ#4¸D¿J¹Jñ
ˆô ×%Ò%ØØ×(Ñ(Ø—‘Ø—*‘*Ø—n‘nØ×(Ñ(Ø—*‘*Ø×,Ñ,Ø"×4Ñ4Ø"×4Ñ4Ø#×6Ñ6Ø#×6Ñ6Ø—]‘]ò
ˆô �2�|×$Ñ$à ŸO™OˆBŒMØ�‰�bÕr.   )rm   ©rt   r   r�   r   r`   r‰   )rM   rN   rO   rP   rQ   r�   rR   r’   r”   r•   r–   r˜   rm   rš   r›   r�   rŸ   r    r¡   r¢   r\   rS   r0   r.   r,   r   r   ˆ  s§   ‡ ñð2 	ð ØIóð €K�ÓØ€J�ÓØ€Eˆ:ÓØ€IˆtÓØ€K�ÓØ€Eˆ:ÓØ€J�
ÓØ€M�4ÓØÐ�sÓØÐ�sÓØ#Ð˜Ó#Ø$Ð˜Ó$Ø+-€HÐ(Ó-÷ r.   r   c                 ó   • [        SSS9e)Nz5RichTracebackFormatter requires Rich to be installed.Úrich)Úname)ÚModuleNotFoundError)ÚargsÚkws     r,   r   r   ×  s   € Ü!ØCØñ
ð 	
r.   )r�   c                ó    • [         R                  " S[        SS9  U R                  SSR	                  [
        R                  " U6 5      -   5        g)aw  
Pretty-print *exc_info* to *sio* using the *better-exceptions* package.

To be passed into `ConsoleRenderer`'s ``exception_formatter`` argument.

Used by default if *better-exceptions* is installed and Rich is absent.

.. versionadded:: 21.2.0
.. deprecated:: 26.1.0
   *better-exceptions* support is deprecated and will be removed in a
   future release. Use Rich instead.
úbbetter-exceptions support is deprecated and will be removed in a future release. Use Rich instead.r¥   r¦   r‹   rT   N)r©   rª   r«   rr   ÚjoinÚbetter_exceptionsÚformat_exceptionrŒ   s     r,   r   r   ú  sC   € ô ‡M‚Mð	1äØò	ð ‡I�Iˆd�R—W‘WÔ.×?Ò?ÀÐJÓKÑKÕLr.   rº   r¥   r¦   c                  óŠ  • \ rS rSr% SrS\S'   \\SSS\SSS	SSS4                       S(S
 jjr	\
S)S j5       r\
 S*     S+S jj5       r\S,S-S jj5       rS.S jrS/S jr        S0S jr\S1S j5       r\R(                  S2S j5       r\S3S j5       r\R(                  S4S j5       r\S5S j5       r\R(                  S6S j5       r\S3S j5       r\R(                  S4S j5       r\S3S j5       r\R(                  S4S j5       r\S7S j5       r\R(                  S8S j5       r\S3S j5       r\R(                  S4S j5       r\S9S j5       r\R(                  S:S  j5       r\S;S! j5       r\R(                  S<S" j5       r\S;S# j5       r\R(                  S<S$ j5       r\S3S% j5       r\R(                  S4S& j5       rS'rg)=r   i#  aú  
Render ``event_dict`` nicely aligned, possibly in colors, and ordered.

If ``event_dict`` contains a true-ish ``exc_info`` key, it will be rendered
*after* the log line. If Rich_ is present, in colors and with extra
context.

Tip:
    Since `ConsoleRenderer` is mainly a development helper, it is less
    strict about immutability than the rest of *structlog* for better
    ergonomics. Notably, the currently active instance can be obtained by
    calling `ConsoleRenderer.get_active()` and it offers properties to
    configure its behavior after instantiation.

Args:
    columns:
        A list of `Column` objects defining both the order and format of
        the key-value pairs in the output. If passed, most other arguments
        become meaningless.

        **Must** contain a column with ``key=''`` that defines the default
        formatter.

        .. seealso:: `columns-config`

    pad_event_to:
        Pad the event to this many characters. Ignored if *columns* are
        passed.

    colors:
        Use colors for a nicer output. `True` by default. On Windows only
        if Colorama_ is installed. Ignored if *columns* are passed.

    force_colors:
        Force colors even for non-tty destinations. Use this option if your
        logs are stored in a file that is meant to be streamed to the
        console. Only meaningful on Windows. Ignored if *columns* are
        passed.

    repr_native_str:
        When `True`, `repr` is also applied to ``str``\ s. The ``event``
        key is *never* `repr` -ed. Ignored if *columns* are passed.

    level_styles:
        When present, use these styles for colors. This must be a dict from
        level names (strings) to terminal sequences (for example, Colorama)
        styles. The default can be obtained by calling
        `ConsoleRenderer.get_default_level_styles`. Ignored when *columns*
        are passed.

    exception_formatter:
        A callable to render ``exc_infos``. If Rich_ is installed, it is
        used for pretty-printing by default. You can also manually set it
        to `plain_traceback`, an instance of `RichTracebackFormatter` like
        `rich_traceback`, or implement your own.

    sort_keys:
        Whether to sort keys when formatting. `True` by default. Ignored if
        *columns* are passed.

    event_key:
        The key to look for the main log message. Needed when you rename it
        e.g. using `structlog.processors.EventRenamer`. Ignored if
        *columns* are passed.

    timestamp_key:
        The key to look for timestamp of the log message. Needed when you
        rename it e.g. using `structlog.processors.EventRenamer`. Ignored
        if *columns* are passed.

    pad_level:
        Whether to pad log level with blanks to the longest amongst all
        level label.

Requires the Colorama_ package if *colors* is `True` **on Windows**.

Raises:
    ValueError: If there's not exactly one default column formatter.

.. _Colorama: https://pypi.org/project/colorama/
.. _better-exceptions: https://pypi.org/project/better-exceptions/
.. _Rich: https://pypi.org/project/rich/

.. versionadded:: 16.0.0
.. versionadded:: 16.1.0 *colors*
.. versionadded:: 17.1.0 *repr_native_str*
.. versionadded:: 18.1.0 *force_colors*
.. versionadded:: 18.1.0 *level_styles*
.. versionchanged:: 19.2.0
   Colorama now initializes lazily to avoid unwanted initializations as
   ``ConsoleRenderer`` is used by default.
.. versionchanged:: 19.2.0 Can be pickled now.
.. versionchanged:: 20.1.0
   Colorama does not initialize lazily on Windows anymore because it breaks
   rendering.
.. versionchanged:: 21.1.0
   It is additionally possible to set the logger name using the
   ``logger_name`` key in the ``event_dict``.
.. versionadded:: 21.2.0 *exception_formatter*
.. versionchanged:: 21.2.0
   `ConsoleRenderer` now handles the ``exc_info`` event dict key itself. Do
   **not** use the `structlog.processors.format_exc_info` processor
   together with `ConsoleRenderer` anymore! It will keep working, but you
   can't have customize exception formatting and a warning will be raised
   if you ask for it.
.. versionchanged:: 21.2.0
   The colors keyword now defaults to True on non-Windows systems, and
   either True or False in Windows depending on whether Colorama is
   installed.
.. versionadded:: 21.3.0 *sort_keys*
.. versionadded:: 22.1.0 *event_key*
.. versionadded:: 23.2.0 *timestamp_key*
.. versionadded:: 23.3.0 *columns*
.. versionadded:: 24.2.0 *pad_level*
.. versionchanged:: 26.1.0
   The default exception formatter is now monochrome if colors are disabled.
rV   Ú_default_column_formatterFNTÚeventrH   c                óÀ  ^• Ub1  U[         :w  a  [        S5      e[        R                  " S[        SS9  UnX`l        Xpl        X@l        U R                  X#5      U l	        X l
        X0l        Uc  U R                  U5      OUU l        Xl        X�l        X€l        X°l        U[$        L a  U(       d  [&        U l        U
c  U R)                  5         g X l        / mSU4S jjnU[         :w  a  U" S5        U[,        :w  a  U" S5        USLa  U" S	5        USLa  U" S
5        Ub  U" S5        US:w  a  U" S5        U	S:w  a  U" S5        T H  n[        R                  " USS9  M     g )Nz/Cannot set both `pad_event` and `pad_event_to`.zCThe `pad_event` argument is deprecated. Use `pad_event_to` instead.r¥   r¦   c                ó0   >• TR                  SU  S35        g )NzThe `z-` argument is ignored when passing `columns`.)Úappend)ÚargÚto_warns    €r,   Úadd_meaningless_argÚ5ConsoleRenderer.__init__.<locals>.add_meaningless_argÔ  s   ø€ Ø�N‰NØ˜�uÐIÐJõr.   Úpad_event_toÚcolorsFr+   Úrepr_native_strry   rÀ   Ú	event_keyrH   Útimestamp_key)rÄ   r>   r`   r‰   )Ú_EVENT_WIDTHÚ
ValueErrorr©   rª   r«   Úexception_formatterÚ
_sort_keysÚ_repr_native_strÚget_default_column_stylesÚ_stylesÚ_colorsÚ_force_colorsÚget_default_level_stylesÚ_level_stylesÚ_pad_event_toÚ_timestamp_keyÚ
_event_keyÚ
_pad_levelÚdefault_exception_formatterÚ&default_monochrome_exception_formatterÚ_configure_columnsÚcolumnsÚ_has_colors)rY   rÈ   rÉ   r+   rÊ   ry   rÏ   Ú	sort_keysrË   rÌ   rß   Ú	pad_levelÚ	pad_eventrÆ   ÚwrÅ   s                  @r,   r}   ÚConsoleRenderer.__init__œ  sk  ø€ ð Ñ Øœ|Ó+Ü ØEóð ô �MŠMØUÜ"Øòð
 %ˆLð $7Ô Ø#ŒØ /ÔØ×5Ñ5°fÓKˆŒØŒØ)Ôð Ñ#ð ×)Ñ)¨&Ô1àð 	Ôð
 *ÔØ+ÔØ#ŒØ#ŒàÔ"=Ò=ÆfÜ'MˆDÔ$à‰?Ø×#Ñ#Ô%ØàŒàˆ÷	ð
 œ<Ó'Ù Ô/à”[Ó Ù Ô)à˜uÒ$Ù Ô/à %Ò'ÙÐ 1Ô2àÑ#Ù Ô/à˜ÓÙ Ô,à˜KÓ'Ù Ô0ãˆAÜ�MŠM˜!¨Ô*ò r.   c                óŽ   • SSK Jn  SnU" 5       S    H%  n[        U[        5      (       d  M  Ub  [        eUnM'     Uc  [
        eU$ )a—  
If *structlog* is configured to use `ConsoleRenderer`, it's returned.

It does not have to be the last processor.

Raises:
    NoConsoleRendererConfiguredError:
        If no ConsoleRenderer is found in the current configuration.

    MultipleConsoleRenderersConfiguredError:
        If more than one is found in the current configuration. This is
        almost certainly a bug.

.. versionadded:: 25.5.0
r   )Ú
get_configNÚ
processors)Ú_configrç   Ú
isinstancer   r   r   )Úclsrç   ÚcrÚps       r,   Ú
get_activeÚConsoleRenderer.get_activeñ  sL   € õ" 	(àˆÙ“˜lÔ+ˆAÜ˜!œ_×-Ó-Ø‘>ÜAÐAà’ñ ,ð ‰:Ü2Ð2àˆ	r.   c                óT   • U(       d  [         $ [        U R                  U5        [        $ )a5  
Configure and return the appropriate styles class for console output.

This method handles the setup of colorful or plain styles, including
proper colorama initialization on Windows systems when colors are
enabled.

Args:
    colors: Whether to use colorful output styles.

    force_colors:
        Force colorful output even in non-interactive environments.
        Only relevant on Windows with colorama.

Returns:
    The configured styles.

Raises:
    SystemError:
        On Windows when colors=True but colorama is not installed.

.. versionadded:: 25.5.0
)Ú_plain_stylesr-   rM   Ú_colorful_styles)rë   rÉ   r+   s      r,   rÒ   Ú)ConsoleRenderer.get_default_column_styles  s!   € ö6 Ü Ð ä�s—|‘| \Ô2äÐr.   c           	     óÞ   • U (       a  [         O[        nUR                  UR                  UR                  UR
                  UR
                  UR                  UR                  UR                  S.$ )a4  
Get the default styles for log levels

This is intended to be used with `ConsoleRenderer`'s ``level_styles``
parameter.  For example, if you are adding custom levels in your
home-grown :func:`~structlog.stdlib.add_log_level` you could do::

    my_styles = ConsoleRenderer.get_default_level_styles()
    my_styles["EVERYTHING_IS_ON_FIRE"] = my_styles["critical"]
    renderer = ConsoleRenderer(level_styles=my_styles)

Args:
    colors:
        Whether to use colorful styles. This must match the *colors*
        parameter to `ConsoleRenderer`. Default: `True`.
)ÚcriticalÚ	exceptionÚerrorrª   ÚwarningÚinfoÚdebugÚnotset)	rò   rñ   rA   rB   rC   rD   rE   rF   rG   )rÉ   Ústyless     r,   rÖ   Ú(ConsoleRenderer.get_default_level_styles3  s`   € ö& &,Õ!´ˆà×-Ñ-Ø×/Ñ/Ø×'Ñ'Ø×%Ñ%Ø×(Ñ(Ø×%Ñ%Ø×'Ñ'Ø×)Ñ)ñ	
ð 		
r.   c                ó&  • U R                   R                  5       nU H#  nX==   U R                  R                  -  ss'   M%     [	        [        UR                  5       [        S95      U l        [        U R                  R                  U R                  R                  U R                  R                  U R                  SS9U l        [        SU R                  R                  U R                  R                  -   U R                  R                  [        SSS9nU R                   (       d  SOSn[#        U R$                  [        SU R                  R&                  U R                  R                  [        S95      [#        S	[)        UU R                  R                  US
95      [#        U R*                  [        SU R                  R                  U R                  R                  [        U R,                  S95      [#        SU5      [#        SU5      /U l        g)zØ
Re-configure self._columns and self._default_column_formatter
according to our current settings.

Overwrite existing columns settings, regardless of whether they were
explicitly passed by the user or derived by us.
r{   r   )rk   rm   Nr€   r�   )rh   ri   rj   rk   rn   ro   )rh   ri   rj   rk   rƒ   )rj   rm   )rh   ri   rj   rk   rm   ÚloggerrI   )r×   ÚcopyrÓ   r@   r4   r5   r|   Ú_longest_levelrf   rJ   rK   r?   Ú_reprr¿   rI   r>   rÛ   rb   rÙ   rH   rw   rÚ   rØ   Ú_columns)rY   Úlevel_to_colorrZ   Úlogger_name_formatterÚlevel_widths        r,   rÞ   Ú"ConsoleRenderer._configure_columnsR  s¬  € ð ×+Ñ+×0Ñ0Ó2ˆã!ˆCØÓ 4§<¡<×#6Ñ#6Ñ6Õñ "ä!¤# n×&9Ñ&9Ó&;ÄÑ"EÓFˆÔä)@Ø�L‰L×ÑØ�L‰L×!Ñ!Ø�L‰L×ÑØ—z‘zØñ*
ˆÔ&ô !8ØØŸ™×+Ñ+¨d¯l©l×.FÑ.FÑFØŸ™×*Ñ*ÜØØñ!
Ðð  $ŸŸ‘a°Dˆô Ø×#Ñ#Ü'Ø"Ø $§¡× 6Ñ 6Ø $§¡× 2Ñ 2Ü"ñ	óô ØÜ'Ø"Ø $§¡× 2Ñ 2Ø%ñóô Ø—‘Ü'Ø"Ø $§¡× 3Ñ 3Ø $§¡× 2Ñ 2Ü"Ø×,Ñ,ñó	ô �8Ð2Ó3Ü�=Ð"7Ó8ð;
ˆ�r.   c                óº   • U R                   SL a  [        U5      $ [        U[        5      (       a"  [	        U5      1 Sk-  (       a  [        U5      $ U$ [        U5      $ )zR
Determine representation of *val* depending on its type &
self._repr_native_str.
T>   Ú	r‹   Úr3   Ú"Ú'rq   )rÑ   Úreprrê   r>   Úset)rY   Úvals     r,   r  ÚConsoleRenderer._repr“  sO   € ð
 × Ñ  DÒ(Ü˜“9Ðä�cœ3×ÑÜ�3‹xÒ@×@Ü˜C“yÐ ØˆJä�C‹yÐr.   c           	     ó^  • UR                  SS 5      nUR                  SS 5      nUR                  SS 5      nU R                   Vs/ sHJ  nUR                  UR                  [        5      =n[        Ld  M.  UR	                  UR                  U5      PML     snU R
                  (       a  [        U5      OU V	s/ sH  n	U R                  X“U	   5      PM     sn	-   n
[        5       nUR                  SR                  S U
 5       5      R                  S5      5        Ub/  UR                  SU-   5        U(       d  Ub  UR                  S5        [        U5      nU(       a!  U R                  X¶5        UR                  5       $ Ub  UR                  SU-   5        UR                  5       $ s  snf s  sn	f )NÚstackrö   r�   r3   c              3  ó4   #   • U H  o(       d  M  Uv •  M     g 7fr†   r0   )Ú.0Úkvs     r,   Ú	<genexpr>Ú+ConsoleRenderer.__call__.<locals>.<genexpr>³  s   é € Ð3© 2³ŸB™Bªùs   ‚	�	r‹   zR

===============================================================================
)Úpoprß   rZ   Ú_NOTHINGrd   rÐ   Úsortedr¿   r   rr   r»   Úrstripr   Ú_exception_formatterrs   )rY   rÿ   rµ   Ú
event_dictr  Úexcr�   Úcolr  rZ   Úkvsrt   s               r,   r\   ÚConsoleRenderer.__call__¢  st  € ð —‘˜w¨Ó-ˆØ�n‰n˜[¨$Ó/ˆØ—>‘> *¨dÓ3ˆð —|’|ó
á#�Ø!—~‘~ c§g¡g¬xÓ8Ð8�ÄÐIó (ˆC�M‰M˜#Ÿ'™' 3Ö'Ù#ñ
ð /3¯o¯oœ˜zÔ*À:ÐMó
áM�ð ×*Ñ*¨3¸3±Ö@ÙMñ
ñ	
ˆô ‹jˆØ�	‰	�3—8‘8Ñ3©Ó3Ó3×;Ñ;¸CÓ@ÔAàÑØ�I‰I�d˜U‘lÔ#Þ˜3™?Ø—	‘	Ð2Ô3ä'¨Ó1ˆÞØ×%Ñ% cÔ4ð �|‰|‹~Ðð ‰_Ø�I‰I�d˜S‘jÔ!à�|‰|‹~Ðùò/
ùò
s   Á,F%Á5 F%Â7F*c                ó   • U R                   $ )zR
The exception formatter used by this console renderer.

.. versionadded:: 25.5.0
©r  ©rY   s    r,   rÏ   Ú#ConsoleRenderer.exception_formatterÂ  s   € ð ×(Ñ(Ð(r.   c                ó   • Xl         g©ú
.. versionadded:: 25.5.0
Nr#  ©rY   r[   s     r,   rÏ   r%  Ë  s
   € ð
 %*Õ!r.   c                ó   • U R                   $ )zA
Whether to sort keys when formatting.

.. versionadded:: 25.5.0
©rÐ   r$  s    r,   rá   ÚConsoleRenderer.sort_keysÒ  s   € ð �‰Ðr.   c                ó   • Xl         gr'  r+  r)  s     r,   rá   r,  Û  s	   € ð  �r.   c                óH   • [        SU R                  5      /U R                  Q$ )aý  
The columns configuration for this console renderer.

Warning:
    Just like with passing *columns* argument, many of the other
    arguments you may have passed are ignored.

Args:
    value:
        A list of `Column` objects defining both the order and format
        of the key-value pairs in the output.

        **Must** contain a column with ``key=''`` that defines the
        default formatter.

Raises:
    ValueError: If there's not exactly one default column formatter.

.. versionadded:: 25.5.0
rT   )rb   r¿   r  r$  s    r,   rß   ÚConsoleRenderer.columnsã  s#   € ô, �r˜4×9Ñ9Ó:ÐK¸T¿]¹]ÐKÐKr.   c                ó.  • U Vs/ sH  o"R                   S:X  d  M  UPM     nnU(       d  [        S5      e[        U5      S:”  a  [        S5      eUS   R                  U l        U Vs/ sH  o"R                   (       d  M  UPM     snU l        gs  snf s  snf )r(  rT   z>Must pass a default column formatter (a column with `key=''`).r   z*Only one default column formatter allowed.r   N)rZ   rÎ   r4   rd   r¿   r  )rY   r[   r  Údefaultss       r,   rß   r/  û  sƒ   € ñ
 $)Ó:¡5˜C¯G©G°r©M—C¡5ˆÐ:ÞÜØPóð ô ˆx‹=˜1ÓÜÐIÓJÐJà)1°!©×)>Ñ)>ˆÔ&Ù(-Ó9© ·µŸ©Ñ9ˆ�ùò ;ùò :s   …B›BÁ'BÁ>Bc                ó   • U R                   $ )zð
Whether to use colorful output styles.

Setting this will update the renderer's styles immediately and reset
level styles to the defaults according to the new color setting -- even
if the color value is the same.

.. versionadded:: 25.5.0
)rÔ   r$  s    r,   rÉ   ÚConsoleRenderer.colors  s   € ð �|‰|Ðr.   c                ó  • Xl         U R                  XR                  5      U l        U R	                  U5      U l        U R                  [        L d  U R                  [        L a  U(       a  [        O[        U l        U R                  5         g)z‚
.. versionadded:: 25.5.0

.. versionchanged:: 26.1.0
   Also switches to monochrome exception formatting if colors are disabled.
N)
rÔ   rÒ   rÕ   rÓ   rÖ   r×   rÏ   rÜ   rÝ   rÞ   r)  s     r,   rÉ   r3    s€   € ð ŒØ×5Ñ5Ø×%Ñ%ó
ˆŒð "×:Ñ:¸5ÓAˆÔð ×#Ñ#Ü'ò
à×%Ñ%Ü2ò
ö
 õ ,ä;ð Ô$ð 	×ÑÕ!r.   c                ó   • U R                   $ )a  
Force colorful output even in non-interactive environments.

Setting this will update the renderer's styles immediately and reset
level styles to the defaults according to the current color setting --
even if the value is the same.

.. versionadded:: 25.5.0
)rÕ   r$  s    r,   r+   ÚConsoleRenderer.force_colors5  ó   € ð ×!Ñ!Ð!r.   c                ó²   • Xl         U R                  U R                  U5      U l        U R	                  U R                  5      U l        U R                  5         gr'  )rÕ   rÒ   rÔ   rÓ   rÖ   r×   rÞ   r)  s     r,   r+   r6  B  sE   € ð
 #ÔØ×5Ñ5°d·l±lÀEÓJˆŒØ!×:Ñ:¸4¿<¹<ÓHˆÔà×ÑÕ!r.   c                ó   • U R                   $ )zñ
The level styles mapping for this console renderer.

Setting this property will reset to defaults if set to None, otherwise
it applies the provided mapping. In all cases, columns are rebuilt to
reflect the change.

.. versionadded:: 25.5.0
)r×   r$  s    r,   ry   ÚConsoleRenderer.level_stylesM  r7  r.   c                ón   • Uc  U R                  U R                  5      OUU l        U R                  5         gr'  )rÖ   rÔ   r×   rÞ   r)  s     r,   ry   r:  Z  s6   € ð ‰}ð ×)Ñ)¨$¯,©,Ô7àð 	Ôð
 	×ÑÕ!r.   c                ó   • U R                   $ )z£
Whether to pad log level with blanks to the longest amongst all
level labels.

Setting this will rebuild columns to reflect the change.

.. versionadded:: 25.5.0
)rÛ   r$  s    r,   râ   ÚConsoleRenderer.pad_levelf  s   € ð �‰Ðr.   c                ó0   • Xl         U R                  5         gr'  )rÛ   rÞ   r)  s     r,   râ   r=  r  ó   € ð
  ŒØ×ÑÕ!r.   c                ó   • U R                   $ )zƒ
The number of characters to pad the event to.

Setting this will rebuild columns to reflect the change.

.. versionadded:: 25.5.0
)rØ   r$  s    r,   rÈ   ÚConsoleRenderer.pad_event_toz  s   € ð ×!Ñ!Ð!r.   c                ó0   • Xl         U R                  5         gr'  )rØ   rÞ   r)  s     r,   rÈ   rA  …  s   € ð
 #ÔØ×ÑÕ!r.   c                ó   • U R                   $ )z
The key to look for the main log message.

Setting this will rebuild columns to reflect the change.

.. versionadded:: 25.5.0
)rÚ   r$  s    r,   rË   ÚConsoleRenderer.event_key�  s   € ð �‰Ðr.   c                ó0   • Xl         U R                  5         gr'  )rÚ   rÞ   r)  s     r,   rË   rD  ˜  r?  r.   c                ó   • U R                   $ )z‹
The key to look for the timestamp of the log message.

Setting this will rebuild columns to reflect the change.

.. versionadded:: 25.5.0
)rÙ   r$  s    r,   rÌ   ÚConsoleRenderer.timestamp_key   s   € ð ×"Ñ"Ð"r.   c                ó0   • Xl         U R                  5         gr'  )rÙ   rÞ   r)  s     r,   rÌ   rG  «  s   € ð
 $ÔØ×ÑÕ!r.   c                ó   • U R                   $ )za
Whether native strings are passed through repr() in non-event values.

.. versionadded:: 25.5.0
©rÑ   r$  s    r,   rÊ   ÚConsoleRenderer.repr_native_str³  s   € ð ×$Ñ$Ð$r.   c                ó   • Xl         gr'  rJ  r)  s     r,   rÊ   rK  ¼  s
   € ð
 !&Õr.   )rÔ   r  r¿   rÚ   r  rÕ   r×   r  rØ   rÛ   rÑ   rÐ   rÓ   rÙ   rß   rÏ   )rÈ   rl   rÉ   r‘   r+   r‘   rÊ   r‘   ry   rx   rÏ   r   rá   r‘   rË   r>   rÌ   r>   rß   zlist[Column] | Nonerâ   r‘   rã   rˆ   )r`   r   )F)rÉ   r‘   r+   r‘   r`   r<   )T)rÉ   r‘   r`   r‡   )r`   r‰   )r  r	   r`   r>   )rÿ   r   rµ   r>   r  r   r`   r>   )r`   r   )r[   r   r`   r‰   )r`   r‘   )r[   r‘   r`   r‰   )r`   úlist[Column])r[   rM  r`   r‰   )r`   r‡   )r[   rx   r`   r‰   )r`   rl   )r[   rl   r`   r‰   )r`   r>   )r[   r>   r`   r‰   ) rM   rN   rO   rP   rQ   rR   rÍ   rà   rÜ   r}   Úclassmethodrî   rÒ   ÚstaticmethodrÖ   rÞ   r  r\   ÚpropertyrÏ   Úsetterrá   rß   rÉ   r+   ry   râ   rÈ   rË   rÌ   rÊ   rS   r0   r.   r,   r   r   #  sA  ‡ ñtðl  /Ó.ð )Ø"Ø"Ø %Ø.2Ø1LØØ Ø(Ø'+ØØ $ðS+àðS+ð ðS+ð ð	S+ð
 ðS+ð ,ðS+ð /ðS+ð ðS+ð ðS+ð ðS+ð %ðS+ð ðS+ð õS+ðj óó ðð> à05ð Øð Ø)-ð à	ô ó ð ðB õ
ó ð
ô<?
ôBðØ#ðØ+.ðØ<Eðà	ôð@ ó)ó ð)ð ×Ñó*ó  ð*ð óó ðð ×Ñó ó ð ð óLó ðLð. ‡^�^ó:ó ð:ð ó
ó ð
ð ‡]�]ó"ó ð"ð8 ó
"ó ð
"ð ×Ñó"ó ð"ð ó
"ó ð
"ð ×Ñó	"ó ð	"ð ó	ó ð	ð ×Ñó"ó ð"ð ó"ó ð"ð ×Ñó"ó ð"ð óó ðð ×Ñó"ó ð"ð ó#ó ð#ð ×Ñó"ó ð"ð ó%ó ð%ð ×Ñó&ó ó&r.   r   c                óZ   • US:w  d  UR                  S[        5      [        La  U$ SUS'   U$ )z«
Set ``event_dict["exc_info"] = True`` if *method_name* is ``"exception"``.

Do nothing if the name is different or ``exc_info`` is already set.

.. versionadded:: 19.2.0
rö   r�   T)r‚   Ú	_SENTINEL)rÿ   Úmethod_namer  s      r,   Úset_exc_inforU  Ç  s5   € ð 	�{Ó"Ø�>‰>˜*¤iÓ0¼	ÒAàÐà!€JˆzÑàÐr.   )r"   r>   r+   r‘   r`   r‰   )r6   r>   r7   rl   r`   r>   r²   )rÿ   r   rT  r>   r  r   r`   r   )TrQ   Ú
__future__r   Úsysr©   Úcollections.abcr   r   Údataclassesr   Úior   Útypesr   Útypingr	   r
   r   r   r   Ú_framesr   Ú
exceptionsr   r   rè   r   r   r   r   r   r!   ÚImportErrorr¼   r´   Úrich.consoler   Úrich.tracebackr   Ú__all__ÚplatformÚ_IS_WINDOWSr&   rÍ   r-   r9   ÚStyleÚ	RESET_ALLÚBRIGHTÚDIMÚForeÚREDÚBLUEÚCYANÚMAGENTAÚYELLOWÚGREENÚBackÚRED_BACKrà   Ú_use_colorsr<   rò   rñ   Ú_ColorfulStylesÚ_PlainStylesrV   rb   rf   rw   r_   r  r   r   r   Úrich_monochrome_tracebackr   rÜ   rÝ   rª   r«   r   rS  rU  r0   r.   r,   Ú<module>rv     s�  ðñõ #ã 
Û ç .Ý !Ý Ý ÷õ õ '÷õ -ß HÓ HðÛðÛðÛå$Ý(ò€ð �l‰l˜gÑ%€à>€Ø€ö õô>ô'ð ÑØ—‘×(Ñ(€IØ�^‰^×"Ñ"€FØ
�.‰.×
Ñ
€CØ
�-‰-×
Ñ
€CØ�=‰=×Ñ€DØ�=‰=×Ñ€DØ�m‰m×#Ñ#€GØ�]‰]×!Ñ!€FØ�M‰M×Ñ€EØ�}‰}× Ñ �Hð
 €IØ€FØ
€CØ
€CØ€DØ€DØ€GØ€FØ€EØ€Hð Œo×5 °Ð!5€ð €ñ �$Ñ÷ð ó ðñ:  Ø
ØØØØØØØØØØØØñÐ ñ  Ø
ØØØØØØØØØØØØñ€ð" #€Ø€ô�hô ð* ÷ð ó ðð( ÷8ð 8ó ð8÷v5Gñ 5Gñp ‹8€ô
2ð ÷Ið Ió ðIðX �<ò
ð !/Ññ ,Ó-€Nð	ñ !7ÀDÑ IÐð
ôMð, ÑØ"0ÐØ-FÑ*ØÑ"àðÐÐ"Hð ‡M‚Mð	1àØó	ð 	ðÐÐ"H÷
^
&ñ ^
&ñB ‹H€	ðØðØ(+ðØ9Bðàõøð$ ó ØƒHðûð
 ó ØÓðûð ó ØƒDðús6   ÁJ ÁJ$ Á$J3 ÊJ!Ê J!Ê$J0Ê/J0Ê3J?Ê>J?