
    h6r                     
   d Z ddlZddlZddlZddlmZ ddlmZmZm	Z	m
Z
mZ ddlmZmZ ddlmZ ddlmZ dd	lmZ dd
lmZmZmZ ddlmZmZ ddlmZmZ dZdZ dZ!dZ"dZ#dZ$dZ%e de!de"de#de%de$diZ& ejN                  dejP                        Z) e
d      Z*de de  de! de" d e# d!e% d"e$ d#Z+d$e*d%e*fd&Z,d$e-d%ej                  fd'Z.d$ej                  d%e-fd(Z/e,fd)ed*d+d,e-d-eegef   d%e	e0e-      f
d.Z1 G d/ d+ee      Z2y)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                     | S N r   s    H/var/www/html/aiagenthome/venv/lib/python3.12/site-packages/pypdf/xmp.py	_identityr$   i   s    L    c           	      0   t         j                  |       }|t        d|        t        |j	                  d            }t        |j	                  d      xs d      }t        |j	                  d      xs d      }t        |j	                  d      xs d      }t        |j	                  d      xs d      }t        j                  |j	                  d	      xs d      }|j                  t
        j                        }||z
  d
z  }	t        |      }
t        |	      }|j	                  d      xs d}t        j                  ||||||
|      }|dk7  rDd |j                  d      D        \  }}|dz  }|dk  r|dz  }|t        j                  ||      z   }|S )NzInvalid date format: yearmonth1dayhour0minutesecondi@B tzdZc              3   2   K   | ]  }t        |        y wr    )int).0xs     r#   	<genexpr>z"_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_daterM   m   su   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T67L	QB
cz!A#))C.!A	;R	q=2K($$9kJJIr%   c                     | j                   9| j                         )| j                  t        j                  j
                        } | j                  d      } | j                  d      S )zFormat 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)rO   	utcoffset
astimezonerB   timezoneutcreplacestrftimer"   s    r#   _format_datetime_utcrV      sV     ||EOO$5$A  !2!2!6!67MMM&E>>122r%   elementselfXmpInformation	list_type	converterc                     | j                  t        |      }g }t        |      rN|D ]G  }|j                  t        d      D ],  }|j                  |      } ||      }|j	                  |       . I |S y )Nli)getElementsByTagNameNSRDF_NAMESPACElen	_get_textappend)	rW   rX   rZ   r[   
containersretval	containeritemr   s	            r#   _generic_getrg      sr     //yIJF
:#I!88Mt,!%(e$ N $
 r%   c                      e Zd ZdZdeddfdZedTd       Z	 dUdede	de
ef   ddfdZd	e
d
e
de
dee   fdZd	e
d
e
dee   fdZdede
fdZefd
e
de
dee
gef   dee   fdZd
e
de
deee
      fdZefd
e
de
deegef   deee      fdZd
e
de
deeeef      fdZedeee
      fd       Zej<                  deee
      ddfd       Zedee
   fd       Zej<                  dee
   ddfd       Zedeee
      fd       Z e j<                  deee
      ddfd       Z edeee!jB                        fd       Z"e"j<                  deee	e
e!jB                  f         ddfd       Z"edeee
e
f      fd       Z#e#j<                  deee
e
f      ddfd        Z#edee
   fd!       Z$e$j<                  dee
   ddfd"       Z$edee
   fd#       Z%e%j<                  dee
   ddfd$       Z%edeee
      fd%       Z&e&j<                  deee
      ddfd&       Z&edeee
      fd'       Z'e'j<                  deee
      ddfd(       Z'edeee
      fd)       Z(e(j<                  deee
      ddfd*       Z(edeee
e
f      fd+       Z)e)j<                  deee
e
f      ddfd,       Z)edee
   fd-       Z*e*j<                  dee
   ddfd.       Z*edeee
      fd/       Z+e+j<                  deee
      ddfd0       Z+edeee
e
f      fd1       Z,e,j<                  deee
e
f      ddfd2       Z,edeee
      fd3       Z-e-j<                  deee
      ddfd4       Z-edee
   fd5       Z.e.j<                  dee
   ddfd6       Z.edee
   fd7       Z/e/j<                  dee
   ddfd8       Z/edee
   fd9       Z0e0j<                  dee
   ddfd:       Z0edee!jB                     fd;       Z1e1j<                  dee!jB                     ddfd<       Z1edee!jB                     fd=       Z2e2j<                  dee!jB                     ddfd>       Z2edee!jB                     fd?       Z3e3j<                  dee!jB                     ddfd@       Z3edee
   fdA       Z4e4j<                  dee
   ddfdB       Z4edee
   fdC       Z5e5j<                  dee
   ddfdD       Z5edee
   fdE       Z6e6j<                  dee
   ddfdF       Z6edee
   fdG       Z7e7j<                  dee
   ddfdH       Z7edee
   fdI       Z8e8j<                  dee
   ddfdJ       Z8edeeef   fdK       Z9dVd	e
defdLZ:d
e
de
ddfdMZ;d
e
de
dee
   ddfdNZ<d
e
de
deee
      ddfdOZ=d
e
de
deee
      ddfdPZ>d
e
de
deee
e
f      ddfdQZ?d
e
de
fdRZ@dWdSZAy)XrY   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                     || _         	 | j                   j                         }t        |      }|j                  t        d      d   | _        i | _	        y # t        t        f$ r}t        d|       d }~ww xY w)Nz#XML in XmpInformation was invalid: RDFr   )
ri   get_datar
   AttributeErrorr   r   r^   r_   rdf_rootcache)rX   ri   datadoc_rootes        r#   __init__zXmpInformation.__init__   s    	J;;'')D!,T!2H %-$C$C5%

% &(
 
+ 	J!DQCHII	Js   %A A6#A11A6c                 r    t        dd      }|j                  t        j                  d              | |      S )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)clsri   s     r#   createzXmpInformation.create   s1     tT*++G456{r%   encryption_keyc                 p    t        ddd       |t        dd       | j                  j                  |       y )NzXmpInformation.write_to_streamzPdfWriter.xmp_metadataz6.0.0z/the encryption_key parameter of write_to_streamz5.0.0)r   r   ri   write_to_stream)rX   ri   r{   s      r#   r}   zXmpInformation.write_to_stream   s>     	#,$	

 %&A7 	##F+r%   	about_uri	namespacenamec              #      K   | j                   j                  t        d      D ]N  }|j                  t        d      |k(  s|j	                  ||      }|| |j                  ||      E d {    P y 7 wNDescriptionabout)rn   r^   r_   getAttributeNSgetAttributeNodeNS)rX   r~   r   r   descattrs         r#   get_elementzXmpInformation.get_element   sp     MM88VD""=':iG..y$?#J66y$GGG W
 Hs   =A7 -A7-A5.A7c              #     K   | j                   j                  t        d      D ]  }|j                  t        d      |k(  st	        |j
                  j                        D ]4  }|j
                  j                  |      }|s!|j                  |k(  s1| 6 |j                  D ]  }|j                  |k(  s|   y wr   )
rn   r^   r_   r   range
attributeslengthrf   namespaceURI
childNodes)rX   r~   r   r   ir   childs          r#   get_nodes_in_namespacez%XmpInformation.get_nodes_in_namespace   s     MM88VD""=':iGt556A??//2D 1 1Y >"
 7 "__E))Y6# - Ws   =B> ?B> B>$B>5	B>rW   c                 ~    d}|j                   D ]+  }|j                  |j                  k(  s||j                  z  }- |S N )r   nodeType	TEXT_NODErp   )rX   rW   textr   s       r#   ra   zXmpInformation._get_text   s<    ''E~~0

" ( r%   r[   c                 ^   | j                   j                  |i       j                  |      }|r|S d }| j                  d||      D ]:  }|j                  |j                  k(  r|j
                  }n| j                  |      } n | ||      }| j                   j                  |i       }|||<   |S r   )ro   getr   r   ATTRIBUTE_NODE	nodeValuera   
setdefault)rX   r   r   r[   cachedr   rW   ns_caches           r#   _get_single_valuez XmpInformation._get_single_value   s     	2.2248M''It<G7#9#99))w/ = e$E::((B7r%   c                 b   | j                   j                  |i       j                  |      }|r|S g }| j                  d||      D ]F  }t        || d      x}|j	                  |       %| j                  |      }|j                  |       H | j                   j                  |i       }|||<   |S )Nr   BagrZ   ro   r   r   rg   extendra   rb   r   )	rX   r   r   r   rd   rW   bagsr   r   s	            r#   _getter_bagzXmpInformation._getter_bag  s    	2.2248M''It<G$WdeDDQd#w/e$ = ::((B7r%   c                    | j                   j                  |i       j                  |      }|r|S g }| j                  d||      D ]o  }t        || d|      x}|j	                  |       &t        || d      x}|j	                  |       H || j                  |            }	|j                  |	       q | j                   j                  |i       }
||
|<   |S )Nr   Seq)rZ   r[   r   r   r   )rX   r   r   r[   r   rd   rW   seqsr   r   r   s              r#   _get_seq_valueszXmpInformation._get_seq_values  s     	2.2248M''It<G$WdeyYYfd#&wFF$S d#!$.."9:e$ = ::((B7r%   c                    | j                   j                  |i       j                  |      }|r|S i }| j                  d||      D ]  }|j                  t        d      }t        |      rH|D ]B  }|j                  t        d      D ]'  }| j                  |      }	|	||j                  d      <   ) D l| j                  |      |d<    | j                   j                  |i       }
||
|<   |S )Nr   Altr]   xml:langz	x-default)	ro   r   r   r^   r_   r`   ra   getAttributer   )rX   r   r   r   rd   rW   altsaltrf   r   r   s              r#   _get_langalt_valuesz"XmpInformation._get_langalt_values0  s    	2.2248M!#''It<G11-GD4yC # : :=$ O $t 4@Et00<= !P  
 '+nnW&={# = ::((B7r%   c                 .    | j                  t        d      S )z6Contributors to the resource (other than the authors).contributorr   DC_NAMESPACErX   s    r#   dc_contributorzXmpInformation.dc_contributorB  s     m<<r%   valuesc                 2    | j                  t        d|       y )Nr   _set_bag_valuesr   rX   r   s     r#   r   zXmpInformation.dc_contributorG  s    \=&Ar%   c                 .    | j                  t        d      S )z4Text describing the extent or scope of the resource.coverager   r   r   s    r#   dc_coveragezXmpInformation.dc_coverageK  s     %%lJ??r%   r   c                 2    | j                  t        d|       y )Nr   _set_single_valuer   rX   r   s     r#   r   zXmpInformation.dc_coverageP  s    |Z?r%   c                 .    | j                  t        d      S )zVA sorted array of names of the authors of the resource, listed in order of precedence.creator)r   r   r   s    r#   
dc_creatorzXmpInformation.dc_creatorT  s     ##L)<<r%   c                 2    | j                  t        d|       y )Nr   )_set_seq_valuesr   r   s     r#   r   zXmpInformation.dc_creatorY      \9f=r%   c                 8    | j                  t        dt              S )zXA sorted array of dates of significance to the resource. The dates and times are in UTC.date)r   r   rM   r   s    r#   dc_datezXmpInformation.dc_date]  s     ##L&/JJr%   c                    || j                  t        dd        y g }|D ]Q  }t        |t        j                        r|j	                  t        |             8|j	                  t        |             S | j                  t        d|       y )Nr   )r   r   
isinstancerB   rb   rV   str)rX   r   date_stringsr   s       r#   r   zXmpInformation.dc_dateb  sr    >  vt<LeX%6%67 ''(<U(CD ''E
3	  
   v|Dr%   c                 .    | j                  t        d      S )zSA language-keyed dictionary of textual descriptions of the content of the resource.descriptionr   r   r   s    r#   dc_descriptionzXmpInformation.dc_descriptiono  s     ''mDDr%   c                 2    | j                  t        d|       y )Nr   _set_langalt_valuesr   r   s     r#   r   zXmpInformation.dc_descriptiont  s      }fEr%   c                 .    | j                  t        d      S )zThe mime-type of the resource.formatr   r   s    r#   	dc_formatzXmpInformation.dc_formatx       %%lH==r%   c                 2    | j                  t        d|       y )Nr   r   r   s     r#   r   zXmpInformation.dc_format}      |Xu=r%   c                 .    | j                  t        d      S )z"Unique identifier of the resource.
identifierr   r   s    r#   dc_identifierzXmpInformation.dc_identifier  s     %%lLAAr%   c                 2    | j                  t        d|       y )Nr   r   r   s     r#   r   zXmpInformation.dc_identifier  s    |\5Ar%   c                 .    | j                  t        d      S )zAAn unordered array specifying the languages used in the resource.languager   r   s    r#   dc_languagezXmpInformation.dc_language       j99r%   c                 2    | j                  t        d|       y )Nr   r   r   s     r#   r   zXmpInformation.dc_language      \:v>r%   c                 .    | j                  t        d      S )z&An unordered array of publisher names.	publisherr   r   s    r#   dc_publisherzXmpInformation.dc_publisher  s     k::r%   c                 2    | j                  t        d|       y )Nr   r   r   s     r#   r   zXmpInformation.dc_publisher  s    \;?r%   c                 .    | j                  t        d      S )zLAn unordered array of text descriptions of relationships to other documents.relationr   r   s    r#   dc_relationzXmpInformation.dc_relation  r   r%   c                 2    | j                  t        d|       y )Nr   r   r   s     r#   r   zXmpInformation.dc_relation  r   r%   c                 .    | j                  t        d      S )z`A language-keyed dictionary of textual descriptions of the rights the user has to this resource.rightsr   r   s    r#   	dc_rightszXmpInformation.dc_rights  s     ''h??r%   c                 2    | j                  t        d|       y )Nr   r   r   s     r#   r   zXmpInformation.dc_rights  s      x@r%   c                 .    | j                  t        d      S )zCUnique identifier of the work from which this resource was derived.sourcer   r   s    r#   	dc_sourcezXmpInformation.dc_source  r   r%   c                 2    | j                  t        d|       y )Nr   r   r   s     r#   r   zXmpInformation.dc_source  r   r%   c                 .    | j                  t        d      S )z\An unordered array of descriptive phrases or keywords that specify the topic of the content.subjectr   r   s    r#   
dc_subjectzXmpInformation.dc_subject  s     i88r%   c                 2    | j                  t        d|       y )Nr   r   r   s     r#   r   zXmpInformation.dc_subject  r   r%   c                 .    | j                  t        d      S )z9A language-keyed dictionary of the title of the resource.titler   r   s    r#   dc_titlezXmpInformation.dc_title  s     ''g>>r%   c                 2    | j                  t        d|       y )Nr   r   r   s     r#   r   zXmpInformation.dc_title  s      w?r%   c                 .    | j                  t        d      S )z@An unordered array of textual descriptions of the document type.typer   r   s    r#   dc_typezXmpInformation.dc_type  s     f55r%   c                 2    | j                  t        d|       y )Nr  r   r   s     r#   r  zXmpInformation.dc_type  s    \66:r%   c                 .    | j                  t        d      S )z:An unformatted text string representing document keywords.Keywordsr   PDF_NAMESPACEr   s    r#   pdf_keywordszXmpInformation.pdf_keywords       %%mZ@@r%   c                 2    | j                  t        d|       y )Nr  r   r	  r   s     r#   r
  zXmpInformation.pdf_keywords      }j%@r%   c                 .    | j                  t        d      S )z-The PDF file version, for example 1.0 or 1.3.
PDFVersionr  r   s    r#   pdf_pdfversionzXmpInformation.pdf_pdfversion  s     %%m\BBr%   c                 2    | j                  t        d|       y )Nr  r  r   s     r#   r  zXmpInformation.pdf_pdfversion  s    }lEBr%   c                 .    | j                  t        d      S )z6The name of the tool that saved the document as a PDF.Producerr  r   s    r#   pdf_producerzXmpInformation.pdf_producer  r  r%   c                 2    | j                  t        d|       y )Nr  r  r   s     r#   r  zXmpInformation.pdf_producer  r  r%   c                 8    | j                  t        dt              S )zYThe date and time the resource was originally created. Returned as a UTC datetime object.
CreateDater   XMP_NAMESPACErM   r   s    r#   xmp_create_datezXmpInformation.xmp_create_date       %%m\?SSr%   c                 |    |r#t        |      }| j                  t        d|       y | j                  t        dd        y )Nr  rV   r   r  rX   r   date_strs      r#   r  zXmpInformation.xmp_create_date  3    +E2H""=,I""=,Er%   c                 8    | j                  t        dt              S )zTThe date and time the resource was last modified. Returned as a UTC datetime object.
ModifyDater  r   s    r#   xmp_modify_datezXmpInformation.xmp_modify_date  r  r%   c                 |    |r#t        |      }| j                  t        d|       y | j                  t        dd        y )Nr#  r  r  s      r#   r$  zXmpInformation.xmp_modify_date  r!  r%   c                 8    | j                  t        dt              S )zjThe date and time that any metadata for this resource was last changed. Returned as a UTC datetime object.MetadataDater  r   s    r#   xmp_metadata_datez XmpInformation.xmp_metadata_date  s     %%m^_UUr%   c                 |    |r#t        |      }| j                  t        d|       y | j                  t        dd        y )Nr'  r  r  s      r#   r(  z XmpInformation.xmp_metadata_date  s3    +E2H""=.(K""=.$Gr%   c                 .    | j                  t        d      S )z=The name of the first known tool used to create the resource.CreatorTool)r   r  r   s    r#   xmp_creator_toolzXmpInformation.xmp_creator_tool  s     %%m]CCr%   c                 2    | j                  t        d|       y )Nr+  )r   r  r   s     r#   r,  zXmpInformation.xmp_creator_tool  s    }mUCr%   c                 .    | j                  t        d      S )zGThe common identifier for all versions and renditions of this resource.
DocumentIDr   XMPMM_NAMESPACEr   s    r#   xmpmm_document_idz XmpInformation.xmpmm_document_id       %%o|DDr%   c                 2    | j                  t        d|       y )Nr/  r   r1  r   s     r#   r2  z XmpInformation.xmpmm_document_id"      eDr%   c                 .    | j                  t        d      S )zZAn identifier for a specific incarnation of a document, updated each time a file is saved.
InstanceIDr0  r   s    r#   xmpmm_instance_idz XmpInformation.xmpmm_instance_id&  r3  r%   c                 2    | j                  t        d|       y )Nr8  r5  r   s     r#   r9  z XmpInformation.xmpmm_instance_id+  r6  r%   c                 .    | j                  t        d      S )zMThe part of the PDF/A standard that the document conforms to (e.g., 1, 2, 3).partr   PDFAID_NAMESPACEr   s    r#   pdfaid_partzXmpInformation.pdfaid_part/  s     %%&6??r%   c                 2    | j                  t        d|       y )Nr<  r   r>  r   s     r#   r?  zXmpInformation.pdfaid_part4  s    /?r%   c                 .    | j                  t        d      S )zFThe conformance level within the PDF/A standard (e.g., 'A', 'B', 'U').conformancer=  r   s    r#   pdfaid_conformancez!XmpInformation.pdfaid_conformance8  s     %%&6FFr%   c                 2    | j                  t        d|       y )NrC  rA  r   s     r#   rD  z!XmpInformation.pdfaid_conformance=  s    /Fr%   c           
         t        | d      si | _        | j                  dt              D ]  }|j                  }	 |j                  d      }|dk(  rn/|d| t        t        ||dz   |dz    d	            z   ||dz   d z   }F|j                  |j                  k(  r|j                  }n| j                  |      }|| j                  |<    | j                  S )
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   ↂr7   Nr         )base)hasattrrG  r   PDFX_NAMESPACE	localNamefindchrr2   r   r   r   ra   )rX   nodekeyidxr   s        r#   custom_propertiesz XmpInformation.custom_propertiesA  s     t12&(D#33BGnn((8,CbyDS	c#cAga"8rBCDcAgi.)   ==D$7$77 NNE NN40E/4'',! H" &&&r%   c                 `   | j                   j                  t        d      D ]  }|j                  t        d      |k(  s|c S  | j                   j                  }|t        d      |j                  t        d      }|j                  t        d|       | j                   j                  |       |S )zBGet or create an rdf:Description element with the given about URI.r   r   XMP Document is Nonezrdf:Descriptionz	rdf:about)	rn   r^   r_   r   ownerDocumentr   createElementNSsetAttributeNSappendChild)rX   r~   r   docs       r#   _get_or_create_descriptionz)XmpInformation._get_or_create_description`  s    MM88VD""=':iG W mm));"#9::""=2CDM;	B!!$'r%   c                 P    | j                   j                  |      }|r	||v r||= yyy)z<Remove a cached value for a given namespace/name if present.N)ro   r   )rX   r   r   r   s       r#   _clear_cache_entryz!XmpInformation._clear_cache_entryn  s,    ::>>),( )8r%   c                 *   | j                  ||       | j                         }t        |j                  ||            }|D ]  }|j	                  |        |j                  ||      x}r|j                  |       || j                  j                  }|t        d      | j                  |      }	|j                  ||	 d|       }|j                  t        |            }
|j                  |
       |j                  |       | j                          y)z&Set or remove a single metadata value.NrU  r6   )r]  r[  listr^   removeChildr   removeAttributeNodern   rV  r   _get_namespace_prefixrW  createTextNoder   rY  _update_stream)rX   r   r   r   r   existing_elementselemexisting_attrrZ  prefix	text_nodes              r#   r   z XmpInformation._set_single_valuet  s   	40..0 !<!<Y!MN%DT" & !33ItDD=D$$]3----C{&'=>>//	:F&&yVHAdV2DED**3u:6IY'T"r%   c                    | j                  ||       | j                         }t        |j                  ||            }|D ]  }|j	                  |        |r| j
                  j                  }|t        d      | j                  |      }|j                  || d|       }|j                  t        d      }	|D ]T  }
|j                  t        d      }|j                  t        |
            }|j                  |       |	j                  |       V |j                  |	       |j                  |       | j                          y)z+Set or remove bag values (unordered array).NrU  r6   zrdf:Bagrdf:lir]  r[  r_  r^   r`  rn   rV  r   rb  rW  r_   rc  r   rY  rd  )rX   r   r   r   r   re  rf  rZ  rh  bagr   r]   ri  s                r#   r   zXmpInformation._set_bag_values  &   	40..0 !<!<Y!MN%DT" & ----C{&'=>>//	:F&&yVHAdV2DED%%mY?C((A..s5z:	y)#	   S!T"r%   c                    | j                  ||       | j                         }t        |j                  ||            }|D ]  }|j	                  |        |r| j
                  j                  }|t        d      | j                  |      }|j                  || d|       }|j                  t        d      }	|D ]T  }
|j                  t        d      }|j                  t        |
            }|j                  |       |	j                  |       V |j                  |	       |j                  |       | j                          y)z.Set or remove sequence values (ordered array).NrU  r6   zrdf:Seqrk  rl  )rX   r   r   r   r   re  rf  rZ  rh  seqr   r]   ri  s                r#   r   zXmpInformation._set_seq_values  rn  r%   c                    | j                  ||       | j                         }t        |j                  ||            }|D ]  }|j	                  |        |r| j
                  j                  }|t        d      | j                  |      }|j                  || d|       }|j                  t        d      }	|j                         D ]i  \  }
}|j                  t        d      }|j                  d|
       |j                  t        |            }|j                  |       |	j                  |       k |j                  |	       |j                  |       | j!                          y)z*Set or remove language alternative values.NrU  r6   zrdf:Altrk  r   )r]  r[  r_  r^   r`  rn   rV  r   rb  rW  r_   itemssetAttributerc  r   rY  rd  )rX   r   r   r   r   re  rf  rZ  rh  r   langr   r]   ri  s                 r#   r   z"XmpInformation._set_langalt_values  s>   	40..0 !<!<Y!MN%DT" & ----C{&'=>>//	:F&&yVHAdV2DED%%mY?C%||~e((A
D1..s5z:	y)#  . S!T"r%   c                 .    t         j                  |d      S )z?Get the appropriate namespace prefix for a given namespace URI.unknown)_NAMESPACE_PREFIX_MAPr   )rX   r   s     r#   rb  z$XmpInformation._get_namespace_prefix  s    $((I>>r%   c                     | j                   j                  }|t        d      |j                  d      }| j                  j                  |       y)z/Update the stream with the current XML content.NrU  ru   )encoding)rn   rV  r   toxmlri   rv   )rX   rZ  xml_datas      r#   rd  zXmpInformation._update_stream  sD    mm));"#9::99g9.X&r%   )r   rY   r    )r   )r   N)B__name__
__module____qualname____doc__r   rs   classmethodrz   r   r   r   bytesr}   r   r   r   r   
XmlElementra   r$   r   r   r   r_  r   r   dictr   propertyr   setterr   r   rB   r   r   r   r   r   r   r   r   r   r   r   r  r
  r  r  r  r$  r(  r,  r2  r9  r?  rD  rS  r[  r]  r   r   r   r   rb  rd  r!   r%   r#   rY   rY      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  rB   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   r  r	  r1  rL  r>  rw  compileVERBOSEr:   r   rw   r$   r   rM   rV   r_  rg   rY   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%   