
    XiE{                    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Jr  SSKJr  SSKJr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/J0r0  SSK1J2r2J3r3  \(       a   SSK4J5r5  SSK6J7r7  SSK8J9r9  SSK:J;r;J<r<  SSK=J>r>   " S S\05      r?\R                  " S80 \,D6 " S  S!5      5       rAS9S" jrB\	S:S# j5       rC          S;S$ jrDS<S=S& jjrE      S>S' jrF      S?S( jrGS@S) jrH1 S*krI1 S+krJSS,.         SAS- jjrK          SBS. jrL          SCS/ jrMSSS0.         SDS1 jjrN          SES2 jrOSFS3 jrPSFS4 jrQ    SGS5 jrRSS%S6.         SHS7 jjrSg)IzmPrivate logic related to fields (the `Field()` function and `FieldInfo` class), and arguments to `Annotated`.    )annotationsN)Mapping)cache)	Parameterismethoddescriptor)Pattern)TYPE_CHECKINGAnyCallableTypeVarcast)PydanticUndefined)TypeIs)AnnotationSource)PydanticDeprecatedSince211)PydanticUserError   )AliasGenerator   )	_generics_typing_extra)ConfigWrapper)extract_docstrings_from_cls)import_cached_base_modelimport_cached_field_info)
slots_true)
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+       M/var/www/html/venv/lib/python3.13/site-packages/pydantic/_internal/_fields.pyr)   r)   '   s
    :Ir3   r)   c                  *    \ rS rSr% S\S'   S\S'   Srg)PydanticExtraInfo-   r
   
annotationboolcompleter+   N)r,   r-   r.   r/   __annotations__r2   r+   r3   r4   r6   r6   -   s     ONr3   r6   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    r4   pydantic_general_metadatar?   4   s     !"8,,r3   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>._PydanticGeneralMetadataE   z,Pydantic general metadata like `max_digits`.c                    Xl         g N__dict__)selfr>   s     r4   __init__@_general_metadata_cls.<locals>._PydanticGeneralMetadata.__init__H   s    $Mr3   rF   N)r>   r
   )r,   r-   r.   r/   r0   rI   r2   r+   r3   r4   _PydanticGeneralMetadatarB   E   s
    :	%r3   rK   )annotated_typesr"   r)   )r"   rK   s     r4   r=   r=   @   s     -%#3\ % $#r3   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              r4   _check_protected_namespacesrp   N   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  4r3   Fc                    [        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fieldsrs   fields_docsrg   
field_infos         r4   _update_fields_from_docstringsrz   y   s;    -cKK &!!)h.E%0%:J" !/r3   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 )titlerW   rY   	TypeError	__class__)title_generator
field_namery   r}   s       r4   *_apply_field_title_generator_to_field_infor      sU    
 
7%%%4_4EE[\a\k\k[lmnn   r3   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 r|   )alias_priorityaliasvalidation_aliasserialization_aliasrW   r   generate_aliasescallablerY   r~   r   r    )alias_generatorr   ry   r   r   r   s         r4   $_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 2r3   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_generatorr   r   r   )config_wrapperr   ry   r   s       r4   update_field_from_configr      sN     '<<d@d@d(23HV`a%%1,^-K-KZd 2r3   >   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 H  n['        X}5      (       d  M  X;  a  M  [	        U S0 5      R1                  S5      nUUL a  M?  [2        R4                  " U5      (       a  [2        R6                  " U5      OS Vs1 s H  nUR8                  iM     nnUU;   a  M  [:        R<                  " SU SU R>                   SUR>                   S3[@        SS9  M     T[         L ai  X;   d  X;  a5  URC                  U[D        RF                  S9nUUl$        U(       d  SUl%        GO/Xm   RM                  5       nU(       a  [O        UX#SS9nGO	UnGO[Q        TU5      (       aL  [S        TRT                  5      (       a2  TRT                  RW                  SU 5      nUTl*        UTRX                  S'   UR[                  UT[D        RF                  S9nTUl.        UUl$        U(       d  SUl%        O`SUR^                  ;   aP  URa                  5       (       d;  [:        R<                  " SU< SU< SU< S3[b        SS9  UR                  U5        GMC   [e        X5        U Rh                  S    nUURj                  ;   a  [m        S!U< S"U R                  < S#35      eUX'   URJ                  (       d  GM  [o        XU5        GM     URp                  (       a  [s        X5        SnS$U	;   a  U	S$   u  nn[u        UUS%9nUUU4$ s  snf ! [f         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 three-tuple containing the model fields, the `PydanticExtraInfo` instance if the `__pydantic_extra__` annotation is set,
    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.
rN   N)ns_resolvermodel_config)rf   rg   rh   ri   c              3  B   >#    U  H  n[        TUS 5      TL v   M     g 7frE   )r]   .0	depr_name
BaseModel_assigned_values     r4   	<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   )r]   r   r   s     r4   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 ""   rU   _sourceFTr   r   lenient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>.`)categoryrV   __pydantic_decorators__rO   z
 of class zf overrides symbol of same name in a parent class. This override with a computed_field is incompatible.__pydantic_extra__r8   r:   );r   r   	__bases__reversedr]   updater   get_model_type_hintssafe_get_annotationssetrt   rp   rf   r,   is_classvar_annotationaddr   any_deprecated_method_namesr[   _deprecated_classmethod_namesis_valid_field_name__pydantic_root_model__	NameErrorgetdataclassesis_dataclassrw   namerc   rd   r.   re   from_annotationr   CLASS_original_annotation	_complete_copy_recreate_field_inforW   r   r   __get___attributes_setfrom_annotated_attribute_original_assignment_qualifiersis_requiredr   delattrAttributeErrorrG   computed_fieldsr~   r   use_attribute_docstringsrz   r6   )rv   r   r   r   
FieldInfo_rh   parent_fields_lookupbasemodel_fields
type_hintscls_annotationsrw   
class_varsrg   ann_type	evaluatedgeneric_originfielddataclass_fieldsry   parent_field_infor   
decoratorspydantic_extra_infoannr:   r   r   s                             @@r4   collect_model_fieldsr      s   @ *+J)+JMME13"4)>EE<E ''5   33CQJ $88=O#%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  Dt&&2 ").Mr!R!V!VW_!`>) JUIaIabfIgIg[-?-?-Emo-o$-o5EJJ-o ! $ // "8*F33C3C2D E))*!- 	+ 8 ..*h.R (77JZJ`J`7a
2:
/ +0J(
 %9$B$H$H$J!  !5){gk"J "3J .*55:L^McMc:d:d )0088sC)0&<C..y9#<<X~_o_u_u<vJ /=J+.6J+',
$J222:;Q;Q;S;S!(-jksjv w""*  .DE 8  x(
& &)\\2K%L
z111Js||.> ?G G  &$^zJg ,>j ..&s348z)"#78X/

 &
22U$\ " s    R(R
R&%R&c          	        0 nUR                  U 5         U R                  R                  5        H7  u  pVUR                  (       a  XdU'   M  [	        XbUSS9n[        XU5        XtU'   M9     U R                  bY  U R                  R                  (       d>  [        [        R                  " U R                  R                  /UR                  Q76 SS9nOU R                  nSSS5        XH4$ ! , (       d  f       UW4$ = f)a6  Rebuild the (already present) model fields by trying to reevaluate annotations.

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

Returns:
    A two-tuple, the first element being the rebuilt fields, the second element being
    the rebuild `PydanticExtraInfo` instance, if available.

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.
Fr   NTr   )pushrN   rt   r   r   r   __pydantic_extra_info__r:   r6   r   	eval_typer8   types_namespace)	rv   r   r   r   rebuilt_fieldsf_namery   	new_fieldrebuilt_extra_infos	            r4   rebuild_model_fieldsr     s    , ,.N			#	"%"9"9"?"?"AF##)3v&0l\a	 )K)2v& #B &&23;V;V;_;_!2(22//::=H=X=X 	" "%!<!<' 
* --+ 
	* ---s   CC''
C8c                  [        5       nU R                  nU(       aE  [        R                  " U R                  U5      n[
        R                  " U/UR                  Q76 u  pgOd[
        R                  " U R                  /UR                  Q76 n[        R                  " Xb5      n[
        R                  " U/UR                  Q76 nSnU R                  =n[        L a  UR                  U[        R                  S9n	O$UR                  Xh[        R                  S9n	Xl	        Xil        U	R                  b  U	R                  OUU	l        U(       d  SU	l        U	$ )NTr   F)r   ru   r   replace_typesr   r   try_eval_typer   r   r   r   r   r   r   r   r   )
ry   r   r   r   r   existing_descr   r   assignr   s
             r4   r   r     s?    *+J**M%%j&E&E|T&44
((
Y %%++
((
 %%c8%%
((
 	1116GG..s<L<R<R.S	77M]McMc7d	)/&%("5>5J5J5VI11\iI#	r3   )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__rr   )%r   r   __dataclass_fields__r   __mro__r   r   r   rt   r   r   r   r   typer   initr   MISSINGdefault_factoryrW   init_varr   r   r   	DATACLASSr   r   r   r   r   r]   setattrvaluesapply_typevars_mapr   rz   r[   )rv   r   r   r   r   rw   r   r   rg   dataclass_field	base_annsglobalnslocalnsr   r   ry   r   s                    r4   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   rN   rt   r   ru   r   r   r   r   r   r   r   r   r   r	  r   )rv   r   r   r   r   r   r   ry   r   r   r   s              r4   rebuild_dataclass_fieldsr  {  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_rZ   r   s    r4   r   r     s    s###r3   c                ^    U R                  S5      =(       a    U R                  S5      (       + $ )Nr  __r  r  s    r4   is_valid_privateattr_namer    s"    ??3=(=$==r3   c                4    [         R                  " 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   signature_no_evalr^   r~   list
parametersr  rb   r   r   r   empty)r  sigr  s      r4   takes_validated_data_argumentr!    s    --o> cnn++-.Jz?aq$5jm$DqTUI^I^bkbqbqIqq 	"  s   B BB)validated_datacall_default_factoryc                   SSK Jn  Uc  U" U 5      $ U(       aC  [        US9(       a"  [        SU5      nUc  [	        S5      eU" U5      $ [        SU5      nU" 5       $ [
        $ )zMResolve the default value using either a static default or a default_factory.r   )smart_deepcopy)r  zCallable[[dict[str, Any]], Any]zpThe default factory requires the 'validated_data' argument, which was not provided when calling 'get_default()'.zCallable[[], Any])_utilsr%  r!  r   r^   r   )r   r  r"  r#  r%  facs         r4   resolve_default_valuer(    sp     'g&&(I8/JC%  G  ~&&*O<C5Lr3   r+   )r>   r
   returnr"   )r)  ztype[BaseMetadata])
rf   ztuple[str | Pattern[str], ...]rg   rY   rh   ztuple[type[Any], ...]ri   rY   r)  None)F)rv   z	type[Any]rw   dict[str, FieldInfo]rs   r9   r)  r*  )r   zCallable[[str, FieldInfo], str]r   rY   ry   r#   )r   z%Callable[[str], str] | AliasGeneratorr   rY   ry   r#   )r   r   r   rY   ry   r#   r)  r*  )
rv   type[BaseModel]r   r   r   r   r   zMapping[TypeVar, Any] | Noner)  z?tuple[dict[str, FieldInfo], PydanticExtraInfo | None, set[str]])
rv   r,  r   r   r   r   r   Mapping[TypeVar, Any]r)  z5tuple[dict[str, FieldInfo], PydanticExtraInfo | None])
ry   r#   r   r   r   r-  r   r9   r)  r#   )
rv   ztype[StandardDataclass]r   r   r   zNsResolver | Noner   zdict[Any, Any] | Noner)  r+  )
rv   ztype[PydanticDataclass]r   r   r   r   r   r-  r)  r+  )r   rY   r)  r9   )r  z3Callable[[], Any] | Callable[[dict[str, Any]], Any]r)  z'TypeIs[Callable[[dict[str, Any]], Any]])
r   r
   r  z:Callable[[], Any] | Callable[[dict[str, Any]], Any] | Noner"  zdict[str, Any] | Noner#  r9   r)  r
   )Tr0   
__future__r   _annotationsr   rc   collections.abcr   	functoolsr   inspectr   r   rer   typingr	   r
   r   r   r   pydantic_corer   typing_extensionsr   typing_inspection.introspectionr   pydanticr   pydantic.errorsr   aliasesr    r   r   _configr   _docs_extractionr   _import_utilsr   r   _internal_dataclassr   _namespace_utilsr   _reprr   r&  r   r    rL   r"   rw   r#   mainr$   _dataclassesr%   r&   _decoratorsr'   r)   	dataclassr6   r?   r=   rp   rz   r   r   r   r   r   r   r   r   r  r  r   r  r!  r(  r+   r3   r4   <module>rF     s   s 2   #  1  > > + $ < / - $ & " 9 M + ( ! 9," B+~  $$  %	- 
$ 
$(8(( !( 	(
 
(V;
!4
!
! 
!/V:/VHK/VYb/Vde" h ! & 26Q3	Q3!Q3 Q3
 /Q3 EQ3h,.	,. ",. 	,.
 (,. ;,.^))) ()
 ) )` &**.i	 i "i #	i
 (i iX+	 + "+ 	+
 (+ +\$>rHr,r( -1!&O *	
  	r3   