/**
 * Constant定義ファイル
 */
const readyState = {
  UNINITIALIZED: 0,
  LOADING: 1,
  LOADED: 2,
  INTERACTIVE: 3,
  COMPLETED: 4,
};

const MessageType = {
  TEXT: 0,
  IMAGE: 1,
  VIDEO: 2,
  SYSTEM: 3,
  COMMUNICATIONSTART: 4,
  COMMUNICATIONEND: 5,
};

const ChatRoomType = {
  DM: "1",
  GROUP: "0",
  ALL: "2",
};

const COLLABORATION_TYPE = {
  AUDIO: "audio",
  CAMERA: "camera",
  VIDEO: "video",
  DOCUMENT: "document",
  BOARD: "board",
};

const COLLABORATION_TYPE_NUMBER = {
  AUDIO: 0,
  CAMERA: 2,
  VIDEO: 3,
  DOCUMENT: 4,
  BOARD: 5,
};

const MakeRoomFlag = {
  NAME_CARD: 0,
  MAKE_ROOM: 1,
};

const ANDROID_SDK_VERSION = {
  O: 26,
};

const HostRequestFlag = {
  DONE: 0,
  DOING: 1,
};

const PagingSize = {
  MESSAGE: 100,
};

const InvitedFlag = {
  NONE: 0,
  INVITED: 1,
};

const COLLABORATION_JOIN_TYPE = {
  HOST: "0",
  ATTENDEE: "1",
  INVITED: "2",
};

const ARCHIVE_TYPE = {
  PICTURE: 0,
  VIDEO: 1,
  VOICE: 2,
  DOCUMENT: 3,
};

const messageSeperator = "<::split>";
const DATA_MESSAGE_SCHEME = "::NOT_MESSAGE";
const FINISH_ALL_COLLABORATION_SIGNAL = "::ALL_COLLABORATION_END";

const TemplateURL = {
  GROUP_PATH: "./template/template_group_path.html",
  GROUP_LIST: "./template/template_group_list.html",
  ARCHIVE_LIST: "./template/template_archive_list.html",
  MAKE_ROOM_GROUP_LIST: "./template/template_make_room_group_list.html",
  GROUP_USER_LIST: "./template/template_group_user_list.html",
  ROOM_LIST: "./template/template_room_list.html",
  SYSTEM_MESSAGE: "./template/template_system_message.html",
  USER_LIST: "./template/template_user_list.html",
  USER_NAME_CARD: "./template/template_user_name_card.html",
  USER_MESSAGE: "./template/template_user_message.html",
  ARCHIVE: "./template/template_archive.html",
  ARCHIVE_DETAIL: "./template/template_archive_detail.html",
  ARCHIVE_USER: "./template/template_archive_user.html",
  MY_NAME_CARD: "./template/template_my_name_card.html",
  MY_MESSAGE: "./template/template_my_message.html",
  OPEN_COLLABORATION_MESSAGE:
    "./template/template_open_collaboration_message.html",
  CHATROOM_USER_LIST: "./template/template_chatroom_user_list.html",
  CHATROOM_USER_FILTER_LIST:
    "./template/template_chatroom_user_filter_list.html",
  MAKE_ROOM_USER_LIST: "./template/template_make_room_user_list.html",
  MAKE_ROOM_GROUP_USER_LIST:
    "./template/template_make_room_group_user_list.html",
  MAKE_ROOM_GROUP_PATH: "./template/template_make_room_group_path.html",
  MAKE_ROOM_CONFIRM_USER_LIST:
    "./template/template_make_room_confirm_user_list.html",
  ADD_USER_CONFIRM_USER_LIST:
    "./template/template_add_user_confirm_user_list.html",
  ADD_USER_USER_LIST: "./template/template_add_user_user_list.html",
  ADD_USER_USER_LIST_IN_COLLABORATION:
    "./template/template_add_user_user_list_in_collaboration.html",
  ADD_USER_GROUP_PATH: "./template/template_add_user_group_path.html",
  ADD_USER_GROUP_LIST: "./template/template_add_user_group_list.html",
  ADD_USER_GROUP_LIST_IN_COLLABORATION:
    "./template/template_add_user_group_list_in_collaboration.html",
  ADD_USER_GROUP_USER_LIST: "./template/template_add_user_group_user_list.html",
  ADD_USER_GROUP_USER_LIST_IN_COLLABORATION:
    "./template/template_add_user_group_user_list_in_collaboration.html",
  ADD_USER_GROUP_PATH_IN_COLLABORATION:
    "./template/template_add_user_group_path_in_collaboration.html",
  COLLABORATION_PROFILE: "./modal_collabo_profile.html",
  COLLABORATION_OVERLAY_USER_LIST: "collaboration_overlay_user_list.html",
  MODAL_ADD_USER_CONFIRM: "./modal_add_user_confirm.html",
};

const SOCKET_KEY = {
  CONNECT: "connect",
  DISCONNECT: "disconnect",
  CONNECT_ERROR: "connect_error",
  NEW_MESSAGE: "newMessage",
  NEW_COMMUNICATION: "newCommunication",
  NEW_NOTIFICATION: "newNotification",
  REFRESH_GROUPLIST: "refreshGroupList",
  REFRESH_USERLIST_INGROUP: "refreshUserListInGroup",
  SHOW_SERVER_ERROR: "showServerError",
  RETRY_JOIN_PROCESS: "retryJoinProcess",
  JOIN: "join",
  CREATE_MESSAGE: "createMessage",
  CREATE_TEXT: "createText",
  CREATE_IMAGE: "createImage",
  CREATE_VIDEO: "createVideo",
  COMMUNICATION: "communication",  
  GET_GROUP_LIST: "getGroupList",
  LEAVE_ROOM: "leaveRoom",
};

const NATIVE_KEY_IOS = {
  currentUserInfo: "currentUserInfo",
  getDeviceInfo: "getDeviceInfo",
  getServerInfo: "getServerInfo",
  getRoomInfo: "getRoomInfo",
  getBeforeRoomType: "getBeforeRoomType",
  getRoomType: "getRoomType",
  removeFavoriteUser: "removeFavoriteUser",
  addFavoriteUser: "addFavoriteUser",
  removeFavoriteGroup: "removeFavoriteGroup",
  addFavoriteGroup: "addFavoriteGroup",
  getCollaborationJoinFlg: "getCollaborationJoinFlg",
  getUserInfoList: "getUserInfoList",
  createContentView: "createContentView",
  getToMoveGroupId: "getToMoveGroupId",
  getJoinCollaborationType: "getJoinCollaborationType",
  getHostRequestFlg: "getHostRequestFlg",
  getRoomList: "getRoomList",
  getMyInfo: "getMyInfo",
  getMessages: "getMessages",
  getFavoriteUsersNotInRoom: "getFavoriteUsersNotInRoom",
  getFavoriteUsers: "getFavoriteUsers",
  getFavoriteGroups: "getFavoriteGroups",
  getMyGroupUsers: "getMyGroupUsers",
  getGroupInfo: "getGroupInfo",
  getGroupInfoForAddUser: "getGroupInfoForAddUser",
  getSelectedUserList: "getSelectedUserList",
  getNameCardData: "getNameCardData",
  getMyGroupShopMemberByName: "getMyGroupShopMemberByName",
  getMyGroupShopMemberNotInRoomByName: "getMyGroupShopMemberNotInRoomByName",
  getAllGroupShopMemberByName: "getAllGroupShopMemberByName",
  getAllGroupShopMemberNotInRoomByName: "getAllGroupShopMemberNotInRoomByName",
  getGroupByName: "getGroupByName",
  getUsersInRoom: "getUsersInRoom",
  getArchiveList: "getArchiveList",
  getArchiveByName: "getArchiveByName",
  getArchiveDetail: "getArchiveDetail",
  searchMessages: "searchMessages",
  getMyGroupUsersNotInRoom: "getMyGroupUsersNotInRoom",
  getUserInfo: "getUserInfo",
  getUserListByLoginId: "getUserListByLoginId",
  getMessageListFromMessageId: "getMessageListFromMessageId",
  updatePreMessage: "updatePreMessage",
};

const BIZ_TASK_YELL_URL = "https://biztaskyell.abookcloud.com";