a
    $ñ»jª ã                	   @  sŒ  d dl mZ d dlZd dlZd dlmZ ddlmZmZ ddl	m
Z
 ddl	mZ ddl	mZ G d	d
„ d
eƒZG dd„ deƒZG dd„ deƒZeG dd„ dƒƒZG dd„ dejƒZG dd„ dejƒZG dd„ dejƒZG dd„ dejƒZG dd„ dejƒZG dd„ dejƒZeG dd„ dƒƒZeG dd „ d ƒƒZG d!d"„ d"eƒZeG d#d$„ d$ƒƒZeG d%d&„ d&ƒƒZeG d'd(„ d(ƒƒZ eG d)d*„ d*ƒƒZ!d
d+d,œd-d.„Z"�dd
d
d/d0d1œd2d3„Z#�dd/d4d5d6d7d8d9œd:d;„Z$�dd/d4d5d<d=d>œd?d@„Z%d=dAœdBdC„Z&dDd=dEœdFdG„Z'�ddHd=dIœdJdK„Z(�dd/d4d5d=dLœdMdN„Z)d
d+d,œdOdP„Z*�dd/d4d5dQdLœdRdS„Z+�dd/d4d5dTdLœdUdV„Z,�dd6d7d8dWœdXdY„Z-�dd6d7dZdWœd[d\„Z.�dd
d]d7d^d_œd`da„Z/�ddbdbd7d7dcddœdedf„Z0�dd/d4d5d7dgdhœdidj„Z1d
d0d,œdkdl„Z2dDdbdbd^dmœdndo„Z3d=dAœdpdq„Z4d=dAœdrds„Z5d=dAœdtdu„Z6d=dAœdvdw„Z7�dd
d
d/d0d1œdxdy„Z8�ddDd7dzd{œd|d}„Z9dDd0d~œdd€„Z:d�d^d‚œdƒd„„Z;d
dDd0d…œd†d‡„Z<d
dDd^d…œdˆd‰„Z=d^dAœdŠd‹„Z>d
dDd0dŒœd�dŽ„Z?d=dAœd�d�„Z@d
dDd=d‘œd’d“„ZAd
d=d,œd”d•„ZB�dd
d6d7d=d–œd—d˜„ZCd™d0dšœd›dœ„ZD�dd/d4dHd�dždŸœd d¡„ZEd
dDdDd=d¢œd£d¤„ZF�dd
dDdHd=d¥œd¦d§„ZG�dd¨d/d4d5d=d©œdªd«„ZHd¬d=d­œd®d¯„ZId
d°d,œd±d²„ZJd™dgdšœd³d´„ZKd
d=d,œdµd¶„ZLd
dDd0d‘œd·d¸„ZMd
dDd=d¹œdºd»„ZNd
dDd=d¼œd½d¾„ZOd=dAœd¿dÀ„ZPdÁdÂdÃœdÄdÅ„ZQ�dd
dHdÆdÇd7d7dÈdÉœdÊdË„ZRd
d^d,œdÌdÍ„ZS�d d
dHd0dÎœdÏdÐ„ZTd
d¬d^dÑœdÒdÓ„ZUedÔƒeG dÕdÖ„ dÖƒƒƒZVed×ƒeG dØdÙ„ dÙƒƒƒZWedÚƒeG dÛdÜ„ dÜƒƒƒZXedÝƒeG dÞdß„ dßƒƒƒZYedàƒeG dádâ„ dâƒƒƒZZedãƒeG dädå„ dåƒƒƒZ[edæƒeG dçdè„ dèƒƒƒZ\edéƒeG dêdë„ dëƒƒƒZ]edìƒeG dídî„ dîƒƒƒZ^edïƒeG dðdñ„ dñƒƒƒZ_edòƒeG dódô„ dôƒƒƒZ`edõƒeG död÷„ d÷ƒƒƒZaedøƒeG dùdú„ dúƒƒƒZbedûƒeG düdý„ dýƒƒƒZcedþƒeG dÿ�d „ �d ƒƒƒZde�dƒeG �d�d„ �dƒƒƒZee�dƒeG �d�d„ �dƒƒƒZfe�dƒeG �d�d	„ �d	ƒƒƒZge�d
ƒeG �d�d„ �dƒƒƒZhdS (!  é    )ÚannotationsN)Ú	dataclassé   )Úevent_classÚT_JSON_DICT)Únetwork)Úpage)Úruntimec                      sB   e Zd ZdZddœdd„Zedd dœdd„ƒZ‡ fd	d
„Z‡  ZS )ÚNodeIdzUnique DOM node identifier.Úint©Úreturnc                 C  s   | S ©N© ©Úselfr   r   ú/E:\soccer\ml_env\Lib\site-packages\mycdp/dom.pyÚto_json   s    zNodeId.to_json©Újsonr   c                 C  s   | |ƒS r   r   ©Úclsr   r   r   r   Ú	from_json   s    zNodeId.from_jsonc                   s   d  tƒ  ¡ ¡S )Nz
NodeId({})©ÚformatÚsuperÚ__repr__r   ©Ú	__class__r   r   r      s    zNodeId.__repr__©	Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   Úclassmethodr   r   Ú__classcell__r   r   r   r   r
      s
   r
   c                      sB   e Zd ZdZddœdd„Zedd dœdd„ƒZ‡ fd	d
„Z‡  ZS )ÚStyleSheetIdz'Unique identifier for a CSS stylesheet.Ústrr   c                 C  s   | S r   r   r   r   r   r   r   #   s    zStyleSheetId.to_jsonr   c                 C  s   | |ƒS r   r   r   r   r   r   r   &   s    zStyleSheetId.from_jsonc                   s   d  tƒ  ¡ ¡S )NzStyleSheetId({})r   r   r   r   r   r   *   s    zStyleSheetId.__repr__r   r   r   r   r   r&       s
   r&   c                      sB   e Zd ZdZddœdd„Zedd dœdd„ƒZ‡ fd	d
„Z‡  ZS )ÚBackendNodeIdzq
    Unique DOM node identifier used to reference a node
    that may not have been pushed to the front-end.
    r   r   c                 C  s   | S r   r   r   r   r   r   r   4   s    zBackendNodeId.to_jsonr   c                 C  s   | |ƒS r   r   r   r   r   r   r   7   s    zBackendNodeId.from_jsonc                   s   d  tƒ  ¡ ¡S )NzBackendNodeId({})r   r   r   r   r   r   ;   s    zBackendNodeId.__repr__r   r   r   r   r   r(   .   s
   r(   c                   @  sL   e Zd ZU dZded< ded< ded< dd	œd
d„Zedd dœdd„ƒZdS )ÚBackendNodez"Backend node with a friendly name.r   Ú	node_typer'   Ú	node_namer(   Úbackend_node_idr   r   c                 C  s,   t ƒ }| j|d< | j|d< | j ¡ |d< |S )NÚnodeTypeÚnodeNameÚbackendNodeId)Údictr*   r+   r,   r   ©r   r   r   r   r   r   H   s
    

zBackendNode.to_jsonr   c                 C  s.   | t | d¡ƒt| d¡ƒt | d¡¡d�S )Nr-   r.   r/   )r*   r+   r,   )r   Úgetr'   r(   r   r   r   r   r   r   O   s
    ýzBackendNode.from_jsonN©r    r!   r"   r#   Ú__annotations__r   r$   r   r   r   r   r   r)   ?   s   
r)   c                   @  sÖ   e Zd ZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZ dZ!d Z"d!Z#d"Z$d#Z%d$Z&d%Z'd&Z(d'Z)d(Z*d)Z+d*Z,d+d,œd-d.„Z-e.d+d d/œd0d1„ƒZ/d2S )3Ú
PseudoTypezPseudo element type.z
first-linezfirst-letterZ	checkmarkÚbeforeÚafterzexpand-iconzpicker-iconzinterest-hintÚmarkerZbackdropÚcolumnZ	selectionzsearch-textztarget-textzspelling-errorzgrammar-errorÚ	highlightzfirst-line-inheritedzscroll-markerzscroll-marker-groupzscroll-buttonZ	scrollbarzscrollbar-thumbzscrollbar-buttonzscrollbar-trackzscrollbar-track-piecezscrollbar-cornerZresizerzinput-list-buttonzview-transitionzview-transition-groupzview-transition-image-pairzview-transition-group-childrenzview-transition-oldzview-transition-newÚplaceholderzfile-selector-buttonzdetails-contentZpickerzpermission-iconzoverscroll-area-parentr'   r   c                 C  s   | j S r   ©Úvaluer   r   r   r   r   „   s    zPseudoType.to_jsonr   c                 C  s   | |ƒS r   r   r   r   r   r   r   ‡   s    zPseudoType.from_jsonN)0r    r!   r"   r#   Z
FIRST_LINEZFIRST_LETTERZ	CHECKMARKZBEFOREZAFTERZEXPAND_ICONZPICKER_ICONZINTEREST_HINTZMARKERZBACKDROPZCOLUMNZ	SELECTIONZSEARCH_TEXTZTARGET_TEXTZSPELLING_ERRORZGRAMMAR_ERRORZ	HIGHLIGHTZFIRST_LINE_INHERITEDZSCROLL_MARKERZSCROLL_MARKER_GROUPZSCROLL_BUTTONZ	SCROLLBARZSCROLLBAR_THUMBZSCROLLBAR_BUTTONZSCROLLBAR_TRACKZSCROLLBAR_TRACK_PIECEZSCROLLBAR_CORNERZRESIZERZINPUT_LIST_BUTTONZVIEW_TRANSITIONZVIEW_TRANSITION_GROUPZVIEW_TRANSITION_IMAGE_PAIRZVIEW_TRANSITION_GROUP_CHILDRENZVIEW_TRANSITION_OLDZVIEW_TRANSITION_NEWZPLACEHOLDERZFILE_SELECTOR_BUTTONZDETAILS_CONTENTZPICKERZPERMISSION_ICONZOVERSCROLL_AREA_PARENTr   r$   r   r   r   r   r   r5   X   sZ   r5   c                   @  s>   e Zd ZdZdZdZdZddœdd„Zedd d	œd
d„ƒZ	dS )ÚShadowRootTypezShadow root type.z
user-agentÚopenÚclosedr'   r   c                 C  s   | j S r   r<   r   r   r   r   r   ’   s    zShadowRootType.to_jsonr   c                 C  s   | |ƒS r   r   r   r   r   r   r   •   s    zShadowRootType.from_jsonN)
r    r!   r"   r#   Z
USER_AGENTZOPEN_ZCLOSEDr   r$   r   r   r   r   r   r>   Œ   s   r>   c                   @  s>   e Zd ZdZdZdZdZddœdd„Zedd d	œd
d„ƒZ	dS )ÚCompatibilityModezDocument compatibility mode.Z
QuirksModeZLimitedQuirksModeZNoQuirksModer'   r   c                 C  s   | j S r   r<   r   r   r   r   r       s    zCompatibilityMode.to_jsonr   c                 C  s   | |ƒS r   r   r   r   r   r   r   £   s    zCompatibilityMode.from_jsonN)
r    r!   r"   r#   ZQUIRKS_MODEZLIMITED_QUIRKS_MODEZNO_QUIRKS_MODEr   r$   r   r   r   r   r   rA   š   s   rA   c                   @  s>   e Zd ZdZdZdZdZddœdd„Zedd d	œd
d„ƒZ	dS )ÚPhysicalAxesz ContainerSelector physical axes.Z
HorizontalZVerticalÚBothr'   r   c                 C  s   | j S r   r<   r   r   r   r   r   ®   s    zPhysicalAxes.to_jsonr   c                 C  s   | |ƒS r   r   r   r   r   r   r   ±   s    zPhysicalAxes.from_jsonN)
r    r!   r"   r#   Ú
HORIZONTALÚVERTICALÚBOTHr   r$   r   r   r   r   r   rB   ¨   s   rB   c                   @  s>   e Zd ZdZdZdZdZddœdd„Zedd d	œd
d„ƒZ	dS )ÚLogicalAxeszContainerSelector logical axes.ZInlineZBlockrC   r'   r   c                 C  s   | j S r   r<   r   r   r   r   r   ¼   s    zLogicalAxes.to_jsonr   c                 C  s   | |ƒS r   r   r   r   r   r   r   ¿   s    zLogicalAxes.from_jsonN)
r    r!   r"   r#   ZINLINEZBLOCKrF   r   r$   r   r   r   r   r   rG   ¶   s   rG   c                   @  s:   e Zd ZdZdZdZddœdd„Zedd dœd	d
„ƒZdS )ÚScrollOrientationzPhysical scroll orientation.Ú
horizontalÚverticalr'   r   c                 C  s   | j S r   r<   r   r   r   r   r   É   s    zScrollOrientation.to_jsonr   c                 C  s   | |ƒS r   r   r   r   r   r   r   Ì   s    zScrollOrientation.from_jsonN)	r    r!   r"   r#   rD   rE   r   r$   r   r   r   r   r   rH   Ä   s   rH   c                   @  sÀ  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Zded< dZded< dZded< dZded< dZ	ded< dZ
ded< dZded< dZded< dZded< dZded< dZded< dZded< dZded< dZded < dZd!ed"< dZd#ed$< dZd%ed&< dZded'< dZd%ed(< dZded)< dZd%ed*< dZd+ed,< dZd-ed.< dZd/ed0< dZd1ed2< dZd-ed3< dZd-ed4< dZ d5ed6< dZ!d7ed8< d9d:œd;d<„Z"e#d9d d=œd>d?„ƒZ$dS )@ÚNodez”
    DOM interaction is implemented in terms of mirror objects that represent
    the actual DOM nodes.
    DOMNode is a base node mirror type.
    r
   Únode_idr(   r,   r   r*   r'   r+   Ú
local_nameÚ
node_valueNútyping.Optional[NodeId]Ú	parent_idútyping.Optional[int]Úchild_node_countz"typing.Optional[typing.List[Node]]Úchildrenz!typing.Optional[typing.List[str]]Ú
attributesútyping.Optional[str]Údocument_urlÚbase_urlÚ	public_idÚ	system_idÚinternal_subsetÚxml_versionÚnamer=   ztyping.Optional[PseudoType]Úpseudo_typeÚpseudo_identifierztyping.Optional[ShadowRootType]Úshadow_root_typeztyping.Optional[page.FrameId]Úframe_idztyping.Optional[Node]Úcontent_documentÚshadow_rootsÚtemplate_contentÚpseudo_elementsÚimported_documentz)typing.Optional[typing.List[BackendNode]]Údistributed_nodesútyping.Optional[bool]Úis_svgz"typing.Optional[CompatibilityMode]Úcompatibility_modeztyping.Optional[BackendNode]Úassigned_slotÚis_scrollableÚaffected_by_starting_stylesz*typing.Optional[typing.List[StyleSheetId]]Úadopted_style_sheetsú%typing.Optional[network.AdProvenance]Úad_provenancer   r   c                 C  s"  t ƒ }| j ¡ |d< | j ¡ |d< | j|d< | j|d< | j|d< | j|d< | jd urb| j ¡ |d< | j	d urv| j	|d< | j
d ur”d	d
„ | j
D ƒ|d< | jd ur²dd
„ | jD ƒ|d< | jd urÆ| j|d< | jd urÚ| j|d< | jd urî| j|d< | jd u�r| j|d< | jd u�r| j|d< | jd u�r0| j|d< | jd u�rF| j|d< | jd u�r\| j|d< | jd u�rv| j ¡ |d< | jd u�rŒ| j|d< | jd u�r¦| j ¡ |d< | jd u�rÀ| j ¡ |d< | jd u�rÚ| j ¡ |d< | jd u�rúdd
„ | jD ƒ|d< | jd u�r| j ¡ |d< | jd u�r4dd
„ | jD ƒ|d< | jd u�rN| j ¡ |d < | jd u�rnd!d
„ | jD ƒ|d"< | jd u�r„| j|d#< | jd u�rž| j ¡ |d$< | j d u�r¸| j  ¡ |d%< | j!d u�rÎ| j!|d&< | j"d u�rä| j"|d'< | j#d u�rd(d
„ | j#D ƒ|d)< | j$d u�r| j$ ¡ |d*< |S )+NÚnodeIdr/   r-   r.   Ú	localNameÚ	nodeValueÚparentIdÚchildNodeCountc                 S  s   g | ]}|  ¡ ‘qS r   ©r   ©Ú.0Úir   r   r   Ú
<listcomp>.  ó    z Node.to_json.<locals>.<listcomp>rS   c                 S  s   g | ]}|‘qS r   r   rv   r   r   r   ry   0  rz   rT   ÚdocumentURLÚbaseURLÚpublicIdÚsystemIdÚinternalSubsetÚ
xmlVersionr\   r=   Ú
pseudoTypeÚpseudoIdentifierÚshadowRootTypeÚframeIdÚcontentDocumentc                 S  s   g | ]}|  ¡ ‘qS r   ru   rv   r   r   r   ry   L  rz   ÚshadowRootsÚtemplateContentc                 S  s   g | ]}|  ¡ ‘qS r   ru   rv   r   r   r   ry   P  s   ÚpseudoElementsÚimportedDocumentc                 S  s   g | ]}|  ¡ ‘qS r   ru   rv   r   r   r   ry   V  s   ÚdistributedNodesÚisSVGÚcompatibilityModeÚassignedSlotÚisScrollableÚaffectedByStartingStylesc                 S  s   g | ]}|  ¡ ‘qS r   ru   rv   r   r   r   ry   d  s   ÚadoptedStyleSheetsÚadProvenance)%r0   rL   r   r,   r*   r+   rM   rN   rP   rR   rS   rT   rV   rW   rX   rY   rZ   r[   r\   r=   r]   r^   r_   r`   ra   rb   rc   rd   re   rf   rh   ri   rj   rk   rl   rm   ro   r1   r   r   r   r   !  s�    




















ÿ
ÿ



ÿ
zNode.to_jsonr   c              '   C  s(  | t  |d ¡t | d¡¡t| d¡ƒt| d¡ƒt| d¡ƒt| d¡ƒ| dd ¡d urlt  | d¡¡nd | dd ¡d urŒt| d¡ƒnd | d	d ¡d ur°d
d„ |d	 D ƒnd | dd ¡d urÔdd„ |d D ƒnd | dd ¡d uròt|d ƒnd | dd ¡d u�rt|d ƒnd | dd ¡d u�r2t|d ƒnd | dd ¡d u�rRt|d ƒnd | dd ¡d u�rrt|d ƒnd | dd ¡d u�r’t|d ƒnd | dd ¡d u�r²t|d ƒnd | dd ¡d u�rÒt|d ƒnd | dd ¡d u�rôt |d ¡nd | dd ¡d u�rt|d ƒnd | dd ¡d u�r6t |d ¡nd | dd ¡d u�rZtj	 |d ¡nd | dd ¡d u�r|t
 |d ¡nd | dd ¡d u�r¢dd„ |d D ƒnd | dd ¡d u�rÄt
 |d ¡nd | dd ¡d u�rêdd„ |d D ƒnd | d d ¡d u�rt
 |d  ¡nd | d!d ¡d u�r2d"d„ |d! D ƒnd | d#d ¡d u�rRt|d# ƒnd | d$d ¡d u�rtt |d$ ¡nd | d%d ¡d u�r–t |d% ¡nd | d&d ¡d u�r¶t|d& ƒnd | d'd ¡d u�rÖt|d' ƒnd | d(d ¡d u�rüd)d„ |d( D ƒnd | d*d ¡d u�r tj |d* ¡nd d+�#S ),Nrp   r/   r-   r.   rq   rr   rs   rt   rS   c                 S  s   g | ]}t  |¡‘qS r   ©rK   r   rv   r   r   r   ry   |  rz   z"Node.from_json.<locals>.<listcomp>rT   c                 S  s   g | ]}t |ƒ‘qS r   ©r'   rv   r   r   r   ry     rz   r{   r|   r}   r~   r   r€   r\   r=   r�   r‚   rƒ   r„   r…   r†   c                 S  s   g | ]}t  |¡‘qS r   r’   rv   r   r   r   ry   ©  rz   r‡   rˆ   c                 S  s   g | ]}t  |¡‘qS r   r’   rv   r   r   r   ry   ¯  rz   r‰   rŠ   c                 S  s   g | ]}t  |¡‘qS r   ©r)   r   rv   r   r   r   ry   µ  s   r‹   rŒ   r�   rŽ   r�   r�   c                 S  s   g | ]}t  |¡‘qS r   ©r&   r   rv   r   r   r   ry   Ë  s   r‘   )#rL   r,   r*   r+   rM   rN   rP   rR   rS   rT   rV   rW   rX   rY   rZ   r[   r\   r=   r]   r^   r_   r`   ra   rb   rc   rd   re   rf   rh   ri   rj   rk   rl   rm   ro   )r
   r   r(   r2   r   r'   r5   r>   r   ÚFrameIdrK   ÚboolrA   r)   r   ÚAdProvenancer   r   r   r   r   k  sÎ    ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿý
ÿÿýÿÿÿÿý
ÿÿ›zNode.from_json)%r    r!   r"   r#   r4   rP   rR   rS   rT   rV   rW   rX   rY   rZ   r[   r\   r=   r]   r^   r_   r`   ra   rb   rc   rd   re   rf   rh   ri   rj   rk   rl   rm   ro   r   r$   r   r   r   r   r   rK   Ñ   sN   
	JrK   c                   @  sX   e Zd ZU dZded< ded< ded< dZded< d	d
œdd„Zed	d dœdd„ƒZdS )ÚRGBAz"A structure holding an RGBA color.r   ÚrÚgÚbNztyping.Optional[float]Úar   r   c                 C  s<   t ƒ }| j|d< | j|d< | j|d< | jd ur8| j|d< |S )Nrš   r›   rœ   r�   )r0   rš   r›   rœ   r�   r1   r   r   r   r   â  s    




zRGBA.to_jsonr   c                 C  sJ   | t | d¡ƒt | d¡ƒt | d¡ƒ| dd ¡d urBt|d ƒnd d�S )Nrš   r›   rœ   r�   )rš   r›   rœ   r�   )r   r2   Úfloatr   r   r   r   r   ë  s    üzRGBA.from_json)	r    r!   r"   r#   r4   r�   r   r$   r   r   r   r   r   r™   Ö  s   
	r™   c                      sB   e Zd ZdZddœdd„Zedd dœdd„ƒZ‡ fd	d
„Z‡  ZS )ÚQuadzg
    An array of quad vertices, x immediately followed by y for each point.
    Points clock-wise.
    ztyping.List[float]r   c                 C  s   | S r   r   r   r   r   r   r   û  s    zQuad.to_jsonr   c                 C  s   | |ƒS r   r   r   r   r   r   r   þ  s    zQuad.from_jsonc                   s   d  tƒ  ¡ ¡S )NzQuad({})r   r   r   r   r   r     s    zQuad.__repr__r   r   r   r   r   rŸ   õ  s
   rŸ   c                   @  sp   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
Zded< ddœdd„Zedd dœdd„ƒZd
S )ÚBoxModelz
Box model.rŸ   ÚcontentÚpaddingÚborderÚmarginr   ÚwidthÚheightNz!typing.Optional[ShapeOutsideInfo]Úshape_outsider   r   c                 C  sn   t ƒ }| j ¡ |d< | j ¡ |d< | j ¡ |d< | j ¡ |d< | j|d< | j|d< | jd urj| j ¡ |d< |S )Nr¡   r¢   r£   r¤   r¥   r¦   ÚshapeOutside)	r0   r¡   r   r¢   r£   r¤   r¥   r¦   r§   r1   r   r   r   r     s    


zBoxModel.to_jsonr   c                 C  sz   | t  | d¡¡t  | d¡¡t  | d¡¡t  | d¡¡t| d¡ƒt| d¡ƒ| dd ¡d urrt | d¡¡nd d�S )	Nr¡   r¢   r£   r¤   r¥   r¦   r¨   )r¡   r¢   r£   r¤   r¥   r¦   r§   )rŸ   r   r2   r   ÚShapeOutsideInfor   r   r   r   r   $  s    ÿözBoxModel.from_json)	r    r!   r"   r#   r4   r§   r   r$   r   r   r   r   r   r      s   
r    c                   @  sL   e Zd ZU dZded< ded< ded< ddœd	d
„Zedd dœdd„ƒZdS )r©   zCSS Shape Outside details.rŸ   Úboundsztyping.List[typing.Any]ÚshapeÚmargin_shaper   r   c                 C  s@   t ƒ }| j ¡ |d< dd„ | jD ƒ|d< dd„ | jD ƒ|d< |S )Nrª   c                 S  s   g | ]}|‘qS r   r   rv   r   r   r   ry   B  rz   z,ShapeOutsideInfo.to_json.<locals>.<listcomp>r«   c                 S  s   g | ]}|‘qS r   r   rv   r   r   r   ry   C  rz   ÚmarginShape)r0   rª   r   r«   r¬   r1   r   r   r   r   ?  s
    zShapeOutsideInfo.to_jsonr   c                 C  s6   | t  | d¡¡dd„ |d D ƒdd„ |d D ƒd�S )Nrª   c                 S  s   g | ]}|‘qS r   r   rv   r   r   r   ry   J  rz   z.ShapeOutsideInfo.from_json.<locals>.<listcomp>r«   c                 S  s   g | ]}|‘qS r   r   rv   r   r   r   ry   K  rz   r­   )rª   r«   r¬   )rŸ   r   r2   r   r   r   r   r   F  s
    ýzShapeOutsideInfo.from_jsonNr3   r   r   r   r   r©   5  s   
r©   c                   @  sT   e Zd ZU dZded< ded< ded< ded< ddœd	d
„Zedd dœdd„ƒZdS )ÚRectz
Rectangle.rž   ÚxÚyr¥   r¦   r   r   c                 C  s2   t ƒ }| j|d< | j|d< | j|d< | j|d< |S )Nr¯   r°   r¥   r¦   )r0   r¯   r°   r¥   r¦   r1   r   r   r   r   [  s    



zRect.to_jsonr   c                 C  s8   | t | d¡ƒt | d¡ƒt | d¡ƒt | d¡ƒd�S )Nr¯   r°   r¥   r¦   )r¯   r°   r¥   r¦   )rž   r2   r   r   r   r   r   c  s    üzRect.from_jsonNr3   r   r   r   r   r®   O  s   
r®   c                   @  s@   e Zd ZU ded< ded< ddœdd„Zedd dœd	d
„ƒZdS )ÚCSSComputedStylePropertyr'   r\   r=   r   r   c                 C  s   t ƒ }| j|d< | j|d< |S )Nr\   r=   )r0   r\   r=   r1   r   r   r   r   t  s    

z CSSComputedStyleProperty.to_jsonr   c                 C  s    | t | d¡ƒt | d¡ƒd�S )Nr\   r=   )r\   r=   )r'   r2   r   r   r   r   r   z  s    þz"CSSComputedStyleProperty.from_jsonN)r    r!   r"   r4   r   r$   r   r   r   r   r   r±   m  s
   
r±   z<typing.Generator[T_JSON_DICT, T_JSON_DICT, typing.List[str]])rL   r   c                 c  s4   t ƒ }|  ¡ |d< d|dœ}|V }dd„ |d D ƒS )zÄ
    Collects class names for the node with given id and all of its child nodes.
    **EXPERIMENTAL**
    :param node_id: Id of the node to collect class names.
    :returns: Class name list.
    rp   z DOM.collectClassNamesFromSubtree©ÚmethodÚparamsc                 S  s   g | ]}t |ƒ‘qS r   r“   rv   r   r   r   ry   ’  rz   z4collect_class_names_from_subtree.<locals>.<listcomp>Z
classNames©r0   r   ©rL   r´   Úcmd_dictr   r   r   r   Ú collect_class_names_from_subtree‚  s    	þr¸   rO   z2typing.Generator[T_JSON_DICT, T_JSON_DICT, NodeId])rL   Útarget_node_idÚinsert_before_node_idr   c                 c  sR   t ƒ }|  ¡ |d< | ¡ |d< |dur2| ¡ |d< d|dœ}|V }t | d¡¡S )aŸ  
    Creates a deep copy of the specified node and places it into the
    target container before the given anchor.
    :param node_id: Id of the node to copy.
    :param target_node_id: Id of the element to drop the copy into.
    :param insert_before_node_id: *(Optional)* Drop the copy before this node
     (if absent, the copy becomes the last child of `targetNodeId`).
    :returns: Id of the node clone.
    rp   ÚtargetNodeIdNÚinsertBeforeNodeIdz
DOM.copyTor²   ©r0   r   r
   r   r2   ©rL   r¹   rº   r´   r·   r   r   r   r   Úcopy_to•  s    þr¿   ztyping.Optional[BackendNodeId]z'typing.Optional[runtime.RemoteObjectId]rQ   rg   z0typing.Generator[T_JSON_DICT, T_JSON_DICT, Node])rL   r,   Ú	object_idÚdepthÚpiercer   c                 c  s‚   t ƒ }| dur|  ¡ |d< |dur.| ¡ |d< |durB| ¡ |d< |durR||d< |durb||d< d|dœ}|V }t | d	¡¡S )
aÊ  
    Describes node given its id, does not require domain to be enabled.
    Does not start tracking any objects, can be used for automation.
    :param node_id: *(Optional)* Identifier of the node.
    :param backend_node_id: *(Optional)* Identifier of the backend node.
    :param object_id: *(Optional)* JavaScript object id of the node wrapper.
    :param depth: *(Optional)* The maximum depth at which children should be
     retrieved, defaults to 1.
     Use -1 for the entire subtree or provide an integer larger than 0.
    :param pierce: *(Optional)*
     Whether or not iframes and shadow roots should be traversed
     when returning the subtree (default is false).
    :returns: Node description.
    Nrp   r/   ÚobjectIdrÁ   rÂ   zDOM.describeNoder²   Únode)r0   r   rK   r   r2   )rL   r,   rÀ   rÁ   rÂ   r´   r·   r   r   r   r   Údescribe_node°  s     þrÅ   ztyping.Optional[Rect]z0typing.Generator[T_JSON_DICT, T_JSON_DICT, None])rL   r,   rÀ   Úrectr   c                 c  sj   t ƒ }| dur|  ¡ |d< |dur.| ¡ |d< |durB| ¡ |d< |durV| ¡ |d< d|dœ}|V }dS )ak  
    Scrolls the specified rect of the given node into view
    if not already visible.
    Note: exactly one between nodeId,
    backendNodeId and objectId should be passed to identify the node.
    :param node_id: *(Optional)* Identifier of the node.
    :param backend_node_id: *(Optional)* Identifier of the backend node.
    :param object_id: *(Optional)* JavaScript object id of the node wrapper.
    :param rect: *(Optional)*
     The rect to be scrolled into view, relative to the node's border box,
     in CSS pixels. When omitted, center of the node will be used,
     similar to Element.scrollIntoView.
    Nrp   r/   rÃ   rÆ   zDOM.scrollIntoViewIfNeededr²   rµ   )rL   r,   rÀ   rÆ   r´   r·   r   r   r   r   Úscroll_into_view_if_neededØ  s    þrÇ   r   c                  c  s   ddi} | V }dS )z&Disables DOM agent for the given page.r³   zDOM.disableNr   ©r·   r   r   r   r   Údisableû  s    ÿrÉ   r'   )Ú	search_idr   c                 c  s"   t ƒ }| |d< d|dœ}|V }dS )zÀ
    Discards search results from the session with the given id.
    `getSearchResults` should no longer be called for that search.
    :param search_id: Unique search session identifier.
    ÚsearchIdzDOM.discardSearchResultsr²   N©r0   )rÊ   r´   r·   r   r   r   r   Údiscard_search_results  s    þrÍ   rU   )Úinclude_whitespacer   c                 c  s*   t ƒ }| dur| |d< d|dœ}|V }dS )z¨
    Enables DOM agent for the given page.
    :param include_whitespace: *(Optional)*
     Whether to include whitespaces in the children array of returned Nodes.
    NZincludeWhitespacez
DOM.enabler²   rÌ   )rÎ   r´   r·   r   r   r   r   Úenable  s    þrÏ   )rL   r,   rÀ   r   c                 c  sV   t ƒ }| dur|  ¡ |d< |dur.| ¡ |d< |durB| ¡ |d< d|dœ}|V }dS )zó
    Focuses the given element.
    :param node_id: *(Optional)* Identifier of the node.
    :param backend_node_id: *(Optional)* Identifier of the backend node.
    :param object_id: *(Optional)* JavaScript object id of the node wrapper.
    Nrp   r/   rÃ   z	DOM.focusr²   rµ   ©rL   r,   rÀ   r´   r·   r   r   r   r   Úfocus&  s    þrÑ   c                 c  s4   t ƒ }|  ¡ |d< d|dœ}|V }dd„ |d D ƒS )zº
    Returns attributes for the specified node.
    :param node_id: Id of the node to retrieve attributes for.
    :returns: An interleaved array of node attribute names and values.
    rp   zDOM.getAttributesr²   c                 S  s   g | ]}t |ƒ‘qS r   r“   rv   r   r   r   ry   N  rz   z"get_attributes.<locals>.<listcomp>rT   rµ   r¶   r   r   r   Úget_attributes?  s    þrÒ   z4typing.Generator[T_JSON_DICT, T_JSON_DICT, BoxModel]c                 c  sb   t ƒ }| dur|  ¡ |d< |dur.| ¡ |d< |durB| ¡ |d< d|dœ}|V }t | d¡¡S )a   
    Returns boxes for the given node.
    :param node_id: *(Optional)* Identifier of the node.
    :param backend_node_id: *(Optional)* Identifier of the backend node.
    :param object_id: *(Optional)* JavaScript object id of the node wrapper.
    :returns: Box model for the node.
    Nrp   r/   rÃ   zDOM.getBoxModelr²   Úmodel)r0   r   r    r   r2   rÐ   r   r   r   Úget_box_modelQ  s    þrÔ   z=typing.Generator[T_JSON_DICT, T_JSON_DICT, typing.List[Quad]]c                 c  sd   t ƒ }| dur|  ¡ |d< |dur.| ¡ |d< |durB| ¡ |d< d|dœ}|V }dd„ |d	 D ƒS )
a¦  
    Returns quads that describe node position on the page. This method
    might return multiple quads for inline nodes.
    **EXPERIMENTAL**
    :param node_id: *(Optional)* Identifier of the node.
    :param backend_node_id: *(Optional)* Identifier of the backend node.
    :param object_id: *(Optional)* JavaScript object id of the node wrapper.
    :returns: Quads that describe node layout relative to viewport.
    Nrp   r/   rÃ   zDOM.getContentQuadsr²   c                 S  s   g | ]}t  |¡‘qS r   )rŸ   r   rv   r   r   r   ry   †  rz   z%get_content_quads.<locals>.<listcomp>Zquadsrµ   rÐ   r   r   r   Úget_content_quadsl  s    þrÕ   )rÁ   rÂ   r   c                 c  sF   t ƒ }| dur| |d< |dur&||d< d|dœ}|V }t | d¡¡S )aû  
    Returns the root DOM node (and optionally the subtree) to the caller.
    Implicitly enables the DOM domain events for the current target.
    :param depth: *(Optional)*
     The maximum depth at which children should be retrieved, defaults to 1.
     Use -1 for the entire subtree or provide an integer larger than 0.
    :param pierce: *(Optional)*
     Whether or not iframes and shadow roots should be traversed
     when returning the subtree (default is false).
    :returns: Resulting node.
    NrÁ   rÂ   zDOM.getDocumentr²   Úroot)r0   rK   r   r2   ©rÁ   rÂ   r´   r·   r   r   r   r   Úget_document‰  s    þrØ   z=typing.Generator[T_JSON_DICT, T_JSON_DICT, typing.List[Node]]c                 c  sH   t ƒ }| dur| |d< |dur&||d< d|dœ}|V }dd„ |d D ƒS )	aM  
    Returns the root DOM node (and optionally the subtree) to the caller.
    Deprecated, as it is not designed to work well with
    the rest of the DOM agent.
    Use DOMSnapshot.captureSnapshot instead.
    .. deprecated:: 1.3
    :param depth: *(Optional)*
     The maximum depth at which children should be retrieved, defaults to 1.
     Use -1 for the entire subtree or provide an integer larger than 0.
    :param pierce: *(Optional)* Whether or not iframes and shadow roots
     should be traversed when returning the subtree (default is false).
    :returns: Resulting node.
    NrÁ   rÂ   zDOM.getFlattenedDocumentr²   c                 S  s   g | ]}t  |¡‘qS r   r’   rv   r   r   r   ry   ¾  rz   z*get_flattened_document.<locals>.<listcomp>ÚnodesrÌ   r×   r   r   r   Úget_flattened_document¤  s    þrÚ   z%typing.List[CSSComputedStyleProperty]z?typing.Generator[T_JSON_DICT, T_JSON_DICT, typing.List[NodeId]])rL   Úcomputed_stylesrÂ   r   c                 c  sV   t ƒ }|  ¡ |d< dd„ |D ƒ|d< |dur4||d< d|dœ}|V }d	d„ |d
 D ƒS )aÇ  
    Finds nodes with a given computed style in a subtree.
    **EXPERIMENTAL**
    :param node_id: Node ID pointing to the root of a subtree.
    :param computed_styles: The style to filter nodes by
     (includes nodes if any of properties matches).
    :param pierce: *(Optional)*
     Whether or not iframes and shadow roots in the same target
     should be traversed when returning the results (default is false).
    :returns: Resulting nodes.
    rp   c                 S  s   g | ]}|  ¡ ‘qS r   ru   rv   r   r   r   ry   Ó  rz   z2get_nodes_for_subtree_by_style.<locals>.<listcomp>ZcomputedStylesNrÂ   zDOM.getNodesForSubtreeByStyler²   c                 S  s   g | ]}t  |¡‘qS r   ©r
   r   rv   r   r   r   ry   Û  rz   ÚnodeIdsrµ   )rL   rÛ   rÂ   r´   r·   r   r   r   r   Úget_nodes_for_subtree_by_styleÁ  s    þrÞ   r   zntyping.Generator[T_JSON_DICT, T_JSON_DICT, typing.Tuple[BackendNodeId, page.FrameId, typing.Optional[NodeId]]])r¯   r°   Úinclude_user_agent_shadow_domÚignore_pointer_events_noner   c                 c  sŠ   t ƒ }| |d< ||d< |dur&||d< |dur6||d< d|dœ}|V }t | d¡¡tj | d	¡¡| d
d¡dur„t | d
¡¡ndfS )aÖ  
    Returns node id at given location.
    Depending on whether DOM domain is enabled,
    nodeId is either returned or not.
    :param x: X coordinate.
    :param y: Y coordinate.
    :param include_user_agent_shadow_dom: *(Optional)*
    False to skip to the nearest non-UA shadow root ancestor (default: false).
    :param ignore_pointer_events_none: *(Optional)*
    Whether to ignore pointer-events: none on elements and hit test them.
    :returns: A tuple with the following items:
        0. **backendNodeId** - Resulting node.
        1. **frameId** - Frame this node belongs to.
        2. **nodeId** - *(Optional)*
        Id of the node at given coordinates,
        only when enabled and requested document.
    r¯   r°   NÚincludeUserAgentShadowDOMZignorePointerEventsNonezDOM.getNodeForLocationr²   r/   r„   rp   )r0   r(   r   r2   r   r–   r
   )r¯   r°   rß   rà   r´   r·   r   r   r   r   Úget_node_for_locationÞ  s"    þÿúrâ   z/typing.Generator[T_JSON_DICT, T_JSON_DICT, str])rL   r,   rÀ   Úinclude_shadow_domr   c                 c  sp   t ƒ }| dur|  ¡ |d< |dur.| ¡ |d< |durB| ¡ |d< |durR||d< d|dœ}|V }t| d¡ƒS )	a[  
    Returns node's HTML markup.
    :param node_id: *(Optional)* Identifier of the node.
    :param backend_node_id: *(Optional)* Identifier of the backend node.
    :param object_id: *(Optional)* JavaScript object id of the node wrapper.
    :param include_shadow_dom: *(Optional)* Include all shadow roots.
    :returns: Outer HTML markup.
    Nrp   r/   rÃ   ZincludeShadowDOMzDOM.getOuterHTMLr²   Ú	outerHTML©r0   r   r'   r2   )rL   r,   rÀ   rã   r´   r·   r   r   r   r   Úget_outer_html  s    þræ   c                 c  s2   t ƒ }|  ¡ |d< d|dœ}|V }t | d¡¡S )zÂ
    Returns the id of the nearest ancestor that is a relayout boundary.
    **EXPERIMENTAL**
    :param node_id: Id of the node.
    :returns: Relayout boundary node id for the given node.
    rp   zDOM.getRelayoutBoundaryr²   r½   r¶   r   r   r   Úget_relayout_boundary/  s    	þrç   )rÊ   Ú
from_indexÚto_indexr   c                 c  s@   t ƒ }| |d< ||d< ||d< d|dœ}|V }dd„ |d D ƒS )	ak  
    Returns search results from given `fromIndex` to given `toIndex`
    from the search with the given identifier.
    :param search_id: Unique search session identifier.
    :param from_index: Start index of the search result to be returned.
    :param to_index: End index of the search result to be returned.
    :returns: Ids of the search result nodes.
    rË   Z	fromIndexZtoIndexzDOM.getSearchResultsr²   c                 S  s   g | ]}t  |¡‘qS r   rÜ   rv   r   r   r   ry   V  rz   z&get_search_results.<locals>.<listcomp>rÝ   rÌ   )rÊ   rè   ré   r´   r·   r   r   r   r   Úget_search_resultsB  s    þrê   c                  c  s   ddi} | V }dS )zHides any highlight.r³   zDOM.hideHighlightNr   rÈ   r   r   r   Úhide_highlightY  s    ÿrë   c                  c  s   ddi} | V }dS )zHighlights DOM node.r³   zDOM.highlightNodeNr   rÈ   r   r   r   Úhighlight_nodea  s    ÿrì   c                  c  s   ddi} | V }dS )zHighlights given rectangle.r³   zDOM.highlightRectNr   rÈ   r   r   r   Úhighlight_recti  s    ÿrí   c                  c  s   ddi} | V }dS )zMarks last undoable state.r³   zDOM.markUndoableStateNr   rÈ   r   r   r   Úmark_undoable_stateq  s    ÿrî   c                 c  sR   t ƒ }|  ¡ |d< | ¡ |d< |dur2| ¡ |d< d|dœ}|V }t | d¡¡S )a�  
    Moves node into the new container, places it before the given anchor.
    :param node_id: Id of the node to move.
    :param target_node_id: Id of the element to drop the moved node into.
    :param insert_before_node_id: *(Optional)* Drop node before this one
     (if absent, the moved node becomes the last child of `targetNodeId`).
    :returns: New id of the moved node.
    rp   r»   Nr¼   z
DOM.moveTor²   r½   r¾   r   r   r   Úmove_toy  s    þrï   zBtyping.Generator[T_JSON_DICT, T_JSON_DICT, typing.Tuple[str, int]])Úqueryrß   r   c                 c  sJ   t ƒ }| |d< |dur||d< d|dœ}|V }t| d¡ƒt| d¡ƒfS )aê  
    Searches for a given string in the DOM tree.
    Use `getSearchResults` to access search results
    or `cancelSearch` to end this search session.
    :param query: Plain text or query selector or XPath search query.
    :param include_user_agent_shadow_dom: *(Optional)*
     True to search in user agent shadow DOM.
    :returns: A tuple with the following items:
        0. **searchId** - Unique search session identifier.
        1. **resultCount** - Number of search results.
    rð   Nrá   zDOM.performSearchr²   rË   ZresultCount)r0   r'   r2   r   )rð   rß   r´   r·   r   r   r   r   Úperform_search“  s    þrñ   )Úpathr   c                 c  s.   t ƒ }| |d< d|dœ}|V }t | d¡¡S )z¬
    Requests that the node is sent to the caller given its path.
    :param path: Path to node in the proprietary format.
    :returns: Id of the node for given path.
    rò   zDOM.pushNodeByPathToFrontendr²   rp   )r0   r
   r   r2   )rò   r´   r·   r   r   r   r   Úpush_node_by_path_to_frontend­  s    þró   ztyping.List[BackendNodeId])Úbackend_node_idsr   c                 c  s:   t ƒ }dd„ | D ƒ|d< d|dœ}|V }dd„ |d D ƒS )a  
    Requests that a batch of nodes is sent to the caller
    given their backend node ids.
    :param backend_node_ids: The array of backend node ids.
    :returns: The array of ids of pushed nodes that correspond
    to the backend ids specified in backendNodeIds.
    c                 S  s   g | ]}|  ¡ ‘qS r   ru   rv   r   r   r   ry   Ê  rz   z9push_nodes_by_backend_ids_to_frontend.<locals>.<listcomp>ZbackendNodeIdsz#DOM.pushNodesByBackendIdsToFrontendr²   c                 S  s   g | ]}t  |¡‘qS r   rÜ   rv   r   r   r   ry   Ð  rz   rÝ   rÌ   )rô   r´   r·   r   r   r   r   Ú%push_nodes_by_backend_ids_to_frontend¿  s    
þrõ   )rL   Úselectorr   c                 c  s:   t ƒ }|  ¡ |d< ||d< d|dœ}|V }t | d¡¡S )z°
    Executes `querySelector` on a given node.
    :param node_id: Id of the node to query upon.
    :param selector: Selector string.
    :returns: Query selector result.
    rp   rö   zDOM.querySelectorr²   r½   ©rL   rö   r´   r·   r   r   r   r   Úquery_selectorÓ  s    	þrø   c                 c  s<   t ƒ }|  ¡ |d< ||d< d|dœ}|V }dd„ |d D ƒS )z³
    Executes `querySelectorAll` on a given node.
    :param node_id: Id of the node to query upon.
    :param selector: Selector string.
    :returns: Query selector result.
    rp   rö   zDOM.querySelectorAllr²   c                 S  s   g | ]}t  |¡‘qS r   rÜ   rv   r   r   r   ry   ø  rz   z&query_selector_all.<locals>.<listcomp>rÝ   rµ   r÷   r   r   r   Úquery_selector_allç  s    	þrù   c                  c  s    ddi} | V }dd„ |d D ƒS )zë
    Returns NodeIds of current top layer elements.
    Top layer is rendered closest to the user within a viewport,
    therefore its elements always appear on top of all other content.
    :returns: NodeIds of top layer elements
    r³   zDOM.getTopLayerElementsc                 S  s   g | ]}t  |¡‘qS r   rÜ   rv   r   r   r   ry     rz   z*get_top_layer_elements.<locals>.<listcomp>rÝ   r   rÈ   r   r   r   Úget_top_layer_elementsû  s    
ÿrú   )rL   Úrelationr   c                 c  s:   t ƒ }|  ¡ |d< ||d< d|dœ}|V }t | d¡¡S )a	  
    Returns the NodeId of the matched element according to certain relations.
    :param node_id: Id of the node from which to query the relation.
    :param relation: Type of relation to get.
    :returns: NodeId of the element matching the queried relation.
    rp   rû   zDOM.getElementByRelationr²   r½   )rL   rû   r´   r·   r   r   r   r   Úget_element_by_relation  s    	þrü   c                  c  s   ddi} | V }dS )zRe-does the last undone action.r³   zDOM.redoNr   rÈ   r   r   r   Úredo  s    ÿrý   )rL   r\   r   c                 c  s.   t ƒ }|  ¡ |d< ||d< d|dœ}|V }dS )z¼
    Removes attribute with given name from an element with given id.
    :param node_id: Id of the element to remove attribute from.
    :param name: Name of the attribute to remove.
    rp   r\   zDOM.removeAttributer²   Nrµ   ©rL   r\   r´   r·   r   r   r   r   Úremove_attribute'  s    þrÿ   c                 c  s&   t ƒ }|  ¡ |d< d|dœ}|V }dS )zS
    Removes node with given id.
    :param node_id: Id of the node to remove.
    rp   zDOM.removeNoder²   Nrµ   r¶   r   r   r   Úremove_node9  s    þr   )rL   rÁ   rÂ   r   c                 c  sF   t ƒ }|  ¡ |d< |dur"||d< |dur2||d< d|dœ}|V }dS )a[  
    Requests that children of the node with given id are returned to the caller
    in form of `setChildNodes` events where not only immediate children are
    retrieved, but all children down to the specified depth.
    :param node_id: Id of the node to get children for.
    :param depth: *(Optional)*
     The maximum depth at which children should be retrieved. Defaults to 1.
     Use -1 for the entire subtree or provide an integer larger than 0.
    :param pierce: *(Optional)* Whether or not iframes and shadow roots
     should be traversed when returning the sub-tree (default is false).
    rp   NrÁ   rÂ   zDOM.requestChildNodesr²   rµ   )rL   rÁ   rÂ   r´   r·   r   r   r   r   Úrequest_child_nodesI  s    þr  zruntime.RemoteObjectId)rÀ   r   c                 c  s2   t ƒ }|  ¡ |d< d|dœ}|V }t | d¡¡S )aT  
    Requests that the node is sent to the caller given the JavaScript node
    object reference. All nodes that form the path from the node to the root
    are also sent to the client as a series of `setChildNodes` notifications.
    :param object_id: JavaScript object id to convert into node.
    :returns: Node id for given object.
    rÃ   zDOM.requestNoder²   rp   r½   ©rÀ   r´   r·   r   r   r   r   Úrequest_nodef  s    
þr  z+typing.Optional[runtime.ExecutionContextId]z@typing.Generator[T_JSON_DICT, T_JSON_DICT, runtime.RemoteObject])rL   r,   Úobject_groupÚexecution_context_idr   c                 c  st   t ƒ }| dur|  ¡ |d< |dur.| ¡ |d< |dur>||d< |durR| ¡ |d< d|dœ}|V }tj | d¡¡S )	aï  
    Resolves the JavaScript node object for a given NodeId or BackendNodeId.
    :param node_id: *(Optional)* Id of the node to resolve.
    :param backend_node_id: *(Optional)*
     Backend identifier of the node to resolve.
    :param object_group: *(Optional)*
     Symbolic group name that can be used to release multiple objects.
    :param execution_context_id: *(Optional)*
     Execution context in which to resolve the node.
    :returns: JavaScript object wrapper for given node.
    Nrp   r/   ZobjectGroupZexecutionContextIdzDOM.resolveNoder²   Úobject)r0   r   r	   ZRemoteObjectr   r2   )rL   r,   r  r  r´   r·   r   r   r   r   Úresolve_nodez  s    þr  )rL   r\   r=   r   c                 c  s6   t ƒ }|  ¡ |d< ||d< ||d< d|dœ}|V }dS )z¶
    Sets attribute for an element with given id.
    :param node_id: Id of the element to set attribute for.
    :param name: Attribute name.
    :param value: Attribute value.
    rp   r\   r=   zDOM.setAttributeValuer²   Nrµ   )rL   r\   r=   r´   r·   r   r   r   r   Úset_attribute_valueœ  s    	þr  )rL   Útextr\   r   c                 c  s>   t ƒ }|  ¡ |d< ||d< |dur*||d< d|dœ}|V }dS )aÔ  
    Sets attributes on element with given id.
    This method is useful when user edits some existing
    attribute value and types in several attribute name/value pairs.
    :param node_id: Id of the element to set attributes for.
    :param text: Text with a number of attributes.
    Will parse this text using HTML parser.
    :param name: *(Optional)*
    Attribute name to replace with new attributes derived from text
    in case text parsed successfully.
    rp   r	  Nr\   zDOM.setAttributesAsTextr²   rµ   )rL   r	  r\   r´   r·   r   r   r   r   Úset_attributes_as_text°  s    þr
  ztyping.List[str])ÚfilesrL   r,   rÀ   r   c                 c  sh   t ƒ }dd„ | D ƒ|d< |dur,| ¡ |d< |dur@| ¡ |d< |durT| ¡ |d< d|d	œ}|V }dS )
a3  
    Sets files for the given file input element.
    :param files: Array of file paths to set.
    :param node_id: *(Optional)* Identifier of the node.
    :param backend_node_id: *(Optional)* Identifier of the backend node.
    :param object_id: *(Optional)* JavaScript object id of the node wrapper.
    c                 S  s   g | ]}|‘qS r   r   rv   r   r   r   ry   Ø  rz   z(set_file_input_files.<locals>.<listcomp>r  Nrp   r/   rÃ   zDOM.setFileInputFilesr²   rµ   )r  rL   r,   rÀ   r´   r·   r   r   r   r   Úset_file_input_filesÊ  s    þr  r—   )rÏ   r   c                 c  s"   t ƒ }| |d< d|dœ}|V }dS )zš
    Sets if stack traces should be captured for Nodes.
    See `Node.getNodeStackTraces`. Default is disabled.
    :param enable: Enable or disable.
    rÏ   zDOM.setNodeStackTracesEnabledr²   NrÌ   )rÏ   r´   r·   r   r   r   r   Úset_node_stack_traces_enabledæ  s    þr  zOtyping.Generator[T_JSON_DICT, T_JSON_DICT, typing.Optional[runtime.StackTrace]]c                 c  sH   t ƒ }|  ¡ |d< d|dœ}|V }| dd¡durDtj | d¡¡S dS )zê
    Gets stack traces associated with a Node.
    As of now, only provides stack trace for Node creation.
    :param node_id: Id of the node to get stack traces for.
    :returns: *(Optional)* Creation stack trace, if available.
    rp   zDOM.getNodeStackTracesr²   ZcreationN)r0   r   r2   r	   Z
StackTracer   r¶   r   r   r   Úget_node_stack_traces÷  s    þÿýr  c                 c  s0   t ƒ }|  ¡ |d< d|dœ}|V }t| d¡ƒS )z~
    Returns file information for the given file wrapper.
    :param object_id: JavaScript object id of the node wrapper.
    rÃ   zDOM.getFileInfor²   rò   rå   r  r   r   r   Úget_file_info  s    þr  c                 c  s&   t ƒ }|  ¡ |d< d|dœ}|V }dS )zÔ
    Enables console to refer to the node with given id via $x
    (see Command Line API for more details $x functions).
    :param node_id:
     DOM node id to be accessible by means of $x command line API.
    rp   zDOM.setInspectedNoder²   Nrµ   r¶   r   r   r   Úset_inspected_node!  s    	þr  c                 c  s:   t ƒ }|  ¡ |d< ||d< d|dœ}|V }t | d¡¡S )z¥
    Sets node name for a node with given id.
    :param node_id: Id of the node to set name for.
    :param name: New node's name.
    :returns: New node's id.
    rp   r\   zDOM.setNodeNamer²   r½   rþ   r   r   r   Úset_node_name3  s    	þr  )rL   r=   r   c                 c  s.   t ƒ }|  ¡ |d< ||d< d|dœ}|V }dS )zŒ
    Sets node value for a node with given id.
    :param node_id: Id of the node to set value for.
    :param value: New node's value.
    rp   r=   zDOM.setNodeValuer²   Nrµ   )rL   r=   r´   r·   r   r   r   r   Úset_node_valueG  s    þr  )rL   Ú
outer_htmlr   c                 c  s.   t ƒ }|  ¡ |d< ||d< d|dœ}|V }dS )zœ
    Sets node HTML markup, returns new node id.
    :param node_id: Id of the node to set markup for.
    :param outer_html: Outer HTML markup to set.
    rp   rä   zDOM.setOuterHTMLr²   Nrµ   )rL   r  r´   r·   r   r   r   r   Úset_outer_htmlY  s    þr  c                  c  s   ddi} | V }dS )z!Undoes the last performed action.r³   zDOM.undoNr   rÈ   r   r   r   Úundok  s    ÿr  zpage.FrameIdz`typing.Generator[T_JSON_DICT, T_JSON_DICT, typing.Tuple[BackendNodeId, typing.Optional[NodeId]]])r`   r   c                 c  sV   t ƒ }|  ¡ |d< d|dœ}|V }t | d¡¡| dd¡durPt | d¡¡ndfS )aA  
    Returns iframe node that owns iframe with the given domain.
    :param frame_id:
    :returns: A tuple with the following items:
        0. **backendNodeId** - Resulting node.
        1. **nodeId** - *(Optional)*
          ID of the node at given coordinates,
          only when enabled and requested document.
    r„   zDOM.getFrameOwnerr²   r/   rp   N)r0   r   r(   r   r2   r
   )r`   r´   r·   r   r   r   r   Úget_frame_owners  s    þÿûr  ztyping.Optional[PhysicalAxes]ztyping.Optional[LogicalAxes]zCtyping.Generator[T_JSON_DICT, T_JSON_DICT, typing.Optional[NodeId]])rL   Úcontainer_nameÚphysical_axesÚlogical_axesÚqueries_scroll_stateÚqueries_anchoredr   c           	      c  sœ   t ƒ }|  ¡ |d< |dur"||d< |dur6| ¡ |d< |durJ| ¡ |d< |durZ||d< |durj||d< d|d	œ}|V }| dd¡dur˜t |d ¡S dS )
aº  
    Returns the query container of the given node based on container query
    conditions: containerName, physical and logical axes, and whether
    it queries scroll-state or anchored elements. If no axes are provided and
    queriesScrollState is false, the style container is returned, which is the
    direct parent or the closest element with a matching container-name.
    :param node_id:
    :param container_name: *(Optional)*
    :param physical_axes: *(Optional)*
    :param logical_axes: *(Optional)*
    :param queries_scroll_state: *(Optional)*
    :param queries_anchored: *(Optional)*
    :returns: *(Optional)* The container node for the given node,
     or null if not found.
    rp   NZcontainerNameZphysicalAxesZlogicalAxesZqueriesScrollStateZqueriesAnchoredzDOM.getContainerForNoder²   )r0   r   r2   r
   r   )	rL   r  r  r  r  r  r´   r·   r   r   r   r   Úget_container_for_node”  s(    þÿýr  c                 c  s4   t ƒ }|  ¡ |d< d|dœ}|V }dd„ |d D ƒS )a   
    Returns the descendants of a container query container that have
    container queries against this container.
    :param node_id: Id of the container node to find querying descendants from.
    :returns: Descendant nodes with container queries
     against the given container.
    rp   z&DOM.getQueryingDescendantsForContainerr²   c                 S  s   g | ]}t  |¡‘qS r   rÜ   rv   r   r   r   ry   Ô  rz   z:get_querying_descendants_for_container.<locals>.<listcomp>rÝ   rµ   r¶   r   r   r   Ú&get_querying_descendants_for_containerÃ  s    
þr  )rL   Úanchor_specifierr   c                 c  sB   t ƒ }|  ¡ |d< |dur"||d< d|dœ}|V }t | d¡¡S )a  
    Returns the target anchor element of the given anchor query according to
    https://www.w3.org/TR/css-anchor-position-1/#target.
    :param node_id: Id of the positioned element from which to find the anchor.
    :param anchor_specifier: *(Optional)*
     An optional anchor specifier, as defined in
     https://www.w3.org/TR/css-anchor-position-1/#anchor-specifier.
     If not provided, it will return the implicit anchor element for the given
     positioned element.
    :returns: The anchor element of the given anchor query.
    rp   NZanchorSpecifierzDOM.getAnchorElementr²   r½   )rL   r  r´   r·   r   r   r   r   Úget_anchor_element×  s    þr  )rL   rÏ   r   c                 c  s<   t ƒ }|  ¡ |d< ||d< d|dœ}|V }dd„ |d D ƒS )a’  
    When enabling, this API force-opens the popover identified by nodeId
    and keeps it open until disabled.
    :param node_id: The id of the popover HTMLElement.
    :param enable: If true, opens the popover and keeps it open.
     If False, closes the popover if it was previously force-opened.
    :returns: List of popovers that were closed
     in order to respect popover stacking order.
    rp   rÏ   zDOM.forceShowPopoverr²   c                 S  s   g | ]}t  |¡‘qS r   rÜ   rv   r   r   r   ry     rz   z&force_show_popover.<locals>.<listcomp>rÝ   rµ   )rL   rÏ   r´   r·   r   r   r   r   Úforce_show_popoverñ  s    þr   zDOM.attributeModifiedc                   @  s>   e Zd ZU dZded< ded< ded< edd dœd	d
„ƒZdS )ÚAttributeModifiedz-Fired when `Element`'s attribute is modified.r
   rL   r'   r\   r=   r   r   c                 C  s.   | t  | d¡¡t| d¡ƒt| d¡ƒd�S )Nrp   r\   r=   )rL   r\   r=   ©r
   r   r2   r'   r   r   r   r   r     s
    ýzAttributeModified.from_jsonN©r    r!   r"   r#   r4   r$   r   r   r   r   r   r!  	  s   
r!  zDOM.attributeRemovedc                   @  s6   e Zd ZU dZded< ded< edd dœdd	„ƒZd
S )ÚAttributeRemovedz,Fired when `Element`'s attribute is removed.r
   rL   r'   r\   r   r   c                 C  s"   | t  | d¡¡t| d¡ƒd�S )Nrp   r\   )rL   r\   r"  r   r   r   r   r   &  s    þzAttributeRemoved.from_jsonNr#  r   r   r   r   r$    s
   
r$  zDOM.adoptedStyleSheetsModifiedc                   @  s6   e Zd ZU dZded< ded< edd dœdd	„ƒZd
S )ÚAdoptedStyleSheetsModifiedz9Fired when ``Element``'s adoptedStyleSheets are modified.r
   rL   ztyping.List[StyleSheetId]rm   r   r   c                 C  s$   | t  |d ¡dd„ |d D ƒd�S )Nrp   c                 S  s   g | ]}t  |¡‘qS r   r•   rv   r   r   r   ry   ;  s   z8AdoptedStyleSheetsModified.from_json.<locals>.<listcomp>r�   )rL   rm   rÜ   r   r   r   r   r   7  s    ÿþz$AdoptedStyleSheetsModified.from_jsonNr#  r   r   r   r   r%  .  s
   
r%  zDOM.characterDataModifiedc                   @  s6   e Zd ZU dZded< ded< edd dœdd	„ƒZd
S )ÚCharacterDataModifiedz)Mirrors `DOMCharacterDataModified` event.r
   rL   r'   Úcharacter_datar   r   c                 C  s"   | t  | d¡¡t| d¡ƒd�S )Nrp   ZcharacterData)rL   r'  r"  r   r   r   r   r   J  s    þzCharacterDataModified.from_jsonNr#  r   r   r   r   r&  A  s
   
r&  zDOM.childNodeCountUpdatedc                   @  s6   e Zd ZU dZded< ded< edd dœdd	„ƒZd
S )ÚChildNodeCountUpdatedz6Fired when `Container`'s child node count has changed.r
   rL   r   rR   r   r   c                 C  s"   | t  | d¡¡t| d¡ƒd�S )Nrp   rt   )rL   rR   )r
   r   r2   r   r   r   r   r   r   [  s    þzChildNodeCountUpdated.from_jsonNr#  r   r   r   r   r(  R  s
   
r(  zDOM.childNodeInsertedc                   @  s>   e Zd ZU dZded< ded< ded< edd dœd	d
„ƒZdS )ÚChildNodeInsertedz Mirrors `DOMNodeInserted` event.r
   Úparent_node_idÚprevious_node_idrK   rÄ   r   r   c                 C  s2   | t  | d¡¡t  | d¡¡t | d¡¡d�S )NÚparentNodeIdZpreviousNodeIdrÄ   )r*  r+  rÄ   ©r
   r   r2   rK   r   r   r   r   r   n  s
    ýzChildNodeInserted.from_jsonNr#  r   r   r   r   r)  c  s   
r)  zDOM.childNodeRemovedc                   @  s6   e Zd ZU dZded< ded< edd dœdd„ƒZd	S )
ÚChildNodeRemovedzMirrors `DOMNodeRemoved` event.r
   r*  rL   r   r   c                 C  s$   | t  | d¡¡t  | d¡¡d�S )Nr,  rp   )r*  rL   ©r
   r   r2   r   r   r   r   r   €  s    þzChildNodeRemoved.from_jsonNr#  r   r   r   r   r.  w  s
   
r.  zDOM.distributedNodesUpdatedc                   @  s6   e Zd ZU dZded< ded< edd dœdd	„ƒZd
S )ÚDistributedNodesUpdatedz$Called when distribution is changed.r
   Úinsertion_point_idztyping.List[BackendNode]rf   r   r   c                 C  s&   | t  | d¡¡dd„ |d D ƒd�S )NZinsertionPointIdc                 S  s   g | ]}t  |¡‘qS r   r”   rv   r   r   r   ry   •  s   z5DistributedNodesUpdated.from_json.<locals>.<listcomp>rŠ   )r1  rf   r/  r   r   r   r   r   ‘  s    ÿþz!DistributedNodesUpdated.from_jsonNr#  r   r   r   r   r0  ˆ  s
   
r0  zDOM.documentUpdatedc                   @  s$   e Zd ZdZedd dœdd„ƒZdS )ÚDocumentUpdatedz[
    Fired when `Document` has been totally updated.
    Node IDs are no longer valid.
    r   r   c                 C  s   | ƒ S r   r   r   r   r   r   r   £  s    zDocumentUpdated.from_jsonN©r    r!   r"   r#   r$   r   r   r   r   r   r2  ›  s   r2  zDOM.inlineStyleInvalidatedc                   @  s.   e Zd ZU dZded< edd dœdd„ƒZdS )	ÚInlineStyleInvalidatedz^
    Fired when `Element`'s inline style is modified
    via a CSS property modification.
    ztyping.List[NodeId]Únode_idsr   r   c                 C  s   | dd„ |d D ƒd�S )Nc                 S  s   g | ]}t  |¡‘qS r   rÜ   rv   r   r   r   ry   ´  rz   z4InlineStyleInvalidated.from_json.<locals>.<listcomp>rÝ   )r5  r   r   r   r   r   r   ²  s    z InlineStyleInvalidated.from_jsonNr#  r   r   r   r   r4  ¨  s   
r4  zDOM.pseudoElementAddedc                   @  s6   e Zd ZU dZded< ded< edd dœdd	„ƒZd
S )ÚPseudoElementAddedz4Called when a pseudo element is added to an element.r
   rP   rK   Úpseudo_elementr   r   c                 C  s$   | t  | d¡¡t | d¡¡d�S )Nrs   ZpseudoElement)rP   r7  r-  r   r   r   r   r   À  s    þzPseudoElementAdded.from_jsonNr#  r   r   r   r   r6  ·  s
   
r6  zDOM.topLayerElementsUpdatedc                   @  s$   e Zd ZdZedd dœdd„ƒZdS )ÚTopLayerElementsUpdatedz+Called when top layer elements are changed.r   r   c                 C  s   | ƒ S r   r   r   r   r   r   r   Í  s    z!TopLayerElementsUpdated.from_jsonNr3  r   r   r   r   r8  È  s   r8  zDOM.pseudoElementRemovedc                   @  s6   e Zd ZU dZded< ded< edd dœdd„ƒZd	S )
ÚPseudoElementRemovedz8Called when a pseudo element is removed from an element.r
   rP   Úpseudo_element_idr   r   c                 C  s$   | t  | d¡¡t  | d¡¡d�S )Nrs   ZpseudoElementId)rP   r:  r/  r   r   r   r   r   Û  s    þzPseudoElementRemoved.from_jsonNr#  r   r   r   r   r9  Ò  s
   
r9  zDOM.scrollableFlagUpdatedc                   @  s6   e Zd ZU dZded< ded< edd dœdd	„ƒZd
S )ÚScrollableFlagUpdatedz1Called when a node's scrollability state changes.r
   rL   r—   rk   r   r   c                 C  s"   | t  | d¡¡t| d¡ƒd�S )Nrp   rŽ   )rL   rk   ©r
   r   r2   r—   r   r   r   r   r   ì  s    þzScrollableFlagUpdated.from_jsonNr#  r   r   r   r   r;  ã  s
   
r;  zDOM.adRelatedStateUpdatedc                   @  s6   e Zd ZU dZded< ded< edd dœdd	„ƒZd
S )ÚAdRelatedStateUpdatedz-Fired when a node's ad related state changes.r
   rL   rn   ro   r   r   c                 C  s:   | t  | d¡¡| dd ¡d ur2tj | d¡¡nd d�S )Nrp   r‘   )rL   ro   )r
   r   r2   r   r˜   r   r   r   r   r   ý  s    ýÿúzAdRelatedStateUpdated.from_jsonNr#  r   r   r   r   r=  ô  s
   
r=  z'DOM.affectedByStartingStylesFlagUpdatedc                   @  s6   e Zd ZU dZded< ded< edd dœdd	„ƒZd
S )Ú#AffectedByStartingStylesFlagUpdatedz,Fired when a node's starting styles changes.r
   rL   r—   rl   r   r   c                 C  s"   | t  | d¡¡t| d¡ƒd�S )Nrp   r�   )rL   rl   r<  r   r   r   r   r     s    ÿþz-AffectedByStartingStylesFlagUpdated.from_jsonNr#  r   r   r   r   r>  	  s
   
r>  zDOM.setChildNodesc                   @  s6   e Zd ZU dZded< ded< edd dœdd	„ƒZd
S )ÚSetChildNodesz‘
    Fired when backend wants to provide client with the missing DOM structure.
    This happens upon most of the calls requesting node ids.
    r
   rP   ztyping.List[Node]rÙ   r   r   c                 C  s&   | t  | d¡¡dd„ |d D ƒd�S )Nrs   c                 S  s   g | ]}t  |¡‘qS r   r’   rv   r   r   r   ry   .  rz   z+SetChildNodes.from_json.<locals>.<listcomp>rÙ   )rP   rÙ   r/  r   r   r   r   r   *  s    þzSetChildNodes.from_jsonNr#  r   r   r   r   r?    s
   
r?  zDOM.shadowRootPoppedc                   @  s6   e Zd ZU dZded< ded< edd dœdd„ƒZd	S )
ÚShadowRootPoppedz3Called when shadow root is popped from the element.r
   Úhost_idÚroot_idr   r   c                 C  s$   | t  | d¡¡t  | d¡¡d�S )NÚhostIdZrootId)rA  rB  r/  r   r   r   r   r   ;  s    þzShadowRootPopped.from_jsonNr#  r   r   r   r   r@  2  s
   
r@  zDOM.shadowRootPushedc                   @  s6   e Zd ZU dZded< ded< edd dœdd	„ƒZd
S )ÚShadowRootPushedz3Called when shadow root is pushed into the element.r
   rA  rK   rÖ   r   r   c                 C  s$   | t  | d¡¡t | d¡¡d�S )NrC  rÖ   )rA  rÖ   r-  r   r   r   r   r   L  s    þzShadowRootPushed.from_jsonNr#  r   r   r   r   rD  C  s
   
rD  )N)NNNNN)NNNN)N)NNN)NNN)NNN)NN)NN)N)NN)NNNN)N)N)NN)NNNN)N)NNN)NNNNN)N)iÚ
__future__r   ÚenumÚtypingÚdataclassesr   Úutilr   r   Ú r   r   r	   r   r
   r'   r&   r(   r)   ÚEnumr5   r>   rA   rB   rG   rH   rK   r™   ÚlistrŸ   r    r©   r®   r±   r¸   r¿   rÅ   rÇ   rÉ   rÍ   rÏ   rÑ   rÒ   rÔ   rÕ   rØ   rÚ   rÞ   râ   ræ   rç   rê   rë   rì   rí   rî   rï   rñ   ró   rõ   rø   rù   rú   rü   rý   rÿ   r   r  r  r  r  r
  r  r  r  r  r  r  r  r  r  r  r  r  r  r   r!  r$  r%  r&  r(  r)  r.  r0  r2  r4  r6  r8  r9  r;  r=  r>  r?  r@  rD  r   r   r   r   Ú<module>   sz  4  .ý    û)   ü#ÿ  ý  ý  ýÿÿ ý  ü3   üýÿ ý   ü"ÿ  ü#    ú/ÿ