ó
    ‚¤jí¼ ã            	      óò  • S SK Jr  S SKrS SKrS SKrS SKrS SKrS SKrS SKrS SK	r	S SK
r
S SKrS SKrS SKrS SKrS SKrS SKrS SKrS SKrS SKJr  S SKJr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"J#r#J$r$J%r%J&r&  S SK'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/r0  S SK1J2r2  S SK3J4r4  S SK5J6r6J7r7J8r8J9r9J:r:J;r;J/r/  S SK<J=r=  S SK>J?r?J@r@JArA  S SKBJCrCJDrD  S SKEJFrFJGrGJHrHJIrIJJrJ  S SKKJLrLJMrMJNrNJOrOJPrPJQrQJRrRJSrS  S SKTJUrUJVrVJWrW  S SKXJYrYJZrZJ[r[J\r\J]r]J^r^J_r_J`r`  S SKaJbrbJcrcJdrd  S SKeJfrfJgrg  S SKhJiri  S SKjJkrkJlrlJmrm  S SKnJoroJprpJqrqJrrr  S SKsJtrtJuru  S SKvJwrx  S SKyJzrzJ{r{J|r|J}r}J~r~  S SKJ€r€J�r�J‚r‚JƒrƒJ„r„J…r…J†r†   S SK‡r‡\"(       a  S SK‰JŠrŠ  S SK‹JŒrŒ  S S K�JŽrŽ   " S! S"5      r� " S# S$\�5      r� S3     S4S% jjr‘      S5S& jr’S6S7S' jjr“S8S( jr” " S) S*5      r•\2" S+S,S-S.S/5       " S0 S1\�\@\AS295       r–g! \ˆ a    Sr‡ N�f = f)9é    )ÚannotationsN)Údefaultdict)ÚAsyncIteratorÚ	AwaitableÚCallableÚ	CoroutineÚSequenceÚSet)ÚPath)Ú
ModuleTypeÚSimpleNamespace)ÚTYPE_CHECKINGÚAnyÚLiteralÚUnionÚcast)ÚurlparseÚ
urlunparse)ÚCapacityLimiter)Úutils)Údocument)Ú	transpile)Ú	analyticsÚ
componentsÚ
networkingÚoauthÚprocessing_utilsÚqueueingr   )ÚBlockFunction)ÚBLOCKS_EVENTSÚBlocksEventsÚ
BlocksMeta)ÚTrackManualCacheUsageÚused_manual_cache)ÚContextÚLocalContextÚget_blocks_contextÚget_render_contextÚset_render_context)ÚAPIEndpointInfoÚAPIInfoÚBlocksConfigDictÚDeveloperPathÚFileDataÚGradioModelÚGradioRootModelÚLayout)Ú	EventDataÚEventListenerÚEventListenerMethod)ÚChecksumMismatchErrorÚComponentProcessingErrorÚDuplicateBlockErrorÚErrorÚInvalidApiNameErrorÚInvalidComponentErrorÚServerFailedToStartErrorÚShareCertificateWriteError)Úcreate_trackerÚskipÚspecial_args)ÚI18nÚI18nData)Ústart_node_server)Ú
API_PREFIXÚMediaStreamÚslugify)ÚINTERNAL_ROUTESÚVERSIONÚAppÚRequest)ÚSessionStateÚStateHolder)Ú
ThemeClass)ÚBINARY_FILENAMEÚBINARY_FOLDERÚBINARY_PATHÚ
BINARY_URLÚCURRENT_TUNNELS)ÚTupleNoPrintÚcheck_function_inputs_matchÚcomponent_or_layout_classÚget_cancelled_fn_indicesÚget_node_pathÚget_package_versionÚget_upload_folder)Ú	Component)ÚGradioMCPServer)Ú
Renderablec                  ól  • \ rS rSrSSSSSSSS.             SS jjrSS jr\SS j5       r\SS	 j5       r\SS
 j5       r	\  SS j5       r
S rS rS S jrS S jrS!S jrSS jrS"S#S jjr\ S"   S$S jj5       r    S%S jr    S%S jr    S&S jr\S S j5       r\S 5       rS rSrg)'ÚBlockés   NTÚvalue)Úelem_idÚelem_classesÚrenderÚkeyÚpreserved_by_keyÚvisibleÚ	proxy_urlc               ó4  • [        U SS5      (       a  g SU l        [        R                  R	                  S 5      nUb  U(       a  XH;   a  SU l        X„   U l        OISU l        [        R                  U l        [        =R                  S-  sl        Ub  Ub  U R                  X„'   X`l	        Xl
        [        U[        5      (       a  U/OU=(       d    / U l        Xpl        [        R                   " S5      U l        S U l        S U l        U   SU l        U   SU l        [-        5       U l        [1        5       U l        X@l        [        U[        5      (       a  U/O
U=(       d    / U l        S U l        [-        5       U l        SU l        U(       a  U R?                  5         g g )NÚ_is_initializedFTé   é    é'  ) Úgetattrrh   r&   Úkey_to_id_mapÚgetÚis_render_replacementÚ_idr%   Úidre   r`   Ú
isinstanceÚstrra   rf   ÚsecretsÚtoken_urlsafeÚshare_tokenÚparentÚrendered_inÚis_renderedÚstate_session_capacityÚsetÚ
temp_filesrX   ÚGRADIO_CACHErc   rd   Úmcp_server_objÚkeep_in_cacheÚhas_launchedrb   )	Úselfr`   ra   rb   rc   rd   re   rf   rm   s	            Ú›C:\Users\johnn\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.13_qbz5n2kfra8p0\LocalCache\local-packages\Python313\site-packages\gradio/blocks.pyÚ__init__ÚBlock.__init__t   se  € ô �4Ð*¨E×2Ñ2ØØ#ˆÔÜ$×2Ñ2×6Ñ6°tÓ<ˆØ‰?ž}°Ó1EØ)-ˆDÔ&Ø$Ñ)ˆD�Hà).ˆDÔ&Ü—z‘zˆDŒHÜ�JŠJ˜!‰O�JØ‰ =Ñ#<Ø%)§X¡X�Ñ"ØŒØŒä(¨´s×;Ñ;ˆ\‰NÀ÷àð 	Ôð #ŒÜ"×0Ò0°Ó4ˆÔØ+/ˆŒØ.2ˆÔÙØ!&ˆÔÙØ&+ˆÔ#Ü$'£EˆŒÜ-Ó/ˆÔØŒô Ð*¬C×0Ñ0ð Ñà"×( bð 	Ôð
 #ˆÔô !›UˆÔØ!ˆÔæØ�K‰K�Mð ó    c                óš   • U R                   c  g [        U R                  (       a  U R                  R                  OS U R                   45      $ ©N)rc   Úhashrx   rp   ©r�   s    r‚   Ú
unique_keyÚBlock.unique_key«   s9   € Ø�8‰8ÑØÜ¨T×-=×-=�T×%Ñ%×)Ò)À4ÈÏÉÐRÓSÐSr…   c                ó   • g©NF© r‰   s    r‚   ÚstatefulÚBlock.stateful°   ó   € àr…   c                ó   • gr�   rŽ   r‰   s    r‚   Úskip_apiÚBlock.skip_api´   r‘   r…   c                óF   • U R                   (       a  U R                   S   $ 0 $ )zlGet the arguments passed to the component's initializer.

Only set classes whose metaclass is ComponentMeta
r   )Ú_constructor_argsr‰   s    r‚   Úconstructor_argsÚBlock.constructor_args¸   s"   € ð -1×,B×,Bˆt×%Ñ% aÑ(ÐJÈÐJr…   c                ó   • [        U S/ 5      $ )NÚEVENTS)rl   r‰   s    r‚   ÚeventsÚBlock.eventsÂ   s   € ô �t˜X rÓ*Ð*r…   c                ó\  • [        5       n[        5       n[        R                  R	                  S5      U l        UbD  U R                  UR                  ;   a*  U R                  (       d  [        SU R                   S35      eUb9  U(       a  UR                  R                  U l        UR                  U 5        X l        Ubm  XR                  U R                  '   SU l        [!        U ["        R$                  5      (       a/  UR                  R&                  R)                  U R*                  5        U $ )z)
Adds self into appropriate BlockContext
NúA block with id: ú1 has already been rendered in the current Blocks.T)r'   r(   r&   Ú
renderablern   rx   rp   Úblocksro   r7   Ú
root_blockÚcurrent_pageÚpageÚaddrw   ry   rr   r   rY   Útemp_file_setsÚappendr|   )r�   Úroot_contextÚrender_contexts      r‚   rb   ÚBlock.renderÈ   só   € ô *Ó+ˆÜ+Ó-ˆÜ'×2Ñ2×6Ñ6°tÓ<ˆÔàÑ$Ø—‘˜L×/Ñ/Ó/Ø×.×.ä%Ø# D§H¡H :Ð-^Ð_óð ð Ñ%ÞØ(×3Ñ3×@Ñ@�”	Ø×Ñ˜tÔ$Ø(ŒKØÑ#Ø,0×Ñ §¡Ñ)Ø#ˆDÔÜ˜$¤
× 4Ñ 4×5Ñ5Ø×'Ñ'×6Ñ6×=Ñ=¸d¿o¹oÔNØˆr…   c                ó:  • [        5       n[        U S5      (       a:  U R                  b-   U R                  R                  R	                  U 5        SU l        Ub!   UR                  U R                  	 SU l        U $ U $ ! [
         a     N2f = f! [         a     U $ f = f)z±
Removes self from BlockContext if it has been rendered (otherwise does nothing).
Removes self from the layout and collection of blocks, but does not delete any event triggers.
rw   NF)
r'   Úhasattrrw   ÚchildrenÚremoveÚ
ValueErrorr¡   rp   ry   ÚKeyError)r�   r¨   s     r‚   ÚunrenderÚBlock.unrenderã   s¤   € ô
 *Ó+ˆÜ�4˜×"Ñ" t§{¡{Ñ'>ðØ—‘×$Ñ$×+Ñ+¨DÔ1Ø"�”ð Ñ#ðØ ×'Ñ'¨¯©Ð1Ø#(�Ô ð ˆˆtˆøô ó Ùðûô ó ØØˆðús#   ª,A< ÁB Á<
B	ÂB	Â
BÂBc                óÈ   • [        U S5      (       a.  U R                  R                  R                  R	                  5       $ U R                  R                  R	                  5       $ )a  
Gets block's class name. If it is template component it gets the parent's class name.
This is used to identify the Svelte file to use in the frontend. Override this method
if a component should use a different Svelte file than the default naming convention.
Úis_template©r¬   Ú	__class__Ú__base__Ú__name__Úlowerr‰   s    r‚   Úget_block_nameÚBlock.get_block_name÷   sQ   € ô �t˜]×+Ñ+ð �N‰N×#Ñ#×,Ñ,×2Ñ2Ó4ð	
ð —‘×(Ñ(×.Ñ.Ó0ð	
r…   c                óÈ   • [        U S5      (       a.  U R                  R                  R                  R	                  5       $ U R                  R                  R	                  5       $ )a  
Gets block's class name. If it is template component it gets the parent's class name.
Very similar to the get_block_name method, but this method is used to reconstruct a
Gradio app that is loaded from a Space using gr.load(). This should generally
NOT be overridden.
r´   rµ   r‰   s    r‚   Úget_block_classÚBlock.get_block_class  sQ   € ô �t˜]×+Ñ+ð �N‰N×#Ñ#×,Ñ,×2Ñ2Ó4ð	
ð —‘×(Ñ(×.Ñ.Ó0ð	
r…   c                ó   • g r‡   rŽ   r‰   s    r‚   Úget_expected_parentÚBlock.get_expected_parent  s   € Ør…   c                ó   • g)z´
Whether this component breaks FormComponent grouping chains.
Components that return False will not reset the pseudo_parent
when encountered during fill_expected_parents grouping.
TrŽ   r‰   s    r‚   Úbreaks_groupingÚBlock.breaks_grouping  s   € ð r…   c                ó  • 0 nUc  U R                   n[        R                  " UR                  5      nUR                  R                  5        GH,  n[        XR                  5      (       d  M   [        XR                  5      n[        R                  " U5      (       a  [        R                  " U5      nO·[        U[        5      (       a"  UnUR                  5       nUR                  US'   O€[        U[         ["        45      (       ae  / nU H[  n[        U[        5      (       a2  UR                  5       n	UR                  U	S'   UR%                  U	5        MJ  UR%                  U5        M]     UnXRUR                  '   GM/     U R&                   H"  n
U
R)                  5       nU(       d  M  0 UEUEnM$     UR+                  SS 5        0 UE[        U SS 5      U R-                  5       S.EnS H  n[        XS 5      =nc  M  XÒU'   M     U$ )Nrq   rb   rf   )rf   Úname)Ú_selectableÚ	_undoableÚ
_retryableÚlikeable)r¶   ÚinspectÚ	signaturerƒ   Ú
parametersÚvaluesr¬   rÆ   rl   ÚdataclassesÚis_dataclassÚasdictrr   r]   Ú
get_configrp   ÚlistÚtupler§   r›   Úconfig_dataÚpopr½   )r�   ÚclsÚconfigrÌ   Ú	parameterr_   Úblock_instanceÚserialized_listÚitemÚitem_configÚeÚto_addÚevent_attributeÚattributables                 r‚   rÒ   ÚBlock.get_config  s¿  € ØˆØ‰;Ø—.‘.ˆCÜ×%Ò% c§l¡lÓ3ˆ	Ø"×-Ñ-×4Ñ4×6ˆIÜ�tŸ^™^×,Ó,Ü §n¡nÓ5�Ü×+Ò+¨E×2Ñ2Ü'×.Ò.¨uÓ5‘EÜ ¤u×-Ñ-Ø%*�NØ*×5Ñ5Ó7�EØ"0×"4Ñ"4�E˜$’KÜ ¬¬e }×5Ñ5Ø&(�OÛ %˜Ü% d¬E×2Ñ2Ø*.¯/©/Ó*;˜KØ04·±˜K¨Ñ-Ø+×2Ñ2°;Ö?à+×2Ñ2°4Ö8ñ !&ð ,�EØ).�y—~‘~Ô&ñ' 7ð( —”ˆAØ—]‘]“_ˆFßˆvØ-˜FÐ- fÐ-’ñ ð 	�
‰
�8˜TÔ"ð
Øð
ä   {°DÓ9Ø×(Ñ(Ó*ò
ˆó
  VˆOÜ '¨¸tÓ DÐD�ÓQØ*6�Ó'ñ  Vð ˆr…   c                ó  • U=(       d    / n[         R                  " U R                  5      n0 nUR                  R	                  5        HA  nUR
                  U;   d  M  UR
                  U;  d  M'  XR
                     XER
                  '   MC     U$ )z'
Recovers kwargs from a dict of props.
)rË   rÌ   rƒ   rÍ   rÎ   rÆ   )r×   ÚpropsÚadditional_keysrÌ   ÚkwargsrÙ   s         r‚   Úrecover_kwargsÚBlock.recover_kwargsC  sq   € ð *×/¨RˆÜ×%Ò% c§l¡lÓ3ˆ	ØˆØ"×-Ñ-×4Ñ4Ö6ˆIØ�~‰~ Õ&¨9¯>©>ÀÕ+PØ).¯~©~Ñ)>�—~‘~Ó&ñ 7ð ˆr…   c              ƒ  ó<  #   • Uc  g[        U[        5      (       a  [        U5      n[        R                  " U5      (       aC  [
        R                  " XR                  S9I Sh  v•N nU R                  R                  U5        U$ [        [        R                  " U5      5      n[        R                  " XR                  5      (       d    [
        R                  " XR                  S9nOUnU R                  R                  U5        U$  N¤! [         a    Us $ f = f7f)aa  Moves a file or downloads a file from a url to a block's cache directory, adds
to to the block's temp_files, and returns the path to the file in cache. This
ensures that the file is accessible to the Block and can be served to users.

This async version of the function is used when this is being called within
a FastAPI route, as this is not blocking.
N©Ú	cache_dir)rr   r   rs   Úclient_utilsÚis_http_url_liker   Úasync_ssrf_protected_downloadr}   r|   r¥   r   ÚabspathÚis_in_or_equalÚsave_file_to_cacheÚFileNotFoundError©r�   Úurl_or_file_pathÚtemp_file_paths      r‚   Ú"async_move_resource_to_block_cacheÚ(Block.async_move_resource_to_block_cacheR  sÿ   é € ð Ñ#ØÜÐ&¬×-Ñ-Ü"Ð#3Ó4Ðä×(Ò(Ð)9×:Ñ:Ü#3×#QÒ#QØ ×,=Ñ,=ñ$÷ ˆNð �O‰O×Ñ Ô/ð$ Ðô!  #¤5§=¢=Ð1AÓ#BÓCÐÜ×'Ò'Ð(8×:KÑ:K×LÑLð	,Ü%5×%HÒ%HØ(×4EÑ4Eñ&‘Nð "2�Ø�O‰O×Ñ Ô/àÐñ-øô )ó ,ð
 ,Ò+ð,üs7   ‚A!DÁ#DÁ$A%DÃ
D
 Ã(!DÄ
DÄDÄDÄDc                ó   • Uc  g[        U[        5      (       a  [        U5      n[        R                  " U5      (       a;  [
        R                  " XR                  S9nU R                  R                  U5        U$ [        [        R                  " U5      5      n[        R                  " XR                  5      (       d    [
        R                  " XR                  S9nOUnU R                  R                  U5        U$ ! [         a    Us $ f = f)ap  Moves a file or downloads a file from a url to a block's cache directory, adds
to to the block's temp_files, and returns the path to the file in cache. This
ensures that the file is accessible to the Block and can be served to users.

This sync version of the function is used when this is being called outside of
a FastAPI route, e.g. when examples are being cached.
Nrê   )rr   r   rs   rì   rí   r   Úsave_url_to_cacher}   r|   r¥   r   rï   rð   rñ   rò   ró   s      r‚   Úmove_resource_to_block_cacheÚ"Block.move_resource_to_block_cachez  só   € ð Ñ#ØÜÐ&¬×-Ñ-Ü"Ð#3Ó4Ðä×(Ò(Ð)9×:Ñ:Ü-×?Ò?Ø ×,=Ñ,=ñˆNð �O‰O×Ñ Ô/ð$ Ðô!  #¤5§=¢=Ð1AÓ#BÓCÐÜ×'Ò'Ð(8×:KÑ:K×LÑLð	,Ü%5×%HÒ%HØ(×4EÑ4Eñ&‘Nð "2�Ø�O‰O×Ñ Ô/àÐøô )ó ,ð
 ,Ò+ð,ús   Ã C> Ã>DÄDc                ób  • Uc  g[        U[        5      (       a  U$ [        U[        5      (       a  [        U5      n[        R
                  " U5      (       a*  [        [        U5      [        U5      S9R                  5       $ USS0S.n [        R                  " X 5      $ ! [         a    Us $ f = f)a™  If a file is a local file, moves it to the block's cache directory and returns
a FileData-type dictionary corresponding to the file. If the file is a URL, returns a
FileData-type dictionary corresponding to the URL. This ensures that the file is
accessible in the frontend and can be served to users.

Examples:
>>> block.serve_static_file("https://gradio.app/logo.png") -> {"path": "https://gradio.app/logo.png", "url": "https://gradio.app/logo.png"}
>>> block.serve_static_file("logo.png") -> {"path": "logo.png", "url": "/file=logo.png"}
>>> block.serve_static_file({"path": "logo.png", "url": "/file=logo.png"}) -> {"path": "logo.png", "url": "/file=logo.png"}
N)ÚpathÚurlÚ_typezgradio.FileData)rý   Úmeta)rr   Údictr   rs   rì   rí   r.   Ú
model_dumpr   Úmove_files_to_cacheÚAttributeError)r�   rô   Údatas      r‚   Úserve_static_fileÚBlock.serve_static_file¢  s®   € ð Ñ#ØÜÐ&¬×-Ñ-Ø#Ð#ÜÐ&¬×-Ñ-Ü"Ð#3Ó4ÐÜ×(Ò(Ð)9×:Ñ:ÜÜÐ)Ó*´Ð4DÓ0Eñç‰j‹lðð -°wÐ@QÐ6RÑSˆDðÜ'×;Ò;¸DÓGÐGøÜ!ó Ø’ðús   Â	B ÂB.Â-B.c                óî   •  [         R                  " U 5      n[        R
                  " U R                   SU 3R                  5       5      R                  5       nU$ ! [         a    U R                  n N[f = f)NÚ_)	rË   ÚgetfileÚOSErrorÚ
__module__ÚhashlibÚsha256r¸   ÚencodeÚ	hexdigest)r×   Úmodule_pathÚmodule_hashs      r‚   Úget_component_class_idÚBlock.get_component_class_idÀ  sl   € ð	)Ü!Ÿ/š/¨#Ó.ˆKô —n’nØ�|‰|ˆn˜A˜k˜]Ð+×2Ñ2Ó4ó
ç
‰)‹+ð 	ð Ðøô ó 	)ØŸ.™.ŠKð	)ús   ‚A ÁA4Á3A4c                ó"   • U R                  5       $ r‡   )r  r‰   s    r‚   Úcomponent_class_idÚBlock.component_class_idË  s   € à×*Ñ*Ó,Ð,r…   c                ó   • U$ r‡   rŽ   ©r�   r_   s     r‚   ÚpostprocessÚBlock.postprocessÏ  s   € Øˆr…   )r}   rp   rh   ra   r`   r€   ro   ry   r   rc   r~   r¤   rw   rd   rf   rx   rv   rz   r|   re   )r`   ú
str | Nonera   úlist[str] | str | Nonerb   Úboolrc   ú(int | str | tuple[int | str, ...] | Nonerd   r  re   úbool | Literal['hidden']rf   r  )Úreturnú
int | None)r!  r  )r!  údict[str, Any])r!  zlist[EventListener])r!  rs   )r!  ztype[BlockContext] | Noner‡   )r×   ztype[Block] | Noner!  r#  )rä   r#  rå   úlist[str] | None)rô   ústr | Path | Noner!  r  )rô   zstr | Path | dict | Noner!  zdict | None)r¸   r  Ú__qualname__Ú__firstlineno__rƒ   rŠ   Úpropertyr�   r“   r—   r›   rb   r±   rº   r½   rÀ   rÃ   rÒ   Úclassmethodrç   rö   rú   r  r  r  r  Ú__static_attributes__rŽ   r…   r‚   r]   r]   s   s~  † ð #Ø/3ØØ8<Ø3:Ø,0Ø $ñ5ð ð5ð -ð	5ð
 ð5ð 6ð5ð 1ð5ð *ð5ð õ5ônTð
 óó ðð óó ðð óKó ðKð ð+à	ó+ó ð+ò
ò6ô(

ô
ôôö&ðP àHLðØ"ðØ5Eôó ðð&Ø 1ð&à	ô&ðP&Ø 1ð&à	ô&ðPØ 8ðà	ôð< óó ðð ñ-ó ð-õr…   r]   c                  ó–   • \ rS rSr      S           SS jjr\" S5      rSr\S 5       r	SS jr
S rSS	 jrS
 rSSS jjrSrg)ÚBlockContextiÓ  Nc           
     óD   • / U l         [        R                  U UUUUUUS9  g)aü  
Parameters:
    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 string or list of strings that are assigned as the class of this component in the HTML DOM. Can be used for targeting CSS styles.
    visible: If False, this will be hidden but included in the Blocks config file (its visibility can later be updated).
    render: If False, this will not be included in the Blocks config file at all.
)r`   ra   re   rb   rc   rd   N)r­   r]   rƒ   )r�   r`   ra   re   rb   rc   rd   s          r‚   rƒ   ÚBlockContext.__init__Ô  s1   € ð  &(ˆŒÜ�‰ØØØ%ØØØØ-ð 	ò 	
r…   z./templates/z../../frontend/c                ó   • g©NTrŽ   r‰   s    r‚   r“   ÚBlockContext.skip_apiò  s   € àr…   c                ó:   • U R                   R                  U5        g r‡   )r­   r§   ©r�   Úchilds     r‚   Ú	add_childÚBlockContext.add_childö  s   € Ø�‰×Ñ˜UÕ#r…   c                ó<   • [        5       nXl        [        U 5        U $ r‡   )r(   rw   r)   ©r�   r©   s     r‚   Ú	__enter__ÚBlockContext.__enter__ù  s   € Ü+Ó-ˆØ$ŒÜ˜4Ô Øˆr…   c                óF   • Xl         U R                  R                  U5        g r‡   )rw   r­   r§   r3  s     r‚   r¥   ÚBlockContext.addÿ  s   € ØŒØ�‰×Ñ˜UÕ#r…   c                ó¤  • [        5       n/ nS nU R                   GH+  nUR                  5       nU(       a  [        X5      (       a*  UR	                  5       (       a  S nUR                  U5        MU  Ub"  [        X55      (       a  UR                  U5        O«S nUR                  b=  [        UR                  [        5      (       a  UR                  S-   nOUR                  S4nU" SUS9nXl	        UR                  U5        UR                  U5        UR                  Ul
        U(       a  X1R                  UR                  '   X4l	        GM.     X l        g )N)Ú_parentr>  F)rb   rc   )r'   r­   rÀ   rr   rÃ   r§   r5  rc   rÔ   rw   r¤   r¡   rp   )r�   r¨   r­   Úpseudo_parentr4  Úexpected_parentrc   s          r‚   Úfill_expected_parentsÚ"BlockContext.fill_expected_parents  s  € Ü)Ó+ˆØˆØˆØ—]•]ˆEØ#×7Ñ7Ó9ˆOÞ"¤j°×&GÑ&GØ×(Ñ(×*Ñ*Ø$(�MØ—‘ Ö&à Ñ,´Ø!÷2ñ 2ð "×+Ñ+¨EÕ2à�CØ—y‘yÑ,Ü% e§i¡i´×7Ñ7Ø"'§)¡)¨lÑ":™Cà#(§9¡9¨iÐ"8˜CÙ$3¸5ÀcÑ$J�MØ+/Ô(Ø—O‘O MÔ2Ø!×+Ñ+¨EÔ2Ø).¯©�MÔ&Þ#ØAN×+Ñ+¨M×,=Ñ,=Ñ>Ø,—ñ3 #ð4 !�r…   c                ó|   • [        U R                  5        Ub  g [        U SS5      (       a  U R                  5         g g )NÚallow_expected_parentsT)r)   rw   rl   rA  )r�   Úexc_typeÚargss      r‚   Ú__exit__ÚBlockContext.__exit__#  s8   € Ü˜4Ÿ;™;Ô'ØÑØÜ�4Ð1°4×8Ñ8Ø×&Ñ&Õ(ð 9r…   )r­   rw   )NNTTNN)r`   r  ra   r  re   r   rb   r  rc   r  rd   r  )r4  r]   r‡   ©rE  ztype[BaseException] | None)r¸   r  r&  r'  rƒ   r-   ÚTEMPLATE_DIRÚFRONTEND_DIRr(  r“   r5  r9  r¥   rA  rG  r*  rŽ   r…   r‚   r,  r,  Ó  s—   † ð #Ø/3Ø,0ØØ8<Ø37ð
àð
ð -ð
ð *ð	
ð
 ð
ð 6ð
ð 1õ
ñ6 ! Ó0€LØ$€Làñó ðô$òô$ò!÷@)ñ )r…   r,  c                óÚ  • SSK Jn  UR                  S[        R                  R
                  5      nSn[        X5      (       an  [        R                  " UR                  5      n[        UR                  R                  5       5      nUR                  5        VV	s0 s H  u  p‰X‡;  d  M  X‰_M     nnn	U Vs0 s H!  n[        X5      (       d  M  U[        X5      _M#     nnU(       a  XQS'   U[        R                  R
                  LaT  U(       aI  U R!                  U5      US'   [        US   ["        [$        45      (       a  US   R'                  5       US'   OXAS'   SUS'   U$ s  sn	nf s  snf )a»  
Converts a dictionary of updates into a format that can be sent to the frontend to update the component.
E.g. {"value": "2", "visible": True, "invalid_arg": "hello"}
Into -> {"__type__": "update", "value": 2.0, "visible": True}
Parameters:
    block: The Block that is being updated with this update dictionary.
    update_dict: The original update dictionary
    postprocess: Whether to postprocess the "value" key of the update dictionary.
r   )ÚHTMLr_   Nrä   ÚupdateÚ__type__)Úgradio.componentsrM  rÖ   r   Ú	_KeywordsÚNO_VALUErr   rË   rÌ   rƒ   r{   rÍ   ÚkeysÚitemsr¬   rl   r  r/   r0   r  )
ÚblockÚupdate_dictr  rM  r_   rä   ÚsigÚconstructor_paramsÚkÚvs
             r‚   Úpostprocess_update_dictr[  +  s9  € õ 'à�O‰O˜G¤Z×%9Ñ%9×%BÑ%BÓC€Eà€EÜ�%×ÑÜ×Ò §¡Ó.ˆÜ  §¡×!4Ñ!4Ó!6Ó7ÐØ"-×"3Ñ"3Ô"5ÔUÒ"5™$˜!¸Ñ9T“�’Ñ"5ˆÑUÙ1<ÓR²¨AÄÈ×@QÓ'�1”g˜eÓ'Ò'±€KÐRÞØ$�GÑà”J×(Ñ(×1Ñ1Ò1ÞØ#(×#4Ñ#4°UÓ#;ˆK˜Ñ Ü˜+ gÑ.´¼oÐ0N×OÑOØ'2°7Ñ';×'FÑ'FÓ'H�˜GÑ$øà#(˜Ñ Ø&€K�
ÑØÐùó VùÚRs   ÂE"Â(E"Â5E(ÃE(c                óL  ^
• U Vs/ s H  n[        U[        5      PM     nn[        U5      (       aÈ  U  Vs/ s H  oDR                  PM     nnU Vs/ s H  n[	        5       PM     nnUR                  5        Hg  u  m
nT
R                  U;   a  UR                  T
R                  5      n	O[        U
4S j[        U 5       5       S5      n	U	c  [        ST
 S35      eX‡U	'   Mi     [        R                  " U5      nU$ [        U5      (       a  [        S5      eU$ s  snf s  snf s  snf )ao  
Converts a dictionary of component updates into a list of updates in the order of
the output components and including every output component. Leaves other types of dictionaries unchanged.
E.g. {"textbox": "hello", "number": {"__type__": "generic_update", "value": "2"}}
Into -> ["hello", {"__type__": "generic_update"}, {"__type__": "generic_update", "value": "2"}]
c              3  ó‚   >#   • U  H4  u  pTR                   c  M  UR                   TR                   :X  d  M0  Uv •  M6     g 7fr‡   ©rc   )Ú.0ÚindexrU  Ú	components      €r‚   Ú	<genexpr>Ú1convert_component_dict_to_list.<locals>.<genexpr>c  s8   øé € ð â,>™L˜EØ$Ÿ=™=ó à9>¿¹ÀiÇmÁmÑ9S÷ ™Ú,>ùs   ƒ?š?¶	?NzReturned component z% not specified as output of function.z±Returned dictionary included some keys as Components. Either all keys must be Components to assign Component values, or return a List of values to assign output values in order.)rr   r]   Úallrp   r>   rT  r`  ÚnextÚ	enumerater¯   r   Úresolve_singletonÚany)ÚoutputsÚpredictionsrc   Úkeys_are_blocksrU  Úoutputs_idsr	  Úreordered_predictionsr_   Úoutput_indexra  s             @r‚   Úconvert_component_dict_to_listro  O  s/  ø€ ñ :EÓEº°#”z #¤uÖ-¹€OÐEÜ
ˆ?×ÑÙ.5Ó6ªg U—y”y©gˆÐ6Ù1<Ó =²¨A¤¦±ÐÐ =Ø +× 1Ñ 1Ö 3ÑˆI�uØ�}‰} Ó+Ø*×0Ñ0°·±Ó?‘ô  $ôä,5°gÔ,>óð
 ó �ð Ñ#Ü Ø)¨)¨Ð4YÐZóð ð 38 ,Ó/ñ% !4ô& ×-Ò-Ð.CÓDˆð
 Ðô	 
ˆ_×	Ñ	Üð @ó
ð 	
ð Ðùò9 Fùâ6ùÚ =s   †D¶DÁD!c                óN  • SSK n[        XU-   5       Hh  n UR                  5       nUR                  UR                  UR                  S5        UR                  U S:w  a  U OSU45        UR                  5         Us  $    [        SU SX-   S-
   S35      e! [         a     M�  f = f)	z0Find an available port by scanning from *start*.r   Nri   ú0.0.0.0ú	127.0.0.1z!Cannot find empty port in range: Ú-Ú.)ÚsocketÚrangeÚ
setsockoptÚ
SOL_SOCKETÚSO_REUSEADDRÚbindÚcloser  )ÚhostÚstartÚ	try_countru  ÚportÚss         r‚   Ú_find_free_portr�  w  s©   € ãä�e YÑ.Ö/ˆð	Ø—‘“ˆAØ�L‰L˜×*Ñ*¨F×,?Ñ,?ÀÔCØ�F‰F˜D IÓ-‘D°;ÀÐEÔFØ�G‰GŒIØŠKñ 0ô Ð5°e°W¸A¸eÑ>OÐRSÑ>SÐ=TÐTUÐVÓ
WÐWøô ó 	Úð	ús   —A#BÂ
B$Â#B$c                ó:   •  [        XSS9  g! [         a     gf = f)zGWhether *port* can be bound, checked the same way as `_find_free_port`.ri   ©r}  r~  FT)r�  r  )r|  r  s     r‚   Ú_port_is_freer„  ‡  s*   € ðÜ˜°AÒ6ð øô ó Ùðús   ‚
 �
™c                  óF  • \ rS rSrS
S jr                               S                                                                       SS jjr\ S         SS jj5       rSSS jjrS r	SSS jjr
S	rg)ÚBlocksConfigi�  c                ój   • SU l         Xl        0 U l        0 U l        SU l        UR
                  U l        g )Nr   )rp   r¢   r¡   ÚfnsÚfn_idÚrenderables)r�   r¢   s     r‚   rƒ   ÚBlocksConfig.__init__‘  s1   € ØˆŒØ$ŒØ46ˆŒØ-/ˆŒØˆŒ
Ø-7×-CÑ-CˆÕr…   Nc$           
     ó	  • U V$s/ s H?  n$U(       d'  U$R                   (       a  U$R                   R                  OSU$R                  4PMA     n%n$[        U[        5      (       a  Sn&[        US S9nO Sn&Uc  / nO[        U[        5      (       d  U/n[        U[        5      (       a  [        US S9nOUc  / nO[        U[        5      (       d  U/nU	(       a  [        U	[        5      (       d  U	/n	Ub  U(       d  [        X#U&5        U%(       a   Uc  U%S   S   S	;   a  S
nOU%S   S   S;   a  SnUc  SnOUS;  a  [        SU S/ SQ 35      eU(       a  UR                  OUn'U'(       a  [        U'5      OSSS/ 4u  n(n)n*n+U#c  U+=(       d    / n#U
b)  [        U
[        5      (       a×  U
R                  5       S:X  aÃ  Ub³  [        US5      (       dF  [        US5      (       a2  [        UR                  S5      (       a  UR                  R                  n,OSn,OUR                  n,SR!                  [        U,5       V-s/ s H)  n-U-[#        [$        R&                  5      SS1-
  ;  d  M'  U-PM+     sn-5      n
OUb  Sn
SnOSn
SnO	U
SL a  Sn
Sn[(        R*                  " U
U R,                  R/                  5        Vs/ s H0  n[        UR0                  [        5      (       d  M$  UR0                  PM2     sn5      n
Uc  U*SLn[2        R4                  R7                  S5      n.USL a  U(       a  [        S5      eSn/U R8                  n0U.(       a  U.R:                  OSn1U.(       aD  U!bA  U R,                  R/                  5        H#  n2U2R<                  U!:X  d  M  Sn/U2R                  n0  O   [?        WUUUU40 SU0_SU&_SU%_SU_SU_S U_S!U_S"U)SL_S#U
_S$U_S%U_S&U_S'[        U	[@        [B        45      (       d  U	c  U	OU	/_S(U_S)U_S*U_S+U_S,U_S-U_S.U_S/U_S0U_S1U_S2U._S3U1_S4U_S5U_S6U_S7U_S8U_S9U#_S:U RD                  RF                  _S;U _S<U!_S=U"_6n3U3U R,                  U0'   U/(       d  U =R8                  S-  sl        U3U3R                  4$ s  sn$f s  sn-f s  snf )>aR  
Adds an event to the component's dependencies.
Parameters:
    targets: a list of EventListenerMethod objects that define the event trigger
    fn: the function to run when the event is triggered
    inputs: the list of input components whose values will be passed to the function
    outputs: the list of output components whose values will be updated by the function
    preprocess: whether to run the preprocess methods of the input components before running the function
    postprocess: whether to run the postprocess methods of the output components after running the function
    scroll_to_output: whether to scroll to output of dependency on trigger
    show_progress: how to show the progress animation while event is running: "full" shows a spinner which covers the output component area as well as a runtime display in the upper right corner, "minimal" only shows the runtime display, "hidden" shows no progress animation at all
    show_progress_on: Component or list of components to show the progress animation on. If None, will show the progress animation on all of the output components.
    api_name: defines how the endpoint appears in the API docs. Can be a string or None. If set to a string, the endpoint will be exposed in the API docs with the given name. If None (default), the name of the function will be used as the API endpoint.
    api_description: Description of the API endpoint. Can be a string, None, or False. If set to a string, the endpoint will be exposed in the API docs with the given description. If None, the function's docstring will be used as the API endpoint description. If False, then no description will be displayed in the API docs.
    js: Optional frontend JavaScript to run before 'fn', provided as either a function or a raw code string. A function receives the values of 'inputs' and 'outputs' as arguments; raw code can access them through `arguments`. Return a list of values to pass as inputs to the Python function (`fn`).
    no_target: if True, sets "targets" to [], used for the Blocks.load() event and .then() events
    queue: If True, will place the request on the queue, if the queue has been enabled. If False, will not put this event on the queue, even if the queue has been enabled. If None, will use the queue setting of the gradio app.
    batch: whether this function takes in a batch of inputs
    max_batch_size: the maximum batch size to send to the function
    cancels: a list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method.
    collects_event_data: whether to collect event data for this event
    trigger_after: if set, this event will be triggered after 'trigger_after' function index
    trigger_only_on_success: if True, this event will only be triggered if the previous event was successful (only applies if `trigger_after` is set)
    trigger_only_on_failure: if True, this event will only be triggered if the previous event failed i.e. raised an exception (only applies if `trigger_after` is set)
    trigger_mode: If "once" (default for all events except `.change()`) would not allow any submissions while an event is pending. If set to "multiple", unlimited submissions are allowed while pending, and "always_last" (default for `.change()` and `.key_up()` events) would allow a second submission after the pending event is complete.
    concurrency_limit: If set, this is the maximum number of this event that can be running simultaneously. Can be set to None to mean no concurrency_limit (any number of this event can be running simultaneously). Set to "default" to use the default concurrency limit (defined by the `default_concurrency_limit` parameter in `queue()`, which itself is 1 by default).
    concurrency_id: If set, this is the id of the concurrency group. Events with the same concurrency_id will be limited by the lowest set concurrency_limit.
    api_visibility: controls the visibility and accessibility of this endpoint. Can be "public" (shown in API docs and callable by clients), "private" (hidden from API docs and not callable by the Gradio client libraries), or "undocumented" (hidden from API docs but callable by clients and via gr.load). If fn is None, api_visibility will automatically be set to "private".
    is_cancel_function: whether this event cancels another running event.
    connection: The connection format, either "sse" or "stream".
    time_limit: The time limit for the function to run. Parameter only used for the `.stream()` event.
    stream_every: The latency (in seconds) at which stream chunks are sent to the backend. Defaults to 0.5 seconds. Parameter only used for the `.stream()` event.
    validator: a function that takes in the inputs and can optionally return a gr.validate() object for each input.
Returns: dependency information, dependency index
NTc                ó   • U R                   $ r‡   ©rp   ©Úxs    r‚   Ú<lambda>Ú0BlocksConfig.set_event_trigger.<locals>.<lambda>ø  s   € °!·%²%r…   r^  Fc                ó   • U R                   $ r‡   rŽ  r�  s    r‚   r‘  r’    s   € °A·E²Er…   r   ri   )ÚchangeÚkey_upÚalways_last)ÚstreamÚmultipleÚonce)r™  r˜  r–  z,Invalid value for parameter `trigger_mode`: z. Please choose from: Ú r¸   r¶   Úunnamedrs  r	  Újs_fnÚprivateÚfalsez<Cannot create event: events with js=True cannot have inputs.rp   Úinputs_as_dictÚtargetsÚbatchÚmax_batch_sizeÚconcurrency_limitÚconcurrency_idÚtracks_progressÚapi_nameÚapi_descriptionÚjsÚshow_progressÚshow_progress_onÚcancelsÚcollects_event_dataÚtrigger_afterÚtrigger_only_on_successÚtrigger_only_on_failureÚtrigger_modeÚqueueÚscroll_to_outputÚapi_visibilityr    rx   Úrender_iterationÚis_cancel_functionÚ
connectionÚ
time_limitÚstream_everyÚevent_specific_argsÚcomponent_prop_inputsr¤   Újs_implementationrc   Ú	validator)$rU  rp   Ú
event_namerr   r
   Úsortedr	   rS   r¯   Úfnr?   rs   Ústripr¬   r¶   r¸   Újoinr{   ÚstringÚpunctuationr   Úappend_unique_suffixrˆ  rÎ   r¦  r&   r    rn   r‰  r´  rc   r   rÓ   rÔ   r¢   r£   )4r�   r   r¿  Úinputsri  Ú
preprocessr  r²  r©  rª  r¦  r§  r¨  Ú	no_targetr±  r¡  r¢  r«  r¬  r­  r®  r¯  r°  r£  r¤  r³  r    rµ  r¶  r·  r¸  r¹  r»  rc   r¼  rº  ÚtargetÚ_targetsrŸ  Úfn_to_analyzer	  Úprogress_indexÚevent_data_indexÚcomponent_prop_indicesrÆ   r€  rx   Úreuse_idr‰  r´  Úexisting_fnÚblock_fns4                                                       r‚   Úset_event_triggerÚBlocksConfig.set_event_trigger™  sq  € ñv "ó
ò
 "�ö )2°f·l·l�—‘× Ò ÈØ×!Ñ!óñ "ð 	ð 
ô �fœc×"Ñ"Ø!ˆNÜ˜F©Ñ8‰Fà"ˆNØ‰~Ø‘Ü ¬×1Ñ1Ø ˜�ä�gœs×#Ñ#Ü˜W©/Ñ:‰GØ‰_Ø‰GÜ˜G¤X×.Ñ.Ø�iˆGÞ¤JÐ/?Ä×$JÑ$JØ 0Ð1Ðà‰>¦'Ü'¨°NÔCæ˜Ñ,Ø˜‰{˜1‰~Ð!5Ó5Ø,‘Ø˜!‘˜Q‘ :Ó-Ø)�ØÑØ!‰LØÐ!DÓDÜØ>¸|¸nÐLbò  dGð  cHð  Ióð ö *4˜
Ÿš¸ˆæ+8ŒL˜Ô'¸tÀTÈ4ÐQSÐ>Tñ 	Dˆˆ>Ð+Ð-Cð !Ñ(Ø$:×$@¸bÐ!ð Ñœz¨(´C×8Ñ8¸X¿^¹^Ó=MÐQSÓ=SØ‰~Ü˜r :×.Ñ.Ü˜r ;×/Ñ/´G¸B¿L¹LÈ*×4UÑ4UØ!Ÿ|™|×4Ñ4™à(™àŸ;™;�DØŸ7™7ô "% T¤óâ!*˜AØ¤C¬×(:Ñ(:Ó$;¸sÀC¸jÑ$HÑH÷ Ù!*ñó‘ð ‘Ø"�Ø!*‘à$�Ø!*‘Ø˜ÒØˆHØ&ˆNä×-Ò-ØØ#'§8¡8§?¡?Ô#4ÓUÒ#4˜R¼
À2Ç;Á;ÔPS×8T‹[ˆR�[Œ[Ñ#4ÑUó
ˆð Ñ&Ø"2¸$Ð">Ðä"×-Ñ-×1Ñ1°$Ó7ˆà�Š:ž&ÜØNóð ð ˆØ—
‘
ˆÞ;F˜;×7Ò7ÈDÐæ˜3™?Ø#Ÿx™xŸ™Ö0�Ø—?‘? cÕ)Ø#�HØ'ŸO™O�EÙñ	  1ô !ØØØØØò+
ñ ð+
ñ *ð+
ñ ð+
ñ ð+
ñ *ð+
ñ 0ð+
ñ *ð+
ð +°$Ñ6ð+
ñ ð+
ñ ,ð+
ñ  ð!+
ñ" (ð#+
ô& Ð*¬T´5¨M×:Ñ:Ð>NÑ>Vñ .à"Ð#øð)+
ñ* ð++
ñ, !4ð-+
ñ. (ð/+
ñ0 %<ð1+
ñ2 %<ð3+
ñ4 &ð5+
ñ6 ð7+
ñ8 .ð9+
ñ: *ð;+
ñ< "ð=+
ñ> $ð?+
ñ@ .ðA+
ñB  2ðC+
ñD "ðE+
ñF "ðG+
ñH &ðI+
ñJ !4ðK+
ñL #8ðM+
ðN —‘×-Ò-ðO+
ñP 0ðQ+
ñR ðS+
ñT  ðU+
ˆðZ #ˆ�‰�‰ÞØ�JŠJ˜!‰O�JØ˜Ÿ™Ð%Ð%ùòq
ùòvùò$ Vs   …AQ?È4&RÉRÊ/#R	
ËR	
c           	     óp  • U(       a  X;  a  0 $ [        US5      (       a  UR                  5       O0 n/ nU(       aD  UR                  (       a3  UR                  R	                  5        VVs/ s H  u  pgUb  M
  UPM     nnn[
        R                  " XES9  U UR                  5       UUR                  [        USS 5      UR                  5       S.nU(       a  UR                  US'   UR                  b  UR                  R                  US'   UR                  (       d–  UR                  5       US'   [        US5      (       a  UR                  5       US'   OUR                  5       US'   [        US	5      (       a  UR                  5       US	'   OUR                  5       US	'   UR!                  5       US
'   U$ s  snnf )NrÒ   )Ú
skip_propsr  )rq   Útyperä   r“   r  rc   r    rx   Úapi_infoÚapi_info_as_inputÚapi_info_as_outputÚexample_inputs)r¬   rÒ   rc   r—   rT  r   Údelete_nonerº   r“   rl   rŠ   rp   rx   rÖ  r×  rØ  rÙ  )	rp   Úrendered_idsrU  r    rä   Úskip_none_deletionÚpropÚvalÚblock_configs	            r‚   Úconfig_for_blockÚBlocksConfig.config_for_block‰  s�  € ö ˜#Ó1ØˆIÜ&-¨e°\×&BÑ&B�× Ñ Ô"ÈˆàÐæ˜5Ÿ9Ÿ9ð ',×&<Ñ&<×&BÑ&BÔ&Dô"Ú&D™˜È—Ñ&Dð ñ "ô 	×Ò˜%Ò?ð Ø×(Ñ(Ó*ØØŸ™Ü")¨%Ð1EÀtÓ"LØ×#Ñ#Ó%ñ
ˆö Ø)3¯©ˆL˜Ñ&Ø×ÑÑ(Ø*/×*;Ñ*;×*?Ñ*?ˆL˜Ñ'Ø�~�~Ø',§~¡~Ó'7ˆL˜Ñ$Ü�uÐ1×2Ñ2Ø49×4KÑ4KÓ4M�Ð0Ò1à49·N±NÓ4D�Ð0Ñ1Ü�uÐ2×3Ñ3Ø5:×5MÑ5MÓ5O�Ð1Ò2à5:·^±^Ó5E�Ð1Ñ2Ø-2×-AÑ-AÓ-CˆLÐ)Ñ*àÐùó;"s   Á)	F2Á6F2c                óX  ^^• 0 / / S.nU R                   R                   H5  nUS   nXBS   ;  d  M  U R                   R                  / S./ / S.US   U'   M7     / mSUU4S jjmU(       a  U R                  UR                     nOU R                   nT" U5      nXbS'   UR                  S/ 5       Hh  n[        U[        5      (       d  M  US	   U R                  ;   d  M/  U R                  US	      nUS   UR                     S   S   R                  U5        Mj     [        U R                  R                  5       5      n	U	 Hc  u  p¨U R                  U
TX�5      nU(       d  M!  US
   R                  U5        US   UR                     S
   R                  UR                  5        Me     / nU R                  R                  5        H`  nUb  UR                  U:X  d  M  UR!                  5       nUR                  U5        US   UR                     S   R                  US	   5        Mb     XÂS'   U$ )N)r¤   r   Údependenciesr   r¤   ©rq   r­   )Úlayoutr   rã  c                óú   >• TR                  U R                  5        [        U [        5      (       d  SU R                  0$ / nU R                   H  nT" U5      nUR                  U5        M     U R                  US.$ )Nrq   rä  )r§   rp   rr   r,  r­   )rU  Úchildren_layoutr4  rå  Ú
get_layoutrÛ  s       €€r‚   rè  Ú+BlocksConfig.get_config.<locals>.get_layoutÉ  sm   ø€ Ø×Ñ §	¡	Ô*Ü˜e¤\×2Ñ2Ø˜eŸi™iÐ(Ð(Ø ˆOØŸœ�Ù# EÓ*�Ø×&Ñ& vÖ.ñ (ð  Ÿ)™)°ÑAÐAr…   rå  r­   rq   r   rã  )rU  r]   r!  r1   )r¢   Úpagesrp   r¡   Úcontainer_idrn   rr   r  r¤   r§   rÓ   rT  rà  rˆ  rÎ   rx   rÒ   )r�   r    rØ   Ú
page_tupler¤   r¢   rå  Ú
root_childrU  Úblocks_itemsrp   rß  rã  r¿  Údependency_configrè  rÛ  s                  @@r‚   rÒ   ÚBlocksConfig.get_config·  s  ù€ àØØñ
ˆð Ÿ/™/×/Ô/ˆJØ˜a‘=ˆDØ &™>Õ)à%)§_¡_×%8Ñ%8ÀbÑIØ"$Ø$&ñ(��v‘˜tÓ$ñ 0ð ˆ÷	Bð 	Bö ØŸ™ Z×%<Ñ%<Ñ=‰JàŸ™ˆJÙ˜JÓ'ˆØ!ˆxÑà Ÿ*™* Z°Ö4ˆJÜ˜*¤d×+Ó+°
¸4Ñ0@ÀDÇKÁKÕ0OØŸ™ J¨tÑ$4Ñ5�Ø�v‘˜uŸz™zÑ*¨8Ñ4°ZÑ@×GÑGÈ
ÖSñ 5ô
 Ø�K‰K×ÑÓó
ˆó '‰JˆCØ×0Ñ0°°lÀEÓVˆLÞÙØ�<Ñ ×'Ñ'¨Ô5Ø�6‰N˜5Ÿ:™:Ñ& |Ñ4×;Ñ;¸E¿I¹IÖFñ 'ð ˆØ—(‘(—/‘/Ö#ˆBØÑ! R§^¡^°zÕ%AØ$&§M¡M£OÐ!Ø×#Ñ#Ð$5Ô6Ø�v‘˜rŸw™wÑ'¨Ñ7×>Ñ>Ð?PÐQUÑ?VÖWñ	 $ð ".ˆ~ÑØˆr…   c                ó0  • [        U R                  5      n[        R                  " U R                  5      Ul        [        R                  " U R                  5      Ul        U R
                  Ul        [        R                  " U R                  5      Ul        U$ r‡   )r†  r¢   Úcopyr¡   rˆ  r‰  rŠ  )r�   Únews     r‚   Ú__copy__ÚBlocksConfig.__copy__ó  s^   € Ü˜4Ÿ?™?Ó+ˆÜ—Y’Y˜tŸ{™{Ó+ˆŒ
Ü—)’)˜DŸH™HÓ%ˆŒØ—J‘JˆŒ	ÜŸ)š) D×$4Ñ$4Ó5ˆŒØˆ
r…   c           
     óÖ  • U R                   R                  5        HÆ  nUb  UR                  U:w  a  M  [        U[        R
                  5      (       d  M9  UR                  (       d  ML  UR                  u  p4n[        U5      S:„  nX@R                  S4/-  nU R                  U Vs/ s H  n[        U6 PM     snUUUSU(       a  SOSS9S   nUR                  5       Ul        MÈ     gs  snf )zYAdd a load event for every component whose initial value requires a function call to set.Nr   ÚloadFÚhiddenÚfull)rÇ  r©  )r¡   rÎ   rx   rr   r   rY   Úload_event_to_attachÚlenr¢   rÑ  r4   rÒ   Ú
load_event)	r�   rx   ra  Úload_fnÚtriggersrÅ  Ú
has_targetÚtriggerÚdeps	            r‚   Úattach_load_eventsÚBlocksConfig.attach_load_eventsû  sã   € àŸ™×+Ñ+Ö-ˆIØÑ&¨9×+@Ñ+@ÀKÓ+OÙä˜9¤j×&:Ñ&:×;Ó;Ø×2×2Ñ2à,5×,JÑ,JÑ)� 6Ü  ›]¨QÑ.�
ØŸo™o¨vÐ6Ð7Ñ7�ð ×,Ñ,ÙBJÓKÂ(°wÔ(¨'Ó2Á(ÑKØØØØ#Þ.8¡(¸fð -ð ð ñ�ð (+§~¡~Ó'7�	Ö$ò) .ùò Ls   Â$C&
)rp   r¡   r‰  rˆ  rŠ  r¢   )r¢   ÚBlocks)TTFrù  NNNNFTFé   NNNFFr™  ÚdefaultNÚpublicNFÚsseNg      à?NNNNN)Hr   zSequence[EventListenerMethod]r¿  úCallable | NonerÅ  údComponent | BlockContext | Sequence[Component | BlockContext] | Set[Component | BlockContext] | Noneri  r
  rÆ  r  r  r  r²  r  r©  z$Literal['full', 'minimal', 'hidden']rª  z&Component | Sequence[Component] | Noner¦  r  r§  zstr | None | Literal[False]r¨  ústr | Literal[True] | NonerÇ  r  r±  r  r¡  r  r¢  Úintr«  úlist[int] | Noner¬  úbool | Noner­  r"  r®  r  r¯  r  r°  z1Literal['once', 'multiple', 'always_last'] | Noner£  zint | None | Literal['default']r¤  r  r³  z,Literal['public', 'private', 'undocumented']r    úRenderable | Nonerµ  r  r¶  zLiteral['stream', 'sse']r·  zfloat | Noner¸  Úfloatr¹  r$  r»  r  rc   z(str | int | tuple[int | str, ...] | Noner¼  r	  rº  r  r!  ztuple[BlockFunction, int]r‡   )
rp   r  rÛ  z	list[int]rU  zBlock | Componentr    r  r!  r  )r    r  )rx   r  )r¸   r  r&  r'  rƒ   rÑ  Ústaticmethodrà  rÒ   rô  r  r*  rŽ   r…   r‚   r†  r†  �  s}  † ôDð4  Ø Ø!&Ø>DØCGØ#Ø7;Ø)-ØØØØØ$(Ø+/Ø$(Ø(-Ø(-ØJPØ=FØ%)ØGOØ(,Ø#(Ø/4Ø#'Ø!Ø04Ø(,Ø8<Ø%)Ø26ðan&à.ðn&ð ðn&ð
ðn&ððn&ð$ ð%n&ð& ð'n&ð( ð)n&ð* <ð+n&ð, Að-n&ð. ð/n&ð0 5ð1n&ð2 'ð3n&ð4 ð5n&ð6 ð7n&ð8 ð9n&ð: ð;n&ð< "ð=n&ð> )ð?n&ð@ "ðAn&ðB "&ðCn&ðD "&ðEn&ðF HðGn&ðH ;ðIn&ðJ #ðKn&ðL EðMn&ðN &ðOn&ðP !ðQn&ðR -ðSn&ðT !ðUn&ðV ðWn&ðX .ðYn&ðZ &ð[n&ð\ 6ð]n&ð^ #ð_n&ð`  0ðan&ðb 
#õcn&ð` ð
 )-ð	+Øð+àð+ð !ð+ð &ð	+ð
 
ô+ó ð+öZ:òx÷8ñ 8r…   r†  Úlaunchr±  Ú	integrater÷  Úunloadc            '      ó<  ^ • \ rS rSr% Sr\R                  " 5       rS\S'   \	SJS j5       r
      SK           SLU 4S jjjr\SMS	 j5       r\R                  SNS
 j5       r\SOS j5       rSPS jr\S 5       r\	        SQS j5       rS rS r\S 5       rSRS jrS rSSSTS jjrSSS.SUS jjr       SV                 SWS jjrSXS jrSYS jrSZS jr\              S[S j5       r S\       S]S jjr S^S jr!        S_S jr"S`S  jr#SaS! jr$SbS" jr%      SaS# jr&\ScS$ j5       r'\        SdS% j5       r(SbS& jr)  Se             SfS' jjr* S\             SgS( jjr+           Sh                           SiS* jjr,      SjS+ jr-S, r.S- r/SkS. jr0S\SlS/ jjr1S0 r2SmSnU 4S1 jjjr3S2 r4\5" 5          SoS3S4.       SpS5 jjj5       r6S6 r7S7 r8S8 r9 Sq     SrS9 jjr:           SsS: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SS)SSSSSSSS=.%                                                                                                 StS> jjjr;   Su     SvS? jjr<   Su         SwS@ jjr=SxSA jr>SqSySB jjr?  SxSC jr@SD rASE rBS\SzSF jjrC\        S{SG j5       rD\5" 5        S|       S}SH jj5       rESIrFU =rG$ )~r  i  aE  
Blocks is Gradio's low-level API that allows you to create more custom web
applications and demos than Interfaces (yet still entirely in Python).


Compared to the Interface class, Blocks offers more flexibility and control over:
(1) the layout of components (2) the events that
trigger the execution of functions (3) data flows (e.g. inputs can trigger outputs,
which can trigger the next level of outputs). Blocks also offers ways to group
together related demos such as with tabs.


The basic usage of Blocks is as follows: create a Blocks object, then use it as a
context (with the "with" statement), and then define layouts, components, or events
within the Blocks context. Finally, call the launch() method to launch the demo.

Example:
    import gradio as gr
    def update(name):
        return f"Welcome to Gradio, {name}!"

    with gr.Blocks() as demo:
        gr.Markdown("Start typing below and then click **Run** to see the output.")
        with gr.Row():
            inp = gr.Textbox(placeholder="What is your name?")
            out = gr.Textbox()
        btn = gr.Button("Run")
        btn.click(fn=update, inputs=inp, outputs=out)

    demo.launch()
Demos: blocks_hello, blocks_flipper, blocks_kinematics
Guides: blocks-and-event-listeners, controlling-layout, state-in-blocks, more-blocks-features, using-blocks-like-functions
zweakref.WeakSetÚ	instancesc                ó4   • [        [        R                  5      $ )z)
:return: list of all current instances.
)rÓ   r  r  )r×   s    r‚   Úget_instancesÚBlocks.get_instances;  s   € ô
 ”F×$Ñ$Ó%Ð%r…   NFc                ó¼  >• SU l         SU l        SU l        SU l        SU l        SU l        SU l        [        [        5      U l	        [        [        5      U l
        [        R                  " 5       U l        SU l        X@l        XPl        X`l        / U l        / U l        U   SU l        SU l        SU l        SU l        Ub  UO[0        R2                  " 5       U l        U R2                  (       a3  [4        R6                  " [0        R8                  S9nUR;                  5         OS[<        R>                  S'   SU l         / SQn	U	 V
s0 s H  oªU;   d  M
  X§RC                  U
5      _M     nn
U(       a=  S	RE                  URG                  5       5      n[H        RJ                  " S
U S3[L        SS9  URO                  S5      U l(        URO                  S5      U l)        URO                  S5      U l*        URO                  S5      U l+        URO                  S5      U l,        URO                  S5      U l-        []        U 5      U l/        [`        TU ]Ä  " SSS0UD6  X l2        SU l3        SU l4        SU l5        SU l6        SU l7        [p        Rr                  " 5       SL U l:        [p        Rr                  " 5       U l;        SU l<        SU l=        [}        [<        R~                  " SS5      5      U l@        [}        [<        R~                  " SS5      5      U lA        [„        R†                  " S5      U lD        [‹        5       U lF        U RŒ                  /U lG        X0lH        SU lI        SU lJ        SU lK        SU lL        SU lM        SU lN        SU lO        / U lP        / U lQ        [<        R>                  RO                  SS5      U lR        [‹        5       U lS        S/U lT        SU lU        SU lV        SU lW        SU lX        SU lY        SU lZ        U R2                  (       a-  U Rd                  [·        5       S.n[0        R¸                  " U5        [º        R¼                  R¿                  U 5        U RÁ                  5         gs  sn
f )a‡  
Parameters:
    analytics_enabled: Whether to allow basic telemetry. If None, will use GRADIO_ANALYTICS_ENABLED environment variable or default to True.
    mode: A human-friendly name for the kind of Blocks or Interface being created. Used internally for analytics.
    title: The tab title to display when this is opened in a browser window.
    fill_height: Whether to vertically expand top-level child components to the height of the window. If True, expansion occurs when the scale value of the child components >= 1.
    fill_width: Whether to horizontally expand to fill container fully. If False, centers and constrains app to a maximum width. Only applies if this is the outermost `Blocks` in your Gradio app.
    delete_cache: A tuple corresponding [frequency, age] both expressed in number of seconds. Every `frequency` seconds, the temporary files created by this Blocks instance will be deleted if more than `age` seconds have passed since the file was created. For example, setting this to (86400, 86400) will delete temporary files every day. The cache will be deleted entirely when the server restarts. If None, no cache deletion will occur.
NFTé(   )rÈ  ÚTrueÚHF_HUB_DISABLE_TELEMETRY)ÚthemeÚcssÚ	css_pathsr¨  ÚheadÚ
head_pathsú, zaThe parameters have been moved from the Blocks constructor to the launch() method in Gradio 6.0: z3. Please pass these parameters to launch() instead.é   )Ú
stacklevelr  r  r   r¨  r!  r"  rb   ÚGRADIO_WATCH_DIRSrš  ÚGRADIO_VIBE_MODEé@   ÚGRADIO_ROOT_PATH)rš  ÚHomeT)ÚmodeÚversionrŽ   )aÚlimiterÚencryptr~   Ú	mcp_errorÚshareÚenable_queueÚmax_threadsr   r  Úpending_streamsÚpending_diff_streamsÚweakrefÚWeakKeyDictionaryÚ_stream_run_idsÚ
show_errorÚfill_heightÚ
fill_widthÚdelete_cacheÚextra_startup_eventsrŠ  Úcustom_mount_pathÚpwaÚ
mcp_serverÚrun_historyr   Úanalytics_enabledÚ	threadingÚThreadÚversion_checkr}  ÚosÚenvironÚenable_monitoringrÖ   rÁ  rS  ÚwarningsÚwarnÚUserWarningrn   Ú_deprecated_themeÚ_deprecated_cssÚ_deprecated_css_pathsÚ_deprecated_jsÚ_deprecated_headÚ_deprecated_head_pathsr†  Údefault_configÚsuperrƒ   r+  Ú
is_runningÚ	local_urlÚ	share_urlÚwidthÚheightr   Ú	get_spaceÚapi_openÚspace_idÚfavicon_pathÚauthr  ÚgetenvÚdev_modeÚ	vibe_modeÚrandomÚgetrandbitsÚapp_idr{   Úupload_file_setr¦   ÚtitleÚpredictÚinput_componentsÚoutput_componentsr¸   Úapi_modeÚprogress_trackingÚ
ssl_verifyÚallowed_pathsÚblocked_pathsÚ	root_pathÚ
proxy_urlsrê  r£   r  r¨  r!  r  r"  rW   Úinitiated_analyticsr  r  r¥   r±  )r�   rA  r+  rd  r9  r:  r;  ræ   ÚtÚdeprecated_paramsrY  Údeprecated_kwargsÚ
param_listr  r¶   s                 €r‚   rƒ   ÚBlocks.__init__B  sÅ  ø€ ð( ˆŒØˆŒØ6:ˆÔØ%)ˆŒØˆŒ
Ø ˆÔØˆÔÜ*¬4Ó0ˆÔÜ$/´Ó$5ˆÔ!ô ×%Ò%Ó'ð 	Ôð ˆŒØ&ÔØ$ŒØ(ÔØSUˆÔ!Ø-/ˆÔÙØ-1ˆÔØˆŒØˆŒØˆÔð !Ñ,ñ ä×,Ò,Ó.ð 	Ôð
 ×!×!Ü× Ò ¬	×(?Ñ(?Ñ@ˆAØ�G‰G�Ià5;ŒB�J‰JÐ1Ñ2Ø.2ˆÔâUÐÙ7HÓXÒ7H°!ÐQWÉKÓ-˜Q§
¡
¨1£Ò-Ñ7HÐÐXÞØŸ™Ð#4×#9Ñ#9Ó#;Ó<ˆJÜ�MŠMØsÐt~Ðsð @Dð EäØò	ð "3×!6Ñ!6°wÓ!?ˆÔØ0×4Ñ4°UÓ;ˆÔØ%6×%:Ñ%:¸;Ó%GˆÔ"Ø/×3Ñ3°DÓ9ˆÔØ 1× 5Ñ 5°fÓ =ˆÔØ&7×&;Ñ&;¸LÓ&IˆÔ#ä*¨4Ó0ˆÔÜ‰ÒÑ0 Ð0¨Ò0àŒ	ØˆŒØˆŒØˆŒØˆŒ
ØˆŒÜŸšÓ)¨TÐ1ˆŒäŸšÓ)ˆŒØ ˆÔØˆŒ	ÜœRŸYšYÐ':¸BÓ?Ó@ˆŒÜœbŸišiÐ(:¸BÓ?Ó@ˆŒÜ×(Ò(¨Ó,ˆŒÜ"›uˆÔØ#×3Ñ3Ð4ˆÔØŒ
ð ˆŒØ $ˆÔØ!%ˆÔØˆŒØˆŒà!%ˆÔØˆŒØˆÔØˆÔÜŸ™Ÿ™Ð(:¸BÓ?ˆŒÜ›%ˆŒà3EÐ2FˆŒ
ØˆÔàˆŒØˆŒØˆŒ	ØˆŒ
ØˆŒà×!×!àŸ	™	Ü.Ó0ñˆDô ×)Ò)¨$Ô/ä×Ñ×Ñ˜TÔ"à�
‰
�ùòK Ys   Ä?	QÅQc                ó.   • U R                   R                  $ r‡   ©rQ  r¡   r‰   s    r‚   r¡   ÚBlocks.blocksÈ  s   € à×"Ñ"×)Ñ)Ð)r…   c                ó$   • XR                   l        g r‡   rv  r  s     r‚   r¡   rw  Ì  s   € à%*×ÑÕ"r…   c                ó.   • U R                   R                  $ r‡   )rQ  rˆ  r‰   s    r‚   rˆ  Ú
Blocks.fnsÐ  s   € à×"Ñ"×&Ñ&Ð&r…   c                óŒ   • U R                   U   n[        U[        R                  [        45      (       d  [        SU S35      eU$ )NzBlock with id z# is not a Component or BlockContext)r¡   rr   r   rY   r,  Ú	TypeError)r�   rq   Úcomps      r‚   Úget_componentÚBlocks.get_componentÔ  sA   € Ø�{‰{˜2‰ˆÜ˜$¤×!5Ñ!5´|Ð D×EÑEÜ˜n¨R¨DÐ0SÐTÓUÐUØˆr…   c                ó(   • SSK Jn  [        USS5      $ )Nr   )Úreload_threadÚrunning_reloadF)Úgradio.cli.commands.reloadr�  rl   )r�   r�  s     r‚   Ú_is_running_in_reload_threadÚ#Blocks._is_running_in_reload_threadÚ  s   € å<ä�}Ð&6¸Ó>Ð>r…   c           	     ó  ^^^^^^• [         R                  " U5      nUS   m0 m[        5       m[        R                  " T5      R
                  R                  S5      (       a  TR                  T5        S0UUU4S jjmUUU4S jmS/n[        UR                  SS5      S	9 n[        R                  =(       d    U=TS
'   nSU;   a  T" US   R                  S/ 5      5        SnSU;  a  [        S5      e[        US   USS9 GH�  u  p‰SU;   a  US   S:X  a  M  U H  n
UR                  U
S5        M     UR                  S5      nUR                  SS5      nSn[        US
   [         5      (       d(  US
   S   S;   a  [#        U5      S:w  a  [        S5      eSnUR                  S5        UR                  SS5        US    Vs/ s H  nTU   PM
     snUS'   US    Vs/ s H  nTU   PM
     snUS'   UR                  SS5        UR                  SS5        UR                  SS5        UR                  SS5        UR                  SS5        UR                  S S5        UR                  S!S5      nUc,  UR                  S"S5      nUS#   SL a  S$nO
USL a  S%nOS&nUUS!'   SUS''   SUS('   U(       aP  [%        SS)5      /nUR                  S*5      US*'   UR                  S+5      US+'   UR                  S,S5      US,'   SUS-'   OW[        R'                  TX¼5       Vs/ s H6  n[%        UR(                  (       a  UR*                  OSUR,                  5      PM8     nnUR.                  R0                  " S1UU	S..UD6S
   nUb  GM  UnGM„     U(       aJ  [3        5       (       a;  US
   /Ul        UR6                  Ul        UR:                  Ul        S/Ul        SUl         SSS5        TWl!        U$ s  snf s  snf s  snf ! , (       d  f       N&= f)2a£  
Factory method that creates a Blocks from a config and list of functions. Used
internally by the gradio.external.load() method.

Parameters:
config: a dictionary containing the configuration of the Blocks.
fns: a list of functions that are used in the Blocks. Must be in the same order as the dependencies in the config.
proxy_url: an external url to use as a root URL when serving files for components in the Blocks.
r   ú	.hf.spacerq   c                ó  >• T H  nUS   U :X  d  M    O   [        SU  35      e[        US   S   5      nUS   R                  S5      c  T	 S3US   S'   US   R                  SS 5      nUR	                  US   5      nU" S
0 UD6nUb  X5l        US   S   nXel        [        R                  " U5      R                  R                  S5      (       a  T
R                  U5        US   R                  S	S 5      =n b  Xul        U$ )Nrq   zCannot find block with id rä   rÆ   rf   Ú/r_   r‡  rÇ   rŽ   )r¯   rT   rn   rÖ   rç   r_   rf   ÚhttpxÚURLr|  Úendswithr¥   rÇ   )rq   rß  r×   Úpostprocessed_valuer—   rU  Úblock_proxy_urlrÇ   Úcomponents_configrf   rn  s           €€€r‚   Úget_block_instanceÚ.Blocks.from_config.<locals>.get_block_instance÷  s+  ø€ Û 1�Ø Ñ%¨Õ+Ùñ !2ô !Ð#=¸b¸TÐ!BÓCÐCÜ+¨L¸Ñ,AÀ&Ñ,IÓJˆCð
 ˜GÑ$×(Ñ(¨Ó5Ñ=Ø8A°{À!°_�˜WÑ% kÑ2Ø".¨wÑ"7×";Ñ";¸GÀTÓ"JÐà"×1Ñ1°,¸wÑ2GÓHÐÙÑ+Ð*Ñ+ˆEØ"Ñ.Ø1”à*¨7Ñ3°KÑ@ˆOØ-ŒOô �yŠy˜Ó)×.Ñ.×7Ñ7¸×DÑDØ—‘˜Ô/à+¨GÑ4×8Ñ8¸ÈÓMÐM�Øñð %0Ô!àˆLr…   c                óú   >• U  Hb  nUS   nT" U5      nUTU'   UR                  S5      nUc  M+  [        U[        5      (       d  [        SU S35      eU   T" U5        S S S 5        Md     g ! , (       d  f       Mv  = f)Nrq   r­   zInvalid config, Block with id z( has children but is not a BlockContext.)rn   rr   r,  r¯   )Úchildren_listÚchild_configrq   rU  r­   r�  Úiterate_over_childrenÚoriginal_mappings        €€€r‚   r•  Ú1Blocks.from_config.<locals>.iterate_over_children  s…   ø€ Û -�Ø! $Ñ'�Ù*¨2Ó.�à',Ð  Ñ$à'×+Ñ+¨JÓ7�ØÓ'Ü% e¬\×:Ñ:Ü(Ø<¸R¸DÐ@hÐióð ò Ù-¨hÔ7÷ ™ò !.÷ žús   Á	A+Á+
A:	Útypesr  N)r  r   rå  r­   rã  zEThis config is missing the 'dependencies' field and cannot be loaded.F©Ústrictr   Ú
fake_eventr   ri   )ÚthenÚsuccesszcThis logic assumes that .then() events are not combined with other events in a single gr.on() eventTÚ
backend_fnÚdocumentationrÅ  ri  Ústatus_trackerÚzerogpurx   Ú	render_idÚeveryr³  Úshow_apir¦  r�  r  ÚundocumentedrÆ  r  rœ  r­  r®  r¯  rÇ  )r   r¿  Ú	Interface)rq   r  r!  r]   rŽ   )"rò  Údeepcopyr{   rŠ  r‹  r|  rŒ  r¥   r  rn   r%   r¢   r¯   ÚziprÖ   rr   r  rû  r4   Úget_event_targetsÚhas_triggerÚ__self__r½  rQ  rÑ  r'   re  rÅ  rf  ri  rg  r¸   rh  rn  )r×   rØ   rˆ  rf   Úderived_fieldsr¡   r¢   Úfirst_dependencyÚ
dependencyr¿  ÚfieldrÉ  r   Úis_then_eventÚiÚor³  r¤  r   rp  r�  r�  r•  r–  rn  s      `                @@@@@r‚   Úfrom_configÚBlocks.from_configà  sE  ý€ ô  —’˜vÓ&ˆØ" <Ñ0ÐØ-/ÐÜ"›uˆ
Ü�9Š9�YÓ×$Ñ$×-Ñ-¨k×:Ñ:Ø�N‰N˜9Ô%÷	ñ 	÷B	8ð  "˜ˆä˜&Ÿ*™* W¨dÓ3Ò4¸ä/6×/AÑ/A×/KÀVÐKÐ˜QÑ *à˜6Ó!Ù% f¨XÑ&6×&:Ñ&:¸:ÀrÓ&JÔKà#Ðð  VÓ+Ü Ø[óð ô #& f¨^Ñ&<¸cÈ%Õ"P‘�
ð  
Ó*¨z¸)Ñ/DÈÓ/TÙÛ+�EØ—N‘N 5¨$Ö/ñ ,ð
 &Ÿ>™>¨)Ó4�Ø$Ÿ.™.¨°DÓ9�Ø %�ô
 " (¨1¡+¬s×3Ñ3¸À¹ÀA¹ð Kó 9ô ˜8“}¨Ó)Ü(ð Bóð ð %)�Mà—‘˜|Ô,Ø—‘˜°Ô5à1;¸HÒ1Eó(Ú1E¨AÐ$ QÔ'Ñ1Eñ(�
˜8Ñ$ð 2<¸IÒ1Fó)Ú1F¨AÐ$ QÔ'Ñ1Fñ)�
˜9Ñ%ð —‘Ð/°Ô6Ø—‘˜y¨$Ô/Ø—‘˜t TÔ*Ø—‘˜}¨dÔ3Ø—‘˜{¨DÔ1Ø—‘˜w¨Ô-ð ",§¡Ð0@À$Ó!G�Ø!Ñ)Ø)Ÿ~™~¨j¸$Ó?�HØ! *Ñ-°Ò6Ø)2™Ø! TÒ)Ø)1™à)7˜Ø3A�JÐ/Ñ0à+0�
˜<Ñ(Ø,1�
˜=Ñ)Þ Ü2°4¸Ó@ÐA�GØ2<·.±.ÀÓ2Q�J˜Ñ/Ø<F¿N¹NØ1ó=�JÐ8Ñ9ð =G¿N¹NØ1°5ó=�JÐ8Ñ9ð /3�J˜{Ò+ô "(×!9Ñ!9Ø,¨hô"óò
"˜Aô	 ,Ø*+¯-¯-˜AŸJšJ¸TØŸL™Löñ"ð ð ð (×6Ñ6×HÒHð Ø#¨ñØ.8ñàñ�
ð $Ô+Ø'1Ó$ñi #Qön  Ô$6×$8Ñ$8Ø"% a¡& �”Ø*:×*AÑ*A�Ô'Ø+;×+CÑ+C�Ô(Ø"-�”Ø"&�”÷U 5ðV 'ˆÔØˆùò}(ùò)ùòH÷k 5Õ4ús?   Â!D"O9ÇO*ÇO9ÇO/Ç.D,O9Ì=O4Í%O9ÎAO9Ï*O9Ï9
Pc                ó"   • U R                  5       $ r‡   )Ú__repr__r‰   s    r‚   Ú__str__ÚBlocks.__str__˜  s   € Ø�}‰}‹Ðr…   c                ó0  • [        U R                  R                  5        Vs/ s H  oR                  (       d  M  UPM     sn5      nSU S3nUSS[        U5      -   3-  nU R                  R	                  5        H’  u  pUR                  (       d  M  USU 3-  nUS-  nUR
                   H$  nU R                  UR                     nUSU 3-  nM&     US-  nUR                   H$  nU R                  UR                     nUSU 3-  nM&     M”     U$ s  snf )	NzGradio Blocks instance: z backend functionsÚ
rs  z

fn_index=z	
 inputs:z
 |-z

 outputs:)	rû  rˆ  rÎ   r¿  rT  rÅ  r¡   rp   ri  )r�   ÚdÚnum_backend_fnsÚreprr®  rU  s         r‚   r¶  ÚBlocks.__repr__›  s  € Ü¨$¯(©(¯/©/Ô*;ÓDÒ*; Q¿t½tŸqÑ*;ÑDÓEˆØ)¨/Ð):Ð:LÐMˆØ�"�Sœ3˜t›9‘_Ð%Ð&Ñ&ˆØ!ŸX™XŸ^™^Ö-‰MˆAØ�}�}‰}Ø˜+ a SÐ)Ñ)�Ø˜Ñ$�Ø'×.Ô.�EØ ŸK™K¨¯	©	Ñ2�EØ˜e E 7˜OÑ+’Dñ /ð ˜Ñ%�Ø'×/Ô/�EØ ŸK™K¨¯	©	Ñ2�EØ˜e E 7˜OÑ+’Dó 0ñ .ð ˆùò Es
   ¢DºDc                óV   • [        S U R                  R                  5        5       5      $ )z>Return whether the app expects user to authenticate via OAuth.c              3  óV   #   • U  H  n[        U[        R                  5      v •  M!     g 7fr‡   )rr   r   ÚLoginButton©r_  rU  s     r‚   rb  Ú'Blocks.expects_oauth.<locals>.<genexpr>¯  s$   é € ð 
ÚCW¸%ŒJ�uœj×4Ñ4×5Ð5ÒCWùs   ‚'))rh  r¡   rÎ   r‰   s    r‚   Úexpects_oauthÚBlocks.expects_oauth¬  s+   € ô ñ 
ØCGÇ;Á;×CUÑCUÔCWó
ó 
ð 	
r…   c                ót   • U R                   R                  [        SS5      /USSSSSSSSSSSSSSSSSSS	S
9  g)aù  This listener is triggered when the user closes or refreshes the tab, ending the user session.
It is useful for cleaning up resources when the app is closed.
Parameters:
    fn: Callable function to run to clear resources. The function should not take any arguments and the output is not used.
Example:
    import gradio as gr
    with gr.Blocks() as demo:
        gr.Markdown("# When you close the tab, hello will be printed to the console")
        demo.unload(lambda: print("hello"))
    demo.launch()
Nr  Frø  Tr  r™  r  r�  )r   r¿  rÅ  ri  rÆ  r  r©  r¦  r¨  rÇ  r¡  r¢  r«  r¬  r­  r®  r¯  r°  r£  r¤  r³  )rQ  rÑ  r4   )r�   r¿  s     r‚   r  ÚBlocks.unload³  sf   € ð 	×Ñ×-Ñ-Ü(¨¨xÓ8Ð9ØØØØØØ"ØØØØØØØ $ØØ$)Ø$)ØØ'ØØ$ð+ 	.ò 	
r…   c                óè  • [        5       nUGbœ  UR                  nU R                  UR                  ;   a  [	        SU R                   S35      e[        UR                  5      R                  U R                  5      nU H:  n[        U R                  U   [        R                  5      (       a  M1  [	        S5      e   U R                  R                  5        H  nUR                  Ul        M     UR                  R                  U R                  5        [        UR                  R!                  5       SS9S-   nUR                  R                  5        Vs/ s H0  n[        UR"                  [$        5      (       d  M$  UR"                  PM2     nnU R                  R                  5        GHf  n	UR                  U	l        U	=R                  U-  sl        U	R&                   V
Vs/ s H%  u  p«X R                  :X  a  UR                  U4OX«4PM'     snn
U	l        U	R"                  n[        U[$        5      (       a"  [(        R*                  " UU5      nXÍ:w  a  XÙl        U	R,                   Vs/ s H  oîU-   PM	     snU	l        U	R.                  b  U	=R.                  U-  sl        U	R,                  (       aF  U	R,                   Vs/ s H  oñR                  U   R1                  5       PM!     nn[3        U5      U	l        X‘R                  U	R                  '   GMi     [        UR                  R!                  5       SS9S-   Ul        UR6                  R9                  U R6                  5        UR:                  R                  U R:                  5        UR<                  R9                  U R<                  5        [?        5       nUb%  UR@                  R9                  U R@                  5        U $ s  snf s  snn
f s  snf s  snf )Nrž   rŸ   z<At least one block in this Blocks has already been rendered.éÿÿÿÿ)r  ri   )!r'   r¢   rp   r¡   r7   r{   Úintersectionrr   r   ÚStaterÎ   r£   r¤   rN  Úmaxrˆ  rS  r¦  rs   r   r   rÄ  r«  r­  rÒ   rU   r‰  r¦   Úextendrn  r<  r(   r­   )r�   r¨   r¢   Úoverlapping_idsrq   rU  Údependency_offsetr  Úexisting_api_namesr®  Ú	target_idr½  r¦  Ú	api_name_Úcr±  Úupdated_cancelsr©   s                     r‚   rb   ÚBlocks.render×  s\  € Ü)Ó+ˆØÒ#Ø%×0Ñ0ˆJØ�x‰x˜<×.Ñ.Ó.Ü)Ø'¨¯© zÐ1bÐcóð ô " ,×"5Ñ"5Ó6×CÑCÀDÇKÁKÓPˆOÛ%�ä! $§+¡+¨b¡/´:×3CÑ3C×DÓDÜ-ØVóð ñ &ð Ÿ™×+Ñ+Ö-�Ø'×4Ñ4�–
ñ .à×Ñ×&Ñ& t§{¡{Ô3Ü # L×$4Ñ$4×$9Ñ$9Ó$;ÀRÑ HÈ1Ñ LÐð (×+Ñ+×2Ñ2Ô4ó"â4�CÜ˜cŸl™l¬C×0ó �—”Ù4ð ð "ð
 #Ÿh™hŸo™o×/�
Ø",×"9Ñ"9�
”Ø—’Ð"3Ñ3•ð 2<×1CÒ1Cô	&ò 2DÑ-˜	ð !§H¡HÓ,ð  —^‘^ ZÑ0à#Ð0ò1ñ 2Dò	&�
Ô"ð &×.Ñ.�Ü˜h¬×,Ñ,Ü %× :Ò :Ø Ø*ó!�Ið  Ó,Ø.7Ô+ØEO×EWÒEWÓ%XÒEWÀÐ*;Ô&;ÑEWÑ%X�
Ô"Ø×+Ñ+Ñ7Ø×,Ò,Ð0AÑAÕ,ð ×%×%àBL×BTÒBTó'ÚBT¸Q×(Ñ(¨Ñ+×6Ñ6Ö8ÑBTð $ð 'ô *BÀ/Ó)R�JÔ&Ø3=× Ñ  §¡Ô0ñ= 0ô> "% \×%5Ñ%5×%:Ñ%:Ó%<ÀbÑ!IÈAÑ!MˆLÔØ×%Ñ%×,Ñ,¨T×-@Ñ-@ÔAØ×!Ñ!×(Ñ(¨¯©Ô9Ø×+Ñ+×2Ñ2°4×3LÑ3LÔMä+Ó-ˆØÑ%Ø×#Ñ#×*Ñ*¨4¯=©=Ô9ØˆùòY"ùó&ùò &Yùò's   Å#OÅ;OÇ ,O$É&O*Ê=&O/r   c                ó\  • U R                   U   nU R                   U   n[        R                  " UR                  5      (       a  g[        R                  " UR                  5      (       a  g[        S UR                   5       5      (       a  g[        S UR                   5       5      (       + $ )zVChecks if a particular Blocks function is callable (i.e. not stateful or a generator).Fc              3  ó8   #   • U  H  oR                   v •  M     g 7fr‡   ©r�   rÂ  s     r‚   rb  Ú%Blocks.is_callable.<locals>.<genexpr>"  s   é € Ð=Ò+< %�~Ž~Ò+<ùó   ‚c              3  ó8   #   • U  H  oR                   v •  M     g 7fr‡   rØ  rÂ  s     r‚   rb  rÙ  $  s   é € ÐFÒ3E¨%—~–~Ò3EùrÚ  )rˆ  rË   Úisasyncgenfunctionr¿  Úisgeneratorfunctionrh  rÅ  ri  )r�   Úfn_indexrÐ  r®  s       r‚   Úis_callableÚBlocks.is_callable  s‚   € à—8‘8˜HÑ%ˆØ—X‘X˜hÑ'ˆ
ä×%Ò% h§k¡k×2Ñ2ØÜ×&Ò& x§{¡{×3Ñ3ØÜÑ=¨:×+<Ò+<Ó=×=Ñ=ØÜÑF°:×3EÒ3EÓFÓFÔFÐFr…   )rÞ  r¦  c          	     ój  ^• TbA  [        U4S jU R                  R                  5        5       S5      nUc  [        ST 35      eUnU R	                  U5      (       d  [        S5      e[        U5      nU R                  X5      nU R                  U   nUR                  (       a  U Vs/ s H  ow/PM     nn[        R                  " U R                  UUS0 SS9nUS   nUR                  (       a  U V	s/ s H  o™S   PM	     nn	U R                  X5      n[        R                  " U5      n
U
$ s  snf s  sn	f )	aÚ  
Allows Blocks objects to be called as functions. Supply the parameters to the
function as positional arguments. To choose which function to call, use the
fn_index parameter, which must be a keyword argument.

Parameters:
*inputs: the parameters to pass to the function
fn_index: the index of the function to call (defaults to 0, which for Interfaces, is the default prediction function)
api_name: The api_name of the dependency to call. Will take precedence over fn_index.
Nc              3  óP   >#   • U  H  u  pUR                   T:X  d  M  Uv •  M     g 7fr‡   )r¦  )r_  r±  r»  r¦  s      €r‚   rb  Ú"Blocks.__call__.<locals>.<genexpr>3  s"   øé € ÐJÒ/‘t�q°1·:±:ÀÑ3I—‘Ò/ùs   ƒ&�	&z%Cannot find a function with api_name zŸThis function is not callable because it is either stateful or is a generator. Please use the .launch() method instead to create an interactive user interface.T)rÐ  rÅ  ÚrequestÚstateÚexplicit_callr  r   )re  rˆ  rT  r9   rß  r¯   rÓ   Úserialize_datar¡  rì   Úsynchronize_asyncÚprocess_apiÚdeserialize_datar   rg  )r�   rÞ  r¦  rÅ  Úinferred_fn_indexÚprocessed_inputsr¿  Úinpri  ÚoutÚprocessed_outputss     `        r‚   Ú__call__ÚBlocks.__call__&  s@  ø€ ð ÑÜ $ÜJ˜tŸx™xŸ~™~Ô/ÓJØó!Ðð !Ñ(Ü)Ø;¸H¸:ÐFóð ð )ˆHØ× Ñ  ×*Ñ*Üð róð ô �f“ˆØ×.Ñ.¨xÓ@ÐØ�X‰X�hÑˆØ�8�8Ù1AÓBÒ1A¨#£Ñ1AÐÐBä×0Ò0Ø×ÑØØ#ØØØñ
ˆð ˜&‘/ˆà�8�8Ù)0Ó1ª #˜1”v©ˆGÐ1à×'Ñ'¨Ó:ˆÜ!×3Ò3°GÓ<Ðà Ð ùò%  Cùò 2s   Â'D+Ã2D0c
           	   ƒ  óH  #   • [        U[        5      (       a  U R                  U   nUR                  (       d  [	        S5      eSn
[        U[
        5      (       a  US   OUn[        R                  " 5       n[        R                  " UR                  U UUUUS9nUGcL  UR                  (       a  [        [        UR                  USS95      /nUR                  (       a  UR                  R                  OUR                  n0 nUR                   H6  nU[        U5      :  d  M  [        UU   [        5      (       d  M.  UU   UU'   M8     [!        UUUUUU	S9u  nn  nUb  UU   OSnUb!  Ub  [#        UUR$                  5      u  nnUUU'   [&        R(                  " U5      (       a  U" U6 I Sh  v•N nO9[*        R,                  R.                  " U/UQ7SU R0                  06I Sh  v•N nOSn[&        R2                  " U5      (       d  [&        R4                  " U5      (       av   Uc  [7        [8        [:           U5      n[&        R<                  " U5      (       a   [        R>                  " X0R0                  5      n[        R@                  " U5      I Sh  v•N nS	n
[        R                  " 5       U-
  nUUU
US.$  GN
 NÕ N*! [B         aX    [        URD                  5      nUS
:X  a  [F        RH                  RJ                  O[F        RH                  RJ                  4U-  nSn N‡f = f7f)a~  
Calls function with given index and preprocessed input, and measures process time.
Parameters:
    fn_index: index of function to call
    processed_input: preprocessed input to pass to function
    iterator: iterator to use if function is a generator
    requests: requests to pass to function
    event_id: id of event in queue
    event_data: data associated with event trigger
zfunction has no backend method.Fr   )r¿  r¡   Úevent_idÚin_event_listenerrä  rå  Nr™  )Úcomponent_propsÚtokenr-  Tri   )Ú
predictionÚdurationÚis_generatingÚiterator)&rr   r  rˆ  r¿  Ú
IndexErrorrÓ   Útimer   Úget_function_with_localsrŸ  r  r¨  rÅ  r    rº  rû  r?   r=   Ú
track_tqdmrË   ÚiscoroutinefunctionÚanyioÚ	to_threadÚrun_syncr-  rÝ  rÜ  r   r   r   ÚisgeneratorÚSyncToAsyncIteratorÚasync_iterationÚStopAsyncIterationri  r   rQ  ÚFINISHED_ITERATING)r�   rÐ  Úprocessed_inputrú  Úrequestsró  Ú
event_datarô  rå  Úoauth_tokenrù  rä  r}  r¿  rÊ  rõ  ÚidxrË  r	  Úprogress_trackerr÷  Ú	n_outputsrø  s                          r‚   Úcall_functionÚBlocks.call_functionX  sò  é € ô, �h¤×$Ñ$Ø—x‘x Ñ)ˆHØ�{�{ÜÐ>Ó?Ð?ØˆÜ!+¨H´d×!;Ñ!;�(˜1’+ÀˆÜ—	’	“ˆä×+Ò+Ø�{‰{ØØØ/ØØñ
ˆð ÒØ×&×&äœ˜XŸ_™_¨oÀeÑLÓMð#�ð
 +3×*=×*=�×#Ñ#×&Ò&À8Ç;Á;ð ð !ˆOØ×5Ô5�Øœ˜_Ó-Õ-´*Ø# CÑ(¬$÷3ó 3ð ,;¸3Ñ+?�O CÓ(ñ	 6ô 5AØØØØØ /Ø!ñ5Ñ1ˆO˜^¨Q°ð 4BÑ3M� Ò/ÐSWð ð  Ñ+°Ñ0JÜ'5°bÐ:J×:UÑ:UÓ'VÑ$Ð  "Ø2B� Ñ/ä×*Ò*¨2×.Ñ.Ù#% Ð#7×7‘
ä#(§?¡?×#;Ò#;Øð$Ø(ò$Ø26·,±,ñ$÷ ‘
ð ˆJä×&Ò& r×*Ñ*¬g×.HÒ.HÈ×.LÑ.Lð ØÑ#Ü#¤M´#Ñ$6¸
ÓC�HÜ×&Ò& x×0Ñ0Ü$×8Ò8¸Ç<Á<ÓP�HÜ#(×#8Ò#8¸Ó#B×B�
Ø $�ô —9’9“; Ñ&ˆð %Ø Ø*Ø ñ	
ð 	
ò7 8ññ Cøä%ó  Ü × 0Ñ 0Ó1�	ð ! A“~ô ×(Ñ(×;Ò;ä$×.Ñ.×AÑAÐCÀiÑOð ð
  ’ð üsi   ‚DL"Ä"L"Ä<A0L"Æ,J6Æ-6L"Ç#J9Ç$=L"È"A.J= ÊJ;ÊJ= Ê L"Ê9L"Ê;J= Ê=ALÌL"ÌLÌL"c                ó�  • U R                   U   n/ nS n[        UR                  5       H˜  u  pg[        U[        R
                  5      (       d  [        UR                   S35      eUR                  5       n[        R                  " U5      (       a  [        R                  " X&   US 5      n	OX&   n	UR                  U	5        Mš     U$ )Nc                ó0   • [        U S9R                  5       $ )N)rý   )r.   r  ©r€  s    r‚   Úformat_fileÚ*Blocks.serialize_data.<locals>.format_fileÆ  s   € Ü Ñ#×.Ñ.Ó0Ð0r…   ú' Component not a valid input component.c                óh   • [         R                  " U 5      =(       d    [         R                  " U 5      $ r‡   )rì   Úis_filepathrí   r  s    r‚   r‘  Ú'Blocks.serialize_data.<locals>.<lambda>Ó  s$   € Ü$×0Ò0°Ó3×W´|×7TÒ7TÐUVÓ7WÐWr…   )rˆ  rf  rÅ  rr   r   rY   r:   r¶   rÖ  rì   Úvalue_is_fileÚtraverser§   )
r�   rÞ  rÅ  r®  r  r  r±  rU  rÖ  Úserialized_inputs
             r‚   rç  ÚBlocks.serialize_dataÂ  sÁ   € Ø—X‘X˜hÑ'ˆ
Øˆò	1ô " *×"3Ñ"3Ö4‰HˆAÜ˜e¤Z×%9Ñ%9×:Ñ:Ü+Ø—‘Ð'Ð'NÐOóð ð —~‘~Ó'ˆHÜ×)Ò)¨(×3Ñ3Ü#/×#8Ò#8Ø‘IØñó$Ñ ð $*¡9Ð Ø×"Ñ"Ð#3Ö4ñ! 5ð$ Ðr…   c                óF  • U R                   U   n/ n[        UR                  5       Hv  u  pV[        U[        R
                  5      (       d  [        UR                   S35      e[        R                  " X%   S [        R                  5      nUR                  U5        Mx     U$ )Nú( Component not a valid output component.c                ó   • U S   $ )Nrý   rŽ   r  s    r‚   r‘  Ú)Blocks.deserialize_data.<locals>.<lambda>è  s   €  a¨¢ir…   )rˆ  rf  ri  rr   r   rY   r:   r¶   rì   r  Úis_file_objr§   )r�   rÞ  ri  r®  rj  r²  rU  Údeserializeds           r‚   rê  ÚBlocks.deserialize_dataÝ  s–   € Ø—X‘X˜hÑ'ˆ
Øˆä! *×"4Ñ"4Ö5‰HˆAÜ˜e¤Z×%9Ñ%9×:Ñ:Ü+Ø—‘Ð'Ð'OÐPóð ô (×0Ò0Ø‘
Ñ/´×1IÑ1IóˆLð ×Ñ˜|Ö,ñ 6ð Ðr…   c                ó  • UR                   n[        U5      [        U5      :  aé  UR                  (       a   UR                  S:w  a  SUR                   S3OSn/ n/ nU H  nUR                  [	        U5      5        M     U H:  n[        U[        5      (       a  SU S3O
[	        U5      n	UR                  U	5        M<     SR                  U5      n
SR                  U5      n[        SU S[        U5       S	[        U5       S
U
 SU S35      eg )Nú<lambda>ú (Ú)rš  Ú"r#  zAn event handlerz- didn't receive enough input values (needed: z, got: zz).
Check if the event handler calls a Javascript function, and make sure its return value is correct.
Wanted inputs:
    [z]
Received inputs:
    [Ú])rÅ  rû  rÆ   r§   rs   rr   rÁ  r¯   )r�   rÐ  rÅ  Ú
dep_inputsrÆ   Úwanted_argsÚreceived_argsrU  rí  rZ  ÚwantedÚreceiveds               r‚   Úvalidate_inputsÚBlocks.validate_inputsî  s  € Ø—_‘_ˆ
ô
 ˆv‹;œ˜Z›Ó(ð —=—= X§]¡]°jÓ%@ð �X—]‘]�O 1Ñ%àð ð ˆKØˆMÛ#�Ø×"Ñ"¤3 u£:Ö.ñ $ã�Ü",¨S´#×"6Ñ"6�a˜�u˜A‘J¼CÀ»H�Ø×$Ñ$ QÖ'ñ ð —Y‘Y˜{Ó+ˆFØ—y‘y Ó/ˆHô Ø$ T FÐ*WÔX[Ð\fÓXgÐWhÐhoÔpsÐtzÓp{Ðo|ð }ð €Xð à€Zˆqðóð ð' )r…   c                óâ  • U R                   (       a   U R                   S:w  a  SU R                    S3OSnU(       a  U R                  OU R                  nSR                  S U 5       5      n[	        U5      n	[        U	5      S:”  a  U	S S S-   n	U(       a  S	OS
n
U(       a  SOSnU(       a  SOSn[        X$(       a  SOSS 5      nS nUb¥   [        [        R                  " U5      R                  R                  5       5      nU(       af  US   R                  [        R                  R                  La<  US   R                  n[        U[         5      (       a  UO[        US[!        U5      5      nU(       a  SU S3OSnSU SU
 SU SUR'                  5        SU SU
 SU SU SU SU	 S[)        U5      R*                   S[)        U5      R*                   S U 3$ ! ["        [$        4 a    S n N€f = f)!Nr&  z	 (named "z")rš  r#  c              3  ó@   #   • U  H  oR                  5       v •  M     g 7fr‡   )rº   )r_  Úbs     r‚   rb  Ú2Blocks._format_processing_error.<locals>.<genexpr>  s   é € Ð#GÂ¸1×$4Ñ$4×$6Ð$6Âùs   ‚éÈ   z...ÚinputÚoutputrÆ  r  z	passed tozreturned fromr   r¸   zExpected a `z
`, but theÚThez
Could not Ú z component at index z (a `z!` component) of the event handlerz with z components: [z].

z value z the event handler was: z (of type `z`).

Original error: ú: )rÆ   rÅ  ri  rÁ  r½  rû  rl   rÓ   rË   rÌ   rÍ   rÎ   Ú
annotationÚ	ParameterÚemptyrr   rs   r¯   r|  rº   rÕ  r¸   )rÐ  r`  rU  r_   Úis_inputÚoriginal_errorrÆ   r¡   Úcomponents_listÚ
value_reprÚkindÚstageÚverbÚmethodÚexpected_typeÚparamsr<  Úexpected_clauses                     r‚   Ú_format_processing_errorÚBlocks._format_processing_error  s  € ð �}�} §¡°*Ó!<ð ˜Ÿ™� bÑ)àð 	ö
 %-�—’°(×2BÑ2BˆØŸ)™)Ñ#GÁÓ#GÓGˆä˜%“[ˆ
Üˆz‹?˜SÓ Ø# D SÐ)¨EÑ1ˆJæ"‰w¨ˆÞ (‘¨mˆÞ&‰{¨Oˆä˜µ¡¸mÈTÓRˆØˆØÑð
%Üœg×/Ò/°Ó7×BÑB×IÑIÓKÓL�Þ˜f Q™i×2Ñ2¼'×:KÑ:K×:QÑ:QÒQØ!'¨¡×!5Ñ!5�Jô & j´#×6Ñ6ñ #ä$ Z°¼SÀ»_ÓMð "ö 9Fˆl˜=˜/¨Ñ4È5ð 	ð ˜˜˜q  Ð&:¸5¸'ð BØ×'Ñ'Ó)Ð*Ð*KÈDÈ6ð RØ�6˜¨Ð'8¸ØÐ˜w t fÐ,DÀZÀLð QÜ˜e›×-Ñ-Ð.ð /Ü# NÓ3×<Ñ<Ð=¸RÀÐ?OðQð	
øô ¤	Ð*ó %Ø $’ð%ús   Ã	B$G ÇG.Ç-G.c              ƒ  ó  #   • U=(       d    [        U 5      nU R                  X5        / n[        UR                  5       GH[  u  pg[	        U[
        R                  5      (       d  [        UR                   S35      eUR                  (       a  UR                  X7R                     5        Mm  UR                  U;   a  X7R                     nXaR                  ;   nU(       a  [        R                  " X&   5        U(       a  X&   R                  SS 5      OX&   n	SSKJn
  U
" S5       IS h  v•N   [        R$                  " U	UU(       + S9I S h  v•N nS S S 5      IS h  v•N   ['        USS 5      (       a<  Wb9  [)        [*        [,        [.        4   UR0                  5      nUR3                  USS	0S
9n[	        W[,        [.        45      (       a  UR5                  5       nOUnUR                  U;  a  XsUR                  '   UR7                  UR                  U5        UR8                  (       a<   [:        R<                  R?                  UR8                  X°R@                  S9I S h  v•N nOUnU(       a  XâU   S'   UR                  X&   5        GMJ  UR                  U5        GM^     U$  GNy GNY GNL! , IS h  v•N  (       d  f       GNb= f Ng! [B         a    e [D         a#  n[G        U RI                  UUUU	S	US95      UeS nAff = f7f)Nr  r_   r   ©Útrace_phaseÚpreprocess_move_to_cache)Úcheck_in_upload_folderÚ
data_modelÚvalidate_metaT)Úcontext©r-  ©r?  r@  )%rJ   r0  rf  rÅ  rr   r   rY   r:   r¶   r�   r§   rp   rº  r   Úcheck_all_files_in_cachern   Úgradio.profilingrN  Úasync_move_files_to_cacherl   r   r   r/   r0   rQ  Úmodel_validater  Ú_update_value_in_configrÆ  r   r  r  r-  r8   Ú	Exceptionr6   rJ  )r�   rÐ  rÅ  rå  ræ  r  r±  rU  Úis_prop_inputÚvalue_to_processrN  Úinputs_cachedrQ  Úinputs_serializedÚprocessed_valueÚerrs                   r‚   Úpreprocess_dataÚBlocks.preprocess_dataD  sµ  é € ð ×+œ dÓ+ˆà×Ñ˜XÔ.àˆÜ! (§/¡/×2‰HˆAÜ˜e¤Z×%9Ñ%9×:Ñ:Ü+Ø—‘Ð'Ð'NÐOóð ð �~�~Ø×&Ñ& u¯Y©YÑ'7Ö8à—9‘9 Ó%Ø!§)¡)Ñ,�Eà !×%CÑ%CÑ C�Þ Ü$×=Ò=¸f¹iÔHæ4A�F‘I—M‘M '¨4Ô0ÀvÁyð !õ 9á&Ð'A×BÕBÜ*:×*TÒ*TØ(ØØ3@Ô/@ñ+÷ %�M÷ C×Bô ˜5 ,°×5Ñ5¸-Ñ:SÜ!%Üœk¬?Ð:Ñ;¸U×=MÑ=Mó"�Jð %/×$=Ñ$=Ø%°ÀÐ/Fð %>ð %�Mô ˜m¬k¼?Ð-K×LÑLØ(5×(@Ñ(@Ó(BÑ%à(5Ð%à—9‘9 EÓ)Ø',˜%Ÿ)™)Ñ$Ø×-Ñ-¨e¯i©iÐ9JÔKà×&×&ð#Ü05·±×0HÑ0HØ!×,Ñ,¨mÇ\Á\ð 1Ið 1÷ +™ð" '8�Oæ Ø)8˜1‘I˜gÑ&Ø#×*Ñ*¨6©9×5à#×*Ñ*¨?×;ñG 3ðH Ðòa Cò%÷ C×B×BÒBúñ0+øô !ó ØÜ$ó 
#Ü6Ø ×9Ñ9Ø (Ø !Ø %Ø 0Ø)-Ø/2ð :ð ó	ð  #ð	#ûð
#üs’   ‚D&LÄ(J!Ä)LÄ,J*ÅJ$ÅJ*ÅLÅJ'ÅCLÈ(5KÉKÉKÉ"A LÊ$J*Ê'LÊ*K	Ê0J3Ê1K	Ê=LËKËK>ËK9Ë9K>Ë>Lc                óF  • UR                   n[        U[        [        45      (       d  U/n[	        U5      [	        U5      :w  Ga^  UR
                  (       a   UR
                  S:w  a  SUR
                   S3OSn/ n/ nU H+  nUR                  [        UR                  5       5      5        M-     U H:  n[        U[        5      (       a  SU S3O
[        U5      n	UR                  U	5        M<     SR                  U5      n
SR                  U5      n[	        U5      [	        U5      :  a-  [        SU S[	        U5       S	[	        U5       S
U
 SU S35      e[	        U5      S:X  a  US   c  g [        R                  " SU S[	        U5       S	[	        U5       SU
 SU S35        g g )Nr&  r'  r(  rš  r)  r#  zA  functionz- didn't return enough output values (needed: z, returned: z#).
    Output components:
        [z']
    Output values returned:
        [r*  ri   r   z
A functionz* returned too many output values (needed: z:). Ignoring extra values.
    Output components:
        [)ri  rr   rÓ   rÔ   rû  rÆ   r§   rs   r½   rÁ  r¯   rH  rI  )r�   rÐ  rj  Údep_outputsrÆ   r,  r-  rU  ÚpredrZ  r.  r/  s               r‚   Úvalidate_outputsÚBlocks.validate_outputs–  sÓ  € Ø×&Ñ&ˆä˜+¬¬e }×5Ñ5Ø&˜-ˆKäˆ{Óœs ;Ó/Ô/ð —=—= X§]¡]°jÓ%@ð �X—]‘]�O 1Ñ%àð ð ˆKØˆMÛ$�Ø×"Ñ"¤3 u×'<Ñ'<Ó'>Ó#?Ö@ñ %ã#�Ü#-¨d´C×#8Ñ#8�a˜�v˜Q‘K¼cÀ$»i�Ø×$Ñ$ QÖ'ñ $ð —Y‘Y˜{Ó+ˆFØ—y‘y Ó/ˆHä�;Ó¤# kÓ"2Ó2Ü Ø# D 6Ð)VÔWZÐ[fÓWgÐVhÐhtÔuxð  zEó  vFð  uGð G
à
ˆð 
à
ˆ�1ð	óð ô �{Ó# qÓ(¨[¸©^Ñ-Cð Ü—’Ø" 4 &Ð(RÔSVÐWbÓScÐRdÐdpÔqtð  vAó  rBð  qCð C
à
ˆð 
à
ˆ�1ð	õð? 0r…   c              ƒ  ó  #   • SSK Jn  U=(       d    [        U 5      n[        U[        5      (       aH  U[        5       :X  a:  [        UR                  5      S:”  a!  [        5       /[        UR                  5      -  n[        U[        5      (       a.  [        U5      S:”  a  [        [        UR                  5      U5      n[        UR                  5      S:X  a  UR                  (       d  U/nU R                  X5        / n[        UR                  5       GHº  u  pg X&   [        R                  R                  L a  UR!                  S 5        M9   UR*                  (       aX  X&   n	[,        R.                  " U	5      (       a  SU	;   a  U	S   X7R0                  '   OX“UR0                  '   UR!                  S 5        M£  X&   n	[,        R.                  " U	5      (       a  [,        R2                  " U	SS9n	[        U	[4        5      (       a   U	R6                  R9                  5       n	SU	S	'   O²[        U	[:        5      (       a�  [=        U	S
S5      (       a‹  [?        U	5      R9                  5       n	[@        RB                  " URD                  RF                  5      RH                  RK                  5       n
U	RM                  5        VVs0 s H  u  p¼Xº;   d  M  X¼_M     n	nnSU	S	'   [,        R.                  " U	5      (       aü  URO                  UR0                  U5      nUR6                  R9                  5       nURQ                  U	5        URS                  SS 5        URS                  S	5        SUS'   URD                  " S0 UD6X7R0                  '   URU                  UR0                  5        [W        X7R0                     U	URX                  S9n	SU	;   a+  UR[                  UR0                  U	RO                  S5      5        GO•URX                  (       Ga8  [        U[        R\                  5      (       d  [_        URD                   S35      eUR0                  U;   a  X7R0                     n [`        Rb                  Re                  URX                  X�Rf                  S9I S h  v•N n	[        U	[p        [r        45      (       a  U	Ru                  5       nOU	nU" S5       IS h  v•N   [v        Rx                  " UUSS9I S h  v•N nUR0                  U;  a  XsUR0                  '   UR[                  UR0                  U5        S S S 5      IS h  v•N   OKURX                  (       d:  UR0                  U;  a  XsUR0                  '   UR[                  UR0                  U	5        U" S5       IS h  v•N   [v        Rx                  " U	USS9I S h  v•N nS S S 5      IS h  v•N   UR!                  W5        GM½     U$ ! ["        [$        4 a  n['        SUR(                   35      UeS nAff = fs  snnf  GN†! [h         a    e [j         a%  n[m        U Ro                  UUUX&   SUS95      UeS nAff = f GN† GNk GN$! , IS h  v•N  (       d  f       Ní= f Nã NÇ N¹! , IS h  v•N  (       d  f       NÎ= f7f)Nr   rM  ri   zXNumber of output components does not match number of values returned from from function r_   T)Ú
skip_valuerN  rO  Ú_is_component_updateFrb   )rU  rV  r  r  rT  rU  Ú"postprocess_update_state_in_config©r  Úpostprocess_move_to_cacherŽ   )=rW  rN  rJ   rr   r  r>   rû  ri  ro  rÓ   r¡  rg  rf  r   rQ  r  r§   rû  r°   r¯   rÆ   r�   r   Úis_prop_updaterp   rÚ  r]   r—   rò  r   rl   ÚvarsrË   rÌ   r¶   rƒ   rÍ   rS  rT  rn   rN  rÖ   Ú_update_configr[  r  rZ  rY   r:   r   r  r  r-  r8   r[  r6   rJ  r/   r0   r  r   rX  )r�   rÐ  rj  rå  rN  r8  r±  rU  ra  Úprediction_valuerS  rY  rZ  Ú
base_blockræ   Úprediction_value_serializedÚoutputs_cacheds                    r‚   Úpostprocess_dataÚBlocks.postprocess_dataÃ  sÎ  é € õ 	1à×+œ dÓ+ˆä�{¤D×)Ñ)Øœt›vÓ%Ü�H×$Ñ$Ó%¨Ó)ô  ›6˜(¤S¨×)9Ñ)9Ó%:Ñ:ˆKÜ�k¤4×(Ñ(¬S°Ó-=ÀÓ-AÜ8Ü�X×%Ñ%Ó&¨óˆKô ˆx×ÑÓ  AÓ%¨h¯n¯nàðˆKð 	×Ñ˜hÔ4àˆÜ! (×"2Ñ"2×3‰HˆAðØ‘>¤Z×%9Ñ%9×%LÑ%LÒLØ—M‘M $Ô'Ùð Mð �~�~Ø#.¡>Ð Ü×'Ò'Ð(8×9Ñ9àÐ"2Ó2Ø+;¸GÑ+D˜Ÿi™iÑ(øà'7˜%Ÿ)™)Ñ$Ø—‘˜dÖ#à#.¡>Ð Ü×'Ò'Ø$÷ñ ô (-×'8Ò'8Ø(°Tñ(Ð$ô Ð.´×6Ñ6Ø'7×'HÑ'H×'MÑ'MÓ'OÐ$Ø3;Ð$ ZÒ0ÜÐ 0´/×BÑBÄwØ$Ð&<¸e÷Hñ Hô (,Ð,<Ó'=×'BÑ'BÓ'DÐ$Ü"×,Ò,¨U¯_©_×-EÑ-EÓF×QÑQ×VÑVÓX�Dà)9×)?Ñ)?Ô)Aô(Ú)A¡ ÀQÁY›˜šÑ)Að %ñ (ð 4<Ð$ ZÑ0Ü×'Ò'Ð(8×9Ñ9ð "'§¡¨5¯9©9°eÓ!<�JØ'×8Ñ8×=Ñ=Ó?�FØ—M‘MÐ"2Ô3Ø—J‘J˜w¨Ô-Ø—J‘J˜zÔ*Ø',�F˜8Ñ$à',§¢Ñ'@¸Ñ'@�EŸ)™)Ñ$Ø×(Ñ(¨¯©Ô3Ü'>Ø#§I¡IÑ.Ø$4Ø$,×$8Ñ$8ñ(Ð$ð
 Ð"2Ó2Ø×5Ñ5Ø!ŸI™IÐ'7×';Ñ';¸GÓ'Dôùð ×)×)Ð)Ü% e¬Z×-AÑ-A×BÑBÜ3Ø$Ÿ™Ð/Ð/WÐXóð ð —y‘y EÓ)Ø %§i¡iÑ 0˜ð#Ü16·±×1IÑ1IØ!×-Ñ-Ð/?ÏÉð 2Jð 2÷ ,Ð(ô  "Ð"2´[Ä/Ð4R×SÑSØ6F×6QÑ6QÓ6SÑ3à6FÐ3Ù*Ð+O×PÕPä"2×"LÒ"LØ ;Ø %Ø,0ñ#÷ ð 4ð !Ÿ9™9¨EÓ1Ø/4 %§)¡)Ñ,Ø×5Ñ5Ø!ŸI™IÐ'Bô÷  Q×PÐPð "×-×-Ø—y‘y¨Ó-Ø+0˜eŸi™iÑ(Ø×1Ñ1°%·)±)Ð=MÔNÙ&Ð'B×CÕCÜ+;×+UÒ+UØ(ØØ$(ñ,÷ &�N÷ D×Cð —‘˜n×-ñe 4ðh ˆøô_ ¤Ð)ó Ü ð=Ø=E¿]¹]¸OðMóð ðûðüó@(òD,øô !ó ØÜ$ó 
#Ü6Ø ×9Ñ9Ø (Ø !Ø %Ø +¡Ø).Ø/2ð :ð ó	ð  #ð	#ûð
#úò  Qò÷  Q×P×PÑPúñ" Dñ&÷ D×C×CÐCüs  ‚DZÄ0WÅ	E*ZÊ3XËXËFZÑ5XÒX
ÒXÒ	:ZÓY	ÓZÓYÓ!YÓ">YÔ ZÔ+YÔ,AZÖY,Ö	ZÖY2Ö&Y.Ö'Y2Ö+ZÖ6Y0Ö7Z×X×#W<×<XØ	ZØ
XØYØ! YÙYÙZÙYÙZÙY)	ÙYÙY)	Ù%ZÙ.Y2Ù0ZÙ2Z		Ù8Y;Ù9Z		ÚZc                óœ   • U R                   R                  U5      nUc-  [        R                  " 5       R                  nX R                   U'   U$ )a  Return the key of the streaming run that `iterator` is driving.

The key goes into the playlist URL, so it has to hold for every chunk of
a run and never repeat. `id()` only holds while the object is alive, so
the key is held weakly against the iterator and dies with it instead.
)r7  rn   ÚuuidÚuuid4Úhex)r�   rú  Úruns      r‚   Ú_stream_run_keyÚBlocks._stream_run_keyW  sC   € ð ×"Ñ"×&Ñ& xÓ0ˆØ‰;Ü—*’*“,×"Ñ"ˆCØ-0× Ñ  Ñ*Øˆ
r…   c                ór   • Ub  Uc  gU R                   R                  U5      nUc  gU R                  X5        g)a  Close out the streaming state of the run `iterator` was driving.

For a run that reaches no final chunk: it raised, was cancelled, or its
client went away. Its streams are ended but stay, since the playlist is
fetched after the run ends; its diff state goes, nothing reads it again.
N)r7  rn   Ú	_drop_run)r�   Úsession_hashrú  r|  s       r‚   Ú_drop_run_streamsÚBlocks._drop_run_streamsd  s<   € ð Ñ 8Ñ#3ØØ×"Ñ"×&Ñ& xÓ0ˆØ‰;ØØ�‰�|Õ)r…   c                óÈ   • U R                   R                  U0 5      R                  U0 5      R                  5        H  nUR                  5         M     U R	                  X5        g r‡   )r3  rn   rÎ   Ú
end_streamÚ_pop_run_diffs)r�   r�  r|  r—  s       r‚   r€  ÚBlocks._drop_runr  sP   € Ø×*Ñ*×.Ñ.¨|¸RÓ@×DÑDÀSÈ"ÓM×TÑTÖVˆFØ×ÑÖñ Wà×Ñ˜LÕ.r…   c           
   ƒ  ó
  #   • Ub  Uc  gU R                   R                  U5      nUc  gU R                  R                  U0 5      R                  U0 5      n UR                  5        Ho  u  pVU R                  U   n[        U[        R                  5      (       a,  U R                  XvU R                  XU5      5      I Sh  v•N   M_  UR                  5         Mq     U R                  X5        g N,! U R                  X5        f = f7f)zÒComplete the streams of a run nobody will continue: a generator called
through the run route yields once and is dropped, so what it produced is
all there is, and it has to come out whole rather than be cut off.N)r7  rn   r3  rT  r¡   rr   r   ÚStreamingOutputÚ_finish_streamÚ
_stream_idr…  r€  )r�   r�  rú  r|  ÚstreamsÚ	output_idr—  rU  s           r‚   Ú_finish_run_streamsÚBlocks._finish_run_streamsw  sé   é € ð Ñ 8Ñ#3ØØ×"Ñ"×&Ñ& xÓ0ˆØ‰;ØØ×&Ñ&×*Ñ*¨<¸Ó<×@Ñ@ÀÀbÓIˆð	.Ø%,§]¡]¦_Ñ!�	ØŸ™ IÑ.�Ü˜e¤Z×%?Ñ%?×@Ñ@Ø×-Ñ-Ø t§¡°|È)Ó'Tó÷ ò ð ×%Ñ%Ö'ñ &5ð �N‰N˜<Õ-ñøð �N‰N˜<Õ-üs1   ‚ADÁA(C- Â>C+Â?C- ÃDÃ+C- Ã-D Ä Dc                ó   • U  SU SU S3$ )Nr‰  z/playlist.m3u8rŽ   )r�  r|  r�  s      r‚   r‹  ÚBlocks._stream_id‘  s   € à�˜q   Q y k°Ð@Ð@r…   c              ƒ  óÀ   #   •  UR                  U R                  U5      I S h  v•N 5      I S h  v•N   UR                  5         g  N! N! UR                  5         f = f7fr‡   )Úadd_segmentÚflush_stream_outputr…  )rU  r—  Ú	stream_ids      r‚   rŠ  ÚBlocks._finish_stream•  sR   é € ð	 Ø×$Ñ$¨5×+DÑ+DÀYÓ+O×%OÓP×PÐPð
 ×ÑÕñ &PÑPøð
 ×ÑÕüs;   ‚A„A	 £A¤A	 ¯A°A	 ´AÁA	 ÁA	 Á	AÁAc                ó�   • U R                   R                  U5      nUc  gUR                  US5        U(       d  U R                   U	 gg)zHDrop a run's diff state, and its session's dict if that leaves it empty.N)r4  rn   rÖ   )r�   r�  r|  Úrunss       r‚   r†  ÚBlocks._pop_run_diffs¡  sD   € à×(Ñ(×,Ñ,¨\Ó:ˆØ‰<ØØ�‰��dÔÞØ×)Ñ)¨,Ñ7ð r…   c              ƒ  ó\  #   • Ub  Uc  U$ U R                   R                  U0 5      R                  U0 5      n[        UR                  5       GHÐ  u  p‰U	R                  n
[        U	[        R                  5      (       d  M3  U	R                  (       d  MF  [        R                  " X(   5      (       a  Me  U(       a  UR                  U
5      c  M€  U R                  X4U
5      nX§;  nU	R                  X(   UU5      I S h  v•N u  pÞU(       a™  S nUR                  S5      =n(       a  [        U5      R                  SS  nU R                   U   R                  U0 5      n[!        US9nUXz'   UR"                  R%                  [&        R(                  " UU	R*                  U5      5        Xz   R-                  U5      I S h  v•N   U(       a  U R/                  X—U
   U5      I S h  v•N   [0        R2                  " UU	SS9I S h  v•N nUb  [0        R4                  " XåS 5      nXâU'   GMÓ     U$  GN) Nn NL N07f)NÚ	orig_nameri   )Údesired_output_formatTrm  )r3  rn   rf  ri  rp   rr   r   r‰  Ú	streamingr   ro  r‹  Ústream_outputr   ÚsuffixÚ
setdefaultrD   Úon_endr§   r5  ÚfinalizeÚend_stream_outputr“  rŠ  r   rX  Úadd_root_url)r�   rÐ  r  r�  r|  rm  ÚfinalÚ
stream_runr±  rU  r�  r•  Úfirst_chunkÚbinary_dataÚoutput_datarœ  r›  r—  s                     r‚   Úhandle_streaming_outputsÚBlocks.handle_streaming_outputsª  s  é € ð Ñ 3¡;ØˆKð .2×-AÑ-A×-EÑ-EØ˜"ó.
ç
‰#ˆc�2‹,ð 	ô " (×"2Ñ"2×3‰HˆAØŸ	™	ˆIä˜5¤*×"<Ñ"<×=Ó=Ø—O—O‘OÜ×,Ò,¨T©W×5Ó5ö ˜ZŸ^™^¨IÓ6Ñ>ÙØ ŸO™O¨L¸yÓI�	Ø'Ñ9�Ø16×1DÑ1DØ‘GØØó2÷ ,Ñ(�ö
 Ø,0Ð)Ø$/§O¡O°KÓ$@Ð@�yÕ@Ü04°Y³×0FÑ0FÀqÀrÐ0JÐ-Ø!%×!5Ñ!5°lÑ!C×!NÑ!NÈsÐTVÓ!W�JÜ(Ð?TÑU�FØ,2�JÑ)ð
 —M‘M×(Ñ(Ü×(Ò(¨°×1HÑ1HÈ)ÓTôð !Ñ+×7Ñ7¸ÓD×DÐDÞØ×-Ñ-¨eÀ	Ñ5JÈIÓV×VÐVÜ$4×$NÒ$NØØØ $ñ%÷ �ð
 Ñ(Ü"2×"?Ò"?Ø#°ó#�Kð &�Q”ña 4ðd ˆòE,ñ( EáVñùs\   ‚A9H,Á?H,ÂH,Â1A	H,Ã:H#Ã;B<H,Æ7H&Æ8#H,ÇH(ÇH,Ç9H*Ç:*H,È&H,È(H,È*H,c                óf  • Ub  Uc  U$ X@R                   U   ;  nU(       a  S /[        U5      -  U R                   U   U'   U R                   U   U   n[        U5      [        UR                  5      :  a4  UR                  S /[        UR                  5      [        U5      -
  -  5        [	        [        UR                  5      5       HO  n	U(       a  X‰   X)'   M  U(       a  X)   X‰'   M!  X‰   n
X)   X‰'   U(       a  M4  [
        R                  " X¢U	   5      X)'   MQ     U(       a  U R                  X45        U$ r‡   )r4  rû  ri  rÍ  rv  r   Údiffr†  )r�   rÐ  r  r�  r|  r¥  Úsimple_formatÚ	first_runÚ
last_diffsr±  Ú
prev_chunks              r‚   Úhandle_streaming_diffsÚBlocks.handle_streaming_diffsï  s  € ð Ñ 3¡;ØˆKØ×8Ñ8¸ÑFÑFˆ	ÞØ<@¸6ÄCÈÃIÑ;MˆD×%Ñ% lÑ3°CÑ8Ø×.Ñ.¨|Ñ<¸SÑAˆ
Üˆz‹?œS ×!1Ñ!1Ó2Ó2ð ×Ñ˜t˜f¬¨H×,<Ñ,<Ó(=ÄÀJÃÑ(OÑPÔQä”s˜8×+Ñ+Ó,Ö-ˆAÞØ$™-�‘ÙæØ $¡�
“à'™]�
Ø $¡�
‘ß$�}Ü#Ÿjšj¨¸!±WÓ=�D“Gñ .ö Ø×Ñ Ô2àˆr…   Tc              ƒ  ó$  ^##   • [        U[        5      (       a  U R                  U   nUR                  nU R	                  X5      u  nn/ n[
        R                  R                  U 5        U(       GaÉ  UR                  nU Vs/ s H  n[        U5      PM     nnUS   m#Sn[        R                  " UR                  5      (       d%  [        R                  " UR                  5      (       a  [        S5      e[        U#4S jU 5       5      (       d  [        SU S35      eT#U:”  a  [        ST# SU S	35      e[!        US
S06 Vs/ s H'  nU R#                  U[%        U5      X;5      I Sh  v•N PM)     nn['        5          U R)                  U[%        [!        US
S065      SUUUU	UU5	      I Sh  v•N n[+        5       nSSS5        WS   n[!        US
S06 Vs/ s H'  nU R-                  U[%        U5      U5      I Sh  v•N PM)     nnUb  [.        R0                  " UUS5      n[%        [!        US
S065      nSu  nnGOêSSKJn  UnSnU(       a  / nO;U" S5       ISh  v•N   U R#                  XX;5      I Sh  v•N nSSS5      ISh  v•N   USLn['        5          U" S5       ISh  v•N   U R)                  UUUUUUU	UU5	      I Sh  v•N nSSS5      ISh  v•N   [+        5       nSSS5        U" S5       ISh  v•N   U R-                  UWS   U5      I Sh  v•N nSSS5      ISh  v•N   U(       a?  [!        UUSS9 VV s/ s H'  u  nn U[6        R8                  " UU    5      :w  d  M%  U PM)     nnn Ub  [.        R0                  " WUS5      nWS   US   nnU(       d  U(       a€  Ub  U R;                  U(       a  UOU5      OSn! U" S5       ISh  v•N   U R=                  UWUU!UU(       + S9I Sh  v•N nU R?                  UUUUb  U!OSU(       + U
S9nSSS5      ISh  v•N   U(       d-  U=RD                  US   -  sl"        U=RF                  S-  sl#        WUUUS   URF                  S:”  a  URD                  URF                  -  OSSUU(       a  SOSS.n"URH                  (       al  U(       ae  URJ                  RM                  URH                  5      U"S'   URH                  RN                  U"S   S'   Ub  [.        R0                  " U"S   US5      U"S'   U"$ s  snf  GNµs  snf  GNy! , (       d  f       GNt= f GN@s  snf  GNç GNÐ GNÃ! , ISh  v•N  (       d  f       GNÙ= f GNÁ GN£ GN–! , ISh  v•N  (       d  f       GN¬= f! , (       d  f       GN¬= f GN£ GNˆ GN{! , ISh  v•N  (       d  f       GN‘= fs  sn nf  GNõ GN× GN¬! , ISh  v•N  (       d  f       GNÂ= f! [@         a    Ub  U!b  U RC                  UU!5        e f = f7f)aq  
Processes API calls from the frontend. First preprocesses the data,
then runs the relevant function, then postprocesses the output.

Parameters:
    fn_index: Index of function to run.
    inputs: input data received from the frontend
    state: data stored from stateful components for session (key is input block id)
    request: the gr.Request object containing information about the network request (e.g. IP address, headers, query parameters, username)
    iterators: the in-progress iterators for each generator function (key is function index)
    event_id: id of event that triggered this API call
    event_data: data associated with the event trigger itself
    in_event_listener: whether this API call is being made in response to an event listener
    explicit_call: whether this call is being made directly by calling the Blocks function, instead of through an event listener or API route
    root_path: if provided, the root path of the server. All file URLs will be prefixed with this path.

Returns a dictionary with the following keys:
    - "data": the output data from the function
    - "is_generating": whether the function is generating output
    - "iterator": the iterator for the function
    - "duration": the duration of the function call
    - "average_duration": the average duration of the function call
    - "render_config": the render config for the function
r   Fz1Gradio does not support generators in batch mode.c              3  ó,   >#   • U  H	  oT:H  v •  M     g 7fr‡   rŽ   )r_  r�  Ú
batch_sizes     €r‚   rb  Ú%Blocks.process_api.<locals>.<genexpr>M	  s   øé € Ð<²¨1˜J–²ùs   ƒzQAll inputs to a batch function must have the same length but instead have sizes: rt  zBatch size (z0) exceeds the max_batch_size for this function (r(  rš  Nr÷  )NNrM  rÆ  Úfn_callr  r™  rù  rú  Ústreaming_diff)r�  r|  rm  r¥  )r�  r|  r¥  r®  rø  ri   Úpartial)r  rù  rú  rø  Úaverage_durationÚrender_configÚchanged_state_idsÚ
used_cacher¼  r¢  )(rr   r  rˆ  r¡  Úget_state_ids_to_trackr&   r¡   r{   r¢  rû  rË   rÜ  r¿  rÝ  r¯   rd  r¨  rb  rÓ   r#   r  r$   rv  r   r¤  rW  rN  r   Ú	deep_hashr}  rª  r²  ÚBaseExceptionr€  Útotal_runtimeÚ
total_runsr    Úblocks_configrÒ   rp   )$r�   rÐ  rÅ  rå  rä  rú  r�  ró  r
  rô  r®  ræ  rm  r  r¡  Ústate_ids_to_trackÚhashed_valuesr½  r¢  rí  Úbatch_sizesÚmanual_cache_usedr±  ÚresultÚpredsr²  r  rù  rN  Úold_iteratorÚwas_generatingÚ
hash_valueÚstate_idr|  r8  r¶  s$                                      @r‚   ré  ÚBlocks.process_api	  s  øé € ôP �h¤×$Ñ$Ø—x‘x Ñ)ˆHØ—‘ˆØ,0×,GÑ,GÈÓ,XÑ)Ð˜MØÐÜ×Ñ×Ñ Ô%çØ%×4Ñ4ˆNÙ/5Ó6ªv¨œ3˜sž8©vˆKÐ6Ø$ Q™ˆJØ %ÐÜ×)Ò)¨(¯+©+×6Ñ6¼'×:UÒ:UØ—‘÷;ñ ;ô !Ð!TÓUÐUÜÔ<±Ó<×<Ñ<Ü ØgÐhsÐgtÐtuÐvóð ð ˜NÓ*Ü Ø" : ,Ð.^Ð_mÐ^nÐnoÐpóð ô
 ˜fÐ3¨UÒ3óâ3�Að ×*Ñ*¨8´T¸!³W¸eÓS×SÒSÙ3ð ð ô 'Õ(Ø#×1Ñ1ØÜœ˜fÐ3¨UÑ3Ó4ØØØØØ%ØØó
 ÷ 
�ô %6Ó$7Ð!÷ )ð ˜<Ñ(ˆEô ˜eÐ2¨EÒ2óâ2�Að ×+Ñ+¨H´d¸1³g¸uÓE×EÒEÙ2ð ð ð Ñ$Ü'×4Ò4°T¸9ÀdÓK�Üœ˜TÐ0¨%Ñ0Ó1ˆDØ&0Ñ#ˆMš8å4à#ˆLØ %ÐÞØ‘á& |×4Õ4Ø#'×#7Ñ#7Ø ¨%ó$÷ �F÷ 5×4ð *°Ð5ˆNÜ&Õ(Ù& y×1Õ1Ø#'×#5Ñ#5Ø ØØ$ØØ Ø"Ø)ØØ#ó
$÷ 
�F÷ 2×1ô %6Ó$7Ð!÷ )ñ # =×1Õ1Ø!×2Ñ2Ø˜f \Ñ2°Eó÷ �÷ 2×1ö ô 14Ø%Ð'9À%ò1ô%ò1Ñ,˜
 Hð "¤U§_¢_°U¸8±_Ó%EÑE÷	 ñ1ð "ñ %ð Ñ$Ü'×4Ò4°T¸9ÀdÓK�Ø&,¨_Ñ&=¸vÀjÑ?Q˜8ˆMÞ¦ð $Ñ/ð ×(Ñ(¾©ÈXÔVàð ð
Ù*Ð+;×<Õ<Ø%)×%BÑ%BØ$Ø Ø)5Ø #Ø&/Ø&3Ô"3ð &Cð &÷  ˜ð  $×:Ñ:Ø$Ø Ø)5Ø'/Ñ';¡ÀØ&3Ô"3Ø*7ð  ;ð  ˜÷  =×<ö: !Ø×"Ò" f¨ZÑ&8Ñ8Õ"Ø×Ò 1Ñ$ÕàØ*Ø Ø˜zÑ*ð ×&Ñ&¨Ó*ð ×&Ñ&¨×)<Ñ)<Ò<àà!Ø!2Þ'8™)¸dñ
ˆð ××¦5Ø&+×&9Ñ&9×&DÑ&DØ×#Ñ#ó'ˆF�?Ñ#ð 4<×3FÑ3F×3JÑ3JˆF�?Ñ# KÑ0ØÑ$Ü*:×*GÒ*GØ˜?Ñ+¨Y¸ó+��Ñ'ð ˆùòi 7ò  Tùòò

÷ )Ö(úò Fùòò  5ò÷ 5×4×4Ò4úò 2ò
÷ 2×1×1Ò1ú÷ )Ö(úò 2ò÷ 2×1×1Ò1üó
%ò$  =ò ÷  =×<×<Ò<ûô* %ó ð $Ñ/°C±OØŸ™ |°SÔ9Øðüs2  ƒA>XÂTÂB,XÅ%TÅ'T
Å(TÅ0XÅ</T'Æ+T$Æ,T'Æ:XÇ%T<Ç9T9
Ç:T<ÈAXÉUÉXÉU
É4UÉ5U
É9XÊUÊXÊV	Ê$U%Ê%V	Ê(U.ËU(ËU.Ë
V	ËU+ËV	Ë$XË8VË9XË<V$ÌVÌV$ÌXÌ&V!Ì'XÍ $V?Í(V?Í.AXÏW) ÏWÏW) ÏWÏ1WÏ2"WÐW) ÐWÐ W) Ð$C8XÔTÔXÔ$T'Ô'
T6Ô1XÔ9T<Ô<XÕU
ÕXÕ
U"ÕUÕU"ÕXÕ%V	Õ(U.Õ+V	Õ.V	Õ4U7Õ5V	ÖV	Ö	
VÖ	XÖV$Ö!XÖ$V<Ö*V-Ö+V<Ö7X×W) ×W×W) ×W&×W×W&×!W) ×$X×&W) ×)$XØXc                ó†  ^• Uc  / / 4$ / n/ nUR                    H£  mTR                  (       d  M  [        U4S jUR                  R                  R                  5        5       5      (       d  MT  UTR                     nUR                  TR                  5        UR                  [        R                  " U5      5        M¥     X44$ )Nc              3  óZ   >#   • U  H   nTR                   S 4UR                  ;   v •  M"     g7f)r”  N)rp   r   )r_  r¿  rU  s     €r‚   rb  Ú0Blocks.get_state_ids_to_track.<locals>.<genexpr>ä	  s*   øé € ð &â:�Bð —‘˜HÐ%¨¯©Ö3Ú:ùs   ƒ(+)
ri  r�   rh  rÄ  rˆ  rÎ   rp   r§   r   rÀ  )r�   rÐ  rå  rÅ  rÆ  r_   rU  s         @r‚   r¿  ÚBlocks.get_state_ids_to_trackÜ	  s©   ø€ ð ‰=Ø�r�6ˆMØÐØˆØ×%Ô%ˆEØ�~�~‰~¤#ô &à×-Ñ-×1Ñ1×8Ñ8Ô:ó&÷ #ó #ð ˜eŸi™iÑ(�Ø"×)Ñ)¨%¯)©)Ô4Ø×$Ñ$¤U§_¢_°UÓ%;Ö<ñ &ð "Ð0Ð0r…   c                ód   • U R                   S:X  a  S U l        g [        U R                   S9U l        g )Nr  )Útotal_tokens)r2  r   r-  r‰   s    r‚   Úcreate_limiterÚBlocks.create_limiterí	  s5   € ð ×Ñ 2Ó%ð ð 	�ô !¨d×.>Ñ.>Ñ?ð 	�r…   c                ó
   • SS0$ )NrÕ  ÚcolumnrŽ   r‰   s    r‚   rÒ   ÚBlocks.get_configô	  s   € Ø˜Ð!Ð!r…   c                óô  • 0 S[         _S[        _SU R                  _SU R                  _SU R                  _SU R
                  _SU R                  _S/ _S	U R                  _S
S_SU R                  _SU R                  _SU R                  =(       d    S_SU R                  _SS_S[        U SS5      _S[        U S/ 5      _[        U SS5      [        R                  " 5       [        U SS 5      [        U S/ 5      U R                  b  U R                  R                   OS S[        U SS 5      bk  U R                  R#                  S5      U R                  R#                  S5      U R                  R#                  S5      U R                  R#                  S5      S.OS U R$                  U R&                  [        U SS 5      U R(                  U R*                  0 U R,                  [        U S S 5      b  [        U R.                  S!S 5      OS S".EnUR1                  U R2                  R5                  5       5        [        R6                  " XR8                  R;                  5       U R<                  R;                  5       5      US
'   U$ )#Nr,  Ú
api_prefixr+  rb  r^  r_  rA  r   r  Úconnect_heartbeatFr¨  r!  rd  ÚGradiorZ  r1  Tr8  Úfooter_linksr@  Úmax_file_sizeÚstylesheetsÚsse_v3r  Úbody_background_fillÚbody_text_colorÚbody_background_fill_darkÚbody_text_color_dark)rã  rä  rå  ræ  Ú
theme_hashÚi18n_instanceÚtranslations_dict)r@  Úis_colabrà  rá  r  ÚprotocolÚbody_cssr9  r:  rç  r>  rê  r¤   r?  Úi18n_translations)rG   rC   r+  rb  r^  r_  rA  r  r¨  r!  rd  rZ  rl   r   Úcolab_checkr  rÆ   Ú_get_computed_valuer9  r:  r>  rê  r?  rè  rN  rQ  rÒ   rÝ  r¡   rÎ   rˆ  )r�   rØ   s     r‚   Úget_config_fileÚBlocks.get_config_file÷	  s‹  € ð2$
Ø”wð2$
àœ*ð2$
ð �D—I‘Ið2$
ð �d—k‘kð	2$
ð
 ˜Ÿ™ð2$
ð ˜Ÿ™ð2$
ð   ×!7Ñ!7ð2$
ð ˜"ð2$
ð �4—8‘8ð2$
ð   ð2$
ð �$—'‘'ð2$
ð �D—I‘Ið2$
ð �T—Z‘Z×+ 8ð2$
ð ˜Ÿ™ð2$
ð ˜Dð2$
ð  œ' $¨°eÓ<ð!2$
ð" œG D¨.¸"Ó=ð#2$
ô$ # 4¨¸Ó=Ü×)Ò)Ó+Ü$ T¨?¸DÓAÜ" 4¨¸Ó;Ø(,¯
©
Ñ(>�T—Z‘Z—_’_ÀDØ ô �t˜W dÓ+Ñ7ð )-¯
©
×(FÑ(FØ*ó)ð $(§:¡:×#AÑ#AÐBSÓ#TØ-1¯Z©Z×-KÑ-KØ/ó.ð )-¯
©
×(FÑ(FØ*ó)òð Ø×+Ñ+ØŸ/™/Ü! $¨°dÓ;Ø—8‘8Ø—Z‘ZØØŸ/™/ô ˜4 °$Ó7ÑCô ˜×*Ñ*Ð,?ÀÔFàòa2$
ˆðf 	�‰�d×)Ñ)×4Ñ4Ó6Ô7Ü&+×&=Ò&=Ø—K‘K×&Ñ&Ó(¨$¯(©(¯/©/Ó*;ó'
ˆÐ"Ñ#ð ˆr…   c           
     ó´  • U R                   R                  5        Vs/ s H2  o"R                  (       d  M  UR                  SL d  M&  UR                  PM4     nn[	        U5      nU(       d  US:”  a  [        S5        [        S5        [        U5       Hu  u  pRU(       d!  [        SUS-    SU SUR                   S	3S
S9  [        USS 5      c&   [        USS9Ul
        U(       d  [        S5        M_  Ma  U(       a  Mj  [        S5        Mw     U(       d  US:”  a  [        S5        g g g s  snf ! [         a#  nU(       d  [        SUSS9   S nAM»   S nAMÁ  S nAff = f)NTr   z,********************************************zB* Trying to transpile functions from Python -> JS for performance
z* (ri   r‰  z) r;  rš  )ÚendÚ__js_implementation__)Úvalidateu   âœ…u   â�Œz

z-********************************************
)rˆ  rÎ   r¿  r¨  rû  Úprintrf  r¸   rl   r   rô  r[  )r�   Úquietr¿  Úfns_to_transpileÚnum_to_transpiler`  rÞ   s          r‚   Útranspile_to_jsÚBlocks.transpile_to_js1
  s6  € à ŸH™HŸO™OÔ-ó
Ú-�b·µ‹E¸2¿5¹5ÀD¸=‹EˆB�EŒEÑ-ð 	ð 
ô Ð/Ó0ÐÞÐ)¨AÓ-ÜÐ@ÔAÜÐWÔXÜ"Ð#3Ö4‰IˆEÞÜ˜˜E A™I˜; aÐ(8Ð'9¸¸B¿K¹K¸=ÈÐKÐQSÒTÜ�rÐ2°DÓ9ÑAð4Ü/8¸ÀdÑ/K�BÔ,Þ Ü˜ežñ !÷
 �UÜ�e–ñ 5ö Ð)¨AÓ-ÜÐBÕCð .ˆuùò)
øô !ó 4Þ Ü˜e Q¨F×3Ð3õ !ûð4ús(   �D%µD%ÁD%Ã!D*Ä*
EÄ4EÅEc                óf   • [        5       nUc  U [        l        Xl        [	        U 5        SU l        U $ r�   )r(   r%   r¢   rw   r)   Úexitedr8  s     r‚   r9  ÚBlocks.__enter__I
  s1   € Ü+Ó-ˆØÑ!Ø!%ŒGÔØ$ŒÜ˜4Ô ØˆŒØˆr…   c                ó<  >• Ub  [        S 5        S [        l        g [        TU ]  5         [        U R
                  5        U R                  R                  5         U R
                  c  S [        l        O/U R
                  R                  R                  U R                  5        U R                  5       U l        [        R                  " U SS9U l        [        S U R                   R#                  5        5       5      U l        SU l        U R)                  5         SU l        g )NF©r?  c              3  ó8   #   • U  H  oR                   v •  M     g 7fr‡   )r¥  )r_  rÐ  s     r‚   rb  Ú"Blocks.__exit__.<locals>.<genexpr>a
  s   é € ð %
Ú5F¨×$Ö$Ò5FùrÚ  rš  T)r)   r%   r¢   rR  rA  rw   rQ  r  r­   rÍ  rð  rØ   rH   Ú
create_appÚapprh  rˆ  rÎ   ri  r¤   Úvalidate_navbar_settingsrý  )r�   rE  rF  r¶   s      €r‚   rG  ÚBlocks.__exit__R
  sÖ   ø€ ØÑÜ˜tÔ$Ø!%ŒGÔØÜ‰Ñ%Ô'Ü˜4Ÿ;™;Ô'à×Ñ×.Ñ.Ô0Ø�;‰;ÑØ!%ŒGÕà�K‰K× Ñ ×'Ñ'¨¯©Ô6Ø×*Ñ*Ó,ˆŒÜ—>’> $°5Ñ9ˆŒÜ!$ñ %
Ø59·X±X·_±_Ô5Fó%
ó "
ˆÔð ˆŒ	Ø×%Ñ%Ô'Øˆ�r…   c                óX   • 0 U R                   l        0 U R                   l        / U l        U $ )z'Resets the layout of the Blocks object.)rQ  r¡   rˆ  r­   r‰   s    r‚   ÚclearÚBlocks.clearh
  s*   € à%'ˆ×ÑÔ"Ø"$ˆ×ÑÔØˆŒØˆr…   Únot_set)Údefault_concurrency_limitc          	     óô   • Ub  X l         [        R                  " 5       (       a  Uc  SOUn[        R                  " US:H  U R
                  US:w  a  UOSUU US9U l        [        R                  " U SS9U l	        U $ )a;  
By enabling the queue you can control when users know their position in the queue, and set a limit on maximum number of events allowed.
Parameters:
    status_update_rate: If "auto", Queue will send status estimations to all clients whenever a job is finished. Otherwise Queue will send status at regular intervals set by this parameter as the number of seconds.
    api_open: If True, the REST routes of the backend will be open, allowing requests made directly to those endpoints to skip the queue.
    max_size: The maximum number of events the queue will store at any given moment. If the queue is full, new events will not be added and a user will receive a message saying that the queue is full. If None, the queue size will be unlimited.
    default_concurrency_limit: The default value of `concurrency_limit` to use for event listeners that don't specify a value. Can be set by environment variable GRADIO_DEFAULT_CONCURRENCY_LIMIT. Defaults to 1 if not set otherwise.
Example: (Blocks)
    with gr.Blocks() as demo:
        button = gr.Button(label="Generate Image")
        button.click(fn=image_generator, inputs=gr.Textbox(), outputs=gr.Image())
    demo.queue(max_size=10)
    demo.launch()
Example: (Interface)
    demo = gr.Interface(image_generator, gr.Textbox(), gr.Image())
    demo.queue(max_size=20)
    demo.launch()
ri   Úauto)Úlive_updatesÚconcurrency_countÚupdate_intervalsÚmax_sizer¡   r  Fr   )
rY  r   Úis_zero_gpu_spacer   ÚQueuer2  Ú_queuerH   r  r  )r�   Ústatus_update_raterY  r  r  s        r‚   r±  ÚBlocks.queueo
  s{   € ð6 ÑØ$ŒMÜ×"Ò"×$Ñ$Ø$Ñ,‘q°(ˆHÜ—n’nØ+¨vÑ5Ø"×.Ñ.Ø3EÈÓ3OÑ/ÐUVØØØ&?ñ
ˆŒô —>’> $°5Ñ9ˆŒØˆr…   c                ó¾   • U R                   R                  5        H?  nUR                   H,  nU R                   U   R                  (       a  M#  [	        S5      e   MA     g )Na!  Queue needs to be enabled! You may get this error by either 1) passing a function that uses the yield keyword into an interface without enabling the queue or 2) defining an event that cancels another event without enabling the queue. Both can be solved by calling .queue() before .launch())rˆ  rÎ   r«  r±  r¯   )r�   r  r±  s      r‚   Úvalidate_queue_settingsÚBlocks.validate_queue_settings™
  sK   € Ø—8‘8—?‘?Ö$ˆCØ—[”[�Ø—x‘x ‘{×(×(Ñ(Ü$ð+óð ó !ò %r…   c                ó$  • SSK Jn  [        5       nU R                  R	                  5        Hb  n[        X15      (       d  M  UR                  U;   a"  [        SUR                  =(       d    S S35      eUR                  UR                  5        Md     g)z9Validates that only one Navbar component exists per page.r   )ÚNavbarz[Only one gr.Navbar component can exist per page. Found multiple Navbar components on page 'r*  z-'. Please remove the extra Navbar components.N)	Úgradio.components.navbarr  r{   r¡   rÎ   rr   r¤   r¯   r¥   )r�   r  Únavbar_pagesrU  s       r‚   r  ÚBlocks.validate_navbar_settings¥
  s~   € å3ä“uˆØ—[‘[×'Ñ'Ö)ˆEÜ˜%×(Ó(Ø—:‘: Ó-Ü$ðEØEJÇZÁZ×EYÐSYÐDZð [EðEóð ð
 × Ñ  §¡Ö,ò *r…   c                ó|  • U R                   R                  5       U l        U R                   R                  U l        [
        R                  " 5       nUR                  U R                  R                  S5      5        UR                  5       U l
        [        R                  " U R                  5      nU=(       d    /  HV  nU R                  =(       d    SU l        [        USS9 nU =R                  SUR!                  5       -   -  sl        S S S 5        MX     [        R                  " U R"                  5      nU=(       d    /  HV  nU R$                  =(       d    SU l        [        USS9 nU =R$                  SUR!                  5       -   -  sl        S S S 5        MX     g ! , (       d  f       Mï  = f! , (       d  f       M|  = f)Nzutf-8rš  )Úencodingrº  )r  Ú_get_theme_cssÚ	theme_cssÚ_stylesheetsrá  r  r  rN  r  r  rç  r   Únone_or_singleton_to_listr   r  ÚopenÚreadr"  r!  )r�   Útheme_hasherr   Úcss_pathÚcss_filer"  Ú	head_pathÚ	head_files           r‚   Ú_set_html_css_theme_variablesÚ$Blocks._set_html_css_theme_variables´
  s8  € ØŸ™×2Ñ2Ó4ˆŒØŸ:™:×2Ñ2ˆÔÜ—~’~Ó'ˆØ×Ñ˜DŸN™N×1Ñ1°'Ó:Ô;Ø&×0Ñ0Ó2ˆŒÜ×3Ò3°D·N±NÓCˆ	Ø!Ÿ RšˆHØ—x‘x—~ 2ˆDŒHÜ�h¨Ò1°XØ—’˜D 8§=¡=£?Ñ2Ñ2•÷ 2Ñ1ñ (ô
 ×4Ò4°T·_±_ÓEˆ
Ø#×) rÒ)ˆIØŸ	™	Ÿ RˆDŒIÜ�i¨'Ò2°iØ—	’	˜T I§N¡NÓ$4Ñ4Ñ4•	÷ 3Ñ2ò *÷	 2Ö1ú÷ 3Ö2ús   Ã!'FÅ&'F,Æ
F)	Æ,
F;	c                óô   • U(       aE  [        U R                  R                  S/ 5      5      S:”  a  [        R                  " S[
        5        gUb  U$ [        R                  " SS5      R                  5       S:H  $ )Nrê  ri   zbSSR mode is not supported with multi-page apps when mounting on a FastAPI app. Disabling SSR mode.FÚGRADIO_SSR_MODEÚFalseÚtrue)	rû  rØ   rn   rH  rI  rJ  rE  r]  r¹   )r�   Ússr_modeÚdisable_when_multi_pages      r‚   Ú_resolve_ssr_modeÚBlocks._resolve_ssr_modeÆ
  so   € ö #¤s¨4¯;©;¯?©?¸7ÀBÓ+GÓ'HÈ1Ó'LÜ�MŠMØtÜôð ð Ñ#ð ð	
ô —’Ð,¨gÓ6×<Ñ<Ó>À&ÑHð	
r…   iô  z100%rk   )%rW  rV  r[  Ússl_keyfileÚssl_certfileÚssl_keyfile_passwordrj  r÷  rß  r@  rk  rl  rm  Ú
app_kwargsrz   Úshare_server_addressÚshare_server_protocolÚshare_server_tls_certificateÚauth_dependencyrà  rG  Ústrict_corsÚnode_server_nameÚ	node_portr2  r>  r?  Únum_workersÚ_appÚ	_frontendÚi18nr  r  r   r¨  r!  r"  c       %        óä*  ^ • SSK Jn1  U+b  U+OT R                  n+U,b  U,OT R                  n,U-b  U-OT R                  n-U.b  U.OT R
                  n.U/b  U/OT R                  n/U0b  U0OT R                  n0[        R                  " U+5      T l
        U,T l        U-=(       d    / T l        U.T l        U/T l        U0T l        T R!                  5         T R"                  (       a  gT R$                  (       d  T R'                  5         Ub  Ub  [)        S5      eU(       aI  [+        U5      (       d9  [-        US   [.        5      (       d!  [-        US   [0        5      (       d	  U/T l        OUT l        T R2                  (       aˆ  [+        T R2                  5      (       dn  [5        S T R2                   5       5      (       a  [6        R8                  " S5        [5        S T R2                   5       5      (       a  [6        R8                  " S	5        UT l        U	T l        UT l        UT l         UT l!        UT l"        UT l#        Uc&  [H        RJ                  RM                  S
S5      T l'        OUT l'        Uc1  [H        RJ                  RM                  SS5      RQ                  5       S:H  OUT l)        Ub  UO/ SQT l*        T RR                  (       d*  T RT                   V2s/ s H  n2U2S:w  d  M  U2PM     sn2T l*        U(       a  UT l+        Ol[H        RJ                  RM                  SS5      n3[Y        U35      S:”  a6  U3R[                  S5       V4s/ s H  n4U4R]                  5       PM     sn4T l+        O/ T l+        U(       a  UT l/        Ol[H        RJ                  RM                  SS5      n5[Y        U55      S:”  a6  U5R[                  S5       V4s/ s H  n4U4R]                  5       PM     sn4T l/        O/ T l/        [-        T RV                  [0        5      (       d  [)        S5      e[-        T R^                  [0        5      (       d  [)        S5      eT Ra                  5         [        Rb                  " U5      T l2        T Rf                  (       aE  T Rh                  Rk                  5        H'  n6U6Rl                  b  M  SU6Rn                   S3U6l6        M)     U%c  [        Rp                  " 5       SLOU%T l9        UT l:        UT Rv                  l<        T R{                  US9  T R}                  5       T l?        T R�                  U$SS9T lA        U'n7U7c-  [H        RJ                  RM                  S5      n8U8b  […        U85      n7U7b  U7S:¼  a  T R2                  c  Uc  U7OSn9ST lC        ST lD        / n:Sn;T R‚                  (       Gam  [H        RJ                  RM                  S[‹        5       5      T lF        [H        RŽ                  " S5      SLn<U<(       a+  [‘        U"U#T RŒ                  US9u  T lI        T lJ        T lK        GOT RŒ                  (       aÍ  SSKLJMn=JNn>  U
=(       d    [H        RŽ                  " S S!5      n?U#n@U@c$  [H        RŽ                  " S"5      nAUAb  […        WA5      n@W@c  Ub  Un@W@b  W@OU=nB[Ÿ        U?UBS-   U>S#9nCU9(       a#  WCS-   nD[¡        U95       VEs/ s H  nEWDUE-   PM
     n:nEWCnU"=(       d    U?W@T RŒ                  WCU?U:US$.n;S=T lI        =T lK        T lJ        O-/ n:S=T lI        =T lK        T lJ        OS=T lI        =T lK        T lJ        U*T lQ        Uc  0 nU1R¤                  " T U(UUU!U&US%9=T lS        T lT        T Rª                  (       a  U(       d  [­        T Rª                  5        T R®                  (       aK  [-        T R°                  [²        5      (       d  [)        S&T R°                   35      eU(       d  [­        S'5        GOiSS(KZJ[nF  UFR¹                  T R¨                  U
UUUUS)9u  n
nnGnHU
T l]        UGT lX        T R°                  R½                  S*5       [¾         S*3T l`        UT la        UHT lb        S+T lW        [        RÆ                  " 5       T ld        [        RÊ                  " 5       T le        UT lf        U=(       d    Ub  S,OS-T lg        UT lh        S+T li        T RÔ                  (       a  T R°                  T RÔ                  lk        T R°                  RÙ                  S-5      (       d  T RÈ                  (       a  S-OS,T lm        T Rv                  RÝ                  T R¦                  5        U9(       GaG  SS.K JonIJpnJ  SS/KqJrnKJsnL  UK" [³        UI5      [³        UJ5      T R¦                  Rè                  T RV                  T R^                  T Rd                  T RB                  (       a  [³        T RB                  5      OSS09nMT R†                  (       a
  U:(       a  U:nNOST RÂ                  S-   nDT R–                  b  [ë        WDT R–                  S-   5      nD[¡        U95       VEs/ s H  nEWDUE-   PM
     nNnEWL" U9WMWNS19T lv        T Rì                  Rï                  5         U(       d%  [­        S2U9 S3T Rì                  Rð                   35        U;GbT  [‘        St0 U;DS4T Rò                  0D6u  T lI        T lJ        T lK        T R”                  b   T R–                  b“  S+T lC        T Rº                  S5:X  a  S6OT Rº                  nOS7UO S8T R–                   S*3T lX        T R°                  R½                  S*5       [¾         S*3T l`        T RÔ                  (       a  T R°                  T RÔ                  lk        O{T Rõ                  U;S9   UUUS:9T lD        U(       dZ  T Rˆ                  (       a%  [6        R8                  " S;T R°                   S<35        O$[6        R8                  " S=T RÂ                   S>35        T RÈ                  (       dø  U(       dñ  T R†                  (       aN  T R–                  bA  [­        S?T RÚ                   S@T Rº                   S8T R–                   SAT RÂ                   SB3	5        O’T R‚                  (       aE  T Rˆ                  (       d4  [­        S?T RÚ                   S@T Rº                   S8T RÂ                   SC35        O<SDnP[­        UPR÷                  T RÚ                  T Rº                  T RÂ                  5      5        [ø        RL                  " T RÀ                   SE3USSF9nQUQRú                  (       d'  [ý        SGWQRþ                   SHUQGR                    SI35      eUcx  T RÈ                  (       d  T RÊ                  (       a  U(       d  [­        SJ5        S+T l�        OCST l�        [H        RŽ                  " SK5      nRURb  WRRQ                  5       S:X  a  S+T l�        OUT l�        U (       a0  [­        SLT R°                   SMT R¨                  GR                   35        U SN;   T lƒ        U)(       aD  G[        GR
                  " T R°                  5      (       d  T GR                  (       d  [)        SO5      eT RÈ                  (       aB  U(       d;  U(       a  [­        SP5        O[­        SQ5        T GR                  (       d  [­        SR5        T GR                  (       a/  T GR                  (       a  [6        R8                  " SS5        ST l�        T GR                  (       a¶   T GR                  c{  G[        GR                  " T Rº                  T RÂ                  T GR                  T RÌ                  T RÐ                  ST9nSG[        US5      nTG[        T RÎ                  4UTSS -   5      T l‡        [­        SUT GR                   35        U(       d  [­        SV5        OU(       d  [­        S`5        ST l‡        [¾        Sa-   nVT GR.                  (       aO  [­        SbT GR                  =(       d    T R°                  R½                  S*5       S*WVGR1                  S*5       S*35        U(       aU  T GR                  (       a  T GR                  (       a  T GR                  OT R°                  n2G[2        GR4                  " U25        Uc  [        GR6                  " 5       nU(       Gaó   SScKœJ�nWJžnXJŸnY  T GR                  (       a¯  T GR                  (       a�  G[        GR
                  " T GR                  5      (       dB  G[@        GRB                  " Sd5        G[        GR
                  " T GR                  5      (       d  MB  WW" SeT GR                   SfT R@                   SgT R>                   Sh35      nZGOT RÈ                  (       a×  T R†                  (       a  T R–                  b  T R–                  OT RÂ                  n[SiSjR÷                  G[D        GRF                  " U[5      G[D        GRF                  " S*5      G[D        GRF                  " T R@                  5      G[D        GRF                  " T R>                  5      G[D        GRF                  " S5      Sk9-   n\WX" U\5      nZO0WW" SeT R°                   SfT R@                   SgT R>                   Sh35      nZWZT l¤        WY" UZ5        G[M        T SlS5      (       aì  [5        U 4Sm j[        GRN                  Rk                  5        5       5      (       + n]U(       a  SnOSoT RÈ                  T GR                  T GR                  SLT GRP                  T R                  SLT R                  GRR                  W]T R                  SLT R                  SLG[U        T R                  5      G[U        U05      Sp.n^G[        GRV                  " T U^5        G[U        G[M        G[X        SqG[X        GRZ                  GR\                  5      5      n_U(       d2  […        [H        RŽ                  " SrSs5      5      S:X  d  U(       d  W_(       d  T GR_                  5         G[a        T R¦                  T R°                  T GR                  45      $ s  sn2f s  sn4f s  sn4f s  snEf s  snEf ! [ü         aþ  nUT GR                  (       a  G[        GR                  " SW5        ST l‡        ST l�        [-        WUG[        5      (       a  [­        SXG[          SY35         SnUAUGN[-        WUG["        5      (       a  [­        SZWU 35         SnUAUGN>G[%        G[         5      GR'                  5       (       a  [­        S[5         SnUAUGNt[­        S\G[          S]G[(         S^G[*         S_G[,         35         SnUAUGN¥SnUAUff = f! G[J         a     GNáf = f)uaû+  
Launches a simple web server that serves the demo. Can also be used to create a
public link used by anyone to access the demo from their browser by setting share=True.
Parameters:
    inline: whether to display in the gradio app inline in an iframe. Defaults to True in python notebooks; False otherwise.
    inbrowser: whether to automatically launch the gradio app in a new tab on the default browser.
    share: whether to create a publicly shareable link for the gradio app. Creates an SSH tunnel to make your UI accessible from anywhere. If not provided, it is set to False by default every time, except when running in Google Colab. When localhost is not accessible (e.g. Google Colab), setting share=False is not supported. Can be set by environment variable GRADIO_SHARE=True.
    debug: if True, blocks the main thread from running. If running in Google Colab, this is needed to print the errors in the cell output.
    auth: If provided, username and password (or list of username-password tuples) required to access app. Can also provide function that takes username and password and returns True if valid login.
    auth_message: If provided, HTML message provided on login page.
    prevent_thread_lock: By default, the gradio app blocks the main thread while the server is running. If set to True, the gradio app will not block and the gradio server will terminate as soon as the script finishes.
    show_error: If True, any errors in the gradio app will be displayed in an alert modal and printed in the browser console log. They will also be displayed in the alert modal of downstream apps that gr.load() this app.
    server_port: will start gradio app on this port (if available). Can be set by environment variable GRADIO_SERVER_PORT. If None, will search for an available port starting at 7860.
    server_name: to make app accessible on local network, set this to "0.0.0.0". Can be set by environment variable GRADIO_SERVER_NAME. If None, will use "127.0.0.1".
    max_threads: the maximum number of total threads that the Gradio app can generate in parallel. The default is inherited from the starlette library (currently 40).
    width: The width in pixels of the iframe element containing the gradio app (used if inline=True)
    height: The height in pixels of the iframe element containing the gradio app (used if inline=True)
    favicon_path: If a path to a file (.png, .gif, or .ico) is provided, it will be used as the favicon for the web page.
    ssl_keyfile: If a path to a file is provided, will use this as the private key file to create a local server running on https.
    ssl_certfile: If a path to a file is provided, will use this as the signed certificate for https. Needs to be provided if ssl_keyfile is provided.
    ssl_keyfile_password: If a password is provided, will use this with the ssl certificate for https.
    ssl_verify: If False, skips certificate validation which allows self-signed certificates to be used.
    quiet: If True, suppresses most print statements.
    footer_links: The links to display in the footer of the app. Accepts a list, where each element of the list must be one of "api", "gradio", "settings", or "runs" corresponding to the API docs, "built with Gradio", the settings page, and the run history page respectively. The "runs" link only appears if `run_history` is True and the browser has at least one saved run for this app. If None, all four links will be shown in the footer. An empty list means that no footer is shown.
    run_history: If True, users can review and reload calls from the run history page at /gradio_api/runs. Runs are saved privately in the browser by default; from that page, a user can instead connect a Hugging Face bucket and save future runs there. Browser history is scoped to the logged-in user if the app uses `auth`. If False, nothing is recorded, the run history page is disabled, and any runs previously saved by this app are deleted from the browser. If None, will use the GRADIO_RUN_HISTORY environment variable or default to True.
    allowed_paths: List of complete filepaths or parent directories that gradio is allowed to serve. Must be absolute paths. Warning: if you provide directories, any files in these directories or their subdirectories are accessible to all users of your app. Can be set by comma separated environment variable GRADIO_ALLOWED_PATHS. These files are generally assumed to be secure and will be displayed in the browser when possible.
    blocked_paths: List of complete filepaths or parent directories that gradio is not allowed to serve (i.e. users of your app are not allowed to access). Must be absolute paths. Warning: takes precedence over `allowed_paths` and all other directories exposed by Gradio by default. Can be set by comma separated environment variable GRADIO_BLOCKED_PATHS.
    root_path: The root path (or "mount point") of the application, if it's not served from the root ("/") of the domain. Often used when the application is behind a reverse proxy that forwards requests to the application. For example, if the application is served at "https://example.com/myapp", the `root_path` should be set to "/myapp". A full URL beginning with http:// or https:// can be provided, which will be used as the root path in its entirety. Can be set by environment variable GRADIO_ROOT_PATH. Defaults to "".
    app_kwargs: Additional keyword arguments to pass to the underlying FastAPI app as a dictionary of parameter keys and argument values. For example, `{"docs_url": "/docs"}`
    state_session_capacity: The maximum number of sessions whose information to store in memory. If the number of sessions exceeds this number, the oldest sessions will be removed. Reduce capacity to reduce memory usage when using gradio.State or returning updated components from functions. Defaults to 10000.
    share_server_address: Use this to specify a custom FRP server and port for sharing Gradio apps (only applies if share=True). If not provided, will use the default FRP server at https://gradio.live. See https://github.com/huggingface/frp for more information.
    share_server_protocol: Use this to specify the protocol to use for the share links. Defaults to "https", unless a custom share_server_address is provided, in which case it defaults to "http". If you are using a custom share_server_address and want to use https, you must set this to "https".
    share_server_tls_certificate: The path to a TLS certificate file to use when connecting to a custom share server. This parameter is not used with the default FRP server at https://gradio.live. Otherwise, you must provide a valid TLS certificate file (e.g. a "cert.pem") relative to the current working directory, or the connection will not use TLS encryption, which is insecure.
    auth_dependency: A function that takes a FastAPI request and returns a string user ID or None. If the function returns None for a specific request, that user is not authorized to access the app (they will see a 401 Unauthorized response). To be used with external authentication systems like OAuth. Cannot be used with `auth`.
    max_file_size: The maximum file size in bytes that can be uploaded. Can be a string of the form "<value><unit>", where value is any positive integer and unit is one of "b", "kb", "mb", "gb", "tb". If None, no limit is set.
    enable_monitoring: Enables traffic monitoring of the app through the /monitoring endpoint. By default is None, which enables this endpoint. If explicitly True, will also print the monitoring URL to the console. If False, will disable monitoring altogether.
    strict_cors: If True, prevents external domains from making requests to a Gradio server running on localhost. If False, allows requests to localhost that originate from localhost but also, crucially, from "null". This parameter should normally be True to prevent CSRF attacks but may need to be False when embedding a *locally-running Gradio app* using web components.
    ssr_mode: If True, the Gradio app will be rendered using server-side rendering mode, which is typically more performant and provides better SEO, but this requires Node 20+ to be installed on the system. If False, the app will be rendered using client-side rendering mode. If None, will use GRADIO_SSR_MODE environment variable or default to False.
    pwa: If True, the Gradio app will be set up as an installable PWA (Progressive Web App). If set to None (default behavior), then the PWA feature will be enabled if this Gradio app is launched on Spaces, but not otherwise.
    i18n: An I18n instance containing custom translations, which are used to translate strings in our components (e.g. the labels of components or Markdown strings). This feature can only be used to translate static text in the frontend, not values in the backend.
    mcp_server: If True, the Gradio app will be set up as an MCP server and documented functions will be added as MCP tools. If None (default behavior), then the GRADIO_MCP_SERVER environment variable will be used to determine if the MCP server should be enabled.
    num_workers: Number of background workers to launch in the background to serve file I/O and static assets. This offloads traffic from the main server and reduces latency. Only has an effect if ssr mode is set.
    theme: A Theme object or a string representing a theme. If a string, will look for a built-in theme with that name (e.g. "soft" or "default"), or will attempt to load a theme from the Hugging Face Hub (e.g. "gradio/monochrome"). If None, will use the Default theme.
    css: Custom css as a code string. This css will be included in the demo webpage.
    css_paths: Custom css as a pathlib.Path to a css file or a list of such paths. This css files will be read, concatenated, and included in the demo webpage. If the `css` parameter is also set, the css from `css` will be included first.
    js: Custom JavaScript provided as either a function or a raw code string. A function is automatically invoked; otherwise the code is executed directly when the page loads. To run JavaScript as a document-level `<script>` tag, use the `head` parameter.
    head: Custom html code to insert into the head of the demo webpage. This can be used to add custom meta tags, multiple scripts, stylesheets, etc. to the page.
    head_paths: Custom html code as a pathlib.Path to a html file or a list of such paths. This html files will be read, concatenated, and included in the head of the demo webpage. If the `head` parameter is also set, the html from `head` will be included first.
Returns:
    app: FastAPI app object that is running the demo
    local_url: Locally accessible link to the demo
    share_url: Publicly accessible link to the demo (if share=True, otherwise None)
Example: (Blocks)
    import gradio as gr
    def reverse(text):
        return text[::-1]
    with gr.Blocks() as demo:
        button = gr.Button(value="Reverse")
        button.click(reverse, gr.Textbox(), gr.Textbox())
    demo.launch(share=True, auth=("username", "password"))
Example:  (Interface)
    import gradio as gr
    def reverse(text):
        return text[::-1]
    demo = gr.Interface(reverse, "text", "text")
    demo.launch(share=True, auth=("username", "password"))
r   )rH   N©NNNzTYou cannot provide both `auth` and `auth_dependency` in launch(). Please choose one.c              3  ó4   #   • U  H  oS    (       + v •  M     g7f)r   NrŽ   ©r_  Úauthenticables     r‚   rb  Ú Blocks.launch.<locals>.<genexpr>{  ó   é € ÐGºY¨M QÑ'×'Ñ'ºYùó   ‚zOYou have provided an empty username in `auth`. Please provide a valid username.c              3  ó4   #   • U  H  oS    (       + v •  M     g7f)ri   NrŽ   rH  s     r‚   rb  rJ    rK  rL  zOYou have provided an empty password in `auth`. Please provide a valid password.r)  rš  ÚGRADIO_RUN_HISTORYr  r1  )ÚapiÚgradioÚsettingsr˜  r˜  ÚGRADIO_ALLOWED_PATHSÚ,ÚGRADIO_BLOCKED_PATHSz.`allowed_paths` must be a list of directories.z.`blocked_paths` must be a list of directories.Ú__)r÷  F)r3  ÚGRADIO_NUM_WORKERSri   ÚGRADIO_NODE_PATHÚGRADIO_LOCAL_DEV_MODE)Úserver_nameÚserver_portÚ	node_pathÚdebug©ÚINITIAL_PORT_VALUEÚTRY_NUM_PORTSÚGRADIO_SERVER_NAMErr  ÚGRADIO_NODE_SERVER_PORTrƒ  )rY  rZ  r[  Úpython_portÚpython_hostÚstatic_worker_portsr\  )r  r=  r9  r>  r?  r\  zInvalid local_url: z[Rerunning server... use `close()` to stop if you need to change `launch()` parameters.
----©Úhttp_server©r  rY  rZ  r6  r7  r8  r‰  TÚhttpÚhttps)ÚBUILD_PATH_LIBÚSTATIC_PATH_LIB)ÚStaticServerConfigÚStaticWorkerPool)Ú
build_pathÚstatic_pathÚuploaded_file_dirrk  rl  rà  r[  )rA  rØ   Úportsz* Static file workers: z processes on ports Úon_shutdownrq  Ú	localhostzhttp://Ú:rZ  )Ú	user_portr6  r7  r8  zAFailed to start Node front proxy for SSR; serving without SSR on z$ (see the Node server output above).z’Failed to start Node front proxy for SSR, and the user-facing port could not be taken over; Gradio is reachable only on the internal Python port :z:. See the Node server output above, or set ssr_mode=False.z* Running on local URL:  z://u&   , with SSR âš¡ (Node proxy -> Python :r(  u   , with SSR âš¡ (dev mode)z#* Running on local URL:  {}://{}:{}zstartup-events)ÚverifyÚtimeoutz Couldn't start the app because 'z' failed (code zJ). Check your network or proxy settings to ensure localhost is accessible.zÎIt looks like you are running Gradio on a hosted Jupyter notebook, which requires `share=True`. Automatically setting `share=True` (you can turn this off by setting `share=False` in `launch()` explicitly).
ÚGRADIO_SHAREzMonitoring URL: zmonitoring/)TNz”When localhost is not accessible, a shareable link must be created. Please set share=True or check your proxy settings to allow access to localhost.z‡Colab notebook detected. This cell will run indefinitely so that you can see errors and logs. To turn off, set debug=False in launch().zUColab notebook detected. To show errors in colab notebook, set debug=True in launch()zENote: opening Chrome Inspector may crash demo inside Colab notebooks.z:Setting share=True is not supported on Hugging Face Spaces)Ú
local_hostÚ
local_portrv   r:  r<  z* Running on public URL: zø
This share link is temporary and will last for up to 1 week (best effort). For free permanent hosting and GPU upgrades, run `gradio deploy` from the terminal in the working directory to deploy to Hugging Face Spaces (https://huggingface.co/spaces)zNot able to set up tunnelz:
Could not create share link. Checksum mismatch for file: rt  z
Could not create share link. zr
Could not create share link. Please check your internet connection or our status page: https://status.gradio.app.z,
Could not create share link. Missing file: zÄ. 

Please check your internet connection. This can happen if your antivirus software blocks the download of this file. You can install manually by following these steps: 

1. Download this file: z#
2. Rename the downloaded file to: z$
3. Move the file to this location: z:* To create a public link, set `share=True` in `launch()`.z/mcpu3   
ðŸ”¨ Launching MCP server:
* Streamable HTTP URL: )rM  Ú
JavascriptÚdisplayg      Ð?z<div><iframe src="ú	" width="ú
" height="zx" allow="autoplay; camera; microphone; clipboard-read; clipboard-write;" frameborder="0" allowfullscreen></iframe></div>aW  (async (port, path, width, height, cache, element) => {
                        if (!google.colab.kernel.accessAllowed && !cache) {
                            return;
                        }
                        element.appendChild(document.createTextNode(''));
                        const url = await google.colab.kernel.proxyPort(port, {cache});

                        const external_link = document.createElement('div');
                        external_link.innerHTML = `
                            <div style="font-family: monospace; margin-bottom: 0.5rem">
                                Running on <a href=${new URL(path, url).toString()} target="_blank">
                                    https://localhost:${port}${path}
                                </a>
                            </div>
                        `;
                        element.appendChild(external_link);

                        const iframe = document.createElement('iframe');
                        iframe.src = new URL(path, url).toString();
                        iframe.height = height;
                        iframe.allow = "autoplay; camera; microphone; clipboard-read; clipboard-write;"
                        iframe.width = width;
                        iframe.style.border = 0;
                        element.appendChild(iframe);
                    })z<({port}, {path}, {width}, {height}, {cache}, window.element))r  rý   rV  rW  ÚcacherA  c              3  óz   >#   • U  H0  nTR                   R                  5       UR                  5       :H  v •  M2     g 7fr‡   )r  Úto_dict)r_  Úbuilt_in_themer�   s     €r‚   rb  rJ  �  s3   øé € ð &â&D�Nð —
‘
×"Ñ"Ó$¨×(>Ñ(>Ó(@Ö@Ú&Dùs   ƒ8;ÚbrowserÚinline)Úlaunch_methodÚis_google_colabÚis_sharing_onÚis_spacer+  Ú
custom_cssr  Úis_custom_themeÚ	custom_jsÚcustom_headÚcustom_css_pathsÚcustom_head_pathsÚps1ÚGRADIO_DEBUGÚ0rŽ   )±Úgradio.routesrH   rK  rL  rM  rN  rO  rP  r   Ú	get_themer  r  r   r¨  r!  r"  r,  r„  rý  rG  r¯   Úcallablerr   rÔ   rÓ   r\  rh  rH  rI  Úauth_messager8  rW  rV  r[  rj  rz   rE  rF  rn   rm  r¹   r@  rß  rk  rû  ÚsplitrÀ  rl  r  Ú_parse_file_sizerà  r^  r¡   rÎ   rc   rp   rX  r>  r2  r  Úmax_thread_countrú  rð  rØ   r4  r2  r  Ú_node_is_proxyÚ_ssr_degradedrV   r[  r]  rB   r?  Únode_processr@  Úgradio.http_serverr^  r_  r�  rv  rè  r  Ú
server_appr  r/  rö  rS  rT  rs   rP  rf  Ústart_serverrY  ÚrstriprC   Úlocal_api_urlrZ  Úserverrî  rê  Úis_hosted_notebookr:  r;  r<  r€   r~   Ú
_local_urlÚ
startswithrë  Úset_server_apprj  rk  Úgradio.static_serverrl  rm  rp  rÌ  Ú_static_worker_poolr}  rq  Ú_end_streaming_responsesÚ_serve_without_node_proxyÚformatrŠ  Ú
is_successr[  rþ   Ústatus_coder0  Úanalytics_keyrG  r   Úurl_okrZ  rU  Úsetup_tunnelrv   r   r   rA  r   Úerror_analyticsr5   rO   r<   r   ÚexistsrP   rM   rN   r?  ÚlstripÚ
webbrowserr%  Úipython_checkÚIPython.displayrM  r{  r|  rü  ÚsleepÚjsonÚdumpsÚartifactÚImportErrorrl   ÚBUILT_IN_THEMESr+  rÆ   r  Úlaunched_analyticsÚsysÚflagsÚinteractiveÚblock_threadrR   )`r�   r„  Ú	inbrowserr0  r\  r2  r\  r•  Úprevent_thread_lockr8  rY  rZ  rW  rV  r[  r6  r7  r8  rj  r÷  rß  r@  rk  rl  rm  r9  rz   r:  r;  r<  r=  rà  rG  r>  r?  r@  r2  r>  r?  rA  rB  rC  rD  r  r  r   r¨  r!  r"  rH   ÚlinkÚallowed_paths_envrÜ   Úblocked_paths_envrU  Úresolved_num_workersÚenv_valÚstatic_worker_countrd  Ú_pending_node_proxy_kwargsÚis_dev_moder^  r_  rc  ru  Úenv_node_portÚpreferred_startÚpython_internal_portÚworker_startr±  rf  rT  r¡  rj  rk  rl  rm  Ústatic_configÚworker_portsÚurl_hostr€  ÚrespÚ	share_envrU  Ú
parsed_urlrÞ   Úmcp_subpathrM  r{  r|  r¹  Ú
colab_portÚcoderŠ  r  Úis_in_interactive_modes`   `                                                                                               r‚   r  ÚBlocks.launchÕ
  sÀ  ø€ õz 	&àÑ*‘°×0FÑ0FˆØ‘_‰c¨$×*>Ñ*>ˆØ!*Ñ!6‘I¸D×<VÑ<Vˆ	Ø‘>‰R t×':Ñ':ˆØÑ'‰t¨T×-BÑ-Bˆà$Ñ0‰J°d×6QÑ6Qð 	ô "ŸOšO¨EÓ2ˆŒ
ØˆŒØ"Ÿ bˆŒØˆŒØˆŒ	Ø$ˆŒØ×*Ñ*Ô,à×,×,à#à�{�{Ø�M‰MŒOàÑ Ñ ;ÜØfóð ö Ü˜T—N‘NÜ˜t A™w¬×.Ñ.Ü˜t A™w¬×-Ñ-à˜ˆD�IàˆDŒIà�9�9œX d§i¡i×0Ñ0ÜÑG¸T¿YºYÓG×GÑGÜ—’Øeôô ÑG¸T¿YºYÓG×GÑGÜ—’Øeôð )ˆÔØ$ˆŒØˆŒØˆŒ
Ø(ˆÔØ$ˆŒØ&<ˆÔ#ØÑÜŸZ™ZŸ^™^Ð,>ÀÓCˆD�Nà&ˆDŒNð Ñ"ô �J‰J�N‰NÐ/°Ó8×>Ñ>Ó@ÀFÒJàð 	Ôð Ñ'ñ â6ð 	Ôð
 ××Ø26×2CÒ2CÓ VÒ2C¨$ÀtÈvÁ~§Ñ2CÑ VˆDÔæØ!.ˆDÕä "§
¡
§¡Ð/EÀrÓ JÐÜÐ$Ó%¨Ó)à->×-DÑ-DÀSÔ-Ió&Ú-I T�D—J‘J–LÑ-Iñ&�Õ"ð &(�Ô"æØ!.ˆDÕä "§
¡
§¡Ð/EÀrÓ JÐÜÐ$Ó%¨Ó)à->×-DÑ-DÀSÔ-Ió&Ú-I T�D—J‘J–LÑ-Iñ&�Õ"ð &(�Ô"ä˜$×,Ñ,¬d×3Ñ3ÜÐMÓNÐNÜ˜$×,Ñ,¬d×3Ñ3ÜÐMÓNÐNà×$Ñ$Ô&Ü"×3Ò3°MÓBˆÔà�=�=ØŸ™×+Ñ+Ö-�Ø—9‘9Ó$Ø"$ U§Y¡Y K¨rÐ 2�E–Iñ .ð 58±K”5—?’?Ó$¨DÑ0ÀSˆŒØ&ˆÔØ'2ˆ�‰Ô$Ø×Ñ 5ÐÑ)Ø×*Ñ*Ó,ˆŒà×.Ñ.¨xÐQVÐ.ÐWˆŒð  +ÐØÑ'Ü—j‘j—n‘nÐ%9Ó:ˆGØÑ"Ü'*¨7£|Ð$ð $Ñ/Ø$¨Ó)Ø—	‘	Ñ!ØÑ'ñ	 !ð
 ð 	ð $ˆÔð #ˆÔØ)+Ðð 37Ð"à�=�=ˆ=ÜŸZ™ZŸ^™^Ð,>ÄÃÓPˆDŒNÜŸ)š)Ð$;Ó<ÀDÐHˆKæô &Ø$4Ø$-Ø"&§.¡.Ø#ñ	ñ I�Ô% tÔ'8¸$¾.ð ——÷ Qà)÷ ¬R¯YªYØ(¨+ó.�ð &�	ØÑ$Ü$&§I¢IÐ.GÓ$H�MØ$Ñ0Ü$'¨Ó$6˜	ØÑ$¨Ñ)@Ø +�Ið "+Ñ!6‘IÐ<Nð  ô (7Ø ¸Ñ':Àmñ(Ð$ö 'Ø#7¸!Ñ#;�Lä27Ð8KÔ2Ló+Ú2L¨Q˜ qÔ(Ñ2Lð (ð +ð 3�à#3×#B°{Ø#,Ø!%§¡Ø#7Ø#.Ø+>Ø"ñ.Ð*ð NRÐQ�Ô%ÐQ¨¬¸Õ9Jð
 ')Ð#ØMQÐQ�Ô%ÐQ¨¬¸Õ9JàIMÐMˆDÔ!ÐM D¤N°TÔ5Fà!ˆÔàÑØˆJà%(§^¢^ØØØ+Ø!Ø#Ø!Øñ&
ð 	
ˆŒ˜$œ(ð �>�>¦%Ü�$—.‘.Ô!à�?�?Ü˜dŸn™n¬c×2Ñ2Ü Ð#6°t·~±~Ð6FÐ!GÓHÐHÞÜØrôùõ +ð ×(Ñ(Ø—H‘HØ'Ø'Ø'Ø)Ø%9ð )ð ñØØØØð  +ˆDÔØ&ˆDŒNØ$(§N¡N×$9Ñ$9¸#Ó$>Ð#?Ä
¸|È1Ð!MˆDÔØ*ˆDÔØ ˆDŒKØ"ˆDŒOÜ!×-Ò-Ó/ˆDŒMÜ&+×&>Ò&>Ó&@ˆDÔ#Ø(<ˆDÔ%Ø)>÷ *Ø.Ñ:‘Àð Ô&ð 1MˆDÔ-Ø $ˆDÔØ×"×"Ø15·±�×#Ñ#Ô.ð —>‘>×,Ñ,¨W×5Ñ5¸¿¿ñ àð ŒMð �K‰K×&Ñ& t§¡Ô7÷ #÷÷ Vá 2Ü" >Ó2Ü # OÓ 4Ø&*§o¡o×&GÑ&GØ"&×"4Ñ"4Ø"&×"4Ñ"4Ø"&×"4Ñ"4Ø;?×;L×;L¤ T×%6Ñ%6Ô!7ÐRVñ!�ð ×&×&Ö+>Ø#6‘Là#'×#3Ñ#3°aÑ#7�LØ—~‘~Ñ1Ü'*¨<¸¿¹È!Ñ9KÓ'L˜ä27Ð8KÔ2Ló$Ú2L¨Q˜ qÔ(Ñ2Lð !ð $ñ ,<Ø 3Ø(Ø&ñ,�Ô(ð
 ×(Ñ(×.Ñ.Ô0æÜØ1Ð2EÐ1FÐFZÐ[_×[sÑ[s×[yÑ[yÐZzÐ{ôð *Ò5ä%ñ Ø4ñà$(×$AÑ$Aòñ I�Ô% tÔ'8¸$¼.ð ×$Ñ$Ñ0°T·^±^Ñ5OØ*.�DÔ'ð  ×+Ñ+¨yÓ8ñ $à!×-Ñ-ð ð
 (/¨x¨j¸¸$¿.¹.Ð9IÈÐ%K�D”NØ,0¯N©N×,AÑ,AÀ#Ó,FÐ+GÌ
À|ÐSTÐ)U�DÔ&Ø×*×*Ø9=¿¹˜×+Ñ+Ô6øð *.×)GÑ)GØ"<¸]Ñ"KØ$/Ø%1Ø-Að	 *Hð *�DÔ&ö !Ø×-×-Ü$ŸMšMð!2Ø26·.±.Ð1Að BFð!Fõô %ŸMšMð!$ð %)×$4Ñ$4Ð#5ð 6@ð!@ôð —=—=®Ø×&×&¨4¯>©>Ñ+EÜØ3°D·M±M°?À#Àd×FVÑFVÐEWÐWXÐY]×YgÑYgÐXhð  iOð  PT÷  P`ñ  P`ð  Oað  abð  cõð —]—]¨4×+=×+=ÜØ3°D·M±M°?À#Àd×FVÑFVÐEWÐWXÐY]×YiÑYiÐXjð  kDð  Eõð >�AÜ˜!Ÿ(™( 4§=¡=°$×2BÑ2BÀD×DTÑDTÓUÔVä—9’9Ø×%Ñ%Ð& nÐ5Ø!ØñˆDð
 —?—?ÜØ6°t·x±x°jÀÐPT×P`ÒP`ÐOað  blð  móð ð ‰=Ø�}�} × 7× 7ÞÜð jôð "�•
à"�”
ÜŸIšI nÓ5�	ØÑ(¨Y¯_©_Ó->À&Ó-HØ!%�D”JøàˆDŒJæÜØ" 4§>¡>Ð"2°+¸d¿h¹h×>TÒ>TÐ=UÐVôð "3°lÑ!BˆÔö �Z×.Ó.¨t¯~©~×>Ñ>ÀtÇzÇzÀzÜð góð ð �=�=¦ÞÜð ^õô Økôð —:—:�:ÜØ[ôð �:�:ˆ:˜$Ÿ-Ÿ-˜-Ü�MŠMÐVÔWØˆDŒJà�:�:ˆ:ð$Ø—>’>Ñ)Ý *× 7Ó 7Ø#'×#3Ñ#3Ø#'×#3Ñ#3Ø$(×$4Ò$4Ø-1×-FÑ-FØ59×5VÑ5Vñ!�Iõ "*¨)Ó!4�JÝ%/Ø×3Ñ3Ð5¸
À1À2¸ÑFó&�D”Nô Ð1°$·.².Ð1AÐBÔCÞÜð Tôøö. ÜÐRÔSØ!ˆDŒNä  6Ñ)ˆØ�?�?ˆ?Üð,Ø,0¯NªN×,X¸d¿n¹n×>SÑ>SÐTWÓ>XÐ+YÐYZÐ[f×[mÒ[mÐnqÓ[rÐZsÐstðvôö
 Ø%)§Z§Z Z°D·N·N°N�4—>“>ÈÏÉˆDÝ�O‹O˜DÔ!ð ‰>Ü×(Ó(Ó*ˆFßð=ßEÑEà—:—:�: $§.§. .Ý(×/Ó/°·²×?Ñ?ÝŸ
›
 4Ô(õ )×/Ó/°·²×?Ó?á#Ø,¨T¯^ª^Ð,<¸IÀdÇjÁjÀ\ÐQ[Ð\`×\gÑ\gÐ[hð  iað  bó ’Hð —]—]ð  ×.×.°4·>±>Ñ3Mð Ÿšà!×-Ñ-ð ð
ð0 [×aÑaÝ!ŸZ›Z¨
Ó3Ý!ŸZ›Z¨›_Ý"Ÿj›j¨¯©Ó4Ý#Ÿz›z¨$¯+©+Ó6Ý"Ÿj›j¨Ó/ð bð ñ1�Dñ@  *¨$Ó/‘Há#Ø,¨T¯^©^Ð,<¸IÀdÇjÁjÀ\ÐQ[Ð\`×\gÑ\gÐ[hð  iað  bó �Hð !)�”Ù˜Ô!õ �4Ð,¨e×4Ñ4Ü"%ô &ä&+×&;Ò&;×&BÑ&BÔ&Dó&ó #ô ˆOö
 /8¡¸XØ#'§=¡=Ø!%§¢Ø ŸMšM°Ð5ØŸ	š	Ø"Ÿh™h¨dÐ2ØŸ™ŸšØ#2Ø!ŸW™W¨DÐ0Ø#Ÿy™y°Ð4Ý$(¨¯©Ó$8Ý%)¨*Ó%5ñˆDõ ×(Ó(¨¨tÔ4å!%¥g­c°5½#¿)º)×:OÒ:OÓ&PÓ!QÐö Ü”2—9’9˜^¨SÓ1Ó2°aÓ7ö (Ö0Fð
 ×ÒÔå˜TŸ_™_¨d¯n©n¸d¿nºnÐMÓNÐNùòm !Wùò&ùò&ùòP+ùòp$øôt ó Ø×)×)Ð)Ý×-Ó-Ð.IÔJØ!%�”Ø"�”
Ü˜aÕ!6×7Ñ7ÜØUÕVaÐUbÐbcÐd÷ò ô   Õ#=×>Ñ>ÜÐ;¸A¸3Ð?×@Ò@Ý�+Ó&×-Ò-×/Ñ/Üð N÷ò ô ØGÍÀ}ð  U]õ  ^hð  ]ið  iMõ  N]ð  M^ð  ^Cõ  DQð  CRð  S÷ò ûð!ûõF ó Úðús…   Ë
AP<ËAP<Ì/AQÎ*AQÚAQèAQû%B4AQ ÁBBAU  ÁD3EAU  ÁQ
AUÁQA"AUÁS$AUÁS10AUÁT'+AUÁUAUÁU AU/ÁU.AU/c           	     óÈ  • SnUb›  SnUR                  SS5        U R                  b/  UR                  SU R                   35        UR                  5         OKU R                  (       a/  UR                  SU R                   35        UR                  5         O[        S5      eUb¨  [        US5      (       a  [        US	5      (       d   S
5       eSnU R                  be  UR                  SUR                  SU R                  -   S-   [        U R                  5      -   S-   [        U R                  5      -   S-   5      05        O[        S5        Ub`  [        US5      (       d   S5       eSnU R                  b  UR                  SU R                  5        OUR                  SU R                  5        U R                  (       a#  U(       a  SU0n[        R                   " U5        ggg)a¾  
A catch-all method for integrating with other libraries. This method should be run after launch()
Parameters:
    comet_ml: If a comet_ml Experiment object is provided, will integrate with the experiment and appear on Comet dashboard
    wandb: If the wandb module is provided, will integrate with it and appear on WandB dashboard
    mlflow: If the mlflow module  is provided, will integrate with the experiment and appear on ML Flow dashboard
rš  NÚCometMLzCreated fromrÞ  zgradio: zPlease run `launch()` first.ÚlogÚHtmlz(wandb module missing required attributesÚWandBzGradio panelz<iframe src="r}  r~  z" frameBorder="0"></iframe>zAThe WandB integration requires you to `launch(share=True)` first.Ú	log_paramz)mlflow module missing required attributesÚMLFlowzGradio Interface Share LinkzGradio Interface Local LinkÚintegration)Ú	log_otherrU  Úlog_textró  rT  r¯   r¬   rÜ  rÝ  rs   rV  rW  rö  rß  rA  r   Úintegration_analytics)r�   Úcomet_mlÚwandbÚmlflowÚanalytics_integrationr  s         r‚   r  ÚBlocks.integrate²  sÔ  € ð !#ÐØÑØ$-Ð!Ø×Ñ˜~¨xÔ8Ø�~‰~Ñ)Ø×!Ñ! H¨T¯^©^Ð,<Ð"=Ô>Ø—‘•Ø——Ø×!Ñ! H¨T¯^©^Ð,<Ð"=Ô>Ø—‘•ä Ð!?Ó@Ð@ØÑÜ˜5 %×(Ñ(¬W°U¸F×-CÑ-Cð Ø:óÐCð %,Ð!Ø�~‰~Ñ)Ø—	‘	à&¨¯
©
Ø+Ø"Ÿn™nñ-à)ñ*ô " $§*¡*›oñ.ð +ñ	+ô
 " $§+¡+Ó.ñ/ð <ñ<ó)ð
õô ØWôð ÑÜ˜6 ;×/Ñ/ð Ø;óÐ/ð %-Ð!Ø�~‰~Ñ)Ø× Ñ Ð!>ÀÇÁÕOà× Ñ Ð!>ÀÇÁÔOØ×!×!Ö&;Ø!Ð#8Ð9ˆDÜ×+Ò+¨DÕ1ð '<Ð!r…   c                óº  ^ ^^^^• SSK Jm  SSKJnJn  T R
                  nT R                  nT R                  S:X  a  SOT R                  n	SUU UUU4S jjn
Ub  [        X‘5      (       d  gUnO [        X•US9nUb  UR                  5          U
" U5      u  pÍpïUT l        UT l        UT l        UR                  S	5       [         S	3T l        UT l        UR#                  S
5      (       d  T R$                  (       a  S
OST l        T R(                  (       a  UT R(                  l        g! [         a     gf = f! [        [        4 a    U
" U5      u  pÍpïUT l         gf = f)um  Moves the running Python server from its internal port onto the
user-facing port, for when the Node front proxy failed to start.

In proxy mode Python deliberately binds an internal port and lets Node own
the user-facing one. If Node never comes up, that leaves the app answering
on a port nobody is asking about â€” on Spaces the container is judged by the
user-facing port, so the app is reported as crashed even though Python is
healthy. Rebinding there serves the app client-side rendered instead.

Returns whether the move happened; the existing server keeps running if the
user-facing port could not be taken over.
r   re  r]  rq  rr  c           	     óT   >• TR                  TR                  TR                  U TTTS9$ )Nrg  )rž  r  rY  )r  rf  r�   r7  r6  r8  s    €€€€€r‚   Úserve_onÚ2Blocks._serve_without_node_proxy.<locals>.serve_on	  s7   ø€ Ø×+Ñ+Ø—H‘HØ ×,Ñ,Ø Ø'Ø)Ø%9ð ,ð ð r…   Frƒ  r‰  ri  rh  T)r  r"  )rP  rf  rœ  r^  r_  rZ  r¡  rY  r„  r�  r  r{  r;   rT  rŸ  rC   r   r¤  rê  rë  r~   r£  )r�   ru  r6  r7  r8  r^  r_  Úinternal_portÚ
old_serverÚ	bind_hostrì  Útarget_portrY  rZ  rT  r¡  rf  s   ` ```           @r‚   r©  Ú Blocks._serve_without_node_proxyï  s]  ü€ õ& 	'ßHà×(Ñ(ˆØ—[‘[ˆ
Ø#'×#3Ñ#3°yÓ#@‘KÀd×FVÑFVˆ	÷	ó 	ð Ñ Ü  ×6Ñ6ØØ&/‰KðÜ-ØÀ=ñ�ð Ñ!Ø×ÑÔð	Ù:BÀ;Ó:OÑ7ˆK ið 'ˆÔØ&ˆÔØ"ˆŒØ )× 0Ñ 0°Ó 5Ð6´z°lÀ!ÐDˆÔØˆŒà ×+Ñ+¨G×4Ñ4¸¿¿‰GÈ6ð 	Œð ××Ø-6ˆD×ÑÔ*Øøô3 ó Ùðûô Ô1Ð2ó 	ñ ;CÀ=Ó:QÑ7ˆK iØ ˆDŒKÙð	ús$   Á.
D% ÂD5 Ä%
D2Ä1D2Ä5"EÅEc                óL   • U R                   R                  R                  5         g)a³  
Ends the session heartbeat streams. The Node front proxy waits for the
connections it is serving before exiting, and these are those connections.

This runs on the main thread while the event loop runs in uvicorn's, so
the set() only lands on the loop's next wake; uvicorn's main loop ticks
every 100ms, which is what keeps shutdown prompt. `server_app` rather
than `app`, because `queue()` rebinds `app` but not the served instance.
N)r�  Ú
stop_eventr{   r‰   s    r‚   r¨  ÚBlocks._end_streaming_responses;  s   € ð 	�‰×"Ñ"×&Ñ&Õ(r…   c                ó  • U R                   (       d  g [        U S5      (       a.  U R                  b!  U R                  R                  5         SU l        U R                  R                  5         SU l         U R                  R                  R                  5         U R                  (       a  U R                  R                  5         SU R                  l
        U(       a  [        SU R                   35        gg! [        [        4 a     gf = f)z<
Closes the Interface that was launched and frees the port.
Nr§  Fz Closing server running on port: )rS  r¬   r§  Úshutdownr  r{  r  rô  r{   r¡  Ústartup_events_triggeredrö  rZ  r  r  )r�   Úverboses     r‚   r{  ÚBlocks.closeG  sÏ   € ð ��Øð	ä˜Ð3×4Ñ4Ø×,Ñ,Ñ8à×(Ñ(×1Ñ1Ô3Ø+/�Ô(Ø�K‰K×ÑÔà#ˆDŒOØ�H‰H×Ñ×#Ñ#Ô%Ø�{�{Ø—‘×!Ñ!Ô#ð 16ˆD�H‰HÔ-ÞÜÐ8¸×9IÑ9IÐ8JÐKÕLð øä¤Ð(ó 	Ùð	ús   ”CC5 Ã5DÄDc                óN  •  U R                   (       a*  [        R                  " S5        U R                   (       a  M)  gg! [        [        4 aV    [        S5        U R                  (       a  U R                  R                  5         [         H  nUR                  5         M      gf = f)z,Block main thread until interrupted by user.gš™™™™™¹?z7Keyboard interruption in main thread... closing server.N)
rS  rü  r¶  ÚKeyboardInterruptr  rö  r¡  r{  rQ   Úkill)r�   Útunnels     r‚   rÀ  ÚBlocks.block_threadc  sk   € ð	Ø—/—/Ü—
’
˜3”ð —/—/“/øä!¤7Ð+ó 	ÜÐKÔLØ�{�{Ø—‘×!Ñ!Ô#ß)�Ø—‘–ó *ð		ús   ‚8> ¾A#B$Â#B$c                óˆ   • U R                   R                  5         SU R                   l        SU l        U R	                  5         g)zGEvents that should be run when the app containing this block starts up.FTN)r  r}  ÚstoppedrS  rÖ  r‰   s    r‚   Úrun_startup_eventsÚBlocks.run_startup_eventsq  s1   € à�‰×ÑÔà#ˆ�‰ÔØˆŒØ×ÑÕr…   c              ƒ  óT   #   • U R                    H  nU" 5       I S h  v•N   M     g  N	7fr‡   )r<  )r�   Ústartup_events     r‚   Úrun_extra_startup_eventsÚBlocks.run_extra_startup_eventsy  s#   é € Ø!×6Ô6ˆMÙ“/×!Ò!ò 7Ù!ùs   ‚(œ&�
(c                óP	  • U R                   n0 0 S.nU R                  R                  5        GHu  nUR                  (       a  UR                  S:X  a  M'  U(       d  UR                  S:w  a  M@  / / [        [        S   UR                  5      S.n[        R                  " UR                  5      nUb  XeS'   [        R                  " UR                  5      nUR                  SL a  S	US
'   O]UR                  c)  [        R                  " UR                  5      u  n  n	X…S
'   O'UR                  n[        U[        5      (       d   eX…S
'   Sn
UR                  n[        U5       GHÞ  u  pÍUS    H  nUS   UR                   :X  d  M    O   Sn
  GO·US   S   nU R"                  US      R$                  (       a  MW  US   R'                  SSUR                    35      nU R)                  US   5      n[        U[*        R,                  5      (       d  [/        U< S35      eUR'                  SUR'                  S5      5      nUR1                  5       n[2        R4                  " U5      nUR                  (       a"  U[7        U5      :  a  X|   S   S;  a  X|   S   nOSU 3nUS   R'                  S5      b  SnUS   S   nO=UR                  (       a(  U[7        U5      :  a  X|   S   (       a  X|   S   c  SnSnOSnSnUS   R9                  UUUUUUU=(       d    0 R'                  SS	5      S.UR;                  5       US.5        GMá     UR<                  nU GH.  nUS    H  nUS   UR                   :X  d  M    O   Sn
  GO	US   S   nU R"                  US      R$                  (       a  MU  US   R'                  SSUR                    35      nU R)                  US   5      n[        U[*        R,                  5      (       d  [/        U< S35      eUR'                  S US   5      nUR1                  5       n[2        R4                  " U5      nUS!   R9                  UUUUR'                  S
S	5      S.UR;                  5       S".5        GM1     U
(       a  GMa  XSS#   S$UR>                   3'   GMx     U$ )%zÊ
Gets the information needed to generate the API docs from a Blocks.
Parameters:
    all_endpoints: If True, returns information about all endpoints, including those with api_visibility="undocumented".
)Únamed_endpointsÚunnamed_endpointsr�  r  )r  r�  r¥  )rÍ   Úreturnsr³  Nr  Frš  Údescriptionr   rq   Trä   rÆ   ÚlabelÚ
parameter_z is not a Componentr×  rÖ  r   )r¦  rÞ  Úresult_callbacksÚparam_r_   ri   r$  rÍ   Úadditional_description)rÕ  r  )r  Úparameter_nameÚparameter_has_defaultÚparameter_defaultrÕ  Úpython_typera  Úexample_inputÚvalue_rØ  r  )r  rÕ  r  ra  r	  r‰  ) rØ   rˆ  rÎ   r¿  r³  r   r   r   Úoauth_token_requirementÚget_function_paramsr§  Úget_function_descriptionrr   rs   rÅ  rf  rp   r¡   r“   rn   r~  r   rY   r|  rÙ  rì   Újson_schema_to_python_typerû  r§   Ú
capitalizeri  r¦  )r�   Úall_endpointsrØ   rÖ  r¿  Údependency_infoÚoauth_token_kindÚfn_infor  r	  Úskip_endpointrÅ  r`  Úinput_blockra  rÕ  r  r}  ÚinfoÚexampler  r  r  r  ri  r²  s                             r‚   Úget_api_infoÚBlocks.get_api_info}  s˜  € ð —‘ˆØ02ÈÑLˆà—(‘(—/‘/×#ˆBØ—5—5˜B×-Ñ-°Ó:ÙÞ  R×%6Ñ%6¸(Ó%BÙð !ØÜ"&ÜÐ?Ñ@À"×BSÑBSó#ñ0ˆOô  %×<Ò<¸R¿U¹UÓCÐØÑ+Ø1A Ñ.Ü×/Ò/°·±Ó6ˆGØ×!Ñ! UÒ*Ø13� Ò.Ø×#Ñ#Ñ+Ü$)×$BÒ$BÀ2Ç5Á5Ó$IÑ!�˜Q Ø1< Ò.à ×0Ñ0�Ü! +¬s×3Ñ3Ð3Ð3Ø1< Ñ.Ø!ˆMà—Y‘YˆFÜ&/°×&7Ñ"�Ø!'¨Ô!5�IØ  ‘¨+¯/©/Õ9Ùñ "6ð %)�MÚØ  Ñ)¨&Ñ1�Ø—;‘;˜y¨™Ñ/×8×8ÙØ! 'Ñ*×.Ñ.¨w¸*À[Ç_Á_ÐDUÐ8VÓW�Ø×)Ñ)¨)°D©/Ó:�Ü! $¬
×(<Ñ(<×=Ñ=Ü# t¡hÐ.AÐ$BÓCÐCØ —}‘}Ð%8¸)¿-¹-È
Ó:SÓT�Ø×-Ñ-Ó/�Ü*×EÒEÀdÓK�ð —E—EØ¤ G£Ó,Ø™ qÑ)ØGóHð &-¡^°AÑ%6‘Nà'-¨e¨WÐ%5�Nð ˜WÑ%×)Ñ)¨'Ó2Ñ>Ø,0Ð)Ø(1°'Ñ(:¸7Ñ(CÑ%à—E—EØ¤ G£Ó,Ø™ q×)Ø™ qÑ)Ñ1à,0Ð)Ø(,Ñ%à,1Ð)Ø(,Ð%à Ñ-×4Ñ4à!&Ø*8Ø1FØ->Ø $à$/Ø,0¯J°B×+;Ñ+;Ø 8¸"ó,ñ(ð &*§_¡_Ó%6Ø)0ñ÷ñe '8ðH —j‘jˆGÜ�Ø!'¨Ô!5�IØ  ‘¨!¯%©%Õ/Ùñ "6ð %)�MÚØ  Ñ)¨&Ñ1�Ø—;‘;˜y¨™Ñ/×8×8ÙØ! 'Ñ*×.Ñ.¨w¸&ÀÇÁÀÐ8HÓI�Ø×)Ñ)¨)°D©/Ó:�Ü! $¬
×(<Ñ(<×=Ñ=Ü# t¡hÐ.AÐ$BÓCÐCØ —}‘}Ð%9¸9ÀZÑ;PÓQ�Ø×-Ñ-Ó/�Ü*×EÒEÀdÓK�Ø 	Ñ*×1Ñ1à!&Ø $à$/Ø+/¯8©8°MÀ2Ó+Fñ(ð &*§_¡_Ó%6ñ÷
ñ# ÷: !‘=ØAPÐ*Ñ+¨a°·±¨}Ð,=Ô>ñA $ðD ˆr…   c           	     ó®  • / nU HÇ  n[        U[        5      (       a  UOUS   n[        U[        5      (       a  UOUS   nU R                  U5      nUc\  U[         Vs/ s H&  n[        U[        5      (       a  UR
                  OUPM(     sn;   a  [        R                  nO[        SU S35      e[        Xv5      nUR                  U5        MÉ     U$ s  snf )Nr   ri   zCannot find Block with id: z) but is present as a target in the config)rr   r  rn   r    r3   r½  r%   r¢   r¯   rl   r§   )	r–  rÉ  r   Útarget_eventsrÈ  rÑ  r½  rU  Úevents	            r‚   r©  ÚBlocks.get_event_targets
  sà   € ð ˆÛˆFô #-¨V´S×"9Ñ"9™¸vÀa¹yˆIÜ$.¨v´s×$;Ñ$;™ÀÈÁˆJØ$×(Ñ(¨Ó3ˆEà‰}Øå!.ó"â!.˜ô )3°5¼-×(HÑ(H�E×$Ò$ÈeÒSÙ!.ñ"ó ô $×.Ñ.‘Eä$Ø5°i°[Ð@iÐjóð ô ˜EÓ.ˆEØ× Ñ  Ö'ñ% ð& Ðùò"s   Á-Cc                óv  • [        5       (       a  [        S5      eU(       aL  UR                  S5      n[        R                  " S5      nUR                  U5      (       d  [        SU S35      eU[        ;   a  [        SU S35      eUc!  [        U5      nU(       d  [        SU S35      eU[        ;   d"  X R                   Vs/ s H  oUS	   PM	     sn;   a5  S
U-   nU[        ;   a  M  X R                   Vs/ s H  oUS	   PM	     sn;   a  M5  U R                  R                  X!U45        X l
        U $ s  snf s  snf )a÷  
Adds a new page to the Blocks app.
Parameters:
    name: The name of the page as it appears in the nav bar.
    path: The URL suffix appended after your Gradio app's root URL to access this page (e.g. if path="/test", the page may be accessible e.g. at http://localhost:7860/test). If not provided, the path is generated from the name by converting to lowercase and replacing spaces with hyphens. Any leading or trailing forward slashes are stripped.
    show_in_navbar: If True, the page will appear in the navbar. If False, the page will be accessible via URL but not shown in the navbar.
Example:
    with gr.Blocks() as demo:
        name = gr.Textbox(label="Name")
        ...
    with demo.route("Test", "/test"):
        num = gr.Number()
        ...
zzYou cannot create a route while inside a Blocks() context. Call route() outside the Blocks() context (unindent this line).r‰  z#^[a-zA-Z0-9-._~!$&'()*+,;=:@\[\]]+$zPath 'z‡' contains invalid characters. Paths can only contain alphanumeric characters and the following special characters: -._~!$&'()*+,;=:@[]zRoute with path 'z' already existsz' is not validr   r	  )r'   r¯   rÀ  ÚreÚcompileÚmatchrF   rE   rê  r§   r£   )r�   rÆ   rý   Úshow_in_navbarÚvalid_path_regexr¤   s         r‚   ÚrouteÚBlocks.route$  s3  € ô$ ×ÑÜð Móð ö Ø—:‘:˜c“?ˆDÜ!ŸzšzÐ*PÓQÐØ#×)Ñ)¨$×/Ñ/Ü Ø˜T˜Fð  #jð  kóð ð ”?Ó"ÜÐ0°°Ð6FÐGÓHÐHØ‰<Ü˜4“=ˆDÞÜ Ð#4°T°F¸.Ð!IÓJÐJØ”oÓ%¨ÇjÂjÓ1QÂj¸d°q´'ÁjÑ1QÓ)QØ˜‘:ˆDð ”oÕ%¨ÇjÂjÓ1QÂj¸d°q´'ÁjÑ1QÕ)Qà�
‰
×Ñ˜4 ~Ð6Ô7Ø ÔØˆùò	 2RùÒ1Qs   ÃD1Ã6D6)dr¸   rL  rM  rO  rP  rN  rK  r™  r  rš  r§  r7  rk  rA  rh  rY  r  rb  r¹  r\  r•  rl  r­   rØ   r  r   r£   r=  rQ  r;  r^  rG  r1  r.  rý  r<  r[  r9  r:  rß  r€   r!  r"  rW  rè  rf  rê  r¢  rS  r¨  r-  r   rT  rà  r2  r/  r?  r~   r+  r[  r@  r›  r?  rg  r¤   rê  rw   r4  r3  re  ri  rë  rn  r>  rŠ  rm  r@  r¡  r�  rY  rZ  r0  r:  r;  r<  rU  r8  rZ  rj  r2  rz   rá  r¦   r  r"  rç  rd  rc  r_  rV  )r!  zlist[Blocks])Nr¡   rÞ  FFN)rA  r  r+  rs   rd  zstr | I18nDatar9  r  r:  r  r;  ztuple[int, int] | None)r!  údict[int, Component | Block])r_   r3  )r!  zdict[int, BlockFunction])rq   r  r!  úComponent | BlockContext)rØ   r,   rˆ  zlist[Callable]rf   rs   r!  r  )r¿  zCallable[..., Any]r!  ÚNone)r   )rÞ  r  r!  r  )rÞ  r  r¦  r  )NNNNFNN)rÐ  úBlockFunction | intr  ú	list[Any]rú  zAsyncIterator[Any] | Noner	  úRequest | list[Request] | Noneró  r  r
  úEventData | Nonerô  r  rå  úSessionState | Noner  úoauth.OAuthToken | None)rÞ  r  rÅ  r7  r!  r7  )rÞ  r  ri  r7  r!  r7  )rÐ  r   rÅ  r7  )rÐ  r   r`  r  rU  r]   r_   r   r?  r  r@  r[  r!  rs   )F)rÐ  r   rÅ  r7  rå  r:  ræ  r  )rÐ  r   rj  zAny | list[Any])rÐ  r   rj  úlist | dictrå  r:  r!  r7  )rú  r   r!  rs   )r�  r  rú  r   r!  r5  )r�  rs   r|  rs   r!  r5  )r�  rs   r|  rs   r�  r  r!  rs   )rU  zcomponents.StreamingOutputr—  rD   r•  rs   r!  r5  r�   )rÐ  r   r  rÓ   r�  r  r|  r  rm  r  r¥  r  r!  rÓ   )rÐ  r   r  rÓ   r�  r  r|  r  r¥  r  r®  r  r!  rÓ   )NNNNNNTFFNN)rÐ  r6  rÅ  r7  rå  r:  rä  r8  rú  zAsyncIterator | Noner�  r  ró  r  r
  r9  rô  r  r®  r  ræ  r  rm  r  r  r;  r!  r#  )rÐ  r   rå  r:  r!  ztuple[list[int], list])r!  r,   )r÷  r  r‡   rI  )r  NN)r  zfloat | Literal['auto']rY  r  r  r"  r  zint | None | Literal['not_set']©T)r2  r  r3  r  r!  r  )NFNFr  NNFFNN)br„  r  rÁ  r  r0  r  r\  r  r2  r  r\  zKCallable[[str, str], bool] | tuple[str, str] | list[tuple[str, str]] | Noner•  r  rÂ  r  r8  r  rY  r  rZ  r"  rW  r  rV  z	int | strr[  r%  r6  r  r7  r  r8  r  rj  r  r÷  r  rß  zJlist[Literal['api', 'gradio', 'settings', 'runs'] | dict[str, str]] | Noner@  r  rk  r$  rl  r$  rm  r  r9  zdict[str, Any] | Nonerz   r  r:  r  r;  zLiteral['http', 'https'] | Noner<  r  r=  zFCallable[[fastapi.Request], str | None | Awaitable[str | None]] | Nonerà  zstr | int | NonerG  r  r>  r  r?  r  r@  r"  r2  r  r>  r  r?  r  rA  r"  rB  z
App | NonerC  r  rD  zI18n | Noner  zTheme | str | Noner  r  r   ú(str | Path | Sequence[str | Path] | Noner¨  r  r!  r  r"  r>  r!  ztuple[App, str, str]rF  )ræ  úModuleType | Nonerç  r?  r!  r5  )
ru  r"  r6  r  r7  r  r8  r  r!  r  )r!  r5  )rù  r  r!  r5  )r  r  r!  r+   )r–  zdict[int, Block]rÉ  rÓ   r   rs   r!  rÓ   r0  )rÆ   rs   rý   r  r/  r  r!  r  )Hr¸   r  r&  r'  Ú__doc__r5  ÚWeakSetr  Ú__annotations__r)  r  rƒ   r(  r¡   Úsetterrˆ  r~  r„  r³  r·  r¶  rÄ  r  rb   rß  rð  r  rç  rê  r0  r  rJ  rb  rg  rv  r}  r‚  r€  rŽ  r‹  rŠ  r†  rª  r²  ré  r¿  rÖ  rÒ   rð  rú  r9  rG  r  r   r±  r  r  r,  r4  r  r  r©  r¨  r{  rÀ  r  r  r%  r©  r1  r*  Ú__classcell__)r¶   s   @r‚   r  r    sŸ	  ø‡ ñ ðF ")§¢Ó!2€IˆÓ2àó&ó ð&ð *.ØØ (Ø!Ø Ø/3ðDà&ðDð ðDð ð	Dð
 ðDð ðDð -÷Dð DðL ó*ó ð*ð ‡]�]ó+ó ð+ð ó'ó ð'ôð ñ?ó ð?ð
 ðuà ðuð ðuð ð	uð
 
óuó ðuònòð" ñ
ó ð
ô"
òH@öDGð 12È$÷ 0!ðl /3Ø37Ø#Ø'+Ø"'Ø%)Ø/3ðh
à%ðh
ð #ðh
ð ,ð	h
ð
 1ðh
ð ðh
ð %ðh
ð  ðh
ð #ðh
ð -õh
ôTô6ô" ðD ð1
Øð1
àð1
ð ð1
ð ð	1
ð
 ð1
ð "ð1
ð 
ó1
ó ð1
ðp $ðPàðPð ðPð #ð	Pð
 õPôd+ðZRàðRð !ðRð #ð	Rð
 
ôRôhô*ô/ð
.Ø&ð.Ø25ð.à	ô.ð4 óAó ðAð ð	 Ø)ð	 Ø3>ð	 ØKNð	 à	ó	 ó ð	 ô8ð !%ØðCàðCð ðCð !ð	Cð
 ðCð ðCð ðCð 
õCðX $ð$àð$ð ð$ð !ð	$ð
 ð$ð ð$ð ð$ð 
õ$ðT &*Ø26Ø)-Ø#'Ø#Ø'+Ø"&Ø#Ø#Ø $Ø/3ðEà%ðEð ðEð #ð	Eð
 0ðEð 'ðEð !ðEð ðEð %ðEð  ðEð ðEð ðEð ðEð -ðEð 
õEðN1Ø%ð1Ø.Að1à	ô1ò"
ò"ô8ötDò0÷ñ ò,ñ ƒZð 7=Ø $Ø#ð	'ð FOñ'à3ð'ð ð'ð ð	'ð $Cõ'ó ð'òR
ò-ò5ð& FJð
Ø#ð
Ø>Bð
à	õ
ð" #ØØ!ØØð Ø#'Ø$)Ø Ø"&Ø"&ð[Oð  Ø!Ø*.Ø"&Ø#'Ø+/ØØð Ø#'Ø*.Ø*.Ø $Ø,0Ø&+Ø+/ØAEØ37àØ*.Ø)-Ø Ø'+Ø $Ø $ØØ"&Ø"&ØØØ Ø$(ØØ>BØ)-ØØ?Cñq[Oàð[Oð ð[Oð ð	[Oð
 ð[Oð ð[Oð Xð[Oð !ð[Oð "ð[Oð ð[Oð  ð[Oð  ð[Oð  ð![Oð" ð#[Oð$ (ð%[Oð&  ð'[Oð( !ð)[Oð* )ð+[Oð, ð-[Oð. ð/[Oð0ð1[Oð8 !ð9[Oð: (ð;[Oð< (ð=[Oð> ð?[Oð@ *ðA[OðB !$ðC[OðD )ðE[OðF  ?ðG[OðH '1ðI[OðJðK[OðN (ðO[OðP 'ðQ[OðR ðS[OðT %ðU[OðV ðW[OðX ðY[OðZ ð[[Oð\  ð][Oð^  ð_[Oð` ða[Oðb ðc[Oðd ðe[Oðf "ðg[Oðh ði[Oðj <ðk[Oðl 'ðm[Oðn ðo[Oðp =ðq[Oðr 
ös[Oð~ Ø#'Ø$(ð	;2ð !ð;2ð "ð	;2ð
 
õ;2ð@ #'Ø#'Ø+/ðJàðJð  ðJð !ð	Jð
 )ðJð 
õJôX
)öð8à	ôòò"öKðZ ðØ*ðØ6:ðØEHðà	óó ðñ2 ƒZàIMð'Øð'Ø)ð'ØBFð'à	ô'ó ö'r…   r  )Ú	metaclassr=  )rU  r4  rV  r  r  r  )ri  zSequence[Block]rj  r  r!  r<  )éd   )r|  rs   r}  r  r~  r  r!  r  )r|  rs   r  r  r!  r  )—Ú
__future__r   rò  rÏ   r  rË   r·  rE  r`  r,  rt   rÂ  r½  rB  rü  ry  rH  r5  r³  Úcollectionsr   Úcollections.abcr   r   r   r   r	   r
   Úpathlibr   r˜  r   r   Útypingr   r   r   r   r   Úurllib.parser   r   r   ÚfastapirŠ  r   Úgradio_clientr   rì   Úgradio_client.documentationr   Úgroovyr   rP  r   r   r   r   r   r   Úgradio.block_functionr   Úgradio.blocks_eventsr    r!   r"   Úgradio.cachingr#   r$   Úgradio.contextr%   r&   r'   r(   r)   Úgradio.data_classesr*   r+   r,   r-   r.   r/   r0   r1   Úgradio.eventsr2   r3   r4   Úgradio.exceptionsr5   r6   r7   r8   r9   r:   r;   r<   Úgradio.helpersr=   r>   r?   Úgradio.i18nr@   rA   Úgradio.node_serverrB   Úgradio.route_utilsrC   rD   rE   r’  rF   rG   rH   rI   Úgradio.state_holderrJ   rK   Úgradio.themesrL   ÚThemeÚgradio.tunnelingrM   rN   rO   rP   rQ   Úgradio.utilsrR   rS   rT   rU   rV   rW   rX   Úspacesr[  Úgradio.components.baserY   Ú
gradio.mcprZ   Úgradio.renderabler[   r]   r,  r[  ro  r�  r„  r†  r  rŽ   r…   r‚   Ú<module>re     sÃ  ðÝ "ã Û Û Û Û Û 	Û Û 	Û Û Û 
Û Û Û Û Û Û Ý #ß X× XÝ ß -ß ;Õ ;ß -ã Û Û Ý !Ý /Ý 0Ý ÷÷ ñ õ 0ß HÑ Hß C÷õ ÷	÷ 	ó 	÷ñ ÷
	÷ 	ó 	÷ >Ñ =ß &Ý 0ß ?Ñ ?ß @Ó @ß 9Ý -÷õ ÷÷ ñ ðÛö
 Ý0Ý*Ý,÷]ñ ]ô@U)�5ô U)ðr MQð!Ø#ð!Ø26ð!ØEIõ!ðH%Øð%Ø+/ð%àô%öPXô ÷A8ñ A8ñH 
ˆ(�G˜[¨&°(Ó;ôw,ˆ\˜<°:ñ w,ó <ñw,øðY ó Ø‚Fðús   Å0G+ Ç+G6Ç5G6