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 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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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 d0d1„ d1ƒƒZ!eG d2d3„ d3ƒƒZ"eG d4d5„ d5ƒƒZ#eG d6d7„ d7ƒƒZ$eG d8d9„ d9ƒƒZ%eG d:d;„ d;ƒƒZ&eG d<d=„ d=ƒƒZ'eG d>d?„ d?ƒƒZ(eG d@dA„ dAƒƒZ)eG dBdC„ dCƒƒZ*eG dDdE„ dEƒƒZ+eG dFdG„ dGƒƒZ,eG dHdI„ dIƒƒZ-eG dJdK„ dKƒƒZ.eG dLdM„ dMƒƒZ/eG dNdO„ dOƒƒZ0eG dPdQ„ dQƒƒZ1eG dRdS„ dSƒƒZ2eG dTdU„ dUƒƒZ3eG dVdW„ dWƒƒZ4eG dXdY„ dYƒƒZ5eG dZd[„ d[ƒƒZ6eG d\d]„ d]ƒƒZ7eG d^d_„ d_ƒƒZ8eG d`da„ daƒƒZ9dûdbdcd%dddedfœdgdh„Z:dbdidjœdkdl„Z;düdmdndodpœdqdr„Z<dsdtœdudv„Z=dsdtœdwdx„Z>dydzdsd{œd|d}„Z?dyd~dsdœd€d�„Z@dyd‚dƒœd„d…„ZAdyd†dƒœd‡dˆ„ZBdýdzdyd‰dŠd‰did‹œdŒd�„ZCdcdcdŽd�œd�d‘„ZDdyd’dƒœd“d”„ZEdyd•dƒœd–d—„ZFdyd˜dƒœd™dš„ZGd›dtœdœd�„ZHdždtœdŸd „ZIdyd¡dƒœd¢d£„ZJdbd¤djœd¥d¦„ZKdyd§dƒœd¨d©„ZLdbdcdªd«œd¬d­„ZMdþdddsdƒœd®d¯„ZNd°dsd±œd²d³„ZOd´dtœdµd¶„ZPdydcdcdsd·œd¸d¹„ZQdbd%dcdºd»œd¼d½„ZRdbd%dcdºd¾œd¿dÀ„ZSdbd%dcdÁdÂœdÃdÄ„ZTdbd%dcdÅdÂœdÆdÇ„ZUdbd%dcdÈdÂœdÉdÊ„ZVdbd%dcdËdÂœdÌdÍ„ZWdbd%dcdÎdÂœdÏdÐ„ZXdbd%dcdÑdÒœdÓdÔ„ZYdbdcdÕdÖœd×dØ„ZZdÿdÙdddÚdÛœdÜdÝ„Z[dsdtœdÞdß„Z\dàdtœdádâ„Z]dãdtœdädå„Z^d~dsdæœ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úƒƒƒZedS (   é    )ÚannotationsN)Ú	dataclassé   )Úevent_classÚT_JSON_DICT)Údom)Úpagec                   @  sB   e Zd 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 )ÚStyleSheetOrigina
  
    Stylesheet type: "injected" for stylesheets injected via extension,
    "user-agent" for user-agent stylesheets, "inspector" for stylesheets
    created by the inspector (i.e. those holding the "via inspector" rules),
    "regular" for regular stylesheets.
    Zinjectedz
user-agentZ	inspectorZregularÚstr©Úreturnc                 C  s   | j S ©N©Úvalue©Úself© r   ú/E:\soccer\ml_env\Lib\site-packages\mycdp/css.pyÚto_json   s    zStyleSheetOrigin.to_json©Újsonr   c                 C  s   | |ƒS r   r   ©Úclsr   r   r   r   Ú	from_json    s    zStyleSheetOrigin.from_jsonN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__ZINJECTEDZ
USER_AGENTZ	INSPECTORZREGULARr   Úclassmethodr   r   r   r   r   r	      s   r	   c                   @  sP   e Zd ZU dZ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 )ÚPseudoElementMatchesz.CSS rule collection for a single pseudo style.zdom.PseudoTypeÚpseudo_typeútyping.List[RuleMatch]ÚmatchesNútyping.Optional[str]Úpseudo_identifierr   r   c                 C  s@   t ƒ }| j ¡ |d< dd„ | jD ƒ|d< | jd ur<| j|d< |S )NÚ
pseudoTypec                 S  s   g | ]}|  ¡ ‘qS r   ©r   ©Ú.0Úir   r   r   Ú
<listcomp>2   ó    z0PseudoElementMatches.to_json.<locals>.<listcomp>r"   ÚpseudoIdentifier)Údictr    r   r"   r$   ©r   r   r   r   r   r   /   s    

zPseudoElementMatches.to_jsonr   c                 C  sD   | t j |d ¡dd„ |d D ƒ| dd ¡d ur<t|d ƒnd d�S )Nr%   c                 S  s   g | ]}t  |¡‘qS r   ©Ú	RuleMatchr   r'   r   r   r   r*   ;   r+   z2PseudoElementMatches.from_json.<locals>.<listcomp>r"   r,   )r    r"   r$   )r   Z
PseudoTyper   Úgetr
   r   r   r   r   r   7   s    ÿûzPseudoElementMatches.from_json)	r   r   r   r   Ú__annotations__r$   r   r   r   r   r   r   r   r   %   s   
r   c                   @  sH   e Zd ZU dZded< dZded< ddœd	d
„Zedd dœdd„ƒZdS )ÚCSSAnimationStylez@CSS style coming from animations with the name of the animation.ÚCSSStyleÚstyleNr#   Únamer   r   c                 C  s,   t ƒ }| j ¡ |d< | jd ur(| j|d< |S )Nr5   r6   )r-   r5   r   r6   r.   r   r   r   r   J   s
    

zCSSAnimationStyle.to_jsonr   c                 C  s6   | t  | d¡¡| dd ¡d ur.t| d¡ƒnd d�S )Nr5   r6   )r5   r6   )r4   r   r1   r
   r   r   r   r   r   Q   s    ÿüzCSSAnimationStyle.from_json)	r   r   r   r   r2   r6   r   r   r   r   r   r   r   r3   B   s   
r3   c                   @  sH   e Zd ZU dZded< dZded< ddœd	d
„Zedd dœdd„ƒZdS )ÚInheritedStyleEntryz1Inherited CSS rule collection from ancestor node.r!   Úmatched_css_rulesNútyping.Optional[CSSStyle]Úinline_styler   r   c                 C  s6   t ƒ }dd„ | jD ƒ|d< | jd ur2| j ¡ |d< |S )Nc                 S  s   g | ]}|  ¡ ‘qS r   r&   r'   r   r   r   r*   g   r+   z/InheritedStyleEntry.to_json.<locals>.<listcomp>ÚmatchedCSSRulesÚinlineStyle)r-   r8   r:   r   r.   r   r   r   r   e   s
    
zInheritedStyleEntry.to_jsonr   c                 C  s8   | dd„ |d D ƒ|  dd ¡d ur0t |d ¡nd d�S )Nc                 S  s   g | ]}t  |¡‘qS r   r/   r'   r   r   r   r*   o   s   z1InheritedStyleEntry.from_json.<locals>.<listcomp>r;   r<   )r8   r:   ©r1   r4   r   r   r   r   r   r   l   s    ÿÿúzInheritedStyleEntry.from_json)	r   r   r   r   r2   r:   r   r   r   r   r   r   r   r7   [   s   
r7   c                   @  sL   e Zd ZU dZdZded< dZded< ddœd	d
„Zedd dœdd„ƒZ	dS )ÚInheritedAnimatedStyleEntryzP
    Inherited CSS style collection for animated styles from ancestor node.
    Nz/typing.Optional[typing.List[CSSAnimationStyle]]Úanimation_stylesr9   Útransitions_styler   r   c                 C  s@   t ƒ }| jd ur$dd„ | jD ƒ|d< | jd ur<| j ¡ |d< |S )Nc                 S  s   g | ]}|  ¡ ‘qS r   r&   r'   r   r   r   r*   ‡   s   z7InheritedAnimatedStyleEntry.to_json.<locals>.<listcomp>ÚanimationStylesÚtransitionsStyle)r-   r?   r@   r   r.   r   r   r   r   „   s    
ÿ

z#InheritedAnimatedStyleEntry.to_jsonr   c                 C  sL   | |  dd ¡d ur$dd„ |d D ƒnd |  dd ¡d urDt |d ¡nd d�S )NrA   c                 S  s   g | ]}t  |¡‘qS r   ©r3   r   r'   r   r   r   r*   ‘   s   z9InheritedAnimatedStyleEntry.from_json.<locals>.<listcomp>rB   )r?   r@   r=   r   r   r   r   r   Ž   s    ýÿÿøz%InheritedAnimatedStyleEntry.from_json)
r   r   r   r   r?   r2   r@   r   r   r   r   r   r   r   r>   x   s   

r>   c                   @  s<   e Zd ZU dZded< ddœdd„Zedd dœd	d
„ƒZdS )ÚInheritedPseudoElementMatcheszBInherited pseudo element matches from pseudos of an ancestor node.z!typing.List[PseudoElementMatches]Úpseudo_elementsr   r   c                 C  s   t ƒ }dd„ | jD ƒ|d< |S )Nc                 S  s   g | ]}|  ¡ ‘qS r   r&   r'   r   r   r   r*   ¤   r+   z9InheritedPseudoElementMatches.to_json.<locals>.<listcomp>ÚpseudoElements)r-   rE   r.   r   r   r   r   ¢   s    z%InheritedPseudoElementMatches.to_jsonr   c                 C  s   | dd„ |d D ƒd�S )Nc                 S  s   g | ]}t  |¡‘qS r   ©r   r   r'   r   r   r   r*   ª   s   ÿz;InheritedPseudoElementMatches.from_json.<locals>.<listcomp>rF   )rE   r   r   r   r   r   r   §   s
    þÿz'InheritedPseudoElementMatches.from_jsonN©r   r   r   r   r2   r   r   r   r   r   r   r   rD   œ   s
   
rD   c                   @  sD   e Zd ZU dZded< ded< ddœdd	„Zedd d
œdd„ƒZdS )r0   zMatch data for a CSS rule.ÚCSSRuleÚruleztyping.List[int]Úmatching_selectorsr   r   c                 C  s,   t ƒ }| j ¡ |d< dd„ | jD ƒ|d< |S )NrJ   c                 S  s   g | ]}|‘qS r   r   r'   r   r   r   r*   ¼   r+   z%RuleMatch.to_json.<locals>.<listcomp>ÚmatchingSelectors)r-   rJ   r   rK   r.   r   r   r   r   ¹   s    zRuleMatch.to_jsonr   c                 C  s&   | t  | d¡¡dd„ |d D ƒd�S )NrJ   c                 S  s   g | ]}t |ƒ‘qS r   ©Úintr'   r   r   r   r*   Ã   r+   z'RuleMatch.from_json.<locals>.<listcomp>rL   )rJ   rK   )rI   r   r1   r   r   r   r   r   ¿   s    þzRuleMatch.from_jsonNrH   r   r   r   r   r0   ±   s   
r0   c                   @  sT   e Zd ZU dZded< dZded< dZded< d	d
œdd„Zed	d dœdd„ƒZ	dS )ÚValuez\
    Data for a simple selector
    (these are delimited by commas in a selector list).
    r
   ÚtextNútyping.Optional[SourceRange]Úrange_ztyping.Optional[Specificity]Úspecificityr   r   c                 C  sD   t ƒ }| j|d< | jd ur(| j ¡ |d< | jd ur@| j ¡ |d< |S )NrP   ÚrangerS   )r-   rP   rR   r   rS   r.   r   r   r   r   Ô   s    


zValue.to_jsonr   c                 C  sR   | t |d ƒ| dd ¡d ur*t |d ¡nd | dd ¡d urJt |d ¡nd d�S )NrP   rT   rS   )rP   rR   rS   )r
   r1   ÚSourceRanger   ÚSpecificityr   r   r   r   r   Ý   s    
ÿÿùzValue.from_json)
r   r   r   r   r2   rR   rS   r   r   r   r   r   r   r   rO   Ç   s   
	rO   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 )rV   zP
    Specificity:
    https://drafts.csswg.org/selectors/#specificity-rules
    rN   ÚaÚbÚcr   r   c                 C  s(   t ƒ }| j|d< | j|d< | j|d< |S )NrW   rX   rY   )r-   rW   rX   rY   r.   r   r   r   r   ù   s
    


zSpecificity.to_jsonr   c                 C  s,   | t | d¡ƒt | d¡ƒt | d¡ƒd�S )NrW   rX   rY   )rW   rX   rY   )rN   r1   r   r   r   r   r      s
    ýzSpecificity.from_jsonNrH   r   r   r   r   rV   ê   s   
rV   c                   @  sD   e Zd ZU dZded< ded< ddœdd	„Zedd d
œdd„ƒZdS )ÚSelectorListzSelector list data.ztyping.List[Value]Ú	selectorsr
   rP   r   r   c                 C  s(   t ƒ }dd„ | jD ƒ|d< | j|d< |S )Nc                 S  s   g | ]}|  ¡ ‘qS r   r&   r'   r   r   r   r*     r+   z(SelectorList.to_json.<locals>.<listcomp>r[   rP   )r-   r[   rP   r.   r   r   r   r     s    
zSelectorList.to_jsonr   c                 C  s$   | dd„ |d D ƒt | d¡ƒd�S )Nc                 S  s   g | ]}t  |¡‘qS r   )rO   r   r'   r   r   r   r*     r+   z*SelectorList.from_json.<locals>.<listcomp>r[   rP   )r[   rP   ©r
   r1   r   r   r   r   r     s    þzSelectorList.from_jsonNrH   r   r   r   r   rZ   	  s   
rZ   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ed< ded< ded< ded< ded< ded< ded< ded< dZded< dZded< dZded< dZded< ddœd d!„Z	e
dd d"œd#d$„ƒZdS )%ÚCSSStyleSheetHeaderzCSS stylesheet metainformation.údom.StyleSheetIdÚstyle_sheet_idúpage.FrameIdÚframe_idr
   Ú
source_urlr	   ÚoriginÚtitleÚboolÚdisabledÚ	is_inlineÚ
is_mutableÚis_constructedÚfloatÚ
start_lineÚstart_columnÚlengthÚend_lineÚ
end_columnNr#   Úsource_map_urlú"typing.Optional[dom.BackendNodeId]Ú
owner_nodeútyping.Optional[bool]Úhas_source_urlÚloading_failedr   r   c                 C  sö   t ƒ }| j ¡ |d< | j ¡ |d< | j|d< | j ¡ |d< | j|d< | j|d< | j|d< | j	|d< | j
|d	< | j|d
< | j|d< | j|d< | j|d< | 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ÚstyleSheetIdÚframeIdÚ	sourceURLrc   rd   rf   ÚisInlineÚ	isMutableÚisConstructedÚ	startLineÚstartColumnrm   ÚendLineÚ	endColumnÚsourceMapURLÚ	ownerNodeÚhasSourceURLÚloadingFailed)r-   r_   r   ra   rb   rc   rd   rf   rg   rh   ri   rk   rl   rm   rn   ro   rp   rr   rt   ru   r.   r   r   r   r   R  s0    

















zCSSStyleSheetHeader.to_jsonr   c                 C  sB  | t j | d¡¡tj | d¡¡t| d¡ƒt | d¡¡t| d¡ƒt| d¡ƒt| d¡ƒt| d¡ƒt| d	¡ƒt	| d
¡ƒt	| d¡ƒt	| d¡ƒt	| d¡ƒt	| d¡ƒ| dd ¡d urÒt| d¡ƒnd | dd ¡d uröt j
 | d¡¡nd | dd ¡d u�rt| d¡ƒnd | dd ¡d u�r:t| d¡ƒnd d�S )Nrv   rw   rx   rc   rd   rf   ry   rz   r{   r|   r}   rm   r~   r   r€   r�   r‚   rƒ   )r_   ra   rb   rc   rd   rf   rg   rh   ri   rk   rl   rm   rn   ro   rp   rr   rt   ru   )r   ÚStyleSheetIdr   r1   r   ZFrameIdr
   r	   re   rj   ÚBackendNodeIdr   r   r   r   r   l  s<    ÿÿÿÿÿäzCSSStyleSheetHeader.from_json)r   r   r   r   r2   rp   rr   rt   ru   r   r   r   r   r   r   r   r]     s,   
r]   c                   @  sÐ   e Zd ZU dZ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d œd!d"„Zedd d#œd$d%„ƒZdS )&rI   zCSS rule representation.rZ   Úselector_listr	   rc   r4   r5   Nú!typing.Optional[dom.StyleSheetId]r_   z!typing.Optional[typing.List[str]]Únesting_selectorsrq   Úorigin_tree_scope_node_idz&typing.Optional[typing.List[CSSMedia]]Úmediaz/typing.Optional[typing.List[CSSContainerQuery]]Úcontainer_queriesz)typing.Optional[typing.List[CSSSupports]]Úsupportsz&typing.Optional[typing.List[CSSLayer]]Úlayersz&typing.Optional[typing.List[CSSScope]]Úscopesz)typing.Optional[typing.List[CSSRuleType]]Ú
rule_typesz.typing.Optional[typing.List[CSSStartingStyle]]Ústarting_stylesz+typing.Optional[typing.List[CSSNavigation]]Únavigationsr   r   c                 C  sz  t ƒ }| j ¡ |d< | j ¡ |d< | j ¡ |d< | jd urH| j ¡ |d< | jd urfdd„ | jD ƒ|d< | jd ur~| j ¡ |d< | jd urœd	d„ | jD ƒ|d
< | j	d urºdd„ | j	D ƒ|d< | j
d urØdd„ | j
D ƒ|d< | jd urödd„ | jD ƒ|d< | jd u�rdd„ | jD ƒ|d< | jd u�r6dd„ | jD ƒ|d< | jd u�rVdd„ | jD ƒ|d< | jd u�rvdd„ | jD ƒ|d< |S )NÚselectorListrc   r5   rv   c                 S  s   g | ]}|‘qS r   r   r'   r   r   r   r*   Ç  r+   z#CSSRule.to_json.<locals>.<listcomp>ÚnestingSelectorsÚoriginTreeScopeNodeIdc                 S  s   g | ]}|  ¡ ‘qS r   r&   r'   r   r   r   r*   Í  r+   rŠ   c                 S  s   g | ]}|  ¡ ‘qS r   r&   r'   r   r   r   r*   Ï  s   ÚcontainerQueriesc                 S  s   g | ]}|  ¡ ‘qS r   r&   r'   r   r   r   r*   Ó  r+   rŒ   c                 S  s   g | ]}|  ¡ ‘qS r   r&   r'   r   r   r   r*   Õ  r+   r�   c                 S  s   g | ]}|  ¡ ‘qS r   r&   r'   r   r   r   r*   ×  r+   rŽ   c                 S  s   g | ]}|  ¡ ‘qS r   r&   r'   r   r   r   r*   Ù  r+   Ú	ruleTypesc                 S  s   g | ]}|  ¡ ‘qS r   r&   r'   r   r   r   r*   Û  s   ÚstartingStylesc                 S  s   g | ]}|  ¡ ‘qS r   r&   r'   r   r   r   r*   ß  r+   r‘   )r-   r†   r   rc   r5   r_   rˆ   r‰   rŠ   r‹   rŒ   r�   rŽ   r�   r�   r‘   r.   r   r   r   r   ¿  s@    


ÿ

ÿ


ÿ
zCSSRule.to_jsonr   c                 C  sÜ  | t  | d¡¡t | d¡¡t | d¡¡| dd ¡d urNtj | d¡¡nd | dd ¡d urtdd„ | d¡D ƒnd | dd ¡d ur˜tj | 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dd„ | d¡D ƒnd | dd ¡d u�r4dd„ | d¡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¬dd„ | d¡D ƒnd | dd ¡d u�rÔdd„ | d¡D ƒnd d�S )Nr’   rc   r5   rv   r“   c                 S  s   g | ]}t |ƒ‘qS r   ©r
   r'   r   r   r   r*   ë  r+   z%CSSRule.from_json.<locals>.<listcomp>r”   rŠ   c                 S  s   g | ]}t  |¡‘qS r   ©ÚCSSMediar   r'   r   r   r   r*   ó  r+   r•   c                 S  s   g | ]}t  |¡‘qS r   )ÚCSSContainerQueryr   r'   r   r   r   r*   ö  s   ÿrŒ   c                 S  s   g | ]}t  |¡‘qS r   )ÚCSSSupportsr   r'   r   r   r   r*   ü  r+   r�   c                 S  s   g | ]}t  |¡‘qS r   )ÚCSSLayerr   r'   r   r   r   r*   ÿ  r+   rŽ   c                 S  s   g | ]}t  |¡‘qS r   )ÚCSSScoper   r'   r   r   r   r*     r+   r–   c                 S  s   g | ]}t  |¡‘qS r   )ÚCSSRuleTyper   r'   r   r   r   r*     s   r—   c                 S  s   g | ]}t  |¡‘qS r   )ÚCSSStartingStyler   r'   r   r   r   r*   
  s   ÿr‘   c                 S  s   g | ]}t  |¡‘qS r   )ÚCSSNavigationr   r'   r   r   r   r*     s   )r†   rc   r5   r_   rˆ   r‰   rŠ   r‹   rŒ   r�   rŽ   r�   r�   r‘   )rZ   r   r1   r	   r4   r   r„   r…   r   r   r   r   r   â  s`    ÿÿýÿÿüþÿÿÿý
ÿü
þý
ÿÐzCSSRule.from_json)r   r   r   r   r2   r_   rˆ   r‰   rŠ   r‹   rŒ   r�   rŽ   r�   r�   r‘   r   r   r   r   r   r   r   rI   Ž  s$   
#rI   c                   @  sR   e 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œdd„ƒZdS )rŸ   zÑ
    Enum indicating the type of a CSS rule,
    used to represent the order of a style rule's ancestors.
    This list only contains rule types that are collected
    during the ancestor rule collection.
    Z	MediaRuleZSupportsRuleZContainerRuleZ	LayerRuleZ	ScopeRuleZ	StyleRuleZStartingStyleRuleZNavigationRuler
   r   c                 C  s   | j S r   r   r   r   r   r   r   (  s    zCSSRuleType.to_jsonr   c                 C  s   | |ƒS r   r   r   r   r   r   r   +  s    zCSSRuleType.from_jsonN)r   r   r   r   Z
MEDIA_RULEZSUPPORTS_RULEZCONTAINER_RULEZ
LAYER_RULEZ
SCOPE_RULEZ
STYLE_RULEZSTARTING_STYLE_RULEZNAVIGATION_RULEr   r   r   r   r   r   r   rŸ     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 )Ú	RuleUsagezCSS coverage information.r^   r_   rj   Ústart_offsetÚ
end_offsetre   Úusedr   r   c                 C  s6   t ƒ }| j ¡ |d< | j|d< | j|d< | j|d< |S )Nrv   ÚstartOffsetÚ	endOffsetr¥   )r-   r_   r   r£   r¤   r¥   r.   r   r   r   r   <  s    


zRuleUsage.to_jsonr   c                 C  s4   | t j |d ¡t|d ƒt|d ƒt|d ƒd�S )Nrv   r¦   r§   r¥   )r_   r£   r¤   r¥   )r   r„   r   rj   re   r   r   r   r   r   D  s    


üzRuleUsage.from_jsonNrH   r   r   r   r   r¢   0  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 )rU   z9Text range within a resource. All numbers are zero-based.rN   rk   rl   rn   ro   r   r   c                 C  s2   t ƒ }| j|d< | j|d< | j|d< | j|d< |S )Nr|   r}   r~   r   )r-   rk   rl   rn   ro   r.   r   r   r   r   Z  s    



zSourceRange.to_jsonr   c                 C  s0   | t |d ƒt |d ƒt |d ƒt |d ƒd�S )Nr|   r}   r~   r   )rk   rl   rn   ro   rM   r   r   r   r   r   b  s    



üzSourceRange.from_jsonNrH   r   r   r   r   rU   N  s   
rU   c                   @  sL   e Zd ZU 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 )ÚShorthandEntryr
   r6   r   Nrs   Ú	importantr   r   c                 C  s2   t ƒ }| j|d< | j|d< | jd ur.| j|d< |S )Nr6   r   r©   )r-   r6   r   r©   r.   r   r   r   r   u  s    



zShorthandEntry.to_jsonr   c                 C  s:   | t |d ƒt |d ƒ| dd ¡d ur2t|d ƒnd d�S )Nr6   r   r©   )r6   r   r©   )r
   r1   re   r   r   r   r   r   }  s    

ÿûzShorthandEntry.from_json)r   r   r   r2   r©   r   r   r   r   r   r   r   r¨   l  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
   r6   r   r   r   c                 C  s   t ƒ }| j|d< | j|d< |S )Nr6   r   )r-   r6   r   r.   r   r   r   r   �  s    

z CSSComputedStyleProperty.to_jsonr   c                 C  s    | t | d¡ƒt | d¡ƒd�S )Nr6   r   )r6   r   r\   r   r   r   r   r   •  s    þz"CSSComputedStyleProperty.from_jsonN©r   r   r   r2   r   r   r   r   r   r   r   rª   ˆ  s
   
rª   c                   @  s8   e Zd ZU ded< ddœdd„Zedd dœdd	„ƒZd
S )ÚComputedStyleExtraFieldsre   Úis_appearance_baser   r   c                 C  s   t ƒ }| j|d< |S )NÚisAppearanceBase)r-   r­   r.   r   r   r   r   ¤  s    
z ComputedStyleExtraFields.to_jsonr   c                 C  s   | t |d ƒd�S )Nr®   )r­   )re   r   r   r   r   r   ©  s    
ÿz"ComputedStyleExtraFields.from_jsonNr«   r   r   r   r   r¬   �  s   
r¬   c                   @  sh   e Zd ZU dZded< ded< dZded< dZd	ed
< dZded< ddœdd„Ze	dd dœdd„ƒZ
dS )r4   zCSS style representation.ztyping.List[CSSProperty]Úcss_propertiesztyping.List[ShorthandEntry]Úshorthand_entriesNr‡   r_   r#   Úcss_textrQ   rR   r   r   c                 C  sv   t ƒ }dd„ | jD ƒ|d< dd„ | jD ƒ|d< | jd urF| j ¡ |d< | jd urZ| j|d< | jd urr| j ¡ |d< |S )	Nc                 S  s   g | ]}|  ¡ ‘qS r   r&   r'   r   r   r   r*   À  r+   z$CSSStyle.to_json.<locals>.<listcomp>ÚcssPropertiesc                 S  s   g | ]}|  ¡ ‘qS r   r&   r'   r   r   r   r*   Á  s   ÚshorthandEntriesrv   ÚcssTextrT   )r-   r¯   r°   r_   r   r±   rR   r.   r   r   r   r   ¾  s    ÿ




zCSSStyle.to_jsonr   c              	   C  sŽ   | dd„ |  d¡D ƒdd„ |  d¡D ƒ|  dd ¡d urHtj |  d¡¡nd |  dd ¡d urft|d ƒnd |  dd ¡d ur†t |d ¡nd d	�S )
Nc                 S  s   g | ]}t  |¡‘qS r   ©ÚCSSPropertyr   r'   r   r   r   r*   Ï  s   z&CSSStyle.from_json.<locals>.<listcomp>r²   c                 S  s   g | ]}t  |¡‘qS r   )r¨   r   r'   r   r   r   r*   Ò  s   ÿr³   rv   r´   rT   )r¯   r°   r_   r±   rR   )r1   r   r„   r   r
   rU   r   r   r   r   r   Ì  s"    ÿþÿÿÿðzCSSStyle.from_json)r   r   r   r   r2   r_   r±   rR   r   r   r   r   r   r   r   r4   °  s   
r4   c                   @  s˜   e Zd ZU dZ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dœdd„Zedd dœdd„ƒZdS )r¶   zCSS property declaration data.r
   r6   r   Nrs   r©   Úimplicitr#   rP   Ú	parsed_okrf   rQ   rR   z)typing.Optional[typing.List[CSSProperty]]Úlonghand_propertiesr   r   c                 C  s¸   t ƒ }| j|d< | j|d< | jd ur.| j|d< | jd urB| j|d< | jd urV| j|d< | jd urj| j|d< | jd ur~| j|d< | jd ur–| j 	¡ |d< | j
d ur´d	d
„ | j
D ƒ|d< |S )Nr6   r   r©   r·   rP   ÚparsedOkrf   rT   c                 S  s   g | ]}|  ¡ ‘qS r   r&   r'   r   r   r   r*   
  s   z'CSSProperty.to_json.<locals>.<listcomp>ÚlonghandProperties)r-   r6   r   r©   r·   rP   r¸   rf   rR   r   r¹   r.   r   r   r   r   ù  s(    













ÿ
zCSSProperty.to_jsonr   c                 C  sú   | t | d¡ƒt | d¡ƒ| dd ¡d ur6t|d ƒnd | dd ¡d urTt|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òd
d„ |d	 D ƒnd d�	S )Nr6   r   r©   r·   rP   rº   rf   rT   r»   c                 S  s   g | ]}t  |¡‘qS r   rµ   r'   r   r   r   r*   &  s   z)CSSProperty.from_json.<locals>.<listcomp>)	r6   r   r©   r·   rP   r¸   rf   rR   r¹   )r
   r1   re   rU   r   r   r   r   r   r     s6    ÿÿÿÿÿÿýÿçzCSSProperty.from_json)r   r   r   r   r2   r©   r·   rP   r¸   rf   rR   r¹   r   r   r   r   r   r   r   r¶   â  s   
r¶   c                   @  st   e Zd ZU dZ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dœdd„Z	e
dd dœdd„ƒZdS )rš   zCSS media rule descriptor.r
   rP   ÚsourceNr#   rb   rQ   rR   r‡   r_   z(typing.Optional[typing.List[MediaQuery]]Ú
media_listr   r   c                 C  s€   t ƒ }| j|d< | j|d< | jd ur.| j|d< | jd urF| j ¡ |d< | jd ur^| j ¡ |d< | jd ur|dd„ | jD ƒ|d< |S )	NrP   r¼   rx   rT   rv   c                 S  s   g | ]}|  ¡ ‘qS r   r&   r'   r   r   r   r*   M  r+   z$CSSMedia.to_json.<locals>.<listcomp>Ú	mediaList)r-   rP   r¼   rb   rR   r   r_   r½   r.   r   r   r   r   B  s    






zCSSMedia.to_jsonr   c              
   C  s¬   | t | d¡ƒt | d¡ƒ| dd ¡d ur8t | d¡ƒnd | dd ¡d urZt | d¡¡nd | dd ¡d ur~tj | d¡¡nd | dd ¡d ur¤dd„ | d¡D ƒnd d	�S )
NrP   r¼   rx   rT   rv   r¾   c                 S  s   g | ]}t  |¡‘qS r   )Ú
MediaQueryr   r'   r   r   r   r*   ^  r+   z&CSSMedia.from_json.<locals>.<listcomp>)rP   r¼   rb   rR   r_   r½   ©r
   r1   rU   r   r   r„   r   r   r   r   r   P  s     ÿÿÿÿòzCSSMedia.from_json)r   r   r   r   r2   rb   rR   r_   r½   r   r   r   r   r   r   r   rš   .  s   
rš   c                   @  sD   e Zd ZU dZded< ded< ddœdd	„Zedd d
œdd„ƒZdS )r¿   zMedia query descriptor.z!typing.List[MediaQueryExpression]Úexpressionsre   Úactiver   r   c                 C  s(   t ƒ }dd„ | jD ƒ|d< | j|d< |S )Nc                 S  s   g | ]}|  ¡ ‘qS r   r&   r'   r   r   r   r*   n  r+   z&MediaQuery.to_json.<locals>.<listcomp>rÁ   rÂ   )r-   rÁ   rÂ   r.   r   r   r   r   l  s    
zMediaQuery.to_jsonr   c                 C  s$   | dd„ |d D ƒt | d¡ƒd�S )Nc                 S  s   g | ]}t  |¡‘qS r   )ÚMediaQueryExpressionr   r'   r   r   r   r*   u  s   z(MediaQuery.from_json.<locals>.<listcomp>rÁ   rÂ   )rÁ   rÂ   )re   r1   r   r   r   r   r   r  s    ÿüzMediaQuery.from_jsonNrH   r   r   r   r   r¿   d  s   
r¿   c                   @  sd   e Zd ZU dZded< ded< ded< dZded	< dZd
ed< ddœdd„Zedd dœdd„ƒZ	dS )rÃ   z"Media query expression descriptor.rj   r   r
   ÚunitÚfeatureNrQ   Úvalue_rangeztyping.Optional[float]Úcomputed_lengthr   r   c                 C  sT   t ƒ }| j|d< | j|d< | j|d< | jd ur<| j ¡ |d< | jd urP| j|d< |S )Nr   rÄ   rÅ   Ú
valueRangeÚcomputedLength)r-   r   rÄ   rÅ   rÆ   r   rÇ   r.   r   r   r   r   Š  s    





zMediaQueryExpression.to_jsonr   c              	   C  sl   | t | d¡ƒt| d¡ƒt| d¡ƒ| dd ¡d urFt | d¡¡nd | dd ¡d urdt |d ƒnd d�S )Nr   rÄ   rÅ   rÈ   rÉ   )r   rÄ   rÅ   rÆ   rÇ   )rj   r1   r
   rU   r   r   r   r   r   r   •  s    ÿÿ÷zMediaQueryExpression.from_json)
r   r   r   r   r2   rÆ   rÇ   r   r   r   r   r   r   r   rÃ   |  s   
rÃ   c                   @  s�   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Zded< dZ	ded< dZ
ded< dZded< ddœdd„Zedd dœdd„ƒZdS )r›   z$CSS container query rule descriptor.r
   rP   NrQ   rR   r‡   r_   r#   r6   z!typing.Optional[dom.PhysicalAxes]Úphysical_axesz typing.Optional[dom.LogicalAxes]Úlogical_axesrs   Úqueries_scroll_stateÚqueries_anchoredr   r   c                 C  s°   t ƒ }| j|d< | jd ur(| j ¡ |d< | jd ur@| j ¡ |d< | jd urT| j|d< | jd url| j ¡ |d< | jd ur„| j ¡ |d< | jd ur˜| j|d< | j	d ur¬| j	|d< |S )	NrP   rT   rv   r6   ÚphysicalAxesÚlogicalAxesÚqueriesScrollStateÚqueriesAnchored)
r-   rP   rR   r   r_   r6   rÊ   rË   rÌ   rÍ   r.   r   r   r   r   ¸  s"    










zCSSContainerQuery.to_jsonr   c                 C  s  | t | d¡ƒ| dd ¡d ur.t | d¡¡nd | dd ¡d urRtj | d¡¡nd | dd ¡d urrt | d¡ƒnd | dd ¡d ur–tj | d¡¡nd | dd ¡d urºtj | d¡¡nd | dd ¡d urÚt| d¡ƒnd | dd ¡d urút| d¡ƒnd d	�S )
NrP   rT   rv   r6   rÎ   rÏ   rÐ   rÑ   )rP   rR   r_   r6   rÊ   rË   rÌ   rÍ   )	r
   r1   rU   r   r   r„   ZPhysicalAxesZLogicalAxesre   r   r   r   r   r   Ë  s0    ÿÿÿÿÿÿÿêzCSSContainerQuery.from_json)r   r   r   r   r2   rR   r_   r6   rÊ   rË   rÌ   rÍ   r   r   r   r   r   r   r   r›   ¤  s   
r›   c                   @  s\   e Zd ZU dZded< ded< dZded< dZd	ed
< ddœdd„Zedd dœdd„ƒZ	dS )rœ   z CSS Supports at-rule descriptor.r
   rP   re   rÂ   NrQ   rR   r‡   r_   r   r   c                 C  sN   t ƒ }| j|d< | j|d< | jd ur2| j ¡ |d< | jd urJ| j ¡ |d< |S ©NrP   rÂ   rT   rv   ©r-   rP   rÂ   rR   r   r_   r.   r   r   r   r   ó  s    



zCSSSupports.to_jsonr   c              	   C  sf   | t | d¡ƒt| d¡ƒ| dd ¡d ur:t | d¡¡nd | dd ¡d ur^tj | d¡¡nd d�S ©NrP   rÂ   rT   rv   )rP   rÂ   rR   r_   ©r
   r1   re   rU   r   r   r„   r   r   r   r   r   ý  s    ÿÿøzCSSSupports.from_json©
r   r   r   r   r2   rR   r_   r   r   r   r   r   r   r   rœ   ç  s   

rœ   c                   @  s`   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œdd„Ze	dd dœdd„ƒZ
dS )r¡   z"CSS Navigation at-rule descriptor.r
   rP   Nrs   rÂ   rQ   rR   r‡   r_   r   r   c                 C  sX   t ƒ }| j|d< | jd ur$| j|d< | jd ur<| j ¡ |d< | jd urT| j ¡ |d< |S rÒ   rÓ   r.   r   r   r   r     s    




zCSSNavigation.to_jsonr   c              	   C  sz   | t | d¡ƒ| dd ¡d ur,t| d¡ƒnd | dd ¡d urNt | d¡¡nd | dd ¡d urrtj | d¡¡nd d�S rÔ   rÕ   r   r   r   r   r   "  s    ÿÿÿözCSSNavigation.from_json)r   r   r   r   r2   rÂ   rR   r_   r   r   r   r   r   r   r   r¡     s   
r¡   c                   @  sT   e Zd ZU dZded< dZded< dZded< d	d
œdd„Zed	d dœdd„ƒZ	dS )rž   zCSS Scope at-rule descriptor.r
   rP   NrQ   rR   r‡   r_   r   r   c                 C  sD   t ƒ }| j|d< | jd ur(| j ¡ |d< | jd ur@| j ¡ |d< |S ©NrP   rT   rv   ©r-   rP   rR   r   r_   r.   r   r   r   r   <  s    


zCSSScope.to_jsonr   c                 C  sZ   | t | d¡ƒ| dd ¡d ur.t | d¡¡nd | dd ¡d urRtj | d¡¡nd d�S ©NrP   rT   rv   )rP   rR   r_   rÀ   r   r   r   r   r   E  s    ÿÿùzCSSScope.from_jsonrÖ   r   r   r   r   rž   2  s   
	rž   c                   @  sT   e Zd ZU dZded< dZded< dZded< d	d
œdd„Zed	d dœdd„ƒZ	dS )r�   zCSS Layer at-rule descriptor.r
   rP   NrQ   rR   r‡   r_   r   r   c                 C  sD   t ƒ }| j|d< | jd ur(| j ¡ |d< | jd ur@| j ¡ |d< |S r×   rØ   r.   r   r   r   r   \  s    


zCSSLayer.to_jsonr   c                 C  sZ   | t | d¡ƒ| dd ¡d ur.t | d¡¡nd | dd ¡d urRtj | d¡¡nd d�S rÙ   rÀ   r   r   r   r   r   e  s    ÿÿùzCSSLayer.from_jsonrÖ   r   r   r   r   r�   R  s   
	r�   c                   @  sL   e Zd ZU dZdZded< dZded< ddœd	d
„Zedd dœdd„ƒZ	dS )r    z&CSS Starting Style at-rule descriptor.NrQ   rR   r‡   r_   r   r   c                 C  s:   t ƒ }| jd ur| j ¡ |d< | jd ur6| j ¡ |d< |S )NrT   rv   )r-   rR   r   r_   r.   r   r   r   r   z  s    

zCSSStartingStyle.to_jsonr   c                 C  sN   | |  dd ¡d ur"t |  d¡¡nd |  dd ¡d urFtj |  d¡¡nd d�S )NrT   rv   )rR   r_   )r1   rU   r   r   r„   r   r   r   r   r   ‚  s    ÿÿúzCSSStartingStyle.from_json)
r   r   r   r   rR   r2   r_   r   r   r   r   r   r   r   r    r  s   
r    c                   @  sP   e Zd ZU dZ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 )ÚCSSLayerDatazCSS Layer data.r
   r6   rj   ÚorderNz*typing.Optional[typing.List[CSSLayerData]]Ú
sub_layersr   r   c                 C  s<   t ƒ }| j|d< | j|d< | jd ur8dd„ | jD ƒ|d< |S )Nr6   rÛ   c                 S  s   g | ]}|  ¡ ‘qS r   r&   r'   r   r   r   r*   �  r+   z(CSSLayerData.to_json.<locals>.<listcomp>Ú	subLayers)r-   r6   rÛ   rÜ   r.   r   r   r   r   ˜  s    


zCSSLayerData.to_jsonr   c                 C  sF   | t | d¡ƒt| d¡ƒ| dd ¡d ur>dd„ | d¡D ƒnd d�S )Nr6   rÛ   rÝ   c                 S  s   g | ]}t  |¡‘qS r   )rÚ   r   r'   r   r   r   r*   ¥  s   z*CSSLayerData.from_json.<locals>.<listcomp>)r6   rÛ   rÜ   ©r
   r1   rj   r   r   r   r   r      s    ýÿùzCSSLayerData.from_json)	r   r   r   r   r2   rÜ   r   r   r   r   r   r   r   rÚ   Ž  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 )ÚPlatformFontUsagezP
    Information about amount of glyphs that were rendered with given font.
    r
   Úfamily_nameÚpost_script_namere   Úis_custom_fontrj   Úglyph_countr   r   c                 C  s2   t ƒ }| j|d< | j|d< | j|d< | j|d< |S )NÚ
familyNameÚpostScriptNameÚisCustomFontÚ
glyphCount)r-   rà   rá   râ   rã   r.   r   r   r   r   »  s    



zPlatformFontUsage.to_jsonr   c                 C  s8   | t | d¡ƒt | d¡ƒt| d¡ƒt| d¡ƒd�S )Nrä   rå   ræ   rç   )rà   rá   râ   rã   )r
   r1   re   rj   r   r   r   r   r   Ã  s    üzPlatformFontUsage.from_jsonNrH   r   r   r   r   rß   ­  s   
rß   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	d
œdd„Zed	d dœdd„ƒZdS )ÚFontVariationAxisz9Information about font variation axes for variable fonts.r
   Útagr6   rj   Ú	min_valueÚ	max_valueÚdefault_valuer   r   c                 C  s<   t ƒ }| j|d< | j|d< | j|d< | j|d< | j|d< |S )Nré   r6   ÚminValueÚmaxValueÚdefaultValue)r-   ré   r6   rê   rë   rì   r.   r   r   r   r   Û  s    




zFontVariationAxis.to_jsonr   c              	   C  sD   | t | d¡ƒt | d¡ƒt| d¡ƒt| d¡ƒt| d¡ƒd�S )Nré   r6   rí   rî   rï   )ré   r6   rê   rë   rì   rÞ   r   r   r   r   r   ä  s    ûzFontVariationAxis.from_jsonNrH   r   r   r   r   rè   Í  s   
	rè   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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 )ÚFontFacezÁ
    Properties of a web font:
    https://www.w3.org/TR/2008/REC-CSS2-20080411/fonts.html#font-descriptions
    and additional information such as platformFontFamily and fontVariationAxes
    r
   Úfont_familyÚ
font_styleÚfont_variantÚfont_weightÚfont_stretchÚfont_displayÚunicode_rangeÚsrcÚplatform_font_familyNz/typing.Optional[typing.List[FontVariationAxis]]Úfont_variation_axesr   r   c                 C  s‚   t ƒ }| j|d< | j|d< | j|d< | j|d< | j|d< | j|d< | j|d< | j|d< | j	|d	< | j
d ur~d
d„ | j
D ƒ|d< |S )NÚ
fontFamilyÚ	fontStyleÚfontVariantÚ
fontWeightÚfontStretchÚfontDisplayÚunicodeRangerø   ÚplatformFontFamilyc                 S  s   g | ]}|  ¡ ‘qS r   r&   r'   r   r   r   r*     s   z$FontFace.to_json.<locals>.<listcomp>ÚfontVariationAxes)r-   rñ   rò   ró   rô   rõ   rö   r÷   rø   rù   rú   r.   r   r   r   r     s    









ÿ
zFontFace.to_jsonr   c                 C  s†   | t |d ƒt |d ƒt |d ƒt |d ƒt |d ƒt |d ƒt |d ƒt |d ƒt |d	 ƒ| d
d ¡d ur~dd„ |d
 D ƒnd d�
S )Nrû   rü   rý   rþ   rÿ   r   r  rø   r  r  c                 S  s   g | ]}t  |¡‘qS r   )rè   r   r'   r   r   r   r*   (  s   ÿz&FontFace.from_json.<locals>.<listcomp>)
rñ   rò   ró   rô   rõ   rö   r÷   rø   rù   rú   r\   r   r   r   r   r     s     








üþñzFontFace.from_json)	r   r   r   r   r2   rú   r   r   r   r   r   r   r   rð   ï  s   
rð   c                   @  sP   e Zd ZU dZ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 )Ú
CSSTryRulezCSS try rule representation.r	   rc   r4   r5   Nr‡   r_   r   r   c                 C  s>   t ƒ }| j ¡ |d< | j ¡ |d< | jd ur:| j ¡ |d< |S )Nrc   r5   rv   )r-   rc   r   r5   r_   r.   r   r   r   r   ;  s    
zCSSTryRule.to_jsonr   c                 C  sH   | t  | d¡¡t | d¡¡| dd ¡d ur@tj | d¡¡nd d�S )Nrc   r5   rv   )rc   r5   r_   )r	   r   r1   r4   r   r„   r   r   r   r   r   C  s    ÿûzCSSTryRule.from_json©	r   r   r   r   r2   r_   r   r   r   r   r   r   r   r  1  s   
r  c                   @  s`   e Zd ZU dZ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 )ÚCSSPositionTryRulez&CSS @position-try rule representation.rO   r6   r	   rc   r4   r5   re   rÂ   Nr‡   r_   r   r   c                 C  sV   t ƒ }| j ¡ |d< | j ¡ |d< | j ¡ |d< | j|d< | jd urR| j ¡ |d< |S )Nr6   rc   r5   rÂ   rv   )r-   r6   r   rc   r5   rÂ   r_   r.   r   r   r   r   [  s    

zCSSPositionTryRule.to_jsonr   c              
   C  sb   | t  | d¡¡t | d¡¡t | d¡¡t| d¡ƒ| dd ¡d urZtj | d¡¡nd d�S )Nr6   rc   r5   rÂ   rv   )r6   rc   r5   rÂ   r_   )rO   r   r1   r	   r4   re   r   r„   r   r   r   r   r   e  s    ÿùzCSSPositionTryRule.from_jsonr  r   r   r   r   r  N  s   

r  c                   @  sD   e Zd ZU dZded< ded< ddœdd	„Zedd d
œdd„ƒZdS )ÚCSSKeyframesRulez"CSS keyframes rule representation.rO   Úanimation_nameztyping.List[CSSKeyframeRule]Ú	keyframesr   r   c                 C  s,   t ƒ }| j ¡ |d< dd„ | jD ƒ|d< |S )NÚanimationNamec                 S  s   g | ]}|  ¡ ‘qS r   r&   r'   r   r   r   r*   }  r+   z,CSSKeyframesRule.to_json.<locals>.<listcomp>r	  )r-   r  r   r	  r.   r   r   r   r   z  s    zCSSKeyframesRule.to_jsonr   c                 C  s(   | t  | d¡¡dd„ | d¡D ƒd�S )Nr
  c                 S  s   g | ]}t  |¡‘qS r   )ÚCSSKeyframeRuler   r'   r   r   r   r*   „  s   z.CSSKeyframesRule.from_json.<locals>.<listcomp>r	  )r  r	  )rO   r   r1   r   r   r   r   r   €  s    ÿþzCSSKeyframesRule.from_jsonNrH   r   r   r   r   r  r  s   
r  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 )ÚCSSPropertyRegistrationz[
    Representation of a custom property registration
    through CSS.registerProperty
    r
   Úproperty_namere   ÚinheritsÚsyntaxNútyping.Optional[Value]Úinitial_valuer   r   c                 C  s@   t ƒ }| j|d< | j|d< | j|d< | jd ur<| j ¡ |d< |S )NÚpropertyNamer  r  ÚinitialValue)r-   r  r  r  r  r   r.   r   r   r   r   •  s    



zCSSPropertyRegistration.to_jsonr   c              	   C  sN   | t | d¡ƒt| d¡ƒt | d¡ƒ| dd ¡d urFt | d¡¡nd d�S )Nr  r  r  r  )r  r  r  r  )r
   r1   re   rO   r   r   r   r   r   r   ž  s    ÿúz!CSSPropertyRegistration.from_json)	r   r   r   r   r2   r  r   r   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Zd	ed
< dZded< dZded< ddœdd„Ze	dd dœdd„ƒZ
dS )Ú	CSSAtRulez!CSS generic @rule representation.r
   Útype_r	   rc   r4   r5   Nr#   Ú
subsectionr  r6   r‡   r_   r   r   c                 C  st   t ƒ }| j|d< | j ¡ |d< | j ¡ |d< | jd ur@| j|d< | jd urX| j ¡ |d< | jd urp| j ¡ |d< |S )NÚtyperc   r5   r  r6   rv   )r-   r  rc   r   r5   r  r6   r_   r.   r   r   r   r   º  s    




zCSSAtRule.to_jsonr   c                 C  s–   | t | d¡ƒt | d¡¡t | d¡¡| dd ¡d urHt | d¡ƒnd | dd ¡d urjt | d¡¡nd | dd ¡d urŽtj | d¡¡nd d�S )Nr  rc   r5   r  r6   rv   )r  rc   r5   r  r6   r_   )r
   r1   r	   r   r4   rO   r   r„   r   r   r   r   r   Ç  s    ÿÿÿôzCSSAtRule.from_json)r   r   r   r   r2   r  r6   r_   r   r   r   r   r   r   r   r  ª  s   
r  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 )ÚCSSPropertyRulez$CSS property at-rule representation.r	   rc   rO   r  r4   r5   Nr‡   r_   r   r   c                 C  sL   t ƒ }| j ¡ |d< | j ¡ |d< | j ¡ |d< | jd urH| j ¡ |d< |S )Nrc   r  r5   rv   )r-   rc   r   r  r5   r_   r.   r   r   r   r   å  s    
zCSSPropertyRule.to_jsonr   c              	   C  sV   | t  | d¡¡t | d¡¡t | d¡¡| dd ¡d urNtj | d¡¡nd d�S )Nrc   r  r5   rv   )rc   r  r5   r_   ©r	   r   r1   rO   r4   r   r„   r   r   r   r   r   î  s    ÿúzCSSPropertyRule.from_jsonr  r   r   r   r   r  Ù  s   
	r  c                   @  sD   e Zd ZU dZded< ded< ddœdd„Zedd d	œd
d„ƒZdS )ÚCSSFunctionParameterz%CSS function argument representation.r
   r6   r  r   r   c                 C  s   t ƒ }| j|d< | j|d< |S )Nr6   r  )r-   r6   r  r.   r   r   r   r     s    

zCSSFunctionParameter.to_jsonr   c                 C  s    | t | d¡ƒt | d¡ƒd�S )Nr6   r  )r6   r  r\   r   r   r   r   r     s    þzCSSFunctionParameter.from_jsonNrH   r   r   r   r   r  ú  s   
r  c                   @  st   e Zd ZU dZ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dœdd„Z	e
dd dœdd„ƒZdS )ÚCSSFunctionConditionNodez.CSS function conditional block representation.útyping.List[CSSFunctionNode]Úchildrenr
   Úcondition_textNztyping.Optional[CSSMedia]rŠ   z"typing.Optional[CSSContainerQuery]r‹   ztyping.Optional[CSSSupports]rŒ   ztyping.Optional[CSSNavigation]Ú
navigationr   r   c                 C  sˆ   t ƒ }dd„ | jD ƒ|d< | j|d< | jd ur<| j ¡ |d< | jd urT| j ¡ |d< | jd url| j ¡ |d< | jd ur„| j ¡ |d< |S )	Nc                 S  s   g | ]}|  ¡ ‘qS r   r&   r'   r   r   r   r*   %  r+   z4CSSFunctionConditionNode.to_json.<locals>.<listcomp>r  ÚconditionTextrŠ   r•   rŒ   r  )r-   r  r  rŠ   r   r‹   rŒ   r  r.   r   r   r   r   #  s    




z CSSFunctionConditionNode.to_jsonr   c                 C  s¬   | dd„ |  d¡D ƒt|  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	�S )
Nc                 S  s   g | ]}t  |¡‘qS r   ©ÚCSSFunctionNoder   r'   r   r   r   r*   4  s   z6CSSFunctionConditionNode.from_json.<locals>.<listcomp>r  r   rŠ   r•   rŒ   r  )r  r  rŠ   r‹   rŒ   r  )r1   r
   rš   r   r›   rœ   r¡   r   r   r   r   r   1  s(    ÿÿýÿÿÿîz"CSSFunctionConditionNode.from_json)r   r   r   r   r2   rŠ   r‹   rŒ   r  r   r   r   r   r   r   r   r    s   
r  c                   @  sL   e Zd ZU dZdZded< dZded< ddœd	d
„Zedd dœdd„ƒZ	dS )r"  z+Section of the body of a CSS function rule.Nz)typing.Optional[CSSFunctionConditionNode]Ú	conditionr9   r5   r   r   c                 C  s:   t ƒ }| jd ur| j ¡ |d< | jd ur6| j ¡ |d< |S )Nr#  r5   )r-   r#  r   r5   r.   r   r   r   r   Q  s    

zCSSFunctionNode.to_jsonr   c                 C  sJ   | |  dd ¡d ur"t |  d¡¡nd |  dd ¡d urBt |d ¡nd d�S )Nr#  r5   )r#  r5   )r1   r  r   r4   r   r   r   r   r   Y  s    ÿÿúzCSSFunctionNode.from_json)
r   r   r   r   r#  r2   r5   r   r   r   r   r   r   r   r"  I  s   
r"  c                   @  sl   e Zd ZU dZded< ded< ded< ded	< d
Zded< d
Zded< ddœdd„Zedd dœdd„ƒZ	d
S )ÚCSSFunctionRulez$CSS function at-rule representation.rO   r6   r	   rc   z!typing.List[CSSFunctionParameter]Ú
parametersr  r  Nr‡   r_   rq   r‰   r   r   c                 C  s~   t ƒ }| j ¡ |d< | j ¡ |d< dd„ | jD ƒ|d< dd„ | jD ƒ|d< | jd urb| j ¡ |d< | jd urz| j ¡ |d	< |S )
Nr6   rc   c                 S  s   g | ]}|  ¡ ‘qS r   r&   r'   r   r   r   r*   z  r+   z+CSSFunctionRule.to_json.<locals>.<listcomp>r%  c                 S  s   g | ]}|  ¡ ‘qS r   r&   r'   r   r   r   r*   {  r+   r  rv   r”   )r-   r6   r   rc   r%  r  r_   r‰   r.   r   r   r   r   v  s    

ÿzCSSFunctionRule.to_jsonr   c                 C  s�   | t  | d¡¡t | d¡¡dd„ | d¡D ƒdd„ | d¡D ƒ| dd ¡d urdtj | d¡¡nd | d	d ¡d urˆtj | d	¡¡nd d
�S )Nr6   rc   c                 S  s   g | ]}t  |¡‘qS r   )r  r   r'   r   r   r   r*   ‰  s   ÿz-CSSFunctionRule.from_json.<locals>.<listcomp>r%  c                 S  s   g | ]}t  |¡‘qS r   r!  r'   r   r   r   r*   �  s   r  rv   r”   )r6   rc   r%  r  r_   r‰   )rO   r   r1   r	   r   r„   r…   r   r   r   r   r   „  s$    þÿÿýÿïzCSSFunctionRule.from_json)
r   r   r   r   r2   r_   r‰   r   r   r   r   r   r   r   r$  e  s   
r$  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 )r  z!CSS keyframe rule representation.r	   rc   rO   Úkey_textr4   r5   Nr‡   r_   r   r   c                 C  sL   t ƒ }| j ¡ |d< | j ¡ |d< | j ¡ |d< | jd urH| j ¡ |d< |S )Nrc   ÚkeyTextr5   rv   )r-   rc   r   r&  r5   r_   r.   r   r   r   r   §  s    
zCSSKeyframeRule.to_jsonr   c              	   C  sV   | t  | d¡¡t | d¡¡t | d¡¡| dd ¡d urNtj | d¡¡nd d�S )Nrc   r'  r5   rv   )rc   r&  r5   r_   r  r   r   r   r   r   °  s    ÿúzCSSKeyframeRule.from_jsonr  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 )ÚStyleDeclarationEditz;A descriptor of operation to mutate style declaration text.r^   r_   rU   rR   r
   rP   r   r   c                 C  s0   t ƒ }| j ¡ |d< | j ¡ |d< | j|d< |S )Nrv   rT   rP   )r-   r_   r   rR   rP   r.   r   r   r   r   Æ  s
    
zStyleDeclarationEdit.to_jsonr   c                 C  s,   | t j |d ¡t |d ¡t|d ƒd�S )Nrv   rT   rP   )r_   rR   rP   )r   r„   r   rU   r
   r   r   r   r   r   Í  s
    
ýzStyleDeclarationEdit.from_jsonNrH   r   r   r   r   r(  ¼  s   
r(  r^   r
   ztyping.Optional[dom.NodeId]z3typing.Generator[T_JSON_DICT, T_JSON_DICT, CSSRule])r_   Ú	rule_textÚlocationÚ#node_for_property_syntax_validationr   c                 c  sZ   t ƒ }|  ¡ |d< ||d< | ¡ |d< |dur:| ¡ |d< d|dœ}|V }t | d¡¡S )	a  
    Inserts a new rule with the given ``ruleText`` in a stylesheet
    with given ``styleSheetId``, at the position specified by ``location``.
    :param style_sheet_id:
        The css style sheet identifier where a new rule should be inserted.
    :param rule_text: The text of a new rule.
    :param location: Text position of a new rule in the target style sheet.
    :param node_for_property_syntax_validation:
        NodeId for the DOM node in whose context custom property declarations
        for registered properties should be validated.
        If omitted, declarations in the new rule text can only be validated
        statically, which may produce incorrect results if the declaration
        contains a var() for example.
    :returns: The newly created rule.
    rv   ZruleTextr*  NÚnodeForPropertySyntaxValidationzCSS.addRule©ÚmethodÚparamsrJ   )r-   r   rI   r   r1   )r_   r)  r*  r+  r/  Úcmd_dictr   r   r   r   Úadd_ruleÖ  s    ÿþr1  z<typing.Generator[T_JSON_DICT, T_JSON_DICT, typing.List[str]])r_   r   c                 c  s6   t ƒ }|  ¡ |d< d|dœ}|V }dd„ | d¡D ƒS )zv
    Returns all class names from specified stylesheet.
    :param style_sheet_id:
    :returns: Class name list.
    rv   zCSS.collectClassNamesr-  c                 S  s   g | ]}t |ƒ‘qS r   r˜   r'   r   r   r   r*   
  r+   z'collect_class_names.<locals>.<listcomp>Z
classNames©r-   r   r1   ©r_   r/  r0  r   r   r   r   Úcollect_class_namesû  s    þr4  r`   rs   z<typing.Generator[T_JSON_DICT, T_JSON_DICT, dom.StyleSheetId])ra   Úforcer   c                 c  sD   t ƒ }|  ¡ |d< |dur"||d< d|dœ}|V }tj | d¡¡S )a  
    Creates a new special "via-inspector" stylesheet in the frame
    with given ``frameId``.
    :param frame_id:
    Identifier of the frame where "via-inspector" stylesheet should be created.
    :param force: *(Optional)*
    If true, creates a new stylesheet for every call.
    If false, returns a stylesheet previously created by a call
    with force=false for the frame's document if it exists
    or creates a new stylesheet (default: false).
    :returns: Identifier of the created "via-inspector" stylesheet.
    rw   Nr5  zCSS.createStyleSheetr-  rv   )r-   r   r   r„   r   r1   )ra   r5  r/  r0  r   r   r   r   Úcreate_style_sheet  s    þr6  z0typing.Generator[T_JSON_DICT, T_JSON_DICT, None]r   c                  c  s   ddi} | V }dS )z*Disables the CSS agent for the given page.r.  zCSS.disableNr   ©r0  r   r   r   r   Údisable(  s    ÿr8  c                  c  s   ddi} | V }dS )z§
    Enables the CSS agent for the given page.
    Clients should not assume that the CSS agent has been
    enabled until the result of this command is received.
    r.  z
CSS.enableNr   r7  r   r   r   Úenable0  s    ÿr9  ú
dom.NodeIdztyping.List[str])Únode_idÚforced_pseudo_classesr   c                 c  s8   t ƒ }|  ¡ |d< dd„ |D ƒ|d< d|dœ}|V }dS )a1  
    Ensures that the given node will have specified pseudo-classes
    whenever its style is computed by the browser.
    :param node_id: The element id for which to force the pseudo state.
    :param forced_pseudo_classes:
        Element pseudo classes to force when computing the element's style.
    ÚnodeIdc                 S  s   g | ]}|‘qS r   r   r'   r   r   r   r*   H  r+   z&force_pseudo_state.<locals>.<listcomp>ZforcedPseudoClasseszCSS.forcePseudoStater-  N©r-   r   )r;  r<  r/  r0  r   r   r   r   Úforce_pseudo_state<  s    
þr?  re   )r;  Úforcedr   c                 c  s.   t ƒ }|  ¡ |d< ||d< d|dœ}|V }dS )zÑ
    Ensures that the given node is in its starting-style state.
    :param node_id: The element id for which to force the starting-style state.
    :param forced: Boolean indicating if this is on or off.
    r=  r@  zCSS.forceStartingStyler-  Nr>  )r;  r@  r/  r0  r   r   r   r   Úforce_starting_styleP  s    þrA  z‡typing.Generator[T_JSON_DICT, T_JSON_DICT, typing.Tuple[typing.Optional[typing.List[str]], typing.Optional[str], typing.Optional[str]]])r;  r   c                 c  s†   t ƒ }|  ¡ |d< d|dœ}|V }| dd¡durDdd„ |d D ƒnd| dd¡durbt|d ƒnd| d	d¡dur€t|d	 ƒndfS )
aÜ  
    :param node_id: Id of the node to get background colors for.
    :returns: A tuple with the following items:
        0. **backgroundColors** - *(Optional)*
            The range of background colors behind this element,
            if it contains any visible text. If no visible text is present,
            this will be undefined. In the case of a flat background color,
            this will consist of simply that color. In the case of a gradient,
            this will consist of each of the color stops.
            For anything more complicated, this will be an empty array.
            Images will be ignored (as if the image had failed to load).
        1. **computedFontSize** - *(Optional)*
            The computed font size for this node,
            as a CSS computed value string (e.g. '12px').
        2. **computedFontWeight** - *(Optional)*
            The computed font weight for this node,
            as a CSS computed value string (e.g. 'normal' or '100').
    r=  zCSS.getBackgroundColorsr-  ZbackgroundColorsNc                 S  s   g | ]}t |ƒ‘qS r   r˜   r'   r   r   r   r*   ‡  r+   z)get_background_colors.<locals>.<listcomp>ZcomputedFontSizeZcomputedFontWeight©r-   r   r1   r
   ©r;  r/  r0  r   r   r   r   Úget_background_colorsb  s     þÿÿÿ÷rD  zytyping.Generator[T_JSON_DICT, T_JSON_DICT, typing.Tuple[typing.List[CSSComputedStyleProperty], ComputedStyleExtraFields]]c                 c  sF   t ƒ }|  ¡ |d< d|dœ}|V }dd„ | d¡D ƒt | d¡¡fS )a\  
    Returns the computed style for a DOM node identified by ``nodeId``.
    :param node_id:
    :returns: A tuple with the following items:
        0. **computedStyle** - Computed style for the specified DOM node.
        1. **extraFields** - A list of non-standard "extra fields"
            which blink stores alongside each computed style.
    r=  zCSS.getComputedStyleForNoder-  c                 S  s   g | ]}t  |¡‘qS r   )rª   r   r'   r   r   r   r*   ¬  s   ÿz/get_computed_style_for_node.<locals>.<listcomp>ZcomputedStyleZextraFields)r-   r   r1   r¬   r   rC  r   r   r   Úget_computed_style_for_node“  s    þþûrE  r#   ztyping.Optional[dom.PseudoType])Úvaluesr;  r  r    r$   r   c                 c  s|   t ƒ }dd„ | D ƒ|d< | ¡ |d< |dur4||d< |durH| ¡ |d< |durX||d< d	|d
œ}|V }dd„ | d¡D ƒS )aâ  
    Resolve the specified values in the context of the provided element.
    For example, a value of '1em' is evaluated according to the computed
    'font-size' of the element and a value 'calc(1px + 2px)' will be
    resolved to '3px'.
    If the ``propertyName`` was specified the ``values`` are resolved as if
    they were property's declaration. If a value cannot be parsed according
    to the provided property syntax, the value is parsed using combined
    syntax as if null ``propertyName`` was provided. If the value cannot be
    resolved even then, return the provided value without any changes.
    Note: this function currently does not resolve CSS random() function,
    it returns unmodified random() function parts.`
    :param values: Cascade-dependent keywords (revert/revert-layer) do not work
    :param node_id: Id of the node in whose context the expression is evaluated
    :param property_name:
    :param pseudo_type:
    :param pseudo_identifier:
    :returns:
    c                 S  s   g | ]}|‘qS r   r   r'   r   r   r   r*   Ï  r+   z"resolve_values.<locals>.<listcomp>rF  r=  Nr  r%   r,   zCSS.resolveValuesr-  c                 S  s   g | ]}t |ƒ‘qS r   r˜   r'   r   r   r   r*   Ü  r+   Úresultsr2  )rF  r;  r  r    r$   r/  r0  r   r   r   r   Úresolve_values´  s    þrH  zDtyping.Generator[T_JSON_DICT, T_JSON_DICT, typing.List[CSSProperty]])Úshorthand_namer   r   c                 c  s:   t ƒ }| |d< ||d< d|dœ}|V }dd„ | d¡D ƒS )z@
    :param shorthand_name:
    :param value:
    :returns:
    ZshorthandNamer   zCSS.getLonghandPropertiesr-  c                 S  s   g | ]}t  |¡‘qS r   rµ   r'   r   r   r   r*   ï  r+   z+get_longhand_properties.<locals>.<listcomp>r»   ©r-   r1   )rI  r   r/  r0  r   r   r   r   Úget_longhand_propertiesß  s    þrK  zntyping.Generator[T_JSON_DICT, T_JSON_DICT, typing.Tuple[typing.Optional[CSSStyle], typing.Optional[CSSStyle]]]c                 c  sj   t ƒ }|  ¡ |d< d|dœ}|V }| dd¡durBt | d¡¡nd| dd¡durdt | d¡¡ndfS )aÞ  
    Returns the styles defined inline
    (explicitly in the "style" attribute and implicitly,
    using DOM attributes) for a DOM node identified by ``nodeId``.
    :param node_id:
    :returns: A tuple with the following items:
        0. **inlineStyle** - *(Optional)*
            Inline style for the specified DOM node.
        1. **attributesStyle** - *(Optional)*
            Attribute-defined element style
            (e.g. resulting from "width=20 height=100%").
    r=  zCSS.getInlineStylesForNoder-  r<   NÚattributesStyle©r-   r   r1   r4   r   rC  r   r   r   Úget_inline_styles_for_nodeò  s    þÿÿúrN  z¿typing.Generator[T_JSON_DICT, T_JSON_DICT, typing.Tuple[typing.Optional[typing.List[CSSAnimationStyle]], typing.Optional[CSSStyle], typing.Optional[typing.List[InheritedAnimatedStyleEntry]]]]c                 c  s’   t ƒ }|  ¡ |d< d|dœ}|V }| dd¡durFdd„ | d¡D ƒnd| dd¡durft |d ¡nd| d	d¡durŒd
d„ | d	¡D ƒndfS )a  
    Returns the styles coming from animations & transitions
    including the animation & transition styles coming from inheritance chain.
    :param node_id:
    :returns: A tuple with the following items:

        0. **animationStyles** - *(Optional)* Styles coming from animations.
        1. **transitionsStyle** - *(Optional)* Style coming from transitions.
        2. **inherited** - *(Optional)*
           Inherited style entries for animationsStyle and transitionsStyle
           from the inheritance chain of the element.
    r=  zCSS.getAnimatedStylesForNoder-  rA   Nc                 S  s   g | ]}t  |¡‘qS r   rC   r'   r   r   r   r*   5  r+   z0get_animated_styles_for_node.<locals>.<listcomp>rB   Ú	inheritedc                 S  s   g | ]}t  |¡‘qS r   )r>   r   r'   r   r   r   r*   ;  s   ÿrM  rC  r   r   r   Úget_animated_styles_for_node  s$    þÿÿüþôrP  aŽ  typing.Generator[T_JSON_DICT, T_JSON_DICT, typing.Tuple[typing.Optional[CSSStyle], typing.Optional[CSSStyle], typing.Optional[typing.List[RuleMatch]], typing.Optional[typing.List[PseudoElementMatches]], typing.Optional[typing.List[InheritedStyleEntry]], typing.Optional[typing.List[InheritedPseudoElementMatches]], typing.Optional[typing.List[CSSKeyframesRule]], typing.Optional[typing.List[CSSPositionTryRule]], typing.Optional[int], typing.Optional[typing.List[CSSPropertyRule]], typing.Optional[typing.List[CSSPropertyRegistration]], typing.Optional[typing.List[CSSAtRule]], typing.Optional[dom.NodeId], typing.Optional[typing.List[CSSFunctionRule]]]]c                 c  s   t ƒ }|  ¡ |d< d|dœ}|V }| dd¡durBt | d¡¡nd| dd¡durbt |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Îdd	„ |d 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>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ªdd	„ |d 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d¡du�rdd	„ |d D ƒndfS )a   
    Returns requested styles for a DOM node identified by ``nodeId``.
    :param node_id:
    :returns: A tuple with the following items:
        0. **inlineStyle** - *(Optional)*
            Inline style for the specified DOM node.
        1. **attributesStyle** - *(Optional)*
            Attribute-defined element style
            (e.g. resulting from "width=20 height=100%").
        2. **matchedCSSRules** - *(Optional)*
            CSS rules matching this node, from all applicable stylesheets.
        3. **pseudoElements** - *(Optional)*
            Pseudo style matches for this node.
        4. **inherited** - *(Optional)*
            A chain of inherited styles
            (from the immediate node parent up to the DOM tree root).
        5. **inheritedPseudoElements** - *(Optional)*
            A chain of inherited pseudo element styles
            (from the immediate node parent up to the DOM tree root).
        6. **cssKeyframesRules** - *(Optional)*
            A list of CSS keyframed animations matching this node.
        7. **cssPositionTryRules** - *(Optional)*
            A list of CSS @position-try rules matching this node,
            based on the position-try-fallbacks property.
        8. **activePositionFallbackIndex** - *(Optional)*
            Index of the active fallback in the applied position-try-fallback
            property, won't be set if there is no active position-try fallback.
        9. **cssPropertyRules** - *(Optional)*
            A list of CSS at-property rules matching this node.
        10. **cssPropertyRegistrations** - *(Optional)*
            A list of CSS property registrations matching this node.
        11. **cssAtRules** - *(Optional)*
            A list of simple @rules matching this node or its pseudo-elements.
        12. **parentLayoutNodeId** - *(Optional)*
            Id of the first parent element that doesn't have display: contents.
        13. **cssFunctionRules** - *(Optional)*
            A list of CSS at-function rules referenced by styles of this node.
    r=  zCSS.getMatchedStylesForNoder-  r<   NrL  r;   c                 S  s   g | ]}t  |¡‘qS r   r/   r'   r   r   r   r*   Ž  r+   z/get_matched_styles_for_node.<locals>.<listcomp>rF   c                 S  s   g | ]}t  |¡‘qS r   rG   r'   r   r   r   r*   ‘  r+   rO  c                 S  s   g | ]}t  |¡‘qS r   )r7   r   r'   r   r   r   r*   ”  r+   ZinheritedPseudoElementsc                 S  s   g | ]}t  |¡‘qS r   )rD   r   r'   r   r   r   r*   —  s   ÿZcssKeyframesRulesc                 S  s   g | ]}t  |¡‘qS r   )r  r   r'   r   r   r   r*   �  r+   ZcssPositionTryRulesc                 S  s   g | ]}t  |¡‘qS r   )r  r   r'   r   r   r   r*      r+   ZactivePositionFallbackIndexZcssPropertyRulesc                 S  s   g | ]}t  |¡‘qS r   )r  r   r'   r   r   r   r*   ¦  r+   ZcssPropertyRegistrationsc                 S  s   g | ]}t  |¡‘qS r   )r  r   r'   r   r   r   r*   ©  s   ÿZ
cssAtRulesc                 S  s   g | ]}t  |¡‘qS r   )r  r   r'   r   r   r   r*   ¯  r+   ZparentLayoutNodeIdZcssFunctionRulesc                 S  s   g | ]}t  |¡‘qS r   )r$  r   r'   r   r   r   r*   µ  r+   )r-   r   r1   r4   r   rN   r   ÚNodeIdrC  r   r   r   Úget_matched_styles_for_nodeD  sj    <þÿÿÿÿÿüþÿÿÿÿü
þÿÿÿÐrR  z0typing.Generator[T_JSON_DICT, T_JSON_DICT, dict]c                  c  s   ddi} | V }t | d¡ƒS )z^
    Returns the values of the default UA-defined
    environment variables used in env()
    r.  zCSS.getEnvironmentVariablesZenvironmentVariablesrJ  r7  r   r   r   Úget_environment_variables»  s    ÿrS  zAtyping.Generator[T_JSON_DICT, T_JSON_DICT, typing.List[CSSMedia]]c                  c  s"   ddi} | V }dd„ |  d¡D ƒS )z9Returns all media queries parsed by the rendering engine.r.  zCSS.getMediaQueriesc                 S  s   g | ]}t  |¡‘qS r   r™   r'   r   r   r   r*   Ñ  r+   z%get_media_queries.<locals>.<listcomp>Zmedias©r1   r7  r   r   r   Úget_media_queriesÉ  s    ÿrU  zJtyping.Generator[T_JSON_DICT, T_JSON_DICT, typing.List[PlatformFontUsage]]c                 c  s6   t ƒ }|  ¡ |d< d|dœ}|V }dd„ | d¡D ƒS )zÈ
    Requests information about platform fonts,
    which we used to render child TextNodes in the given node.
    :param node_id:
    :returns: Usage statistics for every employed platform font.
    r=  zCSS.getPlatformFontsForNoder-  c                 S  s   g | ]}t  |¡‘qS r   )rß   r   r'   r   r   r   r*   æ  r+   z/get_platform_fonts_for_node.<locals>.<listcomp>Zfontsr2  rC  r   r   r   Úget_platform_fonts_for_nodeÔ  s    þrV  z/typing.Generator[T_JSON_DICT, T_JSON_DICT, str]c                 c  s0   t ƒ }|  ¡ |d< d|dœ}|V }t| d¡ƒS )z}
    Returns the current textual content for a stylesheet.
    :param style_sheet_id:
    :returns: The stylesheet text.
    rv   zCSS.getStyleSheetTextr-  rP   )r-   r   r
   r1   r3  r   r   r   Úget_style_sheet_texté  s    þrW  z8typing.Generator[T_JSON_DICT, T_JSON_DICT, CSSLayerData]c                 c  s2   t ƒ }|  ¡ |d< d|dœ}|V }t | d¡¡S )a@  
    Returns all layers parsed by the rendering engine for the tree scope
    of a node. Given a DOM element identified by nodeId,
    getLayersForNode returns the root layer for the nearest ancestor
    document or shadow root. The layer root contains the full layer tree
    for the tree scope and their ordering.
    r=  zCSS.getLayersForNoder-  Z	rootLayer)r-   r   rÚ   r   r1   rC  r   r   r   Úget_layers_for_nodeû  s    
þrX  zDtyping.Generator[T_JSON_DICT, T_JSON_DICT, typing.List[SourceRange]])r_   Úselector_textr   c                 c  s>   t ƒ }|  ¡ |d< ||d< d|dœ}|V }dd„ | d¡D ƒS )zÏ
    Given a CSS selector text and a style sheet ID, getLocationForSelector
    returns an array of locations of the CSS selector in the style sheet.
    :param style_sheet_id:
    :param selector_text:
    rv   ZselectorTextzCSS.getLocationForSelectorr-  c                 S  s   g | ]}t  |¡‘qS r   )rU   r   r'   r   r   r   r*    	  r+   z-get_location_for_selector.<locals>.<listcomp>Úrangesr2  )r_   rY  r/  r0  r   r   r   r   Úget_location_for_selector	  s    	þr[  c                 c  s.   t ƒ }| dur|  ¡ |d< d|dœ}|V }dS )a“  
    Starts tracking the given node for the computed style updates
    and whenever the computed style is updated for node, it queues
    a ``computedStyleUpdated`` event with throttling.
    There can only be 1 node tracked for computed style updates
    so passing a new node id removes tracking from the previous node.
    Pass ``undefined`` to disable tracking.
    :param node_id: *(Optional)*
    Nr=  z$CSS.trackComputedStyleUpdatesForNoder-  r>  rC  r   r   r   Ú%track_computed_style_updates_for_node#	  s    þr\  z%typing.List[CSSComputedStyleProperty])Úproperties_to_trackr   c                 c  s,   t ƒ }dd„ | D ƒ|d< d|dœ}|V }dS )z×
    Starts tracking the given computed styles for updates.
    The specified array of properties replaces the one previously specified.
    Pass empty array to disable tracking.
    :param properties_to_track:
    c                 S  s   g | ]}|  ¡ ‘qS r   r&   r'   r   r   r   r*   C	  r+   z0track_computed_style_updates.<locals>.<listcomp>ZpropertiesToTrackzCSS.trackComputedStyleUpdatesr-  N©r-   )r]  r/  r0  r   r   r   r   Útrack_computed_style_updates9	  s    	þr_  zCtyping.Generator[T_JSON_DICT, T_JSON_DICT, typing.List[dom.NodeId]]c                  c  s"   ddi} | V }dd„ |  d¡D ƒS )z’
    Polls the next batch of computed style updates.
    :returns: The list of node Ids
     that have their tracked computed styles updated.
    r.  zCSS.takeComputedStyleUpdatesc                 S  s   g | ]}t j |¡‘qS r   ©r   rQ  r   r'   r   r   r   r*   W	  r+   z/take_computed_style_updates.<locals>.<listcomp>ZnodeIdsrT  r7  r   r   r   Útake_computed_style_updatesK	  s    	ÿra  )r;  r  r   r   c                 c  s6   t ƒ }|  ¡ |d< ||d< ||d< d|dœ}|V }dS )zÞ
    Find a rule with the given active property for the given node
    and set the new value for this property.
    :param node_id: The element id for which to set property.
    :param property_name:
    :param value:
    r=  r  r   z$CSS.setEffectivePropertyValueForNoder-  Nr>  )r;  r  r   r/  r0  r   r   r   r   Ú%set_effective_property_value_for_nodeZ	  s    
þrb  z1typing.Generator[T_JSON_DICT, T_JSON_DICT, Value])r_   rR   r  r   c                 c  sF   t ƒ }|  ¡ |d< | ¡ |d< ||d< d|dœ}|V }t | d¡¡S )z´
    Modifies the property rule property name.
    :param style_sheet_id:
    :param range_:
    :param property_name:
    :returns: The resulting key text after modification.
    rv   rT   r  zCSS.setPropertyRulePropertyNamer-  ©r-   r   rO   r   r1   )r_   rR   r  r/  r0  r   r   r   r   Úset_property_rule_property_nameo	  s    
þrd  )r_   rR   r&  r   c                 c  sF   t ƒ }|  ¡ |d< | ¡ |d< ||d< d|dœ}|V }t | d¡¡S )zª
    Modifies the keyframe rule key text.
    :param style_sheet_id:
    :param range_:
    :param key_text:
    :returns: The resulting key text after modification.
    rv   rT   r'  zCSS.setKeyframeKeyr-  rc  )r_   rR   r&  r/  r0  r   r   r   r   Úset_keyframe_key…	  s    
þre  z4typing.Generator[T_JSON_DICT, T_JSON_DICT, CSSMedia])r_   rR   rP   r   c                 c  sF   t ƒ }|  ¡ |d< | ¡ |d< ||d< d|dœ}|V }t | d¡¡S )z£
    Modifies the rule selector.
    :param style_sheet_id:
    :param range_:
    :param text:
    :returns: The resulting CSS media rule after modification.
    rv   rT   rP   zCSS.setMediaTextr-  rŠ   )r-   r   rš   r   r1   ©r_   rR   rP   r/  r0  r   r   r   r   Úset_media_text›	  s    
þrg  z=typing.Generator[T_JSON_DICT, T_JSON_DICT, CSSContainerQuery]c                 c  sF   t ƒ }|  ¡ |d< | ¡ |d< ||d< d|dœ}|V }t | d¡¡S )z¿
    Modifies the expression of a container query.
    :param style_sheet_id:
    :param range_:
    :param text:
    :returns: The resulting CSS container query rule after modification.
    rv   rT   rP   zCSS.setContainerQueryTextr-  ZcontainerQuery)r-   r   r›   r   r1   rf  r   r   r   Úset_container_query_text±	  s    
þrh  z7typing.Generator[T_JSON_DICT, T_JSON_DICT, CSSSupports]c                 c  sF   t ƒ }|  ¡ |d< | ¡ |d< ||d< d|dœ}|V }t | d¡¡S )z¹
    Modifies the expression of a supports at-rule.
    :param style_sheet_id:
    :param range_:
    :param text:
    :returns: The resulting CSS Supports rule after modification.
    rv   rT   rP   zCSS.setSupportsTextr-  rŒ   )r-   r   rœ   r   r1   rf  r   r   r   Úset_supports_textÇ	  s    
þri  z9typing.Generator[T_JSON_DICT, T_JSON_DICT, CSSNavigation]c                 c  sF   t ƒ }|  ¡ |d< | ¡ |d< ||d< d|dœ}|V }t | d¡¡S )z½
    Modifies the expression of a navigation at-rule.
    :param style_sheet_id:
    :param range_:
    :param text:
    :returns: The resulting CSS Navigation rule after modification.
    rv   rT   rP   zCSS.setNavigationTextr-  r  )r-   r   r¡   r   r1   rf  r   r   r   Úset_navigation_textÝ	  s    
þrj  z4typing.Generator[T_JSON_DICT, T_JSON_DICT, CSSScope]c                 c  sF   t ƒ }|  ¡ |d< | ¡ |d< ||d< d|dœ}|V }t | d¡¡S )z³
    Modifies the expression of a scope at-rule.
    :param style_sheet_id:
    :param range_:
    :param text:
    :returns: The resulting CSS Scope rule after modification.
    rv   rT   rP   zCSS.setScopeTextr-  Úscope)r-   r   rž   r   r1   rf  r   r   r   Úset_scope_textó	  s    
þrl  z8typing.Generator[T_JSON_DICT, T_JSON_DICT, SelectorList])r_   rR   Úselectorr   c                 c  sF   t ƒ }|  ¡ |d< | ¡ |d< ||d< d|dœ}|V }t | d¡¡S )z¦
    Modifies the rule selector.
    :param style_sheet_id:
    :param range_:
    :param selector:
    :returns: The resulting selector list after modification.
    rv   rT   rm  zCSS.setRuleSelectorr-  r’   )r-   r   rZ   r   r1   )r_   rR   rm  r/  r0  r   r   r   r   Úset_rule_selector	
  s    
þrn  z@typing.Generator[T_JSON_DICT, T_JSON_DICT, typing.Optional[str]])r_   rP   r   c                 c  sL   t ƒ }|  ¡ |d< ||d< d|dœ}|V }| dd¡durHt| d¡ƒS dS )z¡
    Sets the new stylesheet text.
    :param style_sheet_id:
    :param text:
    :returns: *(Optional)* URL of source map associated with script (if any).
    rv   rP   zCSS.setStyleSheetTextr-  r€   NrB  )r_   rP   r/  r0  r   r   r   r   Úset_style_sheet_text
  s    	þÿýro  z!typing.List[StyleDeclarationEdit]zAtyping.Generator[T_JSON_DICT, T_JSON_DICT, typing.List[CSSStyle]])Úeditsr+  r   c                 c  sP   t ƒ }dd„ | D ƒ|d< |dur,| ¡ |d< d|dœ}|V }dd„ | d	¡D ƒS )
a  
    Applies specified style edits one after another in the given order.
    :param edits:
    :param node_for_property_syntax_validation: **(EXPERIMENTAL)** *(Optional)*
     NodeId for the DOM node in whose context custom property declarations
     for registered properties should be validated.
     If omitted, declarations in the new rule text can only be
     validated statically, which may produce incorrect results
     if the declaration contains a var() for example.
    :returns: The resulting styles after modification.
    c                 S  s   g | ]}|  ¡ ‘qS r   r&   r'   r   r   r   r*   G
  r+   z#set_style_texts.<locals>.<listcomp>rp  Nr,  zCSS.setStyleTextsr-  c                 S  s   g | ]}t  |¡‘qS r   )r4   r   r'   r   r   r   r*   Q
  r+   Ústylesr2  )rp  r+  r/  r0  r   r   r   r   Úset_style_texts7
  s    ÿþrr  c                  c  s   ddi} | V }dS )zEnables the selector recording.r.  zCSS.startRuleUsageTrackingNr   r7  r   r   r   Ústart_rule_usage_trackingT
  s    ÿrs  zBtyping.Generator[T_JSON_DICT, T_JSON_DICT, typing.List[RuleUsage]]c                  c  s"   ddi} | V }dd„ |  d¡D ƒS )z­
    Stop tracking rule usage and return the list of rules that were used
    since last call to ``takeCoverageDelta``
    (or since start of coverage instrumentation).
    r.  zCSS.stopRuleUsageTrackingc                 S  s   g | ]}t  |¡‘qS r   ©r¢   r   r'   r   r   r   r*   j
  r+   z,stop_rule_usage_tracking.<locals>.<listcomp>Z	ruleUsagerT  r7  r   r   r   Ústop_rule_usage_tracking^
  s    	ÿru  zWtyping.Generator[T_JSON_DICT, T_JSON_DICT, typing.Tuple[typing.List[RuleUsage], float]]c                  c  s0   ddi} | V }dd„ |  d¡D ƒt|  d¡ƒfS )a  
    Obtain list of rules that became used since last call to this method
    (or since start of coverage instrumentation).
    :returns: A tuple with the following items:
        0. **coverage** -
        1. **timestamp** - Monotonically increasing time, in seconds.
    r.  zCSS.takeCoverageDeltac                 S  s   g | ]}t  |¡‘qS r   rt  r'   r   r   r   r*   ~
  r+   z'take_coverage_delta.<locals>.<listcomp>ZcoverageÚ	timestamp)r1   rj   r7  r   r   r   Útake_coverage_deltam
  s    ÿþrw  )Úenabledr   c                 c  s"   t ƒ }| |d< d|dœ}|V }dS )zŽ
    Enables/disables rendering of local CSS fonts (enabled by default).
    :param enabled: Whether rendering of local fonts is enabled.
    rx  zCSS.setLocalFontsEnabledr-  Nr^  )rx  r/  r0  r   r   r   r   Úset_local_fonts_enabledƒ
  s    þry  zCSS.fontsUpdatedc                   @  s.   e Zd ZU dZded< edd dœdd„ƒZdS )	ÚFontsUpdatedzx
    Fires whenever a web font is updated.
    A non-empty font parameter indicates a successfully loaded web font.
    ztyping.Optional[FontFace]Úfontr   r   c                 C  s(   | |  dd ¡d ur t |d ¡nd d�S )Nr{  )r{  )r1   rð   r   r   r   r   r   r   �
  s
    ÿýzFontsUpdated.from_jsonN©r   r   r   r   r2   r   r   r   r   r   r   rz  “
  s   
rz  zCSS.mediaQueryResultChangedc                   @  s$   e Zd ZdZedd dœdd„ƒZdS )ÚMediaQueryResultChangedzÀ
    Fires whenever a MediaQuery result changes
    (for example, after a browser window has been resized).
    The current implementation considers only viewport-dependent media features
    r   r   c                 C  s   | ƒ S r   r   r   r   r   r   r   ¯
  s    z!MediaQueryResultChanged.from_jsonN)r   r   r   r   r   r   r   r   r   r   r}  ¦
  s   r}  zCSS.styleSheetAddedc                   @  s.   e Zd ZU dZded< edd dœdd„ƒZdS )	ÚStyleSheetAddedz6Fired whenever an active document stylesheet is added.r]   Úheaderr   r   c                 C  s   | t  | d¡¡d�S )Nr  )r  )r]   r   r1   r   r   r   r   r   »
  s    zStyleSheetAdded.from_jsonNr|  r   r   r   r   r~  ´
  s   
r~  zCSS.styleSheetChangedc                   @  s.   e Zd ZU dZded< edd dœdd„ƒZdS )	ÚStyleSheetChangedzU
    Fired whenever a stylesheet is changed as a result of the client operation.
    r^   r_   r   r   c                 C  s   | t j | d¡¡d�S ©Nrv   )r_   ©r   r„   r   r1   r   r   r   r   r   È
  s    ÿzStyleSheetChanged.from_jsonNr|  r   r   r   r   r€  À
  s   
r€  zCSS.styleSheetRemovedc                   @  s.   e Zd ZU dZded< edd dœdd„ƒZdS )	ÚStyleSheetRemovedz8Fired whenever an active document stylesheet is removed.r^   r_   r   r   c                 C  s   | t j | d¡¡d�S r�  r‚  r   r   r   r   r   Ö
  s
    ÿÿzStyleSheetRemoved.from_jsonNr|  r   r   r   r   rƒ  Ï
  s   
rƒ  zCSS.computedStyleUpdatedc                   @  s.   e Zd ZU dZded< edd dœdd„ƒZdS )	ÚComputedStyleUpdatedz**EXPERIMENTAL**r:  r;  r   r   c                 C  s   | t j |d ¡d�S )Nr=  )r;  r`  r   r   r   r   r   æ
  s    zComputedStyleUpdated.from_jsonNr|  r   r   r   r   r„  ß
  s   
r„  )N)N)NNN)N)N)fÚ
__future__r   ÚenumÚtypingÚdataclassesr   Úutilr   r   Ú r   r   ÚEnumr	   r   r3   r7   r>   rD   r0   rO   rV   rZ   r]   rI   rŸ   r¢   rU   r¨   rª   r¬   r4   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(  r1  r4  r6  r8  r9  r?  rA  rD  rE  rH  rK  rN  rP  rR  rS  rU  rV  rW  rX  r[  r\  r_  ra  rb  rd  re  rg  rh  ri  rj  rl  rn  ro  rr  rs  ru  rw  ry  rz  r}  r~  r€  rƒ  r„  r   r   r   r   Ú<module>   s<  #"n 
1K5'B#&!A#. 85  ü% ÿ1$   û+$.w ÿ þ

