
    aDgS,                        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dZed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     M/var/www/highfloat_scraper/venv/lib/python3.12/site-packages/cdp/animation.pyr$   zAnimation.to_json6   s     F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_jsonF   s    DJT&\"d=124,-^ 45T+./tM23d6l#@HD@P?,,T(^<VZ)0D3tG}%
 	
 ?C
 	
r)   returnr   )r'   r   r0   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dZed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 )Nr9   endDelayiterationStartr<   r=   r>   r?   r@   backendNodeIdkeyframesRule)r#   r9   r:   r;   r<   r=   r>   r?   r@   rA   r$   rB   r%   s     r(   r$   zAnimationEffect.to_jsony   s     F

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 )Nr9   rD   rE   r<   r=   r>   r?   r@   rF   rG   )
r9   r:   r;   r<   r=   r>   r?   r@   rA   rB   )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/   )r'   r   r0   r+   )
r1   r2   r3   r4   r5   rA   rB   r$   r6   r,   r7   r)   r(   r+   r+   V   su     L    O N I K ;?O7> 6:N29  
 
r)   r+   c                  D    e Zd ZU dZded<   dZded<   d	dZed
d       Zy)rJ   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 )NrL   r   )r#   rL   r$   r   )r&   r'   is      r(   r$   zKeyframesRule.to_json   sJ     F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 )NrL   r   )rL   r   )KeyframeStyler,   r   )r.   r'   rN   s      r(   r,   zKeyframesRule.from_json   sO    ;?;LMa}..q1M&,nT&\"
 	
:>
 	
Ms   Ar/   )r'   r   r0   rJ   )	r1   r2   r3   r4   r5   r   r$   r6   r,   r7   r)   r(   rJ   rJ      s5     *) "&D
% 
 
r)   rJ   c                  @    e Zd ZU dZded<   ded<   ddZed	d       Zy)
rP   z
    Keyframe Style
    r   offsetr@   c                V    t               }| j                  |d<   | j                  |d<   |S )NrR   r@   )r#   rR   r@   r%   s     r(   r$   zKeyframeStyle.to_json   s(     FXXr)   c                F     | t        |d         t        |d               S )NrR   r@   )rR   r@   r   r-   s     r(   r,   zKeyframeStyle.from_json   s'    tH~&tH~&
 	
r)   Nr/   )r'   r   r0   rP   )r1   r2   r3   r4   r5   r$   r6   r,   r7   r)   r(   rP   rP      s.     K K 
 
r)   rP   c               #     K   ddi} | }yw)z2
    Disables animation domain notifications.
    methodzAnimation.disableNr7   cmd_dictr'   s     r(   disablerZ      s     
 	%H >D   
c               #     K   ddi} | }yw)z1
    Enables animation domain notifications.
    rW   zAnimation.enableNr7   rX   s     r(   enabler]      s     
 	$H >Dr[   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rW   paramsr    )r#   r   )r   r`   rY   r'   s       r(   get_current_timera      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.
    rW   zAnimation.getPlaybackRater   )r   rX   s     r(   get_playback_raterc      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#   )re   r`   rN   rY   r'   s        r(   release_animationsrg      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`   rY   r'   s       r(   resolve_animationrm     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.
    re   r    zAnimation.seekAnimationsr_   Nrf   )re   r   r`   rN   rY   r'   s         r(   seek_animationsro   $  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.
    re   pausedzAnimation.setPausedr_   Nrf   )re   rr   r`   rN   rY   r'   s         r(   
set_pausedrs   8  sI      &F'12!A2F<F8'H >D 3rp   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_   Nrf   )r   r`   rY   r'   s       r(   set_playback_rateru   L  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.
    ri   r=   r9   zAnimation.setTimingr_   Nrf   )rl   r=   r9   r`   rY   r'   s         r(   
set_timingrw   ]  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   rU   r-   s     r(   r,   zAnimationCanceled.from_json}      DJ
 	
r)   N)r'   r   r0   ry   r1   r2   r3   r4   r5   r6   r,   r7   r)   r(   ry   ry   t        
H
 
r)   ry   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 r{   rU   r-   s     r(   r,   zAnimationCreated.from_json  r|   r)   N)r'   r   r0   r   r}   r7   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   r0   r   r}   r7   r)   r(   r   r     s!     
 
r)   r   )r0   0typing.Generator[T_JSON_DICT, T_JSON_DICT, None])r   r   r0   1typing.Generator[T_JSON_DICT, T_JSON_DICT, float])r0   r   )re   typing.List[str]r0   r   )rl   r   r0   z@typing.Generator[T_JSON_DICT, T_JSON_DICT, runtime.RemoteObject])re   r   r   r   r0   r   )re   r   rr   r   r0   r   )r   r   r0   r   )rl   r   r=   r   r9   r   r0   r   )
__future__r   cdp.utilr   r   dataclassesr   enumtyping r   r	   r   r+   rJ   rP   rZ   r]   ra   rc   rg   rm   ro   rs   ru   rw   ry   r   r   r7   r)   r(   <module>r      s   # - !     @
 @
 @
F ?
 ?
 ?
D 
 
 
2 
 
 
0&&	8&&
'$	7"@@	G@&$ 
8($ 
8(	7"  
8	. *+

 
  ,
 )*

 
  +
 )*

 
  +
r)   