
    'j                     d    d dl Z d dlmZmZmZ d dlmZ d dlmZ erd dl	m
Z
  G d d          ZdS )    N)TYPE_CHECKINGOptionalUnion)Artifact)Error)Pagec                       e Zd Zdddee         ddfdZdefdZdej	        fdZ
d	eeej	        f         ddfd
ZddZdS )Videopager   artifactreturnNc                 t    |j         | _         |j        | _        || _        |j        j        | _        || _        d S N)_loop_dispatcher_fiber_page_connection	is_remote
_is_remote	_artifact)selfr   r   s      [/home/ice/.hermes/hermes-agent/venv/lib/python3.11/site-packages/playwright/_impl/_video.py__init__zVideo.__init__   s5    Z
!%!7
*4!    c                     d| j          dS )Nz<Video page=>)r   r   s    r   __repr__zVideo.__repr__!   s    +dj++++r   c                 v   K   | j         rt          d          | j        st          d          | j        j        S )Nz[Path is not available when using browserType.connect(). Use save_as() to save a local copy.%Video recording has not been started.)r   r   r   absolute_pathr   s    r   pathz
Video.path$   sL      ? 	m   ~ 	A?@@@~++r   r"   c                    K   | j         j        j        r| j         j        st	          d          | j        st	          d          | j                            |           d {V  d S )Nz?Page is not yet closed. Close the page prior to calling save_asr    )r   r   _is_sync
_is_closedr   r   save_as)r   r"   s     r   r&   zVideo.save_as-   s      :!* 	4:3H 	Q   ~ 	A?@@@n$$T***********r   c                 Z   K   | j         r!| j                                          d {V  d S d S r   )r   deleter   s    r   r(   zVideo.delete6   sF      > 	*.'')))))))))))	* 	*r   )r   N)__name__
__module____qualname__r   r   r   strr   pathlibPathr"   r   r&   r(    r   r   r
   r
      s        "V "x/A "d " " " ",# , , , ,,GL , , , ,+%W\(9": +t + + + +* * * * * *r   r
   )r-   typingr   r   r   playwright._impl._artifactr   playwright._impl._helperr   playwright._impl._pager   r
   r/   r   r   <module>r4      s     1 1 1 1 1 1 1 1 1 1 / / / / / / * * * * * * ,++++++* * * * * * * * * *r   