+
    Crh?                        R t . R$Ot^ RIt^ RIt^ RIt^ RIt^ RIt^ RIH	t	 ^ RIH
t ^ RIHt ^ RIHtHtHt RtRtRtRtR	t]P*                  ! R
4      t]P*                  ! R4      tR tR tR%R ltR tR tRtRR/R ltR tR t R t!R t"R&R lt#R'R lt$R(R lt%R t&RR/R lt'R t(R t)R(R lt*]P*                  ! R ]PV                  4      t,R! t-R)R" lt.R*R# lt/R# )+zMiscellaneous utilities.N)quote)AddressList)	mktime_tz)	parsedateparsedate_tz_parsedate_tzz,  z
'z[][\\()<>@,:;".]z[\\"]c                L     V P                  4        R#   \         d     R# i ; i)z;Return True if s may contain surrogate-escaped binary data.FT)encodeUnicodeEncodeError)ss   &(/usr/local/lib/python3.14/email/utils.py_has_surrogatesr   /   s%    
	
 s    ##c                 J    V P                  R R4      pVP                  R R4      # )utf-8surrogateescapereplace)r   decode)stringoriginal_bytess   & r   	_sanitizer   <   s(    
 ]]7,=>N  )44    c                   V w  r#VP                  R4       V'       dX    VP                  R4       Rp\        P                  V4      '       d   Rp\        P	                  RV4      pV: V: V: RV: R2# V#   \
         dC    \        T\        4      '       d   ^ RIH	p T! T4      pTP                  T4      pT: RT: R2u # i ; i)a  The inverse of parseaddr(), this takes a 2-tuple of the form
(realname, email_address) and returns the string value suitable
for an RFC 2822 From, To or Cc header.

If the first element of pair is false, then the second element is
returned unmodified.

The optional charset is the character set that is used to encode
realname in case realname is not ASCII safe.  Can be an instance of str or
a Charset-like object which has a header_encode method.  Default is
'utf-8'.
asciir   "z\\\g<0>z <>)Charset)r   
specialsresearch	escapesresubr   
isinstancestremail.charsetr   header_encode)paircharsetnameaddressquotesr   encoded_names   &&     r   
formataddrr,   H   s     MDNN7	CKK  F  &&==T2D$*D&'BBN " 	7'3''1!'*"006L ,g66	7s   A7 7A
CCc              #      "   ^ pRp\        V 4       F.  w  rV'       d   VRV,           3x  RpK  VR8X  d   RpK)  W3x  K0  	  V'       d	   VR3x  R# R# 5i)    F\TN)	enumerate)addrposescapechs   &   r   _iter_escaped_charsr5   k   s]     
CFT?r	""F4ZF)O # Dk s   A	A
Ac                   RV 9  d   V # ^ pRp. p\        V 4       F:  w  rEVR8X  g   K  Vf   TpK  W8w  d   VP                  WV 4       V^,           pRpK<  	  V\        V 4      8  d   VP                  WR 4       RP                  V4      # )z Strip real names between quotes.r   Nr   )r5   appendlenjoin)r1   startopen_posresultr2   r4   s   &     r   _strip_quoted_realnamesr=   z   s    
$EHF&t,9$MM$X"67a - s4yd6l#776?r   Tstrictc                  V'       g4   \         P                  R V  4       4      p\        V4      pVP                  # V  Uu. uF  p\	        V4      NK  	  p p\        V 4      p \         P                  V 4      p\        V4      p\        VP                  4      p^ pV  F-  p\        V4      pV^VP                  R4      ,           ,          pK/  	  \        V4      V8w  d   R.# V# u upi )zReturn a list of (REALNAME, EMAIL) or ('','') for each fieldvalue.

When parsing fails for a fieldvalue, a 2-tuple of ('', '') is returned in
its place.

If strict is true, use a strict parser which rejects malformed inputs.
c              3   8   "   T F  p\        V4      x  K  	  R # 5iNr#   ).0vs   & r   	<genexpr>getaddresses.<locals>.<genexpr>   s     :kc!ffk   ,r   r   )

COMMASPACEr9   _AddressListaddresslistr#   _pre_parse_validation_post_parse_validationr=   countr8   )fieldvaluesr>   allarD   r1   r<   ns   &$      r   getaddressesrT      s    $ oo:k::}}#./;a3q6;K/'4K??;'DTA#AMM2F 	
A $A&	Q  6{azM% 0s    C c                     \        V 4      p ^ p\        V 4       F3  w  r#VR8X  d   V^,          pK  VR8X  g   K   V^,          pV^ 8  g   K2   R# 	  V^ 8H  # )r.   ()F)r=   r5   )r1   opensr2   r4   s   &   r   _check_parenthesisrY      sX    "4(DE&t,9QJE3YQJEqy - QJr   c                 d    . pV  F'  p\        V4      '       g   R pVP                  V4       K)  	  V# )z('', ''))rY   r7   )email_header_fieldsaccepted_valuesrD   s   &  r   rM   rM      s7    O !!$$Aq! !
 r   c                 ^    . pV  F$  pR V^,          9   d   RpVP                  V4       K&  	  V# )[rI   )r7   )parsed_email_header_tuplesr\   rD   s   &  r   rN   rN      s9    O (!A$;Aq! (
 r   c           	          R . ROV ^,          ,          V ^,          . ROV ^,          ^,
          ,          V ^ ,          V ^,          V ^,          V ^,          V3,          # )z"%s, %02d %s %04d %02d:%02d:%02d %s)MonTueWedThuFriSatSun)JanFebMarAprMayJunJulAugSepOctNovDec )	timetuplezones   &&r   _format_timetuple_and_zonerw      sZ    /9)A,G!	33<Q<!3C	E!ilIaL)A,3  r   c                $   V f   \         P                   ! 4       p \        P                  P                  V \        P                  P                  4      pV'       d   VP                  4       pRpMV'       g   VP                  RR7      p\        W24      # )a[  Returns a date string as specified by RFC 2822, e.g.:

Fri, 09 Nov 2001 01:08:47 -0000

Optional timeval if given is a floating-point time value as accepted by
gmtime() and localtime(), otherwise the current time is used.

Optional localtime is a flag that when True, interprets timeval, and
returns a date relative to the local timezone instead of UTC, properly
taking daylight savings time into account.

Optional argument usegmt means that the timezone is written out as
an ascii string, not numeric one (so "GMT" instead of "+0000"). This
is needed for HTTP, and is only used when localtime==False.
NF)tzinfo)timedatetimefromtimestamptimezoneutc
astimezoner   format_datetime)timeval	localtimeusegmtdts   &&& r   
formatdater      si    $ ))+				(	((2C2C2G2G	HB]]_ZZtZ$2&&r   c                   V P                  4       pV'       dF   V P                  e*   V P                  \        P                  P                  8w  d   \        R4      hRpM"V P                  f   RpMV P                  R4      p\        W#4      # )a  Turn a datetime into a date string as specified in RFC 2822.

If usegmt is True, dt must be an aware datetime with an offset of zero.  In
this case 'GMT' will be rendered instead of the normal +0000 required by
RFC2822.  This is to support HTTP headers involving date stamps.
z%usegmt option requires a UTC datetimeGMTz-0000z%z)ru   ry   r{   r}   r~   
ValueErrorstrftimerw   )r   r   nowrv   s   &&  r   r   r     sl     ,,.C99		X->->-B-B BDEE		{{4 %c00r   c                   ^ RI p^ RIp\        \        P                  ! 4       ^d,          4      p\        P
                  ! 4       pVP                  ^@4      pV f   Rp M	RV ,           p Vf   VP                  4       pRWEW`V3,          pV# )ac  Returns a string suitable for RFC 2822 compliant Message-ID, e.g:

<142480216486.20800.16526388040877946887@nightshade.la.mastaler.com>

Optional idstring if given is a string used to strengthen the
uniqueness of the message id.  Optional domain if given provides the
portion of the message id after the '@'.  It defaults to the locally
defined hostname.
Nr   .z<%d.%d.%d%s@%s>)randomsocketintrz   osgetpidgetrandbitsgetfqdn)idstringdomainr   r   r   pidrandintmsgids   &&      r   
make_msgidr     st     $))+c/"G
))+C  $G>~!w& IIELr   c           
      (   \        V 4      pVf   \        R\        V 4      ,          4      hVEv r#Vf   \        P                  ! VR,          !  # \        P                  ! VR,          R\        P                  ! \        P
                  ! VR7      4      / # )Nz!Invalid date value or format "%s":N   Nry   )seconds)r   r   r#   r{   r}   	timedelta)dataparsed_date_tzdtupletzs   &   r   parsedate_to_datetimer   ;  s    "4(N<s4yHII KV	z  &*--fRj F$$X%7%7%CDF Fr   c               x   V'       g)   \        V 4      P                  pV'       g   R# V^ ,          # \        V \        4      '       d
   V ^ ,          p \        V \        4      '       g   R# \        V .4      ^ ,          p \        \        V 4      P                  4      pV'       d   \        V4      ^8  d   R# V^ ,          # )z
Parse addr into its constituent realname and email address parts.

Return a tuple of realname and email address, unless the parse fails, in
which case return a 2-tuple of ('', '').

If strict is True, use a strict parser which rejects malformed inputs.
rI   )rK   rL   r"   listr#   rM   rN   r8   )r1   r>   addrss   &$ r   	parseaddrr   F  s     T"..OQx$AwdC   $(+D"<#5#A#ABECJN8Or   c                2   \        V 4      ^8  d   V P                  R4      '       d=   V P                  R4      '       d&   V ^R P                  RR4      P                  RR4      # V P                  R4      '       d   V P                  R4      '       d   V ^R # V # )zRemove quotes from a string.r   z\\r/   z\"<r   )r8   
startswithendswithr   rB   s   &r   unquoter   e  s~    
3x!|>>#3<<#4#4q9$$VT2::5#FF>>#3<<#4#4q9Jr   c                \    V P                  \        ^4      p\        V4      ^8:  d   RRV 3# V# )z#Decode string according to RFC 2231N)splitTICKr8   )r   partss   & r   decode_rfc2231r   q  s.    GGD!E
5zQT1}Lr   c                    \         P                  P                  T RT;'       g    RR7      p Vf   Vf   V # Vf   RpV: RV: RV : 2# )zEncode string according to RFC 2231.

If neither charset nor language is given, then s is returned as-is.  If
charset is given but not language, the string is encoded using the empty
string for language.
r   r   )safeencodingr	   )urllibparser   )r   r'   languages   &&&r   encode_rfc2231r   y  sN     	120B0B7CA8+ (A..r   z&^(?P<name>\w+)\*((?P<num>[0-9]+)\*?)?$c                   V ^ ,          .p/ pV R,           F  w  r4VP                  R4      p\        V4      p\        P                  V4      pV'       dI   VP	                  RR4      w  r7Ve   \        V4      pVP                  V. 4      P                  WtV34       K  VP                  VR\        V4      ,          34       K  	  V'       Edt   VP                  4        EF^  w  r8. pRp	\        ;QJ d    R V 4       F  '       g   K   RM	  RM! R V 4       4      p
V
'       d   V Uu. uF  q^ ,          f   K  VNK  	  ppM2V Uu. uF&  q^ ,          ;'       g    ^ V^,          V^,          3NK(  	  ppVP                  R	 R
7       V FB  w  r|pV'       d$   \        P                  P                  VRR7      pRp	VP                  V4       KD  	  \        \        P                  V4      4      pV	'       d.   \!        V4      w  rpVP                  W=VRV,          334       EKD  VP                  VRV,          34       EKa  	  V# u upi u upi )zwDecode parameters list according to RFC 2231.

params is a sequence of 2-tuples containing (param name, string value).
:   NN*r(   numz"%s"Fc              3   8   "   T F  q^ ,          ^ 8H  x  K  	  R# 5i)r.   Nrt   )rC   xs   & r   rE    decode_params.<locals>.<genexpr>  s     <mQ419mrG   Tc                     V ^ ,          # )r.   rt   )r   s   &r   <lambda>decode_params.<locals>.<lambda>  s    QqTr   )keyzlatin-1)r   )r   r   rfc2231_continuationmatchgroupr   
setdefaultr7   r   itemsanysortr   r   EMPTYSTRINGr9   r   )params
new_paramsrfc2231_paramsr(   valueencodedmor   continuationsextendedhas_zeror   r   r'   r   s   &              r   decode_paramsr     s   
 )J Nbzz--$!''-/ID#h%%dB/66G7LMtVeEl%:;< " ~#1#7#7#9DEH s<m<sss<m<<H,9 NMqqTM NBO P-QA$))!QqT1Q4!8- P>2 $1 ,,Q,CA#HQ $1 +**512E+9%+@(5!!48Ve^)L"MN!!4%"89; $:< / !O Ps   &I7IIIc                     \        V \        4      '       d   \        V 4      ^8w  d   \        V 4      # V w  r4pVf   Tp\	        VR4      p \        WcV4      #   \         d    \        T4      u # i ; i)   zraw-unicode-escape)r"   tupler8   r   bytesr#   LookupError)r   errorsfallback_charsetr'   r   textrawbytess   &&&    r   collapse_rfc2231_valuer     ss    eU##s5zQu~ $Gt #T/0H8f-- t}s   
A A/.A/c                f    V f   \         P                   P                  4       p V P                  4       # )aE  Return local time as an aware datetime object.

If called without arguments, return current time.  Otherwise *dt*
argument should be a datetime instance, and it is converted to the
local time zone according to the system time zone database.  If *dt* is
naive (that is, dt.tzinfo is None), it is assumed to be in local time.

)r{   r   r   )r   s   &r   r   r     s)     
z""$==?r   )r   r   r   r   r,   r   r   rT   r   r   r   r   r   r   r   )r   )NFF)F)NN)r   zus-asciirA   )0__doc____all__r   rerz   r{   urllib.parser   email._parseaddrr   r   rK   r   r   r   r   rJ   r   UEMPTYSTRINGCRLFr   compiler   r    r   r   r,   r5   r=   supports_strict_parsingrT   rY   rM   rN   rw   r   r   r   r   r   r   r   r   ASCIIr   r   r   r   rt   r   r   <module>r      s  
 $ 
 	    " 8 & C C

ZZ+,
JJx 		5 F2  ) )X	':1&8Fd >/ zz"KHH 4l4r   