o
    º¼tfÀ  ã                   @   st   d Z ddlmZmZmZmZ ddlZddlZddlm	Z	m
Z
 ddlmZ ddlT dd	„ Zdd
d„Zdd„ Zeƒ  dS )aâ  Interactive widgets for the Jupyter notebook.

Provide simple interactive controls in the notebook.
Each Widget corresponds to an object in Python and Javascript,
with controls on the page.

To put a Widget on the page, you can display it with Jupyter's display machinery::

    from ipywidgets import IntSlider
    slider = IntSlider(min=1, max=10)
    display(slider)

Moving the slider will change the value. Most Widgets have a current value,
accessible as a `value` attribute.
é   )Ú__version__Ú__protocol_version__Ú$__jupyter_widgets_controls_version__Ú __jupyter_widgets_base_version__é    N)ÚlinkÚdlink)Úget_ipython)Ú*c                 C   s   t | dƒsdS tƒ  dS )z#Set up Jupyter to work with widgetsÚkernelN)ÚhasattrÚregister_comm_target©Úip© r   ú\/var/www/html/software/conda/envs/catlas/lib/python3.10/site-packages/ipywidgets/__init__.pyÚload_ipython_extension    s   

r   c                 C   s@   ddl m} | ¡ }|du rdS | dtj¡ | dtj¡ dS )z'Register the jupyter.widget comm targetr   )ÚcommNzjupyter.widgetzjupyter.widget.control)Ú r   Zget_comm_managerZregister_targetZWidgetZhandle_comm_openedZhandle_control_comm_opened)r   r   Zcomm_managerr   r   r   r   &   s   r   c                  C   s   t ƒ } | du r	dS tƒ  dS )z=Register with the comm target at import if running in JupyterN)r	   r   r   r   r   r   Ú_handle_ipython/   s   
r   )N)Ú__doc__Ú_versionr   r   r   r   ÚosÚsysZ	traitletsr   r   ZIPythonr	   Zwidgetsr   r   r   r   r   r   r   Ú<module>   s   
	
