
    ,h<|              
       4   d dl 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 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 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 d dlmZ 	  e	d      Z e	d      Ze
eef   Zdedeegef   fdZdedeegef   fdZdeeef   deegef   fdZdedeegef   fdZdedeegef   fdZdedeegef   fdZ dedeegef   fdZ!deeef   deege
ed    ef   f   fd!Z"d"edeege
ed    ef   f   fd#Z#dCd"ed$ede
ed    ef   fd%Z$deeef   deegee   f   fd&Z%deeef   deegee   f   fd'Z&deeef   deege
ee   ed    f   f   fd(Z'deeef   d)edeegef   fd*Z(deeef   d)edeegef   fd+Z)deeef   d,ed)edeegef   fd-Z*de
eeef   eef   deegef   fd.Z+de
eeeef   f   deege
eef   f   fd/Z,d"e
eeeef   f   deege
eef   f   fd0Z-d1e
eeeef   f   deege
ed    ef   f   fd2Z.d"edeegef   fd3Z/d"edeegef   fd4Z0deeef   deegef   fd5Z1d"ed6edeegef   fd7Z2deeef   d6edeegef   fd8Z3d9e4deegef   fd:Z5d;ee   deegef   fd<Z6deege
eed    f   f   fd=Z7deeef   d,edeegef   fd>Z8d?eegef   deege
ed    ef   f   fd@Z9d?eege
eed    f   f   deege
ee   ed    f   f   fdAZ:d?eegef   deegef   fdBZ;y)D    N)Iterable)Any)Callable)List)Literal)Tuple)TypeVar)Union)NoAlertPresentException)NoSuchElementException)NoSuchFrameException)StaleElementReferenceExceptionWebDriverException)Alert	WebDriver)
WebElementDTtitlereturnc                       dt         f fd}|S )zAn expectation for checking the title of a page.

    Parameters:
    -----------
    title : str
        The expected title, which must be an exact match.

    Returns:
    -------
    boolean : True if the title matches, False otherwise.
    driverc                 "    | j                   k(  S Nr   r   r   s    p/var/www/html/Resume-Scraper/venv/lib/python3.12/site-packages/selenium/webdriver/support/expected_conditions.py
_predicateztitle_is.<locals>._predicate=   s    ||u$$    r   r   r    s   ` r   title_isr#   0   s    %9 % r!   c                       dt         f fd}|S )a  An expectation for checking that the title contains a case-sensitive
    substring.

    Parameters:
    -----------
    title : str
        The fragment of title expected.

    Returns:
    -------
    boolean : True when the title matches, False otherwise.
    r   c                      | j                   v S r   r   r   s    r   r    z"title_contains.<locals>._predicateQ   s    $$r!   r   r"   s   ` r   title_containsr&   C   s    %9 % r!   locatorc                       dt         f fd}|S )a  An expectation for checking that an element is present on the DOM of a
    page. This does not necessarily mean that the element is visible.

    Parameters:
    -----------
    locator : Tuple[str, str]
        Used to find the element.

    Returns:
    -------
    WebElement : The WebElement once it is located.

    Example:
    --------
    >>> from selenium.webdriver.common.by import By
    >>> from selenium.webdriver.support.ui import WebDriverWait
    >>> from selenium.webdriver.support import expected_conditions as EC
    >>> element = WebDriverWait(driver, 10).until(
    ... EC.presence_of_element_located((By.NAME, "q")))
    r   c                 "     | j                    S r   )find_elementr   r'   s    r   r    z/presence_of_element_located.<locals>._predicatem   s    "v""G,,r!   WebDriverOrWebElementr'   r    s   ` r   presence_of_element_locatedr/   W   s    ,-0 - r!   urlc                       dt         f fd}|S )a  An expectation for checking that the current url contains a case-
    sensitive substring.

    Parameters:
    -----------
    url : str
        The fragment of url expected.

    Returns:
    -------
    boolean : True when the url matches, False otherwise.
    r   c                      | j                   v S r   current_urlr   r0   s    r   r    z url_contains.<locals>._predicate   s    f((((r!   r   r0   r    s   ` r   url_containsr7   s       )9 ) r!   patternc                       dt         f fd}|S )aQ  An expectation for checking the current url.

    Parameters:
    -----------
    pattern : str
        The pattern to match with the current url.

    Returns:
    -------
    boolean : True when the pattern matches, False otherwise.

    Notes:
    ------
    More powerful than url_contains, as it allows for regular expressions.
    r   c                 H    t        j                  | j                        d uS r   )researchr4   )r   r9   s    r   r    zurl_matches.<locals>._predicate   s    yy&"4"45TAAr!   r   )r9   r    s   ` r   url_matchesr>      s    "B9 B r!   c                       dt         f fd}|S )zAn expectation for checking the current url.

    Parameters:
    -----------
    url : str
        The expected url, which must be an exact match.

    Returns:
    -------
    boolean : True when the url matches, False otherwise.
    r   c                 "    | j                   k(  S r   r3   r5   s    r   r    zurl_to_be.<locals>._predicate       f((((r!   r   r6   s   ` r   	url_to_berB      s    )9 ) r!   c                       dt         f fd}|S )a  An expectation for checking the current url is different than a given
    string.

    Parameters:
    -----------
    url : str
        The expected url, which must not be an exact match.

    Returns:
    -------
    boolean : True when the url does not match, False otherwise
    r   c                 "    | j                   k7  S r   r3   r5   s    r   r    zurl_changes.<locals>._predicate   rA   r!   r   r6   s   ` r   url_changesrE      r8   r!   Fc                       dt         f fd}|S )a  An expectation for checking that an element is present on the DOM of a
    page and visible. Visibility means that the element is not only displayed
    but also has a height and width that is greater than 0.

    Parameters:
    -----------
    locator : Tuple[str, str]
        Used to find the element.

    Returns:
    -------
    WebElement : The WebElement once it is located and visible.

    Example:
    --------
    >>> from selenium.webdriver.common.by import By
    >>> from selenium.webdriver.support.ui import WebDriverWait
    >>> from selenium.webdriver.support import expected_conditions as EC
    >>> element = WebDriverWait(driver, 10).until(
    ... EC.visibility_of_element_located((By.NAME, "q")))
    r   c                 T    	 t         | j                         S # t        $ r Y yw xY wNF)_element_if_visibler*   r   r+   s    r   r    z1visibility_of_element_located.<locals>._predicate   s3    	&':v':':G'DEE- 		s    	''r,   r.   s   ` r   visibility_of_element_locatedrJ      s    20  r!   elementc                       fd}|S )a:  An expectation for checking that an element, known to be present on the
    DOM of a page, is visible.

    Parameters:
    -----------
    element : WebElement
        The WebElement to check.

    Returns:
    -------
    WebElement : The WebElement once it is visible.

    Example:
    --------
    >>> from selenium.webdriver.common.by import By
    >>> from selenium.webdriver.support.ui import WebDriverWait
    >>> from selenium.webdriver.support import expected_conditions as EC
    >>> element = WebDriverWait(driver, 10).until(
    ... EC.visibility_of(driver.find_element(By.NAME, "q")))

    Notes:
    ------
    Visibility means that the element is not only displayed but also has
    a height and width that is greater than 0. element is the WebElement
    returns the (same) WebElement once it is visible
    c                     t              S r   )rI   _rK   s    r   r    z!visibility_of.<locals>._predicate  s    "7++r!    rK   r    s   ` r   visibility_ofrR      s    8, r!   
visibilityc                 0    | j                         |k(  r| S dS )a|  An expectation for checking that an element, known to be present on the
    DOM of a page, is of the expected visibility.

    Parameters:
    -----------
    element : WebElement
        The WebElement to check.
    visibility : bool
        The expected visibility of the element.

    Returns:
    -------
    WebElement : The WebElement once it is visible or not visible.
    F)is_displayed)rK   rS   s     r   rI   rI   	  s     **,
:7EEr!   c                       dt         f fd}|S )ap  An expectation for checking that there is at least one element present
    on a web page.

    Parameters:
    -----------
    locator : Tuple[str, str]
        Used to find the element.

    Returns:
    -------
    List[WebElement] : The list of WebElements once they are located.

    Example:
    --------
    >>> from selenium.webdriver.common.by import By
    >>> from selenium.webdriver.support.ui import WebDriverWait
    >>> from selenium.webdriver.support import expected_conditions as EC
    >>> elements = WebDriverWait(driver, 10).until(
    ... EC.presence_of_all_elements_located((By.CLASS_NAME, "foo")))
    r   c                 "     | j                    S r   )find_elementsr+   s    r   r    z4presence_of_all_elements_located.<locals>._predicate1  s    #v##W--r!   r,   r.   s   ` r    presence_of_all_elements_locatedrY     s    ,.0 . r!   c                       dt         f fd}|S )a~  An expectation for checking that there is at least one element visible
    on a web page.

    Parameters:
    -----------
    locator : Tuple[str, str]
        Used to find the element.

    Returns:
    -------
    List[WebElement] : The list of WebElements once they are located and visible.

    Example:
    --------
    >>> from selenium.webdriver.common.by import By
    >>> from selenium.webdriver.support.ui import WebDriverWait
    >>> from selenium.webdriver.support import expected_conditions as EC
    >>> elements = WebDriverWait(driver, 10).until(
    ... EC.visibility_of_any_elements_located((By.CLASS_NAME, "foo")))
    r   c                 `     | j                    D cg c]  }t        |      s| c}S c c}w r   )rX   rI   )r   rK   r'   s     r   r    z6visibility_of_any_elements_located.<locals>._predicateM  s-    ';v';';W'EfGI\]dIefffs   ++r,   r.   s   ` r   "visibility_of_any_elements_locatedr\   7  s    ,g0 g r!   c                       dt         f fd}|S )a  An expectation for checking that all elements are present on the DOM of
    a page and visible. Visibility means that the elements are not only
    displayed but also has a height and width that is greater than 0.

    Parameters:
    -----------
    locator : Tuple[str, str]
        Used to find the elements.

    Returns:
    -------
    List[WebElement] : The list of WebElements once they are located and visible.

    Example:
    --------
    >>> from selenium.webdriver.common.by import By
    >>> from selenium.webdriver.support.ui import WebDriverWait
    >>> from selenium.webdriver.support import expected_conditions as EC
    >>> elements = WebDriverWait(driver, 10).until(
    ... EC.visibility_of_all_elements_located((By.CLASS_NAME, "foo")))
    r   c                 r    	  | j                    }|D ]  }t        |d      s y |S # t        $ r Y yw xY w)NFrS   )rX   rI   r   )r   elementsrK   r'   s      r   r    z6visibility_of_all_elements_located.<locals>._predicatel  sO    	+v++W5H# !&w5A ! O- 		s   !* * * 	66r,   r.   s   ` r   "visibility_of_all_elements_locatedra   S  s    20  r!   text_c                 $     dt         f fd}|S )a  An expectation for checking if the given text is present in the
    specified element.

    Parameters:
    -----------
    locator : Tuple[str, str]
        Used to find the element.
    text_ : str
        The text to be present in the element.

    Returns:
    -------
    boolean : True when the text is present, False otherwise.

    Example:
    --------
    >>> from selenium.webdriver.common.by import By
    >>> from selenium.webdriver.support.ui import WebDriverWait
    >>> from selenium.webdriver.support import expected_conditions as EC
    >>> is_text_in_element = WebDriverWait(driver, 10).until(
    ... EC.text_to_be_present_in_element((By.CLASS_NAME, "foo"), "bar"))
    r   c                 ^    	  | j                    j                  }|v S # t        $ r Y yw xY wrH   )r*   textr   r   element_textr'   rb   s     r   r    z1text_to_be_present_in_element.<locals>._predicate  s=    	.6..8==LL((- 		s     	,,r,   r'   rb   r    s   `` r   text_to_be_present_in_elementri   y      00  r!   c                 $     dt         f fd}|S )a  An expectation for checking if the given text is present in the
    element's value.

    Parameters:
    -----------
    locator : Tuple[str, str]
        Used to find the element.
    text_ : str
        The text to be present in the element's value.

    Returns:
    -------
    boolean : True when the text is present, False otherwise.

    Example:
    --------
    >>> from selenium.webdriver.common.by import By
    >>> from selenium.webdriver.support.ui import WebDriverWait
    >>> from selenium.webdriver.support import expected_conditions as EC
    >>> is_text_in_element_value = WebDriverWait(driver, 10).until(
    ... EC.text_to_be_present_in_element_value((By.CLASS_NAME, "foo"), "bar"))
    r   c                 h    	  | j                    j                  d      }|v S # t        $ r Y yw xY w)NvalueFr*   get_attributer   rf   s     r   r    z7text_to_be_present_in_element_value.<locals>._predicate  sB    	.6..8FFwOLL((- 		   !% 	11r,   rh   s   `` r   #text_to_be_present_in_element_valuerq     s    40  r!   
attribute_c                 (     dt         f fd}|S )a$  An expectation for checking if the given text is present in the
    element's attribute.

    Parameters:
    -----------
    locator : Tuple[str, str]
        Used to find the element.
    attribute_ : str
        The attribute to check the text in.
    text_ : str
        The text to be present in the element's attribute.

    Returns:
    -------
    boolean : True when the text is present, False otherwise.

    Example:
    --------
    >>> from selenium.webdriver.common.by import By
    >>> from selenium.webdriver.support.ui import WebDriverWait
    >>> from selenium.webdriver.support import expected_conditions as EC
    >>> is_text_in_element_attribute = WebDriverWait(driver, 10).until(
    ... EC.text_to_be_present_in_element_attribute((By.CLASS_NAME, "foo"),
    ... "bar", "baz"))
    r   c                 n    	  | j                    j                        }|y|v S # t        $ r Y yw xY wrH   rn   )r   rg   rr   r'   rb   s     r   r    z;text_to_be_present_in_element_attribute.<locals>._predicate  sK    	.6..8FFzRL#L((- 		s    ( ( 	44r,   )r'   rr   rb   r    s   ``` r   'text_to_be_present_in_element_attributeru     s    :0  r!   c                       dt         f fd}|S )a  An expectation for checking whether the given frame is available to
    switch to.

    Parameters:
    -----------
    locator : Union[Tuple[str, str], str, WebElement]
        Used to find the frame.

    Returns:
    -------
    boolean : True when the frame is available, False otherwise.

    Example:
    --------
    >>> from selenium.webdriver.support.ui import WebDriverWait
    >>> from selenium.webdriver.support import expected_conditions as EC
    >>> WebDriverWait(driver, 10).until(
    ... EC.frame_to_be_available_and_switch_to_it("frame_name"))

    Notes:
    ------
    If the frame is available it switches the given driver to the
    specified frame.
    r   c                     	 t        t              r9t        t              s)| j                  j	                   | j
                          y| j                  j	                         y# t        $ r Y yw xY w)NTF)
isinstancer   str	switch_toframer*   r   r+   s    r   r    z:frame_to_be_available_and_switch_to_it.<locals>._predicate  sm    	'8,Z5M  &&':v':':G'DE    &&w/# 		s   AA( A( (	A43A4r   r.   s   ` r   &frame_to_be_available_and_switch_to_itr|     s    89  r!   c                       dt         f fd}|S )a  An Expectation for checking that an element is either invisible or not
    present on the DOM.

    Parameters:
    -----------
    locator : Union[WebElement, Tuple[str, str]]
        Used to find the element.

    Returns:
    -------
    boolean : True when the element is invisible or not present, False otherwise.

    Example:
    --------
    >>> from selenium.webdriver.common.by import By
    >>> from selenium.webdriver.support.ui import WebDriverWait
    >>> from selenium.webdriver.support import expected_conditions as EC
    >>> is_invisible = WebDriverWait(driver, 10).until(
    ... EC.invisibility_of_element_located((By.CLASS_NAME, "foo")))

    Notes:
    ------
    - In the case of NoSuchElement, returns true because the element is not
    present in DOM. The try block checks if the element is present but is
    invisible.
    - In the case of StaleElementReference, returns true because stale element
    reference implies that element is no longer visible.
    r   c                     	 }t        |t              s | j                  | }t        |d      S # t        t
        f$ r Y yw xY w)NFr_   T)rx   r   r*   rI   r   r   )r   targetr'   s     r   r    z3invisibility_of_element_located.<locals>._predicate1  sP    	Ffj1,,,f5&v%@@&(FG 	 	s   -1 AAr,   r.   s   ` r   invisibility_of_element_locatedr     s    @0  r!   c                     t        |       S )a  An Expectation for checking that an element is either invisible or not
    present on the DOM.

    Parameters:
    -----------
    element : Union[WebElement, Tuple[str, str]]
        Used to find the element.

    Returns:
    -------
    boolean : True when the element is invisible or not present, False otherwise.

    Example:
    --------
    >>> from selenium.webdriver.common.by import By
    >>> from selenium.webdriver.support.ui import WebDriverWait
    >>> from selenium.webdriver.support import expected_conditions as EC
    >>> is_invisible_or_not_present = WebDriverWait(driver, 10).until(
    ... EC.invisibility_of_element(driver.find_element(By.CLASS_NAME, "foo")))
    )r   )rK   s    r   invisibility_of_elementr   B  s    . +733r!   markc                       dt         f fd}|S )av  An Expectation for checking an element is visible and enabled such that
    you can click it.

    Parameters:
    -----------
    mark : Union[WebElement, Tuple[str, str]]
        Used to find the element.

    Returns:
    -------
    WebElement : The WebElement once it is located and clickable.

    Example:
    --------
    >>> from selenium.webdriver.common.by import By
    >>> from selenium.webdriver.support.ui import WebDriverWait
    >>> from selenium.webdriver.support import expected_conditions as EC
    >>> element = WebDriverWait(driver, 10).until(
    ... EC.element_to_be_clickable((By.CLASS_NAME, "foo")))
    r   c                     }t        |t              s | j                  | } t        |      |       }|r|j	                         r|S yrH   )rx   r   r*   rR   
is_enabled)r   r   rK   r   s      r   r    z+element_to_be_clickable.<locals>._predicatev  sK    &*-(V((&1F'-'/w))+Nr!   r,   )r   r    s   ` r   element_to_be_clickabler   \  s    40  r!   c                       fd}|S )aZ  Wait until an element is no longer attached to the DOM.

    Parameters:
    -----------
    element : WebElement
        The element to wait for.

    Returns:
    -------
    boolean : False if the element is still attached to the DOM, true otherwise.

    Example:
    --------
    >>> from selenium.webdriver.common.by import By
    >>> from selenium.webdriver.support.ui import WebDriverWait
    >>> from selenium.webdriver.support import expected_conditions as EC
    >>> is_element_stale = WebDriverWait(driver, 10).until(
    ... EC.staleness_of(driver.find_element(By.CLASS_NAME, "foo")))
    c                 F    	 j                          y# t        $ r Y yw xY wNFT)r   r   rN   s    r   r    z staleness_of.<locals>._predicate  s)    	 - 		s    	  rP   rQ   s   ` r   staleness_ofr     s    * r!   c                       fd}|S )aM  An expectation for checking the selection is selected.

    Parameters:
    -----------
    element : WebElement
        The WebElement to check.

    Returns:
    -------
    boolean : True if the element is selected, False otherwise.

    Example:
    --------
    >>> from selenium.webdriver.common.by import By
    >>> from selenium.webdriver.support.ui import WebDriverWait
    >>> from selenium.webdriver.support import expected_conditions as EC
    >>> is_selected = WebDriverWait(driver, 10).until(
    ... EC.element_to_be_selected(driver.find_element(By.CLASS_NAME, "foo")))
    c                 $    j                         S r   is_selectedrN   s    r   r    z*element_to_be_selected.<locals>._predicate  s    ""$$r!   rP   rQ   s   ` r   element_to_be_selectedr     s    *% r!   c                       dt         f fd}|S )aK  An expectation for the element to be located is selected.

    Parameters:
    -----------
    locator : Tuple[str, str]
        Used to find the element.

    Returns:
    -------
    boolean : True if the element is selected, False otherwise.

    Example:
    --------
    >>> from selenium.webdriver.common.by import By
    >>> from selenium.webdriver.support.ui import WebDriverWait
    >>> from selenium.webdriver.support import expected_conditions as EC
    >>> is_selected = WebDriverWait(driver, 10).until(
    ... EC.element_located_to_be_selected((By.CLASS_NAME, "foo")))
    r   c                 >     | j                    j                         S r   )r*   r   r+   s    r   r    z2element_located_to_be_selected.<locals>._predicate  s    "v""G,88::r!   r,   r.   s   ` r   element_located_to_be_selectedr     s    *;0 ; r!   r   c                       fd}|S )a  An expectation for checking if the given element is selected.

    Parameters:
    -----------
    element : WebElement
        The WebElement to check.
    is_selected : bool

    Returns:
    -------
    boolean : True if the element's selection state is the same as is_selected

    Example:
    --------
    >>> from selenium.webdriver.common.by import By
    >>> from selenium.webdriver.support.ui import WebDriverWait
    >>> from selenium.webdriver.support import expected_conditions as EC
    >>> is_selected = WebDriverWait(driver, 10).until(
    ... EC.element_selection_state_to_be(driver.find_element(By.CLASS_NAME, "foo"), True))
    c                 *    j                         k(  S r   r   )rO   rK   r   s    r   r    z1element_selection_state_to_be.<locals>._predicate  s    ""$33r!   rP   )rK   r   r    s   `` r   element_selection_state_to_ber     s    ,4 r!   c                 $     dt         f fd}|S )a  An expectation to locate an element and check if the selection state
    specified is in that state.

    Parameters:
    -----------
    locator : Tuple[str, str]
        Used to find the element.
    is_selected : bool

    Returns:
    -------
    boolean : True if the element's selection state is the same as is_selected

    Example:
    --------
    >>> from selenium.webdriver.common.by import By
    >>> from selenium.webdriver.support.ui import WebDriverWait
    >>> from selenium.webdriver.support import expected_conditions as EC
    >>> is_selected = WebDriverWait(driver, 10).until(
    ... EC.element_located_selection_state_to_be((By.CLASS_NAME, "foo"), True))
    r   c                 h    	  | j                    }|j                         k(  S # t        $ r Y yw xY wrH   )r*   r   r   )r   rK   r   r'   s     r   r    z9element_located_selection_state_to_be.<locals>._predicate  s@    	)f))73G&&(K77- 		rp   r,   )r'   r   r    s   `` r   %element_located_selection_state_to_ber     s    20  r!   num_windowsc                       dt         f fd}|S )a  An expectation for the number of windows to be a certain value.

    Parameters:
    -----------
    num_windows : int
        The expected number of windows.

    Returns:
    -------
    boolean : True when the number of windows matches, False otherwise.

    Example:
    --------
    >>> from selenium.webdriver.support.ui import WebDriverWait
    >>> from selenium.webdriver.support import expected_conditions as EC
    >>> is_number_of_windows = WebDriverWait(driver, 10).until(
    ... EC.number_of_windows_to_be(2))
    r   c                 4    t        | j                        k(  S r   lenwindow_handles)r   r   s    r   r    z+number_of_windows_to_be.<locals>._predicate+  s    6(()[88r!   r   )r   r    s   ` r   number_of_windows_to_ber     s    (99 9 r!   current_handlesc                       dt         f fd}|S )az  An expectation that a new window will be opened and have the number of
    windows handles increase.

    Parameters:
    -----------
    current_handles : List[str]
        The current window handles.

    Returns:
    -------
    boolean : True when a new window is opened, False otherwise.

    Example:
    --------
    >>> from selenium.webdriver.support.ui import By
    >>> from selenium.webdriver.support.ui import WebDriverWait
    >>> from selenium.webdriver.support import expected_conditions as EC
    >>> is_new_window_opened = WebDriverWait(driver, 10).until(
    ... EC.new_window_is_opened(driver.window_handles))
    r   c                 F    t        | j                        t              kD  S r   r   )r   r   s    r   r    z(new_window_is_opened.<locals>._predicateG  s    6(()C,@@@r!   r   )r   r    s   ` r   new_window_is_openedr   1  s    ,A9 A r!   c                      dt         fd} | S )a  An expectation for checking if an alert is currently present and
    switching to it.

    Returns:
    -------
    Alert : The Alert once it is located.

    Example:
    --------
    >>> from selenium.webdriver.support.ui import WebDriverWait
    >>> from selenium.webdriver.support import expected_conditions as EC
    >>> alert = WebDriverWait(driver, 10).until(EC.alert_is_present())

    Notes:
    ------
    If the alert is present it switches the given driver to it.
    r   c                 N    	 | j                   j                  S # t        $ r Y yw xY wrH   )rz   alertr   )r   s    r   r    z$alert_is_present.<locals>._predicate`  s+    	##)))& 		s    	$$r   )r    s    r   alert_is_presentr   M  s    &9  r!   c                 $     dt         f fd}|S )a  An expectation for checking if the given attribute is included in the
    specified element.

    Parameters:
    -----------
    locator : Tuple[str, str]
        Used to find the element.
    attribute_ : str
        The attribute to check.

    Returns:
    -------
    boolean : True when the attribute is included, False otherwise.

    Example:
    --------
    >>> from selenium.webdriver.common.by import By
    >>> from selenium.webdriver.support.ui import WebDriverWait
    >>> from selenium.webdriver.support import expected_conditions as EC
    >>> is_attribute_in_element = WebDriverWait(driver, 10).until(
    ... EC.element_attribute_to_include((By.CLASS_NAME, "foo"), "bar"))
    r   c                 h    	  | j                    j                        }|d uS # t        $ r Y yw xY wrH   rn   )r   element_attributerr   r'   s     r   r    z0element_attribute_to_include.<locals>._predicate  sC    	 3 3 3W = K KJ W$D00- 		rp   r,   )r'   rr   r    s   `` r   element_attribute_to_includer   i  rj   r!   expected_conditionsc                        dt         f fd}|S )a0  An expectation that any of multiple expected conditions is true.

    Parameters:
    -----------
    expected_conditions : Callable[[D], T]
        The list of expected conditions to check.

    Returns:
    -------
    T : The result of the first matching condition, or False if none do.

    Example:
    --------
    >>> from selenium.webdriver.common.by import By
    >>> from selenium.webdriver.support.ui import WebDriverWait
    >>> from selenium.webdriver.support import expected_conditions as EC
    >>> element = WebDriverWait(driver, 10).until(
    ... EC.any_of(EC.presence_of_element_located((By.NAME, "q"),
    ... EC.visibility_of_element_located((By.NAME, "q"))))

    Notes:
    ------
    Equivalent to a logical 'OR'. Returns results of the first matching
    condition, or False if none do.
    r   c                 P    D ]  }	  ||       }|r|c S  y# t         $ r Y  w xY wrH   r   r   expected_conditionresultr   s      r   any_of_conditionz any_of.<locals>.any_of_condition  sH    "5 	+F3!M 	  & s   	%%r   )r   r   s   ` r   any_ofr     s    6  r!   c                        dt         f fd}|S )a  An expectation that all of multiple expected conditions is true.

    Parameters:
    -----------
    expected_conditions : Callable[[D], Union[T, Literal[False]]]
        The list of expected conditions to check.

    Returns:
    -------
    List[T] : The results of all the matching conditions, or False if any do not.

    Example:
    --------
    >>> from selenium.webdriver.common.by import By
    >>> from selenium.webdriver.support.ui import WebDriverWait
    >>> from selenium.webdriver.support import expected_conditions as EC
    >>> elements = WebDriverWait(driver, 10).until(
    ... EC.all_of(EC.presence_of_element_located((By.NAME, "q"),
    ... EC.visibility_of_element_located((By.NAME, "q"))))

    Notes:
    ------
    Equivalent to a logical 'AND'.
    Returns: When any ExpectedCondition is not met: False.
    When all ExpectedConditions are met: A List with each ExpectedCondition's return value.
    r   c                 v    g }D ]   }	  ||       }|s y|j                  |       " |S # t        $ r Y  yw xY wrH   )appendr   )r   resultsr   r   r   s       r   all_of_conditionz all_of.<locals>.all_of_condition  sT    "5 	+F3 v&	  & s   
++	88r   )r   r   s   ` r   all_ofr     s    <
 
 r!   c                        dt         f fd}|S )a  An expectation that none of 1 or multiple expected conditions is true.

    Parameters:
    -----------
    expected_conditions : Callable[[D], Any]
        The list of expected conditions to check.

    Returns:
    -------
    boolean : True if none of the conditions are true, False otherwise.

    Example:
    --------
    >>> from selenium.webdriver.common.by import By
    >>> from selenium.webdriver.support.ui import WebDriverWait
    >>> from selenium.webdriver.support import expected_conditions as EC
    >>> element = WebDriverWait(driver, 10).until(
    ... EC.none_of(EC.presence_of_element_located((By.NAME, "q"),
    ... EC.visibility_of_element_located((By.NAME, "q"))))

    Notes:
    ------
    Equivalent to a logical 'NOT-OR'. Returns a Boolean
    r   c                 L    D ]  }	  ||       }|r y y# t         $ r Y w xY wr   r   r   s      r   none_of_conditionz"none_of.<locals>.none_of_condition  sF    "5 	+F3  	  & s   
	##r   )r   r   s   ` r   none_ofr     s    4!  r!   )T)<r<   collections.abcr   typingr   r   r   r   r   r	   r
   selenium.common.exceptionsr   r   r   r   r   selenium.webdriver.common.alertr   #selenium.webdriver.remote.webdriverr   r   r   r   r-   ry   boolr#   r&   r/   r7   r>   rB   rE   rJ   rR   rI   rY   r\   ra   ri   rq   ru   r|   r   r   r   r   r   r   r   r   intr   r   r   r   r   r   r   rP   r!   r   <module>r      s(  $ 
 $        > = ; E 9 1 9 :
 CLCLi34 C Hi[$%67 &# (I;+<"= (sCx XG\F]_iFi=j 8c h	{D'89 ( 9+t*;!< .3 8YK$56 &S Xyk4&78 (38_$%uWU^Z-G'HHID: (C5%PZ@Z:[3[*\ DF F FwW\~_iOiIj F$eCHo (LaKbdhisdtKtBu 8c3h HNcMdfjkufvMvDw 8#38_#$%uT*-=wu~-M'NNO#L5c? 3 8UjTkmqTqKr D!38_!%(!$%t+,!H&38_&*-&69&$%t+,&R&5c?C34&yk4 &R.:uS#X./.$%uZ-='>>?.b4:uS#X./4$%uZ-='>>?44#

E#s(O+
,#$%uWU^Z-G'HHI#L* 3%+)> @J 8SE4K3H 6E#s(O J_I`bfIf@g 6: D XWZV[]aVaMb 8 38_ +/ $%t+, F 9+t:K1L 4$s) )dAR8S 8(I;eWU^6K0L#LM 8%S/ s xYnXoquXuOv D%1#q&!1 %hsE'RW.Z[J[D\?\6] %P*"A3a.?(@#@A*qc5a'%.0112*Z$(A38"4 $1#t)9L $r!   