+
    B*jT                        R t ^ RIt^ RIt^ RIHt ^ RIHt R.t]P                  ! R4      t
]P                  ! R4      t]P                  ! R4      t]P                  ! R4      t]P                  ! R	4      t]P                  ! R
4      t]P                  ! R4      t]P                  ! R4      t]P                  ! R4      t]P                  ! R4      t]P                  ! R4      t]P                  ! R4      t]P                  ! R]P,                  4      t]P                  ! R]P,                  4      t]P                  ! R]P,                  4      t]P                  ! R4      t]P                  ! R4      tR tR t ! R R]P<                  4      tR# )zA parser for HTML and XHTML.N)unescape)html5
HTMLParserz[&<]z
&[a-zA-Z#]z%&([a-zA-Z][-.a-zA-Z0-9]*)[^a-zA-Z0-9]z)&#(?:[0-9]+|[xX][0-9a-fA-F]+)[^0-9a-fA-F]z&#(?:[0-9]|[xX][0-9a-fA-F])z6&(#[0-9]+|#[xX][0-9a-fA-F]+|[a-zA-Z][a-zA-Z0-9]*)[;=]?z	<[a-zA-Z]z
</[a-zA-Z]>z--!?>z-?>z0([a-zA-Z][^\t\n\r\f />]*)(?:[\t\n\r\f ]|/(?!>))*a{  
  (
    (?<=['"\t\n\r\f /])[^\t\n\r\f />][^\t\n\r\f /=>]*  # attribute name
   )
  ([\t\n\r\f ]*=[\t\n\r\f ]*        # value indicator
    ('[^']*'                        # LITA-enclosed value
    |"[^"]*"                        # LIT-enclosed value
    |(?!['"])[^>\t\n\r\f ]*         # bare value
    )
   )?
  (?:[\t\n\r\f ]|/(?!>))*           # possibly followed by a space
a  
  [a-zA-Z][^\t\n\r\f />]*           # tag name
  [\t\n\r\f /]*                     # optional whitespace before attribute name
  (?:(?<=['"\t\n\r\f /])[^\t\n\r\f />][^\t\n\r\f /=>]*  # attribute name
    (?:[\t\n\r\f ]*=[\t\n\r\f ]*    # value indicator
      (?:'[^']*'                    # LITA-enclosed value
        |"[^"]*"                    # LIT-enclosed value
        |(?!['"])[^>\t\n\r\f ]*     # bare value
       )
     )?
    [\t\n\r\f /]*                   # possibly followed by a space
   )*
   >?
aF  
  <[a-zA-Z][^\t\n\r\f />\x00]*       # tag name
  (?:[\s/]*                          # optional whitespace before attribute name
    (?:(?<=['"\s/])[^\s/>][^\s/=>]*  # attribute name
      (?:\s*=+\s*                    # value indicator
        (?:'[^']*'                   # LITA-enclosed value
          |"[^"]*"                   # LIT-enclosed value
          |(?!['"])[^>\s]*           # bare value
         )
        \s*                          # possibly followed by a space
       )?(?:\s|/(?!>))*
     )*
   )?
  \s*                                # trailing whitespace
z#</\s*([a-zA-Z][-.a-zA-Z0-9:_]*)\s*>c                     V P                  ^ 4      pVP                  R4      '       d   \        V4      # VP                  R4      '       g   VR,          \        9   d   \        V4      # V# )    &#=:   NN)group
startswithr   endswithhtml5_entities)matchrefs   & (/usr/local/lib/python3.14/html/parser.py_replace_attr_charrefr   ]   sS    
++a.C
~~d} <<RN!:}J    c                 6    \         P                  \        V 4      # N)attr_charrefsubr   )ss   &r   _unescape_attrvaluer   i   s    1155r   c                      a a ] tR t^mt oRtR#tR$tRRRR/V 3R lltV 3R ltR t	R	 t
R
tR tRR/R ltR tR%R ltR tR tR%R ltR&R ltR tR tR tR tR tR tR tR tR tR tR tR tR  t R! t!R"t"Vt#V ;t$# )'r   a  Find tags and other markup and call handler functions.

Usage:
    p = HTMLParser()
    p.feed(data)
    ...
    p.close()

Start tags are handled by calling self.handle_starttag() or
self.handle_startendtag(); end tags by self.handle_endtag().  The
data between tags is passed from the parser to the derived class
by calling self.handle_data() with the data as argument (the data
may be split up in arbitrary chunks).  If convert_charrefs is
True the character references are converted automatically to the
corresponding Unicode character (and self.handle_data() is no
longer split in chunks), otherwise they are passed by calling
self.handle_entityref() or self.handle_charref() with the string
containing respectively the named or numeric reference as the
argument.
convert_charrefsT	scriptingFc               \   < \         SV `  4        Wn        W n        V P	                  4        R# )aJ  Initialize and reset this instance.

If convert_charrefs is true (the default), all character references
are automatically converted to the corresponding Unicode characters.

If *scripting* is false (the default), the content of the
``noscript`` element is parsed normally; if it's true,
it's returned as is without being parsed.
N)super__init__r   r   reset)selfr   r   	__class__s   &$$r   r   HTMLParser.__init__   s$     	 0"

r   c                   < RV n         RV n        \        V n        RV n        RV n        RV n        \        SV `!  4        R# )z1Reset this instance.  Loses all unprocessed data. z???NT)	rawdatalasttaginteresting_normalinteresting
cdata_elem_support_cdata
_escapabler   r    )r!   r"   s   &r   r    HTMLParser.reset   s8    -"r   c                X    V P                   V,           V n         V P                  ^ 4       R# )zyFeed data to the parser.

Call this as often as you want, with as little or as much text
as you want (may include '\n').
N)r&   goaheadr!   datas   &&r   feedHTMLParser.feed   s     ||d*Qr   c                (    V P                  ^4       R# )zHandle any buffered data.N)r/   r!   s   &r   closeHTMLParser.close   s    Qr   Nc                    V P                   # )z)Return full source of start tag: '<...>'.)_HTMLParser__starttag_textr5   s   &r   get_starttag_textHTMLParser.get_starttag_text   s    ###r   	escapablec                  VP                  4       V n        W n        V P                  R 8X  d   \        P                  ! R4      V n        R# V'       de   V P                  '       gS   \        P                  ! RV P                  ,          \        P                  \        P                  ,          4      V n        R# \        P                  ! RV P                  ,          \        P                  \        P                  ,          4      V n        R# )	plaintextz\zz&|</%s(?=[\t\n\r\f />])z</%s(?=[\t\n\r\f />])N)	lowerr*   r,   recompiler)   r   
IGNORECASEASCII)r!   elemr<   s   &&$r   set_cdata_modeHTMLParser.set_cdata_mode   s    **,#??k)!zz%0Dt444!zz*Dt*V*,--*@ BD  "zz*BT__*T*,--*@ BDr   c                8    \         V n        R V n        RV n        R # )NT)r(   r)   r*   r,   r5   s   &r   clear_cdata_modeHTMLParser.clear_cdata_mode   s    -r   c                    Wn         R# )a  Enable or disable support of the CDATA sections.
If enabled, "<[CDATA[" starts a CDATA section which ends with "]]>".
If disabled, "<[CDATA[" starts a bogus comments which ends with ">".

This method is not called by default. Its purpose is to be called
in custom handle_starttag() and handle_endtag() methods, with
value that depends on the adjusted current node.
See https://html.spec.whatwg.org/multipage/parsing.html#markup-declaration-open-state
for details.
N)r+   )r!   flags   &&r   _set_support_cdataHTMLParser._set_support_cdata   s
     #r   c                J   V P                   p^ p\        V4      pW48  Ed   V P                  '       d   V P                  '       gs   VP	                  RV4      pV^ 8  dY   VP                  R\        W4^",
          4      4      pV^ 8  d.   \        P                  ! R4      P                  W&4      '       g   EMTpMJV P                  P                  W#4      pV'       d   VP                  4       pMV P                  '       d   EMTpW58  dU   V P                  '       d0   V P                  '       d   V P                  \        W#V 4      4       MV P                  W#V 4       V P                  W54      pW48X  d   EM3VP                   pV! RV4      '       Ed   \"        P%                  W#4      '       d   V P'                  V4      p	MV! RV4      '       d   V P)                  V4      p	MV! RV4      '       d   V P+                  V4      p	MuV! RV4      '       d   V P-                  V4      p	MTV! RV4      '       d   V P/                  V4      p	M3V^,           V8  g	   V'       d   V P                  R4       V^,           p	MEM3V	^ 8  Ed   V'       g   EM!\"        P%                  W#4      '       d   EMV! RV4      '       d[   V^,           V8X  d   V P                  R4       EMt\0        P%                  W#4      '       d   EMWV P3                  W#^,           R 4       EM;V! RV4      '       dY   TpR F5  p
VP5                  W^,           4      '       g   K#  V\        V
4      ,          p M	  V P3                  W#^,           V 4       MV! R	V4      '       d.   V P6                  '       d   V P9                  W#^,           R 4       MW#V^	,            P;                  4       R
8X  d   V P=                  W#^,           R 4       M_V! RV4      '       d   V P3                  W#^,           R 4       M5V! RV4      '       d   V P?                  W#^,           R 4       M\A        R4      hTp	V P                  W94      pEKC  V! RV4      '       Ed   \B        P%                  W#4      pV'       dh   VPE                  4       ^R pV PG                  V4       VPI                  4       p	V! RV	^,
          4      '       g
   V	^,
          p	V P                  W94      pEK  \J        P%                  W#4      pV'       d8   V'       d.   V PG                  W#^,           R 4       V P                  W44      pEMdEMbV^,           V8  d-   V P                  R4       V P                  W3^,           4      pEKe  EM&V! RV4      '       Ed   \L        P%                  W#4      pV'       df   VPE                  ^4      pV PO                  V4       VPI                  4       p	V! RV	^,
          4      '       g
   V	^,
          p	V P                  W94      pEK  \P        P%                  W#4      pV'       d6   V'       d-   V PO                  W#^,           R 4       V P                  W44      pMCMBV^,           V8  d-   V P                  R4       V P                  W3^,           4      pEK  MQ R4       hV'       dl   W48  df   V P                  '       d0   V P                  '       d   V P                  \        W#V 4      4       MV P                  W#V 4       V P                  W44      pW#R V n         R# )r   <&z[\t\n\r\f ;]</<!--<?<!N	<![CDATA[	<!doctypezwe should not get here!r   ;zinteresting.search() lied)z--!z---))r&   lenr   r*   findrfindmaxr@   rA   searchr)   startr,   handle_datar   	updateposr   starttagopenr   parse_starttagparse_endtagparse_commentparse_piparse_html_declaration
endtagopenhandle_commentr   r+   unknown_declr?   handle_decl	handle_piAssertionErrorcharrefr   handle_charrefendincomplete_charref	entityrefhandle_entityref
incomplete)r!   rp   r&   injampposr   r   ksuffixnames   &&          r   r/   HTMLParser.goahead   s   ,,Le$$$T___LLa(q5 %]]3At=F!JJ7>>wOOA((//;AAu(((T___$$Xgl%;<$$Wq\2q$Avu ++J#q!!%%g11++A.Aa(())!,A****1-Aa((a(Aa((33A6A!eq[C$$S)AAq5#))'55#D!,,q5A: ,,T2'--g99  !//!>#FA..&8F&//!<< !S[ 0 % '9 ++GaCN;#K338K8K8K))'A#$-8 1Q3--/;>((17#D!,,++GaCDM:#D!,,wst}5,-FGGANN1(D!$$g1 ;;=2.D''-		A%c1Q3//Eq,A*00<++GaCDM: NN10UQY $$T*qa%0AC##!3 ;;q>D))$/		A%c1Q3//Eq,A"((4--gcdm< NN10UQY $$S)qa%0A555q15$$$  'A,!78  1.q$Ar{r   c                @   V P                   pW!V^,            R8X  g   Q R4       hW!V^,            R8X  d   V P                  V4      # W!V^	,            R8X  dX   V P                  '       dF   VP                  RV^	,           4      pV^ 8  d   R# V P	                  W!^,           V 4       V^,           # W!V^	,            P                  4       R8X  dF   VP                  RV^	,           4      pVR8X  d   R# V P                  W!^,           V 4       V^,           # V P                  V4      # )	   rT   z+unexpected call to parse_html_declaration()rR   rU   z]]>rV   r   rY   )r&   re   r+   r[   rj   r?   rk   parse_bogus_comment)r!   ru   r&   rw   gtposs   &&   r   rg   !HTMLParser.parse_html_declarationj  s   ,,1~% 	D )C 	D%QqS>V#%%a((qs^{*t/B/B/BUAaC(A1u	gc1o.q5Lqs^!!#{2LLac*E{	WqS/07N++A..r   c                p   V P                   pVP                  R V4      '       g   Q R4       h\        P                  W1^,           4      pV'       g'   \        P                  W1^,           4      pV'       g   R# V'       d+   VP                  4       pV P                  W1^,           V 4       VP                  4       # )rR   z"unexpected call to parse_comment()rY   )	r&   r   commentcloser^   commentabruptcloser   r_   ri   rp   )r!   ru   reportr&   r   rw   s   &&&   r   re   HTMLParser.parse_comment  s    ,,!!&!,,R.RR,##GqS1&,,Wc:E	A!Q0yy{r   c                    V P                   pW1V^,            R9   g   Q R4       hVP                  RV^,           4      pVR8X  d   R# V'       d   V P                  W1^,           V 4       V^,           # )r~   z(unexpected call to parse_bogus_comment()r   )rT   rQ   rY   )r&   r[   ri   )r!   ru   r   r&   poss   &&&  r   r   HTMLParser.parse_bogus_comment  ss    ,,1~- 	I 1H 	I-ll3!$"9I!C 01Qwr   c                   V P                   pW!V^,            R8X  g   Q R4       h\        P                  W!^,           4      pV'       g   R# VP                  4       pV P	                  W!^,           V 4       VP                  4       pV# )r~   rS   zunexpected call to parse_pi()rY   )r&   picloser^   r_   rl   rp   r!   ru   r&   r   rw   s   &&   r   rf   HTMLParser.parse_pi  sp    ,,1~%F'FF%w!,IKKMwsA'IIKr   c                h   R V n         V P                  V4      pV^ 8  d   V# V P                  pW1V V n         . p\        P	                  W1^,           4      pV'       g   Q R4       hVP                  4       pVP                  ^4      P                  4       ;V n        pWb8  d   \        P	                  W64      pV'       g   MVP                  ^^^4      w  rpV
'       g   R pM<VR,          Ru;8X  d   VRR  8X  g   M VR,          Ru;8X  d   VRR  8X  d	   M MV^R pV'       d   \        V4      pVP                  V	P                  4       V34       VP                  4       pK  W6V P                  4       pVR9  d   V P                  W1V 4       V# VP                  R4      '       d   V P                  Wt4       V# V P!                  Wt4       WpP"                  9   g!   V P$                  '       d   VR8X  g   VR8X  d   V P'                  VRR	7       V# WpP(                  9   d   V P'                  VR
R	7       V# )Nz#unexpected call to parse_starttag():Nr
   N'"/>noscriptr>   F)r<   TrY   )r   r   )r9   check_for_whole_start_tagr&   tagfind_tolerantr   rp   r   r?   r'   attrfind_tolerantr   appendstripr`   r   handle_startendtaghandle_starttagCDATA_CONTENT_ELEMENTSr   rE   RCDATA_CONTENT_ELEMENTS)r!   ru   endposr&   attrsr   ry   tagmattrnamerest	attrvaluerp   s   &&           r   rc   HTMLParser.parse_starttag  s     $//2A:M,,&0  &&w!4;;;uIIK"[[^1133sj!''3A()1a(8%HI 	2$8)BC.82#7237%aO	/	:	LL(..*I67A%%'k!Wv./M<<##C/    ,222C:$5{"##C5#9  444##C4#8r   c                    V P                   p\        P                  W!^,           4      pV'       g   Q hVP                  4       pW$^,
          ,          R8w  d   R# V# )r
   r   rY   )r&   locatetagendr   rp   r   s   &&   r   r   $HTMLParser.check_for_whole_start_tag  sI    ,,""7aC0uIIKQ3<3Ir   c                   V P                   pW!V^,            R8X  g   Q R4       hVP                  RV^,           4      ^ 8  d   R# \        P                  W!4      '       g2   W!^,           V^,            R8X  d
   V^,           # V P	                  V4      # \
        P                  W!^,           4      pV'       g   Q hVP                  4       pW$^,
          ,          R8w  d   R# \        P                  W!^,           4      pV'       g   Q hVP                  ^4      P                  4       pV P                  V4       V P                  4        V# )r~   rQ   zunexpected call to parse_endtagr   rY   )r&   r[   rh   r   r   r   rp   r   r   r?   handle_endtagrH   )r!   ru   r&   r   rw   r   s   &&    r   rd   HTMLParser.parse_endtag  s    ,,1~%H'HH%<<QqS!A%I++s1Q33&s
//22""7aC0uIIKQ3<3I !&&w!4ukk!n""$3r   c                J    V P                  W4       V P                  V4       R # r   )r   r   r!   r   r   s   &&&r   r   HTMLParser.handle_startendtag  s    S(3r   c                    R # r    r   s   &&&r   r   HTMLParser.handle_starttag	      r   c                    R # r   r   )r!   r   s   &&r   r   HTMLParser.handle_endtag  r   r   c                    R # r   r   r!   r{   s   &&r   ro   HTMLParser.handle_charref  r   r   c                    R # r   r   r   s   &&r   rs   HTMLParser.handle_entityref  r   r   c                    R # r   r   r0   s   &&r   r`   HTMLParser.handle_data  r   r   c                    R # r   r   r0   s   &&r   ri   HTMLParser.handle_comment  r   r   c                    R # r   r   )r!   decls   &&r   rk   HTMLParser.handle_decl!  r   r   c                    R # r   r   r0   s   &&r   rl   HTMLParser.handle_pi%  r   r   c                    R # r   r   r0   s   &&r   rj   HTMLParser.unknown_decl(  r   r   )	__starttag_textr,   r+   r*   r   r)   r'   r&   r   )scriptstylexmpiframenoembednoframes)textareatitle)T)r
   )%__name__
__module____qualname____firstlineno____doc__r   r   r   r    r2   r6   r9   r:   rE   rH   rL   r/   rg   re   r   rf   rc   r   rd   r   r   r   ro   rs   r`   ri   rk   rl   rj   __static_attributes____classdictcell____classcell__)r"   __classdict__s   @@r   r   r   m   s     0 Y34 5  O$
B 
B
# O#h/2		.d< 
 r   ) r   r@   _markupbasehtmlr   html.entitiesr   r   __all__rA   r(   rt   rr   rn   rq   r   rb   rh   r   r   r   r   VERBOSEr   r   locatestarttagend_tolerant	endendtag
endtagfindr   r   
ParserBaser   r   r   r   <module>r      si   " 
   1 . ZZ' ZZ%
JJ>?	
**@
AZZ => zzSTzz+&ZZ%

**S/zz(#ZZ'  ::QR JJ   ZZ  zz  ZZ   ZZ ) ZZ  JJsO	ZZ>?

6|'' |r   