403Webshell
Server IP : 80.87.202.40  /  Your IP : 216.73.216.169
Web Server : Apache
System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64
User : bitrix ( 600)
PHP Version : 8.2.27
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : ON |  Perl : ON |  Python : OFF |  Sudo : ON |  Pkexec : ON
Directory :  /home/bitrix/ext_www/cvetdv.ru/bitrix/js/im/controller/dist/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /home/bitrix/ext_www/cvetdv.ru/bitrix/js/im/controller/dist/controller.bundle.min.js
this.BX=this.BX||{};(function(e,t,i,s,n,a,r,o,l,u,d,c){"use strict";
/**
	 * Bitrix Messenger
	 * Application controller
	 *
	 * @package bitrix
	 * @subpackage im
	 * @copyright 2001-2020 Bitrix
	 */var h=function(){function e(){babelHelpers.classCallCheck(this,e);this.controller=null;this.timer=new o.Timer;this._prepareFilesBeforeSave=function(e){return e};this.defaultMessageLimit=50;this.requestMessageLimit=this.getDefaultMessageLimit();this.messageLastReadId={};this.messageReadQueue={}}babelHelpers.createClass(e,[{key:"setCoreController",value:function e(t){this.controller=t}},{key:"getSiteId",value:function e(){return this.controller.getStore().state.application.common.siteId}},{key:"getUserId",value:function e(){return this.controller.getStore().state.application.common.userId}},{key:"getLanguageId",value:function e(){return this.controller.getStore().state.application.common.languageId}},{key:"getCurrentUser",value:function e(){return this.controller.getStore().getters["users/get"](this.controller.getStore().state.application.common.userId,true)}},{key:"getChatId",value:function e(){return this.controller.getStore().state.application.dialog.chatId}},{key:"getDialogId",value:function e(){return this.controller.getStore().state.application.dialog.dialogId}},{key:"getData",value:function e(){return this.controller.getStore().state.application}},{key:"getDialogData",value:function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:this.getDialogId();if(this.controller.getStore().state.dialogues.collection[t]){return this.controller.getStore().state.dialogues.collection[t]}return this.controller.getStore().getters["dialogues/getBlank"]()}},{key:"getDialogCrmData",value:function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:this.getDialogId();var i={enabled:false,entityType:l.DialogCrmType.none,entityId:0};var s=this.getDialogData(t);if(s.type===l.DialogType.call){if(s.entityData1&&typeof s.entityData1==="string"){var n=s.entityData1.split("|"),a=babelHelpers.slicedToArray(n,3),r=a[0],o=a[1],u=a[2];if(r){o=o?o.toString().toLowerCase():l.DialogCrmType.none;i={enabled:r,entityType:o,entityId:u}}}}else if(s.type===l.DialogType.crm){var d=s.entityId.split("|"),c=babelHelpers.slicedToArray(d,2),h=c[0],g=c[1];h=h?h.toString().toLowerCase():l.DialogCrmType.none;i={enabled:true,entityType:h,entityId:g}}return i}},{key:"getDialogIdByChatId",value:function e(t){if(this.getDialogId()==="chat"+t){return this.getDialogId()}var i=this.controller.getStore().getters["dialogues/getByChatId"](t);if(!i){return 0}return i.dialogId}},{key:"getDiskFolderId",value:function e(){return this.controller.getStore().state.application.dialog.diskFolderId}},{key:"getDefaultMessageLimit",value:function e(){return this.defaultMessageLimit}},{key:"getRequestMessageLimit",value:function e(){return this.requestMessageLimit}},{key:"muteDialog",value:function e(){var t=this;var i=arguments.length>0&&arguments[0]!==undefined?arguments[0]:null;var s=arguments.length>1&&arguments[1]!==undefined?arguments[1]:this.getDialogId();if(u.Utils.dialog.isEmptyDialogId(s)){return false}if(i===null){i=!this.isDialogMuted()}this.timer.start("muteDialog",s,.3,(function(e){t.controller.restClient.callMethod(l.RestMethod.imChatMute,{DIALOG_ID:s,ACTION:i?"Y":"N"})}));var n=[];if(i){n=this.getDialogData().muteList;n.push(this.getUserId())}else{n=this.getDialogData().muteList.filter((function(e){return e!==t.getUserId()}))}this.controller.getStore().dispatch("dialogues/update",{dialogId:s,fields:{muteList:n}});return true}},{key:"isDialogMuted",value:function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:this.getDialogId();return this.getDialogData().muteList.includes(this.getUserId())}},{key:"isUnreadMessagesLoaded",value:function e(){var t=this.controller.getStore().state.dialogues.collection[this.getDialogId()];if(!t){return true}if(t.lastMessageId<=0){return true}var i=this.controller.getStore().state.messages.collection[this.getChatId()];if(!i||i.length<=0){return true}var s=0;for(var n=i.length-1;n>=0;n--){var a=i[n];if(typeof a.id==="number"){s=a.id;break}}return s>=t.lastMessageId}},{key:"prepareFilesBeforeSave",value:function e(t){return this._prepareFilesBeforeSave(t)}},{key:"setPrepareFilesBeforeSaveFunction",value:function e(t){this._prepareFilesBeforeSave=t.bind(this)}},{key:"showSmiles",value:function e(){this.store.dispatch("application/showSmiles")}},{key:"hideSmiles",value:function e(){this.store.dispatch("application/hideSmiles")}},{key:"startOpponentWriting",value:function e(t){var i=this;var s=t.dialogId,n=t.userId,a=t.userName;this.controller.getStore().dispatch("dialogues/updateWriting",{dialogId:s,userId:n,userName:a,action:true});this.timer.start("writingEnd",s+"|"+n,35,(function(e,t){var s=t.dialogId,n=t.userId;i.controller.getStore().dispatch("dialogues/updateWriting",{dialogId:s,userId:n,action:false})}),{dialogId:s,userId:n});return true}},{key:"stopOpponentWriting",value:function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var i=t.dialogId,s=t.userId,n=t.userName;this.timer.stop("writingStart",i+"|"+s,true);this.timer.stop("writingEnd",i+"|"+s);return true}},{key:"startWriting",value:function e(){var t=this;var i=arguments.length>0&&arguments[0]!==undefined?arguments[0]:this.getDialogId();if(u.Utils.dialog.isEmptyDialogId(i)||this.timer.has("writes",i)){return false}this.timer.start("writes",i,28);this.timer.start("writesSend",i,5,(function(e){t.controller.restClient.callMethod(l.RestMethod.imDialogWriting,{DIALOG_ID:i})["catch"]((function(){t.timer.stop("writes",i)}))}))}},{key:"stopWriting",value:function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:this.getDialogId();this.timer.stop("writes",t,true);this.timer.stop("writesSend",t,true)}},{key:"joinParentChat",value:function e(t,i){var s=this;return new Promise((function(e,n){if(!t||!i){return n()}if(typeof s.tempJoinChat==="undefined"){s.tempJoinChat={}}else if(s.tempJoinChat["wait"]){return n()}s.tempJoinChat["wait"]=true;s.controller.restClient.callMethod(l.RestMethod.imChatParentJoin,{DIALOG_ID:i,MESSAGE_ID:t}).then((function(){s.tempJoinChat["wait"]=false;s.tempJoinChat[i]=true;return e(i)}))["catch"]((function(){s.tempJoinChat["wait"]=false;return n()}))}))}},{key:"setTextareaMessage",value:function e(t){var i=t.message,s=i===void 0?"":i,n=t.dialogId,a=n===void 0?this.getDialogId():n;this.controller.getStore().dispatch("dialogues/update",{dialogId:a,fields:{textareaMessage:s}})}},{key:"setSendingMessageFlag",value:function e(t){this.controller.getStore().dispatch("messages/actionStart",{id:t,chatId:this.getChatId()})}},{key:"reactMessage",value:function e(t){var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:"auto";this.controller.restClient.callMethod(l.RestMethod.imMessageLike,{MESSAGE_ID:t,ACTION:i==="auto"?"auto":i==="set"?"plus":"minus"})}},{key:"readMessage",value:function e(){var t=this;var i=arguments.length>0&&arguments[0]!==undefined?arguments[0]:null;var s=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:false;var a=this.getChatId();if(typeof this.messageLastReadId[a]==="undefined"){this.messageLastReadId[a]=null}if(typeof this.messageReadQueue[a]==="undefined"){this.messageReadQueue[a]=[]}if(i){this.messageReadQueue[a].push(parseInt(i))}this.timer.stop("readMessage",a,true);this.timer.stop("readMessageServer",a,true);if(s){return this.readMessageExecute(a,n)}return new Promise((function(e,i){t.timer.start("readMessage",a,.1,(function(i,s){return t.readMessageExecute(i,n).then((function(t){return e(t)}))}))}))}},{key:"readMessageExecute",value:function e(t){var i=this;var s=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;return new Promise((function(e,n){if(i.messageReadQueue[t]){i.messageReadQueue[t]=i.messageReadQueue[t].filter((function(e){if(!i.messageLastReadId[t]){i.messageLastReadId[t]=e}else if(i.messageLastReadId[t]<e){i.messageLastReadId[t]=e}}))}var a=i.getDialogIdByChatId(t);var r=i.messageLastReadId[t]||0;if(r<=0){e({dialogId:a,lastId:0});return true}i.controller.getStore().dispatch("messages/readMessages",{chatId:t,readId:r}).then((function(n){i.controller.getStore().dispatch("dialogues/decreaseCounter",{dialogId:a,count:n.count});if(i.getChatId()===t&&i.controller.getStore().getters["dialogues/canSaveChat"]){var o=i.controller.getStore().getters["dialogues/get"](a);if(o.counter<=0){i.controller.getStore().commit("application/clearDialogExtraCount")}}if(s){e({dialogId:a,lastId:r})}else{i.timer.start("readMessageServer",t,.5,(function(){i.controller.restClient.callMethod(l.RestMethod.imDialogRead,{DIALOG_ID:a,MESSAGE_ID:r}).then((function(){return e({dialogId:a,lastId:r})}))["catch"]((function(){return e({dialogId:a,lastId:r})}))}))}}))["catch"]((function(){e()}))}))}},{key:"unreadMessage",value:function e(){var t=this;var i=arguments.length>0&&arguments[0]!==undefined?arguments[0]:null;var s=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;var n=this.getChatId();if(typeof this.messageLastReadId[n]==="undefined"){this.messageLastReadId[n]=null}if(typeof this.messageReadQueue[n]==="undefined"){this.messageReadQueue[n]=[]}if(i){this.messageReadQueue[n]=this.messageReadQueue[n].filter((function(e){return e<i}))}this.timer.stop("readMessage",n,true);this.timer.stop("readMessageServer",n,true);this.messageLastReadId[n]=i;this.controller.getStore().dispatch("messages/unreadMessages",{chatId:n,unreadId:this.messageLastReadId[n]}).then((function(e){var a=t.getDialogIdByChatId(n);t.controller.getStore().dispatch("dialogues/update",{dialogId:a,fields:{unreadId:i}});t.controller.getStore().dispatch("dialogues/increaseCounter",{dialogId:a,count:e.count});if(!s){t.controller.restClient.callMethod(l.RestMethod.imDialogUnread,{DIALOG_ID:a,MESSAGE_ID:t.messageLastReadId[n]})}}))["catch"]((function(){}))}},{key:"shareMessage",value:function e(t,i){this.controller.restClient.callMethod(l.RestMethod.imMessageShare,{DIALOG_ID:this.getDialogId(),MESSAGE_ID:t,TYPE:i});return true}},{key:"replyToUser",value:function e(t,i){return true}},{key:"openMessageReactionList",value:function e(t,i){return true}},{key:"emit",value:function e(t){var i;for(var s=arguments.length,n=new Array(s>1?s-1:0),a=1;a<s;a++){n[a-1]=arguments[a]}(i=d.Vue.event).$emit.apply(i,[t].concat(n))}},{key:"listen",value:function e(t,i){d.Vue.event.$on(t,i)}}]);return e}();function g(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,s)}return i}function f(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?g(Object(i),!0).forEach((function(t){babelHelpers.defineProperty(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):g(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var p=function(){function e(){var t=this;var i=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};babelHelpers.classCallCheck(this,e);this.inited=false;this.initPromise=new Promise((function(e,i){t.initPromiseResolver=e}));this.offline=false;this.restAnswerHandler=[];this.vuexAdditionalModel=[];this.store=null;this.storeBuilder=null;this.init().then((function(){return t.prepareParams(i)})).then((function(){return t.initController()})).then((function(){return t.initLocalStorage()})).then((function(){return t.initStorage()})).then((function(){return t.initRestClient()})).then((function(){return t.initPullClient()})).then((function(){return t.initEnvironment()})).then((function(){return t.initComplete()}))["catch"]((function(e){c.Logger.error("error initializing core controller",e)}))}babelHelpers.createClass(e,[{key:"init",value:function e(){return Promise.resolve()}},{key:"prepareParams",value:function e(n){var a=this;if(typeof n.localize!=="undefined"){this.localize=n.localize}else{if(typeof BX!=="undefined"){this.localize=f({},BX.message)}else{this.localize={}}}if(typeof n.host!=="undefined"){this.host=n.host}else{this.host=location.origin}if(typeof n.userId!=="undefined"){var r=parseInt(n.userId);if(!isNaN(r)){this.userId=r}else{this.userId=0}}else{var o=this.getLocalize("USER_ID");this.userId=o?parseInt(o):0}if(typeof n.siteId!=="undefined"){if(typeof n.siteId==="string"&&n.siteId!==""){this.siteId=n.siteId}else{this.siteId="s1"}}else{this.siteId=this.getLocalize("SITE_ID")||"s1"}if(typeof n.siteDir!=="undefined"){if(typeof n.siteDir==="string"&&n.siteDir!==""){this.siteDir=n.siteDir}else{this.siteDir="s1"}}else{this.siteDir=this.getLocalize("SITE_DIR")||"s1"}if(typeof n.languageId!=="undefined"){if(typeof n.languageId==="string"&&n.languageId!==""){this.languageId=n.languageId}else{this.languageId="en"}}else{this.languageId=this.getLocalize("LANGUAGE_ID")||"en"}this.pullInstance=t.PullClient;this.pullClient=t.PULL;if(typeof n.pull!=="undefined"){if(typeof n.pull.instance!=="undefined"){this.pullInstance=n.pull.instance}if(typeof n.pull.client!=="undefined"){this.pullClient=n.pull.client}}this.restInstance=i.RestClient;this.restClient=i.rest;if(typeof n.rest!=="undefined"){if(typeof n.rest.instance!=="undefined"){this.restInstance=n.rest.instance}if(typeof n.rest.client!=="undefined"){this.restClient=n.rest.client}}this.vuexBuilder={database:false,databaseName:"desktop/im",databaseType:s.VuexBuilder.DatabaseType.indexedDb};if(typeof n.vuexBuilder!=="undefined"){if(typeof n.vuexBuilder.database!=="undefined"){this.vuexBuilder.database=n.vuexBuilder.database}if(typeof n.vuexBuilder.databaseName!=="undefined"){this.vuexBuilder.databaseName=n.vuexBuilder.databaseName}if(typeof n.vuexBuilder.databaseType!=="undefined"){this.vuexBuilder.databaseType=n.vuexBuilder.databaseType}if(typeof n.vuexBuilder.models!=="undefined"){n.vuexBuilder.models.forEach((function(e){a.addVuexModel(e)}))}}return Promise.resolve()}},{key:"initController",value:function e(){this.application=new h;this.application.setCoreController(this);return new Promise((function(e,t){return e()}))}},{key:"initLocalStorage",value:function e(){return new Promise((function(e,t){return e()}))}},{key:"initStorage",value:function e(){var t=this;var i={common:{host:this.getHost(),userId:this.getUserId(),siteId:this.getSiteId(),languageId:this.getLanguageId()},dialog:{messageLimit:this.application.getDefaultMessageLimit(),enableReadMessages:true},device:{type:u.Utils.device.isMobile()?l.DeviceType.mobile:l.DeviceType.desktop,orientation:u.Utils.device.getOrientation()}};var a=(new s.VuexBuilder).addModel(n.ApplicationModel.create().useDatabase(false).setVariables(i)).addModel(n.MessagesModel.create().useDatabase(this.vuexBuilder.database).setVariables({host:this.getHost()})).addModel(n.DialoguesModel.create().useDatabase(this.vuexBuilder.database).setVariables({host:this.getHost()})).addModel(n.FilesModel.create().useDatabase(this.vuexBuilder.database).setVariables({host:this.getHost(),default:{name:"File is deleted"}})).addModel(n.UsersModel.create().useDatabase(this.vuexBuilder.database).setVariables({host:this.getHost(),default:{name:"Anonymous"}})).addModel(n.RecentModel.create().useDatabase(false).setVariables({host:this.getHost()})).addModel(n.NotificationsModel.create().useDatabase(false).setVariables({host:this.getHost()}));this.vuexAdditionalModel.forEach((function(e){a.addModel(e)}));a.setDatabaseConfig({name:this.vuexBuilder.databaseName,type:this.vuexBuilder.databaseType,siteId:this.getSiteId(),userId:this.getUserId()});return a.build().then((function(e){t.store=e.store;t.storeBuilder=e.builder;return new Promise((function(e,t){return e()}))}))}},{key:"initRestClient",value:function e(t){this.addRestAnswerHandler(r.CoreRestHandler.create({store:this.store,controller:this}));return new Promise((function(e,t){return e()}))}},{key:"initPullClient",value:function e(){if(!this.pullClient){return false}this.pullClient.subscribe(this.pullBaseHandler=new a.ImBasePullHandler({store:this.store,controller:this}));this.pullClient.subscribe({type:this.pullInstance.SubscriptionType.Status,callback:this.eventStatusInteraction.bind(this)});this.pullClient.subscribe({type:this.pullInstance.SubscriptionType.Online,callback:this.eventOnlineInteraction.bind(this)});return new Promise((function(e,t){return e()}))}},{key:"initEnvironment",value:function e(t){var i=this;window.addEventListener("orientationchange",(function(){if(!i.store){return}i.store.commit("application/set",{device:{orientation:u.Utils.device.getOrientation()}});if(i.store.state.application.device.type===l.DeviceType.mobile&&i.store.state.application.device.orientation===l.DeviceOrientation.horizontal){document.activeElement.blur()}}));return new Promise((function(e,t){return e()}))}},{key:"initComplete",value:function e(){this.inited=true;this.initPromiseResolver(this)}},{key:"eventStatusInteraction",value:function e(t){if(t.status===this.pullInstance.PullStatus.Online){this.offline=false}else if(t.status===this.pullInstance.PullStatus.Offline){this.offline=true}}},{key:"eventOnlineInteraction",value:function e(t){if(t.command==="list"||t.command==="userStatus"){for(var i in t.params.users){if(!t.params.users.hasOwnProperty(i)){continue}this.store.dispatch("users/update",{id:t.params.users[i].id,fields:t.params.users[i]})}}}},{key:"executeRestAnswer",value:function e(t,i,s){c.Logger.warn("Core.controller.executeRestAnswer",t,i,s);this.restAnswerHandler.forEach((function(e){e.execute(t,i,s)}))}},{key:"createVue",value:function e(t){var i=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var s=this;var n=function e(){};if(i.beforeCreate){n=i.beforeCreate}var a=function e(){};if(i.destroyed){a=i.destroyed}var r=function e(){};if(i.created){r=i.created}var o={store:this.store,beforeCreate:function e(){this.$bitrix.Data.set("controller",s);this.$bitrix.Application.set(t);this.$bitrix.Loc.setMessage(s.localize);if(s.restClient){this.$bitrix.RestClient.set(s.restClient)}if(s.pullClient){this.$bitrix.PullClient.set(s.pullClient)}n.bind(this)()},created:function e(){r.bind(this)()},destroyed:function e(){a.bind(this)()}};if(i.el){o.el=i.el}if(i.template){o.template=i.template}if(i.computed){o.computed=i.computed}if(i.data){o.data=i.data}var l=o.created;return new Promise((function(e,t){o.created=function(){l.bind(this)();e(this)};d.BitrixVue.createApp(o)}))}},{key:"getHost",value:function e(){return this.host}},{key:"setHost",value:function e(t){this.host=t;this.store.commit("application/set",{common:{host:t}})}},{key:"getUserId",value:function e(){return this.userId}},{key:"setUserId",value:function e(t){var i=parseInt(t);if(!isNaN(i)){this.userId=i}else{this.userId=0}this.store.commit("application/set",{common:{userId:t}})}},{key:"getSiteId",value:function e(){return this.siteId}},{key:"setSiteId",value:function e(t){if(typeof t==="string"&&t!==""){this.siteId=t}else{this.siteId="s1"}this.store.commit("application/set",{common:{siteId:this.siteId}})}},{key:"getLanguageId",value:function e(){return this.languageId}},{key:"setLanguageId",value:function e(t){if(typeof t==="string"&&t!==""){this.languageId=t}else{this.languageId="en"}this.store.commit("application/set",{common:{languageId:this.languageId}})}},{key:"getStore",value:function e(){return this.store}},{key:"getStoreBuilder",value:function e(){return this.storeBuilder}},{key:"addRestAnswerHandler",value:function e(t){this.restAnswerHandler.push(t)}},{key:"addVuexModel",value:function e(t){this.vuexAdditionalModel.push(t)}},{key:"isOnline",value:function e(){return!this.offline}},{key:"ready",value:function e(){if(this.inited){return Promise.resolve(this)}return this.initPromise}},{key:"setError",value:function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:"";var i=arguments.length>1&&arguments[1]!==undefined?arguments[1]:"";c.Logger.error("Messenger.Application.error: ".concat(t," (").concat(i,")"));var s="";if(t.endsWith("LOCALIZED")){s=i}this.store.commit("application/set",{error:{active:true,code:t,description:s}})}},{key:"clearError",value:function e(){this.store.commit("application/set",{error:{active:false,code:"",description:""}})}},{key:"addLocalize",value:function e(t){if(babelHelpers["typeof"](t)!=="object"||!t){return false}for(var i in t){if(t.hasOwnProperty(i)){this.localize[i]=t[i]}}return true}},{key:"getLocalize",value:function e(t){var i="";if(typeof t==="undefined"){return this.localize}else if(typeof this.localize[t.toString()]==="undefined"){c.Logger.warn("Controller.Core.getLocalize: message with code '".concat(t.toString(),"' is undefined."))}else{i=this.localize[t]}return i}}]);return e}();e.Controller=p})(this.BX.Messenger=this.BX.Messenger||{},BX,BX,BX,BX.Messenger.Model,BX.Messenger.Provider.Pull,BX.Messenger.Provider.Rest,BX.Messenger.Lib,BX.Messenger.Const,BX.Messenger.Lib,BX,BX.Messenger.Lib);
//# sourceMappingURL=controller.bundle.map.js

Youez - 2016 - github.com/yon3zu
LinuXploit