o
    ҷhP                     @  sp  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 ddl	m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eG dd dZeG dd dZG dd dejZeG dd dZG dd dej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eG d#d$ d$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G d-d. d.ejZ dd1d2Z!dd3d4Z"				ddd>d?Z#ddBdCZ$ddDdEZ%ddFdGZ&		dddMdNZ'				dddWdXZ(		ddd]d^Z)		dddddeZ*			dddgdhZ+	dddkdlZ,ddodpZ-	dddrdsZ.ddtduZ/ddvdwZ0ddzd{Z1dd~dZ2dddZ3dddZ4dddZ5dddZ6dddZ7dddZ8dddZ9dddZ:	ddddZ;dddZ<edeG dd dZ=edeG dd dZ>edeG dd dZ?edeG dd dZ@dS )    )annotations   )event_classT_JSON_DICT)	dataclassN)dom)page)runtimec                   @  s6   e Zd ZU dZded< ded< dd Zedd Zd	S )
SourceOrderConfigzR
    Configuration data for drawing the source order of an elements children.
    zdom.RGBAparent_outline_colorchild_outline_colorc                 C  &   t  }| j |d< | j |d< |S )NparentOutlineColorchildOutlineColor)dictr   to_jsonr   selfjson r   b/var/www/html/venv/lib/python3.10/site-packages/selenium/webdriver/common/devtools/v117/overlay.pyr         zSourceOrderConfig.to_jsonc                 C  s$   | t j|d t j|d dS )Nr   r   )r   r   r   RGBA	from_jsonclsr   r   r   r   r   "   s   zSourceOrderConfig.from_jsonN__name__
__module____qualname____doc____annotations__r   classmethodr   r   r   r   r   r
         
 r
   c                   @  s  e Zd ZU dZ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d Zedd ZdS )GridHighlightConfigzC
    Configuration data for the highlighting of Grid elements.
    Ntyping.Optional[bool]show_grid_extension_linesshow_positive_line_numbersshow_negative_line_numbersshow_area_namesshow_line_namesshow_track_sizestyping.Optional[dom.RGBA]grid_border_colorcell_border_colorrow_line_colorcolumn_line_colorgrid_border_dashcell_border_dashrow_line_dashcolumn_line_dashrow_gap_colorrow_hatch_colorcolumn_gap_colorcolumn_hatch_colorarea_border_colorgrid_background_colorc                 C  s  t  }| 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r5| j|d< | jd ur?| j|d< | jd urK| j |d< | j	d urW| j	 |d< | j
d urc| j
 |d	< | jd uro| j |d
< | jd ury| 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| 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< |S )NshowGridExtensionLinesshowPositiveLineNumbersshowNegativeLineNumbersshowAreaNamesshowLineNamesshowTrackSizesgridBorderColorcellBorderColorrowLineColorcolumnLineColorgridBorderDashcellBorderDashrowLineDashcolumnLineDashrowGapColorrowHatchColorcolumnGapColorcolumnHatchColorareaBorderColorgridBackgroundColor)r   r'   r(   r)   r*   r+   r,   r.   r   r/   r0   r1   r2   r3   r4   r5   r6   r7   r8   r9   r:   r;   r   r   r   r   r   k   sT   





























zGridHighlightConfig.to_jsonc                 C  sB  | d)i dd|v rt |d nd dd|v rt |d nd dd|v r(t |d nd dd|v r5t |d nd d	d
|v rBt |d
 nd dd|v rOt |d nd dd|v r^tj|d nd dd|v rmtj|d nd dd|v r|tj|d nd dd|v rtj|d nd dd|v rt |d nd dd|v rt |d nd dd|v rt |d nd dd|v rt |d nd dd|v rtj|d nd dd |v rtj|d  nd d!d"|v rtj|d" nd d#d$|v rtj|d$ nd d%d&|v rtj|d& nd d'd(|v rtj|d( S d S )*Nr'   r<   r(   r=   r)   r>   r*   r?   r+   r@   r,   rA   r.   rB   r/   rC   r0   rD   r1   rE   r2   rF   r3   rG   r4   rH   r5   rI   r6   rJ   r7   rK   r8   rL   r9   rM   r:   rN   r;   rO   r   )boolr   r   r   r   r   r   r   r      s|   	
zGridHighlightConfig.from_json)r   r   r    r!   r'   r"   r(   r)   r*   r+   r,   r.   r/   r0   r1   r2   r3   r4   r5   r6   r7   r8   r9   r:   r;   r   r#   r   r   r   r   r   r%   *   s2   
 ,r%   c                   @  s   e Zd ZU dZ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d Zedd ZdS )FlexContainerHighlightConfigzM
    Configuration data for the highlighting of Flex container elements.
    Ntyping.Optional[LineStyle]container_borderline_separatoritem_separatortyping.Optional[BoxStyle]main_distributed_spacecross_distributed_spacerow_gap_spacecolumn_gap_spacecross_alignmentc                 C  s   t  }| jd ur| j |d< | jd ur| j |d< | jd ur'| j |d< | jd ur3| j |d< | jd ur?| j |d< | jd urK| j |d< | jd urW| j |d< | j	d urc| j	 |d< |S )	NcontainerBorderlineSeparatoritemSeparatormainDistributedSpacecrossDistributedSpacerowGapSpacecolumnGapSpacecrossAlignment)
r   rS   r   rT   rU   rW   rX   rY   rZ   r[   r   r   r   r   r      s$   







z$FlexContainerHighlightConfig.to_jsonc                 C  s   | d|v rt |d nd d|v rt |d nd d|v r$t |d nd d|v r0t|d nd d|v r<t|d nd d|v rHt|d nd d|v rTt|d nd d|v rbt |d d	S d d	S )
Nr\   r]   r^   r_   r`   ra   rb   rc   )rS   rT   rU   rW   rX   rY   rZ   r[   )	LineStyler   BoxStyler   r   r   r   r      s   z&FlexContainerHighlightConfig.from_json)r   r   r    r!   rS   r"   rT   rU   rW   rX   rY   rZ   r[   r   r#   r   r   r   r   r   rQ      s   
 rQ   c                   @  sJ   e Zd ZU dZdZded< dZded< dZded< dd	 Ze	d
d Z
dS )FlexItemHighlightConfigzH
    Configuration data for the highlighting of Flex item elements.
    NrV   base_size_boxrR   base_size_borderflexibility_arrowc                 C  R   t  }| jd ur| j |d< | jd ur| j |d< | jd ur'| j |d< |S )NbaseSizeBoxbaseSizeBorderflexibilityArrow)r   rg   r   rh   ri   r   r   r   r   r         


zFlexItemHighlightConfig.to_jsonc                 C  sT   | d|v rt |d nd d|v rt|d nd d|v r&t|d dS d dS )Nrk   rl   rm   )rg   rh   ri   )re   r   rd   r   r   r   r   r     s   z!FlexItemHighlightConfig.from_json)r   r   r    r!   rg   r"   rh   ri   r   r#   r   r   r   r   r   rf      s   
 
rf   c                   @  s>   e Zd ZU dZdZded< dZded< dd Zed	d
 Z	dS )rd   z/
    Style information for drawing a line.
    Nr-   colortyping.Optional[str]patternc                 C  s6   t  }| jd ur| j |d< | jd ur| j|d< |S )Nro   rq   )r   ro   r   rq   r   r   r   r   r     s   


zLineStyle.to_jsonc                 C  s<   | d|v rt j|d nd d|v rt|d dS d dS )Nro   rq   )ro   rq   )r   r   r   strr   r   r   r   r   $  s   zLineStyle.from_json)
r   r   r    r!   ro   r"   rq   r   r#   r   r   r   r   r   rd        
 rd   c                   @  s>   e Zd ZU dZdZded< dZded< dd Zedd	 Z	dS )
re   z.
    Style information for drawing a box.
    Nr-   
fill_colorhatch_colorc                 C  :   t  }| jd ur| j |d< | jd ur| j |d< |S )N	fillColor
hatchColor)r   rt   r   ru   r   r   r   r   r   7     

zBoxStyle.to_jsonc                 C  s@   | d|v rt j|d nd d|v rt j|d dS d dS )Nrw   rx   )rt   ru   r   r   r   r   r   r   ?  s   zBoxStyle.from_json)
r   r   r    r!   rt   r"   ru   r   r#   r   r   r   r   r   re   ,  rs   re   c                   @  s,   e Zd ZdZdZdZdd Zedd ZdS )	ContrastAlgorithmaaaaaapcac                 C     | j S Nvaluer   r   r   r   r   L     zContrastAlgorithm.to_jsonc                 C     | |S r   r   r   r   r   r   r   O     zContrastAlgorithm.from_jsonN)	r   r   r    AAAAAAPCAr   r#   r   r   r   r   r   rz   G  s    rz   c                   @  s
  e Zd ZU dZ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d Zed d! ZdS )"HighlightConfigzC
    Configuration data for the highlighting of page elements.
    Nr&   	show_infoshow_stylesshow_rulersshow_accessibility_infoshow_extension_linesr-   content_colorpadding_colorborder_colormargin_colorevent_target_colorshape_colorshape_margin_colorcss_grid_colortyping.Optional[ColorFormat]color_formatz$typing.Optional[GridHighlightConfig]grid_highlight_configz-typing.Optional[FlexContainerHighlightConfig]flex_container_highlight_configz(typing.Optional[FlexItemHighlightConfig]flex_item_highlight_configz"typing.Optional[ContrastAlgorithm]contrast_algorithmz7typing.Optional[ContainerQueryContainerHighlightConfig]*container_query_container_highlight_configc                 C  s  t  }| 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r5| j|d< | jd urA| j |d< | jd urM| j |d< | j	d urY| j	 |d< | j
d ure| j
 |d	< | jd urq| 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| 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< |S )NshowInfo
showStyles
showRulersshowAccessibilityInfoshowExtensionLinescontentColorpaddingColorborderColormarginColoreventTargetColor
shapeColorshapeMarginColorcssGridColorcolorFormatgridHighlightConfigflexContainerHighlightConfigflexItemHighlightConfigcontrastAlgorithm&containerQueryContainerHighlightConfig)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     sP   























zHighlightConfig.to_jsonc                 C  s,  | d'i dd|v rt |d nd dd|v rt |d nd dd|v r(t |d nd dd|v r5t |d nd d	d
|v rBt |d
 nd dd|v rQtj|d nd dd|v r`tj|d nd dd|v rotj|d nd dd|v r~tj|d nd dd|v rtj|d nd dd|v rtj|d nd dd|v rtj|d nd dd|v rtj|d nd dd|v rt|d nd dd|v rt|d nd dd |v rt|d  nd d!d"|v rt|d" nd d#d$|v rt|d$ nd 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   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   )
rP   r   r   r   ColorFormatr%   rQ   rf   rz   &ContainerQueryContainerHighlightConfigr   r   r   r   r     sv   	
zHighlightConfig.from_json)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   T  s0   
 *r   c                   @  s0   e Zd ZdZdZdZdZdd Zedd Z	d	S )
r   rgbhslhwbhexc                 C  r~   r   r   r   r   r   r   r     r   zColorFormat.to_jsonc                 C  r   r   r   r   r   r   r   r     r   zColorFormat.from_jsonN)
r   r   r    RGBHSLHWBHEX_r   r#   r   r   r   r   r   r     s    r   c                   @  s6   e Zd ZU dZded< ded< dd Zedd	 Zd
S )GridNodeHighlightConfigz6
    Configurations for Persistent Grid Highlight
    r%   r   
dom.NodeIdnode_idc                 C  r   )Nr   nodeId)r   r   r   r   r   r   r   r   r     r   zGridNodeHighlightConfig.to_jsonc                 C  "   | t |d tj|d dS )Nr   r   )r   r   )r%   r   r   NodeIdr   r   r   r   r        z!GridNodeHighlightConfig.from_jsonNr   r   r   r   r   r     r$   r   c                   @  2   e Zd ZU ded< ded< dd Zedd Zd	S )
FlexNodeHighlightConfigrQ   r   r   r   c                 C  r   )Nr   r   )r   r   r   r   r   r   r   r   r     r   zFlexNodeHighlightConfig.to_jsonc                 C  r   )Nr   r   )r   r   )rQ   r   r   r   r   r   r   r   r   
  r   z!FlexNodeHighlightConfig.from_jsonNr   r   r    r"   r   r#   r   r   r   r   r   r        
 r   c                   @  sR   e Zd ZU dZded< dZded< dZded< dZded< dd	 Ze	d
d Z
dS )"ScrollSnapContainerHighlightConfigNrR   snapport_bordersnap_area_borderr-   scroll_margin_colorscroll_padding_colorc                 C  sj   t  }| jd ur| j |d< | jd ur| j |d< | jd ur'| j |d< | jd ur3| j |d< |S )NsnapportBordersnapAreaBorderscrollMarginColorscrollPaddingColor)r   r   r   r   r   r   r   r   r   r   r      s   



z*ScrollSnapContainerHighlightConfig.to_jsonc                 C  sp   | d|v rt |d nd d|v rt |d nd d|v r%tj|d nd d|v r4tj|d dS d dS )Nr   r   r   r   )r   r   r   r   )rd   r   r   r   r   r   r   r   r   ,  s   z,ScrollSnapContainerHighlightConfig.from_json)r   r   r    r   r"   r   r   r   r   r#   r   r   r   r   r   r     s   
 r   c                   @  r   )
ScrollSnapHighlightConfigr   &scroll_snap_container_highlight_configr   r   c                 C  r   )N"scrollSnapContainerHighlightConfigr   )r   r   r   r   r   r   r   r   r   >  r   z!ScrollSnapHighlightConfig.to_jsonc                 C  r   )Nr   r   )r   r   )r   r   r   r   r   r   r   r   r   D  r   z#ScrollSnapHighlightConfig.from_jsonNr   r   r   r   r   r   6  r   r   c                   @  sF   e Zd ZU dZded< dZded< dZded< dd	 Zed
d Z	dS )HingeConfigz-
    Configuration for dual screen hinge
    zdom.RectrectNr-   r   outline_colorc                 C  sH   t  }| j |d< | jd ur| j |d< | jd ur"| j |d< |S )Nr   r   outlineColor)r   r   r   r   r   r   r   r   r   r   Z  s   

zHingeConfig.to_jsonc                 C  sN   | t j|d d|v rt j|d nd d|v r#t j|d dS d dS )Nr   r   r   )r   r   r   )r   Rectr   r   r   r   r   r   r   c  s   zHingeConfig.from_json)
r   r   r    r!   r"   r   r   r   r#   r   r   r   r   r   r   L  s   
 	r   c                   @  r   )
ContainerQueryHighlightConfigr   r   r   r   c                 C  r   )Nr   r   )r   r   r   r   r   r   r   r   r   t  r   z%ContainerQueryHighlightConfig.to_jsonc                 C  r   )Nr   r   )r   r   )r   r   r   r   r   r   r   r   r   z  r   z'ContainerQueryHighlightConfig.from_jsonNr   r   r   r   r   r   l  r   r   c                   @  s:   e Zd ZU dZded< dZded< dd Zedd ZdS )	r   NrR   rS   descendant_borderc                 C  rv   )Nr\   descendantBorder)r   rS   r   r   r   r   r   r   r     ry   z.ContainerQueryContainerHighlightConfig.to_jsonc                 C  s<   | d|v rt |d nd d|v rt |d dS d dS )Nr\   r   )rS   r   )rd   r   r   r   r   r   r     s   z0ContainerQueryContainerHighlightConfig.from_json)	r   r   r    rS   r"   r   r   r#   r   r   r   r   r   r     s   
 r   c                   @  r   )
IsolatedElementHighlightConfigIsolationModeHighlightConfigisolation_mode_highlight_configr   r   c                 C  r   )NisolationModeHighlightConfigr   )r   r   r   r   r   r   r   r   r     r   z&IsolatedElementHighlightConfig.to_jsonc                 C  r   )Nr   r   )r   r   )r   r   r   r   r   r   r   r   r     r   z(IsolatedElementHighlightConfig.from_jsonNr   r   r   r   r   r     r   r   c                   @  sF   e Zd ZU dZded< dZded< dZded< dd Zedd	 Z	dS )
r   Nr-   resizer_colorresizer_handle_color
mask_colorc                 C  rj   )NresizerColorresizerHandleColor	maskColor)r   r   r   r   r   r   r   r   r   r     rn   z$IsolationModeHighlightConfig.to_jsonc                 C  sZ   | d|v rt j|d nd d|v rt j|d nd d|v r)t j|d dS d dS )Nr   r   r   )r   r   r   r   r   r   r   r   r     s   z&IsolationModeHighlightConfig.from_json)
r   r   r    r   r"   r   r   r   r#   r   r   r   r   r   r     s   
 
r   c                   @  s4   e Zd ZdZdZdZdZdZdd Ze	dd	 Z
d
S )InspectModesearchForNodesearchForUAShadowDOMcaptureAreaScreenshotshowDistancesnonec                 C  r~   r   r   r   r   r   r   r     r   zInspectMode.to_jsonc                 C  r   r   r   r   r   r   r   r     r   zInspectMode.from_jsonN)r   r   r    SEARCH_FOR_NODESEARCH_FOR_UA_SHADOW_DOMCAPTURE_AREA_SCREENSHOTSHOW_DISTANCESNONEr   r#   r   r   r   r   r   r     s    r   return0typing.Generator[T_JSON_DICT, T_JSON_DICT, None]c                  c      ddi} | V }dS )z(
    Disables domain notifications.
    methodzOverlay.disableNr   cmd_dictr   r   r   r   disable     
r   c                  c  r   )z'
    Enables domain notifications.
    r   zOverlay.enableNr   r   r   r   r   enable  r   r   r   r   include_distancer&   include_styler   r   r   0typing.Generator[T_JSON_DICT, T_JSON_DICT, dict]c                 c  st    t  }|  |d< |dur||d< |dur||d< |dur$| |d< |dur,||d< d|d}|V }t |d	 S )
a  
    For testing.

    :param node_id: Id of the node to get highlight object for.
    :param include_distance: *(Optional)* Whether to include distance info.
    :param include_style: *(Optional)* Whether to include style info.
    :param color_format: *(Optional)* The color format to get config with (default: hex).
    :param show_accessibility_info: *(Optional)* Whether to show accessibility info (default: true).
    :returns: Highlight data for the node.
    r   NincludeDistanceincludeStyler   r   z!Overlay.getHighlightObjectForTestr   params	highlightr   r   )r   r   r   r   r   r   r   r   r   r   r   get_highlight_object_for_test  s    r  node_idstyping.List[dom.NodeId]c                 c  s6    t  }dd | D |d< d|d}|V }t |d S )z
    For Persistent Grid testing.

    :param node_ids: Ids of the node to get highlight object for.
    :returns: Grid Highlight data for the node ids provided.
    c                 S     g | ]}|  qS r   r   .0ir   r   r   
<listcomp>      z7get_grid_highlight_objects_for_test.<locals>.<listcomp>nodeIdsz&Overlay.getGridHighlightObjectsForTestr   
highlightsr   )r  r   r   r   r   r   r   #get_grid_highlight_objects_for_test  s   	r  c                 c  s0    t  }|  |d< d|d}|V }t |d S )z
    For Source Order Viewer testing.

    :param node_id: Id of the node to highlight.
    :returns: Source order highlight data for the node id provided.
    r   z,Overlay.getSourceOrderHighlightObjectForTestr   r   r   )r   r   r   r   r   r   r   *get_source_order_highlight_object_for_test'  s   	r  c                  c  r   )z
    Hides any highlight.
    r   zOverlay.hideHighlightNr   r   r   r   r   hide_highlight:  r   r  frame_idpage.FrameIdr   r-   content_outline_colorc                 c  P    t  }|  |d< |dur| |d< |dur| |d< d|d}|V }dS )a  
    Highlights owner element of the frame with given id.
    Deprecated: Doesn't work reliablity and cannot be fixed due to process
    separatation (the owner node might be in a different process). Determine
    the owner node in the client and use highlightNode.

    :param frame_id: Identifier of the frame to highlight.
    :param content_color: *(Optional)* The content box highlight fill color (default: transparent).
    :param content_outline_color: *(Optional)* The content box highlight outline color (default: transparent).
    frameIdNr   contentOutlineColorzOverlay.highlightFramer   r   )r  r   r  r   r   r   r   r   r   highlight_frameD  s   
r  highlight_configtyping.Optional[dom.NodeId]backend_node_id"typing.Optional[dom.BackendNodeId]	object_id'typing.Optional[runtime.RemoteObjectId]selectorrp   c                 c  st    t  }|  |d< |dur| |d< |dur| |d< |dur(| |d< |dur0||d< d|d}|V }dS )	a  
    Highlights DOM node with given id or with the given JavaScript object wrapper. Either nodeId or
    objectId must be specified.

    :param highlight_config: A descriptor for the highlight appearance.
    :param node_id: *(Optional)* Identifier of the node to highlight.
    :param backend_node_id: *(Optional)* Identifier of the backend node to highlight.
    :param object_id: *(Optional)* JavaScript object id of the node to be highlighted.
    :param selector: *(Optional)* Selectors to highlight relevant nodes.
    highlightConfigNr   backendNodeIdobjectIdr  zOverlay.highlightNoder   r   )r  r   r  r  r  r   r   r   r   r   r   highlight_node`  s   
r"  quaddom.Quadro   r   c                 c  r  )a1  
    Highlights given quad. Coordinates are absolute with respect to the main frame viewport.

    :param quad: Quad to highlight
    :param color: *(Optional)* The highlight fill color (default: transparent).
    :param outline_color: *(Optional)* The highlight outline color (default: transparent).
    r#  Nro   r   zOverlay.highlightQuadr   r   )r#  ro   r   r   r   r   r   r   r   highlight_quad  s   
r%  xintywidthheightc           	      c  sd    t  }| |d< ||d< ||d< ||d< |dur| |d< |dur(| |d< d|d	}|V }dS )
a  
    Highlights given rectangle. Coordinates are absolute with respect to the main frame viewport.

    :param x: X coordinate
    :param y: Y coordinate
    :param width: Rectangle width
    :param height: Rectangle height
    :param color: *(Optional)* The highlight fill color (default: transparent).
    :param outline_color: *(Optional)* The highlight outline color (default: transparent).
    r&  r(  r)  r*  Nro   r   zOverlay.highlightRectr   r   )	r&  r(  r)  r*  ro   r   r   r   r   r   r   r   highlight_rect  s   
r+  source_order_configc                 c  sd    t  }|  |d< |dur| |d< |dur| |d< |dur(| |d< d|d}|V }dS )a  
    Highlights the source order of the children of the DOM node with given id or with the given
    JavaScript object wrapper. Either nodeId or objectId must be specified.

    :param source_order_config: A descriptor for the appearance of the overlay drawing.
    :param node_id: *(Optional)* Identifier of the node to highlight.
    :param backend_node_id: *(Optional)* Identifier of the backend node to highlight.
    :param object_id: *(Optional)* JavaScript object id of the node to be highlighted.
    sourceOrderConfigNr   r   r!  zOverlay.highlightSourceOrderr   r   )r,  r   r  r  r   r   r   r   r   r   highlight_source_order  s   
r.  mode typing.Optional[HighlightConfig]c                 c  s<    t  }|  |d< |dur| |d< d|d}|V }dS )av  
    Enters the 'inspect' mode. In this mode, elements that user is hovering over are highlighted.
    Backend then generates 'inspectNodeRequested' event upon element selection.

    :param mode: Set an inspection mode.
    :param highlight_config: *(Optional)* A descriptor for the highlight appearance of hovered-over nodes. May be omitted if ```enabled == false```.
    r/  Nr  zOverlay.setInspectModer   r   )r/  r  r   r   r   r   r   r   set_inspect_mode  s   
r1  showrP   c                 c  $    t  }| |d< d|d}|V }dS )zu
    Highlights owner element of all frames detected to be ads.

    :param show: True for showing ad highlights
    r2  zOverlay.setShowAdHighlightsr   Nr  r2  r   r   r   r   r   r   set_show_ad_highlights     
r5  messagec                 c  s,    t  }| dur| |d< d|d}|V }dS )zk
    :param message: *(Optional)* The message to display, also triggers resume and step over controls.
    Nr7  z"Overlay.setPausedInDebuggerMessager   r  )r7  r   r   r   r   r   r   set_paused_in_debugger_message  s   
r8  c                 c  r3  )zn
    Requests that backend shows debug borders on layers

    :param show: True for showing debug borders
    r2  zOverlay.setShowDebugBordersr   Nr  r4  r   r   r   set_show_debug_borders  r6  r9  c                 c  r3  )zh
    Requests that backend shows the FPS counter

    :param show: True for showing the FPS counter
    r2  zOverlay.setShowFPSCounterr   Nr  r4  r   r   r   set_show_fps_counter#  r6  r:  grid_node_highlight_configs$typing.List[GridNodeHighlightConfig]c                 c  .    t  }dd | D |d< d|d}|V }dS )z
    Highlight multiple elements with the CSS Grid overlay.

    :param grid_node_highlight_configs: An array of node identifiers and descriptors for the highlight appearance.
    c                 S  r  r   r  r  r   r   r   r	  =  r
  z*set_show_grid_overlays.<locals>.<listcomp>gridNodeHighlightConfigszOverlay.setShowGridOverlaysr   Nr  )r;  r   r   r   r   r   r   set_show_grid_overlays4     
r?  flex_node_highlight_configs$typing.List[FlexNodeHighlightConfig]c                 c  r=  )zx
    :param flex_node_highlight_configs: An array of node identifiers and descriptors for the highlight appearance.
    c                 S  r  r   r  r  r   r   r   r	  L  r
  z*set_show_flex_overlays.<locals>.<listcomp>flexNodeHighlightConfigszOverlay.setShowFlexOverlaysr   Nr  )rA  r   r   r   r   r   r   set_show_flex_overlaysE     
rD  scroll_snap_highlight_configs&typing.List[ScrollSnapHighlightConfig]c                 c  r=  )zz
    :param scroll_snap_highlight_configs: An array of node identifiers and descriptors for the highlight appearance.
    c                 S  r  r   r  r  r   r   r   r	  [  r
  z1set_show_scroll_snap_overlays.<locals>.<listcomp>scrollSnapHighlightConfigsz!Overlay.setShowScrollSnapOverlaysr   Nr  )rF  r   r   r   r   r   r   set_show_scroll_snap_overlaysT  rE  rI  !container_query_highlight_configs*typing.List[ContainerQueryHighlightConfig]c                 c  r=  )z~
    :param container_query_highlight_configs: An array of node identifiers and descriptors for the highlight appearance.
    c                 S  r  r   r  r  r   r   r   r	  j  r
  z5set_show_container_query_overlays.<locals>.<listcomp>containerQueryHighlightConfigsz%Overlay.setShowContainerQueryOverlaysr   Nr  )rJ  r   r   r   r   r   r   !set_show_container_query_overlaysc  rE  rM  resultc                 c  r3  )zl
    Requests that backend shows paint rectangles

    :param result: True for showing paint rectangles
    rN  zOverlay.setShowPaintRectsr   Nr  rN  r   r   r   r   r   r   set_show_paint_rectsr  r6  rP  c                 c  r3  )zt
    Requests that backend shows layout shift regions

    :param result: True for showing layout shift regions
    rN  z!Overlay.setShowLayoutShiftRegionsr   Nr  rO  r   r   r   set_show_layout_shift_regions  r6  rQ  c                 c  r3  )zx
    Requests that backend shows scroll bottleneck rects

    :param show: True for showing scroll bottleneck rects
    r2  z$Overlay.setShowScrollBottleneckRectsr   Nr  r4  r   r   r    set_show_scroll_bottleneck_rects  r6  rR  c                 c  r3  )zc
    Deprecated, no longer has any effect.

    :param show: True for showing hit-test borders
    r2  zOverlay.setShowHitTestBordersr   Nr  r4  r   r   r   set_show_hit_test_borders  r6  rS  c                 c  r3  )zY
    Request that backend shows an overlay with web vital metrics.

    :param show:
    r2  zOverlay.setShowWebVitalsr   Nr  r4  r   r   r   set_show_web_vitals  r6  rT  c                 c  r3  )zf
    Paints viewport size upon main frame resize.

    :param show: Whether to paint size or not.
    r2  z#Overlay.setShowViewportSizeOnResizer   Nr  r4  r   r   r    set_show_viewport_size_on_resize  r6  rU  hinge_configtyping.Optional[HingeConfig]c                 c  s0    t  }| dur|  |d< d|d}|V }dS )zp
    Add a dual screen device hinge

    :param hinge_config: *(Optional)* hinge data, null means hideHinge
    NhingeConfigzOverlay.setShowHinger   r   )rV  r   r   r   r   r   r   set_show_hinge  s   
rY  "isolated_element_highlight_configs+typing.List[IsolatedElementHighlightConfig]c                 c  r=  )z
    Show elements in isolation mode with overlays.

    :param isolated_element_highlight_configs: An array of node identifiers and descriptors for the highlight appearance.
    c                 S  r  r   r  r  r   r   r   r	    r
  z.set_show_isolated_elements.<locals>.<listcomp>isolatedElementHighlightConfigszOverlay.setShowIsolatedElementsr   Nr  )rZ  r   r   r   r   r   r   set_show_isolated_elements  r@  r]  zOverlay.inspectNodeRequestedc                   @  (   e Zd ZU dZded< ed
ddZd	S )InspectNodeRequestedz
    Fired when the node should be inspected. This happens after call to ``setInspectMode`` or when
    user manually inspects an element.
    zdom.BackendNodeIdr  r   r   r   c                 C     | t j|d dS )Nr   )r  )r   BackendNodeIdr   r   r   r   r   r        zInspectNodeRequested.from_jsonN)r   r   r   r_  r   r   r    r!   r"   r#   r   r   r   r   r   r_    s
   
 r_  zOverlay.nodeHighlightRequestedc                   @  r^  )NodeHighlightRequestedzc
    Fired when the node should be highlighted. This happens after call to ``setInspectMode``.
    r   r   r   r   r   c                 C  r`  )Nr   )r   )r   r   r   r   r   r   r   r     rb  z NodeHighlightRequested.from_jsonN)r   r   r   rd  rc  r   r   r   r   rd    s
   
 rd  zOverlay.screenshotRequestedc                   @  r^  )ScreenshotRequestedzN
    Fired when user asks to capture screenshot of some area on the page.
    zpage.Viewportviewportr   r   r   c                 C  r`  )Nrf  )rf  )r   Viewportr   r   r   r   r   r   $  rb  zScreenshotRequested.from_jsonN)r   r   r   re  rc  r   r   r   r   re    s
   
 re  zOverlay.inspectModeCanceledc                   @  s   e Zd ZdZedddZdS )	InspectModeCanceledz3
    Fired when user cancels the inspect mode.
    r   r   r   c                 C  s   |  S r   r   r   r   r   r   r   3  s   zInspectModeCanceled.from_jsonN)r   r   r   rh  )r   r   r    r!   r#   r   r   r   r   r   rh  +  s    rh  )r   r   )NNNN)r   r   r   r&   r   r&   r   r   r   r&   r   r   )r  r  r   r   )r   r   r   r   )NN)r  r  r   r-   r  r-   r   r   )r  r   r   r  r  r  r  r  r  rp   r   r   )r#  r$  ro   r-   r   r-   r   r   )r&  r'  r(  r'  r)  r'  r*  r'  ro   r-   r   r-   r   r   )NNN)
r,  r
   r   r  r  r  r  r  r   r   r   )r/  r   r  r0  r   r   )r2  rP   r   r   )r7  rp   r   r   )r;  r<  r   r   )rA  rB  r   r   )rF  rG  r   r   )rJ  rK  r   r   )rN  rP   r   r   )rV  rW  r   r   )rZ  r[  r   r   )A
__future__r   utilr   r   dataclassesr   enumtyping r   r   r	   r
   r%   rQ   rf   rd   re   Enumrz   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r  r  r  r  r"  r%  r+  r.  r1  r5  r8  r9  r:  r?  rD  rI  rM  rP  rQ  rR  rS  rT  rU  rY  r]  r_  rd  re  rh  r   r   r   r   <module>   s    >  #



#

$$ 













