Ë
    `§1hE3  ã                   óú   — d dl 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  G d„ dee«      Z G d	„ d
«      Z G d„ d«      Z G d„ d«      Z G d„ d«      Z G d„ d«      Z G d„ de¬«      Z G d„ de«      Zy)é    N)ÚABCMetaÚabstractmethod)ÚEnum)ÚListÚOptional)ÚInvalidArgumentException)ÚProxyc                   ó   — e Zd ZdZdZdZdZy)ÚPageLoadStrategya†  Enum of possible page load strategies.

    Selenium support following strategies:
        * normal (default) - waits for all resources to download
        * eager - DOM access is ready, but other resources like images may still be loading
        * none - does not block `WebDriver` at all

    Docs: https://www.selenium.dev/documentation/webdriver/drivers/options/#pageloadstrategy.
    ÚnormalÚeagerÚnoneN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   © ó    ú_/var/www/skyplay_api_hub/venv/lib/python3.12/site-packages/selenium/webdriver/common/options.pyr   r      s   „ ñð €FØ€EØ�Dr   r   c                   ó   — e Zd Zd„ Zd„ Zd„ Zy)Ú_BaseOptionsDescriptorc                 ó   — || _         y ©N©Úname©Úselfr   s     r   Ú__init__z_BaseOptionsDescriptor.__init__,   ó	   € Øˆ�	r   c                 óÄ  — | j                   dk(  r1|j                  j                  d«      }|du xs t        |t        «      S | j                   dk(  r9|j                  j                  | j                   «      }t        |t        «      sd S |S | j                   dv r&|j                  j                  | j                   d«      S |j                  j                  | j                   «      S )NÚ
enableBidiÚwebSocketUrlT)ÚacceptInsecureCertsÚstrictFileInteractabilityÚsetWindowRectúse:downloadsEnabledF)r   Ú_capsÚgetÚ
isinstanceÚstr)r   ÚobjÚclsÚvalues       r   Ú__get__z_BaseOptionsDescriptor.__get__/   s©   € Ø�9‰9˜Ò$à—I‘I—M‘M .Ó1ˆEØ˜D�=Ò:¤J¨u´cÓ$:Ð:Ø�9‰9˜Ò&à—I‘I—M‘M $§)¡)Ó,ˆEÜ)¨%´Ô5�4Ð@¸5Ð@Ø�9‰9ÐtÑtØ—9‘9—=‘= §¡¨EÓ2Ð2Ø�y‰y�}‰}˜TŸY™YÓ'Ð'r   c                 ó€   — | j                   dk(  r|j                  d|«       y |j                  | j                   |«       y )Nr!   r"   )r   Úset_capability©r   r+   r-   s      r   Ú__set__z_BaseOptionsDescriptor.__set__<   s2   € Ø�9‰9˜Ò$Ø×Ñ˜~¨uÕ5à×Ñ˜tŸy™y¨%Õ0r   N)r   r   r   r   r.   r2   r   r   r   r   r   +   s   „ òò(ó1r   r   c                   ó"   — e Zd ZdZd„ Zd„ Zd„ Zy)Ú_PageLoadStrategyDescriptorzÛDetermines the point at which a navigation command is returned:
    https://w3c.github.io/webdriver/#dfn-table-of-page-load-strategies.

    :param strategy: the strategy corresponding to a document readiness state
    c                 ó   — || _         y r   r   r   s     r   r   z$_PageLoadStrategyDescriptor.__init__J   r   r   c                 óL   — |j                   j                  | j                  «      S r   ©r'   r(   r   ©r   r+   r,   s      r   r.   z#_PageLoadStrategyDescriptor.__get__M   ó   € Ø�y‰y�}‰}˜TŸY™YÓ'Ð'r   c                 óZ   — |dv r|j                  | j                  |«       y t        d«      ‚)N)r   r   r   z>Strategy can only be one of the following: normal, eager, none©r0   r   Ú
ValueErrorr1   s      r   r2   z#_PageLoadStrategyDescriptor.__set__P   s+   € ØÐ/Ñ/Ø×Ñ˜tŸy™y¨%Õ0äÐ]Ó^Ð^r   N©r   r   r   r   r   r.   r2   r   r   r   r4   r4   C   s   „ ñòò(ó_r   r4   c                   ó"   — e Zd ZdZd„ Zd„ Zd„ Zy)Ú"_UnHandledPromptBehaviorDescriptorad  How the driver should respond when an alert is present and the:
    command sent is not handling the alert:
    https://w3c.github.io/webdriver/#dfn-table-of-page-load-strategies:

    :param behavior: behavior to use when an alert is encountered

    :returns: Values for implicit timeout, pageLoad timeout and script timeout if set (in milliseconds)
    c                 ó   — || _         y r   r   r   s     r   r   z+_UnHandledPromptBehaviorDescriptor.__init__a   r   r   c                 óL   — |j                   j                  | j                  «      S r   r7   r8   s      r   r.   z*_UnHandledPromptBehaviorDescriptor.__get__d   r9   r   c                 óZ   — |dv r|j                  | j                  |«       y t        d«      ‚)N)ÚdismissÚacceptzdismiss and notifyzaccept and notifyÚignoreziBehavior can only be one of the following: dismiss, accept, dismiss and notify, accept and notify, ignorer;   r1   s      r   r2   z*_UnHandledPromptBehaviorDescriptor.__set__g   s1   € ØÐ^Ñ^Ø×Ñ˜tŸy™y¨%Õ0äð,óð r   Nr=   r   r   r   r?   r?   W   s   „ ñòò(ór   r?   c                   ó"   — e Zd ZdZd„ Zd„ Zd„ Zy)Ú_TimeoutsDescriptoraL  How long the driver should wait for actions to complete before:
    returning an error https://w3c.github.io/webdriver/#timeouts:

    :param timeouts: values in milliseconds for implicit wait, page load and script timeout

    :returns: Values for implicit timeout, pageLoad timeout and script timeout if set (in milliseconds)
    c                 ó   — || _         y r   r   r   s     r   r   z_TimeoutsDescriptor.__init__z   r   r   c                 óL   — |j                   j                  | j                  «      S r   r7   r8   s      r   r.   z_TimeoutsDescriptor.__get__}   r9   r   c                 ó’   — t        d„ |j                  «       D «       «      r|j                  | j                  |«       y t	        d«      ‚)Nc              3   ó$   K  — | ]  }|d v –— Œ
 y­w))ÚimplicitÚpageLoadÚscriptNr   )Ú.0Úxs     r   ú	<genexpr>z._TimeoutsDescriptor.__set__.<locals>.<genexpr>�   s   è ø€ ÒM¸1ˆqÐ6Ô6ÑMùs   ‚zITimeout keys can only be one of the following: implicit, pageLoad, script)ÚallÚkeysr0   r   r<   r1   s      r   r2   z_TimeoutsDescriptor.__set__€   s6   € ÜÑMÀÇ
Á
ÃÔMÔMØ×Ñ˜tŸy™y¨%Õ0äÐhÓiÐir   Nr=   r   r   r   rG   rG   q   s   „ ñòò(ójr   rG   c                   ó"   — e Zd ZdZd„ Zd„ Zd„ Zy)Ú_ProxyDescriptorz':Returns: Proxy if set, otherwise None.c                 ó   — || _         y r   r   r   s     r   r   z_ProxyDescriptor.__init__Š   r   r   c                 ó   — |j                   S r   )Ú_proxyr8   s      r   r.   z_ProxyDescriptor.__get__�   s   € Ø�z‰zÐr   c                 ó–   — t        |t        «      st        d«      ‚||_        |j	                  «       |j
                  | j                  <   y )Nz$Only Proxy objects can be passed in.)r)   r	   r   rX   Úto_capabilitiesr'   r   r1   s      r   r2   z_ProxyDescriptor.__set__�   s:   € Ü˜%¤Ô'Ü*Ð+QÓRÐRØˆŒ
Ø$×4Ñ4Ó6ˆ�	‰	�$—)‘)Òr   Nr=   r   r   r   rU   rU   ‡   s   „ Ù1òòó7r   rU   c            	       óx  ‡ — e Zd ZdZ ed«      Z	  ed«      Z	  ed«      Z	  ed«      Z	  ed«      Z		  ed«      Z
	  ed«      Z	  ed	«      Z	  ed
«      Z	  ed«      Z	  ed«      Z	  ed«      Z	 dˆ fd„Zed„ «       Zdd„Z	 	 	 ddee   dee   dee   ddfd„Zed„ «       Zeed„ «       «       Zdd„Zˆ xZ S )ÚBaseOptionsz*Base class for individual browser options.ÚbrowserVersionÚplatformNamer#   r$   r%   r!   ÚpageLoadStrategyÚunhandledPromptBehaviorÚtimeoutsÚproxyr&   r"   ÚreturnNc                 ó®   •— t         ‰| �  «        | j                  | _        d | _        | j                  dt        j                  «       d | _        d| _	        y )Nr_   F)
Úsuperr   Údefault_capabilitiesr'   rX   r0   r   r   Úmobile_optionsÚ_ignore_local_proxy©r   Ú	__class__s    €r   r   zBaseOptions.__init__¤  sJ   ø€ Ü‰ÑÔØ×.Ñ.ˆŒ
ØˆŒØ×ÑÐ.Ô0@×0GÑ0GÔHØ"ˆÔØ#(ˆÕ r   c                 ó   — | j                   S r   ©r'   ©r   s    r   ÚcapabilitieszBaseOptions.capabilities¬  s   € à�z‰zÐr   c                 ó"   — || j                   |<   y)zSets a capability.Nrl   )r   r   r-   s      r   r0   zBaseOptions.set_capability°  s   € à ˆ�
‰
�4Òr   Úandroid_packageÚandroid_activityÚdevice_serialc                 óv   — |st        d«      ‚d|i| _        |r|| j                  d<   |r|| j                  d<   yy)z˜Enables mobile browser use for browsers that support it.

        :Args:
            android_activity: The name of the android package to start
        z!android_package must be passed inÚandroidPackageÚandroidActivityÚandroidDeviceSerialN)ÚAttributeErrorrg   )r   rp   rq   rr   s       r   Úenable_mobilezBaseOptions.enable_mobile´  sM   € ñ Ü Ð!DÓEÐEØ/°ÐAˆÔÙØ5EˆD×ÑÐ 1Ñ2ÙØ9FˆD×ÑÐ 5Ò6ð r   c                  ó   — y)z-Convert options into capabilities dictionary.Nr   rm   s    r   rZ   zBaseOptions.to_capabilitiesÇ  ó   � r   c                  ó   — y)z6Return minimal capabilities necessary as a dictionary.Nr   rm   s    r   rf   z BaseOptions.default_capabilitiesË  rz   r   c                 ó   — d| _         y)úaBy calling this you will ignore HTTP_PROXY and HTTPS_PROXY from
        being picked up and used.TN)rh   rm   s    r   Ú(ignore_local_proxy_environment_variablesz4BaseOptions.ignore_local_proxy_environment_variablesÐ  s   € ð $(ˆÕ r   ©rc   N)NNN)!r   r   r   r   r   Úbrowser_versionÚplatform_nameÚaccept_insecure_certsÚstrict_file_interactabilityÚset_window_rectÚenable_bidir4   Úpage_load_strategyr?   Úunhandled_prompt_behaviorrG   ra   rU   rb   Úenable_downloadsÚweb_socket_urlr   Úpropertyrn   r0   r   r*   rx   r   rZ   rf   r~   Ú__classcell__©rj   s   @r   r\   r\   —   sx  ø„ Ù4á,Ð-=Ó>€Oðñ* +¨>Ó:€Mðñ* 3Ð3HÓIÐðñ* #9Ð9TÓ"UÐðñ* -¨_Ó=€Oðñ* )¨Ó6€Kðñ* 5Ð5GÓHÐðñ* !CÐC\Ó ]Ððñ, # :Ó.€Hðñ, ˜WÓ%€Eðñ* .Ð.CÓDÐðñ* ,¨NÓ;€Nðõ*)ð ñó ðó!ð *.Ø*.Ø'+ñ	Gà! #™ðGð # 3™-ðGð   ‘}ð	Gð
 
óGð& ñ<ó ð<ð ØñEó ó ðE÷(r   r\   )Ú	metaclassc                   ój   ‡ — e Zd ZdZdZdˆ fd„Zed„ «       Zdeddfd„Z	dˆ fd	„Z
d
„ Zed„ «       Zˆ xZS )Ú
ArgOptionsz Binary Location Must be a Stringzfedcm:accountsrc   Nc                 ó0   •— t         ‰| �  «        g | _        y r   )re   r   Ú
_argumentsri   s    €r   r   zArgOptions.__init__Û  s   ø€ Ü‰ÑÔØ%'ˆ�r   c                 ó   — | j                   S )z5:Returns: A list of arguments needed for the browser.)r‘   rm   s    r   Ú	argumentszArgOptions.argumentsß  s   € ð �‰Ðr   Úargumentc                 óT   — |r| j                   j                  |«       yt        d«      ‚)zTAdds an argument to the list.

        :Args:
         - Sets the arguments
        zargument can not be nullN)r‘   Úappendr<   )r   r”   s     r   Úadd_argumentzArgOptions.add_argumentä  s%   € ñ Ø�O‰O×"Ñ" 8Õ,äÐ7Ó8Ð8r   c                 óZ   •— t        j                  dt        d¬«       t        ‰| �  «        y)r}   a  using ignore_local_proxy_environment_variables in Options has been deprecated, instead, create a Proxy instance with ProxyType.DIRECT to ignore proxy settings, pass the proxy instance into a ClientConfig constructor, pass the client config instance into the Webdriver constructoré   )Ú
stacklevelN)ÚwarningsÚwarnÚDeprecationWarningre   r~   ri   s    €r   r~   z3ArgOptions.ignore_local_proxy_environment_variablesï  s,   ø€ ô 	�‰ðMô Øõ	
ô 	‰Ñ8Õ:r   c                 ó   — | j                   S r   rl   rm   s    r   rZ   zArgOptions.to_capabilitiesý  s   € Ø�z‰zÐr   c                 ó   — i S r   r   rm   s    r   rf   zArgOptions.default_capabilities   s   € àˆ	r   r   )r   r   r   ÚBINARY_LOCATION_ERRORÚFEDCM_CAPABILITYr   rŠ   r“   r*   r—   r~   rZ   rf   r‹   rŒ   s   @r   r�   r�   Ö  sY   ø„ Ø>Ðà'Ðõ(ð ñó ðð	9 Sð 	9¨Tó 	9õ;òð ñó ôr   r�   )r›   Úabcr   r   Úenumr   Útypingr   r   Úselenium.common.exceptionsr   Úselenium.webdriver.common.proxyr	   r*   r   r   r4   r?   rG   rU   r\   r�   r   r   r   ú<module>r§      sx   ðó$ ß 'Ý ß !å ?Ý 1ô�s˜Dô ÷ 1ñ 1÷0_ñ _÷(ñ ÷4jñ j÷,7ñ 7ô |(˜Gõ |(ô~	,�õ ,r   