
    $)fh+                        d dl mZ ddlmZmZ d dlmZ d dlZd dlZddl	m
Z
 ddl	mZ e G d d	             Ze G d
 d             Ze G d d             Ze G d d             Zd#dZd#dZ	 	 	 	 d$dZd%dZ	 	 	 	 d&dZ	 	 	 	 d'dZ	 	 	 	 	 	 d(dZ	 	 	 	 	 	 d)dZ	 	 	 	 d*dZ	 	 	 	 	 	 	 	 d+dZ ed      e G d d                    Z ed      e G d d                    Z ed       e G d! d"                    Zy),    )annotations   )event_classT_JSON_DICT)	dataclassN)dom)runtimec                      e Zd ZU dZded<   ded<   ded<   ded<   ded	<   ded
<   ded<   ded<   dZded<   dZded<   d Zed        Z	y)	Animationz
    Animation instance.
    strid_nameboolpaused_state
play_statefloatplayback_rate
start_timecurrent_timetype_Nz typing.Optional[AnimationEffect]sourcetyping.Optional[str]css_idc                   t               }| j                  |d<   | j                  |d<   | j                  |d<   | j                  |d<   | j
                  |d<   | j                  |d<   | j                  |d<   | j                  |d<   | j                  | j                  j                         |d	<   | j                  | j                  |d
<   |S )Nidr   pausedState	playStateplaybackRate	startTimecurrentTimetyper   cssId)dictr   r   r   r   r   r   r   r   r   to_jsonr   selfjsons     n/var/www/html/flask-app/venv/lib/python3.12/site-packages/selenium/webdriver/common/devtools/v121/animation.pyr$   zAnimation.to_json4   s    vXXT
yyV"//] OO[#11^ OO["//]zzV;;"![[002DN;;" KKDM    c                L    | t        |d         t        |d         t        |d         t        |d         t        |d         t        |d         t        |d         t        |d         d	|v rt        j	                  |d	         nd d
|v rt        |d
         
      S d 
      S )Nr   r   r   r   r   r   r    r!   r   r"   )
r   r   r   r   r   r   r   r   r   r   )r   r   r   AnimationEffect	from_jsonclsr'   s     r(   r,   zAnimation.from_jsonD   s    DJT&\"d=124,-^ 45T+./tM23d6l#@HD@P?,,T(^<VZ)0D3tG}%
 	
 ?C
 	
r)   )
__name__
__module____qualname____doc____annotations__r   r   r$   classmethodr,    r)   r(   r   r      sv     
H I  O    J 04F,3 $(F '  
 
r)   r   c                      e Zd ZU dZded<   ded<   ded<   ded<   ded<   ded	<   ded
<   ded<   dZded<   dZded<   d Zed        Z	y)r+   z"
    AnimationEffect instance
    r   delay	end_delayiteration_start
iterationsdurationr   	directionfilleasingNz"typing.Optional[dom.BackendNodeId]backend_node_idztyping.Optional[KeyframesRule]keyframes_rulec                   t               }| j                  |d<   | j                  |d<   | j                  |d<   | j                  |d<   | j
                  |d<   | j                  |d<   | j                  |d<   | j                  |d<   | j                  | j                  j                         |d	<   | j                  | j                  j                         |d
<   |S )Nr7   endDelayiterationStartr:   r;   r<   r=   r>   backendNodeIdkeyframesRule)r#   r7   r8   r9   r:   r;   r<   r=   r>   r?   r$   r@   r%   s     r(   r$   zAnimationEffect.to_jsonw   s    v

W>>Z!%!5!5!__\==Z NN[yyVX+$($8$8$@$@$BD!*$($7$7$?$?$AD!r)   c                t    | t        |d         t        |d         t        |d         t        |d         t        |d         t        |d         t        |d         t        |d         d	|v r"t        j                  j	                  |d	         nd d
|v rt
        j	                  |d
         
      S d 
      S )Nr7   rB   rC   r:   r;   r<   r=   r>   rD   rE   )
r7   r8   r9   r:   r;   r<   r=   r>   r?   r@   )r   r   r   BackendNodeIdr,   KeyframesRuler-   s     r(   r,   zAnimationEffect.from_json   s    W&D,-!$'7"89T,/04
+,${+,T&\"tH~&RaeiRiC--77_8MNosM\`dMd=2243HI
 	
 ko
 	
r)   )
r/   r0   r1   r2   r3   r?   r@   r$   r4   r,   r5   r)   r(   r+   r+   T   su     L    O N I K ;?O7> 6:N29  
 
r)   r+   c                  @    e Zd ZU dZded<   dZded<   d Zed        Zy)	rH   z
    Keyframes Rule
    ztyping.List[KeyframeStyle]	keyframesNr   r   c                    t               }| j                  D cg c]  }|j                          c}|d<   | j                  | j                  |d<   |S c c}w )NrJ   r   )r#   rJ   r$   r   )r&   r'   is      r(   r$   zKeyframesRule.to_json   sJ    v26..AQQYY[A[99 99DL Bs   Ac                     | |d   D cg c]  }t         j                  |       c}d|v rt        |d               S d       S c c}w )NrJ   r   )rJ   r   )KeyframeStyler,   r   )r.   r'   rL   s      r(   r,   zKeyframesRule.from_json   sO    ;?;LMa}..q1M&,nT&\"
 	
:>
 	
Ms   A)	r/   r0   r1   r2   r3   r   r$   r4   r,   r5   r)   r(   rH   rH      s5     *) "&D
% 
 
r)   rH   c                  <    e Zd ZU dZded<   ded<   d Zed        Zy)rN   z
    Keyframe Style
    r   offsetr>   c                V    t               }| j                  |d<   | j                  |d<   |S )NrP   r>   )r#   rP   r>   r%   s     r(   r$   zKeyframeStyle.to_json   s(    vXXr)   c                F     | t        |d         t        |d               S )NrP   r>   )rP   r>   r   r-   s     r(   r,   zKeyframeStyle.from_json   s'    tH~&tH~&
 	
r)   N)r/   r0   r1   r2   r3   r$   r4   r,   r5   r)   r(   rN   rN      s.     K K 
 
r)   rN   c               #     K   ddi} | }yw)z2
    Disables animation domain notifications.
    methodzAnimation.disableNr5   cmd_dictr'   s     r(   disablerX      s     
 	%H >D   
c               #     K   ddi} | }yw)z1
    Enables animation domain notifications.
    rU   zAnimation.enableNr5   rV   s     r(   enabler[      s     
 	$H >DrY   c              #  V   K   t               }| |d<   d|d}|}t        |d         S w)z
    Returns the current time of the an animation.

    :param id_: Id of animation.
    :returns: Current time of the page.
    r   zAnimation.getCurrentTimerU   paramsr    )r#   r   )r   r^   rW   r'   s       r(   get_current_timer_      s>      &FF4L,H >Dm$%%s   ')c               #  6   K   ddi} | }t        |d         S w)zo
    Gets the playback rate of the document timeline.

    :returns: Playback rate for animations on page.
    rU   zAnimation.getPlaybackRater   )r   rV   s     r(   get_playback_ratera      s.      	-H >Dn%&&s   c              #  b   K   t               }| D cg c]  }| c}|d<   d|d}|}yc c}w w)zz
    Releases a set of animations to no longer be manipulated.

    :param animations: List of animation ids to seek.
    
animationszAnimation.releaseAnimationsr]   Nr#   )rc   r^   rL   rW   r'   s        r(   release_animationsre      s?      &F'12!A2F</H >D 3s   /	*/c              #  ~   K   t               }| |d<   d|d}|}t        j                  j                  |d         S w)z
    Gets the remote object of the Animation.

    :param animation_id: Animation id.
    :returns: Corresponding remote object.
    animationIdzAnimation.resolveAnimationr]   remoteObject)r#   r	   RemoteObjectr,   )animation_idr^   rW   r'   s       r(   resolve_animationrk     sK      &F(F=.H >D))$~*>??s   ;=c              #  l   K   t               }| D cg c]  }| c}|d<   ||d<   d|d}|}yc c}w w)z
    Seek a set of animations to a particular time within each animation.

    :param animations: List of animation ids to seek.
    :param current_time: Set the current time of each animation.
    rc   r    zAnimation.seekAnimationsr]   Nrd   )rc   r   r^   rL   rW   r'   s         r(   seek_animationsrm   "  sI      &F'12!A2F<(F=,H >D 3   4	/4c              #  l   K   t               }| D cg c]  }| c}|d<   ||d<   d|d}|}yc c}w w)z
    Sets the paused state of a set of animations.

    :param animations: Animations to set the pause state of.
    :param paused: Paused state to set to.
    rc   pausedzAnimation.setPausedr]   Nrd   )rc   rp   r^   rL   rW   r'   s         r(   
set_pausedrq   6  sI      &F'12!A2F<F8'H >D 3rn   c              #  <   K   t               }| |d<   d|d}|}yw)zz
    Sets the playback rate of the document timeline.

    :param playback_rate: Playback rate for animations on page
    r   zAnimation.setPlaybackRater]   Nrd   )r   r^   rW   r'   s       r(   set_playback_raters   J  s/      &F*F>-H >Ds   c              #  P   K   t               }| |d<   ||d<   ||d<   d|d}|}yw)z
    Sets the timing of an animation node.

    :param animation_id: Animation id.
    :param duration: Duration of the animation.
    :param delay: Delay of the animation.
    rg   r;   r7   zAnimation.setTimingr]   Nrd   )rj   r;   r7   r^   rW   r'   s         r(   
set_timingru   [  sB      &F(F=!F:F7O'H >Ds   $&zAnimation.animationCanceledc                  .    e Zd ZU dZded<   edd       Zy)AnimationCanceledz9
    Event for when an animation has been cancelled.
    r   r   c                ,     | t        |d               S Nr   )r   rS   r-   s     r(   r,   zAnimationCanceled.from_json{      DJ
 	
r)   N)r'   r   returnrw   r/   r0   r1   r2   r3   r4   r,   r5   r)   r(   rw   rw   r        
H
 
r)   rw   zAnimation.animationCreatedc                  .    e Zd ZU dZded<   edd       Zy)AnimationCreatedz9
    Event for each animation that has been created.
    r   r   c                ,     | t        |d               S ry   rS   r-   s     r(   r,   zAnimationCreated.from_json  rz   r)   N)r'   r   r{   r   r|   r5   r)   r(   r   r     r}   r)   r   zAnimation.animationStartedc                  .    e Zd ZU dZded<   edd       Zy)AnimationStartedz4
    Event for animation that has been started.
    r   	animationc                @     | t         j                  |d               S )Nr   )r   )r   r,   r-   s     r(   r,   zAnimationStarted.from_json  s"    ))${*;<
 	
r)   N)r'   r   r{   r   r|   r5   r)   r(   r   r     s!     
 
r)   r   )r{   0typing.Generator[T_JSON_DICT, T_JSON_DICT, None])r   r   r{   1typing.Generator[T_JSON_DICT, T_JSON_DICT, float])r{   r   )rc   typing.List[str]r{   r   )rj   r   r{   z@typing.Generator[T_JSON_DICT, T_JSON_DICT, runtime.RemoteObject])rc   r   r   r   r{   r   )rc   r   rp   r   r{   r   )r   r   r{   r   )rj   r   r;   r   r7   r   r{   r   )
__future__r   utilr   r   dataclassesr   enumtyping r   r	   r   r+   rH   rN   rX   r[   r_   ra   re   rk   rm   rq   rs   ru   rw   r   r   r5   r)   r(   <module>r      s   # * !     @
 @
 @
F ?
 ?
 ?
D 
 
 
2 
 
 
0&&	8&&
'$	7"@@	G@&$ 
8($ 
8(	7"  
8	. *+

 
  ,
 )*

 
  +
 )*

 
  +
r)   