+
    i0                        R t ^ RIHt ^ RIt^ RIHtHtHt ^ RI	H
t
 ^ RIHt ^ RIHtHtHt ^ RIHtHtHtHt ]'       d   ^ RIHt ^ R	IHt  ! R
 R]4      t ! R R]4      tR# )z4Custom element classes related to document comments.)annotationsN)TYPE_CHECKINGCallablecast)nsdecls)	parse_xml)ST_DateTimeST_DecimalNumber	ST_String)BaseOxmlElementOptionalAttributeRequiredAttribute
ZeroOrMore)CT_Tbl)CT_Pc                  Z    ] tR t^t$ RtR]R&   ]! R4      tR R ltR R lt	R	 R
 lt
RtR# )CT_Commentsa~  `w:comments` element, the root element for the comments part.

Simply contains a collection of `w:comment` elements, each representing a single comment. Each
contained comment is identified by a unique `w:id` attribute, used to reference the comment
from the document text. The offset of the comment in this collection is arbitrary; it is
essentially a _set_ implemented as a list.
zlist[CT_Comment]comment_lstz	w:commentc                   V ^8  d   QhRR/# )   return
CT_Comment )formats   "Y/Users/agent/.openclaw/workspace/.venv/lib/python3.14/site-packages/docx/oxml/comments.py__annotate__CT_Comments.__annotate__    s      Z     c           
         V P                  4       p\        \        \        R\	        R4       RV R24      4      pV P                  V4       V# )a  Return newly added `w:comment` child of this `w:comments`.

The returned `w:comment` element is the minimum valid value, having a `w:id` value unique
within the existing comments and the required `w:author` attribute present but set to the
empty string. It's content is limited to a single run containing the necessary annotation
reference but no text. Content is added by adding runs to this first paragraph and by
adding additional paragraphs as needed.
z<w:comment wz w:id="z" w:author="">  <w:p>    <w:pPr>      <w:pStyle w:val="CommentText"/>    </w:pPr>    <w:r>      <w:rPr>        <w:rStyle w:val="CommentReference"/>      </w:rPr>      <w:annotationRef/>    </w:r>  </w:p></w:comment>)_next_available_comment_idr   r   r   r   append)selfnext_idcomments   &  r   add_commentCT_Comments.add_comment    sU     113gcl^77) <  
$ 	Gr   c                    V ^8  d   QhRRRR/# )r   
comment_idintr   zCT_Comment | Noner   )r   s   "r   r   r   ?   s     9 9C 94E 9r   c                R    V P                  RV R24      pV'       d
   V^ ,          # R# )zRReturn the `w:comment` element identified by `comment_id`, or |None| if not found.z(./w:comment[@w:id='z'])[1]Nxpath)r"   r(   comment_elmss   && r   get_comment_by_idCT_Comments.get_comment_by_id?   s+    zz$8F"KL".|A8D8r   c                   V ^8  d   QhRR/# )r   r   r)   r   )r   s   "r   r   r   D   s      C r   c                    V P                  R4       Uu. uF  p\        V4      NK  	  pp\        VRR7      ^,           pVR8:  d   V# \        \	        V4      4       F  w  rEWE8w  g   K  Vu # 	  \        V4      # u upi )aF  The next available comment id.

According to the schema, this can be any positive integer, as big as you like, and the
default mechanism is to use `max() + 1`. However, if that yields a value larger than will
fit in a 32-bit signed integer, we take a more deliberate approach to use the first
ununsed integer starting from 0.
z./w:comment/@w:id)defaulti)r,   r)   max	enumeratesortedlen)r"   xused_idsr#   expectedactuals   &     r   r    &CT_Comments._next_available_comment_idD   s|     %)JJ/B$CD$CqCF$CDh+a/iN !*&*: ;H! !< 8} Es   A9r   N)__name__
__module____qualname____firstlineno____doc____annotations__r   r$   r%   r.   r    __static_attributes__r   r   r   r   r      s-     "!%G>9
 r   r   c                      ] tR t^[t$ Rt]! R]4      tR]R&   ]! R]	4      t
R]R&   ]! R]	4      tR	]R
&   ]! R]4      tR]R&   ]! RRR7      t]! RRR7      tR]R&   R]R&   R]R&   R]R&   ]R R l4       tRtR# )r   aA  `w:comment` element, representing a single comment.

A comment is a so-called "story" and can contain paragraphs and tables much like a table-cell.
While probably most often used for a single sentence or phrase, a comment can contain rich
content, including multiple rich-text paragraphs, hyperlinks, images, and tables.
zw:idr)   idzw:authorstrauthorz
w:initialsz
str | Noneinitialszw:datezdt.datetime | Nonedatezw:p)
successorszw:tblzCallable[[], CT_P]add_pz
list[CT_P]p_lstzlist[CT_Tbl]tbl_lstzCallable[[CT_Tbl], CT_Tbl]_insert_tblc                   V ^8  d   QhRR/# )r   r   zlist[CT_P | CT_Tbl]r   )r   s   "r   r   CT_Comment.__annotate__z   s     - -(; -r   c                $    V P                  R4      # )z8Generate all `w:p` and `w:tbl` elements in this comment.z./w:p | ./w:tblr+   )r"   s   &r   inner_content_elements!CT_Comment.inner_content_elementsy   s     zz+,,r   r   N)r=   r>   r?   r@   rA   r   r	   rE   rB   r
   rG   r   rH   r   rI   r   ptblpropertyrR   rC   r   r   r   r   r   [   s      (89B9#J	:FC:,iHj   1+ D
  	5R(A
W
,C ++- -r   r   )rA   
__future__r   datetimedttypingr   r   r   docx.oxml.nsr   docx.oxml.parserr   docx.oxml.simpletypesr   r	   r
   docx.oxml.xmlchemyr   r   r   r   docx.oxml.tabler   docx.oxml.text.paragraphr   r   r   r   r   r   <module>ra      sJ    : "  0 0   & J J ` `&-F/ FR!- !-r   