ó
    Ñ]jë  ã                   ól   • S r SSKrSSKrSSKJr  SSKJs  Jr   " S S\5      r	S r
S\4S jrS	 rS
 rg)z2Utilities for accessing the platform's clipboard.
é    N)ÚTryNextc                   ó   • \ rS rSrSrg)ÚClipboardEmptyé   © N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__static_attributes__r   ó    ÚR/home/mande/repo/quber/.venv/lib/python3.13/site-packages/IPython/lib/clipboard.pyr   r      s   † Úr   r   c                  óò  •  SSK n U R                  5          U R	                  U R
                  5      nU R                  5         U$ ! [         a  n[        S5      UeSnAff = f! [        U R                  4 ai     U R	                  U R                  5      n[        R                  " U[        R                  5      n N‰! [        U R                  4 a  n[        UeSnAff = ff = f! U R                  5         f = f)zZGet the current clipboard's text on Windows.

Requires Mark Hammond's pywin32 extensions.
r   NziGetting text from the clipboard requires the pywin32 extensions: http://sourceforge.net/projects/pywin32/)Úwin32clipboardÚImportErrorr   ÚOpenClipboardÚGetClipboardDataÚCF_UNICODETEXTÚ	TypeErrorÚerrorÚCF_TEXTÚ	py3compatÚcast_unicodeÚDEFAULT_ENCODINGr   ÚCloseClipboard)r   ÚeÚtexts      r   Úwin32_clipboard_getr      só   € ð
UÛð × Ñ Ô"ð	(Ø×.Ñ.¨~×/LÑ/LÓMˆð 	×%Ñ%Ô'Ø€Køô ó UÜð Mó NØSTð	UûðUûô �~×+Ñ+Ð,ó (ð	(Ø!×2Ñ2°>×3IÑ3IÓJˆDÜ×)Ò)¨$´	×0JÑ0JÓKŠDøÜ˜>×/Ñ/Ð0ó 	(Ü  aÐ'ûð	(úð	(ûð 	×%Ñ%Õ'úsS   ‚A —A" Á
AÁAÁAÁ"C!Á9A B;Â9C$ Â;CÃCÃCÃC!Ã!C$ Ã$C6Úreturnc                  óÄ   • [         R                  " / SQ[         R                  S9n U R                  5       u  pUR	                  SS5      n[
        R                  " U5      nU$ )z&Get the clipboard's text on OS X.
    )Úpbpastez-PreferÚascii©Ústdoutó   ó   
)Ú
subprocessÚPopenÚPIPEÚcommunicateÚreplacer   Údecode)ÚpÚbytes_Ústderrr   s       r   Úosx_clipboard_getr0   '   sP   € ô 	×ÒÒ8Ü�‰ñ	 €Aà—]‘]“_�N€Fà�^‰^˜E 5Ó)€FÜ×Ò˜FÓ#€DØ€Kr   c                  ód  •  SSK Jn Jn  U " 5       nUR                  5          UR                  5       n UR                  5         [        R                  " U[        R                  5      nU$ ! [         a  n[	        S5      UeSnAff = f! U a  n[        UeSnAff = f! UR                  5         f = f)zÔGet the clipboard's text using Tkinter.

This is the default on systems that are not Windows or OS X. It may
interfere with other UI toolkits and should be replaced with an
implementation that uses that toolkit.
r   )ÚTkÚTclErrorzBGetting text from the clipboard on this platform requires tkinter.N)Útkinterr2   r3   r   r   ÚwithdrawÚclipboard_getr   Údestroyr   r   r   )r2   r3   r   Úrootr   s        r   Útkinter_clipboard_getr9   3   s    € ðcß(ñ ‹4€DØ‡M�M„OðØ×!Ñ!Ó#‰ð 	�‰ŒÜ×!Ò! $¬	×(BÑ(BÓC€DØ€Køô ó cÜÐZÓ[ÐabÐbûðcûð ó $Ü !Ð#ûð$ûð 	�‰�ús:   ‚A* ¢B Á*
BÁ4B Â BÂBÂBÂBÂB ÂB/c                  óü  • [         R                  R                  S5      S:w  a  [        S5      e [        R
                  " S/[        R                  S9 n U R                  5       u  pU R                  5       (       a  [        U5      e SSS5        W(       d  [        e [        R                  " U5      nU$ ! , (       d  f       N4= f! [         a  n[        S5      UeSnAff = f! [         a  n[        UeSnAff = f)z~Get the clipboard's text under Wayland using wl-paste command.

This requires Wayland and wl-clipboard installed and running.
ÚXDG_SESSION_TYPEÚwaylandzwayland is not detectedzwl-paster#   NzzGetting text from the clipboard under Wayland requires the wl-clipboard extension: https://github.com/bugaevc/wl-clipboard)ÚosÚenvironÚgetr   r'   r(   r)   r*   ÚwaitÚFileNotFoundErrorr   r   r,   ÚUnicodeDecodeError)r-   ÚrawÚerrr   r   s        r   Úwayland_clipboard_getrE   K   sã   € ô
 
‡z�z‡~�~Ð(Ó)¨YÓ6ÜÐ/Ó0Ð0ð	Ü×Ò˜z˜l´:·?±?ÒCÀqØ—}‘}“‰HˆCØ�v‰v�x‰xÜ˜c“lÐ"ð ÷ Dö ÜÐð$Ü×Ò Ó$ˆð €K÷% DÕCûô ó ÜðAó
ð ð	ûðûô ó $Ü !Ð#ûð$úsM   °$C Á3B6ÂC ÂC% Â6
CÃ C ÃC Ã
C"ÃCÃC"Ã%
C;Ã/C6Ã6C;)Ú__doc__r=   r'   ÚIPython.core.errorr   ÚIPython.utils.py3compatÚutilsr   Ú
ValueErrorr   r   Ústrr0   r9   rE   r   r   r   Ú<module>rL      sB   ðñó 
Û å &ß +Ð +ô	�Zô 	òð0	˜3ô 	òó0r   