+
    ~js              	         ^ RI Ht ^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIH	t	H
t
HtHtHtHtHtHtHt ^ RIHtHt ^RIHtHt ^RIHt ^RIHt ^RIHt ^R	IHt  ^R
I!H"t" ^RI#H$t$ ^RI%H&t& ^RI'H(t(H)t)H*t* ^RI+H,t, ^RI-H.t. ^RI/H0t0 ^RI1H2t2 ^RI-H3t3 ^RI4H5t5H6t6H7t7H8t8 ^RI9H:t: ^RIH;t<  ! R R]=4      t> ! R R]=4      t? ! R R]=4      t@ ! R R]=4      tA ! R R]=4      tB ! R  R!]=4      tC ! R" R#]4      tD]R$.]
]]]E,          ,          ]]E,          3,          3,          tF]! R%]]3.]
]]]E,          ,          ]]E,          3,          3,          R&7      tG ! R' R(]D4      tH ! R) R*]D4      tIR# )+    )annotationsN)	ListUnionCallableDict	AwaitableOptionalMappingcastTypeVar)abstractmethodABC)	FfiClient	FfiHandle)ffi_pb2)participant_pb2)TrackPublishOptions)TranscriptionSegment)ParticipantTrackPermission)BroadcastQueue)
LocalTrack)LocalTrackPublicationRemoteTrackPublicationTrackPublication)Transcription)RpcError)"RpcMethodInvocationResponseRequest)logger)RpcInvocationData)TextStreamWriterByteStreamWriterByteStreamInfoSTREAM_CHUNK_SIZE)LocalDataTrack)data_track_pb2c                  "    ] tR t^=tR R ltRtR# )PublishTrackErrorc                    V ^8  d   QhRRRR/#    messagestrreturnNone )formats   "l/Users/mitch_tango/dev/rabbit-r1-livekit/agent/.venv/lib/python3.14/site-packages/livekit/rtc/participant.py__annotate__PublishTrackError.__annotate__>               c                	    Wn         R # Nr+   selfr+   s   &&r1   __init__PublishTrackError.__init__>       r5   r8   N__name__
__module____qualname____firstlineno__r;   __static_attributes__r/   r5   r1   r'   r'   =        r5   r'   c                  "    ] tR t^BtR R ltRtR# )UnpublishTrackErrorc                    V ^8  d   QhRRRR/# r)   r/   )r0   s   "r1   r2    UnpublishTrackError.__annotate__C   r4   r5   c                	    Wn         R # r7   r8   r9   s   &&r1   r;   UnpublishTrackError.__init__C   r=   r5   r8   Nr>   r/   r5   r1   rF   rF   B   rD   r5   rF   c                  "    ] tR t^GtR R ltRtR# )PublishDataErrorc                    V ^8  d   QhRRRR/# r)   r/   )r0   s   "r1   r2   PublishDataError.__annotate__H   r4   r5   c                	    Wn         R # r7   r8   r9   s   &&r1   r;   PublishDataError.__init__H   r=   r5   r8   Nr>   r/   r5   r1   rL   rL   G   rD   r5   rL   c                  "    ] tR t^LtR R ltRtR# )PublishDTMFErrorc                    V ^8  d   QhRRRR/# r)   r/   )r0   s   "r1   r2   PublishDTMFError.__annotate__M   r4   r5   c                	    Wn         R # r7   r8   r9   s   &&r1   r;   PublishDTMFError.__init__M   r=   r5   r8   Nr>   r/   r5   r1   rR   rR   L   rD   r5   rR   c                  "    ] tR t^QtR R ltRtR# )PublishTranscriptionErrorc                    V ^8  d   QhRRRR/# r)   r/   )r0   s   "r1   r2   &PublishTranscriptionError.__annotate__R   r4   r5   c                	    Wn         R # r7   r8   r9   s   &&r1   r;   "PublishTranscriptionError.__init__R   r=   r5   r8   Nr>   r/   r5   r1   rX   rX   Q   rD   r5   rX   c                  "    ] tR t^VtR R ltRtR# )PublishDataTrackErrorc                    V ^8  d   QhRRRR/# r)   r/   )r0   s   "r1   r2   "PublishDataTrackError.__annotate__W   r4   r5   c                	    Wn         R # r7   r8   r9   s   &&r1   r;   PublishDataTrackError.__init__W   r=   r5   r8   Nr>   r/   r5   r1   r^   r^   V   rD   r5   r^   c                  4   ] tR t^[tR R lt]]R R l4       4       t]R R l4       t]R R l4       t	]R	 R
 l4       t
]R R l4       t]R R l4       t]R R l4       t]R R l4       t]R R l4       t]R R l4       t]R R l4       t]R R l4       tRtR# )Participantc                    V ^8  d   QhRRRR/# r*   
owned_info"proto_participant.OwnedParticipantr-   r.   r/   )r0   s   "r1   r2   Participant.__annotate__\   s     ; ;#E ;$ ;r5   c                	p    VP                   V n        \        VP                  P                  4      V n        R # r7   )info_infor   handleid_ffi_handle)r:   rg   s   &&r1   r;   Participant.__init__\   s&    __
$Z%6%6%9%9:r5   c                   V ^8  d   QhRR/# )r*   r-   zMapping[str, TrackPublication]r/   )r0   s   "r1   r2   ri   b   s      $B r5   c                    R# )E
A dictionary of track publications associated with the participant.
Nr/   r:   s   &r1   track_publicationsParticipant.track_publications`   s     	r5   c                   V ^8  d   QhRR/# r*   r-   r,   r/   )r0   s   "r1   r2   ri   i   s      S r5   c                	.    V P                   P                  # r7   )rl   sidrt   s   &r1   rz   Participant.sidh   s    zz~~r5   c                   V ^8  d   QhRR/# rx   r/   )r0   s   "r1   r2   ri   m   s      c r5   c                	.    V P                   P                  # r7   )rl   namert   s   &r1   r~   Participant.namel   s    zzr5   c                   V ^8  d   QhRR/# rx   r/   )r0   s   "r1   r2   ri   q        # ## #r5   c                	.    V P                   P                  # r7   )rl   identityrt   s   &r1   r   Participant.identityp       zz"""r5   c                   V ^8  d   QhRR/# rx   r/   )r0   s   "r1   r2   ri   u   r   r5   c                	.    V P                   P                  # r7   )rl   metadatart   s   &r1   r   Participant.metadatat   r   r5   c                   V ^8  d   QhRR/# )r*   r-   dict[str, str]r/   )r0   s   "r1   r2   ri   y   s     + +N +r5   c                @    \        V P                  P                  4      # )z2Custom attributes associated with the participant.)dictrl   
attributesrt   s   &r1   r   Participant.attributesx   s     DJJ))**r5   c                   V ^8  d   QhRR/# )r*   r-   z+proto_participant.ParticipantKind.ValueTyper/   )r0   s   "r1   r2   ri   ~   s      A r5   c                .    V P                   P                  # )zLParticipant's kind (e.g., regular participant, ingress, egress, sip, agent).)rl   kindrt   s   &r1   r   Participant.kind}   s     zzr5   c                   V ^8  d   QhRR/# )r*   r-   z7list[proto_participant.ParticipantKindDetail.ValueType]r/   )r0   s   "r1   r2   ri      s     - -U -r5   c                @    \        V P                  P                  4      # )zzAdditional details refining the participant's kind (e.g., cloud agent, forwarded, whatsapp/twilio connector, rtsp bridge).)listrl   kind_detailsrt   s   &r1   r   Participant.kind_details   s     DJJ++,,r5   c                   V ^8  d   QhRR/# )r*   r-   z,proto_participant.ParticipantState.ValueTyper/   )r0   s   "r1   r2   ri      s        C  r5   c                .    V P                   P                  # )zGParticipant's connection state (joining, joined, active, disconnected).)rl   statert   s   &r1   r   Participant.state   s     zzr5   c                   V ^8  d   QhRR/# )r*   r-   zdatetime.datetime | Noner/   )r0   s   "r1   r2   ri      s     
 
3 
r5   c                    V P                   P                  ^ 8X  d   R# \        P                  P                  V P                   P                  R,          \        P                  P
                  R7      # )zMTimestamp of when the participant joined the room, or None if not yet joined.N  )tz)rl   	joined_atdatetimefromtimestamptimezoneutcrt   s   &r1   r   Participant.joined_at   sW     ::1$  ..JJ  4'H,=,=,A,A / 
 	
r5   c                   V ^8  d   QhRR/# )r*   r-   z'proto_participant.ParticipantPermissionr/   )r0   s   "r1   r2   ri      s     % %D %r5   c                .    V P                   P                  # )z.The participant's permissions within the room.)rl   
permissionrt   s   &r1   permissionsParticipant.permissions   s     zz$$$r5   c                   V ^8  d   QhRR/# )r*   r-   z6Optional[proto_participant.DisconnectReason.ValueType]r/   )r0   s   "r1   r2   ri      s     , ,	?,r5   c                    V P                   P                  \        P                  P                  8X  d   R# V P                   P                  # )aX  Reason for the participant's disconnection.

Returns one of DisconnectReasons or None if the participant isn't disconnected. Common reasons are:
- CLIENT_INITIATED - the client initiated the disconnect
- DUPLICATE_IDENTITY - another participant with the same identity has joined the room
- SERVER_SHUTDOWN - the server instance is shutting down
- PARTICIPANT_REMOVED - RoomService.RemoveParticipant was called
- ROOM_DELETED - RoomService.DeleteRoom was called
- STATE_MISMATCH - the client is attempting to resume a session, but server is not aware of it
- JOIN_FAILURE - client was unable to connect fully

When dialing a participant via SIP, you may see the following reasons:
- USER_UNAVAILABLE - SIP callee did not respond in time
- USER_REJECTED - SIP callee rejected the call (busy)
- SIP_TRUNK_FAILURE - SIP protocol failure or unexpected response
N)rl   disconnect_reasonproto_participantDisconnectReasonUNKNOWN_REASONrt   s   &r1   r   Participant.disconnect_reason   s6    ( ::''+<+M+M+\+\\zz+++r5   )ro   rl   N)r?   r@   rA   rB   r;   propertyr   ru   rz   r~   r   r   r   r   r   r   r   r   r   rC   r/   r5   r1   rd   rd   [   s    ;        # # # # + +   - -     
 
 % % , ,r5   rd   r   F)boundc                    a  ] tR t^tRtR V 3R llt]R R l4       tRRR. R	R
/R R lltR R lt	R R lt
RR/R R lltR<R R lltR R ltRR/R R lltR R ltR R ltR  R! ltR" R# ltRRR	R
R$RR%RR&RR'RR(R/R) R* lltRRR	R
R$RR&R/R+ R, lltR'RR-R.R$RR%RRRR	R
/R/ R0 lltR	R
RRR$RR%R/R1 R2 lltR3 R4 lt]! 4       3R5 R6 lltR7 R8 ltR9 R: ltR;tV ;t# )=LocalParticipantz+Represents the local participant in a room.c               $    V ^8  d   QhRRRRRR/# )r*   
room_queuez"BroadcastQueue[proto_ffi.FfiEvent]rg   rh   r-   r.   r/   )r0   s   "r1   r2   LocalParticipant.__annotate__   s(     7 767 77 
	7r5   c                	N   < \         SV `  V4       Wn        / V n        / V n        R # r7   )superr;   _room_queue_track_publications_rpc_handlers)r:   r   rg   	__class__s   &&&r1   r;   LocalParticipant.__init__   s(    
 	$%EG 46r5   c                   V ^8  d   QhRR/# )r*   r-   z#Mapping[str, LocalTrackPublication]r/   )r0   s   "r1   r2   r      s     ( ($G (r5   c                    V P                   # rs   r   rt   s   &r1   ru   #LocalParticipant.track_publications       
 '''r5   reliableTdestination_identitiestopic c          
     ,    V ^8  d   QhRRRRRRRRR	R
/# )r*   payloadzUnion[bytes, str]r   boolr   z	List[str]r   r,   r-   r.   r/   )r0   s   "r1   r2   r      s<     ,: ,:",: 	,:
 !*,: ,: 
,:r5   c                 a
"   \        V\        4      '       d   VP                  R4      p\        V4      p\        P
                  V,          ! V!  p\        P                  ! 4       pV P                  P                  VP                  n        \        P                  ! V4      VP                  n        WWP                  n        W'P                  n        WGP                  n        VP                  P"                  P%                  V4       \&        P(                  P*                  P-                  4       p \&        P(                  P/                  V4      o
VP1                  V
3R l4      G Rj  xL
 p	\&        P(                  P*                  P3                  V4       V	P                  P4                  '       d    \7        V	P                  P4                  4      hR#  Lj  \&        P(                  P*                  P3                  T4       i ; i5i)a  
Publish arbitrary data to the room.

Args:
    payload (Union[bytes, str]): The data to publish.
    reliable (bool, optional): Whether to send reliably or not. Defaults to True.
    destination_identities (List[str], optional): List of participant identities to send to. Defaults to [].
    topic (str, optional): The topic under which to publish the data. Defaults to "".

Raises:
    PublishDataError: If there is an error in publishing data.
zutf-8c                ^   < V P                   P                  SP                   P                  8H  # r7   )publish_dataasync_ideresps   &r1   <lambda>/LocalParticipant.publish_data.<locals>.<lambda>   s     !..11T5F5F5O5OOr5   N)
isinstancer,   encodelenctypesc_byte	proto_ffi
FfiRequestro   rm   r   local_participant_handle	addressofdata_ptrdata_lenr   r   r   extendr   instancequeue	subscriberequestwait_forunsubscribeerrorrL   )r:   r   r   r   r   r   cdatareqr   cbr   s   &&$$$     @r1   r   LocalParticipant.publish_data   sr    ( gs##nnW-Gw<)G4""$484D4D4K4K1$*$4$4U$;!$,!$,!!&//667MN""((224	8%%--c2D+0>>O, &B $$007??   "2??#8#899 !& $$007s7   D*H .7G %G&G *AH /!H G +G==H c               $    V ^8  d   QhRRRRRR/# )r*   codeintdigitr,   r-   r.   r/   )r0   s   "r1   r2   r      s!     > ># >c >d >r5   c                 a"   \         P                  ! 4       pV P                  P                  VP                  n        WP                  n        W#P                  n        \        P                  P                  P                  4       p \        P                  P                  V4      oVP                  V3R l4      G Rj  xL
 p\        P                  P                  P                  V4       VP                  P                  '       d    \!        VP                  P                  4      hR#  Lj  \        P                  P                  P                  T4       i ; i5i)z
Publish SIP DTMF message.

Args:
    code (int): DTMF code.
    digit (str): DTMF digit.

Raises:
    PublishDTMFError: If there is an error in publishing SIP DTMF message.
c                ^   < V P                   P                  SP                   P                  8H  # r7   )publish_sip_dtmfr   r   s   &r1   r   /LocalParticipant.publish_dtmf.<locals>.<lambda>  s"    !,,559N9N9W9WWr5   N)r   r   ro   rm   r   r   r   r   r   r   r   r   r   r   r   r   rR   )r:   r   r   r   r   r   r   s   &$$   @r1   publish_dtmfLocalParticipant.publish_dtmf   s      ""$8<8H8H8O8O5$(!%*"""((224	8%%--c2D+0>>W, &B $$007$$$"2#6#6#<#<== %& $$007s7   BE7D+ >D)?D+ AE!E)D+ ++EEc                    V ^8  d   QhRRRR/# )r*   transcriptionr   r-   r.   r/   )r0   s   "r1   r2   r     s     &L &L &L4 &Lr5   c                  a"   \         P                  ! 4       pVP                   Uu. uFP  p\        VP                  VP
                  VP                  VP                  VP                  VP                  R7      NKR  	  ppV P                  P                  VP                  n        VP                  VP                  n        VP                  P                  P                  V4       VP                   VP                  n        \$        P&                  P(                  P+                  4       p \$        P&                  P-                  V4      oVP/                  V3R l4      G Rj  xL
 p\$        P&                  P(                  P1                  V4       VP                  P2                  '       d    \5        VP                  P2                  4      hR# u upi  Lo  \$        P&                  P(                  P1                  T4       i ; i5i)z
Publish transcription data to the room.

Args:
    transcription (Transcription): The transcription data to publish.

Raises:
    PublishTranscriptionError: If there is an error in publishing transcription.
)rn   text
start_timeend_timefinallanguagec                ^   < V P                   P                  SP                   P                  8H  # r7   )publish_transcriptionr   r   s   &r1   r   8LocalParticipant.publish_transcription.<locals>.<lambda>7  s"    !11::d>X>X>a>aar5   N)r   r   segmentsProtoTranscriptionSegmentrn   r   r   r   r   r   ro   rm   r  r   participant_identityr   	track_sidtrack_idr   r   r   r   r   r   r   r   rX   )r:   r   r   sproto_segmentsr   r   r   s   &&     @r1   r  &LocalParticipant.publish_transcription  s     ""$ #++

 , &44VV<<gg , 	 

 >B=M=M=T=T!!:9F9[9[!!6!!**11.A-:-D-D!!*""((224	8%%--c2D+0>>a, &B $$007##)))+B,D,D,J,JKK *5

(& $$007sC   $G?AG
=B*G?(7G G G $AG?)&G?G +G<<G?response_timeoutNc          
     ,    V ^8  d   QhRRRRRRRRRR/# )r*   destination_identityr,   methodr   r  zOptional[float]r-   r/   )r0   s   "r1   r2   r   ?  s>     )& )& ")& 	)&
 )& *)& 
)&r5   c               h  a"   \         P                  ! 4       pV P                  P                  VP                  n        WP                  n        W%P                  n        W5P                  n        Ve"   \        VR,          4      VP                  n
        \        P                  P                  P                  4       p \        P                  P                  V4      oVP!                  V3R l4      G Rj  xL
 p\        P                  P                  P#                  V4       VP                  P%                  R4      '       d+   \&        P(                  ! VP                  P*                  4      hVP                  P                  #  L  \        P                  P                  P#                  T4       i ; i5i)a  
Initiate an RPC call to a remote participant.

Args:
    destination_identity (str): The `identity` of the destination participant
    method (str): The method name to call
    payload (str): The method payload
    response_timeout (Optional[float]): Timeout for receiving a response after initial connection

Returns:
    str: The response payload

Raises:
    RpcError: On failure. Details in `message`.
Nr   c                ^   < V P                   P                  SP                   P                  8H  # r7   )perform_rpcr   r   s   &r1   r   .LocalParticipant.perform_rpc.<locals>.<lambda>a  s     0F0F$JZJZJcJc0cr5   r   )r   r   ro   rm   r  r   r  r  r   r   response_timeout_msr   r   r   r   r   r   r   HasFieldr   _from_protor   )	r:   r  r  r   r  r   r   r   r   s	   &$$$$   @r1   r  LocalParticipant.perform_rpc?  s+    . ""$373C3C3J3J0/C,!'")'256F6M2NCOO/""((224	8%%--c2D~~&cddB$$007>>""7++&&r~~';';<<~~%%% e$$007s8   B8F2<7F 3F4F 8A	F2A F2F +F//F2c               $    V ^8  d   QhRRRRRR/# )r*   method_namer,   handlerzOptional[F]r-   zUnion[F, Callable[[F], F]]r/   )r0   s   "r1   r2   r   j  s(     4 44 4 
$	4r5   c                6   a a R VV 3R llpVe	   V! V4      # V# )a  
Establishes the participant as a receiver for calls of the specified RPC method.
Can be used either as a decorator or a regular method.

The handler will receive one argument of type `RpcInvocationData` and should return a string response which will be forwarded back to the caller.

The handler may be synchronous or asynchronous.

If unable to respond within `response_timeout`, the caller will hang up and receive an error on their side.

You may raise errors of type `RpcError` in the handler, and they will be forwarded to the caller.

Other errors raised in your handler will be caught and forwarded to the caller as "1500 Application Error".

Args:
    method_name (str): The name of the indicated RPC method.
    handler (Optional[Callable]): Handler to be invoked whenever an RPC request for this method is received.  Omit this argument to use the decorator syntax.

Returns:
    None (when used as a decorator it returns the decorator function)

Example:
    # As a decorator:
    @room.local_participant.register_rpc_method("greet")
    async def greet_handler(data: RpcInvocationData) -> str:
        print(f"Received greeting from {data.caller_identity}: {data.payload}")
        return f"Hello, {data.caller_identity}!"

    # As a regular method:
    async def greet_handler(data: RpcInvocationData) -> str:
        print(f"Received greeting from {data.caller_identity}: {data.payload}")
        return f"Hello, {data.caller_identity}!"

    room.local_participant.register_rpc_method('greet', greet_handler)
c                    V ^8  d   QhRRRR/# )r*   handler_funcr   r-   r/   )r0   s   "r1   r2   :LocalParticipant.register_rpc_method.<locals>.__annotate__  s     	  	 1 	  	 r5   c                   < V SP                   S&   \        P                  ! 4       pSP                  P                  VP
                  n        SVP
                  n        \        P                  P                  V4       V # r7   )r   r   r   ro   rm   register_rpc_methodr   r  r   r   r   )r  r   r  r:   s   & r1   register6LocalParticipant.register_rpc_method.<locals>.register  sc    .:D{+&&(C?C?O?O?V?VC##<-8C##*&&s+r5   r/   )r:   r  r  r!  s   ff& r1   r   $LocalParticipant.register_rpc_methodj  s&    R	  	  G$$Or5   c                    V ^8  d   QhRRRR/# )r*   r  r,   r-   r.   r/   )r0   s   "r1   r2   r     s     ( (C (D (r5   c                   V P                   P                  VR4       \        P                  ! 4       pV P                  P
                  VP                  n        WP                  n        \        P                  P                  V4       R# )zs
Unregisters a previously registered RPC method.

Args:
    method (str): The name of the RPC method to unregister
N)r   popr   r   ro   rm   unregister_rpc_methodr   r  r   r   r   )r:   r  r   s   && r1   r'  &LocalParticipant.unregister_rpc_method  sb     	vt,""$=A=M=M=T=T!!:+1!!(""3'r5   participant_permissionsc               $    V ^8  d   QhRRRRRR/# )r*   allow_all_participantsr   r)  z*Optional[List[ParticipantTrackPermission]]r-   r.   r/   )r0   s   "r1   r2   r     s+     ( ( !%( "L	(
 
(r5   c               .   Vf   . p\         P                  ! 4       pV P                  P                  VP                  n        WP                  n        VP                  P                  P                  V4       \        P                  P                  V4       R# )a\  
Set the track subscription permissions for the local participant.

Args:
    allow_all_participants (bool): Whether to allow all participants to subscribe to this participant's tracks.
    participant_permissions (List[ParticipantTrackPermission]): Participant-specific track subscription permissions, ignored if `allow_all_participants` is True.
N)r   r   ro   rm   "set_track_subscription_permissionsr   all_participants_allowedr   r   r   r   r   )r:   r+  r)  r   s   &$$ r1   r-  3LocalParticipant.set_track_subscription_permissions  ss     #*&(#""$JNJZJZJaJa..GJ`..G..::AABYZ""3'r5   c               4    V ^8  d   QhRRRRRRRRRRRR	R
R/# )r*   invocation_idr   r  r,   
request_idcaller_identityr   r  floatr-   r.   r/   )r0   s   "r1   r2   r     sY     5Q 5Q5Q 5Q 	5Q
 5Q 5Q  5Q 
5Qr5   c           	     	  "   R pR p\        W4WV4      p	V P                  P                  V4      p
V
'       g0   \        P                  ! \        P
                  P                  4      pMg \        P                  ! V
4      '       d)    \        P                  ! V
! V	4      VR7      G R j  xL
 pM"\        \        \         ,          V
! V	4      4      p \*        P,                  ! \/        V P0                  P2                  TV'       d   VP5                  4       MR VR7      R7      p\6        P8                  P;                  V4      pVP<                  P>                  '       d2   VP<                  P>                  p\$        P>                  ! RV 24       R # R #  L  \        P                   d0    \        P                  ! \        P
                  P                  4      h\        P                   d0    \        P                  ! \        P
                  P                  4      hi ; i  \         d   pTp R p?EL\R p?i\"         dM    \$        P&                  ! RT R24       \        P                  ! \        P
                  P(                  4      p ELi ; i5i)N)timeoutz+Uncaught error returned by RPC handler for z'. Returning APPLICATION_ERROR instead. )r   r1  r   r   )rpc_method_invocation_responsez.error sending rpc method invocation response: ) r   r   getr   	_built_in	ErrorCodeUNSUPPORTED_METHODasyncioiscoroutinefunctionr   TimeoutErrorRESPONSE_TIMEOUTCancelledErrorRECIPIENT_DISCONNECTEDr   r	   r,   	Exceptionr   	exceptionAPPLICATION_ERRORr   r   r   ro   rm   	_to_protor   r   r   r7  r   )r:   r1  r  r2  r3  r   r  response_errorresponse_payloadparamsr  r   r   reserrs   &&&&&&&        r1   _handle_rpc_method_invocation.LocalParticipant._handle_rpc_method_invocation  s     .2*.":Z$$((0%//0B0B0U0UVNZ..w77\181A1A#FO5E2 ,( (,HSM76?'K$ ""+M)-)9)9)@)@+4Bn..0(	,
   ((---33344::CLLI#OP 4;, #// V&001C1C1T1TUU"11 \&001C1C1Z1Z[[\  '!& Z  A& J< < "*!3!3H4F4F4X4X!YZs   A#J&H !F $F
%F )J*!H BJ3J
F AH"0HH J H("J(J5A	J>JJJc                    V ^8  d   QhRRRR/# )r*   r   r,   r-   r.   r/   )r0   s   "r1   r2   r     s     8 83 84 8r5   c                   a"   \         P                  ! 4       pV P                  P                  VP                  n        WP                  n        \        P                  P                  P                  4       p \        P                  P                  V4      oVP                  V3R l4      G Rj  xL
  \        P                  P                  P                  V4       R#  L/  \        P                  P                  P                  T4       i ; i5i)z
Set the metadata for the local participant.

Note: this requires `canUpdateOwnMetadata` permission.

Args:
    metadata (str): The new metadata.
c                ^   < V P                   P                  SP                   P                  8H  # r7   )set_local_metadatar   r   s   &r1   r   /LocalParticipant.set_metadata.<locals>.<lambda>  "    !..774;R;R;[;[[r5   N)r   r   ro   rm   rP  r   r   r   r   r   r   r   r   r   )r:   r   r   r   r   s   &&  @r1   set_metadataLocalParticipant.set_metadata  s      ""$:>:J:J:Q:Q7*2'""((224	8%%--c2D..[   $$007	 $$0070   A3D77C  .C/C  3+DC   +DDc                    V ^8  d   QhRRRR/# )r*   r~   r,   r-   r.   r/   )r0   s   "r1   r2   r     s     8 83 84 8r5   c                   a"   \         P                  ! 4       pV P                  P                  VP                  n        WP                  n        \        P                  P                  P                  4       p \        P                  P                  V4      oVP                  V3R l4      G Rj  xL
  \        P                  P                  P                  V4       R#  L/  \        P                  P                  P                  T4       i ; i5i)z
Set the name for the local participant.

Note: this requires `canUpdateOwnMetadata` permission.

Args:
    name (str): The new name.
c                ^   < V P                   P                  SP                   P                  8H  # r7   )set_local_namer   r   s   &r1   r   +LocalParticipant.set_name.<locals>.<lambda>#  s"    !**33t7J7J7S7SSr5   N)r   r   ro   rm   rY  r   r~   r   r   r   r   r   r   r   )r:   r~   r   r   r   s   &&  @r1   set_nameLocalParticipant.set_name  s      ""$6:6F6F6M6M3"&""((224	8%%--c2D..S   $$007	 $$007rU  c                    V ^8  d   QhRRRR/# )r*   r   r   r-   r.   r/   )r0   s   "r1   r2   r   (  s     8 8~ 8$ 8r5   c                0  a"   \         P                  ! 4       pV P                  P                  VP                  n        VP                  P                   Uu/ uF  q3P                  VP                  bK  	  ppVP                  V4       VP                  4        F5  w  rVVP                  P                  P                  4       pWSn        Wcn        K7  	  \        P                  P                  P                  4       p \        P                  P!                  V4      oVP#                  V3R l4      G Rj  xL
  \        P                  P                  P%                  V4       R# u upi  L4  \        P                  P                  P%                  T4       i ; i5i)z
Set custom attributes for the local participant.

Note: this requires `canUpdateOwnMetadata` permission.

Args:
    attributes (dict[str, str]): A dictionary of attributes to set.
c                ^   < V P                   P                  SP                   P                  8H  # r7   )set_local_attributesr   r   s   &r1   r   1LocalParticipant.set_attributes.<locals>.<lambda>A  s"    !0099T=V=V=_=__r5   N)r   r   ro   rm   r`  r   r   keyvalueupdateitemsaddr   r   r   r   r   r   r   )	r:   r   r   entryexisting_attributesrb  rc  r   r   s	   &&      @r1   set_attributesLocalParticipant.set_attributes(  s@     ""$<@<L<L<S<S  9030H0H0S0S
0SuIIu{{"0S 	 
 	"":.-335JC,,77;;=EIK 6
 ""((224	8%%--c2D.._   $$007#
 $$007s=   AFE!5BF:7E( 1E&2E( 60F&E( (+FFr   	stream_idreply_to_id
total_sizesender_identityc               8    V ^8  d   QhRRRRRRRRR	RR
RRRRR/# )r*   r   Optional[List[str]]r   r,   r   Optional[Dict[str, str]]rk  
str | Nonerl  rm  
int | Nonern  r-   r    r/   )r0   s   "r1   r2   r   F  s\       !4 	
 -     $ 
r5   c               h   "   \        V VVVVVVVR7      pVP                  4       G Rj  xL
  V#  L5i)z
Returns a TextStreamWriter that allows to write individual chunks of text to a text stream.
In most cases where you want to simply send a text message use send_text() instead.
)r   r   rl  r   rm  rk  rn  N)r    _send_header)	r:   r   r   r   rk  rl  rm  rn  writers	   &$$$$$$$ r1   stream_textLocalParticipant.stream_textF  sG      "!##9!+	
 !!### 	$   '202c          
     ,    V ^8  d   QhRRRRRRRRRR	/# )
r*   r   r,   r   rp  r   r   rq  rl  rr  r/   )r0   s   "r1   r2   r   d  s<       !4	
  -  r5   c               	   "   \        VP                  4       4      pV P                  VVVVVR 7      G Rj  xL
 pVP                  V4      G Rj  xL
  VP	                  4       G Rj  xL
  VP
                  #  LA L* L5i))r   r   r   rl  rm  N)r   r   rw  writeacloserk   )r:   r   r   r   r   rl  rm  rv  s   &&$$$$  r1   	send_textLocalParticipant.send_textd  sz      '
''#9!#! ( 
 
 ll4   mmo{{
 	!s3   3A=A7A=A9A=&A;'A=9A=;A=	mime_typeapplication/octet-streamc               8    V ^8  d   QhRRRRRRRRRR	R
RRRRR/# )r*   r~   r,   rm  rs  r  r   rq  rk  rr  r   rp  r   r-   r!   r/   )r0   s   "r1   r2   r   {  sZ       	
  -  !4  
r5   c               h   "   \        V VVVVVVVR7      pVP                  4       G Rj  xL
  V#  L5i)z
Returns a ByteStreamWriter that allows to write individual chunks of bytes to a byte stream.
In cases where you want to simply send a file from the file system use send_file() instead.
)r~   r   rm  rk  r  r   r   N)r!   ru  )	r:   r~   rm  r  r   rk  r   r   rv  s	   &&$$$$$$ r1   stream_bytesLocalParticipant.stream_bytes{  sG      "!!#9	
 !!### 	$ry  c               0    V ^8  d   QhRRRRRRRRRR	R
R/# )r*   	file_pathr,   r   r   rp  r   rq  rk  rr  r-   r"   r/   )r0   s   "r1   r2   r     sF       	
 !4 -  
r5   c          
     	  "   \         P                  P                  V4      p\         P                  P                  V4      p\        P
                  ! V4      w  rVf   RpV P                  VVVVVVVR7      G R j  xL
 p
\        P                  ! VR4      ;_uu_4       GR j  xL
 pVP                  \        4      G R j  xL
 ;p'       d   V
P                  V4      G R j  xL
  K@  R R R 4      GR j  xL
  V
P                  4       G R j  xL
  V
P                  #  L Lz L_ L@ L0  + GR j  xL 
 '       g   i     LG; i L65i)Nr  )r~   rm  r  r   rk  r   r   rb)ospathgetsizebasename	mimetypes
guess_typer  aiofilesopenreadr#   r|  r}  rk   )r:   r  r   r   r   rk  	file_size	file_namer  _rv  fbytess   &&$$$$       r1   	send_fileLocalParticipant.send_file  s     GGOOI.	GG$$Y/	 ++I6	2I)-):): !#9 *; *
 $
 ==D111Q!"(9!:::%:ll5))) 21 mmo{{$
 2:) 2111 	s   A8E:D;'E"D#E&D%?D D%D% D!!D%'E2D#3E
EEED%!D%#E%D>	+D.,
D>	7D>	9	Ec                    V ^8  d   QhRRRR/# )r*   r~   r,   r-   r$   r/   )r0   s   "r1   r2   r     s      $; $; $; 
	$;r5   c               F  a"   \         P                  ! VR7      p\        P                  ! 4       pV P                  P
                  VP                  n        VP                  P                  P                  V4       \        P                  P                  P                  4       p \        P                  P                  V4      oVP                  V3R l4      G Rj  xL
 p\        P                  P                  P!                  V4       VP                  P#                  R4      '       d*   \%        VP                  P&                  P(                  4      h\+        VP                  P,                  4      #  L  \        P                  P                  P!                  T4       i ; i5i)al  Publishes a data track.

Args:
    name: The track name used to identify the track to other participants.
        Must not be empty and must be unique per publisher.

Returns:
    The published data track. Use :meth:`LocalDataTrack.try_push` to
    send data frames on the track.

Raises:
    PublishDataTrackError: If there is an error publishing the data track.
)r~   c                ^   < V P                   P                  SP                   P                  8H  # r7   )publish_data_trackr   r   s   &r1   r   5LocalParticipant.publish_data_track.<locals>.<lambda>  rR  r5   Nr   )proto_data_trackDataTrackOptionsr   r   ro   rm   r  r   optionsCopyFromr   r   r   r   r   r   r   r  r^   r   r+   r$   track)r:   r~   
proto_optsr   r   r   r   s   &$    @r1   r  #LocalParticipant.publish_data_track  s.    $ &66DA
""$:>:J:J:Q:Q7&&//
;""((224	8%%--c2D+0>>[, &B $$007  ))'22'(=(=(C(C(K(KLLb3399::& $$007s8   BF!#7E3 E1E3 A	F!)AF!1E3 3+FF!c               $    V ^8  d   QhRRRRRR/# )r*   r  r   r  r   r-   r   r/   )r0   s   "r1   r2   r     s$     '0 '0'0*='0	'0r5   c                  a"   \         P                  ! 4       pVP                  P                  VP                  n        V P                  P                  VP                  n        VP                  P                  P                  V4       V P                  P                  4       p \        P                  P                  V4      oVP                  V3R l4      G Rj  xL
 pVP                  P                  '       d    \!        VP                  P                  4      h\#        VP                  P$                  4      pWn        VP(                  VP*                  n        W`P,                  VP(                  &   VP/                  4        VV P                  P1                  V4       #  L  T P                  P1                  T4       i ; i5i)aC  
Publish a local track to the room.

Args:
    track (LocalTrack): The track to publish.
    options (TrackPublishOptions, optional): Options for publishing the track.

Returns:
    LocalTrackPublication: The publication of the published track.

Raises:
    PublishTrackError: If there is an error in publishing the track.
c                ^   < V P                   P                  SP                   P                  8H  # r7   )publish_trackr   r   s   &r1   r   0LocalParticipant.publish_track.<locals>.<lambda>  s     !//22d6H6H6Q6QQr5   N)r   r   ro   rm   r  track_handler   r  r  r   r   r   r   r   r   r   r'   r   publication_trackrz   rl   r   	task_doner   )r:   r  r  r   r   r   track_publicationr   s   &&&    @r1   r  LocalParticipant.publish_track  sT      ""$).):):)A)A&595E5E5L5L2!!**73  **,	0%%--c2D+0>>Q, &B %%%'(8(8(>(>?? 5b6F6F6R6R S',$/33EKKO>O$$%6%:%:;OO$((/& ((/s7   BG#7F! FF! ;BF! GF! !F>>Gc                    V ^8  d   QhRRRR/# )r*   r  r,   r-   r.   r/   )r0   s   "r1   r2   r     s     0 0s 0t 0r5   c                  a"   \         P                  ! 4       pV P                  P                  VP                  n        WP                  n        RVP                  n        V P                  P                  4       p \        P                  P                  V4      oVP                  V3R l4      G Rj  xL
 pVP                  P                  '       d    \        VP                  P                  4      hV P                   P#                  V4      pRVn        VP'                  4        V P                  P)                  V4       R#  L  T P                  P)                  T4       i ; i5i)z
Unpublish a track from the room.

Args:
    track_sid (str): The SID of the track to unpublish.

Raises:
    UnpublishTrackError: If there is an error in unpublishing the track.
Tc                ^   < V P                   P                  SP                   P                  8H  # r7   )unpublish_trackr   r   s   &r1   r   2LocalParticipant.unpublish_track.<locals>.<lambda>  s"    !++448L8L8U8UUr5   N)r   r   ro   rm   r  r   r  stop_on_unpublishr   r   r   r   r   r   r   rF   r   r&  r  r  r   )r:   r  r   r   r   r  r   s   &&    @r1   r   LocalParticipant.unpublish_track  s     ""$7;7G7G7N7N4(1%04-  **,	0%%--c2D+0>>U, &B !!''')"*<*<*B*BCC2266yAK!%KOO((/& ((/s7   A6E":7E 1E 2E AE #E" E EE"c                   V ^8  d   QhRR/# rx   r/   )r0   s   "r1   r2   r   '  s     c c# cr5   c                	V    R V P                    RV P                   RV P                   R2# )zrtc.LocalParticipant(sid=, identity=, name=)rz   r   r~   rt   s   &r1   __repr__LocalParticipant.__repr__'  s.    *488*KgVZV_V_U``abbr5   )r   r   r   r7   )r?   r@   rA   rB   __doc__r;   r   ru   r   r   r  r  r   r'  r-  rK  rS  r[  ri  rw  r~  r  r  r  r   r  r  r  rC   __classcell__r   s   @r1   r   r      s   57 7 ( (,: 	,:
 -/,: ,:\>8&LP)& -1)&V4l(( OS	(,5Qn8,8,8< 7; 	
 04 !% #' "& '+< 7;	
  04 #'. "&	
 4 04 !% 7; < 	
 7; 04 !%@$;N AT@U'0R0>c cr5   r   c                  P   a  ] tR tRtR V 3R llt]R R l4       tR R ltRtV ;t	# )	RemoteParticipanti+  c                    V ^8  d   QhRRRR/# rf   r/   )r0   s   "r1   r2   RemoteParticipant.__annotate__,  s     I I#E I$ Ir5   c                	4   < \         SV `  V4       / V n        R # r7   )r   r;   r   )r:   rg   r   s   &&r1   r;   RemoteParticipant.__init__,  s    $FH r5   c                   V ^8  d   QhRR/# )r*   r-   z$Mapping[str, RemoteTrackPublication]r/   )r0   s   "r1   r2   r  1  s     ( ($H (r5   c                    V P                   # r   r   rt   s   &r1   ru   $RemoteParticipant.track_publications0  r   r5   c                   V ^8  d   QhRR/# rx   r/   )r0   s   "r1   r2   r  7  s     d d# dr5   c                	V    R V P                    RV P                   RV P                   R2# )zrtc.RemoteParticipant(sid=r  r  r  r  rt   s   &r1   r  RemoteParticipant.__repr__7  s.    +DHH:[wW[W`W`Vaabccr5   r   )
r?   r@   rA   rB   r;   r   ru   r  rC   r  r  s   @r1   r  r  +  s/    I I ( (d dr5   r  )J
__future__r   r   r<  r   r  r  r  typingr   r   r   r   r   r	   r
   r   r   abcr   r   _ffi_clientr   r   _protor   r   r   r   _proto.room_pb2r   r   r  _proto.track_pb2r   _utilsr   r  r   r  r   r   r   r   r   rpcr   _proto.rpc_pb2r   logr   r   data_streamr    r!   r"   r#   
data_trackr$   r%   r  rB  r'   rF   rL   rR   rX   r^   rd   r,   
RpcHandlerr   r   r  r/   r5   r1   <module>r     sM   #    	   [ [ [ # - ( 8 #  
 )  >  "  ' 6	 
) 
y 
y 
	 
I 
U,# U,p *+U9Xc]3KXVY]3Z-[[\
x*+U9Xc]3KXVY]3Z-[[\
o	c{ o	cdd dr5   