uawdijnntqw1x1x1
IP : 3.23.92.44
Hostname : axolotl
Kernel : Linux axolotl 4.9.0-13-amd64 #1 SMP Debian 4.9.228-1 (2020-07-05) x86_64
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,
OS : Linux
PATH:
/
var
/
www
/
axolotl
/
data
/
www
/
arhangelsk.axolotls.ru
/
a537b
/
dialog.tar
/
/
config.php000066400000000560147744135340006541 0ustar00<? if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) { die(); } return [ 'js' => [ './dist/dialog.bundle.js', ], 'css' => [ './dist/dialog.bundle.css', ], 'rel' => [ 'main.polyfill.core', 'ui.vue', 'ui.vue.vuex', 'im.lib.logger', 'im.const', 'im.lib.utils', 'im.view.dialog', 'im.view.quotepanel', ], 'skip_core' => true, ];bundle.config.js000066400000000163147744135340007635 0ustar00module.exports = { input: './src/component.js', output: './dist/dialog.bundle.js', namespace: 'BX.Messenger', };src/component.js000066400000041075147744135340007720 0ustar00/** * Bitrix im dialog mobile * Dialog vue component * * @package bitrix * @subpackage mobile * @copyright 2001-2019 Bitrix */ import {Vue} from "ui.vue"; import {Vuex} from "ui.vue.vuex"; import {Logger} from "im.lib.logger"; import {EventType, RestMethodHandler, RestMethod} from "im.const"; import {Utils} from "im.lib.utils"; import "im.view.dialog"; import "im.view.quotepanel"; import "./component.css"; /** * @notice Do not mutate or clone this component! It is under development. */ Vue.component('bx-im-component-dialog', { props: { chatId: { default: 0 }, userId: { default: 0 }, dialogId: { default: 0 }, enableGestureQuote: { default: true }, enableGestureQuoteFromRight: { default: true }, enableGestureMenu: { default: false }, showMessageUserName: { default: true }, showMessageAvatar: { default: true }, }, data: function() { return { dialogState: 'loading', dialogDiskFolderId: 0, dialogChatId: 0 }; }, created: function() { this.requestData(); }, watch: { dialogId() { this.requestData(); } }, computed: { EventType: () => EventType, localize() { return Object.assign({}, Vue.getFilteredPhrases('MOBILE_CHAT_', this.$root.$bitrixMessages), Vue.getFilteredPhrases('IM_UTILS_', this.$root.$bitrixMessages), ); }, widgetClassName(state) { let className = ['bx-mobilechat-wrapper']; if (this.showMessageDialog) { className.push('bx-mobilechat-chat-start'); } return className.join(' '); }, quotePanelData() { let result = { id: 0, title: '', description: '', color: '' }; if (!this.showMessageDialog || !this.dialog.quoteId) { return result; } let message = this.$store.getters['messages/getMessage'](this.dialog.chatId, this.dialog.quoteId); if (!message) { return result; } let user = this.$store.getters['users/get'](message.authorId); let files = this.$store.getters['files/getList'](this.dialog.chatId); return { id: this.dialog.quoteId, title: message.params.NAME ? message.params.NAME : (user ? user.name: ''), color: user? user.color: '', description: Utils.text.purify(message.text, message.params, files, this.localize) }; }, isDialog() { return Utils.dialog.isChatId(this.dialog.dialogId); }, isGestureQuoteSupported() { return false; }, isDarkBackground() { return this.application.options.darkBackground; }, showMessageDialog() { let result = this.messageCollection && this.messageCollection.length > 0; if (result) { this.dialogState = 'show'; } else if (this.dialog && this.dialog.init) { this.dialogState = 'empty'; } else { this.dialogState = 'loading'; } return result; }, ...Vuex.mapState({ application: state => state.application, dialog: state => state.dialogues.collection[state.application.dialog.dialogId], messageCollection: state => state.messages.collection[state.application.dialog.chatId] }) }, methods: { requestData() { console.log('4. requestData'); //this.requestDataSend = true; let query = { [RestMethodHandler.mobileBrowserConstGet]: [RestMethod.mobileBrowserConstGet, {}], [RestMethodHandler.imChatGet]: [RestMethod.imChatGet, {dialog_id: this.dialogId}], [RestMethodHandler.imDialogMessagesGetInit]: [RestMethod.imDialogMessagesGet, { dialog_id: this.dialogId, limit: this.$root.$bitrixController.application.getRequestMessageLimit(), convert_text: 'Y' }], }; if (Utils.dialog.isChatId(this.dialogId)) { query[RestMethodHandler.imUserGet] = [RestMethod.imUserGet, {}]; } else { query[RestMethodHandler.imUserListGet] = [RestMethod.imUserListGet, {id: [this.userId, this.dialogId]}]; } this.$root.$bitrixController.restClient.callBatch(query, (response) => { if (!response) { //this.requestDataSend = false; //this.setError('EMPTY_RESPONSE', 'Server returned an empty response.'); return false; } let constGet = response[RestMethodHandler.mobileBrowserConstGet]; if (constGet.error()) { // this.setError(constGet.error().ex.error, constGet.error().ex.error_description); } else { this.$root.$bitrixController.executeRestAnswer(RestMethodHandler.mobileBrowserConstGet, constGet); } let userGet = response[RestMethodHandler.imUserGet]; if (userGet && !userGet.error()) { this.$root.$bitrixController.executeRestAnswer(RestMethodHandler.imUserGet, userGet); } let userListGet = response[RestMethodHandler.imUserListGet]; if (userListGet && !userListGet.error()) { this.$root.$bitrixController.executeRestAnswer(RestMethodHandler.imUserListGet, userListGet); } let chatGetResult = response[RestMethodHandler.imChatGet]; if (!chatGetResult.error()) { this.dialogChatId = chatGetResult.data().id; this.dialogDiskFolderId = chatGetResult.data().disk_folder_id; } // TODO imChatGet this.$root.$bitrixController.executeRestAnswer(RestMethodHandler.imChatGet, chatGetResult); let dialogMessagesGetResult = response[RestMethodHandler.imDialogMessagesGetInit]; if (dialogMessagesGetResult.error()) { //this.setError(dialogMessagesGetResult.error().ex.error, dialogMessagesGetResult.error().ex.error_description); } else { //this.timer.stop('data', 'load', true); // this.$root.$bitrixController.getStore().dispatch('dialogues/saveDialog', { // dialogId: this.$root.$bitrixController.application.getDialogId(), // chatId: this.$root.$bitrixController.application.getChatId(), // }); if (this.$root.$bitrixController.pullCommandHandler) { //this.$root.$bitrixController.pullCommandHandler.option.skip = false; } this.$root.$bitrixController.getStore().dispatch('application/set', {dialog: { enableReadMessages: true }}).then(() => { this.$root.$bitrixController.executeRestAnswer(RestMethodHandler.imDialogMessagesGetInit, dialogMessagesGetResult); }); //this.processSendMessages(); } //this.requestDataSend = false; }, false, false, Utils.getLogTrackingParams({name: 'im.dialog', dialog: this.$root.$bitrixController.application.getDialogData()})); return new Promise((resolve, reject) => resolve()); }, getDialogHistory(lastId, limit = this.$root.$bitrixController.application.getRequestMessageLimit()) { this.$root.$bitrixController.restClient.callMethod(RestMethod.imDialogMessagesGet, { 'CHAT_ID': this.dialogChatId, 'LAST_ID': lastId, 'LIMIT': limit, 'CONVERT_TEXT': 'Y' }).then(result => { this.$root.$bitrixController.executeRestAnswer(RestMethodHandler.imDialogMessagesGet, result); this.$root.$emit(EventType.dialog.requestHistoryResult, {count: result.data().messages.length}); }).catch(result => { this.$root.$emit(EventType.dialog.requestHistoryResult, {error: result.error().ex}); }); }, getDialogUnread(lastId, limit = this.$root.$bitrixController.application.getRequestMessageLimit()) { if (this.promiseGetDialogUnreadWait) { return this.promiseGetDialogUnread; } this.promiseGetDialogUnread = new BX.Promise(); this.promiseGetDialogUnreadWait = true; if (!lastId) { lastId = this.$root.$bitrixController.getStore().getters['messages/getLastId'](this.dialogChatId); } if (!lastId) { this.$root.$emit(EventType.dialog.requestUnreadResult, {error: {error: 'LAST_ID_EMPTY', error_description: 'LastId is empty.'}}); this.promiseGetDialogUnread.reject(); this.promiseGetDialogUnreadWait = false; return this.promiseGetDialogUnread; } this.$root.$bitrixController.application.readMessage(lastId, true, true).then(() => { // this.timer.start('data', 'load', .5, () => { // console.warn("ChatDialog.requestData: slow connection show progress icon"); // app.titleAction("setParams", {useProgress: true, useLetterImage: false}); // }); let query = { [RestMethodHandler.imDialogRead]: [RestMethod.imDialogRead, { dialog_id: this.dialogId, message_id: lastId }], [RestMethodHandler.imChatGet]: [RestMethod.imChatGet, { dialog_id: this.dialogId }], [RestMethodHandler.imDialogMessagesGetUnread]: [RestMethod.imDialogMessagesGet, { chat_id: this.dialogChatId, first_id: lastId, limit: limit, convert_text: 'Y' }] }; this.$root.$bitrixController.restClient.callBatch(query, (response) => { if (!response) { this.$root.$emit(EventType.dialog.requestUnreadResult, {error: {error: 'EMPTY_RESPONSE', error_description: 'Server returned an empty response.'}}); this.promiseGetDialogUnread.reject(); this.promiseGetDialogUnreadWait = false; return false; } let chatGetResult = response[RestMethodHandler.imChatGet]; if (!chatGetResult.error()) { this.$root.$bitrixController.executeRestAnswer(RestMethodHandler.imChatGet, chatGetResult); } let dialogMessageUnread = response[RestMethodHandler.imDialogMessagesGetUnread]; if (dialogMessageUnread.error()) { this.$root.$emit(EventType.dialog.requestUnreadResult, {error: dialogMessageUnread.error().ex}); } else { this.$root.$bitrixController.executeRestAnswer(RestMethodHandler.imDialogMessagesGetUnread, dialogMessageUnread); this.$root.$emit(EventType.dialog.requestUnreadResult, { firstMessageId: dialogMessageUnread.data().messages.length > 0? dialogMessageUnread.data().messages[0].id: 0, count: dialogMessageUnread.data().messages.length }); //app.titleAction("setParams", {useProgress: false, useLetterImage: true}); //this.timer.stop('data', 'load', true); } this.promiseGetDialogUnread.fulfill(response); this.promiseGetDialogUnreadWait = false; }, false, false, Utils.getLogTrackingParams({name: RestMethodHandler.imDialogMessagesGetUnread, dialog: this.$root.$bitrixController.application.getDialogData()})); }); return this.promiseGetDialogUnread; }, logEvent(name, ...params) { Logger.info(name, ...params); }, onDialogRequestHistory(event) { this.getDialogHistory(event.lastId); }, onDialogRequestUnread(event) { this.getDialogUnread(event.lastId); }, onDialogMessageClickByUserName(event) { this.$root.$bitrixController.application.replyToUser(event.user.id, event.user); }, onDialogMessageClickByUploadCancel(event) { this.$root.$bitrixController.application.cancelUploadFile(event.file.id); }, onDialogMessageClickByCommand(event) { if (event.type === 'put') { this.$root.$bitrixController.application.insertText({text: event.value+' '}); } else if (event.type === 'send') { this.$root.$bitrixController.application.addMessage(event.value); } else { Logger.warn('Unprocessed command', event); } }, onDialogMessageClickByMention(event) { if (event.type === 'USER') { this.$root.$bitrixController.application.openProfile(event.value); } else if (event.type === 'CHAT') { this.$root.$bitrixController.application.openDialog(event.value); } else if (event.type === 'CALL') { this.$root.$bitrixController.application.openPhoneMenu(event.value); } }, onDialogMessageMenuClick(event) { Logger.warn('Message menu:', event); this.$root.$bitrixController.application.openMessageMenu(event.message); }, onDialogMessageRetryClick(event) { Logger.warn('Message retry:', event); this.$root.$bitrixController.application.retrySendMessage(event.message); }, onDialogReadMessage(event) { this.$root.$bitrixController.application.readMessage(event.id); }, onDialogReadedListClick(event) { this.$root.$bitrixController.application.openReadedList(event.list); }, onDialogQuoteMessage(event) { this.$root.$bitrixController.application.quoteMessage(event.message.id); }, onDialogMessageReactionSet(event) { this.$root.$bitrixController.application.reactMessage(event.message.id, event.reaction); }, onDialogMessageReactionListOpen(event) { this.$root.$bitrixController.application.openMessageReactionList(event.message.id, event.values); }, onDialogMessageClickByKeyboardButton(event) { this.$root.$bitrixController.application.execMessageKeyboardCommand(event); }, onDialogMessageClickByChatTeaser(event) { this.$root.$bitrixController.application.execMessageOpenChatTeaser(event); }, onDialogClick(event) { }, onQuotePanelClose() { this.$root.$bitrixController.quoteMessageClear(); }, }, template: ` <div :class="widgetClassName"> <div :class="['bx-mobilechat-box', {'bx-mobilechat-box-dark-background': isDarkBackground}]"> <template v-if="application.error.active"> <div class="bx-mobilechat-body"> <div class="bx-mobilechat-warning-window"> <div class="bx-mobilechat-warning-icon"></div> <template v-if="application.error.description"> <div class="bx-mobilechat-help-title bx-mobilechat-help-title-sm bx-mobilechat-warning-msg" v-html="application.error.description"></div> </template> <template v-else> <div class="bx-mobilechat-help-title bx-mobilechat-help-title-md bx-mobilechat-warning-msg">{{localize.MOBILE_CHAT_ERROR_TITLE}}</div> <div class="bx-mobilechat-help-title bx-mobilechat-help-title-sm bx-mobilechat-warning-msg">{{localize.MOBILE_CHAT_ERROR_DESC}}</div> </template> </div> </div> </template> <template v-else> <div :class="['bx-mobilechat-body', {'bx-mobilechat-body-with-message': dialogState == 'show'}]" key="with-message"> <template v-if="dialogState == 'loading'"> <div class="bx-mobilechat-loading-window"> <svg class="bx-mobilechat-loading-circular" viewBox="25 25 50 50"> <circle class="bx-mobilechat-loading-path" cx="50" cy="50" r="20" fill="none" stroke-miterlimit="10"/> <circle class="bx-mobilechat-loading-inner-path" cx="50" cy="50" r="20" fill="none" stroke-miterlimit="10"/> </svg> <h3 class="bx-mobilechat-help-title bx-mobilechat-help-title-md bx-mobilechat-loading-msg">{{localize.MOBILE_CHAT_LOADING}}</h3> </div> </template> <template v-else-if="dialogState == 'empty'"> <div class="bx-mobilechat-loading-window"> <h3 class="bx-mobilechat-help-title bx-mobilechat-help-title-md bx-mobilechat-loading-msg">{{localize.MOBILE_CHAT_EMPTY}}</h3> </div> </template> <template v-else> <div class="bx-mobilechat-dialog"> <bx-im-view-dialog :userId="userId" :dialogId="dialogId" :chatId="dialogChatId" :messageLimit="application.dialog.messageLimit" :messageExtraCount="application.dialog.messageExtraCount" :enableReadMessages="application.dialog.enableReadMessages" :enableReactions="true" :enableDateActions="false" :enableCreateContent="false" :enableGestureQuote="enableGestureQuote" :enableGestureQuoteFromRight="enableGestureQuoteFromRight" :enableGestureMenu="enableGestureMenu" :showMessageUserName="showMessageUserName" :showMessageAvatar="showMessageAvatar" :showMessageMenu="false" :listenEventScrollToBottom="EventType.dialog.scrollToBottom" :listenEventRequestHistory="EventType.dialog.requestHistoryResult" :listenEventRequestUnread="EventType.dialog.requestUnreadResult" :listenEventSendReadMessages="EventType.dialog.sendReadMessages" @readMessage="onDialogReadMessage" @quoteMessage="onDialogQuoteMessage" @requestHistory="onDialogRequestHistory" @requestUnread="onDialogRequestUnread" @clickByCommand="onDialogMessageClickByCommand" @clickByMention="onDialogMessageClickByMention" @clickByUserName="onDialogMessageClickByUserName" @clickByMessageMenu="onDialogMessageMenuClick" @clickByMessageRetry="onDialogMessageRetryClick" @clickByUploadCancel="onDialogMessageClickByUploadCancel" @clickByReadedList="onDialogReadedListClick" @setMessageReaction="onDialogMessageReactionSet" @openMessageReactionList="onDialogMessageReactionListOpen" @clickByKeyboardButton="onDialogMessageClickByKeyboardButton" @clickByChatTeaser="onDialogMessageClickByChatTeaser" @click="onDialogClick" /> </div> <bx-im-view-quote-panel :id="quotePanelData.id" :title="quotePanelData.title" :description="quotePanelData.description" :color="quotePanelData.color" @close="onQuotePanelClose"/> </template> </div> </template> </div> </div> ` });src/dialog.css000066400000016305147744135340007327 0ustar00.bx-im-dialog { display: flex; height: 100%; overflow: hidden; } .bx-im-dialog-ajax { text-decoration: dotted; } .bx-im-dialog-list { overflow-y: auto; width: 100%; } .bx-im-dialog-list-scroll-blocked { overflow: hidden; } .bx-im-dialog-list-box { width: 100%; display: flex; flex-direction: column; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; overflow-x: hidden; overflow-y: auto; padding: 10px 0; } .bx-im-dialog-scroll-button-box { position: absolute; right: 0; bottom: 0; width: 55px; height: 55px; z-index: 1; -webkit-tap-highlight-color: transparent; outline: none; } .bx-im-dialog-scroll-button { background: #fff; border: 1px solid #ececec; box-shadow: 0 2px 1px 0 rgba(0,0,0,0.2); border-radius: 50%; width: 34px; height: 34px; margin-top: 10px; margin-left: 7px; cursor: pointer; transition: background-color .2s; text-align: center; } .bx-im-dialog-scroll-button:hover { background-color: #f9f9f9; } .bx-im-dialog-scroll-button-arrow { display: inline-block; width: 7px; height: 7px; border-top: 3px solid #bbb8b8; border-right: 3px solid #bbb8b8; transform: rotate(135deg); margin-top: 11px; cursor: pointer; box-sizing: content-box; } .bx-im-dialog-scroll-button-counter { width: 100%; text-align: center; margin-top:-7px; position: absolute; } .bx-im-dialog-scroll-button-counter-digit { display: inline-block; font: 11px/16px "Helvetica Neue", Helvetica, Arial, sans-serif; color: #fff; padding: 0 5px 0 5px; border: 2px solid #fff; border-radius: 10px; background-color: #17b0e1; } .bx-im-dialog-scroll-button-enter-active, .bx-im-dialog-scroll-button-leave-active { transition: bottom .2s ease-out; } .bx-im-dialog-scroll-button-enter, .bx-im-dialog-scroll-button-leave-to { bottom: -60px; } .bx-im-dialog-message-animation-enter-active, .bx-im-dialog-message-animation-leave-active { transition: 0s; } .bx-im-dialog-list-item {} .bx-im-dialog-group { font: 14px/19px "Helvetica Neue", Helvetica, Arial, sans-serif; text-overflow: ellipsis; white-space: nowrap; text-align: center; position: relative; } .bx-im-dialog-group-date { background-color: rgba(7, 5, 27, 0.62); border: 1px solid rgba(7, 5, 27, 0.1); text-shadow: none; color: #fff!important; display: inline-block; padding: 5px 15px; border-radius: 15px; font-size: 14px; text-decoration: none; margin: 10px 15px; } .bx-im-dialog-group-float.bx-im-dialog-group-date { position: absolute; display: block; margin-top: 32px; z-index: 30; -webkit-transform: translateZ(0); transform: translateZ(0); } .bx-im-dialog-load-more { position: relative; text-align: center; } .bx-im-dialog-load-more + .bx-im-dialog-list-box { padding-top: 0; } .bx-im-dialog-load-more-history { padding-bottom: 0; } .bx-im-dialog-load-more-unread { padding-top: 0; padding-bottom: 13px; } .bx-im-dialog-load-more-text:before { position: absolute; margin-left: -30px; margin-top: 4px; width: 20px; height: 20px; background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%3E%3Cpath%20d%3D%22M1%2010c0%204.9706%204.0294%209%209%209s9-4.0294%209-9-4.0294-9-9-9c-2.4048%200-4.5893.9432-6.2038%202.4798%22%20stroke%3D%22%23677B8F%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22/%3E%3C/svg%3E'); background-repeat: no-repeat; -ms-animation: bx-im-dialog-load-more .8s linear infinite; -webkit-animation: bx-im-dialog-load-more .8s linear infinite; animation: bx-im-dialog-load-more .8s linear infinite; content: "" } .bx-im-dialog-load-more-text { display: inline-block; height: 29px; font: 15px/29px "Helvetica Neue",Helvetica,Arial,sans-serif; color: #687B8C; vertical-align: top; padding: 10px 15px; padding-left: 30px; } .bx-im-dialog-dark-background .bx-im-dialog-load-more-text { color: #949494; } @-webkit-keyframes bx-im-dialog-load-more { 0% { -webkit-transform:rotate(0deg); transform:rotate(0deg); } 100% { -webkit-transform:rotate(360deg); transform:rotate(360deg); } } @keyframes bx-im-dialog-load-more { 0% { -moz-transform:rotate(0deg); transform:rotate(0deg); } 100% { -moz-transform:rotate(360deg); transform:rotate(360deg); } } .bx-im-dialog-status { padding: 0 20px 15px; display: block; font: 15px/19px "Helvetica Neue", Helvetica, Arial, sans-serif; color: #585858; word-wrap: break-word; vertical-align: middle; -moz-user-select:none; -webkit-user-select:none; user-select:none; cursor: default; position: relative; } .bx-im-dialog-status-enter-active, .bx-im-dialog-status-leave-active { transition: opacity .1s ease-out; } .bx-im-dialog-status-leave-active { transition: opacity .05s ease-out; } .bx-im-dialog-status-enter, .bx-im-dialog-status-leave-to { opacity: 0; } .bx-im-dialog-status-writing { width: 20px; height: 11px; display: inline-block; background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%228%22%20height%3D%222%22%3E%0A%20%20%3Cg%20fill%3D%22%23717171%22%20fill-rule%3D%22evenodd%22%3E%0A%20%20%20%20%3Crect%20width%3D%221.6%22%20height%3D%222%22%20rx%3D%22.8%22/%3E%0A%20%20%20%20%3Crect%20width%3D%221.6%22%20height%3D%222%22%20x%3D%223.2%22%20rx%3D%22.8%22/%3E%0A%20%20%20%20%3Crect%20width%3D%221.6%22%20height%3D%222%22%20x%3D%226.4%22%20rx%3D%22.8%22/%3E%0A%20%20%3C/g%3E%0A%3C/svg%3E%0A'); background-repeat: no-repeat; background-position: bottom left; vertical-align: middle; } .bx-im-dialog-status-writing:before { -webkit-animation: imWriting 1.4s linear infinite; animation: imWriting 1.4s linear infinite; content: ''; height: 16px; position: absolute; width: 19px; margin-left: 10px; margin-top:-1px; background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2210%22%20height%3D%2210%22%3E%0A%20%20%3Cpath%20fill%3D%22%23717171%22%20fill-rule%3D%22evenodd%22%20d%3D%22M7.8128%204.807L5.1751%202.1694a.041.041%200%200%200-.0578%200L.0328%207.2538c-.0739.0733%200%202.696%200%202.696s2.6222.0734%202.6961%200l5.0845-5.0844a.0416.0416%200%200%200-.0006-.0583zM1.0647%208.9376v-1.047h1.0495V8.94H1.0647v-.0025zm8.8785-6.2584L7.3054.0413a.0421.0421%200%200%200-.0578%200L6.1144%201.1746a.0416.0416%200%200%200%200%20.0577l2.6378%202.6378a.041.041%200%200%200%20.0577%200l1.1338-1.1333a.0427.0427%200%200%200-.0028-.0577h.0023z%22/%3E%0A%3C/svg%3E%0A'); background-repeat: no-repeat; zoom:1; } @-webkit-keyframes imWriting { 0% { margin-left: 1px; margin-top:-0px; } 20% { margin-left: 4px; margin-top:-1px; } 60% { margin-left: 8px; margin-top:-2px; } 65% { margin-left: 8px; margin-top:-2px; } 70% { margin-left: 8px; margin-top:-3px; -webkit-transform:rotate(-20deg); transform:rotate(-20deg); } 90% { margin-left: 8px; margin-top:-5px; -webkit-transform:rotate(-40deg); transform:rotate(-40deg); } 100% { margin-left: 1px; margin-top:-3px; } } @keyframes imWriting { 0% { margin-left: 1px; margin-top:-0px; } 20% { margin-left: 4px; margin-top:-1px; } 60% { margin-left: 8px; margin-top:-2px; } 65% { margin-left: 8px; margin-top:-2px; } 70% { margin-left: 8px; margin-top:-3px; transform:rotate(-20deg); } 90% { margin-left: 8px; margin-top:-5px; transform:rotate(-40deg); } 100% { margin-left: 1px; margin-top:-3px; } }src/dialog.js000066400000123017147744135340007152 0ustar00/** * Bitrix Messenger * Dialog Vue component * * @package bitrix * @subpackage im * @copyright 2001-2019 Bitrix */ import './dialog.css'; import 'main.polyfill.intersectionobserver'; import {Vue} from 'ui.vue'; import {Vuex} from 'ui.vue.vuex'; import 'im.component.message'; import {DeviceType, MutationType, DialogReferenceClassName, DialogType} from "im.const"; import {Utils as MessengerUtils} from "im.utils"; import {Animation} from "im.tools.animation"; const TemplateType = Object.freeze({ message: 'message', delimiter: 'delimiter', group: 'group', historyLoader: 'historyLoader', unreadLoader: 'unreadLoader', button: 'button', }); const ObserverType = Object.freeze({ history: 'history', unread: 'unread', read: 'read', none: 'none', }); const LoadButtonTypes = Object.freeze({ before: 'before', after: 'after' }); const AnimationType = Object.freeze({ none: 'none', mixed: 'mixed', enter: 'enter', leave: 'leave', }); Vue.component('bx-messenger-dialog', { /** * @emits 'requestHistory' {lastId: number, limit: number} * @emits 'requestUnread' {lastId: number, limit: number} * @emits 'readMessage' {id: number} * @emits 'quoteMessage' {message: object} * @emits 'click' {event: MouseEvent} * @emits 'clickByUserName' {user: object, event: MouseEvent} * @emits 'clickByUploadCancel' {file: object, event: MouseEvent} * @emits 'clickByKeyboardButton' {message: object, action: string, params: Object} * @emits 'clickByChatTeaser' {message: object, event: MouseEvent} * @emits 'clickByMessageMenu' {message: object, event: MouseEvent} * @emits 'clickByCommand' {type: string, value: string, event: MouseEvent} * @emits 'clickByMention' {type: string, value: string, event: MouseEvent} * @emits 'clickByMessageRetry' {message: object, event: MouseEvent} * @emits 'clickByReadedList' {list: array, event: MouseEvent} * @emits 'setMessageReaction' {message: object, reaction: object} * @emits 'openMessageReactionList' {message: object, values: object} */ /** * @listens props.listenEventScrollToBottom {force:boolean, cancelIfScrollChange:boolean} (global|application) -- scroll dialog to bottom, see more in methods.onScrollToBottom() * @listens props.listenEventRequestHistory {count:number} (application) * @listens props.listenEventRequestUnread {count:number} (application) * @listens props.listenEventSendReadMessages {} (application) */ props: { userId: { default: 0 }, dialogId: { default: 0 }, chatId: { default: 0 }, messageLimit: { default: 20 }, messageExtraCount: { default: 0 }, listenEventScrollToBottom: { default: '' }, listenEventRequestHistory: { default: '' }, listenEventRequestUnread: { default: '' }, listenEventSendReadMessages: { default: '' }, enableReadMessages: { default: true }, enableReactions: { default: true }, enableDateActions: { default: true }, enableCreateContent: { default: true }, enableGestureQuote: { default: true }, enableGestureQuoteFromRight: { default: true }, enableGestureMenu: { default: false }, showMessageUserName: { default: true }, showMessageAvatar: { default: true }, showMessageMenu: { default: true }, }, data() { return { scrollAnimating: false, showScrollButton: false, messageShowCount: 0, unreadLoaderShow: false, historyLoaderBlocked: false, historyLoaderShow: true, startMessageLimit: 0, templateMessageScrollOffset: 20, templateMessageWithNameDifferent: 29, // name block + padding top TemplateType: TemplateType, ObserverType: ObserverType, DialogReferenceClassName: DialogReferenceClassName, captureMove: false, capturedMoveEvent: null, lastMessageId: null, maxMessageId: null, } }, created() { this.showScrollButton = this.unreadCounter > 0; this.scrollChangedByUser = false; this.scrollButtonDiff = 100; this.scrollButtonShowTimeout = null; this.scrollPosition = 0; this.scrollPositionChangeTime = new Date().getTime(); this.animationScrollHeightStart = 0; this.animationScrollHeightEnd = 0; this.animationScrollTop = 0; this.animationScrollChange = 0; this.animationScrollLastUserId = 0; this.animationType = AnimationType.none; this.animationCollection = []; this.animationCollectionOffset = {}; this.animationLastElementBeforeStart = 0; this.observers = {}; this.requestHistoryInterval = null; this.requestUnreadInterval = null; this.lastAuthorId = 0; this.firstMessageId = null; this.firstUnreadMessageId = null; this.dateFormatFunction = null; this.cacheGroupTitle = {}; this.waitLoadHistory = false; this.waitLoadUnread = false; this.skipUnreadScroll = false; this.readMessageQueue = []; this.readMessageTarget = {}; this.readMessageDelayed = MessengerUtils.debounce(this.readMessage, 50, this); this.requestHistoryBlockIntersect = false; this.requestHistoryDelayed = MessengerUtils.debounce(this.requestHistory, 50, this); this.requestUnreadBlockIntersect = false; this.requestUnreadDelayed = MessengerUtils.debounce(this.requestUnread, 50, this); this.startMessageLimit = this.messageLimit; if (this.listenEventScrollToBottom) { Vue.event.$on(this.listenEventScrollToBottom, this.onScrollToBottom); this.$root.$on(this.listenEventScrollToBottom, this.onScrollToBottom); } if (this.listenEventRequestHistory) { this.$root.$on(this.listenEventRequestHistory, this.onRequestHistoryAnswer); } if (this.listenEventRequestUnread) { this.$root.$on(this.listenEventRequestUnread, this.onRequestUnreadAnswer); } if (this.listenEventSendReadMessages) { this.$root.$on(this.listenEventSendReadMessages, this.onSendReadMessages); } window.addEventListener("orientationchange", this.onOrientationChange); window.addEventListener('focus', this.onWindowFocus); window.addEventListener('blur', this.onWindowBlur); Vue.event.$on('bitrixmobile:controller:focus', this.onWindowFocus); Vue.event.$on('bitrixmobile:controller:blur', this.onWindowBlur); }, beforeDestroy() { this.observers = {}; clearTimeout(this.scrollButtonShowTimeout); clearInterval(this.requestHistoryInterval); clearInterval(this.requestUnreadInterval); if (this.listenEventScrollToBottom) { Vue.event.$off(this.listenEventScrollToBottom, this.onScrollToBottom); this.$root.$off(this.listenEventScrollToBottom, this.onScrollToBottom); } if (this.listenEventRequestHistory) { this.$root.$off(this.listenEventRequestHistory, this.onRequestHistoryAnswer); } if (this.listenEventRequestUnread) { this.$root.$off(this.listenEventRequestUnread, this.onRequestUnreadAnswer); } if (this.listenEventSendReadMessages) { this.$root.$off(this.listenEventSendReadMessages, this.onSendReadMessages); } window.removeEventListener("orientationchange", this.onOrientationChange); window.removeEventListener('focus', this.onWindowFocus); window.removeEventListener('blur', this.onWindowBlur); Vue.event.$off('bitrixmobile:controller:focus', this.onWindowFocus); Vue.event.$off('bitrixmobile:controller:blur', this.onWindowBlur); }, mounted() { let unreadId = Utils.getFirstUnreadMessage(this.collection); if (unreadId) { Utils.scrollToFirstUnreadMessage(this, this.collection, unreadId, true) } else { let body = this.$refs.body; Utils.scrollToPosition(this, body.scrollHeight - body.clientHeight); } this.windowFocused = MessengerUtils.platform.isBitrixMobile()? true: document.hasFocus(); }, computed: { localize() { return Vue.getFilteredPhrases('IM_MESSENGER_DIALOG_', this.$root.$bitrixMessages); }, dialog() { let dialog = this.$store.getters['dialogues/get'](this.dialogId); return dialog? dialog: this.$store.getters['dialogues/getBlank'](); }, collectionMutationType() { return this.$store.getters['messages/getMutationType'](this.chatId); }, collection() { return this.$store.getters['messages/get'](this.chatId); }, elementsWithLimit() { let unreadCount = this.collection.filter(element => element.unread).length; let showLimit = this.messageExtraCount + this.messageLimit * 2; if (unreadCount > showLimit) { showLimit = unreadCount; } let start = this.collection.length - showLimit; if (!this.historyLoaderShow || start < 0) { start = 0; } let slicedCollection = start === 0? this.collection: this.collection.slice(start, this.collection.length); this.messageShowCount = slicedCollection.length; this.firstMessageId = null; this.lastMessageId = 0; this.maxMessageId = 0; this.lastMessageAuthorId = 0; let collection = []; let lastAuthorId = 0; let groupNode = {}; this.firstUnreadMessageId = 0; let unreadCountInSlicedCollection = 0; if (this.messageShowCount > 0) { slicedCollection.forEach(element => { if (this.firstMessageId === null || this.firstMessageId > element.id) { this.firstMessageId = element.id; } if (this.maxMessageId < element.id) { this.maxMessageId = element.id; } this.lastMessageId = element.id; let group = this._groupTitle(element.date); if (!groupNode[group.title]) { groupNode[group.title] = group.id; collection.push(Blocks.getGroup(group.id, group.title)); } else if (lastAuthorId !== element.authorId) { collection.push(Blocks.getDelimiter(element.id)); } collection.push(element); lastAuthorId = element.authorId; if (element.unread) { if (!this.firstUnreadMessageId) { this.firstUnreadMessageId = element.id; } unreadCountInSlicedCollection++; } }); this.lastMessageAuthorId = lastAuthorId; } else { this.firstMessageId = 0; } if ( this.collection.length >= this.messageLimit && this.collection.length >= this.messageShowCount && this.historyLoaderBlocked === false ) { this.historyLoaderShow = true; } else { this.historyLoaderShow = false; } if (this.dialog.unreadLastId > this.maxMessageId) { this.unreadLoaderShow = true; } else { this.unreadLoaderShow = false; } return collection; }, statusWriting() { clearTimeout(this.scrollToTimeout); if (this.dialog.writingList.length === 0) { return ''; } if (!this.scrollChangedByUser && !this.showScrollButton) { this.scrollToTimeout = setTimeout(() => this.scrollTo({duration: 500}), 300); } return this.localize.IM_MESSENGER_DIALOG_WRITES_MESSAGE.replace( '#USER#', this.dialog.writingList.map(element => element.userName).join(', ') ); }, statusReaded() { clearTimeout(this.scrollToTimeout); if (this.dialog.readedList.length === 0) { return ''; } let text = ''; if (this.dialog.type === DialogType.private) { let record = this.dialog.readedList[0]; if ( record.messageId === this.lastMessageId && record.userId !== this.lastMessageAuthorId ) { let dateFormat = MessengerUtils.date.getFormatType( BX.Messenger.Const.DateFormat.readedTitle, this.$root.$bitrixMessages ); text = this.localize.IM_MESSENGER_DIALOG_MESSAGES_READED_USER.replace( '#DATE#', this._getDateFormat().format(dateFormat, record.date) ); } } else { let readedList = this.dialog.readedList.filter(record => record.messageId === this.lastMessageId && record.userId !== this.lastMessageAuthorId); if (readedList.length === 1) { text = this.localize.IM_MESSENGER_DIALOG_MESSAGES_READED_CHAT.replace( '#USERS#', readedList[0].userName ); } else if (readedList.length > 1) { text = this.localize.IM_MESSENGER_DIALOG_MESSAGES_READED_CHAT.replace( '#USERS#', this.localize.IM_MESSENGER_DIALOG_MESSAGES_READED_CHAT_PLURAL .replace('#USER#', readedList[0].userName) .replace('#COUNT#', readedList.length-1) .replace('[LINK]', '') .replace('[/LINK]', '') ); } } if (!text) { return ''; } if (!this.scrollChangedByUser && !this.showScrollButton) { this.scrollToTimeout = setTimeout(() => this.scrollTo({duration: 500}), 300); } return text; }, unreadCounter() { return this.dialog.counter > 999? 999: this.dialog.counter; }, scrollBlocked() { if (this.application.device.type !== DeviceType.mobile) { return false; } return this.scrollAnimating || this.captureMove; }, isDarkBackground() { return this.application.options.darkBackground; }, isMobile() { return this.application.device.type === DeviceType.mobile; }, AnimationType: () => AnimationType, ...Vuex.mapState({ application: state => state.application, }) }, methods: { onDialogClick(event) { if (Vue.testNode(event.target, {className: 'bx-im-message-command'})) { this.onCommandClick(event); } else if (Vue.testNode(event.target, {className: 'bx-im-mention'})) { this.onMentionClick(event); } this.windowFocused = true; this.$emit('click', {event}); }, onDialogMove(event) { if (!this.captureMove) { return; } this.capturedMoveEvent = event; }, onCommandClick(event) { let value = ''; if ( event.target.dataset.entity === 'send' || event.target.dataset.entity === 'put' ) { value = event.target.nextSibling.innerHTML; } else if (event.target.dataset.entity === 'call') { value = event.target.dataset.command; } this.$emit('clickByCommand', {type: event.target.dataset.entity, value, event}); }, onMentionClick(event) { this.$emit('clickByMention', {type: event.target.dataset.type, value: event.target.dataset.value, event}); }, onScroll(event) { clearTimeout(this.scrollToTimeout); this.scrollPosition = event.target.scrollTop; this.scrollPositionChangeTime = new Date().getTime(); this.scrollChangedByUser = !(event.target.scrollTop + this.scrollButtonDiff >= event.target.scrollHeight - event.target.clientHeight); clearTimeout(this.scrollButtonShowTimeout); this.scrollButtonShowTimeout = setTimeout(() => { if (this.scrollChangedByUser) { if (!this.showScrollButton) { this.showScrollButton = true; } } else { if (this.showScrollButton && !this.unreadLoaderShow) { this.showScrollButton = false; } } }, 200); if (event.target.scrollTop === event.target.scrollHeight - event.target.offsetHeight) { clearTimeout(this.scrollButtonShowTimeout); if (this.showScrollButton && !this.unreadLoaderShow) { this.showScrollButton = false; } } }, scrollToBottom(params = {}) { let { force = false, cancelIfScrollChange = false, duration = null } = params; if (cancelIfScrollChange && this.scrollChangedByUser) { return false; } let body = this.$refs.body; if (this.dialog.counter > 0) { let scrollToMessageId = this.dialog.counter > 1 && this.firstUnreadMessageId? this.firstUnreadMessageId: this.lastMessageId; Utils.scrollToFirstUnreadMessage(this, this.collection, scrollToMessageId); if (this.dialog.counter < this.startMessageLimit) { this.historyLoaderShow = true; this.historyLoaderBlocked = false; } return true; } this.showScrollButton = false; if (force) { Utils.scrollToPosition(this, body.scrollHeight - body.clientHeight); if (this.messageExtraCount) { this.$store.commit('application/clearDialogExtraCount'); } this.historyLoaderShow = true; this.historyLoaderBlocked = false; } else { let scrollParams = {}; if (duration) { scrollParams.duration = duration; } this.scrollTo({ callback: () => { if (this.messageExtraCount) { this.$store.commit('application/clearDialogExtraCount'); } this.historyLoaderShow = true; this.historyLoaderBlocked = false; }, ...scrollParams }); } }, scrollTo(params = {}) { if (this.animateScrollId) { Animation.cancel(this.animateScrollId); this.scrollAnimating = false; } if (typeof params === 'function') { params = {callback: params}; } let body = this.$refs.body; if (!body) { if (params.callback && typeof params.callback === 'function') { params.callback(); } this.animateScrollId = null; this.scrollAnimating = false; return true; } if ( MessengerUtils.platform.isIos() && ( MessengerUtils.platform.getIosVersion() > 12 && MessengerUtils.platform.getIosVersion() < 13.2 ) ) { body.scrollTop = body.scrollHeight - body.clientHeight; return true; } let { start = body.scrollTop, end = body.scrollHeight - body.clientHeight, increment = 20, callback, duration = 500 } = params; let container = this.$refs.container; if (container && (end - start) > container.offsetHeight * 3) { start = end - container.offsetHeight * 3; console.warn('Scroll trajectory has been reduced'); } this.scrollAnimating = true; console.warn('User scroll blocked while scrolling'); this.animateScrollId = Animation.start({ start, end, increment, duration, element: body, elementProperty: 'scrollTop', callback: () => { this.animateScrollId = null; this.scrollAnimating = false; if (callback && typeof callback === 'function') { callback(); } }, }); }, onScrollToBottom(event = {}) { event.force = event.force === true; event.cancelIfScrollChange = event.cancelIfScrollChange === true; if (this.firstUnreadMessageId) { console.warn('onScrollToBottom canceled - unread messages'); return false; } this.scrollToBottom(event); return true; }, onOrientationChange(event = {}) { clearTimeout(this.scrollToTimeout); if (this.application.device.type !== DeviceType.mobile) { return false; } console.log('Orientation changed'); if (!this.scrollChangedByUser) { this.scrollToTimeout = setTimeout(() => this.scrollToBottom({force: true}), 300); } }, onWindowFocus(event = {}) { this.windowFocused = true; this.readMessage(); return true; }, onWindowBlur(event = {}) { this.windowFocused = false; }, requestHistory() { if (!this.requestHistoryBlockIntersect) { return false; } if (this.waitLoadHistory || !this.windowFocused || this.animateScrollId) { this.requestHistoryDelayed(); return false; } if ( this.scrollPositionChangeTime + 100 > new Date().getTime() // || this.$refs.body.scrollTop < 0 ) { this.requestHistoryDelayed(); return true; } this.waitLoadHistory = true; clearTimeout(this.waitLoadHistoryTimeout); this.waitLoadHistoryTimeout = setTimeout(() => { this.waitLoadHistory = false; }, 10000); let length = this.collection.length; let messageShowCount = this.messageShowCount; if (length > messageShowCount) { let element = this.$refs.body.getElementsByClassName(DialogReferenceClassName.listItem)[0]; this.$store.commit('application/increaseDialogExtraCount', {count: this.startMessageLimit}); Utils.scrollToElementAfterLoadHistory(this, element); return true; } this.$emit('requestHistory', {lastId: this.firstMessageId}); }, requestUnread() { if (!this.requestUnreadBlockIntersect) { return false; } if (this.waitLoadUnread || !this.windowFocused || this.animateScrollId) { this.requestUnreadDelayed(); return false; } if ( this.scrollPositionChangeTime + 10 > new Date().getTime() //|| this.$refs.body.scrollTop > this.$refs.body.scrollHeight - this.$refs.body.clientHeight ) { this.requestUnreadDelayed(); return true; } this.waitLoadUnread = true; this.skipUnreadScroll = true; this.$emit('requestUnread', {lastId: this.lastMessageId}); }, onRequestHistoryAnswer(event = {}) { if (event.error) { this.historyLoaderBlocked = false; } else { this.historyLoaderBlocked = event.count < this.startMessageLimit; this.$store.commit('application/increaseDialogExtraCount', {count: event.count}); } if (this.historyLoaderBlocked) { this.historyLoaderShow = false; } let element = this.$refs.body.getElementsByClassName(DialogReferenceClassName.listItem)[0]; if (event.count > 0) { if (element) { Utils.scrollToElementAfterLoadHistory(this, element); } } else if (event.error) { element.scrollIntoView(true); } else { Utils.scrollToPosition(this, 0); } clearTimeout(this.waitLoadHistoryTimeout); this.waitLoadHistoryTimeout = setTimeout(() => { this.waitLoadHistory = false; }, 1000); return true; }, onRequestUnreadAnswer(event = {}) { if (event.error) { this.historyLoaderBlocked = false; } else { if (event.count < this.startMessageLimit) { this.unreadLoaderShow = false; } this.$store.commit('application/increaseDialogExtraCount', {count: event.count}); } let body = this.$refs.body; if (event.count > 0) { } else if (event.error) { let element = this.$refs.body.getElementsByClassName(DialogReferenceClassName.listUnreadLoader)[0]; if (element) { Utils.scrollToPosition(this, body.scrollTop - element.offsetHeight*2); } else { Utils.scrollToPosition(this, body.scrollHeight - body.clientHeight); } } else { Utils.scrollToPosition(this, body.scrollHeight - body.clientHeight); } setTimeout(() => this.waitLoadUnread = false, 1000); return true; }, onSendReadMessages(event = {}) { this.readMessageDelayed(); return true; }, readMessage() { if (!this.windowFocused) { return false; } this.readMessageQueue = this.readMessageQueue.filter(messageId => { if (this.readMessageTarget[messageId]) { if (this.observers[ObserverType.read]) { this.observers[ObserverType.read].unobserve(this.readMessageTarget[messageId]); } delete this.readMessageTarget[messageId]; } this.requestReadMessage(messageId); return false; }); }, requestReadMessage(messageId) { this.$emit('readMessage', {id: messageId}); }, onClickByUserName(event) { if (!this.windowFocused) { return false; } this.$emit('clickByUserName', event) }, onClickByUploadCancel(event) { if (!this.windowFocused) { return false; } this.$emit('clickByUploadCancel', event) }, onClickByKeyboardButton(event) { if (!this.windowFocused) { return false; } this.$emit('clickByKeyboardButton', event) }, onClickByChatTeaser(event) { this.$emit('clickByChatTeaser', event) }, onClickByMessageMenu(event) { if (!this.windowFocused) { return false; } this.$emit('clickByMessageMenu', event) }, onClickByMessageRetry(event) { if (!this.windowFocused) { return false; } this.$emit('clickByMessageRetry', event) }, onClickByReadedList(event) { const readedList = this.dialog.readedList.filter(record => record.messageId === this.lastMessageId && record.userId !== this.lastMessageAuthorId); this.$emit('clickByReadedList', {list: readedList, event}) }, onMessageReactionSet(event) { this.$emit('setMessageReaction', event) }, onMessageReactionListOpen(event) { this.$emit('openMessageReactionList', event) }, onDragMessage(event) { if (!this.windowFocused) { return false; } this.captureMove = event.result; if (!event.result) { this.capturedMoveEvent = null; } }, onQuoteMessage(event) { if (!this.windowFocused) { return false; } this.$emit('quoteMessage', event) }, _getDateFormat() { if (this.dateFormatFunction) { return this.dateFormatFunction; } this.dateFormatFunction = Object.create(BX.Main.Date); if (this.$root.$bitrixMessages) { this.dateFormatFunction._getMessage = (phrase) => this.$root.$bitrixMessages[phrase]; } return this.dateFormatFunction; }, _groupTitle(date) { const id = Utils.getDateFormat(date); if (this.cacheGroupTitle[id]) { return { id: id, title: this.cacheGroupTitle[id] }; } let dateFormat = MessengerUtils.date.getFormatType( BX.Messenger.Const.DateFormat.groupTitle, this.$root.$bitrixMessages ); this.cacheGroupTitle[id] = this._getDateFormat().format(dateFormat, date); return { id: id, title: this.cacheGroupTitle[id] }; }, animationTrigger(type, start, element) { let templateId = element.dataset.templateId; let templateType = element.dataset.type; let body = this.$refs.body; if (!body || !templateId) { return false; } if (start) { if (!this.animationScrollHeightStart) { this.animationScrollHeightStart = body.scrollHeight; this.animationScrollHeightEnd = body.scrollHeight; this.animationScrollTop = body.scrollTop; this.animationScrollChange = 0; clearTimeout(this.scrollToTimeout); this.scrollChangedByUser = !(body.scrollTop + this.scrollButtonDiff >= body.scrollHeight - body.clientHeight); if (this.scrollChangedByUser && !this.showScrollButton && this.unreadCounter > 1) { this.showScrollButton = true; } } } else { this.animationScrollHeightEnd = body.scrollHeight; } if ( !this.collectionMutationType.applied && this.collectionMutationType.initialType !== MutationType.set ) { if (start) { this.animationCollection.push(templateId); } else { this.animationCollection = this.animationCollection.filter(id => { delete this.animationCollectionOffset[templateId]; return id !== templateId; }); } this.animationStart(); return false; } if ( !this.collectionMutationType.applied && this.collectionMutationType.initialType === MutationType.set && this.collectionMutationType.appliedType === MutationType.setBefore ) { let unreadId = Utils.getFirstUnreadMessage(this.collection); if (unreadId) { Utils.scrollToFirstUnreadMessage(this, this.collection, unreadId, true); return false; } Utils.scrollToPosition(this, body.scrollHeight - body.clientHeight); if (start) { this.animationCollection.push(templateId); } else { this.animationCollection = this.animationCollection.filter(id => { delete this.animationCollectionOffset[templateId]; return id !== templateId; }); } this.animationStart(); return false; } if (start) { if (type === AnimationType.leave) { this.animationCollectionOffset[templateId] = element.offsetHeight; } if (this.animationType === AnimationType.none) { this.animationType = type; } else if (this.animationType !== type) { this.animationType = AnimationType.mixed; } this.animationCollection.push(templateId); } else { if (type === AnimationType.enter) { let offset = element.offsetHeight; this.animationScrollChange += offset; body.scrollTop += offset; } else if (type === AnimationType.leave) { let offset = this.animationCollectionOffset[templateId]? this.animationCollectionOffset[templateId]: 0; this.animationScrollChange -= offset; body.scrollTop -= offset; this.animationScrollLastIsDelimeter = templateType !== TemplateType.message; } this.animationCollection = this.animationCollection.filter(id => { delete this.animationCollectionOffset[templateId]; return id !== templateId; }); } this.animationStart(); }, animationStart() { if (this.animationCollection.length > 0) { return false; } let body = this.$refs.body; if (this.animationType === AnimationType.leave) { let newScrollPosition = 0; // fix for chrome dom rendering: while delete node, scroll change immediately if (body.scrollTop !== this.animationScrollTop + this.animationScrollChange) { newScrollPosition = this.animationScrollTop + this.animationScrollChange } else { newScrollPosition = body.scrollTop; } // fix position if last element the same type of new element if (!this.animationScrollLastIsDelimeter) { newScrollPosition += this.templateMessageWithNameDifferent; } if (newScrollPosition !== body.scrollTop) { Utils.scrollToPosition(this, newScrollPosition); } } else if (this.animationType === AnimationType.mixed) { let unreadId = Utils.getFirstUnreadMessage(this.collection); if (unreadId) { Utils.scrollToFirstUnreadMessage(this, this.collection, unreadId, true); } } this.animationType = AnimationType.none; this.animationScrollHeightStart = 0; this.animationScrollHeightEnd = 0; this.animationScrollTop = 0; this.animationScrollChange = 0; if (Utils.scrollByMutationType(this)) { return false; } if (this.scrollChangedByUser) { console.warn('Animation canceled: scroll changed by user'); return false; } if (this.unreadCounter > 0 && this.firstUnreadMessageId) { if (this.skipUnreadScroll) { this.skipUnreadScroll = false; return; } Utils.scrollToFirstUnreadMessage(this, this.collection, this.firstUnreadMessageId); return; } this.scrollTo(() => { if (this.unreadCounter <= 0 && this.messageExtraCount) { this.$store.commit('application/clearDialogExtraCount'); } }); }, }, directives: { 'bx-messenger-dialog-observer': { inserted(element, bindings, vnode) { if (bindings.value === ObserverType.none) { return false; } if (!vnode.context.observers[bindings.value]) { vnode.context.observers[bindings.value] = Utils.getMessageLoaderObserver({ type: bindings.value, context: vnode.context }); } vnode.context.observers[bindings.value].observe(element); return true; }, unbind(element, bindings, vnode) { if (bindings.value === ObserverType.none) { return true; } if (vnode.context.observers[bindings.value]) { vnode.context.observers[bindings.value].unobserve(element); } return true; } }, }, template: ` <div class="bx-im-dialog" @click="onDialogClick" @touchmove="onDialogMove" ref="container"> <div :class="[DialogReferenceClassName.listBody, { 'bx-im-dialog-list-scroll-blocked': scrollBlocked, 'bx-im-dialog-dark-background': isDarkBackground, 'bx-im-dialog-mobile': isMobile, }]" @scroll.passive="onScroll" ref="body"> <template v-if="historyLoaderShow"> <div class="bx-im-dialog-load-more bx-im-dialog-load-more-history" v-bx-messenger-dialog-observer="ObserverType.history"> <span class="bx-im-dialog-load-more-text">{{ localize.IM_MESSENGER_DIALOG_LOAD_MESSAGES }}</span> </div> </template> <transition-group tag="div" class="bx-im-dialog-list-box" name="bx-im-dialog-message-animation" @before-enter="animationTrigger(AnimationType.enter, true, $event)" @after-enter="animationTrigger(AnimationType.enter, false, $event)" @before-leave="animationTrigger(AnimationType.leave, true, $event)" @after-leave="animationTrigger(AnimationType.leave, false, $event)" > <template v-for="element in elementsWithLimit"> <template v-if="element.templateType == TemplateType.message"> <div :class="['bx-im-dialog-list-item', DialogReferenceClassName.listItem, DialogReferenceClassName.listItem+'-'+element.id]" :data-message-id="element.id" :data-template-id="element.templateId" :data-type="element.templateType" :key="element.templateId" v-bx-messenger-dialog-observer="element.unread? ObserverType.read: ObserverType.none"> <component :is="element.params.COMPONENT_ID" :userId="userId" :dialogId="dialogId" :chatId="chatId" :dialog="dialog" :message="element" :enableReactions="enableReactions" :enableDateActions="enableDateActions" :enableCreateContent="showMessageMenu" :enableGestureQuote="enableGestureQuote" :enableGestureQuoteFromRight="enableGestureQuoteFromRight" :enableGestureMenu="enableGestureMenu" :showName="showMessageUserName" :showAvatar="showMessageAvatar" :showMenu="showMessageMenu" :capturedMoveEvent="capturedMoveEvent" :referenceContentClassName="DialogReferenceClassName.listItem" :referenceContentBodyClassName="DialogReferenceClassName.listItemBody" :referenceContentNameClassName="DialogReferenceClassName.listItemName" @clickByUserName="onClickByUserName" @clickByUploadCancel="onClickByUploadCancel" @clickByKeyboardButton="onClickByKeyboardButton" @clickByChatTeaser="onClickByChatTeaser" @clickByMessageMenu="onClickByMessageMenu" @clickByMessageRetry="onClickByMessageRetry" @setMessageReaction="onMessageReactionSet" @openMessageReactionList="onMessageReactionListOpen" @dragMessage="onDragMessage" @quoteMessage="onQuoteMessage" /> </div> </template> <template v-else-if="element.templateType == TemplateType.group"> <div class="bx-im-dialog-group" :data-template-id="element.templateId" :data-type="element.templateType" :key="element.templateId"> <div class="bx-im-dialog-group-date">{{ element.text }}</div> </div> </template> <template v-else-if="element.templateType == TemplateType.delimiter"> <div class="bx-im-dialog-delimiter" :data-template-id="element.templateId" :data-type="element.templateType" :key="element.templateId"></div> </template> </template> </transition-group> <template v-if="unreadLoaderShow"> <div :class="['bx-im-dialog-load-more', 'bx-im-dialog-load-more-unread', DialogReferenceClassName.listUnreadLoader]" v-bx-messenger-dialog-observer="ObserverType.unread"> <span class="bx-im-dialog-load-more-text">{{ localize.IM_MESSENGER_DIALOG_LOAD_MESSAGES }}</span> </div> </template> <transition name="bx-im-dialog-status"> <template v-if="statusWriting"> <div class="bx-im-dialog-status"> <span class="bx-im-dialog-status-writing"></span> {{ statusWriting }} </div> </template> <template v-else-if="statusReaded"> <div class="bx-im-dialog-status" @click="onClickByReadedList"> {{ statusReaded }} </div> </template> </transition> </div> <transition name="bx-im-dialog-scroll-button"> <div v-show="showScrollButton || unreadLoaderShow && unreadCounter" class="bx-im-dialog-scroll-button-box" @click="scrollToBottom()"> <div class="bx-im-dialog-scroll-button"> <div v-show="unreadCounter" class="bx-im-dialog-scroll-button-counter"> <div class="bx-im-dialog-scroll-button-counter-digit">{{unreadCounter}}</div> </div> <div class="bx-im-dialog-scroll-button-arrow"></div> </div> </div> </transition> </div> ` }); const Utils = { getDateFormat(date) { return date.toJSON().slice(0,10); }, scrollToMessage(context, collection, messageId = 0, force = false, stickToTop = true) { let body = context.$refs.body; let element = body.getElementsByClassName(DialogReferenceClassName.listItem+'-'+messageId)[0]; let end = 0; if (!element) { if (stickToTop) { end = 10; } else { end = body.scrollHeight - body.clientHeight; } } else if (stickToTop) { end = element.offsetTop - (context.templateMessageScrollOffset/2); } else { end = element.offsetTop + element.offsetHeight - body.clientHeight + (context.templateMessageScrollOffset/2); } if (force) { this.scrollToPosition(context, end); } else { context.scrollTo({end}); } return true; }, getFirstUnreadMessage(collection) { let unreadId = null; for (let index = collection.length-1; index >= 0; index--) { if (!collection[index].unread) { break; } unreadId = collection[index].id; } return unreadId; }, scrollToPosition(context, position) { let body = context.$refs.body; if (!body) { return false; } if (context.animateScrollId) { Animation.cancel(context.animateScrollId); this.scrollAnimating = false; context.animateScrollId = null; } body.scrollTop = position; }, scrollByMutationType(context) { if ( context.collectionMutationType.applied || context.collectionMutationType.initialType !== MutationType.set) { return false; } context.$store.dispatch('messages/applyMutationType', {chatId: context.chatId}); if (context.collectionMutationType.appliedType === MutationType.setBefore) { let body = context.$refs.body; this.scrollToPosition(context, body.scrollHeight - body.clientHeight); return true; } if (context.collectionMutationType.scrollMessageId > 0) { let unreadId = Utils.getFirstUnreadMessage(context.collection); let toMessageId = context.collectionMutationType.scrollMessageId; let force = !context.collectionMutationType.scrollStickToTop; let stickToTop = context.collectionMutationType.scrollStickToTop; if (unreadId && toMessageId > unreadId) { stickToTop = true; force = true; toMessageId = unreadId; unreadId = null; } Utils.scrollToMessage(context, context.collection, toMessageId, force, stickToTop); if (unreadId) { Utils.scrollToMessage(context, context.collection, unreadId); return true; } } return false; }, scrollToFirstUnreadMessage(context, collection, unreadId = null, force = false) { let body = context.$refs.body; let element = false; if (unreadId !== null) { element = body.getElementsByClassName(DialogReferenceClassName.listItem+'-'+unreadId)[0]; } if (!element) { unreadId = this.getFirstUnreadMessage(collection); } this.scrollToMessage(context, collection, unreadId, force); }, scrollToElementAfterLoadHistory(context, element) { let elementBody = element.getElementsByClassName(DialogReferenceClassName.listItemBody)[0]; if (elementBody) { element = elementBody; } let previousOffsetTop = element.getBoundingClientRect().top; context.$nextTick(() => { clearTimeout(context.waitLoadHistoryTimeout); context.waitLoadHistoryTimeout = setTimeout(() => { context.waitLoadHistory = false; }, 1000); if (!element) { return false; } this.scrollToPosition(context, element.getBoundingClientRect().top - previousOffsetTop); }); }, scrollToElementAfterLoadUnread(context, firstMessageId = 0) { context.showScrollButton = true; if (firstMessageId) { this.scrollToMessage(context, context.collection, firstMessageId, false, false); } }, getMessageLoaderObserver(config) { if ( typeof window.IntersectionObserver === 'undefined' || config.value === ObserverType.none ) { return { observe: () => {}, unobserve: () => {} }; } let observerCallback, observerOptions; if (config.type === ObserverType.read) { observerCallback = function (entries, observer) { entries.forEach(function(entry) { let sendReadEvent = false; if (entry.isIntersecting) { if (entry.intersectionRatio >= 1) { sendReadEvent = true; } else if ( entry.intersectionRatio > 0 && entry.rootBounds.height < entry.boundingClientRect.height + 20 && entry.intersectionRect.height > entry.rootBounds.height / 2 ) { sendReadEvent = true; } } if (sendReadEvent) { config.context.readMessageQueue.push(entry.target.dataset.messageId); config.context.readMessageTarget[entry.target.dataset.messageId] = entry.target; } else { config.context.readMessageQueue = config.context.readMessageQueue.filter(messageId => messageId !== entry.target.dataset.messageId); delete config.context.readMessageTarget[entry.target.dataset.messageId]; } if (config.context.enableReadMessages) { config.context.readMessageDelayed(); } }); }; observerOptions = { root: config.context.$refs.body, threshold: new Array(101).fill(0).map((zero, index) => index * 0.01) }; } else { observerCallback = function (entries, observer) { entries.forEach(function(entry) { if (entry.isIntersecting) { if (config.type === ObserverType.unread) { config.context.requestUnreadBlockIntersect = true; config.context.requestUnreadDelayed(); } else { config.context.requestHistoryBlockIntersect = true; config.context.requestHistoryDelayed(); } } else { if (config.type === ObserverType.unread) { config.context.requestUnreadBlockIntersect = false; } else { config.context.requestHistoryBlockIntersect = false; } } }); }; observerOptions = { root: config.context.$refs.body, threshold: [0, 0.01, 0.99, 1] }; } return new IntersectionObserver(observerCallback, observerOptions); } }; const Blocks = { getDelimiter(id = 0) { return { templateId: 'delimiter'+id, templateType: TemplateType.delimiter }; }, getGroup(id = 0, text = '') { return { templateId: 'group'+id, templateType: TemplateType.group, text: text }; }, getHistoryLoader() { return { templateId: 'historyLoader', templateType: TemplateType.historyLoader, }; }, getUnreadLoader() { return { templateId: 'unreadLoader', templateType: TemplateType.unreadLoader, }; }, getLoadButton(id = 0, text = '', type = LoadButtonTypes.before) { return { templateId: 'loadButton'+id+type, templateType: TemplateType.button, text: text, type: type, messageId: id }; } }; src/component.css000066400000011674147744135340010076 0ustar00/* GENERAL */ .bx-mobilechat-wrapper { display: block; width: 100%; height: 300px; overflow: hidden; } .bx-mobilechat-box { display: flex; flex-direction: column; flex-wrap: nowrap; height: 100%; overflow: hidden; -webkit-overflow-scrolling: touch; } .bx-mobilechat-body { position: relative; display: flex; flex-grow: 1; flex-shrink: 1; flex-wrap: wrap; align-items: center; overflow: hidden; -webkit-overflow-scrolling: touch; } .bx-mobilechat-body { padding-top: constant(safe-area-inset-top); padding-bottom: constant(safe-area-inset-bottom); padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); box-sizing: border-box; } .bx-im-quote-panel, .bx-mobilechat-dialog { padding-right: constant(safe-area-inset-right); padding-left: constant(safe-area-inset-left); padding-right: env(safe-area-inset-right); padding-left: env(safe-area-inset-left); box-sizing: border-box; } .bx-mobilechat-body .bx-im-dialog { position: relative; } .bx-mobilechat-help-container { margin: 0 auto; } .bx-mobilechat-help-container .bx-mobilechat-help-title-sm { display: none; } .bx-mobilechat-help-title { display: block; margin: 0 0 29px 0; font: 300 26px 'OpenSans-Regular', "Helvetica Neue", Arial, Helvetica, sans-serif; color: #333; text-align: center; opacity: .6; width: 100%; } .bx-mobilechat-box-dark-background .bx-mobilechat-help-title { color: #949494; } .bx-mobilechat-help-title-lg { font: 200 26px 'OpenSans-Regular', "Helvetica Neue", Arial, Helvetica, sans-serif; letter-spacing: -.27px; } .bx-mobilechat-help-title-md { font: 200 24px 'OpenSans-Regular', "Helvetica Neue", Arial, Helvetica, sans-serif; letter-spacing: -.25px; } .bx-mobilechat-help-title-sm { font: 200 20px/27px 'OpenSans-Regular', "Helvetica Neue", Arial, Helvetica, sans-serif; letter-spacing: -.21px; } .bx-mobilechat-help-subtitle { font: 14px 'OpenSans-Regular', "Helvetica Neue", Arial, Helvetica, sans-serif; } .bx-mobilechat-chat-start .bx-mobilechat-body { flex-direction: column; flex-wrap: nowrap; overflow: hidden; justify-content: center; } .bx-mobilechat-chat-start .bx-mobilechat-body-with-message { justify-content: flex-end; } .bx-mobilechat-dialog { position: relative; display: flex; flex-direction: column; flex-wrap: nowrap; width: 100%; overflow: hidden; -webkit-animation: bx-mobilechat-dialog-opacity .2s ease-in-out; animation: bx-mobilechat-dialog-opacity .2s ease-in-out; } /* END OF CHAT */ /* END OF BODY */ /* MEDIAQUERIES */ .bx-mobilechat-mobile.bx-mobilechat-wrapper { position: fixed; left: 0; bottom: 0; width: 100%; height: 100%; } /* END OF MEDIAQUERIES */ /* LOADER */ .bx-mobilechat-loading-window { display: flex; flex-direction: column; align-items: center; margin: 0 auto; } .bx-mobilechat-loading-circular { margin: 0 0 53px 0; height: 80px; width: 80px; -webkit-animation: bx-mobilechat-loading-rotate 2s linear infinite; animation: bx-mobilechat-loading-rotate 2s linear infinite; -webkit-transform-origin: center center; transform-origin: center center; } .bx-mobilechat-loading-inner-path { stroke: rgba(215,220,223,.17); stroke-width: 1.5; stroke-dasharray: 200, 200; stroke-dashoffset: 0; stroke-linecap: round; } .bx-mobilechat-loading-path { stroke: rgba(215,220,223,.74); stroke-width: 1.5; stroke-dasharray: 20, 200; stroke-dashoffset: 0; -webkit-animation: bx-mobilechat-loading-dash 1.5s ease-in-out infinite; animation: bx-mobilechat-loading-dash 1.5s ease-in-out infinite; stroke-linecap: round; } .bx-mobilechat-loading-msg { margin: 0; } /* END OF LOADER */ /* WARNING */ .bx-mobilechat-warning-window { display: flex; flex-direction: column; align-items: center; margin: 0 auto; max-width: 290px; } .bx-mobilechat-warning-icon { display: block; margin: 0 0 26px 0; width: 53px; height: 48px; background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2255%22%20height%3D%2248%22%3E%3Cg%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20transform%3D%22translate%28.805%20.74%29%22%3E%3Cpath%20stroke%3D%22%23A8ADB4%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20stroke-width%3D%221.7%22%20d%3D%22M26.688.27L52.64%2045.685H.737z%22/%3E%3Cpath%20fill%3D%22%23A8ADB4%22%20d%3D%22M25.546%2015.714h2.283v16.625h-2.283z%22/%3E%3Ccircle%20cx%3D%2226.688%22%20cy%3D%2236.771%22%20r%3D%221.478%22%20fill%3D%22%23A8ADB4%22/%3E%3C/g%3E%3C/svg%3E'); background-repeat: no-repeat; } .bx-mobilechat-warning-msg { opacity: .9; } .bx-mobilechat-warning-msg > a { color: #000; } /* END OF WARNING */ @keyframes bx-mobilechat-loading-rotate { 100% { transform: rotate(360deg); } } @keyframes bx-mobilechat-loading-dash { 0% { stroke-dasharray: 1, 200; stroke-dashoffset: 0; } 50% { stroke-dasharray: 89, 200; stroke-dashoffset: -35px; } 100% { stroke-dasharray: 89, 200; stroke-dashoffset: -124px; } } @keyframes bx-mobilechat-dialog-opacity { from { opacity: 0; } to { opacity: 1; } }dist/dialog.bundle.js.map000066400000104720147744135340011352 0ustar00{"version":3,"file":"dialog.bundle.js","sources":["../src/component.js"],"sourcesContent":["/**\n * Bitrix im dialog mobile\n * Dialog vue component\n *\n * @package bitrix\n * @subpackage mobile\n * @copyright 2001-2019 Bitrix\n */\n\nimport {Vue} from \"ui.vue\";\nimport {Vuex} from \"ui.vue.vuex\";\nimport {Logger} from \"im.lib.logger\";\nimport {EventType, RestMethodHandler, RestMethod} from \"im.const\";\nimport {Utils} from \"im.lib.utils\";\nimport \"im.view.dialog\";\nimport \"im.view.quotepanel\";\n\nimport \"./component.css\";\n\n/**\n * @notice Do not mutate or clone this component! It is under development.\n */\nVue.component('bx-im-component-dialog',\n{\n\tprops:\n\t{\n\t\tchatId: { default: 0 },\n\t\tuserId: { default: 0 },\n\t\tdialogId: { default: 0 },\n\t\tenableGestureQuote: { default: true },\n\t\tenableGestureQuoteFromRight: { default: true },\n\t\tenableGestureMenu: { default: false },\n\t\tshowMessageUserName: { default: true },\n\t\tshowMessageAvatar: { default: true },\n\t},\n\tdata: function()\n\t{\n\t\treturn {\n\t\t\tdialogState: 'loading',\n\t\t\tdialogDiskFolderId: 0,\n\t\t\tdialogChatId: 0\n\t\t};\n\t},\n\tcreated: function()\n\t{\n\t\tthis.requestData();\n\t},\n\twatch:\n\t{\n\t\tdialogId()\n\t\t{\n\t\t\tthis.requestData();\n\t\t}\n\t},\n\tcomputed:\n\t{\n\t\tEventType: () => EventType,\n\t\tlocalize()\n\t\t{\n\t\t\treturn Object.assign({},\n\t\t\t\tVue.getFilteredPhrases('MOBILE_CHAT_', this.$root.$bitrixMessages),\n\t\t\t\tVue.getFilteredPhrases('IM_UTILS_', this.$root.$bitrixMessages),\n\t\t\t);\n\t\t},\n\t\twidgetClassName(state)\n\t\t{\n\t\t\tlet className = ['bx-mobilechat-wrapper'];\n\n\t\t\tif (this.showMessageDialog)\n\t\t\t{\n\t\t\t\tclassName.push('bx-mobilechat-chat-start');\n\t\t\t}\n\n\t\t\treturn className.join(' ');\n\t\t},\n\t\tquotePanelData()\n\t\t{\n\t\t\tlet result = {\n\t\t\t\tid: 0,\n\t\t\t\ttitle: '',\n\t\t\t\tdescription: '',\n\t\t\t\tcolor: ''\n\t\t\t};\n\n\t\t\tif (!this.showMessageDialog || !this.dialog.quoteId)\n\t\t\t{\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tlet message = this.$store.getters['messages/getMessage'](this.dialog.chatId, this.dialog.quoteId);\n\t\t\tif (!message)\n\t\t\t{\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tlet user = this.$store.getters['users/get'](message.authorId);\n\t\t\tlet files = this.$store.getters['files/getList'](this.dialog.chatId);\n\n\t\t\treturn {\n\t\t\t\tid: this.dialog.quoteId,\n\t\t\t\ttitle: message.params.NAME ? message.params.NAME : (user ? user.name: ''),\n\t\t\t\tcolor: user? user.color: '',\n\t\t\t\tdescription: Utils.text.purify(message.text, message.params, files, this.localize)\n\t\t\t};\n\t\t},\n\n\t\tisDialog()\n\t\t{\n\t\t\treturn Utils.dialog.isChatId(this.dialog.dialogId);\n\t\t},\n\n\t\tisGestureQuoteSupported()\n\t\t{\n\t\t\treturn false;\n\t\t},\n\t\tisDarkBackground()\n\t\t{\n\t\t\treturn this.application.options.darkBackground;\n\t\t},\n\t\tshowMessageDialog()\n\t\t{\n\t\t\tlet result = this.messageCollection && this.messageCollection.length > 0;\n\t\t\tif (result)\n\t\t\t{\n\t\t\t\tthis.dialogState = 'show';\n\t\t\t}\n\t\t\telse if (this.dialog && this.dialog.init)\n\t\t\t{\n\t\t\t\tthis.dialogState = 'empty';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis.dialogState = 'loading';\n\t\t\t}\n\n\t\t\treturn result;\n\t\t},\n\t\t...Vuex.mapState({\n\t\t\tapplication: state => state.application,\n\t\t\tdialog: state => state.dialogues.collection[state.application.dialog.dialogId],\n\t\t\tmessageCollection: state => state.messages.collection[state.application.dialog.chatId]\n\t\t})\n\t},\n\tmethods:\n\t{\n\t\trequestData()\n\t\t{\n\t\t\tconsole.log('4. requestData');\n\n\t\t\t//this.requestDataSend = true;\n\n\t\t\tlet query = {\n\t\t\t\t[RestMethodHandler.mobileBrowserConstGet]: [RestMethod.mobileBrowserConstGet, {}],\n\t\t\t\t[RestMethodHandler.imChatGet]: [RestMethod.imChatGet, {dialog_id: this.dialogId}],\n\t\t\t\t[RestMethodHandler.imDialogMessagesGetInit]: [RestMethod.imDialogMessagesGet, {\n\t\t\t\t\tdialog_id: this.dialogId,\n\t\t\t\t\tlimit: this.$root.$bitrixController.application.getRequestMessageLimit(),\n\t\t\t\t\tconvert_text: 'Y'\n\t\t\t\t}],\n\t\t\t};\n\t\t\tif (Utils.dialog.isChatId(this.dialogId))\n\t\t\t{\n\t\t\t\tquery[RestMethodHandler.imUserGet] = [RestMethod.imUserGet, {}];\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tquery[RestMethodHandler.imUserListGet] = [RestMethod.imUserListGet, {id: [this.userId, this.dialogId]}];\n\t\t\t}\n\n\t\t\tthis.$root.$bitrixController.restClient.callBatch(query, (response) =>\n\t\t\t{\n\t\t\t\tif (!response)\n\t\t\t\t{\n\t\t\t\t\t//this.requestDataSend = false;\n\t\t\t\t\t//this.setError('EMPTY_RESPONSE', 'Server returned an empty response.');\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tlet constGet = response[RestMethodHandler.mobileBrowserConstGet];\n\t\t\t\tif (constGet.error())\n\t\t\t\t{\n\t\t\t\t\t// this.setError(constGet.error().ex.error, constGet.error().ex.error_description);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis.$root.$bitrixController.executeRestAnswer(RestMethodHandler.mobileBrowserConstGet, constGet);\n\t\t\t\t}\n\n\t\t\t\tlet userGet = response[RestMethodHandler.imUserGet];\n\t\t\t\tif (userGet && !userGet.error())\n\t\t\t\t{\n\t\t\t\t\tthis.$root.$bitrixController.executeRestAnswer(RestMethodHandler.imUserGet, userGet);\n\t\t\t\t}\n\n\t\t\t\tlet userListGet = response[RestMethodHandler.imUserListGet];\n\t\t\t\tif (userListGet && !userListGet.error())\n\t\t\t\t{\n\t\t\t\t\tthis.$root.$bitrixController.executeRestAnswer(RestMethodHandler.imUserListGet, userListGet);\n\t\t\t\t}\n\n\t\t\t\tlet chatGetResult = response[RestMethodHandler.imChatGet];\n\t\t\t\tif (!chatGetResult.error())\n\t\t\t\t{\n\t\t\t\t\tthis.dialogChatId = chatGetResult.data().id;\n\t\t\t\t\tthis.dialogDiskFolderId = chatGetResult.data().disk_folder_id;\n\t\t\t\t}\n\n\t\t\t\t// TODO imChatGet\n\t\t\t\tthis.$root.$bitrixController.executeRestAnswer(RestMethodHandler.imChatGet, chatGetResult);\n\n\t\t\t\tlet dialogMessagesGetResult = response[RestMethodHandler.imDialogMessagesGetInit];\n\t\t\t\tif (dialogMessagesGetResult.error())\n\t\t\t\t{\n\t\t\t\t\t//this.setError(dialogMessagesGetResult.error().ex.error, dialogMessagesGetResult.error().ex.error_description);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t//this.timer.stop('data', 'load', true);\n\n\t\t\t\t\t// this.$root.$bitrixController.getStore().dispatch('dialogues/saveDialog', {\n\t\t\t\t\t// \tdialogId: this.$root.$bitrixController.application.getDialogId(),\n\t\t\t\t\t// \tchatId: this.$root.$bitrixController.application.getChatId(),\n\t\t\t\t\t// });\n\n\t\t\t\t\tif (this.$root.$bitrixController.pullCommandHandler)\n\t\t\t\t\t{\n\t\t\t\t\t\t//this.$root.$bitrixController.pullCommandHandler.option.skip = false;\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.$root.$bitrixController.getStore().dispatch('application/set', {dialog: {\n\t\t\t\t\t\tenableReadMessages: true\n\t\t\t\t\t}}).then(() => {\n\t\t\t\t\t\tthis.$root.$bitrixController.executeRestAnswer(RestMethodHandler.imDialogMessagesGetInit, dialogMessagesGetResult);\n\t\t\t\t\t});\n\n\t\t\t\t\t//this.processSendMessages();\n\t\t\t\t}\n\n\t\t\t\t//this.requestDataSend = false;\n\t\t\t}, false, false, Utils.getLogTrackingParams({name: 'im.dialog', dialog: this.$root.$bitrixController.application.getDialogData()}));\n\n\t\t\treturn new Promise((resolve, reject) => resolve());\n\t\t},\n\n\t\tgetDialogHistory(lastId, limit = this.$root.$bitrixController.application.getRequestMessageLimit())\n\t\t{\n\t\t\tthis.$root.$bitrixController.restClient.callMethod(RestMethod.imDialogMessagesGet, {\n\t\t\t\t'CHAT_ID': this.dialogChatId,\n\t\t\t\t'LAST_ID': lastId,\n\t\t\t\t'LIMIT': limit,\n\t\t\t\t'CONVERT_TEXT': 'Y'\n\t\t\t}).then(result => {\n\t\t\t\tthis.$root.$bitrixController.executeRestAnswer(RestMethodHandler.imDialogMessagesGet, result);\n\t\t\t\tthis.$root.$emit(EventType.dialog.requestHistoryResult, {count: result.data().messages.length});\n\t\t\t}).catch(result => {\n\t\t\t\tthis.$root.$emit(EventType.dialog.requestHistoryResult, {error: result.error().ex});\n\t\t\t});\n\t\t},\n\n\t\tgetDialogUnread(lastId, limit = this.$root.$bitrixController.application.getRequestMessageLimit())\n\t\t{\n\t\t\tif (this.promiseGetDialogUnreadWait)\n\t\t\t{\n\t\t\t\treturn this.promiseGetDialogUnread;\n\t\t\t}\n\n\t\t\tthis.promiseGetDialogUnread = new BX.Promise();\n\t\t\tthis.promiseGetDialogUnreadWait = true;\n\n\t\t\tif (!lastId)\n\t\t\t{\n\t\t\t\tlastId = this.$root.$bitrixController.getStore().getters['messages/getLastId'](this.dialogChatId);\n\t\t\t}\n\n\t\t\tif (!lastId)\n\t\t\t{\n\t\t\t\tthis.$root.$emit(EventType.dialog.requestUnreadResult, {error: {error: 'LAST_ID_EMPTY', error_description: 'LastId is empty.'}});\n\n\t\t\t\tthis.promiseGetDialogUnread.reject();\n\t\t\t\tthis.promiseGetDialogUnreadWait = false;\n\n\t\t\t\treturn this.promiseGetDialogUnread;\n\t\t\t}\n\n\t\t\tthis.$root.$bitrixController.application.readMessage(lastId, true, true).then(() =>\n\t\t\t{\n\t\t\t\t// this.timer.start('data', 'load', .5, () => {\n\t\t\t\t// \tconsole.warn(\"ChatDialog.requestData: slow connection show progress icon\");\n\t\t\t\t// \tapp.titleAction(\"setParams\", {useProgress: true, useLetterImage: false});\n\t\t\t\t// });\n\n\t\t\t\tlet query = {\n\t\t\t\t\t[RestMethodHandler.imDialogRead]: [RestMethod.imDialogRead, {\n\t\t\t\t\t\tdialog_id: this.dialogId,\n\t\t\t\t\t\tmessage_id: lastId\n\t\t\t\t\t}],\n\t\t\t\t\t[RestMethodHandler.imChatGet]: [RestMethod.imChatGet, {\n\t\t\t\t\t\tdialog_id: this.dialogId\n\t\t\t\t\t}],\n\t\t\t\t\t[RestMethodHandler.imDialogMessagesGetUnread]: [RestMethod.imDialogMessagesGet, {\n\t\t\t\t\t\tchat_id: this.dialogChatId,\n\t\t\t\t\t\tfirst_id: lastId,\n\t\t\t\t\t\tlimit: limit,\n\t\t\t\t\t\tconvert_text: 'Y'\n\t\t\t\t\t}]\n\t\t\t\t};\n\n\t\t\t\tthis.$root.$bitrixController.restClient.callBatch(query, (response) =>\n\t\t\t\t{\n\t\t\t\t\tif (!response)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.$root.$emit(EventType.dialog.requestUnreadResult, {error: {error: 'EMPTY_RESPONSE', error_description: 'Server returned an empty response.'}});\n\n\t\t\t\t\t\tthis.promiseGetDialogUnread.reject();\n\t\t\t\t\t\tthis.promiseGetDialogUnreadWait = false;\n\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\n\t\t\t\t\tlet chatGetResult = response[RestMethodHandler.imChatGet];\n\t\t\t\t\tif (!chatGetResult.error())\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.$root.$bitrixController.executeRestAnswer(RestMethodHandler.imChatGet, chatGetResult);\n\t\t\t\t\t}\n\n\t\t\t\t\tlet dialogMessageUnread = response[RestMethodHandler.imDialogMessagesGetUnread];\n\t\t\t\t\tif (dialogMessageUnread.error())\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.$root.$emit(EventType.dialog.requestUnreadResult, {error: dialogMessageUnread.error().ex});\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.$root.$bitrixController.executeRestAnswer(RestMethodHandler.imDialogMessagesGetUnread, dialogMessageUnread);\n\n\t\t\t\t\t\tthis.$root.$emit(EventType.dialog.requestUnreadResult, {\n\t\t\t\t\t\t\tfirstMessageId: dialogMessageUnread.data().messages.length > 0? dialogMessageUnread.data().messages[0].id: 0,\n\t\t\t\t\t\t\tcount: dialogMessageUnread.data().messages.length\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\t//app.titleAction(\"setParams\", {useProgress: false, useLetterImage: true});\n\t\t\t\t\t\t//this.timer.stop('data', 'load', true);\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.promiseGetDialogUnread.fulfill(response);\n\t\t\t\t\tthis.promiseGetDialogUnreadWait = false;\n\n\t\t\t\t}, false, false, Utils.getLogTrackingParams({name: RestMethodHandler.imDialogMessagesGetUnread, dialog: this.$root.$bitrixController.application.getDialogData()}));\n\t\t\t});\n\n\t\t\treturn this.promiseGetDialogUnread;\n\t\t},\n\n\n\n\n\t\tlogEvent(name, ...params)\n\t\t{\n\t\t\tLogger.info(name, ...params);\n\t\t},\n\t\tonDialogRequestHistory(event)\n\t\t{\n\t\t\tthis.getDialogHistory(event.lastId);\n\t\t},\n\n\t\tonDialogRequestUnread(event)\n\t\t{\n\t\t\tthis.getDialogUnread(event.lastId);\n\t\t},\n\t\tonDialogMessageClickByUserName(event)\n\t\t{\n\t\t\tthis.$root.$bitrixController.application.replyToUser(event.user.id, event.user);\n\t\t},\n\t\tonDialogMessageClickByUploadCancel(event)\n\t\t{\n\t\t\tthis.$root.$bitrixController.application.cancelUploadFile(event.file.id);\n\t\t},\n\t\tonDialogMessageClickByCommand(event)\n\t\t{\n\t\t\tif (event.type === 'put')\n\t\t\t{\n\t\t\t\tthis.$root.$bitrixController.application.insertText({text: event.value+' '});\n\t\t\t}\n\t\t\telse if (event.type === 'send')\n\t\t\t{\n\t\t\t\tthis.$root.$bitrixController.application.addMessage(event.value);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tLogger.warn('Unprocessed command', event);\n\t\t\t}\n\t\t},\n\t\tonDialogMessageClickByMention(event)\n\t\t{\n\t\t\tif (event.type === 'USER')\n\t\t\t{\n\t\t\t\tthis.$root.$bitrixController.application.openProfile(event.value);\n\t\t\t}\n\t\t\telse if (event.type === 'CHAT')\n\t\t\t{\n\t\t\t\tthis.$root.$bitrixController.application.openDialog(event.value);\n\t\t\t}\n\t\t\telse if (event.type === 'CALL')\n\t\t\t{\n\t\t\t\tthis.$root.$bitrixController.application.openPhoneMenu(event.value);\n\t\t\t}\n\t\t},\n\t\tonDialogMessageMenuClick(event)\n\t\t{\n\t\t\tLogger.warn('Message menu:', event);\n\t\t\tthis.$root.$bitrixController.application.openMessageMenu(event.message);\n\t\t},\n\t\tonDialogMessageRetryClick(event)\n\t\t{\n\t\t\tLogger.warn('Message retry:', event);\n\t\t\tthis.$root.$bitrixController.application.retrySendMessage(event.message);\n\t\t},\n\t\tonDialogReadMessage(event)\n\t\t{\n\t\t\tthis.$root.$bitrixController.application.readMessage(event.id);\n\t\t},\n\t\tonDialogReadedListClick(event)\n\t\t{\n\t\t\tthis.$root.$bitrixController.application.openReadedList(event.list);\n\t\t},\n\t\tonDialogQuoteMessage(event)\n\t\t{\n\t\t\tthis.$root.$bitrixController.application.quoteMessage(event.message.id);\n\t\t},\n\t\tonDialogMessageReactionSet(event)\n\t\t{\n\t\t\tthis.$root.$bitrixController.application.reactMessage(event.message.id, event.reaction);\n\t\t},\n\t\tonDialogMessageReactionListOpen(event)\n\t\t{\n\t\t\tthis.$root.$bitrixController.application.openMessageReactionList(event.message.id, event.values);\n\t\t},\n\t\tonDialogMessageClickByKeyboardButton(event)\n\t\t{\n\t\t\tthis.$root.$bitrixController.application.execMessageKeyboardCommand(event);\n\t\t},\n\t\tonDialogMessageClickByChatTeaser(event)\n\t\t{\n\t\t\tthis.$root.$bitrixController.application.execMessageOpenChatTeaser(event);\n\t\t},\n\t\tonDialogClick(event)\n\t\t{\n\t\t},\n\t\tonQuotePanelClose()\n\t\t{\n\t\t\tthis.$root.$bitrixController.quoteMessageClear();\n\t\t},\n\n\t},\n\ttemplate: `\n\t\t<div :class=\"widgetClassName\">\n\t\t\t<div :class=\"['bx-mobilechat-box', {'bx-mobilechat-box-dark-background': isDarkBackground}]\">\n\t\t\t\t<template v-if=\"application.error.active\">\n\t\t\t\t\t<div class=\"bx-mobilechat-body\">\n\t\t\t\t\t\t<div class=\"bx-mobilechat-warning-window\">\n\t\t\t\t\t\t\t<div class=\"bx-mobilechat-warning-icon\"></div>\n\t\t\t\t\t\t\t<template v-if=\"application.error.description\"> \n\t\t\t\t\t\t\t\t<div class=\"bx-mobilechat-help-title bx-mobilechat-help-title-sm bx-mobilechat-warning-msg\" v-html=\"application.error.description\"></div>\n\t\t\t\t\t\t\t</template> \n\t\t\t\t\t\t\t<template v-else>\n\t\t\t\t\t\t\t\t<div class=\"bx-mobilechat-help-title bx-mobilechat-help-title-md bx-mobilechat-warning-msg\">{{localize.MOBILE_CHAT_ERROR_TITLE}}</div>\n\t\t\t\t\t\t\t\t<div class=\"bx-mobilechat-help-title bx-mobilechat-help-title-sm bx-mobilechat-warning-msg\">{{localize.MOBILE_CHAT_ERROR_DESC}}</div>\n\t\t\t\t\t\t\t</template> \n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</template>\t\t\t\n\t\t\t\t<template v-else>\n\t\t\t\t\t<div :class=\"['bx-mobilechat-body', {'bx-mobilechat-body-with-message': dialogState == 'show'}]\" key=\"with-message\">\n\t\t\t\t\t\t<template v-if=\"dialogState == 'loading'\">\n\t\t\t\t\t\t\t<div class=\"bx-mobilechat-loading-window\">\n\t\t\t\t\t\t\t\t<svg class=\"bx-mobilechat-loading-circular\" viewBox=\"25 25 50 50\">\n\t\t\t\t\t\t\t\t\t<circle class=\"bx-mobilechat-loading-path\" cx=\"50\" cy=\"50\" r=\"20\" fill=\"none\" stroke-miterlimit=\"10\"/>\n\t\t\t\t\t\t\t\t\t<circle class=\"bx-mobilechat-loading-inner-path\" cx=\"50\" cy=\"50\" r=\"20\" fill=\"none\" stroke-miterlimit=\"10\"/>\n\t\t\t\t\t\t\t\t</svg>\n\t\t\t\t\t\t\t\t<h3 class=\"bx-mobilechat-help-title bx-mobilechat-help-title-md bx-mobilechat-loading-msg\">{{localize.MOBILE_CHAT_LOADING}}</h3>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</template>\n\t\t\t\t\t\t<template v-else-if=\"dialogState == 'empty'\">\n\t\t\t\t\t\t\t<div class=\"bx-mobilechat-loading-window\">\n\t\t\t\t\t\t\t\t<h3 class=\"bx-mobilechat-help-title bx-mobilechat-help-title-md bx-mobilechat-loading-msg\">{{localize.MOBILE_CHAT_EMPTY}}</h3>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</template>\n\t\t\t\t\t\t<template v-else>\n\t\t\t\t\t\t\t<div class=\"bx-mobilechat-dialog\">\n\t\t\t\t\t\t\t\t<bx-im-view-dialog\n\t\t\t\t\t\t\t\t\t:userId=\"userId\" \n\t\t\t\t\t\t\t\t\t:dialogId=\"dialogId\"\n\t\t\t\t\t\t\t\t\t:chatId=\"dialogChatId\"\n\t\t\t\t\t\t\t\t\t:messageLimit=\"application.dialog.messageLimit\"\n\t\t\t\t\t\t\t\t\t:messageExtraCount=\"application.dialog.messageExtraCount\"\n\t\t\t\t\t\t\t\t\t:enableReadMessages=\"application.dialog.enableReadMessages\"\n\t\t\t\t\t\t\t\t\t:enableReactions=\"true\"\n\t\t\t\t\t\t\t\t\t:enableDateActions=\"false\"\n\t\t\t\t\t\t\t\t\t:enableCreateContent=\"false\"\n\t\t\t\t\t\t\t\t\t:enableGestureQuote=\"enableGestureQuote\"\n\t\t\t\t\t\t\t\t\t:enableGestureQuoteFromRight=\"enableGestureQuoteFromRight\"\n\t\t\t\t\t\t\t\t\t:enableGestureMenu=\"enableGestureMenu\"\n\t\t\t\t\t\t\t\t\t:showMessageUserName=\"showMessageUserName\"\n\t\t\t\t\t\t\t\t\t:showMessageAvatar=\"showMessageAvatar\"\n\t\t\t\t\t\t\t\t\t:showMessageMenu=\"false\"\n\t\t\t\t\t\t\t\t\t:listenEventScrollToBottom=\"EventType.dialog.scrollToBottom\"\n\t\t\t\t\t\t\t\t\t:listenEventRequestHistory=\"EventType.dialog.requestHistoryResult\"\n\t\t\t\t\t\t\t\t\t:listenEventRequestUnread=\"EventType.dialog.requestUnreadResult\"\n\t\t\t\t\t\t\t\t\t:listenEventSendReadMessages=\"EventType.dialog.sendReadMessages\"\n\t\t\t\t\t\t\t\t\t@readMessage=\"onDialogReadMessage\"\n\t\t\t\t\t\t\t\t\t@quoteMessage=\"onDialogQuoteMessage\"\n\t\t\t\t\t\t\t\t\t@requestHistory=\"onDialogRequestHistory\"\n\t\t\t\t\t\t\t\t\t@requestUnread=\"onDialogRequestUnread\"\n\t\t\t\t\t\t\t\t\t@clickByCommand=\"onDialogMessageClickByCommand\"\n\t\t\t\t\t\t\t\t\t@clickByMention=\"onDialogMessageClickByMention\"\n\t\t\t\t\t\t\t\t\t@clickByUserName=\"onDialogMessageClickByUserName\"\n\t\t\t\t\t\t\t\t\t@clickByMessageMenu=\"onDialogMessageMenuClick\"\n\t\t\t\t\t\t\t\t\t@clickByMessageRetry=\"onDialogMessageRetryClick\"\n\t\t\t\t\t\t\t\t\t@clickByUploadCancel=\"onDialogMessageClickByUploadCancel\"\n\t\t\t\t\t\t\t\t\t@clickByReadedList=\"onDialogReadedListClick\"\n\t\t\t\t\t\t\t\t\t@setMessageReaction=\"onDialogMessageReactionSet\"\n\t\t\t\t\t\t\t\t\t@openMessageReactionList=\"onDialogMessageReactionListOpen\"\n\t\t\t\t\t\t\t\t\t@clickByKeyboardButton=\"onDialogMessageClickByKeyboardButton\"\n\t\t\t\t\t\t\t\t\t@clickByChatTeaser=\"onDialogMessageClickByChatTeaser\"\n\t\t\t\t\t\t\t\t\t@click=\"onDialogClick\"\n\t\t\t\t\t\t\t\t />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<bx-im-view-quote-panel :id=\"quotePanelData.id\" :title=\"quotePanelData.title\" :description=\"quotePanelData.description\" :color=\"quotePanelData.color\" @close=\"onQuotePanelClose\"/>\n\t\t\t\t\t\t</template>\n\t\t\t\t\t</div>\n\t\t\t\t</template>\n\t\t\t</div>\n\t\t</div>\n\t`\n});"],"names":["Vue","component","props","chatId","default","userId","dialogId","enableGestureQuote","enableGestureQuoteFromRight","enableGestureMenu","showMessageUserName","showMessageAvatar","data","dialogState","dialogDiskFolderId","dialogChatId","created","requestData","watch","computed","EventType","localize","Object","assign","getFilteredPhrases","$root","$bitrixMessages","widgetClassName","state","className","showMessageDialog","push","join","quotePanelData","result","id","title","description","color","dialog","quoteId","message","$store","getters","user","authorId","files","params","NAME","name","Utils","text","purify","isDialog","isChatId","isGestureQuoteSupported","isDarkBackground","application","options","darkBackground","messageCollection","length","init","Vuex","mapState","dialogues","collection","messages","methods","console","log","query","RestMethodHandler","mobileBrowserConstGet","RestMethod","imChatGet","dialog_id","imDialogMessagesGetInit","imDialogMessagesGet","limit","$bitrixController","getRequestMessageLimit","convert_text","imUserGet","imUserListGet","restClient","callBatch","response","constGet","error","executeRestAnswer","userGet","userListGet","chatGetResult","disk_folder_id","dialogMessagesGetResult","pullCommandHandler","getStore","dispatch","enableReadMessages","then","getLogTrackingParams","getDialogData","Promise","resolve","reject","getDialogHistory","lastId","callMethod","$emit","requestHistoryResult","count","catch","ex","getDialogUnread","promiseGetDialogUnreadWait","promiseGetDialogUnread","BX","requestUnreadResult","error_description","readMessage","imDialogRead","message_id","imDialogMessagesGetUnread","chat_id","first_id","dialogMessageUnread","firstMessageId","fulfill","logEvent","Logger","info","onDialogRequestHistory","event","onDialogRequestUnread","onDialogMessageClickByUserName","replyToUser","onDialogMessageClickByUploadCancel","cancelUploadFile","file","onDialogMessageClickByCommand","type","insertText","value","addMessage","warn","onDialogMessageClickByMention","openProfile","openDialog","openPhoneMenu","onDialogMessageMenuClick","openMessageMenu","onDialogMessageRetryClick","retrySendMessage","onDialogReadMessage","onDialogReadedListClick","openReadedList","list","onDialogQuoteMessage","quoteMessage","onDialogMessageReactionSet","reactMessage","reaction","onDialogMessageReactionListOpen","openMessageReactionList","values","onDialogMessageClickByKeyboardButton","execMessageKeyboardCommand","onDialogMessageClickByChatTeaser","execMessageOpenChatTeaser","onDialogClick","onQuotePanelClose","quoteMessageClear","template"],"mappings":";;;;CAAA;;;;;;;;AASA,CAUA;;;;AAGAA,WAAG,CAACC,SAAJ,CAAc,wBAAd,EACA;CACCC,EAAAA,KAAK,EACL;CACCC,IAAAA,MAAM,EAAE;CAAEC,MAAAA,OAAO,EAAE;CAAX,KADT;CAECC,IAAAA,MAAM,EAAE;CAAED,MAAAA,OAAO,EAAE;CAAX,KAFT;CAGCE,IAAAA,QAAQ,EAAE;CAAEF,MAA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SF;CA4SCqC,IAAAA,aA5SD,yBA4SerC,KA5Sf,EA6SC,EA7SD;CA+SCsC,IAAAA,iBA/SD,+BAgTC;CACC,WAAKlJ,KAAL,CAAWuD,iBAAX,CAA6B4F,iBAA7B;CACA;CAlTF,GAzHD;CA8aCC,EAAAA,QAAQ;CA9aT,CADA;;;;"}dist/dialog.bundle.map.js000066400000025174147744135340011357 0ustar00{"version":3,"sources":["dialog.bundle.js"],"names":["this","BX","exports","ui_vue","ui_vue_vuex","im_lib_logger","im_const","im_lib_utils","Vue","component","props","chatId","default","userId","dialogId","enableGestureQuote","enableGestureQuoteFromRight","enableGestureMenu","showMessageUserName","showMessageAvatar","data","dialogState","dialogDiskFolderId","dialogChatId","created","requestData","watch","computed","babelHelpers","objectSpread","EventType","localize","Object","assign","getFilteredPhrases","$root","$bitrixMessages","widgetClassName","state","className","showMessageDialog","push","join","quotePanelData","result","id","title","description","color","dialog","quoteId","message","$store","getters","user","authorId","files","params","NAME","name","Utils","text","purify","isDialog","isChatId","isGestureQuoteSupported","isDarkBackground","application","options","darkBackground","messageCollection","length","init","Vuex","mapState","dialogues","collection","messages","methods","_query","_this","console","log","query","defineProperty","RestMethodHandler","mobileBrowserConstGet","RestMethod","imChatGet","dialog_id","imDialogMessagesGetInit","imDialogMessagesGet","limit","$bitrixController","getRequestMessageLimit","convert_text","imUserGet","imUserListGet","restClient","callBatch","response","constGet","error","executeRestAnswer","userGet","userListGet","chatGetResult","disk_folder_id","dialogMessagesGetResult","pullCommandHandler","getStore","dispatch","enableReadMessages","then","getLogTrackingParams","getDialogData","Promise","resolve","reject","getDialogHistory","lastId","_this2","arguments","undefined","callMethod","CHAT_ID","LAST_ID","LIMIT","CONVERT_TEXT","$emit","requestHistoryResult","count","catch","ex","getDialogUnread","_this3","promiseGetDialogUnreadWait","promiseGetDialogUnread","requestUnreadResult","error_description","readMessage","_query2","imDialogRead","message_id","imDialogMessagesGetUnread","chat_id","first_id","dialogMessageUnread","firstMessageId","fulfill","logEvent","_len","Array","_key","Logger","info","apply","concat","onDialogRequestHistory","event","onDialogRequestUnread","onDialogMessageClickByUserName","replyToUser","onDialogMessageClickByUploadCancel","cancelUploadFile","file","onDialogMessageClickByCommand","type","insertText","value","addMessage","warn","onDialogMessageClickByMention","openProfile","openDialog","openPhoneMenu","onDialogMessageMenuClick","openMessageMenu","onDialogMessageRetryClick","retrySendMessage","onDialogReadMessage","onDialogReadedListClick","openReadedList","list","onDialogQuoteMessage","quoteMessage","onDialogMessageReactionSet","reactMessage","reaction","onDialogMessageReactionListOpen","openMessageReactionList","values","onDialogMessageClickByKeyboardButton","execMessageKeyboardCommand","onDialogMessageClickByChatTeaser","execMessageOpenChatTeaser","onDialogClick","onQuotePanelClose","quoteMessageClear","template","Messenger","Lib","Const"],"mappings":"AAAAA,KAAKC,GAAKD,KAAKC,QACd,SAAUC,EAAQC,EAAOC,EAAYC,EAAcC,EAASC,GAC5D,aAcAJ,EAAOK,IAAIC,UAAU,0BACnBC,OACEC,QACEC,QAAS,GAEXC,QACED,QAAS,GAEXE,UACEF,QAAS,GAEXG,oBACEH,QAAS,MAEXI,6BACEJ,QAAS,MAEXK,mBACEL,QAAS,OAEXM,qBACEN,QAAS,MAEXO,mBACEP,QAAS,OAGbQ,KAAM,SAASA,IACb,OACEC,YAAa,UACbC,mBAAoB,EACpBC,aAAc,IAGlBC,QAAS,SAASA,IAChBxB,KAAKyB,eAEPC,OACEZ,SAAU,SAASA,IACjBd,KAAKyB,gBAGTE,SAAUC,aAAaC,cACrBC,UAAW,SAASA,IAClB,OAAOxB,EAASwB,WAElBC,SAAU,SAASA,IACjB,OAAOC,OAAOC,UAAW9B,EAAOK,IAAI0B,mBAAmB,eAAgBlC,KAAKmC,MAAMC,iBAAkBjC,EAAOK,IAAI0B,mBAAmB,YAAalC,KAAKmC,MAAMC,mBAE5JC,gBAAiB,SAASA,EAAgBC,GACxC,IAAIC,GAAa,yBAEjB,GAAIvC,KAAKwC,kBAAmB,CAC1BD,EAAUE,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.component("bx-im-component-dialog",{props:{chatId:{default:0},userId:{default:0},dialogId:{default:0},enableGestureQuote:{default:true},enableGestureQuoteFromRight:{default:true},enableGestureMenu:{default:false},showMessageUserName:{default:true},showMessageAvatar:{default:true}},data:function t(){return{dialogState:"loading",dialogDiskFolderId:0,dialogChatId:0}},created:function t(){this.requestData()},watch:{dialogId:function t(){this.requestData()}},computed:babelHelpers.objectSpread({EventType:function t(){return a.EventType},localize:function t(){return Object.assign({},e.Vue.getFilteredPhrases("MOBILE_CHAT_",this.$root.$bitrixMessages),e.Vue.getFilteredPhrases("IM_UTILS_",this.$root.$bitrixMessages))},widgetClassName:function t(e){var i=["bx-mobilechat-wrapper"];if(this.showMessageDialog){i.push("bx-mobilechat-chat-start")}return i.join(" ")},quotePanelData:function t(){var e={id:0,title:"",description:"",color:""};if(!this.showMessageDialog||!this.dialog.quoteId){return e}var i=this.$store.getters["messages/getMessage"](this.dialog.chatId,this.dialog.quoteId);if(!i){return e}var o=this.$store.getters["users/get"](i.authorId);var a=this.$store.getters["files/getList"](this.dialog.chatId);return{id:this.dialog.quoteId,title:i.params.NAME?i.params.NAME:o?o.name:"",color:o?o.color:"",description:s.Utils.text.purify(i.text,i.params,a,this.localize)}},isDialog:function t(){return s.Utils.dialog.isChatId(this.dialog.dialogId)},isGestureQuoteSupported:function t(){return false},isDarkBackground:function t(){return this.application.options.darkBackground},showMessageDialog:function t(){var e=this.messageCollection&&this.messageCollection.length>0;if(e){this.dialogState="show"}else if(this.dialog&&this.dialog.init){this.dialogState="empty"}else{this.dialogState="loading"}return e}},i.Vuex.mapState({application:function t(e){return e.application},dialog:function t(e){return e.dialogues.collection[e.application.dialog.dialogId]},messageCollection:function t(e){return e.messages.collection[e.application.dialog.chatId]}})),methods:{requestData:function t(){var e,i=this;console.log("4. requestData");var o=(e={},babelHelpers.defineProperty(e,a.RestMethodHandler.mobileBrowserConstGet,[a.RestMethod.mobileBrowserConstGet,{}]),babelHelpers.defineProperty(e,a.RestMethodHandler.imChatGet,[a.RestMethod.imChatGet,{dialog_id:this.dialogId}]),babelHelpers.defineProperty(e,a.RestMethodHandler.imDialogMessagesGetInit,[a.RestMethod.imDialogMessagesGet,{dialog_id:this.dialogId,limit:this.$root.$bitrixController.application.getRequestMessageLimit(),convert_text:"Y"}]),e);if(s.Utils.dialog.isChatId(this.dialogId)){o[a.RestMethodHandler.imUserGet]=[a.RestMethod.imUserGet,{}]}else{o[a.RestMethodHandler.imUserListGet]=[a.RestMethod.imUserListGet,{id:[this.userId,this.dialogId]}]}this.$root.$bitrixController.restClient.callBatch(o,function(t){if(!t){return false}var e=t[a.RestMethodHandler.mobileBrowserConstGet];if(e.error());else{i.$root.$bitrixController.executeRestAnswer(a.RestMethodHandler.mobileBrowserConstGet,e)}var o=t[a.RestMethodHandler.imUserGet];if(o&&!o.error()){i.$root.$bitrixController.executeRestAnswer(a.RestMethodHandler.imUserGet,o)}var s=t[a.RestMethodHandler.imUserListGet];if(s&&!s.error()){i.$root.$bitrixController.executeRestAnswer(a.RestMethodHandler.imUserListGet,s)}var l=t[a.RestMethodHandler.imChatGet];if(!l.error()){i.dialogChatId=l.data().id;i.dialogDiskFolderId=l.data().disk_folder_id}i.$root.$bitrixController.executeRestAnswer(a.RestMethodHandler.imChatGet,l);var r=t[a.RestMethodHandler.imDialogMessagesGetInit];if(r.error());else{if(i.$root.$bitrixController.pullCommandHandler);i.$root.$bitrixController.getStore().dispatch("application/set",{dialog:{enableReadMessages:true}}).then(function(){i.$root.$bitrixController.executeRestAnswer(a.RestMethodHandler.imDialogMessagesGetInit,r)})}},false,false,s.Utils.getLogTrackingParams({name:"im.dialog",dialog:this.$root.$bitrixController.application.getDialogData()}));return new Promise(function(t,e){return t()})},getDialogHistory:function t(e){var i=this;var o=arguments.length>1&&arguments[1]!==undefined?arguments[1]:this.$root.$bitrixController.application.getRequestMessageLimit();this.$root.$bitrixController.restClient.callMethod(a.RestMethod.imDialogMessagesGet,{CHAT_ID:this.dialogChatId,LAST_ID:e,LIMIT:o,CONVERT_TEXT:"Y"}).then(function(t){i.$root.$bitrixController.executeRestAnswer(a.RestMethodHandler.imDialogMessagesGet,t);i.$root.$emit(a.EventType.dialog.requestHistoryResult,{count:t.data().messages.length})}).catch(function(t){i.$root.$emit(a.EventType.dialog.requestHistoryResult,{error:t.error().ex})})},getDialogUnread:function t(e){var i=this;var o=arguments.length>1&&arguments[1]!==undefined?arguments[1]:this.$root.$bitrixController.application.getRequestMessageLimit();if(this.promiseGetDialogUnreadWait){return this.promiseGetDialogUnread}this.promiseGetDialogUnread=new BX.Promise;this.promiseGetDialogUnreadWait=true;if(!e){e=this.$root.$bitrixController.getStore().getters["messages/getLastId"](this.dialogChatId)}if(!e){this.$root.$emit(a.EventType.dialog.requestUnreadResult,{error:{error:"LAST_ID_EMPTY",error_description:"LastId is empty."}});this.promiseGetDialogUnread.reject();this.promiseGetDialogUnreadWait=false;return this.promiseGetDialogUnread}this.$root.$bitrixController.application.readMessage(e,true,true).then(function(){var t;var l=(t={},babelHelpers.defineProperty(t,a.RestMethodHandler.imDialogRead,[a.RestMethod.imDialogRead,{dialog_id:i.dialogId,message_id:e}]),babelHelpers.defineProperty(t,a.RestMethodHandler.imChatGet,[a.RestMethod.imChatGet,{dialog_id:i.dialogId}]),babelHelpers.defineProperty(t,a.RestMethodHandler.imDialogMessagesGetUnread,[a.RestMethod.imDialogMessagesGet,{chat_id:i.dialogChatId,first_id:e,limit:o,convert_text:"Y"}]),t);i.$root.$bitrixController.restClient.callBatch(l,function(t){if(!t){i.$root.$emit(a.EventType.dialog.requestUnreadResult,{error:{error:"EMPTY_RESPONSE",error_description:"Server returned an empty response."}});i.promiseGetDialogUnread.reject();i.promiseGetDialogUnreadWait=false;return false}var e=t[a.RestMethodHandler.imChatGet];if(!e.error()){i.$root.$bitrixController.executeRestAnswer(a.RestMethodHandler.imChatGet,e)}var o=t[a.RestMethodHandler.imDialogMessagesGetUnread];if(o.error()){i.$root.$emit(a.EventType.dialog.requestUnreadResult,{error:o.error().ex})}else{i.$root.$bitrixController.executeRestAnswer(a.RestMethodHandler.imDialogMessagesGetUnread,o);i.$root.$emit(a.EventType.dialog.requestUnreadResult,{firstMessageId:o.data().messages.length>0?o.data().messages[0].id:0,count:o.data().messages.length})}i.promiseGetDialogUnread.fulfill(t);i.promiseGetDialogUnreadWait=false},false,false,s.Utils.getLogTrackingParams({name:a.RestMethodHandler.imDialogMessagesGetUnread,dialog:i.$root.$bitrixController.application.getDialogData()}))});return this.promiseGetDialogUnread},logEvent:function t(e){for(var i=arguments.length,a=new Array(i>1?i-1:0),s=1;s<i;s++){a[s-1]=arguments[s]}o.Logger.info.apply(o.Logger,[e].concat(a))},onDialogRequestHistory:function t(e){this.getDialogHistory(e.lastId)},onDialogRequestUnread:function t(e){this.getDialogUnread(e.lastId)},onDialogMessageClickByUserName:function t(e){this.$root.$bitrixController.application.replyToUser(e.user.id,e.user)},onDialogMessageClickByUploadCancel:function t(e){this.$root.$bitrixController.application.cancelUploadFile(e.file.id)},onDialogMessageClickByCommand:function t(e){if(e.type==="put"){this.$root.$bitrixController.application.insertText({text:e.value+" "})}else if(e.type==="send"){this.$root.$bitrixController.application.addMessage(e.value)}else{o.Logger.warn("Unprocessed command",e)}},onDialogMessageClickByMention:function t(e){if(e.type==="USER"){this.$root.$bitrixController.application.openProfile(e.value)}else if(e.type==="CHAT"){this.$root.$bitrixController.application.openDialog(e.value)}else if(e.type==="CALL"){this.$root.$bitrixController.application.openPhoneMenu(e.value)}},onDialogMessageMenuClick:function t(e){o.Logger.warn("Message menu:",e);this.$root.$bitrixController.application.openMessageMenu(e.message)},onDialogMessageRetryClick:function t(e){o.Logger.warn("Message retry:",e);this.$root.$bitrixController.application.retrySendMessage(e.message)},onDialogReadMessage:function t(e){this.$root.$bitrixController.application.readMessage(e.id)},onDialogReadedListClick:function t(e){this.$root.$bitrixController.application.openReadedList(e.list)},onDialogQuoteMessage:function t(e){this.$root.$bitrixController.application.quoteMessage(e.message.id)},onDialogMessageReactionSet:function t(e){this.$root.$bitrixController.application.reactMessage(e.message.id,e.reaction)},onDialogMessageReactionListOpen:function t(e){this.$root.$bitrixController.application.openMessageReactionList(e.message.id,e.values)},onDialogMessageClickByKeyboardButton:function t(e){this.$root.$bitrixController.application.execMessageKeyboardCommand(e)},onDialogMessageClickByChatTeaser:function t(e){this.$root.$bitrixController.application.execMessageOpenChatTeaser(e)},onDialogClick:function t(e){},onQuotePanelClose:function t(){this.$root.$bitrixController.quoteMessageClear()}},template:'\n\t\t<div :class="widgetClassName">\n\t\t\t<div :class="[\'bx-mobilechat-box\', {\'bx-mobilechat-box-dark-background\': isDarkBackground}]">\n\t\t\t\t<template v-if="application.error.active">\n\t\t\t\t\t<div class="bx-mobilechat-body">\n\t\t\t\t\t\t<div class="bx-mobilechat-warning-window">\n\t\t\t\t\t\t\t<div class="bx-mobilechat-warning-icon"></div>\n\t\t\t\t\t\t\t<template v-if="application.error.description"> \n\t\t\t\t\t\t\t\t<div class="bx-mobilechat-help-title bx-mobilechat-help-title-sm bx-mobilechat-warning-msg" v-html="application.error.description"></div>\n\t\t\t\t\t\t\t</template> \n\t\t\t\t\t\t\t<template v-else>\n\t\t\t\t\t\t\t\t<div class="bx-mobilechat-help-title bx-mobilechat-help-title-md bx-mobilechat-warning-msg">{{localize.MOBILE_CHAT_ERROR_TITLE}}</div>\n\t\t\t\t\t\t\t\t<div class="bx-mobilechat-help-title bx-mobilechat-help-title-sm bx-mobilechat-warning-msg">{{localize.MOBILE_CHAT_ERROR_DESC}}</div>\n\t\t\t\t\t\t\t</template> \n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</template>\t\t\t\n\t\t\t\t<template v-else>\n\t\t\t\t\t<div :class="[\'bx-mobilechat-body\', {\'bx-mobilechat-body-with-message\': dialogState == \'show\'}]" key="with-message">\n\t\t\t\t\t\t<template v-if="dialogState == \'loading\'">\n\t\t\t\t\t\t\t<div class="bx-mobilechat-loading-window">\n\t\t\t\t\t\t\t\t<svg class="bx-mobilechat-loading-circular" viewBox="25 25 50 50">\n\t\t\t\t\t\t\t\t\t<circle class="bx-mobilechat-loading-path" cx="50" cy="50" r="20" fill="none" stroke-miterlimit="10"/>\n\t\t\t\t\t\t\t\t\t<circle class="bx-mobilechat-loading-inner-path" cx="50" cy="50" r="20" fill="none" stroke-miterlimit="10"/>\n\t\t\t\t\t\t\t\t</svg>\n\t\t\t\t\t\t\t\t<h3 class="bx-mobilechat-help-title bx-mobilechat-help-title-md bx-mobilechat-loading-msg">{{localize.MOBILE_CHAT_LOADING}}</h3>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</template>\n\t\t\t\t\t\t<template v-else-if="dialogState == \'empty\'">\n\t\t\t\t\t\t\t<div class="bx-mobilechat-loading-window">\n\t\t\t\t\t\t\t\t<h3 class="bx-mobilechat-help-title bx-mobilechat-help-title-md bx-mobilechat-loading-msg">{{localize.MOBILE_CHAT_EMPTY}}</h3>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</template>\n\t\t\t\t\t\t<template v-else>\n\t\t\t\t\t\t\t<div class="bx-mobilechat-dialog">\n\t\t\t\t\t\t\t\t<bx-im-view-dialog\n\t\t\t\t\t\t\t\t\t:userId="userId" \n\t\t\t\t\t\t\t\t\t:dialogId="dialogId"\n\t\t\t\t\t\t\t\t\t:chatId="dialogChatId"\n\t\t\t\t\t\t\t\t\t:messageLimit="application.dialog.messageLimit"\n\t\t\t\t\t\t\t\t\t:messageExtraCount="application.dialog.messageExtraCount"\n\t\t\t\t\t\t\t\t\t:enableReadMessages="application.dialog.enableReadMessages"\n\t\t\t\t\t\t\t\t\t:enableReactions="true"\n\t\t\t\t\t\t\t\t\t:enableDateActions="false"\n\t\t\t\t\t\t\t\t\t:enableCreateContent="false"\n\t\t\t\t\t\t\t\t\t:enableGestureQuote="enableGestureQuote"\n\t\t\t\t\t\t\t\t\t:enableGestureQuoteFromRight="enableGestureQuoteFromRight"\n\t\t\t\t\t\t\t\t\t:enableGestureMenu="enableGestureMenu"\n\t\t\t\t\t\t\t\t\t:showMessageUserName="showMessageUserName"\n\t\t\t\t\t\t\t\t\t:showMessageAvatar="showMessageAvatar"\n\t\t\t\t\t\t\t\t\t:showMessageMenu="false"\n\t\t\t\t\t\t\t\t\t:listenEventScrollToBottom="EventType.dialog.scrollToBottom"\n\t\t\t\t\t\t\t\t\t:listenEventRequestHistory="EventType.dialog.requestHistoryResult"\n\t\t\t\t\t\t\t\t\t:listenEventRequestUnread="EventType.dialog.requestUnreadResult"\n\t\t\t\t\t\t\t\t\t:listenEventSendReadMessages="EventType.dialog.sendReadMessages"\n\t\t\t\t\t\t\t\t\t@readMessage="onDialogReadMessage"\n\t\t\t\t\t\t\t\t\t@quoteMessage="onDialogQuoteMessage"\n\t\t\t\t\t\t\t\t\t@requestHistory="onDialogRequestHistory"\n\t\t\t\t\t\t\t\t\t@requestUnread="onDialogRequestUnread"\n\t\t\t\t\t\t\t\t\t@clickByCommand="onDialogMessageClickByCommand"\n\t\t\t\t\t\t\t\t\t@clickByMention="onDialogMessageClickByMention"\n\t\t\t\t\t\t\t\t\t@clickByUserName="onDialogMessageClickByUserName"\n\t\t\t\t\t\t\t\t\t@clickByMessageMenu="onDialogMessageMenuClick"\n\t\t\t\t\t\t\t\t\t@clickByMessageRetry="onDialogMessageRetryClick"\n\t\t\t\t\t\t\t\t\t@clickByUploadCancel="onDialogMessageClickByUploadCancel"\n\t\t\t\t\t\t\t\t\t@clickByReadedList="onDialogReadedListClick"\n\t\t\t\t\t\t\t\t\t@setMessageReaction="onDialogMessageReactionSet"\n\t\t\t\t\t\t\t\t\t@openMessageReactionList="onDialogMessageReactionListOpen"\n\t\t\t\t\t\t\t\t\t@clickByKeyboardButton="onDialogMessageClickByKeyboardButton"\n\t\t\t\t\t\t\t\t\t@clickByChatTeaser="onDialogMessageClickByChatTeaser"\n\t\t\t\t\t\t\t\t\t@click="onDialogClick"\n\t\t\t\t\t\t\t\t />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<bx-im-view-quote-panel :id="quotePanelData.id" :title="quotePanelData.title" :description="quotePanelData.description" :color="quotePanelData.color" @close="onQuotePanelClose"/>\n\t\t\t\t\t\t</template>\n\t\t\t\t\t</div>\n\t\t\t\t</template>\n\t\t\t</div>\n\t\t</div>\n\t'})})(this.BX.Messenger=this.BX.Messenger||{},BX,BX,BX.Messenger.Lib,BX.Messenger.Const,BX.Messenger.Lib); //# sourceMappingURL=dialog.bundle.map.jsdist/dialog.bundle.js000066400000051454147744135340010603 0ustar00this.BX = this.BX || {}; (function (exports,ui_vue,ui_vue_vuex,im_lib_logger,im_const,im_lib_utils) { 'use strict'; /** * Bitrix im dialog mobile * Dialog vue component * * @package bitrix * @subpackage mobile * @copyright 2001-2019 Bitrix */ /** * @notice Do not mutate or clone this component! It is under development. */ ui_vue.Vue.component('bx-im-component-dialog', { props: { chatId: { default: 0 }, userId: { default: 0 }, dialogId: { default: 0 }, enableGestureQuote: { default: true }, enableGestureQuoteFromRight: { default: true }, enableGestureMenu: { default: false }, showMessageUserName: { default: true }, showMessageAvatar: { default: true } }, data: function data() { return { dialogState: 'loading', dialogDiskFolderId: 0, dialogChatId: 0 }; }, created: function created() { this.requestData(); }, watch: { dialogId: function dialogId() { this.requestData(); } }, computed: babelHelpers.objectSpread({ EventType: function EventType() { return im_const.EventType; }, localize: function localize() { return Object.assign({}, ui_vue.Vue.getFilteredPhrases('MOBILE_CHAT_', this.$root.$bitrixMessages), ui_vue.Vue.getFilteredPhrases('IM_UTILS_', this.$root.$bitrixMessages)); }, widgetClassName: function widgetClassName(state) { var className = ['bx-mobilechat-wrapper']; if (this.showMessageDialog) { className.push('bx-mobilechat-chat-start'); } return className.join(' '); }, quotePanelData: function quotePanelData() { var result = { id: 0, title: '', description: '', color: '' }; if (!this.showMessageDialog || !this.dialog.quoteId) { return result; } var message = this.$store.getters['messages/getMessage'](this.dialog.chatId, this.dialog.quoteId); if (!message) { return result; } var user = this.$store.getters['users/get'](message.authorId); var files = this.$store.getters['files/getList'](this.dialog.chatId); return { id: this.dialog.quoteId, title: message.params.NAME ? message.params.NAME : user ? user.name : '', color: user ? user.color : '', description: im_lib_utils.Utils.text.purify(message.text, message.params, files, this.localize) }; }, isDialog: function isDialog() { return im_lib_utils.Utils.dialog.isChatId(this.dialog.dialogId); }, isGestureQuoteSupported: function isGestureQuoteSupported() { return false; }, isDarkBackground: function isDarkBackground() { return this.application.options.darkBackground; }, showMessageDialog: function showMessageDialog() { var result = this.messageCollection && this.messageCollection.length > 0; if (result) { this.dialogState = 'show'; } else if (this.dialog && this.dialog.init) { this.dialogState = 'empty'; } else { this.dialogState = 'loading'; } return result; } }, ui_vue_vuex.Vuex.mapState({ application: function application(state) { return state.application; }, dialog: function dialog(state) { return state.dialogues.collection[state.application.dialog.dialogId]; }, messageCollection: function messageCollection(state) { return state.messages.collection[state.application.dialog.chatId]; } })), methods: { requestData: function requestData() { var _query, _this = this; console.log('4. requestData'); //this.requestDataSend = true; var query = (_query = {}, babelHelpers.defineProperty(_query, im_const.RestMethodHandler.mobileBrowserConstGet, [im_const.RestMethod.mobileBrowserConstGet, {}]), babelHelpers.defineProperty(_query, im_const.RestMethodHandler.imChatGet, [im_const.RestMethod.imChatGet, { dialog_id: this.dialogId }]), babelHelpers.defineProperty(_query, im_const.RestMethodHandler.imDialogMessagesGetInit, [im_const.RestMethod.imDialogMessagesGet, { dialog_id: this.dialogId, limit: this.$root.$bitrixController.application.getRequestMessageLimit(), convert_text: 'Y' }]), _query); if (im_lib_utils.Utils.dialog.isChatId(this.dialogId)) { query[im_const.RestMethodHandler.imUserGet] = [im_const.RestMethod.imUserGet, {}]; } else { query[im_const.RestMethodHandler.imUserListGet] = [im_const.RestMethod.imUserListGet, { id: [this.userId, this.dialogId] }]; } this.$root.$bitrixController.restClient.callBatch(query, function (response) { if (!response) { //this.requestDataSend = false; //this.setError('EMPTY_RESPONSE', 'Server returned an empty response.'); return false; } var constGet = response[im_const.RestMethodHandler.mobileBrowserConstGet]; if (constGet.error()) ; else { _this.$root.$bitrixController.executeRestAnswer(im_const.RestMethodHandler.mobileBrowserConstGet, constGet); } var userGet = response[im_const.RestMethodHandler.imUserGet]; if (userGet && !userGet.error()) { _this.$root.$bitrixController.executeRestAnswer(im_const.RestMethodHandler.imUserGet, userGet); } var userListGet = response[im_const.RestMethodHandler.imUserListGet]; if (userListGet && !userListGet.error()) { _this.$root.$bitrixController.executeRestAnswer(im_const.RestMethodHandler.imUserListGet, userListGet); } var chatGetResult = response[im_const.RestMethodHandler.imChatGet]; if (!chatGetResult.error()) { _this.dialogChatId = chatGetResult.data().id; _this.dialogDiskFolderId = chatGetResult.data().disk_folder_id; } // TODO imChatGet _this.$root.$bitrixController.executeRestAnswer(im_const.RestMethodHandler.imChatGet, chatGetResult); var dialogMessagesGetResult = response[im_const.RestMethodHandler.imDialogMessagesGetInit]; if (dialogMessagesGetResult.error()) ; else { //this.timer.stop('data', 'load', true); // this.$root.$bitrixController.getStore().dispatch('dialogues/saveDialog', { // dialogId: this.$root.$bitrixController.application.getDialogId(), // chatId: this.$root.$bitrixController.application.getChatId(), // }); if (_this.$root.$bitrixController.pullCommandHandler) ; _this.$root.$bitrixController.getStore().dispatch('application/set', { dialog: { enableReadMessages: true } }).then(function () { _this.$root.$bitrixController.executeRestAnswer(im_const.RestMethodHandler.imDialogMessagesGetInit, dialogMessagesGetResult); }); //this.processSendMessages(); } //this.requestDataSend = false; }, false, false, im_lib_utils.Utils.getLogTrackingParams({ name: 'im.dialog', dialog: this.$root.$bitrixController.application.getDialogData() })); return new Promise(function (resolve, reject) { return resolve(); }); }, getDialogHistory: function getDialogHistory(lastId) { var _this2 = this; var limit = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.$root.$bitrixController.application.getRequestMessageLimit(); this.$root.$bitrixController.restClient.callMethod(im_const.RestMethod.imDialogMessagesGet, { 'CHAT_ID': this.dialogChatId, 'LAST_ID': lastId, 'LIMIT': limit, 'CONVERT_TEXT': 'Y' }).then(function (result) { _this2.$root.$bitrixController.executeRestAnswer(im_const.RestMethodHandler.imDialogMessagesGet, result); _this2.$root.$emit(im_const.EventType.dialog.requestHistoryResult, { count: result.data().messages.length }); }).catch(function (result) { _this2.$root.$emit(im_const.EventType.dialog.requestHistoryResult, { error: result.error().ex }); }); }, getDialogUnread: function getDialogUnread(lastId) { var _this3 = this; var limit = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.$root.$bitrixController.application.getRequestMessageLimit(); if (this.promiseGetDialogUnreadWait) { return this.promiseGetDialogUnread; } this.promiseGetDialogUnread = new BX.Promise(); this.promiseGetDialogUnreadWait = true; if (!lastId) { lastId = this.$root.$bitrixController.getStore().getters['messages/getLastId'](this.dialogChatId); } if (!lastId) { this.$root.$emit(im_const.EventType.dialog.requestUnreadResult, { error: { error: 'LAST_ID_EMPTY', error_description: 'LastId is empty.' } }); this.promiseGetDialogUnread.reject(); this.promiseGetDialogUnreadWait = false; return this.promiseGetDialogUnread; } this.$root.$bitrixController.application.readMessage(lastId, true, true).then(function () { var _query2; // this.timer.start('data', 'load', .5, () => { // console.warn("ChatDialog.requestData: slow connection show progress icon"); // app.titleAction("setParams", {useProgress: true, useLetterImage: false}); // }); var query = (_query2 = {}, babelHelpers.defineProperty(_query2, im_const.RestMethodHandler.imDialogRead, [im_const.RestMethod.imDialogRead, { dialog_id: _this3.dialogId, message_id: lastId }]), babelHelpers.defineProperty(_query2, im_const.RestMethodHandler.imChatGet, [im_const.RestMethod.imChatGet, { dialog_id: _this3.dialogId }]), babelHelpers.defineProperty(_query2, im_const.RestMethodHandler.imDialogMessagesGetUnread, [im_const.RestMethod.imDialogMessagesGet, { chat_id: _this3.dialogChatId, first_id: lastId, limit: limit, convert_text: 'Y' }]), _query2); _this3.$root.$bitrixController.restClient.callBatch(query, function (response) { if (!response) { _this3.$root.$emit(im_const.EventType.dialog.requestUnreadResult, { error: { error: 'EMPTY_RESPONSE', error_description: 'Server returned an empty response.' } }); _this3.promiseGetDialogUnread.reject(); _this3.promiseGetDialogUnreadWait = false; return false; } var chatGetResult = response[im_const.RestMethodHandler.imChatGet]; if (!chatGetResult.error()) { _this3.$root.$bitrixController.executeRestAnswer(im_const.RestMethodHandler.imChatGet, chatGetResult); } var dialogMessageUnread = response[im_const.RestMethodHandler.imDialogMessagesGetUnread]; if (dialogMessageUnread.error()) { _this3.$root.$emit(im_const.EventType.dialog.requestUnreadResult, { error: dialogMessageUnread.error().ex }); } else { _this3.$root.$bitrixController.executeRestAnswer(im_const.RestMethodHandler.imDialogMessagesGetUnread, dialogMessageUnread); _this3.$root.$emit(im_const.EventType.dialog.requestUnreadResult, { firstMessageId: dialogMessageUnread.data().messages.length > 0 ? dialogMessageUnread.data().messages[0].id : 0, count: dialogMessageUnread.data().messages.length }); //app.titleAction("setParams", {useProgress: false, useLetterImage: true}); //this.timer.stop('data', 'load', true); } _this3.promiseGetDialogUnread.fulfill(response); _this3.promiseGetDialogUnreadWait = false; }, false, false, im_lib_utils.Utils.getLogTrackingParams({ name: im_const.RestMethodHandler.imDialogMessagesGetUnread, dialog: _this3.$root.$bitrixController.application.getDialogData() })); }); return this.promiseGetDialogUnread; }, logEvent: function logEvent(name) { for (var _len = arguments.length, params = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { params[_key - 1] = arguments[_key]; } im_lib_logger.Logger.info.apply(im_lib_logger.Logger, [name].concat(params)); }, onDialogRequestHistory: function onDialogRequestHistory(event) { this.getDialogHistory(event.lastId); }, onDialogRequestUnread: function onDialogRequestUnread(event) { this.getDialogUnread(event.lastId); }, onDialogMessageClickByUserName: function onDialogMessageClickByUserName(event) { this.$root.$bitrixController.application.replyToUser(event.user.id, event.user); }, onDialogMessageClickByUploadCancel: function onDialogMessageClickByUploadCancel(event) { this.$root.$bitrixController.application.cancelUploadFile(event.file.id); }, onDialogMessageClickByCommand: function onDialogMessageClickByCommand(event) { if (event.type === 'put') { this.$root.$bitrixController.application.insertText({ text: event.value + ' ' }); } else if (event.type === 'send') { this.$root.$bitrixController.application.addMessage(event.value); } else { im_lib_logger.Logger.warn('Unprocessed command', event); } }, onDialogMessageClickByMention: function onDialogMessageClickByMention(event) { if (event.type === 'USER') { this.$root.$bitrixController.application.openProfile(event.value); } else if (event.type === 'CHAT') { this.$root.$bitrixController.application.openDialog(event.value); } else if (event.type === 'CALL') { this.$root.$bitrixController.application.openPhoneMenu(event.value); } }, onDialogMessageMenuClick: function onDialogMessageMenuClick(event) { im_lib_logger.Logger.warn('Message menu:', event); this.$root.$bitrixController.application.openMessageMenu(event.message); }, onDialogMessageRetryClick: function onDialogMessageRetryClick(event) { im_lib_logger.Logger.warn('Message retry:', event); this.$root.$bitrixController.application.retrySendMessage(event.message); }, onDialogReadMessage: function onDialogReadMessage(event) { this.$root.$bitrixController.application.readMessage(event.id); }, onDialogReadedListClick: function onDialogReadedListClick(event) { this.$root.$bitrixController.application.openReadedList(event.list); }, onDialogQuoteMessage: function onDialogQuoteMessage(event) { this.$root.$bitrixController.application.quoteMessage(event.message.id); }, onDialogMessageReactionSet: function onDialogMessageReactionSet(event) { this.$root.$bitrixController.application.reactMessage(event.message.id, event.reaction); }, onDialogMessageReactionListOpen: function onDialogMessageReactionListOpen(event) { this.$root.$bitrixController.application.openMessageReactionList(event.message.id, event.values); }, onDialogMessageClickByKeyboardButton: function onDialogMessageClickByKeyboardButton(event) { this.$root.$bitrixController.application.execMessageKeyboardCommand(event); }, onDialogMessageClickByChatTeaser: function onDialogMessageClickByChatTeaser(event) { this.$root.$bitrixController.application.execMessageOpenChatTeaser(event); }, onDialogClick: function onDialogClick(event) {}, onQuotePanelClose: function onQuotePanelClose() { this.$root.$bitrixController.quoteMessageClear(); } }, template: "\n\t\t<div :class=\"widgetClassName\">\n\t\t\t<div :class=\"['bx-mobilechat-box', {'bx-mobilechat-box-dark-background': isDarkBackground}]\">\n\t\t\t\t<template v-if=\"application.error.active\">\n\t\t\t\t\t<div class=\"bx-mobilechat-body\">\n\t\t\t\t\t\t<div class=\"bx-mobilechat-warning-window\">\n\t\t\t\t\t\t\t<div class=\"bx-mobilechat-warning-icon\"></div>\n\t\t\t\t\t\t\t<template v-if=\"application.error.description\"> \n\t\t\t\t\t\t\t\t<div class=\"bx-mobilechat-help-title bx-mobilechat-help-title-sm bx-mobilechat-warning-msg\" v-html=\"application.error.description\"></div>\n\t\t\t\t\t\t\t</template> \n\t\t\t\t\t\t\t<template v-else>\n\t\t\t\t\t\t\t\t<div class=\"bx-mobilechat-help-title bx-mobilechat-help-title-md bx-mobilechat-warning-msg\">{{localize.MOBILE_CHAT_ERROR_TITLE}}</div>\n\t\t\t\t\t\t\t\t<div class=\"bx-mobilechat-help-title bx-mobilechat-help-title-sm bx-mobilechat-warning-msg\">{{localize.MOBILE_CHAT_ERROR_DESC}}</div>\n\t\t\t\t\t\t\t</template> \n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</template>\t\t\t\n\t\t\t\t<template v-else>\n\t\t\t\t\t<div :class=\"['bx-mobilechat-body', {'bx-mobilechat-body-with-message': dialogState == 'show'}]\" key=\"with-message\">\n\t\t\t\t\t\t<template v-if=\"dialogState == 'loading'\">\n\t\t\t\t\t\t\t<div class=\"bx-mobilechat-loading-window\">\n\t\t\t\t\t\t\t\t<svg class=\"bx-mobilechat-loading-circular\" viewBox=\"25 25 50 50\">\n\t\t\t\t\t\t\t\t\t<circle class=\"bx-mobilechat-loading-path\" cx=\"50\" cy=\"50\" r=\"20\" fill=\"none\" stroke-miterlimit=\"10\"/>\n\t\t\t\t\t\t\t\t\t<circle class=\"bx-mobilechat-loading-inner-path\" cx=\"50\" cy=\"50\" r=\"20\" fill=\"none\" stroke-miterlimit=\"10\"/>\n\t\t\t\t\t\t\t\t</svg>\n\t\t\t\t\t\t\t\t<h3 class=\"bx-mobilechat-help-title bx-mobilechat-help-title-md bx-mobilechat-loading-msg\">{{localize.MOBILE_CHAT_LOADING}}</h3>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</template>\n\t\t\t\t\t\t<template v-else-if=\"dialogState == 'empty'\">\n\t\t\t\t\t\t\t<div class=\"bx-mobilechat-loading-window\">\n\t\t\t\t\t\t\t\t<h3 class=\"bx-mobilechat-help-title bx-mobilechat-help-title-md bx-mobilechat-loading-msg\">{{localize.MOBILE_CHAT_EMPTY}}</h3>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</template>\n\t\t\t\t\t\t<template v-else>\n\t\t\t\t\t\t\t<div class=\"bx-mobilechat-dialog\">\n\t\t\t\t\t\t\t\t<bx-im-view-dialog\n\t\t\t\t\t\t\t\t\t:userId=\"userId\" \n\t\t\t\t\t\t\t\t\t:dialogId=\"dialogId\"\n\t\t\t\t\t\t\t\t\t:chatId=\"dialogChatId\"\n\t\t\t\t\t\t\t\t\t:messageLimit=\"application.dialog.messageLimit\"\n\t\t\t\t\t\t\t\t\t:messageExtraCount=\"application.dialog.messageExtraCount\"\n\t\t\t\t\t\t\t\t\t:enableReadMessages=\"application.dialog.enableReadMessages\"\n\t\t\t\t\t\t\t\t\t:enableReactions=\"true\"\n\t\t\t\t\t\t\t\t\t:enableDateActions=\"false\"\n\t\t\t\t\t\t\t\t\t:enableCreateContent=\"false\"\n\t\t\t\t\t\t\t\t\t:enableGestureQuote=\"enableGestureQuote\"\n\t\t\t\t\t\t\t\t\t:enableGestureQuoteFromRight=\"enableGestureQuoteFromRight\"\n\t\t\t\t\t\t\t\t\t:enableGestureMenu=\"enableGestureMenu\"\n\t\t\t\t\t\t\t\t\t:showMessageUserName=\"showMessageUserName\"\n\t\t\t\t\t\t\t\t\t:showMessageAvatar=\"showMessageAvatar\"\n\t\t\t\t\t\t\t\t\t:showMessageMenu=\"false\"\n\t\t\t\t\t\t\t\t\t:listenEventScrollToBottom=\"EventType.dialog.scrollToBottom\"\n\t\t\t\t\t\t\t\t\t:listenEventRequestHistory=\"EventType.dialog.requestHistoryResult\"\n\t\t\t\t\t\t\t\t\t:listenEventRequestUnread=\"EventType.dialog.requestUnreadResult\"\n\t\t\t\t\t\t\t\t\t:listenEventSendReadMessages=\"EventType.dialog.sendReadMessages\"\n\t\t\t\t\t\t\t\t\t@readMessage=\"onDialogReadMessage\"\n\t\t\t\t\t\t\t\t\t@quoteMessage=\"onDialogQuoteMessage\"\n\t\t\t\t\t\t\t\t\t@requestHistory=\"onDialogRequestHistory\"\n\t\t\t\t\t\t\t\t\t@requestUnread=\"onDialogRequestUnread\"\n\t\t\t\t\t\t\t\t\t@clickByCommand=\"onDialogMessageClickByCommand\"\n\t\t\t\t\t\t\t\t\t@clickByMention=\"onDialogMessageClickByMention\"\n\t\t\t\t\t\t\t\t\t@clickByUserName=\"onDialogMessageClickByUserName\"\n\t\t\t\t\t\t\t\t\t@clickByMessageMenu=\"onDialogMessageMenuClick\"\n\t\t\t\t\t\t\t\t\t@clickByMessageRetry=\"onDialogMessageRetryClick\"\n\t\t\t\t\t\t\t\t\t@clickByUploadCancel=\"onDialogMessageClickByUploadCancel\"\n\t\t\t\t\t\t\t\t\t@clickByReadedList=\"onDialogReadedListClick\"\n\t\t\t\t\t\t\t\t\t@setMessageReaction=\"onDialogMessageReactionSet\"\n\t\t\t\t\t\t\t\t\t@openMessageReactionList=\"onDialogMessageReactionListOpen\"\n\t\t\t\t\t\t\t\t\t@clickByKeyboardButton=\"onDialogMessageClickByKeyboardButton\"\n\t\t\t\t\t\t\t\t\t@clickByChatTeaser=\"onDialogMessageClickByChatTeaser\"\n\t\t\t\t\t\t\t\t\t@click=\"onDialogClick\"\n\t\t\t\t\t\t\t\t />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<bx-im-view-quote-panel :id=\"quotePanelData.id\" :title=\"quotePanelData.title\" :description=\"quotePanelData.description\" :color=\"quotePanelData.color\" @close=\"onQuotePanelClose\"/>\n\t\t\t\t\t\t</template>\n\t\t\t\t\t</div>\n\t\t\t\t</template>\n\t\t\t</div>\n\t\t</div>\n\t" }); }((this.BX.Messenger = this.BX.Messenger || {}),BX,BX,BX.Messenger.Lib,BX.Messenger.Const,BX.Messenger.Lib)); //# sourceMappingURL=dialog.bundle.js.map dist/dialog.bundle.min.css000066400000013342147744135340011533 0ustar00.bx-mobilechat-wrapper{display:block;width:100%;height:300px;overflow:hidden}.bx-mobilechat-box{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-ms-flex-wrap:nowrap;flex-wrap:nowrap;height:100%;overflow:hidden;-webkit-overflow-scrolling:touch}.bx-mobilechat-body{position:relative;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-ms-flex-negative:1;flex-shrink:1;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-box-align:center;-ms-flex-align:center;align-items:center;overflow:hidden;-webkit-overflow-scrolling:touch}.bx-mobilechat-body{padding-top:constant(safe-area-inset-top);padding-bottom:constant(safe-area-inset-bottom);padding-top:env(safe-area-inset-top);padding-bottom:env(safe-area-inset-bottom);-webkit-box-sizing:border-box;box-sizing:border-box}.bx-im-quote-panel,.bx-mobilechat-dialog{padding-right:constant(safe-area-inset-right);padding-left:constant(safe-area-inset-left);padding-right:env(safe-area-inset-right);padding-left:env(safe-area-inset-left);-webkit-box-sizing:border-box;box-sizing:border-box}.bx-mobilechat-body .bx-im-dialog{position:relative}.bx-mobilechat-help-container{margin:0 auto}.bx-mobilechat-help-container .bx-mobilechat-help-title-sm{display:none}.bx-mobilechat-help-title{display:block;margin:0 0 29px 0;font:300 26px 'OpenSans-Regular',"Helvetica Neue",Arial,Helvetica,sans-serif;color:#333;text-align:center;opacity:.6;width:100%}.bx-mobilechat-box-dark-background .bx-mobilechat-help-title{color:#949494}.bx-mobilechat-help-title-lg{font:200 26px 'OpenSans-Regular',"Helvetica Neue",Arial,Helvetica,sans-serif;letter-spacing:-.27px}.bx-mobilechat-help-title-md{font:200 24px 'OpenSans-Regular',"Helvetica Neue",Arial,Helvetica,sans-serif;letter-spacing:-.25px}.bx-mobilechat-help-title-sm{font:200 20px/27px 'OpenSans-Regular',"Helvetica Neue",Arial,Helvetica,sans-serif;letter-spacing:-.21px}.bx-mobilechat-help-subtitle{font:14px 'OpenSans-Regular',"Helvetica Neue",Arial,Helvetica,sans-serif}.bx-mobilechat-chat-start .bx-mobilechat-body{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-ms-flex-wrap:nowrap;flex-wrap:nowrap;overflow:hidden;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.bx-mobilechat-chat-start .bx-mobilechat-body-with-message{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end}.bx-mobilechat-dialog{position:relative;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-ms-flex-wrap:nowrap;flex-wrap:nowrap;width:100%;overflow:hidden;-webkit-animation:bx-mobilechat-dialog-opacity .2s ease-in-out;animation:bx-mobilechat-dialog-opacity .2s ease-in-out}.bx-mobilechat-mobile.bx-mobilechat-wrapper{position:fixed;left:0;bottom:0;width:100%;height:100%}.bx-mobilechat-loading-window{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-align:center;-ms-flex-align:center;align-items:center;margin:0 auto}.bx-mobilechat-loading-circular{margin:0 0 53px 0;height:80px;width:80px;-webkit-animation:bx-mobilechat-loading-rotate 2s linear infinite;animation:bx-mobilechat-loading-rotate 2s linear infinite;-webkit-transform-origin:center center;-ms-transform-origin:center center;transform-origin:center center}.bx-mobilechat-loading-inner-path{stroke:rgba(215,220,223,.17);stroke-width:1.5;stroke-dasharray:200,200;stroke-dashoffset:0;stroke-linecap:round}.bx-mobilechat-loading-path{stroke:rgba(215,220,223,.74);stroke-width:1.5;stroke-dasharray:20,200;stroke-dashoffset:0;-webkit-animation:bx-mobilechat-loading-dash 1.5s ease-in-out infinite;animation:bx-mobilechat-loading-dash 1.5s ease-in-out infinite;stroke-linecap:round}.bx-mobilechat-loading-msg{margin:0}.bx-mobilechat-warning-window{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-align:center;-ms-flex-align:center;align-items:center;margin:0 auto;max-width:290px}.bx-mobilechat-warning-icon{display:block;margin:0 0 26px 0;width:53px;height:48px; background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2255%22%20height%3D%2248%22%3E%3Cg%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20transform%3D%22translate%28.805%20.74%29%22%3E%3Cpath%20stroke%3D%22%23A8ADB4%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20stroke-width%3D%221.7%22%20d%3D%22M26.688.27L52.64%2045.685H.737z%22/%3E%3Cpath%20fill%3D%22%23A8ADB4%22%20d%3D%22M25.546%2015.714h2.283v16.625h-2.283z%22/%3E%3Ccircle%20cx%3D%2226.688%22%20cy%3D%2236.771%22%20r%3D%221.478%22%20fill%3D%22%23A8ADB4%22/%3E%3C/g%3E%3C/svg%3E'); background-repeat:no-repeat}.bx-mobilechat-warning-msg{opacity:.9}.bx-mobilechat-warning-msg>a{color:#000}@-webkit-keyframes bx-mobilechat-loading-rotate{100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes bx-mobilechat-loading-rotate{100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@-webkit-keyframes bx-mobilechat-loading-dash{0%{stroke-dasharray:1,200;stroke-dashoffset:0}50%{stroke-dasharray:89,200;stroke-dashoffset:-35px}100%{stroke-dasharray:89,200;stroke-dashoffset:-124px}}@keyframes bx-mobilechat-loading-dash{0%{stroke-dasharray:1,200;stroke-dashoffset:0}50%{stroke-dasharray:89,200;stroke-dashoffset:-35px}100%{stroke-dasharray:89,200;stroke-dashoffset:-124px}}@-webkit-keyframes bx-mobilechat-dialog-opacity{from{opacity:0}to{opacity:1}}@keyframes bx-mobilechat-dialog-opacity{from{opacity:0}to{opacity:1}}dist/dialog.bundle.css000066400000015460147744135340010754 0ustar00/* GENERAL */ .bx-mobilechat-wrapper { display: block; width: 100%; height: 300px; overflow: hidden; } .bx-mobilechat-box { display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-orient: vertical; -webkit-box-direction: normal; -ms-flex-direction: column; flex-direction: column; -ms-flex-wrap: nowrap; flex-wrap: nowrap; height: 100%; overflow: hidden; -webkit-overflow-scrolling: touch; } .bx-mobilechat-body { position: relative; display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-flex: 1; -ms-flex-positive: 1; flex-grow: 1; -ms-flex-negative: 1; flex-shrink: 1; -ms-flex-wrap: wrap; flex-wrap: wrap; -webkit-box-align: center; -ms-flex-align: center; align-items: center; overflow: hidden; -webkit-overflow-scrolling: touch; } .bx-mobilechat-body { padding-top: constant(safe-area-inset-top); padding-bottom: constant(safe-area-inset-bottom); padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); -webkit-box-sizing: border-box; box-sizing: border-box; } .bx-im-quote-panel, .bx-mobilechat-dialog { padding-right: constant(safe-area-inset-right); padding-left: constant(safe-area-inset-left); padding-right: env(safe-area-inset-right); padding-left: env(safe-area-inset-left); -webkit-box-sizing: border-box; box-sizing: border-box; } .bx-mobilechat-body .bx-im-dialog { position: relative; } .bx-mobilechat-help-container { margin: 0 auto; } .bx-mobilechat-help-container .bx-mobilechat-help-title-sm { display: none; } .bx-mobilechat-help-title { display: block; margin: 0 0 29px 0; font: 300 26px 'OpenSans-Regular', "Helvetica Neue", Arial, Helvetica, sans-serif; color: #333; text-align: center; opacity: .6; width: 100%; } .bx-mobilechat-box-dark-background .bx-mobilechat-help-title { color: #949494; } .bx-mobilechat-help-title-lg { font: 200 26px 'OpenSans-Regular', "Helvetica Neue", Arial, Helvetica, sans-serif; letter-spacing: -.27px; } .bx-mobilechat-help-title-md { font: 200 24px 'OpenSans-Regular', "Helvetica Neue", Arial, Helvetica, sans-serif; letter-spacing: -.25px; } .bx-mobilechat-help-title-sm { font: 200 20px/27px 'OpenSans-Regular', "Helvetica Neue", Arial, Helvetica, sans-serif; letter-spacing: -.21px; } .bx-mobilechat-help-subtitle { font: 14px 'OpenSans-Regular', "Helvetica Neue", Arial, Helvetica, sans-serif; } .bx-mobilechat-chat-start .bx-mobilechat-body { -webkit-box-orient: vertical; -webkit-box-direction: normal; -ms-flex-direction: column; flex-direction: column; -ms-flex-wrap: nowrap; flex-wrap: nowrap; overflow: hidden; -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center; } .bx-mobilechat-chat-start .bx-mobilechat-body-with-message { -webkit-box-pack: end; -ms-flex-pack: end; justify-content: flex-end; } .bx-mobilechat-dialog { position: relative; display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-orient: vertical; -webkit-box-direction: normal; -ms-flex-direction: column; flex-direction: column; -ms-flex-wrap: nowrap; flex-wrap: nowrap; width: 100%; overflow: hidden; -webkit-animation: bx-mobilechat-dialog-opacity .2s ease-in-out; animation: bx-mobilechat-dialog-opacity .2s ease-in-out; } /* END OF CHAT */ /* END OF BODY */ /* MEDIAQUERIES */ .bx-mobilechat-mobile.bx-mobilechat-wrapper { position: fixed; left: 0; bottom: 0; width: 100%; height: 100%; } /* END OF MEDIAQUERIES */ /* LOADER */ .bx-mobilechat-loading-window { display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-orient: vertical; -webkit-box-direction: normal; -ms-flex-direction: column; flex-direction: column; -webkit-box-align: center; -ms-flex-align: center; align-items: center; margin: 0 auto; } .bx-mobilechat-loading-circular { margin: 0 0 53px 0; height: 80px; width: 80px; -webkit-animation: bx-mobilechat-loading-rotate 2s linear infinite; animation: bx-mobilechat-loading-rotate 2s linear infinite; -webkit-transform-origin: center center; -ms-transform-origin: center center; transform-origin: center center; } .bx-mobilechat-loading-inner-path { stroke: rgba(215,220,223,.17); stroke-width: 1.5; stroke-dasharray: 200, 200; stroke-dashoffset: 0; stroke-linecap: round; } .bx-mobilechat-loading-path { stroke: rgba(215,220,223,.74); stroke-width: 1.5; stroke-dasharray: 20, 200; stroke-dashoffset: 0; -webkit-animation: bx-mobilechat-loading-dash 1.5s ease-in-out infinite; animation: bx-mobilechat-loading-dash 1.5s ease-in-out infinite; stroke-linecap: round; } .bx-mobilechat-loading-msg { margin: 0; } /* END OF LOADER */ /* WARNING */ .bx-mobilechat-warning-window { display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-orient: vertical; -webkit-box-direction: normal; -ms-flex-direction: column; flex-direction: column; -webkit-box-align: center; -ms-flex-align: center; align-items: center; margin: 0 auto; max-width: 290px; } .bx-mobilechat-warning-icon { display: block; margin: 0 0 26px 0; width: 53px; height: 48px; background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2255%22%20height%3D%2248%22%3E%3Cg%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20transform%3D%22translate%28.805%20.74%29%22%3E%3Cpath%20stroke%3D%22%23A8ADB4%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20stroke-width%3D%221.7%22%20d%3D%22M26.688.27L52.64%2045.685H.737z%22/%3E%3Cpath%20fill%3D%22%23A8ADB4%22%20d%3D%22M25.546%2015.714h2.283v16.625h-2.283z%22/%3E%3Ccircle%20cx%3D%2226.688%22%20cy%3D%2236.771%22%20r%3D%221.478%22%20fill%3D%22%23A8ADB4%22/%3E%3C/g%3E%3C/svg%3E'); background-repeat: no-repeat; } .bx-mobilechat-warning-msg { opacity: .9; } .bx-mobilechat-warning-msg > a { color: #000; } /* END OF WARNING */ @-webkit-keyframes bx-mobilechat-loading-rotate { 100% { -webkit-transform: rotate(360deg); transform: rotate(360deg); } } @keyframes bx-mobilechat-loading-rotate { 100% { -webkit-transform: rotate(360deg); transform: rotate(360deg); } } @-webkit-keyframes bx-mobilechat-loading-dash { 0% { stroke-dasharray: 1, 200; stroke-dashoffset: 0; } 50% { stroke-dasharray: 89, 200; stroke-dashoffset: -35px; } 100% { stroke-dasharray: 89, 200; stroke-dashoffset: -124px; } } @keyframes bx-mobilechat-loading-dash { 0% { stroke-dasharray: 1, 200; stroke-dashoffset: 0; } 50% { stroke-dasharray: 89, 200; stroke-dashoffset: -35px; } 100% { stroke-dasharray: 89, 200; stroke-dashoffset: -124px; } } @-webkit-keyframes bx-mobilechat-dialog-opacity { from { opacity: 0; } to { opacity: 1; } } @keyframes bx-mobilechat-dialog-opacity { from { opacity: 0; } to { opacity: 1; } }lang/ua/config.php000066400000000722147744135340010067 0ustar00<? $MESS["IM_MESSENGER_DIALOG_LOAD_MESSAGES"] = "Завантаження повідомлень"; $MESS["IM_MESSENGER_DIALOG_MESSAGES_READED_CHAT"] = "Переглянуто: #USERS#"; $MESS["IM_MESSENGER_DIALOG_MESSAGES_READED_CHAT_PLURAL"] = "#USER# і [LINK] ще #COUNT#[/LINK]"; $MESS["IM_MESSENGER_DIALOG_MESSAGES_READED_USER"] = "Переглянуто: #DATE#"; $MESS["IM_MESSENGER_DIALOG_WRITES_MESSAGE"] = "#USER# пише повідомлення..."; ?>lang/en/config.php000066400000000623147744135340010064 0ustar00<? $MESS["IM_MESSENGER_DIALOG_LOAD_MESSAGES"] = "Loading messages..."; $MESS["IM_MESSENGER_DIALOG_MESSAGES_READED_CHAT"] = "Viewed by: #USERS#"; $MESS["IM_MESSENGER_DIALOG_MESSAGES_READED_CHAT_PLURAL"] = "#USER# and [LINK]#COUNT# more user(s)[/LINK]"; $MESS["IM_MESSENGER_DIALOG_MESSAGES_READED_USER"] = "Viewed: #DATE#"; $MESS["IM_MESSENGER_DIALOG_WRITES_MESSAGE"] = "#USER# is typing a message..."; ?>lang/ru/config.php000066400000000706147744135340010112 0ustar00<? $MESS["IM_MESSENGER_DIALOG_MESSAGES_READED_USER"] = "Просмотрено: #DATE#"; $MESS["IM_MESSENGER_DIALOG_MESSAGES_READED_CHAT"] = "Просмотрено: #USERS#"; $MESS["IM_MESSENGER_DIALOG_MESSAGES_READED_CHAT_PLURAL"] = "#USER# и [LINK]еще #COUNT#[/LINK]"; $MESS["IM_MESSENGER_DIALOG_WRITES_MESSAGE"] = "#USER# пишет сообщение..."; $MESS["IM_MESSENGER_DIALOG_LOAD_MESSAGES"] = "Загрузка сообщений..."; ?>lang/de/config.php000066400000000647147744135340010060 0ustar00<? $MESS["IM_MESSENGER_DIALOG_LOAD_MESSAGES"] = "Nachrichten werden geladen..."; $MESS["IM_MESSENGER_DIALOG_MESSAGES_READED_CHAT"] = "Angezeigt von: #USERS#"; $MESS["IM_MESSENGER_DIALOG_MESSAGES_READED_CHAT_PLURAL"] = "#USER# und noch [LINK]#COUNT# Nutzer[/LINK]"; $MESS["IM_MESSENGER_DIALOG_MESSAGES_READED_USER"] = "Angezeigt: #DATE#"; $MESS["IM_MESSENGER_DIALOG_WRITES_MESSAGE"] = "#USER# schreibt eine Nachricht..."; ?>
/var/www/axolotl/data/www/arhangelsk.axolotls.ru/a537b/dialog.tar