Ë
    ÅÍájB%  ã                  óœ   — d Z ddlmZ ddlZddlZddlmZ erddlm	Z	 ddl
mZ ddlmZ erdd	lmZ  G d
„ de«      Z G d„ dee«      ZdgZy)zmacOS.é    )ÚannotationsN)ÚTYPE_CHECKING)ÚIteratoré   )ÚXDGMixin)ÚPlatformDirsABC)ÚPathc                  ó^  — e Zd ZdZd&d„Zd'd„Zed&d„«       Zed'd„«       Zed(d„«       Z	ed(d„«       Z
ed&d„«       Zed'd	„«       Zed&d
„«       Zed&d„«       Zed(d„«       Zed&d„«       Zed&d„«       Zed&d„«       Zed&d„«       Zed&d„«       Zed&d„«       Zed&d„«       Zed&d„«       Zed&d„«       Zed&d„«       Zed&d„«       Zed&d„«       Zed&d„«       Zed&d„«       Zed&d„«       Zed&d„«       Zed&d„«       Z ed&d„«       Z!ed'd„«       Z"ed&d „«       Z#ed&d!„«       Z$ed&d"„«       Z%d)d#„Z&d)d$„Z'y%)*Ú_MacOSDefaultsaˆ  Default platform directories for macOS without XDG environment variable overrides.

    Follows the guidance from `Apple's File System Programming Guide
    <https://developer.apple.com/library/archive/documentation/FileManagement/Conceptual/FileSystemProgrammingGuide/MacOSXDirectories/MacOSXDirectories.html>`_.
    The XDG env var handling is in :class:`~platformdirs._xdg.XDGMixin`.

    c                ó^   — | j                  t        j                  j                  d«      «      S )Nz~/Library/Application Support©Ú_append_app_name_and_versionÚosÚpathÚ
expanduser©Úselfs    úV/data/www/html/cgi-venv/lib/python3.12/site-packages/pip/_vendor/platformdirs/macos.pyÚ_base_user_app_support_dirz)_MacOSDefaults._base_user_app_support_dir   s#   € Ø×0Ñ0´·±×1CÑ1CÐDcÓ1dÓeÐeó    c                óè   — dt         j                  v }|r"t         j                  j                  d«      d   nd}|r| j                  |› d�«      gng }|j	                  | j                  d«      «       |S )Nú/opt/pythonr   Ú z/sharez/Library/Application Support)ÚsysÚprefixÚsplitr   Úappend©r   Úis_homebrewÚhomebrew_prefixÚ	path_lists       r   Ú_base_site_dirsz_MacOSDefaults._base_site_dirs   sn   € Ø#¤s§z¡zÐ1ˆÙ@Kœ#Ÿ*™*×*Ñ*¨=Ó9¸!Ò<ÐQSˆÙWb�T×6Ñ6¸/Ð9JÈ&Ð7QÓRÑSÐhjˆ	Ø×Ñ˜×:Ñ:Ð;YÓZÔ[ØÐr   c                ó"   — | j                  «       S )zc:returns: data directory tied to the user, e.g. ``~/Library/Application Support/$appname/$version``©r   r   s    r   Úuser_data_dirz_MacOSDefaults.user_data_dir&   ó   € ð ×.Ñ.Ó0Ð0r   c                ó"   — | j                  «       S ©N©r"   r   s    r   Ú_site_data_dirsz_MacOSDefaults._site_data_dirs+   ó   € à×#Ñ#Ó%Ð%r   c                ó8   — | j                  | j                  «      S )zi:returns: data path shared by users. Only return the first item, even if ``multipath`` is set to ``True``)Ú _first_item_as_path_if_multipathÚsite_data_dirr   s    r   Úsite_data_pathz_MacOSDefaults.site_data_path/   s   € ð ×4Ñ4°T×5GÑ5GÓHÐHr   c                ó8   — | j                  | j                  «      S )zk:returns: config path shared by users. Only return the first item, even if ``multipath`` is set to ``True``)r-   Úsite_config_dirr   s    r   Úsite_config_pathz_MacOSDefaults.site_config_path4   s   € ð ×4Ñ4°T×5IÑ5IÓJÐJr   c                ó"   — | j                  «       S )zD:returns: config directory tied to the user, same as `user_data_dir`r$   r   s    r   Úuser_config_dirz_MacOSDefaults.user_config_dir9   r&   r   c                ó"   — | j                  «       S r(   r)   r   s    r   Ú_site_config_dirsz _MacOSDefaults._site_config_dirs>   r+   r   c                ó^   — | j                  t        j                  j                  d«      «      S )zW:returns: cache directory tied to the user, e.g. ``~/Library/Caches/$appname/$version``z~/Library/Cachesr   r   s    r   Úuser_cache_dirz_MacOSDefaults.user_cache_dirB   s%   € ð ×0Ñ0´·±×1CÑ1CÐDVÓ1WÓXÐXr   c                óD  — dt         j                  v }|r"t         j                  j                  d«      d   nd}|r| j                  |› d�«      gng }|j	                  | j                  d«      «       | j
                  rt        j                  j                  |«      S |d   S )aô  :returns: cache directory shared by users, e.g. ``/Library/Caches/$appname/$version``. If we're using a Python binary managed by `Homebrew <https://brew.sh>`_, the directory will be under the Homebrew prefix, e.g. ``$homebrew_prefix/var/cache/$appname/$version``. If `multipath <platformdirs.api.PlatformDirsABC.multipath>` is enabled, and we're in Homebrew, the response is a multi-path string separated by ":", e.g. ``$homebrew_prefix/var/cache/$appname/$version:/Library/Caches/$appname/$version``r   r   r   z
/var/cachez/Library/Caches)	r   r   r   r   r   Ú	multipathr   ÚpathsepÚjoinr   s       r   Úsite_cache_dirz_MacOSDefaults.site_cache_dirG   sŽ   € ð $¤s§z¡zÐ1ˆÙ@Kœ#Ÿ*™*×*Ñ*¨=Ó9¸!Ò<ÐQSˆÙ[f�T×6Ñ6¸/Ð9JÈ*Ð7UÓVÑWÐlnˆ	Ø×Ñ˜×:Ñ:Ð;LÓMÔNØ�>Š>Ü—:‘:—?‘? 9Ó-Ð-Ø˜‰|Ðr   c                ó8   — | j                  | j                  «      S )zj:returns: cache path shared by users. Only return the first item, even if ``multipath`` is set to ``True``)r-   r=   r   s    r   Úsite_cache_pathz_MacOSDefaults.site_cache_pathR   s   € ð ×4Ñ4°T×5HÑ5HÓIÐIr   c                ó"   — | j                  «       S )zC:returns: state directory tied to the user, same as `user_data_dir`r$   r   s    r   Úuser_state_dirz_MacOSDefaults.user_state_dirW   r&   r   c                ó(   — | j                  «       d   S )zB:returns: state directory shared by users, same as `site_data_dir`r   r)   r   s    r   Úsite_state_dirz_MacOSDefaults.site_state_dir\   s   € ð ×#Ñ#Ó% aÑ(Ð(r   c                ó^   — | j                  t        j                  j                  d«      «      S )zS:returns: log directory tied to the user, e.g. ``~/Library/Logs/$appname/$version``z~/Library/Logsr   r   s    r   Úuser_log_dirz_MacOSDefaults.user_log_dira   s%   € ð ×0Ñ0´·±×1CÑ1CÐDTÓ1UÓVÐVr   c                ó$   — | j                  d«      S )zQ:returns: log directory shared by users, e.g. ``/Library/Logs/$appname/$version``z/Library/Logs)r   r   s    r   Úsite_log_dirz_MacOSDefaults.site_log_dirf   s   € ð ×0Ñ0°ÓAÐAr   c                ó@   — t         j                  j                  d«      S )zD:returns: documents directory tied to the user, e.g. ``~/Documents``z~/Documents©r   r   r   r   s    r   Úuser_documents_dirz!_MacOSDefaults.user_documents_dirk   ó   € ô �w‰w×!Ñ! -Ó0Ð0r   c                ó@   — t         j                  j                  d«      S )zD:returns: downloads directory tied to the user, e.g. ``~/Downloads``z~/DownloadsrI   r   s    r   Úuser_downloads_dirz!_MacOSDefaults.user_downloads_dirp   rK   r   c                ó@   — t         j                  j                  d«      S )zB:returns: pictures directory tied to the user, e.g. ``~/Pictures``z
~/PicturesrI   r   s    r   Úuser_pictures_dirz _MacOSDefaults.user_pictures_diru   ó   € ô �w‰w×!Ñ! ,Ó/Ð/r   c                ó@   — t         j                  j                  d«      S )z>:returns: videos directory tied to the user, e.g. ``~/Movies``z~/MoviesrI   r   s    r   Úuser_videos_dirz_MacOSDefaults.user_videos_dirz   ó   € ô �w‰w×!Ñ! *Ó-Ð-r   c                ó@   — t         j                  j                  d«      S )z<:returns: music directory tied to the user, e.g. ``~/Music``z~/MusicrI   r   s    r   Úuser_music_dirz_MacOSDefaults.user_music_dir   s   € ô �w‰w×!Ñ! )Ó,Ð,r   c                ó@   — t         j                  j                  d«      S )z@:returns: desktop directory tied to the user, e.g. ``~/Desktop``z	~/DesktoprI   r   s    r   Úuser_desktop_dirz_MacOSDefaults.user_desktop_dir„   s   € ô �w‰w×!Ñ! +Ó.Ð.r   c                ó@   — t         j                  j                  d«      S )zB:returns: projects directory tied to the user, e.g. ``~/Projects``z
~/ProjectsrI   r   s    r   Úuser_projects_dirz _MacOSDefaults.user_projects_dir‰   rP   r   c                ó@   — t         j                  j                  d«      S )zD:returns: public share directory tied to the user, e.g. ``~/Public``z~/PublicrI   r   s    r   Úuser_publicshare_dirz#_MacOSDefaults.user_publicshare_dirŽ   rS   r   c                ó@   — t         j                  j                  d«      S )zD:returns: templates directory tied to the user, e.g. ``~/Templates``z~/TemplatesrI   r   s    r   Úuser_templates_dirz!_MacOSDefaults.user_templates_dir“   rK   r   c                ó@   — t         j                  j                  d«      S )zD:returns: fonts directory tied to the user, e.g. ``~/Library/Fonts``z~/Library/FontsrI   r   s    r   Úuser_fonts_dirz_MacOSDefaults.user_fonts_dir˜   s   € ô �w‰w×!Ñ!Ð"3Ó4Ð4r   c                ó^   — | j                  t        j                  j                  d«      «      S )zW:returns: preference directory tied to the user, e.g. ``~/Library/Preferences/AppName``z~/Library/Preferencesr   r   s    r   Úuser_preference_dirz"_MacOSDefaults.user_preference_dir�   s%   € ð ×0Ñ0´·±×1CÑ1CÐD[Ó1\Ó]Ð]r   c                ó@   — t         j                  j                  d«      S )z?:returns: bin directory tied to the user, e.g. ``~/.local/bin``z~/.local/binrI   r   s    r   Úuser_bin_dirz_MacOSDefaults.user_bin_dir¢   s   € ô �w‰w×!Ñ! .Ó1Ð1r   c                 ó   — y)z@:returns: bin directory shared by users, e.g. ``/usr/local/bin``z/usr/local/bin© r   s    r   Úsite_bin_dirz_MacOSDefaults.site_bin_dir§   s   € ð  r   c                ó@   — t         j                  j                  d«      S )zJ:returns: applications directory tied to the user, e.g. ``~/Applications``z~/ApplicationsrI   r   s    r   Úuser_applications_dirz$_MacOSDefaults.user_applications_dir¬   s   € ô �w‰w×!Ñ!Ð"2Ó3Ð3r   c                ó   — dgS )Nz/Applicationsre   r   s    r   Ú_site_applications_dirsz&_MacOSDefaults._site_applications_dirs±   s   € àÐ Ð r   c                óz   — | j                   }| j                  rt        j                  j	                  |«      S |d   S )zH:returns: applications directory shared by users, e.g. ``/Applications``r   )rj   r:   r   r;   r<   )r   Údirss     r   Úsite_applications_dirz$_MacOSDefaults.site_applications_dirµ   s1   € ð ×+Ñ+ˆØ(,¯ªŒr�z‰z�‰˜tÓ$ÐC¸DÀ¹GÐCr   c                ó^   — | j                  t        j                  j                  d«      «      S )zh:returns: runtime directory tied to the user, e.g. ``~/Library/Caches/TemporaryItems/$appname/$version``z~/Library/Caches/TemporaryItemsr   r   s    r   Úuser_runtime_dirz_MacOSDefaults.user_runtime_dir»   s%   € ð ×0Ñ0´·±×1CÑ1CÐDeÓ1fÓgÐgr   c                ó   — | j                   S )zG:returns: runtime directory shared by users, same as `user_runtime_dir`)ro   r   s    r   Úsite_runtime_dirz_MacOSDefaults.site_runtime_dirÀ   s   € ð ×$Ñ$Ð$r   c              #  óT   K  — | j                   –— | j                  E d{  –—†  y7 Œ­w)z4:yield: all user and site configuration directories.N)r4   r6   r   s    r   Úiter_config_dirsz_MacOSDefaults.iter_config_dirsÅ   s!   è ø€ à×"Ñ"Ò"Ø×)Ñ)×)Ò)úó   ‚( &¡(c              #  óT   K  — | j                   –— | j                  E d{  –—†  y7 Œ­w)z+:yield: all user and site data directories.N)r%   r*   r   s    r   Úiter_data_dirsz_MacOSDefaults.iter_data_dirsÊ   s!   è ø€ à× Ñ Ò Ø×'Ñ'×'Ò'úrt   N)ÚreturnÚstr)rw   z	list[str])rw   r	   )rw   zIterator[str])(Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r"   Úpropertyr%   r*   r/   r2   r4   r6   r8   r=   r?   rA   rC   rE   rG   rJ   rM   rO   rR   rU   rW   rY   r[   r]   r_   ra   rc   rf   rh   rj   rm   ro   rq   rs   rv   re   r   r   r   r      sš  „ ñófóð ò1ó ð1ð ò&ó ð&ð òIó ðIð òKó ðKð ò1ó ð1ð ò&ó ð&ð òYó ðYð òó ðð òJó ðJð ò1ó ð1ð ò)ó ð)ð òWó ðWð òBó ðBð ò1ó ð1ð ò1ó ð1ð ò0ó ð0ð ò.ó ð.ð ò-ó ð-ð ò/ó ð/ð ò0ó ð0ð ò.ó ð.ð ò1ó ð1ð ò5ó ð5ð ò^ó ð^ð ò2ó ð2ð ò ó ð ð ò4ó ð4ð ò!ó ð!ð òDó ðDð
 òhó ðhð ò%ó ð%ó*ô
(r   r   c                  ó   — e Zd ZdZy)ÚMacOSaF  Platform directories for the macOS operating system.

    Follows the guidance from `Apple documentation
    <https://developer.apple.com/library/archive/documentation/FileManagement/Conceptual/FileSystemProgrammingGuide/MacOSXDirectories/MacOSXDirectories.html>`_.
    Makes use of the `appname <platformdirs.api.PlatformDirsABC.appname>`, `version
    <platformdirs.api.PlatformDirsABC.version>`, `ensure_exists <platformdirs.api.PlatformDirsABC.ensure_exists>`.

    XDG environment variables (e.g. ``$XDG_DATA_HOME``) are supported and take precedence over macOS defaults.

    N)ry   rz   r{   r|   re   r   r   r   r   Ð   s   „ ò	r   r   )r|   Ú
__future__r   Úos.pathr   r   Útypingr   Úcollections.abcr   Ú_xdgr   Úapir   Úpathlibr	   r   r   Ú__all__re   r   r   ú<module>rˆ      sO   ðÙ å "ã Û 
Ý  áÝ(å Ý  áÝôz(�_ô z(ôz
ˆH�nô 
ð ð�r   