
    X j=7                     R   S SK r 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      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)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       u/root/GenerationalWealth/GenerationalWealth/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+   r0   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 )r8   r	   r   
ValueErrorr/   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)r8   r/   s    r   r0   PointerParameters.to_dictE   s    t0011r   r   N)r   r   r   r   r   r	   r   r8   r2   r3   r;   r4   r0   r   r   r   r   r6   r6   ;   s'    <#))L#)u2 2r   r6   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 )NrC   zwidth must be at least 1zheight must be at least 1rF   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π)
rD   r:   rE   rG   rH   rI   rJ   mathpirK   r/   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.rC   rD   rE   rF   rG   tangentialPressurer   rI   altitudeAngleazimuthAngle)rD   rE   rG   rH   rI   rJ   rK   r*   results     r   r0   PointerCommonProperties.to_dictf   s    !#::?"jjF7O;;!#{{F8==C!%F:##s*+/+C+CF'(::?"jjF7O#%&*&9&9F?#$%)%7%7F>"r   r   N)r   r   r   r   r   rD   intr3   rE   rG   floatrH   rI   rJ   rK   r;   r4   r0   r   r   r   r   rA   rA   J   s[    0E3NFCOHe!$$E3NNEM5J  r   rA   c                   T    \ rS rSr% SrSr\S-  \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   r/   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]   rU   s     r   r0   PauseAction.to_dict   s-    "($))!4==$!%F:r   r   )r   r   r   r   r   r]   rX   r3   propertyr2   r%   r4   r0   r   r   r   r   r[   r[   {   s8    $HcDj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   r/   s    r   r%   KeyDownAction.type       r   c                 4    U R                   U R                  S.$ )z*Convert the KeyDownAction to a dictionary.r%   ri   ro   r/   s    r   r0   KeyDownAction.to_dict       		DJJ77r   r   Nr   r   r   r   r   ri   r2   r3   rd   r%   r4   r0   r   r   r   r   rf   rf      s3    'E3Oc  8 8r   rf   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.rh   ri   r-   c                     g)NkeyUpr   r/   s    r   r%   KeyUpAction.type   ra   r   c                 4    U R                   U R                  S.$ )z(Convert the KeyUpAction to a dictionary.ro   ro   r/   s    r   r0   KeyUpAction.to_dict   rq   r   r   Nrr   r   r   r   rt   rt      s3    %E3Oc  8 8r   rt   c                   b    \ rS rSr% SrSr\\S'   Sr\	S-  \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   r/   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   updater0   rU   s     r   r0   PointerDownAction.to_dict   s9    *.))t{{!K??MM$//1134r   r   )r   r   r   r   r   r~   rX   r3   r   rA   rd   r2   r%   r4   r0   r   r   r   r   r|   r|      sC    +FCO15J'$.5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   r/   s    r   r%   PointerUpAction.type   s    r   c                 4    U R                   U R                  S.$ )z,Convert the PointerUpAction to a dictionary.r   r   r/   s    r   r0   PointerUpAction.to_dict   s    		T[[99r   r   N)r   r   r   r   r   r~   rX   r3   rd   r2   r%   r4   r0   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'   Sr\\-  S-  \S'   Sr\S-  \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   r/   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#   r0   r   r   rU   s     r   r0   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   rY   r3   r   r]   rX   r   r2   r#   r   rA   rd   r%   r4   r0   r   r   r   r   r   r      sn    +AuLAuLHcDj)-FC-$&-15J'$.5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-  \S	'   \R                  r\\-  S-  \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   r/   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#   r0   rU   s     r   r0   WheelScrollAction.to_dict   s     IIllll"
 ==$!%F:;;"$++}55#';;#6#6#8x   $(;;x r   r   )r   r   r   r   r   r   rX   r3   r   r   r   r]   r   r    r   r2   r#   rd   r%   r4   r0   r   r   r   r   r   r      sv    +AsJAsJGSGSHcDj)/FC-$&8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.rh   iddefault_factoryactionsr-   c                     g)Nnoner   r/   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   r0   r*   actions     r   r0   NoneSourceActions.to_dict  8    		]a]i]i=j]iSYnn>N]i=jkk=j   Ar   N)r   r   r   r   r   r   r2   r3   r   listr   r[   rd   r%   r4   r0   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
\	\\-  \-     \S'   \S\4S j5       rS\4S	 jrS
rg)KeySourceActionsi  z%Represents a sequence of key actions.rh   r   r   r   r-   c                     g)Nkeyr   r/   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   r0   KeySourceActions.to_dict(  r   r   r   N)r   r   r   r   r   r   r2   r3   r   r   r   r[   rf   rt   rd   r%   r4   r0   r   r   r   r   r   r     sT    /BL?DUY?ZGT+-;<Zc  l lr   r   c                       \ rS rSr% SrSr\\S'   Sr\	S-  \S'   \
" \S9r\\\-  \-  \-     \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.rh   r   N
parametersr   r   c                 >    U R                   c  [        5       U l         g g N)r   r6   r/   s    r   r;   "PointerSourceActions.__post_init__5  s    ??"/1DO #r   r-   c                     g)Nr   r   r/   s    r   r%   PointerSourceActions.type9  rm   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   r0   r   )r*   r   rV   s      r   r0   PointerSourceActions.to_dict=  s_     II''7;||D|V(|D"

 ??#'??#:#:#<F< 	 Es   A3)r   )r   r   r   r   r   r   r2   r3   r   r6   r   r   r   r[   r|   r   r   r;   rd   r%   r4   r0   r   r   r   r   r   r   -  sp    3BL+/J!D(/[`qu[vGT+ 11OCFWWXv2 c  	 	r   r   c                   p    \ 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)WheelSourceActionsiI  z'Represents a sequence of wheel actions.rh   r   r   r   r-   c                     g)Nwheelr   r/   s    r   r%   WheelSourceActions.typeP  ra   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   r0   WheelSourceActions.to_dictT  r   r   r   N)r   r   r   r   r   r   r2   r3   r   r   r   r[   r   rd   r%   r4   r0   r   r   r   r   r   r   I  sO    1BL5:45PGT+ 112Pc  l lr   r   c                   ^    \ rS rSr% Sr\\S'   \\S'   Sr\	S-  \S'   \
S\	SS 4S	 j5       rS
rg)FileDialogInfoiY  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.

Args:
    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_dicta  s&     4	?T*5EtxxXaObccr   r   )r   r   r   r   r   r2   r3   boolr&   r4   classmethodr   r   r   r   r   r   r   Y  sB    OLNGTD[	dT 	d&6 	d 	dr   r   c                   ,    \ rS rSrSrSr\S 5       rSrg)FileDialogOpenedio  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_jsont  s     ''--r   r   N)	r   r   r   r   r   event_classr   r   r   r   r   r   r   r   o  s    7*K. .r   r   c                       \ rS rSrSrS rS\S\\\	-  \
-  \-     SS4S jrS\SS4S	 jrS\S
\S\\   SS4S jrS\4S jrS\SS4S jrSrg)Inputiz  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.

Args:
    context: The browsing context ID where actions should be performed.
    actions: A list of source actions to perform.
)r   r   zinput.performActionsN)r0   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)ztReleases all input state for the given context.

Args:
    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.

Args:
    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.

Args:
    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)zkRemove a file dialog handler.

Args:
    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+   r2   r   r   r   r   r   r   r   r4   r   rX   r   r  r   r   r   r   r   r   z  s    2
KK '*::=QQTffgK 
	KKs Kt K	E 	Et 	EDI 	E$ 	E# .Ac Ad Ar   r   )rN   dataclassesr   r   typingr   %selenium.webdriver.common.bidi.commonr   &selenium.webdriver.common.bidi.sessionr   r	   r   r#   r6   rA   r[   rf   rt   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   6 l l l d d d*. .TA TAr   