
    Fg                        S r SSKJr  SSKJrJr  SSKJrJrJ	r	  SSK
Jr  SSKJr  SSKJr  \(       a  SSKJr  \" S	5       " S
 S\5      5       rg)zgr.Code() component    )annotations)CallableSequence)TYPE_CHECKINGAnyLiteral)document)	Component)Events)Timer	languagesc                  J  ^  \ rS rSrSr/ SQr\R                  \R                  \R                  \R                  /r  SSSSSSSSSSSSSSSSSS	.                                   SU 4S
 jjjjrSS jrSS jrSS jrSS jrSS jrSU 4S jjrSrU =r$ )Code   z|
Creates a code editor for viewing code (as an output component), or for entering and editing code (as an input component).
)pythonccppmarkdownjsonhtmlcss
javascriptjinja2
typescriptyaml
dockerfileshellrsqlz	sql-msSQLz	sql-mySQLzsql-mariaDBz
sql-sqlitezsql-cassandraz	sql-plSQLzsql-hivez	sql-pgSQLzsql-gqlz	sql-gpSQLzsql-sparkSQLz	sql-esperNN   T   F)everyinputslines	max_lineslabelinteractive
show_label	containerscale	min_widthvisibleelem_idelem_classesrenderkey
wrap_linesc                  > U[         R                  ;  a  [        SU S35      eX l        XPl        Ub  [        XV5      OSU l        UU l        [        TU ]%  UUUUU	U
UUUUUUUUS9  g)a
  
Parameters:
    value: Default value to show in the code editor. If a function is provided, the function will be called each time the app loads to set the initial value of this component.
    language: The language to display the code as. Supported languages listed in `gr.Code.languages`.
    every: Continously calls `value` to recalculate it if `value` is a function (has no effect otherwise). Can provide a Timer whose tick resets `value`, or a float that provides the regular interval for the reset Timer.
    inputs: Components that are used as inputs to calculate `value` if `value` is a function (has no effect otherwise). `value` is recalculated any time the inputs change.
    label: the label for this component. Appears above the component and is also used as the header if there are a table of examples for this component. If None and used in a `gr.Interface`, the label will be the name of the parameter this component is assigned to.
    interactive: Whether user should be able to enter code or only view it.
    show_label: if True, will display label.
    container: If True, will place the component in a container - providing some extra padding around the border.
    scale: relative size compared to adjacent Components. For example if Components A and B are in a Row, and A has scale=2, and B has scale=1, A will be twice as wide as B. Should be an integer. scale applies in Rows, and to top-level Components in Blocks where fill_height=True.
    min_width: minimum pixel width, will wrap if not sufficient screen space to satisfy this value. If a certain scale value results in this Component being narrower than min_width, the min_width parameter will be respected first.
    visible: If False, component will be hidden.
    elem_id: An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles.
    elem_classes: An optional list of strings that are assigned as the classes of this component in the HTML DOM. Can be used for targeting CSS styles.
    render: If False, component will not render be rendered in the Blocks context. Should be used if the intention is to assign event listeners now but render the component later.
    key: if assigned, will be used to assume identity across a re-render. Components that have the same key across a re-render will have their value preserved.
    lines: Minimum number of visible lines to show in the code editor.
    max_lines: Maximum number of visible lines to show in the code editor. Defaults to None and will fill the height of the container.
    wrap_lines: If True, will wrap lines to the width of the container when overflow occurs. Defaults to False.
z	Language z not supported.N)r&   r"   r#   r'   r(   r)   r*   r+   r,   r-   r.   r/   r0   value)
r   r   
ValueErrorlanguager$   maxr%   r1   super__init__)selfr3   r5   r"   r#   r$   r%   r&   r'   r(   r)   r*   r+   r,   r-   r.   r/   r0   r1   	__class__s                      g/Users/admin/workspace/ai/PDFMathTranslate/myenv/lib/python3.13/site-packages/gradio/components/code.pyr8   Code.__init__=   s    P 4>>)y
/BCC 
2;2GU.T$#!% 	 	
    c                    U$ )zl
Parameters:
    payload: string corresponding to the code
Returns:
    Passes the code entered as a `str`.
 )r9   payloads     r;   
preprocessCode.preprocess   s	     r=   c                j    Uc  g[        U[        5      (       a  [        S5      eUR                  5       $ )z
Parameters:
    value: Expects a `str` of code.
Returns:
    Returns the code as a `str` stripped of leading and trailing whitespace.
Nz{Code component does not support returning files as tuples anymore. Please read the file contents and return as str instead.)
isinstancetupler4   strip)r9   r3   s     r;   postprocessCode.postprocess   s:     =eU##K  {{}r=   c                
    SS0$ )Ntypestringr?   r9   s    r;   api_infoCode.api_info   s    !!r=   c                    gNzprint('Hello World')r?   rL   s    r;   example_payloadCode.example_payload       %r=   c                    grP   r?   rL   s    r;   example_valueCode.example_value   rS   r=   c                "   > [         TU ]  U5      $ )N)r7   process_example)r9   r3   r:   s     r;   rX   Code.process_example   s    w&u--r=   )r5   r$   r%   r1   )NN)$r3   zstr | Callable | Noner5   a;  Literal['python', 'c', 'cpp', 'markdown', 'json', 'html', 'css', 'javascript', 'jinja2', 'typescript', 'yaml', 'dockerfile', 'shell', 'r', 'sql', 'sql-msSQL', 'sql-mySQL', 'sql-mariaDB', 'sql-sqlite', 'sql-cassandra', 'sql-plSQL', 'sql-hive', 'sql-pgSQL', 'sql-gql', 'sql-gpSQL', 'sql-sparkSQL', 'sql-esper'] | Noner"   zTimer | float | Noner#   z7Component | Sequence[Component] | set[Component] | Noner$   intr%   
int | Noner&   
str | Noner'   bool | Noner(   r]   r)   boolr*   r[   r+   rZ   r,   r^   r-   r\   r.   zlist[str] | str | Noner/   r^   r0   zint | str | Noner1   r^   )r@   r\   returnr\   )r3   r\   r_   z
None | str)r_   zdict[str, Any])r_   r   )r3   r\   r_   r\   )__name__
__module____qualname____firstlineno____doc__r   r   changeinputfocusblurEVENTSr8   rA   rG   rM   rQ   rU   rX   __static_attributes____classcell__)r:   s   @r;   r   r      s   I@ 		F (,< A^
D '+JN $ #'"& "/3 $ c^
$^
^
D $E^
F HG^
H I^
J K^
L M^
N !O^
P  Q^
R S^
T U^
V W^
X Y^
Z [^
\ -]^
^ _^
` a^
b c^
 ^
@ "&&. .r=   r   N)rd   
__future__r   collections.abcr   r   typingr   r   r   gradio_client.documentationr	   gradio.components.baser
   gradio.eventsr   gradio.componentsr   r   r?   r=   r;   <module>rs      sF     " . . . 0 ,  ' 
+n.9 n. n.r=   