
    xit                     H#   d dl Z d dlZd dlmZ d dlmZ d dlZej        j	        ej        j
        ej        j        ej        j        ej        j        ej        j        ej        j        ej        j        gZej        j        j        Zej        j        j        Zg dZg dZ eej        j	        j        ej        j	                  d         Z eej        j	        j        ej        j	                  d         Zd Zd Z e            \  ZZd	Z  ej!        ej        	                                e d
d          5 Z" ej#                    5   ej$        ddd          5   ej#                    5   ej%        dd          Z& ej%        ddd          Z'ddd           n# 1 swxY w Y    ej(                    5   ej)        d          5   ej*        d            ej+        d eD             ddd          Z, ej%        dd          Z-ddd           n# 1 swxY w Y    ej)        d           5   ej*        d!            ej+        d" eD             d#$          Z. ej/        d%d&          5  g Z0eD ])Z1e02                     ej3        d'e1 $                     *	 ddd           n# 1 swxY w Y    ej+        d( eD             d)$          Z4 ej/        d*d&          5  g Z5eD ])Z1e52                     ej3        d+e1 $                     *	 ddd           n# 1 swxY w Y    ej+        d, eD             d-$          Z6 ej/        d.d&          5  g Z7eD ])Z1e72                     ej3        d/e1 $                     *	 ddd           n# 1 swxY w Y   ddd           n# 1 swxY w Y    ej)        d0          5   ej*        d1            ej+        d2 eD             d3$          Z8 ej/        d4d&          5  g Z9eD ])Z1e92                     ej:        d5e1 $                     *	 ddd           n# 1 swxY w Y    ej+        d6 eD             d7$          Z; ej/        d8d&          5  g Z<eD ])Z1e<2                     ej:        d9e1 $                     *	 ddd           n# 1 swxY w Y    ej+        d: eD             d;$          Z= ej/        d<d&          5  g Z>eD ])Z1e>2                     ej:        d=e1 $                     *	 ddd           n# 1 swxY w Y   ddd           n# 1 swxY w Y    ej)        d>          5   ej*        d?            ej*        d@           g g cZ?Z@ eAdA          D ]{Z1 ej#                    5   ej:        dBe1dz    $          ZB ejC        dC$          ZDe?2                    eB           e@2                    eD           ddd           n# 1 swxY w Y   |g g cZEZF ej*        dD            eAdA          D ]{Z1 ej#                    5   ej:        dBe1dz    $          ZB ejC        dC$          ZDeE2                    eB           eF2                    eD           ddd           n# 1 swxY w Y   |	 ddd           n# 1 swxY w Y   g ZGdE eD             dF eD             z   dG eD             z   ZHeHdd         eHdd         dH eD             dI eD             dJ eD             dK eD             g dLdMgg dN	ZIeD ]PZJeJK                    dO          reIL                                D ]#\  ZMZNeMeJv reN2                    dPeJz               n$QeIdQ         eIdR          eOeH          d         z   eIdR         eIdQ          eOeH          d         z   ceIdQ<   eIdR<   eD ]\  ZPZQZR ej)        eP          5   ej*        eQdSz              eRD ]pZJg ZNeID ]7ZMeMeJv r1eIeM         dd         ZNdPeJz   eNv reNS                    dPeJz               n8 ej+        eJ eeJ          eNdTU          ZTeG2                    eT           q	 ddd           n# 1 swxY w Y   	 ddd           n# 1 swxY w Y   ddd           n# 1 swxY w Y    ej$        dVdWX          5   ej$        dYZ          5   ej*        d[            ej/        d\d]          5   ejU        d^_          ZVddd           n# 1 swxY w Y    ej/        d`d]          5   ej*        da            ej#                    5   ej:        db$          ZW ej:        dc$          ZX ej:        dddef          ZYddd           n# 1 swxY w Y    ej%        d`          ZZ ej*        dg          Z[ddd           n# 1 swxY w Y    ej*        dh           ddd           n# 1 swxY w Y    ej:        didjdkdkdTl          Z\ ej]        dm dndo            ej#                    5   ej^        dp$          Z_ ej^        dq$          Z`ddd           n# 1 swxY w Y    eja        g drds$            ej#                    5   ej$        dYdt          5   ej*        du            ejb        g drdvdwx          Zc ej+        g dydz          Zd ej+        g d{dTd|gd}dT~          Ze ejC        d$          Zfddd           n# 1 swxY w Y    ej$        dYdt          5   ejg        ddd          Zh ej#                    5   ej%        ddZ          Zi ej%        ddZ          Zjd Zkeil                    ekecedeeefe\gehd           d Zmejl                    emdeh           ddd           n# 1 swxY w Y    ej#                    5   ej%        dd          Zn ejo        d          Zp ej%        ddd          Zqddd           n# 1 swxY w Y   ddd           n# 1 swxY w Y   ddd           n# 1 swxY w Y    ejr        dddgdTgddddgdggecedeeefgd            ej#                    5   ejs        g dg dg dgd            ejt        dddg dddd            eju        dddd            ejv                     ddd           n# 1 swxY w Y    ej#                    5   ej3                      ejw        d            ejx        g ddd           ddd           n# 1 swxY w Y    ej#                    5   ej$        d          5   ejy        dgd$          Zz ej{        dTd          Z| ej%        d          Z}e}l                    d ezezd           ddd           n# 1 swxY w Y    ej$        d          5   ej/        d          5   ej*        d            ej~        d$            ej~        d$            ej~        d$           ddd           n# 1 swxY w Y   ddd           n# 1 swxY w Y   ddd           n# 1 swxY w Y   ddd           n# 1 swxY w Y    ej:        dg          Z ejt        dg          Ze"                    ddddd           e.e4e6ge0z   e5z   e7z   e8e;e=gz   e9z   e<z   e>z   e?z   e@z   eEz   eFz   eGz   Zd Zd Z ej        g           Z ej        d          Zd Zd Zd Z ee.                    ee.e0d          j                    ee4                    ee4e5d          j                    ee6                    ee6e7d          j                   e0e5e7fD ]ZeD ]Z eej                   d Z ee8                    ee8e9d          j                    ee;                    ee;e<d          j                    ee=                    ee=e>d          j                    ee-l                    ee,ed          j                   e9e<z   e>z   e?z   eEz   D ]"Z eej                    eej                   #eGD ]"Z eej                    eej                   #e@eFz   D ]Z eej                   e'l                    ddddd           d Z ee&l                    eegee,gez   d          j                   d ZeZl                    d deZd                              eeeWeXeYhe[eZgd           ddd           n# 1 swxY w Y   ddd           n# 1 swxY w Y   edk    re"                                 dS dS )    N)Iterable)document_fn)2   d      i,    i  iX  i  i   i  i  )xxsxssmmdlgxlxxl   c                 x    t           t          z   D ]}|d         | k    r
|d         c S t          d|  d          )Nnamedocz	Variable z" not found in theme documentation.)docs_theme_coredocs_theme_vars
ValueError)var
parameterss     i/root/.openclaw/workspace/chatterbox_venv_py311/lib/python3.11/site-packages/gradio/themes/builder_app.py
get_docstrr      sV    %7 % %
f$$e$$$$ %
HHHH
I
II    c                  ^   t          j        t          j        j        j                  } g }d d g g f\  }}}}|                                 D ]}|                                }|                    d          r n|                    d          r=||	                    |||f           |dd          
                    d          \  }}g }d|v rE|
                    d          d         }|	                    |           |	                    |           |	                    |||f           ||fS )N)z#    z: =r   )inspect	getsourcegrthemesBaseset
splitlinesstrip
startswithappendsplit)sourcegroupsgroupdesc	variablesflat_variablesliner   s           r   get_doc_theme_var_groupsr2   #   s7   ry~122FF-14R-?*E4N!!## ' 'zz||??3 
	'E__T"" 	' udI6777qrr(....KE4IID[[**S//!$CS!!!!!#&&&
MM5$	*+++>!!r   a  
.gradio-container {
    overflow: visible !important;
    max-width: none !important;
}
#controls {
    max-height: 100vh;
    flex-wrap: unset;
    overflow-y: scroll;
    position: sticky;
    top: 0;
}
#controls::-webkit-scrollbar {
  -webkit-appearance: none;
  width: 7px;
}

#controls::-webkit-scrollbar-thumb {
  border-radius: 4px;
  background-color: rgba(0, 0, 0, .5);
  box-shadow: 0 0 1px rgba(255, 255, 255, .5);
}
zGradio Theme Builderz<style id='theme_css'></style>)themecsstitleheadcontrolsr   )scaleelem_id	min_widthUndor   )sizez	Dark Modeprimary)variantr<   zSource Themez
                    Select a base theme below you would like to build off of. Note: when you click 'Load Theme', all variable values in other tabs will be overwritten!
                    c                     g | ]	}|j         
S  __name__).0r3   s     r   
<listcomp>rD   e   s    <<<E<<<r   r$   FTheme)value
show_labellabelz
Load Theme
load_theme)r9   zCore Colorsa  Set the three hues of the theme: `primary_hue`, `secondary_hue`, and `neutral_hue`.
                        Each of these is a palette ranging from 50 to 950 in brightness. Pick a preset palette - optionally, open the accordion to overwrite specific values.
                        Note that these variables do not affect elements directly, but are referenced by other variables with asterisks, such as `*primary_200` or `*neutral_950`.c                     g | ]	}|j         
S r@   r   rC   colors     r   rD   rD   r       888888r   zPrimary Hue)rH   zPrimary Hue Palette)rH   openprimary_c                     g | ]	}|j         
S r@   rK   rL   s     r   rD   rD   ~   rN   r   zSecondary HuezSecondary Hue Palette
secondary_c                     g | ]	}|j         
S r@   rK   rL   s     r   rD   rD      rN   r   zNeutral huezNeutral Hue Paletteneutral_zCore Sizinga  Set the sizing of the theme via: `text_size`, `spacing_size`, and `radius_size`.
                        Each of these is set to a collection of sizes ranging from `xxs` to `xxl`. Pick a preset size collection - optionally, open the accordion to overwrite specific values.
                        Note that these variables do not affect elements directly, but are referenced by other variables with asterisks, such as `*spacing_xl` or `*text_sm`.
                        c                 P    g | ]#}|j                             d           |j         $S )text_r   r(   rC   r<   s     r   rD   rD      s/    VVVt	8L8LW8U8UVVVVr   z	Text SizezText Size RangerV   c                 P    g | ]#}|j                             d           |j         $S )spacing_rW   rX   s     r   rD   rD      s@        $#y33J?? I  r   zSpacing SizezSpacing Size RangerZ   c                 P    g | ]#}|j                             d           |j         $S )radius_rW   rX   s     r   rD   rD      s@        $#y33I>> I  r   zRadius SizezRadius Size Ranger\   z
Core Fontsa	  Set the main `font` and the monospace `font_mono` here.
                        Set up to 4 values for each (fallbacks in case a font is not available).
                        Check "Google Font" if font should be loaded from Google Fonts.
                        z### Main Font   zFont zGoogle Fontz### Monospace Fontc                     g | ]}d | S )z	*primary_r@   rC   is     r   rD   rD      s    <<<___<<<r   c                     g | ]}d | S )z*secondary_r@   r_   s     r   rD   rD      s!    @@@Q(Q((@@@r   c                     g | ]}d | S )z	*neutral_r@   r_   s     r   rD   rD      s    >>>11>>>r   c                     g | ]}d | S )z*text_r@   r_   s     r   rD   rD      s    !C!C!C1,1,,!C!C!Cr   c                     g | ]}d | S )z*radius_r@   r_   s     r   rD   rD      s    BBB!~!~~BBBr   c                     g | ]}d | S z	*spacing_r@   r_   s     r   rD   rD      s    DDDAADDDr   c                     g | ]}d | S rf   r@   r_   s     r   rD   rD      s    @@@OOO@@@r   )100200300400500600700800none)	fillrM   	text_sizeradiuspaddinggapweightshadowborder_width_dark*rq   rM   z^
You can set these to one of the dropdown values, or clear the dropdown to set a custom value.T)rH   infochoicesallow_custom_value   app)r8   r9   panel)r>   ai  
                    # Theme Builder
                    Welcome to the theme builder. The left panel is where you create the theme. The different aspects of the theme are broken down into different tabs. Here's how to navigate them:
                    1. First, set the "Source Theme". This will set the default values that you can override.
                    2. Set the "Core Colors", "Core Sizing" and "Core Fonts". These are the core variables that are used to build the rest of the theme.
                    3. The rest of the tabs set specific CSS theme variables. These control finer aspects of the UI. Within these theme variables, you can reference the core variables and other theme variables using the variable name preceded by an asterisk, e.g. `*primary_50` or `*body_text_color`. Clear the dropdown to set a custom value.
                    4. Once you have finished your theme, click on "View Code" below to see how you can integrate the theme into your app. You can also click on "Upload to Hub" to upload your theme to the Hugging Face Hub, where others can download and use your theme.
                    z	View Code)rO   python)languageUpload to HubzYou can save your theme on the Hugging Face Hub. HF API write token can be found [here](https://huggingface.co/settings/tokens).z
Theme NamezHugging Face Write TokenVersionz,Leave blank to automatically update version.)rH   placeholder)visiblez3Below this panel is a dummy app to demo your theme.Namez8Full name, including middle name. No special characters.zJohn Doe)rH   r{   r   rF   interactivec                     | S )Nr@   xs    r   <lambda>r   M  s    1 r   numbertextboxzSlider 1zSlider 2)ABCzCheckbox Group)r>   r8   z
## Panel 1RadiozLorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.)rH   r{   )Option 1Option 2zOption 3)rG   )Option AOption BOption Cr   Dropdown)multiselectrF   rH   r   Gor   Ghttps://gradio-static-files.s3.us-west-2.amazonaws.com/header-image.jpgImagei@  )rH   heightClear	secondaryc                  .    t          j        d           dS )N   r   timesleep)_argss    r   gor   q  s     JqMMM#l#lr   show_apic                  .    t          j        d           d S )N皙?r   r@   r   r   clearr   |  s     JsOOOOOr   zButton 1Stopstopr   r   r   r   r   r   Examples)examplesinputsrH   )r   r   r   )r]      r~   )      	   	Dataframe)rF   rH   a)testtest2)r   bcJSONgffffff?r   g?)catdogfish)rF   z@https://gradio-static-files.s3.us-west-2.amazonaws.com/world.mp4))z?https://gradio-static-files.s3.us-west-2.amazonaws.com/lion.jpglion)z?https://gradio-static-files.s3.us-west-2.amazonaws.com/logo.pnglogo)z@https://gradio-static-files.s3.us-west-2.amazonaws.com/tower.jpgtower200px)r   columns)r8   )HelloHiChatbot)r   rG   zAdd messagesc                 @    | ddggz   t          j        d          pg z   S )NzHow are you?z
I am good.r   r   )historys    r   r   r     s+    *L9:);:a==.B)0 r   zAdvanced Settingsr   zChatbot control 1zChatbot control 2zChatbot control 3a  () => {
                let evt_listener = window.setTimeout(
                    () => {
                        load_theme_btn = document.querySelector('#load_theme');
                        if (load_theme_btn) {
                            load_theme_btn.click();
                            window.clearTimeout(evt_listener);
                        }
                    },
                    100
                );
            }jsr   c                 0     fdt           D             d         }t          j        |j                  j        }|d         j        }|d         j        }|d         j        }|d         j        }|d         j        }|d         j        } |            }|j        d d	         }	|j        d d	         }
d
 |	D             }d |
D             }d }g }t          D ]V}t          ||          }|-|
                    d          rt          ||d d                   }|                    |           W|j        |j        |j        g|                                z   |                                z   |                                z   |j        |j        |j        gz   |                                z   |                                z   |                                z    |d |	D                       z    ||          z    |d |
D                       z    ||          z   |z   S )Nc                 *    g | ]}|j         k    |S r@   rA   )rC   r3   
theme_names     r   rD   zload_theme.<locals>.<listcomp>  s%    OOOu%.J2N2NU2N2N2Nr   r   primary_huesecondary_hueneutral_huerr   spacing_sizeradius_sizer]   c                 L    g | ]!}t          |t          j        j                  "S r@   
isinstancer"   r#   
GoogleFontrC   fs     r   rD   zload_theme.<locals>.<listcomp>  s'    PPPajBI,@AAPPPr   c                 L    g | ]!}t          |t          j        j                  "S r@   r   r   s     r   rD   zload_theme.<locals>.<listcomp>  s4     # # #89
1bi233# # #r   c                 4    | d gdt          |           z
  z  z   S )Nr]   )lenr   s    r   pad_to_4zload_theme.<locals>.pad_to_4  s    D6QQZ000r   ry   c                 @    g | ]}t          |d           r|j        n|S rK   hasattrr   r   s     r   rD   zload_theme.<locals>.<listcomp>  s-    NNNAga&8&8?AFFaNNNr   c                 @    g | ]}t          |d           r|j        n|S rK   r   r   s     r   rD   zload_theme.<locals>.<listcomp>!  s-    SSSAga&8&8?AFFaSSSr   )r#   r    	signature__init__r   default_font
_font_monor0   getattrendswithr)   r   expand)r   r3   r   r   r   r   rr   r   r   font	font_monofont_is_googlefont_mono_is_googler   
var_outputvariable	theme_vals   `                r   rI   rI     s   OOOOOOOPQRE *5>::EJ$]3;K&7?M$]3;K";/7I%n5=L$]3;KEGGE;rr?D(!,IPP4PPPN# #=F# # #1 1 1 J* - -#E844	$):):7)C)C$ 'x} = =I!!),,,, !=#5{7GH$$&&'&&(() $$&&' ><#4k6FG	H
 ""$$% %%''( $$&&' (NNNNNOOP (>**	+ (SSSSSTT
U (.//0 r   c                 
   0  }  fdt           D             d                      t          j         j                  j        }|d         j        }|d         j        }|d         j        }	|d         j        }
|d         j        }|d         j        }|d	         j        }t          |t                    s|gn|}d
 |D             }|d         j        }t          |t                    s|gn|}d |D             }i }i }g d}t          ||||	|
||gt          j         j
        t          j         j
        t          j         j
        t          j         j        t          j         j        t          j         j        g|d          D ]i\  }}}0|j        0k    r0||<   0fd|j        D             d         }i }d}t          |          D ]}|dv s|                    d          r|                    d          d         dz   |t          j         j
        k    r
|dd          n|z   }t#          ||          ||<   t#          ||          ||         k    rd}|ri }|                                D ]y\  }}|                    d          r$d|                    d          d         z   }|||<   >|                    d          r!|                    d          d         }|||<   t|||<   z||f||<   ki }d |D             }d |D             }|d d         }|d d         }||d	f||dffD ]^\  } }!}"t'          |           t'          |!          k    s)t)          d t          | |!d          D                       rd |!D             ||"<   _d}#d}$t'          |          t'          |          z   dk    r|D ]}%|%|v rO||%         \  }&}'|$d |% d!|&j         d"d#                    d$ |'                                D                        d%z  }$U|%|v rD||%         }(|%                    d&          r|(                    d          d         }(|$d |% d'|( d(z  }$d})t'          |          dk    r1d                    d) |                                D                       })i }*t0          D ]j}+t#           |+          },t#          ||+          }-|,-|+                    d*          rt#           |+d d+                   },|,|-k    rt#          ||+          |*|+<   kd}#d}.t'          |*          dk    r;d,d-|#z   d z                       d. |*                                D                        d/}.d0| d"|$s|)r|#nd |$ |) d1|. d2	}/|/S )3Nc                 *    g | ]}|j         k    |S r@   rA   )rC   r3   
base_themes     r   rD   z'generate_theme_code.<locals>.<listcomp>*  s%    TTTEu~7S7S%7S7S7Sr   r   r   r   r   rr   r   r   r   c                     g | ]B}t          |t          j        j                  st          j                            |          n|CS r@   r   r"   r#   Fontr   s     r   rD   z'generate_theme_code.<locals>.<listcomp>7  sN        *4Ary~)F)FM	q!!!A  r   r   c                     g | ]B}t          |t          j        j                  st          j                            |          n|CS r@   r   r   s     r   rD   z'generate_theme_code.<locals>.<listcomp>?  sN        *4Ary~)F)FM	q!!!A  r   )r   r   r   rr   r   r   Fstrictc                 *    g | ]}|j         k    |S r@   rK   )rC   objfinal_values     r   rD   z'generate_theme_code.<locals>.<listcomp>e  s,       sx;7N7NC7N7N7Nr   )allr   r   _r   T)rP   rR   rT   r   )rV   rZ   r\   c                 "    g | ]}|d          
|S r   r@   rC   r   s     r   rD   z'generate_theme_code.<locals>.<listcomp>  !    MMMT!WMMMMr   c                 "    g | ]}|d          
|S r  r@   r  s     r   rD   z'generate_theme_code.<locals>.<listcomp>  r  r   r]   c              3      K   | ]A\  }}|j         |d          k    p(t          |t          j        j                  |d         k    V  BdS )r   r   N)r   r   r"   r#   r   )rC   	base_font
theme_fonts      r   	<genexpr>z&generate_theme_code.<locals>.<genexpr>  sq       D D .	: Njm3 T!)RY-ABBjQRmSD D D D D Dr   c                 0    g | ]\  }}|rd | dnd| dS )zgr.themes.GoogleFont('z')'r@   )rC   	font_nameis_google_fonts      r   rD   z'generate_theme_code.<locals>.<listcomp>  sR     1 1 1 6I~ *.>>>>>----1 1 1r   
     z=gr.themes.(, c              3   ,   K   | ]\  }}| d | dV  dS )=""Nr@   rC   kvs      r   r  z&generate_theme_code.<locals>.<genexpr>  s\        bM  bMw{wxz{ghbrbrlmbrbrbr  bM  bM  bM  bM  bM  bMr   z),
_sizer  z",
c                 L    g | ]!\  }}d | dd                     |           d"S )r  z=[r  z],
)join)rC   font_set_namefontss      r   rD   z'generate_theme_code.<locals>.<listcomp>  sL       0M5 KJJ$))E2B2BJJJ  r   ry   r   z
.set(
    ,c                 $    g | ]\  }}| d | dS )z='r
  r@   r  s      r   rD   z'generate_theme_code.<locals>.<listcomp>  s(    #O#O#OTQqLLALLL#O#O#Or   z
)z(
import gradio as gr

theme = gr.themes.r   z.

with gr.Blocks(theme=theme) as demo:
    ...)r#   r    r   r   r   r   r   r   zipr"   ColorSizer   r   dirr(   r*   r   itemsr   anyrB   r  r   r0   )1r   final_themecore_variablesfinal_main_fontsfinal_mono_fontsbase_theme_namer   r   r   r   rr   r   r   r   r   
core_diffsspecific_core_diffscore_var_names
value_name
base_valuesource_class
source_objfinal_attr_valuesdiffattrfinal_theme_attrnew_final_attr_valueskeyval	color_keysize_key
font_diffsbase_font_settheme_font_setr  newlinecore_diffs_codevar_nameclsvalsvar_valfont_diffs_code	var_diffsr   base_theme_valfinal_theme_valvars_diff_codeoutputr   s1   `                                               @r   generate_theme_coderI  &  s    )OTTTTVTTT  J !*:+>??JJ$]3;K&7?M$]3;K";/7I%n5=L$]3;Kf%-D!+D(!;!;ED66D   D #;/7I#-i#B#BQ	  "  I
 J"$  N FI!  IOIOIOINININ 'F F F 8 8A
Jk* ?k11-8Jz*   #/#3  
 %'!
OO $ $D888DOOC<P<P8 "((--a0'3ry'F'F488DR %
 ;B#%5; ;%&67 z4004EFV4WWW# ,.)$5$;$;$=$= = =S>>*PQQ =(+ciinnR.@(@I?B1)<< ^^,LMM ='*yy~~b'9H>A1(;;9<1#66$-7'
3
 JMM1AMMMMM1AMMM8D!"1"I'0,k:A  <~} }%%^)<)<<< D D 25%~e2 2 2D D D A A<1 1 :H	1 1 1J}- G O:%8!9!99A== . P PH#666$7$A	T'  ,UH  ,U  ,U  ,U  ,UX\XaXa  bM  bM  @D  @J  @J  @L  @L  bM  bM  bM  YM  YM  ,U  ,U  ,U  U!Z//",X"6#,,W55 =&-mmC&8&8&<G'+OH+O+O+O+O+OO O:"""$'' 4>4D4D4F4F  # # I* I I!(X!>!>")+x"@"@!)h.?.?.H.H)%,Z#2#%G%GN!_44*1+x*H*HIh'GN9~~!!"	Gmf""#O#OY__=N=N#O#O#OPP" " " #  1@%Z?%ZWWXZ ]l n}  @N  F Mr   c                    |dd         \  }}}|ddt          t                    z            }|dt          t                    z   ddt          t                    z  z            }|ddt          t                    z  z   ddt          t                    z  z            }|ddt          t                    z  z   ddt          t                    z  z            \  }	}
}|ddt          t                    z  z   ddt          t                    z  z   t          t                    z            }|ddt          t                    z  z   t          t                    z   ddt          t                    z  z   dt          t                    z  z            }|ddt          t                    z  z   dt          t                    z  z   ddt          t                    z  z   dt          t                    z  z            }|ddt          t                    z  z   dt          t                    z  z   ddt          t                    z  z   dt          t                    z  z   dz            }|ddt          t                    z  z   dt          t                    z  z   dz   ddt          t                    z  z   dt          t                    z  z   dz            }|ddt          t                    z  z   dt          t                    z  z   dz   ddt          t                    z  z   dt          t                    z  z   dz            }|ddt          t                    z  z   dt          t                    z  z   dz   ddt          t                    z  z   dt          t                    z  z   dz            }|ddt          t                    z  z   dt          t                    z  z   dz   d          }t          j        j        | }t          j        j        | }t          j        j        | }t          j        j        | }t          j        j        | }t          j        j        | }g }t                      }t          t          |d	
          D ]\  }}d|v r|
                    |           t          |          }t          ||d	
          D ]@\  }}|s|r!t          j                            ||          }|                    |           Ag } t          ||d	
          D ]@\  }!}|!s|r!t          j                            |!|          }!|                     |!           At          j                            ||||||||           }" |"j        di t          t          t          |d	
                     ||f}#t          |           dk    s&t!          | d                   t!          |#          k    r|                     |#           | |"                                |"j        t'          ||"||||	|
|ft)          t          ||d	
                    t)          t          ||d	
                              |"fS )Nr   r   r   r~   r]   r         Fr   rv   )weights)r   r   r   rr   r   r   r   r   r   r@   )r   palette_range
size_ranger"   r#   r   r!  r%   r  r0   addsortedr   r)   r$   dictstr_get_theme_css_stylesheetsrI  list)$r   r   argsr   r   r   primary_huessecondary_huesneutral_huesrr   r   r   
text_sizesspacing_sizesradius_sizes
main_fontsmain_is_google
mono_fontsmono_is_googleremaining_argsfinal_primary_colorfinal_secondary_colorfinal_neutral_colorfinal_text_sizefinal_spacing_sizefinal_radius_sizer'  font_weightsr3  r7  	main_font	is_googler(  	mono_fontr3   new_steps$                                       r   render_variablesrn    s   6:1Q3i3KAM(:(:$: :;L!!c-&8&8"81q3}CUCU?U;U"UVNAM(:(:$: :QSEWEWAW=W WXL37AM****QS5G5G1G-GG40I|[ AM****Qc-(((.)j//." "J
 !AM****S__<qc-(((@)c*oo%@& &M
  AM****QZ-@@1c-(((D)c*oo%D& &L
 AM****QZ-@@1c-(((D)c*oo%D& D J "AM****QZ-@@1Dqc-(((H)c*oo%H& H N AM****QZ-@@1Dqc-(((H)c*oo%H& H J "AM****QZ-@@2Ec-(((I)c*oo%I& I N "AM****QZ-@@2EGGN #%)/<"@$&IO^$D!"$)/<"@ inj9O!#!? "	 =!55L NNN * *	ct## $$S)))!,//L(+Ju(U(U(U 3 3$	9   V "	 4 4Y 4 U UI ''	2222!(+Ju(U(U(U 3 3$	9   V "	 4 4Y 4 U UI ''	2222INN/3/)/-%* # 	 	E EIPPSNNNOOPPP"D)H7||q  C$4$4H$E$Ex((( $$&&"##%#!$# ZFFFGGZFFFGG  % r   c           	           | t           t          t          gt          z   t          t          t
          t          t          gd                              d t          t
          gd dd          S )NFr   a  (css, fonts) => {
                    document.getElementById('theme_css').innerHTML = css;
                    if (fonts && Array.isArray(fonts)) {
                        let existing_font_links = document.querySelectorAll('link[rel="stylesheet"][href^="https://fonts.googleapis.com/css"]');
                        existing_font_links.forEach(link => {
                            if (fonts.includes(link.href)) {
                                fonts = fonts.filter(font => font != link.href);
                            } else {
                                link.remove();
                            }
                        });
                        fonts.forEach(font => {
                            let link = document.createElement('link');
                            link.rel = 'stylesheet';
                            link.href = font;
                            document.head.appendChild(link);
                        });
                    }
                }r   )	rn  r   base_theme_dropdowntheme_inputs
secret_csssecret_fontoutput_codecurrent_themethen)evt_listeners    r   attach_rerenderrx  H  sk    < -.=*k;N	  
 d[)& /   r   c                 ^      fdt           D             d         fdt          D             S )Nc                 *    g | ]}|j         k    |S r@   rK   )rC   rM   
color_names     r   rD   zload_color.<locals>.<listcomp>i  s%    KKKu%*
2J2JU2J2J2Jr   r   c                 6    g | ]}t          d |           S )r   r   )rC   r`   rM   s     r   rD   zload_color.<locals>.<listcomp>j  s)    CCCGE7q77++CCCr   )colorsrN  )r{  rM   s   `@r   
load_colorr  h  s<    KKKKKKKANECCCC]CCCCr   c                 ^      fdt           D             d         fdt          D             S )Nc                 *    g | ]}|j         k    |S r@   rK   )rC   r<   	size_names     r   rD   zload_size.<locals>.<listcomp>  s%    EEETdi9.D.DD.D.D.Dr   r   c                 0    g | ]}t          |          S r@   r}  )rC   r`   r<   s     r   rD   zload_size.<locals>.<listcomp>  s#    999GD!$$999r   )sizesrO  )r  r<   s   `@r   	load_sizer    s<    EEEEUEEEaHD9999j9999r   a  () => {
            if (document.querySelectorAll('.dark').length) {
                document.querySelectorAll('.dark').forEach(el => el.classList.remove('dark'));
            } else {
                document.querySelector('body').classList.add('dark');
            }
        }c                     t          |           dk    rt          t          j                    iS |                                  |                                 }| |d         gt          |d                   z   S )Nr   r   )r   r   r"   skippoprV  )history_varolds     r   undor    sc    ;1$$++!!!!oo''#SV,tCF||;;r   c                    	 | t                                        | t                   | t                   pd | t                   | t                             }d                    |                    d          dd                    }t          j        d| d| dd          d	fS # t          $ r%}t          j        d
| d          d	fcY d }~S d }~ww xY w)N)	repo_nameversionhf_tokenr   /zTheme uploaded [here!](z )! Load it as `gr.Blocks(theme='z')`T)rF   r   r   zError: )
ru  push_to_hubr   theme_versiontheme_hf_tokenr  r*   r"   Markdown	Exception)data	theme_url
space_namees       r   upload_to_hubr    s    /;;":. /74!.1#J/	 <  	 !XXiooc&:&:233&?@@
Kr	rrcmrrr $   $     K+mm $   $      s   B B# #
C-CCCc                      dS )NzUploading...r@   r@   r   r   r   r     s    N r   __main__)r    r   collections.abcr   gradio_client.documentationr   gradior"   r#   r$   DefaultSoft
MonochromeGlassOriginCitrusOceanr   r   r~  r!  r  rN  rO  r   r   r%   r   r   r2   variable_groupsr0   r4   BlocksdemoRowColumnButtonundo_btndark_mode_btnTabsTabItemr  r   rp  load_theme_btnr   	AccordionrX  r`   r)   ColorPickerr   rY  r   rZ  rr   r[  Textboxr   r\  r   r]  r^  r_  ranger   Checkboxr   r`  ra  theme_var_inputcore_color_suggestionsvariable_suggestionsr   r   r#  
style_typesuggestionsr   r-   r.   r/   removedropdownCodert  r   r  r  upload_to_hub_btntheme_upload_statusr   	InterfaceSliderslider1slider2CheckboxGroupr   radiodropdrop_2checkr   imggo_btn	clear_btnr   clickr   btn1UploadButtonbtn2stop_btnr   r   r   LabelFileVideoGalleryr   chatbotMultimodalTextbox
multimodalchat_btnNumberrr  rs  loadrq  rI   rI  Stater   ru  rn  rx  r  selectrv  hue_sethueblurr  change	theme_boxsubmitcheckboxr  r  rB   launchr@   r   r   <module>r     s"     $ $ $ $ $ $ 3 3 3 3 3 3     INIINIIOIIIO	
 
	
	FFF999
+bin5ry~FFqI+bin0").AA!DJ J J" " "* #;":"<"< 0 RY
)..


 	)	   W

 
	 Q
 Q
RYQ
cBBB J	= J	= U U$29V$777 )	+yt T T TU U U U U U U U U U U U U U U  F= F=RZ// S SBK  
 +6"+<<V<<<$#(%	+ + +' &/RY|\%R%R%RNS S S S S S S S S S S S S S S  RZ.. ( (BKv  
 #."+88888# # #K &,ANNN  ')!.  A(// .*8Q..!" !" !"                  %0BK88888% % %M &,C%PPP  )+!.  A*11 .*:q*:*:!" !" !"                  #."+88888# # #K &,ANNN  ')!.  A(// .*8Q..!" !" !"                 C( ( ( ( ( ( ( ( ( ( ( ( ( ( (T  RZ.. 4 4BK   !,VVuVVV)! ! !I &,=EJJJ  %'
!+  A&-- *
*5!++!" !" !"                  $/2; (-  
 -$ $ $L &,@uMMM  (*!+  A)00 *
*8Q..!" !" !"                  #."+ (-  
 ,# # #K &,?eLLL  ')!+  A(// *
*7A--!" !" !"                 [4 4 4 4 4 4 4 4 4 4 4 4 4 4 4l  RZ-- B BBK    BK00013R.J"U1XX B B#RVXX B B#-2:OAEOO#D#D#DD-8R[}-M-M-MN&--d333*11.AAA	B B B B B B B B B B B B B B B 24R.JBK 4555"U1XX B B#RVXX B B#-2:OAEOO#D#D#DD-8R[}-M-M-MN&--d333*11.AAA	B B B B B B B B B B B B B B BB%B B B B B B B B B B B B B B B2 #% =<m<<<@@-@@@A>>>>>? ' 311153AAA6!C!C
!C!C!CBBzBBBDDDDD@@Z@@@	 	 	  &h$&%( ($( !/ " "H((11 ! 3G3M3M3O3O " "/
K%11'..sX~>>>!E 2
 )0*73CC8N4O4O4Q4QRS(1*62337M3N3N3P3PQR L$V,.B7.K /> = =*E4#E** = =# @   )2 = =H*,K.B * *
#-#9#92Fz2RSTSTST2UK'*X~'D'D(3(:(:3>(J(J(J$)E	 $:
 (3r{&.%/Z%9%9(337	( ( (H ,228<<<<== = = = = = = = = = = = = = ==eF= F= F= F= F= F= F= F= F= F= F= F= F= F= F=	J	= J	= J	= J	= J	= J	= J	= J	= J	= J	= J	= J	= J	= J	= J	=\ RYQ... g	= g	=7+++ S S	 	 	 "R\+E::: = =")"'8"<"<"<K= = = = = = = = = = = = = = =!R\/>>> E EBK [      %/RZl%C%C%C
)3:T)U)U)U(2
"+(V) ) )               )2	/(B(B%*5"+e*D*D*D'E E E E E E E E E E E E E E E QRRR7S S S S S S S S S S S S S S S: 2:O&    D BLh	::: 6 6#")*555#")*5556 6 6 6 6 6 6 6 6 6 6 6 6 6 6 B___4DEEEE 0P 0PRYwa888 4 4BK---$BH'% G  E
 '2;<<<  D )R[<<<$()l($(  F (BKd333E#4 4 4 4 4 4 4 4 4 4 4 4 4 4 4$ RYwa888 P P""(a%"  C
   : :!*4!C!C!C$-BIg{$K$K$K	m m m "D&%>%*	 %   , , , "tS999%: : : : : : : : : : : : : : :(   P P(ry$???.rD999#,29VV$#O#O#OP P P P P P P P P P P P P P P5P P P P P P P P P P P P P P P'0P 0P 0P 0P 0P 0P 0P 0P 0P 0P 0P 0P 0P 0P 0Pd BK "#	 "#Z0	 tVU3 !   &   IIIyyy)))#DKXXXX !yyy0Q0QRR     s3DDEEEE			                    V   
   #!                 0  = =RYQ'''  (bj/):)LLLG!5!5$(U" " "J  )ry88HNN0 0  !& #                  RYQ''' = =%&9:: = =#G,,,!	(;<<<<!	(;<<<<!	(;<<<<	= = = = = = = = = = = = = = == = = = = = = = = = = = = = =!= = = = = = = = = = = = = = =eg	= g	= g	= g	= g	= g	= g	= g	= g	= g	= g	= g	= g	= g	= g	=V  RZ...
bge,,,		 ! 	 	
 	
 	
( -5  ,4	5
     	 
   	 ,	 ,	 ,	\i	 i	 i	V "(2,, r	 r	 r	h	 	 	@	D 	D 	D 	K   	
 	
 	

 	  M>E !  	
 	
 	

 	K   	
 	
 	

 %nlC 	* 	*G * *))))*	: 	: 	: 	Y	:NNS	
 	
 	
 	<    	
 	
 	

 	;u   	
 	
 	
 	  / !  	
 	
 	
 &5
BZO	. 	.I OIN+++OI,----( 	. 	.IOIN+++OI,----&7 	- 	-HOHO,,,,  	 	
 	
 	
	< 	< 	< 	NN	-.=	   
 	
 	
 	
	 	 	2 	""	 	  	
 	

 $	 !"34  

 

 

OQ
 Q
 Q
 Q
 Q
 Q
 Q
 Q
 Q
 Q
 Q
 Q
 Q
 Q
 Q
W
 W
 W
 W
 W
 W
 W
 W
 W
 W
 W
 W
 W
 W
 W
t zKKMMMMM s  3AE;AE$b$'&F	b$Fb$ F!b$3b	AHb	Hb	Hb	,?N(+/J'N('J++N(.J+/1N( /LN(L  N(#L $1N(/NN(NN(NN(b	(N,,b	/N,0b	?T?/P>2T?>QT?Q1T?7/R3'T?3R77T?:R7;1T?,/T(T?(T,,T?/T,0T?3b	?Ub	Ub	AZ0AW;/Z0;W??Z0W?5Z08AZZ0ZZ0ZZ0$b	0Z44b	7Z48D(b	 Ba4(b	4a88b	;a8<b	b$bb$bb$AE$$b((AE$+b(,AE$z#g1	6dg1	dg1	dg1	1 g
5fg
fg
f$g
>g1	
gg1	gg1	%z1g55z8g59:z3#i"	z"i&&z)i&*&zq		#A#lq		lq		lq		/#p2A n>2p2>op2op27pp2pp2"p#p2&q		2p66q		9p6:q		=z	qzq6zAs.	"z.s22z5s26z5u		=z	uzuz#y<	5Awy<	wy<	wy<	-y%>Ayy%yy%yy%y<	%y))y<	,y)-y<	0z<z  zz zAE$zAE$zJ=AE$EAE;E$AE(	E(AE;E+AE(	E,AE;E;AE?FAE?