
    'hV8                     Z   S SK r S SKJrJr  S SKJrJrJr  S SKJ	r	  S SK
Jr   " S S5      r " S S	5      r\ " S
 S5      5       r\ " S S5      5       r\ " S S5      5       r\ " S S5      5       r\ " S S5      5       r\ " S S5      5       r\ " S S5      5       r\ " S S5      5       r\ " S S5      5       r\ " S S5      5       r\ " S S5      5       r\ " S  S!5      5       r\ " S" S#5      5       r\ " S$ S%5      5       r\ " S& S'5      5       r " S( S)5      r " S* S+5      rg),    N)	dataclassfield)AnyOptionalUnion)command_builder)Sessionc                   .    \ rS rSrSrSrSrSr\\\1rSr	g)PointerType   z&Represents the possible pointer types.mousepentouch N)
__name__
__module____qualname____firstlineno____doc__MOUSEPENTOUCHVALID_TYPES__static_attributes__r       m/var/www/home/psychics-availability/venv/lib/python3.13/site-packages/selenium/webdriver/common/bidi/input.pyr   r      s     0E
CE#u%Kr   r   c                        \ rS rSrSrSrSrSrg)Origin$   z%Represents the possible origin types.viewportpointerr   N)r   r   r   r   r   VIEWPORTPOINTERr   r   r   r   r   r   $   s    /HGr   r   c                   J    \ rS rSr% Sr\\S'   \\S'   S\4S jrS\4S jr	S	r
g
)ElementOrigin+   z/Represents an element origin for input actions.typeelementelement_referencec                     SU l         Xl        g )Nr(   r'   r(   )selfr)   s     r   __init__ElementOrigin.__init__2   s    	(r   returnc                 4    U R                   U R                  S.$ )z*Convert the ElementOrigin to a dictionary.r+   r+   r,   s    r   to_dictElementOrigin.to_dict6   s    		dll;;r   )r(   r'   N)r   r   r   r   r   str__annotations__dictr-   r2   r   r   r   r   r%   r%   +   s'    9
IM)$ )< <r   r%   c                   P    \ rS rSr% Sr\R                  r\\	S'   S r
S\4S jrSrg)	PointerParameters;   z2Represents pointer parameters for pointer actions.pointer_typec                     U R                   [        R                  ;  a)  [        SU R                    S[        R                   35      eg )NzInvalid pointer type: z. Must be one of )r:   r   r   
ValueErrorr1   s    r   __post_init__PointerParameters.__post_init__A   sD    K$;$;;5d6G6G5HHYZeZqZqYrstt <r   r/   c                     SU R                   0$ )z.Convert the PointerParameters to a dictionary.pointerType)r:   r1   s    r   r2   PointerParameters.to_dictE   s    t0011r   r   N)r   r   r   r   r   r   r   r:   r4   r5   r=   r6   r2   r   r   r   r   r8   r8   ;   s'    <#))L#)u2 2r   r8   c                       \ rS rSr% SrSr\\S'   Sr\\S'   Sr	\
\S'   Sr\
\S'   S	r\\S
'   Sr\
\S'   Sr\
\S'   S rS\4S jrSrg)PointerCommonPropertiesJ   z&Common properties for pointer actions.   widthheight        pressuretangential_pressurer   twistaltitude_angleazimuth_anglec                    U R                   S:  a  [        S5      eU R                  S:  a  [        S5      eSU R                  s=::  a  S::  d  O  [        S5      eSU R                  s=::  a  S::  d  O  [        S5      eSU R
                  s=::  a  S	::  d  O  [        S
5      eSU R                  s=::  a  [        R                  S-  ::  d  O  [        S5      eSU R                  s=::  a  S[        R                  -  ::  d  O  [        S5      eg )NrE   zwidth must be at least 1zheight must be at least 1rH   g      ?z$pressure must be between 0.0 and 1.0z/tangential_pressure must be between 0.0 and 1.0r   ig  ztwist must be between 0 and 359   u+   altitude_angle must be between 0.0 and π/2u)   azimuth_angle must be between 0.0 and 2π)
rF   r<   rG   rI   rJ   rK   rL   mathpirM   r1   s    r   r=   %PointerCommonProperties.__post_init__V   s    ::>788;;?899t}}++CDDt//636NOOTZZ&3&>??t**9dggk9JKKt))8Q[8HII 9r   r/   c                    0 nU R                   S:w  a  U R                   US'   U R                  S:w  a  U R                  US'   U R                  S:w  a  U R                  US'   U R                  S:w  a  U R                  US'   U R                  S:w  a  U R                  US'   U R
                  S:w  a  U R
                  US	'   U R                  S:w  a  U R                  US
'   U$ )z4Convert the PointerCommonProperties to a dictionary.rE   rF   rG   rH   rI   tangentialPressurer   rK   altitudeAngleazimuthAngle)rF   rG   rI   rJ   rK   rL   rM   r,   results     r   r2   PointerCommonProperties.to_dictf   s    !#::?"jjF7O;;!#{{F8==C!%F:##s*+/+C+CF'(::?"jjF7O#%&*&9&9F?#$%)%7%7F>"r   r   N)r   r   r   r   r   rF   intr5   rG   rI   floatrJ   rK   rL   rM   r=   r6   r2   r   r   r   r   rC   rC   J   s[    0E3NFCOHe!$$E3NNEM5J  r   rC   c                   T    \ rS rSr% SrSr\\   \S'   \	S\
4S j5       rS\4S jrSrg)	PauseAction{   zRepresents a pause action.Ndurationr/   c                     g)Npauser   r1   s    r   r'   PauseAction.type       r   c                 Z    SU R                   0nU R                  b  U R                  US'   U$ )z(Convert the PauseAction to a dictionary.r'   r_   )r'   r_   rW   s     r   r2   PauseAction.to_dict   s-    "($))!4==$!%F:r   r   )r   r   r   r   r   r_   r   rZ   r5   propertyr4   r'   r6   r2   r   r   r   r   r]   r]   {   s8    $"Hhsm"c   r   r]   c                   N    \ rS rSr% SrSr\\S'   \S\4S j5       r	S\
4S jrSrg	)
KeyDownAction   zRepresents a key down action. valuer/   c                     g)NkeyDownr   r1   s    r   r'   KeyDownAction.type       r   c                 4    U R                   U R                  S.$ )z*Convert the KeyDownAction to a dictionary.r'   rk   rq   r1   s    r   r2   KeyDownAction.to_dict       		DJJ77r   r   Nr   r   r   r   r   rk   r4   r5   rf   r'   r6   r2   r   r   r   r   rh   rh      s3    'E3Oc  8 8r   rh   c                   N    \ rS rSr% SrSr\\S'   \S\4S j5       r	S\
4S jrSrg	)
KeyUpAction   zRepresents a key up action.rj   rk   r/   c                     g)NkeyUpr   r1   s    r   r'   KeyUpAction.type   rc   r   c                 4    U R                   U R                  S.$ )z(Convert the KeyUpAction to a dictionary.rq   rq   r1   s    r   r2   KeyUpAction.to_dict   rs   r   r   Nrt   r   r   r   rv   rv      s3    %E3Oc  8 8r   rv   c                   b    \ rS rSr% SrSr\\S'   Sr\	\
   \S'   \S\4S j5       rS\4S	 jrS
rg)PointerDownAction   z!Represents a pointer down action.r   buttonN
propertiesr/   c                     g)NpointerDownr   r1   s    r   r'   PointerDownAction.type       r   c                     U R                   U R                  S.nU R                  (       a)  UR                  U R                  R	                  5       5        U$ )z.Convert the PointerDownAction to a dictionary.r'   r   )r'   r   r   updater2   rW   s     r   r2   PointerDownAction.to_dict   s9    *.))t{{!K??MM$//1134r   r   )r   r   r   r   r   r   rZ   r5   r   r   rC   rf   r4   r'   r6   r2   r   r   r   r   r~   r~      sC    +FCO48J018c   r   r~   c                   N    \ rS rSr% SrSr\\S'   \S\	4S j5       r
S\4S jrSrg	)
PointerUpAction   zRepresents a pointer up action.r   r   r/   c                     g)N	pointerUpr   r1   s    r   r'   PointerUpAction.type   s    r   c                 4    U R                   U R                  S.$ )z,Convert the PointerUpAction to a dictionary.r   r   r1   s    r   r2   PointerUpAction.to_dict   s    		T[[99r   r   N)r   r   r   r   r   r   rZ   r5   rf   r4   r'   r6   r2   r   r   r   r   r   r      s3    )FCOc  : :r   r   c                       \ rS rSr% SrSr\\S'   Sr\\S'   Sr	\
\   \S'   Sr\
\\\4      \S'   Sr\
\   \S	'   \S
\4S j5       rS
\4S jrSrg)PointerMoveAction   z!Represents a pointer move action.r   xyNr_   originr   r/   c                     g)NpointerMover   r1   s    r   r'   PointerMoveAction.type   r   r   c                    U R                   U R                  U R                  S.nU R                  b  U R                  US'   U R                  bL  [        U R                  [        5      (       a  U R                  R                  5       US'   OU R                  US'   U R                  (       a)  UR                  U R                  R                  5       5        U$ )z.Convert the PointerMoveAction to a dictionary.)r'   r   r   r_   r   )
r'   r   r   r_   r   
isinstancer%   r2   r   r   rW   s     r   r2   PointerMoveAction.to_dict   s    *.))$&&tvv!N==$!%F:;;"$++}55#';;#6#6#8x #';;x ??MM$//1134r   r   )r   r   r   r   r   r   r[   r5   r   r_   r   rZ   r   r   r4   r%   r   rC   rf   r'   r6   r2   r   r   r   r   r   r      ss    +AuLAuL"Hhsm"26FHU3-./648J018c   r   r   c                       \ rS rSr% SrSr\\S'   Sr\\S'   Sr	\\S'   Sr
\\S'   Sr\\   \S	'   \R                  r\\\\4      \S
'   \S\4S j5       rS\4S jrSrg)WheelScrollAction   z!Represents a wheel scroll action.r   r   r   delta_xdelta_yNr_   r   r/   c                     g)Nscrollr   r1   s    r   r'   WheelScrollAction.type   s    r   c                 f   U R                   U R                  U R                  U R                  U R                  S.nU R
                  b  U R
                  US'   U R                  bM  [        U R                  [        5      (       a  U R                  R                  5       US'   U$ U R                  US'   U$ )z.Convert the WheelScrollAction to a dictionary.)r'   r   r   deltaXdeltaYr_   r   )
r'   r   r   r   r   r_   r   r   r%   r2   rW   s     r   r2   WheelScrollAction.to_dict   s     IIllll"
 ==$!%F:;;"$++}55#';;#6#6#8x   $(;;x r   r   )r   r   r   r   r   r   rZ   r5   r   r   r   r_   r   r   r"   r   r   r4   r%   rf   r'   r6   r2   r   r   r   r   r   r      s{    +AsJAsJGSGS"Hhsm"28//FHU3-./Ac   r   r   c                   j    \ rS rSr% SrSr\\S'   \" \	S9r
\	\   \S'   \S\4S j5       rS\4S	 jrS
rg)NoneSourceActionsi  z&Represents a sequence of none actions.rj   iddefault_factoryactionsr/   c                     g)Nnoner   r1   s    r   r'   NoneSourceActions.type  s    r   c                     U R                   U R                  U R                   Vs/ s H  oR                  5       PM     snS.$ s  snf )z.Convert the NoneSourceActions to a dictionary.r'   r   r   r'   r   r   r2   r,   actions     r   r2   NoneSourceActions.to_dict  8    		]a]i]i=j]iSYnn>N]i=jkk=j   Ar   N)r   r   r   r   r   r   r4   r5   r   listr   r]   rf   r'   r6   r2   r   r   r   r   r   r     sI    0BL!&t!<GT+<c  l lr   r   c                   v    \ rS rSr% SrSr\\S'   \" \	S9r
\	\\\\4      \S'   \S\4S j5       rS\4S	 jrS
rg)KeySourceActionsi  z%Represents a sequence of key actions.rj   r   r   r   r/   c                     g)Nkeyr   r1   s    r   r'   KeySourceActions.type$  s    r   c                     U R                   U R                  U R                   Vs/ s H  oR                  5       PM     snS.$ s  snf )z-Convert the KeySourceActions to a dictionary.r   r   r   s     r   r2   KeySourceActions.to_dict(  r   r   r   N)r   r   r   r   r   r   r4   r5   r   r   r   r   r]   rh   rv   rf   r'   r6   r2   r   r   r   r   r   r     sV    /BLDIZ^D_GT%]K?@A_c  l lr   r   c                       \ rS rSr% SrSr\\S'   Sr\	\
   \S'   \" \S9r\\\\\\4      \S'   S	 r\S
\4S j5       rS
\4S jrSrg)PointerSourceActionsi-  z)Represents a sequence of pointer actions.rj   r   N
parametersr   r   c                 >    U R                   c  [        5       U l         g g N)r   r8   r1   s    r   r=   "PointerSourceActions.__post_init__7  s    ??"/1DO #r   r/   c                     g)Nr!   r   r1   s    r   r'   PointerSourceActions.type;  ro   r   c                     U R                   U R                  U R                   Vs/ s H  oR                  5       PM     snS.nU R                  (       a  U R                  R                  5       US'   U$ s  snf )z1Convert the PointerSourceActions to a dictionary.r   r   )r'   r   r   r2   r   )r,   r   rX   s      r   r2   PointerSourceActions.to_dict?  s_     II''7;||D|V(|D"

 ??#'??#:#:#<F< 	 Es   A3)r   )r   r   r   r   r   r   r4   r5   r   r   r8   r   r   r   r   r]   r~   r   r   r=   rf   r'   r6   r2   r   r   r   r   r   r   -  st    3BL.2J*+2_d`GT%%6IZZ[\ 2 c  	 	r   r   c                   t    \ rS rSr% SrSr\\S'   \" \	S9r
\	\\\4      \S'   \S\4S j5       rS\4S	 jrS
rg)WheelSourceActionsiK  z'Represents a sequence of wheel actions.rj   r   r   r   r/   c                     g)Nwheelr   r1   s    r   r'   WheelSourceActions.typeR  rc   r   c                     U R                   U R                  U R                   Vs/ s H  oR                  5       PM     snS.$ s  snf )z/Convert the WheelSourceActions to a dictionary.r   r   r   s     r   r2   WheelSourceActions.to_dictV  r   r   r   N)r   r   r   r   r   r   r4   r5   r   r   r   r   r]   r   rf   r'   r6   r2   r   r   r   r   r   r   K  sU    1BL;@QU;VGT%%6678Vc  l lr   r   c                   ^    \ rS rSr% Sr\\S'   \\S'   Sr\	\
   \S'   \S\
SS 4S	 j5       rS
rg)FileDialogInfoi[  zERepresents file dialog information from input.fileDialogOpened event.contextmultipleNr(   datar/   c                 <    U " US   US   UR                  S5      S9$ )zCreates a FileDialogInfo instance from a dictionary.

Parameters:
-----------
    data: A dictionary containing the file dialog information.

Returns:
-------
    FileDialogInfo: A new instance of FileDialogInfo.
r   r   r(   )r   r   r(   )get)clsr   s     r   	from_dictFileDialogInfo.from_dictc  s&     4	?T*5EtxxXaObccr   r   )r   r   r   r   r   r4   r5   boolr(   r   r6   classmethodr   r   r   r   r   r   r   [  sB    OLN"GXd^"dT d&6 d dr   r   c                   ,    \ rS rSrSrSr\S 5       rSrg)FileDialogOpenedis  z-Event class for input.fileDialogOpened event.zinput.fileDialogOpenedc                 ,    [         R                  U5      $ )z%Create FileDialogInfo from JSON data.)r   r   )r   jsons     r   	from_jsonFileDialogOpened.from_jsonx  s     ''--r   r   N)	r   r   r   r   r   event_classr   r   r   r   r   r   r   r   s  s    7*K. .r   r   c            	           \ rS rSrSrS rS\S\\\	\
\\4      SS4S jrS\SS4S	 jrS\S
\S\\   SS4S jrS rS\SS4S jrSrg)Inputi~  z*
BiDi implementation of the input module.
c                 ,    Xl         0 U l        0 U l        g r   )connsubscriptions	callbacks)r,   r   s     r   r-   Input.__init__  s    	r   r   r   r/   Nc                     X Vs/ s H  o3R                  5       PM     snS.nU R                  R                  [        SU5      5        gs  snf )zPerforms a sequence of user input actions.

Parameters:
-----------
    context: The browsing context ID where actions should be performed.
    actions: A list of source actions to perform.
)r   r   zinput.performActionsN)r2   r   executer   )r,   r   r   r   paramss        r   perform_actionsInput.perform_actions  sE     %QX1YQXv..2BQX1YZ		/*@&IJ 2Zs   A	c                 V    SU0nU R                   R                  [        SU5      5        g)zReleases all input state for the given context.

Parameters:
-----------
    context: The browsing context ID to release actions for.
r   zinput.releaseActionsNr   r   r   )r,   r   r   s      r   release_actionsInput.release_actions  s(     W%		/*@&IJr   r(   filesc                 X    XUS.nU R                   R                  [        SU5      5        g)zSets files for a file input element.

Parameters:
-----------
    context: The browsing context ID.
    element: The element reference (script.SharedReference).
    files: A list of file paths to set.
)r   r(   r   zinput.setFilesNr   )r,   r   r(   r   r   s        r   	set_filesInput.set_files  s(     %5I		/*:FCDr   c                    [         R                  U R                  ;  aj  [        U R                  5      nU R                  R                  UR                  [         R                  5      5        / U R                  [         R                  '   U R                  R                  [         U5      nU R                  [         R                     R                  U5        XR                  U'   U$ )zAdd a handler for file dialog opened events.

Parameters:
-----------
    handler: Callback function that takes a FileDialogInfo object.

Returns:
--------
    int: Callback ID for removing the handler later.
)
r   r   r   r	   r   r   	subscribeadd_callbackappendr   )r,   handlersessioncallback_ids       r   add_file_dialog_handlerInput.add_file_dialog_handler  s     ''t/A/AAdii(GIIg//0@0L0LMN?AD/;;< ii,,-=wG+778??L&-{#r   r  c                 d   XR                   ;   a  U R                   U	 [        R                  U R                  ;   a  XR                  [        R                     ;   a,  U R                  [        R                     R	                  U5        U R                  [        R                     (       dh  [        U R                  5      nU R                  R                  UR                  [        R                  5      5        U R                  [        R                  	 U R                  R                  [        U5        g)z}Remove a file dialog handler.

Parameters:
-----------
    callback_id: The callback ID returned by add_file_dialog_handler.
N)
r   r   r   r   remover	   r   r   unsubscriberemove_callback)r,   r  r   s      r   remove_file_dialog_handler Input.remove_file_dialog_handler  s     ..({+''4+=+==001A1M1MNN""#3#?#?@GGT %%&6&B&BC!$)),		!!'"5"56F6R6R"ST&&'7'C'CD		!!"2K@r   )r   r   r   )r   r   r   r   r   r-   r4   r   r   r   r   r   r   r   r   r6   r   r  rZ   r  r   r   r   r   r   r   ~  s    
KK e-/?AUWiijkK 
	KKs Kt K
E 
Et 
EDI 
E$ 
E2Ac Ad Ar   r   )rP   dataclassesr   r   typingr   r   r   %selenium.webdriver.common.bidi.commonr   &selenium.webdriver.common.bidi.sessionr	   r   r   r%   r8   rC   r]   rh   rv   r~   r   r   r   r   r   r   r   r   r   r   r   r   r   <module>r     s  $  ( ' ' A :& &  < < < 2 2 2 , , ,`   " 8 8 8 8 8 8   $ : : :   8   D l l l l l l   : l l l d d d.. .\A \Ar   