
    )im                       S r SSKJr  SSKrSSK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  SSKJrJrJrJr  SS	KJr  SS
KJr  SSKJr  SSKJr  SSKJr  SSKJ r   SSK!J"r"J#r#  SSK$J%r%  SSK&J'r'  SSK(J)r)J*r*  SSK+J,r,  SSK-J.r.  SSK/J0r0J1r1  \(       a   SSK2J3r3  SSK4J5r5  SSK6J7r7  SSK8J9r9J:r:  SSK;J<r<   " S S\.5      r=S1S jr>\	S2S  j5       r?          S3S! jr@S4S5S" jjrA      S6S# jrB      S7S$ jrCS8S% jrD1 S&krE1 S'krFSS(.         S9S) jjrG          S:S* jrHSSS+.         S;S, jjrI          S<S- jrJS=S. jrKS=S/ jrL    S>S0 jrMg)?zmPrivate logic related to fields (the `Field()` function and `FieldInfo` class), and arguments to `Annotated`.    )annotationsN)Mapping)cache)	Parameterismethoddescriptor	signature)Pattern)TYPE_CHECKINGAnyCallableTypeVar)PydanticUndefined)TypeIs)AnnotationSource)PydanticDeprecatedSince211)PydanticUserError   )AliasGenerator   )	_generics_typing_extra)ConfigWrapper)extract_docstrings_from_cls)import_cached_base_modelimport_cached_field_info)
NsResolver)Representation)can_be_positionalget_first_not_noneBaseMetadata)	FieldInfo)	BaseModel)PydanticDataclassStandardDataclass)DecoratorInfosc                      \ rS rSrSrSrSrg)PydanticMetadata&   z0Base class for annotation markers like `Strict`. N)__name__
__module____qualname____firstlineno____doc__	__slots____static_attributes__r*       Z/var/www/html/land-doc-ocr/venv/lib/python3.13/site-packages/pydantic/_internal/_fields.pyr(   r(   &   s
    :Ir2   r(   c                 "    [        5       " U 5      $ )zCreate a new `_PydanticGeneralMetadata` class with the given metadata.

Args:
    **metadata: The metadata to add.

Returns:
    The new `_PydanticGeneralMetadata` class.
)_general_metadata_cls)metadatas    r3   pydantic_general_metadatar7   ,   s     !"8,,r2   c                 2    SSK Jn    " S S[        U 5      nU$ )zCDo it this way to avoid importing `annotated_types` at import time.r   r    c                  "    \ rS rSrSrSS jrSrg)7_general_metadata_cls.<locals>._PydanticGeneralMetadata=   z,Pydantic general metadata like `max_digits`.c                    Xl         g N__dict__)selfr6   s     r3   __init__@_general_metadata_cls.<locals>._PydanticGeneralMetadata.__init__@   s    $Mr2   r>   N)r6   r   )r+   r,   r-   r.   r/   rA   r1   r*   r2   r3   _PydanticGeneralMetadatar:   =   s
    :	%r2   rC   )annotated_typesr!   r(   )r!   rC   s     r3   r5   r5   8   s     -%#3\ % $#r2   c                J   [        5       nU  GH  nSn[        U[        5      (       a  UR                  U5      S LnO&[        U[        5      (       a  UR                  U5      nU(       d  M^  U HV  n[        Xq5      (       d  M  [        Xt5      (       a  U[        US0 5      ;   a  M8  [        SU< S[        Xq5       SU< S35      e   / nU  H  n	[        U	[        5      (       a:  U	R                  U5      (       d"  UR                  SU	R                  < S35        MP  MR  UR                  U	5      (       a  Mj  UR                  S	U	 S	35        M     S
SR                  U5       [        U5      S:X  a  SOS 3n
[        R                  " SU< SU< SU< SU
 S3	[         SS9  GM     g )NF__pydantic_fields__Field z conflicts with member z of protected namespace .zre.compile()'(z, r   z,)z in z$ conflicts with protected namespace zX.

You may be able to solve this by setting the 'protected_namespaces' configuration to    
stacklevel)r   
isinstancer	   matchstr
startswithhasattr
issubclassgetattr
ValueErrorappendpatternjoinlenwarningswarnUserWarning)protected_namespacesann_namebasescls_namer#   protected_namespacens_violationbvalid_namespacespnvalid_namespaces_strs              r3   _check_protected_namespacesrh   F   s    )*I3)733.44X>dJL+S11#../BCL<1''&q44WQPegiEj9j($XL0GPQH\G]67J6MQP   /1 .B!"g..!xx11,33k"**q4QR  2  (22266,33at1I> / *+4995E+F*GPSTdPeijPjpsGt'u$XLXL8\]p\s tl mA  lB  BCD 	7  4r2   c                    [        XS9nUR                  5        H$  u  pEUR                  b  M  XC;   d  M  X4   Ul        M&     g )Nuse_inspect)r   itemsdescription)clsfieldsrk   fields_docsr_   
field_infos         r3   _update_fields_from_docstringsrr   q   s;    -cKK &!!)h.E%0%:J" !/r2   c                    UR                   c?  U " X5      n[        U[        5      (       d  [        SU  SUR                   35      eX2l         g g )Nzfield_title_generator  must return str, not )titlerO   rQ   	TypeError	__class__)title_generator
field_namerq   ru   s       r3   *_apply_field_title_generator_to_field_inforz   x   sU    
 
7%%%4_4EE[\a\k\k[lmnn   r2   c                   UR                   b8  UR                   S::  d(  UR                  b  UR                  b  UR                  Gc   Su  p4n[	        U [
        5      (       a  U R                  U5      u  p4nOH[        U 5      (       a8  U " U5      n[	        U[        5      (       d  [        SU  SUR                   35      eUR                   b  UR                   S::  a  SUl         UR                   S:X  a&  [        XS5      Ul        [        XC5      Ul        X2l        UR                  c  X2l        UR                  c  [        XS5      Ul        UR                  c  [        XC5      Ul        ggg)ab  Apply an alias generator to aliases on a `FieldInfo` instance if appropriate.

Args:
    alias_generator: A callable that takes a string and returns a string, or an `AliasGenerator` instance.
    field_name: The name of the field from which to generate the alias.
    field_info: The `FieldInfo` instance to which the alias generator is (maybe) applied.
Nr   )NNNzalias_generator rt   )alias_priorityaliasvalidation_aliasserialization_aliasrO   r   generate_aliasescallablerQ   rv   rw   r   )alias_generatorry   rq   r}   r~   r   s         r3   $_apply_alias_generator_to_field_infor      s]    	!!)$$)#&&.))17G4!4o~66;J;[;[\f;g8E%8o&&#J/EeS))"2?2CCYZ_ZiZiYj kll
 $$,
0I0IQ0N()J% $$)-?@S-[J**<=M*UJ'$ #$))1-?@S-[J*&&.*<=M*UJ' /9 2r2   c                    UR                   =(       d    U R                   nUb  [        X1U5        U R                  b  [        U R                  X5        gg)aX  Update the `FieldInfo` instance from the configuration set on the model it belongs to.

This will apply the title and alias generators from the configuration.

Args:
    config_wrapper: The configuration from the model.
    field_name: The field name the `FieldInfo` instance is attached to.
    field_info: The `FieldInfo` instance to update.
N)field_title_generatorrz   r   r   )config_wrapperry   rq   r   s       r3   update_field_from_configr      sN     '<<d@d@d(23HV`a%%1,^-K-KZd 2r2   >   copydictjson_iter_calculate_keys_copy_and_set_values>
   schemafrom_ormvalidate	construct	parse_obj	parse_raw
_get_value
parse_fileschema_jsonupdate_forward_refs)typevars_mapc               r	  ^^ [        5       n[        5       mU R                  n0 n[        U5       H*  n[	        USS5      =n(       d  M  UR                  U5        M,     [        R                  " XS9n	[        R                  " U 5      n
0 n[        5       nU	R                  5        GH  u  nu  pUS:X  a  M  [        UR                  UUU R                  S9  [        R                  " U5      (       a  UR                  U5        M_  [	        X[         5      mT[         LaU  [#        UU4S j[$         5       5      (       d0  ['        TS5      (       a%  [#        UU4S j[(         5       5      (       a  [         m[+        U5      (       d  M  U R,                  (       a  US	:w  a  [/        S
U< S35      e[	        U S0 5      R1                  S5      nU H  n[2        R4                  " U5      (       a  [2        R6                  " U5      OS Vs1 s H  nUR8                  iM     nn['        X}5      (       d  Mb  UUL a  Mi  UU;   a  Mq  X;  a  Mx  [:        R<                  " SU SU R>                   SUR>                   S3[@        SS9  M     T[         L aS  X;   d  X;  a5  URC                  U[D        RF                  S9nU(       d  SUl$        UUl%        GOXm   RM                  5       nGO[O        TU5      (       aL  [Q        TRR                  5      (       a2  TRR                  RU                  SU 5      nUTl)        UTRV                  S'   URY                  UT[D        RF                  S9nTUl-        U(       d  SUl$        UUl%        O`SUR\                  ;   aP  UR_                  5       (       d;  [:        R<                  " SU< SU< SU< S3[`        SS9  UR                  U5        GM-   [c        X5        U Rf                  S   nUURh                  ;   a  [k        SU< S U R                  < S!35      eUX'   URH                  (       d  GM  [m        XU5        GM     U(       a;  URo                  5        H'  nURH                  (       d  M  URq                  U5        M)     URr                  (       a  [u        X5        X4$ s  snf ! [d         a     Nf = f)"a  Collect the fields and class variables names of a nascent Pydantic model.

The fields collection process is *lenient*, meaning it won't error if string annotations
fail to evaluate. If this happens, the original annotation (and assigned value, if any)
is stored on the created `FieldInfo` instance.

The `rebuild_model_fields()` should be called at a later point (e.g. when rebuilding the model),
and will make use of these stored attributes.

Args:
    cls: BaseModel or dataclass.
    config_wrapper: The config wrapper instance.
    ns_resolver: Namespace resolver to use when getting model annotations.
    typevars_map: A dictionary mapping type variables to their concrete types.

Returns:
    A two-tuple containing model fields and class variables names.

Raises:
    NameError:
        - If there is a conflict between a field name and protected namespaces.
        - If there is a field other than `root` in `RootModel`.
        - If a field shadows an attribute in the parent model.
rF   N)ns_resolvermodel_config)r^   r_   r`   ra   c              3  B   >#    U  H  n[        TUS 5      TL v   M     g 7fr=   )rU   .0	depr_name
BaseModel_assigned_values     r3   	<genexpr>'collect_model_fields.<locals>.<genexpr>  s!     qXp9
It4FXps   __func__c              3  l   >#    U  H)  n[        [        TUS 5      SS 5      TR                  L v   M+     g 7f)Nr   )rU   r   r   s     r3   r   r   "  s6      %B	 GJ	4@*dSWeWnWnn%Bs   14rootzUnexpected field with name z4; only 'root' is allowed as a field of a `RootModel`__pydantic_generic_metadata__originr*   zField name "z" in "z"" shadows an attribute in parent ""   rM   _sourceFdefaultfinalzAnnotation z= is marked as final and has a default value. Pydantic treats zz as a class variable, but it will be considered as a normal field in V3 to be aligned with dataclasses. If you still want zV to be considered as a class variable, annotate it as: `ClassVar[<type>] = <default>.`)categoryrN   __pydantic_decorators__rG   z
 of class zf overrides symbol of same name in a parent class. This override with a computed_field is incompatible.);r   r   	__bases__reversedrU   updater   get_model_type_hintssafe_get_annotationssetrl   rh   r^   r+   is_classvar_annotationaddr   any_deprecated_method_namesrS   _deprecated_classmethod_namesis_valid_field_name__pydantic_root_model__	NameErrorgetdataclassesis_dataclassro   namer[   r\   r-   r]   from_annotationr   CLASS	_complete_original_annotation_copyrO   r   r   __get___attributes_setfrom_annotated_attribute_original_assignment_qualifiersis_requiredr   delattrAttributeErrorr?   computed_fieldsrv   r   valuesapply_typevars_mapuse_attribute_docstringsrr   )rn   r   r   r   
FieldInfo_r`   parent_fields_lookupbasemodel_fields
type_hintsr   ro   
class_varsr_   ann_type	evaluatedgeneric_originfielddataclass_fieldsrq   r   
decoratorsr   r   s                         @@r3   collect_model_fieldsr      s   > *+J)+JMME13"4)>EE<E ''5   33CQJ  44S9K#%F5J+5+;+;+=''8~% #!/!D!D\\		
 //99NN8$ 0AB!22qXpqqq 
33 %B   /N"8,,&&8v+=-h\9mn  !&ErJNNxXDEPE]E]^bEcEc););D)Aik)k )ku

)k    t&&>)// ."8*F33C3C2D E))*!- 	% 2 ..&(*N (77JZJ`J`7a
 +0J( 7?J3 2;AAC
 .*55:L^McMc:d:d )0088sC)0&<C..y9#<<X~_o_u_u<vJ /=J+',
$2:
/J222:;Q;Q;S;S!(-jksjv w""*  .DE 8  x(
& &)\\2K%L
z111Js||.> ?G G  &$^zJU ,>X ]]_E((6 % ..&s3M \ " s    R$R))
R65R6c                  [        5       n0 nUR                  U 5         U R                  R                  5        H  u  pgUR                  (       a  XuU'   M  UR
                  n[        R                  " UR                  /UR                  Q76 n	[        R                  " X5      n	UR                  =n
[        L a  UR                  U	[        R                   S9nOUR#                  X[        R                   S9nUR
                  b  UR
                  OUUl        [%        XU5        XU'   M     SSS5        U$ ! , (       d  f       U$ = f)a  Rebuild the (already present) model fields by trying to reevaluate annotations.

This function should be called whenever a model with incomplete fields is encountered.

Raises:
    NameError: If one of the annotations failed to evaluate.

Note:
    This function *doesn't* mutate the model fields in place, as it can be called during
    schema generation, where you don't want to mutate other model's fields.
r   N)r   pushrF   rl   r   rm   r   	eval_typer   types_namespacer   replace_typesr   r   r   r   r   r   r   )rn   r   r   r   r   rebuilt_fieldsf_namerq   existing_descannassign	new_fields               r3   rebuild_model_fieldsr     s)   $ *+J+-N			#	"%"9"9"?"?"AF##)3v& * 6 6#--33 00  --c@(===FBSS * : :3HXH^H^ : _I * C CCYiYoYo C pIAJAVAVAb	(=(=hu	%(K)2v&% #B 
* + 
	* s   D
D22
E)r   r   c          
        [        5       n0 nU=(       d
    [        5       nU R                  n[        U R                  5       GH:  n[
        R                  " U5      (       d  M!  UR                  U5         UR                  5        GH  u  p[        R                  " U5      n
X;  a  M#  UR                  u  p[        R                  " U	R                  X5      u  p[        R                  " U5      (       a  Mq  U	R                  (       d<  U	R                   [
        R"                  L a  U	R$                  [
        R"                  L a  M  ['        U	R                   U5      (       a  U	R                   R(                  (       a*  U	R                   R                  SL a  [+        SU S3SS9eGM  UR-                  XR                   [.        R0                  S9nU	R                   Ul        O$UR-                  X[.        R0                  S9nXl        U(       d  SUl        Xl        XU'   [9        XU5        UR                   [:        Ld  GM  ['        [=        XU5      U5      (       d  GM  [?        XUR                   5        GM     SSS5        GM=     U(       a(  URA                  5        H  nURC                  U5        M     URD                  (       a  [G        U U[I        U S5      (       + S	9  U$ ! , (       d  f       GM  = f)
aX  Collect the fields of a dataclass.

Args:
    cls: dataclass.
    config_wrapper: The config wrapper instance.
    ns_resolver: Namespace resolver to use when getting dataclass annotations.
        Defaults to an empty instance.
    typevars_map: A dictionary mapping type variables to their concrete types.

Returns:
    The dataclass fields.
FzDataclass field zD has init=False and init_var=True, but these are mutually exclusive.zclashing-init-and-init-var)coder   N__is_pydantic_dataclass__rj   )%r   r   __dataclass_fields__r   __mro__r   r   r   rl   r   r   r   try_eval_typetyper   initr   MISSINGdefault_factoryrO   init_varr   r   r   	DATACLASSr   r   r   r   r   rU   setattrr   r   r   rr   rS   )rn   r   r   r   r   ro   r   r   r_   dataclass_field	base_annsglobalnslocalnsr   r   rq   r   s                    r3   collect_dataclass_fieldsr     s   & *+J#%F-K//
 %''--d#-=-C-C-E))>>tD	, $/$?$?!&3&A&A/BVBVX`&j# 77AA (,,'//;3F3FF'77;;N;NN o55zBB&..77*22775@"3"28*  =A  !B%A#  !!+!D!D "9"9CSC]C] "E "J 7F6M6MJ3!+!D!D ;K;U;U "E "J 7F3 +0J(6>3#-x (:N%%->>:C:6
D D C:+=+=>m .F $#	 &z ]]_E $$\2	 % ..& $C)DEE	
 MS $#s   3GK:KK
K,	c               6   [        5       n0 nUR                  U 5         U R                  R                  5        H  u  pgUR                  (       a  XuU'   M  UR
                  n[        R                  " UR                  /UR                  Q76 n	[        R                  " X5      n	UR                  U	UR                  [        R                  S9n
U
R
                  b  U
R
                  OUU
l        [!        XU
5        XU'   M     SSS5        U$ ! , (       d  f       U$ = f)a  Rebuild the (already present) dataclass fields by trying to reevaluate annotations.

This function should be called whenever a dataclass with incomplete fields is encountered.

Raises:
    NameError: If one of the annotations failed to evaluate.

Note:
    This function *doesn't* mutate the dataclass fields in place, as it can be called during
    schema generation, where you don't want to mutate other dataclass's fields.
r   N)r   r   rF   rl   r   rm   r   r   r   r   r   r   r   r   r   r   r   )rn   r   r   r   r   r   r   rq   r   r   r   s              r3   rebuild_dataclass_fieldsr   8  s   $ *+J+-N			#	"%"9"9"?"?"AF##)3v& * 6 6#--33 00  --c@&??33,66 @ 	 BKAVAVAb	(=(=hu	%(K)2v&' #B 
, - 
	, s   C!D		
Dc                .    U R                  S5      (       + $ )N_rR   r   s    r3   r   r   f  s    s###r2   c                ^    U R                  S5      =(       a    U R                  S5      (       + $ )Nr  __r  r  s    r3   is_valid_privateattr_namer  j  s"    ??3=(=$==r2   c                    [        U 5      n[        UR                  R                  5       5      n[        U5      S:H  =(       a4    [        US   5      =(       a    US   R                  [        R                  L $ ! [        [        4 a     gf = f)zMWhether the provided default factory callable has a validated data parameter.Fr   r   )r   rV   rv   list
parametersr   rZ   r   r   r   empty)r   sigr
  s      r3   takes_validated_data_argumentr  n  s    ( cnn++-.Jz?aq$5jm$DqTUI^I^bkbqbqIqq 	"  s   A9 9BB)r6   r   returnr!   )r  ztype[BaseMetadata])
r^   ztuple[str | Pattern[str], ...]r_   rQ   r`   ztuple[type[Any], ...]ra   rQ   r  None)F)rn   z	type[Any]ro   dict[str, FieldInfo]rk   boolr  r  )rx   zCallable[[str, FieldInfo], str]ry   rQ   rq   r"   )r   z%Callable[[str], str] | AliasGeneratorry   rQ   rq   r"   )r   r   ry   rQ   rq   r"   r  r  )
rn   type[BaseModel]r   r   r   NsResolver | Noner   zMapping[TypeVar, Any] | Noner  z%tuple[dict[str, FieldInfo], set[str]])
rn   r  r   r   r   r   r   Mapping[TypeVar, Any]r  r  )
rn   ztype[StandardDataclass]r   r   r   r  r   zdict[Any, Any] | Noner  r  )
rn   ztype[PydanticDataclass]r   r   r   r   r   r  r  r  )r   rQ   r  r  )r   z3Callable[[], Any] | Callable[[dict[str, Any]], Any]r  z'TypeIs[Callable[[dict[str, Any]], Any]])Nr/   
__future__r   _annotationsr   r[   collections.abcr   	functoolsr   inspectr   r   r   rer	   typingr
   r   r   r   pydantic_corer   typing_extensionsr   typing_inspection.introspectionr   pydanticr   pydantic.errorsr   aliasesr    r   r   _configr   _docs_extractionr   _import_utilsr   r   _namespace_utilsr   _reprr   _utilsr   r   rD   r!   ro   r"   mainr#   _dataclassesr$   r%   _decoratorsr&   r(   r7   r5   rh   rr   rz   r   r   r   r   r   r   r   r   r   r  r  r*   r2   r3   <module>r,     s&   s 2   #  < <  8 8 + $ < / - $ & " 9 M ( ! 9," B+~ 	- 
$ 
$(8(( !( 	(
 
(V;
!4
!
! 
!/V:/VHK/VYb/Vde" h ! & 26D	D!D #D
 /D +DN*	* "* 	*
 (* *b &**.i	 i "i #	i
 (i iX+	 + "+ 	+
 (+ +\$>rHr,rr2   