
    h_Q                    J   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
  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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/J0r0  SSK1J2r2  \(       a  SSK3J4r4  SSK5J6r6  SSK7J8r8  SSK9J:r:  SSK;J<r<   " S S\05      r=S,S  jr>\
S-S! j5       r?S.S/S" jjr@SS#.         S0S$ jjrAS1S% jrB        S2S& jrCSSSS'.         S3S( jjrDS4S) jrES4S* jrF    S5S+ jrGg)6zmPrivate logic related to fields (the `Field()` function and `FieldInfo` class), and arguments to `Annotated`.    )annotationsN)Mapping)copy)cache)	Parameterismethoddescriptor	signature)Pattern)TYPE_CHECKINGAnyCallableTypeVar)PydanticUndefined)TypeIs
get_origin)typing_objects)AnnotationSource)PydanticDeprecatedSince211)PydanticUserError   )	_generics_typing_extra)ConfigWrapper)extract_docstrings_from_cls)import_cached_base_modelimport_cached_field_info)
NsResolver)Representation)can_be_positionalBaseMetadata   )	FieldInfo)	BaseModel)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*       L/var/www/html/env/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__A   s    $Mr2   r=   N)r6   r   )r+   r,   r-   r.   r/   r@   r1   r*   r2   r3   _PydanticGeneralMetadatar:   >   s
    :	%r2   rB   )annotated_typesr!   r(   )r!   rB   s     r3   r5   r5   9   s     -%#3\ % $#r2   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fieldsrF   fields_docsann_name
field_infos         r3   _update_fields_from_docstringsrN   G   s;    -cKK &!!)h.E%0%:J" !/r2   )typevars_mapc               b   [        5       n[        5       n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
U R                  R                  S0 5      n0 n[        5       nU
R                  5        GH  u  nu  nnUS:X  a  M  UR                   GHc  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 HW  n[%        UU5      (       d  M  ['        UU5      (       a  U[	        US0 5      ;   a  M:  [)        SU S[	        UU5       S	U S
35      e   SnUR                   Hd  n[        U[        5      (       a.  UR                  U5      (       d  USUR*                   S34-  nMD  MF  UR#                  U5      (       a  M^  UU4-  nMf     [,        R.                  " SU SU R0                   SU SU S3	[2        5        GMf     [        R4                  " U5      (       a  UR7                  U5        GM  [	        X[8        5      n[;        U5      (       d  GM  U R<                  (       a  US:w  a  [)        SU< S35      e[	        U S0 5      R                  S5      nU H  n[>        R@                  " U5      (       a  [>        RB                  " U5      OS Vs1 s H  nURD                  iM     nn[%        X5      (       d  Mb  UUL a  Mi  UU;   a  Mq  X;  a  Mx  [,        R.                  " SU SU RF                   SURF                   S3[2        5        M     U[8        L aN  X;   d  X;  a5  URI                  U[J        RL                  S9nU(       d  SUl'        UUl(        GO3[S        X~   5      nGO$[U        X5        [        UU5      (       a;  [W        URX                  5      (       a!  URX                  R[                  SU 5      Ul,        U(       d  [        UU5      (       a  [S        U5      OUnUR]                  UU[J        RL                  S9nU(       d  SUl'        UUl(        UUl/        O`SUR`                  ;   aP  URc                  5       (       d;  [,        R.                  " SU< SU< SU< S 3[d        S!S"9  UR7                  U5        GMA   [g        X5        U R                  S#   nUURj                  ;   a  [m        S$U< S%U R0                  < S&35      eUX'   GM     U(       a;  URo                  5        H'  nURN                  (       d  M  URq                  U5        M)     URr                  (       a  [u        X5        X4$ s  snf ! [h         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.
__pydantic_fields__N)ns_resolver__annotations__model_configFzField "z" conflicts with member z of protected namespace "z".r*   zre.compile()z" in z( has conflict with protected namespace "z_".

You may be able to resolve this warning by setting `model_config['protected_namespaces'] = z`.rootzUnexpected field with name z4; only 'root' is allowed as a field of a `RootModel`__pydantic_generic_metadata__originzField name "z" in "z"" shadows an attribute in parent ""_source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>.`   )category
stacklevel__pydantic_decorators__zField z
 of class zf overrides symbol of same name in a parent class. This override with a computed_field is incompatible.);r   r   	__bases__reversedgetattrupdater   get_model_type_hintsr>   getsetrG   protected_namespaces
isinstancer
   matchstr
startswithhasattr
issubclass	NameErrorpatternwarningswarnr+   UserWarningis_classvar_annotationaddr   is_valid_field_name__pydantic_root_model__dataclassesis_dataclassrJ   namer-   from_annotationr   CLASS	_complete_original_annotationr   #_warn_on_nested_alias_in_annotationr   default__get__from_annotated_attribute_original_assignment_qualifiersis_requiredr   delattrAttributeErrorcomputed_fields	TypeErrorvaluesapply_typevars_mapuse_attribute_docstringsrN   )rI   config_wrapperrR   rO   r$   
FieldInfo_basesparent_fields_lookupbasemodel_fields
type_hintsr   rJ   
class_varsrL   ann_type	evaluatedprotected_namespacens_violationbvalid_namespacespnassigned_valuegeneric_originfielddataclass_fieldsrM   original_assignment
decoratorss                                r3   collect_model_fieldsr   N   s   > )*I)+JMME13"4)>EE<E ''5   33CQJ ,,""#4b9K#%F5J+5+;+;+=''8Y~% #1#F#F!&L-w77288B$N/55'223FG|Aq(++ *1i 8 8XQRTikmIn=n"+")(3KGTUW_L`Ka";<O;PPR!T#   (*$,AA%b'22#%88H#5#5 0{2::,a5P4R R 0 $6 $,#6#6r#:#: 0RE 9 0 B MM!(5>fgzf{ |DDTCUUWY $	3 $G> //99NN8$ 0AB"8,,&&8v+=-h\9mn  !&ErJNNxXDEPE]E]^bEcEc););D)Aik)k )ku

)k    t&&>)// ."8*F33C3C2D E))*!-% 0 ..&(*N (77JZJ`J`7a
 +0J( 7?J3 ""6"@A
 0C.*55:L^McMc:d:d *8)?)?)G)Gc)R& -6*^U_:`:`^$ft   $<<X~_o_u_u<vJ',
$ 3;
/2E
/J222:;Q;Q;S;S!(-jksjv w""*  .DE 8  x(
& &)\\2K%L
z111Js||.> ?G G  &e ,>h ]]_E((6 % ..&s3I ` " s   =V*V!!
V.-V.c                \   [        5       n[        U SS 5      nU(       a  U H  n[        R                  " [	        U5      5      (       d  M)  [
        R                  " U5       HD  n[        XR5      (       d  M  UR                  c  M$  [        R                  " SU S3[        5            g    M     g g )N__args__z `alias` specification on field "z5" must be set on outermost annotation to take effect.)r   rc   r   is_annotatedr   r   get_argsri   aliasrq   rr   rs   )r   rL   r#   argsanno_arganno_type_args         r3   r   r     s    (*I8Z.DH**:h+?@@%2%;%;H%EM!-;;@S@S@_ >xjH}~'  &F  r2   c               p   [        5       n0 nUR                  U 5         U R                  R                  5        H  u  pVUR                  (       a  XdU'   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        XU'   M     SSS5        U$ ! , (       d  f       U$ = f)aT  Rebuild the (already present) model fields by trying to reevaluate annotations.

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

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.
rZ   N)r   pushrQ   rG   r}   rH   r   	eval_typer~   types_namespacer   replace_typesr   r   r{   r   r|   r   )rI   rR   rO   r   rebuilt_fieldsf_namerM   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	%)2v&# #B 
( ) 
	( s   C>D&&
D5)rR   rO   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  pXR                  R                  S0 5      ;  a  M'  UR                  u  p[        R                  " U	R                  X5      u  p[        R                  " U5      (       a  Mu  U	R                   (       d<  U	R"                  [
        R$                  L a  U	R&                  [
        R$                  L a  M  [)        U	R"                  U5      (       an  U	R"                  R*                  (       a*  U	R"                  R                   SL a  [-        SU S3SS9eGM"  UR/                  XR"                  [0        R2                  S9nOUR/                  X[0        R2                  S9nXU'   UR"                  [4        Ld  GM  [)        [7        XU5      U5      (       d  GM  [9        XUR"                  5        GM     SSS5        GM
     U(       a(  UR;                  5        H  nUR=                  U5        M     Ub+  UR>                  (       a  [A        U U[C        U S	5      (       + S
9  U$ ! , (       d  f       GM{  = f)aX  Collect the fields of a dataclass.

Args:
    cls: dataclass.
    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.
    config_wrapper: The config wrapper instance.

Returns:
    The dataclass fields.
rS   FzDataclass field zD has init=False and init_var=True, but these are mutually exclusive.zclashing-init-and-init-var)coderZ   N__is_pydantic_dataclass__rE   )"r   r   __dataclass_fields__rb   __mro__rx   ry   r   rG   r>   rf   r   r   try_eval_typetypert   initr   MISSINGdefault_factoryri   init_varr   r   r   	DATACLASSr   rc   setattrr   r   r   rN   rm   )rI   rR   rO   r   r   rJ   r   r   rL   dataclass_fieldglobalnslocalnsr   _rM   r   s                   r3   collect_dataclass_fieldsr   T  sf   & *+J#%F-K//
 %''--d#-=-C-C-E)==#4#45F#KK $/$?$?!+99/:N:NPXb 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 ",!D!D ;K;U;U "E "J $.x %%->>:C:6
D D C:+=+=>[ .F $#	 &h ]]_E $$\2	 % !n&M&M& $C)DEE	
 MA $#s   3FJ,J,%J,,
J<	c                .    U R                  S5      (       + $ )Nr   rl   rz   s    r3   rv   rv     s    s###r2   c                ^    U R                  S5      =(       a    U R                  S5      (       + $ )Nr   __r   r   s    r3   is_valid_privateattr_namer     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	   
ValueErrorr   list
parametersr   lenr   r   r   empty)r   sigr   s      r3   takes_validated_data_argumentr     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])F)rI   	type[Any]rJ   dict[str, FieldInfo]rF   boolr   None)
rI   type[BaseModel]r   r   rR   NsResolver | NonerO   zMapping[TypeVar, Any] | Noner   z%tuple[dict[str, FieldInfo], set[str]])r   r   rL   rk   r   r   )rI   r   rR   r   rO   zMapping[TypeVar, Any]r   r   )
rI   ztype[StandardDataclass]rR   r   rO   zdict[Any, Any] | Noner   zConfigWrapper | Noner   r   )rz   rk   r   r   )r   z3Callable[[], Any] | Callable[[dict[str, Any]], Any]r   z'TypeIs[Callable[[dict[str, Any]], Any]])Hr/   
__future__r   _annotationsrx   rq   collections.abcr   r   	functoolsr   inspectr   r   r	   rer
   typingr   r   r   r   pydantic_corer   typing_extensionsr   r   typing_inspectionr   typing_inspection.introspectionr   pydanticr   pydantic.errorsr    r   r   _configr   _docs_extractionr   _import_utilsr   r   _namespace_utilsr   _reprr   _utilsr   rC   r!   rJ   r#   mainr$   _dataclassesr%   _decoratorsr&   r(   r7   r5   rN   r   r   r   r   rv   r   r   r*   r2   r3   <module>r      se   s 2   #   < <  8 8 + 0 , < / - & " 9 M ( ! %," /+~ 	- 
$ 
$; 26K	K!K #K
 /K +K\ %	% % (	%
 %V &**.+/`	 ` #` (	`
 )` `F$>rHr,rr2   