
    soj              
          d dl mZ d dlmZ d dlmZ d dlmZ d dl	m
Z
 d dlmZ d dlmZ d dlmZ d dlmZ d d	lmZ d d
lmZ d dlmZ d dlmZmZ d dlmZ d dlmZm Z m!Z!  G d de          Z"dedej#        dededdf
dZ$dS )    )StrEnum)Update)ContextTypesN)User)get_by_bounty)ReservedKeyboardKeys)Screen)CrewRole)ChatWarning)Keyboard)remove_memberget_crew)!get_remaining_time_from_next_cron)full_message_sendget_yes_no_keyboardescape_valid_markdown_charsc                       e Zd ZdZdZdS )CrewLeaveReservedKeysz5
    The reserved keys for the Crew leave screen
    aN)__name__
__module____qualname____doc__CREW_ID     2/app/src/chat/private/screens/screen_crew_leave.pyr   r      s          GGGr   r   updatecontextinbound_keyboarduserreturnc                   K   t          |           |                                t          j        u r>t	          t
          j                            |                                                    t          j
        |j        vrt
          j                            t          t          j                                                            }t#          |                                          }t#          |j                  }|j        |j        k     rG|t
          j                            t/          |j                  t/          |j                            z  }t3          |t4          j        |d          g}t9          ||| ||           d{V  dS t;          ||dd           d{V  t
          j        }t9          ||| |           d{V  dS )z
    Manage the Crew leave screen
    :param update: The update object
    :param context: The context object
    :param user: The user object
    :param inbound_keyboard: The keyboard object
    :return: None
    )r!   T)screenr    no_is_back_button)r   keyboardr    N)r   send_notification_to_captaindisable_user_can_join_crew)r   r    )r   get_crew_roler
   	CONSCRIPTr   phrasesCREW_REMOVE_MEMBER_CONSCRIPTformatget_conscription_remaining_timer   CONFIRMinfoCREW_LEAVE_CONFIRMATIONr   EnvCRON_SEND_LEADERBOARDgetr   get_max_bountybountylevellocation_level*CREW_LEAVE_CONFIRMATION_LOCATION_DOWNGRADEr   namer   r	   PVT_CREW_LEAVEr   r   CREW_LEAVE_SUCCESS)r   r   r    r!   ot_textcurrent_locationnew_locationinline_keyboards           r   managerA       s      $ x1110778\8\8^8^__
 
 	
 #+;+@@@188-c.G.K.K.M.MNN
 

 ))<)<)>)>??$T[11 333wIPP+L,=>>+,<,ABB  G  ,!1"&	  1
  $-
 
 
 	
 	
 	
 	
 	
 	
 	
 	 gD]a         
 (G
GWVN^
_
_
__________r   )%enumr   src.tg_compatr   src.tg_compat.extr   resources.EnvironmentEnvironmentr2   resources.phrasesr+   src.model.Userr   src.model.enums.Locationr   $src.model.enums.ReservedKeyboardKeysr   src.model.enums.Screenr	   src.model.enums.crew.CrewRoler
   src.model.error.ChatWarningr   src.model.pojo.Keyboardr   src.service.crew_servicer   r   src.service.date_servicer   src.service.message_servicer   r   r   r   DEFAULT_TYPErA   r   r   r   <module>rS      s                     * * * * * * # # # # # # # # # # # #       2 2 2 2 2 2 E E E E E E ) ) ) ) ) ) 2 2 2 2 2 2 3 3 3 3 3 3 , , , , , , < < < < < < < < F F F F F F             G   <`<`)6<`JR<`Z^<`	<` <` <` <` <` <`r   