+
    PV-jû+  ã                   óÞ   a € R t"0 t R t^ RIt^ RIt^ RIt^ RIHt ^ RIHtH	t	H
t
 ^RIHt ^RIHt ^RIHtHt ^RIHt ^RIHtHtHtHtHtHtHtHt ^R	IHtHt ^t] ^ k Rt  ! R
 R4      t!R# )z%WebSocket protocol versions 13 and 8.N)Úpartial)ÚFinalÚOptionalÚSet)ÚBaseProtocol)ÚClientConnectionResetError)ÚZLibBackendÚZLibCompressor)ÚDEFAULT_CHUNK_SIZE)ÚMASK_LENÚMSG_SIZEÚPACK_CLOSE_CODEÚ	PACK_LEN1Ú	PACK_LEN2Ú	PACK_LEN3ÚPACK_RANDBITSÚwebsocket_mask)ÚWS_DEFLATE_TRAILINGÚ	WSMsgTypec            
       óà   a € ] tR t^'t o RtRRR]R]P                  ! 4       R^ RR/V 3R lR	 lltRV 3R lR llt	V 3R lR lt
V 3R lR ltV 3R lR ltV 3R lR ltRV 3R lR lltRtV tR
# )ÚWebSocketWritera  WebSocket writer.

The writer is responsible for sending messages to the client. It is
created by the protocol when a connection is established. The writer
should avoid implementing any application logic and should only be
concerned with the low-level details of the WebSocket protocol.
Úuse_maskFÚlimitÚrandomÚcompressÚ
notakeoverc                óp   <€ V ^8„  d   QhRS[ RS[P                  RS[RS[RS[P                  RS[RS[RR	/# )
é   ÚprotocolÚ	transportr   r   r   r   r   ÚreturnN)r   ÚasyncioÚ	TransportÚboolÚintr   ÚRandom)ÚformatÚ__classdict__s   "€Új/Volumes/fast/ai/experiments/ui-tars-smoke/.venv/lib/python3.14/site-packages/aiohttp/_websocket/writer.pyÚ__annotate__ÚWebSocketWriter.__annotate__0   so   ø€ ÷ @ñ @áð@ñ ×$Ñ$ð@ñ
 ð@ñ ð@ñ —‘ð@ñ ð@ñ ð@ð 
ñ@ó    c               ó   € Wn         W n        W0n        \        VP                  ^ 4      V n        W`n        Wpn        RV n        W@n	        ^ V n
        RV n        \        P                  ! 4       V n        \        4       V n        R# )zInitialize a WebSocket writer.FN)r   r   r   r   ÚgetrandbitsÚget_random_bitsr   r   Ú_closingÚ_limitÚ_output_sizeÚ_compressobjr!   ÚLockÚ
_send_lockÚsetÚ_background_tasks)Úselfr   r   r   r   r   r   r   s   &&&$$$$$r(   Ú__init__ÚWebSocketWriter.__init__0   se   € ð !ŒØ"ŒØ ŒÜ& v×'9Ñ'9¸2Ó>ˆÔØ ŒØ$ŒØˆŒØŒØˆÔØ6:ˆÔÜ!Ÿ,š,›.ˆŒÜ:=»%ˆÖr+   Nc                ó>   <€ V ^8„  d   QhRS[ RS[RS[R,          RR/# ©r   ÚmessageÚopcoder   Nr    ©Úbytesr$   )r&   r'   s   "€r(   r)   r*   I   s1   ø€ ÷ 04ñ 04Ùð04Ù&)ð04Ù58¸4µZð04à	ñ04r+   c              ƒ  ó8  "  € V P                   '       d)   V\        P                  ,          '       g   \        R4      hV'       g   V P                  '       d   V\
        8¼  d   V P                  W^ 4       EM\        V4      \        8:  dA   V P                  ;_uu_4       GRj  x€L
  V P                  WV4       RRR4      GRj  x€L
  MÄ\        P                  ! 4       pV P                  WV4      p\        P                  R8¼  d   \        P                   ! WTRR7      pMVP#                  V4      pV P$                  P'                  V4       VP)                  V P$                  P*                  4       \        P,                  ! V4      G Rj  x€L
  V P.                  V P0                  8”  dJ   ^ V n        V P2                  P4                  '       d%   V P2                  P7                  4       G Rj  x€L
  R# R# R#  ELR EL3  + GRj  x€L 
 '       g   i     L…; i LŒ L.5i)z<Send a frame over the websocket with message as its payload.ú!Cannot write to closing transportNT)ÚloopÚeager_start)é   é   )r/   r   ÚCLOSEr   r   ÚWS_CONTROL_FRAME_OPCODEÚ_write_websocket_frameÚlenÚWEBSOCKET_MAX_SYNC_CHUNK_SIZEr4   Ú_send_compressed_frame_syncr!   Úget_running_loopÚ#_send_compressed_frame_async_lockedÚsysÚversion_infoÚTaskÚcreate_taskr6   ÚaddÚadd_done_callbackÚdiscardÚshieldr1   r0   r   Ú_pausedÚ_drain_helper)r7   r<   r=   r   rB   ÚcoroÚ	send_tasks   &&&&   r(   Ú
send_frameÚWebSocketWriter.send_frameI   sr  é € ð �=�=ˆ= &¬9¯?©?×":Ô":Ü,Ð-PÓQÐQç˜DŸMŸM˜M¨fÔ8OÔ.Oà×'Ñ'¨¸Ö;Ü�‹\Ô:Ô:ð
 ———“Ø×0Ñ0°À(ÔK÷ '—�ô ×+Ò+Ó-ˆDØ×;Ñ;¸GÈXÓVˆDÜ×Ñ 7Ô*Ü#ŸLšL¨ÀdÔK‘	à ×,Ñ,¨TÓ2�	à×"Ñ"×&Ñ& yÔ1Ø×'Ñ'¨×(>Ñ(>×(FÑ(FÔGÜ—.’. Ó+×+Ð+ð ×Ñ˜tŸ{™{Ô*Ø !ˆDÔØ�}‰}×$×$Ð$Ø—m‘m×1Ñ1Ó3×3Ò3ñ %ñ +÷= '——–úñ* ,ñ 4ùs…   ‚/H²HÁHÁAHÂ"G4Â#HÂ&G:Â9HÃG7ÃCHÆ	HÆ
AHÇHÇ)HÇ*HÇ7HÇ:H	È HÈ
H	ÈH	È	HÈHc                ó0   <€ V ^8„  d   QhRS[ RS[RS[RR/# )r   r<   r=   Úrsvr    Nr>   )r&   r'   s   "€r(   r)   r*   {   s)   ø€ ÷ 05ñ 05©eð 05¹Sð 05Ásð 05Ètñ 05r+   c                ó`  € \        V4      pV P                  pV'       d   ^€M^ p^€V,          V,          pV^~8  d   \        WtV,          4      p^p	M4VR8  d   \        V^~V,          V4      p^p	M\	        V^V,          V4      p^
p	V P
                  P                  4       '       d   \        R4      hV'       dv   \        V P                  4       4      p
\        V4      p\        W«4       V P
                  P                  WŠ,           V,           4       V ;P                  \        ,          un        McV\        8”  d8   V P
                  P                  V4       V P
                  P                  V4       M!V P
                  P                  W�,           4       V ;P                  W”,           ,          un        R# )zÛ
Write a websocket frame to the transport.

This method handles frame header construction, masking, and writing to transport.
It does not handle compression or flow control - those are the responsibility
of the caller.
i   rA   N)rI   r   r   r   r   r   Ú
is_closingr   r   r.   Ú	bytearrayr   Úwriter1   r   r   )r7   r<   r=   r]   Ú
msg_lengthr   Úmask_bitÚ
first_byteÚheaderÚ
header_lenÚmaskÚmessage_arrs   &&&&        r(   rH   Ú&WebSocketWriter._write_websocket_frame{   sI  € ô ˜“\ˆ
à—=‘=ˆß#‘4¨ˆð ˜C•Z &Õ(ˆ
Ø˜ÔÜ˜z¸Õ+@ÓAˆFØ‰JØ˜%ÔÜ˜z¨3°­>¸:ÓFˆFØ‰Jä˜z¨3°­>¸:ÓFˆFØˆJà�>‰>×$Ñ$×&Ò&Ü,Ð-PÓQÐQ÷ Ü  ×!5Ñ!5Ó!7Ó8ˆDÜ# GÓ,ˆKÜ˜4Ô-Ø�N‰N× Ñ  ¥°Õ!<Ô=Ø×Ò¤Õ)ÖØœ(Ô"Ø�N‰N× Ñ  Ô(Ø�N‰N× Ñ  Õ)à�N‰N× Ñ  Õ!1Ô2à×Ò˜ZÕ4Õ4×r+   c                ó4   <€ V ^8„  d   QhRS[ R,          RS[/# )r   r   Nr    )r$   r	   )r&   r'   s   "€r(   r)   r*   ­   s   ø€ ÷ !ñ !©¨d­
ð !±~ñ !r+   c                óð   € V'       d"   \        \        P                  V) \        R7      # V P                  '       g1   \        \        P                  V P
                  ) \        R7      V n        V P                  # )zBGet or create a compressor object for the given compression level.)ÚlevelÚwbitsÚmax_sync_chunk_size)r	   r   ÚZ_BEST_SPEEDrJ   r2   r   )r7   r   s   &&r(   Ú_get_compressorÚWebSocketWriter._get_compressor­   sa   € çä!Ü!×.Ñ.Ø�iÜ$Aôð ð
 × × Ð Ü .Ü!×.Ñ.Ø—}‘}�nÜ$Aô!ˆDÔð
 × Ñ Ð r+   c                ó>   <€ V ^8„  d   QhRS[ RS[RS[R,          RR/# r;   r>   )r&   r'   s   "€r(   r)   r*   ¾   s1   ø€ ÷ 
ñ 
Ùð
Ù&)ð
Ù58¸4µZð
à	ñ
r+   c                ó  € V P                  V4      pT P                  VP                  V4      TP                  V P                  '       d   \
        P                  M\
        P                  4      ,           P                  \        4      V^@4       R# )zÑ
Synchronous send for small compressed frames.

This is used for small compressed payloads that compress synchronously in the event loop.
Since there are no await points, this is inherently cancellation-safe.
N)
rp   rH   Úcompress_syncÚflushr   r   ÚZ_FULL_FLUSHÚZ_SYNC_FLUSHÚremovesuffixr   ©r7   r<   r=   r   Úcompressobjs   &&&& r(   rK   Ú+WebSocketWriter._send_compressed_frame_sync¾   su   € ð ×*Ñ*¨8Ó4ˆð 	×#Ñ#à×)Ñ)¨'Ó2Ø×#Ñ#à——�ô  ×,Ò,ä$×1Ñ1óõ÷ ‰lÔ.Ó/ØØö	
r+   c                ó>   <€ V ^8„  d   QhRS[ RS[RS[R,          RR/# r;   r>   )r&   r'   s   "€r(   r)   r*   Ú   s1   ø€ ÷  ñ  Ùð Ù&)ð Ù58¸4µZð à	ñ r+   c              ƒ  óÖ  "  € V P                   ;_uu_4       GRj  x€L
  V P                  V4      pT P                  VP                  V4      G Rj  x€L
 TP	                  V P
                  '       d   \        P                  M\        P                  4      ,           P                  \        4      V^@4       RRR4      GRj  x€L
  R#  Lª Lw L
  + GRj  x€L 
 '       g   i     R# ; i5i)a§  
Async send for large compressed frames with lock.

Acquires the lock and compresses large payloads asynchronously in
the executor. The lock is held for the entire operation to ensure
the compressor state is not corrupted by concurrent sends.

MUST be run shielded from cancellation. If cancelled after
compression but before sending, the compressor state would be
advanced but data not sent, corrupting subsequent frames.
N)r4   rp   rH   r   ru   r   r   rv   rw   rx   r   ry   s   &&&& r(   rM   Ú3WebSocketWriter._send_compressed_frame_async_lockedÚ   s¡   é € ð —?—?—?“?ð ×.Ñ.¨xÓ8ˆKð ×'Ñ'à%×.Ñ.¨wÓ7×7Ø!×'Ñ'àŸ?Ÿ?˜?ô $×0Ò0ä(×5Ñ5óõ÷ ‘,Ô2Ó3ØØô÷ #—?“?ñ 8÷ #—?—?“?üsc   ‚C)›CœC)Ÿ1CÁCÁCÁ1ACÂ4C)Â?C
Ã C)ÃCÃ
C)ÃC&	ÃCÃ
C&	ÃC&	Ã 	C)c                ó:   <€ V ^8„  d   QhRS[ RS[S[,          RR/# )r   Úcoder<   r    N)r$   r?   Ústr)r&   r'   s   "€r(   r)   r*   ü   s&   ø€ ÷ 	!ñ 	!¡ð 	!±U¹Sµ[ð 	!È4ñ 	!r+   c              ƒ  óú   "  € \        V\        4      '       d   VP                  R4      p V P                  \	        V4      V,           \
        P                  R7      G Rj  x€L
  RV n        R#  L  RT n        i ; i5i)z<Close the websocket, sending the specified code and message.zutf-8)r=   NT)Ú
isinstancer�   ÚencoderZ   r   r   rF   r/   )r7   r€   r<   s   &&&r(   ÚcloseÚWebSocketWriter.closeü   sk   é € ä�gœs×#Ò#Ø—n‘n WÓ-ˆGð	!Ø—/‘/Ü Ó%¨Õ/¼	¿¹ð "ó ÷ ð ð !ˆDŽMñ	øð !ˆD�Müs.   ‚(A;«4A/ ÁA-Á A/ Á$	A;Á-A/ Á/	A8Á8A;)r6   r/   r2   r0   r1   r4   r   r.   r   r   r   r   )N)iè  r+   )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r
   r   r%   r8   rZ   rH   rp   rK   rM   r…   Ú__static_attributes__Ú__classdictcell__)r'   s   @r(   r   r   '   s—   ø‡ € ñð@ð
 ð@ð (ð@ð !'§¢£ð@ð ð@ð !÷@ò @÷204ò 04÷d05ð 05÷d!ð !÷"
ð 
÷8 ð  ÷D	!÷ 	!ð 	!r+   r   c                óV   € V ^8„  d   Qh/ ^ \         9   d   \        \        ,          ;R&   # )r   rG   )Ú__conditional_annotations__r   r$   )r&   s   "r(   r)   r)      s   € × +Ñ +÷4 (Ò 'œœs�Ñ 'ò5 ,r+   i @  )#r�   r‹   r!   r   rN   Ú	functoolsr   Útypingr   r   r   Úbase_protocolr   Úclient_exceptionsr   Úcompression_utilsr   r	   Úhelpersr
   r   r   r   r   r   r   r   r   Úmodelsr   r   rG   rJ   r   r)   )r�   s   @r(   Ú<module>r—      sZ   øðÞ +ã Û Û 
Ý ß 'Ñ 'å (Ý :ß ;Ý (÷	÷ 	ó 	÷ 3ð '(Ð Ó 'ð !*Ð ÷^!ó ^!r+   