ó
    ¼®ió  ã                   ót   • S SK JrJr  S SKJr  S SKJr  S SKJr   " S S5      r	 " S S5      r
 " S	 S
5      rg)é    )ÚAnyÚOptional)Úcommand_builder)ÚUserPromptHandler)ÚProxyc                   ó4   • \ rS rSrSrSrSrSrSr\\\\1r	Sr
g)	ÚClientWindowStateé   zRepresents a window state.Ú
fullscreenÚ	maximizedÚ	minimizedÚnormal© N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__Ú
FULLSCREENÚ	MAXIMIZEDÚ	MINIMIZEDÚNORMALÚVALID_STATESÚ__static_attributes__r   ó    ÚSC:\des-py\RoboSAPF\venv\Lib\site-packages\selenium\webdriver\common\bidi\browser.pyr	   r	      s'   † Ù$à€JØ€IØ€IØ€Fà 	¨9°fÐ=ƒLr   r	   c                   ó¼   • \ rS rSrSrS\S\S\S\S\S\S	\4S
 jrS\4S jr	S\4S jr
S\4S jrS\4S jrS\4S jrS\4S jrS\4S jr\S\SS 4S j5       rSrg)ÚClientWindowInfoé%   z'Represents a client window information.Úclient_windowÚstateÚwidthÚheightÚxÚyÚactivec                 óX   • Xl         X l        X0l        X@l        XPl        X`l        Xpl        g ©N©r    r!   r"   r#   r$   r%   r&   )Úselfr    r!   r"   r#   r$   r%   r&   s           r   Ú__init__ÚClientWindowInfo.__init__(   s(   € ð +ÔØŒ
ØŒ
ØŒØŒØŒØ�r   Úreturnc                 ó   • U R                   $ )z‰Gets the state of the client window.

Returns:
-------
    str: The state of the client window (one of the ClientWindowState constants).
)r!   ©r*   s    r   Ú	get_stateÚClientWindowInfo.get_state:   ó   € ð �z‰zÐr   c                 ó   • U R                   $ )z\Gets the client window identifier.

Returns:
-------
    str: The client window identifier.
)r    r/   s    r   Úget_client_windowÚ"ClientWindowInfo.get_client_windowC   s   € ð ×!Ñ!Ð!r   c                 ó   • U R                   $ )z`Gets the width of the client window.

Returns:
-------
    int: The width of the client window.
)r"   r/   s    r   Ú	get_widthÚClientWindowInfo.get_widthL   r2   r   c                 ó   • U R                   $ )zbGets the height of the client window.

Returns:
-------
    int: The height of the client window.
)r#   r/   s    r   Ú
get_heightÚClientWindowInfo.get_heightU   ó   € ð �{‰{Ðr   c                 ó   • U R                   $ )znGets the x coordinate of the client window.

Returns:
-------
    int: The x coordinate of the client window.
)r$   r/   s    r   Úget_xÚClientWindowInfo.get_x^   ó   € ð �v‰vˆr   c                 ó   • U R                   $ )znGets the y coordinate of the client window.

Returns:
-------
    int: The y coordinate of the client window.
)r%   r/   s    r   Úget_yÚClientWindowInfo.get_yg   r@   r   c                 ó   • U R                   $ )zyChecks if the client window is active.

Returns:
-------
    bool: True if the client window is active, False otherwise.
)r&   r/   s    r   Ú	is_activeÚClientWindowInfo.is_activep   r<   r   Údatac           
      óP  •  US   n[        U[        5      (       d  [        S5      eUS   n[        U[        5      (       d  [        S5      eU[        R                  ;  a  [        SU S[        R                   35      eUS   n[        U[
        5      (       a  US:  a  [        S	U 35      eUS
   n[        U[
        5      (       a  US:  a  [        SU 35      eUS   n[        U[
        5      (       d!  [        S[        U5      R                   35      eUS   n[        U[
        5      (       d!  [        S[        U5      R                   35      eUS   n[        U[        5      (       d  [        S5      eU " UUUUUUUS9$ ! [        [        4 a  n	[        SU	 35      eSn	A	ff = f)a3  Creates a ClientWindowInfo instance from a dictionary.

Parameters:
-----------
    data: A dictionary containing the client window information.

Returns:
-------
    ClientWindowInfo: A new instance of ClientWindowInfo.

Raises:
------
    ValueError: If required fields are missing or have invalid types.
ÚclientWindowzclientWindow must be a stringr!   zstate must be a stringzInvalid state: z. Must be one of r"   r   z*width must be a non-negative integer, got r#   z+height must be a non-negative integer, got r$   zx must be an integer, got r%   zy must be an integer, got r&   zactive must be a booleanr)   z*Invalid data format for ClientWindowInfo: N)Ú
isinstanceÚstrÚ
ValueErrorr	   r   ÚintÚtyper   ÚboolÚKeyErrorÚ	TypeError)
ÚclsrG   r    r!   r"   r#   r$   r%   r&   Úes
             r   Ú	from_dictÚClientWindowInfo.from_dicty   s³  € ð )	OØ  Ñ0ˆMÜ˜m¬S×1Ñ1Ü Ð!@ÓAÐAà˜‘MˆEÜ˜e¤S×)Ñ)Ü Ð!9Ó:Ð:ØÔ-×:Ñ:Ó:Ü  ?°5°'Ð9JÔK\×KiÑKiÐJjÐ!kÓlÐlà˜‘MˆEÜ˜e¤S×)Ñ)¨U°Q«YÜ Ð#MÈeÈWÐ!UÓVÐVà˜(‘^ˆFÜ˜f¤c×*Ñ*¨f°q«jÜ Ð#NÈvÈhÐ!WÓXÐXà�S‘	ˆAÜ˜a¤×%Ñ%Ü Ð#=¼dÀ1»g×>NÑ>NÐ=OÐ!PÓQÐQà�S‘	ˆAÜ˜a¤×%Ñ%Ü Ð#=¼dÀ1»g×>NÑ>NÐ=OÐ!PÓQÐQà˜(‘^ˆFÜ˜f¤d×+Ñ+Ü Ð!;Ó<Ð<áØ+ØØØØØØñð øô œ)Ð$ó 	OÜÐIÈ!ÈÐMÓNÐNûð	Oús   ‚E?F ÆF%ÆF Æ F%)r&   r    r#   r!   r"   r$   r%   N)r   r   r   r   r   rK   rM   rO   r+   r0   r4   r7   r:   r>   rB   rE   ÚclassmethodÚdictrT   r   r   r   r   r   r   %   sÉ   † Ù1ðàðð ðð ð	ð
 ðð ðð ðð ôð$˜3ô ð" 3ô "ð˜3ô ð˜Cô ð�sô ð�sô ð˜4ô ð ð8O˜Tð 8OÐ&8ó 8Oó ó8Or   r   c            	       óŽ   • \ rS rSrSrS r   SS\\   S\\   S\\	   S\
4S	 jjrS\\
   4S
 jrS\
SS4S jrS\\   4S jrSrg)ÚBrowseréµ   z,
BiDi implementation of the browser module.
c                 ó   • Xl         g r(   ©Úconn)r*   r]   s     r   r+   ÚBrowser.__init__º   s   € Ø�	r   NÚaccept_insecure_certsÚproxyÚunhandled_prompt_behaviorr-   c                 óÀ   • 0 nUb  XS'   Ub  UR                  5       US'   Ub  UR                  5       US'   U R                  R                  [	        SU5      5      nUS   $ )aN  Creates a new user context.

Parameters:
-----------
    accept_insecure_certs: Optional flag to accept insecure TLS certificates
    proxy: Optional proxy configuration for the user context
    unhandled_prompt_behavior: Optional configuration for handling user prompts

Returns:
-------
    str: The ID of the created user context.
ÚacceptInsecureCertsr`   ÚunhandledPromptBehaviorzbrowser.createUserContextÚuserContext)Úto_bidi_dictÚto_dictr]   Úexecuter   )r*   r_   r`   ra   ÚparamsÚresults         r   Úcreate_user_contextÚBrowser.create_user_context½   sr   € ð$ "$ˆà Ñ,Ø,AÐ(Ñ)àÑØ#×0Ñ0Ó2ˆF�7‰Oà$Ñ0Ø0I×0QÑ0QÓ0SˆFÐ,Ñ-à—‘×"Ñ"¤?Ð3NÐPVÓ#WÓXˆØ�mÑ$Ð$r   c                 ó†   • U R                   R                  [        S0 5      5      nUS    Vs/ s H  o"S   PM	     sn$ s  snf )zUGets all user contexts.

Returns:
-------
    List[str]: A list of user context IDs.
zbrowser.getUserContextsÚuserContextsre   )r]   rh   r   )r*   rj   Úcontext_infos      r   Úget_user_contextsÚBrowser.get_user_contextsÝ   sB   € ð —‘×"Ñ"¤?Ð3LÈbÓ#QÓRˆØ@FÀ~Ò@VÓWÒ@V°˜]Ô+Ñ@VÑWÐWùÒWs   ­>Úuser_context_idc                 óx   • US:X  a  [        S5      eSU0nU R                  R                  [        SU5      5        g)zÂRemoves a user context.

Parameters:
-----------
    user_context_id: The ID of the user context to remove.

Raises:
------
    Exception: If the user context ID is "default" or does not exist.
Údefaultz&Cannot remove the default user contextre   zbrowser.removeUserContextN)Ú	Exceptionr]   rh   r   )r*   rr   ri   s      r   Úremove_user_contextÚBrowser.remove_user_contextç   s<   € ð ˜iÓ'ÜÐDÓEÐEà Ð1ˆØ�	‰	×Ñœ/Ð*EÀvÓNÕOr   c                 ó¨   • U R                   R                  [        S0 5      5      nUS    Vs/ s H  n[        R	                  U5      PM     sn$ s  snf )zlGets all client windows.

Returns:
-------
    List[ClientWindowInfo]: A list of client window information.
zbrowser.getClientWindowsÚclientWindows)r]   rh   r   r   rT   )r*   rj   Úwindows      r   Úget_client_windowsÚBrowser.get_client_windowsø   sK   € ð —‘×"Ñ"¤?Ð3MÈrÓ#RÓSˆØAGÈÒAXÓYÒAX°vÔ ×*Ñ*¨6Ö2ÑAXÑYÐYùÒYs   ­Ar\   )NNN)r   r   r   r   r   r+   r   rO   r   r   rK   rk   Úlistrp   rv   r   r{   r   r   r   r   rY   rY   µ   s�   † ñòð
 15Ø!%ØAEñ	%à'¨™~ð%ð ˜‰ð%ð $,Ð,=Ñ#>ð	%ð
 
õ%ð@X 4¨¡9ô XðP°3ð P¸4ô Pð"Z DÐ)9Ñ$:÷ Zr   rY   N)Útypingr   r   Ú%selenium.webdriver.common.bidi.commonr   Ú&selenium.webdriver.common.bidi.sessionr   Úselenium.webdriver.common.proxyr   r	   r   rY   r   r   r   Ú<module>r‚      s:   ð÷& !å AÝ DÝ 1÷>ñ >÷MOñ MO÷`KZò KZr   