+
    f0iS                     :   ^ RI t ^ RIt^ RIt^ RIHtHt ^ RIHt ^ RIH	t	H
t
HtHt ^RIHt ]! ]P                   4      ^8X  d   ]P                   P#                  R4       R R ltR	 R
 ltR R lt]P                   R,          3R R llt]R8X  d
   ]! 4        R# R# )    N)defaultdictdeque)chain)AnyDefaultDictDictList)PDFz--helpc                F    V ^8  d   QhR\         R\        \        ,          /# )   p_strreturn)strr	   int)formats   "T/Users/agent/.openclaw/workspace/venv/lib/python3.14/site-packages/pdfplumber/cli.py__annotate__r      s      3 49     c                     R V 9   d=   \        \        V P                  R 4      4      w  r\        \	        W^,           4      4      # \        V 4      .# )-)mapr   splitlistrange)r   startends   &  r   parse_page_specr      s@    
e|ekk#./
E%q)**E
|r   c                Z    V ^8  d   QhR\         \        ,          R\        P                  /# )r   args_rawr   )r	   r   argparse	Namespace)r   s   "r   r   r      s$     / /c /x'9'9 /r   c                    \         P                  ! R 4      pVP                  RR\         P                  ! R4      R7       VP	                  4       pVP                  RRRR7       VP                  R	R
RR7       VP                  R. RORR7       VP                  RRR7       VP                  RRRR7       VP                  RRRR7       VP                  R\
        P                  R7       VP                  R\        R7       VP                  RR\        R7       VP                  R\        RR7       VP                  V 4      pVP                  e"   \        \        VP                  !  4      Vn
        V# )
pdfplumberinfile?rb)nargstypez--structurezoWrite the structure tree as JSON.  All other arguments except --pages, --laparams, and --indent will be ignored
store_true)helpactionz--structure-textzWrite the structure tree as JSON including text contents.  All other arguments except --pages, --laparams, and --indent will be ignoredz--formatcsv)choicesdefaultz--types+)r'   z--include-attrsz1Include *only* these object attributes in output.)r'   r*   z--exclude-attrsz,Exclude these object attributes from output.z
--laparams)r(   z--precisionz--pagesz--indentz&Indent level for JSON pretty-printing.)r(   r*   )r,   jsontext)r    ArgumentParseradd_argumentFileTypeadd_mutually_exclusive_groupr0   loadsr   r   
parse_argspagesr   r   )r   parsergroupargss   &   r   r7   r7      sw   $$\2F
(2C2CD2IJ//1E	W	   
W	   
,CUS
	-
@   ;   4::6
C0
	?C
#K   X&Dzz%,-
Kr   c                l    V ^8  d   QhR\         R\        \        \        \        3,          ,          RR/# )r   pdfdatar   N)r
   r	   r   r   r   )r   s   "r   r   r   I   s3     G G3 Gd4S>&: Gt Gr   c                    \        R  4      pV P                   FZ  pW#P                  ,          pVP                   F5  pVP	                  R4      pVf   K  WF;;,          VR,          ,          uu&   K7  	  K\  	  \        V4      pV'       d|   VP                  4       pRV9   d   VP                  VR,          4       VP	                  R4      p	V	f   KN  W),          pRV9   g   K_  VR,           Uu. uF  qdV,          NK  	  upVR&   K  R# u upi )c                       \        \        4      # )N)r   r    r   r   <lambda>#add_text_to_mcids.<locals>.<lambda>J   s	    {3?Or   mcidNr1   childrenpage_numbermcids)r   r8   rF   charsgetr   popleftextend)
r=   r>   page_contentspagetext_contentscrD   delpagenos
   &&        r   add_text_to_mcidsrS   I   s    +67O+PM		%&6&67A55=D|1V9,	   	dA
YY[HHR
^$&>%-b=:<W+F+$--+FBvJ  Gs   ,D:   NNc                >    V ^8  d   QhR\         \        ,          RR/# )r   r   r   N)r	   r   )r   s   "r   r   r   _   s      49  r   c                    \        V 4      p\        P                  ! VP                  VP                  VP
                  R 7      ;_uu_ 4       pVP                  '       d8   \        \        P                  ! VP                  VP                  R7      4       EMJVP                  '       dD   VP                  p\        W#4       \        \        P                  ! W1P                  RR7      4       MVP                  R8X  dN   VP                  \         P"                  VP$                  VP&                  VP(                  VP*                  R7       MVP                  R8X  d0   VP                   F  p\        VP-                  RR7      4       K   	  MWVP/                  \         P"                  VP$                  VP&                  VP(                  VP*                  VP                  R	7       R
R
R
4       R
#   + '       g   i     R
# ; i))r8   laparams)indentF)rX   ensure_asciir,   )	precisioninclude_attrsexclude_attrsr1   T)layout)rZ   r[   r\   rX   N)r7   r
   openr$   r8   rW   	structureprintr0   dumpsstructure_treerX   structure_textrS   r   to_csvsysstdouttypesrZ   r[   r\   extract_textto_json)r   r;   r=   treerM   s   &    r   mainrk   _   sP   hD	$++TZZ$--	H	HC>>>$**S//DE   %%Dc($**T++EJK[[E!JJ



.."00"00   [[F"		d''t'45 " KK



.."00"00{{  ' 
I	H	H	Hs   AG)'D8G))G:	__main__)r    r0   re   collectionsr   r   	itertoolsr   typingr   r   r   r	   r=   r
   lenargvappendr   r7   rS   rk   __name__rA   r   r   <module>rt      su      
 *  / / sxx=AHHOOH/dG,  #xx| @ zF r   