
     hu                        d Z ddlmZ dgZddlZddlZddlZddlZddl	m
Z
 ddlmZ  G d d      Zej                   G d	 d
ej                  j                                Z G d dej                  j$                        Zy)zSelector is a single Selector of a CSSStyleRule SelectorList.
Partly implements http://www.w3.org/TR/css3-selectors/.

TODO
    - .contains(selector)
    - .isSubselector(selector)
    )annotationsSelectorN)
Deprecated)_SimpleNamespacesc                  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dZedz   ZdZy)	Constantszexpected constants z:type_selector universal HASH class attrib pseudo negation z"HASH class attrib pseudo negation element_namez0type_selector universal HASH class attrib pseudo)zprefix attribute	attributezcombinator ]value]z$PLUS - DIMENSION NUMBER STRING IDENTz )z combinatorN)__name__
__module____qualname____doc__Ssimple_selector_sequencesimple_selector_sequence2r
   negation_argnegationendattnameattname2attcombinatorattvalueattendexpressionstart
expression
combinator     U/var/www/api/v1/venv_getwork_v1/lib/python3.12/site-packages/cssutils/css/selector.pyr   r      s\     	A 	H  !E!LELK GH"MHF<O 4'JJr!   r   c                  @   e Zd ZU dZded<   ded<    ej                  d       Zded	<   	 d
Zded<   d
Z	ded<    ej                  d       Z
ded<   	 dZded<   d$dZd%dZd%dZd%dZd%dZd%dZd%dZd%dZd%dZd%dZd%dZd%dZd%d Zd%d!Zd%d"Zed#        Zy
)&Newz7
    Derives from _BaseClass to provide self._log.
    r   selectorzdict[str, str]
namespacesc                     dgS )N r    r    r!   r"   <lambda>zNew.<lambda>:   s    B4r!   )default_factoryz	list[str]contextNz
str | Noneelement_PREFIXc                     dgdz  S )Nr      r    r    r!   r"   r)   zNew.<lambda>>   s
    sQwr!   z	list[int]specificityTbool
wellformedc                N   | j                   d   }|r|d   |d   }}nd\  }}|dk(  r|dd | _        y| j                  | j                  dc}| _        n |dk(  rd|v r|j                  d      \  }}nd}|j                  d	      s|dk(  rd
|k(  r|r|dk(  rt        j
                  }	ny|| j                  j                  dd      }	nZ|dk(  rd}	nR| j                  |   }	|	Ad| _        | j                  j                  d|z  |t        j                  j                         y|	|f}|r|dk(  rZd|k(  r| j                  dxx   dz  cc<   n=d|k(  sd|k(  r| j                  dxx   dz  cc<   n|dv r| j                  dxx   dz  cc<   |s|dv r|| _        |j!                  ||||       y)aH  
        appends to seq

        namespace_prefix, IDENT will be combined to a tuple
        (prefix, name) where prefix might be None, the empty string
        or a prefix.

        Saved are also:
            - specificity definition: style, id, class/att, type
            - element: the element this Selector is for
              NNr-   N	universal|	-selectorattribute-selector*r(   Fz-Selector: No namespaceURI found for prefix %r)tokenerrornegationid   class[)type-selectornegation-type-selectorpseudo-element)rD   r8   )linecol)r+   r-   splitendswithcssutils_ANYNSr&   getr2   _logr>   xmldomNamespaceErrr0   r,   append)
selfseqvaltypr=   r+   rG   rH   prefixnamespaceURIs
             r"   rR   z
New.appendB   s    ,,r"a%(#D"ID#)s8DL<<##'<< FDLKC3J))C.KFCF LL%); C' }'  $222t<2!  $v6'&+DOIIOOJVS#!gg22 $ 
   %C 'Z/s{  #q(#C3#:  #q(#  
   #q(#3"@@DL

3$C
0r!   c                l    | j                  |t        j                  j                  |g      d|       |S )z(special implementation for comment tokenCOMMENTr=   )rR   rK   css
CSSCommentrS   expectedrT   r=   	tokenizers        r"   _COMMENTzNew._COMMENT   s,    C00%99ERr!   c                P   | j                   d   }|j                  d      r8|r4|d   j                  dvr#| j                  |t        j
                  d|       |S |dk7  rHd|v rD| j                  |t        j
                  d|       t        j                  t        j                  z   S |S )	Nr4   pseudo-+-r   r[   attribr   
descendant)r+   
startswithr   rR   r   r   r   r   )rS   r_   rT   r=   r`   r+   s         r"   _SzNew._S   s    ,,r"i(s2w}}D0Cc?O \X%=KKY[[,eKD55	8L8LLL Or!   c                @   | j                   d   }| j                  j                  |      }d|v rK| j                  ||d|       d|k(  rt        j
                  S t        j                  t        j                  z   S d| _        | j                  j                  d|       |S )Nr4   r8   r[   r?   FzSelector: Unexpected universal.r+   r%   _tokenvaluerR   r   r   r   r   r2   rN   r>   rS   r_   rT   r=   r`   r+   rU   s          r"   
_universalzNew._universal   s    ,,r"mm''.("KKS+UK;W$ ,,, ::Y=Q=QQQ $DOIIOO=UOKOr!   c                P   | j                   d   }| j                  j                  |      }d|k(  r)d|v r%| j                  ||d|       t        j
                  S d|v r%| j                  ||d|       t        j                  S d| _        | j                  j                  d|       |S )	Nr4   re   rW   r-   r[   type_selectorFz&Selector: Unexpected namespace prefix.)
r+   r%   rk   rR   r   r   r
   r2   rN   r>   rl   s          r"   _namespace_prefixzNew._namespace_prefix   s     ,,r"mm''.w8x#7KKS)5K9%%%(KKS)5K9)))#DOIIOODEOROr!   c                (   | j                   d   }| j                  j                  |d      | j                  j                  |      }}d|v r|dv rd}| j	                  ||||       |j                  d      r+| j                   j	                  |       t        j                  S d	|k(  rt        j                  S d|k(  rt        j                  S t        j                  t        j                  z   S d
| _        | j                  j                  d|       |S )a0  
        /* '::' starts a pseudo-element, ':' a pseudo-class */
        /* Exceptions: :first-line, :first-letter, :before and
        :after. */
        /* Note that pseudo-elements are restricted to one per selector
        and */
        /* occur only in the last simple_selector_sequence. */
        r4   T	normalizepseudo)z:first-linez:first-letterz:beforez:afterrF   r[   (r?   Fz%Selector: Unexpected start of pseudo.)r+   r%   rk   _typerR   rJ   r   r   r   r   r   r2   rN   r>   rS   r_   rT   r=   r`   r+   rU   rV   s           r"   _pseudozNew._pseudo   s     ,,r"MM%%et%<MM&  xKK&KKS#UK3||C  ##C( 000w& ,,,!S( +++ ::Y=Q=QQQ $DOIIOOC5OQOr!   c                J   | j                   d   }| j                  j                  |      | j                  j                  |      }}|j	                  d      r%| j                  ||||       t        j                  S d| _        | j                  j                  d|z  |       |S )Nr4   rc   r[   FSelector: Unexpected %s.)r+   r%   rk   rv   rg   rR   r   r   r2   rN   r>   rw   s           r"   _expressionzNew._expression   s    ,,r"==,,U3T]]5H5H5OSi(KKS#UK3'''#DOIIOO6<EOJOr!   c                V   | j                   d   }| j                  j                  |      | j                  j                  |      }}d|k(  r7d|v r3| j	                  |||j                         |       t        j                  S d| _        | j                  j                  d|z  |       |S )Nr4   re   r   r[   Frz   )r+   r%   rk   rv   rR   lowerr   r   r2   rN   r>   rw   s           r"   _attcombinatorzNew._attcombinator   s     ,,r"==,,U3T]]5H5H5OSw<8#;KKS#))+UK;%%%#DOIIOO6<EOJOr!   c                   | j                   d   }| j                  j                  |      | j                  j                  |      }}d|k(  r)d|v r%| j	                  ||||       t
        j                  S |j                  d      r%| j	                  ||||       t
        j                  S d| _	        | j                  j                  d|       |S )Nr4   re   r   r[   rc   FzSelector: Unexpected STRING.)r+   r%   rv   _stringtokenvaluerR   r   r   rg   r   r2   rN   r>   )rS   r_   rT   r=   r`   r+   rV   rU   s           r"   _stringzNew._string  s    ,,r"==&&u-t}}/N/Nu/US w7h#6KKS#UK3### 	*KKS#UK3''' $DOIIOO:%OHOr!   c                   | j                   d   }| j                  j                  |      | j                  j                  |      }}d|k(  r)d|v r%| j	                  ||d|       t
        j                  S d|k(  r)d|v r%| j	                  ||d|       t
        j                  S d|k(  r%| j	                  ||d	|       t
        j                  S |j                  d
      r%| j	                  ||||       t
        j                  S d|v st
        j                  |k(  r6| j	                  ||d|       t
        j                  t
        j                  z   S d| _        | j                  j!                  d|       |S )Nr4   re   r   r;   r[   r   zattribute-valuer?   rE   rc   ro   rD   FzSelector: Unexpected IDENT.)r+   r%   rk   rv   rR   r   r   r   r   rg   r   r
   r   r   r2   rN   r>   rw   s           r"   _identz
New._ident%  sW   ,,r"==,,U3T]]5H5H5OS w;(#:KKS"6eKD*** W%8KKS"35KA### 7"KKS":%KH((( 	*KKS#UK3'''(I,B,Bh,NKKS/K?669M9MMM $DOIIOO9OGOr!   c                @   | j                   d   }| j                  j                  |      }d|v rK| j                  ||d|       d|k(  rt        j
                  S t        j                  t        j                  z   S d| _        | j                  j                  d|       |S )Nr4   rB   r[   r?   FzSelector: Unexpected class.rj   rl   s          r"   _classz
New._classK  s    ,,r"mm''.hKKS'K7W$ ,,, ::Y=Q=QQQ $DOIIOO9OGOr!   c                @   | j                   d   }| j                  j                  |      }d|v rK| j                  ||d|       d|k(  rt        j
                  S t        j                  t        j                  z   S d| _        | j                  j                  d|       |S )Nr4   HASHr@   r[   r?   FzSelector: Unexpected HASH.rj   rl   s          r"   _hashz	New._hash\  s    ,,r"mm''.XKKS$eK4W$ ,,, ::Y=Q=QQQ $DOIIOO8OFOr!   c                6   | j                   d   }| j                  j                  |      }d|k(  r}d|k(  rxd|v rt| j                  ||d|       | j                   j	                         }| j                   d   }d|k(  rt
        j                  S t
        j                  t
        j                  z   S d|k(  r.d|k(  r)d|v r%| j                  ||d	|       t
        j                  S d
|k(  rhd|k(  rcd
|v r_| j                  ||d|       | j                   j	                          | j                   d   }t
        j                  t
        j                  z   S |dv r|j                  d      rzddd}|dk(  rH|rF|d   j                  t
        j                  k(  r&|j                  d|||          t
        j                  S | j                  ||||   |       t
        j                  S d
|k(  r|j                  d      rxt
        j                  |k(  re| j                  ||d|       | j                   j	                          d|k(  rt
        j                  S t
        j                  t
        j                  z   S d|k(  rDd|v r@| j                  ||d|       | j                   j                  d       t
        j                   S |dv rzd|v rvdddd}|rF|d   j                  t
        j                  k(  r&|j                  d|||          t
        j                  S | j                  ||||   |       t
        j                  S d|k(  r?d| _        | j$                  j'                  dt(        j*                  j,                  |       |S d| _        | j$                  j'                  d|       |S ) Nr4   r   re   zattribute-endr[   r?   =r   equalsr   znegation-endrd   rc   plusminus)+-r   zfunction-endrF   rC   zattribute-startz+>~childzadjacent-siblingzfollowing-sibling)>r   ~,FzSelector: Single selector only.)r>   r=   zSelector: Unexpected CHAR.)r+   r%   rk   rR   popr   r   r   r   r   r   rg   r   r   replacer   r   r2   rN   r>   rO   rP   InvalidModificationErr)rS   r_   rT   r=   r`   r+   rU   _namess           r"   _charz	New._charm  sH   ,,r"mm''. #:(g-#/KKS/K?ll&&(Gll2&GW$ ,,, ::Y=Q=QQQ#:(g-,(2JKKS(%K8%%% #:*/C8OKKS.K>LLll2&G55	8L8LLL $;7--i8!0Fczcc"gmmy{{&BBVC[1 ''' CfSk?''' 3J""9-$$0 KKS.K>LL7* +++ 99I<P<PPP #:(h.KKS"35KALL)$$$%<LH4 '(F
 s2w}}	3BVC[1 555 CfSk?555#:#DOIIOO1gg44  
 O		4EBr!   c                   | j                   j                  |d      }d|v r@| j                  j                  d       | j                  ||d|       t        j
                  S d| _        | j                  j                  d|       |S )NTrr   r?   znegation-startr[   FzSelector: Unexpected negation.)	r%   rk   r+   rR   r   r   r2   rN   r>   )rS   r_   rT   r=   r`   rU   s         r"   	_negationzNew._negation  sw    mm'''>!LL
+KKS"2%K@)))#DOIIOO<EOJOr!   c                N    d| _         | j                  j                  d|       |S )zinvalidates selectorFzSelector: Unexpected ATKEYWORD.r[   )r2   rN   r>   r^   s        r"   
_atkeywordzNew._atkeyword  s#    		9Gr!   c                   i 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| j                  d| j                  d| j                  | j                  | j                  | j                  dS )NCHARrB   r   STRINGIDENTnamespace_prefixr?   pseudo-classrF   r8   NUMBER	DIMENSIONPREFIXMATCHSUFFIXMATCHSUBSTRINGMATCH	DASHMATCHINCLUDES)r   rZ   	ATKEYWORD)r   r   r   r   r   rp   r   rx   rm   r{   r~   rh   ra   r   rS   s    r"   productionszNew.productions  sD   
DJJ
T[[
 DJJ
 dll	

 T[[
  6 6
 
 DLL
 dll
 
 d&&
 ))
 4..
  4..!
" d11#
$ ,,%
& ++'
( }}-
 	
r!   r7   N)r   r   r   r   __annotations__dataclassesfieldr+   r,   r-   r0   r2   rR   ra   rh   rm   rp   rx   r{   r~   r   r   r   r   r   r   r   propertyr   r    r!   r"   r$   r$   2   s     ***<HGYH.GZGZ.[..OKOJQ1f
 "$%N
,$L""Tl
 
 
r!   r$   c                       e Zd ZdZd fd	Zd Zd Zd Zd Zd Z	 e
e	d	      Ze
d
        Z e
d d	      Zd Zd Zd Z e
eed	      Z e
d d	      Z e
d       Z ed      d        Z e
ed	      Z xZS )r   a  
    (cssutils) a single selector in a :class:`~cssutils.css.SelectorList`
    of a :class:`~cssutils.css.CSSStyleRule`.

    Format::

        # implemented in SelectorList
        selectors_group
          : selector [ COMMA S* selector ]*
          ;

        selector
          : simple_selector_sequence [ combinator simple_selector_sequence ]*
          ;

        combinator
          /* combinators can be surrounded by white space */
          : PLUS S* | GREATER S* | TILDE S* | S+
          ;

        simple_selector_sequence
          : [ type_selector | universal ]
            [ HASH | class | attrib | pseudo | negation ]*
          | [ HASH | class | attrib | pseudo | negation ]+
          ;

        type_selector
          : [ namespace_prefix ]? element_name
          ;

        namespace_prefix
          : [ IDENT | '*' ]? '|'
          ;

        element_name
          : IDENT
          ;

        universal
          : [ namespace_prefix ]? '*'
          ;

        class
          : '.' IDENT
          ;

        attrib
          : '[' S* [ namespace_prefix ]? IDENT S*
                [ [ PREFIXMATCH |
                    SUFFIXMATCH |
                    SUBSTRINGMATCH |
                    '=' |
                    INCLUDES |
                    DASHMATCH ] S* [ IDENT | STRING ] S*
                ]? ']'
          ;

        pseudo
          /* '::' starts a pseudo-element, ':' a pseudo-class */
          /* Exceptions: :first-line, :first-letter, :before and :after. */
          /* Note that pseudo-elements are restricted to one per selector and */
          /* occur only in the last simple_selector_sequence. */
          : ':' ':'? [ IDENT | functional_pseudo ]
          ;

        functional_pseudo
          : FUNCTION S* expression ')'
          ;

        expression
          /* In CSS3, the expressions are identifiers, strings, */
          /* or of the form "an+b" */
          : [ [ PLUS | '-' | DIMENSION | NUMBER | STRING | IDENT ] S* ]+
          ;

        negation
          : NOT S* negation_arg S* ')'
          ;

        negation_arg
          : type_selector | universal | HASH | class | attrib | pseudo
          ;

    c                    t         |           t        | j                        | _        d| _        || _        d| _        |r|| _        || _	        y)z
        :Parameters:
            selectorText
                initial value of this selector
            parent
                a SelectorList
            readonly
                default to False
        logN)r   r   r   r   )
super__init__r   rN   _Selector__namespaces_element_parent_specificityselectorText	_readonly)rS   r   parentreadonly	__class__s       r"   r   zSelector.__init__G  sI     	-$))<( ,D!r!   c                    | j                         r| j                  | j                         f}n| j                  }d| j                  j                   d|dS )Nzcssutils.css.z(selectorText=r   )_Selector__getNamespacesr   _getUsedNamespacesr   r   )rS   sts     r"   __repr__zSelector.__repr__]  sR    !##T%<%<%>?B""Bt~~667~bV1MMr!   c                    d| j                   j                  | j                  | j                  | j	                         t        |       fz  S )NzN<cssutils.css.%s object selectorText=%r specificity=%r _namespaces=%r at 0x%x>)r   r   r   r0   r   r@   r   s    r"   __str__zSelector.__str__d  sJ    ' ''!!  '')4
	
r!   c                    t               }| j                  D ]^  }|j                  |j                  }}|j	                  d      s|dk(  s2t        |t              sC|d   dvsK|j                  |d          ` |S )z3Return list of actually used URIs in this Selector.r:   r8   r   )Nr<   )setrT   typer   rJ   
isinstancetupleadd)rS   urisitemtype_rU   s        r"   _getUsedUriszSelector._getUsedUrisq  si    uHHDDJJ3E{+K'sE*F+-Q   r!   c                    | j                         }t        | j                        }t        | j                  j                               D ]  \  }}||v s|||<    |S )z%Return actually used namespaces only.r   )r   r   rN   list_namespacesitems)rS   usedurisr&   puris        r"   r   zSelector._getUsedNamespaces  sX    $$&&4995
4++1134FAsh #
1 5 r!   c                    	 | j                   j                  j                  j                  S # t        $ r | j
                  cY S w xY w)zEUse own namespaces if not attached to a sheet, else the sheet's ones.)r   
parentRuleparentStyleSheetr&   AttributeErrorr   r   s    r"   __getNamespaceszSelector.__getNamespaces  s>    	%<<**;;FFF 	%$$$	%s   ), AAzIf this Selector is attached to a CSSStyleSheet the namespaces of that sheet are mirrored here. While the Selector (or parent SelectorList or parentRule(s) of that are not attached a own dict of {prefix: namespaceURI} is used.)docc                    | j                   S )z*Effective element target of this selector.)r   r   s    r"   r,   zSelector.element  s     }}r!   c                    | j                   S r   )r   r   s    r"   r)   zSelector.<lambda>  s    T\\r!   zn(DOM) The SelectorList that contains this Selector or None if this Selector is not attached to a SelectorList.c                @    t         j                  j                  |       S )zReturn serialized format.)rK   serdo_css_Selectorr   s    r"   _getSelectorTextzSelector._getSelectorText  s    ||++D11r!   c                   | j                          | j                  |      \  }}t        j                  t              5  | j
                  j                  j                  j                  }ddd       | j                  |      }|s| j                  j                  d       y| j                  |      }t        | |      }| j                         }| j                  t         j"                  |||j$                        \  }}|xr |j&                  }t)        |j*                        dkD  s|s/d}| j                  j                  d| j-                  |      z         |dk(  r/d}| j                  j                  d	| j-                  |      z         |t         j"                  k(  r1|r/d}| j                  j                  d
| j-                  |      z         |r<t/        |d   j0                  d      r#|d   j0                  j3                         dk(  r|d= |rY|| _        |j6                  | _        t;        |j<                        | _        | jA                  |       | jC                         | _        yy# 1 sw Y   xY w)at  
        :param selectorText:
            parsable string or a tuple of (selectorText, dict-of-namespaces).
            Given namespaces are ignored if this object is attached to a
            CSSStyleSheet!

        :exceptions:
            - :exc:`~xml.dom.NamespaceErr`:
              Raised if the specified selector uses an unknown namespace
              prefix.
            - :exc:`~xml.dom.SyntaxErr`:
              Raised if the specified CSS string value has a syntax error
              and is unparsable.
            - :exc:`~xml.dom.NoModificationAllowedErr`:
              Raised if this rule is readonly.
        Nz Selector: No selectorText given.)r%   r&   )r_   rT   r`   r   rA   Fz,Selector: Invalid or incomplete selector: %sr
   z#Selector: No element name found: %sz(Selector: Cannot end with combinator: %sr4   stripr(   )"_checkReadonly_splitNamespacesOff
contextlibsuppressr   r   r   r   r&   
_tokenize2rN   r>   _prepare_tokensr$   _tempSeq_parser   r   r   r2   lenr+   	_valuestrhasattrr   r   r   r,   r   r   r0   r   _setSeqr   )rS   r   r&   r`   newnewseqr2   r_   s           r"   _setSelectorTextzSelector._setSelectorText  s   " 	 $(#;#;L#I j  0 //@@KKJ 1
 OOL1	IIOO>?((3	4J7 #{{77	  +  

H  2CNN
 s{{avJIIOO>.../
 ~%JIIOO5|8TT y999fJIIOO:.../ r
(('2r
  &&(B.r
  *DKKDM %coo 6DLL  $ 7 7 9D m 10s   +I))I3c                   g }|D ]  }|\  }}}}|dk(  r#|r!| j                  |d         dk(  r
|d||f|d<   3|dk(  r&|r$| j                  |d         dk(  rdd|z   ||f|d<   ^|dk(  r|r| j                  |d         j                  d      rj| j                  |d         j                  d      sG| j                  |d         j                  d      rd}nd	}|| j                  |d         |z   ||f|d<   |d
k(  r2|dk(  r-|r+d| j                  |d         k(  rdd|z   ||d   d   f|d<   )|d
k(  rm|rk| j                  |d         j                  d      rH| j                  |d         j                  d      rd}nd	}|| j                  |d         |z   ||f|d<   |dk(  r\|rZ| j                  |d         dk(  rC| j                  |d         j                  d      r d| j                  |d         |z   ||f|d<   |dk(  r|j	                  d|||f       |dk(  rt|rr| j                  |d         | j
                  j                  dfv rF| j                  |d         j                  d      dk(  r d| j                  |d         dz   ||f|d<   |dk(  r|j	                  d|||f       |j	                  |        t        |      S )aE  
        "*" -> type "universal"
        "*"|IDENT + "|" -> combined to "namespace_prefix"
        "|" -> type "namespace_prefix"
        "." + IDENT -> combined to "class"
        ":" + IDENT, ":" + FUNCTION -> pseudo-class
        FUNCTION "not(" -> negation
        "::" + IDENT, "::" + FUNCTION -> pseudo-element
        :r4   z::r   .rB   ru   rF   r   FUNCTIONznot(r?   r6   r<   r   r9   r8   )	rk   rg   rJ   rv   rR   _prodsr   finditer)rS   r`   tokenstrV   rU   linrH   s           r"   r   zSelector._prepare_tokens  s    A!"Cc3czf)9)9&*)E)L!4c2r
Ft/?/?r
/Ks/R%sSy#s;r
w$$VBZ0;;C@((4==cB ##F2J/::4@(A&A!1!1&*!=!CS#Nr
 z!6M4++F2J77(#)S&*Q-Hr
z!$$VBZ0;;C@ ##F2J/::4@(A&A!1!1&*!=!CS#Nr
 s
JJvbz*.@@$$VBZ099#>  $$VBZ036	r
 {Cc:; s
JJvbz*t{{/@/@+.NN$$VBZ055c:b@ '$$VBZ036	r
 13SAB a Y \ F|r!   z:(DOM) The parsable textual representation of the selector.c                    | j                   S r   )r   r   s    r"   r)   zSelector.<lambda>_  s
    T&&r!   a  Specificity of this selector (READONLY).
                Tuple of (a, b, c, d) where:

                a
                    presence of style in document, always 0 if not used on a
                    document
                b
                    number of ID selectors
                c
                    number of .class selectors
                d
                    number of Element (type) selectorsc                >    t        t        | j                              S r   )r1   r   rT   r   s    r"   r)   zSelector.<lambda>n  s    tCM':r!   zUse property parent insteadc                    | j                   S r   )r   r   s    r"   _getParentListzSelector._getParentListp  s    {{r!   z'DEPRECATED, see property parent instead)NNF)r   r   r   r   r   r   r   r   r   r   r   r   r,   r   r   r   r   r   r0   r2   r   r  
parentList__classcell__)r   s   @r"   r   r     s    Sj",N
% !K   !F2R:hYv KL &:K  :;J-. / ..WXJr!   )r   
__future__r   __all__r   r   xml.domrO   rK   cssutils.helperr   cssutils.utilr   r   	dataclassutil
_BaseClassr$   Base2r   r    r!   r"   <module>r     s{    #,     & + 8 {
(--
"
" {
 {
|CYx}}"" CYr!   