+
    bIiG              
       *   R t ^ t ^ t^ RItR t]P
                  ! ^^^^]R^ R7      t^ RR/ 3R lt ! R R4      t	]	! 4       t	Rt
^ t^tR	t]! ]4      tR
t. ROtR t^ R]3R lt]'       d   ]tR t^ tR t^ ^]3R ltR tRR ltRR lt]R8X  d   ]! ^R7       ^ RIt^ RIt^ RIHt ^ RIt]! 4       t ^ t!]PD                  R,           F  t#]PH                  PK                  ]#4      '       g   ]&! R4       K.  ]'! ]#4      ;_uu_ 4       t(](PS                  4       t*RRR4       ]&! R]#: R]! ]*4       24       ]! ]*^R7       ]!^,          t!K  	  ]!'       d   ]&! R]! 4       ] ,
          R R24       R# R# R#   ] d    ^t ELMi ; i  + '       g   i     Ls; i)at  Very simple and fast XML parser, used for intra-paragraph text.

Devised by Aaron Watters in the bad old days before Python had fast
parsers available.  Constructs the lightest possible in-memory
representation; parses most files we have seen in pure python very
quickly.

The output structure is the same as the one produced by pyRXP,
our validating C-based parser, which was written later.  It will
use pyRXP if available.

This is used to parse intra-paragraph markup.

Example parse::

    <this type="xml">text <b>in</b> xml</this>

    ( "this",
      {"type": "xml"},
      [ "text ",
        ("b", None, ["in"], None),
        " xml"
        ]
       None )

    { 0: "this"
      "type": "xml"
      1: ["text ",
          {0: "b", 1:["in"]},
          " xml"]
    }

Ie, xml tag translates to a tuple:
 (name, dictofattributes, contentlist, miscellaneousinfo)

where miscellaneousinfo can be anything, (but defaults to None)
(with the intention of adding, eg, line number information)

special cases: name of "" means "top level, no containing tag".
Top level parse always looks like this::

    ("", list, None, None)

 contained text of None means <simple_tag/>

In order to support stuff like::

    <this></this><one></one>

AT THE MOMENT &amp; ETCETERA ARE IGNORED. THEY MUST BE PROCESSED
IN A POST-PROCESSING STEP.

PROLOGUES ARE NOT UNDERSTOOD.  OTHER STUFF IS PROBABLY MISSING.
Nc                     \        V 4       R # )N)print)ss   &ڀC:\Users\petid\OneDrive\Desktop\Maestro\MAESTRO CLAUDE\MAESTRO\maestro-backend\venv\Lib\site-packages\reportlab/lib/rparsexml.pywarnCBr   >   s	    a    zstring input)ErrorOnValidityErrorsNoNoDTDWarningExpandCharacterEntitiesExpandGeneralEntitiesr   srcName
ReturnUTF8c                 |    V\         n        \         P                  ! V 3/ VB pT;'       d    T;'       g    R RV.R3# ) N)pyRXP_parsereoCBparse)xmlTextoneOutermostTagr   entityReplacer	parseOptsps   &&&&& r   parsexmlr   I   s@     w33$$1::D!T(::r   c                   0   a  ] tR t^Pt o ]R 4       tRtV tR# )smartDecodec                h   a ^ RI Ho V3R lp\        V4      \        P                  n        V! V 4      # )    )detectc                 t   < \        V \        4      '       d   V # S! V 4      pV P                  VR ,          4      # )encoding)
isinstancestrdecode)r   cddr   s   & r   __call__&smartDecode.__call__.<locals>.__call__T   s0    !C  ()C88C
O,,r   )charset_normalizerr   staticmethodr   	__class__r$   )r   r$   r   s   & @r   r$   smartDecode.__call__Q   s*    -	- *6h)?&r    N)__name__
__module____qualname____firstlineno__r'   r$   __static_attributes____classdictcell__)__classdict__s   @r   r   r   P   s      r   r   r   	<![CDATA[z]]>c                     . pV  F;  pR V9   d!   \          F  w  r4VP                  W44      pK  	  VP                  V4       K=  	  V# )&)replacelistreplaceappend)contentListresulteoldnews   &    r   unEscapeContentListr=   d   sE    F!8)
IIc' *a	 
 Mr   c                    \         '       d   \        R4      h\        WR7      w  rEV'       d   V^,          ^ ,          # V# )z.official interface: discard unused cursor infoz)pyRXP not found, fallback parser disabled)r   )RequirePyRXPImportError	parsexml0)xmltextr   r   r   r9   cursors   &&&&  r   parsexmlSimplerD   m   s6    |EFF GVay|r   c                 L    \        V R 4      P                  4       p\        V4      # )r)openreadr   )filenameraws   & r   	parseFilerK   z   s!    
x

"
"
$CC=r   c                .   RpRpVf   V P                  RV4      pV^ 8  d    V# V^,           pRpV FU  p\        V4      pWWX,            V8X  g   K  ^pV P                  RV4      pV^ 8  d   \        RV,          4      hV^,           pKW  	  Ve   K  ^pK  V# )zBskip any prologue found after cursor, return index of rest of textN<>zcan't close prologue %r)z!DOCTYPEz?xmlz!--)findlen
ValueError)	textrC   prologue_elementsdoneopenbracketpastfoundr:   les	   &&       r   skip_prologuerY      s     4D
,iiV,q=% M 1}"AQB!1$3-!8$%>%BCC # =DMr   c                   \        V 4      p \        pR;p;rgVe   V P                  4       p TpV P                  RV4      p	W	^,           V	^,            p
^pV	^ 8  dM   Ve%   WR .pV'       d	   V! V4      pWFWW3\	        V 4      3# \        R\        WV^,            4      ,          4      h. pVe   \        ;rM\        W4      pEMHV	^ 8  d#   \        R\        V R,          4      ,          4      hV
R8X  d   W	V	^	,            R8X  dp   V	^	,           pV P                  \        V4      pV^ 8  d%   \        R\        WV^,            4      ,          4      h\        pWV .pV\	        \        4      ,           pRpEMV
R	8X  d   W	V	^,            R
8X  d   V P                  RV	^,           4      pVV	8  d%   \        R\        WV^,            4      ,          4      hV^,           pV V,          R8w  d%   \        R\        WV^,            4      ,          4      hRV^,           3# V P                  RV	4      pV^ 8  pV^,           pV	^,           pV VV pRV9  d,   VR#,          R8X  d   VRR# pRpVP                  4       pTpTpEMRV9   d   RpV'       g/   \	        VR,           P                  R4      4      ^,          '       d   ^pVfb   V P                  RV4      pV^,           pV^ 8  pV VV pV'       g1   \	        VR,           P                  R4      4      ^,          '       g   Ka  ^pKe  V'       d%   \        R\        W	V	^,            4      ,          4      hTpV V^,
          ,          R8X  d   V^,
          pVRR# pRpVP                  4       pVP                  R4      pV^ ,          pVP                  4       pV^ ,          pTpVR#,          pVR#,          R,           VR#&   / ;pp^p\	        V4      pVV8  Ed&   VV,          pV^,           pVP                  4       pV^ ,          R8w  d   \        R\        V4      ,           4      hRVR,          9  d@   VV8  d   \        R\        V4      ,           4      hVV,          p V^,           pV: RV : 2pKM  VP                  4       pVP                  4       p!V!R#,          p"VR\	        V"4      )  p#V#P                  4       p# V#^ ,          p$V#R#,          p%T$T%u;8X  d   R8X  g   M T$T%u;8X  d   R8X  d	   M MT#^R# p#T#TT&   T"pEK-  Ve   TpVEe   V P                  RV4      p&V&V8  d_   X\        8X  d/   RpWR p'\	        V 4      pV''       d   VP                  V'4       KU  KW  \        RV: R\        WV^,            4      : 24      hV V&^,           ,          R8X  Ed   V P                  RV&4      p(V(V&8  d&   \        R\        V V&V&^,            4      ,          4      hV V&^,           V( p)V)P                  4       p*V*^ ,          p+XV+8w  d   V RV p,\	        V,P                  R4      4      p-V RV p,\	        V,P                  R4      4      p.\        RV.: RV-: R \        V4      : R\        V+4      : R!\        WV^d,            4      : 2
4      hWV& p'V''       d   VP                  V'4       V(^,           pRpEK  WV& p'V''       d   VP                  V'4       \        V V&RVR"7      w  p/pV/'       g   EK  VP                  V/4       EK  V'       d   V'       d	   V! V4      pWFWW3p0V0V3#    \        R\        T#TT!34      ,           4      h; i)$z{simple recursive descent xml parser...
return (dictionary, endcharacter)
special case: comment returns (None, endcharacter)NrM   zno tags at non-toplevel %sz.non top level entry should be at start tag: %s:N
   Nz![r2   zunclosed CDATA %sz!-z<!--z--zunterminated comment %srN   z*invalid comment: contains double dashes %s=/".zunclosed start tag %sz fz-attribute value must start with double quotes   NNzunclosed value zattvalue,attentry,attlist='zno close bracket for z found after zunclosed close tag %s
z	at lines z...z close tag name doesn't match  )
startingattoplevelr   )r   NONAMEstriprO   rP   rQ   reprrY   CDATAENDMARKERCDATAMARKERsplitr7   rA   )1rB   re   rf   r   
NameStringContentListAttDict
ExtraStuffrC   firstbracketafterbracket2char
docontentsLname
startcdataendcdataendcommentdashes
endcommentclosebracketnoclosestartsearchpastfirstbracket
tagcontentstoptaglisttaglist0taglist0listattributenameDtaglistindexlasttaglistindexattentrynextattentryattlistnextattnameattvaluefirstlastnextopenbracket	remaindernextclosebracketclosetagcontentsclosetaglist	closenameprefix
endlinenumlinenum	parsetreets1   &&&&                                             r   rA   rA      sZ    '"G J)--K-' --/F<<V,LQ|A~>
 JA~ #&w/0!1L;"[Es7|SS !=WTZ[]T]E^@_!_``
A
  &&J"73F	aMPTU\]`UaPbbcc	D	 W,q.%I;%V &aJ||NJ?Hz !4tG6RT9<U7V!VWW$J"x89Kc.11FJ	D	 W,q.%I6%Q&||D,q.A, !:T'QWXZQZB[=\!\]])!+Jz"C' !MPTU\djkmdmUnPo!opp*Q,''
 #<<\:L"1nG&q.K+A~ !1,?J*$b>3& ",CRJ!%J!'')!
$*$D#z#~&<&<S&A"BA"E"E,'.||C'E&21n".q.%,-=l%K
"c:c>*@*@*E&F&I&I!"D$%<tGYefhYhDi?j%jkk$ <>*C/#/>L!+CRJ!%J'--/
$**3/ #1:'~~/ $A!
 ,R 0%bk$.  ! #&w< "#33&|4H#/>L'~~/H{C'()X[_`h[i)ijjXb\1'(88",->h-O"PP'.|'<'3A~.6#E'~~/H&nn.G")"+K'(:#k*:):;H'~~/Hj ((2,T d'C'5$+;+;#+Ab>'/Am$$/M

 %ll37Ov%<#J ' 0I \F + ! %QUVZ[bkqrtkt[uVv%wxx*+S0#*<<_#E #O3$%<tGO]lmo]oDp?q%qrr#*?1+<>N#O /557
 )O	?$Wf-F!$V\\$%7!8J$[j1F!&,,t"45G$
DJYg^deh^hNiIj&l m m#?;	HHY')!+!
 $?;	HHY' '0O^b  tB  'C#F9HHY' )D;	k6Av;Qj()EdHV^_fKgFh)hiis   \$ $ ]c           	     6   \        V \        \        34      '       d   V # V w  rr4V'       g   / p. pVP                  4        F,  pW&,          pVP	                  V: R\        V4      : 24       K.  	  RP                  V4      pV'       g   V'       d   \        R4      hVeq   \        \        \        V4      4      p	RP                  V	4      p
V'       g   V
# V
P                  R4      pRRP                  V4      ,           p
RV: RV: RV
: R	V: R
2	# RV: RV: R2# )z!pretty printer mainly for testingr\   rd   zname missing with attributes???rc   z   z
   rM   z>
z
</rN   z/>)r    r!   byteskeysr7   rj   joinrQ   listmappprettyprintrm   )	parsedxmlrv   attdicttextlistextrar   kv
attributestextlistpprint
textpprintnllists   &           r   r   r     s    )SK(('0$THBGG\\^J!T!W-.  '"JJ:;;c,9:YY~.
!!$'W\\&12
'+ZTJJ  z**r   c                    ^ RI H p ^ RIHp V! 4       p\        V ^R7      p\        RV! 4       V,
          4       V^,          '       d	   V! V4       V^,          '       d$   \        R4       \	        V4      p\        V4       R# R# )r   time)pprint)r   DONEz============== reformattingN)r   r   rD   r   r   )r   dumpr   r   nowr   r   s   &&     r   	testparser     sb    
&Cq+A	&$&*Avvq	Avv+,Oa r   c                      \        R V R7       R# )a-  <this type="xml">text &lt;&gt;<b>in</b> <funnytag foo="bar"/> xml</this>
                 <!-- comment -->
                 <![CDATA[
                 <this type="xml">text <b>in</b> xml</this> ]]>
                 <tag with="<brackets in values>">just testing brackets feature</tag>
                 r   N)r   r   s   &r   testr     s     
  r   __main__r   r   r`   z!!!!! no file at {f!r}zparsing z |t|=z	timed at z.2fz secs.))z&lt;rM   )z&gt;rN   )z&amp;r4   )r   )+__doc__r?   simpleparsepyRXPUr   Parserr   r   r@   r   rh   NAMEKEYCONTENTSKEYrl   rP   LENCDATAMARKERrk   r5   r=   rD   rK   verboserY   rA   r   r   r   r+   sysosr   	reportlabr   seenargvfpathisfiler   rG   _frH   r   r*   r   r   <module>r      s  5n K==./'(01./!' .%&L +,TTV ;	 	 m	
[!< -.4GZ  H 0 #$a*fP+4  ZaL
&CDXXb\\ww~~a  *+aBGGI HQEs1vh/0aQAID  	$&*S)01 ! G  K\ s   +E2 F2	E?>E?F