<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet"
        integrity="sha384-GLhlTQ8iRABdZLl6O3oVMWSktQOp6b7In1Zl3/Jr59b6EGGoI1aFkw7cmDA6j6gD" crossorigin="anonymous">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.3.0/css/all.min.css"
        integrity="sha512-SzlrxWUlpfuzQ+pcUCosxcglQRNAq/DZjVsC0lE40xsADsfeQoEypE+enwcOiGjk/bSuGGKHEyjSoQ1zVisanQ=="
        crossorigin="anonymous" referrerpolicy="no-referrer" />
</head>
</html>
3
Pfa7                 @   s  d dl mZmZmZ d dlmZ d dlZd dlmZm	Z	 ddl
mZmZmZ ddl
mZmZmZ ddlmZmZ d d	lmZ d
jed Zejde d Zejde d Zi ZeddkZxeej D ]p\Z Z!eree!dkse ree!dkrqe!dkree!dkrej"e!Z!ne#e!Z!e!eks4e j$ re ee!< qW dd Z%ede% dddZ&G dd de'Z(G dd de)Z*dS )    )absolute_importdivisionunicode_literals)	text_typeN)register_errorxmlcharrefreplace_errors   )voidElementsbooleanAttributesspaceCharacters)rcdataElementsentitiesxmlEntities)treewalkers_utils)escape z"'=<>`[]u_    	
 /`  ᠎᠏               　]u   􏿿   &c       
      C   s"  t | ttfrg }g }d}xt| j| j| j D ]n\}}|rFd}q4|| j }tj| j|t	| j|d g rtj
| j||d  }d}nt|}|j| q4W x^|D ]V}tj|}	|	r|jd |j|	 |	jds|jd q|jdt|dd    qW dj|| jfS t| S d S )NFr   Tr   ;z&#x%s;r   )
isinstanceUnicodeEncodeErrorUnicodeTranslateError	enumerateobjectstartendr   ZisSurrogatePairminsurrogatePairToCodepointordappend_encode_entity_mapgetendswithhexjoinr   )
excresZ
codepointsskipicindexZ	codepointZcpe r/    /usr/lib/python3.6/serializer.pyhtmlentityreplace_errors*   s0     
"




r1   htmlentityreplaceetreec             K   s$   t j|}tf |}|j|| |S )N)r   ZgetTreeWalkerHTMLSerializerrender)inputZtreeencodingZserializer_optsZwalkersr/   r/   r0   	serializeJ   s    

r9   c               @   s~   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d Zdd Zdd Zd"ddZd#ddZd$dd ZdS )%r4   legacy"TFquote_attr_values
quote_charuse_best_quote_charomit_optional_tagsminimize_boolean_attributesuse_trailing_solidusspace_before_trailing_solidusescape_lt_in_attrsescape_rcdataresolve_entitiesalphabetical_attributesinject_meta_charsetstrip_whitespacesanitizec          	   K   sz   t |t | j }t|dkr2tdtt| d|kr@d| _x(| jD ]}t| ||j|t	| | qHW g | _
d| _dS )a6	  Initialize HTMLSerializer.

        Keyword options (default given first unless specified) include:

        inject_meta_charset=True|False
          Whether it insert a meta element to define the character set of the
          document.
        quote_attr_values="legacy"|"spec"|"always"
          Whether to quote attribute values that don't require quoting
          per legacy browser behaviour, when required by the standard, or always.
        quote_char=u'"'|u"'"
          Use given quote character for attribute quoting. Default is to
          use double quote unless attribute value contains a double quote,
          in which case single quotes are used instead.
        escape_lt_in_attrs=False|True
          Whether to escape < in attribute values.
        escape_rcdata=False|True
          Whether to escape characters that need to be escaped within normal
          elements within rcdata elements such as style.
        resolve_entities=True|False
          Whether to resolve named character entities that appear in the
          source tree. The XML predefined entities &lt; &gt; &amp; &quot; &apos;
          are unaffected by this setting.
        strip_whitespace=False|True
          Whether to remove semantically meaningless whitespace. (This
          compresses all whitespace to a single space except within pre.)
        minimize_boolean_attributes=True|False
          Shortens boolean attributes to give just the attribute value,
          for example <input disabled="disabled"> becomes <input disabled>.
        use_trailing_solidus=False|True
          Includes a close-tag slash at the end of the start tag of void
          elements (empty elements whose end tag is forbidden). E.g. <hr/>.
        space_before_trailing_solidus=True|False
          Places a space immediately before the closing slash in a tag
          using a trailing solidus. E.g. <hr />. Requires use_trailing_solidus.
        sanitize=False|True
          Strip all unsafe or unknown constructs from output.
          See `html5lib user documentation`_
        omit_optional_tags=True|False
          Omit start/end tags that are optional.
        alphabetical_attributes=False|True
          Reorder attributes to be in alphabetical order.

        .. _html5lib user documentation: http://code.google.com/p/html5lib/wiki/UserDocumentation
        r   z2__init__() got an unexpected keyword argument '%s'r=   FN)	frozensetoptionslen	TypeErrornextiterr>   setattrr$   getattrerrorsstrict)selfkwargsZunexpected_argsattrr/   r/   r0   __init__p   s    .zHTMLSerializer.__init__c             C   s*   t |tst| jr"|j| jdS |S d S )Nr2   )r   r   AssertionErrorr7   encode)rT   stringr/   r/   r0   rY      s    zHTMLSerializer.encodec             C   s*   t |tst| jr"|j| jdS |S d S )NrS   )r   r   rX   r7   rY   )rT   rZ   r/   r/   r0   encodeStrict   s    zHTMLSerializer.encodeStrictNc             c   s  || _ d}g | _|r0| jr0ddlm} |||}| jrJddlm} ||}| jrdddlm} ||}| j	r~ddl
m} ||}| jrddlm} ||}xR|D ]H}|d }|dkr`d|d  }|d r|d	|d  7 }n|d
 r|d7 }|d
 rJ|d
 jddkr0|d
 jddkr*| jd d}nd}|d||d
 |f 7 }|d7 }| j|V  q|d5kr|dksz|r|r|d jddkr| jd | j|d V  n| jt|d V  q|d6kr|d }	| jd|	 V  |	tkr| j rd}n|r| jd x|d j D ]\\}
}}|}|}| jdV  | j|V  | j s|tj|	t kr"|tjdt kr"| jdV  | jdkst|dkrd}n@| jd krtj|d k	}n$| jd!krtj|d k	}ntd"|jd#d$}| j r|jd%d&}|r| j!}| j"rTd|kr<d|kr<d}nd|krTd|krTd}|dkrl|jdd'}n|jdd(}| j|V  | j|V  | j|V  n| j|V  q"W |	t#kr| j$r| j%r| jd)V  n| jd*V  | jdV  q|d+kr6|d }	|	tkrd}n|r$| jd | jd,|	 V  q|d-krx|d }|jd.dkrb| jd/ | jd0|d  V  q|d1kr|d }	|	d2 }|t&kr| jd3|	  | j'r|t(krt&| }nd4|	 }| j|V  q| j|d  qW d S )7NFr   )FiltertypeZDoctypez<!DOCTYPE %snameZpublicIdz PUBLIC "%s"ZsystemIdz SYSTEMr;   r   'zASystem identifer contains both single and double quote charactersz %s%s%s>
CharactersSpaceCharactersdataz</zUnexpected </ in CDATAStartTagEmptyTagz<%sTz+Unexpected child element of a CDATA element r   =alwaysspecr:   z?quote_attr_values must be one of: 'always', 'spec', or 'legacy'r   z&amp;<z&lt;z&#39;z&quot;z //ZEndTagz</%s>Commentz--zComment contains --z	<!--%s-->ZEntityr   zEntity %s not recognizedz&%s;)ra   rb   )rd   re   ))r7   rR   rG   Zfilters.inject_meta_charsetr\   rF   Zfilters.alphabeticalattributesrH   Zfilters.whitespacerI   Zfilters.sanitizerr?   Zfilters.optionaltagsfindserializeErrorr[   rY   r   r   rD   itemsr@   r
   r$   tupler<   rL   _quoteAttributeSpecsearch_quoteAttributeLegacy
ValueErrorreplacerC   r=   r>   r	   rA   rB   r   rE   r   )rT   
treewalkerr7   Zin_cdatar\   tokenr]   Zdoctyper=   r^   _Z	attr_nameZ
attr_valuekvZ
quote_attrrc   keyr/   r/   r0   r9      s    


















zHTMLSerializer.serializec             C   s2   |rdj t| j||S dj t| j|S d S )N    r   )r'   listr9   )rT   rv   r7   r/   r/   r0   r5   ?  s    zHTMLSerializer.renderXXX ERROR MESSAGE NEEDEDc             C   s   | j j| | jrtd S )N)rR   r"   rS   SerializeError)rT   rc   r/   r/   r0   rn   E  s    zHTMLSerializer.serializeError)r<   r=   r>   r?   r@   rA   rB   rC   rD   rE   rF   rG   rH   rI   )N)N)r~   )__name__
__module____qualname__r<   r=   r>   r?   r@   rA   rB   rC   rD   rE   rF   rG   rH   rI   rK   rW   rY   r[   r9   r5   rn   r/   r/   r/   r0   r4   Q   s6        8
 

r4   c               @   s   e Zd ZdZdS )r   zError in serialized treeN)r   r   r   __doc__r/   r/   r/   r0   r   L  s   r   )r3   N)+Z
__future__r   r   r   Zpip._vendor.sixr   recodecsr   r   Z	constantsr	   r
   r   r   r   r   r   r   r   Zxml.sax.saxutilsr   r'   Z_quoteAttributeSpecCharscompilerq   rs   r#   rL   Z_is_ucs4r}   ro   ry   rz   r    r!   islowerr1   r9   r   r4   	Exceptionr   r/   r/   r/   r0   <module>   s:   
	

 |