
    ?OOfV                       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  G d	 d
e      Z G d dej                        Z G d dej                        Z G d dej                        Ze G d d             Ze G d d             Ze G d d             Ze G d d             Z G d dej                        Ze G d d             Zd+dZd+dZ	 	 	 	 d,	 	 	 	 	 	 	 	 	 d-dZ	 	 d.	 	 	 	 	 d/d Z	 d0	 	 	 d1d!Z	 	 	 d2	 	 	 	 	 	 	 d3d"Z	 d0	 	 	 	 	 d4d#Z	 	 	 	 	 d5	 	 	 	 	 	 	 	 	 	 	 d6d$Z  ed%      e G d& d'                    Z! ed(      e G d) d*                    Z"y)7    )annotations   )event_classT_JSON_DICT)	dataclassN)dom)page)runtimec                  <     e Zd ZdZddZedd       Z fdZ xZS )AXNodeIdz/
    Unique accessibility node identifier.
    c                    | S N selfs    v/var/www/premiumrankchecker/venv/lib/python3.12/site-packages/selenium/webdriver/common/devtools/v123/accessibility.pyto_jsonzAXNodeId.to_json   s        c                     | |      S r   r   clsjsons     r   	from_jsonzAXNodeId.from_json       4yr   c                >    dj                  t        | 	               S )NzAXNodeId({}))formatsuper__repr__)r   	__class__s    r   r   zAXNodeId.__repr__   s    $$UW%5%788r   )returnstr)r   r!   r    r   )	__name__
__module____qualname____doc__r   classmethodr   r   __classcell__)r   s   @r   r   r      s+      9 9r   r   c                  j    e Zd ZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZdZdZdZdZdZdZdZd Zed        Zy)AXValueTypez*
    Enum of possible property types.
    booleantristatebooleanOrUndefinedidref	idrefListintegernodenodeListnumberstringcomputedStringtoken	tokenListdomRelationroleinternalRolevalueUndefinedc                    | j                   S r   valuer   s    r   r   zAXValueType.to_json6       zzr   c                     | |      S r   r   r   s     r   r   zAXValueType.from_json9   r   r   N)r"   r#   r$   r%   BOOLEANTRISTATEBOOLEAN_OR_UNDEFINEDIDREF
IDREF_LISTINTEGERNODE	NODE_LISTNUMBERSTRINGCOMPUTED_STRINGTOKEN
TOKEN_LISTDOM_RELATIONROLEINTERNAL_ROLEVALUE_UNDEFINEDr   r&   r   r   r   r   r)   r)       sx     GH/EJGDIFF&OEJ LD"M&O  r   r)   c                  >    e Zd ZdZdZdZdZdZdZdZ	d Z
ed	        Zy
)AXValueSourceTypez,
    Enum of possible property sources.
    	attributeimplicitstylecontentsplaceholderrelatedElementc                    | j                   S r   r<   r   s    r   r   zAXValueSourceType.to_jsonI   r>   r   c                     | |      S r   r   r   s     r   r   zAXValueSourceType.from_jsonL   r   r   N)r"   r#   r$   r%   	ATTRIBUTEIMPLICITSTYLECONTENTSPLACEHOLDERRELATED_ELEMENTr   r&   r   r   r   r   rR   rR   >   s@     IHEHK&O  r   rR   c                  N    e Zd ZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZd Zed        Zy)AXValueNativeSourceTypezd
    Enum of possible native property sources (as a subtype of a particular AXValueSourceType).
    description
figcaptionlabellabelforlabelwrappedlegendrubyannotationtablecaptiontitleotherc                    | j                   S r   r<   r   s    r   r   zAXValueNativeSourceType.to_json`   r>   r   c                     | |      S r   r   r   s     r   r   z!AXValueNativeSourceType.from_jsonc   r   r   N)r"   r#   r$   r%   DESCRIPTION
FIGCAPTIONLABELLABELFORLABELWRAPPEDLEGENDRUBYANNOTATIONTABLECAPTIONTITLEOTHERr   r&   r   r   r   r   rb   rb   Q   sT      KJEH!LF%N!LEE  r   rb   c                      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Zded<   d Zed        Zy)AXValueSourcez5
    A single source for a computed AX property.
    rR   type_Ntyping.Optional[AXValue]r=   typing.Optional[str]rS   attribute_valuetyping.Optional[bool]
supersededz(typing.Optional[AXValueNativeSourceType]native_sourcenative_source_valueinvalidinvalid_reasonc                t   t               }| j                  j                         |d<   | j                  | j                  j                         |d<   | j                  | j                  |d<   | j
                  | j
                  j                         |d<   | j                  | j                  |d<   | j                  | j                  j                         |d<   | j                  | j                  j                         |d<   | j                  | j                  |d<   | j                  | j                  |d	<   |S )
Ntyper=   rS   attributeValuer   nativeSourcenativeSourceValuer   invalidReason)dictr{   r   r=   rS   r~   r   r   r   r   r   r   r   s     r   r   zAXValueSource.to_json   s   vzz))+V::! JJ..0DM>>% $D+%)%9%9%A%A%CD!"??&!%D)#'#5#5#=#=#?D ##/(,(@(@(H(H(JD$%<<#"llDO*$($7$7D!r   c                    | t         j                  |d         d|v rt        j                  |d         nd d|v rt        |d         nd d|v rt        j                  |d         nd d|v rt	        |d         nd d|v rt
        j                  |d         nd d|v rt        j                  |d         nd d|v rt	        |d         nd d	|v rt        |d	         
	      S d 
	      S )Nr   r=   rS   r   r   r   r   r   r   )	r{   r=   rS   r~   r   r   r   r   r   )rR   r   AXValuer!   boolrb   r   s     r   r   zAXValueSource.from_json   s    #--d6l;6=o'##DM240;t0Cc${+,IY]aIaG--d3C.DEgk3?43GtD./TUcgkUk1;;D<PQquPcgkPk 1 1$7J2K Lqu-6$->Di)D9HD9P3tO45

 
	
 W[

 
	
r   )r"   r#   r$   r%   __annotations__r=   rS   r~   r   r   r   r   r   r   r&   r   r   r   r   rz   rz   h   s      '+E#* '+I#* 15O-4 )-J%, ?CM;B 5918 &*G") ,0N(/* 
 
r   rz   c                  J    e Zd ZU ded<   dZded<   dZded<   d Zed        Zy)	AXRelatedNodezdom.BackendNodeIdbackend_dom_node_idNr}   r-   textc                    t               }| j                  j                         |d<   | j                  | j                  |d<   | j                  | j                  |d<   |S )NbackendDOMNodeIdr-   r   )r   r   r   r-   r   r   s     r   r   zAXRelatedNode.to_json   sV    v#'#;#;#C#C#E ::! JJDM99 99DLr   c                     | t         j                  j                  |d         d|v rt        |d         nd d|v rt        |d               S d       S )Nr   r-   r   )r   r-   r   )r   BackendNodeIdr   r!   r   s     r   r   zAXRelatedNode.from_json   s^     # 1 1 ; ;DAS<T U(/4#d7m$T&,nT&\"
 	
 ;?
 	
r   )	r"   r#   r$   r   r-   r   r   r&   r   r   r   r   r   r      s=     +* #'E& "&D
% 
 
r   r   c                  8    e Zd ZU ded<   ded<   d Zed        Zy)
AXPropertyAXPropertyNamenamer   r=   c                    t               }| j                  j                         |d<   | j                  j                         |d<   |S )Nr   r=   )r   r   r   r=   r   s     r   r   zAXProperty.to_json   s:    vyy((*V

**,Wr   c                n     | t         j                  |d         t        j                  |d               S )Nr   r=   )r   r=   )r   r   r   r   s     r   r   zAXProperty.from_json   s3    ))$v,7##DM2
 	
r   N)r"   r#   r$   r   r   r&   r   r   r   r   r   r      s*      N 
 
r   r   c                  \    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e	d        Z
y)r   z(
    A single computed AX property.
    r)   r{   Nztyping.Optional[typing.Any]r=   z+typing.Optional[typing.List[AXRelatedNode]]related_nodesz+typing.Optional[typing.List[AXValueSource]]sourcesc                z   t               }| j                  j                         |d<   | j                  | j                  |d<   | j                  +| j                  D cg c]  }|j                          c}|d<   | j
                  +| j
                  D cg c]  }|j                          c}|d<   |S c c}w c c}w )Nr   r=   relatedNodesr   )r   r{   r   r=   r   r   r   r   is      r   r   zAXValue.to_json   s    vzz))+V::! JJDM)9=9K9K#LAAIIK#LD <<#48LLAqqyy{ADO $MAs   B3B8c                    | t         j                  |d         d|v r|d   nd d|v r&|d   D cg c]  }t        j                  |       c}nd d|v r+|d   D cg c]  }t        j                  |       c}      S d       S c c}w c c}w )Nr   r=   r   r   )r{   r=   r   r   )r)   r   r   rz   r   r   r   s      r   r   zAXValue.from_json   s    ''V5#*d?$w-XfjnXntN?ST!=2215TtxMVZ^M^iIA],,Q/I	
 	
 ei	
 	
 UIs   BB
)r"   r#   r$   r%   r   r=   r   r   r   r&   r   r   r   r   r   r      sR      *.E&- BFM>E <@G8?	 
 
r   r   c                      e Zd ZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZ dZ!d Z"d!Z#d"Z$d#Z%d$Z&d%Z'd&Z(d'Z)d(Z*d) Z+e,d*        Z-y+),r   a  
    Values of AXProperty name:
    - from 'busy' to 'roledescription': states which apply to every AX node
    - from 'live' to 'root': attributes which apply to nodes in live regions
    - from 'autocomplete' to 'valuetext': attributes which apply to widgets
    - from 'checked' to 'selected': states which apply to widgets
    - from 'activedescendant' to 'owns' - relationships between elements other than parent/child/sibling.
    busydisablededitable	focusablefocusedhidden
hiddenRootr   keyshortcutssettableroledescriptionliveatomicrelevantrootautocompletehasPopuplevelmultiselectableorientation	multilinereadonlyrequiredvalueminvaluemax	valuetextcheckedexpandedmodalpressedselectedactivedescendantcontrolsdescribedbydetailserrormessageflowto
labelledbyownsc                    | j                   S r   r<   r   s    r   r   zAXPropertyName.to_json6  r>   r   c                     | |      S r   r   r   s     r   r   zAXPropertyName.from_json9  r   r   N).r"   r#   r$   r%   BUSYDISABLEDEDITABLE	FOCUSABLEFOCUSEDHIDDENHIDDEN_ROOTINVALIDKEYSHORTCUTSSETTABLEROLEDESCRIPTIONLIVEATOMICRELEVANTROOTAUTOCOMPLETE	HAS_POPUPLEVELMULTISELECTABLEORIENTATION	MULTILINEREADONLYREQUIREDVALUEMINVALUEMAX	VALUETEXTCHECKEDEXPANDEDMODALPRESSEDSELECTEDACTIVEDESCENDANTCONTROLSDESCRIBEDBYDETAILSERRORMESSAGEFLOWTO
LABELLEDBYOWNSr   r&   r   r   r   r   r   r     s     DHHIGFKG!LH'ODFHD!LIE'OKIHHHHIGHEGH)HKG!LFJD  r   r   c                      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Zded<   dZded<   dZded<   dZded<   d Zed        Zy)AXNodez+
    A node in the accessibility tree.
    r   node_idr   ignoredNz(typing.Optional[typing.List[AXProperty]]ignored_reasonsr|   r8   chrome_roler   rc   r=   
propertiesztyping.Optional[AXNodeId]	parent_idz&typing.Optional[typing.List[AXNodeId]]	child_ids"typing.Optional[dom.BackendNodeId]r   typing.Optional[page.FrameId]frame_idc                j   t               }| j                  j                         |d<   | j                  |d<   | j                  +| j                  D cg c]  }|j                          c}|d<   | j
                  | j
                  j                         |d<   | j                  | j                  j                         |d<   | j                  | j                  j                         |d<   | j                  | j                  j                         |d<   | j                  | j                  j                         |d<   | j                  +| j                  D cg c]  }|j                          c}|d	<   | j                  | j                  j                         |d
<   | j                  +| j                  D cg c]  }|j                          c}|d<   | j                  | j                  j                         |d<   | j                  | j                  j                         |d<   |S c c}w c c}w c c}w )NnodeIdr   ignoredReasonsr8   
chromeRoler   rc   r=   r   parentIdchildIdsr   frameId)r   r   r   r   r   r8   r   r   rc   r=   r   r   r   r   r  r   s      r   r   zAXNode.to_jsonj  s   v--/X,,Y+;?;O;O%Paaiik%PD!"99 99,,.DL'!%!1!1!9!9!;D99 99,,.DL'"&"2"2":":"<D::! JJ..0DM??&7;!G!!))+!GD>>%#~~557D>>%59^^D		DD##/'+'?'?'G'G'ID#$==$"mm335DO+ &Q "H  Es   H&H+5H0c                |    | t         j                  |d         t        |d         d|v r&|d   D cg c]  }t        j                  |       c}nd d|v rt        j                  |d         nd d|v rt        j                  |d         nd d|v rt        j                  |d         nd d|v rt        j                  |d         nd d|v rt        j                  |d         nd d	|v r&|d	   D cg c]  }t        j                  |       c}nd d
|v rt         j                  |d
         nd d|v r&|d   D cg c]  }t         j                  |       c}nd d|v r"t
        j                  j                  |d         nd d|v r't        j                  j                  |d               S d       S c c}w c c}w c c}w )Nr  r   r  r8   r  r   rc   r=   r   r  r	  r   r
  )r   r   r   r8   r   r   rc   r=   r   r   r   r   r  )	r   r   r   r   r   r   r   r	   FrameIdr   s      r   r   zAXNode.from_json  s   &&tH~6i)YimqYqdCS>TUZ11!4Uw{4:dN""4<0AMQUAU))$|*<=[_4:dN""4<0BOSWBW))$}*=>]a6=o'##DM24P\`dPdl9KLA
,,Q/Ljn>HD>Ph((j)9:VZKUY]K]d:6FGx))!,GcgYkosYs 1 1 ; ;DAS<T Uy}@IT@QT\\++DO<
 	
 X\
 	
 V MGs   F/.F46F9)r"   r#   r$   r%   r   r   r8   r   r   rc   r=   r   r   r   r   r  r   r&   r   r   r   r   r   r   >  s      M AEO=D &*D
") -1K)0 &*D
") -1K)0 '+E#* <@J8? ,0I(/ 9=I5< ?C;B /3H+28 
 
r   r   c               #     K   ddi} | }yw)z,
    Disables the accessibility domain.
    methodzAccessibility.disableNr   cmd_dictr   s     r   disabler    s     
 	)H >D   
c               #     K   ddi} | }yw)z
    Enables the accessibility domain which causes ``AXNodeId``'s to remain consistent between method calls.
    This turns on accessibility for the page, which can impact performance until accessibility is disabled.
    r  zAccessibility.enableNr   r  s     r   enabler    s      	(H >Dr  c              #    K   t               }| | j                         |d<   ||j                         |d<   ||j                         |d<   |||d<   d|d}|}|d   D cg c]  }t        j                  |       c}S c c}w w)a  
    Fetches the accessibility node and partial accessibility tree for this DOM node, if it exists.

    **EXPERIMENTAL**

    :param node_id: *(Optional)* Identifier of the node to get the partial accessibility tree for.
    :param backend_node_id: *(Optional)* Identifier of the backend node to get the partial accessibility tree for.
    :param object_id: *(Optional)* JavaScript object id of the node wrapper to get the partial accessibility tree for.
    :param fetch_relatives: *(Optional)* Whether to fetch this node's ancestors, siblings and children. Defaults to true.
    :returns: The ``Accessibility.AXNode`` for this DOM node, if it exists, plus its ancestors, siblings and children, if requested.
    r  backendNodeIdobjectIdfetchRelativeszAccessibility.getPartialAXTreer  paramsnodesr   r   r   r   )r   backend_node_id	object_idfetch_relativesr  r  r   r   s           r   get_partial_ax_treer     s     " &F"??,x""1"9"9";&..0z"#2 2H >D)-g7AFQ777s   A!B#B?Bc              #     K   t               }| | |d<   ||j                         |d<   d|d}|}|d   D cg c]  }t        j                  |       c}S c c}w w)a  
    Fetches the entire accessibility tree for the root Document

    **EXPERIMENTAL**

    :param depth: *(Optional)* The maximum depth at which descendants of the root node should be retrieved. If omitted, the full tree is returned.
    :param frame_id: *(Optional)* The frame for whose document the AX tree should be retrieved. If omitted, the root frame is used.
    :returns: 
    depthr
  zAccessibility.getFullAXTreer  r  r  )r"  r  r  r  r   r   s         r   get_full_ax_treer#    sp      &Fw$,,.y/H >D)-g7AFQ777s   7AAAc              #     K   t               }| | j                         |d<   d|d}|}t        j                  |d         S w)z
    Fetches the root node.
    Requires ``enable()`` to have been called previously.

    **EXPERIMENTAL**

    :param frame_id: *(Optional)* The frame in whose document the node resides. If omitted, the root frame is used.
    :returns: 
    r
  zAccessibility.getRootAXNoder  r0   r  )r  r  r  r   s       r   get_root_ax_noder%    sS      &F$,,.y/H >DDL))s   AAc              #    K   t               }| | j                         |d<   ||j                         |d<   ||j                         |d<   d|d}|}|d   D cg c]  }t        j                  |       c}S c c}w w)a  
    Fetches a node and all ancestors up to and including the root.
    Requires ``enable()`` to have been called previously.

    **EXPERIMENTAL**

    :param node_id: *(Optional)* Identifier of the node to get.
    :param backend_node_id: *(Optional)* Identifier of the backend node to get.
    :param object_id: *(Optional)* JavaScript object id of the node wrapper to get.
    :returns: 
    r  r  r  z#Accessibility.getAXNodeAndAncestorsr  r  r  )r   r  r  r  r  r   r   s          r   get_ax_node_and_ancestorsr'    s       &F"??,x""1"9"9";&..0z7H >D)-g7AFQ777s   AB A;8B c              #     K   t               }| j                         |d<   ||j                         |d<   d|d}|}|d   D cg c]  }t        j                  |       c}S c c}w w)a"  
    Fetches a particular accessibility node by AXNodeId.
    Requires ``enable()`` to have been called previously.

    **EXPERIMENTAL**

    :param id_:
    :param frame_id: *(Optional)* The frame in whose document the node resides. If omitted, the root frame is used.
    :returns: 
    idr
  zAccessibility.getChildAXNodesr  r  r  )id_r  r  r  r   r   s         r   get_child_ax_nodesr+     sp      &F;;=F4L$,,.y1H >D)-g7AFQ777s   AA)A$!A)c              #     K   t               }| | j                         |d<   ||j                         |d<   ||j                         |d<   |||d<   |||d<   d|d}|}|d   D cg c]  }t        j                  |       c}S c c}w w)	a  
    Query a DOM node's accessibility subtree for accessible name and role.
    This command computes the name and role for all nodes in the subtree, including those that are
    ignored for accessibility, and returns those that match the specified name and role. If no DOM
    node is specified, or the DOM node does not exist, the command returns an error. If neither
    ``accessibleName`` or ``role`` is specified, it returns all the accessibility nodes in the subtree.

    **EXPERIMENTAL**

    :param node_id: *(Optional)* Identifier of the node for the root to query.
    :param backend_node_id: *(Optional)* Identifier of the backend node for the root to query.
    :param object_id: *(Optional)* JavaScript object id of the node wrapper for the root to query.
    :param accessible_name: *(Optional)* Find nodes with this computed name.
    :param role: *(Optional)* Find nodes with this computed role.
    :returns: A list of ``Accessibility.AXNode`` matching the specified attributes, including nodes that are ignored for accessibility.
    r  r  r  accessibleNamer8   zAccessibility.queryAXTreer  r  r  )	r   r  r  accessible_namer8   r  r  r   r   s	            r   query_ax_treer/  :  s     . &F"??,x""1"9"9";&..0z"#2 v-H >D)-g7AFQ777s   A(B*B	BzAccessibility.loadCompletec                  .    e Zd ZU dZded<   edd       Zy)LoadCompletez
    **EXPERIMENTAL**

    The loadComplete event mirrors the load complete event sent by the browser to assistive
    technology when the web page has finished loading.
    r   r   c                @     | t         j                  |d               S )Nr   )r   r   r   r   s     r   r   zLoadComplete.from_jsonp  s!    !!$v,/
 	
r   N)r   r   r    r1  r"   r#   r$   r%   r   r&   r   r   r   r   r1  r1  d  s      L
 
r   r1  zAccessibility.nodesUpdatedc                  .    e Zd ZU dZded<   edd       Zy)NodesUpdatedz~
    **EXPERIMENTAL**

    The nodesUpdated event is sent every time a previously requested node has changed the in tree.
    ztyping.List[AXNode]r  c                f     | |d   D cg c]  }t         j                  |       c}      S c c}w )Nr  )r  r3  r   s      r   r   zNodesUpdated.from_json  s/    04W>16##A&>
 	
>s   .N)r   r   r    r6  r4  r   r   r   r6  r6  w  s!     
 
r   r6  )r    z0typing.Generator[T_JSON_DICT, T_JSON_DICT, None])NNNN)
r   typing.Optional[dom.NodeId]r  r  r  'typing.Optional[runtime.RemoteObjectId]r  r   r    ?typing.Generator[T_JSON_DICT, T_JSON_DICT, typing.List[AXNode]])NN)r"  ztyping.Optional[int]r  r  r    r:  r   )r  r  r    z2typing.Generator[T_JSON_DICT, T_JSON_DICT, AXNode])NNN)r   r8  r  r  r  r9  r    r:  )r*  r   r  r  r    r:  )NNNNN)r   r8  r  r  r  r9  r.  r}   r8   r}   r    r:  )#
__future__r   utilr   r   dataclassesr   enumtyping r   r	   r
   r!   r   Enumr)   rR   rb   rz   r   r   r   r   r   r  r  r   r#  r%  r'  r+  r/  r1  r6  r   r   r   <module>rB     sz   # * !     9s 9$)) <		 &dii . @
 @
 @
F 
 
 
8 
 
 
* "
 "
 "
J6TYY 6r W
 W
 W
t 04>B=A15	8,8;8 ;8 /	8
 
G8F '+268#8/8 
G86 37*/*	9*0 04>B=A8,8;8 ;8 
G	8B 3788/8 
G86 04>B=A04%)'8,'8;'8 ;'8 .	'8
 #'8 
G'8T )*

 
  +
" )*

 
  +
r   