
    ix                     &   S SK r S SKr \" S5      r0 SS_SS_SS_SS_S	S
_SS_SS_SS_SS_SS_SS_SS_SS_SS_SS_SS_S S!_S!S"SS#S$S%S&S'S(S).	Er\ R
                  " S*\ R                  5      r\ R
                  " S+\ R                  5      rS-S, jr	g).    N($  aftncnaftnsepaftnsepc
annotation	atnauthoratndateatnicnatnid	atnparentatnrefatntimeatrfend	atrfstartauthor
backgroundbkmkend	bkmkstartblipuidbuptimcategorycolorschememappingcolortblcommentcompanycreatim	datafield	datastoredefchpdefpapdodoccommdocvar
dptxbxtextebcendebcstartfactoidnamefaltfchars	ffdeftext
ffentrymcr	ffexitmcrffformat
ffhelptextfflffname
ffstattextfilefiletblfldinstfldtypefnamefontembfontfilefonttblfooterfooterffooterlfooterrfootnote	formfieldftncnftnsepftnsepcg	generatorgridtblheaderheaderfheaderlheaderrhlhlfr	hlinkbasehllochlsrchsvhtmltaginfokeycodekeywordslatentstyleslcharslevelnumbers	leveltextlfolevellinkvallist	listlevellistnamelistoverridelistoverridetablelistpictureliststylename	listtablelisttextlsdlockedexceptmaccmaccPr	mailmergemalnmalnScrmanagermargPrmbarmbarPrmbaseJcmbegChr
mborderBoxmborderBoxPrmboxmboxPrmchrmcountmctrlPrmdmdegmdegHidemdenmdiffmdPrmemendChrmeqArrmeqArrPrmfmfNamemfPrmfuncmfuncPr	mgroupChrmgroupChrPrmgrowmhideBot	mhideLeft
mhideRightmhideTopmhtmltagmlimmlimlocmlimlow	mlimlowPrmlimupp	mlimuppPrmmmmaddfieldnamemmath	mmathPictmmathPrmmaxdistmmcmmcJcmmconnectstrmmconnectstrdatammcPrmmcsmmdatasourcemmheadersourcemmmailsubjectmmodsommodsofiltermmodsofldmpdatammodsomappedname
mmodsonamemmodsorecipdata
mmodsosort	mmodsosrcmmodsotable	mmodsoudlmmodsoudldatammodsouniquetagmmPrmmquerymmrmnarymnaryPrmnoBreakmnummobjDistmoMath
moMathParamoMathParaPrmopEmumphantmphantPrmplcHidemposmrmradmradPrmrPrmsepChrmshowmshpmsPremsPrePrmsSubmsSubPrmsSubSup
msSubSupPrmsSupmsSupPrmstrikeBLTRmstrikeHmstrikeTLBRmstrikeVmsubmsubHidemsupmsupHidemtranspmtypemvertJcmvfmfmvfmlmvtofmvtolmzeroAsc	mzeroDescmzeroWidnesttablepropsnextfilenonesttablesobjaliasobjclassobjdataobjectobjnameobjsectobjtime	oldcprops	oldpprops	oldsprops	oldtpropsoleclsidoperatorpanosepasswordpasswordhashpgppgptblpicproppictpnpnseclvlpntextpntxtapntxtbprintimprivatepropnameprotend	protstartprotusertblpxeresultrevtblrevtimrsidtblrxeshpshpgrpshpinstshppictshprsltshptxtsnsp	staticval
stylesheetsubjectsvsvbtctemplate	themedatatitletxeudupr	userpropswgrffmtfilterwindowcaptionwritereservationwritereservhashxexformxmlattrnamexmlattrvaluexmlclosexmlnamexmlnstblxmlopenpar
sectz

pagelinetab	emdashu   —endashu   –emspaceu    enspaceu    qmspaceu    bulletu   •lquoteu   ‘rquoteu   ’	ldblquoteu   “	rdblquoteu   ”rowcell|    {}\   ­u   ‑)	nestcell~r(  r<  r=  r>  r?  -_zO\\([a-z]{1,32})(-?\d{1,10})?[ ]?|\\'([0-9a-f]{2})|\\([^a-z])|([{}])|[\r\n]+|(.)zP(\{\\field\{\s*\\\*\\fldinst\{.*HYPERLINK\s(\".*\")\}{2}\s*\{.*?\s+(.*?)\}{2,3})c                 f   [         R                  " [        SU 5      n / nSnSnSnSnSn[        R	                  U 5       GH  n	U	R                  5       u  pppU(       a.  U(       d'  U[        R                  U5      R                  XS9-  nSnU(       aE  SnUS:X  a  UR                  XT45        Mp  US	:X  a!  U(       a  UR                  5       u  pTM  SnS
nM  M  U(       a/  SnU[        ;   a  U(       d  U[        U   -  nM  M  US:X  a  S
nM  M  U
(       a  SnU
[        ;   a  S
nO"U
S:X  a  SU 3n [        R                  " U5        U(       a  GM  U
[        ;   a  U[        U
   -  nGM*  U
S:X  a  [!        U5      nGM>  U
S:X  a1  Uc  UnGML  [!        U5      nUS:  a  US-  nU[#        U5      -  nUnGMu  GMx  U(       a7  US:  a  US-  nGM  U(       d  [!        US5      nU(       d  UnGM  X|-  nGM  GM  U(       d  GM  US:  a  US-  nGM  U(       a  GM  X-  nGM     U$ ! [         a    Sn Nf = f)a  Converts the rtf text to plain text.

Parameters
----------
text : str
    The rtf text
encoding : str
    Input encoding which is ignored if the rtf file contains an explicit codepage directive, 
    as it is typically the case. Defaults to `cp1252` encoding as it the most commonly used.
errors : str
    How to handle encoding errors. Default is "strict", which throws an error. Another
    option is "ignore" which, as the name says, ignores encoding errors.

Returns
-------
str
    the converted rtf text as a python unicode string
z\1(\2)F   r   N )encodingerrorsr=  r>  T*ansicpgcputf8ucui      )resub
HYPERLINKSPATTERNfinditergroupsbytesfromhexdecodeappendpopspecialcharsdestinationscodecslookupLookupErrorintchr)textrH  rI  stack	ignorableucskipcurskiphexesoutmatchwordarg_hexcharbracetcharcs                    K/home/james-whalen/.local/lib/python3.13/site-packages/striprtf/striprtf.pyrtf_to_textrs  b   s,   & 66*j$/DEIFGE
C!!$'.3lln+4u5=='...PPCEG|f01#(-		%FI
 F $I  G|# ,t,,3 ! 	 G|# 	"u:&MM(+ %|D))S;$GCA1uW3q6MC$G  {1bM EME  U{1YG (H JA # &%H&s   /H!!H0/H0)cp1252strict)
rQ  r^  	frozensetr]  r\  compile
IGNORECASErT  rS  rs       rr  <module>r{     sM   	   ) )\	4
F F D	
 
4 h h x x x h h h    
4!" C#$ 		
		
		5< **VMM
 ZZWMM
_rz  