
    hMh)`                        d 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
 ddlmZ ddlmZ dd	lmZmZ dd
lmZmZ ddlmZ ddlmZ ddlmZmZmZmZmZmZm Z m!Z!m"Z"m#Z#m$Z$ i Z%de%d<   de%d<   de%d<   d Z&d Z'd fdZ( G d dee
e          Z) G d dee
e          Z*e G d dee                      Z+e ee%           G d de)                                  Z,e ee%           G d  d!e)                                  Z-e ee%           G d" d#e)                                  Z.e ee%           G d$ d%e)                                  Z/e ee%           G d& d'e*                                  Z0 G d( d)e)          Z1 G d* d+e*          Z2e ee%           G d, d-e1                                  Z3e ee%           G d. d/e2                                  Z4d0S )1z>Selection classes.

Represents an enumeration using a widget.
    )IterableMapping)chain   )DescriptionWidgetDescriptionStyle)ValueWidget)
CoreWidget)Style)InstanceDict
TypedTuple)registerwidget_serialization)SliderStyle)	doc_subst)UnicodeBoolIntAnyDict
TraitErrorCaselessStrEnumTupleUnionobservevalidateaT  
    options: list
        The options for the dropdown. This can either be a list of values, e.g.
        ``['Galileo', 'Brahe', 'Hubble']`` or ``[0, 1, 2]``, a list of
        (label, value) pairs, e.g.
        ``[('Galileo', 0), ('Brahe', 1), ('Hubble', 2)]``, or a Mapping between
        labels and values, e.g., ``{'Galileo': 0, 'Brahe': 1, 'Hubble': 2}``.

    index: int
        The index of the current selection.

    value: any
        The value of the current selection. When programmatically setting the
        value, a reverse lookup is performed among the options to check that
        the value is valid. The reverse lookup uses the equality operator by
        default, but another predicate may be provided via the ``equals``
        keyword argument. For example, when dealing with numpy arrays, one may
        set ``equals=np.array_equal``.

    label: str
        The label corresponding to the selected value.

    disabled: bool
        Whether to disable user changes.

    description: str
        Label for this input group. This should be a string
        describing the widget.
selection_paramsa  
    options: dict or list
        The options for the dropdown. This can either be a list of values, e.g.
        ``['Galileo', 'Brahe', 'Hubble']`` or ``[0, 1, 2]``, or a list of
        (label, value) pairs, e.g.
        ``[('Galileo', 0), ('Brahe', 1), ('Hubble', 2)]``, or a Mapping between
        labels and values, e.g., ``{'Galileo': 0, 'Brahe': 1, 'Hubble': 2}``.
        The labels are the strings that will be displayed in the UI,
        representing the actual Python choices, and should be unique.

    index: iterable of int
        The indices of the options that are selected.

    value: iterable
        The values that are selected. When programmatically setting the
        value, a reverse lookup is performed among the options to check that
        the value is valid. The reverse lookup uses the equality operator by
        default, but another predicate may be provided via the ``equals``
        keyword argument. For example, when dealing with numpy arrays, one may
        set ``equals=np.array_equal``.

    label: iterable of str
        The labels corresponding to the selected value.

    disabled: bool
        Whether to disable user changes.

    description: str
        Label for this input group. This should be a string
        describing the widget.
multiple_selection_paramsa  
    orientation: str
        Either ``'horizontal'`` or ``'vertical'``. Defaults to ``horizontal``.

    readout: bool
        Display the current label next to the slider. Defaults to ``True``.

    continuous_update: bool
        If ``True``, update the value of the widget continuously as the user
        holds the slider. Otherwise, the model is only updated after the
        user has released the slider. Defaults to ``True``.
slider_paramsc                 x    t          | t                    r$t          | t                    st          |           S | S )z-Exhaust any non-mapping iterable into a tuple)
isinstancer   r   tuple)xs    c/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/ipywidgets/widgets/widget_selection.py_exhaust_iterabler%   d   s5    !X z!W'='= QxxH    c                    t          | t                    r|                                 } t          |           }t	          d |D                       rt          d |D                       S t          d |D                       S )a)  Standardize the options tuple format.

    The returned tuple should be in the format (('label', value), ('label', value), ...).

    The input can be
    * an iterable of (label, value) pairs
    * an iterable of values, and labels will be generated
    * a Mapping between labels and values
    c              3   t   K   | ]3}t          |t          t          f          ot          |          d k    V  4dS )   N)r!   listr"   len.0is     r$   	<genexpr>z _make_options.<locals>.<genexpr>|   s?      
I
IaJq4-((8SVVq[
I
I
I
I
I
Ir&   c              3   >   K   | ]\  }}t          |          |fV  d S Nstr)r-   kvs      r$   r/   z _make_options.<locals>.<genexpr>}   s0      33TQc!ffa[333333r&   c              3   8   K   | ]}t          |          |fV  d S r1   r2   r,   s     r$   r/   z _make_options.<locals>.<genexpr>   s,      ,,#a&&!,,,,,,r&   )r!   r   itemsr"   all)r#   xlists     r$   _make_optionsr:   k   s     !W GGII !HHE 
I
I5
I
I
III 433U333333 ,,e,,,,,,r&   c                     | |k    S r1    r#   ys     r$   <lambda>r?      s
    16 r&   c                     	 t          fd| D                       S # t          $ r t          dz            w xY w)zJA function that uses the compare function to return a value from the list.c              3   4   K   | ]} |          |V  d S r1   r<   )r-   r#   comparevalues     r$   r/   zfindvalue.<locals>.<genexpr>   s4      ::!5(9(9:A::::::r&   z%r not in array)nextStopIteration
ValueError)arrayrC   rB   s    ``r$   	findvaluerH      s^    2:::::u:::::: 2 2 2*501112s     =c                       e Zd ZdZ eddd          Z eddd          Z eddd          	                    d          Z
 ed	d
          ZdZ e e            dd          	                    d          Z ed          	                    d          Z fdZ ed          d             Z ed          d             Z ed          d             Z ed          d             Z ed          d             Z ed          d             Z ed          d             Z ed          d             Z fdZ xZS )
_Selectiona  Base class for Selection widgets

    ``options`` can be specified as a list of values or a list of (label, value)
    tuples. The labels are the strings that will be displayed in the UI,
    representing the actual Python choices, and should be unique.
    If labels are not specified, they are generated from the values.

    When programmatically setting the value, a reverse lookup is performed
    among the options to check that the value is valid. The reverse lookup uses
    the equality operator by default, but another predicate may be provided via
    the ``equals`` keyword argument. For example, when dealing with numpy arrays,
    one may set equals=np.array_equal.
    NSelected valueT)help
allow_noneSelected labelSelected indexsyncr<   Iterable of values, (label, value) pairs, or Mapping between labels and values that the user can select.

    The labels are the strings that will be displayed in the UI, representing the
    actual Python choices, and should be unique.
    rL   The labels for the options.trait	read_onlyrL   Enable or disable user changesc                    |                     dd           | _        d| _        t          |                    dd                    |d<   t          |d                   | _        |                     d            d|vr@d|vr<d|vr8| j        }t          |          d	k    }|rd	nd |d<   |r|d	         nd
\  |d<   |d<    t                      j
        |i | d| _        d S )Nequalsc                     | |k    S r1   r<   r=   s     r$   r?   z%_Selection.__init__.<locals>.<lambda>   
    Q r&   Toptionsr<   indexrC   labelr   )NNF)poprZ   _initializing_traits_r%   getr:   _options_full_propagate_optionsr+   super__init__)selfargskwargsr]   nonempty	__class__s        r$   rf   z_Selection.__init__   s   jj+>+>?? &*"-fjjB.G.GHHy*6)+<==%%% &  WF%:%:wf?T?T(GGq(H#+5aaF7O=E/Wwqzz<,F7OVG_$)&)))%*"""r&   r]   c                 t    t          |j                  |_        t          |j                  | _        |j        S r1   r%   rC   r:   rc   rg   proposals     r$   _validate_optionsz_Selection._validate_options   s/     +8>::*8>::~r&   c                 `   | j         }|                     dt          d |D                                  t          d |D                       | _        | j        dS | j        durIt          |          dk    r-| j        dk    r|                     ddd           dS d| _        dS d| _        dS dS )zPSet the values and labels, and select the first option if we aren't initializing_options_labelsc              3   &   K   | ]}|d          V  dS r   Nr<   r,   s     r$   r/   z0_Selection._propagate_options.<locals>.<genexpr>   &      /F/F!/F/F/F/F/F/Fr&   c              3   &   K   | ]}|d          V  dS r   Nr<   r,   s     r$   r/   z0_Selection._propagate_options.<locals>.<genexpr>   &      $;$;aQqT$;$;$;$;$;$;r&   NTr   r^   )rc   	set_traitr"   _options_valuesr^   ra   r+   _notify_traitrg   changer]   s      r$   rd   z_Selection._propagate_options   s     $(%/F/Fg/F/F/F*F*FGGG$$;$;7$;$;$;;;: F%T117||a:?? &&w155555!"DJJJ!


 21r&   r^   c                     |j         'd|j         cxk    rt          | j                  k     r
n n|j         S t          d          Nr   &Invalid selection: index out of boundsrC   r+   rr   r   rn   s     r$   _validate_indexz_Selection._validate_index   sO    >!Q(.%T%T%T%T3t?S;T;T%T%T%T%T%T>!EFFFr&   c                     |j         | j        |j                  nd}|j         | j        |j                  nd}| j        |ur|| _        | j        |ur	|| _        dS dS )<Propagate changes in index to the value and label propertiesN)newrr   rz   r_   rC   rg   r}   r_   rC   s       r$   _propagate_indexz_Selection._propagate_index   sp     5;J4J$VZ00PT4:J4J$VZ00PT:U""DJ:U""DJJJ #"r&   rC   c                     |j         }	 |t          | j        || j                  nd S # t          $ r t          d          w xY w)N"Invalid selection: value not found)rC   rH   rz   rZ   rF   r   )rg   ro   rC   s      r$   _validate_valuez_Selection._validate_value   s_    	CJOJ[9T15$+FFFaee 	C 	C 	CABBB	Cs	   ( Ac                     |j         d }nY| j        3|                     | j        | j                 |j                   r| j        }n| j                            |j                   }| j        |k    r	|| _        d S d S r1   )r   r^   rZ   rz   rg   r}   r^   s      r$   _propagate_valuez_Selection._propagate_value   s{    :EEZ#D4H4TV\V`(a(a#JEE(..vz::E:DJJJ r&   r_   c                 X    |j         |j         | j        vrt          d          |j         S )N"Invalid selection: label not found)rC   rr   r   rn   s     r$   _validate_labelz_Selection._validate_label  s0    N&X^4CW-W-WABBB~r&   c                     |j         d }nI| j        #| j        | j                 |j         k    r| j        }n| j                            |j                   }| j        |k    r	|| _        d S d S r1   )r   r^   rr   r   s      r$   _propagate_labelz_Selection._propagate_label  sp    :EEZ#(<TZ(HFJ(V(VJEE(..vz::E:DJJJ r&   c              #      K   t                                                      }t          t          |d                    D ]}|dk    r| j        dk    r|V  d S )Nr]   r^   r   )re   
_repr_keyssortedr   r^   )rg   keyskeyrk   s      r$   r   z_Selection._repr_keys  sh      ww!!##%l3344 	 	Cg~~$*//IIII		 	r&   )__name__
__module____qualname____doc__r   rC   r   r_   r   tagr^   r]   rc   r   rr   r   disabledrf   r   rp   r   rd   r   r   r   r   r   r   r   __classcell__rk   s   @r$   rJ   rJ      sb         C+===EGD/DAAAEC+===AAtALLEc"
	 	 	G M !jwwyyDGdeeeiiosittOt9:::>>D>IIH+ + + + +& Xi   WY" " ". XgG G G WW   XgC C C WW   Xg  
 WW          r&   rJ   c                       e Zd ZdZ e e            d          Z e e            d          Z e e	            d          
                    d          Z edd	
          ZdZ e e            dd          
                    d          Z ed
          
                    d          Z fdZ ed          d             Z ed          d             Z ed          d             Z ed          d             Z ed          d             Z ed          d             Z ed          d             Z ed          d             Z fdZ xZS )_MultipleSelectiona  Base class for multiple Selection widgets

    ``options`` can be specified as a list of values, list of (label, value)
    tuples, or a dict of {label: value}. The labels are the strings that will be
    displayed in the UI, representing the actual Python choices, and should be
    unique. If labels are not specified, they are generated from the values.

    When programmatically setting the value, a reverse lookup is performed
    among the options to check that the value is valid. The reverse lookup uses
    the equality operator by default, but another predicate may be provided via
    the ``equals`` keyword argument. For example, when dealing with numpy arrays,
    one may set equals=np.array_equal.
    zSelected values)rV   rL   zSelected labelszSelected indicesTrP   r<   rR   rS   NrT   rU   rX   c                 8   |                     dd           | _        d| _        t          |                    dd                    |d<   t          |d                   | _        |                     d             t                      j	        |i | d| _        d S )NrZ   c                     | |k    S r1   r<   r=   s     r$   r?   z-_MultipleSelection.__init__.<locals>.<lambda>=  r\   r&   Tr]   r<   F)
r`   rZ   ra   r%   rb   r:   rc   rd   re   rf   rg   rh   ri   rk   s      r$   rf   z_MultipleSelection.__init__<  s    jj+>+>?? &*"-fjjB.G.GHHy*6)+<==%%%$)&)))%*"""r&   r]   c                 t    t          |j                  |_        t          |j                  | _        |j        S r1   rm   rn   s     r$   rp   z$_MultipleSelection._validate_optionsI  s-    *8>::*8>::~r&   c                     | j         }|                     dt          d |D                                  t          d |D                       | _        | j        dur	d| _        dS dS )zUnselect any optionrr   c              3   &   K   | ]}|d          V  dS rt   r<   r,   s     r$   r/   z8_MultipleSelection._propagate_options.<locals>.<genexpr>T  ru   r&   c              3   &   K   | ]}|d          V  dS rw   r<   r,   s     r$   r/   z8_MultipleSelection._propagate_options.<locals>.<genexpr>U  rx   r&   Tr<   Nrc   ry   r"   rz   ra   r^   r|   s      r$   rd   z%_MultipleSelection._propagate_optionsP  sx     $(%/F/Fg/F/F/F*F*FGGG$$;$;7$;$;$;;;%T11DJJJ 21r&   r^   c                 p     t           fd|j        D                       r|j        S t          d          )z'Check the range of each proposed index.c              3   \   K   | ]&}d |cxk    ot          j                  k     nc V  'dS rt   r+   rr   r-   r.   rg   s     r$   r/   z5_MultipleSelection._validate_index.<locals>.<genexpr>\  J      JJaqA1111D0111111JJJJJJr&   r   )r8   rC   r   rn   s   ` r$   r   z"_MultipleSelection._validate_indexY  sD     JJJJ8>JJJJJ 	G>!EFFFr&   c                      t           fd|j        D                       }t           fd|j        D                       } j        |k    r| _         j        |k    r	| _        dS dS )r   c              3   2   K   | ]}j         |         V  d S r1   rr   r   s     r$   r/   z6_MultipleSelection._propagate_index.<locals>.<genexpr>d  +      BB!d*1-BBBBBBr&   c              3   2   K   | ]}j         |         V  d S r1   )rz   r   s     r$   r/   z6_MultipleSelection._propagate_index.<locals>.<genexpr>e  r   r&   N)r"   r   r_   rC   r   s   `   r$   r   z#_MultipleSelection._propagate_indexa  s     BBBBvzBBBBBBBBBvzBBBBB:DJ:DJJJ r&   rC   c                      	 t           fd|j        D                       S # t          $ r t          d          w xY w)z>Replace all values with the actual objects in the options listc              3   N   K   | ]}t          j        |j                  V   d S r1   )rH   rz   rZ   r   s     r$   r/   z5_MultipleSelection._validate_value.<locals>.<genexpr>p  s4      aaQ4#7DKHHaaaaaar&   r   )r"   rC   rF   r   rn   s   ` r$   r   z"_MultipleSelection._validate_valuel  s^    	CaaaaRZR`aaaaaa 	C 	C 	CABBB	Cs   # =c                 p     t           fd|j        D                       } j        |k    r	| _        d S d S )Nc              3   L   K   | ]}j                             |          V  d S r1   )rz   r^   r   s     r$   r/   z6_MultipleSelection._propagate_value.<locals>.<genexpr>v  4      HHd*0033HHHHHHr&   r"   r   r^   r   s   `  r$   r   z#_MultipleSelection._propagate_valuet  G    HHHHVZHHHHH:DJJJ r&   r_   c                 p     t           fd|j        D                       rt          d          |j        S )Nc              3   *   K   | ]}|j         vV  d S r1   r   r   s     r$   r/   z5_MultipleSelection._validate_label.<locals>.<genexpr>|  s+      EEq,,EEEEEEr&   r   )anyrC   r   rn   s   ` r$   r   z"_MultipleSelection._validate_labelz  sB    EEEEhnEEEEE 	CABBB~r&   c                 p     t           fd|j        D                       } j        |k    r	| _        d S d S )Nc              3   L   K   | ]}j                             |          V  d S r1   )rr   r^   r   s     r$   r/   z6_MultipleSelection._propagate_label.<locals>.<genexpr>  r   r&   r   r   s   `  r$   r   z#_MultipleSelection._propagate_label  r   r&   c              #      K   t                                                      }t          t          |d                    E d {V  d S )Nr   )re   r   r   r   )rg   r   rk   s     r$   r   z_MultipleSelection._repr_keys  sL      ww!!##%l3344444444444r&   )r   r   r   r   r   r   rC   r   r_   r   r   r^   r]   rc   rr   r   r   rf   r   rp   r   rd   r   r   r   r   r   r   r   r   r   s   @r$   r   r     sn         JSSUU):;;;EJWWYY->???EJSSUU);<<<@@d@KKEc"
	 	 	G M !jwwyyDGdeeeiiosittOt9:::>>D>IIH+ + + + + Xi   WY   XgG G G WW   XgC C C WW  
 Xg  
 WW  
5 5 5 5 5 5 5 5 5r&   r   c                       e Zd ZdZ ed                              d          Z ed                              d          Z ed                              d          ZdS )	ToggleButtonsStyleaD  Button style widget.

    Parameters
    ----------
    button_width: str
        The width of each button. This should be a valid CSS
        width, e.g. '10px' or '5em'.

    font_weight: str
        The text font weight of each button, This should be a valid CSS font
        weight unit, for example 'bold' or '600'
    ToggleButtonsStyleModelTrP   zThe width of each button.rS   z Text font weight of each button.N)	r   r   r   r   r   r   _model_namebutton_widthfont_weightr<   r&   r$   r   r     s          '34488d8CCK7 ;<<<@@d@KKL'ABBBFFDFQQKKKr&   r   c                      e Zd ZdZ ed                              d          Z ed                              d          Z e e            d                              d          Z	 e e            d                              d          Z
  ee          j        dd	dieZ eg d
ddd                              d          ZdS )ToggleButtonsa  Group of toggle buttons that represent an enumeration.

    Only one toggle button can be toggled at any point in time.

    Parameters
    ----------
    {selection_params}

    tooltips: list
        Tooltip for each button. If specified, must be the
        same length as `options`.

    icons: list
        Icons to show on the buttons. This must be the name
        of a font-awesome icon. See `http://fontawesome.io/icons/`
        for a list of icons.

    button_style: str
        One of 'primary', 'success', 'info', 'warning' or
        'danger'. Applies a predefined style to every button.

    style: ToggleButtonsStyle
        Style parameters for the buttons.
    ToggleButtonsViewTrP   ToggleButtonsModelzTooltips for each button.rS   zGIcons names for each button (FontAwesome names without the fa- prefix).rQ   )primarysuccessinfowarningdanger r   z)Use a predefined styling for the buttons.)valuesdefault_valuerM   rL   Nr<   )r   r   r   r   r   r   
_view_namer   r   tooltipsiconsr   r   r   styler   button_styler<   r&   r$   r   r     s$        0 ,--11t1<<J'.//333>>Kz''))*EFFFJJPTJUUHJwwyy'pqqquu{u  A  AE0LL+,,0SSdS>RSSE"?FFFT0_a a aadadjnadaoao LLr&   r   c                       e Zd ZdZ ed                              d          Z ed                              d          ZdS )DropdownznAllows you to select a single item from a dropdown.

    Parameters
    ----------
    {selection_params}
    DropdownViewTrP   DropdownModelN)r   r   r   r   r   r   r   r   r<   r&   r$   r   r     sZ          ((,,$,77J'/**..D.99KKKr&   r   c                       e Zd ZdZ ed                              d          Z ed                              d          Z eddgdd	                              d          Z	d
S )RadioButtonszGroup of radio buttons that represent an enumeration.

    Only one radio button can be toggled at any point in time.

    Parameters
    ----------
    {selection_params}
    RadioButtonsViewTrP   RadioButtonsModel
horizontalverticalVertical or horizontal.r   r   rL   N)
r   r   r   r   r   r   r   r   r   orientationr<   r&   r$   r   r     s          +,,00d0;;J'-..222==K!/j)&( ( ((+ KKr&   r   c                       e Zd ZdZ ed                              d          Z ed                              d          Z edd                              d          Z	d	S )
Selectz
    Listbox that only allows one item to be selected at any given time.

    Parameters
    ----------
    {selection_params}

    rows: int
        The number of rows to display in the widget.
    
SelectViewTrP   SelectModel   The number of rows to display.rS   N
r   r   r   r   r   r   r   r   r   rowsr<   r&   r$   r   r     s        	 	 &&***55J'-((,,$,77K3q7888<<$<GGDDDr&   r   c                       e Zd ZdZ ed                              d          Z ed                              d          Z edd                              d          Z	d	S )
SelectMultiplea  
    Listbox that allows many items to be selected at any given time.

    The ``value``, ``label`` and ``index`` attributes are all iterables.

    Parameters
    ----------
    {multiple_selection_params}

    rows: int
        The number of rows to display in the widget.
    SelectMultipleViewTrP   SelectMultipleModelr   r   rS   Nr   r<   r&   r$   r   r     s          -..222==J'/0044$4??K3q7888<<$<GGDDDr&   r   c                        e Zd ZdZ ed          Z ed          Z ed          	                    d          Z
 fdZ ed	          d
             Z ed          d             Z xZS )_SelectionNonemptyz6Selection that is guaranteed to have a value selected.rK   rS   rN   rO   TrP   c                     t          |                    dd                    dk    rt          d           t                      j        |i | d S Nr]   r<   r   zoptions must be nonemptyr+   rb   r   re   rf   r   s      r$   rf   z_SelectionNonempty.__init__  U    vzz)R(())Q..7888$)&)))))r&   r]   c                     t          |j                  |_        t          |j                  | _        t	          | j                  dk    rt          d          |j        S Nr   zOption list must be nonemptyr%   rC   r:   rc   r+   r   rn   s     r$   rp   z$_SelectionNonempty._validate_options  sR    *8>::*8>::t!""a'';<<<~r&   r^   c                 |    d|j         cxk    rt          | j                  k     r
n n|j         S t          d          r   r   rn   s     r$   r   z"_SelectionNonempty._validate_index  sH    ::::T%9!:!::::::>!EFFFr&   )r   r   r   r   r   rC   r   r_   r   r   r^   rf   r   rp   r   r   r   s   @r$   r   r     s        @@C%&&&EG)***EC%&&&***55E* * * * *
 Xi   XgG G G G G G Gr&   r   c                   J     e Zd ZdZ fdZ ed          d             Z xZS )_MultipleSelectionNonemptyz9Selection that is guaranteed to have an option available.c                     t          |                    dd                    dk    rt          d           t                      j        |i | d S r   r   r   s      r$   rf   z#_MultipleSelectionNonempty.__init__)  r   r&   r]   c                     t          |j                  |_        t          |j                  | _        t	          | j                  dk    rt          d          |j        S r   r   rn   s     r$   rp   z,_MultipleSelectionNonempty._validate_options.  sR    *8>::*8>::t!""a'';<<<~r&   )r   r   r   r   rf   r   rp   r   r   s   @r$   r   r   &  sd        CC* * * * *
 Xi      r&   r   c                      e Zd ZdZ ed                              d          Z ed                              d          Z eddgdd	                              d          Z	 e
dd
                              d          Z e
dd                              d          Z eg ddd	                              d          Z  ee          j        dddieZdS )SelectionSliderz
    Slider to select a single item from a list or dictionary.

    Parameters
    ----------
    {selection_params}

    {slider_params}
    SelectionSliderViewTrP   SelectionSliderModelr   r   r   r   5Display the current selected label next to the sliderrS   AUpdate the value of the widget as the user is holding the slider.drag-tapz	drag-snaptapdragsnapr  Slider dragging behavior.rQ   Nr<   )r   r   r   r   r   r   r   r   r   r   r   readoutcontinuous_updatebehaviorr   r   r   r   r<   r&   r$   r  r  7  sT         .//333>>J'0115545@@K!/j)&( ( ((+  d4DF F FFIctcnn TPR R RRURU[_RUR`R` &V&V&V 'BD D DDGCTCNN  *LL%%)LLtL7KLLEEEr&   r  c                      e Zd ZdZ ed                              d          Z ed                              d          Z ed          Z	 ed          Z
 ed	d
                              d          Z ed          d             Z ed          d             Z eddgdd                              d          Z edd                              d          Z edd                              d          Z  ee          j        dddieZ eg ddd                              d          ZdS )SelectionRangeSlidera  
    Slider to select multiple contiguous items from a list.

    The index, value, and label attributes contain the start and end of
    the selection range, not all items in the range.

    Parameters
    ----------
    {multiple_selection_params}

    {slider_params}
    SelectionRangeSliderViewTrP   SelectionRangeSliderModelzMin and max selected valuesrS   zMin and max selected labelsr   r   zMin and max selected indicesr]   c                     | j         }|                     dt          d |D                                  t          d |D                       | _        | j        dur	d| _        dS dS )zSelect the first rangerr   c              3   &   K   | ]}|d          V  dS rt   r<   r,   s     r$   r/   z:SelectionRangeSlider._propagate_options.<locals>.<genexpr>m  ru   r&   c              3   &   K   | ]}|d          V  dS rw   r<   r,   s     r$   r/   z:SelectionRangeSlider._propagate_options.<locals>.<genexpr>n  rx   r&   Tr  Nr   r|   s      r$   rd   z'SelectionRangeSlider._propagate_optionsi  sx     $(%/F/Fg/F/F/F*F*FGGG$$;$;7$;$;$;;;%T11DJJJ 21r&   r^   c                      t          |j                  dk    rt          d|j                  t           fd|j        D                       r|j        S t          d|j                  )zIMake sure we have two indices and check the range of each proposed index.r)   z6Invalid selection: index must have two values, but is c              3   \   K   | ]&}d |cxk    ot          j                  k     nc V  'dS rt   r   r   s     r$   r/   z7SelectionRangeSlider._validate_index.<locals>.<genexpr>w  r   r&   z(Invalid selection: index out of bounds: )r+   rC   r   r8   rn   s   ` r$   r   z$SelectionRangeSlider._validate_indexr  s{     x~!##*YaYgYgijjjJJJJ8>JJJJJ 	]>!*8>>[\\\r&   r   r   r   r   r  r  rQ   r  r  r  Nr<   )r   r   r   r   r   r   r   r   r   rC   r_   r^   r   rd   r   r   r   r   r   r  r  r   r   r   r   r  r<   r&   r$   r  r  S  s         34488d8CCJ'566:::EEKE4555EE4555EE%<===AAtALLEWY      Xg] ] ] "/j)&( ( ((+  d4DF F FFIctcnn TPR R RRURU[_RUR`R`  *LL%%)LLtL7KLLE&V&V&V 'BD D DDGCTCNN HHr&   r  N)5r   collections.abcr   r   	itertoolsr   widget_descriptionr   r   valuewidgetr	   widget_corer
   widget_styler   trait_typesr   r   widgetr   r   
widget_intr   docutilsr   	traitletsr   r   r   r   r   r   r   r   r   r   r   _doc_snippetsr%   r:   rH   rJ   r   r   r   r   r   r   r   r   r   r  r  r<   r&   r$   <module>r%     s   
 . - - - - - - -       C C C C C C C C $ $ $ $ $ $ # # # # # #       1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 # # # # # #      8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 %  !<.) *@"o   - - -. ':&9 2 2 2 2P P P P P"K P P Pfm5 m5 m5 m5 m5*K m5 m5 m5` 
R R R R R): R R 
R$ 

="p "p "p "p "pJ "p "p  
"pJ 

=: : : : :z : :  
: 

=7 7 7 7 7: 7 7  
7" 

=H H H H HZ H H  
H 

=H H H H H' H H  
H$G G G G G G G G6    !3   " 

=M M M M M( M M  
M4 

=1S 1S 1S 1S 1S5 1S 1S  
1S 1S 1Sr&   