
    g{                    h    d dl mZ d dlZd dlmZ d dlmZ 	 	 	 	 	 	 d	dZ	 	 	 	 	 	 d
dZddZ	ddZ
y)    )annotationsN)cli_util)ConfigOptionc                    | j                         D ]9  \  }}|j                  d      s|j                  }||   j                  }||k7  s9 y y)zpReturn True if and only if an option in the server section differs
    between old_options and new_options.
    serverTF)items
startswithvalue)old_optionsnew_optionsopt_nameopt_valold_valnew_vals         J/var/www/openai/venv/lib/python3.12/site-packages/streamlit/config_util.pyserver_option_changedr      sV     )..0'""8,--h'--g 1     c                ^   g j                  t        d             fd}fd}fd}fd}| j                         D ]  \  }}|dk(  r|j                         D 	ci c]6  \  }}	|	j                  |k(  r"|	j                  dk(  r|	j                         s||	8 }
}}	t        |
      dk(  rmj                  d	        |d
|z         j                  d	       |
j                         D ]  \  }}|j                  j                  d      d   }t        |j                  xs d	      }t        |      dz
  }t        |      D ]{  \  }}|j                         j                  d      }|r|d   j                         s|dd }|dk(  r|n|}|D ]  } ||j                                 ||k7  skj                  d	       } ddl}|j!                  d|j"                  i      }|dd j                         }t        |      dkD  r%d   d	k7  rj                  d	        |d|z         n	 |j$                  rT |t'        j(                  dd             t        |j*                        D ]
  } ||         |d|j,                  z         |j.                  t0        j2                  k7  }|r |d|j.                  z         |j!                  ||j4                  i      }t        |      dk(  rd| d}n|sd| } ||         t'        j6                  dj9                               yc c}	}w )z8Print the given config sections/options to the terminal.zh
        # Below are all the sections and options you can have in
        ~/.streamlit/config.toml.
    c                X    j                  dt        j                  | d      z          y )N# T)boldappendr   style_for_clitextouts    r   append_descz show_config.<locals>.append_desc9   s!    

4(00DAABr   c                T    j                  dt        j                  |       z          y )Nr   r   r   s    r   append_commentz#show_config.<locals>.append_comment<   s    

4(00667r   c                T    j                  t        j                  | dd             y )NTgreen)r   fgr   r   s    r   append_sectionz#show_config.<locals>.append_section?   s    

8))$TgFGr   c                R    j                  t        j                  | d             y )Nr"   r#   r   r   s    r   append_settingz#show_config.<locals>.append_settingB   s    

8))$7;<r   _testvisibler    z[%s].   
Ndefault
   zDefault: %szDEPRECATED.yellowr&   z+This option will be removed on or after %s.zThe value below was set in %sr   z =
)r   _cleanr   section
visibility
is_expiredlenkeysplit_clean_paragraphsdescription	enumeraterstripstriplstriptomldumpsdefault_val
deprecatedr   r   deprecation_textexpiration_datewhere_definedr   DEFAULT_DEFINITIONr
   print_to_clijoin)section_descriptionsconfig_optionsr   r    r$   r'   r3   _kvsection_optionsr7   optiondescription_paragraphslast_paragraph_idxi	paragraphlinesappend_funcliner?   toml_defaultoption_is_manually_settoml_settingr   s                           @r   show_configrZ   )   s#    CJJ	
C8H= +002
 g ',,.
.1yyG#	(A!,,. qD. 	 
 1$

2v'(

2*002KC**""3'*C%6v7I7I7OR%P"!$%;!<q!@ )*@ A9!((*00
 q!1!!"IE ./!Vk "D. " **JJrN' !B* ::y&2D2D&EFL',224L< 1$r7b=JJrN}|;<   x55mQR-f.E.EFD"4( GA,,- $$(G(GG # &>AUAUUV::sFLL&9:L< A%!#C5~+!#L>2<(C 3+ 3p $))C.)c
s   ";L)c                0    t        j                  dd|       S )zReplace sequences of multiple spaces with a single space, excluding newlines.

    Preserves leading and trailing spaces, and does not modify spaces in between lines.
    z + )resub)txts    r   r2   r2      s    
 66$S!!r   c           	         | j                  d      } | j                  d      }|D cg c])  }dj                  d |j                  d      D              + }}|S c c}w )zHSplit the text into paragraphs, preserve newlines within the paragraphs.r-   z

c              3  2   K   | ]  }t        |        y w)N)r2   ).0rV   s     r   	<genexpr>z$_clean_paragraphs.<locals>.<genexpr>   s     A+@4&,+@s   )r=   r8   rH   )r_   
paragraphsrS   cleaned_paragraphss       r   r9   r9      sf     ))D/C6"J $#I 			A9??4+@AA#   	s   .A)r   dict[str, ConfigOption]r   rf   returnbool)rI   zdict[str, str]rJ   rf   rg   None)r_   strrg   rj   )r_   rj   rg   z	list[str])
__future__r   r]   	streamlitr   streamlit.config_optionr   r   rZ   r2   r9    r   r   <module>ro      s^    # 	  0(7N	$t*(t*+t* 
t*n"	r   