+
    ¿Ìj‡  ã                  ó6  € ^ RI Ht R.t^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RI	H
t
Ht ^RIHt ^RIHt ^RIHtHt ^RIHtHtHt ^R	IHt ]'       d   ^R
IHt ]P6                  ! ]4      t]P=                  ]P>                  ! 4       4        ! R R]4      t R# )é    )ÚannotationsÚ
AttachmentN)ÚOptionalÚTYPE_CHECKING)Ú	constants)ÚAttachmentBase)ÚAttachmentTypeÚSaveType)ÚcreateZipOpenÚinputToStringÚprepareFilename)ÚPropertiesStore)ÚMSGFilec                  ó˜   a € ] tR t^!tRtR V 3R lltR R ltR R ltR R	 lt]	R
 R l4       t
]	R R l4       t]	R R l4       tRtV ;t# )r   z,
A standard data attachment of an MSG file.
c               ó$   € V ^8„  d   QhRRRRRR/# )é   Úmsgr   Údir_ÚstrÚ	propStorer   © )Úformats   "Ú|/home/l0st/web/w4ttz.lol/public_html/toolz/MsgDoxxer/venv/lib/python3.14/site-packages/extract_msg/attachments/attachment.pyÚ__annotate__ÚAttachment.__annotate__&   s!   € ÷ =ñ =˜Gð =¨3ð =¸?ñ =ó    c                	óT   <€ \         SV `  WV4       V P                  R 4      V n        R# )z__substg1.0_37010102N)ÚsuperÚ__init__Ú	getStreamÚ_Attachment__data)Úselfr   r   r   Ú	__class__s   &&&&€r   r   ÚAttachment.__init__&   s#   ø€ Ü‰Ñ˜ IÔ.Ø—n‘nÐ%;Ó<ˆŽr   c               ó   € V ^8„  d   QhRR/# ©r   Úreturnr   r   )r   s   "r   r   r   *   s   € ÷ ñ  sñ r   c                óf  € RpVP                  R4      pV'       dJ   \        V4      p\        P                  P                  P                  V4      '       d   \        R4      hTpV# VP                  RR4      '       d   V P                  pV'       g   V P                  pV'       g   V P                  # V# )a  
Returns the filename to use for the attachment.

:param contentId: Use the contentId, if available.
:param customFilename: A custom name to use for the file.

If the filename starts with "UnknownFilename" then there is no guarantee
that the files will have exactly the same filename.
NÚcustomFilenamezfInvalid character found in customFilename. Must not contain any of the following characters: \/:*?"<>|Ú	contentIdF)
Úgetr   r   ÚreÚINVALID_FILENAME_CHARSÚsearchÚ
ValueErrorÚcidÚnameÚrandomFilename)r"   ÚkwargsÚfilenamer)   s   &,  r   ÚgetFilenameÚAttachment.getFilename*   sŸ   € ð ˆØŸ™Ð$4Ó5ˆßÜ  Ó0ˆNô �|‰|×2Ñ2×9Ñ9¸.×IÒIÜ ð  "Kó  Lð  LØ%ˆHð ˆð �z‰z˜+ u×-Ò-ØŸ8™8�çØŸ9™9�çØ×*Ñ*Ð*àˆr   c               ó   € V ^8„  d   QhRR/# )r   r'   ÚNoner   )r   s   "r   r   r   K   s   € ÷ Añ A dñ Ar   c           	     ó‚   € \        RRP                  R \        ^4       4       4      ,           R,           R4      V n        R# )z^
Used to regenerate the random filename used if the attachment cannot
find a usable filename.
zUnknownFilename Ú c              3  ó”   "  € T F>  p\         P                  ! \        P                  \        P                  ,           4      x € K@  	  R # 5i©N)ÚrandomÚchoiceÚstringÚascii_uppercaseÚdigits)Ú.0Ú_s   & r   Ú	<genexpr>Ú2Attachment.regenerateRandomName.<locals>.<genexpr>Q   s2   é € ð .Ù$,˜qô "Ÿ=š=¬×)?Ñ)?Ä&Ç-Á-Õ)O×PÐPÛ$,ùs   ‚AAz.binÚasciiN)r   ÚjoinÚrangeÚ_Attachment__randomName©r"   s   &r   ÚregenerateRandomNameÚAttachment.regenerateRandomNameK   sB   € ô
 *Ð*<Ø—7‘7ñ .Ü$)¨!¤Hó.ó .õ+.à06õ+7à8?óAˆÖr   c               ó   € V ^8„  d   QhRR/# )r   r'   zconstants.SAVE_TYPEr   )r   s   "r   r   r   T   s   € ÷ Rñ RÐ 3ñ Rr   c                ó’  € V P                   ! R/ VB p\        \        W P                  P                  4      4      pVP                  RR4      p\        V4      V8”  d>   \        P                  P                  V4      w  rEVRV\        V4      ,
           V,           pVP                  R4      pRp V'       d‘   \        V\        \        P                  34      '       d-   \        P                  ! VR\        P                   4      pWaR&   Rp\        P                  ! VP                  RR	4      4      p\#        VP$                  4      p	R
p
M<\        P                  ! VP                  RR4      4      P'                  4       pRp
\$        p	V P)                  WbW�4      pV	! \        V4      V
4      ;_uu_ 4       pVP+                  V P,                  4       RRR4       \.        P0                  \        V4      3V'       d   V'       d   VP3                  4        # # #   + '       g   i     LM; i  T'       d   T'       d   TP3                  4        i i i ; i)aÅ  
Saves the attachment data.

The name of the file is determined by several factors. The first
thing that is checked is if you have provided :param customFilename:
to this function. If you have, that is the name that will be used.
If no custom name has been provided and :param contentId: is ``True``,
the file will be saved using the content ID of the attachment. If
it is not found or :param contentId: is ``False``, the long filename
will be used. If the long filename is not found, the short one will
be used. If after all of this a usable filename has not been found, a
random one will be used (accessible from :meth:`randomFilename`).
After the name to use has been determined, it will then be shortened to
make sure that it is not more than the value of :param maxNameLength:.

To change the directory that the attachment is saved to, set the value
of :param customPath: when calling this function. The default save
directory is the working directory.

If you want to save the contents into a ``ZipFile`` or similar object,
either pass a path to where you want to create one or pass an instance
to :param zip:. If :param zip: is an instance, :param customPath: will
refer to a location inside the zip file.

:param extractEmbedded: If ``True``, causes the attachment, should it
    be an embedded MSG file, to save as a .msg file instead of calling
    it's save function.
:param skipEmbedded: If ``True``, skips saving this attachment if it is
    an embedded MSG file.
ÚmaxNameLengthé   NÚzipFÚaTÚ
customPathr:   ÚwÚ.Úwbr   )r5   r   r   r   ÚstringEncodingr+   ÚlenÚosÚpathÚsplitextÚ
isinstancer   ÚpathlibÚPathÚzipfileÚZipFileÚZIP_DEFLATEDr   ÚopenÚabsoluteÚ
_handleFncÚwriter!   r
   ÚFILEÚclose)r"   r3   r4   rO   r1   ÚextÚ_zipÚ
createdZiprS   Ú_openÚmodeÚfullFilenameÚfs   &,           r   ÚsaveÚAttachment.saveT   s»  € ð@ ×#Ò#Ñ- fÑ-ˆô #¤=°¿8¹8×;RÑ;RÓ#SÓTˆð Ÿ
™
 ?°CÓ8ˆô ˆx‹=˜=Ô(ÜŸ™×(Ñ(¨Ó2‰IˆDØÐ5˜]¬S°«XÕ5Ð6¸Õ<ˆHð �z‰z˜%Ó ˆàˆ
ð 	çô ˜d¤S¬'¯,©,Ð$7×8Ò8ä"Ÿ?š?¨4°´g×6JÑ6JÓK�DØ$(˜5‘MØ!%�Jô %Ÿ\š\¨&¯*©*°\À2Ó*FÓG�
ä% d§i¡iÓ0�à‘ä$Ÿ\š\¨&¯*©*°\À3Ó*GÓH×QÑQÓS�
Ø�Ü�àŸ?™?¨4¸:ÓNˆLá”s˜<Ó(¨$×/Ô/°1Ø—‘˜Ÿ™Ô$÷ 0ô —M‘M¤3 |Ó#4Ð5÷ Ÿ
Ø—
‘
•ð #ˆt÷ 0×/û÷ Ÿ
Ø—
‘
•ð #ˆtús1   Â.H" Â6C8H" Æ.HÇ
"H" ÈH	ÈH" È"IÈ3Ic               ó   € V ^8„  d   QhRR/# )r   r'   zOptional[bytes]r   )r   s   "r   r   r   ©   s   € ÷ ñ �oñ r   c                ó   € V P                   # )zg
The bytes making up the attachment data.

If the attachment data stream does not exist, returns None.
)r!   rJ   s   &r   ÚdataÚAttachment.data¨   s   € ð �{‰{Ðr   c               ó   € V ^8„  d   QhRR/# r&   r   )r   s   "r   r   r   ²   s   € ÷ %ñ % ñ %r   c                óv   €  V P                   #   \         d     T P                  4        T P                   u # i ; i)z4
The random filename to be used by this attachment.
)rI   ÚAttributeErrorrK   rJ   s   &r   r2   ÚAttachment.randomFilename±   s:   € ð
	%Ø×$Ñ$Ð$øÜô 	%Ø×%Ñ%Ô'Ø×$Ñ$Ò$ð	%ús   ‚ Ž'8·8c               ó   € V ^8„  d   QhRR/# )r   r'   r	   r   )r   s   "r   r   r   ½   s   € ÷ #ñ #�nñ #r   c                	ó"   € \         P                  # r<   )r	   ÚDATArJ   s   &r   ÚtypeÚAttachment.type¼   s   € ä×"Ñ"Ð"r   )Ú__dataÚ__randomName)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   r5   rK   ro   Úpropertyrs   r2   r|   Ú__static_attributes__Ú__classcell__)r#   s   @r   r   r   !   sa   ø† ñ÷=ð =õõBAõRðh ôó ðð ô%ó ð%ð ô#ó ö#r   )!Ú
__future__r   Ú__all__ÚloggingrY   r]   r=   r?   r_   Útypingr   r   r:   r   Úattachment_baser   Úenumsr	   r
   Úutilsr   r   r   Ú
propertiesr   Úmsg_classes.msgr   Ú	getLoggerr€   ÚloggerÚ
addHandlerÚNullHandlerr   r   r   r   Ú<module>r•      sz   ðÝ "ð ð€ó
 Û 	Û Û Û Û ç *å Ý +ß ,ß AÑ AÝ (÷ Ý)à	×	Ò	˜8Ó	$€Ø × Ñ �'×%Ò%Ó'Ô (ô]#�ö ]#r   