+
    Ĝi%              	          ^ RI HtHt ^ RIHtHt ^ RIHtHtHtH	t	 ^ RIH
t
 ^ RIt ] . R!Ot ! R R]4      t]! R	R
]/R7      t]! RP'                  R" U u. uF  p RV ,           NK  	  up 4      R
]/R7      t]! RR
]/R7      t]! R4      tR#R ltR#R ltR tR tR tR tR tR tR#R ltR t  ! R R4      t!]!! 4       t"RRR]"3R lt#R t$R t%R t&R  t'R#   ] d    ]t Li ; iu up i )$    )XPathElementBase)
fromstringXHTML_NAMESPACE)_forms_xpath_options_xpath_nons_transform_result)defsNFormNotFoundDefaultErrorCreatorc                       ] tR t^tRtRtR# )r   z"
Raised when no form can be found
 N)__name__
__module____qualname____firstlineno____doc____static_attributes__r       [/Users/mibo/.openclaw/workspace/.venv-ak/lib/python3.14/site-packages/lxml/html/formfill.pyr   r      s    r   zKdescendant-or-self::form[name=$name]|descendant-or-self::x:form[name=$name]x)
namespaces|zdescendant-or-self::z-//label[@for=$for_id]|//x:label[@for=$for_id]z"descendant-or-self::*[@name=$name]c                 6    \        WVR 7      p \        W4       R# )form_id
form_indexN)
_find_form
_fill_form)elvaluesr   r   s   &&&&r   	fill_formr#      s     
BJ	?Brr   c                     \        V 4      p\        V \        4      '       d   \        V 4      pM\        P
                  ! V 4      p\        WQW#R 7       \        WE4      # )r   )type
isinstance
basestringr   copydeepcopyr#   r
   )htmlr"   r   r   result_typedocs   &&&&  r   fill_form_htmlr-   &   sE    t*K$
##mmD!c7B[..r   c                 <   / p\        VR 4      '       d   VP                  4       p\        V 4      pV F  pVP                  R4      pV'       g   K  \	        V4      '       d?   VP                  V. 4      p\        V\        \        34      '       g   V.p\        WF4       Km  WQ9  d   Ku  VP                  V^ 4      pV^,           W%&   W,          p\        V\        \        34      '       d    Wg,          pM	V^ 8  d   K  \        WF4       K  	  R#   \         d     K  i ; i)mixednameN)hasattrr/   _input_xpathget_takes_multipler&   listtuple_fill_multiple
IndexError_fill_single)r!   r"   countsinputsinputr0   valueindexs   &&      r   r    r    /   s    Fvw"Fyy 5!!JJtR(EedE]335(JJtQ'E 19FLLE%$//!LE &- $ " s   )DDDc                     \        V P                  4      R 8X  d   V P                  R4      '       d   R# V P                  RR4      P                  4       pVR9   d   R# R# )selectmultipleTr%    F)radiocheckbox)r	   tagr3   lower)r<   r%   s   & r   r4   r4   M   sL    UYY8#		*(=(=99VR &&(D$$r   c                 (   V P                  R R4      P                  4       pVR8X  db   V P                  R4      pVf=   V'       g   RpM$V^ ,          p\        V\        4      '       d   VR8H  p\	        W4       R# \	        WV9   4       R# VR8X  d"   V P                  R4      p\	        WV9   4       R# \        V P                  4      R8X  g   Q h\        V 4       F6  pVP                  R4      pVf   VP                  4       p\        WSV9   4       K8  	  R# )	r%   rB   rD   r=   NFonrC   r@   )
r3   rF   r&   r'   _checkr	   rE   r   text_content_select)r<   r=   r%   vresultoptions   &&    r   r7   r7   V   s    99VR &&(DzIIg9qeZ00#t^F5!5u*%	IIgu5j!UYY8+++$U+F

7#Ay '')FJ' ,r   c                 ~    V'       d   V P                  R R4       R# R V P                  9   d   V P                  R  R# R# )checkedrB   Nsetattrib)r!   checks   &&r   rI   rI   r   s0    
y"		!		)$ "r   c                 ~    V'       d   V P                  R R4       R# R V P                  9   d   V P                  R  R# R# )selectedrB   NrQ   )r!   r@   s   &&r   rK   rK   y   s0    
z2"		*% #r   c                 n    \        V P                  4      R 8X  d	   Wn        R# V P                  RV4       R# )textarear=   N)r	   rE   textrR   )r<   r=   s   &&r   r9   r9      s&    UYY:%
		'5!r   c           
         Vf&   Vf"   \        V 4      pV F  pVu # 	  \        R4      hVee   V P                  V4      pVe   V# \        WR7      pV'       d
   V^ ,          # \        R\        : RRP                  \        V 4      4      : R24      hVe   \        V 4      p W2,          # R #   \         d    \        RT\        T4      3,          4      hi ; i)NzNo forms in pager0   zNo form with the name or id of z	 (forms: z, )z3There is no form with the index %r (%i forms found))	r   r   get_element_by_id_form_name_xpathidjoin_find_form_idsr8   len)r!   r   r   formsforms   &&&  r   r   r      s    :-R DK   	 ##G,K 28Otyy!3467 7 R 	,$$   	,Es5z*+, ,	,s   "B, ,)Cc              #     "   \        V 4      pV'       g   R x  R# \        V4       F  w  r#VP                  R4      '       dX   VP                  R4      '       d,   VP                  R4      : RVP                  R4      : 2x  K^  VP                  R4      x  Ks  VP                  R4      '       d   VP                  R4      x  K  RV,          x  K  	  R# 5i)z
(no forms)Nr_   r0   z or z(unnamed form %s))r   	enumerater3   )r!   rc   r>   rd   s   &   r   ra   ra      s     E '88D>>xx$(HHTN%)XXf%57 7 hhtn$XXf((6""%-- (s   ACAC1&Cc                   D   a  ] tR t^t o RtRtRtRtRtRt	R t
R tRtV tR	# )
r   Tdivzerror-messagezerror-blockInvalidc                    VP                  4        F4  w  r#\        W4      '       g   \        R V,          4      h\        WV4       K6  	  R# )zUnexpected keyword argument: %sN)itemsr1   	TypeErrorsetattr)selfkwr0   r=   s   &,  r   __init__DefaultErrorCreator.__init__   s>    88:KD4&&5<> >D&	 &r   c                    VP                  V P                  4      pV P                  '       d   VP                  R V P                  4       V'       dM   V P                  '       d;   VP                  R VP                  R R4      R,           V P                  ,           4       Ve   VR8X  d   V P                  p\        V\        4      '       d   VP                  V4       M?\        V\        4      '       g   Q RV,          4       hT;'       g    V P                  Vn        V'       dd   V P                  '       dR   V P                  '       d-   VP                  Vn        RVn        VP                  ^ V4       R# VP                  V4       R# VP!                  4       pVP#                  V4      pV P                  '       d   VP                  Wd4       R# VP                  Vn        RVn        VP                  V^,           V4       R# )classrB    Nz.Bad message; should be a string or element: %r)makeelementerror_container_tagerror_message_classrR   error_block_classr3   default_messager&   r   appendr'   rY   block_insideinsert_beforetailinsert	getparentr>   )rn   r!   is_blockmessageerror_elparentposs   &&&&   r   __call__DefaultErrorCreator.__call__   sp   >>$":":;###LL$":":;...LL(,,w";C"?@V@V"VW?gm**Gg{++OOG$gz22 L@7JL2#;;t';';HM)))!!! "		!X&		(#\\^F,,r"C!!!c, "c!eX.r   r   N)r   r   r   r   r|   r{   rv   rw   rx   ry   rp   r   r   __classdictcell__)__classdict__s   @r   r   r      s5     ML)%O'/ /r   errorc           	         \        WVR 7      p VP                  4        F`  w  rgVf   K  \        WV4       FE  w  r\        V	\        \        R4      \        34      '       g   Q RV	,          4       h\        WWE4       KG  	  Kb  	  R# )r   NzBad message: %r)r   rk   _find_elements_for_namer&   r'   r%   r   _insert_error)
r!   errorsr   r   error_classerror_creatorr0   r   r   r   s
   &&&&&&    r   insert_errorsr      sv     
BJ	?B||~=!85!IHg
DJ'LMM -!G+-M([H "J &r   c                     \        V 4      p\        V \        4      '       d   \        V 4      pM\        P
                  ! V 4      p\        WA3/ VB  \        W44      # )N)r%   r&   r'   r   r(   r)   r   r
   )r*   r"   ro   r+   r,   s   &&,  r   insert_errors_htmlr      sH    t*K$
##mmD!#$$[..r   c                    \        V P                  4      \        P                  9   g   \        V P                  4      R 8X  d   RpMRp\        V P                  4      R8w  d   V'       d   \	        W4       V P                  R4      '       d8   \        W P                  R4      R7      pV'       d   V F  p\	        Wb4       K  	  V! WV4       R# )rX   FTrd   r_   )for_idN)r	   rE   r   
empty_tags
_add_classr3   _label_for_xpath)r!   r   r   r   r   labelslabels   &&&&   r   r   r     s    RVV}'5=J+FRVV};2#	vvd||!"VVD\:5.  "&r   c                     V P                  R 4      '       d2   V P                  R V P                  R 4      R,           V,           4       R# V P                  R V4       R# )rs   rt   N)r3   rR   )r!   
class_names   &&r   r   r     s=    	vvg
ww+J67
w
#r   c              #   X  "   Vf   W3x  R # VP                  R4      '       d$   V P                  VR,          4      pVe   W23x  R # \        WR7      pV'       g   R # \        V\        \
        34      '       g   V^ ,          V3x  R # \        WB4       F  w  r5Vf   K  W53x  K  	  R # 5i)N#:   NNr[   )
startswithr]   _name_xpathr&   r5   r6   zip)rd   r0   r   r!   elserrs   &&&   r   r   r     s     |ks##DH->)O
d
&CedE]++!fems?;g #s   "B*BB*)r   r#   r-   r   r   r   )r<   r@   rX   zx:inputzx:selectz
x:textarea)NN)(
lxml.etreer   r   	lxml.htmlr   r   r   r   r	   r
   r   r(   r'   	NameErrorstr__all__LookupErrorr   r^   r`   r2   r   r   r#   r-   r    r4   r7   rI   rK   r9   r   ra   r   default_error_creatorr   r   r   r   r   )_tags   0r   <module>r      sP   ) 1 L L  
"; 
 ftw  yH  tI  J SXX  HG  H  HGt5d::  HG  H  I+.*?AH+.*?A 89/'<(8%&",6.*,/ ,/\ ,-  'I"/'$Y  J Hs   C C&	C#"C#