
    YHh/
                        U d dl mZ d dlZd dlmZ d dlmZ d dlmZm	Z	 d dl
mZ d dlmZmZ d dlmZ  ee      Zdad	ed
<    G d d      Z	 d	 	 	 	 	 	 	 ddZddZ	 d	 	 	 	 	 	 	 	 	 ddZddZy)    )annotationsN)	getLoggerexc_info)AnyNoReturn)BackendType)SUPPORTED_BACKENDSall_implementations)RootComponentConstructorzBackendType[Any] | None_DEFAULT_IMPLEMENTATIONc                      e Zd ZdZddZy)OptionszConfiguration options that can be provided to the backend.
    This definition should not be used/instantiated. It exists only for
    type hinting purposes.c                    d}t        |      )Nz&Default implementation has no options.)
ValueError)selfargskwdsmsgs       P/var/www/html/planif/env/lib/python3.12/site-packages/reactpy/backend/default.py__init__zOptions.__init__   s    6o    N)r   r   r   r   returnr   )__name__
__module____qualname____doc__r    r   r   r   r      s    r   r   c                T    |d}t        |      t               j                  | |      S )z?Configure the given app instance to display the given componentz8Default implementation cannot be configured with options)r   _default_implementation	configure)app	componentoptionsr   s       r   r!   r!      s/     Ho"$..sI>>r   c                 2    t               j                         S )z7Create an application instance for development purposes)r    create_development_appr   r   r   r&   r&   '   s    "$;;==r   c                V   K   t               j                  | |||       d{   S 7 w)z-Run an application using a development serverN)r    serve_development_app)r"   hostportstarteds       r   r(   r(   -   s1      )*@@T4   s    )')c                     t         t         S 	 t        t                     } | a | S # t        $ rG t        j                  dt                      dj                  t              }d| d}t        |      dw xY w)z-Get the first available server implementationNz$Backend implementation import failedr   z, zIt seems you haven't installed a backend. To resolve this issue, you can install a backend by running:

[1mpip install "reactpy[starlette]"[0m

Other supported backends include: .)
r   nextr   StopIterationloggerdebugr   joinr
   RuntimeError)implementationsupported_backendsr   s      r   r    r    9   s     *&&134 #1  	*;hjQ!YY'9:1 2D0DAG 	 3T)	*s
   % AA5)N)r"   r   r#   r   r$   Noner   r6   )r   r   )
r"   r   r)   strr*   intr+   zasyncio.Event | Noner   r6   )r   zBackendType[Any])
__future__r   asynciologgingr   sysr   typingr   r   reactpy.backend.typesr	   reactpy.backend.utilsr
   r   reactpy.typesr   r   r0   r   __annotations__r   r!   r&   r(   r    r   r   r   <module>rB      s    "      - I 2	8	37 0 7  DH?	?1?<@?	?> %)				
	 	 "		
 
	r   