o
    ٷiu                     @  s`   d Z ddlmZ ddlmZ ddlmZ ddlmZ ddl	m
Z
 er#	 e G dd deZd	S )
zgr.Timer() component.    )annotations)TYPE_CHECKING)document)	Component)Eventsc                      sn   e Zd ZdZejgZ	ddddd fd
dZdddZdddZ	d ddZ
dd Zdd Zd!ddZ  ZS )"Timerz
    Special component that ticks at regular intervals when active. It is not visible, and only used to trigger events at a regular interval through the `tick` event listener.
       T)activerendervaluefloatr	   boolr
   c                  s   || _ t j||d dS )aD  
        Parameters:
            value: Interval in seconds between each tick.
            active: Whether the timer is active.
            render: If False, component will not render be rendered in the Blocks context. Should be used if the intention is to assign event listeners now but render the component later.
        )r   r
   N)r	   super__init__)selfr   r	   r
   	__class__ K/home/ubuntu/.local/lib/python3.10/site-packages/gradio/components/timer.pyr      s   zTimer.__init__payloadfloat | Nonereturnc                 C     |S )z
        Parameters:
            payload: The interval of the timer as a float or None.
        Returns:
            The interval of the timer as a float.
        r   )r   r   r   r   r   
preprocess*      zTimer.preprocessc                 C  r   )z
        Parameters:
            value: The interval of the timer as a float or None.
        Returns:
            The interval of the timer as a float.
        r   )r   r   r   r   r   postprocess3   r   zTimer.postprocessdictc                 C  s   ddiS )Ntypenumberr   r   r   r   r   api_info<   s   zTimer.api_infoc                 C     dS Nr   r   r   r   r   r   example_payload?      zTimer.example_payloadc                 C  r!   r"   r   r   r   r   r   example_valueB   r$   zTimer.example_valuec                 C  r!   )z:Timer components should not break wrapper grouping chains.Fr   r   r   r   r   breaks_groupingE   s   zTimer.breaks_grouping)r   )r   r   r	   r   r
   r   )r   r   r   r   )r   r   r   r   )r   r   )r   r   )__name__
__module____qualname____doc__r   tickEVENTSr   r   r   r    r#   r%   r&   __classcell__r   r   r   r   r      s    

	
	r   N)r*   
__future__r   typingr   gradio_client.documentationr   gradio.components.baser   gradio.eventsr   r   r   r   r   r   <module>   s    