
    'h                     X    S SK Jr  S SKJr   " S S5      r " S S5      r " S S5      rg	)
    )Optionalcommand_builderc                   .    \ rS rSrSrSrSrSr\\\1rSr	g)UserPromptHandlerType   z3Represents the behavior of the user prompt handler.acceptdismissignore N)
__name__
__module____qualname____firstlineno____doc__ACCEPTDISMISSIGNOREVALID_TYPES__static_attributes__r       o/var/www/home/psychics-availability/venv/lib/python3.13/site-packages/selenium/webdriver/common/bidi/session.pyr   r      s     =FGF7F+Kr   r   c                       \ rS rSrSr      SS\\   S\\   S\\   S\\   S\\   S	\\   4S
 jjrS\\\4   4S jr	Sr
g)UserPromptHandler!   z8Represents the configuration of the user prompt handler.Nalertbefore_unloadconfirmdefaultfilepromptc           	          SU4SU4SU4SU4SU4SU44 H@  u  pxUc  M
  U[         R                  ;  d  M   [        SU S	U S
[         R                   35      e   Xl        X l        X0l        X@l        XPl        X`l        g)a  Initialize UserPromptHandler.

Parameters:
-----------
    alert: Handler type for alert prompts
    before_unload: Handler type for beforeUnload prompts
    confirm: Handler type for confirm prompts
    default: Default handler type for all prompts
    file: Handler type for file picker prompts
    prompt: Handler type for prompt dialogs

Raises:
------
    ValueError: If any handler type is not valid
r   r   r   r   r    r!   NzInvalid z handler type: z. Must be one of )	r   r   
ValueErrorr   r   r   r   r    r!   )	selfr   r   r   r   r    r!   
field_namevalues	            r   __init__UserPromptHandler.__init__$   s    2 em,  TNv"
J  U2G2S2S%S zl/%@QRgRsRsQtu "
 
*	r   returnc                 v    SSSSSSS.n0 nUR                  5        H  u  p4[        X5      nUc  M  XRU'   M     U$ )zConvert the UserPromptHandler to a dictionary for BiDi protocol.

Returns:
-------
    Dict[str, str]: Dictionary representation suitable for BiDi protocol
r   beforeUnloadr   r   r    r!   r   r   r   r   r    r!   )itemsgetattr)r$   field_mappingresult	attr_namedict_keyr&   s         r   to_dictUserPromptHandler.to_dictP   sY     +  
 #0#6#6#8ID,E #(x  $9 r   r,   )NNNNNN)r   r   r   r   r   r   strr'   dictr3   r   r   r   r   r   r   !   s    B  $'+!%!%" $*}*  }* #	*
 #* sm* *Xc3h r   r   c                   <    \ rS rSrS rSS.S jrSS.S jrS rSrg)	Sessionh   c                     Xl         g )Nconn)r$   r<   s     r   r'   Session.__init__i   s    	r   N)browsing_contextsc                B    SU0nUc  / nU(       a  XS'   [        SU5      $ )NeventsbrowsingContextszsession.subscriber   r$   r>   r@   paramss       r   	subscribeSession.subscribel   s6    f
 $ "):%&2F;;r   c                B    SU0nUc  / nU(       a  XS'   [        SU5      $ )Nr@   rA   zsession.unsubscriber   rB   s       r   unsubscribeSession.unsubscribev   s6    f
 $ "):%&4f==r   c                 P    [        S0 5      nU R                  R                  U5      $ )z
The session.status command returns information about the remote end's readiness
to create new sessions and may include implementation-specific metadata.

Returns
-------
dict
    Dictionary containing the ready state (bool), message (str) and metadata
zsession.status)r   r<   execute)r$   cmds     r   statusSession.status   s&     .3yy  %%r   r;   )	r   r   r   r   r'   rD   rG   rL   r   r   r   r   r8   r8   h   s      48 < 6: >&r   r8   N)typingr   %selenium.webdriver.common.bidi.commonr   r   r   r8   r   r   r   <module>rP      s.   $  A, ,D DN#& #&r   