o
    hi                     @  s   d dl mZ d dlZd dlmZmZmZ d dlmZm	Z	m
Z
 ddlmZmZ ddlmZ ddlmZ er:d d	lmZ d
gZ	dddd
ZdS )    )annotationsN)TYPE_CHECKINGTextIOcast)get_bell_environment_variableget_term_environment_variableis_conemu_ansi   )DummyOutputOutput)
ColorDepth)PlainTextOutputStdoutProxycreate_outputFstdoutTextIO | StdoutProxy | Nonealways_prefer_ttyboolreturnr   c                 C  s   t  }t }t }| du r(tj} |r(tjtjfD ]}|dur'| r'|}  nqddlm	} t
| |r;| j} t
| |s3| du rBt S tjdkryddlm} ddlm} ddlm}	m}
 |
 rgtt|	| |d	S t rstt|| |d	S || |d	S dd
lm} |  st| S |j| |||dS )aX  
    Return an :class:`~prompt_toolkit.output.Output` instance for the command
    line.

    :param stdout: The stdout object
    :param always_prefer_tty: When set, look for `sys.stderr` if `sys.stdout`
        is not a TTY. Useful if `sys.stdout` is redirected to a file, but we
        still want user input and output on the terminal.

        By default, this is `False`. If `sys.stdout` is not a terminal (maybe
        it's redirected to a file), then a `PlainTextOutput` will be returned.
        That way, tools like `print_formatted_text` will write plain text into
        that file.
    Nr   r   win32r	   )ConEmuOutput)Win32Output)Windows10_Outputis_win_vt100_enabled)default_color_depth)Vt100_Output)termr   enable_bell)r   r   r   from_envsysr   stderrisattyprompt_toolkit.patch_stdoutr   
isinstanceoriginal_stdoutr
   platformconemur   r   r   	windows10r   r   r   r   r   vt100r   r   from_pty)r   r   term_from_envbell_from_envcolor_depth_from_envior   r   r   r   r   r    r/   `/var/www/html/optinet_system/venv/lib/python3.10/site-packages/prompt_toolkit/output/defaults.pyr      sP   



)NF)r   r   r   r   r   r   )
__future__r   r    typingr   r   r   prompt_toolkit.utilsr   r   r   baser
   r   color_depthr   
plain_textr   r#   r   __all__r   r/   r/   r/   r0   <module>   s    