ó
    °"³j4  ã                  óJ  • % S SK Jr  S SKrS SKJrJrJrJrJrJ	r	  S SK
Jr  SSKJr  \(       a  SSKJrJr  / SQr\\/S	4   rS
\S'    \\/\	S   4   rS
\S'     " S S5      r\\\/S	4   rS
\S'   \\\/\	S   4   rS
\S'   \\\\4   rS
\S'   SS jrSS jrSS jrSS jrg)é    )ÚannotationsN)ÚTYPE_CHECKINGÚAnyÚUnionÚCallableÚIterableÚ	Awaitable)Ú	TypeAliasé   )Ú
APIRequest)ÚAPIResponseÚAsyncAPIResponse)Ú
MiddlewareÚCallNextÚAsyncCallNextÚMiddlewareCallableÚAsyncMiddlewareCallableÚMiddlewareInputúAPIResponse[Any]r
   r   úAsyncAPIResponse[Any]r   c                  ó,   • \ rS rSrSrSS jrSS jrSrg)	r   é.   zÜBase class for client-level middleware.

Subclass and override `handle` (used by the sync client) and/or `handle_async`
(used by the async client). The default implementations delegate straight to
the rest of the chain.
c                ó   • U" U5      $ ©N© ©ÚselfÚrequestÚ	call_nexts      ÚR/home/mande/repo/quber/.venv/lib/python3.13/site-packages/anthropic/_middleware.pyÚhandleÚMiddleware.handle6   s   € Ù˜Ó!Ð!ó    c              ƒ  ó.   #   • U" U5      I S h  v•N $  N7fr   r   r   s      r    Úhandle_asyncÚMiddleware.handle_async9   s   é € Ù˜wÓ'×'Ð'Ñ'ùs   ‚Ž�r   N)r   r   r   r   Úreturnr   )r   r   r   r   r'   r   )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r!   r%   Ú__static_attributes__r   r#   r    r   r   .   s   † ñô"÷(r#   r   r   r   r   c                ó´   • [        U [        5      (       a  [        U 5      R                  $ [	        U SS 5      n[        U[
        5      (       a  U$ [        U 5      $ )Nr(   )Ú
isinstancer   Útyper(   ÚgetattrÚstrÚrepr)Ú
middlewareÚnames     r    Ú_middleware_namer6   B   sJ   € Ü�*œj×)Ñ)Ü�JÓ×(Ñ(Ð(Ü�:˜z¨4Ó0€DÜ˜d¤C×(Ñ(ˆ4Ð>¬d°:Ó.>Ð>r#   c                ó–   • [         R                  " U 5      (       a  g[        U SS5      nUSL=(       a    [         R                  " U5      $ )z«Whether calling the given object returns a coroutine.

Unlike `inspect.iscoroutinefunction(obj)` this also handles class instances
that define an async `__call__` method.
TÚ__call__N)ÚinspectÚiscoroutinefunctionr1   )ÚobjÚcalls     r    Ú_is_async_callabler=   I   sA   € ô ×"Ò" 3×'Ñ'ØÜ�3˜
 DÓ)€DØ�tÐ×A¤× ;Ò ;¸DÓ AÐAr#   c                óì  • U  Hî  n[        U[        5      (       a†  [        U5      R                  [        R                  L a  [	        S[        U5       S35      e[        R                  " [        U5      R                  5      (       a  [	        S[        U5       S35      eMž  [        U5      (       d  [	        S[        U5       S35      e[        U5      (       d  MØ  [	        S[        U5       S35      e   g )Númiddleware zW does not implement `handle()`; the synchronous client requires sync-capable middlewarezj defines `handle()` as an async function; the synchronous client requires `handle()` to be a sync functionú is not callablezP is an async function; the synchronous client requires sync middleware functions)
r/   r   r0   r!   Ú	TypeErrorr6   r9   r:   Úcallabler=   ©r4   Úentrys     r    Úvalidate_sync_middlewarerE   U   sú   € ÛˆÜ�eœZ×(Ñ(Ü�E‹{×!Ñ!¤Z×%6Ñ%6Ò6ÜØ!Ô"2°5Ó"9Ð!:ð ;Nð Nóð ô ×*Ò*¬4°«;×+=Ñ+=×>Ñ>ÜØ!Ô"2°5Ó"9Ð!:ð ;Wð Wóð ñ ?ô
 ˜%—‘Ü˜kÔ*:¸5Ó*AÐ)BÐBRÐSÓTÐTÜ ×&Ó&ÜØÔ.¨uÓ5Ð6ð 7Lð Lóð ò r#   c                óì  • U  Hî  n[        U[        5      (       a†  [        U5      R                  [        R                  L a  [	        S[        U5       S35      e[        R                  " [        U5      R                  5      (       d  [	        S[        U5       S35      eMž  [        U5      (       d  [	        S[        U5       S35      e[        U5      (       a  MØ  [	        S[        U5       S35      e   g )Nr?   z_ does not implement `handle_async()`; the asynchronous client requires async-capable middlewarezw defines `handle_async()` as a sync function; the asynchronous client requires `handle_async()` to be an async functionr@   zV is not an async function; the asynchronous client requires async middleware functions)
r/   r   r0   r%   rA   r6   r9   r:   rB   r=   rC   s     r    Úvalidate_async_middlewarerG   k   sû   € ÛˆÜ�eœZ×(Ñ(Ü�E‹{×'Ñ'¬:×+BÑ+BÒBÜØ!Ô"2°5Ó"9Ð!:ð ;Pð Póð ô ×.Ò.¬t°E«{×/GÑ/G×HÑHÜØ!Ô"2°5Ó"9Ð!:ð ;`ð `óð ñ Iô
 ˜%—‘Ü˜kÔ*:¸5Ó*AÐ)BÐBRÐSÓTÐTÜ# E×*Ó*ÜØÔ.¨uÓ5Ð6ð 7Nð Nóð ò r#   )r4   Úobjectr'   r2   )r;   rH   r'   Úbool)r4   zIterable[MiddlewareInput]r'   ÚNone)Ú
__future__r   r9   Útypingr   r   r   r   r   r	   Útyping_extensionsr
   Ú_requestr   Ú	_responser   r   Ú__all__r   Ú__annotations__r   r   r   r   r   r6   r=   rE   rG   r   r#   r    Ú<module>rR      sÙ   ðÞ "ã ß K× KÝ 'å  æß8ò€ð  
˜|Ð-?Ð?Ñ@€ˆ)Ó @ð	ð $ Z L°)Ð<SÑ2TÐ$TÑU€ˆyÓ Uð	÷(ñ (ð !)¨*°hÐ)?ÐASÐ)SÑ TÐ �IÓ TØ%-¨z¸=Ð.IÈ9ÐUlÑKmÐ.mÑ%nÐ ˜Ó nØ" :Ð/AÐCZÐ#ZÑ[€�Ó [ô?ô	Bôõ,r#   