
    i6r                        S r SSKrSSKrSSKrSSKJr  SSKJrJrJ	r	J
r
Jr  SSKJrJr  SSKJr  SSKJr  SS	KJr  SS
KJrJrJr  SSKJrJr  SSKJrJr  SrSr Sr!Sr"Sr#Sr$Sr%\ S\!S\"S\#S\%S\$S0r&\RN                  " S\RP                  5      r)\
" S5      r*S\ S\  S\! S\" S \# S!\% S"\$ S#3r+S$\*S%\*4S& jr,S$\-S%\R                  4S' jr.S$\R                  S%\-4S( jr/\,4S)\S*S+S,\-S-\\/\4   S%\	\0\-      4
S. jjr1 " S/ S+\\5      r2g)0z~
Anything related to Extensible Metadata Platform (XMP) metadata.

https://en.wikipedia.org/wiki/Extensible_Metadata_Platform
    N)Iterator)AnyCallableOptionalTypeVarUnion)DocumentparseString)Element)
ExpatError   )XmpInformationProtocol)
StreamTypedeprecate_with_replacementdeprecation_no_replacement)PdfReadErrorXmpDocumentError)ContentStream	PdfObjectz+http://www.w3.org/1999/02/22-rdf-syntax-ns#z http://purl.org/dc/elements/1.1/zhttp://ns.adobe.com/xap/1.0/zhttp://ns.adobe.com/pdf/1.3/zhttp://ns.adobe.com/xap/1.0/mm/zhttp://ns.adobe.com/pdfx/1.3/zhttp://www.aiim.org/pdfa/ns/id/dcxmppdfxmpMMpdfaidpdfxa{  
        (?P<year>[0-9]{4})
        (-
            (?P<month>[0-9]{2})
            (-
                (?P<day>[0-9]+)
                (T
                    (?P<hour>[0-9]{2}):
                    (?P<minute>[0-9]{2})
                    (:(?P<second>[0-9]{2}(.[0-9]+)?))?
                    (?P<tzd>Z|[-+][0-9]{2}:[0-9]{2})
                )?
            )?
        )?
        Ku   <?xpacket begin="﻿" id="W5M0MpCehiHzreSzNTczkc9d"?>
<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="pypdf">
    <rdf:RDF xmlns:rdf="z?">
        <rdf:Description rdf:about=""
            xmlns:dc="z"
            xmlns:xmp="z"
            xmlns:pdf="z"
            xmlns:xmpMM="z"
            xmlns:pdfaid="z"
            xmlns:pdfx="zM">
        </rdf:Description>
    </rdf:RDF>
</x:xmpmeta>
<?xpacket end="r"?>valuereturnc                     U $ N r   s    C/home/james-whalen/.local/lib/python3.13/site-packages/pypdf/xmp.py	_identityr$   i   s    L    c           	      f   [         R                  U 5      nUc  [        SU  35      e[        UR	                  S5      5      n[        UR	                  S5      =(       d    S5      n[        UR	                  S5      =(       d    S5      n[        UR	                  S5      =(       d    S5      n[        UR	                  S5      =(       d    S5      n[
        R                  " UR	                  S	5      =(       d    S5      nUR                  [
        R                  5      nXx-
  S
-  n	[        U5      n
[        U	5      nUR	                  S5      =(       d    Sn[        R                  " X#XEXjU5      nUS:w  aA  S UR                  S5       5       u  pUS-  nUS:  a  US-  nU[        R                  " XS9-   nU$ )NzInvalid date format: yearmonth1dayhour0minutesecondi@B tzdZc              3   8   #    U  H  n[        U5      v   M     g 7fr    )int).0xs     r#   	<genexpr>"_converter_date.<locals>.<genexpr>   s     !A.Q#a&&.s   :r   )hoursminutes)iso8601match
ValueErrorr2   groupdecimalDecimalto_integralROUND_FLOORdatetimesplit	timedelta)r   matchesr'   r(   r*   r+   r-   r.   seconds_decmilliseconds_decsecondsmillisecondsr/   dt	tzd_hourstzd_minutess                   r#   _converter_daterN   m   si   mmE"G0899w}}V$%Dg&-#.E
gmmE")c
*Cw}}V$+,Dx(/C0F__W]]84;<F$$W%8%89K,	9+G'(L
--

%#C			46L	QB
cz!A#))C.!A	R	q=2K($$9JJIr%   c                     U R                   b:  U R                  5       b)  U R                  [        R                  R
                  5      n U R                  SS9n U R                  S5      $ )z}Format a datetime as UTC with trailing 'Z'.

- If the input is timezone-aware, convert to UTC first.
- If naive, assume UTC.
N)tzinfoz%Y-%m-%dT%H:%M:%S.%fZ)rP   	utcoffset
astimezonerC   timezoneutcreplacestrftimer"   s    r#   _format_datetime_utcrW      sV     ||EOO$5$A  !2!2!6!67MMM&E>>122r%   elementselfXmpInformation	list_type	converterc                     U R                  [        U5      n/ n[        U5      (       aR  U HJ  nUR                  [        S5       H-  nUR                  U5      nU" U5      nUR	                  U5        M/     ML     U$ g )Nli)getElementsByTagNameNSRDF_NAMESPACElen	_get_textappend)	rX   rY   r[   r\   
containersretval	containeritemr   s	            r#   _generic_getrh      st     //yIJF
:#I!88Mt,!%(e$ N $
 r%   c                   4   \ rS rSrSrS\SS4S jr\SVS j5       r SWS\	S\
S\\4   SS4S	 jjrS
\S\S\S\\   4S jrS
\S\S\\   4S jrS\S\4S jr\4S\S\S\\/\4   S\\   4S jjrS\S\S\\\      4S jr\4S\S\S\\/\4   S\\\      4S jjrS\S\S\\\\4      4S jr\S\\\      4S j5       r\R>                  S\\\      SS4S j5       r\S\\   4S j5       r \ R>                  S\\   SS4S j5       r \S\\\      4S j5       r!\!R>                  S\\\      SS4S j5       r!\S\\\"RD                        4S j5       r#\#R>                  S\\\
\\"RD                  4         SS4S j5       r#\S\\\\4      4S  j5       r$\$R>                  S\\\\4      SS4S! j5       r$\S\\   4S" j5       r%\%R>                  S\\   SS4S# j5       r%\S\\   4S$ j5       r&\&R>                  S\\   SS4S% j5       r&\S\\\      4S& j5       r'\'R>                  S\\\      SS4S' j5       r'\S\\\      4S( j5       r(\(R>                  S\\\      SS4S) j5       r(\S\\\      4S* j5       r)\)R>                  S\\\      SS4S+ j5       r)\S\\\\4      4S, j5       r*\*R>                  S\\\\4      SS4S- j5       r*\S\\   4S. j5       r+\+R>                  S\\   SS4S/ j5       r+\S\\\      4S0 j5       r,\,R>                  S\\\      SS4S1 j5       r,\S\\\\4      4S2 j5       r-\-R>                  S\\\\4      SS4S3 j5       r-\S\\\      4S4 j5       r.\.R>                  S\\\      SS4S5 j5       r.\S\\   4S6 j5       r/\/R>                  S\\   SS4S7 j5       r/\S\\   4S8 j5       r0\0R>                  S\\   SS4S9 j5       r0\S\\   4S: j5       r1\1R>                  S\\   SS4S; j5       r1\S\\"RD                     4S< j5       r2\2R>                  S\\"RD                     SS4S= j5       r2\S\\"RD                     4S> j5       r3\3R>                  S\\"RD                     SS4S? j5       r3\S\\"RD                     4S@ j5       r4\4R>                  S\\"RD                     SS4SA j5       r4\S\\   4SB j5       r5\5R>                  S\\   SS4SC j5       r5\S\\   4SD j5       r6\6R>                  S\\   SS4SE j5       r6\S\\   4SF j5       r7\7R>                  S\\   SS4SG j5       r7\S\\   4SH j5       r8\8R>                  S\\   SS4SI j5       r8\S\\   4SJ j5       r9\9R>                  S\\   SS4SK j5       r9\S\\\4   4SL j5       r:SXS
\S\4SM jjr;S\S\SS4SN jr<S\S\S\\   SS4SO jr=S\S\S\\\      SS4SP jr>S\S\S\\\      SS4SQ jr?S\S\S\\\\4      SS4SR jr@S\S\4SS jrASYST jrBSUrCg)ZrZ      z
An object that represents Extensible Metadata Platform (XMP) metadata.
Usually accessed by :py:attr:`xmp_metadata()<pypdf.PdfReader.xmp_metadata>`.

Raises:
  PdfReadError: if XML is invalid

streamr   Nc                     Xl          U R                   R                  5       n[        U5      nUR                  [        S5      S   U l        0 U l	        g ! [        [        4 a  n[        SU 35      eS nAff = f)Nz#XML in XmpInformation was invalid: RDFr   )
rk   get_datar
   AttributeErrorr   r   r_   r`   rdf_rootcache)rY   rk   datadoc_rootes        r#   __init__XmpInformation.__init__   s    	J;;'')D!,T!2H %-$C$C5%

% &(
 
+ 	J!DQCHII	Js   %A A6#A11A6c                 r    [        SS5      nUR                  [        R                  S5      5        U " U5      $ )z
Create a new XmpInformation object with minimal structure.

Returns:
    A new XmpInformation instance with empty metadata fields.
Nutf-8)r   set_data_MINIMAL_XMPencode)clsrk   s     r#   createXmpInformation.create   s1     tT*++G456{r%   encryption_keyc                 r    [        SSS5        Ub  [        SS5        U R                  R                  U5        g )NzXmpInformation.write_to_streamzPdfWriter.xmp_metadataz6.0.0z/the encryption_key parameter of write_to_streamz5.0.0)r   r   rk   write_to_stream)rY   rk   r   s      r#   r   XmpInformation.write_to_stream   s>     	#,$	

 %&A7 	##F+r%   	about_uri	namespacenamec              #      #    U R                   R                  [        S5       HP  nUR                  [        S5      U:X  d  M  UR	                  X#5      nUb  Uv   UR                  X#5       S h  vN   MR     g  N	7fNDescriptionabout)rp   r_   r`   getAttributeNSgetAttributeNodeNS)rY   r   r   r   descattrs         r#   get_elementXmpInformation.get_element   sk     MM88VD""=':iG..y?#J66yGGG W
 Hs   <A:,A:.A8/
A:c              #     #    U R                   R                  [        S5       H  nUR                  [        S5      U:X  d  M  [	        UR
                  R                  5       H=  nUR
                  R                  U5      nU(       d  M'  UR                  U:X  d  M9  Uv   M?     UR                   H  nUR                  U:X  d  M  Uv   M     M     g 7fr   )
rp   r_   r`   r   range
attributeslengthrg   namespaceURI
childNodes)rY   r   r   r   ir   childs          r#   get_nodes_in_namespace%XmpInformation.get_nodes_in_namespace   s     MM88VD""=':iGt556A??//2Dt 1 1Y >"
 7 "__E))Y6# - Ws   <CACC%CCrX   c                     SnUR                    H-  nUR                  UR                  :X  d  M  X#R                  -  nM/     U$ N )r   nodeType	TEXT_NODErr   )rY   rX   textr   s       r#   rb   XmpInformation._get_text   s:    ''E~~0

" ( r%   r\   c                 j   U R                   R                  U0 5      R                  U5      nU(       a  U$ S nU R                  SX5       H;  nUR                  UR                  :X  a  UR
                  nOU R                  U5      n  O   Ub  U" U5      nU R                   R                  U0 5      nXWU'   U$ r   )rq   getr   r   ATTRIBUTE_NODE	nodeValuerb   
setdefault)rY   r   r   r\   cachedr   rX   ns_caches           r#   _get_single_value XmpInformation._get_single_value   s     	2.2248M''I<G7#9#99))w/ = e$E::((B7r%   c                 h   U R                   R                  U0 5      R                  U5      nU(       a  U$ / nU R                  SX5       HE  n[        XPSS9=nb  UR	                  U5        M#  U R                  U5      nUR                  U5        MG     U R                   R                  U0 5      nXHU'   U$ )Nr   Bagr[   rq   r   r   rh   extendrb   rc   r   )	rY   r   r   r   re   rX   bagsr   r   s	            r#   _getter_bagXmpInformation._getter_bag  s    	2.2248M''I<G$WeDDQd#w/e$ = ::((B7r%   c                    U R                   R                  U0 5      R                  U5      nU(       a  U$ / nU R                  SX5       Hl  n[        X`SUS9=nb  UR	                  U5        M$  [        X`SS9=nb  UR	                  U5        MD  U" U R                  U5      5      n	UR                  U	5        Mn     U R                   R                  U0 5      n
XZU'   U$ )Nr   Seq)r[   r\   r   r   r   )rY   r   r   r\   r   re   rX   seqsr   r   r   s              r#   _get_seq_valuesXmpInformation._get_seq_values  s     	2.2248M''I<G$WeyYYfd#&wFF$S d#!$.."9:e$ = ::((B7r%   c                    U R                   R                  U0 5      R                  U5      nU(       a  U$ 0 nU R                  SX5       H  nUR                  [        S5      n[        U5      (       aL  U HD  nUR                  [        S5       H'  nU R                  U5      n	XUR                  S5      '   M)     MF     Mu  U R                  U5      US'   M     U R                   R                  U0 5      n
XJU'   U$ )Nr   Altr^   xml:langz	x-default)	rq   r   r   r_   r`   ra   rb   getAttributer   )rY   r   r   r   re   rX   altsaltrg   r   r   s              r#   _get_langalt_values"XmpInformation._get_langalt_values0  s    	2.2248M!#''I<G11-GD4yyC # : :=$ O $t 4@Et00<= !P  
 '+nnW&={# = ::((B7r%   c                 .    U R                  [        S5      $ )z6Contributors to the resource (other than the authors).contributorr   DC_NAMESPACErY   s    r#   dc_contributorXmpInformation.dc_contributorB  s     m<<r%   valuesc                 2    U R                  [        SU5        g )Nr   _set_bag_valuesr   rY   r   s     r#   r   r   G  s    \=&Ar%   c                 .    U R                  [        S5      $ )z4Text describing the extent or scope of the resource.coverager   r   r   s    r#   dc_coverageXmpInformation.dc_coverageK  s     %%lJ??r%   r   c                 2    U R                  [        SU5        g )Nr   _set_single_valuer   rY   r   s     r#   r   r   P  s    |Z?r%   c                 .    U R                  [        S5      $ )zVA sorted array of names of the authors of the resource, listed in order of precedence.creator)r   r   r   s    r#   
dc_creatorXmpInformation.dc_creatorT  s     ##L)<<r%   c                 2    U R                  [        SU5        g )Nr   )_set_seq_valuesr   r   s     r#   r   r   Y      \9f=r%   c                 8    U R                  [        S[        5      $ )zXA sorted array of dates of significance to the resource. The dates and times are in UTC.date)r   r   rN   r   s    r#   dc_dateXmpInformation.dc_date]  s     ##L&/JJr%   c                 (   Uc  U R                  [        SS 5        g / nU HX  n[        U[        R                  5      (       a  UR	                  [        U5      5        M>  UR	                  [        U5      5        MZ     U R                  [        SU5        g )Nr   )r   r   
isinstancerC   rc   rW   str)rY   r   date_stringsr   s       r#   r   r   b  su    >  vt<LeX%6%677 ''(<U(CD ''E
3	  
   v|Dr%   c                 .    U R                  [        S5      $ )zSA language-keyed dictionary of textual descriptions of the content of the resource.descriptionr   r   r   s    r#   dc_descriptionXmpInformation.dc_descriptiono  s     ''mDDr%   c                 2    U R                  [        SU5        g )Nr   _set_langalt_valuesr   r   s     r#   r   r   t  s      }fEr%   c                 .    U R                  [        S5      $ )zThe mime-type of the resource.formatr   r   s    r#   	dc_formatXmpInformation.dc_formatx       %%lH==r%   c                 2    U R                  [        SU5        g )Nr   r   r   s     r#   r   r   }      |Xu=r%   c                 .    U R                  [        S5      $ )z"Unique identifier of the resource.
identifierr   r   s    r#   dc_identifierXmpInformation.dc_identifier  s     %%lLAAr%   c                 2    U R                  [        SU5        g )Nr   r   r   s     r#   r   r     s    |\5Ar%   c                 .    U R                  [        S5      $ )zAAn unordered array specifying the languages used in the resource.languager   r   s    r#   dc_languageXmpInformation.dc_language       j99r%   c                 2    U R                  [        SU5        g )Nr   r   r   s     r#   r   r         \:v>r%   c                 .    U R                  [        S5      $ )z&An unordered array of publisher names.	publisherr   r   s    r#   dc_publisherXmpInformation.dc_publisher  s     k::r%   c                 2    U R                  [        SU5        g )Nr   r   r   s     r#   r   r    s    \;?r%   c                 .    U R                  [        S5      $ )zLAn unordered array of text descriptions of relationships to other documents.relationr   r   s    r#   dc_relationXmpInformation.dc_relation  r   r%   c                 2    U R                  [        SU5        g )Nr  r   r   s     r#   r  r    r   r%   c                 .    U R                  [        S5      $ )z`A language-keyed dictionary of textual descriptions of the rights the user has to this resource.rightsr   r   s    r#   	dc_rightsXmpInformation.dc_rights  s     ''h??r%   c                 2    U R                  [        SU5        g )Nr	  r   r   s     r#   r
  r    s      x@r%   c                 .    U R                  [        S5      $ )zCUnique identifier of the work from which this resource was derived.sourcer   r   s    r#   	dc_sourceXmpInformation.dc_source  r   r%   c                 2    U R                  [        SU5        g )Nr  r   r   s     r#   r  r    r   r%   c                 .    U R                  [        S5      $ )z\An unordered array of descriptive phrases or keywords that specify the topic of the content.subjectr   r   s    r#   
dc_subjectXmpInformation.dc_subject  s     i88r%   c                 2    U R                  [        SU5        g )Nr  r   r   s     r#   r  r    r   r%   c                 .    U R                  [        S5      $ )z9A language-keyed dictionary of the title of the resource.titler   r   s    r#   dc_titleXmpInformation.dc_title  s     ''g>>r%   c                 2    U R                  [        SU5        g )Nr  r   r   s     r#   r  r    s      w?r%   c                 .    U R                  [        S5      $ )z@An unordered array of textual descriptions of the document type.typer   r   s    r#   dc_typeXmpInformation.dc_type  s     f55r%   c                 2    U R                  [        SU5        g )Nr  r   r   s     r#   r  r    s    \66:r%   c                 .    U R                  [        S5      $ )z:An unformatted text string representing document keywords.Keywordsr   PDF_NAMESPACEr   s    r#   pdf_keywordsXmpInformation.pdf_keywords       %%mZ@@r%   c                 2    U R                  [        SU5        g )Nr"  r   r$  r   s     r#   r%  r&        }j%@r%   c                 .    U R                  [        S5      $ )z-The PDF file version, for example 1.0 or 1.3.
PDFVersionr#  r   s    r#   pdf_pdfversionXmpInformation.pdf_pdfversion  s     %%m\BBr%   c                 2    U R                  [        SU5        g )Nr,  r)  r   s     r#   r-  r.    s    }lEBr%   c                 .    U R                  [        S5      $ )z6The name of the tool that saved the document as a PDF.Producerr#  r   s    r#   pdf_producerXmpInformation.pdf_producer  r'  r%   c                 2    U R                  [        SU5        g )Nr1  r)  r   s     r#   r2  r3    r*  r%   c                 8    U R                  [        S[        5      $ )zYThe date and time the resource was originally created. Returned as a UTC datetime object.
CreateDater   XMP_NAMESPACErN   r   s    r#   xmp_create_dateXmpInformation.xmp_create_date       %%m\?SSr%   c                     U(       a#  [        U5      nU R                  [        SU5        g U R                  [        SS 5        g )Nr6  rW   r   r8  rY   r   date_strs      r#   r9  r:    3    +E2H""=,I""=,Er%   c                 8    U R                  [        S[        5      $ )zTThe date and time the resource was last modified. Returned as a UTC datetime object.
ModifyDater7  r   s    r#   xmp_modify_dateXmpInformation.xmp_modify_date  r;  r%   c                     U(       a#  [        U5      nU R                  [        SU5        g U R                  [        SS 5        g )NrB  r=  r>  s      r#   rC  rD    r@  r%   c                 8    U R                  [        S[        5      $ )zjThe date and time that any metadata for this resource was last changed. Returned as a UTC datetime object.MetadataDater7  r   s    r#   xmp_metadata_date XmpInformation.xmp_metadata_date  s     %%m^_UUr%   c                     U(       a#  [        U5      nU R                  [        SU5        g U R                  [        SS 5        g )NrG  r=  r>  s      r#   rH  rI    s3    +E2H""=.(K""=.$Gr%   c                 .    U R                  [        S5      $ )z=The name of the first known tool used to create the resource.CreatorTool)r   r8  r   s    r#   xmp_creator_toolXmpInformation.xmp_creator_tool  s     %%m]CCr%   c                 2    U R                  [        SU5        g )NrL  )r   r8  r   s     r#   rM  rN    s    }mUCr%   c                 .    U R                  [        S5      $ )zGThe common identifier for all versions and renditions of this resource.
DocumentIDr   XMPMM_NAMESPACEr   s    r#   xmpmm_document_id XmpInformation.xmpmm_document_id       %%o|DDr%   c                 2    U R                  [        SU5        g )NrQ  r   rS  r   s     r#   rT  rU  "      eDr%   c                 .    U R                  [        S5      $ )zZAn identifier for a specific incarnation of a document, updated each time a file is saved.
InstanceIDrR  r   s    r#   xmpmm_instance_id XmpInformation.xmpmm_instance_id&  rV  r%   c                 2    U R                  [        SU5        g )Nr[  rX  r   s     r#   r\  r]  +  rY  r%   c                 .    U R                  [        S5      $ )zMThe part of the PDF/A standard that the document conforms to (e.g., 1, 2, 3).partr   PDFAID_NAMESPACEr   s    r#   pdfaid_partXmpInformation.pdfaid_part/  s     %%&6??r%   c                 2    U R                  [        SU5        g )Nr`  r   rb  r   s     r#   rc  rd  4  s    /?r%   c                 .    U R                  [        S5      $ )zFThe conformance level within the PDF/A standard (e.g., 'A', 'B', 'U').conformancera  r   s    r#   pdfaid_conformance!XmpInformation.pdfaid_conformance8  s     %%&6FFr%   c                 2    U R                  [        SU5        g )Nrh  rf  r   s     r#   ri  rj  =  s    /Fr%   c           
         [        U S5      (       d  0 U l        U R                  S[        5       H  nUR                  n UR                  S5      nUS:X  a  O+USU [        [        X#S-   US-    SS	95      -   X#S-   S -   nMC  UR                  UR                  :X  a  UR                  nOU R                  U5      nX@R                  U'   M     U R                  $ )
z
Retrieve custom metadata properties defined in the undocumented pdfx
metadata schema.

Returns:
    A dictionary of key/value items for custom metadata properties.

_custom_propertiesr   u   ↂr8   Nr         )base)hasattrrm  r   PDFX_NAMESPACE	localNamefindchrr2   r   r   r   rb   )rY   nodekeyidxr   s        r#   custom_properties XmpInformation.custom_propertiesA  s     t122&(D#33BGnn((8,CbyDS	c#Aga"8rBCDAgi.)   ==D$7$77 NNE NN40E/4'',! H" &&&r%   c                 h   U R                   R                  [        S5       H!  nUR                  [        S5      U:X  d  M  Us  $    U R                   R                  nUc  [        S5      eUR                  [        S5      nUR                  [        SU5        U R                   R                  U5        U$ )zBGet or create an rdf:Description element with the given about URI.r   r   XMP Document is Nonezrdf:Descriptionz	rdf:about)	rp   r_   r`   r   ownerDocumentr   createElementNSsetAttributeNSappendChild)rY   r   r   docs       r#   _get_or_create_description)XmpInformation._get_or_create_description`  s    MM88VD""=':iG W mm));"#9::""=2CDM;	B!!$'r%   c                 Z    U R                   R                  U5      nU(       a	  X#;   a  X2	 ggg)z<Remove a cached value for a given namespace/name if present.N)rq   r   )rY   r   r   r   s       r#   _clear_cache_entry!XmpInformation._clear_cache_entryn  s(    ::>>),( )8r%   c                 4   U R                  X5        U R                  5       n[        UR                  X5      5      nU H  nUR	                  U5        M     UR                  X5      =n(       a  UR                  U5        Ub  U R                  R                  nUc  [        S5      eU R                  U5      n	UR                  X SU 35      nUR                  [        U5      5      n
UR                  U
5        UR                  U5        U R                  5         g)z&Set or remove a single metadata value.Nr|  r7   )r  r  listr_   removeChildr   removeAttributeNoderp   r}  r   _get_namespace_prefixr~  createTextNoder   r  _update_stream)rY   r   r   r   r   existing_elementselemexisting_attrr  prefix	text_nodes              r#   r    XmpInformation._set_single_valuet  s    	0..0 !<!<Y!MN%DT" & !33IDD=D$$]3----C{&'=>>//	:F&&yHAdV2DED**3u:6IY'T"r%   c                    U R                  X5        U R                  5       n[        UR                  X5      5      nU H  nUR	                  U5        M     U(       a  U R
                  R                  nUc  [        S5      eU R                  U5      nUR                  X SU 35      nUR                  [        S5      n	U HU  n
UR                  [        S5      nUR                  [        U
5      5      nUR                  U5        U	R                  U5        MW     UR                  U	5        UR                  U5        U R                  5         g)z+Set or remove bag values (unordered array).Nr|  r7   zrdf:Bagrdf:lir  r  r  r_   r  rp   r}  r   r  r~  r`   r  r   r  r  )rY   r   r   r   r   r  r  r  r  bagr   r^   r  s                r#   r   XmpInformation._set_bag_values      	0..0 !<!<Y!MN%DT" & ----C{&'=>>//	:F&&yHAdV2DED%%mY?C((A..s5z:	y)#	   S!T"r%   c                    U R                  X5        U R                  5       n[        UR                  X5      5      nU H  nUR	                  U5        M     U(       a  U R
                  R                  nUc  [        S5      eU R                  U5      nUR                  X SU 35      nUR                  [        S5      n	U HU  n
UR                  [        S5      nUR                  [        U
5      5      nUR                  U5        U	R                  U5        MW     UR                  U	5        UR                  U5        U R                  5         g)z.Set or remove sequence values (ordered array).Nr|  r7   zrdf:Seqr  r  )rY   r   r   r   r   r  r  r  r  seqr   r^   r  s                r#   r   XmpInformation._set_seq_values  r  r%   c                    U R                  X5        U R                  5       n[        UR                  X5      5      nU H  nUR	                  U5        M     U(       Ga   U R
                  R                  nUc  [        S5      eU R                  U5      nUR                  X SU 35      nUR                  [        S5      n	UR                  5        Hi  u  pUR                  [        S5      nUR                  SU
5        UR                  [        U5      5      nUR                  U5        U	R                  U5        Mk     UR                  U	5        UR                  U5        U R!                  5         g)z*Set or remove language alternative values.Nr|  r7   zrdf:Altr  r   )r  r  r  r_   r  rp   r}  r   r  r~  r`   itemssetAttributer  r   r  r  )rY   r   r   r   r   r  r  r  r  r   langr   r^   r  s                 r#   r   "XmpInformation._set_langalt_values  s6   	0..0 !<!<Y!MN%DT" & ----C{&'=>>//	:F&&yHAdV2DED%%mY?C%||~((A
D1..s5z:	y)#  . S!T"r%   c                 .    [         R                  US5      $ )z?Get the appropriate namespace prefix for a given namespace URI.unknown)_NAMESPACE_PREFIX_MAPr   )rY   r   s     r#   r  $XmpInformation._get_namespace_prefix  s    $((I>>r%   c                     U R                   R                  nUc  [        S5      eUR                  SS9nU R                  R                  U5        g)z/Update the stream with the current XML content.Nr|  rx   )encoding)rp   r}  r   toxmlrk   ry   )rY   r  xml_datas      r#   r  XmpInformation._update_stream  sD    mm));"#9::99g9.X&r%   )rm  rq   rp   rk   )r   rZ   r    )r   )r   N)D__name__
__module____qualname____firstlineno____doc__r   ru   classmethodr}   r   r   r   bytesr   r   r   r   r   
XmlElementrb   r$   r   r   r   r  r   r   dictr   propertyr   setterr   r   rC   r   r   r   r   r   r   r  r
  r  r  r  r  r%  r-  r2  r9  rC  rH  rM  rT  r\  rc  ri  ry  r  r  r   r   r   r   r  r  __static_attributes__r!   r%   r#   rZ   rZ      s|   
(} 
( 
( 	 	 MQ, ,27c58H2I,	,HS HS H HQT H	$ 	$ 	$QT 	$   +4	  SE3J'	
 
#,S  c8K & +4	  SE3J'	
 
$s)	:S  cSVh@X $ =c 3 = = BXd3i%8 BT B B @Xc] @ @ @# @4 @ @ =HT#Y/ = = >$s)!4 > > > K$x'8'8"9: K K ^^
EhtE#x7H7H2H,I'JK 
EPT 
E 
E Ec3h 8 E E FXd38n%= F$ F F >8C= > > >x} > > > Bx} B B B8C= BT B B :Xd3i0 : : ?(49"5 ?$ ? ? ;htCy1 ; ; @8DI#6 @4 @ @ :Xd3i0 : : ?(49"5 ?$ ? ? @8DcN3 @ @ Ac3h 8 AT A A >8C= > > >x} > > > 9HT#Y/ 9 9 >$s)!4 > > > ?(4S>2 ? ? __@xS#X7 @D @ @ 6$s), 6 6 ^^;htCy1 ;d ; ; Ahsm A A A(3- AD A A C C C CHSM Cd C C Ahsm A A A(3- AD A A T(*;*;!< T T FXh.?.?%@ FT F F T(*;*;!< T T FXh.?.?%@ FT F F V8H,=,=#> V V Hx0A0A'B Ht H H D(3- D D Dhsm D D D E8C= E E Ex} E E E E8C= E E Ex} E E E @Xc] @ @ @# @4 @ @ GHSM G G G G$ G G '4S> ' '<C  C s t 3 c (3- TX 0 C $s)AT Y] 8 C $s)AT Y] 8S  XdSVX[S[nE] bf :?s ?s ?'r%   )3r  rC   r?   recollections.abcr   typingr   r   r   r   r   xml.dom.minidomr	   r
   r   r  xml.parsers.expatr   
_protocolsr   _utilsr   r   r   errorsr   r   genericr   r   r`   r   r8  r$  rS  rr  rb  r  compileVERBOSEr;   r   rz   r$   r   rN   rW   r  rh   rZ   r!   r%   r#   <module>r     s     	 $  2 1 ( . V V 2 -=1..3( 1 5  $55WhF  ** JJ!( CL& (#n %% '% ')* ++, -'( ) Q 1 3 8#4#4 6
3 1 1 
3c 
3 hq#3@CPXZ]Y^`cYcPdd3iH	'+Y H	'r%   