ó
    Ãu„jN¨  ã                  óR  • % S r SSKJr  SSKJrJr  SSKJrJrJ	r	J
r
JrJrJr  SSKJr  SSKJr  SSKJr  SSKJr  SS	KJr  SS
KJrJrJrJrJrJrJrJ r   SSK!r"SSK#J$r$  SSK%J&r&  SSK'J(r(J)r)  SSK*J+r+J,r,  SSK-J.r.J/r/  SSK0J1r1J2r2  SSK3J4r4  SSK5J6r6J7r7  SSK8J9r9  SSK:J;r;  SSK<J=r=  SSK>J?r?J@r@  SSKAJBrB  SSKCJDrD  SSKEJFrF  SSKGJHrH  SSKIJJrJ  SSKKJLrLJMrMJNrNJOrOJPrP  SSKQJRrR  SSKSJTrT  \(       a  SS KUJVrVJWrW  / S!QrX\ " S" S#5      5       rY\ " S$ S%5      5       rZ\S&   r[S'\\S('    S)r]S'\\S*'     " S+ S,\5      r^ " S- S.\ 5      r_S/r`S'\\S0'    " S1 S2\^5      ra\"RÄ                  RÆ                  \ " S3 S4\R5      5       5       rd " S5 S6\OS7S89re " S9 S:\PS7S;9rf " S< S=\M5      rg " S> S?\@S   5      rhg)@z¢
This module contains classes for working with Textual's command palette.

See the guide on the [Command Palette](../guide/command_palette.md) for full details.

é    )Úannotations)ÚABCÚabstractmethod)ÚCancelledErrorÚQueueÚTaskÚTimeoutErrorÚcreate_taskÚwaitÚwait_for)Ú	dataclass)Útotal_ordering)Úisclass)Ú
attrgetter)Ú	monotonic)ÚTYPE_CHECKINGÚAnyÚAsyncGeneratorÚAsyncIteratorÚCallableÚClassVarÚIterableÚ
NamedTupleN)ÚAlign)ÚText)ÚFinalÚ	TypeAlias)ÚonÚwork)ÚBindingÚBindingType)Ú
HorizontalÚVertical)ÚContent)ÚClickÚMount)ÚMatcher)ÚMessage)Úvar)ÚScreenÚSystemModalScreen)ÚStyle)ÚTimer)ÚIgnoreReturnCallbackType)Ú
VisualType)ÚWidget)ÚButtonÚInputÚLoadingIndicatorÚ
OptionListÚStatic)ÚOption)Úget_current_worker)ÚAppÚComposeResult)ÚCommandPaletteÚDiscoveryHitÚHitÚHitsr'   ÚProviderc                  ó�   • \ rS rSr% SrS\S'    S\S'    S\S'    S	rS
\S'    S	rS
\S'    \SS j5       r	SS jr
SS jrSS jrSrg	)r<   éH   ú1Holds the details of a single command search hit.ÚfloatÚscorer/   Úmatch_displayr.   ÚcommandNú
str | NoneÚtextÚhelpc                ó   • U R                   $ )zAThe prompt to use when displaying the hit in the command palette.)rD   ©Úselfs    Ú�C:\Users\johnn\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.13_qbz5n2kfra8p0\LocalCache\local-packages\Python313\site-packages\textual/command.pyÚpromptÚ
Hit.promptb   ó   € ð ×!Ñ!Ð!ó    c                ój   • [        U[        5      (       a  U R                  UR                  :  $ [        $ ©N©Ú
isinstancer<   rC   ÚNotImplemented©rK   Úothers     rL   Ú__lt__Ú
Hit.__lt__g   s(   € Ü�eœS×!Ñ!Ø—:‘: §¡Ñ+Ð+ÜÐrP   c                ój   • [        U[        5      (       a  U R                  UR                  :H  $ [        $ rR   rS   rV   s     rL   Ú__eq__Ú
Hit.__eq__l   s(   € Ü�eœS×!Ñ!Ø—:‘: §¡Ñ,Ð,ÜÐrP   c                óT   • U R                   c  [        U R                  5      U l         gg©zEnsure 'text' is populated.N)rG   ÚstrrD   rJ   s    rL   Ú__post_init__ÚHit.__post_init__q   s#   € à�9‰9ÑÜ˜D×.Ñ.Ó/ˆD�Ið rP   ©rG   ©Úreturnr/   ©rW   Úobjectrd   Úbool©rd   ÚNone)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__Ú__annotations__rG   rH   ÚpropertyrM   rX   r[   r`   Ú__static_attributes__© rP   rL   r<   r<   H   sb   ‡ á;àƒLðð
 ÓØ@à%Ó%Ø:à€Dˆ*Óðð €Dˆ*ÓØ-àó"ó ð"ôô
÷
0rP   r<   c                  ó˜   • \ rS rSr% SrS\S'    S\S'    SrS\S	'    SrS\S
'    \SS j5       r	\SS j5       r
SS jrSS jrSS jrSrg)r;   éw   rA   r/   Údisplayr.   rE   NrF   rG   rH   c                ó   • U R                   $ )zKThe prompt to use when displaying the discovery hit in the command palette.)ru   rJ   s    rL   rM   ÚDiscoveryHit.prompt‹   s   € ð �|‰|ÐrP   c                ó   • g)zÙA discovery hit always has a score of 0.

The order in which discovery hits are displayed is determined by the order
in which they are yielded by the Provider. It's up to the developer to yield
DiscoveryHits in the .
g        rr   rJ   s    rL   rC   ÚDiscoveryHit.score�   s   € ð rP   c                ó¦   • [        U[        5      (       a7  U R                  c   eUR                  c   eUR                  U R                  :  $ [        $ rR   )rT   r;   rG   rU   rV   s     rL   rX   ÚDiscoveryHit.__lt__š   sH   € Ü�eœ\×*Ñ*Ø—9‘9Ñ(Ð(Ð(Ø—:‘:Ñ)Ð)Ð)Ø—:‘: §	¡	Ñ)Ð)ÜÐrP   c                ój   • [        U[        5      (       a  U R                  UR                  :H  $ [        $ rR   )rT   r<   rG   rU   rV   s     rL   r[   ÚDiscoveryHit.__eq__¡   s(   € Ü�eœS×!Ñ!Ø—9‘9 §
¡
Ñ*Ð*ÜÐrP   c                óT   • U R                   c  [        U R                  5      U l         ggr^   )rG   r_   ru   rJ   s    rL   r`   ÚDiscoveryHit.__post_init__¦   s!   € à�9‰9ÑÜ˜DŸL™LÓ)ˆD�Ið rP   rb   rc   )rd   rB   re   rh   )rj   rk   rl   rm   rn   ro   rG   rH   rp   rM   rC   rX   r[   r`   rq   rr   rP   rL   r;   r;   w   sj   ‡ á;àÓØ@à%Ó%Ø:à€Dˆ*Óðð €Dˆ*ÓØ-àóó ðð óó ðôô÷
*rP   r;   úDiscoveryHit | Hitr   r=   z7Iterable[type[Provider] | Callable[[], type[Provider]]]ÚProviderSourcec                  óÞ   • \ rS rSrSrSSS jjr\SS j5       r\SS j5       r\SS j5       r	\SS j5       r
SSS	 jjrSS
 jrSS jrSS jrSS jr\SS j5       rSS jrSS jrSS jrSrg)r>   é³   z¦Base class for command palette command providers.

To create new command provider, inherit from this class and implement
[`search`][textual.command.Provider.search].
Nc                óv   • Ub  [        U[        5      (       d   S5       eXl        X l        SU l        SU l        g)zVInitialise the command provider.

Args:
    screen: A reference to the active screen.
NzDmatch_style must be a Visual style (from textual.style import Style)F)rT   r,   Ú_Provider__screenÚ_Provider__match_styleÚ
_init_taskÚ_init_success©rK   ÚscreenÚmatch_styles      rL   Ú__init__ÚProvider.__init__º   sL   € ð Ñ"ÜØœU÷ñ ð VàUóVð ð ŒØ(ÔØ'+ˆŒØ"ˆÕrP   c                ó.   • U R                   R                  $ )z}The currently-focused widget in the currently-active screen in the application.

If no widget has focus this will be `None`.
)r…   ÚfocusedrJ   s    rL   r�   ÚProvider.focusedÉ   s   € ð �}‰}×$Ñ$Ð$rP   c                ó   • U R                   $ )z/The currently-active screen in the application.)r…   rJ   s    rL   rŠ   ÚProvider.screenÑ   s   € ð �}‰}ÐrP   c                ó.   • U R                   R                  $ )zA reference to the application.)r…   ÚapprJ   s    rL   r”   ÚProvider.appÖ   s   € ð �}‰}× Ñ Ð rP   c                ó   • U R                   $ )z{The preferred style to use when highlighting matching portions of the [`match_display`][textual.command.Hit.match_display].)r†   rJ   s    rL   r‹   ÚProvider.match_styleÛ   rO   rP   c                ó,   • [        UU R                  US9$ )a  Create a [fuzzy matcher][textual.fuzzy.Matcher] for the given user input.

Args:
    user_input: The text that the user has input.
    case_sensitive: Should matching be case sensitive?

Returns:
    A [fuzzy matcher][textual.fuzzy.Matcher] object for matching against candidate hits.
)r‹   Úcase_sensitive)r'   r‹   )rK   Ú
user_inputr™   s      rL   ÚmatcherÚProvider.matcherà   s    € ô ØØ×(Ñ(Ø)ñ
ð 	
rP   c                ó@   ^ • SU 4S jjn[        U" 5       5      T l        g)z&Internal method to run post init task.c               “  óÒ   >#   •  TR                  5       I Sh  v•N   STl        g N! [         a3    SSKJn   TR
                  R                  R                  U " 5       5         gf = f7f)z)Wrapper to post init that runs in a task.NTr   ©Ú	Traceback)Ústartuprˆ   Ú	ExceptionÚrich.tracebackr    r”   ÚlogÚerror)r    rK   s    €rL   Úpost_init_taskÚ+Provider._post_init.<locals>.post_init_taskó   sR   øé € ð*Ø—l‘l“n×$Ð$ð &*�Õ"ñ %øÜó 0Ý4à—‘—‘×"Ñ"¡9£;Ö/ð0üs1   ƒA'…' ˜%™' �A'¥' §:A$Á!A'Á#A$Á$A'Nrh   )r
   r‡   )rK   r¦   s   ` rL   Ú
_post_initÚProvider._post_initð   s   ø€ ÷		*ô &¡nÓ&6Ó7ˆ�rP   c              ƒ  ó`   #   • U R                   b  U R                   I Sh  v•N   SU l         g N7f)zWait for initialization.N)r‡   rJ   s    rL   Ú
_wait_initÚProvider._wait_init   s(   é € à�?‰?Ñ&Ø—/‘/×!Ð!Øˆ�ñ "ùs   ‚.Ÿ, .c              ƒ  ó   #   • g7f)zKCalled after the Provider is initialized, but before any calls to `search`.Nrr   rJ   s    rL   r¡   ÚProvider.startup  ó   é � ùó   ‚c               óô   #   • U R                  5       I Sh  v•N   U R                  (       aE  U(       a  U R                  U5      OU R                  5       nU  Sh  v•N nU[        Ld  M  U7v •  M  g N[ N
 g7f)z‹Internal method to perform search.

Args:
    query: The user input to be matched.

Yields:
    Instances of [`Hit`][textual.command.Hit].
N)r«   rˆ   ÚsearchÚdiscoverrU   )rK   ÚqueryÚhitsÚhits       rL   Ú_searchÚProvider._search	  sb   é € ð �o‰oÓ×ÐØ××ö */�4—;‘;˜uÔ%°D·M±M³OˆDÙ!÷ �cØœnÔ,Ø•Ið ñ 	 ñ
™Tùs9   ‚A8–A2—?A8ÁA6ÁA4ÁA6ÁA8Á*	A8Á4A6Á6A8c               ó   #   • [         7v •  g7f)z¦A request to search for commands relevant to the given query.

Args:
    query: The user input to be matched.

Yields:
    Instances of [`Hit`][textual.command.Hit].
N©rU   )rK   r´   s     rL   r²   ÚProvider.search  s   é € ô Ôùó   ‚c               ó   #   • [         7v •  g7f)a…  A default collection of hits for the provider.

Yields:
    Instances of [`DiscoveryHit`][textual.command.DiscoveryHit].

Note:
    This is different from
    [`search`][textual.command.Provider.search] in that it should
    yield [`DiscoveryHit`s][textual.command.DiscoveryHit] that
    should be shown by default (before user input).

    It is permitted to *not* implement this method.
Nrº   rJ   s    rL   r³   ÚProvider.discover'  s   é € ô Ôùr¼   c              ƒ  óÂ   #   •  U R                  5       I Sh  v•N   g N! [         a3    SSKJn  U R                  R
                  R                  U" 5       5         gf = f7f)z0Internal method to call shutdown and log errors.Nr   rŸ   )Úshutdownr¢   r£   r    r”   r¤   r¥   )rK   r    s     rL   Ú	_shutdownÚProvider._shutdown7  sB   é € ð	,Ø—-‘-“/×!Ó!øÜó 	,Ý0à�H‰H�L‰L×Ñ™y›{Ö+ð	,üs1   ‚A„ —˜ œA� Ÿ:AÁAÁAÁAc              ƒ  ó   #   • g7f)z\Called when the Provider is shutdown.

Use this method to perform an cleanup, if required.

Nrr   rJ   s    rL   rÀ   ÚProvider.shutdown@  r¯   r°   )Ú__match_styleÚ__screenrˆ   r‡   rR   )rŠ   úScreen[Any]r‹   úStyle | Nonerd   ri   )rd   zWidget | None)rd   zScreen[object])rd   úApp[object]©rd   rÈ   )F)rš   r_   r™   rg   rd   r'   rh   ©r´   r_   rd   r=   ©rd   r=   )rj   rk   rl   rm   rn   rŒ   rp   r�   rŠ   r”   r‹   r›   r¨   r«   r¡   r·   r   r²   r³   rÁ   rÀ   rq   rr   rP   rL   r>   r>   ³   s™   † ñö#ð ó%ó ð%ð óó ðð ó!ó ð!ð ó"ó ð"ö
ô 8ô ôZôð$ ó	ó ð	ôô ,÷rP   r>   c                  ó@   • \ rS rSr% SrS\S'    S\S'    SrS\S	'   S
rg)ÚSimpleCommandiH  zA simple command.r_   Únamer.   ÚcallbackNrF   Ú	help_textrr   )rj   rk   rl   rm   rn   ro   rÑ   rq   rr   rP   rL   rÎ   rÎ   H  s#   ‡ Ùà
ƒIØ"Ø&Ó&Ø>Ø €IˆzÓ Ú)rP   rÎ   zgSimpleCommand | tuple[str, IgnoreReturnCallbackType, str | None] | tuple[str, IgnoreReturnCallbackType]ÚCommandListItemc                  ó~   ^ • \ rS rSrSr      S	U 4S jjr S
     SS jjr\SS j5       rSS jr	SS jr
SrU =r$ )ÚSimpleProvideriX  z8A simple provider which the caller can pass commands to.c                ó”  >• [         TU ]  US 5        / U l        U Hª  n[        U[        5      (       a  U R                  R                  U5        M5  [        U5      S:X  a(  U R                  R                  [	        / UQS P76 5        Ml  [        U5      S:X  a#  U R                  R                  [	        U6 5        Mž  [        SU 35      e   g )Né   é   zInvalid command: )ÚsuperrŒ   Ú	_commandsrT   rÎ   ÚappendÚlenÚ
ValueError)rK   rŠ   ÚcommandsrE   Ú	__class__s       €rL   rŒ   ÚSimpleProvider.__init__[  s¥   ø€ ô 	‰Ñ˜ Ô&Ø.0ˆŒÛˆGÜ˜'¤=×1Ñ1Ø—‘×%Ñ% gÖ.Ü�W“ Ó"Ø—‘×%Ñ%¤mÐ&C°WÐ&C¸dÒ&CÖDÜ�W“ Ó"Ø—‘×%Ñ%¤m°WÐ&=Ö>ä Ð#4°W°IÐ!>Ó?Ð?ò  rP   c                ó   • X l         U $ rR   ©Ú_SimpleProvider__match_styler‰   s      rL   Ú__call__ÚSimpleProvider.__call__m  s   € ð )ÔØˆrP   c                ó   • U R                   $ rR   rá   rJ   s    rL   r‹   ÚSimpleProvider.match_styles  s   € à×!Ñ!Ð!rP   c               óÈ   #   • U R                  U5      nU R                   H=  u  p4nUR                  U5      =nS:”  d  M  [        UUR	                  U5      UUS97v •  M?     g 7f)Nr   ©rH   )r›   rÙ   Úmatchr<   Ú	highlight)rK   r´   r›   rÏ   rÐ   rÑ   ré   s          rL   r²   ÚSimpleProvider.searchw  s`   é € Ø—,‘,˜uÓ%ˆØ)-¯¬Ñ%ˆD˜IØ Ÿ™ tÓ,Ð,�°Õ1ÜØØ×%Ñ% dÓ+ØØ"ñ	õ ò *8ùs
   ‚9A"¿#A"c               óT   #   • U R                    H  u  pn[        UUUS97v •  M     g7f)zmHandle a request for the discovery commands for this provider.

Yields:
    Commands that can be discovered.
rè   N)rÙ   r;   )rK   rÏ   rÐ   rÑ   s       rL   r³   ÚSimpleProvider.discover‚  s0   é € ð *.¯¬Ñ%ˆD˜IÜØØØñõ ò *8ùs   ‚&()rÅ   rÙ   )rŠ   rÇ   rÝ   zlist[CommandListItem]rd   ri   rR   )rŠ   rÇ   r‹   rÈ   rd   rÔ   rÊ   rË   rÌ   )rj   rk   rl   rm   rn   rŒ   rã   rp   r‹   r²   r³   rq   Ú__classcell__©rÞ   s   @rL   rÔ   rÔ   X  sr   ø† ÙBð@àð@ð (ð@ð 
÷	@ð& @DðØ!ðØ0<ðà	õð ó"ó ð"ô	÷ò rP   rÔ   c                  óh   ^ • \ rS rSrSr  S         S	U 4S jjjrS
S jrSS jrSS jrSr	U =r
$ )ÚCommandi�  zKClass that holds a hit in the [`CommandList`][textual.command.CommandList].c                ó2   >• [         TU ]  XU5        X l        g)zïInitialise the option.

Args:
    prompt: The prompt for the option.
    hit: The details of the hit associated with the option.
    id: The optional ID for the option.
    disabled: The initial enabled/disabled state. Enabled by default.
N)rØ   rŒ   r¶   )rK   rM   r¶   ÚidÚdisabledrÞ   s        €rL   rŒ   ÚCommand.__init__•  s   ø€ ô 	‰Ñ˜ XÔ.ØŒØ@rP   c                ó   • [        U 5      $ rR   ©ró   rJ   s    rL   Ú__hash__ÚCommand.__hash__¨  s   € Ü�$‹xˆrP   c                ój   • [        U[        5      (       a  U R                  UR                  :  $ [        $ rR   ©rT   rñ   r¶   rU   rV   s     rL   rX   ÚCommand.__lt__«  s(   € Ü�eœW×%Ñ%Ø—8‘8˜eŸi™iÑ'Ð'ÜÐrP   c                ój   • [        U[        5      (       a  U R                  UR                  :H  $ [        $ rR   rû   rV   s     rL   r[   ÚCommand.__eq__°  s(   € Ü�eœW×%Ñ%Ø—8‘8˜uŸy™yÑ(Ð(ÜÐrP   )r¶   )NF)
rM   r/   r¶   r€   ró   rF   rô   rg   rd   ri   )rd   Úintre   )rj   rk   rl   rm   rn   rŒ   rø   rX   r[   rq   rî   rï   s   @rL   rñ   rñ   �  sf   ø† ñ Vð ØðAàðAð  ðAð ð	Að
 ðAð 
÷Að Aô&ô÷
ò rP   rñ   c                  ó   • \ rS rSrSrSrSrg)ÚCommandListi¶  z!The command palette command list.a®  
    
    CommandList:ansi {
        & > .option-list--option-highlighted {             
            color: $block-cursor-foreground;
            background: $block-cursor-background;
            text-style: $block-cursor-text-style;    
        }               
    }       
    
    CommandList {
        visibility: hidden;
        border-top: blank;
        border-bottom: hkey black;
        border-left: none;
        border-right: none;
        height: auto;
        max-height: 70vh;
        background: transparent;
        padding: 0;
    }

    CommandList:focus {
        border: blank;
    }

    CommandList.--visible {
        visibility: visible;
    }

    CommandList.--populating {
        border-bottom: none;
    }

    CommandList > .option-list--option-highlighted {
        color: $block-cursor-blurred-foreground;
        background: $block-cursor-blurred-background;
        text-style: $block-cursor-blurred-text-style;        
    }
    

    CommandList:nocolor > .option-list--option-highlighted {       
        text-style: reverse;
    }

    CommandList > .option-list--option {
        padding: 0 2;
        color: $foreground;
        text-style: bold;
    }
    rr   N©rj   rk   rl   rm   rn   ÚDEFAULT_CSSrq   rr   rP   rL   r  r  ¶  s   † Ù+ð2ƒKrP   r  F)Ú	can_focusc                  óD   • \ rS rSr% SrSr\" S5      rS\S'    S
S jr	Sr
g	)Ú
SearchIconiî  z=Widget for displaying a search icon before the command input.z•
    SearchIcon {
        color: #000;  /* required for snapshot tests */
        margin-left: 1;
        margin-top: 1;
        width: 2;
    }
    u   ðŸ”Žzvar[str]Úiconc                ó   • U R                   $ )z4Render the icon.

Returns:
    The icon renderable.
)r  rJ   s    rL   ÚrenderÚSearchIcon.renderý  s   € ð �y‰yÐrP   rr   Nrc   )rj   rk   rl   rm   rn   r  r)   r  ro   r	  rq   rr   rP   rL   r  r  î  s$   ‡ ÙGð€Kñ ˜“[€Dˆ(Ó Ø÷rP   r  )Úinherit_cssc                  ó   • \ rS rSrSrSrSrg)ÚCommandInputi  z"The command palette input control.z´
    CommandInput, CommandInput:focus {
        border: blank;
        width: 1fr;
        padding-left: 0;
        background: transparent;
        background-tint: 0%;
    }
    rr   Nr  rr   rP   rL   r  r    s   † Ù,ðƒKrP   r  c                  ó<  ^ • \ rS rSr% SrSr\R                  SS1-  rS\S'    Sr	\
" S	S
SSS9\
" SSSSS9\
" SSSSS9\
" SSS5      \
" SSSSS9\
" SSSSS9\
" SSSSS9/rS\S '    S!rS"\S#'    \" SSS$9rS%\S&'    \" SSS$9rS%\S''    \" S(5      rS)\S*'    \ " S+ S,\5      5       r\ " S- S.\5      5       r\ " S/ S0\5      5       r SYS1S(S(S(S2.           SZU 4S3 jjjjr\S[S4 j5       r\S\S5 j5       rS]S6 jrS^S7 jrS_S8 jrS`S9 jrS`S: jrS;r S<\S='    S`S> jr!S`S? jr"S;r#S<\S@'    SaSA jr$S`SB jr%S`SC jr&\SbSD j5       r'    ScSE jr(        SdSF jr)SGr*S<\SH'    SIr+SJ\SK'    SLr,SJ\SM'    \-" S!\,SN9SaSO j5       r.S`SP jr/\0" \1Rd                  5      SeSQ j5       r3\0" \4Rj                  5      SfSR j5       r6\0" \1Rn                  5      \0" \8Rr                  5       SY   SgSS jj5       5       r:\0" \4R&                  5      ShST j5       r;S`SU jr<SiSV jr=S`SW jr>SXr?U =r@$ )jr:   i  zThe Textual command palette.r  úcommand-palette--help-textúcommand-palette--highlightzClassVar[set[str]]ÚCOMPONENT_CLASSESa°  
   
    CommandPalette:inline {
        /* If the command palette is invoked in inline mode, we may need additional lines. */
        min-height: 20;
    }
    CommandPalette {
        color: $foreground;
        background: $background 60%;
        align-horizontal: center;        

        #--container {
            display: none;
        }

        &:ansi {
            background: transparent;
        }
    }

    CommandPalette.-ready {
        #--container {
            display: block;
        }
    }


    CommandPalette > .command-palette--help-text  {
        color: transparent;
        text-style: dim not bold;
    }
    
    CommandPalette > .command-palette--highlight {
        text-style: bold underline;
    }   

    CommandPalette:nocolor > .command-palette--highlight {
        text-style: underline;
    }

    CommandPalette > Vertical {
        margin-top: 3; 
        height: 100%;
        visibility: hidden;
        background: $surface;
        &:dark { background: $panel-darken-1; }
    }

    CommandPalette #--input {
        height: auto;
        visibility: visible;
        border: hkey black 50%;
    }

    CommandPalette #--input.--list-visible {
        border-bottom: none;
    }

    CommandPalette #--input Label {
        margin-top: 1;
        margin-left: 1;
    }

    CommandPalette #--input Button {
        min-width: 7;
        margin-right: 1;
    }

    CommandPalette #--results {
        overlay: screen;
        height: auto;
    }

    CommandPalette LoadingIndicator {
        height: auto;
        visibility: hidden;
        border-bottom: hkey $border;
    }

    CommandPalette LoadingIndicator.--visible {
        visibility: visible;
    }
    zctrl+end, shift+endzcommand_list('last')zGo to bottomF)Úshowzctrl+home, shift+homezcommand_list('first')z	Go to topÚdownÚcursor_downzNext commandÚescapezExit the command paletteÚpagedownzcommand_list('page_down')z	Next pageÚpageupzcommand_list('page_up')zPrevious pageÚupzcommand_list('cursor_up')zPrevious commandzClassVar[list[BindingType]]ÚBINDINGSTzClassVar[bool]Úrun_on_select)Úinitz	var[bool]Ú_list_visibleÚ
_show_busyNzvar[Screen[Any] | None]Ú_calling_screenc                  ó$   • \ rS rSr% SrS\S'   Srg)Ú CommandPalette.OptionHighlightediª  zCPosted to App when an option is highlighted in the command palette.úOptionList.OptionHighlightedÚhighlighted_eventrr   N©rj   rk   rl   rm   rn   ro   rq   rr   rP   rL   ÚOptionHighlightedr   ª  s   ‡ áQà7Ó7ÚZrP   r$  c                  ó   • \ rS rSrSrSrg)ÚCommandPalette.Openedi±  z1Posted to App when the command palette is opened.rr   N)rj   rk   rl   rm   rn   rq   rr   rP   rL   ÚOpenedr&  ±  s   † ä?rP   r'  c                  ó$   • \ rS rSr% SrS\S'   Srg)ÚCommandPalette.Closediµ  z1Posted to App when the command palette is closed.rg   Úoption_selectedrr   Nr#  rr   rP   rL   ÚClosedr)  µ  s   ‡ á?àÓÚjrP   r+  u   Search for commandsâ€¦)ÚplaceholderrÏ   ró   Úclassesc               ó®   >• [         TU ]  UUUS9  U R                  S5        SU l         SU l         SU l         Xl        / U l         SU l         X l	        g)zæInitialise the command palette.

Args:
    providers: An optional list of providers to use. If None, the providers supplied
        in the App or Screen will be used.
    placeholder: The placeholder text for the command palette.
)ró   r-  rÏ   ú--textual-command-paletteNr   )
rØ   rŒ   Ú	add_classÚ_selected_commandÚ_busy_timerÚ_no_matches_timerÚ_supplied_providersÚ
_providersÚ
_hit_countÚ_placeholder)rK   Ú	providersr,  rÏ   ró   r-  rÞ   s         €rL   rŒ   ÚCommandPalette.__init__¼  sp   ø€ ô  	‰ÑØØØð 	ñ 	
ð
 	�‰Ð2Ô3à<@ˆÔØ8Ø)-ˆÔØJØ/3ˆÔØ]Ø:CÔ Ø*,ˆŒØ>Ø ˆŒØ'Ø'ÕrP   c                ó8   • U R                   R                  S5      $ )z‘Is a command palette current open?

Args:
    app: The app to test.

Returns:
    `True` if a command palette is currently open, `False` if not.
r/  )rŠ   Ú	has_class)r”   s    rL   Úis_openÚCommandPalette.is_openà  s   € ð �z‰z×#Ñ#Ð$?Ó@Ð@rP   c                óø   •     SS jnU R                   c
  [        5       $ U R                  c:  1 U" U R                  R                  5      kU" U R                   R                  5      k$ 1 U" U R                  5      k$ )zÝThe currently available command providers.

This is a combination of the command providers defined [in the
application][textual.app.App.COMMANDS] and those [defined in
the current screen][textual.screen.Screen.COMMANDS].
c              3  ó¼   #   • U  HR  n[        U[        5      (       a  Uv •  M  [        U5      (       a  [        U[        5      (       a  Uv •  MI  U" 5       v •  MT     g7f)zÇLoad the providers from a source (typically from the COMMANDS class variable)
at the App or Screen level.

Args:
    provider_source: The source of providers.

Returns:
    An iterable of providers.
N)rT   rÔ   r   Ú
issubclassr>   )Úprovider_sourceÚproviders     rL   Úget_providersÚ7CommandPalette._provider_classes.<locals>.get_providersõ  sI   é € ó ,�Ü˜h¬×7Ñ7Ø"”NÜ˜X×&Ñ&¬:°hÄ×+IÑ+IØ"”Nñ #›*Ô$ò ,ùs   ‚AA)rA  r�   rd   zIterable[type[Provider]])r  Úsetr4  r”   ÚCOMMANDS)rK   rC  s     rL   Ú_provider_classesÚ CommandPalette._provider_classesì  sŠ   € ð	%Ø+ð	%à%ô	%ð* ×ÑÑ'Ü“5ˆLØ×%Ñ%Ñ-ðÙ˜tŸx™x×0Ñ0Ó1ðá˜t×3Ñ3×<Ñ<Ó=ðð ð
 >‘] 4×#;Ñ#;Ó<Ð=Ð=rP   c              #  óŽ  #   • [        SS9   [        SS9   [        5       v •  [        U R                  SS9v •  U R
                  (       d  [        S5      v •  SSS5        [        SS9   [        5       v •  [        5       v •  SSS5        SSS5        g! , (       d  f       NA= f! , (       d  f       N(= f! , (       d  f       g= f7f)	zFCompose the command palette.

Returns:
    The content of the screen.
z--containerr÷   z--inputF)r,  Úselect_on_focusu   â–¶Nz	--results)	r#   r"   r  r  r7  r  r1   r  r3   rJ   s    rL   ÚcomposeÚCommandPalette.compose  sŒ   é € ô ˜Ó'Ü˜yÓ)Ü “lÒ"Ü"¨t×/@Ñ/@ÐRWÑXÒXØ×)×)Ü  Ó*Ò*÷	 *ô
 ˜[Ó)Ü!“mÒ#Ü&Ó(Ò(÷ *÷ (Ð'ß)Õ)ú÷
 *Õ)ú÷ (Õ'üsL   ‚
CŒ
B4–ABÁB4Á(B#ÂB4Â		CÂ
B 	ÂB4Â#
B1	Â-B4Â4
CÂ>Cc                óö   • U R                  UR                  UR                  5      S   U L aM  U R                  5         U R                  R                  [        R                  SS95        U R                  5         gg)z�Handle the click event.

Args:
    event: The click event.

This method is used to allow clicking on the 'background' as a
method of dismissing the palette.
r   F©r*  N)	Úget_widget_atÚscreen_xÚscreen_yÚ_cancel_gather_commandsr”   Úpost_messager:   r+  Údismiss©rK   Úevents     rL   Ú	_on_clickÚCommandPalette._on_click$  sa   € ð ×Ñ˜eŸn™n¨e¯n©nÓ=¸aÑ@ÀDÒHØ×(Ñ(Ô*Ø�H‰H×!Ñ!¤.×"7Ñ"7ÈÐ"7Ð"NÔOØ�L‰L�Nð IrP   c                ó°  • U R                   R                  [        R                  5       5        U R                   R                  S   U l        U R                  SSS9nU R
                  c   eU R                   Vs/ s H  nU" U R
                  U5      PM     snU l        U R                   H  nUR                  5         M     U R                  S5        gs  snf )z4Configure the command palette once the DOM is ready.éþÿÿÿr  T)ÚpartialNÚ )r”   rS  r:   r'  Úscreen_stackr  Úget_visual_stylerG  r5  r¨   Ú_gather_commands)rK   Ú_r‹   Úprovider_classrB  s        rL   Ú	_on_mountÚCommandPalette._on_mount2  sÂ   € ð 	�‰×Ñœn×3Ñ3Ó5Ô6Ø#Ÿx™x×4Ñ4°RÑ8ˆÔà×+Ñ+Ð,HÐRVÐ+ÐWˆà×#Ñ#Ñ/Ð/Ð/ð #'×"8Ò"8ó
â"8�ñ ˜4×/Ñ/°Ö=Ù"8ñ
ˆŒð ŸœˆHØ×ÑÖ!ñ (à×Ñ˜bÕ!ùò
s   Á9Cc           	   ƒ  óü   #   • U R                   (       a`  [        U R                    Vs/ s H  n[        UR                  5       5      PM     sn5      I Sh  v•N   U R                   R	                  5         ggs  snf  N%7f)z2Shutdown providers when command palette is closed.N)r5  r   r
   rÁ   Úclear)rK   rB  s     rL   Ú_on_unmountÚCommandPalette._on_unmountC  sa   é € à�?�?ÜØCGÇ?Â?ÓSÂ?°x”˜X×/Ñ/Ó1Ö2Á?ÑSó÷ ð ð �O‰O×!Ñ!Õ#ð	 ùâSñùs   ‚%A<§#A5Á

A<ÁA:Á&A<c                ób   • U R                   b"  U R                   R                  5         SU l         gg)z)Stop any busy countdown that's in effect.N)r2  ÚstoprJ   s    rL   Ú_stop_busy_countdownÚ#CommandPalette._stop_busy_countdownK  s-   € à×ÑÑ'Ø×Ñ×!Ñ!Ô#Ø#ˆDÕð (rP   g      à?zFinal[float]Ú_BUSY_COUNTDOWNc                óx   ^ • T R                  5         SU 4S jjnT R                  T R                  U5      T l        g)z7Start a countdown to showing that we're busy searching.c                 ó8   >• T R                   (       a  ST l        g g )NT)r  r  rJ   s   €rL   Ú_become_busyÚ:CommandPalette._start_busy_countdown.<locals>._become_busyX  s   ø€ Ø×!×!Ø"&�•ð "rP   Nrh   )rj  Ú	set_timerrl  r2  )rK   ro  s   ` rL   Ú_start_busy_countdownÚ$CommandPalette._start_busy_countdownT  s/   ø€ à×!Ñ!Ô#÷	'ð  Ÿ>™>¨$×*>Ñ*>ÀÓMˆÕrP   c                ób   • U R                   b"  U R                   R                  5         SU l         gg)z1Stop any 'No matches' countdown that's in effect.N)r3  ri  rJ   s    rL   Ú_stop_no_matches_countdownÚ)CommandPalette._stop_no_matches_countdown^  s-   € à×!Ñ!Ñ-Ø×"Ñ"×'Ñ'Ô)Ø%)ˆDÕ"ð .rP   Ú_NO_MATCHES_COUNTDOWNc                ó|   ^ ^• T R                  5         SUU 4S jjnT R                  T R                  U5      T l        g)zÚStart a countdown to showing that there are no matches for the query.

Args:
    search_value: The value being searched for.

Adds a 'No matches found' option to the command list after
`_NO_MATCHES_COUNTDOWN` seconds.
c                 óÜ   >• T(       a]  TR                  [        5      n U R                  [        [        R
                  " [        SSS95      STR                  S95        STl        g STl        g )NzNo matches foundznot bold)ÚstyleT)rô   ró   F)	Ú	query_oner  Ú
add_optionr6   r   Úcenterr   Ú_NO_MATCHESr  )Úcommand_listÚsearch_valuerK   s    €€rL   Ú_show_no_matchesÚDCommandPalette._start_no_matches_countdown.<locals>._show_no_matchesr  s`   ø€ ö Ø#Ÿ~™~¬kÓ:�Ø×'Ñ'ÜÜŸš¤TÐ*<ÀJÑ%OÓPØ!%Ø×+Ñ+ñôð &*�Õ"ð &+�Õ"rP   Nrh   )ru  rq  rw  r3  )rK   r€  r�  s   `` rL   Ú_start_no_matches_countdownÚ*CommandPalette._start_no_matches_countdowng  s:   ù€ ð 	×'Ñ'Ô)÷	+ð 	+ð( "&§¡Ø×&Ñ&Øó"
ˆÕrP   c                óô   • U R                  [        5      R                  U R                  S5        U R                  S[        5      R                  U R                  S5        U R                  (       d  SU l        gg)z-React to the list visible flag being toggled.ú	--visiblez#--inputz--list-visibleFN)r{  r  Ú	set_classr  r"   r  rJ   s    rL   Ú_watch__list_visibleÚ#CommandPalette._watch__list_visible‹  s]   € à�‰”{Ó#×-Ñ-¨d×.@Ñ.@À+ÔNØ�‰�z¤:Ó.×8Ñ8Ø×ÑÐ 0ô	
ð ×!×!Ø#ˆD�Oð "rP   c              ƒ  óÈ   #   • U R                  [        5      R                  U R                  S5        U R                  [        5      R                  U R                  S5        g7f)zzReact to the show busy flag being toggled.

This watcher adds or removes a busy indication depending on the
flag's state.
r†  z--populatingN)r{  r3   r‡  r  r  rJ   s    rL   Ú_watch__show_busyÚ CommandPalette._watch__show_busy”  sB   é € ð 	�‰Ô'Ó(×2Ñ2°4·?±?ÀKÔPØ�‰”{Ó#×-Ñ-¨d¯o©o¸~ÕNùs   ‚A A"c              ƒ  ób   #   • U   Sh  v•N nUR                  U5      I Sh  v•N   M$   N N
 g7f)z—Consume a source of matching commands, feeding the given command queue.

Args:
    hits: The hits to consume.
    commands: The command queue to feed.
N)Úput)rµ   rÝ   r¶   s      rL   Ú_consumeÚCommandPalette._consume�  s0   é € ñ ÷ 	$�#Ø—,‘,˜sÓ#×#Ò#ñ	$Ù#ñ ùs(   ‚/…-‰)Š-�/¢+£/©-«/­/c           
    ó  #   • [        5       nU R                   Vs/ s H-  n[        U R                  UR	                  U5      U5      5      PM/     nnU R                  5         SnU(       dm  [        S U 5       5      (       aV   [        UR                  5       S5      I Sh  v•N 7v •nUR                  5         U(       d  [        S U 5       5      (       a  MV  U Hs  nUR                  5       (       d  M  UR                  5       nUc  M/  SSKJn  U R                   R#                  UR%                  ['        U5      XwR(                  5      5        Mu     U(       d  U R+                  5         U(       dN  UR-                  5       (       d9  UR                  5       I Sh  v•N 7v •nU(       d  UR-                  5       (       d  M9  U(       a  U H  nUR/                  5         M     ggs  snf  GND! [         a     GN<[         a    Sn GNJf = f Nn7f)z½Search for a given search value amongst all of the command providers.

Args:
    search_value: The value to search for.

Yields:
    The hits made amongst the registered command providers.
Fc              3  óJ   #   • U  H  oR                  5       (       + v •  M     g 7frR   )Údone)Ú.0r²   s     rL   Ú	<genexpr>Ú-CommandPalette._search_for.<locals>.<genexpr>É  s   é € Ð!KÂ(¸§k¡k£m×"3Ñ"3Â(ùs   ‚!#gš™™™™™¹?NTr   rŸ   )r   r5  r
   r�  r·   rr  Úanyr   ÚgetÚ	task_doner	   r   r“  Ú	exceptionr£   r    r¤   r¥   Úfrom_exceptionÚtypeÚ__traceback__rj  ÚemptyÚcancel)	rK   r€  rÝ   rB  ÚsearchesÚabortedr²   rš  r    s	            rL   Ú_search_forÚCommandPalette._search_for¨  sµ  é € ô /4«gˆð !ŸOšOó
ò ,�ô Ø—‘Ø×$Ñ$ \Ó2Øóöñ ,ð 	ð 
ð 	×"Ñ"Ô$ð ˆö œcÑ!KÁ(Ó!K×KÑKð%ô '/¨x¯|©|«~¸sÓ&C× CÒC�ð ×"Ñ"Ô$ö œcÑ!KÁ(Ó!K×KÓKó. ˆFØ�{‰{�}‹}Ø"×,Ñ,Ó.�	ØÓ(Ý8à—H‘H—N‘NØ!×0Ñ0Ü  ›O¨Y×8OÑ8Oóöñ ö" Ø×%Ñ%Ô'ö
  (§.¡.×"2Ñ"2Ø"*§,¡,£.×0Ò0ˆGö  (§.¡.×"2Ó"2ö Û"�Ø—‘–ò #ð ùòE
ò( !DøÜó ò Ü!ó à“ðúñL 1ùsw   ‚H›4GÁ2HÂG& ÂG#Â G& Â'.HÃHÃ3HÄBHÆHÆ#HÆ<'HÇ#G& Ç&
HÇ0HÇ3HÇ>HÈHÈHc                óÜ   • [        U[        S5      SS9nUR                  5       R                  U5        U(       a  SUl        [        UR                  5      U l        UR                  U l        g)zÝRefresh the command list.

Args:
    command_list: The widget that shows the list of commands.
    commands: The commands to show in the widget.
    clear_current: Should the current content of the list be cleared first?
z	hit.scoreT)ÚkeyÚreverser   N)	Úsortedr   Úclear_optionsÚadd_optionsÚhighlightedrg   Úoption_countr  r6  )rK   r  rÝ   Úclear_currentÚsorted_commandss        rL   Ú_refresh_command_listÚ$CommandPalette._refresh_command_listÿ  sZ   € ô ! ¬z¸+Ó/FÐPTÑUˆØ×"Ñ"Ó$×0Ñ0°ÔAæØ'(ˆLÔ$ä! ,×";Ñ";Ó<ˆÔØ&×3Ñ3ˆ�rP   g      Ð?Ú_RESULT_BATCH_TIMEz--no-matchesz
Final[str]r~  z)--textual-command-palette-gather-commandsÚ_GATHER_COMMANDS_GROUP)Ú	exclusiveÚgroupc           	   ƒ  ób  ^ ^#   • / nT R                  [        5      nUR                  S:X  aD  UR                  S5      R                  T R
                  :X  a  UR                  T R
                  5        Sn[        5       nST l        Sn[        5       nT R                  U5      nUR                  5       n	 U	R                  5       I Sh  v•N mT(       aÁ  S
UU 4S jjn
[        S5      R                  U
" 5       5      nUR!                  [#        UT[%        U5      S95        UR&                  (       a  Od[        5       nXÇ-
  T R(                  :”  a  T R+                  X2U5        SnUnUS-  n UR-                  UR&                  5      I Sh  v•N mT(       a  MÁ  UR&                  (       d  T R+                  X2U5        ST l        UR                  S:X  a)  UR&                  (       d  ST l        T R1                  U5        T R3                  S	5        g GNB! [         a    Sm GNOf = f N˜! [         a     Mš  f = f7f)zmGather up all of the commands that match the search value.

Args:
    search_value: The value to search for.
é   r   FTNc               3  ó°  >#   • Tc   e[        TR                  [        5      (       a#  [        R                  " TR                  5      v •  O"[        R
                  " TR                  5      v •  TR                  (       aW  [        R                  " TR                  S5      5      n [        R
                  " TR                  5      R                  U 5      v •  gg7f)zGenerator for prompt content.Nr  )rT   rM   r   r$   Úfrom_rich_textÚfrom_markuprH   r,   Úfrom_stylesÚget_component_stylesÚstylize_before)Ú
help_styler¶   rK   s    €€rL   Úbuild_promptÚ5CommandPalette._gather_commands.<locals>.build_prompt\  sš   øé € à‘Ð&�Ü˜cŸj™j¬$×/Ñ/Ü!×0Ò0°·±Ó<Ó<ä!×-Ò-¨c¯j©jÓ9Ò9ð —8—8Ü!&×!2Ò!2Ø×1Ñ1Ð2NÓOó"�Jô "×-Ò-¨c¯h©hÓ7×FÑFÀzÓRÓRð	 ùs   ƒCCÚ
r÷   z-ready)rd   zIterable[Content])r{  r  r«  Úget_option_at_indexró   r~  Úremove_optionr7   r  r   r¢  Ú	__aiter__Ú	__anext__ÚStopAsyncIterationr$   ÚjoinrÚ   rñ   r_   Úis_cancelledr°  r®  Úasendr6  rƒ  r0  )rK   r€  Úgathered_commandsr  Ú
command_idÚworkerr¬  Úlast_updateÚsearch_routineÚsearch_resultsr½  rM   Únowr¶   s   `            @rL   r_  ÚCommandPalette._gather_commands  s	  ùé € ð ,.Ðð —~‘~¤kÓ2ˆð ×%Ñ%¨Ó*Ø×0Ñ0°Ó3×6Ñ6¸$×:JÑ:JÓJà×&Ñ& t×'7Ñ'7Ô8ð
 ˆ
ô $Ó%ˆð  ˆŒð ˆô  “kˆð ×)Ñ)¨,Ó7ˆØ'×1Ñ1Ó3ˆð	Ø&×0Ñ0Ó2×2ˆCö ÷Sð Sô ˜T“]×'Ñ'©«Ó7ˆFà×$Ñ$¤W¨V°S¼SÀ»_Ñ%MÔNà×"×"Øä“+ˆCØÑ! T×%<Ñ%<Ó<Ø×*Ñ*Ø °]ôð !&�Ø!�à˜!‰OˆJð
Ø*×0Ñ0°×1DÑ1DÓE×E�÷Q ˆcð\ ×"×"Ø×&Ñ& |ÈÔVð  ˆŒð
 ×$Ñ$¨Ó)°&×2E×2EØˆDŒOØ×,Ñ,¨\Ô:à�‰�xÕ òC 3øÜ!ó 	ð ‹Cð	úñZ FøÜ%ó Úðüsz   „B,H/Â1H	 ÃHÃH	 Ã	BH/Å%H ÆHÆH ÆH/ÆA5H/ÈH	 È	HÈH/ÈHÈH/ÈH È
H,È(H/È+H,È,H/c                óN   • U R                   R                  X R                  5        g)z-Cancel any operation that is gather commands.N)ÚworkersÚcancel_groupr±  rJ   s    rL   rR  Ú&CommandPalette._cancel_gather_commands•  s   € à�‰×!Ñ! $×(CÑ(CÕDrP   c                ó¶   • UR                  5         U R                  5         U R                  5         U R                  UR                  R                  5       5        g)zJReact to input in the command palette.

Args:
    event: The input event.
N)ri  rR  ru  r_  ÚvalueÚstriprU  s     rL   Ú_inputÚCommandPalette._input™  s@   € ð 	�
‰
ŒØ×$Ñ$Ô&Ø×'Ñ'Ô)Ø×Ñ˜eŸk™k×/Ñ/Ó1Õ2rP   c                óT  • UR                  5         U R                  5         U R                  [        5      nU R	                  [
        R                  5         [        UR                  [        5      (       d   eUR                  R                  n[        UR                  5      Ul        X0l        SSS5        UR                  5         SU l        U R                  ["        5      R%                  5         SU l        U R(                  (       a  U R+                  5         gg! , (       d  f       Nr= f)zcReact to a command being selected from the dropdown.

Args:
    event: The option selection event.
NFr   )ri  rR  r{  r  Úpreventr2   ÚChangedrT   Úoptionrñ   r¶   r_   rG   rÕ  r1  Ú
action_endr  r  r¨  r6  r  Ú_select_or_command)rK   rV  Úinputr¶   s       rL   Ú_select_commandÚCommandPalette._select_command¥  sÌ   € ð 	�
‰
ŒØ×$Ñ$Ô&Ø—‘œ|Ó,ˆØ�\‰\œ%Ÿ-™-Õ(Ü˜eŸl™l¬G×4Ñ4Ð4Ð4Ø—,‘,×"Ñ"ˆCÜ˜cŸh™h›-ˆEŒKØ%(Ô"÷	 )ð
 	×ÑÔØ"ˆÔØ�‰”{Ó#×1Ñ1Ô3ØˆŒØ××Ø×#Ñ#Õ%ð ÷ )Õ(ús   ÁADÄ
D'c                ó`  • Ub  UR                  5         U R                  (       ag  U R                  [        5      nUR                  c3  U R                  5         UR                  S:X  a  U R                  S5        ggU R                  S5        gU R                  b–  U R                  5         U R                  R                  [        R                  SS95        U R                  R                  5         U R                  5         U R                  R!                  U R                  R"                  5        gg)z2Depending on context, select or execute a command.Nrµ  ÚselectTrN  )ri  r  r{  r  rª  Ú_action_cursor_downr«  Ú_action_command_listr1  rR  r”   rS  r:   r+  Údelay_updaterT  Ú
call_laterrE   )rK   rV  r  s      rL   rÞ  Ú!CommandPalette._select_or_command»  së   € ð ÑØ�J‰JŒLØ××ØŸ>™>¬+Ó6ˆLà×'Ñ'Ñ/à×(Ñ(Ô*à×,Ñ,°Ó1à×-Ñ-¨hÕ7ð 2ð ×)Ñ)¨(Õ3ð ×%Ñ%Ñ1ð ×,Ñ,Ô.Ø—‘×%Ñ%¤n×&;Ñ&;ÈDÐ&;Ð&QÔRØ—‘×%Ñ%Ô'Ø—‘”Ø—‘×#Ñ# D×$:Ñ$:×$BÑ$BÕCð 2rP   c                ó|   • UR                  5         U R                  R                  [        R	                  US95        g)z=Stop any unused events so they don't leak to the application.)r"  N)ri  r”   rS  r:   r$  rU  s     rL   Ú_stop_event_leakÚCommandPalette._stop_event_leakß  s.   € ð 	�
‰
ŒØ�‰×Ñœn×>Ñ>ÐQVÐ>ÐWÕXrP   c                óœ   • U R                  5         U R                  R                  [        R	                  SS95        U R                  5         g)z6Handle a request to escape out of the command palette.FrN  N)rR  r”   rS  r:   r+  rT  rJ   s    rL   Ú_action_escapeÚCommandPalette._action_escapeå  s7   € à×$Ñ$Ô&Ø�‰×Ñœn×3Ñ3ÀEÐ3ÐJÔKØ�‰�rP   c                óx   •  [        U R                  [        5      SU 35      nU" 5         g! [         a     gf = f)z¥Pass an action on to the [`CommandList`][textual.command.CommandList].

Args:
    action: The action to pass on to the [`CommandList`][textual.command.CommandList].
Úaction_N)Úgetattrr{  r  ÚAttributeError)rK   ÚactionÚcommand_actions      rL   rå  Ú#CommandPalette._action_command_listë  s?   € ð	Ü$ T§^¡^´KÓ%@ÀGÈFÈ8ÐBTÓUˆNñ 	Õøô ó 	Ùð	ús   ‚", ¬
9¸9c                ó*  • U R                  [        5      nUR                  (       a   U R                  (       d  SU l        SUl        gUR                  (       a<  UR                  S5      R                  U R                  :X  d  U R                  S5        ggg)z¸Handle the cursor down action.

This allows the cursor down key to either open the command list, if
it's closed but has options, or if it's open with options just
cursor through them.
Tr   r  N)	r{  r  r«  r  rª  rÀ  ró   r~  rå  )rK   rÝ   s     rL   rä  Ú"CommandPalette._action_cursor_down÷  st   € ð —>‘>¤+Ó.ˆØ× × ¨×);×);Ø!%ˆDÔØ#$ˆHÕ à×!×!Ø×0Ñ0°Ó3×6Ñ6¸$×:JÑ:JÓJà×%Ñ% mÕ4ð Kð "rP   )
r2  r  r6  r  r3  r7  r5  r1  r  r4  rR   )r8  zProviderSource | Noner,  r_   rÏ   rF   ró   rF   r-  rF   rd   ri   )r”   rÉ   rd   rg   )rd   zset[type[Provider]])rd   r9   )rV  r%   rd   ri   )r`  r&   rd   ri   rh   )r€  r_   rd   ri   )rµ   r=   rÝ   zQueue[DiscoveryHit | Hit]rd   ri   )r€  r_   rd   z(AsyncGenerator[DiscoveryHit | Hit, bool])r  r  rÝ   zlist[Command]r¬  rg   rd   ri   )rV  zInput.Changedrd   ri   )rV  zOptionList.OptionSelectedrd   ri   )rV  z'Input.Submitted | Button.Pressed | Nonerd   ri   )rV  r!  rd   ri   )ró  r_   rd   ri   )Arj   rk   rl   rm   rn   Ú
AUTO_FOCUSr*   r  ro   r  r    r  r  r)   r  r  r  r   r(   r$  r'  r+  rŒ   Ústaticmethodr<  rp   rG  rK  rW  rb  rf  rj  rl  rr  ru  rw  rƒ  rˆ  r‹  r�  r¢  r®  r°  r~  r±  r   r_  rR  r   r2   rÛ  r×  r4   ÚOptionSelectedrà  Ú	Submittedr1   ÚPressedrÞ  rê  rí  rå  rä  rq   rî   rï   s   @rL   r:   r:     s¡  ø‡ Ù&à€Jà,2×,DÑ,DØ$Ø$ðHñ -ÐÐ)ó ððR€Kñj 	Ø!Ø"ØØñ		
ñ 	Ø#Ø#ØØñ		
ñ 	�˜ ~¸EÑBÙ�˜(Ð$>Ó?Ù�
Ð7¸È5ÑQÙ�Ð3°_È5ÑQÙ�Ð1Ð3EÈEÑRð#-€HÐ)ó ð&
ð %)€M�>Ó(ðñ  # 5¨uÑ5€M�9Ó5ØIá ¨EÑ2€J�	Ó2ØKá/2°4«y€OÐ,Ó8ØEàô[˜Gó [ó ð[ð ô@�ó @ó ð@ð ôk�ó kó ðkð ,0ð"(ð 4ØØØ"ñ"(à(ð"(ð ð	"(ð
 ð"(ð ð"(ð ð"(ð 
÷"(ñ "(ðH ó	Aó ð	Að ó%>ó ð%>ôN)ô ô"ô"$ô$ð %(€O�\Ó'ØUôNô*ð +.Ð˜<Ó-ØEô"
ôH$ôOð ó$ó ð$ðU ØðU à	1ôU ðn4Ø'ð4Ø3@ð4ØQUð4à	ô4ð( (,Ð˜Ó+ØFà,€K�Ó,ØNà)TÐ˜JÓTØ9á	�DÐ 6Ñ7óv!ó 8ðv!ôpEñ ˆ�‰Óó	3ó ð	3ñ ˆ
×!Ñ!Ó"ó&ó #ð&ñ* ˆ�‰ÓÙˆ�‰Óà?Cð DØ<ð Dà	ô Dó ó ð DñD ˆ
×$Ñ$Ó%óYó &ðYô
ô
÷5ò 5rP   r:   )irn   Ú
__future__r   Úabcr   r   Úasyncior   r   r   r	   r
   r   r   Údataclassesr   Ú	functoolsr   Úinspectr   Úoperatorr   Útimer   Útypingr   r   r   r   r   r   r   r   Ú	rich.reprÚrichÚ
rich.alignr   Ú	rich.textr   Útyping_extensionsr   r   Útextualr   r   Útextual.bindingr    r!   Útextual.containersr"   r#   Útextual.contentr$   Útextual.eventsr%   r&   Útextual.fuzzyr'   Útextual.messager(   Útextual.reactiver)   Útextual.screenr*   r+   Útextual.styler,   Útextual.timerr-   Útextual.typesr.   Útextual.visualr/   Útextual.widgetr0   Útextual.widgetsr1   r2   r3   r4   r5   Útextual.widgets.option_listr6   Útextual.workerr7   Útextual.appr8   r9   Ú__all__r<   r;   r=   ro   r�   r>   rÎ   rÒ   rÔ   ÚreprÚautorñ   r  r  r  r:   rr   rP   rL   Ú<module>r      s‹  ðòõ #ç #÷÷ ñ õ "Ý $Ý Ý Ý ÷	÷ 	ó 	ó Ý Ý ß .ç ß 0ß 3Ý #ß 'Ý !Ý #Ý  ß 4Ý Ý Ý 2Ý %Ý !ß OÕ OÝ .Ý -æß.ò€ð ÷+0ð +0ó ð+0ð\ ÷1*ð 1*ó ð1*ðh  Ð 4Ñ5€€iÓ 5Ø =àU€�	Ó UØ BôRˆsô Rôj*�Jô *ð nð �ó ô
5�Xô 5ðp ‡�‡�Øô!ˆfó !ó ó ð!ôH5�*¨ò 5ôp� Uò ô0�5ô ôr5Ð& tÑ,õ r5rP   