+
     h'  c                  s    R t ^ RIHt ^ RIt^ RIt^ RIHt ^ RIHt ^RI	H
t
 ]'       d   ^ RIHt  ! R R]
4      tR	 R
 ltR R ltR R ltR R ltR R lt]! RR7      ! ]! 4       4      tR.tR# )zWindows.)annotationsN)	lru_cache)TYPE_CHECKING)PlatformDirsABC)Callablec                  s   ] tR t^tRt]R R l4       tRR/R R llt]R R	 l4       t]R
 R l4       t	]R R l4       t
]R R l4       t]R R l4       t]R R l4       t]R R l4       t]R R l4       t]R R l4       t]R R l4       t]R R l4       t]R R l4       t]R  R! l4       t]R" R# l4       t]R$ R% l4       tR&tR# )'Windowsa  
`MSDN on where to store app data files <https://learn.microsoft.com/en-us/windows/win32/shell/knownfolderid>`_.

Makes use of the `appname <platformdirs.api.PlatformDirsABC.appname>`, `appauthor
<platformdirs.api.PlatformDirsABC.appauthor>`, `version <platformdirs.api.PlatformDirsABC.version>`, `roaming
<platformdirs.api.PlatformDirsABC.roaming>`, `opinion <platformdirs.api.PlatformDirsABC.opinion>`, `ensure_exists
<platformdirs.api.PlatformDirsABC.ensure_exists>`.

c                   V ^8  d   QhRR/#    returnstr Zformat   "L/usr/lib/python3.14/site-packages/setuptools/_vendor/platformdirs/windows.py__annotate__Windows.__annotate__   s     ( (s (    c                s    V P                   '       d   RMRp\        P                  P                  \	        V4      4      pV P                  V4      # )z
:return: data directory tied to the user, e.g.
 ``%USERPROFILE%\AppData\Local\$appauthor\$appname`` (not roaming) or
 ``%USERPROFILE%\AppData\Roaming\$appauthor\$appname`` (roaming)
CSIDL_APPDATACSIDL_LOCAL_APPDATA)Zroamingospathnormpathget_win_folder_append_parts)selfZconstr   s   &  r   user_data_dirZWindows.user_data_dir   s>     $(<<<5Jwwu 56!!$''r   opinion_valueNc               s$    V ^8  d   QhRRRRRR/# )r   r   r
   r   
str | Noner	   r   r   r   r   r   r   &   s!      #  s r   c               	s   . pV P                   '       d   V P                  R Jd2   V P                  ;'       g    V P                   pVP                  V4       VP                  V P                   4       Ve$   V P                  '       d   VP                  V4       V P                  '       d   VP                  V P                  4       \
        P                  P                  ! V.VO5!  pV P                  V4       V# )F)	ZappnameZ	appauthorZappendopinionZversionr   r   join_optionally_create_directory)r   r   r   ZparamsZauthors   &&$  r   r   ZWindows._append_parts&   s    <<<~~U*774<<f%MM$,,'(T\\\m,|||dll+ww||D*6*))$/r   c               r   r   r   r   r   r   r   r   6   s     ( (s (r   c                st    \         P                  P                  \        R4      4      pV P	                  V4      # )zT:return: data directory shared by users, e.g. ``C:\ProgramData\$appauthor\$appname``CSIDL_COMMON_APPDATAr   r   r   r   r   r   r      & r   site_data_dirZWindows.site_data_dir5   s/     ww/E FG!!$''r   c               r   r   r   r   r   r   r   r   <        " " "r   c                    V P                   # )zC:return: config directory tied to the user, same as `user_data_dir`r   r      &r   user_config_dirZWindows.user_config_dir;        !!!r   c               r   r   r   r   r   r   r   r   A   r%   r   c                r&   )zF:return: config directory shared by the users, same as `site_data_dir`)r$   r(   r)   r   site_config_dirZWindows.site_config_dir@   r+   r   c               r   r   r   r   r   r   r   r   F   s     ? ? ?r   c                x    \         P                  P                  \        R4      4      pV P	                  VRR7      # )z
:return: cache directory tied to the user (if opinionated with ``Cache`` folder within ``$appname``) e.g.
 ``%USERPROFILE%\AppData\Local\$appauthor\$appname\Cache\$version``
r   Cacher   r!   r"   r#   r   user_cache_dirZWindows.user_cache_dirE   s4     ww/D EF!!$g!>>r   c               r   r   r   r   r   r   r   r   O   s     ? ? ?r   c                r-   )zd:return: cache directory shared by users, e.g. ``C:\ProgramData\$appauthor\$appname\Cache\$version``r    r.   r/   r!   r"   r#   r   site_cache_dirZWindows.site_cache_dirN   s4     ww/E FG!!$g!>>r   c               r   r   r   r   r   r   r   r   U   s     " " "r   c                r&   )zB:return: state directory tied to the user, same as `user_data_dir`r'   r(   r)   r   user_state_dirZWindows.user_state_dirT   r+   r   c               r   r   r   r   r   r   r   r   Z   s      c r   c                s    V P                   pV P                  '       d2   \        P                  P	                  VR4      pV P                  V4       V# )zg:return: log directory tied to the user, same as `user_data_dir` if not opinionated else ``Logs`` in itZLogs)r   r   r   r   r   r   r"   r#   r   user_log_dirZWindows.user_log_dirY   s?     !!<<<77<<f-D--d3r   c               r   r   r   r   r   r   r   r   c   s     B BC Br   c                R    \         P                  P                  \        R4      4      # )zN:return: documents directory tied to the user e.g. ``%USERPROFILE%\Documents``CSIDL_PERSONALr   r   r   r   r(   r)   r   user_documents_dirZWindows.user_documents_dirb   s     ww/? @AAr   c               r   r   r   r   r   r   r   r   h   s     C CC Cr   c                r4   )zN:return: downloads directory tied to the user e.g. ``%USERPROFILE%\Downloads``CSIDL_DOWNLOADSr6   r(   r)   r   user_downloads_dirZWindows.user_downloads_dirg   s     ww/@ ABBr   c               r   r   r   r   r   r   r   r   m   s     D D3 Dr   c                r4   )zL:return: pictures directory tied to the user e.g. ``%USERPROFILE%\Pictures``CSIDL_MYPICTURESr6   r(   r)   r   user_pictures_dirZWindows.user_pictures_dirl   s     ww/A BCCr   c               r   r   r   r   r   r   r   r   r   s     A A Ar   c                r4   )zH:return: videos directory tied to the user e.g. ``%USERPROFILE%\Videos``CSIDL_MYVIDEOr6   r(   r)   r   user_videos_dirZWindows.user_videos_dirq        ww ?@@r   c               r   r   r   r   r   r   r   r   w   s     A A Ar   c                r4   )zF:return: music directory tied to the user e.g. ``%USERPROFILE%\Music``CSIDL_MYMUSICr6   r(   r)   r   user_music_dirZWindows.user_music_dirv   r>   r   c               r   r   r   r   r   r   r   r   |   s     J J# Jr   c                r4   )zK:return: desktop directory tied to the user, e.g. ``%USERPROFILE%\Desktop``CSIDL_DESKTOPDIRECTORYr6   r(   r)   r   user_desktop_dirZWindows.user_desktop_dir{   s     ww/G HIIr   c               r   r   r   r   r   r   r   r      s     ( (# (r   c                s    \         P                  P                  \         P                  P                  \	        R4      R4      4      pV P                  V4      # )zm
:return: runtime directory tied to the user, e.g.
 ``%USERPROFILE%\AppData\Local\Temp\$appauthor\$appname``
r   ZTemp)r   r   r   r   r   r   r"   r#   r   user_runtime_dirZWindows.user_runtime_dir   s?     ww^<Q-RTZ [\!!$''r   c               r   r   r   r   r   r   r   r      s     % %# %r   c                r&   )zF:return: runtime directory shared by users, same as `user_runtime_dir`)rC   r(   r)   r   site_runtime_dirZWindows.site_runtime_dir   s     $$$r   r   )Z__name__Z
__module__Z__qualname__Z__firstlineno____doc__Zpropertyr   r   r$   r*   r,   r0   r1   r2   r3   r7   r9   r;   r=   r@   rB   rC   rD   Z__static_attributes__r   r   r   r   r      s_    ( (d  ( (
 " " " " ? ? ? ?
 " "   B B C C D D A A A A J J ( ( % %r   r   c                    V ^8  d   QhRRRR/# r   
csidl_namer
   r	   r   r   r   r   r   r      s      S S r   c                s    \        V 4      pVe   V# RRRRRR/P                  V 4      pVf   RV  2p\        V4      h\        P                  P                  V4      pVf   RV 2p\        V4      hV# )	z&Get folder from environment variables.r   ZAPPDATAr    ZALLUSERSPROFILEr   ZLOCALAPPDATAUnknown CSIDL name: zUnset environment variable: )(get_win_folder_if_csidl_name_not_env_varget
ValueErrorr   environ)rH   ZresultZenv_var_namemsgs   &   r   get_win_folder_from_env_varsrO      s    5jAF 	 1~ 
c*o	 
 $ZL1oZZ^^L)F~,\N;oMr   c               s     V ^8  d   QhRRRR/# )r   rH   r
   r	   r   r   r   r   r   r   r      s        r   c                s   V R8X  dS   \         P                  P                  \         P                  P                  \         P                  R,          4      R4      # V R8X  dS   \         P                  P                  \         P                  P                  \         P                  R,          4      R4      # V R8X  dS   \         P                  P                  \         P                  P                  \         P                  R,          4      R4      # V R8X  dS   \         P                  P                  \         P                  P                  \         P                  R,          4      R	4      # V R
8X  dS   \         P                  P                  \         P                  P                  \         P                  R,          4      R4      # R# )zMGet a folder for a CSIDL name that does not exist as an environment variable.r5   ZUSERPROFILEZ	Documentsr8   	Downloadsr:   ZPicturesr<   ZVideosr?   ZMusicN)r   r   r   r   rM   )rH   r)   r   rJ   rJ      s   %%ww||BGG,,RZZ-FGUU&&ww||BGG,,RZZ-FGUU''ww||BGG,,RZZ-FGTT_$ww||BGG,,RZZ-FGRR_$ww||BGG,,RZZ-FGQQr   c               rF   rG   r   r   r   r   r   r      s      S S r   c                s   RRRRRRRRR	R
RRRRRR/P                  V 4      pVf   RV  2p\        V4      h\        P                  R8w  d   \        h^ RIpVP                  VP                  R4      pVP                  WA4      w  rV\        V4      # )z
Get folder from the registry.

This is a fallback technique at best. I'm not sure if using the registry for these guarantees us the correct answer
for all CSIDL_* names.

r   ZAppDatar    zCommon AppDatar   zLocal AppDatar5   ZPersonalr8   z&{374DE290-123F-4565-9164-39C4925E467B}r:   zMy Picturesr<   zMy Videor?   zMy MusicNrI   Zwin32z@Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders)
rK   rL   sysZplatformZNotImplementedErrorwinregZOpenKeyZHKEY_CURRENT_USERZQueryValueExr
   )rH   Zshell_folder_namerN   rR   ZkeyZ	directoryZ_   &      r   get_win_folder_from_registryrT      s     	 0*CM	 
c*o   $ZL1o
||w!!
..113v
wC&&s>LIy>r   c               rF   rG   r   r   r   r   r   r      s     $ $# $# $r   c                s^   ^ RI pR^R^#R^R^R^'R^R^R	^(R
^/	P                  V 4      pVf   RV  2p\        V4      hVP                  R4      p\	        VR4      pVP
                  P                  RVR^ V4       \        ;QJ d    R V 4       F  '       g   K   RM	  RM! R V 4       4      '       dA   VP                  R4      pVP                  P                  VP                  VR4      '       d   TpV R	8X  d+   \        P                  P                  VP                  R4      # VP                  # )zGet folder with ctypes.Nr   r    r   r5   r:   r<   r?   r8   rA   rI   i   windllc              3  s>   "   T F  p\        V4      ^8  x  K  	  R# 5i)i   N)Zord)Z.0Zcr#   r   Z	<genexpr>Z,get_win_folder_via_ctypes.<locals>.<genexpr>   s     
%A3q6C<s   TFrP   )ctypesrK   rL   Zcreate_unicode_bufferZgetattrZshell32ZSHGetFolderPathWZanyZkernel32ZGetShortPathNameWZvaluer   r   r   )rH   rV   Zcsidl_constrN   ZbufrU   Zbuf2rS   r   get_win_folder_via_ctypesrW      s      	r!B2 "
 
c*o  $ZL1o

&
&t
,CVX&F
NN##D+tQD s
%
%sss
%
%%%++D1??,,SYYdCCC&&ww||CII{3399r   c               r   )r   r	   zCallable[[str], str]r   r   r   r   r   r      s     , ,2 ,r   c                 s     ^ RI p \        V R4      '       d   \        #   ^ RIp\
        #   \         d     Li ; i  \         d
    \        u # i ; i)i    NrU   )rV   ZhasattrrW   ZImportErrorrR   rT   rO   )rV   rR   s     r   _pick_get_win_folderrX      s^    - 68$$,, %, ,+    ,++,s   * ; 88AA)Zmaxsize)rE   Z
__future__r    r   rQ   Z	functoolsr   Ztypingr   Zapir   Zcollections.abcr   r   rO   rJ   rT   rW   rX   r   Z__all__r   r   r   <module>rY      sj     " 	 
     (|%o |%~*&<$N,  4()=)?@ r   